@platforma-sdk/ui-vue 1.13.2 → 1.13.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/CHANGELOG.md +6 -0
- package/dist/lib.js +4896 -4842
- package/dist/lib.umd.cjs +36 -36
- package/dist/src/components/PlAgDataTable/PlTableFilters.vue.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/PlAgDataTable/PlTableFilters.vue +94 -18
package/dist/lib.umd.cjs
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
(function(
|
|
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,Ie,x,rs,im,ld,sm,cd,dd,am,lm,cm,ud,dm){"use strict";var wR=Object.defineProperty;var nm=R=>{throw TypeError(R)};var bR=(R,r,Ie)=>r in R?wR(R,r,{enumerable:!0,configurable:!0,writable:!0,value:Ie}):R[r]=Ie;var Ue=(R,r,Ie)=>bR(R,typeof r!="symbol"?r+"":r,Ie),rd=(R,r,Ie)=>r.has(R)||nm("Cannot "+Ie);var b=(R,r,Ie)=>(rd(R,r,"read from private field"),Ie?Ie.call(R):r.get(R)),ze=(R,r,Ie)=>r.has(R)?nm("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(R):r.set(R,Ie),me=(R,r,Ie,x)=>(rd(R,r,"write to private field"),x?x.call(R,Ie):r.set(R,Ie),Ie),de=(R,r,Ie)=>(rd(R,r,"access private method"),Ie);var Sa=(R,r,Ie,x)=>({set _(rs){me(R,r,rs,Ie)},get _(){return b(R,r,x)}});var wp,So,bp,xp,un,Lt,pn,hn,Eo,To,ct,fn,at,Ke,xe,Tt,Gt,wt,ht,mn,ft,gn,yn,zt,_n,br,Bt,re,od,jr,Un,Fi,Zt,om,qr,Bo,Ri,Rr,Mr,id,Ea,Ta,Je,sd,ns,Ir,ad;function um(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}const pd=Array.isArray;function pm(t){return t!==null&&typeof t=="object"}function hd(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null}function En(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=En(t[n]);return e}else if(pm(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=En(t[n])}),e}else return t}function fd(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],s=e[n];hd(o)&&hd(s)||pd(o)&&pd(s)&&o.length===s.length?fd(o,s):t[n]=s}),t}function Ba(t,e,n=!0){let o=0,s;return function(...l){s=()=>{t.apply(this,l),o=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>o&&s()}}function hm(t){let e=0n,n;return async function(...o){const s=++e;try{await n}catch{}if(e!==s)return{ok:!1};const l=t(...o);return n=l,{ok:!0,value:await l}}}var Uo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var mm=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((o,s)=>{if(e[s]===void 0||typeof e[s]=="symbol")return o;const l=o.length===0?"":",";return`${o}${l}${t(s)}:${t(e[s])}`},"")}}`};const Or=fm(mm);class Aa extends Error{}class Na extends Error{constructor(e){super(e.join(`
|
|
2
2
|
`)),this.errors=e}toString(){return this.errors.join(`
|
|
3
|
-
`)}}function mm(t){return{ok:!0,value:t}}function fd(t){if(!t)throw new Ba;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function md(t){return{value:t,errors:void 0}}function gm(t){if(t.errors)throw new Aa(t.errors);if(!t.value)throw new Ba;return t.value}function ym(t){return t!==void 0}function Na(t,e){return Mr(t)===Mr(e)}const Va=t=>t,Pa=t=>t instanceof Error?t:Error(String(t)),Da=t=>t.name==="ZodError",Fa=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),o=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function Ra(t){const e=t.validate??Va,{autoSave:n}=t,o=r.ref(),s=r.ref(),l=A=>{s.value={model:En(A)}};r.watch(()=>t.get(),A=>l(A),{immediate:!0});const d=()=>{var A;t.onSave(e(En((A=s.value)==null?void 0:A.model)))},u=()=>{l(t.get()),o.value=void 0},p=A=>{const O=Pa(A);Da(O)?o.value=Error(Fa(O)):o.value=O},f=A=>{o.value=void 0;try{e(A),n&&d()}catch(O){p(O)}},m=r.computed({get:()=>{var A;return(A=s.value)==null?void 0:A.model},set(A){l(A),f(A)}});r.watch(s,(A,O)=>{A&&A===O&&f(A.model)},{deep:!0});const y=r.computed(()=>!o.value),E=r.computed(()=>!Na(t.get(),r.unref(s))),S=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:E,error:o,errorString:S,save:d,revert:u,setError:p})}function _m(t,e,n){const o=t.validate??Va,{autoSave:s}=t,l=r.ref(),d=r.ref(),u=z=>{var C;if(n.deepPatchModel){const R=(C=d.value)==null?void 0:C.model,G=Object.assign(En(z),e??{});d.value={model:R?hd(R,G):G,stage:Symbol()}}else d.value={model:Object.assign(En(z),e??{}),stage:Symbol()}};r.watch(()=>t.get(),z=>u(z),{immediate:!0});const p=()=>{var z;t.onSave(o(En((z=d.value)==null?void 0:z.model)))},f=()=>{u(t.get()),l.value=void 0},m=z=>{const C=Pa(z);Da(C)?l.value=Error(Fa(C)):l.value=C},y=z=>{l.value=void 0;try{o(z),s&&p()}catch(C){m(C)}},E=r.computed({get:()=>{var z;return(z=d.value)==null?void 0:z.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:E.value.args,ui:E.value.ui}),()=>{var z;return(z=d.value)==null?void 0:z.stage}],([z,C],[R,G])=>{C===G&&y(z)},{deep:!0});const S=r.computed(()=>!l.value),A=r.computed(()=>{var R;const{args:z,ui:C}=((R=r.unref(d))==null?void 0:R.model)??{};return!Na(t.get(),{args:z,ui:C})}),O=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:E,valid:S,isChanged:A,error:l,errorString:O,save:p,revert:f,setError:m})}const vm=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function Cm(t,e,n){const o=(C,...R)=>{n.debug&&console.log(`%c>>> %c${C}`,"color: orange; font-weight: bold","color: orange",...R)},l=Ta(e.setBlockArgs,100),d=Ta(e.setBlockUiState,100),u=Ta(e.setBlockArgsAndUiState,100),p=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async C=>{C.forEach(R=>{R.key==="args"&&(p.args=Object.freeze(R.value),o("args patch",p.args)),R.key==="ui"&&(p.ui=Object.freeze(R.value),o("ui patch",p.ui)),R.key==="outputs"&&(p.outputs=Object.freeze(R.value),o("outputs patch",p.outputs)),R.key==="navigationState"&&(p.navigationState=Object.freeze(R.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const f=()=>En(p.args),m=()=>En(p.ui),y=()=>En(p.navigationState),E={createArgsModel(C={}){return Ra({get(){return C.transform?C.transform(p.args):p.args},validate:C.validate,autoSave:!0,onSave(R){l(R)}})},createUiModel(C={},R){return Ra({get(){return C.transform?C.transform(p.ui):p.ui??R()},validate:C.validate,autoSave:!0,onSave(G){d(G)}})},useOutputs(...C){const R=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(R,{value:this.unwrapOutputs(...C),errors:void 0})}catch(G){Object.assign(R,{value:void 0,errors:[String(G)]})}},{immediate:!0,deep:!0}),R},unwrapOutputs(...C){const R=p.outputs,G=C.map($=>[$,fd(R[$])]);return Object.fromEntries(G)},getOutputField(C){return p.outputs[C]},getOutputFieldOkOptional(C){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const R=this.getOutputField(C);if(R&&R.ok)return R.value},getOutputFieldErrorsOptional(C){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const R=this.getOutputField(C);if(R&&!R.ok)return R.errors},updateArgs(C){const R=f();return C(R),e.setBlockArgs(R)},updateUiState(C){const R=m();return e.setBlockUiState(C(R))},updateNavigationState(C){const R=y();return C(R),e.setNavigationState(R)},navigateTo(C){const R=y();return R.href=C,e.setNavigationState(R)}},S=r.computed(()=>{const C=Object.entries(p.outputs).map(([R,G])=>[R,G.ok&&G.value!==void 0?G.value:void 0]);return Object.fromEntries(C)}),A=r.computed(()=>{const C=Object.entries(p.outputs).map(([R,G])=>[R,G&&!G.ok?new Aa(G.errors):void 0]);return Object.fromEntries(C)}),O={snapshot:p,queryParams:r.computed(()=>vm(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(C=>!(C!=null&&C.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),S.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),A.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),p.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),p.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),p.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),p.navigationState))},z=_m({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(C){u(C.args,C.ui)}},{outputs:S,outputErrors:A},n);return r.reactive(Object.assign(z,E,O))}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 o(s,l=" | "){return s.map(d=>typeof d=="string"?`'${d}'`:d).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Ie||(Ie={}));var Ma;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Ma||(Ma={}));const ae=Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),nr=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map<"u"&&t instanceof Map?ae.map:typeof Set<"u"&&t instanceof Set?ae.set:typeof Date<"u"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},Q=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"]),wm=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class It extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},s=l=>{for(const 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)o._errors.push(n(d));else{let u=o,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),o}static assert(e){if(!(e instanceof It))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):o.push(e(s));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}It.create=t=>new It(t);const io=(t,e)=>{let n;switch(t.code){case Q.invalid_type:t.received===ae.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ie.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ie.joinValues(t.keys,", ")}`;break;case Q.invalid_union:n="Invalid input";break;case Q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ie.joinValues(t.options)}`;break;case Q.invalid_enum_value:n=`Invalid enum value. Expected ${Ie.joinValues(t.options)}, received '${t.received}'`;break;case Q.invalid_arguments:n="Invalid function arguments";break;case Q.invalid_return_type:n="Invalid function return type";break;case Q.invalid_date:n="Invalid date";break;case Q.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ie.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Q.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Q.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Q.custom:n="Invalid input";break;case Q.invalid_intersection_types:n="Intersection results could not be merged";break;case Q.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Q.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ie.assertNever(t)}return{message:n}};let gd=io;function bm(t){gd=t}function ns(){return gd}const rs=t=>{const{data:e,path:n,errorMaps:o,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=o.filter(f=>!!f).slice().reverse();for(const f of p)u=f(d,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},xm=[];function oe(t,e){const n=ns(),o=rs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===io?void 0:io].filter(s=>!!s)});t.common.issues.push(o)}class _t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const s of n){if(s.status==="aborted")return Ce;s.status==="dirty"&&e.dirty(),o.push(s.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const s of n){const l=await s.key,d=await s.value;o.push({key:l,value:d})}return _t.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};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)&&(o[l.value]=d.value)}return{status:e.value,value:o}}}const Ce=Object.freeze({status:"aborted"}),so=t=>({status:"dirty",value:t}),kt=t=>({status:"valid",value:t}),Ia=t=>t.status==="aborted",Oa=t=>t.status==="dirty",$o=t=>t.status==="valid",Uo=t=>typeof Promise<"u"&&t instanceof Promise;function os(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function yd(t,e,n,o,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var pe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(pe||(pe={}));var Wo,Ho;class Tn{constructor(e,n,o,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const _d=(t,e)=>{if($o(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 It(t.common.issues);return this._error=n,this._error}}};function Se(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:s}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(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??o)!==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 nr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new _t,ctx:{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Uo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const s={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},l=this._parseSync({data:e,path:s.path,parent:s});return _d(s,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},s=this._parse({data:e,path:o.path,parent:o}),l=await(Uo(s)?s:Promise.resolve(s));return _d(o,l)}refine(e,n){const o=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const d=e(s),u=()=>l.addIssue({code:Q.custom,...o(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((o,s)=>e(o)?!0:(s.addIssue(typeof n=="function"?n(o,s):n),!1))}_refinement(e){return new an({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return An.create(this,this._def)}nullable(){return sr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sn.create(this,this._def)}promise(){return uo.create(this,this._def)}or(e){return Yo.create([this,e],this._def)}and(e){return Jo.create(this,e,this._def)}transform(e){return new an({...Se(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ni({...Se(this._def),innerType:this,defaultValue:n,typeName:_e.ZodDefault})}brand(){return new za({typeName:_e.ZodBranded,type:this,...Se(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ri({...Se(this._def),innerType:this,catchValue:n,typeName:_e.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return oi.create(this,e)}readonly(){return ii.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const km=/^c[^\s-]{8,}$/i,Sm=/^[0-9a-z]+$/,Em=/^[0-9A-HJKMNP-TV-Z]{26}$/,Tm=/^[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,Bm=/^[a-z0-9_-]{21}$/i,Am=/^[-+]?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)?)??$/,Nm=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Vm="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let La;const Pm=/^(?:(?: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])$/,Dm=/^(([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})))$/,Fm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vd="((\\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])))",Rm=new RegExp(`^${vd}$`);function Cd(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 Mm(t){return new RegExp(`^${Cd(t)}$`)}function wd(t){let e=`${vd}T${Cd(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 Im(t,e){return!!((e==="v4"||!e)&&Pm.test(t)||(e==="v6"||!e)&&Dm.test(t))}class on extends Be{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){const l=this._getOrReturnCtx(e);return oe(l,{code:Q.invalid_type,expected:ae.string,received:l.parsedType}),Ce}const o=new _t;let s;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(s=this._getOrReturnCtx(e,s),oe(s,{code:Q.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="max")e.data.length>l.value&&(s=this._getOrReturnCtx(e,s),oe(s,{code:Q.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.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?oe(s,{code:Q.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):u&&oe(s,{code:Q.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")Nm.test(e.data)||(s=this._getOrReturnCtx(e,s),oe(s,{validation:"email",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")La||(La=new RegExp(Vm,"u")),La.test(e.data)||(s=this._getOrReturnCtx(e,s),oe(s,{validation:"emoji",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")Tm.test(e.data)||(s=this._getOrReturnCtx(e,s),oe(s,{validation:"uuid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")Bm.test(e.data)||(s=this._getOrReturnCtx(e,s),oe(s,{validation:"nanoid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")km.test(e.data)||(s=this._getOrReturnCtx(e,s),oe(s,{validation:"cuid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")Sm.test(e.data)||(s=this._getOrReturnCtx(e,s),oe(s,{validation:"cuid2",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")Em.test(e.data)||(s=this._getOrReturnCtx(e,s),oe(s,{validation:"ulid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),oe(s,{validation:"url",code:Q.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),oe(s,{validation:"regex",code:Q.invalid_string,message:l.message}),o.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(e,s),oe(s,{code:Q.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(s=this._getOrReturnCtx(e,s),oe(s,{code:Q.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(s=this._getOrReturnCtx(e,s),oe(s,{code:Q.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?wd(l).test(e.data)||(s=this._getOrReturnCtx(e,s),oe(s,{code:Q.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?Rm.test(e.data)||(s=this._getOrReturnCtx(e,s),oe(s,{code:Q.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?Mm(l).test(e.data)||(s=this._getOrReturnCtx(e,s),oe(s,{code:Q.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?Am.test(e.data)||(s=this._getOrReturnCtx(e,s),oe(s,{validation:"duration",code:Q.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?Im(e.data,l.version)||(s=this._getOrReturnCtx(e,s),oe(s,{validation:"ip",code:Q.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?Fm.test(e.data)||(s=this._getOrReturnCtx(e,s),oe(s,{validation:"base64",code:Q.invalid_string,message:l.message}),o.dirty()):Ie.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(s=>e.test(s),{validation:n,code:Q.invalid_string,...pe.errToObj(o)})}_addCheck(e){return new on({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...pe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...pe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...pe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...pe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...pe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...pe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...pe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...pe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...pe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...pe.errToObj(e)})}datetime(e){var n,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...pe.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...pe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...pe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...pe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...pe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...pe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...pe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...pe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...pe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...pe.errToObj(n)})}nonempty(e){return this.min(1,pe.errToObj(e))}trim(){return new on({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new on({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new on({...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}}on.create=t=>{var e;return new on({checks:[],typeName:_e.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};function Om(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,s=n>o?n:o,l=parseInt(t.toFixed(s).replace(".","")),d=parseInt(e.toFixed(s).replace(".",""));return l%d/Math.pow(10,s)}class rr 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)!==ae.number){const l=this._getOrReturnCtx(e);return oe(l,{code:Q.invalid_type,expected:ae.number,received:l.parsedType}),Ce}let o;const s=new _t;for(const l of this._def.checks)l.kind==="int"?Ie.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{code:Q.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),oe(o,{code:Q.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),oe(o,{code:Q.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?Om(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),oe(o,{code:Q.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{code:Q.not_finite,message:l.message}),s.dirty()):Ie.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,o,s){return new rr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:pe.toString(s)}]})}_addCheck(e){return new rr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:pe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:pe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ie.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}rr.create=t=>new rr({checks:[],typeName:_e.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class or 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)!==ae.bigint){const l=this._getOrReturnCtx(e);return oe(l,{code:Q.invalid_type,expected:ae.bigint,received:l.parsedType}),Ce}let o;const s=new _t;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),oe(o,{code:Q.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),oe(o,{code:Q.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),oe(o,{code:Q.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Ie.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,o,s){return new or({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:pe.toString(s)}]})}_addCheck(e){return new or({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}or.create=t=>{var e;return new or({checks:[],typeName:_e.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};class jo extends Be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){const o=this._getOrReturnCtx(e);return oe(o,{code:Q.invalid_type,expected:ae.boolean,received:o.parsedType}),Ce}return kt(e.data)}}jo.create=t=>new jo({typeName:_e.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Ir extends Be{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){const l=this._getOrReturnCtx(e);return oe(l,{code:Q.invalid_type,expected:ae.date,received:l.parsedType}),Ce}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return oe(l,{code:Q.invalid_date}),Ce}const o=new _t;let s;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(s=this._getOrReturnCtx(e,s),oe(s,{code:Q.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(s=this._getOrReturnCtx(e,s),oe(s,{code:Q.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Ie.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ir({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:pe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:pe.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Ir.create=t=>new Ir({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_e.ZodDate,...Se(t)});class is extends Be{_parse(e){if(this._getType(e)!==ae.symbol){const o=this._getOrReturnCtx(e);return oe(o,{code:Q.invalid_type,expected:ae.symbol,received:o.parsedType}),Ce}return kt(e.data)}}is.create=t=>new is({typeName:_e.ZodSymbol,...Se(t)});class qo extends Be{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return oe(o,{code:Q.invalid_type,expected:ae.undefined,received:o.parsedType}),Ce}return kt(e.data)}}qo.create=t=>new qo({typeName:_e.ZodUndefined,...Se(t)});class Ko extends Be{_parse(e){if(this._getType(e)!==ae.null){const o=this._getOrReturnCtx(e);return oe(o,{code:Q.invalid_type,expected:ae.null,received:o.parsedType}),Ce}return kt(e.data)}}Ko.create=t=>new Ko({typeName:_e.ZodNull,...Se(t)});class ao extends Be{constructor(){super(...arguments),this._any=!0}_parse(e){return kt(e.data)}}ao.create=t=>new ao({typeName:_e.ZodAny,...Se(t)});class Or extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return kt(e.data)}}Or.create=t=>new Or({typeName:_e.ZodUnknown,...Se(t)});class Ln extends Be{_parse(e){const n=this._getOrReturnCtx(e);return oe(n,{code:Q.invalid_type,expected:ae.never,received:n.parsedType}),Ce}}Ln.create=t=>new Ln({typeName:_e.ZodNever,...Se(t)});class ss extends Be{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return oe(o,{code:Q.invalid_type,expected:ae.void,received:o.parsedType}),Ce}return kt(e.data)}}ss.create=t=>new ss({typeName:_e.ZodVoid,...Se(t)});class sn extends Be{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),s=this._def;if(n.parsedType!==ae.array)return oe(n,{code:Q.invalid_type,expected:ae.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)&&(oe(n,{code:d?Q.too_big:Q.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}),o.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(oe(n,{code:Q.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),o.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(oe(n,{code:Q.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((d,u)=>s.type._parseAsync(new Tn(n,d,n.path,u)))).then(d=>_t.mergeArray(o,d));const l=[...n.data].map((d,u)=>s.type._parseSync(new Tn(n,d,n.path,u)));return _t.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new sn({...this._def,minLength:{value:e,message:pe.toString(n)}})}max(e,n){return new sn({...this._def,maxLength:{value:e,message:pe.toString(n)}})}length(e,n){return new sn({...this._def,exactLength:{value:e,message:pe.toString(n)}})}nonempty(e){return this.min(1,e)}}sn.create=(t,e)=>new sn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Se(e)});function lo(t){if(t instanceof Qe){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=An.create(lo(o))}return new Qe({...t._def,shape:()=>e})}else return t instanceof sn?new sn({...t._def,type:lo(t.element)}):t instanceof An?An.create(lo(t.unwrap())):t instanceof sr?sr.create(lo(t.unwrap())):t instanceof Bn?Bn.create(t.items.map(e=>lo(e))):t}class Qe extends Be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ie.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ae.object){const f=this._getOrReturnCtx(e);return oe(f,{code:Q.invalid_type,expected:ae.object,received:f.parsedType}),Ce}const{status:o,ctx:s}=this._processInputParams(e),{shape:l,keys:d}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ln&&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],y=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new Tn(s,y,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Ln){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)p.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(f==="strict")u.length>0&&(oe(s,{code:Q.unrecognized_keys,keys:u}),o.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const y=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new Tn(s,y,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of p){const y=await m.key,E=await m.value;f.push({key:y,value:E,alwaysSet:m.alwaysSet})}return f}).then(f=>_t.mergeObjectSync(o,f)):_t.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return pe.errToObj,new Qe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var s,l,d,u;const p=(d=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,o).message)!==null&&d!==void 0?d:o.defaultError;return n.code==="unrecognized_keys"?{message:(u=pe.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Qe({...this._def,unknownKeys:"strip"})}passthrough(){return new Qe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Qe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Qe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_e.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Qe({...this._def,catchall:e})}pick(e){const n={};return Ie.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new Qe({...this._def,shape:()=>n})}omit(e){const n={};return Ie.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new Qe({...this._def,shape:()=>n})}deepPartial(){return lo(this)}partial(e){const n={};return Ie.objectKeys(this.shape).forEach(o=>{const s=this.shape[o];e&&!e[o]?n[o]=s:n[o]=s.optional()}),new Qe({...this._def,shape:()=>n})}required(e){const n={};return Ie.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof An;)l=l._def.innerType;n[o]=l}}),new Qe({...this._def,shape:()=>n})}keyof(){return bd(Ie.objectKeys(this.shape))}}Qe.create=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strip",catchall:Ln.create(),typeName:_e.ZodObject,...Se(e)}),Qe.strictCreate=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strict",catchall:Ln.create(),typeName:_e.ZodObject,...Se(e)}),Qe.lazycreate=(t,e)=>new Qe({shape:t,unknownKeys:"strip",catchall:Ln.create(),typeName:_e.ZodObject,...Se(e)});class Yo extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const d=l.map(u=>new It(u.ctx.common.issues));return oe(n,{code:Q.invalid_union,unionErrors:d}),Ce}if(n.common.async)return Promise.all(o.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 o){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&d.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=d.map(p=>new It(p));return oe(n,{code:Q.invalid_union,unionErrors:u}),Ce}}get options(){return this._def.options}}Yo.create=(t,e)=>new Yo({options:t,typeName:_e.ZodUnion,...Se(e)});const Gn=t=>t instanceof Qo?Gn(t.schema):t instanceof an?Gn(t.innerType()):t instanceof ei?[t.value]:t instanceof ir?t.options:t instanceof ti?Ie.objectValues(t.enum):t instanceof ni?Gn(t._def.innerType):t instanceof qo?[void 0]:t instanceof Ko?[null]:t instanceof An?[void 0,...Gn(t.unwrap())]:t instanceof sr?[null,...Gn(t.unwrap())]:t instanceof za||t instanceof ii?Gn(t.unwrap()):t instanceof ri?Gn(t._def.innerType):[];class as extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return oe(n,{code:Q.invalid_type,expected:ae.object,received:n.parsedType}),Ce;const o=this.discriminator,s=n.data[o],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(oe(n,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const s=new Map;for(const l of n){const d=Gn(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 as({typeName:_e.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Se(o)})}}function Ga(t,e){const n=nr(t),o=nr(e);if(t===e)return{valid:!0,data:t};if(n===ae.object&&o===ae.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=Ga(t[u],e[u]);if(!p.valid)return{valid:!1};d[u]=p.data}return{valid:!0,data:d}}else if(n===ae.array&&o===ae.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=Ga(d,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===ae.date&&o===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Jo extends Be{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=(l,d)=>{if(Ia(l)||Ia(d))return Ce;const u=Ga(l.value,d.value);return u.valid?((Oa(l)||Oa(d))&&n.dirty(),{status:n.value,value:u.data}):(oe(o,{code:Q.invalid_intersection_types}),Ce)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,d])=>s(l,d)):s(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Jo.create=(t,e,n)=>new Jo({left:t,right:e,typeName:_e.ZodIntersection,...Se(n)});class Bn extends Be{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.array)return oe(o,{code:Q.invalid_type,expected:ae.array,received:o.parsedType}),Ce;if(o.data.length<this._def.items.length)return oe(o,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&o.data.length>this._def.items.length&&(oe(o,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((d,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new Tn(o,d,o.path,u)):null}).filter(d=>!!d);return o.common.async?Promise.all(l).then(d=>_t.mergeArray(n,d)):_t.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Bn({...this._def,rest:e})}}Bn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bn({items:t,typeName:_e.ZodTuple,rest:null,...Se(e)})};class Xo extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.object)return oe(o,{code:Q.invalid_type,expected:ae.object,received:o.parsedType}),Ce;const s=[],l=this._def.keyType,d=this._def.valueType;for(const u in o.data)s.push({key:l._parse(new Tn(o,u,o.path,u)),value:d._parse(new Tn(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?_t.mergeObjectAsync(n,s):_t.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Be?new Xo({keyType:e,valueType:n,typeName:_e.ZodRecord,...Se(o)}):new Xo({keyType:on.create(),valueType:e,typeName:_e.ZodRecord,...Se(n)})}}class ls extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.map)return oe(o,{code:Q.invalid_type,expected:ae.map,received:o.parsedType}),Ce;const s=this._def.keyType,l=this._def.valueType,d=[...o.data.entries()].map(([u,p],f)=>({key:s._parse(new Tn(o,u,o.path,[f,"key"])),value:l._parse(new Tn(o,p,o.path,[f,"value"]))}));if(o.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}}}}ls.create=(t,e,n)=>new ls({valueType:e,keyType:t,typeName:_e.ZodMap,...Se(n)});class Lr extends Be{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.set)return oe(o,{code:Q.invalid_type,expected:ae.set,received:o.parsedType}),Ce;const s=this._def;s.minSize!==null&&o.data.size<s.minSize.value&&(oe(o,{code:Q.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&o.data.size>s.maxSize.value&&(oe(o,{code:Q.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function 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=[...o.data.values()].map((p,f)=>l._parse(new Tn(o,p,o.path,f)));return o.common.async?Promise.all(u).then(p=>d(p)):d(u)}min(e,n){return new Lr({...this._def,minSize:{value:e,message:pe.toString(n)}})}max(e,n){return new Lr({...this._def,maxSize:{value:e,message:pe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Lr.create=(t,e)=>new Lr({valueType:t,minSize:null,maxSize:null,typeName:_e.ZodSet,...Se(e)});class co extends Be{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.function)return oe(n,{code:Q.invalid_type,expected:ae.function,received:n.parsedType}),Ce;function o(u,p){return rs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ns(),io].filter(f=>!!f),issueData:{code:Q.invalid_arguments,argumentsError:p}})}function s(u,p){return rs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ns(),io].filter(f=>!!f),issueData:{code:Q.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},d=n.data;if(this._def.returns instanceof uo){const u=this;return kt(async function(...p){const f=new It([]),m=await u._def.args.parseAsync(p,l).catch(S=>{throw f.addIssue(o(p,S)),f}),y=await Reflect.apply(d,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(S=>{throw f.addIssue(s(y,S)),f})})}else{const u=this;return kt(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new It([o(p,f.error)]);const m=Reflect.apply(d,this,f.data),y=u._def.returns.safeParse(m,l);if(!y.success)throw new It([s(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new co({...this._def,args:Bn.create(e).rest(Or.create())})}returns(e){return new co({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new co({args:e||Bn.create([]).rest(Or.create()),returns:n||Or.create(),typeName:_e.ZodFunction,...Se(o)})}}class Qo extends Be{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Qo.create=(t,e)=>new Qo({getter:t,typeName:_e.ZodLazy,...Se(e)});class ei extends Be{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return oe(n,{received:n.data,code:Q.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:e.data}}get value(){return this._def.value}}ei.create=(t,e)=>new ei({value:t,typeName:_e.ZodLiteral,...Se(e)});function bd(t,e){return new ir({values:t,typeName:_e.ZodEnum,...Se(e)})}class ir extends Be{constructor(){super(...arguments),Wo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return oe(n,{expected:Ie.joinValues(o),received:n.parsedType,code:Q.invalid_type}),Ce}if(os(this,Wo)||yd(this,Wo,new Set(this._def.values)),!os(this,Wo).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return oe(n,{received:n.data,code:Q.invalid_enum_value,options:o}),Ce}return kt(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 ir.create(e,{...this._def,...n})}exclude(e,n=this._def){return ir.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}Wo=new WeakMap,ir.create=bd;class ti extends Be{constructor(){super(...arguments),Ho.set(this,void 0)}_parse(e){const n=Ie.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ae.string&&o.parsedType!==ae.number){const s=Ie.objectValues(n);return oe(o,{expected:Ie.joinValues(s),received:o.parsedType,code:Q.invalid_type}),Ce}if(os(this,Ho)||yd(this,Ho,new Set(Ie.getValidEnumValues(this._def.values))),!os(this,Ho).has(e.data)){const s=Ie.objectValues(n);return oe(o,{received:o.data,code:Q.invalid_enum_value,options:s}),Ce}return kt(e.data)}get enum(){return this._def.values}}Ho=new WeakMap,ti.create=(t,e)=>new ti({values:t,typeName:_e.ZodNativeEnum,...Se(e)});class uo extends Be{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.promise&&n.common.async===!1)return oe(n,{code:Q.invalid_type,expected:ae.promise,received:n.parsedType}),Ce;const o=n.parsedType===ae.promise?n.data:Promise.resolve(n.data);return kt(o.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}uo.create=(t,e)=>new uo({type:t,typeName:_e.ZodPromise,...Se(e)});class an extends Be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:d=>{oe(o,d),d.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const d=s.transform(o.data,l);if(o.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:o.path,parent:o});return p.status==="aborted"?Ce:p.status==="dirty"||n.value==="dirty"?so(p.value):p});{if(n.value==="aborted")return Ce;const u=this._def.schema._parseSync({data:d,path:o.path,parent:o});return u.status==="aborted"?Ce:u.status==="dirty"||n.value==="dirty"?so(u.value):u}}if(s.type==="refinement"){const d=u=>{const p=s.refinement(u,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),d(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),d(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!$o(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:o.data,path:o.path,parent:o}).then(d=>$o(d)?Promise.resolve(s.transform(d.value,l)).then(u=>({status:n.value,value:u})):d);Ie.assertNever(s)}}an.create=(t,e,n)=>new an({schema:t,typeName:_e.ZodEffects,effect:e,...Se(n)}),an.createWithPreprocess=(t,e,n)=>new an({schema:e,effect:{type:"preprocess",transform:t},typeName:_e.ZodEffects,...Se(n)});class An extends Be{_parse(e){return this._getType(e)===ae.undefined?kt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}An.create=(t,e)=>new An({innerType:t,typeName:_e.ZodOptional,...Se(e)});class sr extends Be{_parse(e){return this._getType(e)===ae.null?kt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}sr.create=(t,e)=>new sr({innerType:t,typeName:_e.ZodNullable,...Se(e)});class ni extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===ae.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ni.create=(t,e)=>new ni({innerType:t,typeName:_e.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Se(e)});class ri extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Uo(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new It(o.common.issues)},input:o.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new It(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}ri.create=(t,e)=>new ri({innerType:t,typeName:_e.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Se(e)});class cs extends Be{_parse(e){if(this._getType(e)!==ae.nan){const o=this._getOrReturnCtx(e);return oe(o,{code:Q.invalid_type,expected:ae.nan,received:o.parsedType}),Ce}return{status:"valid",value:e.data}}}cs.create=t=>new cs({typeName:_e.ZodNaN,...Se(t)});const Lm=Symbol("zod_brand");class za extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class oi extends Be{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return l.status==="aborted"?Ce:l.status==="dirty"?(n.dirty(),so(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const s=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:o.path,parent:o})}}static create(e,n){return new oi({in:e,out:n,typeName:_e.ZodPipeline})}}class ii extends Be{_parse(e){const n=this._def.innerType._parse(e),o=s=>($o(s)&&(s.value=Object.freeze(s.value)),s);return Uo(n)?n.then(s=>o(s)):o(n)}unwrap(){return this._def.innerType}}ii.create=(t,e)=>new ii({innerType:t,typeName:_e.ZodReadonly,...Se(e)});function xd(t,e={},n){return t?ao.create().superRefine((o,s)=>{var l,d;if(!t(o)){const u=typeof e=="function"?e(o):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})}}):ao.create()}const Gm={object:Qe.lazycreate};var _e;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_e||(_e={}));const zm=(t,e={message:`Input not instance of ${t.name}`})=>xd(n=>n instanceof t,e),kd=on.create,Sd=rr.create,Zm=cs.create,$m=or.create,Ed=jo.create,Um=Ir.create,Wm=is.create,Hm=qo.create,jm=Ko.create,qm=ao.create,Km=Or.create,Ym=Ln.create,Jm=ss.create,Xm=sn.create,Qm=Qe.create,eg=Qe.strictCreate,tg=Yo.create,ng=as.create,rg=Jo.create,og=Bn.create,ig=Xo.create,sg=ls.create,ag=Lr.create,lg=co.create,cg=Qo.create,dg=ei.create,ug=ir.create,pg=ti.create,hg=uo.create,Td=an.create,fg=An.create,mg=sr.create,gg=an.createWithPreprocess,yg=oi.create;var Nn=Object.freeze({__proto__:null,defaultErrorMap:io,setErrorMap:bm,getErrorMap:ns,makeIssue:rs,EMPTY_PATH:xm,addIssueToContext:oe,ParseStatus:_t,INVALID:Ce,DIRTY:so,OK:kt,isAborted:Ia,isDirty:Oa,isValid:$o,isAsync:Uo,get util(){return Ie},get objectUtil(){return Ma},ZodParsedType:ae,getParsedType:nr,ZodType:Be,datetimeRegex:wd,ZodString:on,ZodNumber:rr,ZodBigInt:or,ZodBoolean:jo,ZodDate:Ir,ZodSymbol:is,ZodUndefined:qo,ZodNull:Ko,ZodAny:ao,ZodUnknown:Or,ZodNever:Ln,ZodVoid:ss,ZodArray:sn,ZodObject:Qe,ZodUnion:Yo,ZodDiscriminatedUnion:as,ZodIntersection:Jo,ZodTuple:Bn,ZodRecord:Xo,ZodMap:ls,ZodSet:Lr,ZodFunction:co,ZodLazy:Qo,ZodLiteral:ei,ZodEnum:ir,ZodNativeEnum:ti,ZodPromise:uo,ZodEffects:an,ZodTransformer:an,ZodOptional:An,ZodNullable:sr,ZodDefault:ni,ZodCatch:ri,ZodNaN:cs,BRAND:Lm,ZodBranded:za,ZodPipeline:oi,ZodReadonly:ii,custom:xd,Schema:Be,ZodSchema:Be,late:Gm,get ZodFirstPartyTypeKind(){return _e},coerce:{string:t=>on.create({...t,coerce:!0}),number:t=>rr.create({...t,coerce:!0}),boolean:t=>jo.create({...t,coerce:!0}),bigint:t=>or.create({...t,coerce:!0}),date:t=>Ir.create({...t,coerce:!0})},any:qm,array:Xm,bigint:$m,boolean:Ed,date:Um,discriminatedUnion:ng,effect:Td,enum:ug,function:lg,instanceof:zm,intersection:rg,lazy:cg,literal:dg,map:sg,nan:Zm,nativeEnum:pg,never:Ym,null:jm,nullable:mg,number:Sd,object:Qm,oboolean:()=>Ed().optional(),onumber:()=>Sd().optional(),optional:fg,ostring:()=>kd().optional(),pipeline:yg,preprocess:gg,promise:hg,record:ig,set:ag,strictObject:eg,string:kd,symbol:Wm,transformer:Td,tuple:og,undefined:Hm,union:tg,unknown:Km,void:Jm,NEVER:Ce,ZodIssueCode:Q,quotelessJson:wm,ZodError:It});function _g(t){throw new Error("Unexpected object: "+t)}const vg=-2147483648,Bd=-9007199254740991n,Cg=NaN,wg=NaN,bg=null,xg=null;function Ad(t,e){switch(e){case"Int":return t===vg;case"Long":return t===Number(Bd)||t===Bd;case"Float":return t===Cg;case"Double":return t===wg;case"String":return t===bg;case"Bytes":return t===xg;default:throw Error(`unsupported data type: ${e}`)}}function kg(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}function Za(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}function Nd(t){return t.map(Za)}function ds(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=>ds(n,e))};case"outer":return{type:"outer",primary:ds(t.primary,e),secondary:t.secondary.map(n=>ds(n,e))};default:_g(t)}}Nn.object({__isRef:Nn.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Nn.string().describe("Upstream block id"),name:Nn.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 Sg(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 Eg=Nn.object({type:Nn.string(),importance:Nn.number().optional(),id:Nn.string().optional(),label:Nn.string()});Nn.array(Eg);const Tg="1.13.2";function Bg(){return Sg({sdkVersion:Tg})}function Ag(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function po(t){return!!t&&typeof t.children<"u"}function ar(t){return po(t)?t.groupId:t.colId}function Vd(t,e,n){const o=(d,u)=>{const p=d.children.map(ar),f=b._includes(p,ar(u)),m=b._last(d.children),y=m&&ar(m)!==ar(u);return f&&y};if(!po(t))return!0;const s=t,l=n;if(o(s,l))return s.children.push(l),!0;if(s.groupId===e){const d=s.children.map(ar);if(!b._includes(d,ar(l)))return s.children.push(l),!0}for(let d=s.children.length-1;d>=0&&!Vd(s.children[d],e,n);d--);return!1}function Ng(t){const e=(s,l)=>po(s)&&po(l)&&ar(s)===ar(l),n=(s,l)=>{if(!po(l))return s;const d=s,u=l;return u.children&&u.groupId&&Vd(d,u.groupId,u.children[0])||u.children.forEach(p=>n(d,p)),d},o=[];for(let s=1;s<=t.length;s++){const l=t[s-1],d=t[s];e(l,d)?t[s]=n(l,d):o.push(l)}return o}var Vg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(po(s)){const d=s,u=typeof d.groupId<"u"?d.groupId:d.headerName,p=new b.AgProvidedColumnGroup(d,u,!1,l),f=[];return d.children.forEach(m=>{const y=n(m,l+1);y&&f.push(y)}),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}},o=[];return t.forEach(s=>{const l=n(s,0);l&&o.push(l)}),e.length>0&&b._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=Ng(e);t(n)}getLeafPathTrees(){const t=(o,s)=>{let l;if(b.isProvidedColumnGroup(o))if(o.isPadding())l=s;else{const u=Object.assign({},o.getColGroupDef());u.groupId=o.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},o.getColDef());u.colId=o.getColId(),l=u}const d=o.getOriginalParent();return d?t(d,l):l};return this.columnModel.getCols().filter(o=>{const s=o.getColDef();return o.isPrimary()&&!s.showRowGroup}).map(o=>t(o,o.getColDef()))}};function Pg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function Dg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function Fg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Rg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function Mg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function Ig(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function Og(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function Lg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function Gg(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return b._unwrapUserComp(n)}function zg(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var Zg=class extends b.Component{constructor(t){super(),this.eToggleButton=b.RefPlaceholder,this.eIconWrapper=b.RefPlaceholder,this.eLabel=b.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
|
|
3
|
+
`)}}function gm(t){return{ok:!0,value:t}}function md(t){if(!t)throw new Aa;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function gd(t){return{value:t,errors:void 0}}function ym(t){if(t.errors)throw new Na(t.errors);if(!t.value)throw new Aa;return t.value}function _m(t){return t!==void 0}function Va(t,e){return Or(t)===Or(e)}const Pa=t=>t,Da=t=>t instanceof Error?t:Error(String(t)),Fa=t=>t.name==="ZodError",Ra=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),o=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function Ma(t){const e=t.validate??Pa,{autoSave:n}=t,o=r.ref(),s=r.ref(),l=N=>{s.value={model:En(N)}};r.watch(()=>t.get(),N=>l(N),{immediate:!0});const d=()=>{var N;t.onSave(e(En((N=s.value)==null?void 0:N.model)))},u=()=>{l(t.get()),o.value=void 0},p=N=>{const M=Da(N);Fa(M)?o.value=Error(Ra(M)):o.value=M},f=N=>{o.value=void 0;try{e(N),n&&d()}catch(M){p(M)}},m=r.computed({get:()=>{var N;return(N=s.value)==null?void 0:N.model},set(N){l(N),f(N)}});r.watch(s,(N,M)=>{N&&N===M&&f(N.model)},{deep:!0});const y=r.computed(()=>!o.value),B=r.computed(()=>!Va(t.get(),r.unref(s))),T=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:B,error:o,errorString:T,save:d,revert:u,setError:p})}function vm(t,e,n){const o=t.validate??Pa,{autoSave:s}=t,l=r.ref(),d=r.ref(),u=G=>{var C;if(n.deepPatchModel){const F=(C=d.value)==null?void 0:C.model,L=Object.assign(En(G),e??{});d.value={model:F?fd(F,L):L,stage:Symbol()}}else d.value={model:Object.assign(En(G),e??{}),stage:Symbol()}};r.watch(()=>t.get(),G=>u(G),{immediate:!0});const p=()=>{var G;t.onSave(o(En((G=d.value)==null?void 0:G.model)))},f=()=>{u(t.get()),l.value=void 0},m=G=>{const C=Da(G);Fa(C)?l.value=Error(Ra(C)):l.value=C},y=G=>{l.value=void 0;try{o(G),s&&p()}catch(C){m(C)}},B=r.computed({get:()=>{var G;return(G=d.value)==null?void 0:G.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:B.value.args,ui:B.value.ui}),()=>{var G;return(G=d.value)==null?void 0:G.stage}],([G,C],[F,L])=>{C===L&&y(G)},{deep:!0});const T=r.computed(()=>!l.value),N=r.computed(()=>{var F;const{args:G,ui:C}=((F=r.unref(d))==null?void 0:F.model)??{};return!Va(t.get(),{args:G,ui:C})}),M=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:B,valid:T,isChanged:N,error:l,errorString:M,save:p,revert:f,setError:m})}const Cm=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function wm(t,e,n){const o=(C,...F)=>{n.debug&&console.log(`%c>>> %c${C}`,"color: orange; font-weight: bold","color: orange",...F)},l=Ba(e.setBlockArgs,100),d=Ba(e.setBlockUiState,100),u=Ba(e.setBlockArgsAndUiState,100),p=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async C=>{C.forEach(F=>{F.key==="args"&&(p.args=Object.freeze(F.value),o("args patch",p.args)),F.key==="ui"&&(p.ui=Object.freeze(F.value),o("ui patch",p.ui)),F.key==="outputs"&&(p.outputs=Object.freeze(F.value),o("outputs patch",p.outputs)),F.key==="navigationState"&&(p.navigationState=Object.freeze(F.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const f=()=>En(p.args),m=()=>En(p.ui),y=()=>En(p.navigationState),B={createArgsModel(C={}){return Ma({get(){return C.transform?C.transform(p.args):p.args},validate:C.validate,autoSave:!0,onSave(F){l(F)}})},createUiModel(C={},F){return Ma({get(){return C.transform?C.transform(p.ui):p.ui??F()},validate:C.validate,autoSave:!0,onSave(L){d(L)}})},useOutputs(...C){const F=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(F,{value:this.unwrapOutputs(...C),errors:void 0})}catch(L){Object.assign(F,{value:void 0,errors:[String(L)]})}},{immediate:!0,deep:!0}),F},unwrapOutputs(...C){const F=p.outputs,L=C.map($=>[$,md(F[$])]);return Object.fromEntries(L)},getOutputField(C){return p.outputs[C]},getOutputFieldOkOptional(C){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const F=this.getOutputField(C);if(F&&F.ok)return F.value},getOutputFieldErrorsOptional(C){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const F=this.getOutputField(C);if(F&&!F.ok)return F.errors},updateArgs(C){const F=f();return C(F),e.setBlockArgs(F)},updateUiState(C){const F=m();return e.setBlockUiState(C(F))},updateNavigationState(C){const F=y();return C(F),e.setNavigationState(F)},navigateTo(C){const F=y();return F.href=C,e.setNavigationState(F)}},T=r.computed(()=>{const C=Object.entries(p.outputs).map(([F,L])=>[F,L.ok&&L.value!==void 0?L.value:void 0]);return Object.fromEntries(C)}),N=r.computed(()=>{const C=Object.entries(p.outputs).map(([F,L])=>[F,L&&!L.ok?new Na(L.errors):void 0]);return Object.fromEntries(C)}),M={snapshot:p,queryParams:r.computed(()=>Cm(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(C=>!(C!=null&&C.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),T.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),N.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),p.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),p.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),p.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),p.navigationState))},G=vm({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(C){u(C.args,C.ui)}},{outputs:T,outputErrors:N},n);return r.reactive(Object.assign(G,B,M))}var Oe;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const 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 o(s,l=" | "){return s.map(d=>typeof d=="string"?`'${d}'`:d).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Oe||(Oe={}));var Ia;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Ia||(Ia={}));const ae=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),nr=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map<"u"&&t instanceof Map?ae.map:typeof Set<"u"&&t instanceof Set?ae.set:typeof Date<"u"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},Q=Oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),bm=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class It extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},s=l=>{for(const 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)o._errors.push(n(d));else{let u=o,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),o}static assert(e){if(!(e instanceof It))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):o.push(e(s));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}It.create=t=>new It(t);const ao=(t,e)=>{let n;switch(t.code){case Q.invalid_type:t.received===ae.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Oe.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:n=`Unrecognized key(s) in object: ${Oe.joinValues(t.keys,", ")}`;break;case Q.invalid_union:n="Invalid input";break;case Q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Oe.joinValues(t.options)}`;break;case Q.invalid_enum_value:n=`Invalid enum value. Expected ${Oe.joinValues(t.options)}, received '${t.received}'`;break;case Q.invalid_arguments:n="Invalid function arguments";break;case Q.invalid_return_type:n="Invalid function return type";break;case Q.invalid_date:n="Invalid date";break;case Q.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Oe.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Q.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Q.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Q.custom:n="Invalid input";break;case Q.invalid_intersection_types:n="Intersection results could not be merged";break;case Q.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Q.not_finite:n="Number must be finite";break;default:n=e.defaultError,Oe.assertNever(t)}return{message:n}};let yd=ao;function xm(t){yd=t}function os(){return yd}const is=t=>{const{data:e,path:n,errorMaps:o,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=o.filter(f=>!!f).slice().reverse();for(const f of p)u=f(d,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},km=[];function ie(t,e){const n=os(),o=is({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ao?void 0:ao].filter(s=>!!s)});t.common.issues.push(o)}class _t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const s of n){if(s.status==="aborted")return Ce;s.status==="dirty"&&e.dirty(),o.push(s.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const s of n){const l=await s.key,d=await s.value;o.push({key:l,value:d})}return _t.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};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)&&(o[l.value]=d.value)}return{status:e.value,value:o}}}const Ce=Object.freeze({status:"aborted"}),lo=t=>({status:"dirty",value:t}),kt=t=>({status:"valid",value:t}),Oa=t=>t.status==="aborted",La=t=>t.status==="dirty",Wo=t=>t.status==="valid",Ho=t=>typeof Promise<"u"&&t instanceof Promise;function ss(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function _d(t,e,n,o,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var pe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(pe||(pe={}));var jo,qo;class Tn{constructor(e,n,o,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const vd=(t,e)=>{if(Wo(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 It(t.common.issues);return this._error=n,this._error}}};function Te(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:s}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(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??o)!==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 Ne{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 nr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new _t,ctx:{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Ho(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const s={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},l=this._parseSync({data:e,path:s.path,parent:s});return vd(s,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},s=this._parse({data:e,path:o.path,parent:o}),l=await(Ho(s)?s:Promise.resolve(s));return vd(o,l)}refine(e,n){const o=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const d=e(s),u=()=>l.addIssue({code:Q.custom,...o(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((o,s)=>e(o)?!0:(s.addIssue(typeof n=="function"?n(o,s):n),!1))}_refinement(e){return new an({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return An.create(this,this._def)}nullable(){return sr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sn.create(this,this._def)}promise(){return ho.create(this,this._def)}or(e){return Xo.create([this,e],this._def)}and(e){return Qo.create(this,e,this._def)}transform(e){return new an({...Te(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new oi({...Te(this._def),innerType:this,defaultValue:n,typeName:_e.ZodDefault})}brand(){return new Za({typeName:_e.ZodBranded,type:this,...Te(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ii({...Te(this._def),innerType:this,catchValue:n,typeName:_e.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return si.create(this,e)}readonly(){return ai.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Sm=/^c[^\s-]{8,}$/i,Em=/^[0-9a-z]+$/,Tm=/^[0-9A-HJKMNP-TV-Z]{26}$/,Bm=/^[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,Am=/^[a-z0-9_-]{21}$/i,Nm=/^[-+]?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)?)??$/,Vm=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Pm="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ga;const Dm=/^(?:(?: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])$/,Fm=/^(([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})))$/,Rm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Cd="((\\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])))",Mm=new RegExp(`^${Cd}$`);function wd(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 Im(t){return new RegExp(`^${wd(t)}$`)}function bd(t){let e=`${Cd}T${wd(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 Om(t,e){return!!((e==="v4"||!e)&&Dm.test(t)||(e==="v6"||!e)&&Fm.test(t))}class on extends Ne{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){const l=this._getOrReturnCtx(e);return ie(l,{code:Q.invalid_type,expected:ae.string,received:l.parsedType}),Ce}const o=new _t;let s;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="max")e.data.length>l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.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?ie(s,{code:Q.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):u&&ie(s,{code:Q.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")Vm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"email",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")Ga||(Ga=new RegExp(Pm,"u")),Ga.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"emoji",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")Bm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"uuid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")Am.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"nanoid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")Sm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")Em.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid2",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")Tm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ulid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ie(s,{validation:"url",code:Q.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"regex",code:Q.invalid_string,message:l.message}),o.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?bd(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?Mm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?Im(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?Nm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"duration",code:Q.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?Om(e.data,l.version)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ip",code:Q.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?Rm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"base64",code:Q.invalid_string,message:l.message}),o.dirty()):Oe.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(s=>e.test(s),{validation:n,code:Q.invalid_string,...pe.errToObj(o)})}_addCheck(e){return new on({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...pe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...pe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...pe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...pe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...pe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...pe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...pe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...pe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...pe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...pe.errToObj(e)})}datetime(e){var n,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...pe.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...pe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...pe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...pe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...pe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...pe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...pe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...pe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...pe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...pe.errToObj(n)})}nonempty(e){return this.min(1,pe.errToObj(e))}trim(){return new on({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new on({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new on({...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}}on.create=t=>{var e;return new on({checks:[],typeName:_e.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Te(t)})};function Lm(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,s=n>o?n:o,l=parseInt(t.toFixed(s).replace(".","")),d=parseInt(e.toFixed(s).replace(".",""));return l%d/Math.pow(10,s)}class rr extends Ne{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)!==ae.number){const l=this._getOrReturnCtx(e);return ie(l,{code:Q.invalid_type,expected:ae.number,received:l.parsedType}),Ce}let o;const s=new _t;for(const l of this._def.checks)l.kind==="int"?Oe.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?Lm(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.not_finite,message:l.message}),s.dirty()):Oe.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,o,s){return new rr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:pe.toString(s)}]})}_addCheck(e){return new rr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:pe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:pe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Oe.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}rr.create=t=>new rr({checks:[],typeName:_e.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Te(t)});class or extends Ne{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)!==ae.bigint){const l=this._getOrReturnCtx(e);return ie(l,{code:Q.invalid_type,expected:ae.bigint,received:l.parsedType}),Ce}let o;const s=new _t;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Oe.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,o,s){return new or({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:pe.toString(s)}]})}_addCheck(e){return new or({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}or.create=t=>{var e;return new or({checks:[],typeName:_e.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Te(t)})};class Ko extends Ne{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.boolean,received:o.parsedType}),Ce}return kt(e.data)}}Ko.create=t=>new Ko({typeName:_e.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Te(t)});class Lr extends Ne{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){const l=this._getOrReturnCtx(e);return ie(l,{code:Q.invalid_type,expected:ae.date,received:l.parsedType}),Ce}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ie(l,{code:Q.invalid_date}),Ce}const o=new _t;let s;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Oe.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Lr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:pe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:pe.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Lr.create=t=>new Lr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_e.ZodDate,...Te(t)});class as extends Ne{_parse(e){if(this._getType(e)!==ae.symbol){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.symbol,received:o.parsedType}),Ce}return kt(e.data)}}as.create=t=>new as({typeName:_e.ZodSymbol,...Te(t)});class Yo extends Ne{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.undefined,received:o.parsedType}),Ce}return kt(e.data)}}Yo.create=t=>new Yo({typeName:_e.ZodUndefined,...Te(t)});class Jo extends Ne{_parse(e){if(this._getType(e)!==ae.null){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.null,received:o.parsedType}),Ce}return kt(e.data)}}Jo.create=t=>new Jo({typeName:_e.ZodNull,...Te(t)});class co extends Ne{constructor(){super(...arguments),this._any=!0}_parse(e){return kt(e.data)}}co.create=t=>new co({typeName:_e.ZodAny,...Te(t)});class Gr extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return kt(e.data)}}Gr.create=t=>new Gr({typeName:_e.ZodUnknown,...Te(t)});class Ln extends Ne{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:Q.invalid_type,expected:ae.never,received:n.parsedType}),Ce}}Ln.create=t=>new Ln({typeName:_e.ZodNever,...Te(t)});class ls extends Ne{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.void,received:o.parsedType}),Ce}return kt(e.data)}}ls.create=t=>new ls({typeName:_e.ZodVoid,...Te(t)});class sn extends Ne{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),s=this._def;if(n.parsedType!==ae.array)return ie(n,{code:Q.invalid_type,expected:ae.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)&&(ie(n,{code:d?Q.too_big:Q.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}),o.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ie(n,{code:Q.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),o.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ie(n,{code:Q.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((d,u)=>s.type._parseAsync(new Tn(n,d,n.path,u)))).then(d=>_t.mergeArray(o,d));const l=[...n.data].map((d,u)=>s.type._parseSync(new Tn(n,d,n.path,u)));return _t.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new sn({...this._def,minLength:{value:e,message:pe.toString(n)}})}max(e,n){return new sn({...this._def,maxLength:{value:e,message:pe.toString(n)}})}length(e,n){return new sn({...this._def,exactLength:{value:e,message:pe.toString(n)}})}nonempty(e){return this.min(1,e)}}sn.create=(t,e)=>new sn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Te(e)});function uo(t){if(t instanceof Qe){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=An.create(uo(o))}return new Qe({...t._def,shape:()=>e})}else return t instanceof sn?new sn({...t._def,type:uo(t.element)}):t instanceof An?An.create(uo(t.unwrap())):t instanceof sr?sr.create(uo(t.unwrap())):t instanceof Bn?Bn.create(t.items.map(e=>uo(e))):t}class Qe extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Oe.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ae.object){const f=this._getOrReturnCtx(e);return ie(f,{code:Q.invalid_type,expected:ae.object,received:f.parsedType}),Ce}const{status:o,ctx:s}=this._processInputParams(e),{shape:l,keys:d}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ln&&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],y=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new Tn(s,y,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Ln){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)p.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(f==="strict")u.length>0&&(ie(s,{code:Q.unrecognized_keys,keys:u}),o.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const y=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new Tn(s,y,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of p){const y=await m.key,B=await m.value;f.push({key:y,value:B,alwaysSet:m.alwaysSet})}return f}).then(f=>_t.mergeObjectSync(o,f)):_t.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return pe.errToObj,new Qe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var s,l,d,u;const p=(d=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,o).message)!==null&&d!==void 0?d:o.defaultError;return n.code==="unrecognized_keys"?{message:(u=pe.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Qe({...this._def,unknownKeys:"strip"})}passthrough(){return new Qe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Qe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Qe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_e.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Qe({...this._def,catchall:e})}pick(e){const n={};return Oe.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new Qe({...this._def,shape:()=>n})}omit(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new Qe({...this._def,shape:()=>n})}deepPartial(){return uo(this)}partial(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{const s=this.shape[o];e&&!e[o]?n[o]=s:n[o]=s.optional()}),new Qe({...this._def,shape:()=>n})}required(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof An;)l=l._def.innerType;n[o]=l}}),new Qe({...this._def,shape:()=>n})}keyof(){return xd(Oe.objectKeys(this.shape))}}Qe.create=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strip",catchall:Ln.create(),typeName:_e.ZodObject,...Te(e)}),Qe.strictCreate=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strict",catchall:Ln.create(),typeName:_e.ZodObject,...Te(e)}),Qe.lazycreate=(t,e)=>new Qe({shape:t,unknownKeys:"strip",catchall:Ln.create(),typeName:_e.ZodObject,...Te(e)});class Xo extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const d=l.map(u=>new It(u.ctx.common.issues));return ie(n,{code:Q.invalid_union,unionErrors:d}),Ce}if(n.common.async)return Promise.all(o.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 o){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&d.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=d.map(p=>new It(p));return ie(n,{code:Q.invalid_union,unionErrors:u}),Ce}}get options(){return this._def.options}}Xo.create=(t,e)=>new Xo({options:t,typeName:_e.ZodUnion,...Te(e)});const Gn=t=>t instanceof ti?Gn(t.schema):t instanceof an?Gn(t.innerType()):t instanceof ni?[t.value]:t instanceof ir?t.options:t instanceof ri?Oe.objectValues(t.enum):t instanceof oi?Gn(t._def.innerType):t instanceof Yo?[void 0]:t instanceof Jo?[null]:t instanceof An?[void 0,...Gn(t.unwrap())]:t instanceof sr?[null,...Gn(t.unwrap())]:t instanceof Za||t instanceof ai?Gn(t.unwrap()):t instanceof ii?Gn(t._def.innerType):[];class cs extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return ie(n,{code:Q.invalid_type,expected:ae.object,received:n.parsedType}),Ce;const o=this.discriminator,s=n.data[o],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const s=new Map;for(const l of n){const d=Gn(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 cs({typeName:_e.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Te(o)})}}function za(t,e){const n=nr(t),o=nr(e);if(t===e)return{valid:!0,data:t};if(n===ae.object&&o===ae.object){const s=Oe.objectKeys(e),l=Oe.objectKeys(t).filter(u=>s.indexOf(u)!==-1),d={...t,...e};for(const u of l){const p=za(t[u],e[u]);if(!p.valid)return{valid:!1};d[u]=p.data}return{valid:!0,data:d}}else if(n===ae.array&&o===ae.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=za(d,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===ae.date&&o===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Qo extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=(l,d)=>{if(Oa(l)||Oa(d))return Ce;const u=za(l.value,d.value);return u.valid?((La(l)||La(d))&&n.dirty(),{status:n.value,value:u.data}):(ie(o,{code:Q.invalid_intersection_types}),Ce)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,d])=>s(l,d)):s(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Qo.create=(t,e,n)=>new Qo({left:t,right:e,typeName:_e.ZodIntersection,...Te(n)});class Bn extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.array)return ie(o,{code:Q.invalid_type,expected:ae.array,received:o.parsedType}),Ce;if(o.data.length<this._def.items.length)return ie(o,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((d,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new Tn(o,d,o.path,u)):null}).filter(d=>!!d);return o.common.async?Promise.all(l).then(d=>_t.mergeArray(n,d)):_t.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Bn({...this._def,rest:e})}}Bn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bn({items:t,typeName:_e.ZodTuple,rest:null,...Te(e)})};class ei extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.object)return ie(o,{code:Q.invalid_type,expected:ae.object,received:o.parsedType}),Ce;const s=[],l=this._def.keyType,d=this._def.valueType;for(const u in o.data)s.push({key:l._parse(new Tn(o,u,o.path,u)),value:d._parse(new Tn(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?_t.mergeObjectAsync(n,s):_t.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Ne?new ei({keyType:e,valueType:n,typeName:_e.ZodRecord,...Te(o)}):new ei({keyType:on.create(),valueType:e,typeName:_e.ZodRecord,...Te(n)})}}class ds extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.map)return ie(o,{code:Q.invalid_type,expected:ae.map,received:o.parsedType}),Ce;const s=this._def.keyType,l=this._def.valueType,d=[...o.data.entries()].map(([u,p],f)=>({key:s._parse(new Tn(o,u,o.path,[f,"key"])),value:l._parse(new Tn(o,p,o.path,[f,"value"]))}));if(o.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}}}}ds.create=(t,e,n)=>new ds({valueType:e,keyType:t,typeName:_e.ZodMap,...Te(n)});class zr extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.set)return ie(o,{code:Q.invalid_type,expected:ae.set,received:o.parsedType}),Ce;const s=this._def;s.minSize!==null&&o.data.size<s.minSize.value&&(ie(o,{code:Q.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&o.data.size>s.maxSize.value&&(ie(o,{code:Q.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function 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=[...o.data.values()].map((p,f)=>l._parse(new Tn(o,p,o.path,f)));return o.common.async?Promise.all(u).then(p=>d(p)):d(u)}min(e,n){return new zr({...this._def,minSize:{value:e,message:pe.toString(n)}})}max(e,n){return new zr({...this._def,maxSize:{value:e,message:pe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}zr.create=(t,e)=>new zr({valueType:t,minSize:null,maxSize:null,typeName:_e.ZodSet,...Te(e)});class po extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.function)return ie(n,{code:Q.invalid_type,expected:ae.function,received:n.parsedType}),Ce;function o(u,p){return is({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,os(),ao].filter(f=>!!f),issueData:{code:Q.invalid_arguments,argumentsError:p}})}function s(u,p){return is({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,os(),ao].filter(f=>!!f),issueData:{code:Q.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},d=n.data;if(this._def.returns instanceof ho){const u=this;return kt(async function(...p){const f=new It([]),m=await u._def.args.parseAsync(p,l).catch(T=>{throw f.addIssue(o(p,T)),f}),y=await Reflect.apply(d,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(T=>{throw f.addIssue(s(y,T)),f})})}else{const u=this;return kt(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new It([o(p,f.error)]);const m=Reflect.apply(d,this,f.data),y=u._def.returns.safeParse(m,l);if(!y.success)throw new It([s(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new po({...this._def,args:Bn.create(e).rest(Gr.create())})}returns(e){return new po({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new po({args:e||Bn.create([]).rest(Gr.create()),returns:n||Gr.create(),typeName:_e.ZodFunction,...Te(o)})}}class ti extends Ne{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})}}ti.create=(t,e)=>new ti({getter:t,typeName:_e.ZodLazy,...Te(e)});class ni extends Ne{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:Q.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:e.data}}get value(){return this._def.value}}ni.create=(t,e)=>new ni({value:t,typeName:_e.ZodLiteral,...Te(e)});function xd(t,e){return new ir({values:t,typeName:_e.ZodEnum,...Te(e)})}class ir extends Ne{constructor(){super(...arguments),jo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{expected:Oe.joinValues(o),received:n.parsedType,code:Q.invalid_type}),Ce}if(ss(this,jo)||_d(this,jo,new Set(this._def.values)),!ss(this,jo).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{received:n.data,code:Q.invalid_enum_value,options:o}),Ce}return kt(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 ir.create(e,{...this._def,...n})}exclude(e,n=this._def){return ir.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}jo=new WeakMap,ir.create=xd;class ri extends Ne{constructor(){super(...arguments),qo.set(this,void 0)}_parse(e){const n=Oe.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ae.string&&o.parsedType!==ae.number){const s=Oe.objectValues(n);return ie(o,{expected:Oe.joinValues(s),received:o.parsedType,code:Q.invalid_type}),Ce}if(ss(this,qo)||_d(this,qo,new Set(Oe.getValidEnumValues(this._def.values))),!ss(this,qo).has(e.data)){const s=Oe.objectValues(n);return ie(o,{received:o.data,code:Q.invalid_enum_value,options:s}),Ce}return kt(e.data)}get enum(){return this._def.values}}qo=new WeakMap,ri.create=(t,e)=>new ri({values:t,typeName:_e.ZodNativeEnum,...Te(e)});class ho extends Ne{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.promise&&n.common.async===!1)return ie(n,{code:Q.invalid_type,expected:ae.promise,received:n.parsedType}),Ce;const o=n.parsedType===ae.promise?n.data:Promise.resolve(n.data);return kt(o.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ho.create=(t,e)=>new ho({type:t,typeName:_e.ZodPromise,...Te(e)});class an extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:d=>{ie(o,d),d.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const d=s.transform(o.data,l);if(o.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:o.path,parent:o});return p.status==="aborted"?Ce:p.status==="dirty"||n.value==="dirty"?lo(p.value):p});{if(n.value==="aborted")return Ce;const u=this._def.schema._parseSync({data:d,path:o.path,parent:o});return u.status==="aborted"?Ce:u.status==="dirty"||n.value==="dirty"?lo(u.value):u}}if(s.type==="refinement"){const d=u=>{const p=s.refinement(u,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),d(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),d(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Wo(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:o.data,path:o.path,parent:o}).then(d=>Wo(d)?Promise.resolve(s.transform(d.value,l)).then(u=>({status:n.value,value:u})):d);Oe.assertNever(s)}}an.create=(t,e,n)=>new an({schema:t,typeName:_e.ZodEffects,effect:e,...Te(n)}),an.createWithPreprocess=(t,e,n)=>new an({schema:e,effect:{type:"preprocess",transform:t},typeName:_e.ZodEffects,...Te(n)});class An extends Ne{_parse(e){return this._getType(e)===ae.undefined?kt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}An.create=(t,e)=>new An({innerType:t,typeName:_e.ZodOptional,...Te(e)});class sr extends Ne{_parse(e){return this._getType(e)===ae.null?kt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}sr.create=(t,e)=>new sr({innerType:t,typeName:_e.ZodNullable,...Te(e)});class oi extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===ae.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}oi.create=(t,e)=>new oi({innerType:t,typeName:_e.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Te(e)});class ii extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Ho(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new It(o.common.issues)},input:o.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new It(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}ii.create=(t,e)=>new ii({innerType:t,typeName:_e.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Te(e)});class us extends Ne{_parse(e){if(this._getType(e)!==ae.nan){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.nan,received:o.parsedType}),Ce}return{status:"valid",value:e.data}}}us.create=t=>new us({typeName:_e.ZodNaN,...Te(t)});const Gm=Symbol("zod_brand");class Za extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class si extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return l.status==="aborted"?Ce:l.status==="dirty"?(n.dirty(),lo(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const s=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:o.path,parent:o})}}static create(e,n){return new si({in:e,out:n,typeName:_e.ZodPipeline})}}class ai extends Ne{_parse(e){const n=this._def.innerType._parse(e),o=s=>(Wo(s)&&(s.value=Object.freeze(s.value)),s);return Ho(n)?n.then(s=>o(s)):o(n)}unwrap(){return this._def.innerType}}ai.create=(t,e)=>new ai({innerType:t,typeName:_e.ZodReadonly,...Te(e)});function kd(t,e={},n){return t?co.create().superRefine((o,s)=>{var l,d;if(!t(o)){const u=typeof e=="function"?e(o):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})}}):co.create()}const zm={object:Qe.lazycreate};var _e;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_e||(_e={}));const Zm=(t,e={message:`Input not instance of ${t.name}`})=>kd(n=>n instanceof t,e),Sd=on.create,Ed=rr.create,$m=us.create,Um=or.create,Td=Ko.create,Wm=Lr.create,Hm=as.create,jm=Yo.create,qm=Jo.create,Km=co.create,Ym=Gr.create,Jm=Ln.create,Xm=ls.create,Qm=sn.create,eg=Qe.create,tg=Qe.strictCreate,ng=Xo.create,rg=cs.create,og=Qo.create,ig=Bn.create,sg=ei.create,ag=ds.create,lg=zr.create,cg=po.create,dg=ti.create,ug=ni.create,pg=ir.create,hg=ri.create,fg=ho.create,Bd=an.create,mg=An.create,gg=sr.create,yg=an.createWithPreprocess,_g=si.create;var Nn=Object.freeze({__proto__:null,defaultErrorMap:ao,setErrorMap:xm,getErrorMap:os,makeIssue:is,EMPTY_PATH:km,addIssueToContext:ie,ParseStatus:_t,INVALID:Ce,DIRTY:lo,OK:kt,isAborted:Oa,isDirty:La,isValid:Wo,isAsync:Ho,get util(){return Oe},get objectUtil(){return Ia},ZodParsedType:ae,getParsedType:nr,ZodType:Ne,datetimeRegex:bd,ZodString:on,ZodNumber:rr,ZodBigInt:or,ZodBoolean:Ko,ZodDate:Lr,ZodSymbol:as,ZodUndefined:Yo,ZodNull:Jo,ZodAny:co,ZodUnknown:Gr,ZodNever:Ln,ZodVoid:ls,ZodArray:sn,ZodObject:Qe,ZodUnion:Xo,ZodDiscriminatedUnion:cs,ZodIntersection:Qo,ZodTuple:Bn,ZodRecord:ei,ZodMap:ds,ZodSet:zr,ZodFunction:po,ZodLazy:ti,ZodLiteral:ni,ZodEnum:ir,ZodNativeEnum:ri,ZodPromise:ho,ZodEffects:an,ZodTransformer:an,ZodOptional:An,ZodNullable:sr,ZodDefault:oi,ZodCatch:ii,ZodNaN:us,BRAND:Gm,ZodBranded:Za,ZodPipeline:si,ZodReadonly:ai,custom:kd,Schema:Ne,ZodSchema:Ne,late:zm,get ZodFirstPartyTypeKind(){return _e},coerce:{string:t=>on.create({...t,coerce:!0}),number:t=>rr.create({...t,coerce:!0}),boolean:t=>Ko.create({...t,coerce:!0}),bigint:t=>or.create({...t,coerce:!0}),date:t=>Lr.create({...t,coerce:!0})},any:Km,array:Qm,bigint:Um,boolean:Td,date:Wm,discriminatedUnion:rg,effect:Bd,enum:pg,function:cg,instanceof:Zm,intersection:og,lazy:dg,literal:ug,map:ag,nan:$m,nativeEnum:hg,never:Jm,null:qm,nullable:gg,number:Ed,object:eg,oboolean:()=>Td().optional(),onumber:()=>Ed().optional(),optional:mg,ostring:()=>Sd().optional(),pipeline:_g,preprocess:yg,promise:fg,record:sg,set:lg,strictObject:tg,string:Sd,symbol:Hm,transformer:Bd,tuple:ig,undefined:jm,union:ng,unknown:Ym,void:Xm,NEVER:Ce,ZodIssueCode:Q,quotelessJson:bm,ZodError:It});function vg(t){throw new Error("Unexpected object: "+t)}const Cg=-2147483648,Ad=-9007199254740991n,wg=NaN,bg=NaN,xg=null,kg=null;function Nd(t,e){switch(e){case"Int":return t===Cg;case"Long":return t===Number(Ad)||t===Ad;case"Float":return t===wg;case"Double":return t===bg;case"String":return t===xg;case"Bytes":return t===kg;default:throw Error(`unsupported data type: ${e}`)}}function Sg(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}function $a(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}function Vd(t){return t.map($a)}function ps(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=>ps(n,e))};case"outer":return{type:"outer",primary:ps(t.primary,e),secondary:t.secondary.map(n=>ps(n,e))};default:vg(t)}}Nn.object({__isRef:Nn.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Nn.string().describe("Upstream block id"),name:Nn.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 Eg(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 Tg=Nn.object({type:Nn.string(),importance:Nn.number().optional(),id:Nn.string().optional(),label:Nn.string()});Nn.array(Tg);const Bg="1.13.2";function Ag(){return Eg({sdkVersion:Bg})}function Ng(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function fo(t){return!!t&&typeof t.children<"u"}function ar(t){return fo(t)?t.groupId:t.colId}function Pd(t,e,n){const o=(d,u)=>{const p=d.children.map(ar),f=x._includes(p,ar(u)),m=x._last(d.children),y=m&&ar(m)!==ar(u);return f&&y};if(!fo(t))return!0;const s=t,l=n;if(o(s,l))return s.children.push(l),!0;if(s.groupId===e){const d=s.children.map(ar);if(!x._includes(d,ar(l)))return s.children.push(l),!0}for(let d=s.children.length-1;d>=0&&!Pd(s.children[d],e,n);d--);return!1}function Vg(t){const e=(s,l)=>fo(s)&&fo(l)&&ar(s)===ar(l),n=(s,l)=>{if(!fo(l))return s;const d=s,u=l;return u.children&&u.groupId&&Pd(d,u.groupId,u.children[0])||u.children.forEach(p=>n(d,p)),d},o=[];for(let s=1;s<=t.length;s++){const l=t[s-1],d=t[s];e(l,d)?t[s]=n(l,d):o.push(l)}return o}var Pg=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(fo(s)){const d=s,u=typeof d.groupId<"u"?d.groupId:d.headerName,p=new x.AgProvidedColumnGroup(d,u,!1,l),f=[];return d.children.forEach(m=>{const y=n(m,l+1);y&&f.push(y)}),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}},o=[];return t.forEach(s=>{const l=n(s,0);l&&o.push(l)}),e.length>0&&x._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=Vg(e);t(n)}getLeafPathTrees(){const t=(o,s)=>{let l;if(x.isProvidedColumnGroup(o))if(o.isPadding())l=s;else{const u=Object.assign({},o.getColGroupDef());u.groupId=o.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},o.getColDef());u.colId=o.getColId(),l=u}const d=o.getOriginalParent();return d?t(d,l):l};return this.columnModel.getCols().filter(o=>{const s=o.getColDef();return o.isPrimary()&&!s.showRowGroup}).map(o=>t(o,o.getColDef()))}};function Dg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function Fg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function Rg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Mg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function Ig(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function Og(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function Lg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function Gg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function zg(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return x._unwrapUserComp(n)}function Zg(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var $g=class extends x.Component{constructor(t){super(),this.eToggleButton=x.RefPlaceholder,this.eIconWrapper=x.RefPlaceholder,this.eLabel=x.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",
|
|
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",x._createIconNoSpan(this.toolPanelDef.iconKey,this.gos))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(t){this.addOrRemoveCssClass("ag-selected",t),x._setAriaExpanded(this.eToggleButton,t)}getButtonElement(){return this.eToggleButton}},Ug=class extends x.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!==x.KeyCode.TAB||!t.shiftKey)){if(this.focusService.focusNextGridCoreContainer(!0)){t.preventDefault();return}x._stopPropagationForAgGrid(t)}}setActiveButton(t){this.buttonComps.forEach(e=>{e.setSelected(t===e.getToolPanelId())})}addButtonComp(t){const e=this.createBean(new $g(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),x._clearElement(this.getGui()),super.destroy()}destroy(){this.clearButtons(),super.destroy()}},Wg={selector:"AG-SIDE-BAR-BUTTONS",component:Ug},Dd={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},Fd={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},Ua={columns:Dd,filters:Fd};function Wa(t){if(!t)return;if(t===!0)return{toolPanels:[Dd,Fd],defaultToolPanel:"columns"};if(typeof t=="string")return Wa([t]);if(Array.isArray(t)){const n=[];return t.forEach(o=>{const s=Ua[o];if(!s){Rd(o);return}n.push(s)}),n.length===0?void 0:{toolPanels:n,defaultToolPanel:n[0].id}}return{toolPanels:Hg(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}function Rd(t){x._warnOnce(`the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(Ua).join(",")}`)}function Hg(t){const e=[];return t&&t.forEach(n=>{let o=null;if(typeof n=="string"){const s=Ua[n];if(!s){Rd(n);return}o=s}else o=n;e.push(o)}),e}var jg=class extends x.Component{constructor(){super('<div class="ag-tool-panel-horizontal-resize"></div>'),this.minWidth=100,this.maxWidth=null}wireBeans(t){this.horizontalResizeService=t.horizontalResizeService}setElementToResize(t){this.elementToResize=t}postConstruct(){const t=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(t),this.setInverted(this.gos.get("enableRtl"))}dispatchResizeEvent(t,e,n){this.eventService.dispatchEvent({type:"toolPanelSizeChanged",width:n,started:t,ended:e})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(t){return this.onResizing(t,!0)}onResizing(t,e=!1){const n=this.inverted?-1:1;let o=Math.max(this.minWidth,Math.floor(this.startingWidth-t*n));this.maxWidth!=null&&(o=Math.min(this.maxWidth,o)),this.elementToResize.style.width=`${o}px`,this.dispatchResizeEvent(!1,e,o)}setInverted(t){this.inverted=t}setMaxWidth(t){this.maxWidth=t}setMinWidth(t){t!=null?this.minWidth=t:this.minWidth=100}},qg=class extends x.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 jg);t.setAttribute("id",`ag-${this.getCompId()}`),e.setElementToResize(t),this.appendChild(e)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(t,e){const{id:n,minWidth:o,maxWidth:s,width:l}=t;this.toolPanelId=n,this.width=l;const d=this.userComponentFactory.getToolPanelCompDetails(t,e),u=d.newAgStackInstance();if(this.params=d.params,u==null){x._warnOnce(`error processing tool panel component ${n}. You need to specify 'toolPanel'`);return}u.then(this.setToolPanelComponent.bind(this)),o!=null&&this.resizeBar.setMinWidth(o),s!=null&&this.resizeBar.setMaxWidth(s)}setToolPanelComponent(t){this.toolPanelCompInstance=t,this.appendChild(t.getGui()),this.addDestroyFunc(()=>{this.destroyBean(t)}),this.width&&(this.getGui().style.width=`${this.width}px`)}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(t){const e=this.gos.get("enableRtl"),n=t==="left",o=e?n:!n;this.resizeBar.setInverted(o)}refresh(){var t;(t=this.toolPanelCompInstance)==null||t.refresh(this.params)}},Kg=class extends x.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>`,[Ug]),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:Ua(this.gos.get("sideBar")),sideBarState:t}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this);const e=this.getFocusableElement();this.createManagedBean(new b.ManagedFocusFeature(e,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),b._addFocusableContainerListener(this,e,this.focusService)}onTabKeyDown(t){if(t.defaultPrevented)return;const{focusService:e,sideBarButtons:n}=this,o=this.getGui(),s=n.getGui(),l=b._getActiveDomElement(this.gos),d=o.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=b._getActiveDomElement(this.gos);if(!this.sideBarButtons.getGui().contains(e))return;const n=this.sideBarButtons.getGui(),o=Array.prototype.slice.call(n.querySelectorAll(".ag-side-button")),s=o.findIndex(u=>u.contains(e));let l=null;switch(t.key){case b.KeyCode.LEFT:case b.KeyCode.UP:l=Math.max(0,s-1);break;case b.KeyCode.RIGHT:case b.KeyCode.DOWN:l=Math.min(s+1,o.length-1);break}if(l===null)return;const d=o[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 o=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(o,e,n),!this.toolPanelWrappers.length)return;const s=e?e.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(s),this.setSideBarPosition(e?e.position:this.sideBar.position),s)if(e){const{openToolPanel:l}=e;l&&this.openToolPanel(l,"sideBarInitializing")}else this.openToolPanel(this.sideBar.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(t){t||(t="right"),this.position=t;const e=t==="left",n=e?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",e),this.addOrRemoveCssClass("ag-side-bar-right",!e),this.toolPanelWrappers.forEach(o=>{o.setResizerSizerSide(n)}),this.dispatchSideBarUpdated(),this}setDisplayed(t,e){super.setDisplayed(t,e),this.dispatchSideBarUpdated()}getState(){const t={};return this.toolPanelWrappers.forEach(e=>{var n,o;t[e.getToolPanelId()]=(o=(n=e.getToolPanelInstance())==null?void 0:n.getState)==null?void 0:o.call(n)}),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:t}}createToolPanelsAndSideButtons(t,e,n){var o;for(const s of t)this.createToolPanelAndSideButton(s,(o=e==null?void 0:e.toolPanels)==null?void 0:o[s.id],n==null?void 0:n[s.id])}validateDef(t){var e;if(t.id==null)return b._warnOnce("please review all your toolPanel components, it seems like at least one of them doesn't have an id"),!1;if(t.toolPanel==="agColumnsToolPanel"&&!this.gos.assertModuleRegistered(b.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel"))return!1;if(t.toolPanel==="agFiltersToolPanel"){if(!this.gos.assertModuleRegistered(b.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel"))return!1;if((e=this.filterManager)!=null&&e.isAdvancedFilterEnabled())return b._warnOnce("Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled."),!1}return!0}createToolPanelAndSideButton(t,e,n){if(!this.validateDef(t))return;const o=this.sideBarButtons.addButtonComp(t);let s;n?s=n:(s=this.createBean(new jg),s.setToolPanelDef(t,{initialState:e,onStateUpdated:()=>this.dispatchSideBarUpdated()})),s.setDisplayed(!1);const l=s.getGui();this.appendChild(l),this.toolPanelWrappers.push(s),b._setAriaControls(o.getButtonElement(),l)}refresh(){this.toolPanelWrappers.forEach(t=>t.refresh())}openToolPanel(t,e="api"){const n=this.openedItem();if(n===t)return;this.toolPanelWrappers.forEach(l=>{const d=t===l.getToolPanelId();l.setDisplayed(d)});const o=this.openedItem();n!==o&&(this.sideBarButtons.setActiveButton(t),this.raiseToolPanelVisibleEvent(t,n??void 0,e))}getToolPanelInstance(t){const e=this.toolPanelWrappers.filter(n=>n.getToolPanelId()===t)[0];if(!e){b._warnOnce(`unable to lookup Tool Panel as invalid key supplied: ${t}`);return}return e.getToolPanelInstance()}raiseToolPanelVisibleEvent(t,e,n){const o=!!t&&!!e;e&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:e,visible:!1,switchingToolPanel:o}),t&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:t,visible:!0,switchingToolPanel:o})}close(t="api"){this.openToolPanel(void 0,t)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let t=null;return this.toolPanelWrappers.forEach(e=>{e.isDisplayed()&&(t=e.getToolPanelId())}),t}onSideBarUpdated(){var n;const t=Ua(this.gos.get("sideBar")),e={};t&&this.sideBar&&((n=t.toolPanels)==null||n.forEach(o=>{var f,m;const{id:s}=o;if(!s)return;const l=(f=this.sideBar.toolPanels)==null?void 0:f.find(y=>y.id===s);if(!l||o.toolPanel!==l.toolPanel)return;const d=this.toolPanelWrappers.find(y=>y.getToolPanelId()===s);if(!d)return;const u=this.gos.addGridCommonParams({...o.toolPanelParams??{},onStateUpdated:()=>this.dispatchSideBarUpdated()});((m=d.getToolPanelInstance())==null?void 0:m.refresh(u))===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(y=>y!==d),b._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=>{b._removeFromParent(t.getGui()),this.destroyBean(t)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}},Kg={selector:"AG-SIDE-BAR",component:qg},Yg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return Kg}},Wa="32.3.3",Rd=b._defineModule({version:Wa,moduleName:`${b.ModuleNames.SideBarModule}-core`,beans:[Vg,Yg],dependantModules:[Me.EnterpriseCoreModule]}),Jg=b._defineModule({version:Wa,moduleName:`${b.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:Pg,setSideBarVisible:Dg,setSideBarPosition:Fg,openToolPanel:Rg,closeToolPanel:Mg,getOpenedToolPanel:Ig,refreshToolPanel:Og,isToolPanelShowing:Lg,getToolPanelInstance:Gg,getSideBar:zg},dependantModules:[Rd]}),Ha=b._defineModule({version:Wa,moduleName:b.ModuleNames.SideBarModule,dependantModules:[Rd,Jg]}),Xg={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},Qg=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=ey,t.first=ty,t.last=ny,t.min=ry,t.max=oy,t.count=iy,t.avg=sy,this.initialised=!0}isAggFuncPossible(t,e){const n=this.getFuncNames(t),o=b._includes(n,e),s=b._exists(this.aggFuncsMap[e]);return o&&s}getDefaultFuncLabel(t){return Xg[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 ey(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const s=e[o];typeof s=="number"?n===null?n=s:n+=typeof n=="number"?s:BigInt(s):typeof s=="bigint"&&(n===null?n=s:n=(typeof n=="bigint"?n:BigInt(n))+s)}return n}function ty(t){return t.values.length>0?t.values[0]:null}function ny(t){return t.values.length>0?b._last(t.values):null}function ry(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const s=e[o];(typeof s=="number"||typeof s=="bigint")&&(n===null||n>s)&&(n=s)}return n}function oy(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const s=e[o];(typeof s=="number"||typeof s=="bigint")&&(n===null||n<s)&&(n=s)}return n}function iy(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 o=(l=(s=t.rowNode)==null?void 0:s.aggData)==null?void 0:l[t.column.getColId()];return o&&o.value===n?o:{value:n,toString:function(){return this.value.toString()},toNumber:function(){return this.value}}}function sy(t){var d,u,p;const{values:e}=t;let n=0,o=0;for(let f=0;f<e.length;f++){const m=e[f];let y=null;typeof m=="number"||typeof m=="bigint"?(y=m,o++):m!=null&&(typeof m.value=="number"||typeof m.value=="bigint")&&typeof m.count=="number"&&(y=m.value*(typeof m.value=="number"?m.count:BigInt(m.count)),o+=m.count),typeof y=="number"?n+=typeof n=="number"?y:BigInt(y):typeof y=="bigint"&&(n=(typeof n=="bigint"?n:BigInt(n))+y)}let s=null;o>0&&(s=n/(typeof n=="number"?o:BigInt(o)));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===o&&l.value===s?l:{count:o,value:s,toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}}}var ay=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="aggregationStage"}wireBeans(t){this.columnModel=t.columnModel,this.aggFuncService=t.aggFuncService,this.funcColsService=t.funcColsService,this.pivotResultColsService=t.pivotResultColsService,this.valueService=t.valueService}execute(t){const e=b._missingOrEmpty(this.funcColsService.getValueColumns()),n=!this.gos.getCallback("getGroupRowAgg"),o=t.changedPath&&t.changedPath.isActive();if(e&&n&&o)return;const s=this.createAggDetails(t);this.recursivelyCreateAggData(s)}createAggDetails(t){const e=this.columnModel.isPivotActive(),n=this.funcColsService.getValueColumns(),o=e?this.funcColsService.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!b._getGrandTotalRow(this.gos),changedPath:t.changedPath,valueColumns:n,pivotColumns:o,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return b._getGroupAggFiltering(this.gos)!==void 0||this.gos.get("suppressAggFilteredOnly")}recursivelyCreateAggData(t){const e=n=>{if(!n.hasChildren()){n.aggData&&n.setAggData(null);return}if(n.level===-1&&!t.groupIncludeTotalFooter){const l=!this.columnModel.isPivotMode();if(!t.alwaysAggregateAtRootLevel&&l){n.setAggData(null);return}}this.aggregateRowNode(n,t)};t.changedPath.forEachChangedNodeDepthFirst(e,!0)}aggregateRowNode(t,e){const n=e.valueColumns.length===0,o=e.pivotColumns.length===0;let s;e.userAggFunc?s=e.userAggFunc({nodes:t.childrenAfterFilter}):n?s=null:o?s=this.aggregateRowNodeUsingValuesOnly(t,e):s=this.aggregateRowNodeUsingValuesAndPivot(t),t.setAggData(s),t.sibling&&t.sibling.setAggData(s)}aggregateRowNodeUsingValuesAndPivot(t){var s;const e={},n=((s=this.pivotResultColsService.getPivotResultCols())==null?void 0:s.list)??[];let o=!0;for(let l=0;l<n.length;l++){const d=n[l],u=d.getColDef();if(u.pivotTotalColumnIds!=null){o=!1;continue}const p=u.pivotKeys??[];let f;t.leafGroup?f=this.getValuesFromMappedSet(t.childrenMapped,p,u.pivotValueColumn):f=this.getValuesPivotNonLeaf(t,u.colId),e[u.colId]=this.aggregateValues(f,u.pivotValueColumn.getAggFunc(),u.pivotValueColumn,t,d)}if(!o)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={},o=e.changedPath.isActive()?e.changedPath.getValueColumnsForNode(t,e.valueColumns):e.valueColumns,s=e.changedPath.isActive()?e.changedPath.getNotValueColumnsForNode(t,e.valueColumns):null,l=this.getValuesNormal(t,o,e.filteredOnly),d=t.aggData;return o.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 o=t;for(let s=0;s<e.length;s++){const l=e[s];o=o?o[l]:null}return o?o.map(s=>this.valueService.getValue(n,s)):[]}getValuesNormal(t,e,n){const o=[];e.forEach(()=>o.push([]));const s=e.length,l=n?t.childrenAfterFilter:t.childrenAfterGroup,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],y=this.valueService.getValue(m,p);o[f].push(y)}}return o}aggregateValues(t,e,n,o,s){const l=typeof e=="string"?this.aggFuncService.getAggFunc(e):e;if(typeof l!="function")return b._errorOnce(`unrecognised aggregation function ${e}`),null;const d=l,u=this.gos.addGridCommonParams({values:t,column:n,colDef:n?n.getColDef():void 0,pivotResultColumn:s,rowNode:o,data:o?o.data:void 0});return d(u)}},ly=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="autoColService"}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.columnFactory=t.columnFactory}createAutoCols(t){const e=[],n=this.gos.get("treeData");let o=b._isGroupMultiAutoColumn(this.gos);return n&&o&&(b._warnOnce('you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),o=!1),o?t.forEach((s,l)=>{e.push(this.createOneAutoCol(s,l))}):e.push(this.createOneAutoCol()),e}updateAutoCols(t,e){t.forEach((n,o)=>this.updateOneAutoCol(n,o,e))}createOneAutoCol(t,e){let n;t?n=`${b.GROUP_AUTO_COLUMN_ID}-${t.getId()}`:n=b.GROUP_AUTO_COLUMN_ID;const o=this.createAutoColDef(n,t,e);o.colId=n;const s=new b.AgColumn(o,null,n,!0);return this.createBean(s),s}updateOneAutoCol(t,e,n){const o=t.getColDef(),s=typeof o.showRowGroup=="string"?o.showRowGroup:void 0,l=s!=null?this.columnModel.getColDefCol(s):void 0,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 o=this.createBaseColDef(e);const s=this.gos.get("autoGroupColumnDef");b._mergeDeep(o,s),o=this.columnFactory.addColumnDefaultAndTypes(o,t),this.gos.get("treeData")||b._missing(o.field)&&b._missing(o.valueGetter)&&b._missing(o.filterValueGetter)&&o.filter!=="agGroupColumnFilter"&&(o.filter=!1),n&&n>0&&(o.headerCheckboxSelection=!1);const l=b._isColumnsSortingCoupledToGroup(this.gos),d=o.valueGetter||o.field!=null;return l&&!d&&(o.sortIndex=void 0,o.initialSort=void 0),o}createBaseColDef(t){const e=this.gos.get("autoGroupColumnDef"),o={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(e&&(e.cellRenderer||e.cellRendererSelector)||(o.cellRenderer="agGroupCellRenderer"),t){const l=t.getColDef();Object.assign(o,{headerName:this.columnNameService.getDisplayNameForColumn(t,"header"),headerValueGetter:l.headerValueGetter}),l.cellRenderer&&Object.assign(o,{cellRendererParams:{innerRenderer:l.cellRenderer,innerRendererParams:l.cellRendererParams}}),o.showRowGroup=t.getColId()}else o.showRowGroup=!0;return o}},cy=class extends Me.PillDragComp{constructor(t,e,n,o,s){super(e,n,s,`
|
|
10
|
+
</div>`,[Wg]),this.sideBarButtons=x.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:Wa(this.gos.get("sideBar")),sideBarState:t}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this);const e=this.getFocusableElement();this.createManagedBean(new x.ManagedFocusFeature(e,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),x._addFocusableContainerListener(this,e,this.focusService)}onTabKeyDown(t){if(t.defaultPrevented)return;const{focusService:e,sideBarButtons:n}=this,o=this.getGui(),s=n.getGui(),l=x._getActiveDomElement(this.gos),d=o.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=x._getActiveDomElement(this.gos);if(!this.sideBarButtons.getGui().contains(e))return;const n=this.sideBarButtons.getGui(),o=Array.prototype.slice.call(n.querySelectorAll(".ag-side-button")),s=o.findIndex(u=>u.contains(e));let l=null;switch(t.key){case x.KeyCode.LEFT:case x.KeyCode.UP:l=Math.max(0,s-1);break;case x.KeyCode.RIGHT:case x.KeyCode.DOWN:l=Math.min(s+1,o.length-1);break}if(l===null)return;const d=o[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 o=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(o,e,n),!this.toolPanelWrappers.length)return;const s=e?e.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(s),this.setSideBarPosition(e?e.position:this.sideBar.position),s)if(e){const{openToolPanel:l}=e;l&&this.openToolPanel(l,"sideBarInitializing")}else this.openToolPanel(this.sideBar.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(t){t||(t="right"),this.position=t;const e=t==="left",n=e?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",e),this.addOrRemoveCssClass("ag-side-bar-right",!e),this.toolPanelWrappers.forEach(o=>{o.setResizerSizerSide(n)}),this.dispatchSideBarUpdated(),this}setDisplayed(t,e){super.setDisplayed(t,e),this.dispatchSideBarUpdated()}getState(){const t={};return this.toolPanelWrappers.forEach(e=>{var n,o;t[e.getToolPanelId()]=(o=(n=e.getToolPanelInstance())==null?void 0:n.getState)==null?void 0:o.call(n)}),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:t}}createToolPanelsAndSideButtons(t,e,n){var o;for(const s of t)this.createToolPanelAndSideButton(s,(o=e==null?void 0:e.toolPanels)==null?void 0:o[s.id],n==null?void 0:n[s.id])}validateDef(t){var e;if(t.id==null)return x._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(x.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel"))return!1;if(t.toolPanel==="agFiltersToolPanel"){if(!this.gos.assertModuleRegistered(x.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel"))return!1;if((e=this.filterManager)!=null&&e.isAdvancedFilterEnabled())return x._warnOnce("Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled."),!1}return!0}createToolPanelAndSideButton(t,e,n){if(!this.validateDef(t))return;const o=this.sideBarButtons.addButtonComp(t);let s;n?s=n:(s=this.createBean(new qg),s.setToolPanelDef(t,{initialState:e,onStateUpdated:()=>this.dispatchSideBarUpdated()})),s.setDisplayed(!1);const l=s.getGui();this.appendChild(l),this.toolPanelWrappers.push(s),x._setAriaControls(o.getButtonElement(),l)}refresh(){this.toolPanelWrappers.forEach(t=>t.refresh())}openToolPanel(t,e="api"){const n=this.openedItem();if(n===t)return;this.toolPanelWrappers.forEach(l=>{const d=t===l.getToolPanelId();l.setDisplayed(d)});const o=this.openedItem();n!==o&&(this.sideBarButtons.setActiveButton(t),this.raiseToolPanelVisibleEvent(t,n??void 0,e))}getToolPanelInstance(t){const e=this.toolPanelWrappers.filter(n=>n.getToolPanelId()===t)[0];if(!e){x._warnOnce(`unable to lookup Tool Panel as invalid key supplied: ${t}`);return}return e.getToolPanelInstance()}raiseToolPanelVisibleEvent(t,e,n){const o=!!t&&!!e;e&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:e,visible:!1,switchingToolPanel:o}),t&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:t,visible:!0,switchingToolPanel:o})}close(t="api"){this.openToolPanel(void 0,t)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let t=null;return this.toolPanelWrappers.forEach(e=>{e.isDisplayed()&&(t=e.getToolPanelId())}),t}onSideBarUpdated(){var n;const t=Wa(this.gos.get("sideBar")),e={};t&&this.sideBar&&((n=t.toolPanels)==null||n.forEach(o=>{var f,m;const{id:s}=o;if(!s)return;const l=(f=this.sideBar.toolPanels)==null?void 0:f.find(y=>y.id===s);if(!l||o.toolPanel!==l.toolPanel)return;const d=this.toolPanelWrappers.find(y=>y.getToolPanelId()===s);if(!d)return;const u=this.gos.addGridCommonParams({...o.toolPanelParams??{},onStateUpdated:()=>this.dispatchSideBarUpdated()});((m=d.getToolPanelInstance())==null?void 0:m.refresh(u))===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(y=>y!==d),x._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=>{x._removeFromParent(t.getGui()),this.destroyBean(t)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}},Yg={selector:"AG-SIDE-BAR",component:Kg},Jg=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return Yg}},Ha="32.3.3",Md=x._defineModule({version:Ha,moduleName:`${x.ModuleNames.SideBarModule}-core`,beans:[Pg,Jg],dependantModules:[Ie.EnterpriseCoreModule]}),Xg=x._defineModule({version:Ha,moduleName:`${x.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:Dg,setSideBarVisible:Fg,setSideBarPosition:Rg,openToolPanel:Mg,closeToolPanel:Ig,getOpenedToolPanel:Og,refreshToolPanel:Lg,isToolPanelShowing:Gg,getToolPanelInstance:zg,getSideBar:Zg},dependantModules:[Md]}),ja=x._defineModule({version:Ha,moduleName:x.ModuleNames.SideBarModule,dependantModules:[Md,Xg]}),Qg={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},ey=class extends x.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=ty,t.first=ny,t.last=ry,t.min=oy,t.max=iy,t.count=sy,t.avg=ay,this.initialised=!0}isAggFuncPossible(t,e){const n=this.getFuncNames(t),o=x._includes(n,e),s=x._exists(this.aggFuncsMap[e]);return o&&s}getDefaultFuncLabel(t){return Qg[t]??t}getDefaultAggFunc(t){const e=t.getColDef().defaultAggFunc;if(x._exists(e)&&this.isAggFuncPossible(t,e))return e;if(this.isAggFuncPossible(t,"sum"))return"sum";const n=this.getFuncNames(t);return x._existsAndNotEmpty(n)?n[0]:null}addAggFuncs(t){this.init(),x._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 ty(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const s=e[o];typeof s=="number"?n===null?n=s:n+=typeof n=="number"?s:BigInt(s):typeof s=="bigint"&&(n===null?n=s:n=(typeof n=="bigint"?n:BigInt(n))+s)}return n}function ny(t){return t.values.length>0?t.values[0]:null}function ry(t){return t.values.length>0?x._last(t.values):null}function oy(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const s=e[o];(typeof s=="number"||typeof s=="bigint")&&(n===null||n>s)&&(n=s)}return n}function iy(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const s=e[o];(typeof s=="number"||typeof s=="bigint")&&(n===null||n<s)&&(n=s)}return n}function sy(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 o=(l=(s=t.rowNode)==null?void 0:s.aggData)==null?void 0:l[t.column.getColId()];return o&&o.value===n?o:{value:n,toString:function(){return this.value.toString()},toNumber:function(){return this.value}}}function ay(t){var d,u,p;const{values:e}=t;let n=0,o=0;for(let f=0;f<e.length;f++){const m=e[f];let y=null;typeof m=="number"||typeof m=="bigint"?(y=m,o++):m!=null&&(typeof m.value=="number"||typeof m.value=="bigint")&&typeof m.count=="number"&&(y=m.value*(typeof m.value=="number"?m.count:BigInt(m.count)),o+=m.count),typeof y=="number"?n+=typeof n=="number"?y:BigInt(y):typeof y=="bigint"&&(n=(typeof n=="bigint"?n:BigInt(n))+y)}let s=null;o>0&&(s=n/(typeof n=="number"?o:BigInt(o)));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===o&&l.value===s?l:{count:o,value:s,toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}}}var ly=class extends x.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=x._missingOrEmpty(this.funcColsService.getValueColumns()),n=!this.gos.getCallback("getGroupRowAgg"),o=t.changedPath&&t.changedPath.isActive();if(e&&n&&o)return;const s=this.createAggDetails(t);this.recursivelyCreateAggData(s)}createAggDetails(t){const e=this.columnModel.isPivotActive(),n=this.funcColsService.getValueColumns(),o=e?this.funcColsService.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!x._getGrandTotalRow(this.gos),changedPath:t.changedPath,valueColumns:n,pivotColumns:o,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return x._getGroupAggFiltering(this.gos)!==void 0||this.gos.get("suppressAggFilteredOnly")}recursivelyCreateAggData(t){const e=n=>{if(!n.hasChildren()){n.aggData&&n.setAggData(null);return}if(n.level===-1&&!t.groupIncludeTotalFooter){const l=!this.columnModel.isPivotMode();if(!t.alwaysAggregateAtRootLevel&&l){n.setAggData(null);return}}this.aggregateRowNode(n,t)};t.changedPath.forEachChangedNodeDepthFirst(e,!0)}aggregateRowNode(t,e){const n=e.valueColumns.length===0,o=e.pivotColumns.length===0;let s;e.userAggFunc?s=e.userAggFunc({nodes:t.childrenAfterFilter}):n?s=null:o?s=this.aggregateRowNodeUsingValuesOnly(t,e):s=this.aggregateRowNodeUsingValuesAndPivot(t),t.setAggData(s),t.sibling&&t.sibling.setAggData(s)}aggregateRowNodeUsingValuesAndPivot(t){var s;const e={},n=((s=this.pivotResultColsService.getPivotResultCols())==null?void 0:s.list)??[];let o=!0;for(let l=0;l<n.length;l++){const d=n[l],u=d.getColDef();if(u.pivotTotalColumnIds!=null){o=!1;continue}const p=u.pivotKeys??[];let f;t.leafGroup?f=this.getValuesFromMappedSet(t.childrenMapped,p,u.pivotValueColumn):f=this.getValuesPivotNonLeaf(t,u.colId),e[u.colId]=this.aggregateValues(f,u.pivotValueColumn.getAggFunc(),u.pivotValueColumn,t,d)}if(!o)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={},o=e.changedPath.isActive()?e.changedPath.getValueColumnsForNode(t,e.valueColumns):e.valueColumns,s=e.changedPath.isActive()?e.changedPath.getNotValueColumnsForNode(t,e.valueColumns):null,l=this.getValuesNormal(t,o,e.filteredOnly),d=t.aggData;return o.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 o=t;for(let s=0;s<e.length;s++){const l=e[s];o=o?o[l]:null}return o?o.map(s=>this.valueService.getValue(n,s)):[]}getValuesNormal(t,e,n){const o=[];e.forEach(()=>o.push([]));const s=e.length,l=n?t.childrenAfterFilter:t.childrenAfterGroup,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],y=this.valueService.getValue(m,p);o[f].push(y)}}return o}aggregateValues(t,e,n,o,s){const l=typeof e=="string"?this.aggFuncService.getAggFunc(e):e;if(typeof l!="function")return x._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:o,data:o?o.data:void 0});return d(u)}},cy=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="autoColService"}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.columnFactory=t.columnFactory}createAutoCols(t){const e=[],n=this.gos.get("treeData");let o=x._isGroupMultiAutoColumn(this.gos);return n&&o&&(x._warnOnce('you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),o=!1),o?t.forEach((s,l)=>{e.push(this.createOneAutoCol(s,l))}):e.push(this.createOneAutoCol()),e}updateAutoCols(t,e){t.forEach((n,o)=>this.updateOneAutoCol(n,o,e))}createOneAutoCol(t,e){let n;t?n=`${x.GROUP_AUTO_COLUMN_ID}-${t.getId()}`:n=x.GROUP_AUTO_COLUMN_ID;const o=this.createAutoColDef(n,t,e);o.colId=n;const s=new x.AgColumn(o,null,n,!0);return this.createBean(s),s}updateOneAutoCol(t,e,n){const o=t.getColDef(),s=typeof o.showRowGroup=="string"?o.showRowGroup:void 0,l=s!=null?this.columnModel.getColDefCol(s):void 0,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 o=this.createBaseColDef(e);const s=this.gos.get("autoGroupColumnDef");x._mergeDeep(o,s),o=this.columnFactory.addColumnDefaultAndTypes(o,t),this.gos.get("treeData")||x._missing(o.field)&&x._missing(o.valueGetter)&&x._missing(o.filterValueGetter)&&o.filter!=="agGroupColumnFilter"&&(o.filter=!1),n&&n>0&&(o.headerCheckboxSelection=!1);const l=x._isColumnsSortingCoupledToGroup(this.gos),d=o.valueGetter||o.field!=null;return l&&!d&&(o.sortIndex=void 0,o.initialSort=void 0),o}createBaseColDef(t){const e=this.gos.get("autoGroupColumnDef"),o={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(e&&(e.cellRenderer||e.cellRendererSelector)||(o.cellRenderer="agGroupCellRenderer"),t){const l=t.getColDef();Object.assign(o,{headerName:this.columnNameService.getDisplayNameForColumn(t,"header"),headerValueGetter:l.headerValueGetter}),l.cellRenderer&&Object.assign(o,{cellRendererParams:{innerRenderer:l.cellRenderer,innerRendererParams:l.cellRendererParams}}),o.showRowGroup=t.getColId()}else o.showRowGroup=!0;return o}},dy=class extends Ie.PillDragComp{constructor(t,e,n,o,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
|
-
`,[b.SortIndicatorSelector]),this.column=t,this.dropZonePurpose=o,this.eSortIndicator=b.RefPlaceholder,this.popupShowing=!1}wireBeans(t){super.wireBeans(t),this.popupService=t.popupService,this.sortController=t.sortController,this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService,this.aggFuncService=t.aggFuncService}postConstruct(){this.displayName=this.columnNameService.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}}),this.isGroupingZone()&&this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(t,e){const n=this.gos.get("rowGroupPanelSuppressSort"),o=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!o){const s=e("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");t.push(s)}if(this.isGroupingZone()&&this.column.isSortable()&&!n){const s=e("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");t.push(s)}super.addAdditionalAriaInstructions(t,e)}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){const t=this.localeService.getLocaleTextFunc(),{name:e,aggFuncName:n}=this.getColumnAndAggFuncName(),o=t("ariaDropZoneColumnComponentAggFuncSeparator"," of "),s={asc:t("ariaDropZoneColumnComponentSortAscending","ascending"),desc:t("ariaDropZoneColumnComponentSortDescending","descending")},l=this.column.getSort(),d=this.gos.get("rowGroupPanelSuppressSort");return[n&&`${n}${o}`,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(),o=typeof n=="string"?n:"agg";e=this.localeService.getLocaleTextFunc()(o,o)}return{name:t,aggFuncName:e}}setupSort(){const t=this.column.isSortable(),e=this.isGroupingZone();if(!(!t||!e)&&!this.gos.get("rowGroupPanelSuppressSort")){this.eSortIndicator.setupSort(this.column,!0);const n=o=>{o.preventDefault();const l=this.gos.get("multiSortKey")==="ctrl"?o.ctrlKey||o.metaKey:o.shiftKey;this.sortController.progressSort(this.column,l,"uiColumnSorted")};this.addGuiEventListener("click",n),this.addGuiEventListener("keydown",o=>{o.key===b.KeyCode.ENTER&&this.isGroupingZone()&&n(o)})}}getDefaultIconName(){return"hide"}createGetDragItem(){const{column:t}=this;return()=>{const e={};return e[t.getId()]=t.isVisible(),{columns:[t],visibleState:e}}}setupComponents(){super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(t){super.onKeyDown(t),t.key===b.KeyCode.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&(t.preventDefault(),this.onShowAggFuncSelection())}getDisplayValue(){const{name:t,aggFuncName:e}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${e}(${t})`:t}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;const t=new Me.VirtualList({cssIdentifier:"select-agg-func"}),e=this.aggFuncService.getFuncNames(this.column),n=this.getGui(),o=t.getGui();t.setModel({getRow:function(m){return e[m]},getRowCount:function(){return e.length}}),this.createBean(t);const s=b._loadTemplate('<div class="ag-select-agg-func-popup"></div>');s.style.top="0px",s.style.left="0px",s.appendChild(o),s.style.width=`${n.clientWidth}px`;const[l]=this.addManagedElementListeners(s,{focusout:m=>{!s.contains(m.relatedTarget)&&p&&p.hideFunc()}}),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===b.KeyCode.ENTER||m.key===b.KeyCode.SPACE){const y=t.getLastFocusedRow();if(y==null)return;const E=t.getComponentAt(y);E&&E.selectItem()}}),this.popupService.positionPopupByComponent({type:"aggFuncSelect",eventSource:n,ePopup:s,keepWithinBounds:!0,column:this.column,position:"under"}),t.refresh();let f=e.findIndex(m=>m===this.column.getAggFunc());f===-1&&(f=0),t.focusRow(f)}createAggSelect(t,e){const n=()=>{t(),this.getGui().focus(),this.funcColsService.setColumnAggFunc(this.column,e,"toolPanelDragAndDrop")},o=this.localeService.getLocaleTextFunc(),s=e.toString(),l=o(s,s);return new dy(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}},dy=class extends b.Component{constructor(t,e){super('<div class="ag-select-agg-func-item"/>'),this.selectItem=t,this.getGui().innerText=e,this.addGuiEventListener("click",this.selectItem)}},ja=class extends Me.PillDropZonePanel{constructor(t,e){super(t),this.dropZonePurpose=e}wireBeans(t){super.wireBeans(t),this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}init(t){super.init(t),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(t){return t.columns??[]}isInterestedIn(t){return t===b.DragSourceType.HeaderCell||t===b.DragSourceType.ToolPanel}minimumAllowedNewInsertIndex(){const t=this.gos.get("groupLockGroupColumns"),e=this.funcColsService.getRowGroupColumns().length;return t===-1?e:Math.min(t,e)}showOrHideColumnOnExit(t){return this.isRowGroupPanel()&&!this.gos.get("suppressRowGroupHidesColumns")&&!t.fromNudge}handleDragEnterEnd(t){if(this.showOrHideColumnOnExit(t)){const o=t.dragSource.getDragItem().columns;this.setColumnsVisible(o,!1,"uiColumnDragged")}}handleDragLeaveEnd(t){if(this.showOrHideColumnOnExit(t)){const n=t.dragSource.getDragItem();this.setColumnsVisible(n.columns,!0,"uiColumnDragged")}}setColumnsVisible(t,e,n){if(t){const o=t.filter(s=>!s.getColDef().lockVisible);this.columnModel.setColsVisible(o,e,n)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(t,e,n,o){return new cy(t,e,n,this.dropZonePurpose,o)}},qa=class extends ja{constructor(t){super(t,"pivot")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("pivotColumnsEmptyMessage","Drag here to set column labels"),n=t("pivots","Column Labels");super.init({icon:b._createIconNoSpan("pivotPanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}getTooltipParams(){const t=super.getTooltipParams();return t.location="pivotColumnsList",t}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){const t=this.columnModel.isPivotMode();if(this.isHorizontal())switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(t);break;case"onlyWhenPivoting":{const e=this.columnModel.isPivotActive();this.setDisplayed(t&&e);break}default:this.setDisplayed(!1);break}else this.setDisplayed(t)}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowPivot()&&(!t.isPivotActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setPivotColumns(t,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.funcColsService.getPivotColumns()}},Ka=class extends ja{constructor(t){super(t,"rowGroup")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("rowGroupColumnsEmptyMessage","Drag here to set row groups"),n=t("groups","Row Groups");super.init({icon:b._createIconNoSpan("rowGroupPanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}getTooltipParams(){const t=super.getTooltipParams();return t.location="rowGroupColumnsList",t}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowRowGroup()&&(!t.isRowGroupActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setRowGroupColumns(t,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.funcColsService.getRowGroupColumns()}},uy=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 Ka(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new qa(!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)}},py={selector:"AG-GRID-HEADER-DROP-ZONES",component:uy},hy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return py}},fy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="filterAggregatesStage"}wireBeans(t){this.filterManager=t.filterManager,this.columnModel=t.columnModel}execute(t){var f,m;const e=this.columnModel.isPivotMode(),n=((f=this.filterManager)==null?void 0:f.isAggregateFilterPresent())||((m=this.filterManager)==null?void 0:m.isAggregateQuickFilterPresent()),o=y=>!y.node.group,s=y=>y.node.leafGroup,l=b._getGroupAggFiltering(this.gos)||(e?s:o),{changedPath:d}=t,u=(y,E=!1)=>{y.childrenAfterFilter&&(y.childrenAfterAggFilter=y.childrenAfterFilter,E&&y.childrenAfterAggFilter.forEach(S=>u(S,E)),this.setAllChildrenCount(y)),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)},p=y=>{var E;y.childrenAfterAggFilter=((E=y.childrenAfterFilter)==null?void 0:E.filter(S=>{var z;return l({node:S})&&this.filterManager.doesRowPassAggregateFilters({rowNode:S})?(u(S,!0),!0):(z=S.childrenAfterAggFilter)==null?void 0:z.length}))||null,this.setAllChildrenCount(y),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)};d.forEachChangedNodeDepthFirst(n?p:u,!0)}setAllChildrenCountTreeData(t){const e=t.childrenAfterAggFilter;let n=0;if(e){const o=e.length;n=o;for(let s=0;s<o;++s)n+=e[s].allChildrenCount??0}t.setAllChildrenCount(n===0&&t.level>=0?null:n)}setAllChildrenCountGridGrouping(t){let e=0;t.childrenAfterAggFilter.forEach(n=>{n.group?e+=n.allChildrenCount:e++}),t.setAllChildrenCount(e)}setAllChildrenCount(t){if(!t.hasChildren()){t.setAllChildrenCount(null);return}this.gos.get("treeData")?this.setAllChildrenCountTreeData(t):this.setAllChildrenCountGridGrouping(t)}},my=class extends b.TabGuardComp{constructor(){super(`
|
|
17
|
+
`,[x.SortIndicatorSelector]),this.column=t,this.dropZonePurpose=o,this.eSortIndicator=x.RefPlaceholder,this.popupShowing=!1}wireBeans(t){super.wireBeans(t),this.popupService=t.popupService,this.sortController=t.sortController,this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService,this.aggFuncService=t.aggFuncService}postConstruct(){this.displayName=this.columnNameService.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}}),this.isGroupingZone()&&this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(t,e){const n=this.gos.get("rowGroupPanelSuppressSort"),o=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!o){const s=e("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");t.push(s)}if(this.isGroupingZone()&&this.column.isSortable()&&!n){const s=e("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");t.push(s)}super.addAdditionalAriaInstructions(t,e)}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){const t=this.localeService.getLocaleTextFunc(),{name:e,aggFuncName:n}=this.getColumnAndAggFuncName(),o=t("ariaDropZoneColumnComponentAggFuncSeparator"," of "),s={asc:t("ariaDropZoneColumnComponentSortAscending","ascending"),desc:t("ariaDropZoneColumnComponentSortDescending","descending")},l=this.column.getSort(),d=this.gos.get("rowGroupPanelSuppressSort");return[n&&`${n}${o}`,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(),o=typeof n=="string"?n:"agg";e=this.localeService.getLocaleTextFunc()(o,o)}return{name:t,aggFuncName:e}}setupSort(){const t=this.column.isSortable(),e=this.isGroupingZone();if(!(!t||!e)&&!this.gos.get("rowGroupPanelSuppressSort")){this.eSortIndicator.setupSort(this.column,!0);const n=o=>{o.preventDefault();const l=this.gos.get("multiSortKey")==="ctrl"?o.ctrlKey||o.metaKey:o.shiftKey;this.sortController.progressSort(this.column,l,"uiColumnSorted")};this.addGuiEventListener("click",n),this.addGuiEventListener("keydown",o=>{o.key===x.KeyCode.ENTER&&this.isGroupingZone()&&n(o)})}}getDefaultIconName(){return"hide"}createGetDragItem(){const{column:t}=this;return()=>{const e={};return e[t.getId()]=t.isVisible(),{columns:[t],visibleState:e}}}setupComponents(){super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(t){super.onKeyDown(t),t.key===x.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 Ie.VirtualList({cssIdentifier:"select-agg-func"}),e=this.aggFuncService.getFuncNames(this.column),n=this.getGui(),o=t.getGui();t.setModel({getRow:function(m){return e[m]},getRowCount:function(){return e.length}}),this.createBean(t);const s=x._loadTemplate('<div class="ag-select-agg-func-popup"></div>');s.style.top="0px",s.style.left="0px",s.appendChild(o),s.style.width=`${n.clientWidth}px`;const[l]=this.addManagedElementListeners(s,{focusout:m=>{!s.contains(m.relatedTarget)&&p&&p.hideFunc()}}),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===x.KeyCode.ENTER||m.key===x.KeyCode.SPACE){const y=t.getLastFocusedRow();if(y==null)return;const B=t.getComponentAt(y);B&&B.selectItem()}}),this.popupService.positionPopupByComponent({type:"aggFuncSelect",eventSource:n,ePopup:s,keepWithinBounds:!0,column:this.column,position:"under"}),t.refresh();let f=e.findIndex(m=>m===this.column.getAggFunc());f===-1&&(f=0),t.focusRow(f)}createAggSelect(t,e){const n=()=>{t(),this.getGui().focus(),this.funcColsService.setColumnAggFunc(this.column,e,"toolPanelDragAndDrop")},o=this.localeService.getLocaleTextFunc(),s=e.toString(),l=o(s,s);return new uy(n,l)}isGroupingAndLocked(){return this.isGroupingZone()&&this.columnModel.isColGroupLocked(this.column)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return x.DragSourceType.ToolPanel}destroy(){super.destroy(),this.column=null}},uy=class extends x.Component{constructor(t,e){super('<div class="ag-select-agg-func-item"/>'),this.selectItem=t,this.getGui().innerText=e,this.addGuiEventListener("click",this.selectItem)}},qa=class extends Ie.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===x.DragSourceType.HeaderCell||t===x.DragSourceType.ToolPanel}minimumAllowedNewInsertIndex(){const t=this.gos.get("groupLockGroupColumns"),e=this.funcColsService.getRowGroupColumns().length;return t===-1?e:Math.min(t,e)}showOrHideColumnOnExit(t){return this.isRowGroupPanel()&&!this.gos.get("suppressRowGroupHidesColumns")&&!t.fromNudge}handleDragEnterEnd(t){if(this.showOrHideColumnOnExit(t)){const o=t.dragSource.getDragItem().columns;this.setColumnsVisible(o,!1,"uiColumnDragged")}}handleDragLeaveEnd(t){if(this.showOrHideColumnOnExit(t)){const n=t.dragSource.getDragItem();this.setColumnsVisible(n.columns,!0,"uiColumnDragged")}}setColumnsVisible(t,e,n){if(t){const o=t.filter(s=>!s.getColDef().lockVisible);this.columnModel.setColsVisible(o,e,n)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(t,e,n,o){return new dy(t,e,n,this.dropZonePurpose,o)}},Ka=class extends qa{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:x._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()}},Ya=class extends qa{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:x._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()}},py=class extends x.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"),x._setAriaRole(t,"presentation"),this.rowGroupComp=new Ya(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new Ka(!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)}},hy={selector:"AG-GRID-HEADER-DROP-ZONES",component:py},fy=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return hy}},my=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="filterAggregatesStage"}wireBeans(t){this.filterManager=t.filterManager,this.columnModel=t.columnModel}execute(t){var f,m;const e=this.columnModel.isPivotMode(),n=((f=this.filterManager)==null?void 0:f.isAggregateFilterPresent())||((m=this.filterManager)==null?void 0:m.isAggregateQuickFilterPresent()),o=y=>!y.node.group,s=y=>y.node.leafGroup,l=x._getGroupAggFiltering(this.gos)||(e?s:o),{changedPath:d}=t,u=(y,B=!1)=>{y.childrenAfterFilter&&(y.childrenAfterAggFilter=y.childrenAfterFilter,B&&y.childrenAfterAggFilter.forEach(T=>u(T,B)),this.setAllChildrenCount(y)),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)},p=y=>{var B;y.childrenAfterAggFilter=((B=y.childrenAfterFilter)==null?void 0:B.filter(T=>{var G;return l({node:T})&&this.filterManager.doesRowPassAggregateFilters({rowNode:T})?(u(T,!0),!0):(G=T.childrenAfterAggFilter)==null?void 0:G.length}))||null,this.setAllChildrenCount(y),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)};d.forEachChangedNodeDepthFirst(n?p:u,!0)}setAllChildrenCountTreeData(t){const e=t.childrenAfterAggFilter;let n=0;if(e){const o=e.length;n=o;for(let s=0;s<o;++s)n+=e[s].allChildrenCount??0}t.setAllChildrenCount(n===0&&t.level>=0?null:n)}setAllChildrenCountGridGrouping(t){let e=0;t.childrenAfterAggFilter.forEach(n=>{n.group?e+=n.allChildrenCount:e++}),t.setAllChildrenCount(e)}setAllChildrenCount(t){if(!t.hasChildren()){t.setAllChildrenCount(null);return}this.gos.get("treeData")?this.setAllChildrenCountTreeData(t):this.setAllChildrenCountGridGrouping(t)}},gy=class extends x.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=
|
|
22
|
+
`),this.eGroupField=x.RefPlaceholder,this.eUnderlyingFilter=x.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&&x._warnOnce('Group Column Filter does not work with the colDef property "field". This property will be ignored.'),t.filterValueGetter&&x._warnOnce('Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.'),t.filterParams&&x._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 x._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||(x._warnOnce("Group Column Filter only works on group columns. Please use a different filter."),[])}updateGroupField(){x._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],x._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(x._loadTemplate('<div class="ag-filter-separator"></div>')),x._setDisplayed(this.eGroupField,!0)),e):(this.selectedColumn=void 0,x._setDisplayed(this.eGroupField,!1),null)}createGroupFieldSelectElement(t){this.eGroupFieldSelect=this.createManagedBean(new x.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"),x.AgPromise.resolve();const e=[],n=[];return t.forEach(o=>{const s=this.filterManager.getOrCreateFilterWrapper(o);s!=null&&s.filterPromise&&e.push(s.filterPromise.then(l=>(l&&n.push({filter:l,column:o}),o.getId()===this.selectedColumn.getId()&&(this.selectedFilter=l??void 0),l)))}),x.AgPromise.all(e).then(()=>{this.filterColumnPairs=n,this.groupColumn.setFilterActive(this.isFilterActive(),"columnRowGroupChanged")})}addUnderlyingFilterElement(){var e;if(x._clearElement(this.eUnderlyingFilter),!this.selectedColumn)return x.AgPromise.resolve();const t=this.createManagedBean(new x.FilterWrapperComp(this.selectedColumn,"COLUMN_MENU"));return this.filterWrapperComp=t,t.hasFilter()?(this.eUnderlyingFilter.appendChild(t.getGui()),((e=t.getFilter())==null?void 0:e.then(()=>{var n,o;(n=t.afterGuiAttached)==null||n.call(t,this.afterGuiAttachedParams),!((o=this.afterGuiAttachedParams)!=null&&o.suppressFocus)&&this.eGroupFieldSelect&&!this.eGroupFieldSelect.isDisabled()&&this.eGroupFieldSelect.getFocusableElement().focus()}))??x.AgPromise.resolve()):x.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 x.AgPromise.resolve()}afterGuiAttached(t){this.afterGuiAttachedParams=t,this.addUnderlyingFilterElement()}afterGuiDetached(){var t,e;x._clearElement(this.eUnderlyingFilter),(e=(t=this.selectedFilter)==null?void 0:t.afterGuiDetached)==null||e.call(t)}onColumnRowGroupChanged(){this.updateGroups().then(()=>{this.dispatchLocalEvent({type:"columnRowGroupChanged"})})}onFilterDestroyed({column:t,source:e}){var o;if(e==="gridDestroyed")return;const n=t.getColId();(o=this.filterColumnPairs)!=null&&o.some(({column:s})=>s.getColId()===n)&&setTimeout(()=>{this.isAlive()&&this.updateGroups()})}getFilterColumnPair(t){var e;if(t)return(e=this.filterColumnPairs)==null?void 0:e.find(({column:n})=>n.getId()===t)}getSelectedFilter(){return this.selectedFilter}getSelectedColumn(){return this.selectedColumn}isFilterAllowed(){return!!this.selectedColumn}destroy(){super.destroy()}},yy=class extends x.Component{constructor(){super(`
|
|
23
23
|
<div data-ref="eFloatingFilter" class="ag-group-floating-filter ag-floating-filter-input" role="presentation"></div>
|
|
24
|
-
`),this.eFloatingFilter=b.RefPlaceholder,this.haveAddedColumnListeners=!1}wireBeans(t){this.columnNameService=t.columnNameService,this.filterManager=t.filterManager}init(t){this.params=t;const e=this.gos.get("groupDisplayType")==="multipleColumns";return new b.AgPromise(n=>{this.params.parentFilterInstance(o=>{this.parentFilterInstance=o,e?this.setupUnderlyingFloatingFilterElement().then(()=>n()):(this.setupReadOnlyFloatingFilterElement(),n())})}).then(()=>{this.addManagedListeners(this.parentFilterInstance,{selectedColumnChanged:this.onSelectedColumnChanged.bind(this),columnRowGroupChanged:this.onColumnRowGroupChanged.bind(this)})})}onParamsUpdated(t){this.refresh(t)}refresh(t){this.params=t,this.setParams()}setParams(){var n;const t=this.columnNameService.getDisplayNameForColumn(this.params.column,"header",!0),e=this.localeService.getLocaleTextFunc();(n=this.eFloatingFilterText)==null||n.setInputAriaLabel(`${t} ${e("ariaFilterInput","Filter Input")}`)}setupReadOnlyFloatingFilterElement(){this.eFloatingFilterText||(this.eFloatingFilterText=this.createManagedBean(new b.AgInputTextField),this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams()),this.updateDisplayedValue(),this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui())}setupUnderlyingFloatingFilterElement(){this.showingUnderlyingFloatingFilter=!1,this.underlyingFloatingFilter=void 0,b._clearElement(this.eFloatingFilter);const t=this.parentFilterInstance.getSelectedColumn();if(t&&!t.isVisible()){const e=this.filterManager.getFloatingFilterCompDetails(t,this.params.showParentFilter);if(e)return this.haveAddedColumnListeners||(this.haveAddedColumnListeners=!0,this.addManagedListeners(t,{visibleChanged:this.onColumnVisibleChanged.bind(this),colDefChanged:this.onColDefChanged.bind(this)})),e.newAgStackInstance().then(n=>{var o,s;this.underlyingFloatingFilter=n,(s=this.underlyingFloatingFilter)==null||s.onParentModelChanged((o=this.parentFilterInstance.getSelectedFilter())==null?void 0:o.getModel()),this.appendChild(n.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),b.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(t){var n,o,s;if(!t.column)return;const e=this.filterManager.getFloatingFilterCompDetails(t.column,this.params.showParentFilter);e&&((n=this.underlyingFloatingFilter)!=null&&n.refresh?this.underlyingFloatingFilter.refresh(e.params):(s=(o=this.underlyingFloatingFilter)==null?void 0:o.onParamsUpdated)==null||s.call(o,e.params))}onParentModelChanged(t,e){var n,o;this.showingUnderlyingFloatingFilter?(o=this.underlyingFloatingFilter)==null||o.onParentModelChanged((n=this.parentFilterInstance.getSelectedFilter())==null?void 0:n.getModel(),e):this.updateDisplayedValue()}updateDisplayedValue(){if(!this.parentFilterInstance||!this.eFloatingFilterText)return;const t=this.parentFilterInstance.getSelectedFilter();if(!t){this.eFloatingFilterText.setValue(""),this.eFloatingFilterText.setDisplayed(!1);return}if(this.eFloatingFilterText.setDisplayed(!0),t.getModelAsString){const e=t.getModel();this.eFloatingFilterText.setValue(e==null?"":t.getModelAsString(e))}else this.eFloatingFilterText.setValue("")}onSelectedColumnChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}onColumnRowGroupChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}destroy(){super.destroy()}},Ya=class{constructor(){this.allSets={},this.allParents=[]}removeFromChildrenAfterGroup(t,e){const n=this.getSet(t);n.removeFromChildrenAfterGroup[e.id]=!0}isRemoveFromAllLeafChildren(t,e){return!!this.getSet(t).removeFromAllLeafChildren[e.id]}preventRemoveFromAllLeafChildren(t,e){const n=this.getSet(t);delete n.removeFromAllLeafChildren[e.id]}removeFromAllLeafChildren(t,e){const n=this.getSet(t);n.removeFromAllLeafChildren[e.id]=!0}getSet(t){return this.allSets[t.id]||(this.allSets[t.id]={removeFromAllLeafChildren:{},removeFromChildrenAfterGroup:{}},this.allParents.push(t)),this.allSets[t.id]}getAllParents(){return this.allParents}flush(){this.allParents.forEach(t=>{var o;const e=this.allSets[t.id];t.childrenAfterGroup=t.childrenAfterGroup.filter(s=>!e.removeFromChildrenAfterGroup[s.id]),t.allLeafChildren=((o=t.allLeafChildren)==null?void 0:o.filter(s=>!e.removeFromAllLeafChildren[s.id]))??null,t.updateHasChildren();const n=t.sibling;n&&(n.childrenAfterGroup=t.childrenAfterGroup,n.allLeafChildren=t.allLeafChildren)}),this.allSets={},this.allParents.length=0}};function yy(t){if(!t)return!1;const e=t.length;if(e<2)return!1;let n=!1;for(let o=1;o<e;o++)if(Md(t[o-1],t[o])>0){n=!0;break}return n?(t.sort(Md),!0):!1}function Md(t,e){const n=t.sourceRowIndex,o=e.sourceRowIndex,s=n>=0,l=o>=0,d=s&&l,u=!s&&!l;return d?n-o:u?t.__objectId-e.__objectId:s?1:-1}var _y=class extends b.BeanStub{wireBeans(t){this.beans=t,this.columnModel=t.columnModel,this.funcColsService=t.funcColsService,this.valueService=t.valueService,this.selectionService=t.selectionService,this.showRowGroupColsService=t.showRowGroupColsService}execute(t){const e=this.createGroupingDetails(t);if(e.transactions)this.handleTransaction(e);else{const n=t.afterColumnsChanged===!0;this.shotgunResetEverything(e,n)}this.positionLeafsAndGroups(t.changedPath),this.orderGroups(e)}positionLeafsAndGroups(t){t.forEachChangedNodeDepthFirst(e=>{if(e.childrenAfterGroup){const n=[],o=[];let s;e.childrenAfterGroup.forEach(l=>{var d;(d=l.childrenAfterGroup)!=null&&d.length?l.key===""&&!s?s=l:o.push(l):n.push(l)}),s&&o.push(s),e.childrenAfterGroup=[...n,...o]}},!1)}createGroupingDetails(t){const{rowNode:e,changedPath:n,rowNodeTransactions:o,rowNodesOrderChanged:s}=t,l=this.funcColsService.getRowGroupColumns();return{expandByDefault:this.gos.get("groupDefaultExpanded"),groupedCols:l,rootNode:e,pivotMode:this.columnModel.isPivotMode(),groupedColCount:(l==null?void 0:l.length)??0,transactions:o,rowNodesOrderChanged:!!s,changedPath:n,groupAllowUnbalanced:this.gos.get("groupAllowUnbalanced"),isGroupOpenByDefault:this.gos.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:this.gos.getCallback("initialGroupOrderComparator"),suppressGroupMaintainValueType:this.gos.get("suppressGroupMaintainValueType"),keyCreators:(l==null?void 0:l.map(u=>u.getColDef().keyCreator))??[]}}handleTransaction(t){t.transactions.forEach(e=>{const n=new Ya;b._existsAndNotEmpty(e.remove)&&this.removeNodes(e.remove,t,n),b._existsAndNotEmpty(e.update)&&this.moveNodesInWrongPath(e.update,t,n),b._existsAndNotEmpty(e.add)&&this.insertNodes(e.add,t);const o=n.getAllParents().slice();n.flush(),this.removeEmptyGroups(o,t)}),t.rowNodesOrderChanged&&this.sortChildren(t)}sortChildren(t){t.changedPath.forEachChangedNodeDepthFirst(e=>{yy(e.childrenAfterGroup)&&t.changedPath.addParentNode(e)},!1,!0)}orderGroups(t){const e=t.initialGroupOrderComparator;b._exists(e)&&n(t.rootNode);function n(o){b._exists(o.childrenAfterGroup)&&!o.leafGroup&&(o.childrenAfterGroup.sort((l,d)=>e({nodeA:l,nodeB:d})),o.childrenAfterGroup.forEach(l=>n(l)))}}getExistingPathForNode(t,e){const n=[];let o=t.parent;for(;o&&o!==e.rootNode;)n.push({key:o.key,rowGroupColumn:o.rowGroupColumn,field:o.field}),o=o.parent;return n.reverse(),n}moveNodesInWrongPath(t,e,n){t.forEach(o=>{e.changedPath.isActive()&&e.changedPath.addParentNode(o.parent);const s=p=>p.key,l=this.getExistingPathForNode(o,e).map(s),d=this.getGroupInfo(o,e).map(s);b._areEqual(l,d)||this.moveNode(o,e,n)})}moveNode(t,e,n){if(this.removeNodesFromParents([t],e,n),this.insertOneNode(t,e,n),t.setData(t.data),e.changedPath.isActive()){const o=t.parent;e.changedPath.addParentNode(o)}}removeNodes(t,e,n){this.removeNodesFromParents(t,e,n),e.changedPath.isActive()&&t.forEach(o=>e.changedPath.addParentNode(o.parent))}forEachParentGroup(t,e,n){let o=e;for(;o&&o!==t.rootNode;)n(o),o=o.parent}removeNodesFromParents(t,e,n){const o=n==null,s=n||new Ya;t.forEach(l=>{this.removeFromParent(l,s),this.forEachParentGroup(e,l.parent,d=>{s.removeFromAllLeafChildren(d,l)})}),o&&s.flush()}removeEmptyGroups(t,e){let n=!0;const o=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 Ya;t.forEach(l=>{this.forEachParentGroup(e,l,d=>{o(d)&&(n=!0,this.removeFromParent(d,s),d.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),s.flush()}}removeFromParent(t,e){var o;t.parent&&(e?e.removeFromChildrenAfterGroup(t.parent,t):(b._removeFromArray(t.parent.childrenAfterGroup,t),t.parent.updateHasChildren()));const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);(o=t.parent)!=null&&o.childrenMapped&&delete t.parent.childrenMapped[n],t.setRowTop(null),t.setRowIndex(null)}addToParent(t,e){const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);e!=null&&e.childrenMapped&&e.childrenMapped[n]!==t&&(e.childrenMapped[n]=t,e.childrenAfterGroup.push(t),e.setGroup(!0))}areGroupColsEqual(t,e){return t==null||e==null||t.pivotMode!==e.pivotMode?!1:b._areEqual(t.groupedCols,e.groupedCols)&&b._areEqual(t.keyCreators,e.keyCreators)}checkAllGroupDataAfterColsChanged(t){const e=n=>{n&&n.forEach(o=>{var d;if(!o.group)return;const l={field:o.field,key:o.key,rowGroupColumn:o.rowGroupColumn,leafNode:(d=o.allLeafChildren)==null?void 0:d[0]};this.setGroupData(o,l,t),e(o.childrenAfterGroup)})};e(t.rootNode.childrenAfterGroup)}shotgunResetEverything(t,e){if(this.noChangeInGroupingColumns(t,e))return;this.selectionService.filterFromSelection(l=>l&&!l.group);const{groupedCols:n}=t,o=t.rootNode;o.leafGroup=n.length===0,o.childrenAfterGroup=[],o.childrenMapped={},o.updateHasChildren();const s=o.sibling;s&&(s.childrenAfterGroup=o.childrenAfterGroup,s.childrenMapped=o.childrenMapped),this.insertNodes(o.allLeafChildren,t)}noChangeInGroupingColumns(t,e){let n=!1;const o=this.showRowGroupColsService.getShowRowGroupCols(),s=o?o.map(l=>l.getId()).join("-"):"";return e&&(n=this.areGroupColsEqual(t,this.oldGroupingDetails),this.oldGroupDisplayColIds!==s&&this.checkAllGroupDataAfterColsChanged(t)),this.oldGroupingDetails=t,this.oldGroupDisplayColIds=s,n}insertNodes(t,e){t.forEach(n=>{this.insertOneNode(n,e),e.changedPath.isActive()&&e.changedPath.addParentNode(n.parent)})}insertOneNode(t,e,n){const o=this.getGroupInfo(t,e),s=this.findParentForNode(t,o,e,n);s.group||b._warnOnce("duplicate group keys for row data, keys should be unique",[s.data,t.data]),t.parent=s,t.level=o.length,s.childrenAfterGroup.push(t),s.updateHasChildren()}findParentForNode(t,e,n,o){let s=n.rootNode;return e.forEach((l,d)=>{s=this.getOrCreateNextNode(s,l,d,n),o!=null&&o.isRemoveFromAllLeafChildren(s,t)?o==null||o.preventRemoveFromAllLeafChildren(s,t):s.allLeafChildren.push(t)}),s}getOrCreateNextNode(t,e,n,o){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,o),this.addToParent(l,t)),l}createGroup(t,e,n,o){const s=new b.RowNode(this.beans);return s.group=!0,s.field=t.field,s.rowGroupColumn=t.rowGroupColumn,this.setGroupData(s,t,o),s.key=t.key,s.id=this.createGroupId(s,e,n),s.level=n,s.leafGroup=n===o.groupedColCount-1,s.allLeafChildren=[],s.setAllChildrenCount(0),s.rowGroupIndex=n,s.childrenAfterGroup=[],s.childrenMapped={},s.updateHasChildren(),s.parent=e,this.setExpandedInitialValue(o,s),s}createGroupId(t,e,n){const o=(s,l)=>{if(!s.rowGroupColumn)return null;const d=l?o(l,l.parent):null;return`${d==null?"":d+"-"}${s.rowGroupColumn.getColId()}-${s.key}`};return b.RowNode.ID_PREFIX_ROW_GROUP+o(t,e)}setGroupData(t,e,n){t.groupData={},this.showRowGroupColsService.getShowRowGroupCols().forEach(s=>{const l=t.rowGroupColumn;l!==null&&s.isRowGroupDisplayed(l.getId())&&(n.suppressGroupMaintainValueType?t.groupData[s.getColId()]=e.key:t.groupData[s.getColId()]=this.valueService.getValue(l,e.leafNode))})}getChildrenMappedKey(t,e){return e?e.getId()+"-"+t:t}setExpandedInitialValue(t,e){if(t.pivotMode&&e.leafGroup){e.expanded=!1;return}const n=t.isGroupOpenByDefault;if(n){const o={rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn};e.expanded=n(o)==!0;return}if(t.expandByDefault===-1){e.expanded=!0;return}e.expanded=e.level<t.expandByDefault}getGroupInfo(t,e){const n=[];return e.groupedCols.forEach(o=>{let s=this.valueService.getKeyForNode(o,t),l=s!=null&&s!=="";if((e.pivotMode||!e.groupAllowUnbalanced)&&!l&&(s="",l=!0),l){const u={key:s,field:o.getColDef().field,rowGroupColumn:o,leafNode:t};n.push(u)}}),n}},vy=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,pt=Object.freeze([]),Cy=pt.values(),us=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},wy=class nm{constructor(e,n,o){this.parent=e,this.key=n,this.level=o,this.children=null,this.invalidatedHead=null,this.invalidatedNext=void 0,this.row=null,this.oldRow=null,this.duplicateRows=null,this.childrenAfterGroup=pt,this.allLeafChildren=pt,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())??Cy}upsertKey(e){var o,s;typeof e!="string"&&(e=String(e));let n=(o=this.children)==null?void 0:o.get(e);return n||(n=new nm(this,e,this.level+1),(s=this.children??(this.children=new Map))==null||s.set(n.key,n)),n}destroy(){var o;const{row:e,parent:n}=this;n!==null&&((o=n==null?void 0:n.children)==null||o.delete(this.key),e!==null&&us(e,!0),this.parent=null)}setRow(e){const{level:n,row:o,childrenAfterGroup:s}=this;if(n<0)o!==null&&o!==e&&us(o,!0);else{if(o===e)return!1;o!==null?(e.allLeafChildren=o.allLeafChildren??this.allLeafChildren??pt,us(o,!1)):e.allLeafChildren=this.allLeafChildren??pt}return e.level=n,e.childrenAfterGroup=s,e.treeNode=this,this.row=e,!0}removeRow(e){const{level:n,row:o,duplicateRows:s,childrenAfterGroup:l}=this;if(o===e){const d=this.popDuplicateRow();d?(this.row=d,d.childrenAfterGroup=l,n>=0&&(d.allLeafChildren=o.allLeafChildren??this.allLeafChildren??pt)):this.row=null}else{if(!(s!=null&&s.delete(e)))return!1;s.size===0&&(this.duplicateRows=null)}return us(e,n<0),!0}addDuplicateRow(e){const{level:n}=this;let o=this.duplicateRows;if(o===null)o=new Set,this.duplicateRows=o;else if(o.has(e))return!1;return o.add(e),e.treeNode=this,e.level=n,n>=0&&(e.allLeafChildren=pt),e.childrenAfterGroup=pt,!0}sortFirstDuplicateRow(){const e=this.duplicateRows,n=this.row;if(!n||!e)return n;let o=n;for(const s of e)s.sourceRowIndex<o.sourceRowIndex&&(o=s);return o!==n&&(o.childrenAfterGroup=this.childrenAfterGroup,o.allLeafChildren=n.allLeafChildren??this.allLeafChildren??pt,n.childrenAfterGroup=pt,n.allLeafChildren=pt,e.delete(o),e.add(n),this.row=o),o}popDuplicateRow(){let e=null;const n=this.duplicateRows;return n!==null&&(e=n.values().next().value,e!==null&&n.delete(e)&&n.size===0&&(this.duplicateRows=null)),e}dequeueInvalidated(){const e=this.invalidatedHead;return e!==null&&(this.invalidatedHead=e.invalidatedNext??null,e.invalidatedNext=void 0),e}invalidate(){let e=this,n=this.parent;for(;n!==null&&e.invalidatedNext===void 0;)e.invalidatedNext=n.invalidatedHead,n.invalidatedHead=e,e=n,n=e.parent}invalidateOrder(){var n,o;const e=this.parent;e!==null&&!e.childrenChanged&&((((n=this.children)==null?void 0:n.size)??0)>1||!((o=e.row)!=null&&o.data))&&(e.childrenChanged=!0,e.invalidate())}getRowPosition(){var n,o;const e=this.row;return e!=null&&e.data?e.sourceRowIndex:((o=(n=this.childrenAfterGroup[0])==null?void 0:n.treeNode)==null?void 0:o.oldSourceRowIndex)??this.oldSourceRowIndex}updateChildrenAfterGroup(){var u;this.childrenChanged=!1;const e=((u=this.children)==null?void 0:u.size)??0;if(e===0)return this.childrenAfterGroup.length===0?!1:(this.leafChildrenChanged=!0,this.childrenAfterGroup=pt,this.row.childrenAfterGroup=pt,!0);let n=!1,o=this.childrenAfterGroup;o===pt?(o=new Array(e),this.childrenAfterGroup=o,this.row.childrenAfterGroup=o,n=!0):o.length!==e&&(o.length=e,n=!0);let s=0,l=-1,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;o[s]!==m&&(o[s]=m,n=!0),++s}return n&&(this.leafChildrenChanged=!0),d&&this.reorderChildrenList(o),n||d}reorderChildrenList(e){const n=e.length,o=this.children;e.sort(vy),o.clear();for(let s=0;s<n;++s){const l=e[s].treeNode;o.set(l.key,l)}}updateAllLeafChildren(){var d,u;const{parent:e,row:n,childrenAfterGroup:o}=this;this.leafChildrenChanged=!1;let s=!1;const l=o.length;if(l===0)s=((d=n.allLeafChildren)==null?void 0:d.length)!==0,n.allLeafChildren=pt,this.allLeafChildren=pt;else if(l===1&&((u=o[0].allLeafChildren)!=null&&u.length))n.allLeafChildren=o[0].allLeafChildren,this.allLeafChildren=null,s=!0;else{let p=this.allLeafChildren;(p===pt||p===null)&&(p=[],this.allLeafChildren=p);const f=p.length;let m=0;for(let y=0;y<l;++y){const E=o[y],S=E.allLeafChildren,A=S.length;if(A)for(let O=0;O<A;++O){const z=S[O];(m>=f||p[m]!==z)&&(p[m]=z,s=!0),++m}else(m>=f||p[m]!==E)&&E&&(p[m]=E,s=!0),++m}f!==m&&(p.length=m,s=!0),n.allLeafChildren!==p&&(n.allLeafChildren=p,s=!0)}s&&e&&(e.leafChildrenChanged=!0)}},Id=t=>(t.treeNodeFlags&1)!==0,Od=t=>(t.treeNodeFlags&2)!==0,Ld=t=>(t.treeNodeFlags&4)!==0,by=t=>(t.treeNodeFlags&8)!==0,Gd=t=>(t.treeNodeFlags&16)!==0,zd=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},xy=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},ky=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|12)},lr=t=>{t.treeNodeFlags|=16},Zd=t=>{t.treeNodeFlags=1|t.treeNodeFlags&-29},si=t=>{t.treeNodeFlags=0},Sy=class extends b.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new wy(null,"",-1)}wireBeans(t){this.beans=t,this.showRowGroupColsService=t.showRowGroupColsService}destroy(){const t=this.root.row;t!==null&&(this.root.removeRow(t),si(t)),this.destroyTree(this.root),this.commitDestroyedRows(),super.destroy()}execute(t){const{rowNodeTransactions:e,rowNodesOrderChanged:n,changedPath:o}=t,s=t.rowNode,l=this.gos,d={changedPath:o,expandByDefault:l.get("groupDefaultExpanded"),suppressGroupMaintainValueType:l.get("suppressGroupMaintainValueType"),getDataPath:l.get("getDataPath"),isGroupOpenByDefault:l.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:l.getCallback("initialGroupOrderComparator")};this.root.setRow(s),s.leafGroup=!1;const p=s.sibling;p&&(p.childrenAfterGroup=s.childrenAfterGroup,p.childrenMapped=s.childrenMapped),e?this.handleTransaction(d,e,n):this.handleRowData(d,s,t.afterColumnsChanged===!0)}handleRowData(t,e,n){var s,l,d;const o=this.root;if(n||this.oldGroupDisplayColIds===void 0){const u=((l=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols())==null?void 0:l.map(p=>p.getId()).join("-"))??"";if(n){this.oldGroupDisplayColIds!==u&&this.checkAllGroupDataAfterColsChanged((d=o.row)==null?void 0:d.childrenAfterGroup);return}this.oldGroupDisplayColIds=u}this.clearTree(o),this.addOrUpdateRows(t,e.allLeafChildren,!1),this.commitTree(t)}handleTransaction(t,e,n){for(const{remove:o,update:s,add:l}of e)this.removeRows(o),this.addOrUpdateRows(t,s,!0),this.addOrUpdateRows(t,l,!1);n&&this.handleRowNodesOrderChanged(),this.commitTree(t)}handleRowNodesOrderChanged(){var e;const t=(e=this.root.row)==null?void 0:e.allLeafChildren;if(t)for(let n=0,o=t.length;n<o;++n){const s=t[n].treeNode;s&&s.oldSourceRowIndex!==n&&s.invalidateOrder()}}checkAllGroupDataAfterColsChanged(t){var e;for(let n=0,o=(t==null?void 0:t.length)??0;n<o;++n){const s=t[n];this.setGroupData(s,((e=s.treeNode)==null?void 0:e.key)??s.key),this.checkAllGroupDataAfterColsChanged(s.childrenAfterGroup)}}addOrUpdateRows(t,e,n){for(let o=0,s=(e==null?void 0:e.length)??0;o<s;++o){const l=e[o],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 o=t[e],s=o.treeNode;s!==null&&this.removeRow(s,o)}}getDataPath({getDataPath:t},{data:e}){const n=(t==null?void 0:t(e))||pt;return n.length||b._warnOnce("getDataPath() should not return an empty path",[e]),n}upsertPath(t){let e=this.root;const n=t.length-1;for(let o=0;o<=n;++o){const s=e.upsertKey(t[o]);if(o>=n)return s.invalidate(),s;e=s}return null}addOrUpdateRow(t,e,n){var d;const{level:o,row:s}=t;if(o<0)return;let l=!1;if(s!==e){const u=e.treeNode;u!==null&&u!==t&&(u.removeRow(e),u.invalidate()),s===null?(t.setRow(e),l=!0):s.data?t.addDuplicateRow(e)&&(l=!0):(t.setRow(e),this.destroyRow(s,!0),l=!0)}n&&!Ld(e)&&(xy(e),l=!0),l&&t.invalidate(),(d=this.rowsPendingDestruction)==null||d.delete(e)}removeRow(t,e){const{parent:n,level:o}=t;if(o<0)return;let s=!1;t.removeRow(e)&&(s=!0,n&&(n.childrenChanged=!0),this.destroyRow(e,!e.data)),s&&t.invalidate()}commitTree(t){var o;const e=this.root;this.commitInvalidatedChildren(t,e);const n=e.row;e.childrenChanged&&e.updateChildrenAfterGroup()&&lr(n),n.updateHasChildren(),Gd(n)&&(o=t.changedPath)!=null&&o.isActive()&&t.changedPath.addParentNode(n),Zd(n),this.commitDestroyedRows()}commitInvalidatedChildren(t,e){for(;;){const n=e.dequeueInvalidated();if(n===null)break;n.parent===e&&this.commitChild(t,e,n)}}commitChild(t,e,n){if(n.isEmptyFillerNode()){this.clearTree(n);return}this.commitNodePreOrder(e,n),this.commitInvalidatedChildren(t,n),this.commitNodePostOrder(t,e,n)}commitNodePreOrder(t,e){let n=e.row;if(n===null?(n=this.createFillerRow(e),e.setRow(n)):(n=e.sortFirstDuplicateRow(),n.allChildrenCount===void 0&&(n.allChildrenCount=null)),n.parent=t.row,e.oldRow!==n)for(const s of e.enumChildren()){const l=s.row;l!==null&&(l.parent=n)}const o=e.key;n.key!==o?(n.key=o,ky(n),this.setGroupData(n,o)):n.groupData||this.setGroupData(n,o)}commitNodePostOrder(t,e,n){var f,m,y;const o=n.row,s=n.oldRow;if(n.isEmptyFillerNode()){this.clearTree(n);return}n.childrenChanged&&n.updateChildrenAfterGroup()&&lr(o),n.leafChildrenChanged&&n.updateAllLeafChildren();const l=n.getRowPosition();n.oldSourceRowIndex!==l&&(n.oldSourceRowIndex=l,e.childrenChanged=!0);const d=!!((f=o.childrenAfterGroup)!=null&&f.length),u=d||!o.data,p=o.group;p!==u?(lr(o),o.setGroup(u),!u&&!o.expanded&&zd(o,!1)):o.hasChildren()!==d&&(lr(o),o.updateHasChildren()),o.group&&!Od(o)&&(s!==o&&s!==null&&s.group&&Od(s)&&!t.isGroupOpenByDefault?o.expanded=s.expanded:o.expanded=this.getExpandedInitialValue(t,o),zd(o,!0)),Ld(o)&&(lr(e.row),by(o)&&o.setData(o.data)),s!==o&&(n.oldRow=o,s!==null&&(p||n.hasChildren())&&lr(o),e.childrenChanged=!0,lr(e.row)),Gd(o)?(m=t.changedPath)!=null&&m.isActive()&&t.changedPath.addParentNode(o):Id(o)||(o.childrenAfterFilter||(o.childrenAfterFilter=o.childrenAfterGroup.slice()),o.childrenAfterAggFilter||(o.childrenAfterAggFilter=o.childrenAfterFilter.slice()),o.childrenAfterSort||(o.childrenAfterSort=o.childrenAfterAggFilter.slice())),Zd(o),(y=n.duplicateRows)!=null&&y.size&&!n.duplicateRowsWarned&&(n.duplicateRowsWarned=!0,b._warnOnce("duplicate group keys for row data, keys should be unique",[o.id,o.data,...Array.from(n.duplicateRows).map(E=>E.data)]))}createFillerRow(t){const e=new b.RowNode(this.beans);e.key=t.key,e.group=!0,e.field=null,e.leafGroup=!1,e.rowGroupIndex=null,e.allChildrenCount=null;let n=t.level+"-"+t.key,o=t.parent;for(;o!==null;){const s=o.parent;if(s===null)break;n=`${o.level}-${o.key}-${n}`,o=s}return e.id=b.RowNode.ID_PREFIX_ROW_GROUP+n,e}setGroupData(t,e){var s;const n={};t.groupData=n;const o=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols();if(o)for(const l of o)n[l.getColId()]=e}getExpandedInitialValue(t,e){const n=t.isGroupOpenByDefault;return n?n({rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn})==!0:t.expandByDefault===-1||e.level<t.expandByDefault}clearTree(t){const{parent:e,oldRow:n,row:o,level:s}=t;if(e!==null&&n!==null&&(e.childrenChanged=!0,e.row!==null&&lr(e.row)),o!==null&&s>=0){let l=t.row;for(;l!==null&&t.removeRow(l);)this.destroyRow(l,!l.data),l=t.row}for(const l of t.enumChildren())this.clearTree(l);t.destroy()}destroyTree(t){const{row:e,level:n,duplicateRows:o}=t;if(e&&(n>=0&&!e.data?this.destroyRow(e,!0):si(e)),o)for(const s of o)n>=0&&!s.data?this.destroyRow(s,!0):si(s);for(const s of t.enumChildren())this.destroyTree(s);t.destroy()}destroyRow(t,e){if(!Id(t)){si(t);return}if(!e){(this.rowsPendingDestruction??(this.rowsPendingDestruction=new Set)).add(t);return}si(t),t.setRowIndex(null),t.setRowTop(null),!t.data&&t.isSelected()&&t.setSelectedParams({newValue:!1,source:"rowGroupChanged"})}commitDestroyedRows(){const{rowsPendingDestruction:t}=this;if(t!==null){this.rowsPendingDestruction=null;for(const e of t)this.destroyRow(e,!0)}}},Ey=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?Sy:_y;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()}},$d="PivotRowTotal_",Ty=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,d=[]){return l.forEach(u=>{u.children!==void 0?n(u.children,d):d.push(u)}),d}const o=n(e);this.addRowGroupTotals(e,o),this.addExpandablePivotGroups(e,o),this.addPivotTotalsToGroups(e,o);const s=o.map(l=>b._cloneObject(l));return{pivotColumnGroupDefs:e,pivotColumnDefs:s}}createPivotColumnsFromUniqueValues(t){const e=this.funcColsService.getPivotColumns(),n=e.length;return this.recursivelyBuildGroup(0,t,[],n,e)}recursivelyBuildGroup(t,e,n,o,s){const l=this.funcColsService.getValueColumns();if(t>=o)return this.buildMeasureCols(n);const d=s[t].getColDef(),u=this.headerNameComparator.bind(this,d.pivotComparator);if(l.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&t===o-1){const f=[];return b._iterateObject(e,m=>{const y=[...n,m],E=this.createColDef(l[0],m,y);E.columnGroupShow="open",f.push(E)}),f.sort(u),f}const p=[];return b._iterateObject(e,(f,m)=>{const y=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,E=[...n,f];p.push({children:this.recursivelyBuildGroup(t+1,m,E,o,s),headerName:f,pivotKeys:E,columnGroupShow:"open",openByDefault:y,groupId:this.generateColumnGroupId(E)})}),p.sort(u),p}buildMeasureCols(t){const e=this.funcColsService.getValueColumns();return e.length===0?[this.createColDef(null,"-",t)]:e.map(n=>{const o=this.columnNameService.getDisplayNameForColumn(n,"header");return{...this.createColDef(n,o,t),columnGroupShow:"open"}})}addExpandablePivotGroups(t,e){const n=this.gos.get("suppressExpandablePivotGroups");if(n||this.gos.get("pivotColumnGroupTotals"))return;const o=(s,l,d)=>{if("children"in s){const f=new Map;s.children.forEach(y=>{o(y,l,f)});const m=!s.children.some(y=>y.children);this.funcColsService.getValueColumns().forEach(y=>{const E=this.columnNameService.getDisplayNameForColumn(y,"header"),S=this.createColDef(y,E,s.pivotKeys);S.pivotTotalColumnIds=f.get(y.getColId()),S.columnGroupShow=n?"open":"closed",S.aggFunc=y.getAggFunc(),m||(s.children.push(S),l.push(S))}),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=>{o(s,e,new Map)})}addPivotTotalsToGroups(t,e){if(!this.gos.get("pivotColumnGroupTotals"))return;const n=this.gos.get("pivotColumnGroupTotals")==="after",o=this.funcColsService.getValueColumns(),s=o.map(d=>d.getAggFunc());if(!s||s.length<1||!this.sameAggFuncs(s))return;const l=o[0];t.forEach(d=>{this.recursivelyAddPivotTotal(d,e,l,n)})}recursivelyAddPivotTotal(t,e,n,o){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,o);u&&(l=l.concat(u))}),s.children.length>1){const u=this.localeService.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),p=this.createColDef(n,u,t.pivotKeys,!0);p.pivotTotalColumnIds=l,p.aggFunc=n.getAggFunc(),p.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const f=t.children;o?f.push(p):f.unshift(p),e.push(p)}return l}addRowGroupTotals(t,e){if(!this.gos.get("pivotRowTotals"))return;const n=this.gos.get("pivotRowTotals")==="after",s=this.funcColsService.getValueColumns().slice();n||s.reverse();const l=s.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let d=0;d<s.length;d++){const u=s[d],p=this.columnNameService.getDisplayNameForColumn(u,"header"),f=this.createColDef(u,p,[]),m=[];for(let E=0;E<e.length;E++){const S=e[E];S.pivotValueColumn===u&&m.push(S.colId)}f.pivotTotalColumnIds=m,f.colId=$d+f.colId;const y=l?{children:[f],pivotKeys:[],groupId:`${$d}_pivotGroup_${u.getColId()}`}:f;e.push(f),n?t.push(y):t.unshift(y)}}createColDef(t,e,n,o=!1){const s={};if(t){const l=t.getColDef();Object.assign(s,l),s.hide=!1}return s.headerName=e,s.colId=this.generateColumnId(n||[],t&&!o?t.getColId():""),s.field=s.colId,s.valueGetter=l=>{var 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,o)=>{const l=[...t.has(o)?t.get(o):[],...n];t.set(o,l)})}generateColumnGroupId(t){return`pivotGroup_${this.funcColsService.getPivotColumns().map(n=>n.getColId()).join("-")}_${t.join("-")}`}generateColumnId(t,e){return`pivot_${this.funcColsService.getPivotColumns().map(o=>o.getColId()).join("-")}_${t.join("-")}_${e}`}createColDefsFromFields(t){const e={};for(let s=0;s<t.length;s++){const 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 y in d){const E=d[y],S=n(`${s}${this.fieldSeparator}${y}`,y,E,u+1);p.push(S)}if(p.length===0){const y=this.columnModel.getColDefCol(l);if(y){const S=this.columnNameService.getDisplayNameForColumn(y,"header")??l,A=this.createColDef(y,S,void 0,!1);return A.colId=s,A.aggFunc=y.getAggFunc(),A.valueGetter=O=>{var z;return(z=O.data)==null?void 0:z[s]},A}return{colId:s,headerName:l,valueGetter:S=>{var A;return(A=S.data)==null?void 0:A[s]}}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&p.length===1&&"colId"in p[0]?(p[0].headerName=l,p[0]):{openByDefault:this.pivotDefaultExpanded===-1||u<this.pivotDefaultExpanded,groupId:s,headerName:l,children:p}},o=[];for(const s in e){const l=e[s],d=n(s,s,l,0);o.push(d)}return o}},Ud="Exceeded maximum allowed pivot column count.",By=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="pivotStage",this.uniqueValues={},this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(t){this.valueService=t.valueService,this.columnModel=t.columnModel,this.pivotResultColsService=t.pivotResultColsService,this.funcColsService=t.funcColsService,this.pivotColDefService=t.pivotColDefService}execute(t){const e=t.changedPath;this.columnModel.isPivotActive()?this.executePivotOn(e):this.executePivotOff(e)}executePivotOff(t){this.aggregationColumnsHashLastTime=null,this.uniqueValues={},this.pivotResultColsService.isPivotResultColsPresent()&&(this.pivotResultColsService.setPivotResultCols(null,"rowModelUpdated"),t&&t.setInactive())}executePivotOn(t){const e=this.funcColsService.getValueColumns().length??1,n=this.gos.get("pivotMaxGeneratedColumns");this.maxUniqueValues=n===-1?-1:n/e;let o;try{o=this.bucketUpRowNodes(t)}catch(C){if(C.message===Ud){this.pivotResultColsService.setPivotResultCols([],"rowModelUpdated"),this.eventService.dispatchEvent({type:"pivotMaxColumnsExceeded",message:C.message}),this.lastTimeFailed=!0;return}throw C}const s=this.setUniqueValues(o),l=this.funcColsService.getValueColumns(),d=l.map(C=>`${C.getId()}-${C.getColDef().headerName}`).join("#"),u=l.map(C=>C.getAggFunc().toString()).join("#"),p=this.aggregationColumnsHashLastTime!==d,f=this.aggregationFuncsHashLastTime!==u;this.aggregationColumnsHashLastTime=d,this.aggregationFuncsHashLastTime=u;const m=this.funcColsService.getRowGroupColumns().map(C=>C.getId()).join("#"),y=m!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=m;const E=this.gos.get("pivotRowTotals"),S=this.gos.get("pivotColumnGroupTotals"),A=this.gos.get("suppressExpandablePivotGroups"),O=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),z=E!==this.pivotRowTotalsLastTime||S!==this.pivotColumnGroupTotalsLastTime||A!==this.suppressExpandablePivotGroupsLastTime||O!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=E,this.pivotColumnGroupTotalsLastTime=S,this.suppressExpandablePivotGroupsLastTime=A,this.removePivotHeaderRowWhenSingleValueColumnLastTime=O,this.lastTimeFailed||s||p||y||f||z){const{pivotColumnGroupDefs:C,pivotColumnDefs:R}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=R,this.pivotResultColsService.setPivotResultCols(C,"rowModelUpdated"),t&&t.setInactive()}this.lastTimeFailed=!1}setUniqueValues(t){const e=JSON.stringify(t),n=JSON.stringify(this.uniqueValues);return e!==n?(this.uniqueValues=t,!0):!1}bucketUpRowNodes(t){this.currentUniqueCount=0;const e={};t.forEachChangedNodeDepthFirst(o=>{o.leafGroup&&(o.childrenMapped=null)});const n=o=>{var s;o.leafGroup?this.bucketRowNode(o,e):(s=o.childrenAfterFilter)==null||s.forEach(n)};return t.executeFromRootNode(n),e}bucketRowNode(t,e){const n=this.funcColsService.getPivotColumns();n.length===0?t.childrenMapped=null:t.childrenMapped=this.bucketChildren(t.childrenAfterFilter,n,0,e),t.sibling&&(t.sibling.childrenMapped=t.childrenMapped)}bucketChildren(t,e,n,o){const s={},l=e[n];if(t.forEach(d=>{let u=this.valueService.getKeyForNode(l,d);if(b._missing(u)&&(u=""),!o[u]){this.currentUniqueCount+=1,o[u]={};const p=this.maxUniqueValues!==-1,f=this.currentUniqueCount>this.maxUniqueValues;if(p&&f)throw Error(Ud)}s[u]||(s[u]=[]),s[u].push(d)}),n===e.length-1)return s;{const d={};return b._iterateObject(s,(u,p)=>{d[u]=this.bucketChildren(p,e,n+1,o[u])}),d}}getPivotColumnDefs(){return this.pivotColumnDefs}};function Ay(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function Ny(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function Vy(t){t.aggFuncService&&t.aggFuncService.clear()}function Py(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function Dy(t){return t.columnModel.isPivotMode()}function Fy(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function Ry(t,e){t.funcColsService.setValueColumns(e,"api")}function My(t){return t.funcColsService.getValueColumns()}function Iy(t,e){t.funcColsService.removeValueColumns([e],"api")}function Oy(t,e){t.funcColsService.removeValueColumns(e,"api")}function Ly(t,e){t.funcColsService.addValueColumns([e],"api")}function Gy(t,e){t.funcColsService.addValueColumns(e,"api")}function zy(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function Zy(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function $y(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function Uy(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function Wy(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function Hy(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function jy(t){return t.funcColsService.getRowGroupColumns()}function qy(t,e){t.funcColsService.setPivotColumns(e,"api")}function Ky(t,e){t.funcColsService.removePivotColumns([e],"api")}function Yy(t,e){t.funcColsService.removePivotColumns(e,"api")}function Jy(t,e){t.funcColsService.addPivotColumns([e],"api")}function Xy(t,e){t.funcColsService.addPivotColumns(e,"api")}function Qy(t){return t.funcColsService.getPivotColumns()}function e_(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function t_(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var n_=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="showRowGroupColsService"}wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}refresh(){this.showRowGroupCols=[],this.showRowGroupColsMap={},this.columnModel.getCols().forEach(t=>{const n=t.getColDef().showRowGroup,o=typeof n=="string";!o&&!(n===!0)||(this.showRowGroupCols.push(t),o?this.showRowGroupColsMap[n]=t:this.funcColsService.getRowGroupColumns().forEach(d=>{this.showRowGroupColsMap[d.getId()]=t}))})}getShowRowGroupCols(){return this.showRowGroupCols}getShowRowGroupCol(t){return this.showRowGroupColsMap[t]}},ai="32.3.3",Ja=b._defineModule({version:ai,moduleName:`${b.ModuleNames.RowGroupingModule}-core`,beans:[ay,fy,Ey,Ty,By,Qg,ly,n_,hy],userComponents:[{name:"agGroupRowRenderer",classImp:Me.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Me.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Me.GroupCellRendererCtrl}],dependantModules:[Me.EnterpriseCoreModule]}),r_=b._defineModule({version:ai,moduleName:`${b.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:Ay,addAggFuncs:Ny,clearAggFuncs:Vy,setColumnAggFunc:Py,isPivotMode:Dy,getPivotResultColumn:Fy,setValueColumns:Ry,getValueColumns:My,removeValueColumn:Iy,removeValueColumns:Oy,addValueColumn:Ly,addValueColumns:Gy,setRowGroupColumns:zy,removeRowGroupColumn:Zy,removeRowGroupColumns:$y,addRowGroupColumn:Uy,addRowGroupColumns:Wy,getRowGroupColumns:jy,moveRowGroupColumn:Hy,setPivotColumns:qy,removePivotColumn:Ky,removePivotColumns:Yy,addPivotColumn:Jy,addPivotColumns:Xy,getPivotColumns:Qy,setPivotResultColumns:e_,getPivotResultColumns:t_},dependantModules:[Ja]}),Wd=b._defineModule({version:ai,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:my}],dependantModules:[Ja,b._ColumnFilterModule]}),o_=b._defineModule({version:ai,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:gy}],dependantModules:[Wd,b._FloatingFilterModule]}),i_=b._defineModule({version:ai,moduleName:b.ModuleNames.RowGroupingModule,dependantModules:[Ja,r_,Wd,o_]}),Hd=class extends ja{constructor(t){super(t,"aggregation")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("valueColumnsEmptyMessage","Drag here to aggregate"),n=t("values","Values");super.init({icon:b._createIconNoSpan("valuePanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getTooltipParams(){const t=super.getTooltipParams();return t.location="valueColumnsList",t}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowValue()&&(!t.isValueActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setValueColumns(t,"toolPanelUi")}getExistingItems(){return this.funcColsService.getValueColumns()}},jd=300,s_=class extends b.Component{constructor(){super(`<div class="ag-column-select-header" role="presentation">
|
|
24
|
+
`),this.eFloatingFilter=x.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 x.AgPromise(n=>{this.params.parentFilterInstance(o=>{this.parentFilterInstance=o,e?this.setupUnderlyingFloatingFilterElement().then(()=>n()):(this.setupReadOnlyFloatingFilterElement(),n())})}).then(()=>{this.addManagedListeners(this.parentFilterInstance,{selectedColumnChanged:this.onSelectedColumnChanged.bind(this),columnRowGroupChanged:this.onColumnRowGroupChanged.bind(this)})})}onParamsUpdated(t){this.refresh(t)}refresh(t){this.params=t,this.setParams()}setParams(){var n;const t=this.columnNameService.getDisplayNameForColumn(this.params.column,"header",!0),e=this.localeService.getLocaleTextFunc();(n=this.eFloatingFilterText)==null||n.setInputAriaLabel(`${t} ${e("ariaFilterInput","Filter Input")}`)}setupReadOnlyFloatingFilterElement(){this.eFloatingFilterText||(this.eFloatingFilterText=this.createManagedBean(new x.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,x._clearElement(this.eFloatingFilter);const t=this.parentFilterInstance.getSelectedColumn();if(t&&!t.isVisible()){const e=this.filterManager.getFloatingFilterCompDetails(t,this.params.showParentFilter);if(e)return this.haveAddedColumnListeners||(this.haveAddedColumnListeners=!0,this.addManagedListeners(t,{visibleChanged:this.onColumnVisibleChanged.bind(this),colDefChanged:this.onColDefChanged.bind(this)})),e.newAgStackInstance().then(n=>{var o,s;this.underlyingFloatingFilter=n,(s=this.underlyingFloatingFilter)==null||s.onParentModelChanged((o=this.parentFilterInstance.getSelectedFilter())==null?void 0:o.getModel()),this.appendChild(n.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),x.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(t){var n,o,s;if(!t.column)return;const e=this.filterManager.getFloatingFilterCompDetails(t.column,this.params.showParentFilter);e&&((n=this.underlyingFloatingFilter)!=null&&n.refresh?this.underlyingFloatingFilter.refresh(e.params):(s=(o=this.underlyingFloatingFilter)==null?void 0:o.onParamsUpdated)==null||s.call(o,e.params))}onParentModelChanged(t,e){var n,o;this.showingUnderlyingFloatingFilter?(o=this.underlyingFloatingFilter)==null||o.onParentModelChanged((n=this.parentFilterInstance.getSelectedFilter())==null?void 0:n.getModel(),e):this.updateDisplayedValue()}updateDisplayedValue(){if(!this.parentFilterInstance||!this.eFloatingFilterText)return;const t=this.parentFilterInstance.getSelectedFilter();if(!t){this.eFloatingFilterText.setValue(""),this.eFloatingFilterText.setDisplayed(!1);return}if(this.eFloatingFilterText.setDisplayed(!0),t.getModelAsString){const e=t.getModel();this.eFloatingFilterText.setValue(e==null?"":t.getModelAsString(e))}else this.eFloatingFilterText.setValue("")}onSelectedColumnChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}onColumnRowGroupChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}destroy(){super.destroy()}},Ja=class{constructor(){this.allSets={},this.allParents=[]}removeFromChildrenAfterGroup(t,e){const n=this.getSet(t);n.removeFromChildrenAfterGroup[e.id]=!0}isRemoveFromAllLeafChildren(t,e){return!!this.getSet(t).removeFromAllLeafChildren[e.id]}preventRemoveFromAllLeafChildren(t,e){const n=this.getSet(t);delete n.removeFromAllLeafChildren[e.id]}removeFromAllLeafChildren(t,e){const n=this.getSet(t);n.removeFromAllLeafChildren[e.id]=!0}getSet(t){return this.allSets[t.id]||(this.allSets[t.id]={removeFromAllLeafChildren:{},removeFromChildrenAfterGroup:{}},this.allParents.push(t)),this.allSets[t.id]}getAllParents(){return this.allParents}flush(){this.allParents.forEach(t=>{var o;const e=this.allSets[t.id];t.childrenAfterGroup=t.childrenAfterGroup.filter(s=>!e.removeFromChildrenAfterGroup[s.id]),t.allLeafChildren=((o=t.allLeafChildren)==null?void 0:o.filter(s=>!e.removeFromAllLeafChildren[s.id]))??null,t.updateHasChildren();const n=t.sibling;n&&(n.childrenAfterGroup=t.childrenAfterGroup,n.allLeafChildren=t.allLeafChildren)}),this.allSets={},this.allParents.length=0}};function _y(t){if(!t)return!1;const e=t.length;if(e<2)return!1;let n=!1;for(let o=1;o<e;o++)if(Id(t[o-1],t[o])>0){n=!0;break}return n?(t.sort(Id),!0):!1}function Id(t,e){const n=t.sourceRowIndex,o=e.sourceRowIndex,s=n>=0,l=o>=0,d=s&&l,u=!s&&!l;return d?n-o:u?t.__objectId-e.__objectId:s?1:-1}var vy=class extends x.BeanStub{wireBeans(t){this.beans=t,this.columnModel=t.columnModel,this.funcColsService=t.funcColsService,this.valueService=t.valueService,this.selectionService=t.selectionService,this.showRowGroupColsService=t.showRowGroupColsService}execute(t){const e=this.createGroupingDetails(t);if(e.transactions)this.handleTransaction(e);else{const n=t.afterColumnsChanged===!0;this.shotgunResetEverything(e,n)}this.positionLeafsAndGroups(t.changedPath),this.orderGroups(e)}positionLeafsAndGroups(t){t.forEachChangedNodeDepthFirst(e=>{if(e.childrenAfterGroup){const n=[],o=[];let s;e.childrenAfterGroup.forEach(l=>{var d;(d=l.childrenAfterGroup)!=null&&d.length?l.key===""&&!s?s=l:o.push(l):n.push(l)}),s&&o.push(s),e.childrenAfterGroup=[...n,...o]}},!1)}createGroupingDetails(t){const{rowNode:e,changedPath:n,rowNodeTransactions:o,rowNodesOrderChanged:s}=t,l=this.funcColsService.getRowGroupColumns();return{expandByDefault:this.gos.get("groupDefaultExpanded"),groupedCols:l,rootNode:e,pivotMode:this.columnModel.isPivotMode(),groupedColCount:(l==null?void 0:l.length)??0,transactions:o,rowNodesOrderChanged:!!s,changedPath:n,groupAllowUnbalanced:this.gos.get("groupAllowUnbalanced"),isGroupOpenByDefault:this.gos.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:this.gos.getCallback("initialGroupOrderComparator"),suppressGroupMaintainValueType:this.gos.get("suppressGroupMaintainValueType"),keyCreators:(l==null?void 0:l.map(u=>u.getColDef().keyCreator))??[]}}handleTransaction(t){t.transactions.forEach(e=>{const n=new Ja;x._existsAndNotEmpty(e.remove)&&this.removeNodes(e.remove,t,n),x._existsAndNotEmpty(e.update)&&this.moveNodesInWrongPath(e.update,t,n),x._existsAndNotEmpty(e.add)&&this.insertNodes(e.add,t);const o=n.getAllParents().slice();n.flush(),this.removeEmptyGroups(o,t)}),t.rowNodesOrderChanged&&this.sortChildren(t)}sortChildren(t){t.changedPath.forEachChangedNodeDepthFirst(e=>{_y(e.childrenAfterGroup)&&t.changedPath.addParentNode(e)},!1,!0)}orderGroups(t){const e=t.initialGroupOrderComparator;x._exists(e)&&n(t.rootNode);function n(o){x._exists(o.childrenAfterGroup)&&!o.leafGroup&&(o.childrenAfterGroup.sort((l,d)=>e({nodeA:l,nodeB:d})),o.childrenAfterGroup.forEach(l=>n(l)))}}getExistingPathForNode(t,e){const n=[];let o=t.parent;for(;o&&o!==e.rootNode;)n.push({key:o.key,rowGroupColumn:o.rowGroupColumn,field:o.field}),o=o.parent;return n.reverse(),n}moveNodesInWrongPath(t,e,n){t.forEach(o=>{e.changedPath.isActive()&&e.changedPath.addParentNode(o.parent);const s=p=>p.key,l=this.getExistingPathForNode(o,e).map(s),d=this.getGroupInfo(o,e).map(s);x._areEqual(l,d)||this.moveNode(o,e,n)})}moveNode(t,e,n){if(this.removeNodesFromParents([t],e,n),this.insertOneNode(t,e,n),t.setData(t.data),e.changedPath.isActive()){const o=t.parent;e.changedPath.addParentNode(o)}}removeNodes(t,e,n){this.removeNodesFromParents(t,e,n),e.changedPath.isActive()&&t.forEach(o=>e.changedPath.addParentNode(o.parent))}forEachParentGroup(t,e,n){let o=e;for(;o&&o!==t.rootNode;)n(o),o=o.parent}removeNodesFromParents(t,e,n){const o=n==null,s=n||new Ja;t.forEach(l=>{this.removeFromParent(l,s),this.forEachParentGroup(e,l.parent,d=>{s.removeFromAllLeafChildren(d,l)})}),o&&s.flush()}removeEmptyGroups(t,e){let n=!0;const o=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 Ja;t.forEach(l=>{this.forEachParentGroup(e,l,d=>{o(d)&&(n=!0,this.removeFromParent(d,s),d.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),s.flush()}}removeFromParent(t,e){var o;t.parent&&(e?e.removeFromChildrenAfterGroup(t.parent,t):(x._removeFromArray(t.parent.childrenAfterGroup,t),t.parent.updateHasChildren()));const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);(o=t.parent)!=null&&o.childrenMapped&&delete t.parent.childrenMapped[n],t.setRowTop(null),t.setRowIndex(null)}addToParent(t,e){const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);e!=null&&e.childrenMapped&&e.childrenMapped[n]!==t&&(e.childrenMapped[n]=t,e.childrenAfterGroup.push(t),e.setGroup(!0))}areGroupColsEqual(t,e){return t==null||e==null||t.pivotMode!==e.pivotMode?!1:x._areEqual(t.groupedCols,e.groupedCols)&&x._areEqual(t.keyCreators,e.keyCreators)}checkAllGroupDataAfterColsChanged(t){const e=n=>{n&&n.forEach(o=>{var d;if(!o.group)return;const l={field:o.field,key:o.key,rowGroupColumn:o.rowGroupColumn,leafNode:(d=o.allLeafChildren)==null?void 0:d[0]};this.setGroupData(o,l,t),e(o.childrenAfterGroup)})};e(t.rootNode.childrenAfterGroup)}shotgunResetEverything(t,e){if(this.noChangeInGroupingColumns(t,e))return;this.selectionService.filterFromSelection(l=>l&&!l.group);const{groupedCols:n}=t,o=t.rootNode;o.leafGroup=n.length===0,o.childrenAfterGroup=[],o.childrenMapped={},o.updateHasChildren();const s=o.sibling;s&&(s.childrenAfterGroup=o.childrenAfterGroup,s.childrenMapped=o.childrenMapped),this.insertNodes(o.allLeafChildren,t)}noChangeInGroupingColumns(t,e){let n=!1;const o=this.showRowGroupColsService.getShowRowGroupCols(),s=o?o.map(l=>l.getId()).join("-"):"";return e&&(n=this.areGroupColsEqual(t,this.oldGroupingDetails),this.oldGroupDisplayColIds!==s&&this.checkAllGroupDataAfterColsChanged(t)),this.oldGroupingDetails=t,this.oldGroupDisplayColIds=s,n}insertNodes(t,e){t.forEach(n=>{this.insertOneNode(n,e),e.changedPath.isActive()&&e.changedPath.addParentNode(n.parent)})}insertOneNode(t,e,n){const o=this.getGroupInfo(t,e),s=this.findParentForNode(t,o,e,n);s.group||x._warnOnce("duplicate group keys for row data, keys should be unique",[s.data,t.data]),t.parent=s,t.level=o.length,s.childrenAfterGroup.push(t),s.updateHasChildren()}findParentForNode(t,e,n,o){let s=n.rootNode;return e.forEach((l,d)=>{s=this.getOrCreateNextNode(s,l,d,n),o!=null&&o.isRemoveFromAllLeafChildren(s,t)?o==null||o.preventRemoveFromAllLeafChildren(s,t):s.allLeafChildren.push(t)}),s}getOrCreateNextNode(t,e,n,o){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,o),this.addToParent(l,t)),l}createGroup(t,e,n,o){const s=new x.RowNode(this.beans);return s.group=!0,s.field=t.field,s.rowGroupColumn=t.rowGroupColumn,this.setGroupData(s,t,o),s.key=t.key,s.id=this.createGroupId(s,e,n),s.level=n,s.leafGroup=n===o.groupedColCount-1,s.allLeafChildren=[],s.setAllChildrenCount(0),s.rowGroupIndex=n,s.childrenAfterGroup=[],s.childrenMapped={},s.updateHasChildren(),s.parent=e,this.setExpandedInitialValue(o,s),s}createGroupId(t,e,n){const o=(s,l)=>{if(!s.rowGroupColumn)return null;const d=l?o(l,l.parent):null;return`${d==null?"":d+"-"}${s.rowGroupColumn.getColId()}-${s.key}`};return x.RowNode.ID_PREFIX_ROW_GROUP+o(t,e)}setGroupData(t,e,n){t.groupData={},this.showRowGroupColsService.getShowRowGroupCols().forEach(s=>{const l=t.rowGroupColumn;l!==null&&s.isRowGroupDisplayed(l.getId())&&(n.suppressGroupMaintainValueType?t.groupData[s.getColId()]=e.key:t.groupData[s.getColId()]=this.valueService.getValue(l,e.leafNode))})}getChildrenMappedKey(t,e){return e?e.getId()+"-"+t:t}setExpandedInitialValue(t,e){if(t.pivotMode&&e.leafGroup){e.expanded=!1;return}const n=t.isGroupOpenByDefault;if(n){const o={rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn};e.expanded=n(o)==!0;return}if(t.expandByDefault===-1){e.expanded=!0;return}e.expanded=e.level<t.expandByDefault}getGroupInfo(t,e){const n=[];return e.groupedCols.forEach(o=>{let s=this.valueService.getKeyForNode(o,t),l=s!=null&&s!=="";if((e.pivotMode||!e.groupAllowUnbalanced)&&!l&&(s="",l=!0),l){const u={key:s,field:o.getColDef().field,rowGroupColumn:o,leafNode:t};n.push(u)}}),n}},Cy=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,pt=Object.freeze([]),wy=pt.values(),hs=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},by=class rm{constructor(e,n,o){this.parent=e,this.key=n,this.level=o,this.children=null,this.invalidatedHead=null,this.invalidatedNext=void 0,this.row=null,this.oldRow=null,this.duplicateRows=null,this.childrenAfterGroup=pt,this.allLeafChildren=pt,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())??wy}upsertKey(e){var o,s;typeof e!="string"&&(e=String(e));let n=(o=this.children)==null?void 0:o.get(e);return n||(n=new rm(this,e,this.level+1),(s=this.children??(this.children=new Map))==null||s.set(n.key,n)),n}destroy(){var o;const{row:e,parent:n}=this;n!==null&&((o=n==null?void 0:n.children)==null||o.delete(this.key),e!==null&&hs(e,!0),this.parent=null)}setRow(e){const{level:n,row:o,childrenAfterGroup:s}=this;if(n<0)o!==null&&o!==e&&hs(o,!0);else{if(o===e)return!1;o!==null?(e.allLeafChildren=o.allLeafChildren??this.allLeafChildren??pt,hs(o,!1)):e.allLeafChildren=this.allLeafChildren??pt}return e.level=n,e.childrenAfterGroup=s,e.treeNode=this,this.row=e,!0}removeRow(e){const{level:n,row:o,duplicateRows:s,childrenAfterGroup:l}=this;if(o===e){const d=this.popDuplicateRow();d?(this.row=d,d.childrenAfterGroup=l,n>=0&&(d.allLeafChildren=o.allLeafChildren??this.allLeafChildren??pt)):this.row=null}else{if(!(s!=null&&s.delete(e)))return!1;s.size===0&&(this.duplicateRows=null)}return hs(e,n<0),!0}addDuplicateRow(e){const{level:n}=this;let o=this.duplicateRows;if(o===null)o=new Set,this.duplicateRows=o;else if(o.has(e))return!1;return o.add(e),e.treeNode=this,e.level=n,n>=0&&(e.allLeafChildren=pt),e.childrenAfterGroup=pt,!0}sortFirstDuplicateRow(){const e=this.duplicateRows,n=this.row;if(!n||!e)return n;let o=n;for(const s of e)s.sourceRowIndex<o.sourceRowIndex&&(o=s);return o!==n&&(o.childrenAfterGroup=this.childrenAfterGroup,o.allLeafChildren=n.allLeafChildren??this.allLeafChildren??pt,n.childrenAfterGroup=pt,n.allLeafChildren=pt,e.delete(o),e.add(n),this.row=o),o}popDuplicateRow(){let e=null;const n=this.duplicateRows;return n!==null&&(e=n.values().next().value,e!==null&&n.delete(e)&&n.size===0&&(this.duplicateRows=null)),e}dequeueInvalidated(){const e=this.invalidatedHead;return e!==null&&(this.invalidatedHead=e.invalidatedNext??null,e.invalidatedNext=void 0),e}invalidate(){let e=this,n=this.parent;for(;n!==null&&e.invalidatedNext===void 0;)e.invalidatedNext=n.invalidatedHead,n.invalidatedHead=e,e=n,n=e.parent}invalidateOrder(){var n,o;const e=this.parent;e!==null&&!e.childrenChanged&&((((n=this.children)==null?void 0:n.size)??0)>1||!((o=e.row)!=null&&o.data))&&(e.childrenChanged=!0,e.invalidate())}getRowPosition(){var n,o;const e=this.row;return e!=null&&e.data?e.sourceRowIndex:((o=(n=this.childrenAfterGroup[0])==null?void 0:n.treeNode)==null?void 0:o.oldSourceRowIndex)??this.oldSourceRowIndex}updateChildrenAfterGroup(){var u;this.childrenChanged=!1;const e=((u=this.children)==null?void 0:u.size)??0;if(e===0)return this.childrenAfterGroup.length===0?!1:(this.leafChildrenChanged=!0,this.childrenAfterGroup=pt,this.row.childrenAfterGroup=pt,!0);let n=!1,o=this.childrenAfterGroup;o===pt?(o=new Array(e),this.childrenAfterGroup=o,this.row.childrenAfterGroup=o,n=!0):o.length!==e&&(o.length=e,n=!0);let s=0,l=-1,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;o[s]!==m&&(o[s]=m,n=!0),++s}return n&&(this.leafChildrenChanged=!0),d&&this.reorderChildrenList(o),n||d}reorderChildrenList(e){const n=e.length,o=this.children;e.sort(Cy),o.clear();for(let s=0;s<n;++s){const l=e[s].treeNode;o.set(l.key,l)}}updateAllLeafChildren(){var d,u;const{parent:e,row:n,childrenAfterGroup:o}=this;this.leafChildrenChanged=!1;let s=!1;const l=o.length;if(l===0)s=((d=n.allLeafChildren)==null?void 0:d.length)!==0,n.allLeafChildren=pt,this.allLeafChildren=pt;else if(l===1&&((u=o[0].allLeafChildren)!=null&&u.length))n.allLeafChildren=o[0].allLeafChildren,this.allLeafChildren=null,s=!0;else{let p=this.allLeafChildren;(p===pt||p===null)&&(p=[],this.allLeafChildren=p);const f=p.length;let m=0;for(let y=0;y<l;++y){const B=o[y],T=B.allLeafChildren,N=T.length;if(N)for(let M=0;M<N;++M){const G=T[M];(m>=f||p[m]!==G)&&(p[m]=G,s=!0),++m}else(m>=f||p[m]!==B)&&B&&(p[m]=B,s=!0),++m}f!==m&&(p.length=m,s=!0),n.allLeafChildren!==p&&(n.allLeafChildren=p,s=!0)}s&&e&&(e.leafChildrenChanged=!0)}},Od=t=>(t.treeNodeFlags&1)!==0,Ld=t=>(t.treeNodeFlags&2)!==0,Gd=t=>(t.treeNodeFlags&4)!==0,xy=t=>(t.treeNodeFlags&8)!==0,zd=t=>(t.treeNodeFlags&16)!==0,Zd=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},ky=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},Sy=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|12)},lr=t=>{t.treeNodeFlags|=16},$d=t=>{t.treeNodeFlags=1|t.treeNodeFlags&-29},li=t=>{t.treeNodeFlags=0},Ey=class extends x.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new by(null,"",-1)}wireBeans(t){this.beans=t,this.showRowGroupColsService=t.showRowGroupColsService}destroy(){const t=this.root.row;t!==null&&(this.root.removeRow(t),li(t)),this.destroyTree(this.root),this.commitDestroyedRows(),super.destroy()}execute(t){const{rowNodeTransactions:e,rowNodesOrderChanged:n,changedPath:o}=t,s=t.rowNode,l=this.gos,d={changedPath:o,expandByDefault:l.get("groupDefaultExpanded"),suppressGroupMaintainValueType:l.get("suppressGroupMaintainValueType"),getDataPath:l.get("getDataPath"),isGroupOpenByDefault:l.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:l.getCallback("initialGroupOrderComparator")};this.root.setRow(s),s.leafGroup=!1;const p=s.sibling;p&&(p.childrenAfterGroup=s.childrenAfterGroup,p.childrenMapped=s.childrenMapped),e?this.handleTransaction(d,e,n):this.handleRowData(d,s,t.afterColumnsChanged===!0)}handleRowData(t,e,n){var s,l,d;const o=this.root;if(n||this.oldGroupDisplayColIds===void 0){const u=((l=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols())==null?void 0:l.map(p=>p.getId()).join("-"))??"";if(n){this.oldGroupDisplayColIds!==u&&this.checkAllGroupDataAfterColsChanged((d=o.row)==null?void 0:d.childrenAfterGroup);return}this.oldGroupDisplayColIds=u}this.clearTree(o),this.addOrUpdateRows(t,e.allLeafChildren,!1),this.commitTree(t)}handleTransaction(t,e,n){for(const{remove:o,update:s,add:l}of e)this.removeRows(o),this.addOrUpdateRows(t,s,!0),this.addOrUpdateRows(t,l,!1);n&&this.handleRowNodesOrderChanged(),this.commitTree(t)}handleRowNodesOrderChanged(){var e;const t=(e=this.root.row)==null?void 0:e.allLeafChildren;if(t)for(let n=0,o=t.length;n<o;++n){const s=t[n].treeNode;s&&s.oldSourceRowIndex!==n&&s.invalidateOrder()}}checkAllGroupDataAfterColsChanged(t){var e;for(let n=0,o=(t==null?void 0:t.length)??0;n<o;++n){const s=t[n];this.setGroupData(s,((e=s.treeNode)==null?void 0:e.key)??s.key),this.checkAllGroupDataAfterColsChanged(s.childrenAfterGroup)}}addOrUpdateRows(t,e,n){for(let o=0,s=(e==null?void 0:e.length)??0;o<s;++o){const l=e[o],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 o=t[e],s=o.treeNode;s!==null&&this.removeRow(s,o)}}getDataPath({getDataPath:t},{data:e}){const n=(t==null?void 0:t(e))||pt;return n.length||x._warnOnce("getDataPath() should not return an empty path",[e]),n}upsertPath(t){let e=this.root;const n=t.length-1;for(let o=0;o<=n;++o){const s=e.upsertKey(t[o]);if(o>=n)return s.invalidate(),s;e=s}return null}addOrUpdateRow(t,e,n){var d;const{level:o,row:s}=t;if(o<0)return;let l=!1;if(s!==e){const u=e.treeNode;u!==null&&u!==t&&(u.removeRow(e),u.invalidate()),s===null?(t.setRow(e),l=!0):s.data?t.addDuplicateRow(e)&&(l=!0):(t.setRow(e),this.destroyRow(s,!0),l=!0)}n&&!Gd(e)&&(ky(e),l=!0),l&&t.invalidate(),(d=this.rowsPendingDestruction)==null||d.delete(e)}removeRow(t,e){const{parent:n,level:o}=t;if(o<0)return;let s=!1;t.removeRow(e)&&(s=!0,n&&(n.childrenChanged=!0),this.destroyRow(e,!e.data)),s&&t.invalidate()}commitTree(t){var o;const e=this.root;this.commitInvalidatedChildren(t,e);const n=e.row;e.childrenChanged&&e.updateChildrenAfterGroup()&&lr(n),n.updateHasChildren(),zd(n)&&(o=t.changedPath)!=null&&o.isActive()&&t.changedPath.addParentNode(n),$d(n),this.commitDestroyedRows()}commitInvalidatedChildren(t,e){for(;;){const n=e.dequeueInvalidated();if(n===null)break;n.parent===e&&this.commitChild(t,e,n)}}commitChild(t,e,n){if(n.isEmptyFillerNode()){this.clearTree(n);return}this.commitNodePreOrder(e,n),this.commitInvalidatedChildren(t,n),this.commitNodePostOrder(t,e,n)}commitNodePreOrder(t,e){let n=e.row;if(n===null?(n=this.createFillerRow(e),e.setRow(n)):(n=e.sortFirstDuplicateRow(),n.allChildrenCount===void 0&&(n.allChildrenCount=null)),n.parent=t.row,e.oldRow!==n)for(const s of e.enumChildren()){const l=s.row;l!==null&&(l.parent=n)}const o=e.key;n.key!==o?(n.key=o,Sy(n),this.setGroupData(n,o)):n.groupData||this.setGroupData(n,o)}commitNodePostOrder(t,e,n){var f,m,y;const o=n.row,s=n.oldRow;if(n.isEmptyFillerNode()){this.clearTree(n);return}n.childrenChanged&&n.updateChildrenAfterGroup()&&lr(o),n.leafChildrenChanged&&n.updateAllLeafChildren();const l=n.getRowPosition();n.oldSourceRowIndex!==l&&(n.oldSourceRowIndex=l,e.childrenChanged=!0);const d=!!((f=o.childrenAfterGroup)!=null&&f.length),u=d||!o.data,p=o.group;p!==u?(lr(o),o.setGroup(u),!u&&!o.expanded&&Zd(o,!1)):o.hasChildren()!==d&&(lr(o),o.updateHasChildren()),o.group&&!Ld(o)&&(s!==o&&s!==null&&s.group&&Ld(s)&&!t.isGroupOpenByDefault?o.expanded=s.expanded:o.expanded=this.getExpandedInitialValue(t,o),Zd(o,!0)),Gd(o)&&(lr(e.row),xy(o)&&o.setData(o.data)),s!==o&&(n.oldRow=o,s!==null&&(p||n.hasChildren())&&lr(o),e.childrenChanged=!0,lr(e.row)),zd(o)?(m=t.changedPath)!=null&&m.isActive()&&t.changedPath.addParentNode(o):Od(o)||(o.childrenAfterFilter||(o.childrenAfterFilter=o.childrenAfterGroup.slice()),o.childrenAfterAggFilter||(o.childrenAfterAggFilter=o.childrenAfterFilter.slice()),o.childrenAfterSort||(o.childrenAfterSort=o.childrenAfterAggFilter.slice())),$d(o),(y=n.duplicateRows)!=null&&y.size&&!n.duplicateRowsWarned&&(n.duplicateRowsWarned=!0,x._warnOnce("duplicate group keys for row data, keys should be unique",[o.id,o.data,...Array.from(n.duplicateRows).map(B=>B.data)]))}createFillerRow(t){const e=new x.RowNode(this.beans);e.key=t.key,e.group=!0,e.field=null,e.leafGroup=!1,e.rowGroupIndex=null,e.allChildrenCount=null;let n=t.level+"-"+t.key,o=t.parent;for(;o!==null;){const s=o.parent;if(s===null)break;n=`${o.level}-${o.key}-${n}`,o=s}return e.id=x.RowNode.ID_PREFIX_ROW_GROUP+n,e}setGroupData(t,e){var s;const n={};t.groupData=n;const o=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols();if(o)for(const l of o)n[l.getColId()]=e}getExpandedInitialValue(t,e){const n=t.isGroupOpenByDefault;return n?n({rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn})==!0:t.expandByDefault===-1||e.level<t.expandByDefault}clearTree(t){const{parent:e,oldRow:n,row:o,level:s}=t;if(e!==null&&n!==null&&(e.childrenChanged=!0,e.row!==null&&lr(e.row)),o!==null&&s>=0){let l=t.row;for(;l!==null&&t.removeRow(l);)this.destroyRow(l,!l.data),l=t.row}for(const l of t.enumChildren())this.clearTree(l);t.destroy()}destroyTree(t){const{row:e,level:n,duplicateRows:o}=t;if(e&&(n>=0&&!e.data?this.destroyRow(e,!0):li(e)),o)for(const s of o)n>=0&&!s.data?this.destroyRow(s,!0):li(s);for(const s of t.enumChildren())this.destroyTree(s);t.destroy()}destroyRow(t,e){if(!Od(t)){li(t);return}if(!e){(this.rowsPendingDestruction??(this.rowsPendingDestruction=new Set)).add(t);return}li(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)}}},Ty=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?Ey:vy;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()}},Ud="PivotRowTotal_",By=class extends x.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 o=n(e);this.addRowGroupTotals(e,o),this.addExpandablePivotGroups(e,o),this.addPivotTotalsToGroups(e,o);const s=o.map(l=>x._cloneObject(l));return{pivotColumnGroupDefs:e,pivotColumnDefs:s}}createPivotColumnsFromUniqueValues(t){const e=this.funcColsService.getPivotColumns(),n=e.length;return this.recursivelyBuildGroup(0,t,[],n,e)}recursivelyBuildGroup(t,e,n,o,s){const l=this.funcColsService.getValueColumns();if(t>=o)return this.buildMeasureCols(n);const d=s[t].getColDef(),u=this.headerNameComparator.bind(this,d.pivotComparator);if(l.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&t===o-1){const f=[];return x._iterateObject(e,m=>{const y=[...n,m],B=this.createColDef(l[0],m,y);B.columnGroupShow="open",f.push(B)}),f.sort(u),f}const p=[];return x._iterateObject(e,(f,m)=>{const y=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,B=[...n,f];p.push({children:this.recursivelyBuildGroup(t+1,m,B,o,s),headerName:f,pivotKeys:B,columnGroupShow:"open",openByDefault:y,groupId:this.generateColumnGroupId(B)})}),p.sort(u),p}buildMeasureCols(t){const e=this.funcColsService.getValueColumns();return e.length===0?[this.createColDef(null,"-",t)]:e.map(n=>{const o=this.columnNameService.getDisplayNameForColumn(n,"header");return{...this.createColDef(n,o,t),columnGroupShow:"open"}})}addExpandablePivotGroups(t,e){const n=this.gos.get("suppressExpandablePivotGroups");if(n||this.gos.get("pivotColumnGroupTotals"))return;const o=(s,l,d)=>{if("children"in s){const f=new Map;s.children.forEach(y=>{o(y,l,f)});const m=!s.children.some(y=>y.children);this.funcColsService.getValueColumns().forEach(y=>{const B=this.columnNameService.getDisplayNameForColumn(y,"header"),T=this.createColDef(y,B,s.pivotKeys);T.pivotTotalColumnIds=f.get(y.getColId()),T.columnGroupShow=n?"open":"closed",T.aggFunc=y.getAggFunc(),m||(s.children.push(T),l.push(T))}),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=>{o(s,e,new Map)})}addPivotTotalsToGroups(t,e){if(!this.gos.get("pivotColumnGroupTotals"))return;const n=this.gos.get("pivotColumnGroupTotals")==="after",o=this.funcColsService.getValueColumns(),s=o.map(d=>d.getAggFunc());if(!s||s.length<1||!this.sameAggFuncs(s))return;const l=o[0];t.forEach(d=>{this.recursivelyAddPivotTotal(d,e,l,n)})}recursivelyAddPivotTotal(t,e,n,o){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,o);u&&(l=l.concat(u))}),s.children.length>1){const u=this.localeService.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),p=this.createColDef(n,u,t.pivotKeys,!0);p.pivotTotalColumnIds=l,p.aggFunc=n.getAggFunc(),p.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const f=t.children;o?f.push(p):f.unshift(p),e.push(p)}return l}addRowGroupTotals(t,e){if(!this.gos.get("pivotRowTotals"))return;const n=this.gos.get("pivotRowTotals")==="after",s=this.funcColsService.getValueColumns().slice();n||s.reverse();const l=s.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let d=0;d<s.length;d++){const u=s[d],p=this.columnNameService.getDisplayNameForColumn(u,"header"),f=this.createColDef(u,p,[]),m=[];for(let B=0;B<e.length;B++){const T=e[B];T.pivotValueColumn===u&&m.push(T.colId)}f.pivotTotalColumnIds=m,f.colId=Ud+f.colId;const y=l?{children:[f],pivotKeys:[],groupId:`${Ud}_pivotGroup_${u.getColId()}`}:f;e.push(f),n?t.push(y):t.unshift(y)}}createColDef(t,e,n,o=!1){const s={};if(t){const l=t.getColDef();Object.assign(s,l),s.hide=!1}return s.headerName=e,s.colId=this.generateColumnId(n||[],t&&!o?t.getColId():""),s.field=s.colId,s.valueGetter=l=>{var 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,o)=>{const l=[...t.has(o)?t.get(o):[],...n];t.set(o,l)})}generateColumnGroupId(t){return`pivotGroup_${this.funcColsService.getPivotColumns().map(n=>n.getColId()).join("-")}_${t.join("-")}`}generateColumnId(t,e){return`pivot_${this.funcColsService.getPivotColumns().map(o=>o.getColId()).join("-")}_${t.join("-")}_${e}`}createColDefsFromFields(t){const e={};for(let s=0;s<t.length;s++){const 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 y in d){const B=d[y],T=n(`${s}${this.fieldSeparator}${y}`,y,B,u+1);p.push(T)}if(p.length===0){const y=this.columnModel.getColDefCol(l);if(y){const T=this.columnNameService.getDisplayNameForColumn(y,"header")??l,N=this.createColDef(y,T,void 0,!1);return N.colId=s,N.aggFunc=y.getAggFunc(),N.valueGetter=M=>{var G;return(G=M.data)==null?void 0:G[s]},N}return{colId:s,headerName:l,valueGetter:T=>{var N;return(N=T.data)==null?void 0:N[s]}}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&p.length===1&&"colId"in p[0]?(p[0].headerName=l,p[0]):{openByDefault:this.pivotDefaultExpanded===-1||u<this.pivotDefaultExpanded,groupId:s,headerName:l,children:p}},o=[];for(const s in e){const l=e[s],d=n(s,s,l,0);o.push(d)}return o}},Wd="Exceeded maximum allowed pivot column count.",Ay=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="pivotStage",this.uniqueValues={},this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(t){this.valueService=t.valueService,this.columnModel=t.columnModel,this.pivotResultColsService=t.pivotResultColsService,this.funcColsService=t.funcColsService,this.pivotColDefService=t.pivotColDefService}execute(t){const e=t.changedPath;this.columnModel.isPivotActive()?this.executePivotOn(e):this.executePivotOff(e)}executePivotOff(t){this.aggregationColumnsHashLastTime=null,this.uniqueValues={},this.pivotResultColsService.isPivotResultColsPresent()&&(this.pivotResultColsService.setPivotResultCols(null,"rowModelUpdated"),t&&t.setInactive())}executePivotOn(t){const e=this.funcColsService.getValueColumns().length??1,n=this.gos.get("pivotMaxGeneratedColumns");this.maxUniqueValues=n===-1?-1:n/e;let o;try{o=this.bucketUpRowNodes(t)}catch(C){if(C.message===Wd){this.pivotResultColsService.setPivotResultCols([],"rowModelUpdated"),this.eventService.dispatchEvent({type:"pivotMaxColumnsExceeded",message:C.message}),this.lastTimeFailed=!0;return}throw C}const s=this.setUniqueValues(o),l=this.funcColsService.getValueColumns(),d=l.map(C=>`${C.getId()}-${C.getColDef().headerName}`).join("#"),u=l.map(C=>C.getAggFunc().toString()).join("#"),p=this.aggregationColumnsHashLastTime!==d,f=this.aggregationFuncsHashLastTime!==u;this.aggregationColumnsHashLastTime=d,this.aggregationFuncsHashLastTime=u;const m=this.funcColsService.getRowGroupColumns().map(C=>C.getId()).join("#"),y=m!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=m;const B=this.gos.get("pivotRowTotals"),T=this.gos.get("pivotColumnGroupTotals"),N=this.gos.get("suppressExpandablePivotGroups"),M=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),G=B!==this.pivotRowTotalsLastTime||T!==this.pivotColumnGroupTotalsLastTime||N!==this.suppressExpandablePivotGroupsLastTime||M!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=B,this.pivotColumnGroupTotalsLastTime=T,this.suppressExpandablePivotGroupsLastTime=N,this.removePivotHeaderRowWhenSingleValueColumnLastTime=M,this.lastTimeFailed||s||p||y||f||G){const{pivotColumnGroupDefs:C,pivotColumnDefs:F}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=F,this.pivotResultColsService.setPivotResultCols(C,"rowModelUpdated"),t&&t.setInactive()}this.lastTimeFailed=!1}setUniqueValues(t){const e=JSON.stringify(t),n=JSON.stringify(this.uniqueValues);return e!==n?(this.uniqueValues=t,!0):!1}bucketUpRowNodes(t){this.currentUniqueCount=0;const e={};t.forEachChangedNodeDepthFirst(o=>{o.leafGroup&&(o.childrenMapped=null)});const n=o=>{var s;o.leafGroup?this.bucketRowNode(o,e):(s=o.childrenAfterFilter)==null||s.forEach(n)};return t.executeFromRootNode(n),e}bucketRowNode(t,e){const n=this.funcColsService.getPivotColumns();n.length===0?t.childrenMapped=null:t.childrenMapped=this.bucketChildren(t.childrenAfterFilter,n,0,e),t.sibling&&(t.sibling.childrenMapped=t.childrenMapped)}bucketChildren(t,e,n,o){const s={},l=e[n];if(t.forEach(d=>{let u=this.valueService.getKeyForNode(l,d);if(x._missing(u)&&(u=""),!o[u]){this.currentUniqueCount+=1,o[u]={};const p=this.maxUniqueValues!==-1,f=this.currentUniqueCount>this.maxUniqueValues;if(p&&f)throw Error(Wd)}s[u]||(s[u]=[]),s[u].push(d)}),n===e.length-1)return s;{const d={};return x._iterateObject(s,(u,p)=>{d[u]=this.bucketChildren(p,e,n+1,o[u])}),d}}getPivotColumnDefs(){return this.pivotColumnDefs}};function Ny(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function Vy(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function Py(t){t.aggFuncService&&t.aggFuncService.clear()}function Dy(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function Fy(t){return t.columnModel.isPivotMode()}function Ry(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function My(t,e){t.funcColsService.setValueColumns(e,"api")}function Iy(t){return t.funcColsService.getValueColumns()}function Oy(t,e){t.funcColsService.removeValueColumns([e],"api")}function Ly(t,e){t.funcColsService.removeValueColumns(e,"api")}function Gy(t,e){t.funcColsService.addValueColumns([e],"api")}function zy(t,e){t.funcColsService.addValueColumns(e,"api")}function Zy(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function $y(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function Uy(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function Wy(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function Hy(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function jy(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function qy(t){return t.funcColsService.getRowGroupColumns()}function Ky(t,e){t.funcColsService.setPivotColumns(e,"api")}function Yy(t,e){t.funcColsService.removePivotColumns([e],"api")}function Jy(t,e){t.funcColsService.removePivotColumns(e,"api")}function Xy(t,e){t.funcColsService.addPivotColumns([e],"api")}function Qy(t,e){t.funcColsService.addPivotColumns(e,"api")}function e_(t){return t.funcColsService.getPivotColumns()}function t_(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function n_(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var r_=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="showRowGroupColsService"}wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}refresh(){this.showRowGroupCols=[],this.showRowGroupColsMap={},this.columnModel.getCols().forEach(t=>{const n=t.getColDef().showRowGroup,o=typeof n=="string";!o&&!(n===!0)||(this.showRowGroupCols.push(t),o?this.showRowGroupColsMap[n]=t:this.funcColsService.getRowGroupColumns().forEach(d=>{this.showRowGroupColsMap[d.getId()]=t}))})}getShowRowGroupCols(){return this.showRowGroupCols}getShowRowGroupCol(t){return this.showRowGroupColsMap[t]}},ci="32.3.3",Xa=x._defineModule({version:ci,moduleName:`${x.ModuleNames.RowGroupingModule}-core`,beans:[ly,my,Ty,By,Ay,ey,cy,r_,fy],userComponents:[{name:"agGroupRowRenderer",classImp:Ie.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Ie.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Ie.GroupCellRendererCtrl}],dependantModules:[Ie.EnterpriseCoreModule]}),o_=x._defineModule({version:ci,moduleName:`${x.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:Ny,addAggFuncs:Vy,clearAggFuncs:Py,setColumnAggFunc:Dy,isPivotMode:Fy,getPivotResultColumn:Ry,setValueColumns:My,getValueColumns:Iy,removeValueColumn:Oy,removeValueColumns:Ly,addValueColumn:Gy,addValueColumns:zy,setRowGroupColumns:Zy,removeRowGroupColumn:$y,removeRowGroupColumns:Uy,addRowGroupColumn:Wy,addRowGroupColumns:Hy,getRowGroupColumns:qy,moveRowGroupColumn:jy,setPivotColumns:Ky,removePivotColumn:Yy,removePivotColumns:Jy,addPivotColumn:Xy,addPivotColumns:Qy,getPivotColumns:e_,setPivotResultColumns:t_,getPivotResultColumns:n_},dependantModules:[Xa]}),Hd=x._defineModule({version:ci,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:gy}],dependantModules:[Xa,x._ColumnFilterModule]}),i_=x._defineModule({version:ci,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:yy}],dependantModules:[Hd,x._FloatingFilterModule]}),s_=x._defineModule({version:ci,moduleName:x.ModuleNames.RowGroupingModule,dependantModules:[Xa,o_,Hd,i_]}),jd=class extends qa{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:x._createIconNoSpan("valuePanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getTooltipParams(){const t=super.getTooltipParams();return t.location="valueColumnsList",t}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowValue()&&(!t.isValueActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setValueColumns(t,"toolPanelUi")}getExistingItems(){return this.funcColsService.getValueColumns()}},qd=300,a_=class extends x.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>`,[
|
|
28
|
+
</div>`,[x.AgCheckboxSelector,x.AgInputTextFieldSelector]),this.eExpand=x.RefPlaceholder,this.eSelect=x.RefPlaceholder,this.eFilterTextField=x.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:e=>{e.key===x.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=x._createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=x._createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=x._createIconNoSpan("columnSelectIndeterminate",this.gos)),this.setExpandState(0)}showOrHideOptions(){const t=!this.params.suppressColumnFilter,e=!this.params.suppressColumnSelectAll,n=!this.params.suppressColumnExpandAll,o=this.columnModel.isProvidedColGroupsPresent(),s=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(s("searchOoo","Search...")),x._setDisplayed(this.eFilterTextField.getGui(),t),x._setDisplayed(this.eSelect.getGui(),e),x._setDisplayed(this.eExpand,n&&o)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=x._debounce(()=>{const t=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:t})},qd)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(t){t.key===x.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),qd)}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(t){this.expandState=t,x._setDisplayed(this.eExpandChecked,this.expandState===0),x._setDisplayed(this.eExpandUnchecked,this.expandState===1),x._setDisplayed(this.eExpandIndeterminate,this.expandState===2)}setSelectionState(t){this.selectState=t,this.eSelect.setValue(this.selectState)}},l_={selector:"AG-PRIMARY-COLS-HEADER",component:a_},Kd=class{constructor(t,e,n,o=!1,s){this.localEventService=new x.LocalEventService,this.displayName=t,this.dept=n,this.group=o,o?(this.columnGroup=e,this.expanded=s,this.children=[]):this.column=e}isGroup(){return this.group}getDisplayName(){return this.displayName}getColumnGroup(){return this.columnGroup}getColumn(){return this.column}getDept(){return this.dept}isExpanded(){return!!this.expanded}getChildren(){return this.children}isPassesFilter(){return this.passesFilter}setExpanded(t){t!==this.expanded&&(this.expanded=t,this.localEventService.dispatchEvent({type:"expandedChanged"}))}setPassesFilter(t){this.passesFilter=t}addEventListener(t,e){this.localEventService.addEventListener(t,e)}removeEventListener(t,e){this.localEventService.removeEventListener(t,e)}},Yd=class extends x.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(),x.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){x.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 Ie.AgMenuList),o=this.localeService.getLocaleTextFunc();let s=()=>{};e.appendChild(n.getGui()),n.addMenuItems(t),n.addManagedListeners(n,{closeMenu:()=>{this.parentEl.focus(),s()}});const l=this.popupService.addPopup({modal:!0,eChild:e,closeOnEsc:!0,afterGuiAttached:()=>this.focusService.focusInto(n.getGui()),ariaLabel:o("ariaLabelContextMenu","Context Menu"),closedCallback: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)),o=this.columns.some(s=>e.allowedFunction(s)&&e.activeFunction(s));n&&t.push({name:e.activateLabel(this.displayName),icon:x._createIconNoSpan(e.addIcon,this.gos,null),action:()=>e.activateFunction()}),o&&t.push({name:e.deactivateLabel(this.displayName),icon:x._createIconNoSpan(e.removeIcon,this.gos,null),action:()=>e.deActivateFunction()})}return t}},Jd=class extends x.Component{constructor(t,e,n,o){super(),this.modelItem=t,this.allowDragging=e,this.eventType=n,this.focusWrapper=o,this.cbSelect=x.RefPlaceholder,this.eLabel=x.RefPlaceholder,this.eGroupOpenedIcon=x.RefPlaceholder,this.eGroupClosedIcon=x.RefPlaceholder,this.eColumnGroupIcons=x.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>`,[
|
|
35
|
+
</div>`,[x.AgCheckboxSelector]),this.eDragHandle=x._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(),x._getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gos,null,this.columnGroup).forEach(o=>this.addOrRemoveCssClass(o,!0))}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const t=this.columnGroup.getColGroupDef();if(!t)return;const e=this.gos.get("tooltipShowMode")==="whenTruncated";let n;e&&(n=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const o=()=>{const s=t.headerTooltip;this.setTooltip({newTooltipText:s,location:"columnToolPanelColumnGroup",shouldDisplayTooltip:n})};o(),this.addManagedEventListeners({newColumnsLoaded:o})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumnGroup",t}handleKeyDown(t){switch(t.key){case x.KeyCode.LEFT:t.preventDefault(),this.modelItem.setExpanded(!1);break;case x.KeyCode.RIGHT:t.preventDefault(),this.modelItem.setExpanded(!0);break;case x.KeyCode.SPACE:t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(t){const{columnGroup:e,gos:n}=this;if(n.get("functionsReadOnly"))return;const o=this.createBean(new Yd(e,t,this.focusWrapper));this.addDestroyFunc(()=>{o.isAlive()&&this.destroyBean(o)})}addVisibilityListenersToAllChildren(){const t=this.onColumnStateChanged.bind(this);this.columnGroup.getLeafColumns().forEach(e=>{this.addManagedListeners(e,{visibleChanged:t,columnValueChanged:t,columnPivotChanged:t,columnRowGroupChanged:t})})}setupDragging(){if(!this.allowDragging){x._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:x.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>t?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{t=!this.gos.get("suppressDragLeaveHidesColumns"),this.eventService.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{this.eventService.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{t&&this.modelItemUtils.updateColumns({columns:this.columnGroup.getLeafColumns(),visibleState:n==null?void 0:n.visibleState,pivotState:n==null?void 0:n.pivotState,eventType:this.eventType})},onGridExit:()=>{t&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}createDragItem(){const t=this.columnGroup.getLeafColumns(),e={},n={};return t.forEach(o=>{const s=o.getId();e[s]=o.isVisible(),n[s]=this.modelItemUtils.createPivotState(o)}),{columns:t,visibleState:e,pivotState:n}}setupExpandContract(){this.eGroupClosedIcon.appendChild(x._createIcon("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(x._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 x.TouchListener(this.eColumnGroupIcons,!0);this.addManagedListeners(e,{tap:t}),this.addDestroyFunc(e.destroy.bind(e))}onLabelClicked(){const t=!this.cbSelect.getValue();this.onChangeCommon(t)}onCheckboxChanged(t){this.onChangeCommon(t.selected)}getVisibleLeafColumns(){const t=[],e=n=>{n.forEach(o=>{o.isPassesFilter()&&(o.isGroup()?e(o.getChildren()):t.push(o.getColumn()))})};return e(this.modelItem.getChildren()),t}onChangeCommon(t){this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(),t,this.eventType)}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumnGroup","Column Group"),n=this.cbSelect.getValue(),o=n===void 0?t("ariaIndeterminate","indeterminate"):n?t("ariaVisible","visible"):t("ariaHidden","hidden"),s=t("ariaToggleVisibility","Press SPACE to toggle visibility");x._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${s} (${o})`),x._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}onColumnStateChanged(){const t=this.workOutSelectedValue(),e=this.workOutReadOnlyValue();this.processingColumnStateChange=!0,this.cbSelect.setValue(t),this.cbSelect.setReadOnly(e),this.addOrRemoveCssClass("ag-column-select-column-group-readonly",e),this.processingColumnStateChange=!1}workOutSelectedValue(){const t=this.columnModel.isPivotMode(),e=this.getVisibleLeafColumns();let n=0,o=0;if(e.forEach(s=>{!t&&s.getColDef().lockVisible||(this.isColumnChecked(s,t)?n++:o++)}),!(n>0&&o>0))return n>0}workOutReadOnlyValue(){const t=this.columnModel.isPivotMode();let e=0;return this.columnGroup.getLeafColumns().forEach(n=>{t?n.isAnyFunctionAllowed()&&e++:n.getColDef().lockVisible||e++}),e===0}isColumnChecked(t,e){if(e){const n=t.isPivotActive(),o=t.isRowGroupActive(),s=t.isValueActive();return n||o||s}return t.isVisible()}onExpandOrContractClicked(){const t=this.modelItem.isExpanded();this.modelItem.setExpanded(!t)}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const t=this.modelItem.isExpanded();x._setDisplayed(this.eGroupClosedIcon,!t),x._setDisplayed(this.eGroupOpenedIcon,t)}refreshAriaExpanded(){x._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)}},c_=class extends x.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 Ie.VirtualListDragFeature(this.comp,this.virtualList,{dragSourceType:x.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 x.isProvidedColumnGroup(t)?t.getLeafColumns():t?[t]:[]}isMoveBlocked(t){return this.gos.get("suppressMovableColumns")?!0:!!this.getCurrentColumnsBeingMoved(t).find(s=>{const l=s.getColDef();return!!l.suppressMovable||!!l.lockPosition})}moveItem(t,e){if(!e)return;const{component:n}=e;let o=null,s=e.position==="top";if(n instanceof Jd?(o=n.getColumns()[0],s=!0):n&&(o=n.getColumn()),!o)return;const l=this.getMoveTargetIndex({currentColumns:t,lastHoveredColumn:o,isBefore:s});l!=null&&this.columnMoveService.moveColumns(t,l,"toolPanelUi")}getMoveTargetIndex(t){const{currentColumns:e,lastHoveredColumn:n,isBefore:o}=t;if(!n||!e)return null;const s=this.columnModel.getCols().indexOf(n),l=o?s:s+1,d=this.getMoveDiff(e,l);return l-d}getMoveDiff(t,e){const n=this.columnModel.getCols();if(!t)return 0;const o=t[0],s=t.length;return n.indexOf(o)<e?s:0}},d_=class extends x.Component{constructor(t,e,n,o){super(),this.allowDragging=e,this.groupsExist=n,this.focusWrapper=o,this.eLabel=x.RefPlaceholder,this.cbSelect=x.RefPlaceholder,this.processingColumnStateChange=!1,this.column=t.getColumn(),this.columnDept=t.getDept(),this.displayName=t.getDisplayName()}wireBeans(t){this.columnModel=t.columnModel,this.dragAndDropService=t.dragAndDropService,this.modelItemUtils=t.modelItemUtils}postConstruct(){this.setTemplate(`<div class="ag-column-select-column">
|
|
36
36
|
<ag-checkbox data-ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>
|
|
37
37
|
<span class="ag-column-select-column-label" data-ref="eLabel"></span>
|
|
38
|
-
</div>`,[b.AgCheckboxSelector]),this.eDragHandle=b._createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const t=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1");const n=b._escapeString(this.displayName);this.eLabel.innerHTML=n;const o=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${o}`),this.getGui().style.setProperty("--ag-indentation-level",String(o)),this.setupDragging();const s=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:s}),this.addManagedListeners(this.column,{columnValueChanged:s,columnPivotChanged:s,columnRowGroupChanged:s,visibleChanged:s}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),b._getToolPanelClassesFromColDef(this.column.getColDef(),this.gos,this.column,null).forEach(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 o=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:o,location:"columnToolPanelColumn",shouldDisplayTooltip:e})};n(),this.addManagedEventListeners({newColumnsLoaded:n})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumn",t.colDef=this.column.getColDef(),t}onContextMenu(t){const{column:e,gos:n}=this;if(n.get("functionsReadOnly"))return;const o=this.createBean(new Kd(e,t,this.focusWrapper));this.addDestroyFunc(()=>{o.isAlive()&&this.destroyBean(o)})}handleKeyDown(t){t.key===b.KeyCode.SPACE&&(t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const t=!this.cbSelect.getValue();this.onChangeCommon(t)}onCheckboxChanged(t){this.onChangeCommon(t.selected)}onChangeCommon(t){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.setColumn(this.column,t,"toolPanelUi"))}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumn","Column"),n=this.cbSelect.getValue()?t("ariaVisible","visible"):t("ariaHidden","hidden"),o=t("ariaToggleVisibility","Press SPACE to toggle visibility");b._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${o} (${n})`),b._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging){b._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:b.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>t?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{t=!this.gos.get("suppressDragLeaveHidesColumns"),this.eventService.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{this.eventService.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{t&&this.modelItemUtils.updateColumns({columns:[this.column],visibleState:n==null?void 0:n.visibleState,pivotState:n==null?void 0:n.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{t&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}createDragItem(){const t=this.column.getColId(),e={[t]:this.column.isVisible()},n={[t]:this.modelItemUtils.createPivotState(this.column)};return{columns:[this.column],visibleState:e,pivotState:n}}onColumnStateChanged(){this.processingColumnStateChange=!0;const t=this.columnModel.isPivotMode();if(t){const o=this.column.isAnyFunctionActive();this.cbSelect.setValue(o)}else this.cbSelect.setValue(this.column.isVisible());let e=!0,n=!0;if(t){const o=this.gos.get("functionsReadOnly"),s=!this.column.isAnyFunctionAllowed();e=!o&&!s,n=e}else{const{enableRowGroup:o,enableValue:s,lockPosition:l,suppressMovable:d,lockVisible:u}=this.column.getColDef(),p=!!o||!!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){b._warnOnce("can not expand a column item that does not represent a column group header")}},d_=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},u_="ag-column-select-list",p_=class extends b.Component{constructor(){super(`<div class="${u_}" role="presentation"></div>`),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.colDefService=t.toolPanelColDefService,this.modelItemUtils=t.modelItemUtils}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach(t=>t()),this.destroyColumnItemFuncs=[]}init(t,e,n){this.params=t,this.allowDragging=e,this.eventType=n,this.params.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});const o=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:o,columnPivotModeChanged:o,columnRowGroupChanged:o,columnValueChanged:o,columnVisible:o,newColumnsLoaded:o}),this.expandGroupsByDefault=!this.params.contractColumnSelection,this.virtualList=this.createManagedBean(new Me.VirtualList({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((s,l)=>(b._setAriaLevel(l,s.getDept()+1),this.createComponentFromItem(s,l))),this.columnModel.isReady()&&this.onColumnsChanged(),!this.params.suppressColumnMove&&this.createManagedBean(new l_(this,this.virtualList))}createComponentFromItem(t,e){if(t.isGroup()){const o=new Yd(t,this.allowDragging,this.eventType,e);return this.createBean(o),o}const n=new c_(t,this.allowDragging,this.groupsExist,e);return this.createBean(n),n}onColumnsChanged(){this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const t=this.getExpandedStates(),e=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!e?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const t={};if(this.isInitialState){const{expandedGroupIds:e}=this.params.initialState;return e.forEach(n=>{t[n]=!0}),t}return this.allColsTree?(this.forEachItem(e=>{if(!e.isGroup())return;const n=e.getColumnGroup();n&&(t[n.getId()]=e.isExpanded())}),t):{}}setExpandedStates(t){if(!this.allColsTree)return;const{isInitialState:e}=this;this.forEachItem(n=>{if(!n.isGroup())return;const o=n.getColumnGroup();if(o){const s=t[o.getId()];(s!=null||e)&&n.setExpanded(!!s)}})}buildTreeFromWhatGridIsDisplaying(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))}setColumnLayout(t){const e=this.colDefService.createColumnTree(t);this.buildListModel(e),this.groupsExist=t.some(n=>n&&typeof n.children<"u"),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){this.buildListModel(this.columnModel.getColDefColTree()),this.groupsExist=this.columnModel.isProvidedColGroupsPresent()}buildListModel(t){const e=this.onColumnExpanded.bind(this),n=d=>{d.addEventListener("expandedChanged",e);const u=d.removeEventListener.bind(d,"expandedChanged",e);this.destroyColumnItemFuncs.push(u)},o=(d,u,p)=>{d.forEach(f=>{b.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()){o(d.getChildren(),u,p);return}const y=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,d,"columnToolPanel"),E=new qd(y,d,u,!0,this.expandGroupsByDefault);p.push(E),n(E),o(d.getChildren(),u+1,E.getChildren())},l=(d,u,p)=>{if(d.getColDef()&&d.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(d,"columnToolPanel");p.push(new qd(m,d,u))};this.destroyColumnTree(),o(t,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const t=n=>{n.isPassesFilter()&&(this.displayedColsList.push(n),n.isGroup()&&n.isExpanded()&&n.getChildren().forEach(t))};this.allColsTree.forEach(t),this.virtualList.setModel(new d_(this.displayedColsList));const e=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),e!=null&&this.focusRowIfAlive(e),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumnPanelList","Column List"),n=t("columns","Columns"),o=this.displayedColsList.length;b._setAriaLabel(this.virtualList.getAriaElement(),`${e} ${o} ${n}`)}focusRowIfAlive(t){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(t)},0)}forEachItem(t){const e=n=>{n.forEach(o=>{t(o),o.isGroup()&&e(o.getChildren())})};this.allColsTree&&e(this.allColsTree)}doSetExpandedAll(t){this.forEachItem(e=>{e.isGroup()&&e.setExpanded(t)})}setGroupsExpanded(t,e){if(!e){this.doSetExpandedAll(t);return}const n=[];this.forEachItem(s=>{if(!s.isGroup())return;const l=s.getColumnGroup().getId();e.indexOf(l)>=0&&(s.setExpanded(t),n.push(l))});const o=e.filter(s=>!b._includes(n,s));o.length>0&&b._warnOnce("unable to find group(s) for supplied groupIds:",o)}getExpandState(){let t=0,e=0;return this.forEachItem(n=>{n.isGroup()&&(n.isExpanded()?t++:e++)}),t>0&&e>0?2:e>0?1:0}doSetSelectedAll(t){this.modelItemUtils.selectAllChildren(this.allColsTree,t,this.eventType)}getSelectionState(){let t=0,e=0;const n=this.columnModel.isPivotMode();if(this.forEachItem(o=>{if(o.isGroup()||!o.isPassesFilter())return;const s=o.getColumn(),l=s.getColDef();let 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=b._exists(t)?t.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const t=n=>{if(!b._exists(this.filterText))return!0;const o=n.getDisplayName();return o==null||o.toLowerCase().indexOf(this.filterText)!==-1},e=(n,o)=>{let s=!1;if(n.isGroup()){const d=t(n);n.getChildren().forEach(u=>{const p=e(u,d||o);p&&(s=p)})}const l=o||s?!0:t(n);return n.setPassesFilter(l),l};this.allColsTree.forEach(n=>e(n,!1))}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const t=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:t})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const t=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:t})}getExpandedGroups(){const t=[];return this.allColsTree&&this.forEachItem(e=>{e.isGroup()&&e.isExpanded()&&t.push(e.getColumnGroup().getId())}),t}},h_={selector:"AG-PRIMARY-COLS-LIST",component:p_},f_=class extends b.Component{constructor(){super(`<div class="ag-column-select">
|
|
38
|
+
</div>`,[x.AgCheckboxSelector]),this.eDragHandle=x._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=x._escapeString(this.displayName);this.eLabel.innerHTML=n;const o=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${o}`),this.getGui().style.setProperty("--ag-indentation-level",String(o)),this.setupDragging();const s=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:s}),this.addManagedListeners(this.column,{columnValueChanged:s,columnPivotChanged:s,columnRowGroupChanged:s,visibleChanged:s}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),x._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 o=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:o,location:"columnToolPanelColumn",shouldDisplayTooltip:e})};n(),this.addManagedEventListeners({newColumnsLoaded:n})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumn",t.colDef=this.column.getColDef(),t}onContextMenu(t){const{column:e,gos:n}=this;if(n.get("functionsReadOnly"))return;const o=this.createBean(new Yd(e,t,this.focusWrapper));this.addDestroyFunc(()=>{o.isAlive()&&this.destroyBean(o)})}handleKeyDown(t){t.key===x.KeyCode.SPACE&&(t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const t=!this.cbSelect.getValue();this.onChangeCommon(t)}onCheckboxChanged(t){this.onChangeCommon(t.selected)}onChangeCommon(t){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.setColumn(this.column,t,"toolPanelUi"))}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumn","Column"),n=this.cbSelect.getValue()?t("ariaVisible","visible"):t("ariaHidden","hidden"),o=t("ariaToggleVisibility","Press SPACE to toggle visibility");x._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${o} (${n})`),x._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging){x._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:x.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>t?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{t=!this.gos.get("suppressDragLeaveHidesColumns"),this.eventService.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{this.eventService.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{t&&this.modelItemUtils.updateColumns({columns:[this.column],visibleState:n==null?void 0:n.visibleState,pivotState:n==null?void 0:n.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{t&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}createDragItem(){const t=this.column.getColId(),e={[t]:this.column.isVisible()},n={[t]:this.modelItemUtils.createPivotState(this.column)};return{columns:[this.column],visibleState:e,pivotState:n}}onColumnStateChanged(){this.processingColumnStateChange=!0;const t=this.columnModel.isPivotMode();if(t){const o=this.column.isAnyFunctionActive();this.cbSelect.setValue(o)}else this.cbSelect.setValue(this.column.isVisible());let e=!0,n=!0;if(t){const o=this.gos.get("functionsReadOnly"),s=!this.column.isAnyFunctionAllowed();e=!o&&!s,n=e}else{const{enableRowGroup:o,enableValue:s,lockPosition:l,suppressMovable:d,lockVisible:u}=this.column.getColDef(),p=!!o||!!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){x._warnOnce("can not expand a column item that does not represent a column group header")}},u_=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},p_="ag-column-select-list",h_=class extends x.Component{constructor(){super(`<div class="${p_}" role="presentation"></div>`),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.colDefService=t.toolPanelColDefService,this.modelItemUtils=t.modelItemUtils}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach(t=>t()),this.destroyColumnItemFuncs=[]}init(t,e,n){this.params=t,this.allowDragging=e,this.eventType=n,this.params.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});const o=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:o,columnPivotModeChanged:o,columnRowGroupChanged:o,columnValueChanged:o,columnVisible:o,newColumnsLoaded:o}),this.expandGroupsByDefault=!this.params.contractColumnSelection,this.virtualList=this.createManagedBean(new Ie.VirtualList({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((s,l)=>(x._setAriaLevel(l,s.getDept()+1),this.createComponentFromItem(s,l))),this.columnModel.isReady()&&this.onColumnsChanged(),!this.params.suppressColumnMove&&this.createManagedBean(new c_(this,this.virtualList))}createComponentFromItem(t,e){if(t.isGroup()){const o=new Jd(t,this.allowDragging,this.eventType,e);return this.createBean(o),o}const n=new d_(t,this.allowDragging,this.groupsExist,e);return this.createBean(n),n}onColumnsChanged(){this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const t=this.getExpandedStates(),e=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!e?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const t={};if(this.isInitialState){const{expandedGroupIds:e}=this.params.initialState;return e.forEach(n=>{t[n]=!0}),t}return this.allColsTree?(this.forEachItem(e=>{if(!e.isGroup())return;const n=e.getColumnGroup();n&&(t[n.getId()]=e.isExpanded())}),t):{}}setExpandedStates(t){if(!this.allColsTree)return;const{isInitialState:e}=this;this.forEachItem(n=>{if(!n.isGroup())return;const o=n.getColumnGroup();if(o){const s=t[o.getId()];(s!=null||e)&&n.setExpanded(!!s)}})}buildTreeFromWhatGridIsDisplaying(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))}setColumnLayout(t){const e=this.colDefService.createColumnTree(t);this.buildListModel(e),this.groupsExist=t.some(n=>n&&typeof n.children<"u"),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){this.buildListModel(this.columnModel.getColDefColTree()),this.groupsExist=this.columnModel.isProvidedColGroupsPresent()}buildListModel(t){const e=this.onColumnExpanded.bind(this),n=d=>{d.addEventListener("expandedChanged",e);const u=d.removeEventListener.bind(d,"expandedChanged",e);this.destroyColumnItemFuncs.push(u)},o=(d,u,p)=>{d.forEach(f=>{x.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()){o(d.getChildren(),u,p);return}const y=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,d,"columnToolPanel"),B=new Kd(y,d,u,!0,this.expandGroupsByDefault);p.push(B),n(B),o(d.getChildren(),u+1,B.getChildren())},l=(d,u,p)=>{if(d.getColDef()&&d.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(d,"columnToolPanel");p.push(new Kd(m,d,u))};this.destroyColumnTree(),o(t,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const t=n=>{n.isPassesFilter()&&(this.displayedColsList.push(n),n.isGroup()&&n.isExpanded()&&n.getChildren().forEach(t))};this.allColsTree.forEach(t),this.virtualList.setModel(new u_(this.displayedColsList));const e=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),e!=null&&this.focusRowIfAlive(e),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumnPanelList","Column List"),n=t("columns","Columns"),o=this.displayedColsList.length;x._setAriaLabel(this.virtualList.getAriaElement(),`${e} ${o} ${n}`)}focusRowIfAlive(t){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(t)},0)}forEachItem(t){const e=n=>{n.forEach(o=>{t(o),o.isGroup()&&e(o.getChildren())})};this.allColsTree&&e(this.allColsTree)}doSetExpandedAll(t){this.forEachItem(e=>{e.isGroup()&&e.setExpanded(t)})}setGroupsExpanded(t,e){if(!e){this.doSetExpandedAll(t);return}const n=[];this.forEachItem(s=>{if(!s.isGroup())return;const l=s.getColumnGroup().getId();e.indexOf(l)>=0&&(s.setExpanded(t),n.push(l))});const o=e.filter(s=>!x._includes(n,s));o.length>0&&x._warnOnce("unable to find group(s) for supplied groupIds:",o)}getExpandState(){let t=0,e=0;return this.forEachItem(n=>{n.isGroup()&&(n.isExpanded()?t++:e++)}),t>0&&e>0?2:e>0?1:0}doSetSelectedAll(t){this.modelItemUtils.selectAllChildren(this.allColsTree,t,this.eventType)}getSelectionState(){let t=0,e=0;const n=this.columnModel.isPivotMode();if(this.forEachItem(o=>{if(o.isGroup()||!o.isPassesFilter())return;const s=o.getColumn(),l=s.getColDef();let 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=x._exists(t)?t.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const t=n=>{if(!x._exists(this.filterText))return!0;const o=n.getDisplayName();return o==null||o.toLowerCase().indexOf(this.filterText)!==-1},e=(n,o)=>{let s=!1;if(n.isGroup()){const d=t(n);n.getChildren().forEach(u=>{const p=e(u,d||o);p&&(s=p)})}const l=o||s?!0:t(n);return n.setPassesFilter(l),l};this.allColsTree.forEach(n=>e(n,!1))}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const t=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:t})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const t=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:t})}getExpandedGroups(){const t=[];return this.allColsTree&&this.forEachItem(e=>{e.isGroup()&&e.isExpanded()&&t.push(e.getColumnGroup().getId())}),t}},f_={selector:"AG-PRIMARY-COLS-LIST",component:h_},m_=class extends x.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>`,[
|
|
41
|
+
</div>`,[l_,f_]),this.primaryColsHeaderPanel=x.RefPlaceholder,this.primaryColsListPanel=x.RefPlaceholder}init(t,e,n){this.allowDragging=t,this.params=e,this.eventType=n,this.primaryColsHeaderPanel.init(this.params);const o=this.params.suppressColumnFilter,s=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&o&&s&&this.primaryColsHeaderPanel.setDisplayed(!1),this.addManagedListeners(this.primaryColsListPanel,{groupExpanded:this.onGroupExpanded.bind(this),selectionChanged:this.onSelectionChange.bind(this)}),this.primaryColsListPanel.init(this.params,this.allowDragging,this.eventType),this.addManagedListeners(this.primaryColsHeaderPanel,{expandAll:this.onExpandAll.bind(this),collapseAll:this.onCollapseAll.bind(this),selectAll:this.onSelectAll.bind(this),unselectAll:this.onUnselectAll.bind(this),filterChanged:this.onFilterChanged.bind(this)}),this.positionableFeature=new x.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()}},Xd=class extends x.Component{constructor(){super(...arguments),this.cbPivotMode=x.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(),[
|
|
43
|
+
</div>`}postConstruct(){this.setTemplate(this.createTemplate(),[x.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)}},g_=class extends x.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 Xd),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new m_),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 Ya(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new jd(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new Ka(!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 Xd),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 Ya(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(t):t&&(this.valuesDropZonePanel=this.createManagedBean(new jd(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(t):t&&(this.pivotDropZonePanel=this.createManagedBean(new Ka(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(t)),this.setLastVisible())}setResizers(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach(t=>{if(!t)return;const e=t.getGui();t.toggleResizable(!e.classList.contains("ag-last-column-drop")&&!e.classList.contains("ag-hidden"))})}setLastVisible(){const t=this.getGui();Array.prototype.slice.call(t.querySelectorAll(".ag-column-drop")).forEach(s=>s.classList.remove("ag-last-column-drop"));const n=t.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),o=x._last(n);o&&o.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const e=this.getGui().children;for(let n=0;n<e.length;n++){const o=e[n];o.style.removeProperty("height"),o.style.removeProperty("flex")}}isRowGroupingModuleLoaded(){return this.gos.assertModuleRegistered(x.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,x._clearElement(this.getGui())}refresh(t){return this.destroyChildren(),this.init(t),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}},y_=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="modelItemUtils"}wireBeans(t){this.aggFuncService=t.aggFuncService,this.columnModel=t.columnModel,this.columnApplyStateService=t.columnApplyStateService}selectAllChildren(t,e,n){const o=this.extractAllLeafColumns(t);this.setAllColumns(o,e,n)}setColumn(t,e,n){this.setAllColumns([t],e,n)}setAllColumns(t,e,n){this.columnModel.isPivotMode()?this.setAllPivot(t,e,n):this.setAllVisible(t,e,n)}extractAllLeafColumns(t){const e=[],n=o=>{o.forEach(s=>{s.isPassesFilter()&&(s.isGroup()?n(s.getChildren()):e.push(s.getColumn()))})};return n(t),e}setAllVisible(t,e,n){const o=[];t.forEach(s=>{s.getColDef().lockVisible||s.isVisible()!=e&&o.push({colId:s.getId(),hide:!e})}),o.length>0&&this.columnApplyStateService.applyColumnState({state:o},n)}setAllPivot(t,e,n){this.setAllPivotActive(t,e,n)}setAllPivotActive(t,e,n){const o=[],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);o.push({colId:u.getId(),aggFunc:f})}else u.isAllowRowGroup()?o.push({colId:u.getId(),rowGroup:!0}):u.isAllowPivot()&&o.push({colId:u.getId(),pivot:!0})}:u=>{(u.isPivotActive()||u.isRowGroupActive()||u.isValueActive())&&o.push({colId:u.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};t.forEach(d),o.length>0&&this.columnApplyStateService.applyColumnState({state:o},n)}updateColumns(t){const{columns:e,visibleState:n,pivotState:o,eventType:s}=t,l=e.map(d=>{const u=d.getColId();if(this.columnModel.isPivotMode()){const p=o==null?void 0:o[u];return{colId:u,pivot:p==null?void 0:p.pivot,rowGroup:p==null?void 0:p.rowGroup,aggFunc:p==null?void 0:p.aggFunc}}else return{colId:u,hide:!(n!=null&&n[u])}});this.columnApplyStateService.applyColumnState({state:l},s)}createPivotState(t){return{pivot:t.isPivotActive(),rowGroup:t.isRowGroupActive(),aggFunc:t.isValueActive()?t.getAggFunc():void 0}}},__="32.3.3",Qd=x._defineModule({version:__,moduleName:x.ModuleNames.ColumnsToolPanelModule,beans:[y_],userComponents:[{name:"agColumnsToolPanel",classImp:g_},{name:"agMenuItem",classImp:Ie.AgMenuItemRenderer}],dependantModules:[Ie.EnterpriseCoreModule,s_,ja]});const v_=`.ag-header {
|
|
44
44
|
border-bottom: 1px solid var(--border-color-default);
|
|
45
|
-
}`;function Qd(){b.ModuleRegistry.registerModules([ts.ClientSideRowModelModule,om.InfiniteRowModelModule,ad.ServerSideRowModelModule,im.CsvExportModule,ld.ClipboardModule,cd.RangeSelectionModule,sm.RichSelectModule,am.MenuModule,lm.ExcelExportModule,Ha,Xd]);const t=Ag("AGGRID_LICENSE");t?(Me.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const v_=dd.createPart("headerBottomBorder").withCSS(__),eu=dd.themeQuartz.withParams({headerColumnResizeHandleColor:"transparent",accentColor:"#49cc49",borderColor:"#E1E3EB",cellHorizontalPaddingScale:1,checkboxBorderRadius:"3px",checkboxCheckedBackgroundColor:"#110529",checkboxCheckedBorderColor:"#110529",checkboxIndeterminateBackgroundColor:"#110529",checkboxIndeterminateBorderColor:"#110529",checkboxUncheckedBorderColor:"#CFD1DB",columnBorder:!0,columnHoverColor:"#9BABCC16",fontFamily:"inherit",foregroundColor:"#110529",headerBackgroundColor:"#F7F8FA",headerColumnBorder:!0,headerFontWeight:600,headerRowBorder:!0,headerVerticalPaddingScale:.8,iconButtonHoverColor:"#9BABCC32",iconSize:"16px",menuBackgroundColor:"#FFFFFF",menuBorder:!0,menuTextColor:"#110529",rowHoverColor:"#9BABCC16",rowVerticalPaddingScale:1,selectedRowBackgroundColor:"#63E02424",sidePanelBorder:!1,spacing:"8px",tooltipBackgroundColor:"#110529",tooltipTextColor:"#FFFFFF",wrapperBorderRadius:"6px"}).withPart(v_),tu=Symbol("sdk-vue");function Xa(){return r.inject(tu)}function C_(t,e,n={}){let o;Qd();const s=()=>{t.loadBlockState().then(d=>{l.loaded=!0;const u=Cm(d,t,n),p=e(u),f=Object.fromEntries(Object.entries(p.routes).map(([m,y])=>{const E=typeof y=="function"?y():y;return[m,r.markRaw(E)]}));o=Object.assign(u,{...p,getRoute(m){return f[m]}})}).catch(d=>{console.error("load initial state error",d),l.error=d})},l=r.reactive({loaded:!1,error:void 0,useApp(){return dm(o,"App is not loaded")},install(d){d.provide(tu,this),s()}});return l}var w_=Object.defineProperty,b_=(t,e,n)=>e in t?w_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,x_=(t,e,n)=>b_(t,e+"",n);function nu(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function k_(t,e,n){const o=Math.min(e,n),s=Math.max(e,n);return t>=o&&t<=s}function S_(t){return new Promise(e=>setTimeout(e,t))}function E_(t){return t()}function ps(t,e,n){return e>t?e:t>n?n:t}function ru(t,e){return e(t)}function Gr(t,e){if(t!=null)return e(t)}function T_(t){if(t&&t.ok)return t.value}async function B_(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const ou=t=>t;function A_(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function N_(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(A_(65,91));return e}function iu(){return N_(42)}const Qa=Array.isArray;function li(t){return t!==null&&typeof t=="object"}function el(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null}function V_(t,e){return Object.keys(t).map(n=>e(t[n],n))}function ci(t,e){return li(t)&&li(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>ci(t[n],e[n])):t===e}function di(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=di(t[n]);return e}else if(li(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=di(t[n])}),e}else return t}function P_(t){return Array.isArray(t)?Object.assign([],t):li(t)?Object.assign({},t):t}function D_(t,e){const n={};for(const o in e)e[o]!==t[o]&&(n[o]=t[o]);return n}function F_(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function R_(t,e,n){return t[e]=n,t}function M_(t,e){return t[e]}function I_(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function O_(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function L_(t,...e){return e.map(n=>t[n])}function G_(t,...e){const n=Object.assign({},t);return e.forEach(o=>delete n[o]),n}function su(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],s=e[n];el(o)&&el(s)||Qa(o)&&Qa(s)&&o.length===s.length?su(o,s):t[n]=s}),t}const tl=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:F_,deepClone:di,deepEqual:ci,deepPatch:su,getProp:M_,isArray:Qa,isObject:li,isPlainObject:el,map:V_,omit:G_,pick:O_,pickValues:L_,setProp:R_,shallowClone:P_,shallowDiff:D_,shiftProp:I_},Symbol.toStringTag,{value:"Module"}));function z_(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,o)}function au(t,e,n){let o;return function(...s){o&&clearTimeout(o),o=setTimeout(()=>{o=void 0,t.apply(this,s)},e)}}const Z_=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],$_=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],U_=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],W_=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],lu=(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 nl(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?W_:U_:e.binary?$_:Z_;if(e.signed&&t===0)return` 0 ${n[0]}`;const o=t<0,s=o?"-":e.signed?"+":"";if(o&&(t=-t),t<1){const p=lu(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=lu(Number(t),e.locale),u=n[l];return s+d+" "+u}const H_={class:"context-menu"},j_=["onClick"],q_=r.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(t,{emit:e}){const n=e,o=s=>{s.cb(),n("close")};return(s,l)=>(r.openBlock(),r.createElementBlock("div",H_,[(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=>o(d),["stop"])},[r.createElementVNode("span",null,r.toDisplayString(d.text),1)],8,j_))),128))]))}}),Kt=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},K_=Kt(q_,[["__scopeId","data-v-12530966"]]);function rl(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},o=r.h(K_,{options:e,onClose:()=>{n()}});r.render(o,document.body);const s=o.el;return s.style.top=t.clientY+"px",s.style.left=t.clientX+"px",document.addEventListener("click",l=>{s.contains(l.target)||n()}),n}const cu=Symbol(),hs=()=>r.inject(cu),Y_=["value"],J_={key:1},X_=r.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,s=r.reactive({edit:!1}),l=r.computed(()=>o.valueType),d=f=>{var m;let y=(m=f.target)==null?void 0:m.value;const E=r.unref(l),S=E_(()=>E==="integer"?parseInt(y,10):E==="float"?Number(y):y);n("update:modelValue",S),s.edit=!1},u=r.ref(),p=f=>{!f.metaKey&&o.editable&&(s.edit=!0,requestAnimationFrame(()=>{var m,y;(y=(m=u.value)==null?void 0:m.querySelector("input"))==null||y.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]=y=>s.edit=!1),onChange:d},null,40,Y_)):(r.openBlock(),r.createElementBlock("div",J_,r.toDisplayString(f.modelValue),1))],2))}}),Q_=["^data-row-index"],ev={key:0,class:"control-cell"},tv=r.defineComponent({__name:"TdCell",props:{cell:{}},setup(t){const e=t,n=hs(),o=r.computed(()=>e.cell.column.valueType),s=f=>{Gr(n.settings.value.onUpdatedRow,m=>{const y=e.cell.row,E={...y.dataRow,[e.cell.id]:f};m({...y,dataRow:E})})},l=f=>{f.metaKey&&n.selectRow(e.cell.row.primaryKey)},d=(f,m)=>{if(f.type==="contextmenu")f.preventDefault();else return;const y=n.settings??{},E=[],{onSelectedRows:S,onSelectedColumns:A}=y.value,O=n.data.selectedRows.has(m.primaryKey);S&&S.length&&(O?E.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):E.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),A&&A.length&&(E.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),E.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),E.length&&rl(f,E)},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]=y=>d(y,f.cell.row))},[f.cell.control?(r.openBlock(),r.createElementBlock("div",ev,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(X_,{key:2,"model-value":f.cell.value,"value-type":o.value,editable:f.cell.column.editable,"onUpdate:modelValue":s},null,8,["model-value","value-type","editable"]))],42,Q_))}}),nv={},rv={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ov(t,e){return r.openBlock(),r.createElementBlock("svg",rv,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 iv=Kt(nv,[["render",ov]]),sv={class:"tr-head"},av=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",sv,[r.renderSlot(e.$slots,"default")]))}});function lv(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function cv(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,o)}const dv=["^data-col-id"],uv=r.defineComponent({__name:"ThCell",props:{col:{}},emits:["delete:column","expand:column","change:sort"],setup(t,{emit:e}){const n=e;function o(l){l.preventDefault();const d=[];d.length&&rl(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:lv(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:o},[l.col.valueType?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(l.col.valueType)},null,2)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(l.col.label)+" ",1),l.col.sort?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["sort",l.col.sort.direction]),onClick:d[0]||(d[0]=r.withModifiers(()=>s(l.col),["stop"]))},null,2)):r.createCommentVNode("",!0)],42,dv))}}),pv=r.defineComponent({__name:"TrBody",props:{row:{}},setup(t){const e=r.ref(),n=()=>{r.nextTick().then(()=>{Gr(e.value,o=>o.scrollLeft=0)})};return(o,s)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"trRef",ref:e,class:r.normalizeClass(["tr-body",{selected:o.row.selected}]),scroll:"no",style:r.normalizeStyle(o.row.style),onScroll:n},[r.renderSlot(o.$slots,"default")],38))}}),hv=r.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(t){const e=hs(),n=t,o=r.computed(()=>e.data.selectedColumns.has(n.column.id));return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["column-caret",{selected:o.value,frozen:s.column.frozen}])},null,2))}});function rt(t,e,n,o){r.onMounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.addEventListener(e,n,o)}),r.onUnmounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.removeEventListener(e,n,o)})}function fv(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function mv(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function gv(t,e){let n;function o(l){n={...l}}fv(()=>{n=void 0,e()});const s=mv(t);return rt(window,"mousemove",l=>{n&&s({x:n.x,width:n.width,diff:l.x-n.x})}),{start:o}}const ho=1,yv=10,_v=30,du=60;function uu(){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 pu(t,e={}){const{delayEnter:n=0,delayLeave:o=0}=e,s=r.ref(!1);let l;const d=u=>{const p=u?n:o;l&&(clearTimeout(l),l=void 0),p?l=setTimeout(()=>s.value=u,p):s.value=u};return window&&(rt(t,"mouseenter",()=>d(!0)),rt(t,"mouseleave",()=>d(!1))),s}function vv(t){var e;const n=Gr((e=r.unref(t))==null?void 0:e.querySelectorAll(".th-cell"),o=>[...o])??[];return n.map(o=>{const{width:s,x:l}=o.getBoundingClientRect(),d=o.getAttribute("data-col-id");return ou({colId:d,width:s,x:l,right:l+s})}).slice(0,n.length-1)}function Cv(t,e){const n=uu(),o=pu(e,{}),{data:s}=t,l=gv(u=>{Gr(s.resizeTh,p=>{const f=s.columns.find(m=>m.id===p.colId);f&&(f.width=ps(u.width+u.diff,_v,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(!o.value){document.body.style.cursor="";return}if(s.resize)return;const u=vv(e).find(p=>Math.abs(n.x-p.right)<yv);u?(document.body.style.cursor="col-resize",s.resizeTh=u):(s.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:d}}const wv={key:0,class:"command-menu"},bv={key:0},xv=["onClick"],kv=r.defineComponent({__name:"RowsCommandMenu",setup(t){const e=hs(),n=r.computed(()=>e.getSelectedRows()),o=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)=>o.value?(r.openBlock(),r.createElementBlock("div",wv,[n.value.length?(r.openBlock(),r.createElementBlock("span",bv,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,xv))),128))])):r.createCommentVNode("",!0)}}),Sv={key:0,class:"command-menu"},Ev={key:0},Tv=["onClick"],Bv=r.defineComponent({__name:"ColumnsCommandMenu",setup(t){const e=hs(),n=r.computed(()=>e.getSelectedColumns()),o=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)=>o.value?(r.openBlock(),r.createElementBlock("div",Sv,[n.value.length?(r.openBlock(),r.createElementBlock("span",Ev,"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,Tv))),128))])):r.createCommentVNode("",!0)}});function cr(t,e){const n={el:void 0,x:0,y:0},o=s=>({x:s.x,y:s.y,dx:s.x-n.x,dy:s.y-n.y});rt(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)}),rt(document,"mouseup",s=>{n.el&&(n.el=void 0,e({...o(s),stop:!0},n))}),rt(document,"mousemove",s=>{n.el&&e(o(s),n)})}const Av=r.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(t,{emit:e}){const n=e,o=t,s=r.ref(),l=r.computed(()=>o.windowSize-12),d=r.computed(()=>o.windowSize<o.dataSize),u=r.computed(()=>Math.ceil(o.offset*(l.value/o.dataSize))),p=r.computed(()=>Math.ceil(l.value*l.value/o.dataSize)),f=r.computed(()=>({top:`${u.value}px`,height:`${p.value}px`}));return cr(s,(m,y)=>{const E=(u.value+m.dy)*o.dataSize/l.value;n("change:offset",E),y.x=m.x,y.y=m.y}),(m,y)=>(r.openBlock(),r.createElementBlock("div",{class:"t-scroll",style:r.normalizeStyle({height:`${m.windowSize}px`})},[r.createElementVNode("div",null,[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 Nv(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:o,scrollLeft:s}=e,l=[...e.columns],d=iu();n.value.controlColumn&&l.unshift({id:d,label:"#",width:60,frozen:!0});let u=0;const p=l.map(m=>{const y={...m,offset:u};return u+=m.width+ho,y}),f=p.filter(m=>m.frozen);return z_(p,m=>m.frozen?!1:s<m.offset+m.width&&m.offset<o+s).concat(f).map(m=>({...m,style:{left:m.frozen?`${m.offset}px`:`${m.offset-e.scrollLeft}px`,width:`${m.width}px`},control:m.id===d}))})}function Vv(t,e){const n=r.computed(()=>e.value.reduce((o,s)=>(o[s.id]=s.justify?"justify-"+s.justify:"",o),{}));return r.computed(()=>t.rows.map(o=>{const s=n.value,{primaryKey:l,offset:d,dataRow:u,height:p}=o,f=e.value.map(m=>({id:m.id,column:m,row:o,value:u[m.id],class:s[m.id],editable:m.editable,width:m.width,style:m.style,control:m.control}));return ou({style:{top:`${d-t.scrollTop}px`,height:`${o.height}px`},primaryKey:l,offset:d,height:p,cells:f,selected:t.selectedRows.has(l)})}))}const Pv=async(t,e)=>{const{scrollTop:n,bodyHeight:o}=t;return await S_(0),B_({rows:e.getRows(n,o),dataWindow:t})};function Dv(t){const e=r.reactive({rowIndex:-1,columns:[],pendingLoads:0,currentWindow:void 0,rows:[],resize:!1,resizeTh:void 0,dataHeight:0,bodyHeight:t.settings.height,bodyWidth:0,scrollTop:0,scrollLeft:0,selectedRows:new Set,selectedColumns:new Set});r.watch(()=>t.settings,m=>{e.columns=di(m.columns),e.currentWindow=void 0,m.dataSource.getHeight().then(y=>{e.dataHeight=y,f.updateBodyHeight()}).catch(y=>e.error=y)},{immediate:!0});const n=r.computed(()=>t.settings),o=r.computed(()=>e.columns.reduce((m,y)=>m+y.width+ho,0)),s=r.computed(()=>ru(f.data.dataHeight-f.data.bodyHeight,m=>m>0?m:0)),l=r.computed(()=>ru(o.value-f.data.bodyWidth,m=>m>0?m:0)),d=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),u=Nv({data:e,settings:n}),p=Vv(e,u),f={data:e,settings:n,tableColumns:u,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((E,S)=>E+S.width+ho,0),y=e.bodyWidth+e.scrollLeft;if(m<y){const E=e.columns[e.columns.length-1];E.width=E.width+(y-m)}},updateOffsets(m){this.updateScrollTop(e.scrollTop+m.deltaY),this.updateScrollLeft(e.scrollLeft+m.deltaX)},getSelectedRows(){return e.rows.filter(m=>e.selectedRows.has(m.primaryKey))},getSelectedColumns(){return e.columns.filter(m=>e.selectedColumns.has(m.id))},selectRow(m){e.selectedRows.add(m)},unselectRow(m){e.selectedRows.delete(m)},selectColumn(m){e.selectedColumns.add(m)},unselectColumn(m){e.selectedColumns.delete(m)},updateScrollTop(m){e.scrollTop=ps(m,0,s.value)},updateScrollLeft(m){e.scrollLeft=ps(m,0,l.value)},updateBodyHeight(){const{height:m}=t.settings,{dataHeight:y}=e,E=m>y?y:m;e.bodyHeight=E},updateDimensions(m){this.updateBodyHeight(),f.data.bodyWidth=m.width,f.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(d,(m,y)=>{const E=m.current;(!E||m.scrollTop<E.scrollTop||m.scrollTop+m.bodyHeight>E.bodyHeight+E.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-du,bodyHeight:m.bodyHeight+du*2},Pv(di(e.currentWindow),n.value.dataSource).then(({rows:S,dataWindow:A})=>{ci(e.currentWindow,A)&&(e.rows=S)}))},{deep:!0,immediate:!0}),r.provide(cu,f),f}const Fv={class:"command-menu__container"},Rv={key:0,class:"table-body__no-data"},Mv={class:"carets"},ol=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,o=t,s=Dv(o),l=r.computed(()=>s.data.rows.length===0),d=r.computed(()=>({height:l.value?"212px":s.data.bodyHeight+"px"}));r.watch(s.data,O=>n("update:data",O),{deep:!0}),r.watch(o,()=>m);const u=r.ref(),p=r.ref(),f=r.ref(),m=()=>{Gr(f.value,O=>{s.updateDimensions(O.getBoundingClientRect())})},y=s.tableColumns,E=s.tableRows,{mouseDown:S}=Cv(s,u);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(o.settings),r.nextTick(m)}),rt(window,"resize",()=>r.nextTick(m));const A=O=>{O.preventDefault(),s.updateOffsets(O)};return(O,z)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:u,class:"data-table",onMousedown:z[2]||(z[2]=(...C)=>r.unref(S)&&r.unref(S)(...C))},[r.createElementVNode("div",Fv,[r.createVNode(kv),z[3]||(z[3]=r.createTextVNode()),r.createVNode(Bv)]),z[7]||(z[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(av,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,R)=>(r.openBlock(),r.createBlock(uv,{key:R,col:C,style:r.normalizeStyle(C.style),"onChange:sort":z[0]||(z[0]=G=>O.$emit("change:sort",G))},null,8,["col","style"]))),128))]),_:1})],512),z[8]||(z[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:f,class:"table-body",style:r.normalizeStyle(d.value),onWheel:A},[l.value?(r.openBlock(),r.createElementBlock("div",Rv,[r.createElementVNode("div",null,[r.createVNode(iv),z[4]||(z[4]=r.createTextVNode()),z[5]||(z[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),z[6]||(z[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(E),(C,R)=>(r.openBlock(),r.createBlock(pv,{key:R,row:C},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C.cells,G=>(r.openBlock(),r.createBlock(tv,{key:G.column.id+":"+R,cell:G,style:r.normalizeStyle(G.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),z[9]||(z[9]=r.createTextVNode()),r.createElementVNode("div",Mv,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,R)=>(r.openBlock(),r.createBlock(hv,{key:R,column:C,style:r.normalizeStyle(C.style),"onChange:sort":z[1]||(z[1]=G=>O.$emit("change:sort",G))},null,8,["column","style"]))),128))]),z[10]||(z[10]=r.createTextVNode()),r.createVNode(Av,{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))}}),hu=new WeakMap;class Iv{constructor(e,n,o){x_(this,"dataHeight"),this.datum=e,this.resolveHeight=n,this.resolvePrimaryKey=o;const s=e.reduce((d,u,p)=>(d.indices.set(p,d.total),d.total+=this.resolveHeight(u,p)+ho,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:nu(s.indices.get(u)),height:this.resolveHeight(d,u)}));hu.set(this,l)}get rows(){return hu.get(this)}async getHeight(){return this.dataHeight}async getRows(e,n){return cv(this.rows,o=>{const s=o.offset;return e<s+o.height&&s<n+e})}}class Ov{constructor(e,n,o){this.api=e,this.rowHeight=n,this.resolvePrimaryKey=o}get height(){return this.rowHeight+ho}async getHeight(){return await this.api.count()*this.height}async getRows(e,n){const o=ps(Math.floor(e/this.height),0,Number.POSITIVE_INFINITY),s=Math.ceil(n+40/this.height);return(await this.api.query({offset:o,limit:s})).map((l,d)=>({dataRow:l,index:o+d,primaryKey:this.resolvePrimaryKey(l,o+d),offset:(o+d)*(this.rowHeight+ho),height:this.rowHeight}))}}function Lv(t){return Object.freeze(t)}function Gv(t){return r.h(ol,{settings:Object.freeze(t)})}function il(t,e){const n=new Iv(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function zv(t,e){return r.computed(()=>{const n=r.unref(t);return il(n,r.unref(e))})}function Zv(t,e){const n=r.computed(()=>{const s=r.unref(t);return il(s,r.unref(e))}),o=r.reactive({settings:n});return r.computed(()=>r.h(ol,o))}const $v=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:Ov,Component:ol,factory:Gv,rawDataSettings:il,settings:Lv,useRawData:zv,useRawDataComponent:Zv},Symbol.toStringTag,{value:"Module"}));function*Uv(t,e){for(const n of t)yield e(n)}function Wv(t){const e=[];for(const n of t)e.push(n);return e}function fu(t){return t()}function sl(t,e){if(t==null)throw Error(e);return t}function al(t){let e=!1;return function(...n){e||(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function mu(t){return new Promise(e=>setTimeout(e,t))}function gu(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function yu(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(yu(65,91));return e}function _u(t){return function(e){return 1-t(1-e)}}function jv(t){return function(e){return e<.5?t(2*e)/2:(2-t(2*(1-e)))/2}}function vu(t){const{duration:e,draw:n,timing:o}=t,s=performance.now();let l=!1;return requestAnimationFrame(function d(u){let p=(u-s)/e;(p>1||l)&&(p=1);const f=o(p);n(f),p<1&&requestAnimationFrame(d)}),function(){l=!0}}function qv(t){const{getFraction:e,draw:n,timing:o}=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=o(p);n(f),p<1&&requestAnimationFrame(d)}),function(){l=!0}}function Cu(t,e){let n=-1;return(...o)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...o),e)}}function wu(t,e,n=!0){let o=0,s;return function(...l){s=()=>{t.apply(this,l),o=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>o&&s()}}function Kv(t){return t.map(e=>({text:String(e),value:e}))}function dr(t){return t.map(e=>({label:"label"in e?e.label:e.text,value:e.value,description:e.description}))}const ll=new Map;function Yv(t){return ll.has(t)||ll.set(t,r.ref(localStorage.getItem(t))),sl(ll.get(t),"...")}function Jv(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function bu(t){const e=Yv(t);return r.watch(e,n=>Jv(t,n)),e}const cl=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{Wv(Uv(cl.values(),e=>e(t.matches?"dark":"light")))});const Xv=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",xu=r.ref(Xv),dl=bu("theme");function ku(t){const e=r.computed(()=>dl.value?dl.value:xu.value),n=s=>{xu.value=s,t&&t(s)};function o(){dl.value=e.value==="light"?"dark":(e.value,"light")}return r.watch(e,s=>{t&&t(r.unref(s))}),r.onMounted(()=>{cl.add(n)}),r.onUnmounted(()=>{cl.delete(n)}),[e,o]}const Qv=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=ku();return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-theme-switcher",r.unref(e)]),onClick:s[0]||(s[0]=(...l)=>r.unref(n)&&r.unref(n)(...l))},s[1]||(s[1]=[r.createElementVNode("div",null,null,-1)]),2))}}),eC={key:0,class:"pl-block-page__title"},tC={class:"pl-block-page__title__append"},nC={key:1},rC={class:"pl-block-page__body"},oC={name:"PlBlockPage"},iC=r.defineComponent({...oC,props:{noBodyGutters:{type:Boolean}},setup(t){const e=r.useSlots();return(n,o)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-layout-component pl-block-page",{noBodyGutters:n.noBodyGutters}])},[r.unref(e).title?(r.openBlock(),r.createElementBlock("div",eC,[r.createElementVNode("h1",null,[r.renderSlot(n.$slots,"title")]),o[0]||(o[0]=r.createTextVNode()),r.createElementVNode("div",tC,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",nC)),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",rC,[r.renderSlot(n.$slots,"default")])],2))}}),sC={name:"PlContainer"},aC=r.defineComponent({...sC,props:{width:{}},setup(t){const e=t,n=r.computed(()=>({width:e.width}));return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-container pl-layout-component",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),lC={name:"PlRow"},cC=r.defineComponent({...lC,props:{wrap:{type:Boolean},alignCenter:{type:Boolean},noGap:{type:Boolean}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-layout-component pl-row",{wrap:e.wrap,"align-center":e.alignCenter}])},[r.renderSlot(e.$slots,"default")],2))}}),dC={class:"pl-layout-component",style:{"flex-grow":"1"}},uC={name:"PlSpacer"},Su=r.defineComponent({...uC,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",dC))}}),pC={name:"PlGrid"},hC=r.defineComponent({...pC,props:{columns:{}},setup(t){const e=t,n=r.computed(()=>({gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`}));return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-layout-component pl-grid",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),fC={key:0,class:"pl-alert__icon"},mC={class:"pl-alert__main"},gC={key:0},yC={class:"pl-alert__main__text"},_C={name:"PlAlert"},vC=r.defineComponent({..._C,props:{modelValue:{type:Boolean,default:!0},type:{default:void 0},label:{default:void 0},icon:{type:Boolean,default:void 0},closeable:{type:Boolean,default:void 0},monospace:{type:Boolean,default:void 0},whiteSpacePre:{type:Boolean,default:void 0},maxHeight:{default:void 0}},emits:["update:modelValue"],setup(t){const e={success:"success",warn:"warning",info:"edit",error:"error"};return(n,o)=>n.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-alert",[{monospace:n.monospace,whiteSpacePre:n.whiteSpacePre},n.type?`pl-alert__${n.type}`:""]]),style:r.normalizeStyle({maxHeight:n.maxHeight})},[n.icon&&n.type?(r.openBlock(),r.createElementBlock("div",fC,[r.createElementVNode("div",{class:r.normalizeClass(`icon-24 icon-${e[n.type]}`)},null,2)])):r.createCommentVNode("",!0),o[2]||(o[2]=r.createTextVNode()),r.createElementVNode("div",mC,[n.label?(r.openBlock(),r.createElementBlock("label",gC,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",yC,[r.renderSlot(n.$slots,"default")])]),o[3]||(o[3]=r.createTextVNode()),n.closeable?(r.openBlock(),r.createElementBlock("div",{key:1,class:"pl-alert__close-btn","aria-label":"Close alert",role:"button",onClick:o[0]||(o[0]=s=>n.$emit("update:modelValue",!1))})):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),CC=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
45
|
+
}`;function eu(){x.ModuleRegistry.registerModules([rs.ClientSideRowModelModule,im.InfiniteRowModelModule,ld.ServerSideRowModelModule,sm.CsvExportModule,cd.ClipboardModule,dd.RangeSelectionModule,am.RichSelectModule,lm.MenuModule,cm.ExcelExportModule,ja,Qd]);const t=Ng("AGGRID_LICENSE");t?(Ie.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const C_=ud.createPart("headerBottomBorder").withCSS(v_),tu=ud.themeQuartz.withParams({headerColumnResizeHandleColor:"transparent",accentColor:"#49cc49",borderColor:"#E1E3EB",cellHorizontalPaddingScale:1,checkboxBorderRadius:"3px",checkboxCheckedBackgroundColor:"#110529",checkboxCheckedBorderColor:"#110529",checkboxIndeterminateBackgroundColor:"#110529",checkboxIndeterminateBorderColor:"#110529",checkboxUncheckedBorderColor:"#CFD1DB",columnBorder:!0,columnHoverColor:"#9BABCC16",fontFamily:"inherit",foregroundColor:"#110529",headerBackgroundColor:"#F7F8FA",headerColumnBorder:!0,headerFontWeight:600,headerRowBorder:!0,headerVerticalPaddingScale:.8,iconButtonHoverColor:"#9BABCC32",iconSize:"16px",menuBackgroundColor:"#FFFFFF",menuBorder:!0,menuTextColor:"#110529",rowHoverColor:"#9BABCC16",rowVerticalPaddingScale:1,selectedRowBackgroundColor:"#63E02424",sidePanelBorder:!1,spacing:"8px",tooltipBackgroundColor:"#110529",tooltipTextColor:"#FFFFFF",wrapperBorderRadius:"6px"}).withPart(C_),nu=Symbol("sdk-vue");function Qa(){return r.inject(nu)}function w_(t,e,n={}){let o;eu();const s=()=>{t.loadBlockState().then(d=>{l.loaded=!0;const u=wm(d,t,n),p=e(u),f=Object.fromEntries(Object.entries(p.routes).map(([m,y])=>{const B=typeof y=="function"?y():y;return[m,r.markRaw(B)]}));o=Object.assign(u,{...p,getRoute(m){return f[m]}})}).catch(d=>{console.error("load initial state error",d),l.error=d})},l=r.reactive({loaded:!1,error:void 0,useApp(){return um(o,"App is not loaded")},install(d){d.provide(nu,this),s()}});return l}var b_=Object.defineProperty,x_=(t,e,n)=>e in t?b_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,k_=(t,e,n)=>x_(t,e+"",n);function ru(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function S_(t,e,n){const o=Math.min(e,n),s=Math.max(e,n);return t>=o&&t<=s}function E_(t){return new Promise(e=>setTimeout(e,t))}function T_(t){return t()}function fs(t,e,n){return e>t?e:t>n?n:t}function ou(t,e){return e(t)}function Zr(t,e){if(t!=null)return e(t)}function B_(t){if(t&&t.ok)return t.value}async function A_(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const iu=t=>t;function N_(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(N_(65,91));return e}function su(){return V_(42)}const el=Array.isArray;function di(t){return t!==null&&typeof t=="object"}function tl(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null}function P_(t,e){return Object.keys(t).map(n=>e(t[n],n))}function ui(t,e){return di(t)&&di(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>ui(t[n],e[n])):t===e}function pi(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=pi(t[n]);return e}else if(di(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=pi(t[n])}),e}else return t}function D_(t){return Array.isArray(t)?Object.assign([],t):di(t)?Object.assign({},t):t}function F_(t,e){const n={};for(const o in e)e[o]!==t[o]&&(n[o]=t[o]);return n}function R_(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function M_(t,e,n){return t[e]=n,t}function I_(t,e){return t[e]}function O_(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function L_(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function G_(t,...e){return e.map(n=>t[n])}function z_(t,...e){const n=Object.assign({},t);return e.forEach(o=>delete n[o]),n}function au(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],s=e[n];tl(o)&&tl(s)||el(o)&&el(s)&&o.length===s.length?au(o,s):t[n]=s}),t}const nl=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:R_,deepClone:pi,deepEqual:ui,deepPatch:au,getProp:I_,isArray:el,isObject:di,isPlainObject:tl,map:P_,omit:z_,pick:L_,pickValues:G_,setProp:M_,shallowClone:D_,shallowDiff:F_,shiftProp:O_},Symbol.toStringTag,{value:"Module"}));function Z_(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,o)}function lu(t,e,n){let o;return function(...s){o&&clearTimeout(o),o=setTimeout(()=>{o=void 0,t.apply(this,s)},e)}}const $_=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],U_=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],W_=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],H_=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],cu=(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 rl(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?H_:W_:e.binary?U_:$_;if(e.signed&&t===0)return` 0 ${n[0]}`;const o=t<0,s=o?"-":e.signed?"+":"";if(o&&(t=-t),t<1){const p=cu(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=cu(Number(t),e.locale),u=n[l];return s+d+" "+u}const j_={class:"context-menu"},q_=["onClick"],K_=r.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(t,{emit:e}){const n=e,o=s=>{s.cb(),n("close")};return(s,l)=>(r.openBlock(),r.createElementBlock("div",j_,[(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=>o(d),["stop"])},[r.createElementVNode("span",null,r.toDisplayString(d.text),1)],8,q_))),128))]))}}),Kt=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},Y_=Kt(K_,[["__scopeId","data-v-12530966"]]);function ol(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},o=r.h(Y_,{options:e,onClose:()=>{n()}});r.render(o,document.body);const s=o.el;return s.style.top=t.clientY+"px",s.style.left=t.clientX+"px",document.addEventListener("click",l=>{s.contains(l.target)||n()}),n}const du=Symbol(),ms=()=>r.inject(du),J_=["value"],X_={key:1},Q_=r.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,s=r.reactive({edit:!1}),l=r.computed(()=>o.valueType),d=f=>{var m;let y=(m=f.target)==null?void 0:m.value;const B=r.unref(l),T=T_(()=>B==="integer"?parseInt(y,10):B==="float"?Number(y):y);n("update:modelValue",T),s.edit=!1},u=r.ref(),p=f=>{!f.metaKey&&o.editable&&(s.edit=!0,requestAnimationFrame(()=>{var m,y;(y=(m=u.value)==null?void 0:m.querySelector("input"))==null||y.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]=y=>s.edit=!1),onChange:d},null,40,J_)):(r.openBlock(),r.createElementBlock("div",X_,r.toDisplayString(f.modelValue),1))],2))}}),ev=["^data-row-index"],tv={key:0,class:"control-cell"},nv=r.defineComponent({__name:"TdCell",props:{cell:{}},setup(t){const e=t,n=ms(),o=r.computed(()=>e.cell.column.valueType),s=f=>{Zr(n.settings.value.onUpdatedRow,m=>{const y=e.cell.row,B={...y.dataRow,[e.cell.id]:f};m({...y,dataRow:B})})},l=f=>{f.metaKey&&n.selectRow(e.cell.row.primaryKey)},d=(f,m)=>{if(f.type==="contextmenu")f.preventDefault();else return;const y=n.settings??{},B=[],{onSelectedRows:T,onSelectedColumns:N}=y.value,M=n.data.selectedRows.has(m.primaryKey);T&&T.length&&(M?B.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):B.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),N&&N.length&&(B.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),B.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),B.length&&ol(f,B)},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]=y=>d(y,f.cell.row))},[f.cell.control?(r.openBlock(),r.createElementBlock("div",tv,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(Q_,{key:2,"model-value":f.cell.value,"value-type":o.value,editable:f.cell.column.editable,"onUpdate:modelValue":s},null,8,["model-value","value-type","editable"]))],42,ev))}}),rv={},ov={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function iv(t,e){return r.openBlock(),r.createElementBlock("svg",ov,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 sv=Kt(rv,[["render",iv]]),av={class:"tr-head"},lv=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",av,[r.renderSlot(e.$slots,"default")]))}});function cv(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function dv(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,o)}const uv=["^data-col-id"],pv=r.defineComponent({__name:"ThCell",props:{col:{}},emits:["delete:column","expand:column","change:sort"],setup(t,{emit:e}){const n=e;function o(l){l.preventDefault();const d=[];d.length&&ol(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:cv(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:o},[l.col.valueType?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(l.col.valueType)},null,2)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(l.col.label)+" ",1),l.col.sort?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["sort",l.col.sort.direction]),onClick:d[0]||(d[0]=r.withModifiers(()=>s(l.col),["stop"]))},null,2)):r.createCommentVNode("",!0)],42,uv))}}),hv=r.defineComponent({__name:"TrBody",props:{row:{}},setup(t){const e=r.ref(),n=()=>{r.nextTick().then(()=>{Zr(e.value,o=>o.scrollLeft=0)})};return(o,s)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"trRef",ref:e,class:r.normalizeClass(["tr-body",{selected:o.row.selected}]),scroll:"no",style:r.normalizeStyle(o.row.style),onScroll:n},[r.renderSlot(o.$slots,"default")],38))}}),fv=r.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(t){const e=ms(),n=t,o=r.computed(()=>e.data.selectedColumns.has(n.column.id));return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["column-caret",{selected:o.value,frozen:s.column.frozen}])},null,2))}});function rt(t,e,n,o){r.onMounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.addEventListener(e,n,o)}),r.onUnmounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.removeEventListener(e,n,o)})}function mv(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function gv(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function yv(t,e){let n;function o(l){n={...l}}mv(()=>{n=void 0,e()});const s=gv(t);return rt(window,"mousemove",l=>{n&&s({x:n.x,width:n.width,diff:l.x-n.x})}),{start:o}}const mo=1,_v=10,vv=30,uu=60;function pu(){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 hu(t,e={}){const{delayEnter:n=0,delayLeave:o=0}=e,s=r.ref(!1);let l;const d=u=>{const p=u?n:o;l&&(clearTimeout(l),l=void 0),p?l=setTimeout(()=>s.value=u,p):s.value=u};return window&&(rt(t,"mouseenter",()=>d(!0)),rt(t,"mouseleave",()=>d(!1))),s}function Cv(t){var e;const n=Zr((e=r.unref(t))==null?void 0:e.querySelectorAll(".th-cell"),o=>[...o])??[];return n.map(o=>{const{width:s,x:l}=o.getBoundingClientRect(),d=o.getAttribute("data-col-id");return iu({colId:d,width:s,x:l,right:l+s})}).slice(0,n.length-1)}function wv(t,e){const n=pu(),o=hu(e,{}),{data:s}=t,l=yv(u=>{Zr(s.resizeTh,p=>{const f=s.columns.find(m=>m.id===p.colId);f&&(f.width=fs(u.width+u.diff,vv,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(!o.value){document.body.style.cursor="";return}if(s.resize)return;const u=Cv(e).find(p=>Math.abs(n.x-p.right)<_v);u?(document.body.style.cursor="col-resize",s.resizeTh=u):(s.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:d}}const bv={key:0,class:"command-menu"},xv={key:0},kv=["onClick"],Sv=r.defineComponent({__name:"RowsCommandMenu",setup(t){const e=ms(),n=r.computed(()=>e.getSelectedRows()),o=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)=>o.value?(r.openBlock(),r.createElementBlock("div",bv,[n.value.length?(r.openBlock(),r.createElementBlock("span",xv,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,kv))),128))])):r.createCommentVNode("",!0)}}),Ev={key:0,class:"command-menu"},Tv={key:0},Bv=["onClick"],Av=r.defineComponent({__name:"ColumnsCommandMenu",setup(t){const e=ms(),n=r.computed(()=>e.getSelectedColumns()),o=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)=>o.value?(r.openBlock(),r.createElementBlock("div",Ev,[n.value.length?(r.openBlock(),r.createElementBlock("span",Tv,"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,Bv))),128))])):r.createCommentVNode("",!0)}});function cr(t,e){const n={el:void 0,x:0,y:0},o=s=>({x:s.x,y:s.y,dx:s.x-n.x,dy:s.y-n.y});rt(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)}),rt(document,"mouseup",s=>{n.el&&(n.el=void 0,e({...o(s),stop:!0},n))}),rt(document,"mousemove",s=>{n.el&&e(o(s),n)})}const Nv=r.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(t,{emit:e}){const n=e,o=t,s=r.ref(),l=r.computed(()=>o.windowSize-12),d=r.computed(()=>o.windowSize<o.dataSize),u=r.computed(()=>Math.ceil(o.offset*(l.value/o.dataSize))),p=r.computed(()=>Math.ceil(l.value*l.value/o.dataSize)),f=r.computed(()=>({top:`${u.value}px`,height:`${p.value}px`}));return cr(s,(m,y)=>{const B=(u.value+m.dy)*o.dataSize/l.value;n("change:offset",B),y.x=m.x,y.y=m.y}),(m,y)=>(r.openBlock(),r.createElementBlock("div",{class:"t-scroll",style:r.normalizeStyle({height:`${m.windowSize}px`})},[r.createElementVNode("div",null,[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 Vv(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:o,scrollLeft:s}=e,l=[...e.columns],d=su();n.value.controlColumn&&l.unshift({id:d,label:"#",width:60,frozen:!0});let u=0;const p=l.map(m=>{const y={...m,offset:u};return u+=m.width+mo,y}),f=p.filter(m=>m.frozen);return Z_(p,m=>m.frozen?!1:s<m.offset+m.width&&m.offset<o+s).concat(f).map(m=>({...m,style:{left:m.frozen?`${m.offset}px`:`${m.offset-e.scrollLeft}px`,width:`${m.width}px`},control:m.id===d}))})}function Pv(t,e){const n=r.computed(()=>e.value.reduce((o,s)=>(o[s.id]=s.justify?"justify-"+s.justify:"",o),{}));return r.computed(()=>t.rows.map(o=>{const s=n.value,{primaryKey:l,offset:d,dataRow:u,height:p}=o,f=e.value.map(m=>({id:m.id,column:m,row:o,value:u[m.id],class:s[m.id],editable:m.editable,width:m.width,style:m.style,control:m.control}));return iu({style:{top:`${d-t.scrollTop}px`,height:`${o.height}px`},primaryKey:l,offset:d,height:p,cells:f,selected:t.selectedRows.has(l)})}))}const Dv=async(t,e)=>{const{scrollTop:n,bodyHeight:o}=t;return await E_(0),A_({rows:e.getRows(n,o),dataWindow:t})};function Fv(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=pi(m.columns),e.currentWindow=void 0,m.dataSource.getHeight().then(y=>{e.dataHeight=y,f.updateBodyHeight()}).catch(y=>e.error=y)},{immediate:!0});const n=r.computed(()=>t.settings),o=r.computed(()=>e.columns.reduce((m,y)=>m+y.width+mo,0)),s=r.computed(()=>ou(f.data.dataHeight-f.data.bodyHeight,m=>m>0?m:0)),l=r.computed(()=>ou(o.value-f.data.bodyWidth,m=>m>0?m:0)),d=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),u=Vv({data:e,settings:n}),p=Pv(e,u),f={data:e,settings:n,tableColumns:u,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((B,T)=>B+T.width+mo,0),y=e.bodyWidth+e.scrollLeft;if(m<y){const B=e.columns[e.columns.length-1];B.width=B.width+(y-m)}},updateOffsets(m){this.updateScrollTop(e.scrollTop+m.deltaY),this.updateScrollLeft(e.scrollLeft+m.deltaX)},getSelectedRows(){return e.rows.filter(m=>e.selectedRows.has(m.primaryKey))},getSelectedColumns(){return e.columns.filter(m=>e.selectedColumns.has(m.id))},selectRow(m){e.selectedRows.add(m)},unselectRow(m){e.selectedRows.delete(m)},selectColumn(m){e.selectedColumns.add(m)},unselectColumn(m){e.selectedColumns.delete(m)},updateScrollTop(m){e.scrollTop=fs(m,0,s.value)},updateScrollLeft(m){e.scrollLeft=fs(m,0,l.value)},updateBodyHeight(){const{height:m}=t.settings,{dataHeight:y}=e,B=m>y?y:m;e.bodyHeight=B},updateDimensions(m){this.updateBodyHeight(),f.data.bodyWidth=m.width,f.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(d,(m,y)=>{const B=m.current;(!B||m.scrollTop<B.scrollTop||m.scrollTop+m.bodyHeight>B.bodyHeight+B.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-uu,bodyHeight:m.bodyHeight+uu*2},Dv(pi(e.currentWindow),n.value.dataSource).then(({rows:T,dataWindow:N})=>{ui(e.currentWindow,N)&&(e.rows=T)}))},{deep:!0,immediate:!0}),r.provide(du,f),f}const Rv={class:"command-menu__container"},Mv={key:0,class:"table-body__no-data"},Iv={class:"carets"},il=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,o=t,s=Fv(o),l=r.computed(()=>s.data.rows.length===0),d=r.computed(()=>({height:l.value?"212px":s.data.bodyHeight+"px"}));r.watch(s.data,M=>n("update:data",M),{deep:!0}),r.watch(o,()=>m);const u=r.ref(),p=r.ref(),f=r.ref(),m=()=>{Zr(f.value,M=>{s.updateDimensions(M.getBoundingClientRect())})},y=s.tableColumns,B=s.tableRows,{mouseDown:T}=wv(s,u);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(o.settings),r.nextTick(m)}),rt(window,"resize",()=>r.nextTick(m));const N=M=>{M.preventDefault(),s.updateOffsets(M)};return(M,G)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:u,class:"data-table",onMousedown:G[2]||(G[2]=(...C)=>r.unref(T)&&r.unref(T)(...C))},[r.createElementVNode("div",Rv,[r.createVNode(Sv),G[3]||(G[3]=r.createTextVNode()),r.createVNode(Av)]),G[7]||(G[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(lv,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,F)=>(r.openBlock(),r.createBlock(pv,{key:F,col:C,style:r.normalizeStyle(C.style),"onChange:sort":G[0]||(G[0]=L=>M.$emit("change:sort",L))},null,8,["col","style"]))),128))]),_:1})],512),G[8]||(G[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:f,class:"table-body",style:r.normalizeStyle(d.value),onWheel:N},[l.value?(r.openBlock(),r.createElementBlock("div",Mv,[r.createElementVNode("div",null,[r.createVNode(sv),G[4]||(G[4]=r.createTextVNode()),G[5]||(G[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),G[6]||(G[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(B),(C,F)=>(r.openBlock(),r.createBlock(hv,{key:F,row:C},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C.cells,L=>(r.openBlock(),r.createBlock(nv,{key:L.column.id+":"+F,cell:L,style:r.normalizeStyle(L.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),G[9]||(G[9]=r.createTextVNode()),r.createElementVNode("div",Iv,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,F)=>(r.openBlock(),r.createBlock(fv,{key:F,column:C,style:r.normalizeStyle(C.style),"onChange:sort":G[1]||(G[1]=L=>M.$emit("change:sort",L))},null,8,["column","style"]))),128))]),G[10]||(G[10]=r.createTextVNode()),r.createVNode(Nv,{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))}}),fu=new WeakMap;class Ov{constructor(e,n,o){k_(this,"dataHeight"),this.datum=e,this.resolveHeight=n,this.resolvePrimaryKey=o;const s=e.reduce((d,u,p)=>(d.indices.set(p,d.total),d.total+=this.resolveHeight(u,p)+mo,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:ru(s.indices.get(u)),height:this.resolveHeight(d,u)}));fu.set(this,l)}get rows(){return fu.get(this)}async getHeight(){return this.dataHeight}async getRows(e,n){return dv(this.rows,o=>{const s=o.offset;return e<s+o.height&&s<n+e})}}class Lv{constructor(e,n,o){this.api=e,this.rowHeight=n,this.resolvePrimaryKey=o}get height(){return this.rowHeight+mo}async getHeight(){return await this.api.count()*this.height}async getRows(e,n){const o=fs(Math.floor(e/this.height),0,Number.POSITIVE_INFINITY),s=Math.ceil(n+40/this.height);return(await this.api.query({offset:o,limit:s})).map((l,d)=>({dataRow:l,index:o+d,primaryKey:this.resolvePrimaryKey(l,o+d),offset:(o+d)*(this.rowHeight+mo),height:this.rowHeight}))}}function Gv(t){return Object.freeze(t)}function zv(t){return r.h(il,{settings:Object.freeze(t)})}function sl(t,e){const n=new Ov(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function Zv(t,e){return r.computed(()=>{const n=r.unref(t);return sl(n,r.unref(e))})}function $v(t,e){const n=r.computed(()=>{const s=r.unref(t);return sl(s,r.unref(e))}),o=r.reactive({settings:n});return r.computed(()=>r.h(il,o))}const Uv=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:Lv,Component:il,factory:zv,rawDataSettings:sl,settings:Gv,useRawData:Zv,useRawDataComponent:$v},Symbol.toStringTag,{value:"Module"}));function*Wv(t,e){for(const n of t)yield e(n)}function Hv(t){const e=[];for(const n of t)e.push(n);return e}function mu(t){return t()}function al(t,e){if(t==null)throw Error(e);return t}function ll(t){let e=!1;return function(...n){e||(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function gu(t){return new Promise(e=>setTimeout(e,t))}function yu(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function _u(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function jv(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(_u(65,91));return e}function vu(t){return function(e){return 1-t(1-e)}}function qv(t){return function(e){return e<.5?t(2*e)/2:(2-t(2*(1-e)))/2}}function Cu(t){const{duration:e,draw:n,timing:o}=t,s=performance.now();let l=!1;return requestAnimationFrame(function d(u){let p=(u-s)/e;(p>1||l)&&(p=1);const f=o(p);n(f),p<1&&requestAnimationFrame(d)}),function(){l=!0}}function Kv(t){const{getFraction:e,draw:n,timing:o}=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=o(p);n(f),p<1&&requestAnimationFrame(d)}),function(){l=!0}}function wu(t,e){let n=-1;return(...o)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...o),e)}}function bu(t,e,n=!0){let o=0,s;return function(...l){s=()=>{t.apply(this,l),o=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>o&&s()}}function Yv(t){return t.map(e=>({text:String(e),value:e}))}function dr(t){return t.map(e=>({label:"label"in e?e.label:e.text,value:e.value,description:e.description}))}const cl=new Map;function Jv(t){return cl.has(t)||cl.set(t,r.ref(localStorage.getItem(t))),al(cl.get(t),"...")}function Xv(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function xu(t){const e=Jv(t);return r.watch(e,n=>Xv(t,n)),e}const dl=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{Hv(Wv(dl.values(),e=>e(t.matches?"dark":"light")))});const Qv=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",ku=r.ref(Qv),ul=xu("theme");function Su(t){const e=r.computed(()=>ul.value?ul.value:ku.value),n=s=>{ku.value=s,t&&t(s)};function o(){ul.value=e.value==="light"?"dark":(e.value,"light")}return r.watch(e,s=>{t&&t(r.unref(s))}),r.onMounted(()=>{dl.add(n)}),r.onUnmounted(()=>{dl.delete(n)}),[e,o]}const eC=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=Su();return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-theme-switcher",r.unref(e)]),onClick:s[0]||(s[0]=(...l)=>r.unref(n)&&r.unref(n)(...l))},s[1]||(s[1]=[r.createElementVNode("div",null,null,-1)]),2))}}),tC={key:0,class:"pl-block-page__title"},nC={class:"pl-block-page__title__append"},rC={key:1},oC={class:"pl-block-page__body"},iC={name:"PlBlockPage"},sC=r.defineComponent({...iC,props:{noBodyGutters:{type:Boolean}},setup(t){const e=r.useSlots();return(n,o)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-layout-component pl-block-page",{noBodyGutters:n.noBodyGutters}])},[r.unref(e).title?(r.openBlock(),r.createElementBlock("div",tC,[r.createElementVNode("h1",null,[r.renderSlot(n.$slots,"title")]),o[0]||(o[0]=r.createTextVNode()),r.createElementVNode("div",nC,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",rC)),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",oC,[r.renderSlot(n.$slots,"default")])],2))}}),aC={name:"PlContainer"},lC=r.defineComponent({...aC,props:{width:{}},setup(t){const e=t,n=r.computed(()=>({width:e.width}));return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-container pl-layout-component",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),cC={name:"PlRow"},dC=r.defineComponent({...cC,props:{wrap:{type:Boolean},alignCenter:{type:Boolean},noGap:{type:Boolean}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-layout-component pl-row",{wrap:e.wrap,"align-center":e.alignCenter}])},[r.renderSlot(e.$slots,"default")],2))}}),uC={class:"pl-layout-component",style:{"flex-grow":"1"}},pC={name:"PlSpacer"},Eu=r.defineComponent({...pC,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",uC))}}),hC={name:"PlGrid"},fC=r.defineComponent({...hC,props:{columns:{}},setup(t){const e=t,n=r.computed(()=>({gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`}));return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-layout-component pl-grid",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),mC={key:0,class:"pl-alert__icon"},gC={class:"pl-alert__main"},yC={key:0},_C={class:"pl-alert__main__text"},vC={name:"PlAlert"},CC=r.defineComponent({...vC,props:{modelValue:{type:Boolean,default:!0},type:{default:void 0},label:{default:void 0},icon:{type:Boolean,default:void 0},closeable:{type:Boolean,default:void 0},monospace:{type:Boolean,default:void 0},whiteSpacePre:{type:Boolean,default:void 0},maxHeight:{default:void 0}},emits:["update:modelValue"],setup(t){const e={success:"success",warn:"warning",info:"edit",error:"error"};return(n,o)=>n.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-alert",[{monospace:n.monospace,whiteSpacePre:n.whiteSpacePre},n.type?`pl-alert__${n.type}`:""]]),style:r.normalizeStyle({maxHeight:n.maxHeight})},[n.icon&&n.type?(r.openBlock(),r.createElementBlock("div",mC,[r.createElementVNode("div",{class:r.normalizeClass(`icon-24 icon-${e[n.type]}`)},null,2)])):r.createCommentVNode("",!0),o[2]||(o[2]=r.createTextVNode()),r.createElementVNode("div",gC,[n.label?(r.openBlock(),r.createElementBlock("label",yC,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",_C,[r.renderSlot(n.$slots,"default")])]),o[3]||(o[3]=r.createTextVNode()),n.closeable?(r.openBlock(),r.createElementBlock("div",{key:1,class:"pl-alert__close-btn","aria-label":"Close alert",role:"button",onClick:o[0]||(o[0]=s=>n.$emit("update:modelValue",!1))})):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),wC=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
46
46
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.5 4.5H4.5L4.5 19.5H19.5V4.5ZM4.5 3C3.67157 3 3 3.67157 3 4.5V19.5C3 20.3284 3.67157 21 4.5 21H19.5C20.3284 21 21 20.3284 21 19.5V4.5C21 3.67157 20.3284 3 19.5 3H4.5Z" fill="#110529"/>
|
|
47
47
|
</svg>
|
|
48
|
-
`,
|
|
48
|
+
`,bC=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
49
49
|
<rect x="3" y="3" width="18" height="18" rx="2" fill="#110529"/>
|
|
50
50
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.5431 8.51724L10.3333 16.0875L6.45691 12.0172L7.54312 10.9828L10.3333 13.9125L16.4569 7.48276L17.5431 8.51724Z" fill="white"/>
|
|
51
51
|
</svg>
|
|
52
|
-
`,bC=["innerHTML"],xC={class:"dropdown-list-item__title-container"},kC={class:"dropdown-list-item__title text-s"},SC={key:0,class:"dropdown-list-item__description text-description"},EC={key:1,class:"dropdown-list-item__icon flex-self-start"},fo=r.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>{const l=[];return e.size==="small"&&l.push("dropdown-list-item__small"),e.isSelected&&l.push("dropdown-list-item__selected"),e.isHovered&&l.push("hovered-item"),l.join(" ")}),o=r.computed(()=>{const l=["dropdown-list-item__checkbox","flex-self-start"];return e.isSelected&&l.push("checked"),l.join(" ")}),s=r.computed(()=>e.isSelected?wC:CC);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(o.value),innerHTML:s.value},null,10,bC)):r.createCommentVNode("",!0),d[1]||(d[1]=r.createTextVNode()),r.createElementVNode("div",xC,[r.createElementVNode("div",kC,r.toDisplayString(l.option.label),1),d[0]||(d[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",SC,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),d[2]||(d[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",EC)):r.createCommentVNode("",!0)],2))}});function mo(t,e){const n=al(()=>{if(t.value){const{scrollTop:o,scrollLeft:s,scrollHeight:l,scrollWidth:d,clientHeight:u,clientWidth:p}=document.documentElement,f=t.value.getBoundingClientRect();e({scrollTop:o,scrollLeft:s,scrollHeight:l,scrollWidth:d,clientHeight:u,clientWidth:p,offsetY:o+f.y,offsetX:s+f.x,top:f.top,right:f.right,bottom:f.bottom,left:f.left,width:f.width,height:f.height,x:f.x,y:f.y})}});r.onMounted(n),rt(window,"scroll",n,{capture:!0,passive:!0}),rt(window,"resize",n,{passive:!0}),rt(window,"adjust",n,!0)}const TC=r.defineComponent({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--mask-size: 24px":""),o=r.computed(()=>`mask-16 mask-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,s.$style.icon])},null,6))}}),BC="_icon_1ugxm_2",AC={icon:BC},NC={$style:AC},ur=Kt(TC,[["__cssModules",NC]]),VC=["onKeyup"],PC=r.defineComponent({__name:"PlBtnSplit",props:r.mergeModels({options:{},disabled:{type:Boolean},loading:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:r.mergeModels(["click"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const o=t,s=n,l=r.useModel(t,"modelValue"),d=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(),m=r.reactive({open:!1,optionsHeight:0,activeIndex:-1});e({data:m});const y=r.reactive({top:"0px",left:"0px",width:"0px"});r.watch(u,L=>{if(L){const J=L.getBoundingClientRect();m.optionsHeight=J.height,window.dispatchEvent(new CustomEvent("adjust"))}},{immediate:!0});const E=r.computed(()=>m.open?"mask-24 mask-chevron-up":"mask-24 mask-chevron-down"),S=r.computed(()=>(o.options??[]).findIndex(L=>ci(L.value,l.value))),A=r.computed(()=>dr(o.options??[]).map((L,J)=>({...L,index:J,isSelected:J===S.value,isActive:J===m.activeIndex}))),O=r.computed(()=>o.loading||o.options===void 0),z=r.computed(()=>{var L;return((L=A.value.find(J=>ci(J.value,l.value)))==null?void 0:L.label)??(o.options===void 0?"...":"")});mo(d,L=>{const J=L.top+L.height+3;J+m.optionsHeight>L.clientHeight?y.top=L.top-m.optionsHeight-3+"px":y.top=J+"px",y.left=L.left+"px",y.width=L.width+"px",console.log(L.top,y)});const C=L=>{var J;l.value=L,m.open=!1,(J=d==null?void 0:d.value)==null||J.focus()};function R(){s("click")}const G=L=>{var J,H;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(L.code))L.preventDefault();else return;if(L.target===f.value&&L.code==="Enter"){R();return}const{open:F,activeIndex:N}=m;if(!F&&L.target===p.value){L.code==="Enter"&&(m.open=!0);return}L.code==="Escape"&&(m.open=!1,(J=d.value)==null||J.focus());const M=r.unref(A),{length:j}=M;if(!j)return;L.code==="Enter"&&C((H=M.find(P=>P.index===N))==null?void 0:H.value);const K=M.findIndex(P=>P.index===N)??-1,B=L.code==="ArrowDown"?1:L.code==="ArrowUp"?-1:0,x=Math.abs(K+B+j)%j;m.activeIndex=A.value[x].index??-1},$=L=>{var J,H;const F=L.relatedTarget;!((J=d.value)!=null&&J.contains(F))&&!((H=u.value)!=null&&H.contains(F))&&(m.open=!1)};return(L,J)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:d,class:r.normalizeClass([{disabled:L.disabled||O.value,loading:O.value},"pl-btn-split d-flex"]),onFocusout:$,onKeydown:G},[r.createElementVNode("div",{ref_key:"buttonAction",ref:f,class:"pl-btn-split__title flex-grow-1 d-flex align-center text-s-btn",tabindex:"0",onClick:R,onKeyup:r.withKeys(r.withModifiers(R,["stop"]),["enter"])},r.toDisplayString(z.value),41,VC),J[1]||(J[1]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"menuActivator",ref:p,class:"pl-btn-split__icon-container d-flex align-center justify-center",tabindex:"0",onClick:J[0]||(J[0]=H=>m.open=!m.open)},[O.value?(r.openBlock(),r.createBlock(ur,{key:0,name:"loading"})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([E.value,"pl-btn-split__icon"])},null,2))],512),J[2]||(J[2]=r.createTextVNode()),m.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:u,class:"pl-dropdown__options",style:r.normalizeStyle(y),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(A.value,(H,F)=>(r.openBlock(),r.createBlock(fo,{key:F,option:H,"is-selected":H.isSelected,"is-hovered":H.isActive,size:"medium",onClick:r.withModifiers(N=>C(H.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128))],4)])):r.createCommentVNode("",!0)],34))}});function Eu(t){function e(n){const o=n.currentTarget,s=document.createElement("span"),l=Math.max(o.clientWidth,o.clientHeight),d=l/2;s.style.width=s.style.height=`${l}px`,s.style.left=`${n.clientX-o.offsetLeft-d}px`,s.style.top=`${n.clientY-o.offsetTop-d}px`,s.classList.add("ripple");const u=o.getElementsByClassName("ripple")[0];u&&u.remove(),o.appendChild(s)}r.onMounted(()=>{var n;(n=t.value)==null||n.addEventListener("click",e)})}const DC={key:0},FC={inheritAttrs:!1},fs=r.defineComponent({...FC,__name:"BtnBase",props:{loading:{type:Boolean},small:{type:Boolean},large:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t,n=r.ref(),o=r.computed(()=>e.small||e.size==="small"),s=r.computed(()=>e.large||e.size==="large");return Eu(n),(l,d)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btn",ref:n,tabindex:"0",class:{loading:l.loading,small:o.value,large:s.value,round:l.round,reverse:l.reverse,justifyCenter:l.justifyCenter,[l.$attrs.class+""]:!0}},{...l.$attrs,disabled:!!l.$attrs.disabled||l.loading}),[l.round?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",DC,[r.renderSlot(l.$slots,"default")])),d[0]||(d[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(ur),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(ur),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),RC={name:"PlBtnPrimary"},ul=r.defineComponent({...RC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(fs,r.mergeProps({class:"pl-btn-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),MC={name:"PlBtnAccent"},IC=r.defineComponent({...MC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(fs,r.mergeProps({class:"pl-btn-accent"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),OC={name:"PlBtnDanger"},LC=r.defineComponent({...OC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(fs,r.mergeProps({class:"pl-btn-danger"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),GC={name:"PlBtnSecondary"},pl=r.defineComponent({...GC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(fs,r.mergeProps(e,{class:"pl-btn-secondary"}),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),zC={key:0},ZC={name:"PlBtnGhost"},hl=r.defineComponent({...ZC,props:{loading:{type:Boolean},size:{default:void 0},round:{type:Boolean},icon:{default:void 0},reverse:{type:Boolean},justifyCenter:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.size==="small"),o=r.computed(()=>e.size==="large"),s=r.ref(),l=r.useSlots();return Eu(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:o.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",zC,[r.renderSlot(d.$slots,"default")])):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),d.loading?(r.openBlock(),r.createBlock(r.unref(ur),{key:1,name:"loading",size:d.size},null,8,["size"])):d.icon?(r.openBlock(),r.createBlock(r.unref(ur),{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))}}),$C=r.defineComponent({__name:"PlBtnLink",props:{loading:{type:Boolean},size:{},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean},disabled:{type:Boolean}},setup(t){const e=t,n=r.ref(!1);return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-link",{disabled:o.disabled,loading:o.loading,hover:n.value}]),onMouseover:s[0]||(s[0]=l=>n.value=!0),onMouseleave:s[1]||(s[1]=l=>n.value=!1)},[r.createVNode(pl,r.mergeProps({round:"",hover:n.value},e),null,16,["hover"]),s[2]||(s[2]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],34))}});function UC(t,e){const n=r.ref();return mo(t,o=>{n.value=o}),r.computed(()=>{const o=r.unref(n),s=r.unref(e),l=s.position??"top",d=s.gap??8;if(!o)return"";const u=o.offsetY+Math.floor(o.height/2),p=o.offsetX+Math.floor(o.width/2);return l==="top-left"?`left: ${o.offsetX}px; top: ${o.offsetY-d}px;`:l==="top"?`left: ${p}px; top: ${o.offsetY-d}px;`:l==="right"?`left: ${o.offsetX+o.width+d}px; top: ${u}px;`:l==="left"?`right: ${o.scrollWidth-o.x+d}px; top: ${u}px;`:""})}function ui(t,e){return e(t)}function lt(t,e){if(t!=null)return e(t)}function WC(t){return Array.isArray(t)?t:[t]}function HC(t,e,...n){n.forEach(o=>{t[o]=e[o]})}function ms(t,e){rt(document,"click",n=>{document.contains(n.target)&&(WC(t).map(o=>o.value).filter(o=>!!o).some(o=>o==null?void 0:o.contains(n.target))||e())})}const jC={},qC={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function KC(t,e){return r.openBlock(),r.createElementBlock("svg",qC,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 YC=Kt(jC,[["render",KC]]),fl=new Map,JC={name:"PlTooltip"},St=r.defineComponent({...JC,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"}},emits:["tooltip:close"],setup(t,{emit:e}){const n=e,o=Symbol(),s=t,l=r.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});fl.set(o,()=>f()),r.watch(()=>l.open,O=>{requestAnimationFrame(()=>{l.tooltipOpen=O})});let d=()=>{};const u=wu(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(let[O,z]of fl.entries())O!==o&&z()},f=()=>{l.open=!1,n("tooltip:close")},m=async()=>{s.hide||(u(),l.over=!0,d(),await mu(100),l.over&&p())},y=()=>{l.over=!1,d=gu(()=>{l.over||f()},s.closeDelay)};r.watch(()=>s.hide,O=>{O&&f()});const E=r.ref(),S=r.ref(),A=UC(E,r.toRef(s));return ms([E,S],()=>f()),r.onUnmounted(()=>{fl.delete(o)}),(O,z)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(O.element),r.mergeProps(O.$attrs,{ref_key:"rootRef",ref:E,onClick:m,onMouseover:m,onMouseleave:y}),{default:r.withCtx(()=>[r.renderSlot(O.$slots,"default"),z[1]||(z[1]=r.createTextVNode()),O.$slots.tooltip&&l.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createVNode(r.Transition,{name:"tooltip-transition"},{default:r.withCtx(()=>[l.tooltipOpen?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-tooltip__container",style:r.normalizeStyle(r.unref(A))},[r.createElementVNode("div",{ref_key:"tooltip",ref:S,class:r.normalizeClass(["pl-tooltip",O.position]),onMouseover:m,onMouseleave:y},[r.createElementVNode("div",null,[r.renderSlot(O.$slots,"tooltip")]),z[0]||(z[0]=r.createTextVNode()),r.createVNode(YC)],34)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),XC={},QC={class:"inner-border"};function e0(t,e,n,o,s,l){return r.openBlock(),r.createElementBlock("div",QC,[r.renderSlot(t.$slots,"default")])}const t0=Kt(XC,[["render",e0]]),n0={key:0},r0=["tabindex","onKeydown","onClick"],o0={key:1,class:"pl-btn-group__helper"},i0={key:2,class:"pl-btn-group__error"},s0={name:"PlBtnGroup"},a0=r.defineComponent({...s0,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},compact:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,s=u=>o("update:modelValue",u),l=t,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(["pl-btn-group",{disabled:u.disabled,compact:u.compact}])},[u.label?(r.openBlock(),r.createElementBlock("label",n0,[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(St),{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(t0,{class:"pl-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(["pl-btn-group__option text-s",{active:u.modelValue===f.value}]),tabindex:u.modelValue===f.value||u.disabled?void 0:0,onKeydown:r.withKeys(y=>s(f.value),["enter"]),onClick:y=>s(f.value)},r.toDisplayString(f.label),43,r0))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),u.helper?(r.openBlock(),r.createElementBlock("div",o0,r.toDisplayString(u.helper),1)):u.error?(r.openBlock(),r.createElementBlock("div",i0,r.toDisplayString(u.error),1)):r.createCommentVNode("",!0)],2))}}),l0={inheritAttrs:!1},c0={class:"double-contour"};function d0(t,e,n,o,s,l){return r.openBlock(),r.createElementBlock("div",c0,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const pr=Kt(l0,[["render",d0]]);function Tu(t){r.onMounted(t),r.onUpdated(t)}const ml=new WeakMap,gl=new ResizeObserver(t=>{for(const e of t)lt(ml.get(e.target),n=>n(e))});function Bu(t,e){ml.set(t,e),gl.unobserve(t),gl.observe(t)}function Au(t){gl.unobserve(t),ml.delete(t)}const u0=8,Nu=4;function zn(t,e="label"){const n=new Set;Tu(()=>{lt(t==null?void 0:t.value,o=>{const s=o.querySelector(e);s&&(n.add(s),Bu(s,()=>{const l=fu(()=>s.getBoundingClientRect().width+ui(u0,d=>Number.isNaN(d)?Nu:d+Nu));o.style.getPropertyValue("--label-offset-right-x")!==`${l}px`&&o.style.setProperty("--label-offset-right-x",`${l}px`)}))})}),r.onBeforeUnmount(()=>{Array.from(n.values()).map(o=>Au(o))})}function p0(t,e){const n=[];return e&&e.length>0&&e.forEach(o=>{const s=o(t);typeof s=="string"&&n.push(s)}),{isValid:n.length===0,errors:n}}function Vu(t,e){return r.computed(()=>p0(t.value,e))}const h0=r.defineComponent({__name:"PlIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--icon-size: 24px":""),o=r.computed(()=>`icon-16 icon-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,s.$style.icon])},null,6))}}),f0="_icon_1ugxm_2",m0={icon:f0},g0={$style:m0},gs=Kt(h0,[["__cssModules",g0]]),y0=r.defineComponent({__name:"PlIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`icon-24 icon-${e.name}`);return(o,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),_0="_icon_1ugxm_2",v0={icon:_0},C0={$style:v0},Pu=Kt(y0,[["__cssModules",C0]]),w0={class:"pl-text-field__envelope"},b0={key:0,ref:"label"},x0={key:0,class:"required-icon"},k0={key:1,class:"pl-text-field__prefix"},S0=["disabled","placeholder","type"],E0={class:"pl-text-field__append"},T0={key:0,class:"pl-text-field__error"},B0={key:1,class:"pl-text-field__helper"},A0={name:"PlTextField"},zr=r.defineComponent({...A0,props:r.mergeModels({label:{},clearable:{type:[Boolean,Function]},parse:{type:Function},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},dashed:{type:Boolean},prefix:{},rules:{},type:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useSlots(),n=r.useModel(t,"modelValue"),o=t,s=r.ref(void 0),l=r.ref(),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($){if(u.cached=void 0,o.parse)try{n.value=o.parse($)}catch(L){u.cached={error:L instanceof Error?L.message:String(L),value:$}}else n.value=$}}),f=r.computed(()=>o.type&&o.type==="password"?d.value?"text":o.type:"text"),m=r.computed(()=>d.value?"view-show":"view-hide"),y=()=>{o.clearable&&(u.cached=void 0,n.value=o.clearable===!0?"":o.clearable())},E=Vu(p,o.rules||[]),S=r.computed(()=>o.clearable?o.clearable===!0?n.value==="":n.value===o.clearable():n.value===""),A=r.computed(()=>!S.value),O=r.computed(()=>{const $=[];return o.error&&$.push(o.error),u.cached&&$.push(u.cached.error),E.value.isValid||$.push(...E.value.errors),$}),z=r.computed(()=>O.value.length>0),C=r.computed(()=>o.clearable&&A.value&&o.type!=="password"),R=()=>d.value=!d.value,G=()=>{u.cached=void 0};return zn(s),($,L)=>(r.openBlock(),r.createElementBlock("div",w0,[r.createElementVNode("div",{ref_key:"rootRef",ref:s,class:r.normalizeClass(["pl-text-field",{error:z.value,disabled:$.disabled,dashed:$.dashed,nonEmpty:A.value}])},[$.label?(r.openBlock(),r.createElementBlock("label",b0,[$.required?(r.openBlock(),r.createElementBlock("i",x0)):r.createCommentVNode("",!0),L[1]||(L[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString($.label),1),L[2]||(L[2]=r.createTextVNode()),r.unref(e).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot($.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),L[5]||(L[5]=r.createTextVNode()),$.prefix?(r.openBlock(),r.createElementBlock("div",k0,r.toDisplayString($.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]=J=>p.value=J),disabled:$.disabled,placeholder:$.placeholder||"...",type:f.value,spellcheck:"false",onFocusout:G},null,40,S0),[[r.vModelDynamic,p.value]]),L[7]||(L[7]=r.createTextVNode()),r.createElementVNode("div",E0,[C.value?(r.openBlock(),r.createBlock(r.unref(gs),{key:0,class:"pl-text-field__clearable",name:"delete-clear",onClick:y})):r.createCommentVNode("",!0),L[3]||(L[3]=r.createTextVNode()),$.type==="password"?(r.openBlock(),r.createBlock(r.unref(Pu),{key:1,name:m.value,style:{cursor:"pointer"},onClick:R},null,8,["name"])):r.createCommentVNode("",!0),L[4]||(L[4]=r.createTextVNode()),r.renderSlot($.$slots,"append")]),L[8]||(L[8]=r.createTextVNode()),r.createVNode(pr,{class:"pl-text-field__contour"})],2),L[9]||(L[9]=r.createTextVNode()),z.value?(r.openBlock(),r.createElementBlock("div",T0,r.toDisplayString(O.value.join(" ")),1)):$.helper?(r.openBlock(),r.createElementBlock("div",B0,r.toDisplayString($.helper),1)):r.createCommentVNode("",!0)]))}}),N0={class:"ui-text-area__envelope"},V0={key:0,ref:"label"},P0={key:0,class:"required-icon"},D0=["readonly","rows","disabled","placeholder"],F0={class:"ui-text-area__append"},R0={key:0,class:"ui-text-area__error"},M0={key:1,class:"ui-text-area__helper"},I0={name:"PlTextArea"},O0=r.defineComponent({...I0,props:{modelValue:{},label:{},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},dashed:{type:Boolean},rows:{},autogrow:{type:Boolean},rules:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,s=t,l=r.ref(),d=r.ref(),u=r.computed({get(){return s.modelValue??""},set(S){o("update:modelValue",S)}}),p=r.computed(()=>!!s.modelValue),f=Vu(u,s.rules||[]);zn(l);const m=r.computed(()=>{const S=[];return s.error&&S.push(s.error),S.push(...f.value.errors),S}),y=r.computed(()=>m.value.length>0),E=()=>{if(!s.autogrow)return;const S=d.value;S&&(S.style.height="auto",S.style.height=`${S.scrollHeight}px`)};return r.onMounted(()=>{E()}),(S,A)=>(r.openBlock(),r.createElementBlock("div",N0,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:y.value,disabled:S.disabled,dashed:S.dashed,nonEmpty:p.value}])},[S.label?(r.openBlock(),r.createElementBlock("label",V0,[S.required?(r.openBlock(),r.createElementBlock("i",P0)):r.createCommentVNode("",!0),A[1]||(A[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(S.label),1),A[2]||(A[2]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(S.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),A[3]||(A[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:d,"onUpdate:modelValue":A[0]||(A[0]=O=>u.value=O),readonly:S.readonly,rows:S.rows,disabled:S.disabled,placeholder:S.placeholder??"...",spellcheck:"false",onInput:E},null,40,D0),[[r.vModelText,u.value]]),A[4]||(A[4]=r.createTextVNode()),r.createElementVNode("div",F0,[r.renderSlot(S.$slots,"append")]),A[5]||(A[5]=r.createTextVNode()),r.createVNode(pr,{class:"ui-text-area__contour"})],2),A[6]||(A[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",R0,r.toDisplayString(m.value.join(" ")),1)):S.helper?(r.openBlock(),r.createElementBlock("div",M0,r.toDisplayString(S.helper),1)):r.createCommentVNode("",!0)]))}});function Du(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<o+n&&s>n}function Fu(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<o+n?"ceil":s>n?"floor":"visible"}function pi(t,e,n={}){const o=t.scrollTop,s=t.getBoundingClientRect().height,l=e.getBoundingClientRect().height,d=e.offsetTop,u=Fu(t,e);if(u==="visible")return;const p=f=>{const m=u==="floor"?d-(s-l):d;t.scrollTop=o+f*(m-o)};Du(t,e)||vu({duration:n.duration||100,timing:_u(f=>f),draw:p})}function yl(t,e,n,o){return t.addEventListener(e,n,o),function(){t.removeEventListener(e,n)}}function L0(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 Ru(t){return t!==null&&typeof t=="object"}function Pt(t,e){return Ru(t)&&Ru(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Pt(t[n],e[n])):t===e}function _l(t,e){return t.some(n=>Pt(n,e))}const vl=r.defineComponent({__name:"LongText",setup(t){r.useCssVars(m=>({"8d68520c":d.value}));const e=r.ref(!1),n=r.ref(),o=r.ref(!1),s=r.computed(()=>o.value&&e.value?"ui-lt-animate":""),l=Cu(m=>o.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=sl(n.value,"span cannot be empty");e.value=m.clientWidth<m.scrollWidth}function p(){u(),l(!0)}function f(){l(!1)}return(m,y)=>(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))}}),G0=r.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`mask-24 mask-${e.name}`);return(o,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),z0="_icon_1ugxm_2",Z0={icon:z0},$0={$style:Z0},Zn=Kt(G0,[["__cssModules",$0]]),U0={class:"pl-dropdown__envelope"},W0=["tabindex"],H0={class:"pl-dropdown__container"},j0={class:"pl-dropdown__field"},q0=["disabled","placeholder"],K0={class:"pl-dropdown__controls"},Y0={key:0},J0={key:0,class:"required-icon"},X0={key:0,class:"nothing-found"},Q0={key:0,class:"pl-dropdown__error"},ew={key:1,class:"pl-dropdown__helper"},tw={key:2,class:"pl-dropdown__helper"},nw={name:"PlDropdown"},hi=r.defineComponent({...nw,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,s=r.useSlots(),l=r.ref(),d=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),f=()=>ui(G.value.findIndex(x=>Pt(x.value,o.modelValue)),x=>x<0?0:x),m=()=>p.activeIndex=f(),y=r.computed(()=>o.options===void 0),E=r.computed(()=>y.value?!0:o.disabled),S=r.computed(()=>(o.options??[]).findIndex(x=>Pt(x.value,o.modelValue))),A=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&S.value===-1)return"The selected value is not one of the options"}}),O=r.computed(()=>dr(o.options??[]).map((x,P)=>({...x,index:P,isSelected:P===S.value,isActive:P===p.activeIndex}))),z=r.computed(()=>{const x=r.unref(O).find(P=>Pt(P.value,o.modelValue));return(x==null?void 0:x.label)||o.modelValue}),C=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(z.value):o.placeholder),R=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),G=r.computed(()=>{const x=O.value;return p.search?x.filter(P=>{const U=p.search.toLowerCase();return P.label.toLowerCase().includes(U)||P.description&&P.description.toLowerCase().includes(U)?!0:typeof P.value=="string"?P.value.toLowerCase().includes(U):P.value===p.search}):x}),$=r.computed(()=>E.value?void 0:"0"),L=x=>{var P;n("update:modelValue",x),p.search="",p.open=!1,(P=l==null?void 0:l.value)==null||P.focus()},J=()=>n("update:modelValue",void 0),H=()=>{var x;return(x=u.value)==null?void 0:x.focus()},F=()=>p.open=!p.open,N=()=>p.open=!0,M=x=>{var P,U;const re=x.relatedTarget;!((P=l.value)!=null&&P.contains(re))&&!((U=d.value)!=null&&U.contains(re))&&(p.search="",p.open=!1)},j=()=>{const x=d.value;x&<(x.querySelector(".hovered-item"),P=>{pi(x,P)})},K=x=>{var P,U;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(x.code))x.preventDefault();else return;const{open:re,activeIndex:se}=p;if(!re){x.code==="Enter"&&(p.open=!0);return}x.code==="Escape"&&(p.open=!1,(P=l.value)==null||P.focus());const Pe=r.unref(G),{length:He}=Pe;if(!He)return;x.code==="Enter"&&L((U=Pe.find(br=>br.index===se))==null?void 0:U.value);const ot=Pe.findIndex(br=>br.index===se)??-1,vn=x.code==="ArrowDown"?1:x.code==="ArrowUp"?-1:0,Rn=Math.abs(ot+vn+He)%He;p.activeIndex=G.value[Rn].index??-1};zn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,x=>{var P;return x?(P=u.value)==null?void 0:P.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&j()});const B=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(d,x=>{if(x){const P=x.getBoundingClientRect();p.optionsHeight=P.height,window.dispatchEvent(new CustomEvent("adjust"))}}),mo(l,x=>{const P=x.top+x.height+3;P+p.optionsHeight>x.clientHeight?B.top=x.top-p.optionsHeight-3+"px":B.top=P+"px",B.left=x.left+"px",B.width=x.width+"px"}),(x,P)=>(r.openBlock(),r.createElementBlock("div",U0,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:$.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:x.error,disabled:E.value}]),onKeydown:K,onFocusout:M},[r.createElementVNode("div",H0,[r.createElementVNode("div",j0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":P[0]||(P[0]=U=>p.search=U),type:"text",tabindex:"-1",disabled:E.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:N},null,40,q0),[[r.vModelText,p.search]]),P[4]||(P[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:H},[r.createVNode(vl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(z.value),1)]),_:1})])),P[5]||(P[5]=r.createTextVNode()),r.createElementVNode("div",K0,[y.value?(r.openBlock(),r.createBlock(r.unref(Zn),{key:0,name:"loading"})):r.createCommentVNode("",!0),P[1]||(P[1]=r.createTextVNode()),x.clearable&&R.value?(r.openBlock(),r.createBlock(r.unref(gs),{key:1,name:"delete-clear",onClick:r.withModifiers(J,["stop"])})):r.createCommentVNode("",!0),P[2]||(P[2]=r.createTextVNode()),r.renderSlot(x.$slots,"append"),P[3]||(P[3]=r.createTextVNode()),x.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${x.arrowIconLarge}`]]),onClick:r.withModifiers(F,["stop"])},null,2)):x.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${x.arrowIcon}`]]),onClick:r.withModifiers(F,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(F,["stop"])}))])]),P[9]||(P[9]=r.createTextVNode()),x.label?(r.openBlock(),r.createElementBlock("label",Y0,[x.required?(r.openBlock(),r.createElementBlock("i",J0)):r.createCommentVNode("",!0),P[6]||(P[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(x.label),1),P[7]||(P[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(x.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),P[10]||(P[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:d,class:"pl-dropdown__options",style:r.normalizeStyle(B),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(G.value,(U,re)=>(r.openBlock(),r.createBlock(fo,{key:re,option:U,"is-selected":U.isSelected,"is-hovered":U.isActive,size:x.optionSize,onClick:r.withModifiers(se=>L(U.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),P[8]||(P[8]=r.createTextVNode()),G.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",X0,"Nothing found"))],4)])):r.createCommentVNode("",!0),P[11]||(P[11]=r.createTextVNode()),r.createVNode(pr,{class:"pl-dropdown__contour"})])],42,W0),P[12]||(P[12]=r.createTextVNode()),A.value?(r.openBlock(),r.createElementBlock("div",Q0,r.toDisplayString(A.value),1)):y.value&&x.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",ew,r.toDisplayString(x.loadingOptionsHelper),1)):x.helper?(r.openBlock(),r.createElementBlock("div",tw,r.toDisplayString(x.helper),1)):r.createCommentVNode("",!0)]))}}),rw={name:"PlDropdownRef"},ow=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},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>{var s;return(s=e.options)==null?void 0:s.map(l=>({label:l.label,value:l.ref}))}),o=r.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(s,l)=>(r.openBlock(),r.createBlock(r.unref(hi),r.mergeProps(e,{options:n.value,"loading-options-helper":s.loadingOptionsHelper,"arrow-icon-large":o.value,"onUpdate:modelValue":l[0]||(l[0]=d=>s.$emit("update:modelValue",d))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function iw(t,e){return r.computed(()=>{const n=dr(t.value);return e.value?n.filter(o=>o.label.toLowerCase().includes(e.value.toLowerCase())):n})}const sw={class:"resizable-input"},aw=["placeholder","value","disabled"],lw=r.defineComponent({__name:"ResizableInput",props:{modelValue:{},placeholder:{},value:{},disabled:{type:Boolean},maxWidth:{},width:{}},emits:["input","update:modelValue"],setup(t,{emit:e}){const n=t,o=e,s=r.computed(()=>{var u;return n.placeholder?n.placeholder:(u=n.modelValue||n.value)==null?void 0:u.replace('"',"")}),l=r.computed(()=>{const u={};return n.width&&(u.width=n.width),n.maxWidth&&(u.maxWidth=n.maxWidth),u});function d(u){const p=u.target.value;o("update:modelValue",p)}return(u,p)=>(r.openBlock(),r.createElementBlock("div",sw,[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,aw)]))}}),cw={class:"dropdown-tab-item__title text-caps13"},dw=r.defineComponent({__name:"TabItem",props:{option:{},isSelected:{type:Boolean,default:!1},isHovered:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.option.label),o=r.computed(()=>{const s=[];return e.isSelected&&s.push("dropdown-tab-item__selected"),e.isHovered&&s.push("hovered-item"),s.join(" ")});return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([o.value,"dropdown-tab-item"])},[r.createElementVNode("div",cw,r.toDisplayString(n.value),1)],2))}}),uw={class:"pl-line-dropdown__prefix"},pw={class:"pl-line-dropdown__icon-wrapper"},hw={class:"pl-line-dropdown__icon"},fw={key:0,class:"pl-line-dropdown__no-item"},mw={key:0,class:"pl-line-dropdown__no-item"},Mu=r.defineComponent({__name:"PlDropdownLine",props:{modelValue:{},disabled:{type:Boolean},prefix:{default:""},options:{},placeholder:{default:"Select.."},mode:{default:"list"},tabsContainerStyles:{type:[Boolean,null,String,Object,Array],default:void 0},clearable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,s=r.reactive({isOpen:!1,activeOption:-1,optionsHeight:0}),l=r.ref(),d=r.ref(),u=r.computed(()=>{const M=[];return s.isOpen&&M.push("open"),o.disabled&&M.push("disabled"),M.join(" ")}),p=r.ref(""),f=iw(r.toRef(o,"options"),p),m=r.computed(()=>!!(o.clearable&&s.isOpen&&o.modelValue&&y.value)),y=r.computed(()=>{if(o.modelValue){const M=A();if(M!==-1){const j=dr(o.options)[M];return typeof j.label=="object"?j.label.title:j.label}}return""}),E=r.ref(y.value),S=r.computed(()=>s.isOpen&&p.value&&p.value.length>=y.value.length-1?p.value:y.value??"...");ms(l,()=>{o.mode==="list"&&(s.isOpen=!1)}),r.watch(()=>E.value,M=>{y.value!==M?p.value=M:p.value=""}),r.watch(()=>s.isOpen,M=>{var j;M&&l.value&&((j=l.value.querySelector("input"))==null||j.focus(),r.nextTick(()=>H()))}),r.watch(()=>o.modelValue,()=>O(),{immediate:!0});function A(){return o.options.findIndex(M=>Pt(M.value,o.modelValue))}function O(){s.activeOption=ui(f.value.findIndex(M=>Pt(M.value,o.modelValue)),M=>M<0?0:M),E.value=y.value}function z(){p.value=""}function C(){o.disabled?s.isOpen=!1:r.nextTick(()=>{s.isOpen=!s.isOpen})}function R(){o.mode==="list"&&(s.isOpen=!1)}function G(M){M&&(n("update:modelValue",M.value),R(),z())}function $(M){return Pt(M.value,o.modelValue)}const L=M=>{var j,K;const B=M.relatedTarget;!((j=l.value)!=null&&j.contains(B))&&!((K=d.value)!=null&&K.contains(B))&&(p.value="",s.isOpen=!1)};function J(M){const{activeOption:j}=s;if(!s.isOpen&&M.code==="Enter"){s.isOpen=!0;return}const{length:K}=f.value;if(!K)return;["ArrowDown","ArrowUp","Enter"].includes(M.code)&&M.preventDefault(),M.code==="Enter"&&G(f.value[j]);const B=M.code==="ArrowDown"?1:M.code==="ArrowUp"?-1:0;s.activeOption=Math.abs(j+B+K)%K,requestAnimationFrame(H)}function H(){const M=d.value;M&<(M.querySelector(".hovered-item"),j=>{o.mode==="list"?pi(M,j):j.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function F(){n("update:modelValue",void 0)}const N=r.reactive({top:"0px",left:"0px"});return r.watch(d,M=>{if(M){const j=M.getBoundingClientRect();s.optionsHeight=j.height,window.dispatchEvent(new CustomEvent("adjust"))}}),mo(l,M=>{const j=M.top+M.height+2;j+s.optionsHeight>M.clientHeight?N.top=M.top-s.optionsHeight-2+"px":N.top=j+"px",N.left=M.left+"px"}),(M,j)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([u.value,"pl-line-dropdown uc-pointer"]),onKeydown:J,onFocusout:L,onClick:C},[r.createElementVNode("div",uw,r.toDisplayString(o==null?void 0:o.prefix),1),j[6]||(j[6]=r.createTextVNode()),r.createVNode(lw,{modelValue:E.value,"onUpdate:modelValue":j[0]||(j[0]=K=>E.value=K),placeholder:S.value,disabled:o.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),j[7]||(j[7]=r.createTextVNode()),r.createElementVNode("div",pw,[r.withDirectives(r.createElementVNode("div",hw,null,512),[[r.vShow,!m.value]]),j[1]||(j[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:F},null,512),[[r.vShow,m.value]])]),j[8]||(j[8]=r.createTextVNode()),s.isOpen?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[o.mode==="list"?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"list",ref:d,style:r.normalizeStyle(N),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:L},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(K,B)=>r.renderSlot(M.$slots,"item",{key:B,item:K,textItem:"text",isSelected:$(K),isHovered:s.activeOption==B,onClick:r.withModifiers(x=>G(K),["stop"])},()=>[r.createVNode(fo,{option:K,"text-item":"text","is-selected":$(K),"is-hovered":s.activeOption==B,size:"medium",onClick:r.withModifiers(x=>G(K),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),j[3]||(j[3]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",fw,j[2]||(j[2]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):o.mode==="tabs"?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:d,style:r.normalizeStyle(N),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:L},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(K,B)=>r.renderSlot(M.$slots,"item",{key:B,item:K,isSelected:$(K),isHovered:s.activeOption==B,onClick:r.withModifiers(x=>G(K),["stop"])},()=>[r.createVNode(dw,{option:K,"is-selected":$(K),"is-hovered":s.activeOption==B,onClick:r.withModifiers(x=>G(K),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),j[5]||(j[5]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",mw,j[4]||(j[4]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)],34))}}),gw={class:"ui-dropdown__envelope"},yw=["tabindex"],_w={class:"ui-dropdown__container"},vw={class:"ui-dropdown__field"},Cw=["disabled","placeholder"],ww={class:"ui-dropdown__controls"},bw={key:0},xw={key:0,class:"required-icon"},kw={key:0,class:"nothing-found"},Sw={key:0,class:"ui-dropdown__error"},Ew={key:1,class:"ui-dropdown__helper"},Tw={key:2,class:"ui-dropdown__helper"},Bw={name:"PlDropdown"},Aw=r.defineComponent({...Bw,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,s=r.useSlots(),l=r.ref(),d=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1}),f=()=>ui(G.value.findIndex(B=>Pt(B.value,o.modelValue)),B=>B<0?0:B),m=()=>p.activeIndex=f(),y=r.computed(()=>o.options===void 0),E=r.computed(()=>y.value?!0:o.disabled),S=r.computed(()=>(o.options??[]).findIndex(B=>Pt(B.value,o.modelValue))),A=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&S.value===-1)return"The selected value is not one of the options"}}),O=r.computed(()=>dr(o.options??[]).map((B,x)=>({...B,index:x,isSelected:x===S.value,isActive:x===p.activeIndex}))),z=r.computed(()=>{const B=r.unref(O).find(x=>Pt(x.value,o.modelValue));return(B==null?void 0:B.label)||o.modelValue}),C=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(z.value):o.placeholder),R=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),G=r.computed(()=>{const B=O.value;return p.search?B.filter(x=>{const P=p.search.toLowerCase();return x.label.toLowerCase().includes(P)||x.description&&x.description.toLowerCase().includes(P)?!0:typeof x.value=="string"?x.value.toLowerCase().includes(P):x.value===p.search}):B}),$=r.computed(()=>E.value?void 0:"0"),L=B=>{var x;n("update:modelValue",B),p.search="",p.open=!1,(x=l==null?void 0:l.value)==null||x.focus()},J=()=>n("update:modelValue",void 0),H=()=>{var B;return(B=u.value)==null?void 0:B.focus()},F=()=>p.open=!p.open,N=()=>p.open=!0,M=B=>{var x;(x=l==null?void 0:l.value)!=null&&x.contains(B.relatedTarget)||(p.search="",p.open=!1)},j=()=>{const B=d.value;B&<(B.querySelector(".hovered-item"),x=>{pi(B,x)})},K=B=>{var x,P;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(B.code))B.preventDefault();else return;const{open:U,activeIndex:re}=p;if(!U){B.code==="Enter"&&(p.open=!0);return}B.code==="Escape"&&(p.open=!1,(x=l.value)==null||x.focus());const se=r.unref(G),{length:Pe}=se;if(!Pe)return;B.code==="Enter"&&L((P=se.find(Rn=>Rn.index===re))==null?void 0:P.value);const He=se.findIndex(Rn=>Rn.index===re)??-1,ot=B.code==="ArrowDown"?1:B.code==="ArrowUp"?-1:0,vn=Math.abs(He+ot+Pe)%Pe;p.activeIndex=G.value[vn].index??-1};return zn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,B=>{var x;return B?(x=u.value)==null?void 0:x.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&j()}),(B,x)=>(r.openBlock(),r.createElementBlock("div",gw,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:$.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:B.error,disabled:E.value}]),onKeydown:K,onFocusout:M},[r.createElementVNode("div",_w,[r.createElementVNode("div",vw,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":x[0]||(x[0]=P=>p.search=P),type:"text",tabindex:"-1",disabled:E.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:N},null,40,Cw),[[r.vModelText,p.search]]),x[4]||(x[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:H},[r.createVNode(vl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(z.value),1)]),_:1})])),x[5]||(x[5]=r.createTextVNode()),r.createElementVNode("div",ww,[y.value?(r.openBlock(),r.createBlock(r.unref(Zn),{key:0,name:"loading"})):r.createCommentVNode("",!0),x[1]||(x[1]=r.createTextVNode()),B.clearable&&R.value?(r.openBlock(),r.createBlock(r.unref(gs),{key:1,name:"delete-clear",onClick:r.withModifiers(J,["stop"])})):r.createCommentVNode("",!0),x[2]||(x[2]=r.createTextVNode()),r.renderSlot(B.$slots,"append"),x[3]||(x[3]=r.createTextVNode()),B.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${B.arrowIconLarge}`]]),onClick:r.withModifiers(F,["stop"])},null,2)):B.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${B.arrowIcon}`]]),onClick:r.withModifiers(F,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(F,["stop"])}))])]),x[9]||(x[9]=r.createTextVNode()),B.label?(r.openBlock(),r.createElementBlock("label",bw,[B.required?(r.openBlock(),r.createElementBlock("i",xw)):r.createCommentVNode("",!0),x[6]||(x[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(B.label),1),x[7]||(x[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(B.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),x[10]||(x[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:d,class:"ui-dropdown__options"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(G.value,(P,U)=>(r.openBlock(),r.createBlock(fo,{key:U,option:P,"is-selected":P.isSelected,"is-hovered":P.isActive,size:B.optionSize,onClick:r.withModifiers(re=>L(P.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),x[8]||(x[8]=r.createTextVNode()),G.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",kw,"Nothing found"))],512)):r.createCommentVNode("",!0),x[11]||(x[11]=r.createTextVNode()),r.createVNode(pr,{class:"ui-dropdown__contour"})])],42,yw),x[12]||(x[12]=r.createTextVNode()),A.value?(r.openBlock(),r.createElementBlock("div",Sw,r.toDisplayString(A.value),1)):y.value&&B.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",Ew,r.toDisplayString(B.loadingOptionsHelper),1)):B.helper?(r.openBlock(),r.createElementBlock("div",Tw,r.toDisplayString(B.helper),1)):r.createCommentVNode("",!0)]))}}),Nw={key:0,class:"ui-progress-bar"},Vw={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},Pw={class:"ui-progress-bar__message flex-grow-1"},Dw={class:"ui-progress-bar__percent"},Fw=r.defineComponent({__name:"PlProgressBar",props:{loading:{type:Boolean},progress:{default:0},completeMessage:{default:"Completed"}},setup(t){const e=t,n=r.computed(()=>e.progress===100?e.completeMessage:"");return(o,s)=>o.loading?(r.openBlock(),r.createElementBlock("div",Nw,[r.createElementVNode("div",{class:"ui-progress-bar__indicator",style:r.normalizeStyle({width:o.progress+"%"})},null,4),s[1]||(s[1]=r.createTextVNode()),r.createElementVNode("div",Vw,[r.createElementVNode("div",Pw,r.toDisplayString(n.value),1),s[0]||(s[0]=r.createTextVNode()),r.createElementVNode("div",Dw,r.toDisplayString(o.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),Rw={class:"mi-number-field__main-wrapper d-flex"},Mw={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},Iw={key:0,class:"text-description"},Ow=["disabled","placeholder"],Lw={class:"mi-number-field__icons d-flex-column"},Gw={key:0,class:"mi-number-field__hint text-description"},zw=r.defineComponent({__name:"PlNumberField",props:{modelValue:{},disabled:{type:Boolean},label:{default:void 0},placeholder:{default:void 0},step:{default:1},minValue:{default:void 0},maxValue:{default:void 0},errorMessage:{default:void 0},validate:{type:Function,default:void 0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,s=r.ref(),l=r.useSlots(),d=r.ref();zn(s);const u=r.ref(!0),p=r.computed({get(){return u.value&&n.modelValue!==void 0?new Number(n.modelValue).toString():""},set(C){var R;C=C.replace(/,/g,""),E(C)?(o("update:modelValue",+C),C.toString()!==((R=n.modelValue)==null?void 0:R.toString())&&+C===n.modelValue&&C[C.length-1]!=="."&&(u.value=!1,r.nextTick(()=>{u.value=!0}))):(C.trim()===""&&o("update:modelValue",void 0),u.value=!1,r.nextTick(()=>{u.value=!0}))}}),f=r.computed(()=>{let C=[];return n.errorMessage&&C.push(n.errorMessage),E(n.modelValue)?(n.minValue!==void 0&&n.modelValue!==void 0&&n.modelValue<n.minValue&&C.push(`Model value must be higher than ${n.minValue}`),n.maxValue!==void 0&&n.modelValue!==void 0&&n.modelValue>n.maxValue&&C.push(`Model value must be less than ${n.maxValue}`)):C.push("Model value is not a number."),C=[...C],C.join(" ")}),m=r.computed(()=>!!(n.maxValue&&n.modelValue!==void 0&&(n.modelValue||0)+n.step>n.maxValue)),y=r.computed(()=>!!(n.minValue&&n.modelValue!==void 0&&(n.modelValue||0)-n.step<n.minValue));function E(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 A(){if(!y.value){let C=0;n.modelValue===void 0?C=0:C=+(n.modelValue||0)-n.step,p.value=n.minValue?Math.max(n.minValue,C).toString():C.toString()}}function O(C){["ArrowDown","ArrowUp"].includes(C.code)&&C.preventDefault(),C.code==="ArrowUp"?S():C.code==="ArrowDown"&&A()}const z=C=>{C.detail>1&&C.preventDefault()};return(C,R)=>(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:z,onKeydown:R[1]||(R[1]=G=>O(G))},[r.createElementVNode("div",Rw,[r.createVNode(pr,{class:"mi-number-field__contour"}),R[6]||(R[6]=r.createTextVNode()),r.createElementVNode("div",Mw,[C.label?(r.openBlock(),r.createElementBlock("label",Iw,[r.createTextVNode(r.toDisplayString(C.label)+" ",1),r.unref(l).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(C.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),R[2]||(R[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":R[0]||(R[0]=G=>p.value=G),disabled:C.disabled,placeholder:C.placeholder,class:"text-s flex-grow"},null,8,Ow),[[r.vModelText,p.value]])]),R[7]||(R[7]=r.createTextVNode()),r.createElementVNode("div",Lw,[r.createElementVNode("div",{class:r.normalizeClass([{disabled:m.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:S},R[3]||(R[3]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z",fill:"#110529"})],-1)]),2),R[5]||(R[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([{disabled:y.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:A},R[4]||(R[4]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z",fill:"#110529"})],-1)]),2)])]),R[8]||(R[8]=r.createTextVNode()),f.value.trim()?(r.openBlock(),r.createElementBlock("div",Gw,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],34))}}),Zw={class:"pl-chip__text"},Cl=r.defineComponent({__name:"PlChip",props:{closeable:{type:Boolean},small:{type:Boolean}},emits:["close"],setup(t){const e=r.ref(),n=r.ref(!1);return r.onMounted(()=>{var o;e.value&&(n.value=((o=e.value)==null?void 0:o.clientWidth)>=256)}),(o,s)=>(r.openBlock(),r.createBlock(r.unref(St),{position:"top",class:"pl-chip-tooltip",delay:500},r.createSlots({default:r.withCtx(()=>[s[4]||(s[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"chip",ref:e,class:r.normalizeClass(["pl-chip",{small:o.small}])},[r.createElementVNode("div",Zw,[r.renderSlot(o.$slots,"default")]),s[3]||(s[3]=r.createTextVNode()),o.closeable?(r.openBlock(),r.createElementBlock("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:s[0]||(s[0]=r.withKeys(l=>o.$emit("close"),["enter"])),onClick:s[1]||(s[1]=r.withModifiers(l=>o.$emit("close"),["stop"]))},s[2]||(s[2]=[r.createElementVNode("div",{class:"pl-chip__close--icon"},null,-1)]),32)):r.createCommentVNode("",!0)],2)]),_:2},[n.value?{name:"tooltip",fn:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),key:"0"}:void 0]),1024))}}),$w={class:"pl-multi-dropdown__envelope"},Uw=["tabindex"],Ww={class:"pl-multi-dropdown__container"},Hw={class:"pl-multi-dropdown__field"},jw=["disabled","placeholder"],qw={class:"pl-multi-dropdown__append"},Kw={key:0},Yw={key:0,class:"required-icon"},Jw={class:"pl-multi-dropdown__open-chips-container"},Xw={key:0,class:"nothing-found"},Qw={key:0,class:"pl-multi-dropdown__error"},eb={key:1,class:"pl-multi-dropdown__helper"},tb={name:"PlDropdownMulti"},nb=r.defineComponent({...tb,props:{modelValue:{default:()=>[]},label:{default:void 0},options:{},helper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=F=>n("update:modelValue",F),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:[]),y=r.computed(()=>f.open&&l.modelValue.length>0?l.placeholder:l.modelValue.length>0?"":l.placeholder),E=r.computed(()=>dr(l.options).filter(F=>_l(m.value,F.value))),S=r.computed(()=>{const F=r.unref(m),N=dr(l.options);return(f.search?N.filter(M=>{const j=f.search.toLowerCase();return M.label.toLowerCase().includes(j)?!0:typeof M.value=="string"?M.value.toLowerCase().includes(j):M.value===f.search}):[...N]).map(M=>({...M,selected:_l(F,M.value)}))}),A=r.computed(()=>l.disabled?void 0:"0"),O=()=>{f.activeOption=ui(S.value.findIndex(F=>Pt(F.value,l.modelValue)),F=>F<0?0:F)},z=F=>{var N;const M=r.unref(m);o(_l(M,F)?M.filter(j=>!Pt(j,F)):[...M,F]),f.search="",(N=d==null?void 0:d.value)==null||N.focus()},C=F=>o(r.unref(m).filter(N=>!Pt(N,F))),R=()=>{var F;return(F=p.value)==null?void 0:F.focus()},G=()=>f.open=!f.open,$=F=>{var N,M;const j=F.relatedTarget;!((N=d.value)!=null&&N.contains(j))&&!((M=u.value)!=null&&M.contains(j))&&(f.search="",f.open=!1)},L=()=>{const F=u.value;F&<(F.querySelector(".hovered-item"),N=>{pi(F,N)})},J=F=>{var N;const{open:M,activeOption:j}=f;if(!M){F.code==="Enter"&&(f.open=!0);return}F.code==="Escape"&&(f.open=!1,(N=d.value)==null||N.focus());const K=r.unref(S),{length:B}=K;if(!B)return;["ArrowDown","ArrowUp","Enter"].includes(F.code)&&F.preventDefault(),F.code==="Enter"&&z(K[j].value);const x=F.code==="ArrowDown"?1:F.code==="ArrowUp"?-1:0;f.activeOption=Math.abs(j+x+B)%B,requestAnimationFrame(L)};zn(d),r.watch(()=>l.modelValue,()=>O(),{immediate:!0}),r.watchPostEffect(()=>{f.search,f.open&&L()});const H=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(u,F=>{if(F){const N=F.getBoundingClientRect();f.optionsHeight=N.height,window.dispatchEvent(new CustomEvent("adjust"))}}),mo(d,F=>{const N=F.top+F.height+5;N+f.optionsHeight>F.clientHeight?H.top=F.top-f.optionsHeight-5+"px":H.top=N+"px",H.left=F.left+"px",H.width=F.width+"px"}),(F,N)=>(r.openBlock(),r.createElementBlock("div",$w,[r.createElementVNode("div",{ref_key:"rootRef",ref:d,tabindex:A.value,class:r.normalizeClass(["pl-multi-dropdown",{open:f.open,error:F.error,disabled:F.disabled}]),onKeydown:J,onFocusout:$},[r.createElementVNode("div",Ww,[r.createElementVNode("div",Hw,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:p,"onUpdate:modelValue":N[0]||(N[0]=M=>f.search=M),type:"text",tabindex:"-1",disabled:F.disabled,placeholder:y.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:N[1]||(N[1]=M=>f.open=!0)},null,40,jw),[[r.vModelText,f.search]]),N[3]||(N[3]=r.createTextVNode()),f.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:R},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(E.value,(M,j)=>(r.openBlock(),r.createBlock(r.unref(Cl),{key:j,closeable:"",small:"",onClick:N[2]||(N[2]=r.withModifiers(K=>f.open=!0,["stop"])),onClose:K=>C(M.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(M.label||M.value),1)]),_:2},1032,["onClose"]))),128))])),N[4]||(N[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(G,["stop"])}),N[5]||(N[5]=r.createTextVNode()),r.createElementVNode("div",qw,[r.renderSlot(F.$slots,"append")])]),N[10]||(N[10]=r.createTextVNode()),F.label?(r.openBlock(),r.createElementBlock("label",Kw,[F.required?(r.openBlock(),r.createElementBlock("i",Yw)):r.createCommentVNode("",!0),N[6]||(N[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(F.label),1),N[7]||(N[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(F.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),N[11]||(N[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(H),tabindex:"-1",onFocusout:$},[r.createElementVNode("div",Jw,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(E.value,(M,j)=>(r.openBlock(),r.createBlock(r.unref(Cl),{key:j,closeable:"",small:"",onClose:K=>C(M.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(M.label||M.value),1)]),_:2},1032,["onClose"]))),128))]),N[8]||(N[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,(M,j)=>(r.openBlock(),r.createBlock(fo,{key:j,option:M,"text-item":"text","is-selected":M.selected,"is-hovered":f.activeOption==j,size:"medium","use-checkbox":"",onClick:r.withModifiers(K=>z(M.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),N[9]||(N[9]=r.createTextVNode()),S.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Xw,"Nothing found"))],36)])):r.createCommentVNode("",!0),N[12]||(N[12]=r.createTextVNode()),r.createVNode(pr,{class:"pl-multi-dropdown__contour"})])],42,Uw),N[13]||(N[13]=r.createTextVNode()),F.error?(r.openBlock(),r.createElementBlock("div",Qw,r.toDisplayString(F.error),1)):F.helper?(r.openBlock(),r.createElementBlock("div",eb,r.toDisplayString(F.helper),1)):r.createCommentVNode("",!0)]))}}),wl=r.defineComponent({__name:"PlCheckboxBase",props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>e.modelValue);return(o,s)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["pl-checkbox-base",{checked:n.value,disabled:o.disabled}]),onClick:s[0]||(s[0]=l=>o.$emit("update:modelValue",!o.modelValue)),onKeydown:s[1]||(s[1]=r.withKeys(l=>o.$emit("update:modelValue",!o.modelValue),["enter"]))},null,34))}}),rb={name:"PlCheckbox"},Iu=r.defineComponent({...rb,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.useSlots();return(o,s)=>r.unref(n).default?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-checkbox",{disabled:o.disabled}])},[r.createVNode(wl,r.mergeProps(e,{"onUpdate:modelValue":s[0]||(s[0]=l=>o.$emit("update:modelValue",l))}),null,16),s[3]||(s[3]=r.createTextVNode()),r.createElementVNode("label",{onClick:s[1]||(s[1]=l=>o.$emit("update:modelValue",!o.$props.modelValue))},[r.renderSlot(o.$slots,"default")])],2)):(r.openBlock(),r.createBlock(wl,r.mergeProps({key:1},e,{"onUpdate:modelValue":s[2]||(s[2]=l=>o.$emit("update:modelValue",l))}),null,16))}}),ob={key:0},ib=["onClick"],sb={name:"PlCheckboxGroup"},ab=r.defineComponent({...sb,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,s=d=>o.modelValue.includes(d),l=d=>{const u=o.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",ob,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(wl,{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,ib)]))),128))],2))}}),lb="_component_tupwt_1",cb={component:lb},db={};function ub(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 pb={$style:cb},hb=Kt(db,[["render",ub],["__cssModules",pb]]),fb={key:1,class:"pl-dialog-modal__title"},mb={inheritAttrs:!1},bl=r.defineComponent({...mb,__name:"PlDialogModal",props:{modelValue:{type:Boolean},width:{default:"448px"},height:{default:"auto"},minHeight:{default:"auto"},maxHeight:{default:"auto"},closable:{type:Boolean,default:!0},noContentGutters:{type:Boolean,default:!1},noTopContentGutter:{type:Boolean},actionsHasTopBorder:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,s=t,l=r.ref(),d=r.useAttrs();function u(p){l.value&&s.closeOnOutsideClick&&document.contains(p.target)&&!l.value.contains(p.target)&&o("update:modelValue",!1)}return rt(document.body,"keyup",p=>{s.modelValue&&p.code==="Escape"&&o("update:modelValue",!1)}),(p,f)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,{name:"dialog"},{default:r.withCtx(()=>[p.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-dialog-modal__shadow",onClick:u},[r.createElementVNode("div",r.mergeProps(r.unref(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(hb,{key:0,class:"close-modal-btn",onClick:f[0]||(f[0]=r.withModifiers(m=>o("update:modelValue",!1),["stop"]))})):r.createCommentVNode("",!0),f[1]||(f[1]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",fb,[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})]))}}),gb=r.defineComponent({__name:"TransitionSlidePanel",setup(t){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(o,s)=>(r.openBlock(),r.createBlock(r.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),_:3}))}}),yb={key:0,class:"pl-slide-modal__title"},_b={class:"pl-slide-modal__content"},vb={key:1,class:"pl-slide-modal__actions"},Cb={name:"PlSlideModal",inheritAttrs:!1},wb=r.defineComponent({...Cb,props:{modelValue:{type:Boolean,default:!1},width:{default:"368px"},shadow:{type:Boolean,default:!1},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,s=t,l=r.ref(),d=r.useAttrs();return ms(l,()=>{s.modelValue&&s.closeOnOutsideClick&&o("update:modelValue",!1)}),rt(document,"keydown",u=>{u.key==="Escape"&&o("update:modelValue",!1)}),(u,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(gb,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=>o("update:modelValue",!1),["esc"]))}),[r.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=f=>o("update:modelValue",!1))}),p[3]||(p[3]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",yb,[r.renderSlot(u.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",_b,[r.renderSlot(u.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",vb,[r.renderSlot(u.$slots,"actions")])):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3}),p[6]||(p[6]=r.createTextVNode()),u.modelValue&&u.shadow?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:p[2]||(p[2]=r.withKeys(f=>o("update:modelValue",!1),["esc"]))},null,32)):r.createCommentVNode("",!0)]))}}),bb={key:0,class:"label"},xb={name:"PlToggleSwitch"},ys=r.defineComponent({...xb,props:{label:{},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["ui-toggle-switch",{active:e.modelValue}]),onClick:n[0]||(n[0]=o=>e.$emit("update:modelValue",!e.modelValue)),onKeydown:n[1]||(n[1]=r.withKeys(o=>e.$emit("update:modelValue",!e.modelValue),["enter"]))},[n[2]||(n[2]=r.createElementVNode("div",{class:"ui-toggle-switch__body"},[r.createElementVNode("div",{class:"ui-toggle-switch__handle"})],-1)),n[3]||(n[3]=r.createTextVNode()),e.label?(r.openBlock(),r.createElementBlock("span",bb,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function Ou(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function kb(t){return r.unref(t)}const Sb=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function Eb(t,e,n={}){const{immediate:o=!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)},kb(e))}return o&&(s.value=!0,Sb&&p()),Ou(u),{isPending:r.readonly(s),start:p,stop:u}}function Tb(t,e,n){return r.watch(t,(o,s,l)=>{o&&e(o,s,l)},{...n,once:!1})}function Bb(t,e,n){const{start:o}=Eb(l,e,{immediate:!1}),s=r.ref(!1);async function l(){s.value&&(await t(),o())}function d(){s.value||(s.value=!0,l())}function u(){s.value=!1}return n!=null&&n.immediate&&d(),Ou(u),{isActive:s,pause:u,resume:d}}const Ab="[==PROGRESS==]";function Nb(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vb(t){const e=r.ref(),n=r.reactive({errorCount:0});async function o(){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??Ab,m=new TextDecoder().decode(p.data).replace(new RegExp(`${Nb(f)}`,"g"),"");if(d=Object.assign(d,{lines:d.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const s=Bb(()=>o().catch(l=>{e.value&&(n.errorCount++,n.errorCount>(t.maxRetries??3)?e.value.error=l:console.warn("skip error:",l,"retry..."))}),1500,{immediate:!1});return Tb(()=>{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 Pb={key:0},Db={class:"pl-log-view__copy"},Fb={key:1,class:"pl-log-view__error"},Rb={name:"PlLogView"},Lu=r.defineComponent({...Rb,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=A=>{if(A&&A.ok===!1)return A.errors.join(`
|
|
53
|
-
`)},n=t,o=Vb(n),s=r.ref(!0),l=r.ref(),d=r.ref(),u=r.computed(()=>{var A;return((A=o.value)==null?void 0:A.error)??n.error??e(n.output)}),p=r.computed(()=>{var A;return((A=o.value)==null?void 0:A.lines)??n.value??T_(n.output)}),f=r.ref(!1);zn(d);const m=r.computed(()=>f.value?"clipboard-copied":"clipboard"),y=()=>{f.value=!0,setTimeout(()=>{f.value=!1},1200),p.value&&typeof p.value=="string"&&navigator.clipboard.writeText(p.value)},E=()=>{Gr(l.value,A=>{s.value&&A.scrollTo(A.scrollLeft,A.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{E()})},{immediate:!0});const S=A=>{const O=A.target;s.value=O.scrollTop+20>=O.scrollHeight-O.offsetHeight};return(A,O)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:d,class:r.normalizeClass(["pl-log-view",{"has-error":u.value}])},[A.label?(r.openBlock(),r.createElementBlock("label",Pb,r.toDisplayString(A.label),1)):r.createCommentVNode("",!0),O[1]||(O[1]=r.createTextVNode()),r.createVNode(pr,{class:"pl-log-view__contour"}),O[2]||(O[2]=r.createTextVNode()),r.createElementVNode("div",Db,[r.createVNode(r.unref(St),{"close-delay":800,position:"top"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(f.value?"copied":"copy"),1)]),default:r.withCtx(()=>[r.createVNode(r.unref(Zn),{title:"Copy content",name:m.value,onClick:y},null,8,["name"]),O[0]||(O[0]=r.createTextVNode())]),_:1})]),O[3]||(O[3]=r.createTextVNode()),u.value?(r.openBlock(),r.createElementBlock("div",Fb,r.toDisplayString(u.value),1)):(r.openBlock(),r.createElementBlock("div",{key:2,ref_key:"contentRef",ref:l,class:"pl-log-view__content",onScroll:S},r.toDisplayString(p.value),545))],2))}}),Mb="_component_1ukal_1",Ib="_tab_1ukal_14",Ob="_disabled_1ukal_27",Lb="_active_1ukal_56",Gb="_topLine_1ukal_69",go={component:Mb,tab:Ib,disabled:Ob,active:Lb,topLine:Gb},zb=r.defineComponent({__name:"Tab",props:{option:{}},setup(t){const e=r.ref(),n=r.reactive({isOverflown:!1});return r.onMounted(()=>{const o=r.unref(e);if(!o)return;const s=o.$el.querySelector("span");s&&requestAnimationFrame(()=>{s.offsetWidth<s.scrollWidth&&(n.isOverflown=!0),console.log("el.offsetWidth, el.scrollWidth",s.offsetWidth,s.scrollWidth)})}),(o,s)=>(r.openBlock(),r.createBlock(r.unref(St),{ref_key:"rootRef",ref:e,element:"div",position:"top",hide:!n.isOverflown,"close-delay":300,"data-is-overflown":n.isOverflown?"true":"false"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(o.option.label),1)]),default:r.withCtx(()=>[r.renderSlot(o.$slots,"default"),s[0]||(s[0]=r.createTextVNode())]),_:3},8,["hide","data-is-overflown"]))}}),Zb={name:"PlTabs"},$b=r.defineComponent({...Zb,props:{modelValue:{},options:{},disabled:{type:Boolean},topLine:{type:Boolean},maxTabWidth:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=s=>n("update:modelValue",s);return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(go).component,{[r.unref(go).disabled]:s.disabled,[r.unref(go).topLine]:s.topLine}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(d,u)=>(r.openBlock(),r.createBlock(zb,{key:u,tabindex:s.modelValue===d.value||s.disabled||d.disabled?void 0:0,option:d,class:r.normalizeClass([{[r.unref(go).active]:s.modelValue===d.value,[r.unref(go).disabled]:d.disabled},r.unref(go).tab]),style:r.normalizeStyle({"--pl-tabs-item-max-width":d.maxWidth??s.maxTabWidth}),onKeydown:r.withKeys(p=>o(d.value),["enter"]),onClick:p=>o(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))}}),Ub=r.defineComponent({__name:"PlSectionSeparator",props:{compact:{type:Boolean}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-section-separator",{[e.$style.compact]:e.compact}])},[r.createElementVNode("div",{class:r.normalizeClass(e.$style.content)},[r.renderSlot(e.$slots,"default")],2)],2))}}),Wb="_compact_rhd5u_16",Hb="_content_rhd5u_20",jb={compact:Wb,content:Hb},qb={$style:jb},Gu=Kt(Ub,[["__cssModules",qb]]),Kb=r.defineComponent({__name:"PlAccordion",props:r.mergeModels({multiple:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t;return r.provide("pl-accordion-model",e),r.provide("pl-accordion-props",r.toRef(n)),(o,s)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.renderSlot(o.$slots,"header"),s[0]||(s[0]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],64))}}),Yb=r.defineComponent({__name:"ExpandTransition",setup(t){const e=o=>{o.style.setProperty("--component-height",o.scrollHeight+"px"),o.classList.add("expand-collapse-fix")},n=o=>{o.style.removeProperty("--component-height"),o.classList.remove("expand-collapse-fix")};return(o,s)=>(r.openBlock(),r.createBlock(r.Transition,{name:"expand-collapse",onEnter:e,onLeave:e,onAfterEnter:n,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),_:3}))}}),Jb=r.defineComponent({__name:"PlAccordionSection",props:r.mergeModels({label:{},compact:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.inject("pl-accordion-model"),n=r.inject("pl-accordion-props"),o=r.useModel(t,"modelValue"),s=iu(),l=r.computed(()=>!n||n.value.multiple),d=r.computed({get(){return l.value?o.value:e?e.value===s:o.value},set(u){l.value?o.value=u:e&&(e.value=e.value===s?"":s)}});return(u,p)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(r.unref(Gu),{class:r.normalizeClass(u.$style.separator),compact:u.compact,onClick:p[0]||(p[0]=f=>d.value=!d.value)},{default:r.withCtx(()=>[r.createVNode(r.unref(ur),{name:"chevron-right",class:r.normalizeClass([{[u.$style.down]:d.value},u.$style.chevron])},null,8,["class"]),r.createTextVNode(" "+r.toDisplayString(u.label),1)]),_:1},8,["class","compact"]),p[1]||(p[1]=r.createTextVNode()),r.createVNode(Yb,null,{default:r.withCtx(()=>[d.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(u.$style.content)},[r.renderSlot(u.$slots,"default")],2)):r.createCommentVNode("",!0)]),_:3})],64))}}),Xb="_content_jmjfk_2",Qb="_separator_jmjfk_14",ex="_chevron_jmjfk_19",tx="_down_jmjfk_23",nx={content:Xb,separator:Qb,chevron:ex,down:tx},rx={$style:nx},ox=Kt(Jb,[["__cssModules",rx]]);function ix(t){const e=t.split("/"),n=[];for(let o=0;o<e.length;o++)n.push({index:o,name:o===0?"Root":e[o],path:e.slice(0,o+1).join("/")});return n}const sx={class:"file-dialog"},ax={class:"file-dialog__search"},lx={class:"ls-container"},cx={class:"ls-head"},dx={class:"ls-head__breadcrumbs"},ux=["title","onClick"],px={key:0,class:"icon-16 icon-chevron-right"},hx={class:"d-flex ml-auto align-center gap-12"},fx={class:"ls-head__selected"},mx={key:0,class:"ls-loader"},gx={key:1,class:"ls-empty"},yx={key:2,class:"ls-error"},_x={class:"ls-error__message"},vx={key:3,class:"ls-body"},Cx=["onClick"],wx=["title"],bx=["onClick"],xx=["title"],zu=r.defineComponent({__name:"PlFileDialog",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue","import:files"],setup(t,{emit:e}){const n=e,o=t,s=()=>({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(H=>!H.name.startsWith("."))),u=r.computed(()=>{var H;return{modelValue:o.modelValue,dirPath:l.dirPath,storageHandle:(H=l.storageEntry)==null?void 0:H.handle}}),p=(H,F)=>{window.platforma&&l.currentLoadingPath!==F&&(l.error="",l.items=[],l.lastSelected=void 0,l.currentLoadingPath=F,window.platforma.lsDriver.listFiles(H,F).then(N=>{F===l.dirPath&&(l.items=nu(N).entries.map(M=>({path:M.fullPath,name:M.name,isDir:M.type==="dir",canBeSelected:M.type==="file"&&(!o.extensions||o.extensions.some(j=>M.fullPath.endsWith(j))),handle:M.type==="file"?M.handle:void 0,selected:!1})).sort((M,j)=>M.isDir&&!j.isDir?-1:!M.isDir&&j.isDir?1:M.name.localeCompare(j.name)).map((M,j)=>({id:j,...M})),l.lastSelected=void 0)}).catch(N=>l.error=String(N)).finally(()=>{l.currentLoadingPath=void 0}))},f=()=>{const{storageHandle:H,dirPath:F,modelValue:N}=u.value;H&&N&&p(H,F)},m=au(H=>{l.dirPath=H??""},1e3),y=r.computed(()=>ix(l.dirPath)),E=r.computed(()=>l.items.filter(H=>H.canBeSelected&&H.selected&&!H.isDir)),S=r.computed(()=>E.value.length>0),A=()=>{n("update:modelValue",!1)},O=()=>{var H;S.value&&(H=l.storageEntry)!=null&&H.handle&&(n("import:files",{storageHandle:l.storageEntry.handle,files:E.value.map(F=>F.handle)}),A())},z=H=>{l.dirPath=H,l.storageEntry&&f()},C=(H,F)=>{const{shiftKey:N,metaKey:M}=H,{lastSelected:j}=l;if(H.preventDefault(),F.canBeSelected){if(o.multi||l.items.forEach(K=>K.selected=!1),F.selected=!0,!o.multi)return;!M&&!N&&l.items.forEach(K=>{K.id!==F.id&&(K.selected=!1)}),N&&j!==void 0&&l.items.forEach(K=>{k_(K.id,j,F.id)&&(K.selected=!0)}),F.selected&&(l.lastSelected=F.id)}},R=H=>{H&&!o.multi||l.items.filter(F=>F.canBeSelected).forEach(F=>{F.selected=H})},G=()=>R(!0),$=()=>R(!1),L=()=>{if(l.error="",l.lastSelected=void 0,$(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(H=>{l.storageOptions=H.map(F=>({text:F.name,value:F})),o.autoSelectStorage&&Gr(H.find(F=>F.name==="local"||F.name.startsWith("local_disk_")&&F.initialFullPath.length>4),F=>{l.storageEntry=F,l.dirPath=F.initialFullPath})}).catch(H=>l.error=String(H))};r.watch(r.toRef(l,"storageEntry"),H=>{l.dirPath=(H==null?void 0:H.initialFullPath)??""}),r.watch([()=>l.dirPath,()=>l.storageEntry],()=>{f()}),r.watch(()=>o.modelValue,H=>{H?L():Object.assign(l,s())},{immediate:!0}),rt(document,"keydown",H=>{o.modelValue&&H.target===document.body&&(H.metaKey&&H.code==="KeyA"&&(H.preventDefault(),G()),H.metaKey&&H.shiftKey&&H.code==="Period"&&(H.preventDefault(),l.showHiddenItems=!l.showHiddenItems),H.code==="Enter"&&O())}),r.onUpdated(L);const J={mounted:H=>{if(H.clientWidth<H.scrollWidth){const F=H.innerText;H.innerText=F.substring(0,57)+"..."+F.substring(F.length-10)}}};return(H,F)=>(r.openBlock(),r.createBlock(r.unref(bl),{"no-content-gutters":!0,"close-on-outside-click":H.closeOnOutsideClick,class:"split","model-value":H.modelValue,width:"688px",height:"720px","onUpdate:modelValue":A,onClick:r.withModifiers($,["stop"])},{title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(H.title??"Select files"),1)]),actions:r.withCtx(()=>[r.createVNode(r.unref(ul),{style:{"min-width":"160px"},disabled:!S.value,onClick:r.withModifiers(O,["stop"])},{default:r.withCtx(()=>F[14]||(F[14]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),F[16]||(F[16]=r.createTextVNode()),r.createVNode(r.unref(hl),{"justify-center":!1,onClick:r.withModifiers(A,["stop"])},{default:r.withCtx(()=>F[15]||(F[15]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[F[17]||(F[17]=r.createTextVNode()),r.createElementVNode("div",sx,[r.createElementVNode("div",ax,[r.createVNode(r.unref(hi),{modelValue:l.storageEntry,"onUpdate:modelValue":F[0]||(F[0]=N=>l.storageEntry=N),label:"Select storage",options:l.storageOptions},null,8,["modelValue","options"]),F[1]||(F[1]=r.createTextVNode()),r.createVNode(r.unref(zr),{"model-value":l.dirPath,label:"Enter path","onUpdate:modelValue":r.unref(m)},null,8,["model-value","onUpdate:modelValue"])]),F[13]||(F[13]=r.createTextVNode()),r.createElementVNode("div",lx,[r.createElementVNode("div",cx,[r.createElementVNode("div",dx,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,(N,M)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:M},[r.createElementVNode("div",{title:N.path,onClick:j=>z(N.path)},r.toDisplayString(N.name),9,ux),F[2]||(F[2]=r.createTextVNode()),N.index!==y.value.length-1?(r.openBlock(),r.createElementBlock("i",px)):r.createCommentVNode("",!0)],64))),128))]),F[3]||(F[3]=r.createTextVNode()),r.createElementVNode("div",hx,[r.createElementVNode("span",fx,"Selected: "+r.toDisplayString(E.value.length),1)])]),F[12]||(F[12]=r.createTextVNode()),l.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",mx,F[4]||(F[4]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):l.storageEntry?l.error?(r.openBlock(),r.createElementBlock("div",yx,[F[6]||(F[6]=r.createElementVNode("div",{class:"ls-error__cat"},null,-1)),F[7]||(F[7]=r.createTextVNode()),r.createElementVNode("div",_x,r.toDisplayString(l.error),1)])):(r.openBlock(),r.createElementBlock("div",vx,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,N=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:N.id},[N.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:"isDir",onClick:M=>z(N.path)},[F[8]||(F[8]=r.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),F[9]||(F[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:N.name},[r.createTextVNode(r.toDisplayString(N.name),1)],8,wx)),[[J]])],8,Cx)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({canBeSelected:N.canBeSelected,selected:N.selected}),onClick:r.withModifiers(M=>C(M,N),["stop"])},[F[10]||(F[10]=r.createElementVNode("i",{class:"mask-16 mask-box isFile"},null,-1)),F[11]||(F[11]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:N.name},[r.createTextVNode(r.toDisplayString(N.name),1)],8,xx)),[[J]])],10,bx))],64))),128))])):(r.openBlock(),r.createElementBlock("div",gx,F[5]||(F[5]=[r.createElementVNode("div",{class:"ls-empty__cat"},null,-1),r.createTextVNode(),r.createElementVNode("div",{class:"ls-empty__message"},"Select storage to preview",-1)])))])]),F[18]||(F[18]=r.createTextVNode())]),_:1},8,["close-on-outside-click","model-value"]))}});var Oe;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const 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 o(s,l=" | "){return s.map(d=>typeof d=="string"?`'${d}'`:d).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Oe||(Oe={}));var xl;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(xl||(xl={}));const le=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),hr=t=>{switch(typeof t){case"undefined":return le.undefined;case"string":return le.string;case"number":return isNaN(t)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(t)?le.array:t===null?le.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?le.promise:typeof Map<"u"&&t instanceof Map?le.map:typeof Set<"u"&&t instanceof Set?le.set:typeof Date<"u"&&t instanceof Date?le.date:le.object;default:return le.unknown}},ee=Oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),kx=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ot extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},s=l=>{for(const 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)o._errors.push(n(d));else{let u=o,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),o}static assert(e){if(!(e instanceof Ot))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):o.push(e(s));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Ot.create=t=>new Ot(t);const yo=(t,e)=>{let n;switch(t.code){case ee.invalid_type:t.received===le.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Oe.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Oe.joinValues(t.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Oe.joinValues(t.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Oe.joinValues(t.options)}, received '${t.received}'`;break;case ee.invalid_arguments:n="Invalid function arguments";break;case ee.invalid_return_type:n="Invalid function return type";break;case ee.invalid_date:n="Invalid date";break;case ee.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Oe.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ee.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ee.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ee.custom:n="Invalid input";break;case ee.invalid_intersection_types:n="Intersection results could not be merged";break;case ee.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ee.not_finite:n="Number must be finite";break;default:n=e.defaultError,Oe.assertNever(t)}return{message:n}};let Zu=yo;function Sx(t){Zu=t}function _s(){return Zu}const vs=t=>{const{data:e,path:n,errorMaps:o,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=o.filter(f=>!!f).slice().reverse();for(const f of p)u=f(d,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},Ex=[];function ie(t,e){const n=_s(),o=vs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===yo?void 0:yo].filter(s=>!!s)});t.common.issues.push(o)}class vt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const s of n){if(s.status==="aborted")return we;s.status==="dirty"&&e.dirty(),o.push(s.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const s of n){const l=await s.key,d=await s.value;o.push({key:l,value:d})}return vt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const s of n){const{key:l,value:d}=s;if(l.status==="aborted"||d.status==="aborted")return we;l.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof d.value<"u"||s.alwaysSet)&&(o[l.value]=d.value)}return{status:e.value,value:o}}}const we=Object.freeze({status:"aborted"}),Cs=t=>({status:"dirty",value:t}),Et=t=>({status:"valid",value:t}),kl=t=>t.status==="aborted",Sl=t=>t.status==="dirty",fi=t=>t.status==="valid",mi=t=>typeof Promise<"u"&&t instanceof Promise;function ws(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function $u(t,e,n,o,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var he;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(he||(he={}));var gi,yi;class Vn{constructor(e,n,o,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Uu=(t,e)=>{if(fi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ot(t.common.issues);return this._error=n,this._error}}};function Ee(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:s}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(l,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??o)!==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 hr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:hr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new vt,ctx:{common:e.parent.common,data:e.data,parsedType:hr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(mi(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const s={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hr(e)},l=this._parseSync({data:e,path:s.path,parent:s});return Uu(s,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hr(e)},s=this._parse({data:e,path:o.path,parent:o}),l=await(mi(s)?s:Promise.resolve(s));return Uu(o,l)}refine(e,n){const o=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const d=e(s),u=()=>l.addIssue({code:ee.custom,...o(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((o,s)=>e(o)?!0:(s.addIssue(typeof n=="function"?n(o,s):n),!1))}_refinement(e){return new dn({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Dn.create(this,this._def)}nullable(){return _r.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return cn.create(this,this._def)}promise(){return wo.create(this,this._def)}or(e){return wi.create([this,e],this._def)}and(e){return bi.create(this,e,this._def)}transform(e){return new dn({...Ee(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ti({...Ee(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new Bl({typeName:ve.ZodBranded,type:this,...Ee(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Bi({...Ee(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Ai.create(this,e)}readonly(){return Ni.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Tx=/^c[^\s-]{8,}$/i,Bx=/^[0-9a-z]+$/,Ax=/^[0-9A-HJKMNP-TV-Z]{26}$/,Nx=/^[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,Vx=/^[a-z0-9_-]{21}$/i,Px=/^[-+]?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)?)??$/,Dx=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Fx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let El;const Rx=/^(?:(?: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])$/,Mx=/^(([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})))$/,Ix=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Wu="((\\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])))",Ox=new RegExp(`^${Wu}$`);function Hu(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 Lx(t){return new RegExp(`^${Hu(t)}$`)}function ju(t){let e=`${Wu}T${Hu(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 Gx(t,e){return!!((e==="v4"||!e)&&Rx.test(t)||(e==="v6"||!e)&&Mx.test(t))}class ln extends Ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==le.string){const s=this._getOrReturnCtx(e);return ie(s,{code:ee.invalid_type,expected:le.string,received:s.parsedType}),we}const n=new vt;let o;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.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)&&(o=this._getOrReturnCtx(e,o),l?ie(o,{code:ee.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):d&&ie(o,{code:ee.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Dx.test(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{validation:"email",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")El||(El=new RegExp(Fx,"u")),El.test(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{validation:"emoji",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Nx.test(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{validation:"uuid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")Vx.test(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{validation:"nanoid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Tx.test(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{validation:"cuid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Bx.test(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{validation:"cuid2",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Ax.test(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{validation:"ulid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),ie(o,{validation:"url",code:ee.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{validation:"regex",code:ee.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?ju(s).test(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Ox.test(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?Lx(s).test(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Px.test(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{validation:"duration",code:ee.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Gx(e.data,s.version)||(o=this._getOrReturnCtx(e,o),ie(o,{validation:"ip",code:ee.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Ix.test(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{validation:"base64",code:ee.invalid_string,message:s.message}),n.dirty()):Oe.assertNever(s);return{status:n.value,value:e.data}}_regex(e,n,o){return this.refinement(s=>e.test(s),{validation:n,code:ee.invalid_string,...he.errToObj(o)})}_addCheck(e){return new ln({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...he.errToObj(e)})}url(e){return this._addCheck({kind:"url",...he.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...he.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...he.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...he.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...he.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...he.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...he.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...he.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...he.errToObj(e)})}datetime(e){var n,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...he.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,...he.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...he.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...he.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...he.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...he.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...he.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...he.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...he.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...he.errToObj(n)})}nonempty(e){return this.min(1,he.errToObj(e))}trim(){return new ln({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ln({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ln({...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}}ln.create=t=>{var e;return new ln({checks:[],typeName:ve.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};function zx(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,s=n>o?n:o,l=parseInt(t.toFixed(s).replace(".","")),d=parseInt(e.toFixed(s).replace(".",""));return l%d/Math.pow(10,s)}class fr 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)!==le.number){const s=this._getOrReturnCtx(e);return ie(s,{code:ee.invalid_type,expected:le.number,received:s.parsedType}),we}let n;const o=new vt;for(const s of this._def.checks)s.kind==="int"?Oe.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?zx(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.not_finite,message:s.message}),o.dirty()):Oe.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,he.toString(n))}gt(e,n){return this.setLimit("min",e,!1,he.toString(n))}lte(e,n){return this.setLimit("max",e,!0,he.toString(n))}lt(e,n){return this.setLimit("max",e,!1,he.toString(n))}setLimit(e,n,o,s){return new fr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:he.toString(s)}]})}_addCheck(e){return new fr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:he.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:he.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:he.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:he.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:he.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:he.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:he.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:he.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:he.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Oe.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}fr.create=t=>new fr({checks:[],typeName:ve.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class mr 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)!==le.bigint){const s=this._getOrReturnCtx(e);return ie(s,{code:ee.invalid_type,expected:le.bigint,received:s.parsedType}),we}let n;const o=new vt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):Oe.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,he.toString(n))}gt(e,n){return this.setLimit("min",e,!1,he.toString(n))}lte(e,n){return this.setLimit("max",e,!0,he.toString(n))}lt(e,n){return this.setLimit("max",e,!1,he.toString(n))}setLimit(e,n,o,s){return new mr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:he.toString(s)}]})}_addCheck(e){return new mr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:he.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:he.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:he.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:he.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:he.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}}mr.create=t=>{var e;return new mr({checks:[],typeName:ve.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};class _i extends Ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==le.boolean){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:le.boolean,received:n.parsedType}),we}return Et(e.data)}}_i.create=t=>new _i({typeName:ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class Zr extends Ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==le.date){const s=this._getOrReturnCtx(e);return ie(s,{code:ee.invalid_type,expected:le.date,received:s.parsedType}),we}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return ie(s,{code:ee.invalid_date}),we}const n=new vt;let o;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Oe.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Zr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:he.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:he.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Zr.create=t=>new Zr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ve.ZodDate,...Ee(t)});class bs extends Ae{_parse(e){if(this._getType(e)!==le.symbol){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:le.symbol,received:n.parsedType}),we}return Et(e.data)}}bs.create=t=>new bs({typeName:ve.ZodSymbol,...Ee(t)});class vi extends Ae{_parse(e){if(this._getType(e)!==le.undefined){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:le.undefined,received:n.parsedType}),we}return Et(e.data)}}vi.create=t=>new vi({typeName:ve.ZodUndefined,...Ee(t)});class Ci extends Ae{_parse(e){if(this._getType(e)!==le.null){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:le.null,received:n.parsedType}),we}return Et(e.data)}}Ci.create=t=>new Ci({typeName:ve.ZodNull,...Ee(t)});class _o extends Ae{constructor(){super(...arguments),this._any=!0}_parse(e){return Et(e.data)}}_o.create=t=>new _o({typeName:ve.ZodAny,...Ee(t)});class $r extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Et(e.data)}}$r.create=t=>new $r({typeName:ve.ZodUnknown,...Ee(t)});class $n extends Ae{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:le.never,received:n.parsedType}),we}}$n.create=t=>new $n({typeName:ve.ZodNever,...Ee(t)});class xs extends Ae{_parse(e){if(this._getType(e)!==le.undefined){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:le.void,received:n.parsedType}),we}return Et(e.data)}}xs.create=t=>new xs({typeName:ve.ZodVoid,...Ee(t)});class cn extends Ae{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),s=this._def;if(n.parsedType!==le.array)return ie(n,{code:ee.invalid_type,expected:le.array,received:n.parsedType}),we;if(s.exactLength!==null){const d=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(d||u)&&(ie(n,{code:d?ee.too_big:ee.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}),o.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ie(n,{code:ee.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),o.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ie(n,{code:ee.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((d,u)=>s.type._parseAsync(new Vn(n,d,n.path,u)))).then(d=>vt.mergeArray(o,d));const l=[...n.data].map((d,u)=>s.type._parseSync(new Vn(n,d,n.path,u)));return vt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new cn({...this._def,minLength:{value:e,message:he.toString(n)}})}max(e,n){return new cn({...this._def,maxLength:{value:e,message:he.toString(n)}})}length(e,n){return new cn({...this._def,exactLength:{value:e,message:he.toString(n)}})}nonempty(e){return this.min(1,e)}}cn.create=(t,e)=>new cn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Ee(e)});function vo(t){if(t instanceof et){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=Dn.create(vo(o))}return new et({...t._def,shape:()=>e})}else return t instanceof cn?new cn({...t._def,type:vo(t.element)}):t instanceof Dn?Dn.create(vo(t.unwrap())):t instanceof _r?_r.create(vo(t.unwrap())):t instanceof Pn?Pn.create(t.items.map(e=>vo(e))):t}class et 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=Oe.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==le.object){const p=this._getOrReturnCtx(e);return ie(p,{code:ee.invalid_type,expected:le.object,received:p.parsedType}),we}const{status:n,ctx:o}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),d=[];if(!(this._def.catchall instanceof $n&&this._def.unknownKeys==="strip"))for(const p in o.data)l.includes(p)||d.push(p);const u=[];for(const p of l){const f=s[p],m=o.data[p];u.push({key:{status:"valid",value:p},value:f._parse(new Vn(o,m,o.path,p)),alwaysSet:p in o.data})}if(this._def.catchall instanceof $n){const p=this._def.unknownKeys;if(p==="passthrough")for(const f of d)u.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(p==="strict")d.length>0&&(ie(o,{code:ee.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=o.data[f];u.push({key:{status:"valid",value:f},value:p._parse(new Vn(o,m,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const p=[];for(const f of u){const m=await f.key,y=await f.value;p.push({key:m,value:y,alwaysSet:f.alwaysSet})}return p}).then(p=>vt.mergeObjectSync(n,p)):vt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return he.errToObj,new et({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var s,l,d,u;const p=(d=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,o).message)!==null&&d!==void 0?d:o.defaultError;return n.code==="unrecognized_keys"?{message:(u=he.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new et({...this._def,unknownKeys:"strip"})}passthrough(){return new et({...this._def,unknownKeys:"passthrough"})}extend(e){return new et({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new et({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ve.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new et({...this._def,catchall:e})}pick(e){const n={};return Oe.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new et({...this._def,shape:()=>n})}omit(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new et({...this._def,shape:()=>n})}deepPartial(){return vo(this)}partial(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{const s=this.shape[o];e&&!e[o]?n[o]=s:n[o]=s.optional()}),new et({...this._def,shape:()=>n})}required(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let s=this.shape[o];for(;s instanceof Dn;)s=s._def.innerType;n[o]=s}}),new et({...this._def,shape:()=>n})}keyof(){return qu(Oe.objectKeys(this.shape))}}et.create=(t,e)=>new et({shape:()=>t,unknownKeys:"strip",catchall:$n.create(),typeName:ve.ZodObject,...Ee(e)}),et.strictCreate=(t,e)=>new et({shape:()=>t,unknownKeys:"strict",catchall:$n.create(),typeName:ve.ZodObject,...Ee(e)}),et.lazycreate=(t,e)=>new et({shape:t,unknownKeys:"strip",catchall:$n.create(),typeName:ve.ZodObject,...Ee(e)});class wi extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const d=l.map(u=>new Ot(u.ctx.common.issues));return ie(n,{code:ee.invalid_union,unionErrors:d}),we}if(n.common.async)return Promise.all(o.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 o){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&d.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=d.map(p=>new Ot(p));return ie(n,{code:ee.invalid_union,unionErrors:u}),we}}get options(){return this._def.options}}wi.create=(t,e)=>new wi({options:t,typeName:ve.ZodUnion,...Ee(e)});const gr=t=>t instanceof ki?gr(t.schema):t instanceof dn?gr(t.innerType()):t instanceof Si?[t.value]:t instanceof yr?t.options:t instanceof Ei?Oe.objectValues(t.enum):t instanceof Ti?gr(t._def.innerType):t instanceof vi?[void 0]:t instanceof Ci?[null]:t instanceof Dn?[void 0,...gr(t.unwrap())]:t instanceof _r?[null,...gr(t.unwrap())]:t instanceof Bl||t instanceof Ni?gr(t.unwrap()):t instanceof Bi?gr(t._def.innerType):[];class ks extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.object)return ie(n,{code:ee.invalid_type,expected:le.object,received:n.parsedType}),we;const o=this.discriminator,s=n.data[o],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),we)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const s=new Map;for(const l of n){const d=gr(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 ks({typeName:ve.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Ee(o)})}}function Tl(t,e){const n=hr(t),o=hr(e);if(t===e)return{valid:!0,data:t};if(n===le.object&&o===le.object){const s=Oe.objectKeys(e),l=Oe.objectKeys(t).filter(u=>s.indexOf(u)!==-1),d={...t,...e};for(const u of l){const p=Tl(t[u],e[u]);if(!p.valid)return{valid:!1};d[u]=p.data}return{valid:!0,data:d}}else if(n===le.array&&o===le.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=Tl(d,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===le.date&&o===le.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class bi extends Ae{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=(l,d)=>{if(kl(l)||kl(d))return we;const u=Tl(l.value,d.value);return u.valid?((Sl(l)||Sl(d))&&n.dirty(),{status:n.value,value:u.data}):(ie(o,{code:ee.invalid_intersection_types}),we)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,d])=>s(l,d)):s(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}bi.create=(t,e,n)=>new bi({left:t,right:e,typeName:ve.ZodIntersection,...Ee(n)});class Pn extends Ae{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.array)return ie(o,{code:ee.invalid_type,expected:le.array,received:o.parsedType}),we;if(o.data.length<this._def.items.length)return ie(o,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),we;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...o.data].map((l,d)=>{const u=this._def.items[d]||this._def.rest;return u?u._parse(new Vn(o,l,o.path,d)):null}).filter(l=>!!l);return o.common.async?Promise.all(s).then(l=>vt.mergeArray(n,l)):vt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Pn({...this._def,rest:e})}}Pn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Pn({items:t,typeName:ve.ZodTuple,rest:null,...Ee(e)})};class xi extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.object)return ie(o,{code:ee.invalid_type,expected:le.object,received:o.parsedType}),we;const s=[],l=this._def.keyType,d=this._def.valueType;for(const u in o.data)s.push({key:l._parse(new Vn(o,u,o.path,u)),value:d._parse(new Vn(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?vt.mergeObjectAsync(n,s):vt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Ae?new xi({keyType:e,valueType:n,typeName:ve.ZodRecord,...Ee(o)}):new xi({keyType:ln.create(),valueType:e,typeName:ve.ZodRecord,...Ee(n)})}}class Ss extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.map)return ie(o,{code:ee.invalid_type,expected:le.map,received:o.parsedType}),we;const s=this._def.keyType,l=this._def.valueType,d=[...o.data.entries()].map(([u,p],f)=>({key:s._parse(new Vn(o,u,o.path,[f,"key"])),value:l._parse(new Vn(o,p,o.path,[f,"value"]))}));if(o.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 we;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of d){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return we;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}Ss.create=(t,e,n)=>new Ss({valueType:e,keyType:t,typeName:ve.ZodMap,...Ee(n)});class Ur extends Ae{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.set)return ie(o,{code:ee.invalid_type,expected:le.set,received:o.parsedType}),we;const s=this._def;s.minSize!==null&&o.data.size<s.minSize.value&&(ie(o,{code:ee.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&o.data.size>s.maxSize.value&&(ie(o,{code:ee.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 we;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...o.data.values()].map((p,f)=>l._parse(new Vn(o,p,o.path,f)));return o.common.async?Promise.all(u).then(p=>d(p)):d(u)}min(e,n){return new Ur({...this._def,minSize:{value:e,message:he.toString(n)}})}max(e,n){return new Ur({...this._def,maxSize:{value:e,message:he.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Ur.create=(t,e)=>new Ur({valueType:t,minSize:null,maxSize:null,typeName:ve.ZodSet,...Ee(e)});class Co extends Ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.function)return ie(n,{code:ee.invalid_type,expected:le.function,received:n.parsedType}),we;function o(u,p){return vs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_s(),yo].filter(f=>!!f),issueData:{code:ee.invalid_arguments,argumentsError:p}})}function s(u,p){return vs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_s(),yo].filter(f=>!!f),issueData:{code:ee.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},d=n.data;if(this._def.returns instanceof wo){const u=this;return Et(async function(...p){const f=new Ot([]),m=await u._def.args.parseAsync(p,l).catch(E=>{throw f.addIssue(o(p,E)),f}),y=await Reflect.apply(d,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(E=>{throw f.addIssue(s(y,E)),f})})}else{const u=this;return Et(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Ot([o(p,f.error)]);const m=Reflect.apply(d,this,f.data),y=u._def.returns.safeParse(m,l);if(!y.success)throw new Ot([s(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Co({...this._def,args:Pn.create(e).rest($r.create())})}returns(e){return new Co({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new Co({args:e||Pn.create([]).rest($r.create()),returns:n||$r.create(),typeName:ve.ZodFunction,...Ee(o)})}}class ki 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})}}ki.create=(t,e)=>new ki({getter:t,typeName:ve.ZodLazy,...Ee(e)});class Si extends Ae{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:ee.invalid_literal,expected:this._def.value}),we}return{status:"valid",value:e.data}}get value(){return this._def.value}}Si.create=(t,e)=>new Si({value:t,typeName:ve.ZodLiteral,...Ee(e)});function qu(t,e){return new yr({values:t,typeName:ve.ZodEnum,...Ee(e)})}class yr extends Ae{constructor(){super(...arguments),gi.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{expected:Oe.joinValues(o),received:n.parsedType,code:ee.invalid_type}),we}if(ws(this,gi)||$u(this,gi,new Set(this._def.values)),!ws(this,gi).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{received:n.data,code:ee.invalid_enum_value,options:o}),we}return Et(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return yr.create(e,{...this._def,...n})}exclude(e,n=this._def){return yr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}gi=new WeakMap,yr.create=qu;class Ei extends Ae{constructor(){super(...arguments),yi.set(this,void 0)}_parse(e){const n=Oe.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==le.string&&o.parsedType!==le.number){const s=Oe.objectValues(n);return ie(o,{expected:Oe.joinValues(s),received:o.parsedType,code:ee.invalid_type}),we}if(ws(this,yi)||$u(this,yi,new Set(Oe.getValidEnumValues(this._def.values))),!ws(this,yi).has(e.data)){const s=Oe.objectValues(n);return ie(o,{received:o.data,code:ee.invalid_enum_value,options:s}),we}return Et(e.data)}get enum(){return this._def.values}}yi=new WeakMap,Ei.create=(t,e)=>new Ei({values:t,typeName:ve.ZodNativeEnum,...Ee(e)});class wo extends Ae{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.promise&&n.common.async===!1)return ie(n,{code:ee.invalid_type,expected:le.promise,received:n.parsedType}),we;const o=n.parsedType===le.promise?n.data:Promise.resolve(n.data);return Et(o.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}wo.create=(t,e)=>new wo({type:t,typeName:ve.ZodPromise,...Ee(e)});class dn extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:d=>{ie(o,d),d.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const d=s.transform(o.data,l);if(o.common.async)return Promise.resolve(d).then(async u=>{if(n.value==="aborted")return we;const p=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return p.status==="aborted"?we:p.status==="dirty"||n.value==="dirty"?Cs(p.value):p});{if(n.value==="aborted")return we;const u=this._def.schema._parseSync({data:d,path:o.path,parent:o});return u.status==="aborted"?we:u.status==="dirty"||n.value==="dirty"?Cs(u.value):u}}if(s.type==="refinement"){const d=u=>{const p=s.refinement(u,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?we:(u.status==="dirty"&&n.dirty(),d(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?we:(u.status==="dirty"&&n.dirty(),d(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!fi(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:o.data,path:o.path,parent:o}).then(d=>fi(d)?Promise.resolve(s.transform(d.value,l)).then(u=>({status:n.value,value:u})):d);Oe.assertNever(s)}}dn.create=(t,e,n)=>new dn({schema:t,typeName:ve.ZodEffects,effect:e,...Ee(n)}),dn.createWithPreprocess=(t,e,n)=>new dn({schema:e,effect:{type:"preprocess",transform:t},typeName:ve.ZodEffects,...Ee(n)});class Dn extends Ae{_parse(e){return this._getType(e)===le.undefined?Et(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Dn.create=(t,e)=>new Dn({innerType:t,typeName:ve.ZodOptional,...Ee(e)});class _r extends Ae{_parse(e){return this._getType(e)===le.null?Et(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}_r.create=(t,e)=>new _r({innerType:t,typeName:ve.ZodNullable,...Ee(e)});class Ti extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===le.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ti.create=(t,e)=>new Ti({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});class Bi extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return mi(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ot(o.common.issues)},input:o.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ot(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Bi.create=(t,e)=>new Bi({innerType:t,typeName:ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});class Es extends Ae{_parse(e){if(this._getType(e)!==le.nan){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:le.nan,received:n.parsedType}),we}return{status:"valid",value:e.data}}}Es.create=t=>new Es({typeName:ve.ZodNaN,...Ee(t)});const Zx=Symbol("zod_brand");class Bl extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class Ai extends Ae{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?we:s.status==="dirty"?(n.dirty(),Cs(s.value)):this._def.out._parseAsync({data:s.value,path:o.path,parent:o})})();{const s=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?we:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:o.path,parent:o})}}static create(e,n){return new Ai({in:e,out:n,typeName:ve.ZodPipeline})}}class Ni extends Ae{_parse(e){const n=this._def.innerType._parse(e),o=s=>(fi(s)&&(s.value=Object.freeze(s.value)),s);return mi(n)?n.then(s=>o(s)):o(n)}unwrap(){return this._def.innerType}}Ni.create=(t,e)=>new Ni({innerType:t,typeName:ve.ZodReadonly,...Ee(e)});function Ku(t,e={},n){return t?_o.create().superRefine((o,s)=>{var l,d;if(!t(o)){const u=typeof e=="function"?e(o):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})}}):_o.create()}const $x={object:et.lazycreate};var ve;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ve||(ve={}));const Ux=(t,e={message:`Input not instance of ${t.name}`})=>Ku(n=>n instanceof t,e),Yu=ln.create,Ju=fr.create,Wx=Es.create,Hx=mr.create,Xu=_i.create,jx=Zr.create,qx=bs.create,Kx=vi.create,Yx=Ci.create,Jx=_o.create,Xx=$r.create,Qx=$n.create,ek=xs.create,tk=cn.create,nk=et.create,rk=et.strictCreate,ok=wi.create,ik=ks.create,sk=bi.create,ak=Pn.create,lk=xi.create,ck=Ss.create,dk=Ur.create,uk=Co.create,pk=ki.create,hk=Si.create,fk=yr.create,mk=Ei.create,gk=wo.create,Qu=dn.create,yk=Dn.create,_k=_r.create,vk=dn.createWithPreprocess,Ck=Ai.create;var Fn=Object.freeze({__proto__:null,defaultErrorMap:yo,setErrorMap:Sx,getErrorMap:_s,makeIssue:vs,EMPTY_PATH:Ex,addIssueToContext:ie,ParseStatus:vt,INVALID:we,DIRTY:Cs,OK:Et,isAborted:kl,isDirty:Sl,isValid:fi,isAsync:mi,get util(){return Oe},get objectUtil(){return xl},ZodParsedType:le,getParsedType:hr,ZodType:Ae,datetimeRegex:ju,ZodString:ln,ZodNumber:fr,ZodBigInt:mr,ZodBoolean:_i,ZodDate:Zr,ZodSymbol:bs,ZodUndefined:vi,ZodNull:Ci,ZodAny:_o,ZodUnknown:$r,ZodNever:$n,ZodVoid:xs,ZodArray:cn,ZodObject:et,ZodUnion:wi,ZodDiscriminatedUnion:ks,ZodIntersection:bi,ZodTuple:Pn,ZodRecord:xi,ZodMap:Ss,ZodSet:Ur,ZodFunction:Co,ZodLazy:ki,ZodLiteral:Si,ZodEnum:yr,ZodNativeEnum:Ei,ZodPromise:wo,ZodEffects:dn,ZodTransformer:dn,ZodOptional:Dn,ZodNullable:_r,ZodDefault:Ti,ZodCatch:Bi,ZodNaN:Es,BRAND:Zx,ZodBranded:Bl,ZodPipeline:Ai,ZodReadonly:Ni,custom:Ku,Schema:Ae,ZodSchema:Ae,late:$x,get ZodFirstPartyTypeKind(){return ve},coerce:{string:t=>ln.create({...t,coerce:!0}),number:t=>fr.create({...t,coerce:!0}),boolean:t=>_i.create({...t,coerce:!0}),bigint:t=>mr.create({...t,coerce:!0}),date:t=>Zr.create({...t,coerce:!0})},any:Jx,array:tk,bigint:Hx,boolean:Xu,date:jx,discriminatedUnion:ik,effect:Qu,enum:fk,function:uk,instanceof:Ux,intersection:sk,lazy:pk,literal:hk,map:ck,nan:Wx,nativeEnum:mk,never:Qx,null:Yx,nullable:_k,number:Ju,object:nk,oboolean:()=>Xu().optional(),onumber:()=>Ju().optional(),optional:yk,ostring:()=>Yu().optional(),pipeline:Ck,preprocess:vk,promise:gk,record:lk,set:dk,strictObject:rk,string:Yu,symbol:qx,transformer:Qu,tuple:ak,undefined:Kx,union:ok,unknown:Xx,void:ek,NEVER:we,ZodIssueCode:ee,quotelessJson:kx,ZodError:Ot});function wk(t){throw new Error("Unexpected object: "+t)}const ep="upload://upload/",tp="index://index/";function bk(t){return t.startsWith(ep)}function xk(t){return t.startsWith(tp)}function np(t){if(xk(t)){const e=t.slice(tp.length);return JSON.parse(decodeURIComponent(e)).path}else if(bk(t)){const e=t.slice(ep.length);return JSON.parse(decodeURIComponent(e)).localPath}wk(t)}function kk(t){return t.replace(/^.*[\\/]/,"")}function Sk(t){return kk(np(t))}Fn.object({__isRef:Fn.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Fn.string().describe("Upstream block id"),name:Fn.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();const Ek=Fn.object({type:Fn.string(),importance:Fn.number().optional(),id:Fn.string().optional(),label:Fn.string()});Fn.array(Ek);const Tk={key:0,ref:"label"},Bk={key:0,class:"required-icon"},Ak=["data-placeholder"],Nk={key:5,class:"pl-file-input__stats"},Vk={key:0,class:"pl-file-input__error"},Pk={key:1,class:"pl-file-input__helper"},rp=r.defineComponent({__name:"PlFileInput",props:{modelValue:{},label:{default:void 0},required:{type:Boolean},dashed:{type:Boolean},extensions:{default:void 0},placeholder:{default:void 0},progress:{default:void 0},error:{default:void 0},helper:{default:void 0},cellStyle:{type:Boolean,default:!1},fileDialogTitle:{default:void 0},fileDialogCloseOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.reactive({fileDialogOpen:!1,error:""}),o=r.useSlots(),s=e,l=t,d=(G,$)=>{if(G)try{return $(G)}catch(L){return n.error=L instanceof Error?L.message:String(L),G}},u=r.computed(()=>d(l.modelValue,Sk)),p=r.computed(()=>d(l.modelValue,np)),f=r.computed(()=>l.progress&&!l.progress.done),m=r.computed(()=>l.progress&&l.progress.done),y=r.computed(()=>n.error??l.error),E=r.computed(()=>!!y.value),S=r.computed(()=>{const{status:G,done:$}=l.progress??{};return!G||!G.bytesTotal?"":G.bytesProcessed&&!$?nl(G.bytesProcessed,{})+" / "+nl(G.bytesTotal,{}):nl(G.bytesTotal,{})}),A=r.computed(()=>{var G;const{progress:$}=l;return $?{width:$.done?"100%":Math.round((((G=$.status)==null?void 0:G.progress)??0)*100)+"%"}:{}}),O=()=>{n.fileDialogOpen=!0},z=G=>{G.files.length&&s("update:modelValue",G.files[0])},C=()=>s("update:modelValue",void 0);r.watch(()=>l.modelValue,()=>{n.error=""},{immediate:!0});const R=r.ref();return l.cellStyle||zn(R),(G,$)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"pl-file-input__cell-style":!!G.cellStyle,"has-file":!!u.value},"pl-file-input__envelope"])},[r.createElementVNode("div",{ref_key:"rootRef",ref:R,class:r.normalizeClass(["pl-file-input",{dashed:G.dashed,error:E.value}]),tabindex:"0",onKeyup:r.withKeys(O,["enter"]),onClick:r.withModifiers(O,["stop"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(A.value)},null,4),$[3]||($[3]=r.createTextVNode()),!G.cellStyle&&G.label?(r.openBlock(),r.createElementBlock("label",Tk,[G.required?(r.openBlock(),r.createElementBlock("i",Bk)):r.createCommentVNode("",!0),$[1]||($[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(G.label),1),$[2]||($[2]=r.createTextVNode()),r.unref(o).tooltip||p.value?(r.openBlock(),r.createBlock(r.unref(St),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.unref(o).tooltip?r.renderSlot(G.$slots,"tooltip",{key:0}):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(p.value),1)],64))]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),$[4]||($[4]=r.createTextVNode()),E.value?(r.openBlock(),r.createBlock(r.unref(Zn),{key:1,name:"restart"})):f.value?(r.openBlock(),r.createBlock(r.unref(Zn),{key:2,name:"cloud-upload"})):m.value?(r.openBlock(),r.createBlock(r.unref(Zn),{key:3,name:"success"})):(r.openBlock(),r.createBlock(r.unref(Zn),{key:4,name:"paper-clip"})),$[5]||($[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":G.placeholder??"Choose file",class:"pl-file-input__filename"},r.toDisplayString(u.value),9,Ak),$[6]||($[6]=r.createTextVNode()),S.value?(r.openBlock(),r.createElementBlock("div",Nk,r.toDisplayString(S.value),1)):r.createCommentVNode("",!0),$[7]||($[7]=r.createTextVNode()),G.modelValue?(r.openBlock(),r.createBlock(r.unref(Zn),{key:6,name:"close",onClick:r.withModifiers(C,["stop"])})):r.createCommentVNode("",!0),$[8]||($[8]=r.createTextVNode()),r.createVNode(pr,{class:"pl-file-input__contour"})],34),$[9]||($[9]=r.createTextVNode()),E.value?(r.openBlock(),r.createElementBlock("div",Vk,r.toDisplayString(y.value),1)):G.helper?(r.openBlock(),r.createElementBlock("div",Pk,r.toDisplayString(G.helper),1)):r.createCommentVNode("",!0)],2),$[10]||($[10]=r.createTextVNode()),r.createVNode(r.unref(zu),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":$[0]||($[0]=L=>n.fileDialogOpen=L),extensions:G.extensions,title:G.fileDialogTitle,"close-on-outside-click":G.fileDialogCloseOnOutsideClick,"onImport:files":z},null,8,["modelValue","extensions","title","close-on-outside-click"])],64))}}),Dk={class:"pl-notification-alert__wrapper d-flex"},Fk={class:"pl-notification-alert__content flex-grow-1"},Rk={key:0,class:"pl-notification-alert__close"},Mk={key:0,class:"pl-notification-alert__actions d-flex"},op=r.defineComponent({__name:"PlNotificationAlert",props:r.mergeModels({type:{default:"neutral"},width:{default:"256px"},closable:{type:Boolean}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=r.useModel(t,"modelValue");function o(){e.closable&&(n.value=!1)}return(s,l)=>n.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([s.type,"pl-notification-alert d-flex flex-column gap-16"]),style:r.normalizeStyle({width:`${s.width}`})},[r.createElementVNode("div",Dk,[r.createElementVNode("div",Fk,[r.renderSlot(s.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),s.closable?(r.openBlock(),r.createElementBlock("div",Rk,[r.createVNode(r.unref(hl),{icon:"close",onClick:o})])):r.createCommentVNode("",!0)]),l[1]||(l[1]=r.createTextVNode()),s.$slots.actions?(r.openBlock(),r.createElementBlock("div",Mk,[r.renderSlot(s.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),Ik=r.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(t){const e=t;return r.provide(e.contextKey,r.computed(()=>e.context)),(n,o)=>r.renderSlot(n.$slots,"default")}});function Ct(t,e,n){return e>t?e:t>n?n:t}const Al=t=>r.computed(()=>{const e=[100],{min:n,max:o,step:s}=t.value;let l=n;for(;l<o;){l+=s;const d=(1-(Ct(l,n,o)-n)/(o-n))*100;e.push(d)}return e}),Ok={class:"ui-slider__wrapper"},Lk={class:"ui-slider__label-section"},Gk={key:0,class:"text-s"},zk={key:1,class:"ui-slider__value-static text-s"},Zk={class:"ui-slider__base"},$k={class:"ui-slider__container"},Uk={class:"ui-slider__container ui-slider__container-thumb"},Wk={class:"ui-slider__input-wrapper d-flex"},Hk=["value"],jk={key:0,class:"ui-slider__error"},ip=r.defineComponent({__name:"Slider",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,s=t,l=r.reactive({deltaValue:0}),d=r.computed(()=>s.max-s.min),u=r.computed(()=>Ct((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),y=Al(m),E=r.computed(()=>(u.value-s.min)/d.value),S=r.computed(()=>({right:Math.ceil((1-E.value)*100)+"%"})),A=r.computed(()=>({right:`calc(${Math.ceil((1-E.value)*100)}%) `})),O=r.ref(),z=r.ref();r.watch(()=>s.modelValue,L=>{p.value=L});function C(L){const J=Ct(L,s.min,s.max);return Math.round((J+Number.EPSILON)*(1/s.step))/(1/s.step)}cr(z,L=>{var J;lt((J=r.unref(O))==null?void 0:J.getBoundingClientRect(),H=>{const{dx:F}=L;l.deltaValue=F/H.width*d.value,p.value=C(Ct((s.modelValue??0)+l.deltaValue,s.min,s.max)),L.stop&&(o("update:modelValue",C(u.value)),l.deltaValue=0)})});function R(L){o("update:modelValue",C(L))}function G(L){R(+L.target.value)}function $(L){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(L.code)&&L.preventDefault();const J=L.code==="ArrowUp"||L.code==="ArrowRight"?s.step*1:L.code==="ArrowDown"||L.code==="ArrowLeft"?s.step*-1:0;R(s.modelValue+J)}return(L,J)=>(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",Ok,[r.createElementVNode("div",Lk,[L.label?(r.openBlock(),r.createElementBlock("label",Gk,[r.createElementVNode("span",null,r.toDisplayString(L.label),1),J[1]||(J[1]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(L.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),J[2]||(J[2]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",zk,r.toDisplayString(p.value)+r.toDisplayString(L.measure),1)):r.createCommentVNode("",!0)]),J[6]||(J[6]=r.createTextVNode()),r.createElementVNode("div",Zk,[r.createElementVNode("div",$k,[r.createElementVNode("div",{ref_key:"barRef",ref:O,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(S.value)},null,4)],512)]),J[5]||(J[5]=r.createTextVNode()),r.createElementVNode("div",Uk,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(y),(H,F)=>(r.openBlock(),r.createElementBlock("div",{key:F,style:r.normalizeStyle({right:`${H}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),J[4]||(J[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:z,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(A.value),onKeydown:$},J[3]||(J[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),J[7]||(J[7]=r.createTextVNode()),r.createElementVNode("div",Wk,[s.mode==="input"?(r.openBlock(),r.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:J[0]||(J[0]=H=>G(H))},null,40,Hk)):r.createCommentVNode("",!0)])],2),J[8]||(J[8]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",jk,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],2))}});function qk(t,e=null,n=null){function o(u){const{scrollTop:p,scrollHeight:f,clientHeight:m}=u;if(!(f>m)||!e)return null;const y=f-p-m,E=p>e?e:0,S=y>e?m-e-E:m;return`linear-gradient(
|
|
52
|
+
`,xC=["innerHTML"],kC={class:"dropdown-list-item__title-container"},SC={class:"dropdown-list-item__title text-s"},EC={key:0,class:"dropdown-list-item__description text-description"},TC={key:1,class:"dropdown-list-item__icon flex-self-start"},go=r.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>{const l=[];return e.size==="small"&&l.push("dropdown-list-item__small"),e.isSelected&&l.push("dropdown-list-item__selected"),e.isHovered&&l.push("hovered-item"),l.join(" ")}),o=r.computed(()=>{const l=["dropdown-list-item__checkbox","flex-self-start"];return e.isSelected&&l.push("checked"),l.join(" ")}),s=r.computed(()=>e.isSelected?bC:wC);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(o.value),innerHTML:s.value},null,10,xC)):r.createCommentVNode("",!0),d[1]||(d[1]=r.createTextVNode()),r.createElementVNode("div",kC,[r.createElementVNode("div",SC,r.toDisplayString(l.option.label),1),d[0]||(d[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",EC,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),d[2]||(d[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",TC)):r.createCommentVNode("",!0)],2))}});function yo(t,e){const n=ll(()=>{if(t.value){const{scrollTop:o,scrollLeft:s,scrollHeight:l,scrollWidth:d,clientHeight:u,clientWidth:p}=document.documentElement,f=t.value.getBoundingClientRect();e({scrollTop:o,scrollLeft:s,scrollHeight:l,scrollWidth:d,clientHeight:u,clientWidth:p,offsetY:o+f.y,offsetX:s+f.x,top:f.top,right:f.right,bottom:f.bottom,left:f.left,width:f.width,height:f.height,x:f.x,y:f.y})}});r.onMounted(n),rt(window,"scroll",n,{capture:!0,passive:!0}),rt(window,"resize",n,{passive:!0}),rt(window,"adjust",n,!0)}const BC=r.defineComponent({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--mask-size: 24px":""),o=r.computed(()=>`mask-16 mask-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,s.$style.icon])},null,6))}}),AC="_icon_1ugxm_2",NC={icon:AC},VC={$style:NC},ur=Kt(BC,[["__cssModules",VC]]),PC=["onKeyup"],DC=r.defineComponent({__name:"PlBtnSplit",props:r.mergeModels({options:{},disabled:{type:Boolean},loading:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:r.mergeModels(["click"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const o=t,s=n,l=r.useModel(t,"modelValue"),d=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(),m=r.reactive({open:!1,optionsHeight:0,activeIndex:-1});e({data:m});const y=r.reactive({top:"0px",left:"0px",width:"0px"});r.watch(u,I=>{if(I){const Y=I.getBoundingClientRect();m.optionsHeight=Y.height,window.dispatchEvent(new CustomEvent("adjust"))}},{immediate:!0});const B=r.computed(()=>m.open?"mask-24 mask-chevron-up":"mask-24 mask-chevron-down"),T=r.computed(()=>(o.options??[]).findIndex(I=>ui(I.value,l.value))),N=r.computed(()=>dr(o.options??[]).map((I,Y)=>({...I,index:Y,isSelected:Y===T.value,isActive:Y===m.activeIndex}))),M=r.computed(()=>o.loading||o.options===void 0),G=r.computed(()=>{var I;return((I=N.value.find(Y=>ui(Y.value,l.value)))==null?void 0:I.label)??(o.options===void 0?"...":"")});yo(d,I=>{const Y=I.top+I.height+3;Y+m.optionsHeight>I.clientHeight?y.top=I.top-m.optionsHeight-3+"px":y.top=Y+"px",y.left=I.left+"px",y.width=I.width+"px",console.log(I.top,y)});const C=I=>{var Y;l.value=I,m.open=!1,(Y=d==null?void 0:d.value)==null||Y.focus()};function F(){s("click")}const L=I=>{var Y,H;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(I.code))I.preventDefault();else return;if(I.target===f.value&&I.code==="Enter"){F();return}const{open:D,activeIndex:K}=m;if(!D&&I.target===p.value){I.code==="Enter"&&(m.open=!0);return}I.code==="Escape"&&(m.open=!1,(Y=d.value)==null||Y.focus());const U=r.unref(N),{length:X}=U;if(!X)return;I.code==="Enter"&&C((H=U.find(k=>k.index===K))==null?void 0:H.value);const O=U.findIndex(k=>k.index===K)??-1,E=I.code==="ArrowDown"?1:I.code==="ArrowUp"?-1:0,w=Math.abs(O+E+X)%X;m.activeIndex=N.value[w].index??-1},$=I=>{var Y,H;const D=I.relatedTarget;!((Y=d.value)!=null&&Y.contains(D))&&!((H=u.value)!=null&&H.contains(D))&&(m.open=!1)};return(I,Y)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:d,class:r.normalizeClass([{disabled:I.disabled||M.value,loading:M.value},"pl-btn-split d-flex"]),onFocusout:$,onKeydown:L},[r.createElementVNode("div",{ref_key:"buttonAction",ref:f,class:"pl-btn-split__title flex-grow-1 d-flex align-center text-s-btn",tabindex:"0",onClick:F,onKeyup:r.withKeys(r.withModifiers(F,["stop"]),["enter"])},r.toDisplayString(G.value),41,PC),Y[1]||(Y[1]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"menuActivator",ref:p,class:"pl-btn-split__icon-container d-flex align-center justify-center",tabindex:"0",onClick:Y[0]||(Y[0]=H=>m.open=!m.open)},[M.value?(r.openBlock(),r.createBlock(ur,{key:0,name:"loading"})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([B.value,"pl-btn-split__icon"])},null,2))],512),Y[2]||(Y[2]=r.createTextVNode()),m.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:u,class:"pl-dropdown__options",style:r.normalizeStyle(y),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(N.value,(H,D)=>(r.openBlock(),r.createBlock(go,{key:D,option:H,"is-selected":H.isSelected,"is-hovered":H.isActive,size:"medium",onClick:r.withModifiers(K=>C(H.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128))],4)])):r.createCommentVNode("",!0)],34))}});function Tu(t){function e(n){const o=n.currentTarget,s=document.createElement("span"),l=Math.max(o.clientWidth,o.clientHeight),d=l/2;s.style.width=s.style.height=`${l}px`,s.style.left=`${n.clientX-o.offsetLeft-d}px`,s.style.top=`${n.clientY-o.offsetTop-d}px`,s.classList.add("ripple");const u=o.getElementsByClassName("ripple")[0];u&&u.remove(),o.appendChild(s)}r.onMounted(()=>{var n;(n=t.value)==null||n.addEventListener("click",e)})}const FC={key:0},RC={inheritAttrs:!1},gs=r.defineComponent({...RC,__name:"BtnBase",props:{loading:{type:Boolean},small:{type:Boolean},large:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t,n=r.ref(),o=r.computed(()=>e.small||e.size==="small"),s=r.computed(()=>e.large||e.size==="large");return Tu(n),(l,d)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btn",ref:n,tabindex:"0",class:{loading:l.loading,small:o.value,large:s.value,round:l.round,reverse:l.reverse,justifyCenter:l.justifyCenter,[l.$attrs.class+""]:!0}},{...l.$attrs,disabled:!!l.$attrs.disabled||l.loading}),[l.round?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",FC,[r.renderSlot(l.$slots,"default")])),d[0]||(d[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(ur),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(ur),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),MC={name:"PlBtnPrimary"},pl=r.defineComponent({...MC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(gs,r.mergeProps({class:"pl-btn-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),IC={name:"PlBtnAccent"},OC=r.defineComponent({...IC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(gs,r.mergeProps({class:"pl-btn-accent"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),LC={name:"PlBtnDanger"},GC=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,o)=>(r.openBlock(),r.createBlock(gs,r.mergeProps({class:"pl-btn-danger"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),zC={name:"PlBtnSecondary"},hl=r.defineComponent({...zC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(gs,r.mergeProps(e,{class:"pl-btn-secondary"}),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),ZC={key:0},$C={name:"PlBtnGhost"},fl=r.defineComponent({...$C,props:{loading:{type:Boolean},size:{default:void 0},round:{type:Boolean},icon:{default:void 0},reverse:{type:Boolean},justifyCenter:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.size==="small"),o=r.computed(()=>e.size==="large"),s=r.ref(),l=r.useSlots();return Tu(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:o.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",ZC,[r.renderSlot(d.$slots,"default")])):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),d.loading?(r.openBlock(),r.createBlock(r.unref(ur),{key:1,name:"loading",size:d.size},null,8,["size"])):d.icon?(r.openBlock(),r.createBlock(r.unref(ur),{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))}}),UC=r.defineComponent({__name:"PlBtnLink",props:{loading:{type:Boolean},size:{},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean},disabled:{type:Boolean}},setup(t){const e=t,n=r.ref(!1);return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-link",{disabled:o.disabled,loading:o.loading,hover:n.value}]),onMouseover:s[0]||(s[0]=l=>n.value=!0),onMouseleave:s[1]||(s[1]=l=>n.value=!1)},[r.createVNode(hl,r.mergeProps({round:"",hover:n.value},e),null,16,["hover"]),s[2]||(s[2]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],34))}});function WC(t,e){const n=r.ref();return yo(t,o=>{n.value=o}),r.computed(()=>{const o=r.unref(n),s=r.unref(e),l=s.position??"top",d=s.gap??8;if(!o)return"";const u=o.offsetY+Math.floor(o.height/2),p=o.offsetX+Math.floor(o.width/2);return l==="top-left"?`left: ${o.offsetX}px; top: ${o.offsetY-d}px;`:l==="top"?`left: ${p}px; top: ${o.offsetY-d}px;`:l==="right"?`left: ${o.offsetX+o.width+d}px; top: ${u}px;`:l==="left"?`right: ${o.scrollWidth-o.x+d}px; top: ${u}px;`:""})}function hi(t,e){return e(t)}function lt(t,e){if(t!=null)return e(t)}function HC(t){return Array.isArray(t)?t:[t]}function jC(t,e,...n){n.forEach(o=>{t[o]=e[o]})}function ys(t,e){rt(document,"click",n=>{document.contains(n.target)&&(HC(t).map(o=>o.value).filter(o=>!!o).some(o=>o==null?void 0:o.contains(n.target))||e())})}const qC={},KC={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function YC(t,e){return r.openBlock(),r.createElementBlock("svg",KC,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 JC=Kt(qC,[["render",YC]]),ml=new Map,XC={name:"PlTooltip"},St=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,o=Symbol(),s=t,l=r.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});ml.set(o,()=>f()),r.watch(()=>l.open,M=>{requestAnimationFrame(()=>{l.tooltipOpen=M})});let d=()=>{};const u=bu(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(let[M,G]of ml.entries())M!==o&&G()},f=()=>{l.open=!1,n("tooltip:close")},m=async()=>{s.hide||(u(),l.over=!0,d(),await gu(100),l.over&&p())},y=()=>{l.over=!1,d=yu(()=>{l.over||f()},s.closeDelay)};r.watch(()=>s.hide,M=>{M&&f()});const B=r.ref(),T=r.ref(),N=WC(B,r.toRef(s));return ys([B,T],()=>f()),r.onUnmounted(()=>{ml.delete(o)}),(M,G)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(M.element),r.mergeProps(M.$attrs,{ref_key:"rootRef",ref:B,onClick:m,onMouseover:m,onMouseleave:y}),{default:r.withCtx(()=>[r.renderSlot(M.$slots,"default"),G[1]||(G[1]=r.createTextVNode()),M.$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(N))},[r.createElementVNode("div",{ref_key:"tooltip",ref:T,class:r.normalizeClass(["pl-tooltip",M.position]),onMouseover:m,onMouseleave:y},[r.createElementVNode("div",null,[r.renderSlot(M.$slots,"tooltip")]),G[0]||(G[0]=r.createTextVNode()),r.createVNode(JC)],34)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),QC={},e0={class:"inner-border"};function t0(t,e,n,o,s,l){return r.openBlock(),r.createElementBlock("div",e0,[r.renderSlot(t.$slots,"default")])}const n0=Kt(QC,[["render",t0]]),r0={key:0},o0=["tabindex","onKeydown","onClick"],i0={key:1,class:"pl-btn-group__helper"},s0={key:2,class:"pl-btn-group__error"},a0={name:"PlBtnGroup"},l0=r.defineComponent({...a0,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},compact:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,s=u=>o("update:modelValue",u),l=t,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(["pl-btn-group",{disabled:u.disabled,compact:u.compact}])},[u.label?(r.openBlock(),r.createElementBlock("label",r0,[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(St),{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(n0,{class:"pl-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(["pl-btn-group__option text-s",{active:u.modelValue===f.value}]),tabindex:u.modelValue===f.value||u.disabled?void 0:0,onKeydown:r.withKeys(y=>s(f.value),["enter"]),onClick:y=>s(f.value)},r.toDisplayString(f.label),43,o0))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),u.helper?(r.openBlock(),r.createElementBlock("div",i0,r.toDisplayString(u.helper),1)):u.error?(r.openBlock(),r.createElementBlock("div",s0,r.toDisplayString(u.error),1)):r.createCommentVNode("",!0)],2))}}),c0={inheritAttrs:!1},d0={class:"double-contour"};function u0(t,e,n,o,s,l){return r.openBlock(),r.createElementBlock("div",d0,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const pr=Kt(c0,[["render",u0]]);function Bu(t){r.onMounted(t),r.onUpdated(t)}const gl=new WeakMap,yl=new ResizeObserver(t=>{for(const e of t)lt(gl.get(e.target),n=>n(e))});function Au(t,e){gl.set(t,e),yl.unobserve(t),yl.observe(t)}function Nu(t){yl.unobserve(t),gl.delete(t)}const p0=8,Vu=4;function zn(t,e="label"){const n=new Set;Bu(()=>{lt(t==null?void 0:t.value,o=>{const s=o.querySelector(e);s&&(n.add(s),Au(s,()=>{const l=mu(()=>s.getBoundingClientRect().width+hi(p0,d=>Number.isNaN(d)?Vu:d+Vu));o.style.getPropertyValue("--label-offset-right-x")!==`${l}px`&&o.style.setProperty("--label-offset-right-x",`${l}px`)}))})}),r.onBeforeUnmount(()=>{Array.from(n.values()).map(o=>Nu(o))})}function h0(t,e){const n=[];return e&&e.length>0&&e.forEach(o=>{const s=o(t);typeof s=="string"&&n.push(s)}),{isValid:n.length===0,errors:n}}function Pu(t,e){return r.computed(()=>h0(t.value,e))}const f0=r.defineComponent({__name:"PlIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--icon-size: 24px":""),o=r.computed(()=>`icon-16 icon-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,s.$style.icon])},null,6))}}),m0="_icon_1ugxm_2",g0={icon:m0},y0={$style:g0},_s=Kt(f0,[["__cssModules",y0]]),_0=r.defineComponent({__name:"PlIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`icon-24 icon-${e.name}`);return(o,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),v0="_icon_1ugxm_2",C0={icon:v0},w0={$style:C0},Du=Kt(_0,[["__cssModules",w0]]),b0={class:"pl-text-field__envelope"},x0={key:0,ref:"label"},k0={key:0,class:"required-icon"},S0={key:1,class:"pl-text-field__prefix"},E0=["disabled","placeholder","type"],T0={class:"pl-text-field__append"},B0={key:0,class:"pl-text-field__error"},A0={key:1,class:"pl-text-field__helper"},N0={name:"PlTextField"},hr=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"),o=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($){if(u.cached=void 0,o.parse)try{n.value=o.parse($)}catch(I){u.cached={error:I instanceof Error?I.message:String(I),value:$}}else n.value=$}}),f=r.computed(()=>o.type&&o.type==="password"?d.value?"text":o.type:"text"),m=r.computed(()=>d.value?"view-show":"view-hide"),y=()=>{o.clearable&&(u.cached=void 0,n.value=o.clearable===!0?"":o.clearable())},B=Pu(p,o.rules||[]),T=r.computed(()=>o.clearable?o.clearable===!0?n.value==="":n.value===o.clearable():n.value===""),N=r.computed(()=>!T.value),M=r.computed(()=>{const $=[];return o.error&&$.push(o.error),u.cached&&$.push(u.cached.error),B.value.isValid||$.push(...B.value.errors),$}),G=r.computed(()=>M.value.length>0),C=r.computed(()=>o.clearable&&N.value&&o.type!=="password"),F=()=>d.value=!d.value,L=()=>{u.cached=void 0};return zn(s),($,I)=>(r.openBlock(),r.createElementBlock("div",b0,[r.createElementVNode("div",{ref_key:"rootRef",ref:s,class:r.normalizeClass(["pl-text-field",{error:G.value,disabled:$.disabled,dashed:$.dashed,nonEmpty:N.value}])},[$.label?(r.openBlock(),r.createElementBlock("label",x0,[$.required?(r.openBlock(),r.createElementBlock("i",k0)):r.createCommentVNode("",!0),I[1]||(I[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString($.label),1),I[2]||(I[2]=r.createTextVNode()),r.unref(e).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot($.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),I[5]||(I[5]=r.createTextVNode()),$.prefix?(r.openBlock(),r.createElementBlock("div",S0,r.toDisplayString($.prefix),1)):r.createCommentVNode("",!0),I[6]||(I[6]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":I[0]||(I[0]=Y=>p.value=Y),disabled:$.disabled,placeholder:$.placeholder||"...",type:f.value,spellcheck:"false",onFocusout:L},null,40,E0),[[r.vModelDynamic,p.value]]),I[7]||(I[7]=r.createTextVNode()),r.createElementVNode("div",T0,[C.value?(r.openBlock(),r.createBlock(r.unref(_s),{key:0,class:"pl-text-field__clearable",name:"delete-clear",onClick:y})):r.createCommentVNode("",!0),I[3]||(I[3]=r.createTextVNode()),$.type==="password"?(r.openBlock(),r.createBlock(r.unref(Du),{key:1,name:m.value,style:{cursor:"pointer"},onClick:F},null,8,["name"])):r.createCommentVNode("",!0),I[4]||(I[4]=r.createTextVNode()),r.renderSlot($.$slots,"append")]),I[8]||(I[8]=r.createTextVNode()),r.createVNode(pr,{class:"pl-text-field__contour"})],2),I[9]||(I[9]=r.createTextVNode()),G.value?(r.openBlock(),r.createElementBlock("div",B0,r.toDisplayString(M.value.join(" ")),1)):$.helper?(r.openBlock(),r.createElementBlock("div",A0,r.toDisplayString($.helper),1)):r.createCommentVNode("",!0)]))}}),V0={class:"ui-text-area__envelope"},P0={key:0,ref:"label"},D0={key:0,class:"required-icon"},F0=["readonly","rows","disabled","placeholder"],R0={class:"ui-text-area__append"},M0={key:0,class:"ui-text-area__error"},I0={key:1,class:"ui-text-area__helper"},O0={name:"PlTextArea"},L0=r.defineComponent({...O0,props:{modelValue:{},label:{},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},dashed:{type:Boolean},rows:{},autogrow:{type:Boolean},rules:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,s=t,l=r.ref(),d=r.ref(),u=r.computed({get(){return s.modelValue??""},set(T){o("update:modelValue",T)}}),p=r.computed(()=>!!s.modelValue),f=Pu(u,s.rules||[]);zn(l);const m=r.computed(()=>{const T=[];return s.error&&T.push(s.error),T.push(...f.value.errors),T}),y=r.computed(()=>m.value.length>0),B=()=>{if(!s.autogrow)return;const T=d.value;T&&(T.style.height="auto",T.style.height=`${T.scrollHeight}px`)};return r.onMounted(()=>{B()}),(T,N)=>(r.openBlock(),r.createElementBlock("div",V0,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:y.value,disabled:T.disabled,dashed:T.dashed,nonEmpty:p.value}])},[T.label?(r.openBlock(),r.createElementBlock("label",P0,[T.required?(r.openBlock(),r.createElementBlock("i",D0)):r.createCommentVNode("",!0),N[1]||(N[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(T.label),1),N[2]||(N[2]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(T.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),N[3]||(N[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:d,"onUpdate:modelValue":N[0]||(N[0]=M=>u.value=M),readonly:T.readonly,rows:T.rows,disabled:T.disabled,placeholder:T.placeholder??"...",spellcheck:"false",onInput:B},null,40,F0),[[r.vModelText,u.value]]),N[4]||(N[4]=r.createTextVNode()),r.createElementVNode("div",R0,[r.renderSlot(T.$slots,"append")]),N[5]||(N[5]=r.createTextVNode()),r.createVNode(pr,{class:"ui-text-area__contour"})],2),N[6]||(N[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",M0,r.toDisplayString(m.value.join(" ")),1)):T.helper?(r.openBlock(),r.createElementBlock("div",I0,r.toDisplayString(T.helper),1)):r.createCommentVNode("",!0)]))}});function Fu(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<o+n&&s>n}function Ru(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<o+n?"ceil":s>n?"floor":"visible"}function fi(t,e,n={}){const o=t.scrollTop,s=t.getBoundingClientRect().height,l=e.getBoundingClientRect().height,d=e.offsetTop,u=Ru(t,e);if(u==="visible")return;const p=f=>{const m=u==="floor"?d-(s-l):d;t.scrollTop=o+f*(m-o)};Fu(t,e)||Cu({duration:n.duration||100,timing:vu(f=>f),draw:p})}function _l(t,e,n,o){return t.addEventListener(e,n,o),function(){t.removeEventListener(e,n)}}function G0(t,e){const n=e.getBoundingClientRect();return t.x<n.x||t.x>n.x+n.width||t.y<n.y||t.y>n.y+n.height}function Mu(t){return t!==null&&typeof t=="object"}function Pt(t,e){return Mu(t)&&Mu(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Pt(t[n],e[n])):t===e}function vl(t,e){return t.some(n=>Pt(n,e))}const Cl=r.defineComponent({__name:"LongText",setup(t){r.useCssVars(m=>({"8d68520c":d.value}));const e=r.ref(!1),n=r.ref(),o=r.ref(!1),s=r.computed(()=>o.value&&e.value?"ui-lt-animate":""),l=wu(m=>o.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=al(n.value,"span cannot be empty");e.value=m.clientWidth<m.scrollWidth}function p(){u(),l(!0)}function f(){l(!1)}return(m,y)=>(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))}}),z0=r.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`mask-24 mask-${e.name}`);return(o,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),Z0="_icon_1ugxm_2",$0={icon:Z0},U0={$style:$0},Zn=Kt(z0,[["__cssModules",U0]]),W0={class:"pl-dropdown__envelope"},H0=["tabindex"],j0={class:"pl-dropdown__container"},q0={class:"pl-dropdown__field"},K0=["disabled","placeholder"],Y0={class:"pl-dropdown__controls"},J0={key:0},X0={key:0,class:"required-icon"},Q0={key:0,class:"nothing-found"},ew={key:0,class:"pl-dropdown__error"},tw={key:1,class:"pl-dropdown__helper"},nw={key:2,class:"pl-dropdown__helper"},rw={name:"PlDropdown"},mi=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,o=t,s=r.useSlots(),l=r.ref(),d=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),f=()=>hi(L.value.findIndex(w=>Pt(w.value,o.modelValue)),w=>w<0?0:w),m=()=>p.activeIndex=f(),y=r.computed(()=>o.options===void 0),B=r.computed(()=>y.value?!0:o.disabled),T=r.computed(()=>(o.options??[]).findIndex(w=>Pt(w.value,o.modelValue))),N=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&T.value===-1)return"The selected value is not one of the options"}}),M=r.computed(()=>dr(o.options??[]).map((w,k)=>({...w,index:k,isSelected:k===T.value,isActive:k===p.activeIndex}))),G=r.computed(()=>{const w=r.unref(M).find(k=>Pt(k.value,o.modelValue));return(w==null?void 0:w.label)||o.modelValue}),C=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(G.value):o.placeholder),F=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),L=r.computed(()=>{const w=M.value;return p.search?w.filter(k=>{const Z=p.search.toLowerCase();return k.label.toLowerCase().includes(Z)||k.description&&k.description.toLowerCase().includes(Z)?!0:typeof k.value=="string"?k.value.toLowerCase().includes(Z):k.value===p.search}):w}),$=r.computed(()=>B.value?void 0:"0"),I=w=>{var k;n("update:modelValue",w),p.search="",p.open=!1,(k=l==null?void 0:l.value)==null||k.focus()},Y=()=>n("update:modelValue",void 0),H=()=>{var w;return(w=u.value)==null?void 0:w.focus()},D=()=>p.open=!p.open,K=()=>p.open=!0,U=w=>{var k,Z;const te=w.relatedTarget;!((k=l.value)!=null&&k.contains(te))&&!((Z=d.value)!=null&&Z.contains(te))&&(p.search="",p.open=!1)},X=()=>{const w=d.value;w&<(w.querySelector(".hovered-item"),k=>{fi(w,k)})},O=w=>{var k,Z;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(w.code))w.preventDefault();else return;const{open:te,activeIndex:ne}=p;if(!te){w.code==="Enter"&&(p.open=!0);return}w.code==="Escape"&&(p.open=!1,(k=l.value)==null||k.focus());const be=r.unref(L),{length:Ze}=be;if(!Ze)return;w.code==="Enter"&&I((Z=be.find(xr=>xr.index===ne))==null?void 0:Z.value);const ot=be.findIndex(xr=>xr.index===ne)??-1,vn=w.code==="ArrowDown"?1:w.code==="ArrowUp"?-1:0,Rn=Math.abs(ot+vn+Ze)%Ze;p.activeIndex=L.value[Rn].index??-1};zn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,w=>{var k;return w?(k=u.value)==null?void 0:k.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&X()});const E=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(d,w=>{if(w){const k=w.getBoundingClientRect();p.optionsHeight=k.height,window.dispatchEvent(new CustomEvent("adjust"))}}),yo(l,w=>{const k=w.top+w.height+3;k+p.optionsHeight>w.clientHeight?E.top=w.top-p.optionsHeight-3+"px":E.top=k+"px",E.left=w.left+"px",E.width=w.width+"px"}),(w,k)=>(r.openBlock(),r.createElementBlock("div",W0,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:$.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:w.error,disabled:B.value}]),onKeydown:O,onFocusout:U},[r.createElementVNode("div",j0,[r.createElementVNode("div",q0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":k[0]||(k[0]=Z=>p.search=Z),type:"text",tabindex:"-1",disabled:B.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:K},null,40,K0),[[r.vModelText,p.search]]),k[4]||(k[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:H},[r.createVNode(Cl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(G.value),1)]),_:1})])),k[5]||(k[5]=r.createTextVNode()),r.createElementVNode("div",Y0,[y.value?(r.openBlock(),r.createBlock(r.unref(Zn),{key:0,name:"loading"})):r.createCommentVNode("",!0),k[1]||(k[1]=r.createTextVNode()),w.clearable&&F.value?(r.openBlock(),r.createBlock(r.unref(_s),{key:1,name:"delete-clear",onClick:r.withModifiers(Y,["stop"])})):r.createCommentVNode("",!0),k[2]||(k[2]=r.createTextVNode()),r.renderSlot(w.$slots,"append"),k[3]||(k[3]=r.createTextVNode()),w.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${w.arrowIconLarge}`]]),onClick:r.withModifiers(D,["stop"])},null,2)):w.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${w.arrowIcon}`]]),onClick:r.withModifiers(D,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(D,["stop"])}))])]),k[9]||(k[9]=r.createTextVNode()),w.label?(r.openBlock(),r.createElementBlock("label",J0,[w.required?(r.openBlock(),r.createElementBlock("i",X0)):r.createCommentVNode("",!0),k[6]||(k[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(w.label),1),k[7]||(k[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(w.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),k[10]||(k[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:d,class:"pl-dropdown__options",style:r.normalizeStyle(E),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(L.value,(Z,te)=>(r.openBlock(),r.createBlock(go,{key:te,option:Z,"is-selected":Z.isSelected,"is-hovered":Z.isActive,size:w.optionSize,onClick:r.withModifiers(ne=>I(Z.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),k[8]||(k[8]=r.createTextVNode()),L.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Q0,"Nothing found"))],4)])):r.createCommentVNode("",!0),k[11]||(k[11]=r.createTextVNode()),r.createVNode(pr,{class:"pl-dropdown__contour"})])],42,H0),k[12]||(k[12]=r.createTextVNode()),N.value?(r.openBlock(),r.createElementBlock("div",ew,r.toDisplayString(N.value),1)):y.value&&w.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",tw,r.toDisplayString(w.loadingOptionsHelper),1)):w.helper?(r.openBlock(),r.createElementBlock("div",nw,r.toDisplayString(w.helper),1)):r.createCommentVNode("",!0)]))}}),ow={name:"PlDropdownRef"},iw=r.defineComponent({...ow,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>{var s;return(s=e.options)==null?void 0:s.map(l=>({label:l.label,value:l.ref}))}),o=r.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(s,l)=>(r.openBlock(),r.createBlock(r.unref(mi),r.mergeProps(e,{options:n.value,"loading-options-helper":s.loadingOptionsHelper,"arrow-icon-large":o.value,"onUpdate:modelValue":l[0]||(l[0]=d=>s.$emit("update:modelValue",d))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function sw(t,e){return r.computed(()=>{const n=dr(t.value);return e.value?n.filter(o=>o.label.toLowerCase().includes(e.value.toLowerCase())):n})}const aw={class:"resizable-input"},lw=["placeholder","value","disabled"],cw=r.defineComponent({__name:"ResizableInput",props:{modelValue:{},placeholder:{},value:{},disabled:{type:Boolean},maxWidth:{},width:{}},emits:["input","update:modelValue"],setup(t,{emit:e}){const n=t,o=e,s=r.computed(()=>{var u;return n.placeholder?n.placeholder:(u=n.modelValue||n.value)==null?void 0:u.replace('"',"")}),l=r.computed(()=>{const u={};return n.width&&(u.width=n.width),n.maxWidth&&(u.maxWidth=n.maxWidth),u});function d(u){const p=u.target.value;o("update:modelValue",p)}return(u,p)=>(r.openBlock(),r.createElementBlock("div",aw,[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,lw)]))}}),dw={class:"dropdown-tab-item__title text-caps13"},uw=r.defineComponent({__name:"TabItem",props:{option:{},isSelected:{type:Boolean,default:!1},isHovered:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.option.label),o=r.computed(()=>{const s=[];return e.isSelected&&s.push("dropdown-tab-item__selected"),e.isHovered&&s.push("hovered-item"),s.join(" ")});return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([o.value,"dropdown-tab-item"])},[r.createElementVNode("div",dw,r.toDisplayString(n.value),1)],2))}}),pw={class:"pl-line-dropdown__prefix"},hw={class:"pl-line-dropdown__icon-wrapper"},fw={class:"pl-line-dropdown__icon"},mw={key:0,class:"pl-line-dropdown__no-item"},gw={key:0,class:"pl-line-dropdown__no-item"},Iu=r.defineComponent({__name:"PlDropdownLine",props:{modelValue:{},disabled:{type:Boolean},prefix:{default:""},options:{},placeholder:{default:"Select.."},mode:{default:"list"},tabsContainerStyles:{type:[Boolean,null,String,Object,Array],default:void 0},clearable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,s=r.reactive({isOpen:!1,activeOption:-1,optionsHeight:0}),l=r.ref(),d=r.ref(),u=r.computed(()=>{const U=[];return s.isOpen&&U.push("open"),o.disabled&&U.push("disabled"),U.join(" ")}),p=r.ref(""),f=sw(r.toRef(o,"options"),p),m=r.computed(()=>!!(o.clearable&&s.isOpen&&o.modelValue&&y.value)),y=r.computed(()=>{if(o.modelValue){const U=N();if(U!==-1){const X=dr(o.options)[U];return typeof X.label=="object"?X.label.title:X.label}}return""}),B=r.ref(y.value),T=r.computed(()=>s.isOpen&&p.value&&p.value.length>=y.value.length-1?p.value:y.value??"...");ys(l,()=>{o.mode==="list"&&(s.isOpen=!1)}),r.watch(()=>B.value,U=>{y.value!==U?p.value=U:p.value=""}),r.watch(()=>s.isOpen,U=>{var X;U&&l.value&&((X=l.value.querySelector("input"))==null||X.focus(),r.nextTick(()=>H()))}),r.watch(()=>o.modelValue,()=>M(),{immediate:!0});function N(){return o.options.findIndex(U=>Pt(U.value,o.modelValue))}function M(){s.activeOption=hi(f.value.findIndex(U=>Pt(U.value,o.modelValue)),U=>U<0?0:U),B.value=y.value}function G(){p.value=""}function C(){o.disabled?s.isOpen=!1:r.nextTick(()=>{s.isOpen=!s.isOpen})}function F(){o.mode==="list"&&(s.isOpen=!1)}function L(U){U&&(n("update:modelValue",U.value),F(),G())}function $(U){return Pt(U.value,o.modelValue)}const I=U=>{var X,O;const E=U.relatedTarget;!((X=l.value)!=null&&X.contains(E))&&!((O=d.value)!=null&&O.contains(E))&&(p.value="",s.isOpen=!1)};function Y(U){const{activeOption:X}=s;if(!s.isOpen&&U.code==="Enter"){s.isOpen=!0;return}const{length:O}=f.value;if(!O)return;["ArrowDown","ArrowUp","Enter"].includes(U.code)&&U.preventDefault(),U.code==="Enter"&&L(f.value[X]);const E=U.code==="ArrowDown"?1:U.code==="ArrowUp"?-1:0;s.activeOption=Math.abs(X+E+O)%O,requestAnimationFrame(H)}function H(){const U=d.value;U&<(U.querySelector(".hovered-item"),X=>{o.mode==="list"?fi(U,X):X.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function D(){n("update:modelValue",void 0)}const K=r.reactive({top:"0px",left:"0px"});return r.watch(d,U=>{if(U){const X=U.getBoundingClientRect();s.optionsHeight=X.height,window.dispatchEvent(new CustomEvent("adjust"))}}),yo(l,U=>{const X=U.top+U.height+2;X+s.optionsHeight>U.clientHeight?K.top=U.top-s.optionsHeight-2+"px":K.top=X+"px",K.left=U.left+"px"}),(U,X)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([u.value,"pl-line-dropdown uc-pointer"]),onKeydown:Y,onFocusout:I,onClick:C},[r.createElementVNode("div",pw,r.toDisplayString(o==null?void 0:o.prefix),1),X[6]||(X[6]=r.createTextVNode()),r.createVNode(cw,{modelValue:B.value,"onUpdate:modelValue":X[0]||(X[0]=O=>B.value=O),placeholder:T.value,disabled:o.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),X[7]||(X[7]=r.createTextVNode()),r.createElementVNode("div",hw,[r.withDirectives(r.createElementVNode("div",fw,null,512),[[r.vShow,!m.value]]),X[1]||(X[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:D},null,512),[[r.vShow,m.value]])]),X[8]||(X[8]=r.createTextVNode()),s.isOpen?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[o.mode==="list"?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"list",ref:d,style:r.normalizeStyle(K),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:I},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(O,E)=>r.renderSlot(U.$slots,"item",{key:E,item:O,textItem:"text",isSelected:$(O),isHovered:s.activeOption==E,onClick:r.withModifiers(w=>L(O),["stop"])},()=>[r.createVNode(go,{option:O,"text-item":"text","is-selected":$(O),"is-hovered":s.activeOption==E,size:"medium",onClick:r.withModifiers(w=>L(O),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),X[3]||(X[3]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",mw,X[2]||(X[2]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):o.mode==="tabs"?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:d,style:r.normalizeStyle(K),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:I},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(O,E)=>r.renderSlot(U.$slots,"item",{key:E,item:O,isSelected:$(O),isHovered:s.activeOption==E,onClick:r.withModifiers(w=>L(O),["stop"])},()=>[r.createVNode(uw,{option:O,"is-selected":$(O),"is-hovered":s.activeOption==E,onClick:r.withModifiers(w=>L(O),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),X[5]||(X[5]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",gw,X[4]||(X[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))}}),yw={class:"ui-dropdown__envelope"},_w=["tabindex"],vw={class:"ui-dropdown__container"},Cw={class:"ui-dropdown__field"},ww=["disabled","placeholder"],bw={class:"ui-dropdown__controls"},xw={key:0},kw={key:0,class:"required-icon"},Sw={key:0,class:"nothing-found"},Ew={key:0,class:"ui-dropdown__error"},Tw={key:1,class:"ui-dropdown__helper"},Bw={key:2,class:"ui-dropdown__helper"},Aw={name:"PlDropdown"},Nw=r.defineComponent({...Aw,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,s=r.useSlots(),l=r.ref(),d=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1}),f=()=>hi(L.value.findIndex(E=>Pt(E.value,o.modelValue)),E=>E<0?0:E),m=()=>p.activeIndex=f(),y=r.computed(()=>o.options===void 0),B=r.computed(()=>y.value?!0:o.disabled),T=r.computed(()=>(o.options??[]).findIndex(E=>Pt(E.value,o.modelValue))),N=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&T.value===-1)return"The selected value is not one of the options"}}),M=r.computed(()=>dr(o.options??[]).map((E,w)=>({...E,index:w,isSelected:w===T.value,isActive:w===p.activeIndex}))),G=r.computed(()=>{const E=r.unref(M).find(w=>Pt(w.value,o.modelValue));return(E==null?void 0:E.label)||o.modelValue}),C=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(G.value):o.placeholder),F=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),L=r.computed(()=>{const E=M.value;return p.search?E.filter(w=>{const k=p.search.toLowerCase();return w.label.toLowerCase().includes(k)||w.description&&w.description.toLowerCase().includes(k)?!0:typeof w.value=="string"?w.value.toLowerCase().includes(k):w.value===p.search}):E}),$=r.computed(()=>B.value?void 0:"0"),I=E=>{var w;n("update:modelValue",E),p.search="",p.open=!1,(w=l==null?void 0:l.value)==null||w.focus()},Y=()=>n("update:modelValue",void 0),H=()=>{var E;return(E=u.value)==null?void 0:E.focus()},D=()=>p.open=!p.open,K=()=>p.open=!0,U=E=>{var w;(w=l==null?void 0:l.value)!=null&&w.contains(E.relatedTarget)||(p.search="",p.open=!1)},X=()=>{const E=d.value;E&<(E.querySelector(".hovered-item"),w=>{fi(E,w)})},O=E=>{var w,k;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(E.code))E.preventDefault();else return;const{open:Z,activeIndex:te}=p;if(!Z){E.code==="Enter"&&(p.open=!0);return}E.code==="Escape"&&(p.open=!1,(w=l.value)==null||w.focus());const ne=r.unref(L),{length:be}=ne;if(!be)return;E.code==="Enter"&&I((k=ne.find(Rn=>Rn.index===te))==null?void 0:k.value);const Ze=ne.findIndex(Rn=>Rn.index===te)??-1,ot=E.code==="ArrowDown"?1:E.code==="ArrowUp"?-1:0,vn=Math.abs(Ze+ot+be)%be;p.activeIndex=L.value[vn].index??-1};return zn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,E=>{var w;return E?(w=u.value)==null?void 0:w.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&X()}),(E,w)=>(r.openBlock(),r.createElementBlock("div",yw,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:$.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:E.error,disabled:B.value}]),onKeydown:O,onFocusout:U},[r.createElementVNode("div",vw,[r.createElementVNode("div",Cw,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":w[0]||(w[0]=k=>p.search=k),type:"text",tabindex:"-1",disabled:B.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:K},null,40,ww),[[r.vModelText,p.search]]),w[4]||(w[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:H},[r.createVNode(Cl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(G.value),1)]),_:1})])),w[5]||(w[5]=r.createTextVNode()),r.createElementVNode("div",bw,[y.value?(r.openBlock(),r.createBlock(r.unref(Zn),{key:0,name:"loading"})):r.createCommentVNode("",!0),w[1]||(w[1]=r.createTextVNode()),E.clearable&&F.value?(r.openBlock(),r.createBlock(r.unref(_s),{key:1,name:"delete-clear",onClick:r.withModifiers(Y,["stop"])})):r.createCommentVNode("",!0),w[2]||(w[2]=r.createTextVNode()),r.renderSlot(E.$slots,"append"),w[3]||(w[3]=r.createTextVNode()),E.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${E.arrowIconLarge}`]]),onClick:r.withModifiers(D,["stop"])},null,2)):E.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${E.arrowIcon}`]]),onClick:r.withModifiers(D,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(D,["stop"])}))])]),w[9]||(w[9]=r.createTextVNode()),E.label?(r.openBlock(),r.createElementBlock("label",xw,[E.required?(r.openBlock(),r.createElementBlock("i",kw)):r.createCommentVNode("",!0),w[6]||(w[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(E.label),1),w[7]||(w[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(E.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),w[10]||(w[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(L.value,(k,Z)=>(r.openBlock(),r.createBlock(go,{key:Z,option:k,"is-selected":k.isSelected,"is-hovered":k.isActive,size:E.optionSize,onClick:r.withModifiers(te=>I(k.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),w[8]||(w[8]=r.createTextVNode()),L.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Sw,"Nothing found"))],512)):r.createCommentVNode("",!0),w[11]||(w[11]=r.createTextVNode()),r.createVNode(pr,{class:"ui-dropdown__contour"})])],42,_w),w[12]||(w[12]=r.createTextVNode()),N.value?(r.openBlock(),r.createElementBlock("div",Ew,r.toDisplayString(N.value),1)):y.value&&E.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",Tw,r.toDisplayString(E.loadingOptionsHelper),1)):E.helper?(r.openBlock(),r.createElementBlock("div",Bw,r.toDisplayString(E.helper),1)):r.createCommentVNode("",!0)]))}}),Vw={key:0,class:"ui-progress-bar"},Pw={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},Dw={class:"ui-progress-bar__message flex-grow-1"},Fw={class:"ui-progress-bar__percent"},Rw=r.defineComponent({__name:"PlProgressBar",props:{loading:{type:Boolean},progress:{default:0},completeMessage:{default:"Completed"}},setup(t){const e=t,n=r.computed(()=>e.progress===100?e.completeMessage:"");return(o,s)=>o.loading?(r.openBlock(),r.createElementBlock("div",Vw,[r.createElementVNode("div",{class:"ui-progress-bar__indicator",style:r.normalizeStyle({width:o.progress+"%"})},null,4),s[1]||(s[1]=r.createTextVNode()),r.createElementVNode("div",Pw,[r.createElementVNode("div",Dw,r.toDisplayString(n.value),1),s[0]||(s[0]=r.createTextVNode()),r.createElementVNode("div",Fw,r.toDisplayString(o.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),Mw={class:"mi-number-field__main-wrapper d-flex"},Iw={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},Ow={key:0,class:"text-description"},Lw=["disabled","placeholder"],Gw={class:"mi-number-field__icons d-flex-column"},zw={key:0,class:"mi-number-field__hint text-description"},Zw=r.defineComponent({__name:"PlNumberField",props:{modelValue:{},disabled:{type:Boolean},label:{default:void 0},placeholder:{default:void 0},step:{default:1},minValue:{default:void 0},maxValue:{default:void 0},errorMessage:{default:void 0},validate:{type:Function,default:void 0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,s=r.ref(),l=r.useSlots(),d=r.ref();zn(s);const u=r.ref(!0),p=r.computed({get(){return u.value&&n.modelValue!==void 0?new Number(n.modelValue).toString():""},set(C){var F;C=C.replace(/,/g,""),B(C)?(o("update:modelValue",+C),C.toString()!==((F=n.modelValue)==null?void 0:F.toString())&&+C===n.modelValue&&C[C.length-1]!=="."&&(u.value=!1,r.nextTick(()=>{u.value=!0}))):(C.trim()===""&&o("update:modelValue",void 0),u.value=!1,r.nextTick(()=>{u.value=!0}))}}),f=r.computed(()=>{let C=[];return n.errorMessage&&C.push(n.errorMessage),B(n.modelValue)?(n.minValue!==void 0&&n.modelValue!==void 0&&n.modelValue<n.minValue&&C.push(`Model value must be higher than ${n.minValue}`),n.maxValue!==void 0&&n.modelValue!==void 0&&n.modelValue>n.maxValue&&C.push(`Model value must be less than ${n.maxValue}`)):C.push("Model value is not a number."),C=[...C],C.join(" ")}),m=r.computed(()=>!!(n.maxValue&&n.modelValue!==void 0&&(n.modelValue||0)+n.step>n.maxValue)),y=r.computed(()=>!!(n.minValue&&n.modelValue!==void 0&&(n.modelValue||0)-n.step<n.minValue));function B(C){return C!==void 0?(C=C==null?void 0:C.toString(),!isNaN(+C)&&!isNaN(parseFloat(C))):!1}function T(){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 N(){if(!y.value){let C=0;n.modelValue===void 0?C=0:C=+(n.modelValue||0)-n.step,p.value=n.minValue?Math.max(n.minValue,C).toString():C.toString()}}function M(C){["ArrowDown","ArrowUp"].includes(C.code)&&C.preventDefault(),C.code==="ArrowUp"?T():C.code==="ArrowDown"&&N()}const G=C=>{C.detail>1&&C.preventDefault()};return(C,F)=>(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:G,onKeydown:F[1]||(F[1]=L=>M(L))},[r.createElementVNode("div",Mw,[r.createVNode(pr,{class:"mi-number-field__contour"}),F[6]||(F[6]=r.createTextVNode()),r.createElementVNode("div",Iw,[C.label?(r.openBlock(),r.createElementBlock("label",Ow,[r.createTextVNode(r.toDisplayString(C.label)+" ",1),r.unref(l).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(C.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),F[2]||(F[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":F[0]||(F[0]=L=>p.value=L),disabled:C.disabled,placeholder:C.placeholder,class:"text-s flex-grow"},null,8,Lw),[[r.vModelText,p.value]])]),F[7]||(F[7]=r.createTextVNode()),r.createElementVNode("div",Gw,[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:T},F[3]||(F[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),F[5]||(F[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([{disabled:y.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:N},F[4]||(F[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)])]),F[8]||(F[8]=r.createTextVNode()),f.value.trim()?(r.openBlock(),r.createElementBlock("div",zw,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],34))}}),$w={class:"pl-chip__text"},wl=r.defineComponent({__name:"PlChip",props:{closeable:{type:Boolean},small:{type:Boolean}},emits:["close"],setup(t){const e=r.ref(),n=r.ref(!1);return r.onMounted(()=>{var o;e.value&&(n.value=((o=e.value)==null?void 0:o.clientWidth)>=256)}),(o,s)=>(r.openBlock(),r.createBlock(r.unref(St),{position:"top",class:"pl-chip-tooltip",delay:500},r.createSlots({default:r.withCtx(()=>[s[4]||(s[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"chip",ref:e,class:r.normalizeClass(["pl-chip",{small:o.small}])},[r.createElementVNode("div",$w,[r.renderSlot(o.$slots,"default")]),s[3]||(s[3]=r.createTextVNode()),o.closeable?(r.openBlock(),r.createElementBlock("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:s[0]||(s[0]=r.withKeys(l=>o.$emit("close"),["enter"])),onClick:s[1]||(s[1]=r.withModifiers(l=>o.$emit("close"),["stop"]))},s[2]||(s[2]=[r.createElementVNode("div",{class:"pl-chip__close--icon"},null,-1)]),32)):r.createCommentVNode("",!0)],2)]),_:2},[n.value?{name:"tooltip",fn:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),key:"0"}:void 0]),1024))}}),Uw={class:"pl-multi-dropdown__envelope"},Ww=["tabindex"],Hw={class:"pl-multi-dropdown__container"},jw={class:"pl-multi-dropdown__field"},qw=["disabled","placeholder"],Kw={class:"pl-multi-dropdown__append"},Yw={key:0},Jw={key:0,class:"required-icon"},Xw={class:"pl-multi-dropdown__open-chips-container"},Qw={key:0,class:"nothing-found"},eb={key:0,class:"pl-multi-dropdown__error"},tb={key:1,class:"pl-multi-dropdown__helper"},nb={name:"PlDropdownMulti"},rb=r.defineComponent({...nb,props:{modelValue:{default:()=>[]},label:{default:void 0},options:{},helper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=D=>n("update:modelValue",D),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:[]),y=r.computed(()=>f.open&&l.modelValue.length>0?l.placeholder:l.modelValue.length>0?"":l.placeholder),B=r.computed(()=>dr(l.options).filter(D=>vl(m.value,D.value))),T=r.computed(()=>{const D=r.unref(m),K=dr(l.options);return(f.search?K.filter(U=>{const X=f.search.toLowerCase();return U.label.toLowerCase().includes(X)?!0:typeof U.value=="string"?U.value.toLowerCase().includes(X):U.value===f.search}):[...K]).map(U=>({...U,selected:vl(D,U.value)}))}),N=r.computed(()=>l.disabled?void 0:"0"),M=()=>{f.activeOption=hi(T.value.findIndex(D=>Pt(D.value,l.modelValue)),D=>D<0?0:D)},G=D=>{var K;const U=r.unref(m);o(vl(U,D)?U.filter(X=>!Pt(X,D)):[...U,D]),f.search="",(K=d==null?void 0:d.value)==null||K.focus()},C=D=>o(r.unref(m).filter(K=>!Pt(K,D))),F=()=>{var D;return(D=p.value)==null?void 0:D.focus()},L=()=>f.open=!f.open,$=D=>{var K,U;const X=D.relatedTarget;!((K=d.value)!=null&&K.contains(X))&&!((U=u.value)!=null&&U.contains(X))&&(f.search="",f.open=!1)},I=()=>{const D=u.value;D&<(D.querySelector(".hovered-item"),K=>{fi(D,K)})},Y=D=>{var K;const{open:U,activeOption:X}=f;if(!U){D.code==="Enter"&&(f.open=!0);return}D.code==="Escape"&&(f.open=!1,(K=d.value)==null||K.focus());const O=r.unref(T),{length:E}=O;if(!E)return;["ArrowDown","ArrowUp","Enter"].includes(D.code)&&D.preventDefault(),D.code==="Enter"&&G(O[X].value);const w=D.code==="ArrowDown"?1:D.code==="ArrowUp"?-1:0;f.activeOption=Math.abs(X+w+E)%E,requestAnimationFrame(I)};zn(d),r.watch(()=>l.modelValue,()=>M(),{immediate:!0}),r.watchPostEffect(()=>{f.search,f.open&&I()});const H=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(u,D=>{if(D){const K=D.getBoundingClientRect();f.optionsHeight=K.height,window.dispatchEvent(new CustomEvent("adjust"))}}),yo(d,D=>{const K=D.top+D.height+5;K+f.optionsHeight>D.clientHeight?H.top=D.top-f.optionsHeight-5+"px":H.top=K+"px",H.left=D.left+"px",H.width=D.width+"px"}),(D,K)=>(r.openBlock(),r.createElementBlock("div",Uw,[r.createElementVNode("div",{ref_key:"rootRef",ref:d,tabindex:N.value,class:r.normalizeClass(["pl-multi-dropdown",{open:f.open,error:D.error,disabled:D.disabled}]),onKeydown:Y,onFocusout:$},[r.createElementVNode("div",Hw,[r.createElementVNode("div",jw,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:p,"onUpdate:modelValue":K[0]||(K[0]=U=>f.search=U),type:"text",tabindex:"-1",disabled:D.disabled,placeholder:y.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:K[1]||(K[1]=U=>f.open=!0)},null,40,qw),[[r.vModelText,f.search]]),K[3]||(K[3]=r.createTextVNode()),f.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:F},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(B.value,(U,X)=>(r.openBlock(),r.createBlock(r.unref(wl),{key:X,closeable:"",small:"",onClick:K[2]||(K[2]=r.withModifiers(O=>f.open=!0,["stop"])),onClose:O=>C(U.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(U.label||U.value),1)]),_:2},1032,["onClose"]))),128))])),K[4]||(K[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(L,["stop"])}),K[5]||(K[5]=r.createTextVNode()),r.createElementVNode("div",Kw,[r.renderSlot(D.$slots,"append")])]),K[10]||(K[10]=r.createTextVNode()),D.label?(r.openBlock(),r.createElementBlock("label",Yw,[D.required?(r.openBlock(),r.createElementBlock("i",Jw)):r.createCommentVNode("",!0),K[6]||(K[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(D.label),1),K[7]||(K[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(D.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),K[11]||(K[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(H),tabindex:"-1",onFocusout:$},[r.createElementVNode("div",Xw,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(B.value,(U,X)=>(r.openBlock(),r.createBlock(r.unref(wl),{key:X,closeable:"",small:"",onClose:O=>C(U.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(U.label||U.value),1)]),_:2},1032,["onClose"]))),128))]),K[8]||(K[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(T.value,(U,X)=>(r.openBlock(),r.createBlock(go,{key:X,option:U,"text-item":"text","is-selected":U.selected,"is-hovered":f.activeOption==X,size:"medium","use-checkbox":"",onClick:r.withModifiers(O=>G(U.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),K[9]||(K[9]=r.createTextVNode()),T.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Qw,"Nothing found"))],36)])):r.createCommentVNode("",!0),K[12]||(K[12]=r.createTextVNode()),r.createVNode(pr,{class:"pl-multi-dropdown__contour"})])],42,Ww),K[13]||(K[13]=r.createTextVNode()),D.error?(r.openBlock(),r.createElementBlock("div",eb,r.toDisplayString(D.error),1)):D.helper?(r.openBlock(),r.createElementBlock("div",tb,r.toDisplayString(D.helper),1)):r.createCommentVNode("",!0)]))}}),bl=r.defineComponent({__name:"PlCheckboxBase",props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>e.modelValue);return(o,s)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["pl-checkbox-base",{checked:n.value,disabled:o.disabled}]),onClick:s[0]||(s[0]=l=>o.$emit("update:modelValue",!o.modelValue)),onKeydown:s[1]||(s[1]=r.withKeys(l=>o.$emit("update:modelValue",!o.modelValue),["enter"]))},null,34))}}),ob={name:"PlCheckbox"},Ou=r.defineComponent({...ob,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.useSlots();return(o,s)=>r.unref(n).default?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-checkbox",{disabled:o.disabled}])},[r.createVNode(bl,r.mergeProps(e,{"onUpdate:modelValue":s[0]||(s[0]=l=>o.$emit("update:modelValue",l))}),null,16),s[3]||(s[3]=r.createTextVNode()),r.createElementVNode("label",{onClick:s[1]||(s[1]=l=>o.$emit("update:modelValue",!o.$props.modelValue))},[r.renderSlot(o.$slots,"default")])],2)):(r.openBlock(),r.createBlock(bl,r.mergeProps({key:1},e,{"onUpdate:modelValue":s[2]||(s[2]=l=>o.$emit("update:modelValue",l))}),null,16))}}),ib={key:0},sb=["onClick"],ab={name:"PlCheckboxGroup"},lb=r.defineComponent({...ab,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,s=d=>o.modelValue.includes(d),l=d=>{const u=o.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",ib,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(bl,{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,sb)]))),128))],2))}}),cb="_component_tupwt_1",db={component:cb},ub={};function pb(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 hb={$style:db},fb=Kt(ub,[["render",pb],["__cssModules",hb]]),mb={key:1,class:"pl-dialog-modal__title"},gb={inheritAttrs:!1},xl=r.defineComponent({...gb,__name:"PlDialogModal",props:{modelValue:{type:Boolean},width:{default:"448px"},height:{default:"auto"},minHeight:{default:"auto"},maxHeight:{default:"auto"},closable:{type:Boolean,default:!0},noContentGutters:{type:Boolean,default:!1},noTopContentGutter:{type:Boolean},actionsHasTopBorder:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,s=t,l=r.ref(),d=r.useAttrs();function u(p){l.value&&s.closeOnOutsideClick&&document.contains(p.target)&&!l.value.contains(p.target)&&o("update:modelValue",!1)}return rt(document.body,"keyup",p=>{s.modelValue&&p.code==="Escape"&&o("update:modelValue",!1)}),(p,f)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,{name:"dialog"},{default:r.withCtx(()=>[p.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-dialog-modal__shadow",onClick:u},[r.createElementVNode("div",r.mergeProps(r.unref(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(fb,{key:0,class:"close-modal-btn",onClick:f[0]||(f[0]=r.withModifiers(m=>o("update:modelValue",!1),["stop"]))})):r.createCommentVNode("",!0),f[1]||(f[1]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",mb,[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})]))}}),yb=r.defineComponent({__name:"TransitionSlidePanel",setup(t){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(o,s)=>(r.openBlock(),r.createBlock(r.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),_:3}))}}),_b={key:0,class:"pl-slide-modal__title"},vb={class:"pl-slide-modal__content"},Cb={key:1,class:"pl-slide-modal__actions"},wb={name:"PlSlideModal",inheritAttrs:!1},bb=r.defineComponent({...wb,props:{modelValue:{type:Boolean,default:!1},width:{default:"368px"},shadow:{type:Boolean,default:!1},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,s=t,l=r.ref(),d=r.useAttrs();return ys(l,()=>{s.modelValue&&s.closeOnOutsideClick&&o("update:modelValue",!1)}),rt(document,"keydown",u=>{u.key==="Escape"&&o("update:modelValue",!1)}),(u,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(yb,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=>o("update:modelValue",!1),["esc"]))}),[r.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=f=>o("update:modelValue",!1))}),p[3]||(p[3]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",_b,[r.renderSlot(u.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",vb,[r.renderSlot(u.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",Cb,[r.renderSlot(u.$slots,"actions")])):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3}),p[6]||(p[6]=r.createTextVNode()),u.modelValue&&u.shadow?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:p[2]||(p[2]=r.withKeys(f=>o("update:modelValue",!1),["esc"]))},null,32)):r.createCommentVNode("",!0)]))}}),xb={key:0,class:"label"},kb={name:"PlToggleSwitch"},vs=r.defineComponent({...kb,props:{label:{},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["ui-toggle-switch",{active:e.modelValue}]),onClick:n[0]||(n[0]=o=>e.$emit("update:modelValue",!e.modelValue)),onKeydown:n[1]||(n[1]=r.withKeys(o=>e.$emit("update:modelValue",!e.modelValue),["enter"]))},[n[2]||(n[2]=r.createElementVNode("div",{class:"ui-toggle-switch__body"},[r.createElementVNode("div",{class:"ui-toggle-switch__handle"})],-1)),n[3]||(n[3]=r.createTextVNode()),e.label?(r.openBlock(),r.createElementBlock("span",xb,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function Lu(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function Sb(t){return r.unref(t)}const Eb=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function Tb(t,e,n={}){const{immediate:o=!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)},Sb(e))}return o&&(s.value=!0,Eb&&p()),Lu(u),{isPending:r.readonly(s),start:p,stop:u}}function Bb(t,e,n){return r.watch(t,(o,s,l)=>{o&&e(o,s,l)},{...n,once:!1})}function Ab(t,e,n){const{start:o}=Tb(l,e,{immediate:!1}),s=r.ref(!1);async function l(){s.value&&(await t(),o())}function d(){s.value||(s.value=!0,l())}function u(){s.value=!1}return n!=null&&n.immediate&&d(),Lu(u),{isActive:s,pause:u,resume:d}}const Nb="[==PROGRESS==]";function Vb(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pb(t){const e=r.ref(),n=r.reactive({errorCount:0});async function o(){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??Nb,m=new TextDecoder().decode(p.data).replace(new RegExp(`${Vb(f)}`,"g"),"");if(d=Object.assign(d,{lines:d.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const s=Ab(()=>o().catch(l=>{e.value&&(n.errorCount++,n.errorCount>(t.maxRetries??3)?e.value.error=l:console.warn("skip error:",l,"retry..."))}),1500,{immediate:!1});return Bb(()=>{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 Db={key:0},Fb={class:"pl-log-view__copy"},Rb={key:1,class:"pl-log-view__error"},Mb={name:"PlLogView"},Gu=r.defineComponent({...Mb,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=N=>{if(N&&N.ok===!1)return N.errors.join(`
|
|
53
|
+
`)},n=t,o=Pb(n),s=r.ref(!0),l=r.ref(),d=r.ref(),u=r.computed(()=>{var N;return((N=o.value)==null?void 0:N.error)??n.error??e(n.output)}),p=r.computed(()=>{var N;return((N=o.value)==null?void 0:N.lines)??n.value??B_(n.output)}),f=r.ref(!1);zn(d);const m=r.computed(()=>f.value?"clipboard-copied":"clipboard"),y=()=>{f.value=!0,setTimeout(()=>{f.value=!1},1200),p.value&&typeof p.value=="string"&&navigator.clipboard.writeText(p.value)},B=()=>{Zr(l.value,N=>{s.value&&N.scrollTo(N.scrollLeft,N.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{B()})},{immediate:!0});const T=N=>{const M=N.target;s.value=M.scrollTop+20>=M.scrollHeight-M.offsetHeight};return(N,M)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:d,class:r.normalizeClass(["pl-log-view",{"has-error":u.value}])},[N.label?(r.openBlock(),r.createElementBlock("label",Db,r.toDisplayString(N.label),1)):r.createCommentVNode("",!0),M[1]||(M[1]=r.createTextVNode()),r.createVNode(pr,{class:"pl-log-view__contour"}),M[2]||(M[2]=r.createTextVNode()),r.createElementVNode("div",Fb,[r.createVNode(r.unref(St),{"close-delay":800,position:"top"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(f.value?"copied":"copy"),1)]),default:r.withCtx(()=>[r.createVNode(r.unref(Zn),{title:"Copy content",name:m.value,onClick:y},null,8,["name"]),M[0]||(M[0]=r.createTextVNode())]),_:1})]),M[3]||(M[3]=r.createTextVNode()),u.value?(r.openBlock(),r.createElementBlock("div",Rb,r.toDisplayString(u.value),1)):(r.openBlock(),r.createElementBlock("div",{key:2,ref_key:"contentRef",ref:l,class:"pl-log-view__content",onScroll:T},r.toDisplayString(p.value),545))],2))}}),Ib="_component_1ukal_1",Ob="_tab_1ukal_14",Lb="_disabled_1ukal_27",Gb="_active_1ukal_56",zb="_topLine_1ukal_69",_o={component:Ib,tab:Ob,disabled:Lb,active:Gb,topLine:zb},Zb=r.defineComponent({__name:"Tab",props:{option:{}},setup(t){const e=r.ref(),n=r.reactive({isOverflown:!1});return r.onMounted(()=>{const o=r.unref(e);if(!o)return;const s=o.$el.querySelector("span");s&&requestAnimationFrame(()=>{s.offsetWidth<s.scrollWidth&&(n.isOverflown=!0),console.log("el.offsetWidth, el.scrollWidth",s.offsetWidth,s.scrollWidth)})}),(o,s)=>(r.openBlock(),r.createBlock(r.unref(St),{ref_key:"rootRef",ref:e,element:"div",position:"top",hide:!n.isOverflown,"close-delay":300,"data-is-overflown":n.isOverflown?"true":"false"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(o.option.label),1)]),default:r.withCtx(()=>[r.renderSlot(o.$slots,"default"),s[0]||(s[0]=r.createTextVNode())]),_:3},8,["hide","data-is-overflown"]))}}),$b={name:"PlTabs"},Ub=r.defineComponent({...$b,props:{modelValue:{},options:{},disabled:{type:Boolean},topLine:{type:Boolean},maxTabWidth:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=s=>n("update:modelValue",s);return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(_o).component,{[r.unref(_o).disabled]:s.disabled,[r.unref(_o).topLine]:s.topLine}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(d,u)=>(r.openBlock(),r.createBlock(Zb,{key:u,tabindex:s.modelValue===d.value||s.disabled||d.disabled?void 0:0,option:d,class:r.normalizeClass([{[r.unref(_o).active]:s.modelValue===d.value,[r.unref(_o).disabled]:d.disabled},r.unref(_o).tab]),style:r.normalizeStyle({"--pl-tabs-item-max-width":d.maxWidth??s.maxTabWidth}),onKeydown:r.withKeys(p=>o(d.value),["enter"]),onClick:p=>o(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))}}),Wb=r.defineComponent({__name:"PlSectionSeparator",props:{compact:{type:Boolean}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-section-separator",{[e.$style.compact]:e.compact}])},[r.createElementVNode("div",{class:r.normalizeClass(e.$style.content)},[r.renderSlot(e.$slots,"default")],2)],2))}}),Hb="_compact_rhd5u_16",jb="_content_rhd5u_20",qb={compact:Hb,content:jb},Kb={$style:qb},zu=Kt(Wb,[["__cssModules",Kb]]),Yb=r.defineComponent({__name:"PlAccordion",props:r.mergeModels({multiple:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t;return r.provide("pl-accordion-model",e),r.provide("pl-accordion-props",r.toRef(n)),(o,s)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.renderSlot(o.$slots,"header"),s[0]||(s[0]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],64))}}),Jb=r.defineComponent({__name:"ExpandTransition",setup(t){const e=o=>{o.style.setProperty("--component-height",o.scrollHeight+"px"),o.classList.add("expand-collapse-fix")},n=o=>{o.style.removeProperty("--component-height"),o.classList.remove("expand-collapse-fix")};return(o,s)=>(r.openBlock(),r.createBlock(r.Transition,{name:"expand-collapse",onEnter:e,onLeave:e,onAfterEnter:n,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),_:3}))}}),Xb=r.defineComponent({__name:"PlAccordionSection",props:r.mergeModels({label:{},compact:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.inject("pl-accordion-model"),n=r.inject("pl-accordion-props"),o=r.useModel(t,"modelValue"),s=su(),l=r.computed(()=>!n||n.value.multiple),d=r.computed({get(){return l.value?o.value:e?e.value===s:o.value},set(u){l.value?o.value=u:e&&(e.value=e.value===s?"":s)}});return(u,p)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(r.unref(zu),{class:r.normalizeClass(u.$style.separator),compact:u.compact,onClick:p[0]||(p[0]=f=>d.value=!d.value)},{default:r.withCtx(()=>[r.createVNode(r.unref(ur),{name:"chevron-right",class:r.normalizeClass([{[u.$style.down]:d.value},u.$style.chevron])},null,8,["class"]),r.createTextVNode(" "+r.toDisplayString(u.label),1)]),_:1},8,["class","compact"]),p[1]||(p[1]=r.createTextVNode()),r.createVNode(Jb,null,{default:r.withCtx(()=>[d.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(u.$style.content)},[r.renderSlot(u.$slots,"default")],2)):r.createCommentVNode("",!0)]),_:3})],64))}}),Qb="_content_jmjfk_2",ex="_separator_jmjfk_14",tx="_chevron_jmjfk_19",nx="_down_jmjfk_23",rx={content:Qb,separator:ex,chevron:tx,down:nx},ox={$style:rx},ix=Kt(Xb,[["__cssModules",ox]]);function sx(t){const e=t.split("/"),n=[];for(let o=0;o<e.length;o++)n.push({index:o,name:o===0?"Root":e[o],path:e.slice(0,o+1).join("/")});return n}const ax={class:"file-dialog"},lx={class:"file-dialog__search"},cx={class:"ls-container"},dx={class:"ls-head"},ux={class:"ls-head__breadcrumbs"},px=["title","onClick"],hx={key:0,class:"icon-16 icon-chevron-right"},fx={class:"d-flex ml-auto align-center gap-12"},mx={class:"ls-head__selected"},gx={key:0,class:"ls-loader"},yx={key:1,class:"ls-empty"},_x={key:2,class:"ls-error"},vx={class:"ls-error__message"},Cx={key:3,class:"ls-body"},wx=["onClick"],bx=["title"],xx=["onClick"],kx=["title"],Zu=r.defineComponent({__name:"PlFileDialog",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue","import:files"],setup(t,{emit:e}){const n=e,o=t,s=()=>({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(H=>!H.name.startsWith("."))),u=r.computed(()=>{var H;return{modelValue:o.modelValue,dirPath:l.dirPath,storageHandle:(H=l.storageEntry)==null?void 0:H.handle}}),p=(H,D)=>{window.platforma&&l.currentLoadingPath!==D&&(l.error="",l.items=[],l.lastSelected=void 0,l.currentLoadingPath=D,window.platforma.lsDriver.listFiles(H,D).then(K=>{D===l.dirPath&&(l.items=ru(K).entries.map(U=>({path:U.fullPath,name:U.name,isDir:U.type==="dir",canBeSelected:U.type==="file"&&(!o.extensions||o.extensions.some(X=>U.fullPath.endsWith(X))),handle:U.type==="file"?U.handle:void 0,selected:!1})).sort((U,X)=>U.isDir&&!X.isDir?-1:!U.isDir&&X.isDir?1:U.name.localeCompare(X.name)).map((U,X)=>({id:X,...U})),l.lastSelected=void 0)}).catch(K=>l.error=String(K)).finally(()=>{l.currentLoadingPath=void 0}))},f=()=>{const{storageHandle:H,dirPath:D,modelValue:K}=u.value;H&&K&&p(H,D)},m=lu(H=>{l.dirPath=H??""},1e3),y=r.computed(()=>sx(l.dirPath)),B=r.computed(()=>l.items.filter(H=>H.canBeSelected&&H.selected&&!H.isDir)),T=r.computed(()=>B.value.length>0),N=()=>{n("update:modelValue",!1)},M=()=>{var H;T.value&&(H=l.storageEntry)!=null&&H.handle&&(n("import:files",{storageHandle:l.storageEntry.handle,files:B.value.map(D=>D.handle)}),N())},G=H=>{l.dirPath=H,l.storageEntry&&f()},C=(H,D)=>{const{shiftKey:K,metaKey:U}=H,{lastSelected:X}=l;if(H.preventDefault(),D.canBeSelected){if(o.multi||l.items.forEach(O=>O.selected=!1),D.selected=!0,!o.multi)return;!U&&!K&&l.items.forEach(O=>{O.id!==D.id&&(O.selected=!1)}),K&&X!==void 0&&l.items.forEach(O=>{S_(O.id,X,D.id)&&(O.selected=!0)}),D.selected&&(l.lastSelected=D.id)}},F=H=>{H&&!o.multi||l.items.filter(D=>D.canBeSelected).forEach(D=>{D.selected=H})},L=()=>F(!0),$=()=>F(!1),I=()=>{if(l.error="",l.lastSelected=void 0,$(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(H=>{l.storageOptions=H.map(D=>({text:D.name,value:D})),o.autoSelectStorage&&Zr(H.find(D=>D.name==="local"||D.name.startsWith("local_disk_")&&D.initialFullPath.length>4),D=>{l.storageEntry=D,l.dirPath=D.initialFullPath})}).catch(H=>l.error=String(H))};r.watch(r.toRef(l,"storageEntry"),H=>{l.dirPath=(H==null?void 0:H.initialFullPath)??""}),r.watch([()=>l.dirPath,()=>l.storageEntry],()=>{f()}),r.watch(()=>o.modelValue,H=>{H?I():Object.assign(l,s())},{immediate:!0}),rt(document,"keydown",H=>{o.modelValue&&H.target===document.body&&(H.metaKey&&H.code==="KeyA"&&(H.preventDefault(),L()),H.metaKey&&H.shiftKey&&H.code==="Period"&&(H.preventDefault(),l.showHiddenItems=!l.showHiddenItems),H.code==="Enter"&&M())}),r.onUpdated(I);const Y={mounted:H=>{if(H.clientWidth<H.scrollWidth){const D=H.innerText;H.innerText=D.substring(0,57)+"..."+D.substring(D.length-10)}}};return(H,D)=>(r.openBlock(),r.createBlock(r.unref(xl),{"no-content-gutters":!0,"close-on-outside-click":H.closeOnOutsideClick,class:"split","model-value":H.modelValue,width:"688px",height:"720px","onUpdate:modelValue":N,onClick:r.withModifiers($,["stop"])},{title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(H.title??"Select files"),1)]),actions:r.withCtx(()=>[r.createVNode(r.unref(pl),{style:{"min-width":"160px"},disabled:!T.value,onClick:r.withModifiers(M,["stop"])},{default:r.withCtx(()=>D[14]||(D[14]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),D[16]||(D[16]=r.createTextVNode()),r.createVNode(r.unref(fl),{"justify-center":!1,onClick:r.withModifiers(N,["stop"])},{default:r.withCtx(()=>D[15]||(D[15]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[D[17]||(D[17]=r.createTextVNode()),r.createElementVNode("div",ax,[r.createElementVNode("div",lx,[r.createVNode(r.unref(mi),{modelValue:l.storageEntry,"onUpdate:modelValue":D[0]||(D[0]=K=>l.storageEntry=K),label:"Select storage",options:l.storageOptions},null,8,["modelValue","options"]),D[1]||(D[1]=r.createTextVNode()),r.createVNode(r.unref(hr),{"model-value":l.dirPath,label:"Enter path","onUpdate:modelValue":r.unref(m)},null,8,["model-value","onUpdate:modelValue"])]),D[13]||(D[13]=r.createTextVNode()),r.createElementVNode("div",cx,[r.createElementVNode("div",dx,[r.createElementVNode("div",ux,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,(K,U)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:U},[r.createElementVNode("div",{title:K.path,onClick:X=>G(K.path)},r.toDisplayString(K.name),9,px),D[2]||(D[2]=r.createTextVNode()),K.index!==y.value.length-1?(r.openBlock(),r.createElementBlock("i",hx)):r.createCommentVNode("",!0)],64))),128))]),D[3]||(D[3]=r.createTextVNode()),r.createElementVNode("div",fx,[r.createElementVNode("span",mx,"Selected: "+r.toDisplayString(B.value.length),1)])]),D[12]||(D[12]=r.createTextVNode()),l.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",gx,D[4]||(D[4]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):l.storageEntry?l.error?(r.openBlock(),r.createElementBlock("div",_x,[D[6]||(D[6]=r.createElementVNode("div",{class:"ls-error__cat"},null,-1)),D[7]||(D[7]=r.createTextVNode()),r.createElementVNode("div",vx,r.toDisplayString(l.error),1)])):(r.openBlock(),r.createElementBlock("div",Cx,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,K=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:K.id},[K.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:"isDir",onClick:U=>G(K.path)},[D[8]||(D[8]=r.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),D[9]||(D[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:K.name},[r.createTextVNode(r.toDisplayString(K.name),1)],8,bx)),[[Y]])],8,wx)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({canBeSelected:K.canBeSelected,selected:K.selected}),onClick:r.withModifiers(U=>C(U,K),["stop"])},[D[10]||(D[10]=r.createElementVNode("i",{class:"mask-16 mask-box isFile"},null,-1)),D[11]||(D[11]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:K.name},[r.createTextVNode(r.toDisplayString(K.name),1)],8,kx)),[[Y]])],10,xx))],64))),128))])):(r.openBlock(),r.createElementBlock("div",yx,D[5]||(D[5]=[r.createElementVNode("div",{class:"ls-empty__cat"},null,-1),r.createTextVNode(),r.createElementVNode("div",{class:"ls-empty__message"},"Select storage to preview",-1)])))])]),D[18]||(D[18]=r.createTextVNode())]),_:1},8,["close-on-outside-click","model-value"]))}});var Le;(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 o(s,l=" | "){return s.map(d=>typeof d=="string"?`'${d}'`:d).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Le||(Le={}));var kl;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(kl||(kl={}));const le=Le.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fr=t=>{switch(typeof t){case"undefined":return le.undefined;case"string":return le.string;case"number":return isNaN(t)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(t)?le.array:t===null?le.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?le.promise:typeof Map<"u"&&t instanceof Map?le.map:typeof Set<"u"&&t instanceof Set?le.set:typeof Date<"u"&&t instanceof Date?le.date:le.object;default:return le.unknown}},ee=Le.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"]),Sx=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ot extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},s=l=>{for(const 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)o._errors.push(n(d));else{let u=o,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),o}static assert(e){if(!(e instanceof Ot))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Le.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):o.push(e(s));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Ot.create=t=>new Ot(t);const vo=(t,e)=>{let n;switch(t.code){case ee.invalid_type:t.received===le.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Le.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Le.joinValues(t.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Le.joinValues(t.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Le.joinValues(t.options)}, received '${t.received}'`;break;case ee.invalid_arguments:n="Invalid function arguments";break;case ee.invalid_return_type:n="Invalid function return type";break;case ee.invalid_date:n="Invalid date";break;case ee.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Le.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ee.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ee.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ee.custom:n="Invalid input";break;case ee.invalid_intersection_types:n="Intersection results could not be merged";break;case ee.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ee.not_finite:n="Number must be finite";break;default:n=e.defaultError,Le.assertNever(t)}return{message:n}};let $u=vo;function Ex(t){$u=t}function Cs(){return $u}const ws=t=>{const{data:e,path:n,errorMaps:o,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=o.filter(f=>!!f).slice().reverse();for(const f of p)u=f(d,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},Tx=[];function se(t,e){const n=Cs(),o=ws({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===vo?void 0:vo].filter(s=>!!s)});t.common.issues.push(o)}class vt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const s of n){if(s.status==="aborted")return we;s.status==="dirty"&&e.dirty(),o.push(s.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const s of n){const l=await s.key,d=await s.value;o.push({key:l,value:d})}return vt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const s of n){const{key:l,value:d}=s;if(l.status==="aborted"||d.status==="aborted")return we;l.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof d.value<"u"||s.alwaysSet)&&(o[l.value]=d.value)}return{status:e.value,value:o}}}const we=Object.freeze({status:"aborted"}),bs=t=>({status:"dirty",value:t}),Et=t=>({status:"valid",value:t}),Sl=t=>t.status==="aborted",El=t=>t.status==="dirty",gi=t=>t.status==="valid",yi=t=>typeof Promise<"u"&&t instanceof Promise;function xs(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Uu(t,e,n,o,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var he;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(he||(he={}));var _i,vi;class Vn{constructor(e,n,o,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Wu=(t,e)=>{if(gi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ot(t.common.issues);return this._error=n,this._error}}};function Be(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:s}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(l,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??o)!==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 Ve{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return fr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:fr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new vt,ctx:{common:e.parent.common,data:e.data,parsedType:fr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(yi(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const s={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fr(e)},l=this._parseSync({data:e,path:s.path,parent:s});return Wu(s,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fr(e)},s=this._parse({data:e,path:o.path,parent:o}),l=await(yi(s)?s:Promise.resolve(s));return Wu(o,l)}refine(e,n){const o=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const d=e(s),u=()=>l.addIssue({code:ee.custom,...o(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((o,s)=>e(o)?!0:(s.addIssue(typeof n=="function"?n(o,s):n),!1))}_refinement(e){return new dn({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Dn.create(this,this._def)}nullable(){return vr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return cn.create(this,this._def)}promise(){return xo.create(this,this._def)}or(e){return xi.create([this,e],this._def)}and(e){return ki.create(this,e,this._def)}transform(e){return new dn({...Be(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ai({...Be(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new Al({typeName:ve.ZodBranded,type:this,...Be(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Ni({...Be(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Vi.create(this,e)}readonly(){return Pi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Bx=/^c[^\s-]{8,}$/i,Ax=/^[0-9a-z]+$/,Nx=/^[0-9A-HJKMNP-TV-Z]{26}$/,Vx=/^[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,Px=/^[a-z0-9_-]{21}$/i,Dx=/^[-+]?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)?)??$/,Fx=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Rx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Tl;const Mx=/^(?:(?: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])$/,Ix=/^(([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})))$/,Ox=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Hu="((\\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])))",Lx=new RegExp(`^${Hu}$`);function ju(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 Gx(t){return new RegExp(`^${ju(t)}$`)}function qu(t){let e=`${Hu}T${ju(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 zx(t,e){return!!((e==="v4"||!e)&&Mx.test(t)||(e==="v6"||!e)&&Ix.test(t))}class ln extends Ve{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==le.string){const s=this._getOrReturnCtx(e);return se(s,{code:ee.invalid_type,expected:le.string,received:s.parsedType}),we}const n=new vt;let o;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:ee.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:ee.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)&&(o=this._getOrReturnCtx(e,o),l?se(o,{code:ee.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):d&&se(o,{code:ee.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Fx.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"email",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Tl||(Tl=new RegExp(Rx,"u")),Tl.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"emoji",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Vx.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"uuid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")Px.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"nanoid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Bx.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"cuid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Ax.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"cuid2",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Nx.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"ulid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),se(o,{validation:"url",code:ee.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"regex",code:ee.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),se(o,{code:ee.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),se(o,{code:ee.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),se(o,{code:ee.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?qu(s).test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{code:ee.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Lx.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{code:ee.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?Gx(s).test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{code:ee.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Dx.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"duration",code:ee.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?zx(e.data,s.version)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"ip",code:ee.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Ox.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"base64",code:ee.invalid_string,message:s.message}),n.dirty()):Le.assertNever(s);return{status:n.value,value:e.data}}_regex(e,n,o){return this.refinement(s=>e.test(s),{validation:n,code:ee.invalid_string,...he.errToObj(o)})}_addCheck(e){return new ln({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...he.errToObj(e)})}url(e){return this._addCheck({kind:"url",...he.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...he.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...he.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...he.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...he.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...he.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...he.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...he.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...he.errToObj(e)})}datetime(e){var n,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...he.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,...he.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...he.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...he.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...he.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...he.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...he.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...he.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...he.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...he.errToObj(n)})}nonempty(e){return this.min(1,he.errToObj(e))}trim(){return new ln({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ln({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ln({...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}}ln.create=t=>{var e;return new ln({checks:[],typeName:ve.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Be(t)})};function Zx(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,s=n>o?n:o,l=parseInt(t.toFixed(s).replace(".","")),d=parseInt(e.toFixed(s).replace(".",""));return l%d/Math.pow(10,s)}class mr extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==le.number){const s=this._getOrReturnCtx(e);return se(s,{code:ee.invalid_type,expected:le.number,received:s.parsedType}),we}let n;const o=new vt;for(const s of this._def.checks)s.kind==="int"?Le.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{code:ee.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:ee.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:ee.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?Zx(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),se(n,{code:ee.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{code:ee.not_finite,message:s.message}),o.dirty()):Le.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,he.toString(n))}gt(e,n){return this.setLimit("min",e,!1,he.toString(n))}lte(e,n){return this.setLimit("max",e,!0,he.toString(n))}lt(e,n){return this.setLimit("max",e,!1,he.toString(n))}setLimit(e,n,o,s){return new mr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:he.toString(s)}]})}_addCheck(e){return new mr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:he.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:he.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:he.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:he.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:he.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:he.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:he.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:he.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:he.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"&&Le.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}mr.create=t=>new mr({checks:[],typeName:ve.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Be(t)});class gr extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==le.bigint){const s=this._getOrReturnCtx(e);return se(s,{code:ee.invalid_type,expected:le.bigint,received:s.parsedType}),we}let n;const o=new vt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:ee.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:ee.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),se(n,{code:ee.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):Le.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,he.toString(n))}gt(e,n){return this.setLimit("min",e,!1,he.toString(n))}lte(e,n){return this.setLimit("max",e,!0,he.toString(n))}lt(e,n){return this.setLimit("max",e,!1,he.toString(n))}setLimit(e,n,o,s){return new gr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:he.toString(s)}]})}_addCheck(e){return new gr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:he.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:he.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:he.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:he.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:he.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}}gr.create=t=>{var e;return new gr({checks:[],typeName:ve.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Be(t)})};class Ci extends Ve{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==le.boolean){const n=this._getOrReturnCtx(e);return se(n,{code:ee.invalid_type,expected:le.boolean,received:n.parsedType}),we}return Et(e.data)}}Ci.create=t=>new Ci({typeName:ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Be(t)});class $r extends Ve{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==le.date){const s=this._getOrReturnCtx(e);return se(s,{code:ee.invalid_type,expected:le.date,received:s.parsedType}),we}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return se(s,{code:ee.invalid_date}),we}const n=new vt;let o;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:ee.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:ee.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Le.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new $r({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:he.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:he.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}$r.create=t=>new $r({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ve.ZodDate,...Be(t)});class ks extends Ve{_parse(e){if(this._getType(e)!==le.symbol){const n=this._getOrReturnCtx(e);return se(n,{code:ee.invalid_type,expected:le.symbol,received:n.parsedType}),we}return Et(e.data)}}ks.create=t=>new ks({typeName:ve.ZodSymbol,...Be(t)});class wi extends Ve{_parse(e){if(this._getType(e)!==le.undefined){const n=this._getOrReturnCtx(e);return se(n,{code:ee.invalid_type,expected:le.undefined,received:n.parsedType}),we}return Et(e.data)}}wi.create=t=>new wi({typeName:ve.ZodUndefined,...Be(t)});class bi extends Ve{_parse(e){if(this._getType(e)!==le.null){const n=this._getOrReturnCtx(e);return se(n,{code:ee.invalid_type,expected:le.null,received:n.parsedType}),we}return Et(e.data)}}bi.create=t=>new bi({typeName:ve.ZodNull,...Be(t)});class Co extends Ve{constructor(){super(...arguments),this._any=!0}_parse(e){return Et(e.data)}}Co.create=t=>new Co({typeName:ve.ZodAny,...Be(t)});class Ur extends Ve{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Et(e.data)}}Ur.create=t=>new Ur({typeName:ve.ZodUnknown,...Be(t)});class $n extends Ve{_parse(e){const n=this._getOrReturnCtx(e);return se(n,{code:ee.invalid_type,expected:le.never,received:n.parsedType}),we}}$n.create=t=>new $n({typeName:ve.ZodNever,...Be(t)});class Ss extends Ve{_parse(e){if(this._getType(e)!==le.undefined){const n=this._getOrReturnCtx(e);return se(n,{code:ee.invalid_type,expected:le.void,received:n.parsedType}),we}return Et(e.data)}}Ss.create=t=>new Ss({typeName:ve.ZodVoid,...Be(t)});class cn extends Ve{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),s=this._def;if(n.parsedType!==le.array)return se(n,{code:ee.invalid_type,expected:le.array,received:n.parsedType}),we;if(s.exactLength!==null){const d=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(d||u)&&(se(n,{code:d?ee.too_big:ee.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}),o.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(se(n,{code:ee.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),o.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(se(n,{code:ee.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((d,u)=>s.type._parseAsync(new Vn(n,d,n.path,u)))).then(d=>vt.mergeArray(o,d));const l=[...n.data].map((d,u)=>s.type._parseSync(new Vn(n,d,n.path,u)));return vt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new cn({...this._def,minLength:{value:e,message:he.toString(n)}})}max(e,n){return new cn({...this._def,maxLength:{value:e,message:he.toString(n)}})}length(e,n){return new cn({...this._def,exactLength:{value:e,message:he.toString(n)}})}nonempty(e){return this.min(1,e)}}cn.create=(t,e)=>new cn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Be(e)});function wo(t){if(t instanceof et){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=Dn.create(wo(o))}return new et({...t._def,shape:()=>e})}else return t instanceof cn?new cn({...t._def,type:wo(t.element)}):t instanceof Dn?Dn.create(wo(t.unwrap())):t instanceof vr?vr.create(wo(t.unwrap())):t instanceof Pn?Pn.create(t.items.map(e=>wo(e))):t}class et extends Ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Le.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==le.object){const p=this._getOrReturnCtx(e);return se(p,{code:ee.invalid_type,expected:le.object,received:p.parsedType}),we}const{status:n,ctx:o}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),d=[];if(!(this._def.catchall instanceof $n&&this._def.unknownKeys==="strip"))for(const p in o.data)l.includes(p)||d.push(p);const u=[];for(const p of l){const f=s[p],m=o.data[p];u.push({key:{status:"valid",value:p},value:f._parse(new Vn(o,m,o.path,p)),alwaysSet:p in o.data})}if(this._def.catchall instanceof $n){const p=this._def.unknownKeys;if(p==="passthrough")for(const f of d)u.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(p==="strict")d.length>0&&(se(o,{code:ee.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=o.data[f];u.push({key:{status:"valid",value:f},value:p._parse(new Vn(o,m,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const p=[];for(const f of u){const m=await f.key,y=await f.value;p.push({key:m,value:y,alwaysSet:f.alwaysSet})}return p}).then(p=>vt.mergeObjectSync(n,p)):vt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return he.errToObj,new et({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var s,l,d,u;const p=(d=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,o).message)!==null&&d!==void 0?d:o.defaultError;return n.code==="unrecognized_keys"?{message:(u=he.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new et({...this._def,unknownKeys:"strip"})}passthrough(){return new et({...this._def,unknownKeys:"passthrough"})}extend(e){return new et({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new et({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ve.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new et({...this._def,catchall:e})}pick(e){const n={};return Le.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new et({...this._def,shape:()=>n})}omit(e){const n={};return Le.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new et({...this._def,shape:()=>n})}deepPartial(){return wo(this)}partial(e){const n={};return Le.objectKeys(this.shape).forEach(o=>{const s=this.shape[o];e&&!e[o]?n[o]=s:n[o]=s.optional()}),new et({...this._def,shape:()=>n})}required(e){const n={};return Le.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let s=this.shape[o];for(;s instanceof Dn;)s=s._def.innerType;n[o]=s}}),new et({...this._def,shape:()=>n})}keyof(){return Ku(Le.objectKeys(this.shape))}}et.create=(t,e)=>new et({shape:()=>t,unknownKeys:"strip",catchall:$n.create(),typeName:ve.ZodObject,...Be(e)}),et.strictCreate=(t,e)=>new et({shape:()=>t,unknownKeys:"strict",catchall:$n.create(),typeName:ve.ZodObject,...Be(e)}),et.lazycreate=(t,e)=>new et({shape:t,unknownKeys:"strip",catchall:$n.create(),typeName:ve.ZodObject,...Be(e)});class xi extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const d=l.map(u=>new Ot(u.ctx.common.issues));return se(n,{code:ee.invalid_union,unionErrors:d}),we}if(n.common.async)return Promise.all(o.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 o){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&d.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=d.map(p=>new Ot(p));return se(n,{code:ee.invalid_union,unionErrors:u}),we}}get options(){return this._def.options}}xi.create=(t,e)=>new xi({options:t,typeName:ve.ZodUnion,...Be(e)});const yr=t=>t instanceof Ei?yr(t.schema):t instanceof dn?yr(t.innerType()):t instanceof Ti?[t.value]:t instanceof _r?t.options:t instanceof Bi?Le.objectValues(t.enum):t instanceof Ai?yr(t._def.innerType):t instanceof wi?[void 0]:t instanceof bi?[null]:t instanceof Dn?[void 0,...yr(t.unwrap())]:t instanceof vr?[null,...yr(t.unwrap())]:t instanceof Al||t instanceof Pi?yr(t.unwrap()):t instanceof Ni?yr(t._def.innerType):[];class Es extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.object)return se(n,{code:ee.invalid_type,expected:le.object,received:n.parsedType}),we;const o=this.discriminator,s=n.data[o],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(se(n,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),we)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const s=new Map;for(const l of n){const d=yr(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 Es({typeName:ve.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Be(o)})}}function Bl(t,e){const n=fr(t),o=fr(e);if(t===e)return{valid:!0,data:t};if(n===le.object&&o===le.object){const s=Le.objectKeys(e),l=Le.objectKeys(t).filter(u=>s.indexOf(u)!==-1),d={...t,...e};for(const u of l){const p=Bl(t[u],e[u]);if(!p.valid)return{valid:!1};d[u]=p.data}return{valid:!0,data:d}}else if(n===le.array&&o===le.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=Bl(d,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===le.date&&o===le.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ki extends Ve{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=(l,d)=>{if(Sl(l)||Sl(d))return we;const u=Bl(l.value,d.value);return u.valid?((El(l)||El(d))&&n.dirty(),{status:n.value,value:u.data}):(se(o,{code:ee.invalid_intersection_types}),we)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,d])=>s(l,d)):s(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}ki.create=(t,e,n)=>new ki({left:t,right:e,typeName:ve.ZodIntersection,...Be(n)});class Pn extends Ve{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.array)return se(o,{code:ee.invalid_type,expected:le.array,received:o.parsedType}),we;if(o.data.length<this._def.items.length)return se(o,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),we;!this._def.rest&&o.data.length>this._def.items.length&&(se(o,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...o.data].map((l,d)=>{const u=this._def.items[d]||this._def.rest;return u?u._parse(new Vn(o,l,o.path,d)):null}).filter(l=>!!l);return o.common.async?Promise.all(s).then(l=>vt.mergeArray(n,l)):vt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Pn({...this._def,rest:e})}}Pn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Pn({items:t,typeName:ve.ZodTuple,rest:null,...Be(e)})};class Si extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.object)return se(o,{code:ee.invalid_type,expected:le.object,received:o.parsedType}),we;const s=[],l=this._def.keyType,d=this._def.valueType;for(const u in o.data)s.push({key:l._parse(new Vn(o,u,o.path,u)),value:d._parse(new Vn(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?vt.mergeObjectAsync(n,s):vt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Ve?new Si({keyType:e,valueType:n,typeName:ve.ZodRecord,...Be(o)}):new Si({keyType:ln.create(),valueType:e,typeName:ve.ZodRecord,...Be(n)})}}class Ts extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.map)return se(o,{code:ee.invalid_type,expected:le.map,received:o.parsedType}),we;const s=this._def.keyType,l=this._def.valueType,d=[...o.data.entries()].map(([u,p],f)=>({key:s._parse(new Vn(o,u,o.path,[f,"key"])),value:l._parse(new Vn(o,p,o.path,[f,"value"]))}));if(o.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 we;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of d){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return we;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}Ts.create=(t,e,n)=>new Ts({valueType:e,keyType:t,typeName:ve.ZodMap,...Be(n)});class Wr extends Ve{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.set)return se(o,{code:ee.invalid_type,expected:le.set,received:o.parsedType}),we;const s=this._def;s.minSize!==null&&o.data.size<s.minSize.value&&(se(o,{code:ee.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&o.data.size>s.maxSize.value&&(se(o,{code:ee.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 we;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...o.data.values()].map((p,f)=>l._parse(new Vn(o,p,o.path,f)));return o.common.async?Promise.all(u).then(p=>d(p)):d(u)}min(e,n){return new Wr({...this._def,minSize:{value:e,message:he.toString(n)}})}max(e,n){return new Wr({...this._def,maxSize:{value:e,message:he.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Wr.create=(t,e)=>new Wr({valueType:t,minSize:null,maxSize:null,typeName:ve.ZodSet,...Be(e)});class bo extends Ve{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.function)return se(n,{code:ee.invalid_type,expected:le.function,received:n.parsedType}),we;function o(u,p){return ws({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Cs(),vo].filter(f=>!!f),issueData:{code:ee.invalid_arguments,argumentsError:p}})}function s(u,p){return ws({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Cs(),vo].filter(f=>!!f),issueData:{code:ee.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},d=n.data;if(this._def.returns instanceof xo){const u=this;return Et(async function(...p){const f=new Ot([]),m=await u._def.args.parseAsync(p,l).catch(B=>{throw f.addIssue(o(p,B)),f}),y=await Reflect.apply(d,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(B=>{throw f.addIssue(s(y,B)),f})})}else{const u=this;return Et(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Ot([o(p,f.error)]);const m=Reflect.apply(d,this,f.data),y=u._def.returns.safeParse(m,l);if(!y.success)throw new Ot([s(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new bo({...this._def,args:Pn.create(e).rest(Ur.create())})}returns(e){return new bo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new bo({args:e||Pn.create([]).rest(Ur.create()),returns:n||Ur.create(),typeName:ve.ZodFunction,...Be(o)})}}class Ei extends Ve{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ei.create=(t,e)=>new Ei({getter:t,typeName:ve.ZodLazy,...Be(e)});class Ti extends Ve{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return se(n,{received:n.data,code:ee.invalid_literal,expected:this._def.value}),we}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ti.create=(t,e)=>new Ti({value:t,typeName:ve.ZodLiteral,...Be(e)});function Ku(t,e){return new _r({values:t,typeName:ve.ZodEnum,...Be(e)})}class _r extends Ve{constructor(){super(...arguments),_i.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return se(n,{expected:Le.joinValues(o),received:n.parsedType,code:ee.invalid_type}),we}if(xs(this,_i)||Uu(this,_i,new Set(this._def.values)),!xs(this,_i).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return se(n,{received:n.data,code:ee.invalid_enum_value,options:o}),we}return Et(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return _r.create(e,{...this._def,...n})}exclude(e,n=this._def){return _r.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}_i=new WeakMap,_r.create=Ku;class Bi extends Ve{constructor(){super(...arguments),vi.set(this,void 0)}_parse(e){const n=Le.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==le.string&&o.parsedType!==le.number){const s=Le.objectValues(n);return se(o,{expected:Le.joinValues(s),received:o.parsedType,code:ee.invalid_type}),we}if(xs(this,vi)||Uu(this,vi,new Set(Le.getValidEnumValues(this._def.values))),!xs(this,vi).has(e.data)){const s=Le.objectValues(n);return se(o,{received:o.data,code:ee.invalid_enum_value,options:s}),we}return Et(e.data)}get enum(){return this._def.values}}vi=new WeakMap,Bi.create=(t,e)=>new Bi({values:t,typeName:ve.ZodNativeEnum,...Be(e)});class xo extends Ve{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.promise&&n.common.async===!1)return se(n,{code:ee.invalid_type,expected:le.promise,received:n.parsedType}),we;const o=n.parsedType===le.promise?n.data:Promise.resolve(n.data);return Et(o.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}xo.create=(t,e)=>new xo({type:t,typeName:ve.ZodPromise,...Be(e)});class dn extends Ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:d=>{se(o,d),d.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const d=s.transform(o.data,l);if(o.common.async)return Promise.resolve(d).then(async u=>{if(n.value==="aborted")return we;const p=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return p.status==="aborted"?we:p.status==="dirty"||n.value==="dirty"?bs(p.value):p});{if(n.value==="aborted")return we;const u=this._def.schema._parseSync({data:d,path:o.path,parent:o});return u.status==="aborted"?we:u.status==="dirty"||n.value==="dirty"?bs(u.value):u}}if(s.type==="refinement"){const d=u=>{const p=s.refinement(u,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?we:(u.status==="dirty"&&n.dirty(),d(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?we:(u.status==="dirty"&&n.dirty(),d(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!gi(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:o.data,path:o.path,parent:o}).then(d=>gi(d)?Promise.resolve(s.transform(d.value,l)).then(u=>({status:n.value,value:u})):d);Le.assertNever(s)}}dn.create=(t,e,n)=>new dn({schema:t,typeName:ve.ZodEffects,effect:e,...Be(n)}),dn.createWithPreprocess=(t,e,n)=>new dn({schema:e,effect:{type:"preprocess",transform:t},typeName:ve.ZodEffects,...Be(n)});class Dn extends Ve{_parse(e){return this._getType(e)===le.undefined?Et(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Dn.create=(t,e)=>new Dn({innerType:t,typeName:ve.ZodOptional,...Be(e)});class vr extends Ve{_parse(e){return this._getType(e)===le.null?Et(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}vr.create=(t,e)=>new vr({innerType:t,typeName:ve.ZodNullable,...Be(e)});class Ai extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===le.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ai.create=(t,e)=>new Ai({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Be(e)});class Ni extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return yi(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ot(o.common.issues)},input:o.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ot(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Ni.create=(t,e)=>new Ni({innerType:t,typeName:ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Be(e)});class Bs extends Ve{_parse(e){if(this._getType(e)!==le.nan){const n=this._getOrReturnCtx(e);return se(n,{code:ee.invalid_type,expected:le.nan,received:n.parsedType}),we}return{status:"valid",value:e.data}}}Bs.create=t=>new Bs({typeName:ve.ZodNaN,...Be(t)});const $x=Symbol("zod_brand");class Al extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class Vi extends Ve{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?we:s.status==="dirty"?(n.dirty(),bs(s.value)):this._def.out._parseAsync({data:s.value,path:o.path,parent:o})})();{const s=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?we:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:o.path,parent:o})}}static create(e,n){return new Vi({in:e,out:n,typeName:ve.ZodPipeline})}}class Pi extends Ve{_parse(e){const n=this._def.innerType._parse(e),o=s=>(gi(s)&&(s.value=Object.freeze(s.value)),s);return yi(n)?n.then(s=>o(s)):o(n)}unwrap(){return this._def.innerType}}Pi.create=(t,e)=>new Pi({innerType:t,typeName:ve.ZodReadonly,...Be(e)});function Yu(t,e={},n){return t?Co.create().superRefine((o,s)=>{var l,d;if(!t(o)){const u=typeof e=="function"?e(o):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})}}):Co.create()}const Ux={object:et.lazycreate};var ve;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ve||(ve={}));const Wx=(t,e={message:`Input not instance of ${t.name}`})=>Yu(n=>n instanceof t,e),Ju=ln.create,Xu=mr.create,Hx=Bs.create,jx=gr.create,Qu=Ci.create,qx=$r.create,Kx=ks.create,Yx=wi.create,Jx=bi.create,Xx=Co.create,Qx=Ur.create,ek=$n.create,tk=Ss.create,nk=cn.create,rk=et.create,ok=et.strictCreate,ik=xi.create,sk=Es.create,ak=ki.create,lk=Pn.create,ck=Si.create,dk=Ts.create,uk=Wr.create,pk=bo.create,hk=Ei.create,fk=Ti.create,mk=_r.create,gk=Bi.create,yk=xo.create,ep=dn.create,_k=Dn.create,vk=vr.create,Ck=dn.createWithPreprocess,wk=Vi.create;var Fn=Object.freeze({__proto__:null,defaultErrorMap:vo,setErrorMap:Ex,getErrorMap:Cs,makeIssue:ws,EMPTY_PATH:Tx,addIssueToContext:se,ParseStatus:vt,INVALID:we,DIRTY:bs,OK:Et,isAborted:Sl,isDirty:El,isValid:gi,isAsync:yi,get util(){return Le},get objectUtil(){return kl},ZodParsedType:le,getParsedType:fr,ZodType:Ve,datetimeRegex:qu,ZodString:ln,ZodNumber:mr,ZodBigInt:gr,ZodBoolean:Ci,ZodDate:$r,ZodSymbol:ks,ZodUndefined:wi,ZodNull:bi,ZodAny:Co,ZodUnknown:Ur,ZodNever:$n,ZodVoid:Ss,ZodArray:cn,ZodObject:et,ZodUnion:xi,ZodDiscriminatedUnion:Es,ZodIntersection:ki,ZodTuple:Pn,ZodRecord:Si,ZodMap:Ts,ZodSet:Wr,ZodFunction:bo,ZodLazy:Ei,ZodLiteral:Ti,ZodEnum:_r,ZodNativeEnum:Bi,ZodPromise:xo,ZodEffects:dn,ZodTransformer:dn,ZodOptional:Dn,ZodNullable:vr,ZodDefault:Ai,ZodCatch:Ni,ZodNaN:Bs,BRAND:$x,ZodBranded:Al,ZodPipeline:Vi,ZodReadonly:Pi,custom:Yu,Schema:Ve,ZodSchema:Ve,late:Ux,get ZodFirstPartyTypeKind(){return ve},coerce:{string:t=>ln.create({...t,coerce:!0}),number:t=>mr.create({...t,coerce:!0}),boolean:t=>Ci.create({...t,coerce:!0}),bigint:t=>gr.create({...t,coerce:!0}),date:t=>$r.create({...t,coerce:!0})},any:Xx,array:nk,bigint:jx,boolean:Qu,date:qx,discriminatedUnion:sk,effect:ep,enum:mk,function:pk,instanceof:Wx,intersection:ak,lazy:hk,literal:fk,map:dk,nan:Hx,nativeEnum:gk,never:ek,null:Jx,nullable:vk,number:Xu,object:rk,oboolean:()=>Qu().optional(),onumber:()=>Xu().optional(),optional:_k,ostring:()=>Ju().optional(),pipeline:wk,preprocess:Ck,promise:yk,record:ck,set:uk,strictObject:ok,string:Ju,symbol:Kx,transformer:ep,tuple:lk,undefined:Yx,union:ik,unknown:Qx,void:tk,NEVER:we,ZodIssueCode:ee,quotelessJson:Sx,ZodError:Ot});function bk(t){throw new Error("Unexpected object: "+t)}const tp="upload://upload/",np="index://index/";function xk(t){return t.startsWith(tp)}function kk(t){return t.startsWith(np)}function rp(t){if(kk(t)){const e=t.slice(np.length);return JSON.parse(decodeURIComponent(e)).path}else if(xk(t)){const e=t.slice(tp.length);return JSON.parse(decodeURIComponent(e)).localPath}bk(t)}function Sk(t){return t.replace(/^.*[\\/]/,"")}function Ek(t){return Sk(rp(t))}Fn.object({__isRef:Fn.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Fn.string().describe("Upstream block id"),name:Fn.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();const Tk=Fn.object({type:Fn.string(),importance:Fn.number().optional(),id:Fn.string().optional(),label:Fn.string()});Fn.array(Tk);const Bk={key:0,ref:"label"},Ak={key:0,class:"required-icon"},Nk=["data-placeholder"],Vk={key:5,class:"pl-file-input__stats"},Pk={key:0,class:"pl-file-input__error"},Dk={key:1,class:"pl-file-input__helper"},op=r.defineComponent({__name:"PlFileInput",props:{modelValue:{},label:{default:void 0},required:{type:Boolean},dashed:{type:Boolean},extensions:{default:void 0},placeholder:{default:void 0},progress:{default:void 0},error:{default:void 0},helper:{default:void 0},cellStyle:{type:Boolean,default:!1},fileDialogTitle:{default:void 0},fileDialogCloseOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.reactive({fileDialogOpen:!1,error:""}),o=r.useSlots(),s=e,l=t,d=(L,$)=>{if(L)try{return $(L)}catch(I){return n.error=I instanceof Error?I.message:String(I),L}},u=r.computed(()=>d(l.modelValue,Ek)),p=r.computed(()=>d(l.modelValue,rp)),f=r.computed(()=>l.progress&&!l.progress.done),m=r.computed(()=>l.progress&&l.progress.done),y=r.computed(()=>n.error??l.error),B=r.computed(()=>!!y.value),T=r.computed(()=>{const{status:L,done:$}=l.progress??{};return!L||!L.bytesTotal?"":L.bytesProcessed&&!$?rl(L.bytesProcessed,{})+" / "+rl(L.bytesTotal,{}):rl(L.bytesTotal,{})}),N=r.computed(()=>{var L;const{progress:$}=l;return $?{width:$.done?"100%":Math.round((((L=$.status)==null?void 0:L.progress)??0)*100)+"%"}:{}}),M=()=>{n.fileDialogOpen=!0},G=L=>{L.files.length&&s("update:modelValue",L.files[0])},C=()=>s("update:modelValue",void 0);r.watch(()=>l.modelValue,()=>{n.error=""},{immediate:!0});const F=r.ref();return l.cellStyle||zn(F),(L,$)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"pl-file-input__cell-style":!!L.cellStyle,"has-file":!!u.value},"pl-file-input__envelope"])},[r.createElementVNode("div",{ref_key:"rootRef",ref:F,class:r.normalizeClass(["pl-file-input",{dashed:L.dashed,error:B.value}]),tabindex:"0",onKeyup:r.withKeys(M,["enter"]),onClick:r.withModifiers(M,["stop"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(N.value)},null,4),$[3]||($[3]=r.createTextVNode()),!L.cellStyle&&L.label?(r.openBlock(),r.createElementBlock("label",Bk,[L.required?(r.openBlock(),r.createElementBlock("i",Ak)):r.createCommentVNode("",!0),$[1]||($[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(L.label),1),$[2]||($[2]=r.createTextVNode()),r.unref(o).tooltip||p.value?(r.openBlock(),r.createBlock(r.unref(St),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.unref(o).tooltip?r.renderSlot(L.$slots,"tooltip",{key:0}):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(p.value),1)],64))]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),$[4]||($[4]=r.createTextVNode()),B.value?(r.openBlock(),r.createBlock(r.unref(Zn),{key:1,name:"restart"})):f.value?(r.openBlock(),r.createBlock(r.unref(Zn),{key:2,name:"cloud-upload"})):m.value?(r.openBlock(),r.createBlock(r.unref(Zn),{key:3,name:"success"})):(r.openBlock(),r.createBlock(r.unref(Zn),{key:4,name:"paper-clip"})),$[5]||($[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":L.placeholder??"Choose file",class:"pl-file-input__filename"},r.toDisplayString(u.value),9,Nk),$[6]||($[6]=r.createTextVNode()),T.value?(r.openBlock(),r.createElementBlock("div",Vk,r.toDisplayString(T.value),1)):r.createCommentVNode("",!0),$[7]||($[7]=r.createTextVNode()),L.modelValue?(r.openBlock(),r.createBlock(r.unref(Zn),{key:6,name:"close",onClick:r.withModifiers(C,["stop"])})):r.createCommentVNode("",!0),$[8]||($[8]=r.createTextVNode()),r.createVNode(pr,{class:"pl-file-input__contour"})],34),$[9]||($[9]=r.createTextVNode()),B.value?(r.openBlock(),r.createElementBlock("div",Pk,r.toDisplayString(y.value),1)):L.helper?(r.openBlock(),r.createElementBlock("div",Dk,r.toDisplayString(L.helper),1)):r.createCommentVNode("",!0)],2),$[10]||($[10]=r.createTextVNode()),r.createVNode(r.unref(Zu),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":$[0]||($[0]=I=>n.fileDialogOpen=I),extensions:L.extensions,title:L.fileDialogTitle,"close-on-outside-click":L.fileDialogCloseOnOutsideClick,"onImport:files":G},null,8,["modelValue","extensions","title","close-on-outside-click"])],64))}}),Fk={class:"pl-notification-alert__wrapper d-flex"},Rk={class:"pl-notification-alert__content flex-grow-1"},Mk={key:0,class:"pl-notification-alert__close"},Ik={key:0,class:"pl-notification-alert__actions d-flex"},ip=r.defineComponent({__name:"PlNotificationAlert",props:r.mergeModels({type:{default:"neutral"},width:{default:"256px"},closable:{type:Boolean}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=r.useModel(t,"modelValue");function o(){e.closable&&(n.value=!1)}return(s,l)=>n.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([s.type,"pl-notification-alert d-flex flex-column gap-16"]),style:r.normalizeStyle({width:`${s.width}`})},[r.createElementVNode("div",Fk,[r.createElementVNode("div",Rk,[r.renderSlot(s.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),s.closable?(r.openBlock(),r.createElementBlock("div",Mk,[r.createVNode(r.unref(fl),{icon:"close",onClick:o})])):r.createCommentVNode("",!0)]),l[1]||(l[1]=r.createTextVNode()),s.$slots.actions?(r.openBlock(),r.createElementBlock("div",Ik,[r.renderSlot(s.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),Ok=r.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(t){const e=t;return r.provide(e.contextKey,r.computed(()=>e.context)),(n,o)=>r.renderSlot(n.$slots,"default")}});function Ct(t,e,n){return e>t?e:t>n?n:t}const Nl=t=>r.computed(()=>{const e=[100],{min:n,max:o,step:s}=t.value;let l=n;for(;l<o;){l+=s;const d=(1-(Ct(l,n,o)-n)/(o-n))*100;e.push(d)}return e}),Lk={class:"ui-slider__wrapper"},Gk={class:"ui-slider__label-section"},zk={key:0,class:"text-s"},Zk={key:1,class:"ui-slider__value-static text-s"},$k={class:"ui-slider__base"},Uk={class:"ui-slider__container"},Wk={class:"ui-slider__container ui-slider__container-thumb"},Hk={class:"ui-slider__input-wrapper d-flex"},jk=["value"],qk={key:0,class:"ui-slider__error"},sp=r.defineComponent({__name:"Slider",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,s=t,l=r.reactive({deltaValue:0}),d=r.computed(()=>s.max-s.min),u=r.computed(()=>Ct((s.modelValue??0)+l.deltaValue,s.min,s.max)),p=r.ref(s.modelValue),f=r.computed(()=>{const I=s.modelValue;return Number.isFinite(I)?I<s.min?`Min value: ${s.min}`:I>s.max?`Max value: ${s.max}`:s.error:"Not a number"}),m=r.computed(()=>s),y=Nl(m),B=r.computed(()=>(u.value-s.min)/d.value),T=r.computed(()=>({right:Math.ceil((1-B.value)*100)+"%"})),N=r.computed(()=>({right:`calc(${Math.ceil((1-B.value)*100)}%) `})),M=r.ref(),G=r.ref();r.watch(()=>s.modelValue,I=>{p.value=I});function C(I){const Y=Ct(I,s.min,s.max);return Math.round((Y+Number.EPSILON)*(1/s.step))/(1/s.step)}cr(G,I=>{var Y;lt((Y=r.unref(M))==null?void 0:Y.getBoundingClientRect(),H=>{const{dx:D}=I;l.deltaValue=D/H.width*d.value,p.value=C(Ct((s.modelValue??0)+l.deltaValue,s.min,s.max)),I.stop&&(o("update:modelValue",C(u.value)),l.deltaValue=0)})});function F(I){o("update:modelValue",C(I))}function L(I){F(+I.target.value)}function $(I){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(I.code)&&I.preventDefault();const Y=I.code==="ArrowUp"||I.code==="ArrowRight"?s.step*1:I.code==="ArrowDown"||I.code==="ArrowLeft"?s.step*-1:0;F(s.modelValue+Y)}return(I,Y)=>(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",Lk,[r.createElementVNode("div",Gk,[I.label?(r.openBlock(),r.createElementBlock("label",zk,[r.createElementVNode("span",null,r.toDisplayString(I.label),1),Y[1]||(Y[1]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(I.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),Y[2]||(Y[2]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",Zk,r.toDisplayString(p.value)+r.toDisplayString(I.measure),1)):r.createCommentVNode("",!0)]),Y[6]||(Y[6]=r.createTextVNode()),r.createElementVNode("div",$k,[r.createElementVNode("div",Uk,[r.createElementVNode("div",{ref_key:"barRef",ref:M,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(T.value)},null,4)],512)]),Y[5]||(Y[5]=r.createTextVNode()),r.createElementVNode("div",Wk,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(y),(H,D)=>(r.openBlock(),r.createElementBlock("div",{key:D,style:r.normalizeStyle({right:`${H}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),Y[4]||(Y[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:G,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(N.value),onKeydown:$},Y[3]||(Y[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),Y[7]||(Y[7]=r.createTextVNode()),r.createElementVNode("div",Hk,[s.mode==="input"?(r.openBlock(),r.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:Y[0]||(Y[0]=H=>L(H))},null,40,jk)):r.createCommentVNode("",!0)])],2),Y[8]||(Y[8]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",qk,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],2))}});function Kk(t,e=null,n=null){function o(u){const{scrollTop:p,scrollHeight:f,clientHeight:m}=u;if(!(f>m)||!e)return null;const y=f-p-m,B=p>e?e:0,T=y>e?m-e-B:m;return`linear-gradient(
|
|
54
54
|
to bottom,
|
|
55
55
|
transparent,
|
|
56
|
-
black ${
|
|
57
|
-
black ${
|
|
56
|
+
black ${B}px,
|
|
57
|
+
black ${T}px,
|
|
58
58
|
transparent 100%
|
|
59
|
-
)`}function s(u){const{scrollLeft:p,scrollWidth:f,clientWidth:m}=u;if(!(f>m)||!n)return null;const y=f-p-m,
|
|
59
|
+
)`}function s(u){const{scrollLeft:p,scrollWidth:f,clientWidth:m}=u;if(!(f>m)||!n)return null;const y=f-p-m,B=p>n?n:0,T=y>n?m-n-B:m;return`linear-gradient(
|
|
60
60
|
to right,
|
|
61
61
|
transparent,
|
|
62
|
-
black ${
|
|
63
|
-
black ${
|
|
62
|
+
black ${B}px,
|
|
63
|
+
black ${T}px,
|
|
64
64
|
transparent 100%
|
|
65
|
-
)`}function l(){const u=t.value;if(!u)return;const p=[o(u),s(u)].filter(f=>f!==null);u.style.setProperty("-webkit-mask-image",p.join(",")),u.style.setProperty("mask-image",p.join(",")),p.length>1&&(u.style.setProperty("-webkit-mask-composite","source-in"),u.style.setProperty("mask-composite","source-in"))}const d=al(l);r.onMounted(l),rt(window,"scroll",d,!0),rt(window,"resize",d,!0)}function sp(t,e){Tu(()=>{lt(r.unref(t),n=>{Bu(n,()=>e(n))})}),r.onUnmounted(()=>{lt(r.unref(t),n=>{Au(n)})})}const vr={item:"sortable__item",animate:"sortable__animate"},Vi=t=>t.getBoundingClientRect().y,ap=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},Kk=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function Yk(t,e){const n={item:void 0,options(){var S;return[...((S=t.value)==null?void 0:S.children)??[]]}},o=r.computed(()=>n.options()),s=e.shakeBuffer??10,l=e.reorderDelay??100;function d(S){const A=e.handle?this.querySelector(e.handle):null;A&&!A.contains(S.target)||(this.classList.remove(vr.animate),this.classList.add(vr.item),n.item={el:this,y:S.y,dy:0,orderChanged:!1})}function u(S){const A=n.options();return A.slice(0,A.indexOf(S))}function p(S){const A=n.options();return A.slice(A.indexOf(S)+1)}function f(S,A){const O=n.options().filter(C=>C!==A),z=O.indexOf(S);return O.splice(z,0,A),O}function m(S,A){const O=n.options().filter(C=>C!==A),z=O.indexOf(S);return O.splice(z+1,0,A),O}function y(S,A){S.dy=A-S.y,S.el.style.setProperty("transform",`translateY(${S.dy}px)`)}function E(S){var A;if(!n.item)return;const{el:O}=n.item;if(!O.isConnected){n.item=void 0;return}const z=S.map(J=>Vi(J)),C=Vi(O);(A=t.value)==null||A.replaceChildren(...S);const R=Vi(O),G=S.map(J=>Vi(J)),$=[];for(let J=0;J<G.length;J++){const H=S[J];if(H===n.item.el)continue;const F=G[J],N=z[J]-F;H.style.transform=`translateY(${N}px)`,$.push(H)}const L=R-C;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)`),$.forEach(J=>J.classList.remove(vr.animate)),requestAnimationFrame(function(){$.forEach(J=>{J.classList.add(vr.animate),J.style.transform="",J.addEventListener("transitionend",()=>{J.classList.remove(vr.animate)})})})}rt(window,"mousemove",S=>{if(!n.item)return;const{el:A}=n.item;y(n.item,S.y);const O=Vi(n.item.el),z=Kk(n.item.el),C=u(A),R=p(A);C.forEach(G=>{const $=ap(G);O+s<$&&E(f(G,A))}),R.forEach(G=>{const $=ap(G);z-s>$&&E(m(G,A))})}),rt(window,"mouseup",()=>{if(!n.item)return;const{el:S,orderChanged:A}=n.item;S.classList.add(vr.animate),S.style.removeProperty("transform"),S.addEventListener("transitionend",()=>{S.classList.remove(vr.animate,vr.item)}),setTimeout(()=>{if(!A)return;const O=n.options().map(C=>Number(C.getAttribute("data-index"))),z=t.value;if(z){for(const C of n.options())z.removeChild(C);o.value.forEach(C=>{z.appendChild(C)})}e.onChange(O)},l),n.item=void 0}),r.watchEffect(()=>{o.value.forEach((S,A)=>{S.removeEventListener("mousedown",d),S.addEventListener("mousedown",d),S.setAttribute("data-index",String(A))})})}function Jk(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function Xk(t,e,n){const o=r.reactive({data:tl.deepClone(e(t.value)),changed:!1});return r.watch(()=>o.data,s=>{o.changed?n(tl.deepClone(s)):o.changed=!0},{deep:!0}),r.watch(t,s=>{Object.assign(o,{data:tl.deepClone(e(s)),changed:!1})},{deep:!0,immediate:!0}),o}function Qk(t){const e=r.reactive({isLoading:!1,result:void 0,error:void 0,async run(...n){this.isLoading=!0,this.error=void 0;try{this.result=await t(...n)}catch(o){this.error=o}finally{this.isLoading=!1}},debounce(n,o=1e3){return au(()=>{const s=n();this.run(...s).catch(console.error)},o)}});return e.run=e.run.bind(e),e}function eS(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 o(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",o)}function l(){var d;(d=r.unref(t))==null||d.removeEventListener("mousedown",o)}r.onMounted(s),r.onUnmounted(l)}const tS={class:"ui-slider__wrapper"},nS={class:"ui-slider__label-section"},rS={key:0,class:"text-s"},oS={class:"ui-slider__base"},iS={class:"ui-slider__container"},sS={class:"ui-slider__container ui-slider__container-thumb"},aS=["data-percent"],lS=["data-percent"],cS=["data-percent"],dS={key:0,class:"ui-slider__error"},uS=r.defineComponent({__name:"SliderRangeTriple",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:"%"},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),d=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(),m=r.computed(()=>s.max-s.min),y=r.computed(()=>s),E=Al(y),S=r.computed(()=>Ct((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),A=r.computed(()=>Ct((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),O=r.computed(()=>Ct((s.modelValue[2]??0)+l.deltaValue3,s.min,s.max)),z=r.computed(()=>{const P=s.modelValue;if(!(Array.isArray(P)&&P.length===3&&P.every(re=>Number.isFinite(re))))return"Expected model [number, number, number]";const U=[];return[...s.modelValue].forEach(re=>{re>s.max&&U.push(`Max model value must be lower than max props ${s.max}.`),re<s.min&&U.push("Min model value must be greater than max props.")}),U.length>0?U.join(" "):s.error}),C=r.computed(()=>(S.value-s.min)/m.value),R=r.computed(()=>(A.value-s.min)/m.value),G=r.computed(()=>(O.value-s.min)/m.value),$=r.computed(()=>M()),L=r.computed(()=>({right:$.value[0]+"%",left:100-$.value[2]+"%"})),J=r.computed(()=>({right:Math.ceil((1-C.value)*100)+"%"})),H=r.computed(()=>({right:Math.ceil((1-R.value)*100)+"%"})),F=r.computed(()=>({right:Math.ceil((1-G.value)*100)+"%"}));cr(u,P=>{var U;lt((U=r.unref(d))==null?void 0:U.getBoundingClientRect(),re=>{const{dx:se}=P;l.deltaValue1=se/re.width*m.value,u.value&&N(u.value,s.modelValue[0],l.deltaValue1),P.stop&&(K([j(S.value),j(A.value),j(O.value)]),l.deltaValue1=0)})}),cr(p,P=>{var U;lt((U=r.unref(d))==null?void 0:U.getBoundingClientRect(),re=>{const{dx:se}=P;l.deltaValue2=se/re.width*m.value,p.value&&N(p.value,s.modelValue[1],l.deltaValue2),P.stop&&(K([j(S.value),j(A.value),j(O.value)]),l.deltaValue2=0)})}),cr(f,P=>{var U;lt((U=r.unref(d))==null?void 0:U.getBoundingClientRect(),re=>{const{dx:se}=P;l.deltaValue3=se/re.width*m.value,f.value&&N(f.value,s.modelValue[2],l.deltaValue3),P.stop&&(K([j(S.value),j(A.value),j(O.value)]),l.deltaValue3=0)})});function N(P,U,re){const se=j(Ct((U??0)+re,s.min,s.max));P.dataset.percent=`${se}${s.measure}`,B()}function M(){const P=Math.ceil((1-C.value)*100),U=Math.ceil((1-R.value)*100),re=Math.ceil((1-G.value)*100);return[P,U,re].sort((se,Pe)=>se-Pe)}function j(P){const U=Ct(P,s.min,s.max);return Math.round((U+Number.EPSILON)*(1/s.step))/(1/s.step)}function K(P){o("update:modelValue",P)}function B(){const P=Number(J.value.right.substring(0,J.value.right.length-1)),U=Number(H.value.right.substring(0,H.value.right.length-1)),re=Number(F.value.right.substring(0,F.value.right.length-1)),se=[{r:P,th:u},{r:U,th:p},{r:re,th:f}].sort((Pe,He)=>Pe.r-He.r);se[0].th.value&&(se[0].th.value.dataset.hint="high"),se[1].th.value&&(se[1].th.value.dataset.hint="mid"),se[2].th.value&&(se[2].th.value.dataset.hint="low")}function x(P,U){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(P.code)&&P.preventDefault();const re=P.code==="ArrowUp"||P.code==="ArrowRight"?s.step*1:P.code==="ArrowDown"||P.code==="ArrowLeft"?s.step*-1:0,se=[...s.modelValue];se[U]=Ct(se[U]+re,s.min,s.max),K(se),B()}return r.onMounted(()=>{B()}),(P,U)=>(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",tS,[r.createElementVNode("div",nS,[P.label?(r.openBlock(),r.createElementBlock("label",rS,[r.createElementVNode("span",null,r.toDisplayString(P.label),1),U[3]||(U[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(P.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),U[11]||(U[11]=r.createTextVNode()),r.createElementVNode("div",oS,[r.createElementVNode("div",iS,[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)]),U[10]||(U[10]=r.createTextVNode()),r.createElementVNode("div",sS,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(E),(re,se)=>(r.openBlock(),r.createElementBlock("div",{key:se,style:r.normalizeStyle({right:`${re}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),U[7]||(U[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(J.value),"data-percent":s.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:U[0]||(U[0]=re=>x(re,0))},U[4]||(U[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,aS),U[8]||(U[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(H.value),"data-percent":s.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:U[1]||(U[1]=re=>x(re,1))},U[5]||(U[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,lS),U[9]||(U[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:f,style:r.normalizeStyle(F.value),"data-percent":s.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:U[2]||(U[2]=re=>x(re,2))},U[6]||(U[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,cS)])])]),U[12]||(U[12]=r.createTextVNode()),U[13]||(U[13]=r.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),U[14]||(U[14]=r.createTextVNode()),z.value?(r.openBlock(),r.createElementBlock("div",dS,r.toDisplayString(z.value),1)):r.createCommentVNode("",!0)],2))}}),pS={class:"ui-input-range__separator"},hS=r.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,s=r.reactive({left:n.modelValue[0],right:n.modelValue[1]}),l=r.ref(!1),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(){o("update:modelValue",[+s.left,+s.right]),o("change",[+s.left,+s.right])}function f(m,y){const E=y.target.value;/^[0-9]{0,2}$/.test(E)?m?s.left=+E:s.right=+E:m?s.left=+E.slice(0,E.length-1):s.right=+E.slice(0,E.length-1)}return(m,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:[d.value,"ui-input-range"]},m.$attrs),[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=E=>u.value.left=E),class:"text-s",type:"text",onChange:p,onFocus:y[1]||(y[1]=E=>l.value=!0),onFocusout:y[2]||(y[2]=E=>l.value=!1),onInput:y[3]||(y[3]=E=>f(!0,E))},null,544),[[r.vModelText,u.value.left]]),y[8]||(y[8]=r.createTextVNode()),r.createElementVNode("div",pS,r.toDisplayString(n.separator),1),y[9]||(y[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[4]||(y[4]=E=>u.value.right=E),class:"text-s",type:"text",onChange:p,onFocus:y[5]||(y[5]=E=>l.value=!0),onFocusout:y[6]||(y[6]=E=>l.value=!1),onInput:y[7]||(y[7]=E=>f(!1,E))},null,544),[[r.vModelText,u.value.right]])],16))}}),fS={class:"ui-slider__wrapper"},mS={class:"ui-slider__label-section"},gS={key:0,class:"text-s"},yS={key:1,class:"ui-slider__value-static text-s"},_S={class:"ui-slider__base"},vS={class:"ui-slider__container"},CS={class:"ui-slider__container ui-slider__container-thumb"},wS={class:"ui-slider__input-wrapper d-flex"},bS={key:0,class:"ui-slider__error"},xS=r.defineComponent({__name:"SliderRange",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0}),d=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(s.modelValue),m=r.ref(s.modelValue[0]),y=r.ref(s.modelValue[1]),E=r.computed(()=>s),S=Al(E),A=r.computed(()=>[m.value,y.value].sort((B,x)=>B-x).join("-")),O=r.computed(()=>s.max-s.min),z=r.computed(()=>Ct((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),C=r.computed(()=>Ct((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),R=r.computed(()=>{const B=s.modelValue;return Array.isArray(B)&&B.length===2&&B.every(x=>Number.isFinite(x))?s.error:"Expected model [number, number]"}),G=r.computed(()=>(z.value-s.min)/O.value),$=r.computed(()=>(C.value-s.min)/O.value),L=r.computed(()=>N()),J=r.computed(()=>({right:L.value[0]+"%",left:100-L.value[1]+"%"})),H=r.computed(()=>({right:Math.ceil((1-G.value)*100)+"%"})),F=r.computed(()=>({right:Math.ceil((1-$.value)*100)+"%"}));r.watch(()=>s.modelValue,B=>{f.value=B,m.value=+B[0],y.value=+B[1]},{immediate:!0}),cr(u,B=>{var x;lt((x=r.unref(d))==null?void 0:x.getBoundingClientRect(),P=>{const{dx:U}=B;l.deltaValue1=U/P.width*O.value,m.value=M(Ct((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),f.value=[m.value,y.value].sort((re,se)=>re-se),B.stop&&(j([M(z.value),M(C.value)]),l.deltaValue1=0)})}),cr(p,B=>{var x;lt((x=r.unref(d))==null?void 0:x.getBoundingClientRect(),P=>{const{dx:U}=B;l.deltaValue2=U/P.width*O.value,y.value=M(Ct((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),f.value=[m.value,y.value].sort((re,se)=>re-se),B.stop&&(j([M(z.value),M(C.value)]),l.deltaValue2=0)})});function N(){const B=Math.ceil((1-G.value)*100),x=Math.ceil((1-$.value)*100);return[B,x].sort((P,U)=>P-U)}function M(B){const x=Ct(B,s.min,s.max);return Math.round((x+Number.EPSILON)*(1/s.step))/(1/s.step)}function j(B){o("update:modelValue",B)}function K(B,x){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(B.code)&&B.preventDefault();const P=B.code==="ArrowUp"||B.code==="ArrowRight"?s.step*1:B.code==="ArrowDown"||B.code==="ArrowLeft"?s.step*-1:0,U=[...s.modelValue];U[x]=Ct(U[x]+P,s.min,s.max),j(U)}return(B,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",fS,[r.createElementVNode("div",mS,[B.label?(r.openBlock(),r.createElementBlock("label",gS,[r.createElementVNode("span",null,r.toDisplayString(B.label),1),x[3]||(x[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(B.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),x[4]||(x[4]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",yS,r.toDisplayString(A.value),1)):r.createCommentVNode("",!0)]),x[10]||(x[10]=r.createTextVNode()),r.createElementVNode("div",_S,[r.createElementVNode("div",vS,[r.createElementVNode("div",{ref_key:"barRef",ref:d,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(J.value)},null,4)],512)]),x[9]||(x[9]=r.createTextVNode()),r.createElementVNode("div",CS,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(S),(P,U)=>(r.openBlock(),r.createElementBlock("div",{key:U,style:r.normalizeStyle({right:`${P}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),x[7]||(x[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(H.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:x[0]||(x[0]=P=>K(P,0))},x[5]||(x[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),x[8]||(x[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(F.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:x[1]||(x[1]=P=>K(P,1))},x[6]||(x[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),x[11]||(x[11]=r.createTextVNode()),r.createElementVNode("div",wS,[s.mode==="input"?(r.openBlock(),r.createBlock(hS,{key:0,modelValue:f.value,"onUpdate:modelValue":x[2]||(x[2]=P=>f.value=P),class:"ui-focused-border",onChange:j},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),x[12]||(x[12]=r.createTextVNode()),R.value?(r.openBlock(),r.createElementBlock("div",bS,r.toDisplayString(R.value),1)):r.createCommentVNode("",!0)],2))}}),kS=r.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(t,{emit:e}){const n=e,o=t,s=r.ref(),l=r.computed(()=>o.clientHeight/(o.scrollHeight||1)),d=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{top:o.scrollTop*p+"px",height:Math.floor(o.clientHeight*p)+"px"}});return rt(s,"pointerdown",p=>{const f={clientY:p.clientY},m=yl(document,"mousemove",y=>{const E=(y.clientY-f.clientY)/l.value;n("update:scrollTop",o.scrollTop+E),f.clientY=y.clientY});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,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)}}),SS=r.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(t,{emit:e}){const n=e,o=t,s=r.ref(),l=r.computed(()=>o.clientWidth/(o.scrollWidth||1)),d=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{left:o.scrollLeft*p+"px",width:Math.floor(o.clientWidth*p)+"px"}});return rt(s,"pointerdown",p=>{const f={clientX:p.clientX},m=yl(document,"mousemove",y=>{const E=(y.clientX-f.clientX)/l.value;n("update:scrollLeft",o.scrollLeft+E),f.clientX=y.clientX});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,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)}}),ES={class:"ui-scrollable"},TS=r.defineComponent({__name:"Scrollable",setup(t){const e=r.ref(),n=r.reactive({scrollTop:0,scrollLeft:0,clientHeight:0,clientWidth:0,scrollHeight:0,scrollWidth:0});function o(u){HC(n,u,"scrollTop","scrollLeft","clientHeight","clientWidth","scrollHeight","scrollWidth")}const s=u=>{u.preventDefault();const p=u.currentTarget;p.scrollTop+=u.deltaY,p.scrollLeft+=u.deltaX,o(p)};function l(u){lt(r.unref(e),p=>{p.scrollTop=u,o(p)})}function d(u){lt(r.unref(e),p=>{p.scrollLeft=u,o(p)})}return sp(e,u=>{lt(u,p=>o(p))}),r.onMounted(()=>{lt(r.unref(e),u=>{o(u),u.addEventListener("wheel",s)})}),r.onUnmounted(()=>{lt(r.unref(e),u=>u.removeEventListener("wheel",s))}),(u,p)=>(r.openBlock(),r.createElementBlock("div",ES,[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(kS,{"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(SS,{"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"])]))}}),BS="add.svg",AS="box.svg",NS="calendar.svg",VS="checkmark.svg",PS="clipboard.svg",DS="close.svg",FS="copy.svg",RS="download.svg",MS="duplicate.svg",IS="edit.svg",OS="error.svg",LS="filter.svg",GS="help.svg",zS="info.svg",ZS="link.svg",$S="loading.svg",US="lock.svg",WS="maximize.svg",HS="minimize.svg",jS="minus.svg",qS="more.svg",KS="open.svg",YS="pause.svg",JS="play.svg",XS="renew.svg",QS="restart.svg",e1="reverse.svg",t1="settings.svg",n1="sort.svg",r1="stop.svg",o1="success.svg",i1="time.svg",s1="tune.svg",a1="warning.svg",l1="zip.svg",c1={add:BS,"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:AS,calendar:NS,"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:VS,"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:PS,close:DS,copy:FS,"data-dimentions":"data-dimentions.svg","delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg",download:RS,"drag-dots":"drag-dots.svg",duplicate:MS,edit:IS,error:OS,export:"export.svg","filter-on":"filter-on.svg",filter:LS,"help-outline":"help-outline.svg",help:GS,"info-outline":"info-outline.svg",info:zS,"jump-link":"jump-link.svg",link:ZS,loading:$S,lock:US,maximize:WS,minimize:HS,minus:jS,more:qS,open:KS,"paper-clip":"paper-clip.svg",pause:YS,play:JS,renew:XS,restart:QS,reverse:e1,settings:t1,sort:n1,stop:r1,success:o1,time:i1,tune:s1,warning:a1,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:l1},d1="add.svg",u1="annotate.svg",p1="annotation.svg",h1="area.svg",f1="axes.svg",m1="bar.svg",g1="bindot.svg",y1="box.svg",_1="boxplot.svg",v1="bubble.svg",C1="calendar.svg",w1="canvas.svg",b1="checkbox.svg",x1="checkmark.svg",k1="clipboard.svg",S1="close.svg",E1="cluster.svg",T1="code.svg",B1="color.svg",A1="columns.svg",N1="container.svg",V1="cookie.svg",P1="copy.svg",D1="cpu.svg",F1="debug.svg",R1="dna.svg",M1="download.svg",I1="duplicate.svg",O1="edit.svg",L1="error.svg",G1="filter.svg",z1="generate.svg",Z1="graph.svg",$1="heatmap.svg",U1="help.svg",W1="info.svg",H1="jitter.svg",j1="lasso.svg",q1="layers.svg",K1="learn.svg",Y1="legend.svg",J1="line.svg",X1="link.svg",Q1="loading.svg",eE="lock.svg",tE="maximize.svg",nE="menu.svg",rE="minimize.svg",oE="minus.svg",iE="more.svg",sE="pause.svg",aE="pin.svg",lE="play.svg",cE="product.svg",dE="publications.svg",uE="renew.svg",pE="restart.svg",hE="reverse.svg",fE="search.svg",mE="server.svg",gE="settings.svg",yE="sina.svg",_E="skatterplot.svg",vE="slice.svg",CE="sort.svg",wE="statistics.svg",bE="stop.svg",xE="success.svg",kE="table.svg",SE="template.svg",EE="terminal.svg",TE="time.svg",BE="tune.svg",AE="venn.svg",NE="violin.svg",VE="warning.svg",PE="wetlab.svg",DE="zip.svg",FE={"add-layer":"add-layer.svg",add:d1,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:u1,annotation:p1,area:h1,"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:f1,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:m1,bindot:g1,box:y1,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:_1,bubble:v1,calendar:C1,canvas:w1,"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:b1,checkmark:x1,"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:k1,close:S1,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:E1,code:T1,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:B1,columns:A1,"connected-points":"connected-points.svg",container:N1,cookie:V1,copy:P1,cpu:D1,"data-dimentions":"data-dimentions.svg",debug:F1,"delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg","dendrogram-X-line":"dendrogram-X-line.svg","dendrogram-X":"dendrogram-X.svg","dendrogram-Y-line":"dendrogram-Y-line.svg","dendrogram-Y":"dendrogram-Y.svg","dna-add":"dna-add.svg","dna-import":"dna-import.svg",dna:R1,download:M1,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:I1,edit:O1,"error-bar":"error-bar.svg",error:L1,"expand-left":"expand-left.svg","expand-right":"expand-right.svg",export:"export.svg","file-doc-add":"file-doc-add.svg","file-doc-download":"file-doc-download.svg","file-doc-import":"file-doc-import.svg","file-doc":"file-doc.svg","filter-on":"filter-on.svg",filter:G1,"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:z1,graph:Z1,heatmap:$1,"help-outline":"help-outline.svg",help:U1,"info-outline":"info-outline.svg",info:W1,jitter:H1,"jump-link":"jump-link.svg",lasso:j1,layers:q1,learn:K1,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:Y1,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:J1,"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:X1,loading:Q1,lock:eE,maximize:tE,menu:nE,minimize:rE,minus:oE,more:iE,"paper-clip":"paper-clip.svg",pause:sE,pin:aE,play:lE,"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:cE,publications:dE,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:uE,restart:pE,reverse:hE,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:fE,"server-on":"server-on.svg",server:mE,settings:gE,sina:yE,skatterplot:_E,slice:vE,"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:CE,statistics:wE,stop:bE,"strip-plot":"strip-plot.svg",success:xE,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:kE,template:SE,terminal:EE,"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:TE,tune:BE,venn:AE,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:NE,warning:VE,wetlab:PE,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:DE,"zoom-in":"zoom-in.svg","zoom-out":"zoom-out.svg"};function RE(){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 ME=["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"],IE=["add-layer","add","align-center","align-left","align-right","annotate","annotation","area","arrow-down","arrow-left","arrow-link","arrow-right","arrow-up","axes","bar-cross","bar-error","bar-stacked","bar-trend","bar","bindot","box","boxplot-binned","boxplot-jitter","boxplot-notched","boxplot","bubble","calendar","canvas","cell-type-num","cell-type-txt","checkbox-checked","checkbox-intermediate","checkbox","checkmark","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-sort","chevron-up","clipboard-copied","clipboard","close","cloud-download","cloud-offline","cloud-online","cloud-upload","cluster","code","color-fill","color-none","color-stroke","color","columns","connected-points","container","cookie","copy","cpu","data-dimentions","debug","delete-bin","delete-circle","delete-clear","dendrogram-X-line","dendrogram-X","dendrogram-Y-line","dendrogram-Y","dna-add","dna-import","dna","download","drag-dots","drag-horizontal","drag-vertical","duplicate","edit","error-bar","error","expand-left","expand-right","export","file-doc-add","file-doc-download","file-doc-import","file-doc","filter-on","filter","fire-tips","folder-parent","frame-type-all","frame-type-bottom","frame-type-left-bottom","frame-type-left","frame-type-none","generate","graph","heatmap","help-outline","help","info-outline","info","jitter","jump-link","lasso","layers","learn","legend-box-dot","legend-box","legend","line-binned","line-error","line-jitter","line","linetype-dashed","linetype-dotdash","linetype-dotted","linetype-longdash","linetype-solid","linetype-twodash","link-disabled","link","loading","lock","maximize","menu","minimize","minus","more","paper-clip","pause","pin","play","position-bottom-annotation","position-bottom","position-left-annotation","position-left","position-right-annotation","position-right","position-top-annotation","position-top","product","publications","radio-button-checked","radio-button","renew","restart","reverse","rotation-0","rotation-45","rotation-90","search","server-on","server","settings","sina","skatterplot","slice","social-github","social-linkedin","social-twitter-X","social-twitter-bird","social-youtube","sort-list-down","sort-list-up","sort","statistics","stop","strip-plot","success","table-add","table-alias","table-import","table","template","terminal","text-align-center","text-align-left","text-align-right","theme-dark","theme-light","time","tune","venn","view-hide","view-show","violin-binned","violin-jitter","violin","warning","wetlab","windows-collapse","windows-expand","x-axis","y-axis","zip","zoom-in","zoom-out"],OE={allCssVariables:RE(),icons16:c1,icons24:FE},LE={class:"block__not-found"},GE=r.defineComponent({__name:"NotFound",setup(t){const n=Xa().useApp(),o=()=>{n.updateNavigationState(s=>{s.href="/"})};return(s,l)=>(r.openBlock(),r.createElementBlock("div",LE,[r.createElementVNode("h1",null,"Not found route: "+r.toDisplayString(r.unref(n).snapshot.navigationState.href),1),r.createVNode(r.unref(pl),{onClick:r.withModifiers(o,["stop"])},{default:r.withCtx(()=>l[0]||(l[0]=[r.createTextVNode("Return to main page")])),_:1})]))}}),Ts=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},zE={},ZE={class:"block__loader-page"};function $E(t,e){return r.openBlock(),r.createElementBlock("div",ZE,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const UE=Ts(zE,[["render",$E]]),WE={class:"pl-app-notification-alert"},HE={class:"pl-app-notification-alert__content"},jE={class:"pl-app-notification-alert__title"},qE=r.defineComponent({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(t){const e=t,n=r.ref(!1),o=r.ref(!0),s=r.computed(()=>Object.entries(e.errors).filter(d=>!!d[1]));function l(){n.value=!0}return r.watch(()=>e.errors,d=>{o.value=Object.values(d).some(u=>!!u)},{immediate:!0,deep:!0}),(d,u)=>(r.openBlock(),r.createElementBlock("div",WE,[r.createVNode(r.unref(bl),{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=p=>n.value=p),width:"720px",style:{"max-height":"100vh"}},{title:r.withCtx(()=>u[2]||(u[2]=[r.createTextVNode(" Errors ")])),default:r.withCtx(()=>[r.createElementVNode("div",HE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,p=>{var f;return r.openBlock(),r.createElementBlock("div",{key:p[0],class:"pl-app-notification-alert__item"},[r.createElementVNode("div",jE,r.toDisplayString(p[0]),1),r.createVNode(r.unref(Lu),{value:(f=p[1])==null?void 0:f.message},null,8,["value"])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(op),{modelValue:o.value,"onUpdate:modelValue":u[1]||(u[1]=p=>o.value=p),type:"error",closable:""},{actions:r.withCtx(()=>[r.createVNode(r.unref(ul),{icon:"arrow-right",onClick:l},{default:r.withCtx(()=>u[3]||(u[3]=[r.createTextVNode("See errors")])),_:1}),r.createVNode(r.unref(Su))]),default:r.withCtx(()=>[u[4]||(u[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),KE={key:0,class:"block__loader"},YE=r.defineComponent({__name:"BlockLoader",props:{value:{type:[Boolean,Number]}},setup(t){const e=t,n=r.computed(()=>typeof e.value=="boolean"&&e.value),o=r.computed(()=>{const s=e.value;if(typeof s=="number")return s>=1?void 0:(s*100).toFixed(2)+"%"});return(s,l)=>n.value?(r.openBlock(),r.createElementBlock("div",KE)):o.value!==void 0?(r.openBlock(),r.createElementBlock("div",{key:1,class:"block__progress",style:r.normalizeStyle({"--progress-width":o.value})},null,4)):r.createCommentVNode("",!0)}}),JE={class:"block block__layout"},XE={key:0},QE=r.defineComponent({__name:"BlockLayout",setup(t){const e=Xa(),n=f=>{try{return new URL(f,"http://dummy").pathname}catch{console.error("Invalid href",f);return}},o=r.computed(()=>e.loaded?e.useApp().href:void 0),s=r.computed(()=>{if(e.loaded){const f=e.useApp(),m=n(f.snapshot.navigationState.href);return m?f.getRoute(m):void 0}}),l=r.computed(()=>e.loaded?e.useApp():void 0),d=r.computed(()=>l.value?l.value.model.outputErrors:{}),u=r.computed(()=>{var f;return((f=l.value)==null?void 0:f.showErrorsNotification)??!0}),p=r.computed(()=>{var f,m;return(m=(f=l.value)==null?void 0:f.progress)==null?void 0:m.call(f)});return(f,m)=>(r.openBlock(),r.createElementBlock("div",JE,[r.createVNode(YE,{value:p.value},null,8,["value"]),r.unref(e).error?(r.openBlock(),r.createElementBlock("div",XE,r.toDisplayString(r.unref(e).error),1)):r.unref(e).loaded?s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(s.value),{key:o.value})):(r.openBlock(),r.createBlock(GE,{key:3})):(r.openBlock(),r.createBlock(UE,{key:1},{default:r.withCtx(()=>m[0]||(m[0]=[r.createTextVNode("Loading...")])),_:1})),r.unref(e).loaded&&u.value?(r.openBlock(),r.createBlock(r.unref(qE),{key:4,errors:d.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var Bs={exports:{}};/**
|
|
65
|
+
)`}function l(){const u=t.value;if(!u)return;const p=[o(u),s(u)].filter(f=>f!==null);u.style.setProperty("-webkit-mask-image",p.join(",")),u.style.setProperty("mask-image",p.join(",")),p.length>1&&(u.style.setProperty("-webkit-mask-composite","source-in"),u.style.setProperty("mask-composite","source-in"))}const d=ll(l);r.onMounted(l),rt(window,"scroll",d,!0),rt(window,"resize",d,!0)}function ap(t,e){Bu(()=>{lt(r.unref(t),n=>{Au(n,()=>e(n))})}),r.onUnmounted(()=>{lt(r.unref(t),n=>{Nu(n)})})}const Cr={item:"sortable__item",animate:"sortable__animate"},Di=t=>t.getBoundingClientRect().y,lp=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},Yk=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function Jk(t,e){const n={item:void 0,options(){var T;return[...((T=t.value)==null?void 0:T.children)??[]]}},o=r.computed(()=>n.options()),s=e.shakeBuffer??10,l=e.reorderDelay??100;function d(T){const N=e.handle?this.querySelector(e.handle):null;N&&!N.contains(T.target)||(this.classList.remove(Cr.animate),this.classList.add(Cr.item),n.item={el:this,y:T.y,dy:0,orderChanged:!1})}function u(T){const N=n.options();return N.slice(0,N.indexOf(T))}function p(T){const N=n.options();return N.slice(N.indexOf(T)+1)}function f(T,N){const M=n.options().filter(C=>C!==N),G=M.indexOf(T);return M.splice(G,0,N),M}function m(T,N){const M=n.options().filter(C=>C!==N),G=M.indexOf(T);return M.splice(G+1,0,N),M}function y(T,N){T.dy=N-T.y,T.el.style.setProperty("transform",`translateY(${T.dy}px)`)}function B(T){var N;if(!n.item)return;const{el:M}=n.item;if(!M.isConnected){n.item=void 0;return}const G=T.map(Y=>Di(Y)),C=Di(M);(N=t.value)==null||N.replaceChildren(...T);const F=Di(M),L=T.map(Y=>Di(Y)),$=[];for(let Y=0;Y<L.length;Y++){const H=T[Y];if(H===n.item.el)continue;const D=L[Y],K=G[Y]-D;H.style.transform=`translateY(${K}px)`,$.push(H)}const I=F-C;n.item.y=n.item.y+I,n.item.dy=n.item.dy-I,n.item.orderChanged=!0,n.item.el.style.setProperty("transform",`translateY(${n.item.dy}px)`),$.forEach(Y=>Y.classList.remove(Cr.animate)),requestAnimationFrame(function(){$.forEach(Y=>{Y.classList.add(Cr.animate),Y.style.transform="",Y.addEventListener("transitionend",()=>{Y.classList.remove(Cr.animate)})})})}rt(window,"mousemove",T=>{if(!n.item)return;const{el:N}=n.item;y(n.item,T.y);const M=Di(n.item.el),G=Yk(n.item.el),C=u(N),F=p(N);C.forEach(L=>{const $=lp(L);M+s<$&&B(f(L,N))}),F.forEach(L=>{const $=lp(L);G-s>$&&B(m(L,N))})}),rt(window,"mouseup",()=>{if(!n.item)return;const{el:T,orderChanged:N}=n.item;T.classList.add(Cr.animate),T.style.removeProperty("transform"),T.addEventListener("transitionend",()=>{T.classList.remove(Cr.animate,Cr.item)}),setTimeout(()=>{if(!N)return;const M=n.options().map(C=>Number(C.getAttribute("data-index"))),G=t.value;if(G){for(const C of n.options())G.removeChild(C);o.value.forEach(C=>{G.appendChild(C)})}e.onChange(M)},l),n.item=void 0}),r.watchEffect(()=>{o.value.forEach((T,N)=>{T.removeEventListener("mousedown",d),T.addEventListener("mousedown",d),T.setAttribute("data-index",String(N))})})}function Xk(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function Qk(t,e,n){const o=r.reactive({data:nl.deepClone(e(t.value)),changed:!1});return r.watch(()=>o.data,s=>{o.changed?n(nl.deepClone(s)):o.changed=!0},{deep:!0}),r.watch(t,s=>{Object.assign(o,{data:nl.deepClone(e(s)),changed:!1})},{deep:!0,immediate:!0}),o}function eS(t){const e=r.reactive({isLoading:!1,result:void 0,error:void 0,async run(...n){this.isLoading=!0,this.error=void 0;try{this.result=await t(...n)}catch(o){this.error=o}finally{this.isLoading=!1}},debounce(n,o=1e3){return lu(()=>{const s=n();this.run(...s).catch(console.error)},o)}});return e.run=e.run.bind(e),e}function tS(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 o(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",o)}function l(){var d;(d=r.unref(t))==null||d.removeEventListener("mousedown",o)}r.onMounted(s),r.onUnmounted(l)}const nS={class:"ui-slider__wrapper"},rS={class:"ui-slider__label-section"},oS={key:0,class:"text-s"},iS={class:"ui-slider__base"},sS={class:"ui-slider__container"},aS={class:"ui-slider__container ui-slider__container-thumb"},lS=["data-percent"],cS=["data-percent"],dS=["data-percent"],uS={key:0,class:"ui-slider__error"},pS=r.defineComponent({__name:"SliderRangeTriple",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:"%"},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),d=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(),m=r.computed(()=>s.max-s.min),y=r.computed(()=>s),B=Nl(y),T=r.computed(()=>Ct((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),N=r.computed(()=>Ct((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),M=r.computed(()=>Ct((s.modelValue[2]??0)+l.deltaValue3,s.min,s.max)),G=r.computed(()=>{const k=s.modelValue;if(!(Array.isArray(k)&&k.length===3&&k.every(te=>Number.isFinite(te))))return"Expected model [number, number, number]";const Z=[];return[...s.modelValue].forEach(te=>{te>s.max&&Z.push(`Max model value must be lower than max props ${s.max}.`),te<s.min&&Z.push("Min model value must be greater than max props.")}),Z.length>0?Z.join(" "):s.error}),C=r.computed(()=>(T.value-s.min)/m.value),F=r.computed(()=>(N.value-s.min)/m.value),L=r.computed(()=>(M.value-s.min)/m.value),$=r.computed(()=>U()),I=r.computed(()=>({right:$.value[0]+"%",left:100-$.value[2]+"%"})),Y=r.computed(()=>({right:Math.ceil((1-C.value)*100)+"%"})),H=r.computed(()=>({right:Math.ceil((1-F.value)*100)+"%"})),D=r.computed(()=>({right:Math.ceil((1-L.value)*100)+"%"}));cr(u,k=>{var Z;lt((Z=r.unref(d))==null?void 0:Z.getBoundingClientRect(),te=>{const{dx:ne}=k;l.deltaValue1=ne/te.width*m.value,u.value&&K(u.value,s.modelValue[0],l.deltaValue1),k.stop&&(O([X(T.value),X(N.value),X(M.value)]),l.deltaValue1=0)})}),cr(p,k=>{var Z;lt((Z=r.unref(d))==null?void 0:Z.getBoundingClientRect(),te=>{const{dx:ne}=k;l.deltaValue2=ne/te.width*m.value,p.value&&K(p.value,s.modelValue[1],l.deltaValue2),k.stop&&(O([X(T.value),X(N.value),X(M.value)]),l.deltaValue2=0)})}),cr(f,k=>{var Z;lt((Z=r.unref(d))==null?void 0:Z.getBoundingClientRect(),te=>{const{dx:ne}=k;l.deltaValue3=ne/te.width*m.value,f.value&&K(f.value,s.modelValue[2],l.deltaValue3),k.stop&&(O([X(T.value),X(N.value),X(M.value)]),l.deltaValue3=0)})});function K(k,Z,te){const ne=X(Ct((Z??0)+te,s.min,s.max));k.dataset.percent=`${ne}${s.measure}`,E()}function U(){const k=Math.ceil((1-C.value)*100),Z=Math.ceil((1-F.value)*100),te=Math.ceil((1-L.value)*100);return[k,Z,te].sort((ne,be)=>ne-be)}function X(k){const Z=Ct(k,s.min,s.max);return Math.round((Z+Number.EPSILON)*(1/s.step))/(1/s.step)}function O(k){o("update:modelValue",k)}function E(){const k=Number(Y.value.right.substring(0,Y.value.right.length-1)),Z=Number(H.value.right.substring(0,H.value.right.length-1)),te=Number(D.value.right.substring(0,D.value.right.length-1)),ne=[{r:k,th:u},{r:Z,th:p},{r:te,th:f}].sort((be,Ze)=>be.r-Ze.r);ne[0].th.value&&(ne[0].th.value.dataset.hint="high"),ne[1].th.value&&(ne[1].th.value.dataset.hint="mid"),ne[2].th.value&&(ne[2].th.value.dataset.hint="low")}function w(k,Z){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(k.code)&&k.preventDefault();const te=k.code==="ArrowUp"||k.code==="ArrowRight"?s.step*1:k.code==="ArrowDown"||k.code==="ArrowLeft"?s.step*-1:0,ne=[...s.modelValue];ne[Z]=Ct(ne[Z]+te,s.min,s.max),O(ne),E()}return r.onMounted(()=>{E()}),(k,Z)=>(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",nS,[r.createElementVNode("div",rS,[k.label?(r.openBlock(),r.createElementBlock("label",oS,[r.createElementVNode("span",null,r.toDisplayString(k.label),1),Z[3]||(Z[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(k.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),Z[11]||(Z[11]=r.createTextVNode()),r.createElementVNode("div",iS,[r.createElementVNode("div",sS,[r.createElementVNode("div",{ref_key:"barRef",ref:d,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(I.value)},null,4)],512)]),Z[10]||(Z[10]=r.createTextVNode()),r.createElementVNode("div",aS,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(B),(te,ne)=>(r.openBlock(),r.createElementBlock("div",{key:ne,style:r.normalizeStyle({right:`${te}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),Z[7]||(Z[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(Y.value),"data-percent":s.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:Z[0]||(Z[0]=te=>w(te,0))},Z[4]||(Z[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,lS),Z[8]||(Z[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(H.value),"data-percent":s.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:Z[1]||(Z[1]=te=>w(te,1))},Z[5]||(Z[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,cS),Z[9]||(Z[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:f,style:r.normalizeStyle(D.value),"data-percent":s.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:Z[2]||(Z[2]=te=>w(te,2))},Z[6]||(Z[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,dS)])])]),Z[12]||(Z[12]=r.createTextVNode()),Z[13]||(Z[13]=r.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),Z[14]||(Z[14]=r.createTextVNode()),G.value?(r.openBlock(),r.createElementBlock("div",uS,r.toDisplayString(G.value),1)):r.createCommentVNode("",!0)],2))}}),hS={class:"ui-input-range__separator"},fS=r.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,s=r.reactive({left:n.modelValue[0],right:n.modelValue[1]}),l=r.ref(!1),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(){o("update:modelValue",[+s.left,+s.right]),o("change",[+s.left,+s.right])}function f(m,y){const B=y.target.value;/^[0-9]{0,2}$/.test(B)?m?s.left=+B:s.right=+B:m?s.left=+B.slice(0,B.length-1):s.right=+B.slice(0,B.length-1)}return(m,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:[d.value,"ui-input-range"]},m.$attrs),[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=B=>u.value.left=B),class:"text-s",type:"text",onChange:p,onFocus:y[1]||(y[1]=B=>l.value=!0),onFocusout:y[2]||(y[2]=B=>l.value=!1),onInput:y[3]||(y[3]=B=>f(!0,B))},null,544),[[r.vModelText,u.value.left]]),y[8]||(y[8]=r.createTextVNode()),r.createElementVNode("div",hS,r.toDisplayString(n.separator),1),y[9]||(y[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[4]||(y[4]=B=>u.value.right=B),class:"text-s",type:"text",onChange:p,onFocus:y[5]||(y[5]=B=>l.value=!0),onFocusout:y[6]||(y[6]=B=>l.value=!1),onInput:y[7]||(y[7]=B=>f(!1,B))},null,544),[[r.vModelText,u.value.right]])],16))}}),mS={class:"ui-slider__wrapper"},gS={class:"ui-slider__label-section"},yS={key:0,class:"text-s"},_S={key:1,class:"ui-slider__value-static text-s"},vS={class:"ui-slider__base"},CS={class:"ui-slider__container"},wS={class:"ui-slider__container ui-slider__container-thumb"},bS={class:"ui-slider__input-wrapper d-flex"},xS={key:0,class:"ui-slider__error"},kS=r.defineComponent({__name:"SliderRange",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0}),d=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(s.modelValue),m=r.ref(s.modelValue[0]),y=r.ref(s.modelValue[1]),B=r.computed(()=>s),T=Nl(B),N=r.computed(()=>[m.value,y.value].sort((E,w)=>E-w).join("-")),M=r.computed(()=>s.max-s.min),G=r.computed(()=>Ct((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),C=r.computed(()=>Ct((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),F=r.computed(()=>{const E=s.modelValue;return Array.isArray(E)&&E.length===2&&E.every(w=>Number.isFinite(w))?s.error:"Expected model [number, number]"}),L=r.computed(()=>(G.value-s.min)/M.value),$=r.computed(()=>(C.value-s.min)/M.value),I=r.computed(()=>K()),Y=r.computed(()=>({right:I.value[0]+"%",left:100-I.value[1]+"%"})),H=r.computed(()=>({right:Math.ceil((1-L.value)*100)+"%"})),D=r.computed(()=>({right:Math.ceil((1-$.value)*100)+"%"}));r.watch(()=>s.modelValue,E=>{f.value=E,m.value=+E[0],y.value=+E[1]},{immediate:!0}),cr(u,E=>{var w;lt((w=r.unref(d))==null?void 0:w.getBoundingClientRect(),k=>{const{dx:Z}=E;l.deltaValue1=Z/k.width*M.value,m.value=U(Ct((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),f.value=[m.value,y.value].sort((te,ne)=>te-ne),E.stop&&(X([U(G.value),U(C.value)]),l.deltaValue1=0)})}),cr(p,E=>{var w;lt((w=r.unref(d))==null?void 0:w.getBoundingClientRect(),k=>{const{dx:Z}=E;l.deltaValue2=Z/k.width*M.value,y.value=U(Ct((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),f.value=[m.value,y.value].sort((te,ne)=>te-ne),E.stop&&(X([U(G.value),U(C.value)]),l.deltaValue2=0)})});function K(){const E=Math.ceil((1-L.value)*100),w=Math.ceil((1-$.value)*100);return[E,w].sort((k,Z)=>k-Z)}function U(E){const w=Ct(E,s.min,s.max);return Math.round((w+Number.EPSILON)*(1/s.step))/(1/s.step)}function X(E){o("update:modelValue",E)}function O(E,w){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(E.code)&&E.preventDefault();const k=E.code==="ArrowUp"||E.code==="ArrowRight"?s.step*1:E.code==="ArrowDown"||E.code==="ArrowLeft"?s.step*-1:0,Z=[...s.modelValue];Z[w]=Ct(Z[w]+k,s.min,s.max),X(Z)}return(E,w)=>(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",mS,[r.createElementVNode("div",gS,[E.label?(r.openBlock(),r.createElementBlock("label",yS,[r.createElementVNode("span",null,r.toDisplayString(E.label),1),w[3]||(w[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(St),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(E.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),w[4]||(w[4]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",_S,r.toDisplayString(N.value),1)):r.createCommentVNode("",!0)]),w[10]||(w[10]=r.createTextVNode()),r.createElementVNode("div",vS,[r.createElementVNode("div",CS,[r.createElementVNode("div",{ref_key:"barRef",ref:d,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(Y.value)},null,4)],512)]),w[9]||(w[9]=r.createTextVNode()),r.createElementVNode("div",wS,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(T),(k,Z)=>(r.openBlock(),r.createElementBlock("div",{key:Z,style:r.normalizeStyle({right:`${k}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),w[7]||(w[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(H.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:w[0]||(w[0]=k=>O(k,0))},w[5]||(w[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),w[8]||(w[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(D.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:w[1]||(w[1]=k=>O(k,1))},w[6]||(w[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),w[11]||(w[11]=r.createTextVNode()),r.createElementVNode("div",bS,[s.mode==="input"?(r.openBlock(),r.createBlock(fS,{key:0,modelValue:f.value,"onUpdate:modelValue":w[2]||(w[2]=k=>f.value=k),class:"ui-focused-border",onChange:X},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),w[12]||(w[12]=r.createTextVNode()),F.value?(r.openBlock(),r.createElementBlock("div",xS,r.toDisplayString(F.value),1)):r.createCommentVNode("",!0)],2))}}),SS=r.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(t,{emit:e}){const n=e,o=t,s=r.ref(),l=r.computed(()=>o.clientHeight/(o.scrollHeight||1)),d=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{top:o.scrollTop*p+"px",height:Math.floor(o.clientHeight*p)+"px"}});return rt(s,"pointerdown",p=>{const f={clientY:p.clientY},m=_l(document,"mousemove",y=>{const B=(y.clientY-f.clientY)/l.value;n("update:scrollTop",o.scrollTop+B),f.clientY=y.clientY});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,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)}}),ES=r.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(t,{emit:e}){const n=e,o=t,s=r.ref(),l=r.computed(()=>o.clientWidth/(o.scrollWidth||1)),d=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{left:o.scrollLeft*p+"px",width:Math.floor(o.clientWidth*p)+"px"}});return rt(s,"pointerdown",p=>{const f={clientX:p.clientX},m=_l(document,"mousemove",y=>{const B=(y.clientX-f.clientX)/l.value;n("update:scrollLeft",o.scrollLeft+B),f.clientX=y.clientX});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,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)}}),TS={class:"ui-scrollable"},BS=r.defineComponent({__name:"Scrollable",setup(t){const e=r.ref(),n=r.reactive({scrollTop:0,scrollLeft:0,clientHeight:0,clientWidth:0,scrollHeight:0,scrollWidth:0});function o(u){jC(n,u,"scrollTop","scrollLeft","clientHeight","clientWidth","scrollHeight","scrollWidth")}const s=u=>{u.preventDefault();const p=u.currentTarget;p.scrollTop+=u.deltaY,p.scrollLeft+=u.deltaX,o(p)};function l(u){lt(r.unref(e),p=>{p.scrollTop=u,o(p)})}function d(u){lt(r.unref(e),p=>{p.scrollLeft=u,o(p)})}return ap(e,u=>{lt(u,p=>o(p))}),r.onMounted(()=>{lt(r.unref(e),u=>{o(u),u.addEventListener("wheel",s)})}),r.onUnmounted(()=>{lt(r.unref(e),u=>u.removeEventListener("wheel",s))}),(u,p)=>(r.openBlock(),r.createElementBlock("div",TS,[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(SS,{"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(ES,{"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"])]))}}),AS="add.svg",NS="box.svg",VS="calendar.svg",PS="checkmark.svg",DS="clipboard.svg",FS="close.svg",RS="copy.svg",MS="download.svg",IS="duplicate.svg",OS="edit.svg",LS="error.svg",GS="filter.svg",zS="help.svg",ZS="info.svg",$S="link.svg",US="loading.svg",WS="lock.svg",HS="maximize.svg",jS="minimize.svg",qS="minus.svg",KS="more.svg",YS="open.svg",JS="pause.svg",XS="play.svg",QS="renew.svg",e1="restart.svg",t1="reverse.svg",n1="settings.svg",r1="sort.svg",o1="stop.svg",i1="success.svg",s1="time.svg",a1="tune.svg",l1="warning.svg",c1="zip.svg",d1={add: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",box:NS,calendar:VS,"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:PS,"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:DS,close:FS,copy:RS,"data-dimentions":"data-dimentions.svg","delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg",download:MS,"drag-dots":"drag-dots.svg",duplicate:IS,edit:OS,error:LS,export:"export.svg","filter-on":"filter-on.svg",filter:GS,"help-outline":"help-outline.svg",help:zS,"info-outline":"info-outline.svg",info:ZS,"jump-link":"jump-link.svg",link:$S,loading:US,lock:WS,maximize:HS,minimize:jS,minus:qS,more:KS,open:YS,"paper-clip":"paper-clip.svg",pause:JS,play:XS,renew:QS,restart:e1,reverse:t1,settings:n1,sort:r1,stop:o1,success:i1,time:s1,tune:a1,warning:l1,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:c1},u1="add.svg",p1="annotate.svg",h1="annotation.svg",f1="area.svg",m1="axes.svg",g1="bar.svg",y1="bindot.svg",_1="box.svg",v1="boxplot.svg",C1="bubble.svg",w1="calendar.svg",b1="canvas.svg",x1="checkbox.svg",k1="checkmark.svg",S1="clipboard.svg",E1="close.svg",T1="cluster.svg",B1="code.svg",A1="color.svg",N1="columns.svg",V1="container.svg",P1="cookie.svg",D1="copy.svg",F1="cpu.svg",R1="debug.svg",M1="dna.svg",I1="download.svg",O1="duplicate.svg",L1="edit.svg",G1="error.svg",z1="filter.svg",Z1="generate.svg",$1="graph.svg",U1="heatmap.svg",W1="help.svg",H1="info.svg",j1="jitter.svg",q1="lasso.svg",K1="layers.svg",Y1="learn.svg",J1="legend.svg",X1="line.svg",Q1="link.svg",eE="loading.svg",tE="lock.svg",nE="maximize.svg",rE="menu.svg",oE="minimize.svg",iE="minus.svg",sE="more.svg",aE="pause.svg",lE="pin.svg",cE="play.svg",dE="product.svg",uE="publications.svg",pE="renew.svg",hE="restart.svg",fE="reverse.svg",mE="search.svg",gE="server.svg",yE="settings.svg",_E="sina.svg",vE="skatterplot.svg",CE="slice.svg",wE="sort.svg",bE="statistics.svg",xE="stop.svg",kE="success.svg",SE="table.svg",EE="template.svg",TE="terminal.svg",BE="time.svg",AE="tune.svg",NE="venn.svg",VE="violin.svg",PE="warning.svg",DE="wetlab.svg",FE="zip.svg",RE={"add-layer":"add-layer.svg",add:u1,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:p1,annotation:h1,area:f1,"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:m1,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:g1,bindot:y1,box:_1,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:v1,bubble:C1,calendar:w1,canvas:b1,"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:x1,checkmark:k1,"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:S1,close:E1,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:T1,code:B1,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:A1,columns:N1,"connected-points":"connected-points.svg",container:V1,cookie:P1,copy:D1,cpu:F1,"data-dimentions":"data-dimentions.svg",debug:R1,"delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg","dendrogram-X-line":"dendrogram-X-line.svg","dendrogram-X":"dendrogram-X.svg","dendrogram-Y-line":"dendrogram-Y-line.svg","dendrogram-Y":"dendrogram-Y.svg","dna-add":"dna-add.svg","dna-import":"dna-import.svg",dna:M1,download:I1,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:O1,edit:L1,"error-bar":"error-bar.svg",error:G1,"expand-left":"expand-left.svg","expand-right":"expand-right.svg",export:"export.svg","file-doc-add":"file-doc-add.svg","file-doc-download":"file-doc-download.svg","file-doc-import":"file-doc-import.svg","file-doc":"file-doc.svg","filter-on":"filter-on.svg",filter:z1,"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:Z1,graph:$1,heatmap:U1,"help-outline":"help-outline.svg",help:W1,"info-outline":"info-outline.svg",info:H1,jitter:j1,"jump-link":"jump-link.svg",lasso:q1,layers:K1,learn:Y1,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:J1,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:X1,"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:Q1,loading:eE,lock:tE,maximize:nE,menu:rE,minimize:oE,minus:iE,more:sE,"paper-clip":"paper-clip.svg",pause:aE,pin:lE,play:cE,"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:dE,publications:uE,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:pE,restart:hE,reverse:fE,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:mE,"server-on":"server-on.svg",server:gE,settings:yE,sina:_E,skatterplot:vE,slice:CE,"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:wE,statistics:bE,stop:xE,"strip-plot":"strip-plot.svg",success:kE,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:SE,template:EE,terminal:TE,"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:BE,tune:AE,venn:NE,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:VE,warning:PE,wetlab:DE,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:FE,"zoom-in":"zoom-in.svg","zoom-out":"zoom-out.svg"};function ME(){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 IE=["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"],OE=["add-layer","add","align-center","align-left","align-right","annotate","annotation","area","arrow-down","arrow-left","arrow-link","arrow-right","arrow-up","axes","bar-cross","bar-error","bar-stacked","bar-trend","bar","bindot","box","boxplot-binned","boxplot-jitter","boxplot-notched","boxplot","bubble","calendar","canvas","cell-type-num","cell-type-txt","checkbox-checked","checkbox-intermediate","checkbox","checkmark","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-sort","chevron-up","clipboard-copied","clipboard","close","cloud-download","cloud-offline","cloud-online","cloud-upload","cluster","code","color-fill","color-none","color-stroke","color","columns","connected-points","container","cookie","copy","cpu","data-dimentions","debug","delete-bin","delete-circle","delete-clear","dendrogram-X-line","dendrogram-X","dendrogram-Y-line","dendrogram-Y","dna-add","dna-import","dna","download","drag-dots","drag-horizontal","drag-vertical","duplicate","edit","error-bar","error","expand-left","expand-right","export","file-doc-add","file-doc-download","file-doc-import","file-doc","filter-on","filter","fire-tips","folder-parent","frame-type-all","frame-type-bottom","frame-type-left-bottom","frame-type-left","frame-type-none","generate","graph","heatmap","help-outline","help","info-outline","info","jitter","jump-link","lasso","layers","learn","legend-box-dot","legend-box","legend","line-binned","line-error","line-jitter","line","linetype-dashed","linetype-dotdash","linetype-dotted","linetype-longdash","linetype-solid","linetype-twodash","link-disabled","link","loading","lock","maximize","menu","minimize","minus","more","paper-clip","pause","pin","play","position-bottom-annotation","position-bottom","position-left-annotation","position-left","position-right-annotation","position-right","position-top-annotation","position-top","product","publications","radio-button-checked","radio-button","renew","restart","reverse","rotation-0","rotation-45","rotation-90","search","server-on","server","settings","sina","skatterplot","slice","social-github","social-linkedin","social-twitter-X","social-twitter-bird","social-youtube","sort-list-down","sort-list-up","sort","statistics","stop","strip-plot","success","table-add","table-alias","table-import","table","template","terminal","text-align-center","text-align-left","text-align-right","theme-dark","theme-light","time","tune","venn","view-hide","view-show","violin-binned","violin-jitter","violin","warning","wetlab","windows-collapse","windows-expand","x-axis","y-axis","zip","zoom-in","zoom-out"],LE={allCssVariables:ME(),icons16:d1,icons24:RE},GE={class:"block__not-found"},zE=r.defineComponent({__name:"NotFound",setup(t){const n=Qa().useApp(),o=()=>{n.updateNavigationState(s=>{s.href="/"})};return(s,l)=>(r.openBlock(),r.createElementBlock("div",GE,[r.createElementVNode("h1",null,"Not found route: "+r.toDisplayString(r.unref(n).snapshot.navigationState.href),1),r.createVNode(r.unref(hl),{onClick:r.withModifiers(o,["stop"])},{default:r.withCtx(()=>l[0]||(l[0]=[r.createTextVNode("Return to main page")])),_:1})]))}}),As=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},ZE={},$E={class:"block__loader-page"};function UE(t,e){return r.openBlock(),r.createElementBlock("div",$E,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const WE=As(ZE,[["render",UE]]),HE={class:"pl-app-notification-alert"},jE={class:"pl-app-notification-alert__content"},qE={class:"pl-app-notification-alert__title"},KE=r.defineComponent({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(t){const e=t,n=r.ref(!1),o=r.ref(!0),s=r.computed(()=>Object.entries(e.errors).filter(d=>!!d[1]));function l(){n.value=!0}return r.watch(()=>e.errors,d=>{o.value=Object.values(d).some(u=>!!u)},{immediate:!0,deep:!0}),(d,u)=>(r.openBlock(),r.createElementBlock("div",HE,[r.createVNode(r.unref(xl),{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=p=>n.value=p),width:"720px",style:{"max-height":"100vh"}},{title:r.withCtx(()=>u[2]||(u[2]=[r.createTextVNode(" Errors ")])),default:r.withCtx(()=>[r.createElementVNode("div",jE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,p=>{var f;return r.openBlock(),r.createElementBlock("div",{key:p[0],class:"pl-app-notification-alert__item"},[r.createElementVNode("div",qE,r.toDisplayString(p[0]),1),r.createVNode(r.unref(Gu),{value:(f=p[1])==null?void 0:f.message},null,8,["value"])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(ip),{modelValue:o.value,"onUpdate:modelValue":u[1]||(u[1]=p=>o.value=p),type:"error",closable:""},{actions:r.withCtx(()=>[r.createVNode(r.unref(pl),{icon:"arrow-right",onClick:l},{default:r.withCtx(()=>u[3]||(u[3]=[r.createTextVNode("See errors")])),_:1}),r.createVNode(r.unref(Eu))]),default:r.withCtx(()=>[u[4]||(u[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),YE={key:0,class:"block__loader"},JE=r.defineComponent({__name:"BlockLoader",props:{value:{type:[Boolean,Number]}},setup(t){const e=t,n=r.computed(()=>typeof e.value=="boolean"&&e.value),o=r.computed(()=>{const s=e.value;if(typeof s=="number")return s>=1?void 0:(s*100).toFixed(2)+"%"});return(s,l)=>n.value?(r.openBlock(),r.createElementBlock("div",YE)):o.value!==void 0?(r.openBlock(),r.createElementBlock("div",{key:1,class:"block__progress",style:r.normalizeStyle({"--progress-width":o.value})},null,4)):r.createCommentVNode("",!0)}}),XE={class:"block block__layout"},QE={key:0},eT=r.defineComponent({__name:"BlockLayout",setup(t){const e=Qa(),n=f=>{try{return new URL(f,"http://dummy").pathname}catch{console.error("Invalid href",f);return}},o=r.computed(()=>e.loaded?e.useApp().href:void 0),s=r.computed(()=>{if(e.loaded){const f=e.useApp(),m=n(f.snapshot.navigationState.href);return m?f.getRoute(m):void 0}}),l=r.computed(()=>e.loaded?e.useApp():void 0),d=r.computed(()=>l.value?l.value.model.outputErrors:{}),u=r.computed(()=>{var f;return((f=l.value)==null?void 0:f.showErrorsNotification)??!0}),p=r.computed(()=>{var f,m;return(m=(f=l.value)==null?void 0:f.progress)==null?void 0:m.call(f)});return(f,m)=>(r.openBlock(),r.createElementBlock("div",XE,[r.createVNode(JE,{value:p.value},null,8,["value"]),r.unref(e).error?(r.openBlock(),r.createElementBlock("div",QE,r.toDisplayString(r.unref(e).error),1)):r.unref(e).loaded?s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(s.value),{key:o.value})):(r.openBlock(),r.createBlock(zE,{key:3})):(r.openBlock(),r.createBlock(WE,{key:1},{default:r.withCtx(()=>m[0]||(m[0]=[r.createTextVNode("Loading...")])),_:1})),r.unref(e).loaded&&u.value?(r.openBlock(),r.createBlock(r.unref(KE),{key:4,errors:d.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var Ns={exports:{}};/**
|
|
66
66
|
* @license
|
|
67
67
|
* Lodash <https://lodash.com/>
|
|
68
68
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
69
69
|
* Released under MIT license <https://lodash.com/license>
|
|
70
70
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
71
71
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
72
|
-
*/Bs.exports,function(t,e){(function(){var n,o="4.17.21",s=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",u="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",f=500,m="__lodash_placeholder__",y=1,E=2,S=4,A=1,O=2,z=1,C=2,R=4,G=8,$=16,L=32,J=64,H=128,F=256,N=512,M=30,j="...",K=800,B=16,x=1,P=2,U=3,re=1/0,se=9007199254740991,Pe=17976931348623157e292,He=NaN,ot=4294967295,vn=ot-1,Rn=ot>>>1,br=[["ary",H],["bind",z],["bindKey",C],["curry",G],["curryRight",$],["flip",N],["partial",L],["partialRight",J],["rearg",F]],Wn="[object Arguments]",Kr="[object Array]",Ps="[object AsyncFunction]",ze="[object Boolean]",xr="[object Date]",IT="[object DOMException]",Ds="[object Error]",Fs="[object Function]",xp="[object GeneratorFunction]",Cn="[object Map]",Fi="[object Number]",OT="[object Null]",Hn="[object Object]",kp="[object Promise]",LT="[object Proxy]",Ri="[object RegExp]",wn="[object Set]",Mi="[object String]",Rs="[object Symbol]",GT="[object Undefined]",Ii="[object WeakMap]",zT="[object WeakSet]",Oi="[object ArrayBuffer]",To="[object DataView]",Rl="[object Float32Array]",Ml="[object Float64Array]",Il="[object Int8Array]",Ol="[object Int16Array]",Ll="[object Int32Array]",Gl="[object Uint8Array]",zl="[object Uint8ClampedArray]",Zl="[object Uint16Array]",$l="[object Uint32Array]",ZT=/\b__p \+= '';/g,$T=/\b(__p \+=) '' \+/g,UT=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Sp=/&(?:amp|lt|gt|quot|#39);/g,Ep=/[&<>"']/g,WT=RegExp(Sp.source),HT=RegExp(Ep.source),jT=/<%-([\s\S]+?)%>/g,qT=/<%([\s\S]+?)%>/g,Tp=/<%=([\s\S]+?)%>/g,KT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,YT=/^\w*$/,JT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ul=/[\\^$.*+?()[\]{}|]/g,XT=RegExp(Ul.source),Wl=/^\s+/,QT=/\s/,eB=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,tB=/\{\n\/\* \[wrapped with (.+)\] \*/,nB=/,? & /,rB=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,oB=/[()=,{}\[\]\/\s]/,iB=/\\(\\)?/g,sB=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Bp=/\w*$/,aB=/^[-+]0x[0-9a-f]+$/i,lB=/^0b[01]+$/i,cB=/^\[object .+?Constructor\]$/,dB=/^0o[0-7]+$/i,uB=/^(?:0|[1-9]\d*)$/,pB=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ms=/($^)/,hB=/['\n\r\u2028\u2029\\]/g,Is="\\ud800-\\udfff",fB="\\u0300-\\u036f",mB="\\ufe20-\\ufe2f",gB="\\u20d0-\\u20ff",Ap=fB+mB+gB,Np="\\u2700-\\u27bf",Vp="a-z\\xdf-\\xf6\\xf8-\\xff",yB="\\xac\\xb1\\xd7\\xf7",_B="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vB="\\u2000-\\u206f",CB=" \\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",Pp="A-Z\\xc0-\\xd6\\xd8-\\xde",Dp="\\ufe0e\\ufe0f",Fp=yB+_B+vB+CB,Hl="['’]",wB="["+Is+"]",Rp="["+Fp+"]",Os="["+Ap+"]",Mp="\\d+",bB="["+Np+"]",Ip="["+Vp+"]",Op="[^"+Is+Fp+Mp+Np+Vp+Pp+"]",jl="\\ud83c[\\udffb-\\udfff]",xB="(?:"+Os+"|"+jl+")",Lp="[^"+Is+"]",ql="(?:\\ud83c[\\udde6-\\uddff]){2}",Kl="[\\ud800-\\udbff][\\udc00-\\udfff]",Bo="["+Pp+"]",Gp="\\u200d",zp="(?:"+Ip+"|"+Op+")",kB="(?:"+Bo+"|"+Op+")",Zp="(?:"+Hl+"(?:d|ll|m|re|s|t|ve))?",$p="(?:"+Hl+"(?:D|LL|M|RE|S|T|VE))?",Up=xB+"?",Wp="["+Dp+"]?",SB="(?:"+Gp+"(?:"+[Lp,ql,Kl].join("|")+")"+Wp+Up+")*",EB="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",TB="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Hp=Wp+Up+SB,BB="(?:"+[bB,ql,Kl].join("|")+")"+Hp,AB="(?:"+[Lp+Os+"?",Os,ql,Kl,wB].join("|")+")",NB=RegExp(Hl,"g"),VB=RegExp(Os,"g"),Yl=RegExp(jl+"(?="+jl+")|"+AB+Hp,"g"),PB=RegExp([Bo+"?"+Ip+"+"+Zp+"(?="+[Rp,Bo,"$"].join("|")+")",kB+"+"+$p+"(?="+[Rp,Bo+zp,"$"].join("|")+")",Bo+"?"+zp+"+"+Zp,Bo+"+"+$p,TB,EB,Mp,BB].join("|"),"g"),DB=RegExp("["+Gp+Is+Ap+Dp+"]"),FB=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,RB=["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"],MB=-1,Ye={};Ye[Rl]=Ye[Ml]=Ye[Il]=Ye[Ol]=Ye[Ll]=Ye[Gl]=Ye[zl]=Ye[Zl]=Ye[$l]=!0,Ye[Wn]=Ye[Kr]=Ye[Oi]=Ye[ze]=Ye[To]=Ye[xr]=Ye[Ds]=Ye[Fs]=Ye[Cn]=Ye[Fi]=Ye[Hn]=Ye[Ri]=Ye[wn]=Ye[Mi]=Ye[Ii]=!1;var qe={};qe[Wn]=qe[Kr]=qe[Oi]=qe[To]=qe[ze]=qe[xr]=qe[Rl]=qe[Ml]=qe[Il]=qe[Ol]=qe[Ll]=qe[Cn]=qe[Fi]=qe[Hn]=qe[Ri]=qe[wn]=qe[Mi]=qe[Rs]=qe[Gl]=qe[zl]=qe[Zl]=qe[$l]=!0,qe[Ds]=qe[Fs]=qe[Ii]=!1;var IB={À:"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"},OB={"&":"&","<":"<",">":">",'"':""","'":"'"},LB={"&":"&","<":"<",">":">",""":'"',"'":"'"},GB={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zB=parseFloat,ZB=parseInt,jp=typeof Zo=="object"&&Zo&&Zo.Object===Object&&Zo,$B=typeof self=="object"&&self&&self.Object===Object&&self,gt=jp||$B||Function("return this")(),Jl=e&&!e.nodeType&&e,Yr=Jl&&!0&&t&&!t.nodeType&&t,qp=Yr&&Yr.exports===Jl,Xl=qp&&jp.process,Yt=function(){try{var V=Yr&&Yr.require&&Yr.require("util").types;return V||Xl&&Xl.binding&&Xl.binding("util")}catch{}}(),Kp=Yt&&Yt.isArrayBuffer,Yp=Yt&&Yt.isDate,Jp=Yt&&Yt.isMap,Xp=Yt&&Yt.isRegExp,Qp=Yt&&Yt.isSet,eh=Yt&&Yt.isTypedArray;function $t(V,W,Z){switch(Z.length){case 0:return V.call(W);case 1:return V.call(W,Z[0]);case 2:return V.call(W,Z[0],Z[1]);case 3:return V.call(W,Z[0],Z[1],Z[2])}return V.apply(W,Z)}function UB(V,W,Z,ce){for(var xe=-1,Ze=V==null?0:V.length;++xe<Ze;){var dt=V[xe];W(ce,dt,Z(dt),V)}return ce}function Jt(V,W){for(var Z=-1,ce=V==null?0:V.length;++Z<ce&&W(V[Z],Z,V)!==!1;);return V}function WB(V,W){for(var Z=V==null?0:V.length;Z--&&W(V[Z],Z,V)!==!1;);return V}function th(V,W){for(var Z=-1,ce=V==null?0:V.length;++Z<ce;)if(!W(V[Z],Z,V))return!1;return!0}function kr(V,W){for(var Z=-1,ce=V==null?0:V.length,xe=0,Ze=[];++Z<ce;){var dt=V[Z];W(dt,Z,V)&&(Ze[xe++]=dt)}return Ze}function Ls(V,W){var Z=V==null?0:V.length;return!!Z&&Ao(V,W,0)>-1}function Ql(V,W,Z){for(var ce=-1,xe=V==null?0:V.length;++ce<xe;)if(Z(W,V[ce]))return!0;return!1}function Xe(V,W){for(var Z=-1,ce=V==null?0:V.length,xe=Array(ce);++Z<ce;)xe[Z]=W(V[Z],Z,V);return xe}function Sr(V,W){for(var Z=-1,ce=W.length,xe=V.length;++Z<ce;)V[xe+Z]=W[Z];return V}function ec(V,W,Z,ce){var xe=-1,Ze=V==null?0:V.length;for(ce&&Ze&&(Z=V[++xe]);++xe<Ze;)Z=W(Z,V[xe],xe,V);return Z}function HB(V,W,Z,ce){var xe=V==null?0:V.length;for(ce&&xe&&(Z=V[--xe]);xe--;)Z=W(Z,V[xe],xe,V);return Z}function tc(V,W){for(var Z=-1,ce=V==null?0:V.length;++Z<ce;)if(W(V[Z],Z,V))return!0;return!1}var jB=nc("length");function qB(V){return V.split("")}function KB(V){return V.match(rB)||[]}function nh(V,W,Z){var ce;return Z(V,function(xe,Ze,dt){if(W(xe,Ze,dt))return ce=Ze,!1}),ce}function Gs(V,W,Z,ce){for(var xe=V.length,Ze=Z+(ce?1:-1);ce?Ze--:++Ze<xe;)if(W(V[Ze],Ze,V))return Ze;return-1}function Ao(V,W,Z){return W===W?aA(V,W,Z):Gs(V,rh,Z)}function YB(V,W,Z,ce){for(var xe=Z-1,Ze=V.length;++xe<Ze;)if(ce(V[xe],W))return xe;return-1}function rh(V){return V!==V}function oh(V,W){var Z=V==null?0:V.length;return Z?oc(V,W)/Z:He}function nc(V){return function(W){return W==null?n:W[V]}}function rc(V){return function(W){return V==null?n:V[W]}}function ih(V,W,Z,ce,xe){return xe(V,function(Ze,dt,je){Z=ce?(ce=!1,Ze):W(Z,Ze,dt,je)}),Z}function JB(V,W){var Z=V.length;for(V.sort(W);Z--;)V[Z]=V[Z].value;return V}function oc(V,W){for(var Z,ce=-1,xe=V.length;++ce<xe;){var Ze=W(V[ce]);Ze!==n&&(Z=Z===n?Ze:Z+Ze)}return Z}function ic(V,W){for(var Z=-1,ce=Array(V);++Z<V;)ce[Z]=W(Z);return ce}function XB(V,W){return Xe(W,function(Z){return[Z,V[Z]]})}function sh(V){return V&&V.slice(0,dh(V)+1).replace(Wl,"")}function Ut(V){return function(W){return V(W)}}function sc(V,W){return Xe(W,function(Z){return V[Z]})}function Li(V,W){return V.has(W)}function ah(V,W){for(var Z=-1,ce=V.length;++Z<ce&&Ao(W,V[Z],0)>-1;);return Z}function lh(V,W){for(var Z=V.length;Z--&&Ao(W,V[Z],0)>-1;);return Z}function QB(V,W){for(var Z=V.length,ce=0;Z--;)V[Z]===W&&++ce;return ce}var eA=rc(IB),tA=rc(OB);function nA(V){return"\\"+GB[V]}function rA(V,W){return V==null?n:V[W]}function No(V){return DB.test(V)}function oA(V){return FB.test(V)}function iA(V){for(var W,Z=[];!(W=V.next()).done;)Z.push(W.value);return Z}function ac(V){var W=-1,Z=Array(V.size);return V.forEach(function(ce,xe){Z[++W]=[xe,ce]}),Z}function ch(V,W){return function(Z){return V(W(Z))}}function Er(V,W){for(var Z=-1,ce=V.length,xe=0,Ze=[];++Z<ce;){var dt=V[Z];(dt===W||dt===m)&&(V[Z]=m,Ze[xe++]=Z)}return Ze}function zs(V){var W=-1,Z=Array(V.size);return V.forEach(function(ce){Z[++W]=ce}),Z}function sA(V){var W=-1,Z=Array(V.size);return V.forEach(function(ce){Z[++W]=[ce,ce]}),Z}function aA(V,W,Z){for(var ce=Z-1,xe=V.length;++ce<xe;)if(V[ce]===W)return ce;return-1}function lA(V,W,Z){for(var ce=Z+1;ce--;)if(V[ce]===W)return ce;return ce}function Vo(V){return No(V)?dA(V):jB(V)}function bn(V){return No(V)?uA(V):qB(V)}function dh(V){for(var W=V.length;W--&&QT.test(V.charAt(W)););return W}var cA=rc(LB);function dA(V){for(var W=Yl.lastIndex=0;Yl.test(V);)++W;return W}function uA(V){return V.match(Yl)||[]}function pA(V){return V.match(PB)||[]}var hA=function V(W){W=W==null?gt:Po.defaults(gt.Object(),W,Po.pick(gt,RB));var Z=W.Array,ce=W.Date,xe=W.Error,Ze=W.Function,dt=W.Math,je=W.Object,lc=W.RegExp,fA=W.String,Xt=W.TypeError,Zs=Z.prototype,mA=Ze.prototype,Do=je.prototype,$s=W["__core-js_shared__"],Us=mA.toString,We=Do.hasOwnProperty,gA=0,uh=function(){var i=/[^.]+$/.exec($s&&$s.keys&&$s.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),Ws=Do.toString,yA=Us.call(je),_A=gt._,vA=lc("^"+Us.call(We).replace(Ul,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hs=qp?W.Buffer:n,Tr=W.Symbol,js=W.Uint8Array,ph=Hs?Hs.allocUnsafe:n,qs=ch(je.getPrototypeOf,je),hh=je.create,fh=Do.propertyIsEnumerable,Ks=Zs.splice,mh=Tr?Tr.isConcatSpreadable:n,Gi=Tr?Tr.iterator:n,Jr=Tr?Tr.toStringTag:n,Ys=function(){try{var i=no(je,"defineProperty");return i({},"",{}),i}catch{}}(),CA=W.clearTimeout!==gt.clearTimeout&&W.clearTimeout,wA=ce&&ce.now!==gt.Date.now&&ce.now,bA=W.setTimeout!==gt.setTimeout&&W.setTimeout,Js=dt.ceil,Xs=dt.floor,cc=je.getOwnPropertySymbols,xA=Hs?Hs.isBuffer:n,gh=W.isFinite,kA=Zs.join,SA=ch(je.keys,je),ut=dt.max,bt=dt.min,EA=ce.now,TA=W.parseInt,yh=dt.random,BA=Zs.reverse,dc=no(W,"DataView"),zi=no(W,"Map"),uc=no(W,"Promise"),Fo=no(W,"Set"),Zi=no(W,"WeakMap"),$i=no(je,"create"),Qs=Zi&&new Zi,Ro={},AA=ro(dc),NA=ro(zi),VA=ro(uc),PA=ro(Fo),DA=ro(Zi),ea=Tr?Tr.prototype:n,Ui=ea?ea.valueOf:n,_h=ea?ea.toString:n;function _(i){if(nt(i)&&!ke(i)&&!(i instanceof Fe)){if(i instanceof Qt)return i;if(We.call(i,"__wrapped__"))return Cf(i)}return new Qt(i)}var Mo=function(){function i(){}return function(a){if(!tt(a))return{};if(hh)return hh(a);i.prototype=a;var c=new i;return i.prototype=n,c}}();function ta(){}function Qt(i,a){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}_.templateSettings={escape:jT,evaluate:qT,interpolate:Tp,variable:"",imports:{_}},_.prototype=ta.prototype,_.prototype.constructor=_,Qt.prototype=Mo(ta.prototype),Qt.prototype.constructor=Qt;function Fe(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ot,this.__views__=[]}function FA(){var i=new Fe(this.__wrapped__);return i.__actions__=Dt(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=Dt(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=Dt(this.__views__),i}function RA(){if(this.__filtered__){var i=new Fe(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function MA(){var i=this.__wrapped__.value(),a=this.__dir__,c=ke(i),h=a<0,g=c?i.length:0,v=qN(0,g,this.__views__),k=v.start,T=v.end,D=T-k,q=h?T:k-1,Y=this.__iteratees__,X=Y.length,ne=0,ue=bt(D,this.__takeCount__);if(!c||!h&&g==D&&ue==D)return Zh(i,this.__actions__);var ge=[];e:for(;D--&&ne<ue;){q+=a;for(var Ne=-1,ye=i[q];++Ne<X;){var De=Y[Ne],Re=De.iteratee,jt=De.type,Vt=Re(ye);if(jt==P)ye=Vt;else if(!Vt){if(jt==x)continue e;break e}}ge[ne++]=ye}return ge}Fe.prototype=Mo(ta.prototype),Fe.prototype.constructor=Fe;function Xr(i){var a=-1,c=i==null?0:i.length;for(this.clear();++a<c;){var h=i[a];this.set(h[0],h[1])}}function IA(){this.__data__=$i?$i(null):{},this.size=0}function OA(i){var a=this.has(i)&&delete this.__data__[i];return this.size-=a?1:0,a}function LA(i){var a=this.__data__;if($i){var c=a[i];return c===p?n:c}return We.call(a,i)?a[i]:n}function GA(i){var a=this.__data__;return $i?a[i]!==n:We.call(a,i)}function zA(i,a){var c=this.__data__;return this.size+=this.has(i)?0:1,c[i]=$i&&a===n?p:a,this}Xr.prototype.clear=IA,Xr.prototype.delete=OA,Xr.prototype.get=LA,Xr.prototype.has=GA,Xr.prototype.set=zA;function jn(i){var a=-1,c=i==null?0:i.length;for(this.clear();++a<c;){var h=i[a];this.set(h[0],h[1])}}function ZA(){this.__data__=[],this.size=0}function $A(i){var a=this.__data__,c=na(a,i);if(c<0)return!1;var h=a.length-1;return c==h?a.pop():Ks.call(a,c,1),--this.size,!0}function UA(i){var a=this.__data__,c=na(a,i);return c<0?n:a[c][1]}function WA(i){return na(this.__data__,i)>-1}function HA(i,a){var c=this.__data__,h=na(c,i);return h<0?(++this.size,c.push([i,a])):c[h][1]=a,this}jn.prototype.clear=ZA,jn.prototype.delete=$A,jn.prototype.get=UA,jn.prototype.has=WA,jn.prototype.set=HA;function qn(i){var a=-1,c=i==null?0:i.length;for(this.clear();++a<c;){var h=i[a];this.set(h[0],h[1])}}function jA(){this.size=0,this.__data__={hash:new Xr,map:new(zi||jn),string:new Xr}}function qA(i){var a=fa(this,i).delete(i);return this.size-=a?1:0,a}function KA(i){return fa(this,i).get(i)}function YA(i){return fa(this,i).has(i)}function JA(i,a){var c=fa(this,i),h=c.size;return c.set(i,a),this.size+=c.size==h?0:1,this}qn.prototype.clear=jA,qn.prototype.delete=qA,qn.prototype.get=KA,qn.prototype.has=YA,qn.prototype.set=JA;function Qr(i){var a=-1,c=i==null?0:i.length;for(this.__data__=new qn;++a<c;)this.add(i[a])}function XA(i){return this.__data__.set(i,p),this}function QA(i){return this.__data__.has(i)}Qr.prototype.add=Qr.prototype.push=XA,Qr.prototype.has=QA;function xn(i){var a=this.__data__=new jn(i);this.size=a.size}function eN(){this.__data__=new jn,this.size=0}function tN(i){var a=this.__data__,c=a.delete(i);return this.size=a.size,c}function nN(i){return this.__data__.get(i)}function rN(i){return this.__data__.has(i)}function oN(i,a){var c=this.__data__;if(c instanceof jn){var h=c.__data__;if(!zi||h.length<s-1)return h.push([i,a]),this.size=++c.size,this;c=this.__data__=new qn(h)}return c.set(i,a),this.size=c.size,this}xn.prototype.clear=eN,xn.prototype.delete=tN,xn.prototype.get=nN,xn.prototype.has=rN,xn.prototype.set=oN;function vh(i,a){var c=ke(i),h=!c&&oo(i),g=!c&&!h&&Pr(i),v=!c&&!h&&!g&&Go(i),k=c||h||g||v,T=k?ic(i.length,fA):[],D=T.length;for(var q in i)(a||We.call(i,q))&&!(k&&(q=="length"||g&&(q=="offset"||q=="parent")||v&&(q=="buffer"||q=="byteLength"||q=="byteOffset")||Xn(q,D)))&&T.push(q);return T}function Ch(i){var a=i.length;return a?i[bc(0,a-1)]:n}function iN(i,a){return ma(Dt(i),eo(a,0,i.length))}function sN(i){return ma(Dt(i))}function pc(i,a,c){(c!==n&&!kn(i[a],c)||c===n&&!(a in i))&&Kn(i,a,c)}function Wi(i,a,c){var h=i[a];(!(We.call(i,a)&&kn(h,c))||c===n&&!(a in i))&&Kn(i,a,c)}function na(i,a){for(var c=i.length;c--;)if(kn(i[c][0],a))return c;return-1}function aN(i,a,c,h){return Br(i,function(g,v,k){a(h,g,c(g),k)}),h}function wh(i,a){return i&&In(a,mt(a),i)}function lN(i,a){return i&&In(a,Rt(a),i)}function Kn(i,a,c){a=="__proto__"&&Ys?Ys(i,a,{configurable:!0,enumerable:!0,value:c,writable:!0}):i[a]=c}function hc(i,a){for(var c=-1,h=a.length,g=Z(h),v=i==null;++c<h;)g[c]=v?n:jc(i,a[c]);return g}function eo(i,a,c){return i===i&&(c!==n&&(i=i<=c?i:c),a!==n&&(i=i>=a?i:a)),i}function en(i,a,c,h,g,v){var k,T=a&y,D=a&E,q=a&S;if(c&&(k=g?c(i,h,g,v):c(i)),k!==n)return k;if(!tt(i))return i;var Y=ke(i);if(Y){if(k=YN(i),!T)return Dt(i,k)}else{var X=xt(i),ne=X==Fs||X==xp;if(Pr(i))return Wh(i,T);if(X==Hn||X==Wn||ne&&!g){if(k=D||ne?{}:uf(i),!T)return D?LN(i,lN(k,i)):ON(i,wh(k,i))}else{if(!qe[X])return g?i:{};k=JN(i,X,T)}}v||(v=new xn);var ue=v.get(i);if(ue)return ue;v.set(i,k),Gf(i)?i.forEach(function(ye){k.add(en(ye,a,c,ye,i,v))}):Of(i)&&i.forEach(function(ye,De){k.set(De,en(ye,a,c,De,i,v))});var ge=q?D?Dc:Pc:D?Rt:mt,Ne=Y?n:ge(i);return Jt(Ne||i,function(ye,De){Ne&&(De=ye,ye=i[De]),Wi(k,De,en(ye,a,c,De,i,v))}),k}function cN(i){var a=mt(i);return function(c){return bh(c,i,a)}}function bh(i,a,c){var h=c.length;if(i==null)return!h;for(i=je(i);h--;){var g=c[h],v=a[g],k=i[g];if(k===n&&!(g in i)||!v(k))return!1}return!0}function xh(i,a,c){if(typeof i!="function")throw new Xt(d);return Xi(function(){i.apply(n,c)},a)}function Hi(i,a,c,h){var g=-1,v=Ls,k=!0,T=i.length,D=[],q=a.length;if(!T)return D;c&&(a=Xe(a,Ut(c))),h?(v=Ql,k=!1):a.length>=s&&(v=Li,k=!1,a=new Qr(a));e:for(;++g<T;){var Y=i[g],X=c==null?Y:c(Y);if(Y=h||Y!==0?Y:0,k&&X===X){for(var ne=q;ne--;)if(a[ne]===X)continue e;D.push(Y)}else v(a,X,h)||D.push(Y)}return D}var Br=Yh(Mn),kh=Yh(mc,!0);function dN(i,a){var c=!0;return Br(i,function(h,g,v){return c=!!a(h,g,v),c}),c}function ra(i,a,c){for(var h=-1,g=i.length;++h<g;){var v=i[h],k=a(v);if(k!=null&&(T===n?k===k&&!Ht(k):c(k,T)))var T=k,D=v}return D}function uN(i,a,c,h){var g=i.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:Zf(h);c<h;)i[c++]=a;return i}function Sh(i,a){var c=[];return Br(i,function(h,g,v){a(h,g,v)&&c.push(h)}),c}function yt(i,a,c,h,g){var v=-1,k=i.length;for(c||(c=QN),g||(g=[]);++v<k;){var T=i[v];a>0&&c(T)?a>1?yt(T,a-1,c,h,g):Sr(g,T):h||(g[g.length]=T)}return g}var fc=Jh(),Eh=Jh(!0);function Mn(i,a){return i&&fc(i,a,mt)}function mc(i,a){return i&&Eh(i,a,mt)}function oa(i,a){return kr(a,function(c){return Qn(i[c])})}function to(i,a){a=Nr(a,i);for(var c=0,h=a.length;i!=null&&c<h;)i=i[On(a[c++])];return c&&c==h?i:n}function Th(i,a,c){var h=a(i);return ke(i)?h:Sr(h,c(i))}function At(i){return i==null?i===n?GT:OT:Jr&&Jr in je(i)?jN(i):sV(i)}function gc(i,a){return i>a}function pN(i,a){return i!=null&&We.call(i,a)}function hN(i,a){return i!=null&&a in je(i)}function fN(i,a,c){return i>=bt(a,c)&&i<ut(a,c)}function yc(i,a,c){for(var h=c?Ql:Ls,g=i[0].length,v=i.length,k=v,T=Z(v),D=1/0,q=[];k--;){var Y=i[k];k&&a&&(Y=Xe(Y,Ut(a))),D=bt(Y.length,D),T[k]=!c&&(a||g>=120&&Y.length>=120)?new Qr(k&&Y):n}Y=i[0];var X=-1,ne=T[0];e:for(;++X<g&&q.length<D;){var ue=Y[X],ge=a?a(ue):ue;if(ue=c||ue!==0?ue:0,!(ne?Li(ne,ge):h(q,ge,c))){for(k=v;--k;){var Ne=T[k];if(!(Ne?Li(Ne,ge):h(i[k],ge,c)))continue e}ne&&ne.push(ge),q.push(ue)}}return q}function mN(i,a,c,h){return Mn(i,function(g,v,k){a(h,c(g),v,k)}),h}function ji(i,a,c){a=Nr(a,i),i=mf(i,a);var h=i==null?i:i[On(nn(a))];return h==null?n:$t(h,i,c)}function Bh(i){return nt(i)&&At(i)==Wn}function gN(i){return nt(i)&&At(i)==Oi}function yN(i){return nt(i)&&At(i)==xr}function qi(i,a,c,h,g){return i===a?!0:i==null||a==null||!nt(i)&&!nt(a)?i!==i&&a!==a:_N(i,a,c,h,qi,g)}function _N(i,a,c,h,g,v){var k=ke(i),T=ke(a),D=k?Kr:xt(i),q=T?Kr:xt(a);D=D==Wn?Hn:D,q=q==Wn?Hn:q;var Y=D==Hn,X=q==Hn,ne=D==q;if(ne&&Pr(i)){if(!Pr(a))return!1;k=!0,Y=!1}if(ne&&!Y)return v||(v=new xn),k||Go(i)?lf(i,a,c,h,g,v):WN(i,a,D,c,h,g,v);if(!(c&A)){var ue=Y&&We.call(i,"__wrapped__"),ge=X&&We.call(a,"__wrapped__");if(ue||ge){var Ne=ue?i.value():i,ye=ge?a.value():a;return v||(v=new xn),g(Ne,ye,c,h,v)}}return ne?(v||(v=new xn),HN(i,a,c,h,g,v)):!1}function vN(i){return nt(i)&&xt(i)==Cn}function _c(i,a,c,h){var g=c.length,v=g,k=!h;if(i==null)return!v;for(i=je(i);g--;){var T=c[g];if(k&&T[2]?T[1]!==i[T[0]]:!(T[0]in i))return!1}for(;++g<v;){T=c[g];var D=T[0],q=i[D],Y=T[1];if(k&&T[2]){if(q===n&&!(D in i))return!1}else{var X=new xn;if(h)var ne=h(q,Y,D,i,a,X);if(!(ne===n?qi(Y,q,A|O,h,X):ne))return!1}}return!0}function Ah(i){if(!tt(i)||tV(i))return!1;var a=Qn(i)?vA:cB;return a.test(ro(i))}function CN(i){return nt(i)&&At(i)==Ri}function wN(i){return nt(i)&&xt(i)==wn}function bN(i){return nt(i)&&wa(i.length)&&!!Ye[At(i)]}function Nh(i){return typeof i=="function"?i:i==null?Mt:typeof i=="object"?ke(i)?Dh(i[0],i[1]):Ph(i):Qf(i)}function vc(i){if(!Ji(i))return SA(i);var a=[];for(var c in je(i))We.call(i,c)&&c!="constructor"&&a.push(c);return a}function xN(i){if(!tt(i))return iV(i);var a=Ji(i),c=[];for(var h in i)h=="constructor"&&(a||!We.call(i,h))||c.push(h);return c}function Cc(i,a){return i<a}function Vh(i,a){var c=-1,h=Ft(i)?Z(i.length):[];return Br(i,function(g,v,k){h[++c]=a(g,v,k)}),h}function Ph(i){var a=Rc(i);return a.length==1&&a[0][2]?hf(a[0][0],a[0][1]):function(c){return c===i||_c(c,i,a)}}function Dh(i,a){return Ic(i)&&pf(a)?hf(On(i),a):function(c){var h=jc(c,i);return h===n&&h===a?qc(c,i):qi(a,h,A|O)}}function ia(i,a,c,h,g){i!==a&&fc(a,function(v,k){if(g||(g=new xn),tt(v))kN(i,a,k,c,ia,h,g);else{var T=h?h(Lc(i,k),v,k+"",i,a,g):n;T===n&&(T=v),pc(i,k,T)}},Rt)}function kN(i,a,c,h,g,v,k){var T=Lc(i,c),D=Lc(a,c),q=k.get(D);if(q){pc(i,c,q);return}var Y=v?v(T,D,c+"",i,a,k):n,X=Y===n;if(X){var ne=ke(D),ue=!ne&&Pr(D),ge=!ne&&!ue&&Go(D);Y=D,ne||ue||ge?ke(T)?Y=T:it(T)?Y=Dt(T):ue?(X=!1,Y=Wh(D,!0)):ge?(X=!1,Y=Hh(D,!0)):Y=[]:Qi(D)||oo(D)?(Y=T,oo(T)?Y=$f(T):(!tt(T)||Qn(T))&&(Y=uf(D))):X=!1}X&&(k.set(D,Y),g(Y,D,h,v,k),k.delete(D)),pc(i,c,Y)}function Fh(i,a){var c=i.length;if(c)return a+=a<0?c:0,Xn(a,c)?i[a]:n}function Rh(i,a,c){a.length?a=Xe(a,function(v){return ke(v)?function(k){return to(k,v.length===1?v[0]:v)}:v}):a=[Mt];var h=-1;a=Xe(a,Ut(fe()));var g=Vh(i,function(v,k,T){var D=Xe(a,function(q){return q(v)});return{criteria:D,index:++h,value:v}});return JB(g,function(v,k){return IN(v,k,c)})}function SN(i,a){return Mh(i,a,function(c,h){return qc(i,h)})}function Mh(i,a,c){for(var h=-1,g=a.length,v={};++h<g;){var k=a[h],T=to(i,k);c(T,k)&&Ki(v,Nr(k,i),T)}return v}function EN(i){return function(a){return to(a,i)}}function wc(i,a,c,h){var g=h?YB:Ao,v=-1,k=a.length,T=i;for(i===a&&(a=Dt(a)),c&&(T=Xe(i,Ut(c)));++v<k;)for(var D=0,q=a[v],Y=c?c(q):q;(D=g(T,Y,D,h))>-1;)T!==i&&Ks.call(T,D,1),Ks.call(i,D,1);return i}function Ih(i,a){for(var c=i?a.length:0,h=c-1;c--;){var g=a[c];if(c==h||g!==v){var v=g;Xn(g)?Ks.call(i,g,1):Sc(i,g)}}return i}function bc(i,a){return i+Xs(yh()*(a-i+1))}function TN(i,a,c,h){for(var g=-1,v=ut(Js((a-i)/(c||1)),0),k=Z(v);v--;)k[h?v:++g]=i,i+=c;return k}function xc(i,a){var c="";if(!i||a<1||a>se)return c;do a%2&&(c+=i),a=Xs(a/2),a&&(i+=i);while(a);return c}function Ve(i,a){return Gc(ff(i,a,Mt),i+"")}function BN(i){return Ch(zo(i))}function AN(i,a){var c=zo(i);return ma(c,eo(a,0,c.length))}function Ki(i,a,c,h){if(!tt(i))return i;a=Nr(a,i);for(var g=-1,v=a.length,k=v-1,T=i;T!=null&&++g<v;){var D=On(a[g]),q=c;if(D==="__proto__"||D==="constructor"||D==="prototype")return i;if(g!=k){var Y=T[D];q=h?h(Y,D,T):n,q===n&&(q=tt(Y)?Y:Xn(a[g+1])?[]:{})}Wi(T,D,q),T=T[D]}return i}var Oh=Qs?function(i,a){return Qs.set(i,a),i}:Mt,NN=Ys?function(i,a){return Ys(i,"toString",{configurable:!0,enumerable:!1,value:Yc(a),writable:!0})}:Mt;function VN(i){return ma(zo(i))}function tn(i,a,c){var h=-1,g=i.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 v=Z(g);++h<g;)v[h]=i[h+a];return v}function PN(i,a){var c;return Br(i,function(h,g,v){return c=a(h,g,v),!c}),!!c}function sa(i,a,c){var h=0,g=i==null?h:i.length;if(typeof a=="number"&&a===a&&g<=Rn){for(;h<g;){var v=h+g>>>1,k=i[v];k!==null&&!Ht(k)&&(c?k<=a:k<a)?h=v+1:g=v}return g}return kc(i,a,Mt,c)}function kc(i,a,c,h){var g=0,v=i==null?0:i.length;if(v===0)return 0;a=c(a);for(var k=a!==a,T=a===null,D=Ht(a),q=a===n;g<v;){var Y=Xs((g+v)/2),X=c(i[Y]),ne=X!==n,ue=X===null,ge=X===X,Ne=Ht(X);if(k)var ye=h||ge;else q?ye=ge&&(h||ne):T?ye=ge&&ne&&(h||!ue):D?ye=ge&&ne&&!ue&&(h||!Ne):ue||Ne?ye=!1:ye=h?X<=a:X<a;ye?g=Y+1:v=Y}return bt(v,vn)}function Lh(i,a){for(var c=-1,h=i.length,g=0,v=[];++c<h;){var k=i[c],T=a?a(k):k;if(!c||!kn(T,D)){var D=T;v[g++]=k===0?0:k}}return v}function Gh(i){return typeof i=="number"?i:Ht(i)?He:+i}function Wt(i){if(typeof i=="string")return i;if(ke(i))return Xe(i,Wt)+"";if(Ht(i))return _h?_h.call(i):"";var a=i+"";return a=="0"&&1/i==-re?"-0":a}function Ar(i,a,c){var h=-1,g=Ls,v=i.length,k=!0,T=[],D=T;if(c)k=!1,g=Ql;else if(v>=s){var q=a?null:$N(i);if(q)return zs(q);k=!1,g=Li,D=new Qr}else D=a?[]:T;e:for(;++h<v;){var Y=i[h],X=a?a(Y):Y;if(Y=c||Y!==0?Y:0,k&&X===X){for(var ne=D.length;ne--;)if(D[ne]===X)continue e;a&&D.push(X),T.push(Y)}else g(D,X,c)||(D!==T&&D.push(X),T.push(Y))}return T}function Sc(i,a){return a=Nr(a,i),i=mf(i,a),i==null||delete i[On(nn(a))]}function zh(i,a,c,h){return Ki(i,a,c(to(i,a)),h)}function aa(i,a,c,h){for(var g=i.length,v=h?g:-1;(h?v--:++v<g)&&a(i[v],v,i););return c?tn(i,h?0:v,h?v+1:g):tn(i,h?v+1:0,h?g:v)}function Zh(i,a){var c=i;return c instanceof Fe&&(c=c.value()),ec(a,function(h,g){return g.func.apply(g.thisArg,Sr([h],g.args))},c)}function Ec(i,a,c){var h=i.length;if(h<2)return h?Ar(i[0]):[];for(var g=-1,v=Z(h);++g<h;)for(var k=i[g],T=-1;++T<h;)T!=g&&(v[g]=Hi(v[g]||k,i[T],a,c));return Ar(yt(v,1),a,c)}function $h(i,a,c){for(var h=-1,g=i.length,v=a.length,k={};++h<g;){var T=h<v?a[h]:n;c(k,i[h],T)}return k}function Tc(i){return it(i)?i:[]}function Bc(i){return typeof i=="function"?i:Mt}function Nr(i,a){return ke(i)?i:Ic(i,a)?[i]:vf(Ue(i))}var DN=Ve;function Vr(i,a,c){var h=i.length;return c=c===n?h:c,!a&&c>=h?i:tn(i,a,c)}var Uh=CA||function(i){return gt.clearTimeout(i)};function Wh(i,a){if(a)return i.slice();var c=i.length,h=ph?ph(c):new i.constructor(c);return i.copy(h),h}function Ac(i){var a=new i.constructor(i.byteLength);return new js(a).set(new js(i)),a}function FN(i,a){var c=a?Ac(i.buffer):i.buffer;return new i.constructor(c,i.byteOffset,i.byteLength)}function RN(i){var a=new i.constructor(i.source,Bp.exec(i));return a.lastIndex=i.lastIndex,a}function MN(i){return Ui?je(Ui.call(i)):{}}function Hh(i,a){var c=a?Ac(i.buffer):i.buffer;return new i.constructor(c,i.byteOffset,i.length)}function jh(i,a){if(i!==a){var c=i!==n,h=i===null,g=i===i,v=Ht(i),k=a!==n,T=a===null,D=a===a,q=Ht(a);if(!T&&!q&&!v&&i>a||v&&k&&D&&!T&&!q||h&&k&&D||!c&&D||!g)return 1;if(!h&&!v&&!q&&i<a||q&&c&&g&&!h&&!v||T&&c&&g||!k&&g||!D)return-1}return 0}function IN(i,a,c){for(var h=-1,g=i.criteria,v=a.criteria,k=g.length,T=c.length;++h<k;){var D=jh(g[h],v[h]);if(D){if(h>=T)return D;var q=c[h];return D*(q=="desc"?-1:1)}}return i.index-a.index}function qh(i,a,c,h){for(var g=-1,v=i.length,k=c.length,T=-1,D=a.length,q=ut(v-k,0),Y=Z(D+q),X=!h;++T<D;)Y[T]=a[T];for(;++g<k;)(X||g<v)&&(Y[c[g]]=i[g]);for(;q--;)Y[T++]=i[g++];return Y}function Kh(i,a,c,h){for(var g=-1,v=i.length,k=-1,T=c.length,D=-1,q=a.length,Y=ut(v-T,0),X=Z(Y+q),ne=!h;++g<Y;)X[g]=i[g];for(var ue=g;++D<q;)X[ue+D]=a[D];for(;++k<T;)(ne||g<v)&&(X[ue+c[k]]=i[g++]);return X}function Dt(i,a){var c=-1,h=i.length;for(a||(a=Z(h));++c<h;)a[c]=i[c];return a}function In(i,a,c,h){var g=!c;c||(c={});for(var v=-1,k=a.length;++v<k;){var T=a[v],D=h?h(c[T],i[T],T,c,i):n;D===n&&(D=i[T]),g?Kn(c,T,D):Wi(c,T,D)}return c}function ON(i,a){return In(i,Mc(i),a)}function LN(i,a){return In(i,cf(i),a)}function la(i,a){return function(c,h){var g=ke(c)?UB:aN,v=a?a():{};return g(c,i,fe(h,2),v)}}function Io(i){return Ve(function(a,c){var h=-1,g=c.length,v=g>1?c[g-1]:n,k=g>2?c[2]:n;for(v=i.length>3&&typeof v=="function"?(g--,v):n,k&&Nt(c[0],c[1],k)&&(v=g<3?n:v,g=1),a=je(a);++h<g;){var T=c[h];T&&i(a,T,h,v)}return a})}function Yh(i,a){return function(c,h){if(c==null)return c;if(!Ft(c))return i(c,h);for(var g=c.length,v=a?g:-1,k=je(c);(a?v--:++v<g)&&h(k[v],v,k)!==!1;);return c}}function Jh(i){return function(a,c,h){for(var g=-1,v=je(a),k=h(a),T=k.length;T--;){var D=k[i?T:++g];if(c(v[D],D,v)===!1)break}return a}}function GN(i,a,c){var h=a&z,g=Yi(i);function v(){var k=this&&this!==gt&&this instanceof v?g:i;return k.apply(h?c:this,arguments)}return v}function Xh(i){return function(a){a=Ue(a);var c=No(a)?bn(a):n,h=c?c[0]:a.charAt(0),g=c?Vr(c,1).join(""):a.slice(1);return h[i]()+g}}function Oo(i){return function(a){return ec(Jf(Yf(a).replace(NB,"")),i,"")}}function Yi(i){return function(){var a=arguments;switch(a.length){case 0:return new i;case 1:return new i(a[0]);case 2:return new i(a[0],a[1]);case 3:return new i(a[0],a[1],a[2]);case 4:return new i(a[0],a[1],a[2],a[3]);case 5:return new i(a[0],a[1],a[2],a[3],a[4]);case 6:return new i(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new i(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var c=Mo(i.prototype),h=i.apply(c,a);return tt(h)?h:c}}function zN(i,a,c){var h=Yi(i);function g(){for(var v=arguments.length,k=Z(v),T=v,D=Lo(g);T--;)k[T]=arguments[T];var q=v<3&&k[0]!==D&&k[v-1]!==D?[]:Er(k,D);if(v-=q.length,v<c)return rf(i,a,ca,g.placeholder,n,k,q,n,n,c-v);var Y=this&&this!==gt&&this instanceof g?h:i;return $t(Y,this,k)}return g}function Qh(i){return function(a,c,h){var g=je(a);if(!Ft(a)){var v=fe(c,3);a=mt(a),c=function(T){return v(g[T],T,g)}}var k=i(a,c,h);return k>-1?g[v?a[k]:k]:n}}function ef(i){return Jn(function(a){var c=a.length,h=c,g=Qt.prototype.thru;for(i&&a.reverse();h--;){var v=a[h];if(typeof v!="function")throw new Xt(d);if(g&&!k&&ha(v)=="wrapper")var k=new Qt([],!0)}for(h=k?h:c;++h<c;){v=a[h];var T=ha(v),D=T=="wrapper"?Fc(v):n;D&&Oc(D[0])&&D[1]==(H|G|L|F)&&!D[4].length&&D[9]==1?k=k[ha(D[0])].apply(k,D[3]):k=v.length==1&&Oc(v)?k[T]():k.thru(v)}return function(){var q=arguments,Y=q[0];if(k&&q.length==1&&ke(Y))return k.plant(Y).value();for(var X=0,ne=c?a[X].apply(this,q):Y;++X<c;)ne=a[X].call(this,ne);return ne}})}function ca(i,a,c,h,g,v,k,T,D,q){var Y=a&H,X=a&z,ne=a&C,ue=a&(G|$),ge=a&N,Ne=ne?n:Yi(i);function ye(){for(var De=arguments.length,Re=Z(De),jt=De;jt--;)Re[jt]=arguments[jt];if(ue)var Vt=Lo(ye),qt=QB(Re,Vt);if(h&&(Re=qh(Re,h,g,ue)),v&&(Re=Kh(Re,v,k,ue)),De-=qt,ue&&De<q){var st=Er(Re,Vt);return rf(i,a,ca,ye.placeholder,c,Re,st,T,D,q-De)}var Sn=X?c:this,tr=ne?Sn[i]:i;return De=Re.length,T?Re=aV(Re,T):ge&&De>1&&Re.reverse(),Y&&D<De&&(Re.length=D),this&&this!==gt&&this instanceof ye&&(tr=Ne||Yi(tr)),tr.apply(Sn,Re)}return ye}function tf(i,a){return function(c,h){return mN(c,i,a(h),{})}}function da(i,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=Wt(c),h=Wt(h)):(c=Gh(c),h=Gh(h)),g=i(c,h)}return g}}function Nc(i){return Jn(function(a){return a=Xe(a,Ut(fe())),Ve(function(c){var h=this;return i(a,function(g){return $t(g,h,c)})})})}function ua(i,a){a=a===n?" ":Wt(a);var c=a.length;if(c<2)return c?xc(a,i):a;var h=xc(a,Js(i/Vo(a)));return No(a)?Vr(bn(h),0,i).join(""):h.slice(0,i)}function ZN(i,a,c,h){var g=a&z,v=Yi(i);function k(){for(var T=-1,D=arguments.length,q=-1,Y=h.length,X=Z(Y+D),ne=this&&this!==gt&&this instanceof k?v:i;++q<Y;)X[q]=h[q];for(;D--;)X[q++]=arguments[++T];return $t(ne,g?c:this,X)}return k}function nf(i){return function(a,c,h){return h&&typeof h!="number"&&Nt(a,c,h)&&(c=h=n),a=er(a),c===n?(c=a,a=0):c=er(c),h=h===n?a<c?1:-1:er(h),TN(a,c,h,i)}}function pa(i){return function(a,c){return typeof a=="string"&&typeof c=="string"||(a=rn(a),c=rn(c)),i(a,c)}}function rf(i,a,c,h,g,v,k,T,D,q){var Y=a&G,X=Y?k:n,ne=Y?n:k,ue=Y?v:n,ge=Y?n:v;a|=Y?L:J,a&=~(Y?J:L),a&R||(a&=~(z|C));var Ne=[i,a,g,ue,X,ge,ne,T,D,q],ye=c.apply(n,Ne);return Oc(i)&&gf(ye,Ne),ye.placeholder=h,yf(ye,i,a)}function Vc(i){var a=dt[i];return function(c,h){if(c=rn(c),h=h==null?0:bt(Te(h),292),h&&gh(c)){var g=(Ue(c)+"e").split("e"),v=a(g[0]+"e"+(+g[1]+h));return g=(Ue(v)+"e").split("e"),+(g[0]+"e"+(+g[1]-h))}return a(c)}}var $N=Fo&&1/zs(new Fo([,-0]))[1]==re?function(i){return new Fo(i)}:Qc;function of(i){return function(a){var c=xt(a);return c==Cn?ac(a):c==wn?sA(a):XB(a,i(a))}}function Yn(i,a,c,h,g,v,k,T){var D=a&C;if(!D&&typeof i!="function")throw new Xt(d);var q=h?h.length:0;if(q||(a&=~(L|J),h=g=n),k=k===n?k:ut(Te(k),0),T=T===n?T:Te(T),q-=g?g.length:0,a&J){var Y=h,X=g;h=g=n}var ne=D?n:Fc(i),ue=[i,a,c,h,g,Y,X,v,k,T];if(ne&&oV(ue,ne),i=ue[0],a=ue[1],c=ue[2],h=ue[3],g=ue[4],T=ue[9]=ue[9]===n?D?0:i.length:ut(ue[9]-q,0),!T&&a&(G|$)&&(a&=~(G|$)),!a||a==z)var ge=GN(i,a,c);else a==G||a==$?ge=zN(i,a,T):(a==L||a==(z|L))&&!g.length?ge=ZN(i,a,c,h):ge=ca.apply(n,ue);var Ne=ne?Oh:gf;return yf(Ne(ge,ue),i,a)}function sf(i,a,c,h){return i===n||kn(i,Do[c])&&!We.call(h,c)?a:i}function af(i,a,c,h,g,v){return tt(i)&&tt(a)&&(v.set(a,i),ia(i,a,n,af,v),v.delete(a)),i}function UN(i){return Qi(i)?n:i}function lf(i,a,c,h,g,v){var k=c&A,T=i.length,D=a.length;if(T!=D&&!(k&&D>T))return!1;var q=v.get(i),Y=v.get(a);if(q&&Y)return q==a&&Y==i;var X=-1,ne=!0,ue=c&O?new Qr:n;for(v.set(i,a),v.set(a,i);++X<T;){var ge=i[X],Ne=a[X];if(h)var ye=k?h(Ne,ge,X,a,i,v):h(ge,Ne,X,i,a,v);if(ye!==n){if(ye)continue;ne=!1;break}if(ue){if(!tc(a,function(De,Re){if(!Li(ue,Re)&&(ge===De||g(ge,De,c,h,v)))return ue.push(Re)})){ne=!1;break}}else if(!(ge===Ne||g(ge,Ne,c,h,v))){ne=!1;break}}return v.delete(i),v.delete(a),ne}function WN(i,a,c,h,g,v,k){switch(c){case To:if(i.byteLength!=a.byteLength||i.byteOffset!=a.byteOffset)return!1;i=i.buffer,a=a.buffer;case Oi:return!(i.byteLength!=a.byteLength||!v(new js(i),new js(a)));case ze:case xr:case Fi:return kn(+i,+a);case Ds:return i.name==a.name&&i.message==a.message;case Ri:case Mi:return i==a+"";case Cn:var T=ac;case wn:var D=h&A;if(T||(T=zs),i.size!=a.size&&!D)return!1;var q=k.get(i);if(q)return q==a;h|=O,k.set(i,a);var Y=lf(T(i),T(a),h,g,v,k);return k.delete(i),Y;case Rs:if(Ui)return Ui.call(i)==Ui.call(a)}return!1}function HN(i,a,c,h,g,v){var k=c&A,T=Pc(i),D=T.length,q=Pc(a),Y=q.length;if(D!=Y&&!k)return!1;for(var X=D;X--;){var ne=T[X];if(!(k?ne in a:We.call(a,ne)))return!1}var ue=v.get(i),ge=v.get(a);if(ue&&ge)return ue==a&&ge==i;var Ne=!0;v.set(i,a),v.set(a,i);for(var ye=k;++X<D;){ne=T[X];var De=i[ne],Re=a[ne];if(h)var jt=k?h(Re,De,ne,a,i,v):h(De,Re,ne,i,a,v);if(!(jt===n?De===Re||g(De,Re,c,h,v):jt)){Ne=!1;break}ye||(ye=ne=="constructor")}if(Ne&&!ye){var Vt=i.constructor,qt=a.constructor;Vt!=qt&&"constructor"in i&&"constructor"in a&&!(typeof Vt=="function"&&Vt instanceof Vt&&typeof qt=="function"&&qt instanceof qt)&&(Ne=!1)}return v.delete(i),v.delete(a),Ne}function Jn(i){return Gc(ff(i,n,xf),i+"")}function Pc(i){return Th(i,mt,Mc)}function Dc(i){return Th(i,Rt,cf)}var Fc=Qs?function(i){return Qs.get(i)}:Qc;function ha(i){for(var a=i.name+"",c=Ro[a],h=We.call(Ro,a)?c.length:0;h--;){var g=c[h],v=g.func;if(v==null||v==i)return g.name}return a}function Lo(i){var a=We.call(_,"placeholder")?_:i;return a.placeholder}function fe(){var i=_.iteratee||Jc;return i=i===Jc?Nh:i,arguments.length?i(arguments[0],arguments[1]):i}function fa(i,a){var c=i.__data__;return eV(a)?c[typeof a=="string"?"string":"hash"]:c.map}function Rc(i){for(var a=mt(i),c=a.length;c--;){var h=a[c],g=i[h];a[c]=[h,g,pf(g)]}return a}function no(i,a){var c=rA(i,a);return Ah(c)?c:n}function jN(i){var a=We.call(i,Jr),c=i[Jr];try{i[Jr]=n;var h=!0}catch{}var g=Ws.call(i);return h&&(a?i[Jr]=c:delete i[Jr]),g}var Mc=cc?function(i){return i==null?[]:(i=je(i),kr(cc(i),function(a){return fh.call(i,a)}))}:ed,cf=cc?function(i){for(var a=[];i;)Sr(a,Mc(i)),i=qs(i);return a}:ed,xt=At;(dc&&xt(new dc(new ArrayBuffer(1)))!=To||zi&&xt(new zi)!=Cn||uc&&xt(uc.resolve())!=kp||Fo&&xt(new Fo)!=wn||Zi&&xt(new Zi)!=Ii)&&(xt=function(i){var a=At(i),c=a==Hn?i.constructor:n,h=c?ro(c):"";if(h)switch(h){case AA:return To;case NA:return Cn;case VA:return kp;case PA:return wn;case DA:return Ii}return a});function qN(i,a,c){for(var h=-1,g=c.length;++h<g;){var v=c[h],k=v.size;switch(v.type){case"drop":i+=k;break;case"dropRight":a-=k;break;case"take":a=bt(a,i+k);break;case"takeRight":i=ut(i,a-k);break}}return{start:i,end:a}}function KN(i){var a=i.match(tB);return a?a[1].split(nB):[]}function df(i,a,c){a=Nr(a,i);for(var h=-1,g=a.length,v=!1;++h<g;){var k=On(a[h]);if(!(v=i!=null&&c(i,k)))break;i=i[k]}return v||++h!=g?v:(g=i==null?0:i.length,!!g&&wa(g)&&Xn(k,g)&&(ke(i)||oo(i)))}function YN(i){var a=i.length,c=new i.constructor(a);return a&&typeof i[0]=="string"&&We.call(i,"index")&&(c.index=i.index,c.input=i.input),c}function uf(i){return typeof i.constructor=="function"&&!Ji(i)?Mo(qs(i)):{}}function JN(i,a,c){var h=i.constructor;switch(a){case Oi:return Ac(i);case ze:case xr:return new h(+i);case To:return FN(i,c);case Rl:case Ml:case Il:case Ol:case Ll:case Gl:case zl:case Zl:case $l:return Hh(i,c);case Cn:return new h;case Fi:case Mi:return new h(i);case Ri:return RN(i);case wn:return new h;case Rs:return MN(i)}}function XN(i,a){var c=a.length;if(!c)return i;var h=c-1;return a[h]=(c>1?"& ":"")+a[h],a=a.join(c>2?", ":" "),i.replace(eB,`{
|
|
72
|
+
*/Ns.exports,function(t,e){(function(){var n,o="4.17.21",s=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",u="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",f=500,m="__lodash_placeholder__",y=1,B=2,T=4,N=1,M=2,G=1,C=2,F=4,L=8,$=16,I=32,Y=64,H=128,D=256,K=512,U=30,X="...",O=800,E=16,w=1,k=2,Z=3,te=1/0,ne=9007199254740991,be=17976931348623157e292,Ze=NaN,ot=4294967295,vn=ot-1,Rn=ot>>>1,xr=[["ary",H],["bind",G],["bindKey",C],["curry",L],["curryRight",$],["flip",K],["partial",I],["partialRight",Y],["rearg",D]],Wn="[object Arguments]",Yr="[object Array]",Fs="[object AsyncFunction]",kr="[object Boolean]",Sr="[object Date]",Rs="[object DOMException]",Se="[object Error]",Jr="[object Function]",kp="[object GeneratorFunction]",Cn="[object Map]",Mi="[object Number]",OT="[object Null]",Hn="[object Object]",Sp="[object Promise]",LT="[object Proxy]",Ii="[object RegExp]",wn="[object Set]",Oi="[object String]",Ms="[object Symbol]",GT="[object Undefined]",Li="[object WeakMap]",zT="[object WeakSet]",Gi="[object ArrayBuffer]",Ao="[object DataView]",Ml="[object Float32Array]",Il="[object Float64Array]",Ol="[object Int8Array]",Ll="[object Int16Array]",Gl="[object Int32Array]",zl="[object Uint8Array]",Zl="[object Uint8ClampedArray]",$l="[object Uint16Array]",Ul="[object Uint32Array]",ZT=/\b__p \+= '';/g,$T=/\b(__p \+=) '' \+/g,UT=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ep=/&(?:amp|lt|gt|quot|#39);/g,Tp=/[&<>"']/g,WT=RegExp(Ep.source),HT=RegExp(Tp.source),jT=/<%-([\s\S]+?)%>/g,qT=/<%([\s\S]+?)%>/g,Bp=/<%=([\s\S]+?)%>/g,KT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,YT=/^\w*$/,JT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wl=/[\\^$.*+?()[\]{}|]/g,XT=RegExp(Wl.source),Hl=/^\s+/,QT=/\s/,eB=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,tB=/\{\n\/\* \[wrapped with (.+)\] \*/,nB=/,? & /,rB=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,oB=/[()=,{}\[\]\/\s]/,iB=/\\(\\)?/g,sB=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ap=/\w*$/,aB=/^[-+]0x[0-9a-f]+$/i,lB=/^0b[01]+$/i,cB=/^\[object .+?Constructor\]$/,dB=/^0o[0-7]+$/i,uB=/^(?:0|[1-9]\d*)$/,pB=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Is=/($^)/,hB=/['\n\r\u2028\u2029\\]/g,Os="\\ud800-\\udfff",fB="\\u0300-\\u036f",mB="\\ufe20-\\ufe2f",gB="\\u20d0-\\u20ff",Np=fB+mB+gB,Vp="\\u2700-\\u27bf",Pp="a-z\\xdf-\\xf6\\xf8-\\xff",yB="\\xac\\xb1\\xd7\\xf7",_B="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vB="\\u2000-\\u206f",CB=" \\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",Dp="A-Z\\xc0-\\xd6\\xd8-\\xde",Fp="\\ufe0e\\ufe0f",Rp=yB+_B+vB+CB,jl="['’]",wB="["+Os+"]",Mp="["+Rp+"]",Ls="["+Np+"]",Ip="\\d+",bB="["+Vp+"]",Op="["+Pp+"]",Lp="[^"+Os+Rp+Ip+Vp+Pp+Dp+"]",ql="\\ud83c[\\udffb-\\udfff]",xB="(?:"+Ls+"|"+ql+")",Gp="[^"+Os+"]",Kl="(?:\\ud83c[\\udde6-\\uddff]){2}",Yl="[\\ud800-\\udbff][\\udc00-\\udfff]",No="["+Dp+"]",zp="\\u200d",Zp="(?:"+Op+"|"+Lp+")",kB="(?:"+No+"|"+Lp+")",$p="(?:"+jl+"(?:d|ll|m|re|s|t|ve))?",Up="(?:"+jl+"(?:D|LL|M|RE|S|T|VE))?",Wp=xB+"?",Hp="["+Fp+"]?",SB="(?:"+zp+"(?:"+[Gp,Kl,Yl].join("|")+")"+Hp+Wp+")*",EB="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",TB="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",jp=Hp+Wp+SB,BB="(?:"+[bB,Kl,Yl].join("|")+")"+jp,AB="(?:"+[Gp+Ls+"?",Ls,Kl,Yl,wB].join("|")+")",NB=RegExp(jl,"g"),VB=RegExp(Ls,"g"),Jl=RegExp(ql+"(?="+ql+")|"+AB+jp,"g"),PB=RegExp([No+"?"+Op+"+"+$p+"(?="+[Mp,No,"$"].join("|")+")",kB+"+"+Up+"(?="+[Mp,No+Zp,"$"].join("|")+")",No+"?"+Zp+"+"+$p,No+"+"+Up,TB,EB,Ip,BB].join("|"),"g"),DB=RegExp("["+zp+Os+Np+Fp+"]"),FB=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,RB=["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"],MB=-1,Ye={};Ye[Ml]=Ye[Il]=Ye[Ol]=Ye[Ll]=Ye[Gl]=Ye[zl]=Ye[Zl]=Ye[$l]=Ye[Ul]=!0,Ye[Wn]=Ye[Yr]=Ye[Gi]=Ye[kr]=Ye[Ao]=Ye[Sr]=Ye[Se]=Ye[Jr]=Ye[Cn]=Ye[Mi]=Ye[Hn]=Ye[Ii]=Ye[wn]=Ye[Oi]=Ye[Li]=!1;var qe={};qe[Wn]=qe[Yr]=qe[Gi]=qe[Ao]=qe[kr]=qe[Sr]=qe[Ml]=qe[Il]=qe[Ol]=qe[Ll]=qe[Gl]=qe[Cn]=qe[Mi]=qe[Hn]=qe[Ii]=qe[wn]=qe[Oi]=qe[Ms]=qe[zl]=qe[Zl]=qe[$l]=qe[Ul]=!0,qe[Se]=qe[Jr]=qe[Li]=!1;var IB={À:"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"},OB={"&":"&","<":"<",">":">",'"':""","'":"'"},LB={"&":"&","<":"<",">":">",""":'"',"'":"'"},GB={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zB=parseFloat,ZB=parseInt,qp=typeof Uo=="object"&&Uo&&Uo.Object===Object&&Uo,$B=typeof self=="object"&&self&&self.Object===Object&&self,gt=qp||$B||Function("return this")(),Xl=e&&!e.nodeType&&e,Xr=Xl&&!0&&t&&!t.nodeType&&t,Kp=Xr&&Xr.exports===Xl,Ql=Kp&&qp.process,Yt=function(){try{var V=Xr&&Xr.require&&Xr.require("util").types;return V||Ql&&Ql.binding&&Ql.binding("util")}catch{}}(),Yp=Yt&&Yt.isArrayBuffer,Jp=Yt&&Yt.isDate,Xp=Yt&&Yt.isMap,Qp=Yt&&Yt.isRegExp,eh=Yt&&Yt.isSet,th=Yt&&Yt.isTypedArray;function $t(V,W,z){switch(z.length){case 0:return V.call(W);case 1:return V.call(W,z[0]);case 2:return V.call(W,z[0],z[1]);case 3:return V.call(W,z[0],z[1],z[2])}return V.apply(W,z)}function UB(V,W,z,ce){for(var ke=-1,$e=V==null?0:V.length;++ke<$e;){var dt=V[ke];W(ce,dt,z(dt),V)}return ce}function Jt(V,W){for(var z=-1,ce=V==null?0:V.length;++z<ce&&W(V[z],z,V)!==!1;);return V}function WB(V,W){for(var z=V==null?0:V.length;z--&&W(V[z],z,V)!==!1;);return V}function nh(V,W){for(var z=-1,ce=V==null?0:V.length;++z<ce;)if(!W(V[z],z,V))return!1;return!0}function Er(V,W){for(var z=-1,ce=V==null?0:V.length,ke=0,$e=[];++z<ce;){var dt=V[z];W(dt,z,V)&&($e[ke++]=dt)}return $e}function Gs(V,W){var z=V==null?0:V.length;return!!z&&Vo(V,W,0)>-1}function ec(V,W,z){for(var ce=-1,ke=V==null?0:V.length;++ce<ke;)if(z(W,V[ce]))return!0;return!1}function Xe(V,W){for(var z=-1,ce=V==null?0:V.length,ke=Array(ce);++z<ce;)ke[z]=W(V[z],z,V);return ke}function Tr(V,W){for(var z=-1,ce=W.length,ke=V.length;++z<ce;)V[ke+z]=W[z];return V}function tc(V,W,z,ce){var ke=-1,$e=V==null?0:V.length;for(ce&&$e&&(z=V[++ke]);++ke<$e;)z=W(z,V[ke],ke,V);return z}function HB(V,W,z,ce){var ke=V==null?0:V.length;for(ce&&ke&&(z=V[--ke]);ke--;)z=W(z,V[ke],ke,V);return z}function nc(V,W){for(var z=-1,ce=V==null?0:V.length;++z<ce;)if(W(V[z],z,V))return!0;return!1}var jB=rc("length");function qB(V){return V.split("")}function KB(V){return V.match(rB)||[]}function rh(V,W,z){var ce;return z(V,function(ke,$e,dt){if(W(ke,$e,dt))return ce=$e,!1}),ce}function zs(V,W,z,ce){for(var ke=V.length,$e=z+(ce?1:-1);ce?$e--:++$e<ke;)if(W(V[$e],$e,V))return $e;return-1}function Vo(V,W,z){return W===W?aA(V,W,z):zs(V,oh,z)}function YB(V,W,z,ce){for(var ke=z-1,$e=V.length;++ke<$e;)if(ce(V[ke],W))return ke;return-1}function oh(V){return V!==V}function ih(V,W){var z=V==null?0:V.length;return z?ic(V,W)/z:Ze}function rc(V){return function(W){return W==null?n:W[V]}}function oc(V){return function(W){return V==null?n:V[W]}}function sh(V,W,z,ce,ke){return ke(V,function($e,dt,je){z=ce?(ce=!1,$e):W(z,$e,dt,je)}),z}function JB(V,W){var z=V.length;for(V.sort(W);z--;)V[z]=V[z].value;return V}function ic(V,W){for(var z,ce=-1,ke=V.length;++ce<ke;){var $e=W(V[ce]);$e!==n&&(z=z===n?$e:z+$e)}return z}function sc(V,W){for(var z=-1,ce=Array(V);++z<V;)ce[z]=W(z);return ce}function XB(V,W){return Xe(W,function(z){return[z,V[z]]})}function ah(V){return V&&V.slice(0,uh(V)+1).replace(Hl,"")}function Ut(V){return function(W){return V(W)}}function ac(V,W){return Xe(W,function(z){return V[z]})}function zi(V,W){return V.has(W)}function lh(V,W){for(var z=-1,ce=V.length;++z<ce&&Vo(W,V[z],0)>-1;);return z}function ch(V,W){for(var z=V.length;z--&&Vo(W,V[z],0)>-1;);return z}function QB(V,W){for(var z=V.length,ce=0;z--;)V[z]===W&&++ce;return ce}var eA=oc(IB),tA=oc(OB);function nA(V){return"\\"+GB[V]}function rA(V,W){return V==null?n:V[W]}function Po(V){return DB.test(V)}function oA(V){return FB.test(V)}function iA(V){for(var W,z=[];!(W=V.next()).done;)z.push(W.value);return z}function lc(V){var W=-1,z=Array(V.size);return V.forEach(function(ce,ke){z[++W]=[ke,ce]}),z}function dh(V,W){return function(z){return V(W(z))}}function Br(V,W){for(var z=-1,ce=V.length,ke=0,$e=[];++z<ce;){var dt=V[z];(dt===W||dt===m)&&(V[z]=m,$e[ke++]=z)}return $e}function Zs(V){var W=-1,z=Array(V.size);return V.forEach(function(ce){z[++W]=ce}),z}function sA(V){var W=-1,z=Array(V.size);return V.forEach(function(ce){z[++W]=[ce,ce]}),z}function aA(V,W,z){for(var ce=z-1,ke=V.length;++ce<ke;)if(V[ce]===W)return ce;return-1}function lA(V,W,z){for(var ce=z+1;ce--;)if(V[ce]===W)return ce;return ce}function Do(V){return Po(V)?dA(V):jB(V)}function bn(V){return Po(V)?uA(V):qB(V)}function uh(V){for(var W=V.length;W--&&QT.test(V.charAt(W)););return W}var cA=oc(LB);function dA(V){for(var W=Jl.lastIndex=0;Jl.test(V);)++W;return W}function uA(V){return V.match(Jl)||[]}function pA(V){return V.match(PB)||[]}var hA=function V(W){W=W==null?gt:Fo.defaults(gt.Object(),W,Fo.pick(gt,RB));var z=W.Array,ce=W.Date,ke=W.Error,$e=W.Function,dt=W.Math,je=W.Object,cc=W.RegExp,fA=W.String,Xt=W.TypeError,$s=z.prototype,mA=$e.prototype,Ro=je.prototype,Us=W["__core-js_shared__"],Ws=mA.toString,He=Ro.hasOwnProperty,gA=0,ph=function(){var i=/[^.]+$/.exec(Us&&Us.keys&&Us.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),Hs=Ro.toString,yA=Ws.call(je),_A=gt._,vA=cc("^"+Ws.call(He).replace(Wl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),js=Kp?W.Buffer:n,Ar=W.Symbol,qs=W.Uint8Array,hh=js?js.allocUnsafe:n,Ks=dh(je.getPrototypeOf,je),fh=je.create,mh=Ro.propertyIsEnumerable,Ys=$s.splice,gh=Ar?Ar.isConcatSpreadable:n,Zi=Ar?Ar.iterator:n,Qr=Ar?Ar.toStringTag:n,Js=function(){try{var i=oo(je,"defineProperty");return i({},"",{}),i}catch{}}(),CA=W.clearTimeout!==gt.clearTimeout&&W.clearTimeout,wA=ce&&ce.now!==gt.Date.now&&ce.now,bA=W.setTimeout!==gt.setTimeout&&W.setTimeout,Xs=dt.ceil,Qs=dt.floor,dc=je.getOwnPropertySymbols,xA=js?js.isBuffer:n,yh=W.isFinite,kA=$s.join,SA=dh(je.keys,je),ut=dt.max,bt=dt.min,EA=ce.now,TA=W.parseInt,_h=dt.random,BA=$s.reverse,uc=oo(W,"DataView"),$i=oo(W,"Map"),pc=oo(W,"Promise"),Mo=oo(W,"Set"),Ui=oo(W,"WeakMap"),Wi=oo(je,"create"),ea=Ui&&new Ui,Io={},AA=io(uc),NA=io($i),VA=io(pc),PA=io(Mo),DA=io(Ui),ta=Ar?Ar.prototype:n,Hi=ta?ta.valueOf:n,vh=ta?ta.toString:n;function _(i){if(nt(i)&&!Ee(i)&&!(i instanceof Re)){if(i instanceof Qt)return i;if(He.call(i,"__wrapped__"))return wf(i)}return new Qt(i)}var Oo=function(){function i(){}return function(a){if(!tt(a))return{};if(fh)return fh(a);i.prototype=a;var c=new i;return i.prototype=n,c}}();function na(){}function Qt(i,a){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}_.templateSettings={escape:jT,evaluate:qT,interpolate:Bp,variable:"",imports:{_}},_.prototype=na.prototype,_.prototype.constructor=_,Qt.prototype=Oo(na.prototype),Qt.prototype.constructor=Qt;function Re(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ot,this.__views__=[]}function FA(){var i=new Re(this.__wrapped__);return i.__actions__=Dt(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=Dt(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=Dt(this.__views__),i}function RA(){if(this.__filtered__){var i=new Re(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function MA(){var i=this.__wrapped__.value(),a=this.__dir__,c=Ee(i),h=a<0,g=c?i.length:0,v=qN(0,g,this.__views__),S=v.start,A=v.end,P=A-S,j=h?A:S-1,q=this.__iteratees__,J=q.length,oe=0,ue=bt(P,this.__takeCount__);if(!c||!h&&g==P&&ue==P)return $h(i,this.__actions__);var ge=[];e:for(;P--&&oe<ue;){j+=a;for(var Pe=-1,ye=i[j];++Pe<J;){var Fe=q[Pe],Me=Fe.iteratee,jt=Fe.type,Vt=Me(ye);if(jt==k)ye=Vt;else if(!Vt){if(jt==w)continue e;break e}}ge[oe++]=ye}return ge}Re.prototype=Oo(na.prototype),Re.prototype.constructor=Re;function eo(i){var a=-1,c=i==null?0:i.length;for(this.clear();++a<c;){var h=i[a];this.set(h[0],h[1])}}function IA(){this.__data__=Wi?Wi(null):{},this.size=0}function OA(i){var a=this.has(i)&&delete this.__data__[i];return this.size-=a?1:0,a}function LA(i){var a=this.__data__;if(Wi){var c=a[i];return c===p?n:c}return He.call(a,i)?a[i]:n}function GA(i){var a=this.__data__;return Wi?a[i]!==n:He.call(a,i)}function zA(i,a){var c=this.__data__;return this.size+=this.has(i)?0:1,c[i]=Wi&&a===n?p:a,this}eo.prototype.clear=IA,eo.prototype.delete=OA,eo.prototype.get=LA,eo.prototype.has=GA,eo.prototype.set=zA;function jn(i){var a=-1,c=i==null?0:i.length;for(this.clear();++a<c;){var h=i[a];this.set(h[0],h[1])}}function ZA(){this.__data__=[],this.size=0}function $A(i){var a=this.__data__,c=ra(a,i);if(c<0)return!1;var h=a.length-1;return c==h?a.pop():Ys.call(a,c,1),--this.size,!0}function UA(i){var a=this.__data__,c=ra(a,i);return c<0?n:a[c][1]}function WA(i){return ra(this.__data__,i)>-1}function HA(i,a){var c=this.__data__,h=ra(c,i);return h<0?(++this.size,c.push([i,a])):c[h][1]=a,this}jn.prototype.clear=ZA,jn.prototype.delete=$A,jn.prototype.get=UA,jn.prototype.has=WA,jn.prototype.set=HA;function qn(i){var a=-1,c=i==null?0:i.length;for(this.clear();++a<c;){var h=i[a];this.set(h[0],h[1])}}function jA(){this.size=0,this.__data__={hash:new eo,map:new($i||jn),string:new eo}}function qA(i){var a=ma(this,i).delete(i);return this.size-=a?1:0,a}function KA(i){return ma(this,i).get(i)}function YA(i){return ma(this,i).has(i)}function JA(i,a){var c=ma(this,i),h=c.size;return c.set(i,a),this.size+=c.size==h?0:1,this}qn.prototype.clear=jA,qn.prototype.delete=qA,qn.prototype.get=KA,qn.prototype.has=YA,qn.prototype.set=JA;function to(i){var a=-1,c=i==null?0:i.length;for(this.__data__=new qn;++a<c;)this.add(i[a])}function XA(i){return this.__data__.set(i,p),this}function QA(i){return this.__data__.has(i)}to.prototype.add=to.prototype.push=XA,to.prototype.has=QA;function xn(i){var a=this.__data__=new jn(i);this.size=a.size}function eN(){this.__data__=new jn,this.size=0}function tN(i){var a=this.__data__,c=a.delete(i);return this.size=a.size,c}function nN(i){return this.__data__.get(i)}function rN(i){return this.__data__.has(i)}function oN(i,a){var c=this.__data__;if(c instanceof jn){var h=c.__data__;if(!$i||h.length<s-1)return h.push([i,a]),this.size=++c.size,this;c=this.__data__=new qn(h)}return c.set(i,a),this.size=c.size,this}xn.prototype.clear=eN,xn.prototype.delete=tN,xn.prototype.get=nN,xn.prototype.has=rN,xn.prototype.set=oN;function Ch(i,a){var c=Ee(i),h=!c&&so(i),g=!c&&!h&&Fr(i),v=!c&&!h&&!g&&Zo(i),S=c||h||g||v,A=S?sc(i.length,fA):[],P=A.length;for(var j in i)(a||He.call(i,j))&&!(S&&(j=="length"||g&&(j=="offset"||j=="parent")||v&&(j=="buffer"||j=="byteLength"||j=="byteOffset")||Xn(j,P)))&&A.push(j);return A}function wh(i){var a=i.length;return a?i[xc(0,a-1)]:n}function iN(i,a){return ga(Dt(i),no(a,0,i.length))}function sN(i){return ga(Dt(i))}function hc(i,a,c){(c!==n&&!kn(i[a],c)||c===n&&!(a in i))&&Kn(i,a,c)}function ji(i,a,c){var h=i[a];(!(He.call(i,a)&&kn(h,c))||c===n&&!(a in i))&&Kn(i,a,c)}function ra(i,a){for(var c=i.length;c--;)if(kn(i[c][0],a))return c;return-1}function aN(i,a,c,h){return Nr(i,function(g,v,S){a(h,g,c(g),S)}),h}function bh(i,a){return i&&In(a,mt(a),i)}function lN(i,a){return i&&In(a,Rt(a),i)}function Kn(i,a,c){a=="__proto__"&&Js?Js(i,a,{configurable:!0,enumerable:!0,value:c,writable:!0}):i[a]=c}function fc(i,a){for(var c=-1,h=a.length,g=z(h),v=i==null;++c<h;)g[c]=v?n:qc(i,a[c]);return g}function no(i,a,c){return i===i&&(c!==n&&(i=i<=c?i:c),a!==n&&(i=i>=a?i:a)),i}function en(i,a,c,h,g,v){var S,A=a&y,P=a&B,j=a&T;if(c&&(S=g?c(i,h,g,v):c(i)),S!==n)return S;if(!tt(i))return i;var q=Ee(i);if(q){if(S=YN(i),!A)return Dt(i,S)}else{var J=xt(i),oe=J==Jr||J==kp;if(Fr(i))return Hh(i,A);if(J==Hn||J==Wn||oe&&!g){if(S=P||oe?{}:pf(i),!A)return P?LN(i,lN(S,i)):ON(i,bh(S,i))}else{if(!qe[J])return g?i:{};S=JN(i,J,A)}}v||(v=new xn);var ue=v.get(i);if(ue)return ue;v.set(i,S),zf(i)?i.forEach(function(ye){S.add(en(ye,a,c,ye,i,v))}):Lf(i)&&i.forEach(function(ye,Fe){S.set(Fe,en(ye,a,c,Fe,i,v))});var ge=j?P?Fc:Dc:P?Rt:mt,Pe=q?n:ge(i);return Jt(Pe||i,function(ye,Fe){Pe&&(Fe=ye,ye=i[Fe]),ji(S,Fe,en(ye,a,c,Fe,i,v))}),S}function cN(i){var a=mt(i);return function(c){return xh(c,i,a)}}function xh(i,a,c){var h=c.length;if(i==null)return!h;for(i=je(i);h--;){var g=c[h],v=a[g],S=i[g];if(S===n&&!(g in i)||!v(S))return!1}return!0}function kh(i,a,c){if(typeof i!="function")throw new Xt(d);return es(function(){i.apply(n,c)},a)}function qi(i,a,c,h){var g=-1,v=Gs,S=!0,A=i.length,P=[],j=a.length;if(!A)return P;c&&(a=Xe(a,Ut(c))),h?(v=ec,S=!1):a.length>=s&&(v=zi,S=!1,a=new to(a));e:for(;++g<A;){var q=i[g],J=c==null?q:c(q);if(q=h||q!==0?q:0,S&&J===J){for(var oe=j;oe--;)if(a[oe]===J)continue e;P.push(q)}else v(a,J,h)||P.push(q)}return P}var Nr=Jh(Mn),Sh=Jh(gc,!0);function dN(i,a){var c=!0;return Nr(i,function(h,g,v){return c=!!a(h,g,v),c}),c}function oa(i,a,c){for(var h=-1,g=i.length;++h<g;){var v=i[h],S=a(v);if(S!=null&&(A===n?S===S&&!Ht(S):c(S,A)))var A=S,P=v}return P}function uN(i,a,c,h){var g=i.length;for(c=Ae(c),c<0&&(c=-c>g?0:g+c),h=h===n||h>g?g:Ae(h),h<0&&(h+=g),h=c>h?0:$f(h);c<h;)i[c++]=a;return i}function Eh(i,a){var c=[];return Nr(i,function(h,g,v){a(h,g,v)&&c.push(h)}),c}function yt(i,a,c,h,g){var v=-1,S=i.length;for(c||(c=QN),g||(g=[]);++v<S;){var A=i[v];a>0&&c(A)?a>1?yt(A,a-1,c,h,g):Tr(g,A):h||(g[g.length]=A)}return g}var mc=Xh(),Th=Xh(!0);function Mn(i,a){return i&&mc(i,a,mt)}function gc(i,a){return i&&Th(i,a,mt)}function ia(i,a){return Er(a,function(c){return Qn(i[c])})}function ro(i,a){a=Pr(a,i);for(var c=0,h=a.length;i!=null&&c<h;)i=i[On(a[c++])];return c&&c==h?i:n}function Bh(i,a,c){var h=a(i);return Ee(i)?h:Tr(h,c(i))}function At(i){return i==null?i===n?GT:OT:Qr&&Qr in je(i)?jN(i):sV(i)}function yc(i,a){return i>a}function pN(i,a){return i!=null&&He.call(i,a)}function hN(i,a){return i!=null&&a in je(i)}function fN(i,a,c){return i>=bt(a,c)&&i<ut(a,c)}function _c(i,a,c){for(var h=c?ec:Gs,g=i[0].length,v=i.length,S=v,A=z(v),P=1/0,j=[];S--;){var q=i[S];S&&a&&(q=Xe(q,Ut(a))),P=bt(q.length,P),A[S]=!c&&(a||g>=120&&q.length>=120)?new to(S&&q):n}q=i[0];var J=-1,oe=A[0];e:for(;++J<g&&j.length<P;){var ue=q[J],ge=a?a(ue):ue;if(ue=c||ue!==0?ue:0,!(oe?zi(oe,ge):h(j,ge,c))){for(S=v;--S;){var Pe=A[S];if(!(Pe?zi(Pe,ge):h(i[S],ge,c)))continue e}oe&&oe.push(ge),j.push(ue)}}return j}function mN(i,a,c,h){return Mn(i,function(g,v,S){a(h,c(g),v,S)}),h}function Ki(i,a,c){a=Pr(a,i),i=gf(i,a);var h=i==null?i:i[On(nn(a))];return h==null?n:$t(h,i,c)}function Ah(i){return nt(i)&&At(i)==Wn}function gN(i){return nt(i)&&At(i)==Gi}function yN(i){return nt(i)&&At(i)==Sr}function Yi(i,a,c,h,g){return i===a?!0:i==null||a==null||!nt(i)&&!nt(a)?i!==i&&a!==a:_N(i,a,c,h,Yi,g)}function _N(i,a,c,h,g,v){var S=Ee(i),A=Ee(a),P=S?Yr:xt(i),j=A?Yr:xt(a);P=P==Wn?Hn:P,j=j==Wn?Hn:j;var q=P==Hn,J=j==Hn,oe=P==j;if(oe&&Fr(i)){if(!Fr(a))return!1;S=!0,q=!1}if(oe&&!q)return v||(v=new xn),S||Zo(i)?cf(i,a,c,h,g,v):WN(i,a,P,c,h,g,v);if(!(c&N)){var ue=q&&He.call(i,"__wrapped__"),ge=J&&He.call(a,"__wrapped__");if(ue||ge){var Pe=ue?i.value():i,ye=ge?a.value():a;return v||(v=new xn),g(Pe,ye,c,h,v)}}return oe?(v||(v=new xn),HN(i,a,c,h,g,v)):!1}function vN(i){return nt(i)&&xt(i)==Cn}function vc(i,a,c,h){var g=c.length,v=g,S=!h;if(i==null)return!v;for(i=je(i);g--;){var A=c[g];if(S&&A[2]?A[1]!==i[A[0]]:!(A[0]in i))return!1}for(;++g<v;){A=c[g];var P=A[0],j=i[P],q=A[1];if(S&&A[2]){if(j===n&&!(P in i))return!1}else{var J=new xn;if(h)var oe=h(j,q,P,i,a,J);if(!(oe===n?Yi(q,j,N|M,h,J):oe))return!1}}return!0}function Nh(i){if(!tt(i)||tV(i))return!1;var a=Qn(i)?vA:cB;return a.test(io(i))}function CN(i){return nt(i)&&At(i)==Ii}function wN(i){return nt(i)&&xt(i)==wn}function bN(i){return nt(i)&&ba(i.length)&&!!Ye[At(i)]}function Vh(i){return typeof i=="function"?i:i==null?Mt:typeof i=="object"?Ee(i)?Fh(i[0],i[1]):Dh(i):em(i)}function Cc(i){if(!Qi(i))return SA(i);var a=[];for(var c in je(i))He.call(i,c)&&c!="constructor"&&a.push(c);return a}function xN(i){if(!tt(i))return iV(i);var a=Qi(i),c=[];for(var h in i)h=="constructor"&&(a||!He.call(i,h))||c.push(h);return c}function wc(i,a){return i<a}function Ph(i,a){var c=-1,h=Ft(i)?z(i.length):[];return Nr(i,function(g,v,S){h[++c]=a(g,v,S)}),h}function Dh(i){var a=Mc(i);return a.length==1&&a[0][2]?ff(a[0][0],a[0][1]):function(c){return c===i||vc(c,i,a)}}function Fh(i,a){return Oc(i)&&hf(a)?ff(On(i),a):function(c){var h=qc(c,i);return h===n&&h===a?Kc(c,i):Yi(a,h,N|M)}}function sa(i,a,c,h,g){i!==a&&mc(a,function(v,S){if(g||(g=new xn),tt(v))kN(i,a,S,c,sa,h,g);else{var A=h?h(Gc(i,S),v,S+"",i,a,g):n;A===n&&(A=v),hc(i,S,A)}},Rt)}function kN(i,a,c,h,g,v,S){var A=Gc(i,c),P=Gc(a,c),j=S.get(P);if(j){hc(i,c,j);return}var q=v?v(A,P,c+"",i,a,S):n,J=q===n;if(J){var oe=Ee(P),ue=!oe&&Fr(P),ge=!oe&&!ue&&Zo(P);q=P,oe||ue||ge?Ee(A)?q=A:it(A)?q=Dt(A):ue?(J=!1,q=Hh(P,!0)):ge?(J=!1,q=jh(P,!0)):q=[]:ts(P)||so(P)?(q=A,so(A)?q=Uf(A):(!tt(A)||Qn(A))&&(q=pf(P))):J=!1}J&&(S.set(P,q),g(q,P,h,v,S),S.delete(P)),hc(i,c,q)}function Rh(i,a){var c=i.length;if(c)return a+=a<0?c:0,Xn(a,c)?i[a]:n}function Mh(i,a,c){a.length?a=Xe(a,function(v){return Ee(v)?function(S){return ro(S,v.length===1?v[0]:v)}:v}):a=[Mt];var h=-1;a=Xe(a,Ut(fe()));var g=Ph(i,function(v,S,A){var P=Xe(a,function(j){return j(v)});return{criteria:P,index:++h,value:v}});return JB(g,function(v,S){return IN(v,S,c)})}function SN(i,a){return Ih(i,a,function(c,h){return Kc(i,h)})}function Ih(i,a,c){for(var h=-1,g=a.length,v={};++h<g;){var S=a[h],A=ro(i,S);c(A,S)&&Ji(v,Pr(S,i),A)}return v}function EN(i){return function(a){return ro(a,i)}}function bc(i,a,c,h){var g=h?YB:Vo,v=-1,S=a.length,A=i;for(i===a&&(a=Dt(a)),c&&(A=Xe(i,Ut(c)));++v<S;)for(var P=0,j=a[v],q=c?c(j):j;(P=g(A,q,P,h))>-1;)A!==i&&Ys.call(A,P,1),Ys.call(i,P,1);return i}function Oh(i,a){for(var c=i?a.length:0,h=c-1;c--;){var g=a[c];if(c==h||g!==v){var v=g;Xn(g)?Ys.call(i,g,1):Ec(i,g)}}return i}function xc(i,a){return i+Qs(_h()*(a-i+1))}function TN(i,a,c,h){for(var g=-1,v=ut(Xs((a-i)/(c||1)),0),S=z(v);v--;)S[h?v:++g]=i,i+=c;return S}function kc(i,a){var c="";if(!i||a<1||a>ne)return c;do a%2&&(c+=i),a=Qs(a/2),a&&(i+=i);while(a);return c}function De(i,a){return zc(mf(i,a,Mt),i+"")}function BN(i){return wh($o(i))}function AN(i,a){var c=$o(i);return ga(c,no(a,0,c.length))}function Ji(i,a,c,h){if(!tt(i))return i;a=Pr(a,i);for(var g=-1,v=a.length,S=v-1,A=i;A!=null&&++g<v;){var P=On(a[g]),j=c;if(P==="__proto__"||P==="constructor"||P==="prototype")return i;if(g!=S){var q=A[P];j=h?h(q,P,A):n,j===n&&(j=tt(q)?q:Xn(a[g+1])?[]:{})}ji(A,P,j),A=A[P]}return i}var Lh=ea?function(i,a){return ea.set(i,a),i}:Mt,NN=Js?function(i,a){return Js(i,"toString",{configurable:!0,enumerable:!1,value:Jc(a),writable:!0})}:Mt;function VN(i){return ga($o(i))}function tn(i,a,c){var h=-1,g=i.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 v=z(g);++h<g;)v[h]=i[h+a];return v}function PN(i,a){var c;return Nr(i,function(h,g,v){return c=a(h,g,v),!c}),!!c}function aa(i,a,c){var h=0,g=i==null?h:i.length;if(typeof a=="number"&&a===a&&g<=Rn){for(;h<g;){var v=h+g>>>1,S=i[v];S!==null&&!Ht(S)&&(c?S<=a:S<a)?h=v+1:g=v}return g}return Sc(i,a,Mt,c)}function Sc(i,a,c,h){var g=0,v=i==null?0:i.length;if(v===0)return 0;a=c(a);for(var S=a!==a,A=a===null,P=Ht(a),j=a===n;g<v;){var q=Qs((g+v)/2),J=c(i[q]),oe=J!==n,ue=J===null,ge=J===J,Pe=Ht(J);if(S)var ye=h||ge;else j?ye=ge&&(h||oe):A?ye=ge&&oe&&(h||!ue):P?ye=ge&&oe&&!ue&&(h||!Pe):ue||Pe?ye=!1:ye=h?J<=a:J<a;ye?g=q+1:v=q}return bt(v,vn)}function Gh(i,a){for(var c=-1,h=i.length,g=0,v=[];++c<h;){var S=i[c],A=a?a(S):S;if(!c||!kn(A,P)){var P=A;v[g++]=S===0?0:S}}return v}function zh(i){return typeof i=="number"?i:Ht(i)?Ze:+i}function Wt(i){if(typeof i=="string")return i;if(Ee(i))return Xe(i,Wt)+"";if(Ht(i))return vh?vh.call(i):"";var a=i+"";return a=="0"&&1/i==-te?"-0":a}function Vr(i,a,c){var h=-1,g=Gs,v=i.length,S=!0,A=[],P=A;if(c)S=!1,g=ec;else if(v>=s){var j=a?null:$N(i);if(j)return Zs(j);S=!1,g=zi,P=new to}else P=a?[]:A;e:for(;++h<v;){var q=i[h],J=a?a(q):q;if(q=c||q!==0?q:0,S&&J===J){for(var oe=P.length;oe--;)if(P[oe]===J)continue e;a&&P.push(J),A.push(q)}else g(P,J,c)||(P!==A&&P.push(J),A.push(q))}return A}function Ec(i,a){return a=Pr(a,i),i=gf(i,a),i==null||delete i[On(nn(a))]}function Zh(i,a,c,h){return Ji(i,a,c(ro(i,a)),h)}function la(i,a,c,h){for(var g=i.length,v=h?g:-1;(h?v--:++v<g)&&a(i[v],v,i););return c?tn(i,h?0:v,h?v+1:g):tn(i,h?v+1:0,h?g:v)}function $h(i,a){var c=i;return c instanceof Re&&(c=c.value()),tc(a,function(h,g){return g.func.apply(g.thisArg,Tr([h],g.args))},c)}function Tc(i,a,c){var h=i.length;if(h<2)return h?Vr(i[0]):[];for(var g=-1,v=z(h);++g<h;)for(var S=i[g],A=-1;++A<h;)A!=g&&(v[g]=qi(v[g]||S,i[A],a,c));return Vr(yt(v,1),a,c)}function Uh(i,a,c){for(var h=-1,g=i.length,v=a.length,S={};++h<g;){var A=h<v?a[h]:n;c(S,i[h],A)}return S}function Bc(i){return it(i)?i:[]}function Ac(i){return typeof i=="function"?i:Mt}function Pr(i,a){return Ee(i)?i:Oc(i,a)?[i]:Cf(We(i))}var DN=De;function Dr(i,a,c){var h=i.length;return c=c===n?h:c,!a&&c>=h?i:tn(i,a,c)}var Wh=CA||function(i){return gt.clearTimeout(i)};function Hh(i,a){if(a)return i.slice();var c=i.length,h=hh?hh(c):new i.constructor(c);return i.copy(h),h}function Nc(i){var a=new i.constructor(i.byteLength);return new qs(a).set(new qs(i)),a}function FN(i,a){var c=a?Nc(i.buffer):i.buffer;return new i.constructor(c,i.byteOffset,i.byteLength)}function RN(i){var a=new i.constructor(i.source,Ap.exec(i));return a.lastIndex=i.lastIndex,a}function MN(i){return Hi?je(Hi.call(i)):{}}function jh(i,a){var c=a?Nc(i.buffer):i.buffer;return new i.constructor(c,i.byteOffset,i.length)}function qh(i,a){if(i!==a){var c=i!==n,h=i===null,g=i===i,v=Ht(i),S=a!==n,A=a===null,P=a===a,j=Ht(a);if(!A&&!j&&!v&&i>a||v&&S&&P&&!A&&!j||h&&S&&P||!c&&P||!g)return 1;if(!h&&!v&&!j&&i<a||j&&c&&g&&!h&&!v||A&&c&&g||!S&&g||!P)return-1}return 0}function IN(i,a,c){for(var h=-1,g=i.criteria,v=a.criteria,S=g.length,A=c.length;++h<S;){var P=qh(g[h],v[h]);if(P){if(h>=A)return P;var j=c[h];return P*(j=="desc"?-1:1)}}return i.index-a.index}function Kh(i,a,c,h){for(var g=-1,v=i.length,S=c.length,A=-1,P=a.length,j=ut(v-S,0),q=z(P+j),J=!h;++A<P;)q[A]=a[A];for(;++g<S;)(J||g<v)&&(q[c[g]]=i[g]);for(;j--;)q[A++]=i[g++];return q}function Yh(i,a,c,h){for(var g=-1,v=i.length,S=-1,A=c.length,P=-1,j=a.length,q=ut(v-A,0),J=z(q+j),oe=!h;++g<q;)J[g]=i[g];for(var ue=g;++P<j;)J[ue+P]=a[P];for(;++S<A;)(oe||g<v)&&(J[ue+c[S]]=i[g++]);return J}function Dt(i,a){var c=-1,h=i.length;for(a||(a=z(h));++c<h;)a[c]=i[c];return a}function In(i,a,c,h){var g=!c;c||(c={});for(var v=-1,S=a.length;++v<S;){var A=a[v],P=h?h(c[A],i[A],A,c,i):n;P===n&&(P=i[A]),g?Kn(c,A,P):ji(c,A,P)}return c}function ON(i,a){return In(i,Ic(i),a)}function LN(i,a){return In(i,df(i),a)}function ca(i,a){return function(c,h){var g=Ee(c)?UB:aN,v=a?a():{};return g(c,i,fe(h,2),v)}}function Lo(i){return De(function(a,c){var h=-1,g=c.length,v=g>1?c[g-1]:n,S=g>2?c[2]:n;for(v=i.length>3&&typeof v=="function"?(g--,v):n,S&&Nt(c[0],c[1],S)&&(v=g<3?n:v,g=1),a=je(a);++h<g;){var A=c[h];A&&i(a,A,h,v)}return a})}function Jh(i,a){return function(c,h){if(c==null)return c;if(!Ft(c))return i(c,h);for(var g=c.length,v=a?g:-1,S=je(c);(a?v--:++v<g)&&h(S[v],v,S)!==!1;);return c}}function Xh(i){return function(a,c,h){for(var g=-1,v=je(a),S=h(a),A=S.length;A--;){var P=S[i?A:++g];if(c(v[P],P,v)===!1)break}return a}}function GN(i,a,c){var h=a&G,g=Xi(i);function v(){var S=this&&this!==gt&&this instanceof v?g:i;return S.apply(h?c:this,arguments)}return v}function Qh(i){return function(a){a=We(a);var c=Po(a)?bn(a):n,h=c?c[0]:a.charAt(0),g=c?Dr(c,1).join(""):a.slice(1);return h[i]()+g}}function Go(i){return function(a){return tc(Xf(Jf(a).replace(NB,"")),i,"")}}function Xi(i){return function(){var a=arguments;switch(a.length){case 0:return new i;case 1:return new i(a[0]);case 2:return new i(a[0],a[1]);case 3:return new i(a[0],a[1],a[2]);case 4:return new i(a[0],a[1],a[2],a[3]);case 5:return new i(a[0],a[1],a[2],a[3],a[4]);case 6:return new i(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new i(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var c=Oo(i.prototype),h=i.apply(c,a);return tt(h)?h:c}}function zN(i,a,c){var h=Xi(i);function g(){for(var v=arguments.length,S=z(v),A=v,P=zo(g);A--;)S[A]=arguments[A];var j=v<3&&S[0]!==P&&S[v-1]!==P?[]:Br(S,P);if(v-=j.length,v<c)return of(i,a,da,g.placeholder,n,S,j,n,n,c-v);var q=this&&this!==gt&&this instanceof g?h:i;return $t(q,this,S)}return g}function ef(i){return function(a,c,h){var g=je(a);if(!Ft(a)){var v=fe(c,3);a=mt(a),c=function(A){return v(g[A],A,g)}}var S=i(a,c,h);return S>-1?g[v?a[S]:S]:n}}function tf(i){return Jn(function(a){var c=a.length,h=c,g=Qt.prototype.thru;for(i&&a.reverse();h--;){var v=a[h];if(typeof v!="function")throw new Xt(d);if(g&&!S&&fa(v)=="wrapper")var S=new Qt([],!0)}for(h=S?h:c;++h<c;){v=a[h];var A=fa(v),P=A=="wrapper"?Rc(v):n;P&&Lc(P[0])&&P[1]==(H|L|I|D)&&!P[4].length&&P[9]==1?S=S[fa(P[0])].apply(S,P[3]):S=v.length==1&&Lc(v)?S[A]():S.thru(v)}return function(){var j=arguments,q=j[0];if(S&&j.length==1&&Ee(q))return S.plant(q).value();for(var J=0,oe=c?a[J].apply(this,j):q;++J<c;)oe=a[J].call(this,oe);return oe}})}function da(i,a,c,h,g,v,S,A,P,j){var q=a&H,J=a&G,oe=a&C,ue=a&(L|$),ge=a&K,Pe=oe?n:Xi(i);function ye(){for(var Fe=arguments.length,Me=z(Fe),jt=Fe;jt--;)Me[jt]=arguments[jt];if(ue)var Vt=zo(ye),qt=QB(Me,Vt);if(h&&(Me=Kh(Me,h,g,ue)),v&&(Me=Yh(Me,v,S,ue)),Fe-=qt,ue&&Fe<j){var st=Br(Me,Vt);return of(i,a,da,ye.placeholder,c,Me,st,A,P,j-Fe)}var Sn=J?c:this,tr=oe?Sn[i]:i;return Fe=Me.length,A?Me=aV(Me,A):ge&&Fe>1&&Me.reverse(),q&&P<Fe&&(Me.length=P),this&&this!==gt&&this instanceof ye&&(tr=Pe||Xi(tr)),tr.apply(Sn,Me)}return ye}function nf(i,a){return function(c,h){return mN(c,i,a(h),{})}}function ua(i,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=Wt(c),h=Wt(h)):(c=zh(c),h=zh(h)),g=i(c,h)}return g}}function Vc(i){return Jn(function(a){return a=Xe(a,Ut(fe())),De(function(c){var h=this;return i(a,function(g){return $t(g,h,c)})})})}function pa(i,a){a=a===n?" ":Wt(a);var c=a.length;if(c<2)return c?kc(a,i):a;var h=kc(a,Xs(i/Do(a)));return Po(a)?Dr(bn(h),0,i).join(""):h.slice(0,i)}function ZN(i,a,c,h){var g=a&G,v=Xi(i);function S(){for(var A=-1,P=arguments.length,j=-1,q=h.length,J=z(q+P),oe=this&&this!==gt&&this instanceof S?v:i;++j<q;)J[j]=h[j];for(;P--;)J[j++]=arguments[++A];return $t(oe,g?c:this,J)}return S}function rf(i){return function(a,c,h){return h&&typeof h!="number"&&Nt(a,c,h)&&(c=h=n),a=er(a),c===n?(c=a,a=0):c=er(c),h=h===n?a<c?1:-1:er(h),TN(a,c,h,i)}}function ha(i){return function(a,c){return typeof a=="string"&&typeof c=="string"||(a=rn(a),c=rn(c)),i(a,c)}}function of(i,a,c,h,g,v,S,A,P,j){var q=a&L,J=q?S:n,oe=q?n:S,ue=q?v:n,ge=q?n:v;a|=q?I:Y,a&=~(q?Y:I),a&F||(a&=~(G|C));var Pe=[i,a,g,ue,J,ge,oe,A,P,j],ye=c.apply(n,Pe);return Lc(i)&&yf(ye,Pe),ye.placeholder=h,_f(ye,i,a)}function Pc(i){var a=dt[i];return function(c,h){if(c=rn(c),h=h==null?0:bt(Ae(h),292),h&&yh(c)){var g=(We(c)+"e").split("e"),v=a(g[0]+"e"+(+g[1]+h));return g=(We(v)+"e").split("e"),+(g[0]+"e"+(+g[1]-h))}return a(c)}}var $N=Mo&&1/Zs(new Mo([,-0]))[1]==te?function(i){return new Mo(i)}:ed;function sf(i){return function(a){var c=xt(a);return c==Cn?lc(a):c==wn?sA(a):XB(a,i(a))}}function Yn(i,a,c,h,g,v,S,A){var P=a&C;if(!P&&typeof i!="function")throw new Xt(d);var j=h?h.length:0;if(j||(a&=~(I|Y),h=g=n),S=S===n?S:ut(Ae(S),0),A=A===n?A:Ae(A),j-=g?g.length:0,a&Y){var q=h,J=g;h=g=n}var oe=P?n:Rc(i),ue=[i,a,c,h,g,q,J,v,S,A];if(oe&&oV(ue,oe),i=ue[0],a=ue[1],c=ue[2],h=ue[3],g=ue[4],A=ue[9]=ue[9]===n?P?0:i.length:ut(ue[9]-j,0),!A&&a&(L|$)&&(a&=~(L|$)),!a||a==G)var ge=GN(i,a,c);else a==L||a==$?ge=zN(i,a,A):(a==I||a==(G|I))&&!g.length?ge=ZN(i,a,c,h):ge=da.apply(n,ue);var Pe=oe?Lh:yf;return _f(Pe(ge,ue),i,a)}function af(i,a,c,h){return i===n||kn(i,Ro[c])&&!He.call(h,c)?a:i}function lf(i,a,c,h,g,v){return tt(i)&&tt(a)&&(v.set(a,i),sa(i,a,n,lf,v),v.delete(a)),i}function UN(i){return ts(i)?n:i}function cf(i,a,c,h,g,v){var S=c&N,A=i.length,P=a.length;if(A!=P&&!(S&&P>A))return!1;var j=v.get(i),q=v.get(a);if(j&&q)return j==a&&q==i;var J=-1,oe=!0,ue=c&M?new to:n;for(v.set(i,a),v.set(a,i);++J<A;){var ge=i[J],Pe=a[J];if(h)var ye=S?h(Pe,ge,J,a,i,v):h(ge,Pe,J,i,a,v);if(ye!==n){if(ye)continue;oe=!1;break}if(ue){if(!nc(a,function(Fe,Me){if(!zi(ue,Me)&&(ge===Fe||g(ge,Fe,c,h,v)))return ue.push(Me)})){oe=!1;break}}else if(!(ge===Pe||g(ge,Pe,c,h,v))){oe=!1;break}}return v.delete(i),v.delete(a),oe}function WN(i,a,c,h,g,v,S){switch(c){case Ao:if(i.byteLength!=a.byteLength||i.byteOffset!=a.byteOffset)return!1;i=i.buffer,a=a.buffer;case Gi:return!(i.byteLength!=a.byteLength||!v(new qs(i),new qs(a)));case kr:case Sr:case Mi:return kn(+i,+a);case Se:return i.name==a.name&&i.message==a.message;case Ii:case Oi:return i==a+"";case Cn:var A=lc;case wn:var P=h&N;if(A||(A=Zs),i.size!=a.size&&!P)return!1;var j=S.get(i);if(j)return j==a;h|=M,S.set(i,a);var q=cf(A(i),A(a),h,g,v,S);return S.delete(i),q;case Ms:if(Hi)return Hi.call(i)==Hi.call(a)}return!1}function HN(i,a,c,h,g,v){var S=c&N,A=Dc(i),P=A.length,j=Dc(a),q=j.length;if(P!=q&&!S)return!1;for(var J=P;J--;){var oe=A[J];if(!(S?oe in a:He.call(a,oe)))return!1}var ue=v.get(i),ge=v.get(a);if(ue&&ge)return ue==a&&ge==i;var Pe=!0;v.set(i,a),v.set(a,i);for(var ye=S;++J<P;){oe=A[J];var Fe=i[oe],Me=a[oe];if(h)var jt=S?h(Me,Fe,oe,a,i,v):h(Fe,Me,oe,i,a,v);if(!(jt===n?Fe===Me||g(Fe,Me,c,h,v):jt)){Pe=!1;break}ye||(ye=oe=="constructor")}if(Pe&&!ye){var Vt=i.constructor,qt=a.constructor;Vt!=qt&&"constructor"in i&&"constructor"in a&&!(typeof Vt=="function"&&Vt instanceof Vt&&typeof qt=="function"&&qt instanceof qt)&&(Pe=!1)}return v.delete(i),v.delete(a),Pe}function Jn(i){return zc(mf(i,n,kf),i+"")}function Dc(i){return Bh(i,mt,Ic)}function Fc(i){return Bh(i,Rt,df)}var Rc=ea?function(i){return ea.get(i)}:ed;function fa(i){for(var a=i.name+"",c=Io[a],h=He.call(Io,a)?c.length:0;h--;){var g=c[h],v=g.func;if(v==null||v==i)return g.name}return a}function zo(i){var a=He.call(_,"placeholder")?_:i;return a.placeholder}function fe(){var i=_.iteratee||Xc;return i=i===Xc?Vh:i,arguments.length?i(arguments[0],arguments[1]):i}function ma(i,a){var c=i.__data__;return eV(a)?c[typeof a=="string"?"string":"hash"]:c.map}function Mc(i){for(var a=mt(i),c=a.length;c--;){var h=a[c],g=i[h];a[c]=[h,g,hf(g)]}return a}function oo(i,a){var c=rA(i,a);return Nh(c)?c:n}function jN(i){var a=He.call(i,Qr),c=i[Qr];try{i[Qr]=n;var h=!0}catch{}var g=Hs.call(i);return h&&(a?i[Qr]=c:delete i[Qr]),g}var Ic=dc?function(i){return i==null?[]:(i=je(i),Er(dc(i),function(a){return mh.call(i,a)}))}:td,df=dc?function(i){for(var a=[];i;)Tr(a,Ic(i)),i=Ks(i);return a}:td,xt=At;(uc&&xt(new uc(new ArrayBuffer(1)))!=Ao||$i&&xt(new $i)!=Cn||pc&&xt(pc.resolve())!=Sp||Mo&&xt(new Mo)!=wn||Ui&&xt(new Ui)!=Li)&&(xt=function(i){var a=At(i),c=a==Hn?i.constructor:n,h=c?io(c):"";if(h)switch(h){case AA:return Ao;case NA:return Cn;case VA:return Sp;case PA:return wn;case DA:return Li}return a});function qN(i,a,c){for(var h=-1,g=c.length;++h<g;){var v=c[h],S=v.size;switch(v.type){case"drop":i+=S;break;case"dropRight":a-=S;break;case"take":a=bt(a,i+S);break;case"takeRight":i=ut(i,a-S);break}}return{start:i,end:a}}function KN(i){var a=i.match(tB);return a?a[1].split(nB):[]}function uf(i,a,c){a=Pr(a,i);for(var h=-1,g=a.length,v=!1;++h<g;){var S=On(a[h]);if(!(v=i!=null&&c(i,S)))break;i=i[S]}return v||++h!=g?v:(g=i==null?0:i.length,!!g&&ba(g)&&Xn(S,g)&&(Ee(i)||so(i)))}function YN(i){var a=i.length,c=new i.constructor(a);return a&&typeof i[0]=="string"&&He.call(i,"index")&&(c.index=i.index,c.input=i.input),c}function pf(i){return typeof i.constructor=="function"&&!Qi(i)?Oo(Ks(i)):{}}function JN(i,a,c){var h=i.constructor;switch(a){case Gi:return Nc(i);case kr:case Sr:return new h(+i);case Ao:return FN(i,c);case Ml:case Il:case Ol:case Ll:case Gl:case zl:case Zl:case $l:case Ul:return jh(i,c);case Cn:return new h;case Mi:case Oi:return new h(i);case Ii:return RN(i);case wn:return new h;case Ms:return MN(i)}}function XN(i,a){var c=a.length;if(!c)return i;var h=c-1;return a[h]=(c>1?"& ":"")+a[h],a=a.join(c>2?", ":" "),i.replace(eB,`{
|
|
73
73
|
/* [wrapped with `+a+`] */
|
|
74
|
-
`)}function QN(i){return ke(i)||oo(i)||!!(mh&&i&&i[mh])}function Xn(i,a){var c=typeof i;return a=a??se,!!a&&(c=="number"||c!="symbol"&&uB.test(i))&&i>-1&&i%1==0&&i<a}function Nt(i,a,c){if(!tt(c))return!1;var h=typeof a;return(h=="number"?Ft(c)&&Xn(a,c.length):h=="string"&&a in c)?kn(c[a],i):!1}function Ic(i,a){if(ke(i))return!1;var c=typeof i;return c=="number"||c=="symbol"||c=="boolean"||i==null||Ht(i)?!0:YT.test(i)||!KT.test(i)||a!=null&&i in je(a)}function eV(i){var a=typeof i;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?i!=="__proto__":i===null}function Oc(i){var a=ha(i),c=_[a];if(typeof c!="function"||!(a in Fe.prototype))return!1;if(i===c)return!0;var h=Fc(c);return!!h&&i===h[0]}function tV(i){return!!uh&&uh in i}var nV=$s?Qn:td;function Ji(i){var a=i&&i.constructor,c=typeof a=="function"&&a.prototype||Do;return i===c}function pf(i){return i===i&&!tt(i)}function hf(i,a){return function(c){return c==null?!1:c[i]===a&&(a!==n||i in je(c))}}function rV(i){var a=va(i,function(h){return c.size===f&&c.clear(),h}),c=a.cache;return a}function oV(i,a){var c=i[1],h=a[1],g=c|h,v=g<(z|C|H),k=h==H&&c==G||h==H&&c==F&&i[7].length<=a[8]||h==(H|F)&&a[7].length<=a[8]&&c==G;if(!(v||k))return i;h&z&&(i[2]=a[2],g|=c&z?0:R);var T=a[3];if(T){var D=i[3];i[3]=D?qh(D,T,a[4]):T,i[4]=D?Er(i[3],m):a[4]}return T=a[5],T&&(D=i[5],i[5]=D?Kh(D,T,a[6]):T,i[6]=D?Er(i[5],m):a[6]),T=a[7],T&&(i[7]=T),h&H&&(i[8]=i[8]==null?a[8]:bt(i[8],a[8])),i[9]==null&&(i[9]=a[9]),i[0]=a[0],i[1]=g,i}function iV(i){var a=[];if(i!=null)for(var c in je(i))a.push(c);return a}function sV(i){return Ws.call(i)}function ff(i,a,c){return a=ut(a===n?i.length-1:a,0),function(){for(var h=arguments,g=-1,v=ut(h.length-a,0),k=Z(v);++g<v;)k[g]=h[a+g];g=-1;for(var T=Z(a+1);++g<a;)T[g]=h[g];return T[a]=c(k),$t(i,this,T)}}function mf(i,a){return a.length<2?i:to(i,tn(a,0,-1))}function aV(i,a){for(var c=i.length,h=bt(a.length,c),g=Dt(i);h--;){var v=a[h];i[h]=Xn(v,c)?g[v]:n}return i}function Lc(i,a){if(!(a==="constructor"&&typeof i[a]=="function")&&a!="__proto__")return i[a]}var gf=_f(Oh),Xi=bA||function(i,a){return gt.setTimeout(i,a)},Gc=_f(NN);function yf(i,a,c){var h=a+"";return Gc(i,XN(h,lV(KN(h),c)))}function _f(i){var a=0,c=0;return function(){var h=EA(),g=B-(h-c);if(c=h,g>0){if(++a>=K)return arguments[0]}else a=0;return i.apply(n,arguments)}}function ma(i,a){var c=-1,h=i.length,g=h-1;for(a=a===n?h:a;++c<a;){var v=bc(c,g),k=i[v];i[v]=i[c],i[c]=k}return i.length=a,i}var vf=rV(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(JT,function(c,h,g,v){a.push(g?v.replace(iB,"$1"):h||c)}),a});function On(i){if(typeof i=="string"||Ht(i))return i;var a=i+"";return a=="0"&&1/i==-re?"-0":a}function ro(i){if(i!=null){try{return Us.call(i)}catch{}try{return i+""}catch{}}return""}function lV(i,a){return Jt(br,function(c){var h="_."+c[0];a&c[1]&&!Ls(i,h)&&i.push(h)}),i.sort()}function Cf(i){if(i instanceof Fe)return i.clone();var a=new Qt(i.__wrapped__,i.__chain__);return a.__actions__=Dt(i.__actions__),a.__index__=i.__index__,a.__values__=i.__values__,a}function cV(i,a,c){(c?Nt(i,a,c):a===n)?a=1:a=ut(Te(a),0);var h=i==null?0:i.length;if(!h||a<1)return[];for(var g=0,v=0,k=Z(Js(h/a));g<h;)k[v++]=tn(i,g,g+=a);return k}function dV(i){for(var a=-1,c=i==null?0:i.length,h=0,g=[];++a<c;){var v=i[a];v&&(g[h++]=v)}return g}function uV(){var i=arguments.length;if(!i)return[];for(var a=Z(i-1),c=arguments[0],h=i;h--;)a[h-1]=arguments[h];return Sr(ke(c)?Dt(c):[c],yt(a,1))}var pV=Ve(function(i,a){return it(i)?Hi(i,yt(a,1,it,!0)):[]}),hV=Ve(function(i,a){var c=nn(a);return it(c)&&(c=n),it(i)?Hi(i,yt(a,1,it,!0),fe(c,2)):[]}),fV=Ve(function(i,a){var c=nn(a);return it(c)&&(c=n),it(i)?Hi(i,yt(a,1,it,!0),n,c):[]});function mV(i,a,c){var h=i==null?0:i.length;return h?(a=c||a===n?1:Te(a),tn(i,a<0?0:a,h)):[]}function gV(i,a,c){var h=i==null?0:i.length;return h?(a=c||a===n?1:Te(a),a=h-a,tn(i,0,a<0?0:a)):[]}function yV(i,a){return i&&i.length?aa(i,fe(a,3),!0,!0):[]}function _V(i,a){return i&&i.length?aa(i,fe(a,3),!0):[]}function vV(i,a,c,h){var g=i==null?0:i.length;return g?(c&&typeof c!="number"&&Nt(i,a,c)&&(c=0,h=g),uN(i,a,c,h)):[]}function wf(i,a,c){var h=i==null?0:i.length;if(!h)return-1;var g=c==null?0:Te(c);return g<0&&(g=ut(h+g,0)),Gs(i,fe(a,3),g)}function bf(i,a,c){var h=i==null?0:i.length;if(!h)return-1;var g=h-1;return c!==n&&(g=Te(c),g=c<0?ut(h+g,0):bt(g,h-1)),Gs(i,fe(a,3),g,!0)}function xf(i){var a=i==null?0:i.length;return a?yt(i,1):[]}function CV(i){var a=i==null?0:i.length;return a?yt(i,re):[]}function wV(i,a){var c=i==null?0:i.length;return c?(a=a===n?1:Te(a),yt(i,a)):[]}function bV(i){for(var a=-1,c=i==null?0:i.length,h={};++a<c;){var g=i[a];h[g[0]]=g[1]}return h}function kf(i){return i&&i.length?i[0]:n}function xV(i,a,c){var h=i==null?0:i.length;if(!h)return-1;var g=c==null?0:Te(c);return g<0&&(g=ut(h+g,0)),Ao(i,a,g)}function kV(i){var a=i==null?0:i.length;return a?tn(i,0,-1):[]}var SV=Ve(function(i){var a=Xe(i,Tc);return a.length&&a[0]===i[0]?yc(a):[]}),EV=Ve(function(i){var a=nn(i),c=Xe(i,Tc);return a===nn(c)?a=n:c.pop(),c.length&&c[0]===i[0]?yc(c,fe(a,2)):[]}),TV=Ve(function(i){var a=nn(i),c=Xe(i,Tc);return a=typeof a=="function"?a:n,a&&c.pop(),c.length&&c[0]===i[0]?yc(c,n,a):[]});function BV(i,a){return i==null?"":kA.call(i,a)}function nn(i){var a=i==null?0:i.length;return a?i[a-1]:n}function AV(i,a,c){var h=i==null?0:i.length;if(!h)return-1;var g=h;return c!==n&&(g=Te(c),g=g<0?ut(h+g,0):bt(g,h-1)),a===a?lA(i,a,g):Gs(i,rh,g,!0)}function NV(i,a){return i&&i.length?Fh(i,Te(a)):n}var VV=Ve(Sf);function Sf(i,a){return i&&i.length&&a&&a.length?wc(i,a):i}function PV(i,a,c){return i&&i.length&&a&&a.length?wc(i,a,fe(c,2)):i}function DV(i,a,c){return i&&i.length&&a&&a.length?wc(i,a,n,c):i}var FV=Jn(function(i,a){var c=i==null?0:i.length,h=hc(i,a);return Ih(i,Xe(a,function(g){return Xn(g,c)?+g:g}).sort(jh)),h});function RV(i,a){var c=[];if(!(i&&i.length))return c;var h=-1,g=[],v=i.length;for(a=fe(a,3);++h<v;){var k=i[h];a(k,h,i)&&(c.push(k),g.push(h))}return Ih(i,g),c}function zc(i){return i==null?i:BA.call(i)}function MV(i,a,c){var h=i==null?0:i.length;return h?(c&&typeof c!="number"&&Nt(i,a,c)?(a=0,c=h):(a=a==null?0:Te(a),c=c===n?h:Te(c)),tn(i,a,c)):[]}function IV(i,a){return sa(i,a)}function OV(i,a,c){return kc(i,a,fe(c,2))}function LV(i,a){var c=i==null?0:i.length;if(c){var h=sa(i,a);if(h<c&&kn(i[h],a))return h}return-1}function GV(i,a){return sa(i,a,!0)}function zV(i,a,c){return kc(i,a,fe(c,2),!0)}function ZV(i,a){var c=i==null?0:i.length;if(c){var h=sa(i,a,!0)-1;if(kn(i[h],a))return h}return-1}function $V(i){return i&&i.length?Lh(i):[]}function UV(i,a){return i&&i.length?Lh(i,fe(a,2)):[]}function WV(i){var a=i==null?0:i.length;return a?tn(i,1,a):[]}function HV(i,a,c){return i&&i.length?(a=c||a===n?1:Te(a),tn(i,0,a<0?0:a)):[]}function jV(i,a,c){var h=i==null?0:i.length;return h?(a=c||a===n?1:Te(a),a=h-a,tn(i,a<0?0:a,h)):[]}function qV(i,a){return i&&i.length?aa(i,fe(a,3),!1,!0):[]}function KV(i,a){return i&&i.length?aa(i,fe(a,3)):[]}var YV=Ve(function(i){return Ar(yt(i,1,it,!0))}),JV=Ve(function(i){var a=nn(i);return it(a)&&(a=n),Ar(yt(i,1,it,!0),fe(a,2))}),XV=Ve(function(i){var a=nn(i);return a=typeof a=="function"?a:n,Ar(yt(i,1,it,!0),n,a)});function QV(i){return i&&i.length?Ar(i):[]}function eP(i,a){return i&&i.length?Ar(i,fe(a,2)):[]}function tP(i,a){return a=typeof a=="function"?a:n,i&&i.length?Ar(i,n,a):[]}function Zc(i){if(!(i&&i.length))return[];var a=0;return i=kr(i,function(c){if(it(c))return a=ut(c.length,a),!0}),ic(a,function(c){return Xe(i,nc(c))})}function Ef(i,a){if(!(i&&i.length))return[];var c=Zc(i);return a==null?c:Xe(c,function(h){return $t(a,n,h)})}var nP=Ve(function(i,a){return it(i)?Hi(i,a):[]}),rP=Ve(function(i){return Ec(kr(i,it))}),oP=Ve(function(i){var a=nn(i);return it(a)&&(a=n),Ec(kr(i,it),fe(a,2))}),iP=Ve(function(i){var a=nn(i);return a=typeof a=="function"?a:n,Ec(kr(i,it),n,a)}),sP=Ve(Zc);function aP(i,a){return $h(i||[],a||[],Wi)}function lP(i,a){return $h(i||[],a||[],Ki)}var cP=Ve(function(i){var a=i.length,c=a>1?i[a-1]:n;return c=typeof c=="function"?(i.pop(),c):n,Ef(i,c)});function Tf(i){var a=_(i);return a.__chain__=!0,a}function dP(i,a){return a(i),i}function ga(i,a){return a(i)}var uP=Jn(function(i){var a=i.length,c=a?i[0]:0,h=this.__wrapped__,g=function(v){return hc(v,i)};return a>1||this.__actions__.length||!(h instanceof Fe)||!Xn(c)?this.thru(g):(h=h.slice(c,+c+(a?1:0)),h.__actions__.push({func:ga,args:[g],thisArg:n}),new Qt(h,this.__chain__).thru(function(v){return a&&!v.length&&v.push(n),v}))});function pP(){return Tf(this)}function hP(){return new Qt(this.value(),this.__chain__)}function fP(){this.__values__===n&&(this.__values__=zf(this.value()));var i=this.__index__>=this.__values__.length,a=i?n:this.__values__[this.__index__++];return{done:i,value:a}}function mP(){return this}function gP(i){for(var a,c=this;c instanceof ta;){var h=Cf(c);h.__index__=0,h.__values__=n,a?g.__wrapped__=h:a=h;var g=h;c=c.__wrapped__}return g.__wrapped__=i,a}function yP(){var i=this.__wrapped__;if(i instanceof Fe){var a=i;return this.__actions__.length&&(a=new Fe(this)),a=a.reverse(),a.__actions__.push({func:ga,args:[zc],thisArg:n}),new Qt(a,this.__chain__)}return this.thru(zc)}function _P(){return Zh(this.__wrapped__,this.__actions__)}var vP=la(function(i,a,c){We.call(i,c)?++i[c]:Kn(i,c,1)});function CP(i,a,c){var h=ke(i)?th:dN;return c&&Nt(i,a,c)&&(a=n),h(i,fe(a,3))}function wP(i,a){var c=ke(i)?kr:Sh;return c(i,fe(a,3))}var bP=Qh(wf),xP=Qh(bf);function kP(i,a){return yt(ya(i,a),1)}function SP(i,a){return yt(ya(i,a),re)}function EP(i,a,c){return c=c===n?1:Te(c),yt(ya(i,a),c)}function Bf(i,a){var c=ke(i)?Jt:Br;return c(i,fe(a,3))}function Af(i,a){var c=ke(i)?WB:kh;return c(i,fe(a,3))}var TP=la(function(i,a,c){We.call(i,c)?i[c].push(a):Kn(i,c,[a])});function BP(i,a,c,h){i=Ft(i)?i:zo(i),c=c&&!h?Te(c):0;var g=i.length;return c<0&&(c=ut(g+c,0)),ba(i)?c<=g&&i.indexOf(a,c)>-1:!!g&&Ao(i,a,c)>-1}var AP=Ve(function(i,a,c){var h=-1,g=typeof a=="function",v=Ft(i)?Z(i.length):[];return Br(i,function(k){v[++h]=g?$t(a,k,c):ji(k,a,c)}),v}),NP=la(function(i,a,c){Kn(i,c,a)});function ya(i,a){var c=ke(i)?Xe:Vh;return c(i,fe(a,3))}function VP(i,a,c,h){return i==null?[]:(ke(a)||(a=a==null?[]:[a]),c=h?n:c,ke(c)||(c=c==null?[]:[c]),Rh(i,a,c))}var PP=la(function(i,a,c){i[c?0:1].push(a)},function(){return[[],[]]});function DP(i,a,c){var h=ke(i)?ec:ih,g=arguments.length<3;return h(i,fe(a,4),c,g,Br)}function FP(i,a,c){var h=ke(i)?HB:ih,g=arguments.length<3;return h(i,fe(a,4),c,g,kh)}function RP(i,a){var c=ke(i)?kr:Sh;return c(i,Ca(fe(a,3)))}function MP(i){var a=ke(i)?Ch:BN;return a(i)}function IP(i,a,c){(c?Nt(i,a,c):a===n)?a=1:a=Te(a);var h=ke(i)?iN:AN;return h(i,a)}function OP(i){var a=ke(i)?sN:VN;return a(i)}function LP(i){if(i==null)return 0;if(Ft(i))return ba(i)?Vo(i):i.length;var a=xt(i);return a==Cn||a==wn?i.size:vc(i).length}function GP(i,a,c){var h=ke(i)?tc:PN;return c&&Nt(i,a,c)&&(a=n),h(i,fe(a,3))}var zP=Ve(function(i,a){if(i==null)return[];var c=a.length;return c>1&&Nt(i,a[0],a[1])?a=[]:c>2&&Nt(a[0],a[1],a[2])&&(a=[a[0]]),Rh(i,yt(a,1),[])}),_a=wA||function(){return gt.Date.now()};function ZP(i,a){if(typeof a!="function")throw new Xt(d);return i=Te(i),function(){if(--i<1)return a.apply(this,arguments)}}function Nf(i,a,c){return a=c?n:a,a=i&&a==null?i.length:a,Yn(i,H,n,n,n,n,a)}function Vf(i,a){var c;if(typeof a!="function")throw new Xt(d);return i=Te(i),function(){return--i>0&&(c=a.apply(this,arguments)),i<=1&&(a=n),c}}var $c=Ve(function(i,a,c){var h=z;if(c.length){var g=Er(c,Lo($c));h|=L}return Yn(i,h,a,c,g)}),Pf=Ve(function(i,a,c){var h=z|C;if(c.length){var g=Er(c,Lo(Pf));h|=L}return Yn(a,h,i,c,g)});function Df(i,a,c){a=c?n:a;var h=Yn(i,G,n,n,n,n,n,a);return h.placeholder=Df.placeholder,h}function Ff(i,a,c){a=c?n:a;var h=Yn(i,$,n,n,n,n,n,a);return h.placeholder=Ff.placeholder,h}function Rf(i,a,c){var h,g,v,k,T,D,q=0,Y=!1,X=!1,ne=!0;if(typeof i!="function")throw new Xt(d);a=rn(a)||0,tt(c)&&(Y=!!c.leading,X="maxWait"in c,v=X?ut(rn(c.maxWait)||0,a):v,ne="trailing"in c?!!c.trailing:ne);function ue(st){var Sn=h,tr=g;return h=g=n,q=st,k=i.apply(tr,Sn),k}function ge(st){return q=st,T=Xi(De,a),Y?ue(st):k}function Ne(st){var Sn=st-D,tr=st-q,em=a-Sn;return X?bt(em,v-tr):em}function ye(st){var Sn=st-D,tr=st-q;return D===n||Sn>=a||Sn<0||X&&tr>=v}function De(){var st=_a();if(ye(st))return Re(st);T=Xi(De,Ne(st))}function Re(st){return T=n,ne&&h?ue(st):(h=g=n,k)}function jt(){T!==n&&Uh(T),q=0,h=D=g=T=n}function Vt(){return T===n?k:Re(_a())}function qt(){var st=_a(),Sn=ye(st);if(h=arguments,g=this,D=st,Sn){if(T===n)return ge(D);if(X)return Uh(T),T=Xi(De,a),ue(D)}return T===n&&(T=Xi(De,a)),k}return qt.cancel=jt,qt.flush=Vt,qt}var $P=Ve(function(i,a){return xh(i,1,a)}),UP=Ve(function(i,a,c){return xh(i,rn(a)||0,c)});function WP(i){return Yn(i,N)}function va(i,a){if(typeof i!="function"||a!=null&&typeof a!="function")throw new Xt(d);var c=function(){var h=arguments,g=a?a.apply(this,h):h[0],v=c.cache;if(v.has(g))return v.get(g);var k=i.apply(this,h);return c.cache=v.set(g,k)||v,k};return c.cache=new(va.Cache||qn),c}va.Cache=qn;function Ca(i){if(typeof i!="function")throw new Xt(d);return function(){var a=arguments;switch(a.length){case 0:return!i.call(this);case 1:return!i.call(this,a[0]);case 2:return!i.call(this,a[0],a[1]);case 3:return!i.call(this,a[0],a[1],a[2])}return!i.apply(this,a)}}function HP(i){return Vf(2,i)}var jP=DN(function(i,a){a=a.length==1&&ke(a[0])?Xe(a[0],Ut(fe())):Xe(yt(a,1),Ut(fe()));var c=a.length;return Ve(function(h){for(var g=-1,v=bt(h.length,c);++g<v;)h[g]=a[g].call(this,h[g]);return $t(i,this,h)})}),Uc=Ve(function(i,a){var c=Er(a,Lo(Uc));return Yn(i,L,n,a,c)}),Mf=Ve(function(i,a){var c=Er(a,Lo(Mf));return Yn(i,J,n,a,c)}),qP=Jn(function(i,a){return Yn(i,F,n,n,n,a)});function KP(i,a){if(typeof i!="function")throw new Xt(d);return a=a===n?a:Te(a),Ve(i,a)}function YP(i,a){if(typeof i!="function")throw new Xt(d);return a=a==null?0:ut(Te(a),0),Ve(function(c){var h=c[a],g=Vr(c,0,a);return h&&Sr(g,h),$t(i,this,g)})}function JP(i,a,c){var h=!0,g=!0;if(typeof i!="function")throw new Xt(d);return tt(c)&&(h="leading"in c?!!c.leading:h,g="trailing"in c?!!c.trailing:g),Rf(i,a,{leading:h,maxWait:a,trailing:g})}function XP(i){return Nf(i,1)}function QP(i,a){return Uc(Bc(a),i)}function eD(){if(!arguments.length)return[];var i=arguments[0];return ke(i)?i:[i]}function tD(i){return en(i,S)}function nD(i,a){return a=typeof a=="function"?a:n,en(i,S,a)}function rD(i){return en(i,y|S)}function oD(i,a){return a=typeof a=="function"?a:n,en(i,y|S,a)}function iD(i,a){return a==null||bh(i,a,mt(a))}function kn(i,a){return i===a||i!==i&&a!==a}var sD=pa(gc),aD=pa(function(i,a){return i>=a}),oo=Bh(function(){return arguments}())?Bh:function(i){return nt(i)&&We.call(i,"callee")&&!fh.call(i,"callee")},ke=Z.isArray,lD=Kp?Ut(Kp):gN;function Ft(i){return i!=null&&wa(i.length)&&!Qn(i)}function it(i){return nt(i)&&Ft(i)}function cD(i){return i===!0||i===!1||nt(i)&&At(i)==ze}var Pr=xA||td,dD=Yp?Ut(Yp):yN;function uD(i){return nt(i)&&i.nodeType===1&&!Qi(i)}function pD(i){if(i==null)return!0;if(Ft(i)&&(ke(i)||typeof i=="string"||typeof i.splice=="function"||Pr(i)||Go(i)||oo(i)))return!i.length;var a=xt(i);if(a==Cn||a==wn)return!i.size;if(Ji(i))return!vc(i).length;for(var c in i)if(We.call(i,c))return!1;return!0}function hD(i,a){return qi(i,a)}function fD(i,a,c){c=typeof c=="function"?c:n;var h=c?c(i,a):n;return h===n?qi(i,a,n,c):!!h}function Wc(i){if(!nt(i))return!1;var a=At(i);return a==Ds||a==IT||typeof i.message=="string"&&typeof i.name=="string"&&!Qi(i)}function mD(i){return typeof i=="number"&&gh(i)}function Qn(i){if(!tt(i))return!1;var a=At(i);return a==Fs||a==xp||a==Ps||a==LT}function If(i){return typeof i=="number"&&i==Te(i)}function wa(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=se}function tt(i){var a=typeof i;return i!=null&&(a=="object"||a=="function")}function nt(i){return i!=null&&typeof i=="object"}var Of=Jp?Ut(Jp):vN;function gD(i,a){return i===a||_c(i,a,Rc(a))}function yD(i,a,c){return c=typeof c=="function"?c:n,_c(i,a,Rc(a),c)}function _D(i){return Lf(i)&&i!=+i}function vD(i){if(nV(i))throw new xe(l);return Ah(i)}function CD(i){return i===null}function wD(i){return i==null}function Lf(i){return typeof i=="number"||nt(i)&&At(i)==Fi}function Qi(i){if(!nt(i)||At(i)!=Hn)return!1;var a=qs(i);if(a===null)return!0;var c=We.call(a,"constructor")&&a.constructor;return typeof c=="function"&&c instanceof c&&Us.call(c)==yA}var Hc=Xp?Ut(Xp):CN;function bD(i){return If(i)&&i>=-se&&i<=se}var Gf=Qp?Ut(Qp):wN;function ba(i){return typeof i=="string"||!ke(i)&&nt(i)&&At(i)==Mi}function Ht(i){return typeof i=="symbol"||nt(i)&&At(i)==Rs}var Go=eh?Ut(eh):bN;function xD(i){return i===n}function kD(i){return nt(i)&&xt(i)==Ii}function SD(i){return nt(i)&&At(i)==zT}var ED=pa(Cc),TD=pa(function(i,a){return i<=a});function zf(i){if(!i)return[];if(Ft(i))return ba(i)?bn(i):Dt(i);if(Gi&&i[Gi])return iA(i[Gi]());var a=xt(i),c=a==Cn?ac:a==wn?zs:zo;return c(i)}function er(i){if(!i)return i===0?i:0;if(i=rn(i),i===re||i===-re){var a=i<0?-1:1;return a*Pe}return i===i?i:0}function Te(i){var a=er(i),c=a%1;return a===a?c?a-c:a:0}function Zf(i){return i?eo(Te(i),0,ot):0}function rn(i){if(typeof i=="number")return i;if(Ht(i))return He;if(tt(i)){var a=typeof i.valueOf=="function"?i.valueOf():i;i=tt(a)?a+"":a}if(typeof i!="string")return i===0?i:+i;i=sh(i);var c=lB.test(i);return c||dB.test(i)?ZB(i.slice(2),c?2:8):aB.test(i)?He:+i}function $f(i){return In(i,Rt(i))}function BD(i){return i?eo(Te(i),-se,se):i===0?i:0}function Ue(i){return i==null?"":Wt(i)}var AD=Io(function(i,a){if(Ji(a)||Ft(a)){In(a,mt(a),i);return}for(var c in a)We.call(a,c)&&Wi(i,c,a[c])}),Uf=Io(function(i,a){In(a,Rt(a),i)}),xa=Io(function(i,a,c,h){In(a,Rt(a),i,h)}),ND=Io(function(i,a,c,h){In(a,mt(a),i,h)}),VD=Jn(hc);function PD(i,a){var c=Mo(i);return a==null?c:wh(c,a)}var DD=Ve(function(i,a){i=je(i);var c=-1,h=a.length,g=h>2?a[2]:n;for(g&&Nt(a[0],a[1],g)&&(h=1);++c<h;)for(var v=a[c],k=Rt(v),T=-1,D=k.length;++T<D;){var q=k[T],Y=i[q];(Y===n||kn(Y,Do[q])&&!We.call(i,q))&&(i[q]=v[q])}return i}),FD=Ve(function(i){return i.push(n,af),$t(Wf,n,i)});function RD(i,a){return nh(i,fe(a,3),Mn)}function MD(i,a){return nh(i,fe(a,3),mc)}function ID(i,a){return i==null?i:fc(i,fe(a,3),Rt)}function OD(i,a){return i==null?i:Eh(i,fe(a,3),Rt)}function LD(i,a){return i&&Mn(i,fe(a,3))}function GD(i,a){return i&&mc(i,fe(a,3))}function zD(i){return i==null?[]:oa(i,mt(i))}function ZD(i){return i==null?[]:oa(i,Rt(i))}function jc(i,a,c){var h=i==null?n:to(i,a);return h===n?c:h}function $D(i,a){return i!=null&&df(i,a,pN)}function qc(i,a){return i!=null&&df(i,a,hN)}var UD=tf(function(i,a,c){a!=null&&typeof a.toString!="function"&&(a=Ws.call(a)),i[a]=c},Yc(Mt)),WD=tf(function(i,a,c){a!=null&&typeof a.toString!="function"&&(a=Ws.call(a)),We.call(i,a)?i[a].push(c):i[a]=[c]},fe),HD=Ve(ji);function mt(i){return Ft(i)?vh(i):vc(i)}function Rt(i){return Ft(i)?vh(i,!0):xN(i)}function jD(i,a){var c={};return a=fe(a,3),Mn(i,function(h,g,v){Kn(c,a(h,g,v),h)}),c}function qD(i,a){var c={};return a=fe(a,3),Mn(i,function(h,g,v){Kn(c,g,a(h,g,v))}),c}var KD=Io(function(i,a,c){ia(i,a,c)}),Wf=Io(function(i,a,c,h){ia(i,a,c,h)}),YD=Jn(function(i,a){var c={};if(i==null)return c;var h=!1;a=Xe(a,function(v){return v=Nr(v,i),h||(h=v.length>1),v}),In(i,Dc(i),c),h&&(c=en(c,y|E|S,UN));for(var g=a.length;g--;)Sc(c,a[g]);return c});function JD(i,a){return Hf(i,Ca(fe(a)))}var XD=Jn(function(i,a){return i==null?{}:SN(i,a)});function Hf(i,a){if(i==null)return{};var c=Xe(Dc(i),function(h){return[h]});return a=fe(a),Mh(i,c,function(h,g){return a(h,g[0])})}function QD(i,a,c){a=Nr(a,i);var h=-1,g=a.length;for(g||(g=1,i=n);++h<g;){var v=i==null?n:i[On(a[h])];v===n&&(h=g,v=c),i=Qn(v)?v.call(i):v}return i}function eF(i,a,c){return i==null?i:Ki(i,a,c)}function tF(i,a,c,h){return h=typeof h=="function"?h:n,i==null?i:Ki(i,a,c,h)}var jf=of(mt),qf=of(Rt);function nF(i,a,c){var h=ke(i),g=h||Pr(i)||Go(i);if(a=fe(a,4),c==null){var v=i&&i.constructor;g?c=h?new v:[]:tt(i)?c=Qn(v)?Mo(qs(i)):{}:c={}}return(g?Jt:Mn)(i,function(k,T,D){return a(c,k,T,D)}),c}function rF(i,a){return i==null?!0:Sc(i,a)}function oF(i,a,c){return i==null?i:zh(i,a,Bc(c))}function iF(i,a,c,h){return h=typeof h=="function"?h:n,i==null?i:zh(i,a,Bc(c),h)}function zo(i){return i==null?[]:sc(i,mt(i))}function sF(i){return i==null?[]:sc(i,Rt(i))}function aF(i,a,c){return c===n&&(c=a,a=n),c!==n&&(c=rn(c),c=c===c?c:0),a!==n&&(a=rn(a),a=a===a?a:0),eo(rn(i),a,c)}function lF(i,a,c){return a=er(a),c===n?(c=a,a=0):c=er(c),i=rn(i),fN(i,a,c)}function cF(i,a,c){if(c&&typeof c!="boolean"&&Nt(i,a,c)&&(a=c=n),c===n&&(typeof a=="boolean"?(c=a,a=n):typeof i=="boolean"&&(c=i,i=n)),i===n&&a===n?(i=0,a=1):(i=er(i),a===n?(a=i,i=0):a=er(a)),i>a){var h=i;i=a,a=h}if(c||i%1||a%1){var g=yh();return bt(i+g*(a-i+zB("1e-"+((g+"").length-1))),a)}return bc(i,a)}var dF=Oo(function(i,a,c){return a=a.toLowerCase(),i+(c?Kf(a):a)});function Kf(i){return Kc(Ue(i).toLowerCase())}function Yf(i){return i=Ue(i),i&&i.replace(pB,eA).replace(VB,"")}function uF(i,a,c){i=Ue(i),a=Wt(a);var h=i.length;c=c===n?h:eo(Te(c),0,h);var g=c;return c-=a.length,c>=0&&i.slice(c,g)==a}function pF(i){return i=Ue(i),i&&HT.test(i)?i.replace(Ep,tA):i}function hF(i){return i=Ue(i),i&&XT.test(i)?i.replace(Ul,"\\$&"):i}var fF=Oo(function(i,a,c){return i+(c?"-":"")+a.toLowerCase()}),mF=Oo(function(i,a,c){return i+(c?" ":"")+a.toLowerCase()}),gF=Xh("toLowerCase");function yF(i,a,c){i=Ue(i),a=Te(a);var h=a?Vo(i):0;if(!a||h>=a)return i;var g=(a-h)/2;return ua(Xs(g),c)+i+ua(Js(g),c)}function _F(i,a,c){i=Ue(i),a=Te(a);var h=a?Vo(i):0;return a&&h<a?i+ua(a-h,c):i}function vF(i,a,c){i=Ue(i),a=Te(a);var h=a?Vo(i):0;return a&&h<a?ua(a-h,c)+i:i}function CF(i,a,c){return c||a==null?a=0:a&&(a=+a),TA(Ue(i).replace(Wl,""),a||0)}function wF(i,a,c){return(c?Nt(i,a,c):a===n)?a=1:a=Te(a),xc(Ue(i),a)}function bF(){var i=arguments,a=Ue(i[0]);return i.length<3?a:a.replace(i[1],i[2])}var xF=Oo(function(i,a,c){return i+(c?"_":"")+a.toLowerCase()});function kF(i,a,c){return c&&typeof c!="number"&&Nt(i,a,c)&&(a=c=n),c=c===n?ot:c>>>0,c?(i=Ue(i),i&&(typeof a=="string"||a!=null&&!Hc(a))&&(a=Wt(a),!a&&No(i))?Vr(bn(i),0,c):i.split(a,c)):[]}var SF=Oo(function(i,a,c){return i+(c?" ":"")+Kc(a)});function EF(i,a,c){return i=Ue(i),c=c==null?0:eo(Te(c),0,i.length),a=Wt(a),i.slice(c,c+a.length)==a}function TF(i,a,c){var h=_.templateSettings;c&&Nt(i,a,c)&&(a=n),i=Ue(i),a=xa({},a,h,sf);var g=xa({},a.imports,h.imports,sf),v=mt(g),k=sc(g,v),T,D,q=0,Y=a.interpolate||Ms,X="__p += '",ne=lc((a.escape||Ms).source+"|"+Y.source+"|"+(Y===Tp?sB:Ms).source+"|"+(a.evaluate||Ms).source+"|$","g"),ue="//# sourceURL="+(We.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++MB+"]")+`
|
|
75
|
-
`;i.replace(
|
|
76
|
-
__e(`+
|
|
77
|
-
'`),Vt&&(
|
|
74
|
+
`)}function QN(i){return Ee(i)||so(i)||!!(gh&&i&&i[gh])}function Xn(i,a){var c=typeof i;return a=a??ne,!!a&&(c=="number"||c!="symbol"&&uB.test(i))&&i>-1&&i%1==0&&i<a}function Nt(i,a,c){if(!tt(c))return!1;var h=typeof a;return(h=="number"?Ft(c)&&Xn(a,c.length):h=="string"&&a in c)?kn(c[a],i):!1}function Oc(i,a){if(Ee(i))return!1;var c=typeof i;return c=="number"||c=="symbol"||c=="boolean"||i==null||Ht(i)?!0:YT.test(i)||!KT.test(i)||a!=null&&i in je(a)}function eV(i){var a=typeof i;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?i!=="__proto__":i===null}function Lc(i){var a=fa(i),c=_[a];if(typeof c!="function"||!(a in Re.prototype))return!1;if(i===c)return!0;var h=Rc(c);return!!h&&i===h[0]}function tV(i){return!!ph&&ph in i}var nV=Us?Qn:nd;function Qi(i){var a=i&&i.constructor,c=typeof a=="function"&&a.prototype||Ro;return i===c}function hf(i){return i===i&&!tt(i)}function ff(i,a){return function(c){return c==null?!1:c[i]===a&&(a!==n||i in je(c))}}function rV(i){var a=Ca(i,function(h){return c.size===f&&c.clear(),h}),c=a.cache;return a}function oV(i,a){var c=i[1],h=a[1],g=c|h,v=g<(G|C|H),S=h==H&&c==L||h==H&&c==D&&i[7].length<=a[8]||h==(H|D)&&a[7].length<=a[8]&&c==L;if(!(v||S))return i;h&G&&(i[2]=a[2],g|=c&G?0:F);var A=a[3];if(A){var P=i[3];i[3]=P?Kh(P,A,a[4]):A,i[4]=P?Br(i[3],m):a[4]}return A=a[5],A&&(P=i[5],i[5]=P?Yh(P,A,a[6]):A,i[6]=P?Br(i[5],m):a[6]),A=a[7],A&&(i[7]=A),h&H&&(i[8]=i[8]==null?a[8]:bt(i[8],a[8])),i[9]==null&&(i[9]=a[9]),i[0]=a[0],i[1]=g,i}function iV(i){var a=[];if(i!=null)for(var c in je(i))a.push(c);return a}function sV(i){return Hs.call(i)}function mf(i,a,c){return a=ut(a===n?i.length-1:a,0),function(){for(var h=arguments,g=-1,v=ut(h.length-a,0),S=z(v);++g<v;)S[g]=h[a+g];g=-1;for(var A=z(a+1);++g<a;)A[g]=h[g];return A[a]=c(S),$t(i,this,A)}}function gf(i,a){return a.length<2?i:ro(i,tn(a,0,-1))}function aV(i,a){for(var c=i.length,h=bt(a.length,c),g=Dt(i);h--;){var v=a[h];i[h]=Xn(v,c)?g[v]:n}return i}function Gc(i,a){if(!(a==="constructor"&&typeof i[a]=="function")&&a!="__proto__")return i[a]}var yf=vf(Lh),es=bA||function(i,a){return gt.setTimeout(i,a)},zc=vf(NN);function _f(i,a,c){var h=a+"";return zc(i,XN(h,lV(KN(h),c)))}function vf(i){var a=0,c=0;return function(){var h=EA(),g=E-(h-c);if(c=h,g>0){if(++a>=O)return arguments[0]}else a=0;return i.apply(n,arguments)}}function ga(i,a){var c=-1,h=i.length,g=h-1;for(a=a===n?h:a;++c<a;){var v=xc(c,g),S=i[v];i[v]=i[c],i[c]=S}return i.length=a,i}var Cf=rV(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(JT,function(c,h,g,v){a.push(g?v.replace(iB,"$1"):h||c)}),a});function On(i){if(typeof i=="string"||Ht(i))return i;var a=i+"";return a=="0"&&1/i==-te?"-0":a}function io(i){if(i!=null){try{return Ws.call(i)}catch{}try{return i+""}catch{}}return""}function lV(i,a){return Jt(xr,function(c){var h="_."+c[0];a&c[1]&&!Gs(i,h)&&i.push(h)}),i.sort()}function wf(i){if(i instanceof Re)return i.clone();var a=new Qt(i.__wrapped__,i.__chain__);return a.__actions__=Dt(i.__actions__),a.__index__=i.__index__,a.__values__=i.__values__,a}function cV(i,a,c){(c?Nt(i,a,c):a===n)?a=1:a=ut(Ae(a),0);var h=i==null?0:i.length;if(!h||a<1)return[];for(var g=0,v=0,S=z(Xs(h/a));g<h;)S[v++]=tn(i,g,g+=a);return S}function dV(i){for(var a=-1,c=i==null?0:i.length,h=0,g=[];++a<c;){var v=i[a];v&&(g[h++]=v)}return g}function uV(){var i=arguments.length;if(!i)return[];for(var a=z(i-1),c=arguments[0],h=i;h--;)a[h-1]=arguments[h];return Tr(Ee(c)?Dt(c):[c],yt(a,1))}var pV=De(function(i,a){return it(i)?qi(i,yt(a,1,it,!0)):[]}),hV=De(function(i,a){var c=nn(a);return it(c)&&(c=n),it(i)?qi(i,yt(a,1,it,!0),fe(c,2)):[]}),fV=De(function(i,a){var c=nn(a);return it(c)&&(c=n),it(i)?qi(i,yt(a,1,it,!0),n,c):[]});function mV(i,a,c){var h=i==null?0:i.length;return h?(a=c||a===n?1:Ae(a),tn(i,a<0?0:a,h)):[]}function gV(i,a,c){var h=i==null?0:i.length;return h?(a=c||a===n?1:Ae(a),a=h-a,tn(i,0,a<0?0:a)):[]}function yV(i,a){return i&&i.length?la(i,fe(a,3),!0,!0):[]}function _V(i,a){return i&&i.length?la(i,fe(a,3),!0):[]}function vV(i,a,c,h){var g=i==null?0:i.length;return g?(c&&typeof c!="number"&&Nt(i,a,c)&&(c=0,h=g),uN(i,a,c,h)):[]}function bf(i,a,c){var h=i==null?0:i.length;if(!h)return-1;var g=c==null?0:Ae(c);return g<0&&(g=ut(h+g,0)),zs(i,fe(a,3),g)}function xf(i,a,c){var h=i==null?0:i.length;if(!h)return-1;var g=h-1;return c!==n&&(g=Ae(c),g=c<0?ut(h+g,0):bt(g,h-1)),zs(i,fe(a,3),g,!0)}function kf(i){var a=i==null?0:i.length;return a?yt(i,1):[]}function CV(i){var a=i==null?0:i.length;return a?yt(i,te):[]}function wV(i,a){var c=i==null?0:i.length;return c?(a=a===n?1:Ae(a),yt(i,a)):[]}function bV(i){for(var a=-1,c=i==null?0:i.length,h={};++a<c;){var g=i[a];h[g[0]]=g[1]}return h}function Sf(i){return i&&i.length?i[0]:n}function xV(i,a,c){var h=i==null?0:i.length;if(!h)return-1;var g=c==null?0:Ae(c);return g<0&&(g=ut(h+g,0)),Vo(i,a,g)}function kV(i){var a=i==null?0:i.length;return a?tn(i,0,-1):[]}var SV=De(function(i){var a=Xe(i,Bc);return a.length&&a[0]===i[0]?_c(a):[]}),EV=De(function(i){var a=nn(i),c=Xe(i,Bc);return a===nn(c)?a=n:c.pop(),c.length&&c[0]===i[0]?_c(c,fe(a,2)):[]}),TV=De(function(i){var a=nn(i),c=Xe(i,Bc);return a=typeof a=="function"?a:n,a&&c.pop(),c.length&&c[0]===i[0]?_c(c,n,a):[]});function BV(i,a){return i==null?"":kA.call(i,a)}function nn(i){var a=i==null?0:i.length;return a?i[a-1]:n}function AV(i,a,c){var h=i==null?0:i.length;if(!h)return-1;var g=h;return c!==n&&(g=Ae(c),g=g<0?ut(h+g,0):bt(g,h-1)),a===a?lA(i,a,g):zs(i,oh,g,!0)}function NV(i,a){return i&&i.length?Rh(i,Ae(a)):n}var VV=De(Ef);function Ef(i,a){return i&&i.length&&a&&a.length?bc(i,a):i}function PV(i,a,c){return i&&i.length&&a&&a.length?bc(i,a,fe(c,2)):i}function DV(i,a,c){return i&&i.length&&a&&a.length?bc(i,a,n,c):i}var FV=Jn(function(i,a){var c=i==null?0:i.length,h=fc(i,a);return Oh(i,Xe(a,function(g){return Xn(g,c)?+g:g}).sort(qh)),h});function RV(i,a){var c=[];if(!(i&&i.length))return c;var h=-1,g=[],v=i.length;for(a=fe(a,3);++h<v;){var S=i[h];a(S,h,i)&&(c.push(S),g.push(h))}return Oh(i,g),c}function Zc(i){return i==null?i:BA.call(i)}function MV(i,a,c){var h=i==null?0:i.length;return h?(c&&typeof c!="number"&&Nt(i,a,c)?(a=0,c=h):(a=a==null?0:Ae(a),c=c===n?h:Ae(c)),tn(i,a,c)):[]}function IV(i,a){return aa(i,a)}function OV(i,a,c){return Sc(i,a,fe(c,2))}function LV(i,a){var c=i==null?0:i.length;if(c){var h=aa(i,a);if(h<c&&kn(i[h],a))return h}return-1}function GV(i,a){return aa(i,a,!0)}function zV(i,a,c){return Sc(i,a,fe(c,2),!0)}function ZV(i,a){var c=i==null?0:i.length;if(c){var h=aa(i,a,!0)-1;if(kn(i[h],a))return h}return-1}function $V(i){return i&&i.length?Gh(i):[]}function UV(i,a){return i&&i.length?Gh(i,fe(a,2)):[]}function WV(i){var a=i==null?0:i.length;return a?tn(i,1,a):[]}function HV(i,a,c){return i&&i.length?(a=c||a===n?1:Ae(a),tn(i,0,a<0?0:a)):[]}function jV(i,a,c){var h=i==null?0:i.length;return h?(a=c||a===n?1:Ae(a),a=h-a,tn(i,a<0?0:a,h)):[]}function qV(i,a){return i&&i.length?la(i,fe(a,3),!1,!0):[]}function KV(i,a){return i&&i.length?la(i,fe(a,3)):[]}var YV=De(function(i){return Vr(yt(i,1,it,!0))}),JV=De(function(i){var a=nn(i);return it(a)&&(a=n),Vr(yt(i,1,it,!0),fe(a,2))}),XV=De(function(i){var a=nn(i);return a=typeof a=="function"?a:n,Vr(yt(i,1,it,!0),n,a)});function QV(i){return i&&i.length?Vr(i):[]}function eP(i,a){return i&&i.length?Vr(i,fe(a,2)):[]}function tP(i,a){return a=typeof a=="function"?a:n,i&&i.length?Vr(i,n,a):[]}function $c(i){if(!(i&&i.length))return[];var a=0;return i=Er(i,function(c){if(it(c))return a=ut(c.length,a),!0}),sc(a,function(c){return Xe(i,rc(c))})}function Tf(i,a){if(!(i&&i.length))return[];var c=$c(i);return a==null?c:Xe(c,function(h){return $t(a,n,h)})}var nP=De(function(i,a){return it(i)?qi(i,a):[]}),rP=De(function(i){return Tc(Er(i,it))}),oP=De(function(i){var a=nn(i);return it(a)&&(a=n),Tc(Er(i,it),fe(a,2))}),iP=De(function(i){var a=nn(i);return a=typeof a=="function"?a:n,Tc(Er(i,it),n,a)}),sP=De($c);function aP(i,a){return Uh(i||[],a||[],ji)}function lP(i,a){return Uh(i||[],a||[],Ji)}var cP=De(function(i){var a=i.length,c=a>1?i[a-1]:n;return c=typeof c=="function"?(i.pop(),c):n,Tf(i,c)});function Bf(i){var a=_(i);return a.__chain__=!0,a}function dP(i,a){return a(i),i}function ya(i,a){return a(i)}var uP=Jn(function(i){var a=i.length,c=a?i[0]:0,h=this.__wrapped__,g=function(v){return fc(v,i)};return a>1||this.__actions__.length||!(h instanceof Re)||!Xn(c)?this.thru(g):(h=h.slice(c,+c+(a?1:0)),h.__actions__.push({func:ya,args:[g],thisArg:n}),new Qt(h,this.__chain__).thru(function(v){return a&&!v.length&&v.push(n),v}))});function pP(){return Bf(this)}function hP(){return new Qt(this.value(),this.__chain__)}function fP(){this.__values__===n&&(this.__values__=Zf(this.value()));var i=this.__index__>=this.__values__.length,a=i?n:this.__values__[this.__index__++];return{done:i,value:a}}function mP(){return this}function gP(i){for(var a,c=this;c instanceof na;){var h=wf(c);h.__index__=0,h.__values__=n,a?g.__wrapped__=h:a=h;var g=h;c=c.__wrapped__}return g.__wrapped__=i,a}function yP(){var i=this.__wrapped__;if(i instanceof Re){var a=i;return this.__actions__.length&&(a=new Re(this)),a=a.reverse(),a.__actions__.push({func:ya,args:[Zc],thisArg:n}),new Qt(a,this.__chain__)}return this.thru(Zc)}function _P(){return $h(this.__wrapped__,this.__actions__)}var vP=ca(function(i,a,c){He.call(i,c)?++i[c]:Kn(i,c,1)});function CP(i,a,c){var h=Ee(i)?nh:dN;return c&&Nt(i,a,c)&&(a=n),h(i,fe(a,3))}function wP(i,a){var c=Ee(i)?Er:Eh;return c(i,fe(a,3))}var bP=ef(bf),xP=ef(xf);function kP(i,a){return yt(_a(i,a),1)}function SP(i,a){return yt(_a(i,a),te)}function EP(i,a,c){return c=c===n?1:Ae(c),yt(_a(i,a),c)}function Af(i,a){var c=Ee(i)?Jt:Nr;return c(i,fe(a,3))}function Nf(i,a){var c=Ee(i)?WB:Sh;return c(i,fe(a,3))}var TP=ca(function(i,a,c){He.call(i,c)?i[c].push(a):Kn(i,c,[a])});function BP(i,a,c,h){i=Ft(i)?i:$o(i),c=c&&!h?Ae(c):0;var g=i.length;return c<0&&(c=ut(g+c,0)),xa(i)?c<=g&&i.indexOf(a,c)>-1:!!g&&Vo(i,a,c)>-1}var AP=De(function(i,a,c){var h=-1,g=typeof a=="function",v=Ft(i)?z(i.length):[];return Nr(i,function(S){v[++h]=g?$t(a,S,c):Ki(S,a,c)}),v}),NP=ca(function(i,a,c){Kn(i,c,a)});function _a(i,a){var c=Ee(i)?Xe:Ph;return c(i,fe(a,3))}function VP(i,a,c,h){return i==null?[]:(Ee(a)||(a=a==null?[]:[a]),c=h?n:c,Ee(c)||(c=c==null?[]:[c]),Mh(i,a,c))}var PP=ca(function(i,a,c){i[c?0:1].push(a)},function(){return[[],[]]});function DP(i,a,c){var h=Ee(i)?tc:sh,g=arguments.length<3;return h(i,fe(a,4),c,g,Nr)}function FP(i,a,c){var h=Ee(i)?HB:sh,g=arguments.length<3;return h(i,fe(a,4),c,g,Sh)}function RP(i,a){var c=Ee(i)?Er:Eh;return c(i,wa(fe(a,3)))}function MP(i){var a=Ee(i)?wh:BN;return a(i)}function IP(i,a,c){(c?Nt(i,a,c):a===n)?a=1:a=Ae(a);var h=Ee(i)?iN:AN;return h(i,a)}function OP(i){var a=Ee(i)?sN:VN;return a(i)}function LP(i){if(i==null)return 0;if(Ft(i))return xa(i)?Do(i):i.length;var a=xt(i);return a==Cn||a==wn?i.size:Cc(i).length}function GP(i,a,c){var h=Ee(i)?nc:PN;return c&&Nt(i,a,c)&&(a=n),h(i,fe(a,3))}var zP=De(function(i,a){if(i==null)return[];var c=a.length;return c>1&&Nt(i,a[0],a[1])?a=[]:c>2&&Nt(a[0],a[1],a[2])&&(a=[a[0]]),Mh(i,yt(a,1),[])}),va=wA||function(){return gt.Date.now()};function ZP(i,a){if(typeof a!="function")throw new Xt(d);return i=Ae(i),function(){if(--i<1)return a.apply(this,arguments)}}function Vf(i,a,c){return a=c?n:a,a=i&&a==null?i.length:a,Yn(i,H,n,n,n,n,a)}function Pf(i,a){var c;if(typeof a!="function")throw new Xt(d);return i=Ae(i),function(){return--i>0&&(c=a.apply(this,arguments)),i<=1&&(a=n),c}}var Uc=De(function(i,a,c){var h=G;if(c.length){var g=Br(c,zo(Uc));h|=I}return Yn(i,h,a,c,g)}),Df=De(function(i,a,c){var h=G|C;if(c.length){var g=Br(c,zo(Df));h|=I}return Yn(a,h,i,c,g)});function Ff(i,a,c){a=c?n:a;var h=Yn(i,L,n,n,n,n,n,a);return h.placeholder=Ff.placeholder,h}function Rf(i,a,c){a=c?n:a;var h=Yn(i,$,n,n,n,n,n,a);return h.placeholder=Rf.placeholder,h}function Mf(i,a,c){var h,g,v,S,A,P,j=0,q=!1,J=!1,oe=!0;if(typeof i!="function")throw new Xt(d);a=rn(a)||0,tt(c)&&(q=!!c.leading,J="maxWait"in c,v=J?ut(rn(c.maxWait)||0,a):v,oe="trailing"in c?!!c.trailing:oe);function ue(st){var Sn=h,tr=g;return h=g=n,j=st,S=i.apply(tr,Sn),S}function ge(st){return j=st,A=es(Fe,a),q?ue(st):S}function Pe(st){var Sn=st-P,tr=st-j,tm=a-Sn;return J?bt(tm,v-tr):tm}function ye(st){var Sn=st-P,tr=st-j;return P===n||Sn>=a||Sn<0||J&&tr>=v}function Fe(){var st=va();if(ye(st))return Me(st);A=es(Fe,Pe(st))}function Me(st){return A=n,oe&&h?ue(st):(h=g=n,S)}function jt(){A!==n&&Wh(A),j=0,h=P=g=A=n}function Vt(){return A===n?S:Me(va())}function qt(){var st=va(),Sn=ye(st);if(h=arguments,g=this,P=st,Sn){if(A===n)return ge(P);if(J)return Wh(A),A=es(Fe,a),ue(P)}return A===n&&(A=es(Fe,a)),S}return qt.cancel=jt,qt.flush=Vt,qt}var $P=De(function(i,a){return kh(i,1,a)}),UP=De(function(i,a,c){return kh(i,rn(a)||0,c)});function WP(i){return Yn(i,K)}function Ca(i,a){if(typeof i!="function"||a!=null&&typeof a!="function")throw new Xt(d);var c=function(){var h=arguments,g=a?a.apply(this,h):h[0],v=c.cache;if(v.has(g))return v.get(g);var S=i.apply(this,h);return c.cache=v.set(g,S)||v,S};return c.cache=new(Ca.Cache||qn),c}Ca.Cache=qn;function wa(i){if(typeof i!="function")throw new Xt(d);return function(){var a=arguments;switch(a.length){case 0:return!i.call(this);case 1:return!i.call(this,a[0]);case 2:return!i.call(this,a[0],a[1]);case 3:return!i.call(this,a[0],a[1],a[2])}return!i.apply(this,a)}}function HP(i){return Pf(2,i)}var jP=DN(function(i,a){a=a.length==1&&Ee(a[0])?Xe(a[0],Ut(fe())):Xe(yt(a,1),Ut(fe()));var c=a.length;return De(function(h){for(var g=-1,v=bt(h.length,c);++g<v;)h[g]=a[g].call(this,h[g]);return $t(i,this,h)})}),Wc=De(function(i,a){var c=Br(a,zo(Wc));return Yn(i,I,n,a,c)}),If=De(function(i,a){var c=Br(a,zo(If));return Yn(i,Y,n,a,c)}),qP=Jn(function(i,a){return Yn(i,D,n,n,n,a)});function KP(i,a){if(typeof i!="function")throw new Xt(d);return a=a===n?a:Ae(a),De(i,a)}function YP(i,a){if(typeof i!="function")throw new Xt(d);return a=a==null?0:ut(Ae(a),0),De(function(c){var h=c[a],g=Dr(c,0,a);return h&&Tr(g,h),$t(i,this,g)})}function JP(i,a,c){var h=!0,g=!0;if(typeof i!="function")throw new Xt(d);return tt(c)&&(h="leading"in c?!!c.leading:h,g="trailing"in c?!!c.trailing:g),Mf(i,a,{leading:h,maxWait:a,trailing:g})}function XP(i){return Vf(i,1)}function QP(i,a){return Wc(Ac(a),i)}function eD(){if(!arguments.length)return[];var i=arguments[0];return Ee(i)?i:[i]}function tD(i){return en(i,T)}function nD(i,a){return a=typeof a=="function"?a:n,en(i,T,a)}function rD(i){return en(i,y|T)}function oD(i,a){return a=typeof a=="function"?a:n,en(i,y|T,a)}function iD(i,a){return a==null||xh(i,a,mt(a))}function kn(i,a){return i===a||i!==i&&a!==a}var sD=ha(yc),aD=ha(function(i,a){return i>=a}),so=Ah(function(){return arguments}())?Ah:function(i){return nt(i)&&He.call(i,"callee")&&!mh.call(i,"callee")},Ee=z.isArray,lD=Yp?Ut(Yp):gN;function Ft(i){return i!=null&&ba(i.length)&&!Qn(i)}function it(i){return nt(i)&&Ft(i)}function cD(i){return i===!0||i===!1||nt(i)&&At(i)==kr}var Fr=xA||nd,dD=Jp?Ut(Jp):yN;function uD(i){return nt(i)&&i.nodeType===1&&!ts(i)}function pD(i){if(i==null)return!0;if(Ft(i)&&(Ee(i)||typeof i=="string"||typeof i.splice=="function"||Fr(i)||Zo(i)||so(i)))return!i.length;var a=xt(i);if(a==Cn||a==wn)return!i.size;if(Qi(i))return!Cc(i).length;for(var c in i)if(He.call(i,c))return!1;return!0}function hD(i,a){return Yi(i,a)}function fD(i,a,c){c=typeof c=="function"?c:n;var h=c?c(i,a):n;return h===n?Yi(i,a,n,c):!!h}function Hc(i){if(!nt(i))return!1;var a=At(i);return a==Se||a==Rs||typeof i.message=="string"&&typeof i.name=="string"&&!ts(i)}function mD(i){return typeof i=="number"&&yh(i)}function Qn(i){if(!tt(i))return!1;var a=At(i);return a==Jr||a==kp||a==Fs||a==LT}function Of(i){return typeof i=="number"&&i==Ae(i)}function ba(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=ne}function tt(i){var a=typeof i;return i!=null&&(a=="object"||a=="function")}function nt(i){return i!=null&&typeof i=="object"}var Lf=Xp?Ut(Xp):vN;function gD(i,a){return i===a||vc(i,a,Mc(a))}function yD(i,a,c){return c=typeof c=="function"?c:n,vc(i,a,Mc(a),c)}function _D(i){return Gf(i)&&i!=+i}function vD(i){if(nV(i))throw new ke(l);return Nh(i)}function CD(i){return i===null}function wD(i){return i==null}function Gf(i){return typeof i=="number"||nt(i)&&At(i)==Mi}function ts(i){if(!nt(i)||At(i)!=Hn)return!1;var a=Ks(i);if(a===null)return!0;var c=He.call(a,"constructor")&&a.constructor;return typeof c=="function"&&c instanceof c&&Ws.call(c)==yA}var jc=Qp?Ut(Qp):CN;function bD(i){return Of(i)&&i>=-ne&&i<=ne}var zf=eh?Ut(eh):wN;function xa(i){return typeof i=="string"||!Ee(i)&&nt(i)&&At(i)==Oi}function Ht(i){return typeof i=="symbol"||nt(i)&&At(i)==Ms}var Zo=th?Ut(th):bN;function xD(i){return i===n}function kD(i){return nt(i)&&xt(i)==Li}function SD(i){return nt(i)&&At(i)==zT}var ED=ha(wc),TD=ha(function(i,a){return i<=a});function Zf(i){if(!i)return[];if(Ft(i))return xa(i)?bn(i):Dt(i);if(Zi&&i[Zi])return iA(i[Zi]());var a=xt(i),c=a==Cn?lc:a==wn?Zs:$o;return c(i)}function er(i){if(!i)return i===0?i:0;if(i=rn(i),i===te||i===-te){var a=i<0?-1:1;return a*be}return i===i?i:0}function Ae(i){var a=er(i),c=a%1;return a===a?c?a-c:a:0}function $f(i){return i?no(Ae(i),0,ot):0}function rn(i){if(typeof i=="number")return i;if(Ht(i))return Ze;if(tt(i)){var a=typeof i.valueOf=="function"?i.valueOf():i;i=tt(a)?a+"":a}if(typeof i!="string")return i===0?i:+i;i=ah(i);var c=lB.test(i);return c||dB.test(i)?ZB(i.slice(2),c?2:8):aB.test(i)?Ze:+i}function Uf(i){return In(i,Rt(i))}function BD(i){return i?no(Ae(i),-ne,ne):i===0?i:0}function We(i){return i==null?"":Wt(i)}var AD=Lo(function(i,a){if(Qi(a)||Ft(a)){In(a,mt(a),i);return}for(var c in a)He.call(a,c)&&ji(i,c,a[c])}),Wf=Lo(function(i,a){In(a,Rt(a),i)}),ka=Lo(function(i,a,c,h){In(a,Rt(a),i,h)}),ND=Lo(function(i,a,c,h){In(a,mt(a),i,h)}),VD=Jn(fc);function PD(i,a){var c=Oo(i);return a==null?c:bh(c,a)}var DD=De(function(i,a){i=je(i);var c=-1,h=a.length,g=h>2?a[2]:n;for(g&&Nt(a[0],a[1],g)&&(h=1);++c<h;)for(var v=a[c],S=Rt(v),A=-1,P=S.length;++A<P;){var j=S[A],q=i[j];(q===n||kn(q,Ro[j])&&!He.call(i,j))&&(i[j]=v[j])}return i}),FD=De(function(i){return i.push(n,lf),$t(Hf,n,i)});function RD(i,a){return rh(i,fe(a,3),Mn)}function MD(i,a){return rh(i,fe(a,3),gc)}function ID(i,a){return i==null?i:mc(i,fe(a,3),Rt)}function OD(i,a){return i==null?i:Th(i,fe(a,3),Rt)}function LD(i,a){return i&&Mn(i,fe(a,3))}function GD(i,a){return i&&gc(i,fe(a,3))}function zD(i){return i==null?[]:ia(i,mt(i))}function ZD(i){return i==null?[]:ia(i,Rt(i))}function qc(i,a,c){var h=i==null?n:ro(i,a);return h===n?c:h}function $D(i,a){return i!=null&&uf(i,a,pN)}function Kc(i,a){return i!=null&&uf(i,a,hN)}var UD=nf(function(i,a,c){a!=null&&typeof a.toString!="function"&&(a=Hs.call(a)),i[a]=c},Jc(Mt)),WD=nf(function(i,a,c){a!=null&&typeof a.toString!="function"&&(a=Hs.call(a)),He.call(i,a)?i[a].push(c):i[a]=[c]},fe),HD=De(Ki);function mt(i){return Ft(i)?Ch(i):Cc(i)}function Rt(i){return Ft(i)?Ch(i,!0):xN(i)}function jD(i,a){var c={};return a=fe(a,3),Mn(i,function(h,g,v){Kn(c,a(h,g,v),h)}),c}function qD(i,a){var c={};return a=fe(a,3),Mn(i,function(h,g,v){Kn(c,g,a(h,g,v))}),c}var KD=Lo(function(i,a,c){sa(i,a,c)}),Hf=Lo(function(i,a,c,h){sa(i,a,c,h)}),YD=Jn(function(i,a){var c={};if(i==null)return c;var h=!1;a=Xe(a,function(v){return v=Pr(v,i),h||(h=v.length>1),v}),In(i,Fc(i),c),h&&(c=en(c,y|B|T,UN));for(var g=a.length;g--;)Ec(c,a[g]);return c});function JD(i,a){return jf(i,wa(fe(a)))}var XD=Jn(function(i,a){return i==null?{}:SN(i,a)});function jf(i,a){if(i==null)return{};var c=Xe(Fc(i),function(h){return[h]});return a=fe(a),Ih(i,c,function(h,g){return a(h,g[0])})}function QD(i,a,c){a=Pr(a,i);var h=-1,g=a.length;for(g||(g=1,i=n);++h<g;){var v=i==null?n:i[On(a[h])];v===n&&(h=g,v=c),i=Qn(v)?v.call(i):v}return i}function eF(i,a,c){return i==null?i:Ji(i,a,c)}function tF(i,a,c,h){return h=typeof h=="function"?h:n,i==null?i:Ji(i,a,c,h)}var qf=sf(mt),Kf=sf(Rt);function nF(i,a,c){var h=Ee(i),g=h||Fr(i)||Zo(i);if(a=fe(a,4),c==null){var v=i&&i.constructor;g?c=h?new v:[]:tt(i)?c=Qn(v)?Oo(Ks(i)):{}:c={}}return(g?Jt:Mn)(i,function(S,A,P){return a(c,S,A,P)}),c}function rF(i,a){return i==null?!0:Ec(i,a)}function oF(i,a,c){return i==null?i:Zh(i,a,Ac(c))}function iF(i,a,c,h){return h=typeof h=="function"?h:n,i==null?i:Zh(i,a,Ac(c),h)}function $o(i){return i==null?[]:ac(i,mt(i))}function sF(i){return i==null?[]:ac(i,Rt(i))}function aF(i,a,c){return c===n&&(c=a,a=n),c!==n&&(c=rn(c),c=c===c?c:0),a!==n&&(a=rn(a),a=a===a?a:0),no(rn(i),a,c)}function lF(i,a,c){return a=er(a),c===n?(c=a,a=0):c=er(c),i=rn(i),fN(i,a,c)}function cF(i,a,c){if(c&&typeof c!="boolean"&&Nt(i,a,c)&&(a=c=n),c===n&&(typeof a=="boolean"?(c=a,a=n):typeof i=="boolean"&&(c=i,i=n)),i===n&&a===n?(i=0,a=1):(i=er(i),a===n?(a=i,i=0):a=er(a)),i>a){var h=i;i=a,a=h}if(c||i%1||a%1){var g=_h();return bt(i+g*(a-i+zB("1e-"+((g+"").length-1))),a)}return xc(i,a)}var dF=Go(function(i,a,c){return a=a.toLowerCase(),i+(c?Yf(a):a)});function Yf(i){return Yc(We(i).toLowerCase())}function Jf(i){return i=We(i),i&&i.replace(pB,eA).replace(VB,"")}function uF(i,a,c){i=We(i),a=Wt(a);var h=i.length;c=c===n?h:no(Ae(c),0,h);var g=c;return c-=a.length,c>=0&&i.slice(c,g)==a}function pF(i){return i=We(i),i&&HT.test(i)?i.replace(Tp,tA):i}function hF(i){return i=We(i),i&&XT.test(i)?i.replace(Wl,"\\$&"):i}var fF=Go(function(i,a,c){return i+(c?"-":"")+a.toLowerCase()}),mF=Go(function(i,a,c){return i+(c?" ":"")+a.toLowerCase()}),gF=Qh("toLowerCase");function yF(i,a,c){i=We(i),a=Ae(a);var h=a?Do(i):0;if(!a||h>=a)return i;var g=(a-h)/2;return pa(Qs(g),c)+i+pa(Xs(g),c)}function _F(i,a,c){i=We(i),a=Ae(a);var h=a?Do(i):0;return a&&h<a?i+pa(a-h,c):i}function vF(i,a,c){i=We(i),a=Ae(a);var h=a?Do(i):0;return a&&h<a?pa(a-h,c)+i:i}function CF(i,a,c){return c||a==null?a=0:a&&(a=+a),TA(We(i).replace(Hl,""),a||0)}function wF(i,a,c){return(c?Nt(i,a,c):a===n)?a=1:a=Ae(a),kc(We(i),a)}function bF(){var i=arguments,a=We(i[0]);return i.length<3?a:a.replace(i[1],i[2])}var xF=Go(function(i,a,c){return i+(c?"_":"")+a.toLowerCase()});function kF(i,a,c){return c&&typeof c!="number"&&Nt(i,a,c)&&(a=c=n),c=c===n?ot:c>>>0,c?(i=We(i),i&&(typeof a=="string"||a!=null&&!jc(a))&&(a=Wt(a),!a&&Po(i))?Dr(bn(i),0,c):i.split(a,c)):[]}var SF=Go(function(i,a,c){return i+(c?" ":"")+Yc(a)});function EF(i,a,c){return i=We(i),c=c==null?0:no(Ae(c),0,i.length),a=Wt(a),i.slice(c,c+a.length)==a}function TF(i,a,c){var h=_.templateSettings;c&&Nt(i,a,c)&&(a=n),i=We(i),a=ka({},a,h,af);var g=ka({},a.imports,h.imports,af),v=mt(g),S=ac(g,v),A,P,j=0,q=a.interpolate||Is,J="__p += '",oe=cc((a.escape||Is).source+"|"+q.source+"|"+(q===Bp?sB:Is).source+"|"+(a.evaluate||Is).source+"|$","g"),ue="//# sourceURL="+(He.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++MB+"]")+`
|
|
75
|
+
`;i.replace(oe,function(ye,Fe,Me,jt,Vt,qt){return Me||(Me=jt),J+=i.slice(j,qt).replace(hB,nA),Fe&&(A=!0,J+=`' +
|
|
76
|
+
__e(`+Fe+`) +
|
|
77
|
+
'`),Vt&&(P=!0,J+=`';
|
|
78
78
|
`+Vt+`;
|
|
79
|
-
__p += '`),
|
|
80
|
-
((__t = (`+
|
|
81
|
-
'`),
|
|
82
|
-
`;var ge=
|
|
83
|
-
`+
|
|
79
|
+
__p += '`),Me&&(J+=`' +
|
|
80
|
+
((__t = (`+Me+`)) == null ? '' : __t) +
|
|
81
|
+
'`),j=qt+ye.length,ye}),J+=`';
|
|
82
|
+
`;var ge=He.call(a,"variable")&&a.variable;if(!ge)J=`with (obj) {
|
|
83
|
+
`+J+`
|
|
84
84
|
}
|
|
85
|
-
`;else if(oB.test(ge))throw new
|
|
85
|
+
`;else if(oB.test(ge))throw new ke(u);J=(P?J.replace(ZT,""):J).replace($T,"$1").replace(UT,"$1;"),J="function("+(ge||"obj")+`) {
|
|
86
86
|
`+(ge?"":`obj || (obj = {});
|
|
87
|
-
`)+"var __t, __p = ''"+(
|
|
87
|
+
`)+"var __t, __p = ''"+(A?", __e = _.escape":"")+(P?`, __j = Array.prototype.join;
|
|
88
88
|
function print() { __p += __j.call(arguments, '') }
|
|
89
89
|
`:`;
|
|
90
|
-
`)+
|
|
91
|
-
}`;var Ne=Xf(function(){return Ze(v,ue+"return "+X).apply(n,k)});if(Ne.source=X,Wc(Ne))throw Ne;return Ne}function BF(i){return Ue(i).toLowerCase()}function AF(i){return Ue(i).toUpperCase()}function NF(i,a,c){if(i=Ue(i),i&&(c||a===n))return sh(i);if(!i||!(a=Wt(a)))return i;var h=bn(i),g=bn(a),v=ah(h,g),k=lh(h,g)+1;return Vr(h,v,k).join("")}function VF(i,a,c){if(i=Ue(i),i&&(c||a===n))return i.slice(0,dh(i)+1);if(!i||!(a=Wt(a)))return i;var h=bn(i),g=lh(h,bn(a))+1;return Vr(h,0,g).join("")}function PF(i,a,c){if(i=Ue(i),i&&(c||a===n))return i.replace(Wl,"");if(!i||!(a=Wt(a)))return i;var h=bn(i),g=ah(h,bn(a));return Vr(h,g).join("")}function DF(i,a){var c=M,h=j;if(tt(a)){var g="separator"in a?a.separator:g;c="length"in a?Te(a.length):c,h="omission"in a?Wt(a.omission):h}i=Ue(i);var v=i.length;if(No(i)){var k=bn(i);v=k.length}if(c>=v)return i;var T=c-Vo(h);if(T<1)return h;var D=k?Vr(k,0,T).join(""):i.slice(0,T);if(g===n)return D+h;if(k&&(T+=D.length-T),Hc(g)){if(i.slice(T).search(g)){var q,Y=D;for(g.global||(g=lc(g.source,Ue(Bp.exec(g))+"g")),g.lastIndex=0;q=g.exec(Y);)var X=q.index;D=D.slice(0,X===n?T:X)}}else if(i.indexOf(Wt(g),T)!=T){var ne=D.lastIndexOf(g);ne>-1&&(D=D.slice(0,ne))}return D+h}function FF(i){return i=Ue(i),i&&WT.test(i)?i.replace(Sp,cA):i}var RF=Oo(function(i,a,c){return i+(c?" ":"")+a.toUpperCase()}),Kc=Xh("toUpperCase");function Jf(i,a,c){return i=Ue(i),a=c?n:a,a===n?oA(i)?pA(i):KB(i):i.match(a)||[]}var Xf=Ve(function(i,a){try{return $t(i,n,a)}catch(c){return Wc(c)?c:new xe(c)}}),MF=Jn(function(i,a){return Jt(a,function(c){c=On(c),Kn(i,c,$c(i[c],i))}),i});function IF(i){var a=i==null?0:i.length,c=fe();return i=a?Xe(i,function(h){if(typeof h[1]!="function")throw new Xt(d);return[c(h[0]),h[1]]}):[],Ve(function(h){for(var g=-1;++g<a;){var v=i[g];if($t(v[0],this,h))return $t(v[1],this,h)}})}function OF(i){return cN(en(i,y))}function Yc(i){return function(){return i}}function LF(i,a){return i==null||i!==i?a:i}var GF=ef(),zF=ef(!0);function Mt(i){return i}function Jc(i){return Nh(typeof i=="function"?i:en(i,y))}function ZF(i){return Ph(en(i,y))}function $F(i,a){return Dh(i,en(a,y))}var UF=Ve(function(i,a){return function(c){return ji(c,i,a)}}),WF=Ve(function(i,a){return function(c){return ji(i,c,a)}});function Xc(i,a,c){var h=mt(a),g=oa(a,h);c==null&&!(tt(a)&&(g.length||!h.length))&&(c=a,a=i,i=this,g=oa(a,mt(a)));var v=!(tt(c)&&"chain"in c)||!!c.chain,k=Qn(i);return Jt(g,function(T){var D=a[T];i[T]=D,k&&(i.prototype[T]=function(){var q=this.__chain__;if(v||q){var Y=i(this.__wrapped__),X=Y.__actions__=Dt(this.__actions__);return X.push({func:D,args:arguments,thisArg:i}),Y.__chain__=q,Y}return D.apply(i,Sr([this.value()],arguments))})}),i}function HF(){return gt._===this&&(gt._=_A),this}function Qc(){}function jF(i){return i=Te(i),Ve(function(a){return Fh(a,i)})}var qF=Nc(Xe),KF=Nc(th),YF=Nc(tc);function Qf(i){return Ic(i)?nc(On(i)):EN(i)}function JF(i){return function(a){return i==null?n:to(i,a)}}var XF=nf(),QF=nf(!0);function ed(){return[]}function td(){return!1}function eR(){return{}}function tR(){return""}function nR(){return!0}function rR(i,a){if(i=Te(i),i<1||i>se)return[];var c=ot,h=bt(i,ot);a=fe(a),i-=ot;for(var g=ic(h,a);++c<i;)a(c);return g}function oR(i){return ke(i)?Xe(i,On):Ht(i)?[i]:Dt(vf(Ue(i)))}function iR(i){var a=++gA;return Ue(i)+a}var sR=da(function(i,a){return i+a},0),aR=Vc("ceil"),lR=da(function(i,a){return i/a},1),cR=Vc("floor");function dR(i){return i&&i.length?ra(i,Mt,gc):n}function uR(i,a){return i&&i.length?ra(i,fe(a,2),gc):n}function pR(i){return oh(i,Mt)}function hR(i,a){return oh(i,fe(a,2))}function fR(i){return i&&i.length?ra(i,Mt,Cc):n}function mR(i,a){return i&&i.length?ra(i,fe(a,2),Cc):n}var gR=da(function(i,a){return i*a},1),yR=Vc("round"),_R=da(function(i,a){return i-a},0);function vR(i){return i&&i.length?oc(i,Mt):0}function CR(i,a){return i&&i.length?oc(i,fe(a,2)):0}return _.after=ZP,_.ary=Nf,_.assign=AD,_.assignIn=Uf,_.assignInWith=xa,_.assignWith=ND,_.at=VD,_.before=Vf,_.bind=$c,_.bindAll=MF,_.bindKey=Pf,_.castArray=eD,_.chain=Tf,_.chunk=cV,_.compact=dV,_.concat=uV,_.cond=IF,_.conforms=OF,_.constant=Yc,_.countBy=vP,_.create=PD,_.curry=Df,_.curryRight=Ff,_.debounce=Rf,_.defaults=DD,_.defaultsDeep=FD,_.defer=$P,_.delay=UP,_.difference=pV,_.differenceBy=hV,_.differenceWith=fV,_.drop=mV,_.dropRight=gV,_.dropRightWhile=yV,_.dropWhile=_V,_.fill=vV,_.filter=wP,_.flatMap=kP,_.flatMapDeep=SP,_.flatMapDepth=EP,_.flatten=xf,_.flattenDeep=CV,_.flattenDepth=wV,_.flip=WP,_.flow=GF,_.flowRight=zF,_.fromPairs=bV,_.functions=zD,_.functionsIn=ZD,_.groupBy=TP,_.initial=kV,_.intersection=SV,_.intersectionBy=EV,_.intersectionWith=TV,_.invert=UD,_.invertBy=WD,_.invokeMap=AP,_.iteratee=Jc,_.keyBy=NP,_.keys=mt,_.keysIn=Rt,_.map=ya,_.mapKeys=jD,_.mapValues=qD,_.matches=ZF,_.matchesProperty=$F,_.memoize=va,_.merge=KD,_.mergeWith=Wf,_.method=UF,_.methodOf=WF,_.mixin=Xc,_.negate=Ca,_.nthArg=jF,_.omit=YD,_.omitBy=JD,_.once=HP,_.orderBy=VP,_.over=qF,_.overArgs=jP,_.overEvery=KF,_.overSome=YF,_.partial=Uc,_.partialRight=Mf,_.partition=PP,_.pick=XD,_.pickBy=Hf,_.property=Qf,_.propertyOf=JF,_.pull=VV,_.pullAll=Sf,_.pullAllBy=PV,_.pullAllWith=DV,_.pullAt=FV,_.range=XF,_.rangeRight=QF,_.rearg=qP,_.reject=RP,_.remove=RV,_.rest=KP,_.reverse=zc,_.sampleSize=IP,_.set=eF,_.setWith=tF,_.shuffle=OP,_.slice=MV,_.sortBy=zP,_.sortedUniq=$V,_.sortedUniqBy=UV,_.split=kF,_.spread=YP,_.tail=WV,_.take=HV,_.takeRight=jV,_.takeRightWhile=qV,_.takeWhile=KV,_.tap=dP,_.throttle=JP,_.thru=ga,_.toArray=zf,_.toPairs=jf,_.toPairsIn=qf,_.toPath=oR,_.toPlainObject=$f,_.transform=nF,_.unary=XP,_.union=YV,_.unionBy=JV,_.unionWith=XV,_.uniq=QV,_.uniqBy=eP,_.uniqWith=tP,_.unset=rF,_.unzip=Zc,_.unzipWith=Ef,_.update=oF,_.updateWith=iF,_.values=zo,_.valuesIn=sF,_.without=nP,_.words=Jf,_.wrap=QP,_.xor=rP,_.xorBy=oP,_.xorWith=iP,_.zip=sP,_.zipObject=aP,_.zipObjectDeep=lP,_.zipWith=cP,_.entries=jf,_.entriesIn=qf,_.extend=Uf,_.extendWith=xa,Xc(_,_),_.add=sR,_.attempt=Xf,_.camelCase=dF,_.capitalize=Kf,_.ceil=aR,_.clamp=aF,_.clone=tD,_.cloneDeep=rD,_.cloneDeepWith=oD,_.cloneWith=nD,_.conformsTo=iD,_.deburr=Yf,_.defaultTo=LF,_.divide=lR,_.endsWith=uF,_.eq=kn,_.escape=pF,_.escapeRegExp=hF,_.every=CP,_.find=bP,_.findIndex=wf,_.findKey=RD,_.findLast=xP,_.findLastIndex=bf,_.findLastKey=MD,_.floor=cR,_.forEach=Bf,_.forEachRight=Af,_.forIn=ID,_.forInRight=OD,_.forOwn=LD,_.forOwnRight=GD,_.get=jc,_.gt=sD,_.gte=aD,_.has=$D,_.hasIn=qc,_.head=kf,_.identity=Mt,_.includes=BP,_.indexOf=xV,_.inRange=lF,_.invoke=HD,_.isArguments=oo,_.isArray=ke,_.isArrayBuffer=lD,_.isArrayLike=Ft,_.isArrayLikeObject=it,_.isBoolean=cD,_.isBuffer=Pr,_.isDate=dD,_.isElement=uD,_.isEmpty=pD,_.isEqual=hD,_.isEqualWith=fD,_.isError=Wc,_.isFinite=mD,_.isFunction=Qn,_.isInteger=If,_.isLength=wa,_.isMap=Of,_.isMatch=gD,_.isMatchWith=yD,_.isNaN=_D,_.isNative=vD,_.isNil=wD,_.isNull=CD,_.isNumber=Lf,_.isObject=tt,_.isObjectLike=nt,_.isPlainObject=Qi,_.isRegExp=Hc,_.isSafeInteger=bD,_.isSet=Gf,_.isString=ba,_.isSymbol=Ht,_.isTypedArray=Go,_.isUndefined=xD,_.isWeakMap=kD,_.isWeakSet=SD,_.join=BV,_.kebabCase=fF,_.last=nn,_.lastIndexOf=AV,_.lowerCase=mF,_.lowerFirst=gF,_.lt=ED,_.lte=TD,_.max=dR,_.maxBy=uR,_.mean=pR,_.meanBy=hR,_.min=fR,_.minBy=mR,_.stubArray=ed,_.stubFalse=td,_.stubObject=eR,_.stubString=tR,_.stubTrue=nR,_.multiply=gR,_.nth=NV,_.noConflict=HF,_.noop=Qc,_.now=_a,_.pad=yF,_.padEnd=_F,_.padStart=vF,_.parseInt=CF,_.random=cF,_.reduce=DP,_.reduceRight=FP,_.repeat=wF,_.replace=bF,_.result=QD,_.round=yR,_.runInContext=V,_.sample=MP,_.size=LP,_.snakeCase=xF,_.some=GP,_.sortedIndex=IV,_.sortedIndexBy=OV,_.sortedIndexOf=LV,_.sortedLastIndex=GV,_.sortedLastIndexBy=zV,_.sortedLastIndexOf=ZV,_.startCase=SF,_.startsWith=EF,_.subtract=_R,_.sum=vR,_.sumBy=CR,_.template=TF,_.times=rR,_.toFinite=er,_.toInteger=Te,_.toLength=Zf,_.toLower=BF,_.toNumber=rn,_.toSafeInteger=BD,_.toString=Ue,_.toUpper=AF,_.trim=NF,_.trimEnd=VF,_.trimStart=PF,_.truncate=DF,_.unescape=FF,_.uniqueId=iR,_.upperCase=RF,_.upperFirst=Kc,_.each=Bf,_.eachRight=Af,_.first=kf,Xc(_,function(){var i={};return Mn(_,function(a,c){We.call(_.prototype,c)||(i[c]=a)}),i}(),{chain:!1}),_.VERSION=o,Jt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){_[i].placeholder=_}),Jt(["drop","take"],function(i,a){Fe.prototype[i]=function(c){c=c===n?1:ut(Te(c),0);var h=this.__filtered__&&!a?new Fe(this):this.clone();return h.__filtered__?h.__takeCount__=bt(c,h.__takeCount__):h.__views__.push({size:bt(c,ot),type:i+(h.__dir__<0?"Right":"")}),h},Fe.prototype[i+"Right"]=function(c){return this.reverse()[i](c).reverse()}}),Jt(["filter","map","takeWhile"],function(i,a){var c=a+1,h=c==x||c==U;Fe.prototype[i]=function(g){var v=this.clone();return v.__iteratees__.push({iteratee:fe(g,3),type:c}),v.__filtered__=v.__filtered__||h,v}}),Jt(["head","last"],function(i,a){var c="take"+(a?"Right":"");Fe.prototype[i]=function(){return this[c](1).value()[0]}}),Jt(["initial","tail"],function(i,a){var c="drop"+(a?"":"Right");Fe.prototype[i]=function(){return this.__filtered__?new Fe(this):this[c](1)}}),Fe.prototype.compact=function(){return this.filter(Mt)},Fe.prototype.find=function(i){return this.filter(i).head()},Fe.prototype.findLast=function(i){return this.reverse().find(i)},Fe.prototype.invokeMap=Ve(function(i,a){return typeof i=="function"?new Fe(this):this.map(function(c){return ji(c,i,a)})}),Fe.prototype.reject=function(i){return this.filter(Ca(fe(i)))},Fe.prototype.slice=function(i,a){i=Te(i);var c=this;return c.__filtered__&&(i>0||a<0)?new Fe(c):(i<0?c=c.takeRight(-i):i&&(c=c.drop(i)),a!==n&&(a=Te(a),c=a<0?c.dropRight(-a):c.take(a-i)),c)},Fe.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Fe.prototype.toArray=function(){return this.take(ot)},Mn(Fe.prototype,function(i,a){var c=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),g=_[h?"take"+(a=="last"?"Right":""):a],v=h||/^find/.test(a);g&&(_.prototype[a]=function(){var k=this.__wrapped__,T=h?[1]:arguments,D=k instanceof Fe,q=T[0],Y=D||ke(k),X=function(De){var Re=g.apply(_,Sr([De],T));return h&&ne?Re[0]:Re};Y&&c&&typeof q=="function"&&q.length!=1&&(D=Y=!1);var ne=this.__chain__,ue=!!this.__actions__.length,ge=v&&!ne,Ne=D&&!ue;if(!v&&Y){k=Ne?k:new Fe(this);var ye=i.apply(k,T);return ye.__actions__.push({func:ga,args:[X],thisArg:n}),new Qt(ye,ne)}return ge&&Ne?i.apply(this,T):(ye=this.thru(X),ge?h?ye.value()[0]:ye.value():ye)})}),Jt(["pop","push","shift","sort","splice","unshift"],function(i){var a=Zs[i],c=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",h=/^(?:pop|shift)$/.test(i);_.prototype[i]=function(){var g=arguments;if(h&&!this.__chain__){var v=this.value();return a.apply(ke(v)?v:[],g)}return this[c](function(k){return a.apply(ke(k)?k:[],g)})}}),Mn(Fe.prototype,function(i,a){var c=_[a];if(c){var h=c.name+"";We.call(Ro,h)||(Ro[h]=[]),Ro[h].push({name:a,func:c})}}),Ro[ca(n,C).name]=[{name:"wrapper",func:n}],Fe.prototype.clone=FA,Fe.prototype.reverse=RA,Fe.prototype.value=MA,_.prototype.at=uP,_.prototype.chain=pP,_.prototype.commit=hP,_.prototype.next=fP,_.prototype.plant=gP,_.prototype.reverse=yP,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=_P,_.prototype.first=_.prototype.head,Gi&&(_.prototype[Gi]=mP),_},Po=hA();Yr?((Yr.exports=Po)._=Po,Jl._=Po):gt._=Po}).call(Zo)}(Bs,Bs.exports);var Le=Bs.exports;const eT={class:"grid-overlay-container"},lp=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",eT,[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))]))}}),tT={},nT={class:"grid-overlay-container"};function rT(t,e){return r.openBlock(),r.createElementBlock("div",nT,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const cp=Ts(tT,[["render",rT]]);async function oT(t,e){throw Error("not implemented")}function iT(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function sT(t,e){const n=[];for(const o of e)if(t[o].type==="column"){const s=iT(t[o].spec);for(const l of s){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const d=Za(l),u=t.findIndex(p=>Le.isEqual(p.id,d));if(u===-1)throw console.error("axis not found",o,d,t),Error("axis not found");n.push({columnIdx:o,axisIdx:u})}}return n}const dp=(t,e)=>(t+e).toString();function aT(t,e,n,o,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 y=0;y<l.length;++y)l[y]===d.axisIdx&&(u=y),l[y]===d.columnIdx&&(p=y);const f=(()=>{const E=o[u].data.filter(S=>S!==null);return Array.from(new Set(E))})();f.sort(),p>u?(n.splice(p,1),n.splice(u,1)):(n.splice(u,1),n.splice(p,1));const m=lT(s,o,u,p,f,e.rows);for(let y=0;y<f.length;++y){const E=f[y],S=Mr(E+"@"+y);n.push({colId:S,field:dp(o.length,y),headerName:E,valueFormatter:pp})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function lT(t,e,n,o,s,l){const d=new Map;let u=0;for(let f=0;f<l;f++){const m={};for(let O=0;O<e.length;++O){if(O===n||O===o)continue;const z=t[O].toString();m[z]=e[O].data[f]}let y;const E=Mr(Object.values(m))??"";d.has(E)?y=d.get(E):(d.set(E,m),y=m,y.id=u.toString(),u++);const S=s.indexOf(e[n].data[f]);if(S===-1)throw Error("index not found");const A=dp(e.length,S);y[A]=e[o].data[f]}return Array.from(d.values())}function cT(t){return Mr(t)}function up(t){return JSON.parse(t)}const pp=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function dT(t,e,n){var s,l,d;const o=cT(e);return{colId:o,field:t.toString(),headerName:((l=(s=e.spec.annotations)==null?void 0:s["pl7.app/label"])==null?void 0:l.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(n==null?void 0:n.includes(o))??((d=e.spec.annotations)==null?void 0:d["pl7.app/table/visibility"])==="optional",valueFormatter:pp,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 hp(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 fp(t){const e=[];return ds(t,n=>(e.push(n),n)),e}async function uT(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:Le.uniqWith(n.map(s=>Nd(s.spec.axesSpec).map(Le.cloneDeep)).flat(),Le.isEqual),strictlyCompatible:!0})).hits.filter(s=>s.spec.axesSpec.length===1):[]}async function pT(t,e,n){const o=fp(n),l=(await uT(t,e,o)).filter(d=>!Le.find(o,u=>d.columnId===u.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(d=>({type:"column",column:d}))}}async function hT(t,e,n,o){const s=n.filter(m=>m.type!=="Bytes"),l=fp(o),d=s.map(m=>[]),u=s.map(m=>null);for(let m=0;m<l.length;++m){const y=Nd(l[m].spec.axesSpec);for(let E=0;E<y.length;++E){const S=Le.findIndex(s,A=>Le.isEqual(A,y[E]));S===-1||u[S]||(y.length===1&&l[m].spec.name==="pl7.app/label"?(d[S]=[[m,E]],u[S]=l[m].columnId):d[S].push([m,E]))}}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[y,E]of d[m]){const S=await t.getUniqueValues(e,{columnId:l[y].columnId,...!u[m]&&{axis:Le.cloneDeep(s[m])},filters:[],limit:p});if(S.overflow){u.splice(m,1),d.splice(m,1),s.splice(m,1);continue e}const A=S.values.type;for(const O of S.values.data)if(!(Ad(O,A)||O===null)&&(f[m].add(hp(O,A)),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,y)=>{const E=[...f[y]].map(A=>({value:A,label:A.toString()})),S=E[0].value;return{axis:Le.cloneDeep(m),...u[y]&&{column:u[y]},options:E,defaultValue:S}})}function fT(t,e,n,o){const s=t.length,l=[];for(let d=0;d<e[0].data.length;++d){const u=[],p=(o++).toString();for(const m of n)u.push(e[m].data[d]);const f={key:u,id:p};for(let m=0;m<s;++m){const y=t[m].toString(),E=e[m].data[d],S=e[m].type;kg(e[m].absent,d)?f[y]=void 0:Ad(E,S)||E===null?f[y]=null:f[y]=hp(E,S)}l.push(f)}return l}const mT=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function gT(t,e,n,o){const s=await t.getSpec(e);let l=s.findIndex(C=>C.type==="column");l===-1&&(l=s.length);const d=[...s.keys()].filter(C=>!Le.find(n,R=>Le.isEqual(R.axis,s[C].id)||Le.isEqual(R.column,s[C].id))).sort((C,R)=>{var L,J;if(s[C].type!==s[R].type)return s[C].type==="axis"?-1:1;const G=(L=s[C].spec.annotations)==null?void 0:L["pl7.app/table/orderPriority"],$=(J=s[R].spec.annotations)==null?void 0:J["pl7.app/table/orderPriority"];return G===void 0?$===void 0?0:1:$===void 0?-1:Number($)-Number(G)}),u=Le.cloneDeep(d),p=sT(s,d);for(let C=d.length-1;C>=0;--C){const R=d[C];if(!mT(s[R]))continue;const G=Za(s[R].spec.axesSpec[0]),$=Le.findIndex(d,L=>Le.isEqual(s[L].id,G));if($===-1&&Le.findIndex(n,J=>Le.isEqual(J.axis,G))===-1){console.warn(`added label column, but the axis is not in the data; axisId: ${G}`);continue}d[$]=R;for(const L of p)L.axisIdx===R&&(L.axisIdx=$);d.splice(C,1),u.splice(C,1)}const f=await t.getShape(e),m=f.rows,y=u.map(C=>dT(C,s[C],o));if(p.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",p.length," transposition will not be applied."),p.length===1)return aT(p,f,y,await t.getData(e,d),u,d);const E=[...d],S=new Map;for(let C=0;C<l;++C)S.set(C,-1);for(let C=0;C<E.length;++C){const R=E[C];S.has(R)&&S.set(R,C)}for(const[C,R]of S)R===-1&&(S.set(C,E.length),E.push(C));const A=[];for(let C=0;C<l;++C){const R=S.get(C);if(R===void 0||R===-1)throw new Error("assertion exception");A.push(R)}let O;return{rowModelType:"serverSide",columnDefs:y,serverSideDatasource:{getRows:async C=>{try{if(m==0){C.success({rowData:[],rowCount:m}),C.api.setGridOption("loading",!1),C.api.showNoRowsOverlay();return}if(O&&!Le.isEqual(O.request.sortModel,C.request.sortModel)){O=void 0,C.api.setGridOption("loading",!0),C.success({rowData:[],rowCount:0});return}O=C;let R=0,G=[];if(m>0&&C.request.startRow!==void 0&&C.request.endRow!==void 0&&(R=Math.min(m,C.request.endRow)-C.request.startRow,R>0)){const $=await t.getData(e,E,{offset:C.request.startRow,length:R});G=fT(u,$,A,C.request.startRow)}C.success({rowData:G,rowCount:m}),C.api.autoSizeAllColumns(),C.api.setGridOption("loading",!1)}catch(R){C.api.setGridOption("loading",!0),C.fail(),console.trace(R)}}}}}const yT={class:"ap-ag-data-table-container"},_T={key:0,class:"ap-ag-data-table-sheets"},vT=Ts(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:r.mergeModels(["onRowDoubleClicked","columnsChanged"],["update:modelValue"]),setup(t,{expose:e,emit:n}){b.ModuleRegistry.registerModules([ts.ClientSideRowModelModule,ld.ClipboardModule,ad.ServerSideRowModelModule,cd.RangeSelectionModule,Ha,Xd]);const o=r.useModel(t,"modelValue"),s=t,{settings:l}=r.toRefs(s),d=n;r.watch(()=>l.value,async(B,x)=>{if(B.sourceType!=="pframe"||!B.pFrame||!B.join||x&&x.sourceType==="pframe"&&Le.isEqual(B.pFrame,x.pFrame)&&Le.isEqual(B.join,x.join))return;const P=window.platforma;if(!P)throw Error("platforma not set");const U=P.pFrameDriver;if(!U)throw Error("platforma.pFrameDriver not set");const re=await pT(U,B.pFrame,B.join),se=o.value;se.pTableParams||(se.pTableParams={sorting:[],filters:[]}),se.pTableParams.join=re,o.value=se});const u=mp(()=>l.value.sourceType,async B=>{var P;const x=l.value.sourceType;switch(x){case"pframe":{const U=window.platforma;if(!U)throw Error("platforma not set");const re=U.pFrameDriver;if(!re)throw Error("platforma.pFrameDriver not set");if(!l.value.pFrame)return[];const se=l.value.pFrame,Pe=(P=o.value.pTableParams)==null?void 0:P.join;return Pe?await hT(re,se,l.value.sheetAxes,Pe):[]}case"ptable":return l.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${x}`)}});function p(B){if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return(B==null?void 0:B.sortModel.map(x=>{const{spec:P,...U}=up(x.colId);return{column:U,ascending:x.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const f=r.computed({get:()=>{const B=o.value;return{columnOrder:B.gridState.columnOrder,sort:B.gridState.sort,columnVisibility:B.gridState.columnVisibility}},set:B=>{const x=o.value,P=A.value.rowModelType==="clientSide"?void 0:p(B.sort);x.gridState={...x.gridState,...B},(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(x.pTableParams||(x.pTableParams={sorting:[],filters:[]}),x.pTableParams.sorting=P),o.value=x}}),m=B=>Mr(B);function y(B){var x;if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return((x=u.value)==null?void 0:x.map(P=>({type:"bySingleColumn",column:P.column?{type:"column",id:P.column}:{type:"axis",id:P.axis},predicate:{operator:"Equal",reference:B[m(P.axis)]}})))??[]}const E=r.computed({get:()=>o.value.gridState.sheets??{},set:B=>{const x=y(B),P=o.value;P.gridState.sheets=B,(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(P.pTableParams||(P.pTableParams={sorting:[],filters:[]}),P.pTableParams.filters=x),o.value=P}});r.watch(()=>[l.value,u.value],(B,x)=>{const[P,U]=B;if(!U)return;if(x){const[se,Pe]=x;if((P.sourceType==="ptable"||P.sourceType==="pframe")&&P.sourceType===(se==null?void 0:se.sourceType)&&Le.isEqual(U,Pe))return}if(P.sourceType!=="ptable"&&P.sourceType!=="pframe"){E.value={};return}const re=E.value;for(const se of U){const Pe=m(se.axis);re[Pe]||(re[Pe]=se.defaultValue??se.options[0].value)}E.value=re},{immediate:!0});const S=r.shallowRef(),A=r.shallowRef({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:f.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:B=>{B.api.autoSizeAllColumns()},onRowDoubleClicked:B=>{B.data&&d("onRowDoubleClicked",B.data.key)},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:B=>B.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:lp,noRowsOverlayComponent:cp,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"},defaultCsvExportParams:{allColumns:!0,suppressQuotes:!0,fileName:"table.csv"}}),O=B=>{const x=B.api;S.value=new Proxy(x,{get(P,U,re){switch(U){case"setGridOption":return(se,Pe)=>{const He=A.value;He[se]=Pe,A.value=He,x.setGridOption(se,Pe)};case"updateGridOptions":return se=>{A.value={...A.value,...se},x.updateGridOptions(se)};default:return Reflect.get(P,U,re)}}})},z=B=>({columnOrder:B.columnOrder,sort:B.sort,columnVisibility:B.columnVisibility??(B.columnOrder?{hiddenColIds:[]}:void 0)}),C=B=>{A.value.initialState=f.value=z(B.state),B.api.autoSizeAllColumns()},R=()=>{A.value.initialState=f.value=z(S.value.getState()),S.value=void 0};let G=!1;const $=()=>{if(!G)return;const B=S.value;B!==void 0&&(B.exportDataAsCsv(),G=!1,B.setGridOption("cacheBlockSize",100))},L=()=>{if(!G)return;const B=S.value;if(B===void 0)return;const x=B.getServerSideGroupLevelState()[0];x.cacheBlockSize===x.rowCount&&B.refreshServerSide({route:x.route,purge:!1})};e({exportCsv:async()=>{const B=S.value;if(B!==void 0){if(A.value.rowModelType==="clientSide"){B.exportDataAsCsv();return}if(A.value.rowModelType==="serverSide"){const x=B.getServerSideGroupLevelState()[0];if(x.rowCount<=x.cacheBlockSize){B.exportDataAsCsv();return}G||(G=!0,B.setGridOption("cacheBlockSize",x.rowCount))}}}});const H=r.ref(0);r.watch(()=>[S.value,f.value],(B,x)=>{if(Le.isEqual(B,x))return;const[P,U]=B;if(!P)return;const re=z(P.getState());Le.isEqual(U,re)||(A.value.initialState=U,++H.value)}),r.watch(()=>A.value,(B,x)=>{var P;if(x&&(B.rowModelType!=x.rowModelType&&++H.value,!Le.isEqual(B.columnDefs,x.columnDefs)&&B.columnDefs)){const U=Pe=>!("children"in Pe),re=(P=B.columnDefs)==null?void 0:P.filter(U),se=re==null?void 0:re.map(Pe=>Pe.colId).filter(Pe=>Pe!==void 0).map(Pe=>up(Pe));d("columnsChanged",se??[])}});const F=(B,x)=>{var U;const P=E.value;P[B]!==x&&(P[B]=x,E.value=P,(U=S.value)==null||U.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))},N=window.platforma;if(!N)throw Error("platforma not set");const M=N.pFrameDriver;if(!M)throw Error("platforma.pFrameDriver not set");const j=N.blobDriver;if(!j)throw Error("platforma.blobDriver not set");let K;return r.watch(()=>[S.value,l.value,u.value],async B=>{var se,Pe;const[x,P,U]=B;if(!x||Le.isEqual(P,K))return;K=P;const re=P.sourceType;switch(re){case"pframe":case"ptable":{const He=P.pTable;if(!He||!U)return x.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ot=(Pe=(se=f.value)==null?void 0:se.columnVisibility)==null?void 0:Pe.hiddenColIds,vn=await gT(M,He,U,ot);return x.updateGridOptions({loading:vn.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...vn})}case"xsv":{const He=P.xsvFile;if(!(He!=null&&He.ok)||!He.value)return x.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ot=await oT(j,He.value);return x.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...ot})}default:throw Error(`unsupported source type: ${re}`)}}),(B,x)=>(r.openBlock(),r.createElementBlock("div",yT,[r.unref(u).value&&r.unref(u).value.length>0?(r.openBlock(),r.createElementBlock("div",_T,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(u).value,(P,U)=>(r.openBlock(),r.createBlock(r.unref(Mu),{key:U,"model-value":E.value[m(P.axis)],options:P.options,"onUpdate:modelValue":re=>F(m(P.axis),re)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.unref(cm.AgGridVue),{key:H.value,theme:r.unref(eu),class:"ap-ag-data-table-grid","grid-options":A.value,onGridReady:O,onStateUpdated:C,onGridPreDestroyed:R,onStoreRefreshed:$,onModelUpdated:L},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-5dad3559"]]),CT={key:0,class:"d-flex gap-10 flex-column"},wT={key:0},bT=Ts(r.defineComponent({__name:"PlTableFilters",props:r.mergeModels({columns:{},restrictions:{},defaults:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{columns:o,restrictions:s,defaults:l}=r.toRefs(n),d=N=>Mr(N.id),u=r.computed(()=>o.value.filter(N=>{const M=N.type;switch(M){case"axis":return N.spec.type!=="Bytes";case"column":return N.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${M}`)}}).map(N=>({column:N,id:d(N)}))),p=r.computed(()=>{const N=s.value??[],M={};for(const{column:j,id:K}of u.value){const B=Le.find(N,x=>Le.isEqual(x.column.id,j.id));B!==void 0&&(M[K]=B.allowedFilterTypes)}return M}),f=r.computed(()=>{const N=l.value??[],M={};for(const{column:j,id:K}of u.value){const B=Le.find(N,x=>Le.isEqual(x.column.id,j.id));B!==void 0&&(M[K]=B.default)}return M}),m=N=>N!==void 0?N:f.value,y=r.reactive({state:m(e.value.state)});r.watch(()=>e.value,N=>{Le.isEqual(y.state,N.state)||(y.state=m(N.state))}),r.watch(()=>u.value,N=>{if(y.state!==void 0&&N.length===0)return;const M=y.state??{},j={};for(const{id:K}of N)M[K]!==void 0&&(j[K]=M[K]);y.state=j},{immediate:!0});const E=N=>{switch(N){case"isNotNA":return"Is not NA";case"isNA":return"Is NA";case"number_equals":case"string_equals":return"Equals";case"number_notEquals":case"string_notEquals":return"Not equals";case"number_greaterThan":return"Greater than";case"number_greaterThanOrEqualTo":return"Greater than or equal to";case"number_lessThan":return"Less than";case"number_lessThanOrEqualTo":return"Less than or equal to";case"number_between":return"Between";case"string_contains":return"Contains";case"string_doesNotContain":return"Does not contain";case"string_matches":return"Matches";case"string_doesNotMatch":return"Does not match";case"string_containsFuzzyMatch":return"Contains fuzzy match";default:throw Error(`unsupported filter type: ${N}`)}},S=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],A=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"],O=r.computed(()=>{const N=p.value,M={};for(const{column:j,id:K}of u.value){let x=(j.type==="column"?j.spec.valueType:j.spec.type)==="String"?A:S;const P=N[K];P!==void 0&&(x=x.filter(U=>P.includes(U))),M[K]=x.map(U=>({value:U,text:E(U)}))}return M}),z=r.computed(()=>Le.some(Object.values(O.value),N=>N.length>0)),C=N=>{const M=N.type;switch(M){case"isNotNA":case"isNA":return;case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return N.reference;case"number_between":return N.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return N.reference;default:throw Error(`unsupported filter type: ${M}`)}},R=(N,M)=>{switch(N){case"isNotNA":case"isNA":return{type:N};case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return{type:N,reference:typeof M=="number"?M:0};case"number_between":return{type:N,lowerBound:typeof M=="number"?M:0,includeLowerBound:!0,upperBound:100,includeUpperBound:!1};case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":return{type:N,reference:typeof M=="string"?M:""};case"string_containsFuzzyMatch":return{type:N,reference:typeof M=="string"?M:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${N}`)}},G=(N,M)=>{const j=y.state[N];y.state[N]=R(M,C(j))},$=(N,M)=>{M?y.state[N]=f.value[N]??R(O.value[N][0].value):delete y.state[N]},L=N=>{const M=Le.uniq(N);return M.sort(),M.map(j=>({value:j,text:j}))},J=N=>{const M=Number(N);if(!Number.isFinite(M))throw Error("Model value is not a number.");return M},H=N=>{const M=N.type;switch(M){case"isNotNA":return{operator:"Not",operand:{operator:"IsNA"}};case"isNA":return{operator:"IsNA"};case"number_equals":case"string_equals":return{operator:"Equal",reference:N.reference};case"number_notEquals":case"string_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:N.reference}};case"number_greaterThan":return{operator:"Greater",reference:N.reference};case"number_greaterThanOrEqualTo":return{operator:"GreaterOrEqual",reference:N.reference};case"number_lessThan":return{operator:"Less",reference:N.reference};case"number_lessThanOrEqualTo":return{operator:"LessOrEqual",reference:N.reference};case"number_between":return{operator:"And",operands:[{operator:N.includeLowerBound?"GreaterOrEqual":"Greater",reference:N.lowerBound},{operator:N.includeUpperBound?"LessOrEqual":"Less",reference:N.upperBound}]};case"string_contains":return{operator:"StringContains",substring:N.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:"StringContains",substring:N.reference}};case"string_matches":return{operator:"Matches",regex:N.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:N.reference}};case"string_containsFuzzyMatch":return{operator:"StringContainsFuzzy",reference:N.reference,maxEdits:N.maxEdits,substitutionsOnly:N.substitutionsOnly,wildcard:N.wildcard};default:throw Error(`unsupported filter type: ${M}`)}},F=N=>u.value.map(({column:M,id:j})=>{if(!(j in N))return;const K=H(N[j]),{spec:B,...x}=M;return{type:"bySingleColumn",column:x,predicate:K}}).filter(M=>M!==void 0);return r.watch(()=>y,N=>{Le.isEqual(N.state,e.value.state)||(e.value={state:Le.cloneDeep(N.state),filters:F(N.state)})},{immediate:!0,deep:!0}),(N,M)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,({column:j,id:K},B)=>{var x,P,U,re,se,Pe,He,ot,vn,Rn,br,Wn,Kr,Ps;return r.openBlock(),r.createElementBlock("div",{key:K},[O.value[K].length>0?(r.openBlock(),r.createElementBlock("form",CT,[r.createVNode(r.unref(Iu),{"model-value":!!y.state[K],"onUpdate:modelValue":ze=>$(K,ze)},{default:r.withCtx(()=>{var ze,xr;return[r.createTextVNode(r.toDisplayString(((xr=(ze=j.spec.annotations)==null?void 0:ze["pl7.app/label"])==null?void 0:xr.trim())??"Unlabeled "+j.type+" "+B.toString()),1)]}),_:2},1032,["model-value","onUpdate:modelValue"]),r.createElementVNode("div",{class:r.normalizeClass(["controls d-flex gap-10 flex-column",{open:!!y.state[K]}])},[y.state[K]?(r.openBlock(),r.createBlock(r.unref(hi),{key:0,"model-value":y.state[K].type,options:O.value[K],label:"Predicate","onUpdate:modelValue":ze=>G(K,ze)},null,8,["model-value","options","onUpdate:modelValue"])):r.createCommentVNode("",!0),((x=y.state[K])==null?void 0:x.type)==="number_equals"||((P=y.state[K])==null?void 0:P.type)==="number_notEquals"||((U=y.state[K])==null?void 0:U.type)==="number_lessThan"||((re=y.state[K])==null?void 0:re.type)==="number_lessThanOrEqualTo"||((se=y.state[K])==null?void 0:se.type)==="number_greaterThan"||((Pe=y.state[K])==null?void 0:Pe.type)==="number_greaterThanOrEqualTo"?(r.openBlock(),r.createBlock(r.unref(zr),{key:1,modelValue:y.state[K].reference,"onUpdate:modelValue":ze=>y.state[K].reference=ze,parse:J,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"])):r.createCommentVNode("",!0),((He=y.state[K])==null?void 0:He.type)==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createVNode(r.unref(zr),{modelValue:y.state[K].lowerBound,"onUpdate:modelValue":ze=>y.state[K].lowerBound=ze,parse:J,label:"Lower bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(ys),{modelValue:y.state[K].includeLowerBound,"onUpdate:modelValue":ze=>y.state[K].includeLowerBound=ze,label:"Include lower bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(zr),{modelValue:y.state[K].upperBound,"onUpdate:modelValue":ze=>y.state[K].upperBound=ze,parse:J,label:"Upper bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(ys),{modelValue:y.state[K].includeUpperBound,"onUpdate:modelValue":ze=>y.state[K].includeUpperBound=ze,label:"Include upper bound"},null,8,["modelValue","onUpdate:modelValue"])],64)):r.createCommentVNode("",!0),((ot=y.state[K])==null?void 0:ot.type)==="string_equals"||((vn=y.state[K])==null?void 0:vn.type)==="string_notEquals"||((Rn=y.state[K])==null?void 0:Rn.type)==="string_contains"||((br=y.state[K])==null?void 0:br.type)==="string_doesNotContain"||((Wn=y.state[K])==null?void 0:Wn.type)==="string_matches"||((Kr=y.state[K])==null?void 0:Kr.type)==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(zr),{key:3,modelValue:y.state[K].reference,"onUpdate:modelValue":ze=>y.state[K].reference=ze,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"])):r.createCommentVNode("",!0),((Ps=y.state[K])==null?void 0:Ps.type)==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:4},[r.createVNode(r.unref(zr),{modelValue:y.state[K].reference,"onUpdate:modelValue":ze=>y.state[K].reference=ze,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(ip),{modelValue:y.state[K].maxEdits,"onUpdate:modelValue":ze=>y.state[K].maxEdits=ze,max:5,breakpoints:"",label:"Maximum nuber of substitutions and indels"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(ys),{modelValue:y.state[K].substitutionsOnly,"onUpdate:modelValue":ze=>y.state[K].substitutionsOnly=ze,label:"Substitutions only"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(hi),{modelValue:y.state[K].wildcard,"onUpdate:modelValue":ze=>y.state[K].wildcard=ze,options:L(y.state[K].reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","onUpdate:modelValue","options"])],64)):r.createCommentVNode("",!0)],2)])):r.createCommentVNode("",!0)])}),128)),z.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",wT,"No filters applicable"))],64))}}),[["__scopeId","data-v-b30bf5ef"]]),xT={key:1,class:"alert-error"},kT={key:2},ST=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),o=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),s=r.computed(()=>n.value===void 0&&o.value===void 0);return(l,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),o.value?(r.openBlock(),r.createElementBlock("div",xT,r.toDisplayString(o.value),1)):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createElementBlock("div",kT,"Unresolved")):r.createCommentVNode("",!0)]))}}),ET={style:{height:"100%"}},TT=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),o=r.computed(()=>e.params.value);function s(d){e.params.setValue(d)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(o.value):void 0);return(d,u)=>(r.openBlock(),r.createElementBlock("div",ET,[r.createVNode(r.unref(rp),{"show-filename-only":"",clearable:"","cell-style":"","file-dialog-title":"Select any file",placeholder:`Choose file ${n.value?n.value[0]:""}`,extensions:n.value,"model-value":o.value,progress:l.value,"onUpdate:modelValue":s},null,8,["placeholder","extensions","model-value","progress"])]))}}),BT={class:"pl-ag-grid-open-cell d-flex"},AT={class:"pl-ag-grid-open-cell__value"},NT=r.defineComponent({__name:"PlAgTextAndButtonCell",props:{params:{}},setup(t){const e=t;console.log(e);function n(){if(e.params.invokeRowsOnDoubleClick){const o=e.params.api,s={rowPinned:e.params.node.rowPinned,api:o,rowIndex:e.params.node.rowIndex,context:o,type:"rowDoubleClicked",node:e.params.node,data:e.params.data,event:null};o.dispatchEvent(s)}else e.params.onClick&&e.params.onClick(e.params)}return(o,s)=>(r.openBlock(),r.createElementBlock("div",BT,[r.createElementVNode("div",AT,r.toDisplayString(o.params.value),1),r.createElementVNode("div",{class:"pl-ag-grid-open-cell__activator text-caps11 align-center",onClick:r.withModifiers(n,["stop"])},[r.createVNode(r.unref(ur),{name:o.params.icon??"maximize"},null,8,["name"]),r.createTextVNode(" "+r.toDisplayString(o.params.btnLabel??"Open"),1)])]))}}),As=new Map;function VT(t,e){const n=r.getCurrentScope()??r.effectScope(),o=n.run(()=>(r.onScopeDispose(()=>{As.delete(t)}),r.reactive(e())));return o[Symbol.dispose]=()=>{n.stop()},o}function PT(t){const e=Symbol();return()=>(As.has(e)||As.set(e,VT(e,t)),As.get(e))}function DT(t){return r.computed(()=>{try{return md(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function mp(t,e,n){const o=r.ref(0),s=r.reactive({loading:r.computed(()=>o.value>0),loadingRef:o,value:void 0,error:void 0}),l=pm(e);return r.watch(t,async d=>{s.error=void 0,o.value++,l(d).then(u=>{u.ok&&(s.value=u.value)}).catch(u=>{s.value=void 0,s.error=u}).finally(()=>{o.value--})},Object.assign({immediate:!0,deep:!0},n??{})),s}const bo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,gp=new Set,Nl=typeof process=="object"&&process?process:{},yp=(t,e,n,o)=>{typeof Nl.emitWarning=="function"?Nl.emitWarning(t,e,n,o):console.error(`[${n}] ${e}: ${t}`)};let Ns=globalThis.AbortController,_p=globalThis.AbortSignal;if(typeof Ns>"u"){_p=class{constructor(){$e(this,"onabort");$e(this,"_onabort",[]);$e(this,"reason");$e(this,"aborted",!1)}addEventListener(o,s){this._onabort.push(s)}},Ns=class{constructor(){$e(this,"signal",new _p);e()}abort(o){var s,l;if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(const d of this.signal._onabort)d(o);(l=(s=this.signal).onabort)==null||l.call(s,o)}}};let t=((Cp=Nl.env)==null?void 0:Cp.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,yp("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 FT=t=>!gp.has(t),Cr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),vp=t=>Cr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Vs:null:null;class Vs extends Array{constructor(e){super(e),this.fill(0)}}const Wr=class Wr{constructor(e,n){$e(this,"heap");$e(this,"length");if(!w(Wr,xo))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=vp(e);if(!n)return[];me(Wr,xo,!0);const o=new Wr(e,n);return me(Wr,xo,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};xo=new WeakMap,Ge(Wr,xo,!1);let Vl=Wr;const Fl=class Fl{constructor(e){Ge(this,te);Ge(this,un);Ge(this,Lt);Ge(this,pn);Ge(this,hn);Ge(this,ko);Ge(this,So);$e(this,"ttl");$e(this,"ttlResolution");$e(this,"ttlAutopurge");$e(this,"updateAgeOnGet");$e(this,"updateAgeOnHas");$e(this,"allowStale");$e(this,"noDisposeOnSet");$e(this,"noUpdateTTL");$e(this,"maxEntrySize");$e(this,"sizeCalculation");$e(this,"noDeleteOnFetchRejection");$e(this,"noDeleteOnStaleGet");$e(this,"allowStaleOnFetchAbort");$e(this,"allowStaleOnFetchRejection");$e(this,"ignoreFetchAbort");Ge(this,ct);Ge(this,fn);Ge(this,at);Ge(this,Ke);Ge(this,be);Ge(this,Tt);Ge(this,Gt);Ge(this,wt);Ge(this,ht);Ge(this,mn);Ge(this,ft);Ge(this,gn);Ge(this,yn);Ge(this,zt);Ge(this,_n);Ge(this,wr);Ge(this,Bt);Ge(this,Hr,()=>{});Ge(this,Un,()=>{});Ge(this,Pi,()=>{});Ge(this,Zt,()=>!1);Ge(this,jr,e=>{});Ge(this,Eo,(e,n,o)=>{});Ge(this,Di,(e,n,o,s)=>{if(o||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});$e(this,wp,"LRUCache");const{max:n=0,ttl:o,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:d,updateAgeOnHas:u,allowStale:p,dispose:f,disposeAfter:m,noDisposeOnSet:y,noUpdateTTL:E,maxSize:S=0,maxEntrySize:A=0,sizeCalculation:O,fetchMethod:z,memoMethod:C,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:G,allowStaleOnFetchRejection:$,allowStaleOnFetchAbort:L,ignoreFetchAbort:J}=e;if(n!==0&&!Cr(n))throw new TypeError("max option must be a nonnegative integer");const H=n?vp(n):Array;if(!H)throw new Error("invalid max value: "+n);if(me(this,un,n),me(this,Lt,S),this.maxEntrySize=A||w(this,Lt),this.sizeCalculation=O,this.sizeCalculation){if(!w(this,Lt)&&!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(me(this,So,C),z!==void 0&&typeof z!="function")throw new TypeError("fetchMethod must be a function if specified");if(me(this,ko,z),me(this,wr,!!z),me(this,at,new Map),me(this,Ke,new Array(n).fill(void 0)),me(this,be,new Array(n).fill(void 0)),me(this,Tt,new H(n)),me(this,Gt,new H(n)),me(this,wt,0),me(this,ht,0),me(this,mn,Vl.create(n)),me(this,ct,0),me(this,fn,0),typeof f=="function"&&me(this,pn,f),typeof m=="function"?(me(this,hn,m),me(this,ft,[])):(me(this,hn,void 0),me(this,ft,void 0)),me(this,_n,!!w(this,pn)),me(this,Bt,!!w(this,hn)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!E,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!$,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!J,this.maxEntrySize!==0){if(w(this,Lt)!==0&&!Cr(w(this,Lt)))throw new TypeError("maxSize must be a positive integer if specified");if(!Cr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");de(this,te,rm).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!G,this.updateAgeOnGet=!!d,this.updateAgeOnHas=!!u,this.ttlResolution=Cr(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=o||0,this.ttl){if(!Cr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");de(this,te,rd).call(this)}if(w(this,un)===0&&this.ttl===0&&w(this,Lt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!w(this,un)&&!w(this,Lt)){const F="LRU_CACHE_UNBOUNDED";FT(F)&&(gp.add(F),yp("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",F,Fl))}}static unsafeExposeInternals(e){return{starts:w(e,yn),ttls:w(e,zt),sizes:w(e,gn),keyMap:w(e,at),keyList:w(e,Ke),valList:w(e,be),next:w(e,Tt),prev:w(e,Gt),get head(){return w(e,wt)},get tail(){return w(e,ht)},free:w(e,mn),isBackgroundFetch:n=>{var o;return de(o=e,te,Je).call(o,n)},backgroundFetch:(n,o,s,l)=>{var d;return de(d=e,te,Ea).call(d,n,o,s,l)},moveToTail:n=>{var o;return de(o=e,te,es).call(o,n)},indexes:n=>{var o;return de(o=e,te,Dr).call(o,n)},rindexes:n=>{var o;return de(o=e,te,Fr).call(o,n)},isStale:n=>{var o;return w(o=e,Zt).call(o,n)}}}get max(){return w(this,un)}get maxSize(){return w(this,Lt)}get calculatedSize(){return w(this,fn)}get size(){return w(this,ct)}get fetchMethod(){return w(this,ko)}get memoMethod(){return w(this,So)}get dispose(){return w(this,pn)}get disposeAfter(){return w(this,hn)}getRemainingTTL(e){return w(this,at).has(e)?1/0:0}*entries(){for(const e of de(this,te,Dr).call(this))w(this,be)[e]!==void 0&&w(this,Ke)[e]!==void 0&&!de(this,te,Je).call(this,w(this,be)[e])&&(yield[w(this,Ke)[e],w(this,be)[e]])}*rentries(){for(const e of de(this,te,Fr).call(this))w(this,be)[e]!==void 0&&w(this,Ke)[e]!==void 0&&!de(this,te,Je).call(this,w(this,be)[e])&&(yield[w(this,Ke)[e],w(this,be)[e]])}*keys(){for(const e of de(this,te,Dr).call(this)){const n=w(this,Ke)[e];n!==void 0&&!de(this,te,Je).call(this,w(this,be)[e])&&(yield n)}}*rkeys(){for(const e of de(this,te,Fr).call(this)){const n=w(this,Ke)[e];n!==void 0&&!de(this,te,Je).call(this,w(this,be)[e])&&(yield n)}}*values(){for(const e of de(this,te,Dr).call(this))w(this,be)[e]!==void 0&&!de(this,te,Je).call(this,w(this,be)[e])&&(yield w(this,be)[e])}*rvalues(){for(const e of de(this,te,Fr).call(this))w(this,be)[e]!==void 0&&!de(this,te,Je).call(this,w(this,be)[e])&&(yield w(this,be)[e])}[(bp=Symbol.iterator,wp=Symbol.toStringTag,bp)](){return this.entries()}find(e,n={}){for(const o of de(this,te,Dr).call(this)){const s=w(this,be)[o],l=de(this,te,Je).call(this,s)?s.__staleWhileFetching:s;if(l!==void 0&&e(l,w(this,Ke)[o],this))return this.get(w(this,Ke)[o],n)}}forEach(e,n=this){for(const o of de(this,te,Dr).call(this)){const s=w(this,be)[o],l=de(this,te,Je).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,Ke)[o],this)}}rforEach(e,n=this){for(const o of de(this,te,Fr).call(this)){const s=w(this,be)[o],l=de(this,te,Je).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,Ke)[o],this)}}purgeStale(){let e=!1;for(const n of de(this,te,Fr).call(this,{allowStale:!0}))w(this,Zt).call(this,n)&&(de(this,te,Rr).call(this,w(this,Ke)[n],"expire"),e=!0);return e}info(e){const n=w(this,at).get(e);if(n===void 0)return;const o=w(this,be)[n],s=de(this,te,Je).call(this,o)?o.__staleWhileFetching:o;if(s===void 0)return;const l={value:s};if(w(this,zt)&&w(this,yn)){const d=w(this,zt)[n],u=w(this,yn)[n];if(d&&u){const p=d-(bo.now()-u);l.ttl=p,l.start=Date.now()}}return w(this,gn)&&(l.size=w(this,gn)[n]),l}dump(){const e=[];for(const n of de(this,te,Dr).call(this,{allowStale:!0})){const o=w(this,Ke)[n],s=w(this,be)[n],l=de(this,te,Je).call(this,s)?s.__staleWhileFetching:s;if(l===void 0||o===void 0)continue;const d={value:l};if(w(this,zt)&&w(this,yn)){d.ttl=w(this,zt)[n];const u=bo.now()-w(this,yn)[n];d.start=Math.floor(Date.now()-u)}w(this,gn)&&(d.size=w(this,gn)[n]),e.unshift([o,d])}return e}load(e){this.clear();for(const[n,o]of e){if(o.start){const s=Date.now()-o.start;o.start=bo.now()-s}this.set(n,o.value,o)}}set(e,n,o={}){var E,S,A,O,z;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}=o;let{noUpdateTTL:f=this.noUpdateTTL}=o;const m=w(this,Di).call(this,e,n,o.size||0,u);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),de(this,te,Rr).call(this,e,"set"),this;let y=w(this,ct)===0?void 0:w(this,at).get(e);if(y===void 0)y=w(this,ct)===0?w(this,ht):w(this,mn).length!==0?w(this,mn).pop():w(this,ct)===w(this,un)?de(this,te,Sa).call(this,!1):w(this,ct),w(this,Ke)[y]=e,w(this,be)[y]=n,w(this,at).set(e,y),w(this,Tt)[w(this,ht)]=y,w(this,Gt)[y]=w(this,ht),me(this,ht,y),ka(this,ct)._++,w(this,Eo).call(this,y,m,p),p&&(p.set="add"),f=!1;else{de(this,te,es).call(this,y);const C=w(this,be)[y];if(n!==C){if(w(this,wr)&&de(this,te,Je).call(this,C)){C.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:R}=C;R!==void 0&&!d&&(w(this,_n)&&((E=w(this,pn))==null||E.call(this,R,e,"set")),w(this,Bt)&&((S=w(this,ft))==null||S.push([R,e,"set"])))}else d||(w(this,_n)&&((A=w(this,pn))==null||A.call(this,C,e,"set")),w(this,Bt)&&((O=w(this,ft))==null||O.push([C,e,"set"])));if(w(this,jr).call(this,y),w(this,Eo).call(this,y,m,p),w(this,be)[y]=n,p){p.set="replace";const R=C&&de(this,te,Je).call(this,C)?C.__staleWhileFetching:C;R!==void 0&&(p.oldValue=R)}}else p&&(p.set="update")}if(s!==0&&!w(this,zt)&&de(this,te,rd).call(this),w(this,zt)&&(f||w(this,Pi).call(this,y,s,l),p&&w(this,Un).call(this,p,y)),!d&&w(this,Bt)&&w(this,ft)){const C=w(this,ft);let R;for(;R=C==null?void 0:C.shift();)(z=w(this,hn))==null||z.call(this,...R)}return this}pop(){var e;try{for(;w(this,ct);){const n=w(this,be)[w(this,wt)];if(de(this,te,Sa).call(this,!0),de(this,te,Je).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(w(this,Bt)&&w(this,ft)){const n=w(this,ft);let o;for(;o=n==null?void 0:n.shift();)(e=w(this,hn))==null||e.call(this,...o)}}}has(e,n={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:s}=n,l=w(this,at).get(e);if(l!==void 0){const d=w(this,be)[l];if(de(this,te,Je).call(this,d)&&d.__staleWhileFetching===void 0)return!1;if(w(this,Zt).call(this,l))s&&(s.has="stale",w(this,Un).call(this,s,l));else return o&&w(this,Hr).call(this,l),s&&(s.has="hit",w(this,Un).call(this,s,l)),!0}else s&&(s.has="miss");return!1}peek(e,n={}){const{allowStale:o=this.allowStale}=n,s=w(this,at).get(e);if(s===void 0||!o&&w(this,Zt).call(this,s))return;const l=w(this,be)[s];return de(this,te,Je).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:o=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:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:E=this.allowStaleOnFetchRejection,ignoreFetchAbort:S=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:O,forceRefresh:z=!1,status:C,signal:R}=n;if(!w(this,wr))return C&&(C.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:C});const G={allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:d,noDisposeOnSet:u,size:p,sizeCalculation:f,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:A,ignoreFetchAbort:S,status:C,signal:R};let $=w(this,at).get(e);if($===void 0){C&&(C.fetch="miss");const L=de(this,te,Ea).call(this,e,$,G,O);return L.__returned=L}else{const L=w(this,be)[$];if(de(this,te,Je).call(this,L)){const M=o&&L.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",M&&(C.returnedStale=!0)),M?L.__staleWhileFetching:L.__returned=L}const J=w(this,Zt).call(this,$);if(!z&&!J)return C&&(C.fetch="hit"),de(this,te,es).call(this,$),s&&w(this,Hr).call(this,$),C&&w(this,Un).call(this,C,$),L;const H=de(this,te,Ea).call(this,e,$,G,O),N=H.__staleWhileFetching!==void 0&&o;return C&&(C.fetch=J?"stale":"refresh",N&&J&&(C.returnedStale=!0)),N?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,n={}){const o=await this.fetch(e,n);if(o===void 0)throw new Error("fetch() returned undefined");return o}memo(e,n={}){const o=w(this,So);if(!o)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=o(e,u,{options:d,context:s});return this.set(e,p,d),p}get(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:d}=n,u=w(this,at).get(e);if(u!==void 0){const p=w(this,be)[u],f=de(this,te,Je).call(this,p);return d&&w(this,Un).call(this,d,u),w(this,Zt).call(this,u)?(d&&(d.get="stale"),f?(d&&o&&p.__staleWhileFetching!==void 0&&(d.returnedStale=!0),o?p.__staleWhileFetching:void 0):(l||de(this,te,Rr).call(this,e,"expire"),d&&o&&(d.returnedStale=!0),o?p:void 0)):(d&&(d.get="hit"),f?p.__staleWhileFetching:(de(this,te,es).call(this,u),s&&w(this,Hr).call(this,u),p))}else d&&(d.get="miss")}delete(e){return de(this,te,Rr).call(this,e,"delete")}clear(){return de(this,te,sd).call(this,"delete")}};un=new WeakMap,Lt=new WeakMap,pn=new WeakMap,hn=new WeakMap,ko=new WeakMap,So=new WeakMap,ct=new WeakMap,fn=new WeakMap,at=new WeakMap,Ke=new WeakMap,be=new WeakMap,Tt=new WeakMap,Gt=new WeakMap,wt=new WeakMap,ht=new WeakMap,mn=new WeakMap,ft=new WeakMap,gn=new WeakMap,yn=new WeakMap,zt=new WeakMap,_n=new WeakMap,wr=new WeakMap,Bt=new WeakMap,te=new WeakSet,rd=function(){const e=new Vs(w(this,un)),n=new Vs(w(this,un));me(this,zt,e),me(this,yn,n),me(this,Pi,(l,d,u=bo.now())=>{if(n[l]=d!==0?u:0,e[l]=d,d!==0&&this.ttlAutopurge){const p=setTimeout(()=>{w(this,Zt).call(this,l)&&de(this,te,Rr).call(this,w(this,Ke)[l],"expire")},d+1);p.unref&&p.unref()}}),me(this,Hr,l=>{n[l]=e[l]!==0?bo.now():0}),me(this,Un,(l,d)=>{if(e[d]){const u=e[d],p=n[d];if(!u||!p)return;l.ttl=u,l.start=p,l.now=o||s();const f=l.now-p;l.remainingTTL=u-f}});let o=0;const s=()=>{const l=bo.now();if(this.ttlResolution>0){o=l;const d=setTimeout(()=>o=0,this.ttlResolution);d.unref&&d.unref()}return l};this.getRemainingTTL=l=>{const d=w(this,at).get(l);if(d===void 0)return 0;const u=e[d],p=n[d];if(!u||!p)return 1/0;const f=(o||s())-p;return u-f},me(this,Zt,l=>{const d=n[l],u=e[l];return!!u&&!!d&&(o||s())-d>u})},Hr=new WeakMap,Un=new WeakMap,Pi=new WeakMap,Zt=new WeakMap,rm=function(){const e=new Vs(w(this,un));me(this,fn,0),me(this,gn,e),me(this,jr,n=>{me(this,fn,w(this,fn)-e[n]),e[n]=0}),me(this,Di,(n,o,s,l)=>{if(de(this,te,Je).call(this,o))return 0;if(!Cr(s))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(s=l(o,n),!Cr(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),me(this,Eo,(n,o,s)=>{if(e[n]=o,w(this,Lt)){const l=w(this,Lt)-e[n];for(;w(this,fn)>l;)de(this,te,Sa).call(this,!0)}me(this,fn,w(this,fn)+e[n]),s&&(s.entrySize=o,s.totalCalculatedSize=w(this,fn))})},jr=new WeakMap,Eo=new WeakMap,Di=new WeakMap,Dr=function*({allowStale:e=this.allowStale}={}){if(w(this,ct))for(let n=w(this,ht);!(!de(this,te,od).call(this,n)||((e||!w(this,Zt).call(this,n))&&(yield n),n===w(this,wt)));)n=w(this,Gt)[n]},Fr=function*({allowStale:e=this.allowStale}={}){if(w(this,ct))for(let n=w(this,wt);!(!de(this,te,od).call(this,n)||((e||!w(this,Zt).call(this,n))&&(yield n),n===w(this,ht)));)n=w(this,Tt)[n]},od=function(e){return e!==void 0&&w(this,at).get(w(this,Ke)[e])===e},Sa=function(e){var l,d;const n=w(this,wt),o=w(this,Ke)[n],s=w(this,be)[n];return w(this,wr)&&de(this,te,Je).call(this,s)?s.__abortController.abort(new Error("evicted")):(w(this,_n)||w(this,Bt))&&(w(this,_n)&&((l=w(this,pn))==null||l.call(this,s,o,"evict")),w(this,Bt)&&((d=w(this,ft))==null||d.push([s,o,"evict"]))),w(this,jr).call(this,n),e&&(w(this,Ke)[n]=void 0,w(this,be)[n]=void 0,w(this,mn).push(n)),w(this,ct)===1?(me(this,wt,me(this,ht,0)),w(this,mn).length=0):me(this,wt,w(this,Tt)[n]),w(this,at).delete(o),ka(this,ct)._--,n},Ea=function(e,n,o,s){const l=n===void 0?void 0:w(this,be)[n];if(de(this,te,Je).call(this,l))return l;const d=new Ns,{signal:u}=o;u==null||u.addEventListener("abort",()=>d.abort(u.reason),{signal:d.signal});const p={signal:d.signal,options:o,context:s},f=(O,z=!1)=>{const{aborted:C}=d.signal,R=o.ignoreFetchAbort&&O!==void 0;if(o.status&&(C&&!z?(o.status.fetchAborted=!0,o.status.fetchError=d.signal.reason,R&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),C&&!R&&!z)return y(d.signal.reason);const G=S;return w(this,be)[n]===S&&(O===void 0?G.__staleWhileFetching?w(this,be)[n]=G.__staleWhileFetching:de(this,te,Rr).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,O,p.options))),O},m=O=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=O),y(O)),y=O=>{const{aborted:z}=d.signal,C=z&&o.allowStaleOnFetchAbort,R=C||o.allowStaleOnFetchRejection,G=R||o.noDeleteOnFetchRejection,$=S;if(w(this,be)[n]===S&&(!G||$.__staleWhileFetching===void 0?de(this,te,Rr).call(this,e,"fetch"):C||(w(this,be)[n]=$.__staleWhileFetching)),R)return o.status&&$.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),$.__staleWhileFetching;if($.__returned===$)throw O},E=(O,z)=>{var R;const C=(R=w(this,ko))==null?void 0:R.call(this,e,l,p);C&&C instanceof Promise&&C.then(G=>O(G===void 0?void 0:G),z),d.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(O(void 0),o.allowStaleOnFetchAbort&&(O=G=>f(G,!0)))})};o.status&&(o.status.fetchDispatched=!0);const S=new Promise(E).then(f,m),A=Object.assign(S,{__abortController:d,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,A,{...p.options,status:void 0}),n=w(this,at).get(e)):w(this,be)[n]=A,A},Je=function(e){if(!w(this,wr))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Ns},id=function(e,n){w(this,Gt)[n]=e,w(this,Tt)[e]=n},es=function(e){e!==w(this,ht)&&(e===w(this,wt)?me(this,wt,w(this,Tt)[e]):de(this,te,id).call(this,w(this,Gt)[e],w(this,Tt)[e]),de(this,te,id).call(this,w(this,ht),e),me(this,ht,e))},Rr=function(e,n){var s,l,d,u;let o=!1;if(w(this,ct)!==0){const p=w(this,at).get(e);if(p!==void 0)if(o=!0,w(this,ct)===1)de(this,te,sd).call(this,n);else{w(this,jr).call(this,p);const f=w(this,be)[p];if(de(this,te,Je).call(this,f)?f.__abortController.abort(new Error("deleted")):(w(this,_n)||w(this,Bt))&&(w(this,_n)&&((s=w(this,pn))==null||s.call(this,f,e,n)),w(this,Bt)&&((l=w(this,ft))==null||l.push([f,e,n]))),w(this,at).delete(e),w(this,Ke)[p]=void 0,w(this,be)[p]=void 0,p===w(this,ht))me(this,ht,w(this,Gt)[p]);else if(p===w(this,wt))me(this,wt,w(this,Tt)[p]);else{const m=w(this,Gt)[p];w(this,Tt)[m]=w(this,Tt)[p];const y=w(this,Tt)[p];w(this,Gt)[y]=w(this,Gt)[p]}ka(this,ct)._--,w(this,mn).push(p)}}if(w(this,Bt)&&((d=w(this,ft))!=null&&d.length)){const p=w(this,ft);let f;for(;f=p==null?void 0:p.shift();)(u=w(this,hn))==null||u.call(this,...f)}return o},sd=function(e){var n,o,s;for(const l of de(this,te,Fr).call(this,{allowStale:!0})){const d=w(this,be)[l];if(de(this,te,Je).call(this,d))d.__abortController.abort(new Error("deleted"));else{const u=w(this,Ke)[l];w(this,_n)&&((n=w(this,pn))==null||n.call(this,d,u,e)),w(this,Bt)&&((o=w(this,ft))==null||o.push([d,u,e]))}}if(w(this,at).clear(),w(this,be).fill(void 0),w(this,Ke).fill(void 0),w(this,zt)&&w(this,yn)&&(w(this,zt).fill(0),w(this,yn).fill(0)),w(this,gn)&&w(this,gn).fill(0),me(this,wt,0),me(this,ht,0),w(this,mn).length=0,me(this,fn,0),me(this,ct,0),w(this,Bt)&&w(this,ft)){const l=w(this,ft);let d;for(;d=l==null?void 0:l.shift();)(s=w(this,hn))==null||s.call(this,...d)}};let Pl=Fl;const RT={cacheSize:15e6};class MT{constructor(e){$e(this,"_str");$e(this,"_rawJson");$e(this,"_zodSchema");$e(this,"_validatedJson");this.bytes=e}get str(){return this._str===void 0&&(this._str=new TextDecoder().decode(this.bytes)),this._str}get rawJson(){return this._rawJson===void 0&&(this._rawJson=JSON.parse(this.str)),this._rawJson}validatedJson(e){return this._zodSchema!==e&&(this._validatedJson=e.parse(this.rawJson),this._zodSchema=e),this._validatedJson}}const qr=class qr{constructor(e){$e(this,"fileDataCache");$e(this,"fileDataRefs",new Map);const n={...RT,...e??{}};this.fileDataCache=new Pl({maxSize:n.cacheSize,fetchMethod:async o=>new MT(await Bg().blobDriver.getContent(o)),sizeCalculation:o=>o.bytes.length,dispose:(o,s)=>{this.fileDataRefs.delete(s)}})}getDataRef(e){const n=this.fileDataRefs.get(e);if(n!==void 0)return n;const o=r.shallowRef();return this.fileDataRefs.set(e,o),(async()=>{try{const s=await this.fileDataCache.fetch(e);o.value=s}catch(s){console.error(s)}})(),o}getContentBytes(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n.value)==null?void 0:o.bytes})}getContentString(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n==null?void 0:n.value)==null?void 0:o.str})}getContentJson(e,n){if(e===void 0)return;const o=this.getDataRef(e);return r.computed(()=>{var s,l;return n===void 0?(s=o==null?void 0:o.value)==null?void 0:s.rawJson:(l=o==null?void 0:o.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return qr.globalInstance.getContentBytes(e)}static getContentString(e){return qr.globalInstance.getContentString(e)}static getContentJson(e,n){return qr.globalInstance.getContentJson(e,n)}};$e(qr,"globalInstance",new qr);let Dl=qr;I.AgGridTheme=eu,I.BlockLayout=QE,I.ContextProvider=Ik,I.DataTable=$v,I.DemoData=OE,I.DropdownListItem=fo,I.LongText=vl,I.MultiError=Aa,I.PlAccordion=Kb,I.PlAccordionSection=ox,I.PlAgCellFile=TT,I.PlAgDataTable=vT,I.PlAgOverlayLoading=lp,I.PlAgOverlayNoRows=cp,I.PlAgTextAndButtonCell=NT,I.PlAlert=vC,I.PlBlockPage=iC,I.PlBtnAccent=IC,I.PlBtnDanger=LC,I.PlBtnGhost=hl,I.PlBtnGroup=a0,I.PlBtnLink=$C,I.PlBtnPrimary=ul,I.PlBtnSecondary=pl,I.PlBtnSplit=PC,I.PlCheckbox=Iu,I.PlCheckboxGroup=ab,I.PlChip=Cl,I.PlContainer=aC,I.PlDialogModal=bl,I.PlDropdown=hi,I.PlDropdownLegacy=Aw,I.PlDropdownLine=Mu,I.PlDropdownMulti=nb,I.PlDropdownRef=ow,I.PlFileDialog=zu,I.PlFileInput=rp,I.PlGrid=hC,I.PlIcon16=gs,I.PlIcon24=Pu,I.PlLogView=Lu,I.PlMaskIcon16=ur,I.PlMaskIcon24=Zn,I.PlNotificationAlert=op,I.PlNumberField=zw,I.PlProgressBar=Fw,I.PlRow=cC,I.PlSectionSeparator=Gu,I.PlSlideModal=wb,I.PlSpacer=Su,I.PlTableFilters=bT,I.PlTabs=$b,I.PlTextArea=O0,I.PlTextField=zr,I.PlToggleSwitch=ys,I.PlTooltip=St,I.ReactiveFileContent=Dl,I.Scrollable=TS,I.Slider=ip,I.SliderRange=xS,I.SliderRangeTriple=uS,I.ThemeSwitcher=Qv,I.UnresolvedError=Ba,I.ValueOrErrorsComponent=ST,I.activateAgGrid=Qd,I.animate=vu,I.animateInfinite=qv,I.call=fu,I.computedResult=DT,I.createModel=Ra,I.debounce=Cu,I.defineApp=C_,I.defineStore=PT,I.delay=mu,I.detectOutside=L0,I.ensureError=Pa,I.eventListener=yl,I.formatZodError=Fa,I.getElementScrollPosition=Fu,I.identity=Va,I.isDefined=ym,I.isElementVisible=Du,I.isJsonEqual=Na,I.isZodError=Da,I.listToOptions=Kv,I.makeEaseInOut=jv,I.makeEaseOut=_u,I.maskIcons16=ME,I.maskIcons24=IE,I.normalizeListOptions=dr,I.notEmpty=sl,I.randomInt=yu,I.randomString=Hv,I.requestTick=al,I.scrollIntoView=pi,I.showContextMenu=rl,I.throttle=wu,I.timeout=gu,I.unwrapOptionalResult=gm,I.unwrapValueOrErrors=fd,I.useClickOutside=ms,I.useDraggable=eS,I.useEventListener=rt,I.useFormState=Xk,I.useHover=pu,I.useInterval=Jk,I.useLabelNotch=zn,I.useLocalStorage=bu,I.useMouse=uu,I.useMouseCapture=cr,I.usePosition=mo,I.useQuery=Qk,I.useResizeObserver=sp,I.useScroll=qk,I.useSdkPlugin=Xa,I.useSortable=Yk,I.useTheme=ku,I.useWatchFetch=mp,I.wrapOptionalResult=md,I.wrapValueOrErrors=mm,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
|
|
90
|
+
`)+J+`return __p
|
|
91
|
+
}`;var Pe=Qf(function(){return $e(v,ue+"return "+J).apply(n,S)});if(Pe.source=J,Hc(Pe))throw Pe;return Pe}function BF(i){return We(i).toLowerCase()}function AF(i){return We(i).toUpperCase()}function NF(i,a,c){if(i=We(i),i&&(c||a===n))return ah(i);if(!i||!(a=Wt(a)))return i;var h=bn(i),g=bn(a),v=lh(h,g),S=ch(h,g)+1;return Dr(h,v,S).join("")}function VF(i,a,c){if(i=We(i),i&&(c||a===n))return i.slice(0,uh(i)+1);if(!i||!(a=Wt(a)))return i;var h=bn(i),g=ch(h,bn(a))+1;return Dr(h,0,g).join("")}function PF(i,a,c){if(i=We(i),i&&(c||a===n))return i.replace(Hl,"");if(!i||!(a=Wt(a)))return i;var h=bn(i),g=lh(h,bn(a));return Dr(h,g).join("")}function DF(i,a){var c=U,h=X;if(tt(a)){var g="separator"in a?a.separator:g;c="length"in a?Ae(a.length):c,h="omission"in a?Wt(a.omission):h}i=We(i);var v=i.length;if(Po(i)){var S=bn(i);v=S.length}if(c>=v)return i;var A=c-Do(h);if(A<1)return h;var P=S?Dr(S,0,A).join(""):i.slice(0,A);if(g===n)return P+h;if(S&&(A+=P.length-A),jc(g)){if(i.slice(A).search(g)){var j,q=P;for(g.global||(g=cc(g.source,We(Ap.exec(g))+"g")),g.lastIndex=0;j=g.exec(q);)var J=j.index;P=P.slice(0,J===n?A:J)}}else if(i.indexOf(Wt(g),A)!=A){var oe=P.lastIndexOf(g);oe>-1&&(P=P.slice(0,oe))}return P+h}function FF(i){return i=We(i),i&&WT.test(i)?i.replace(Ep,cA):i}var RF=Go(function(i,a,c){return i+(c?" ":"")+a.toUpperCase()}),Yc=Qh("toUpperCase");function Xf(i,a,c){return i=We(i),a=c?n:a,a===n?oA(i)?pA(i):KB(i):i.match(a)||[]}var Qf=De(function(i,a){try{return $t(i,n,a)}catch(c){return Hc(c)?c:new ke(c)}}),MF=Jn(function(i,a){return Jt(a,function(c){c=On(c),Kn(i,c,Uc(i[c],i))}),i});function IF(i){var a=i==null?0:i.length,c=fe();return i=a?Xe(i,function(h){if(typeof h[1]!="function")throw new Xt(d);return[c(h[0]),h[1]]}):[],De(function(h){for(var g=-1;++g<a;){var v=i[g];if($t(v[0],this,h))return $t(v[1],this,h)}})}function OF(i){return cN(en(i,y))}function Jc(i){return function(){return i}}function LF(i,a){return i==null||i!==i?a:i}var GF=tf(),zF=tf(!0);function Mt(i){return i}function Xc(i){return Vh(typeof i=="function"?i:en(i,y))}function ZF(i){return Dh(en(i,y))}function $F(i,a){return Fh(i,en(a,y))}var UF=De(function(i,a){return function(c){return Ki(c,i,a)}}),WF=De(function(i,a){return function(c){return Ki(i,c,a)}});function Qc(i,a,c){var h=mt(a),g=ia(a,h);c==null&&!(tt(a)&&(g.length||!h.length))&&(c=a,a=i,i=this,g=ia(a,mt(a)));var v=!(tt(c)&&"chain"in c)||!!c.chain,S=Qn(i);return Jt(g,function(A){var P=a[A];i[A]=P,S&&(i.prototype[A]=function(){var j=this.__chain__;if(v||j){var q=i(this.__wrapped__),J=q.__actions__=Dt(this.__actions__);return J.push({func:P,args:arguments,thisArg:i}),q.__chain__=j,q}return P.apply(i,Tr([this.value()],arguments))})}),i}function HF(){return gt._===this&&(gt._=_A),this}function ed(){}function jF(i){return i=Ae(i),De(function(a){return Rh(a,i)})}var qF=Vc(Xe),KF=Vc(nh),YF=Vc(nc);function em(i){return Oc(i)?rc(On(i)):EN(i)}function JF(i){return function(a){return i==null?n:ro(i,a)}}var XF=rf(),QF=rf(!0);function td(){return[]}function nd(){return!1}function eR(){return{}}function tR(){return""}function nR(){return!0}function rR(i,a){if(i=Ae(i),i<1||i>ne)return[];var c=ot,h=bt(i,ot);a=fe(a),i-=ot;for(var g=sc(h,a);++c<i;)a(c);return g}function oR(i){return Ee(i)?Xe(i,On):Ht(i)?[i]:Dt(Cf(We(i)))}function iR(i){var a=++gA;return We(i)+a}var sR=ua(function(i,a){return i+a},0),aR=Pc("ceil"),lR=ua(function(i,a){return i/a},1),cR=Pc("floor");function dR(i){return i&&i.length?oa(i,Mt,yc):n}function uR(i,a){return i&&i.length?oa(i,fe(a,2),yc):n}function pR(i){return ih(i,Mt)}function hR(i,a){return ih(i,fe(a,2))}function fR(i){return i&&i.length?oa(i,Mt,wc):n}function mR(i,a){return i&&i.length?oa(i,fe(a,2),wc):n}var gR=ua(function(i,a){return i*a},1),yR=Pc("round"),_R=ua(function(i,a){return i-a},0);function vR(i){return i&&i.length?ic(i,Mt):0}function CR(i,a){return i&&i.length?ic(i,fe(a,2)):0}return _.after=ZP,_.ary=Vf,_.assign=AD,_.assignIn=Wf,_.assignInWith=ka,_.assignWith=ND,_.at=VD,_.before=Pf,_.bind=Uc,_.bindAll=MF,_.bindKey=Df,_.castArray=eD,_.chain=Bf,_.chunk=cV,_.compact=dV,_.concat=uV,_.cond=IF,_.conforms=OF,_.constant=Jc,_.countBy=vP,_.create=PD,_.curry=Ff,_.curryRight=Rf,_.debounce=Mf,_.defaults=DD,_.defaultsDeep=FD,_.defer=$P,_.delay=UP,_.difference=pV,_.differenceBy=hV,_.differenceWith=fV,_.drop=mV,_.dropRight=gV,_.dropRightWhile=yV,_.dropWhile=_V,_.fill=vV,_.filter=wP,_.flatMap=kP,_.flatMapDeep=SP,_.flatMapDepth=EP,_.flatten=kf,_.flattenDeep=CV,_.flattenDepth=wV,_.flip=WP,_.flow=GF,_.flowRight=zF,_.fromPairs=bV,_.functions=zD,_.functionsIn=ZD,_.groupBy=TP,_.initial=kV,_.intersection=SV,_.intersectionBy=EV,_.intersectionWith=TV,_.invert=UD,_.invertBy=WD,_.invokeMap=AP,_.iteratee=Xc,_.keyBy=NP,_.keys=mt,_.keysIn=Rt,_.map=_a,_.mapKeys=jD,_.mapValues=qD,_.matches=ZF,_.matchesProperty=$F,_.memoize=Ca,_.merge=KD,_.mergeWith=Hf,_.method=UF,_.methodOf=WF,_.mixin=Qc,_.negate=wa,_.nthArg=jF,_.omit=YD,_.omitBy=JD,_.once=HP,_.orderBy=VP,_.over=qF,_.overArgs=jP,_.overEvery=KF,_.overSome=YF,_.partial=Wc,_.partialRight=If,_.partition=PP,_.pick=XD,_.pickBy=jf,_.property=em,_.propertyOf=JF,_.pull=VV,_.pullAll=Ef,_.pullAllBy=PV,_.pullAllWith=DV,_.pullAt=FV,_.range=XF,_.rangeRight=QF,_.rearg=qP,_.reject=RP,_.remove=RV,_.rest=KP,_.reverse=Zc,_.sampleSize=IP,_.set=eF,_.setWith=tF,_.shuffle=OP,_.slice=MV,_.sortBy=zP,_.sortedUniq=$V,_.sortedUniqBy=UV,_.split=kF,_.spread=YP,_.tail=WV,_.take=HV,_.takeRight=jV,_.takeRightWhile=qV,_.takeWhile=KV,_.tap=dP,_.throttle=JP,_.thru=ya,_.toArray=Zf,_.toPairs=qf,_.toPairsIn=Kf,_.toPath=oR,_.toPlainObject=Uf,_.transform=nF,_.unary=XP,_.union=YV,_.unionBy=JV,_.unionWith=XV,_.uniq=QV,_.uniqBy=eP,_.uniqWith=tP,_.unset=rF,_.unzip=$c,_.unzipWith=Tf,_.update=oF,_.updateWith=iF,_.values=$o,_.valuesIn=sF,_.without=nP,_.words=Xf,_.wrap=QP,_.xor=rP,_.xorBy=oP,_.xorWith=iP,_.zip=sP,_.zipObject=aP,_.zipObjectDeep=lP,_.zipWith=cP,_.entries=qf,_.entriesIn=Kf,_.extend=Wf,_.extendWith=ka,Qc(_,_),_.add=sR,_.attempt=Qf,_.camelCase=dF,_.capitalize=Yf,_.ceil=aR,_.clamp=aF,_.clone=tD,_.cloneDeep=rD,_.cloneDeepWith=oD,_.cloneWith=nD,_.conformsTo=iD,_.deburr=Jf,_.defaultTo=LF,_.divide=lR,_.endsWith=uF,_.eq=kn,_.escape=pF,_.escapeRegExp=hF,_.every=CP,_.find=bP,_.findIndex=bf,_.findKey=RD,_.findLast=xP,_.findLastIndex=xf,_.findLastKey=MD,_.floor=cR,_.forEach=Af,_.forEachRight=Nf,_.forIn=ID,_.forInRight=OD,_.forOwn=LD,_.forOwnRight=GD,_.get=qc,_.gt=sD,_.gte=aD,_.has=$D,_.hasIn=Kc,_.head=Sf,_.identity=Mt,_.includes=BP,_.indexOf=xV,_.inRange=lF,_.invoke=HD,_.isArguments=so,_.isArray=Ee,_.isArrayBuffer=lD,_.isArrayLike=Ft,_.isArrayLikeObject=it,_.isBoolean=cD,_.isBuffer=Fr,_.isDate=dD,_.isElement=uD,_.isEmpty=pD,_.isEqual=hD,_.isEqualWith=fD,_.isError=Hc,_.isFinite=mD,_.isFunction=Qn,_.isInteger=Of,_.isLength=ba,_.isMap=Lf,_.isMatch=gD,_.isMatchWith=yD,_.isNaN=_D,_.isNative=vD,_.isNil=wD,_.isNull=CD,_.isNumber=Gf,_.isObject=tt,_.isObjectLike=nt,_.isPlainObject=ts,_.isRegExp=jc,_.isSafeInteger=bD,_.isSet=zf,_.isString=xa,_.isSymbol=Ht,_.isTypedArray=Zo,_.isUndefined=xD,_.isWeakMap=kD,_.isWeakSet=SD,_.join=BV,_.kebabCase=fF,_.last=nn,_.lastIndexOf=AV,_.lowerCase=mF,_.lowerFirst=gF,_.lt=ED,_.lte=TD,_.max=dR,_.maxBy=uR,_.mean=pR,_.meanBy=hR,_.min=fR,_.minBy=mR,_.stubArray=td,_.stubFalse=nd,_.stubObject=eR,_.stubString=tR,_.stubTrue=nR,_.multiply=gR,_.nth=NV,_.noConflict=HF,_.noop=ed,_.now=va,_.pad=yF,_.padEnd=_F,_.padStart=vF,_.parseInt=CF,_.random=cF,_.reduce=DP,_.reduceRight=FP,_.repeat=wF,_.replace=bF,_.result=QD,_.round=yR,_.runInContext=V,_.sample=MP,_.size=LP,_.snakeCase=xF,_.some=GP,_.sortedIndex=IV,_.sortedIndexBy=OV,_.sortedIndexOf=LV,_.sortedLastIndex=GV,_.sortedLastIndexBy=zV,_.sortedLastIndexOf=ZV,_.startCase=SF,_.startsWith=EF,_.subtract=_R,_.sum=vR,_.sumBy=CR,_.template=TF,_.times=rR,_.toFinite=er,_.toInteger=Ae,_.toLength=$f,_.toLower=BF,_.toNumber=rn,_.toSafeInteger=BD,_.toString=We,_.toUpper=AF,_.trim=NF,_.trimEnd=VF,_.trimStart=PF,_.truncate=DF,_.unescape=FF,_.uniqueId=iR,_.upperCase=RF,_.upperFirst=Yc,_.each=Af,_.eachRight=Nf,_.first=Sf,Qc(_,function(){var i={};return Mn(_,function(a,c){He.call(_.prototype,c)||(i[c]=a)}),i}(),{chain:!1}),_.VERSION=o,Jt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){_[i].placeholder=_}),Jt(["drop","take"],function(i,a){Re.prototype[i]=function(c){c=c===n?1:ut(Ae(c),0);var h=this.__filtered__&&!a?new Re(this):this.clone();return h.__filtered__?h.__takeCount__=bt(c,h.__takeCount__):h.__views__.push({size:bt(c,ot),type:i+(h.__dir__<0?"Right":"")}),h},Re.prototype[i+"Right"]=function(c){return this.reverse()[i](c).reverse()}}),Jt(["filter","map","takeWhile"],function(i,a){var c=a+1,h=c==w||c==Z;Re.prototype[i]=function(g){var v=this.clone();return v.__iteratees__.push({iteratee:fe(g,3),type:c}),v.__filtered__=v.__filtered__||h,v}}),Jt(["head","last"],function(i,a){var c="take"+(a?"Right":"");Re.prototype[i]=function(){return this[c](1).value()[0]}}),Jt(["initial","tail"],function(i,a){var c="drop"+(a?"":"Right");Re.prototype[i]=function(){return this.__filtered__?new Re(this):this[c](1)}}),Re.prototype.compact=function(){return this.filter(Mt)},Re.prototype.find=function(i){return this.filter(i).head()},Re.prototype.findLast=function(i){return this.reverse().find(i)},Re.prototype.invokeMap=De(function(i,a){return typeof i=="function"?new Re(this):this.map(function(c){return Ki(c,i,a)})}),Re.prototype.reject=function(i){return this.filter(wa(fe(i)))},Re.prototype.slice=function(i,a){i=Ae(i);var c=this;return c.__filtered__&&(i>0||a<0)?new Re(c):(i<0?c=c.takeRight(-i):i&&(c=c.drop(i)),a!==n&&(a=Ae(a),c=a<0?c.dropRight(-a):c.take(a-i)),c)},Re.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Re.prototype.toArray=function(){return this.take(ot)},Mn(Re.prototype,function(i,a){var c=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),g=_[h?"take"+(a=="last"?"Right":""):a],v=h||/^find/.test(a);g&&(_.prototype[a]=function(){var S=this.__wrapped__,A=h?[1]:arguments,P=S instanceof Re,j=A[0],q=P||Ee(S),J=function(Fe){var Me=g.apply(_,Tr([Fe],A));return h&&oe?Me[0]:Me};q&&c&&typeof j=="function"&&j.length!=1&&(P=q=!1);var oe=this.__chain__,ue=!!this.__actions__.length,ge=v&&!oe,Pe=P&&!ue;if(!v&&q){S=Pe?S:new Re(this);var ye=i.apply(S,A);return ye.__actions__.push({func:ya,args:[J],thisArg:n}),new Qt(ye,oe)}return ge&&Pe?i.apply(this,A):(ye=this.thru(J),ge?h?ye.value()[0]:ye.value():ye)})}),Jt(["pop","push","shift","sort","splice","unshift"],function(i){var a=$s[i],c=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",h=/^(?:pop|shift)$/.test(i);_.prototype[i]=function(){var g=arguments;if(h&&!this.__chain__){var v=this.value();return a.apply(Ee(v)?v:[],g)}return this[c](function(S){return a.apply(Ee(S)?S:[],g)})}}),Mn(Re.prototype,function(i,a){var c=_[a];if(c){var h=c.name+"";He.call(Io,h)||(Io[h]=[]),Io[h].push({name:a,func:c})}}),Io[da(n,C).name]=[{name:"wrapper",func:n}],Re.prototype.clone=FA,Re.prototype.reverse=RA,Re.prototype.value=MA,_.prototype.at=uP,_.prototype.chain=pP,_.prototype.commit=hP,_.prototype.next=fP,_.prototype.plant=gP,_.prototype.reverse=yP,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=_P,_.prototype.first=_.prototype.head,Zi&&(_.prototype[Zi]=mP),_},Fo=hA();Xr?((Xr.exports=Fo)._=Fo,Xl._=Fo):gt._=Fo}).call(Uo)}(Ns,Ns.exports);var Ge=Ns.exports;const tT={class:"grid-overlay-container"},cp=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",tT,[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))]))}}),nT={},rT={class:"grid-overlay-container"};function oT(t,e){return r.openBlock(),r.createElementBlock("div",rT,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const dp=As(nT,[["render",oT]]);async function iT(t,e){throw Error("not implemented")}function sT(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function aT(t,e){const n=[];for(const o of e)if(t[o].type==="column"){const s=sT(t[o].spec);for(const l of s){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const d=$a(l),u=t.findIndex(p=>Ge.isEqual(p.id,d));if(u===-1)throw console.error("axis not found",o,d,t),Error("axis not found");n.push({columnIdx:o,axisIdx:u})}}return n}const up=(t,e)=>(t+e).toString();function lT(t,e,n,o,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 y=0;y<l.length;++y)l[y]===d.axisIdx&&(u=y),l[y]===d.columnIdx&&(p=y);const f=(()=>{const B=o[u].data.filter(T=>T!==null);return Array.from(new Set(B))})();f.sort(),p>u?(n.splice(p,1),n.splice(u,1)):(n.splice(u,1),n.splice(p,1));const m=cT(s,o,u,p,f,e.rows);for(let y=0;y<f.length;++y){const B=f[y],T=Or(B+"@"+y);n.push({colId:T,field:up(o.length,y),headerName:B,valueFormatter:hp})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function cT(t,e,n,o,s,l){const d=new Map;let u=0;for(let f=0;f<l;f++){const m={};for(let M=0;M<e.length;++M){if(M===n||M===o)continue;const G=t[M].toString();m[G]=e[M].data[f]}let y;const B=Or(Object.values(m))??"";d.has(B)?y=d.get(B):(d.set(B,m),y=m,y.id=u.toString(),u++);const T=s.indexOf(e[n].data[f]);if(T===-1)throw Error("index not found");const N=up(e.length,T);y[N]=e[o].data[f]}return Array.from(d.values())}function dT(t){return Or(t)}function pp(t){return JSON.parse(t)}const hp=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function uT(t,e,n){var s,l,d;const o=dT(e);return{colId:o,field:t.toString(),headerName:((l=(s=e.spec.annotations)==null?void 0:s["pl7.app/label"])==null?void 0:l.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(n==null?void 0:n.includes(o))??((d=e.spec.annotations)==null?void 0:d["pl7.app/table/visibility"])==="optional",valueFormatter:hp,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 fp(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 mp(t){const e=[];return ps(t,n=>(e.push(n),n)),e}async function pT(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:Ge.uniqWith(n.map(s=>Vd(s.spec.axesSpec).map(Ge.cloneDeep)).flat(),Ge.isEqual),strictlyCompatible:!0})).hits.filter(s=>s.spec.axesSpec.length===1):[]}async function hT(t,e,n){const o=mp(n),l=(await pT(t,e,o)).filter(d=>!Ge.find(o,u=>d.columnId===u.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(d=>({type:"column",column:d}))}}async function fT(t,e,n,o){const s=n.filter(m=>m.type!=="Bytes"),l=mp(o),d=s.map(m=>[]),u=s.map(m=>null);for(let m=0;m<l.length;++m){const y=Vd(l[m].spec.axesSpec);for(let B=0;B<y.length;++B){const T=Ge.findIndex(s,N=>Ge.isEqual(N,y[B]));T===-1||u[T]||(y.length===1&&l[m].spec.name==="pl7.app/label"?(d[T]=[[m,B]],u[T]=l[m].columnId):d[T].push([m,B]))}}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[y,B]of d[m]){const T=await t.getUniqueValues(e,{columnId:l[y].columnId,...!u[m]&&{axis:Ge.cloneDeep(s[m])},filters:[],limit:p});if(T.overflow){u.splice(m,1),d.splice(m,1),s.splice(m,1);continue e}const N=T.values.type;for(const M of T.values.data)if(!(Nd(M,N)||M===null)&&(f[m].add(fp(M,N)),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,y)=>{const B=[...f[y]].map(N=>({value:N,label:N.toString()})),T=B[0].value;return{axis:Ge.cloneDeep(m),...u[y]&&{column:u[y]},options:B,defaultValue:T}})}function mT(t,e,n,o){const s=t.length,l=[];for(let d=0;d<e[0].data.length;++d){const u=[],p=(o++).toString();for(const m of n)u.push(e[m].data[d]);const f={key:u,id:p};for(let m=0;m<s;++m){const y=t[m].toString(),B=e[m].data[d],T=e[m].type;Sg(e[m].absent,d)?f[y]=void 0:Nd(B,T)||B===null?f[y]=null:f[y]=fp(B,T)}l.push(f)}return l}const gT=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function yT(t,e,n,o){const s=await t.getSpec(e);let l=s.findIndex(C=>C.type==="column");l===-1&&(l=s.length);const d=[...s.keys()].filter(C=>!Ge.find(n,F=>Ge.isEqual(F.axis,s[C].id)||Ge.isEqual(F.column,s[C].id))).sort((C,F)=>{var I,Y;if(s[C].type!==s[F].type)return s[C].type==="axis"?-1:1;const L=(I=s[C].spec.annotations)==null?void 0:I["pl7.app/table/orderPriority"],$=(Y=s[F].spec.annotations)==null?void 0:Y["pl7.app/table/orderPriority"];return L===void 0?$===void 0?0:1:$===void 0?-1:Number($)-Number(L)}),u=Ge.cloneDeep(d),p=aT(s,d);for(let C=d.length-1;C>=0;--C){const F=d[C];if(!gT(s[F]))continue;const L=$a(s[F].spec.axesSpec[0]),$=Ge.findIndex(d,I=>Ge.isEqual(s[I].id,L));if($===-1&&Ge.findIndex(n,Y=>Ge.isEqual(Y.axis,L))===-1){console.warn(`added label column, but the axis is not in the data; axisId: ${L}`);continue}d[$]=F;for(const I of p)I.axisIdx===F&&(I.axisIdx=$);d.splice(C,1),u.splice(C,1)}const f=await t.getShape(e),m=f.rows,y=u.map(C=>uT(C,s[C],o));if(p.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",p.length," transposition will not be applied."),p.length===1)return lT(p,f,y,await t.getData(e,d),u,d);const B=[...d],T=new Map;for(let C=0;C<l;++C)T.set(C,-1);for(let C=0;C<B.length;++C){const F=B[C];T.has(F)&&T.set(F,C)}for(const[C,F]of T)F===-1&&(T.set(C,B.length),B.push(C));const N=[];for(let C=0;C<l;++C){const F=T.get(C);if(F===void 0||F===-1)throw new Error("assertion exception");N.push(F)}let M;return{rowModelType:"serverSide",columnDefs:y,serverSideDatasource:{getRows:async C=>{try{if(m==0){C.success({rowData:[],rowCount:m}),C.api.setGridOption("loading",!1),C.api.showNoRowsOverlay();return}if(M&&!Ge.isEqual(M.request.sortModel,C.request.sortModel)){M=void 0,C.api.setGridOption("loading",!0),C.success({rowData:[],rowCount:0});return}M=C;let F=0,L=[];if(m>0&&C.request.startRow!==void 0&&C.request.endRow!==void 0&&(F=Math.min(m,C.request.endRow)-C.request.startRow,F>0)){const $=await t.getData(e,B,{offset:C.request.startRow,length:F});L=mT(u,$,N,C.request.startRow)}C.success({rowData:L,rowCount:m}),C.api.autoSizeAllColumns(),C.api.setGridOption("loading",!1)}catch(F){C.api.setGridOption("loading",!0),C.fail(),console.trace(F)}}}}}const _T={class:"ap-ag-data-table-container"},vT={key:0,class:"ap-ag-data-table-sheets"},CT=As(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:r.mergeModels(["onRowDoubleClicked","columnsChanged"],["update:modelValue"]),setup(t,{expose:e,emit:n}){x.ModuleRegistry.registerModules([rs.ClientSideRowModelModule,cd.ClipboardModule,ld.ServerSideRowModelModule,dd.RangeSelectionModule,ja,Qd]);const o=r.useModel(t,"modelValue"),s=t,{settings:l}=r.toRefs(s),d=n;r.watch(()=>l.value,async(E,w)=>{if(E.sourceType!=="pframe"||!E.pFrame||!E.join||w&&w.sourceType==="pframe"&&Ge.isEqual(E.pFrame,w.pFrame)&&Ge.isEqual(E.join,w.join))return;const k=window.platforma;if(!k)throw Error("platforma not set");const Z=k.pFrameDriver;if(!Z)throw Error("platforma.pFrameDriver not set");const te=await hT(Z,E.pFrame,E.join),ne=o.value;ne.pTableParams||(ne.pTableParams={sorting:[],filters:[]}),ne.pTableParams.join=te,o.value=ne});const u=gp(()=>l.value.sourceType,async E=>{var k;const w=l.value.sourceType;switch(w){case"pframe":{const Z=window.platforma;if(!Z)throw Error("platforma not set");const te=Z.pFrameDriver;if(!te)throw Error("platforma.pFrameDriver not set");if(!l.value.pFrame)return[];const ne=l.value.pFrame,be=(k=o.value.pTableParams)==null?void 0:k.join;return be?await fT(te,ne,l.value.sheetAxes,be):[]}case"ptable":return l.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${w}`)}});function p(E){if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return(E==null?void 0:E.sortModel.map(w=>{const{spec:k,...Z}=pp(w.colId);return{column:Z,ascending:w.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const f=r.computed({get:()=>{const E=o.value;return{columnOrder:E.gridState.columnOrder,sort:E.gridState.sort,columnVisibility:E.gridState.columnVisibility}},set:E=>{const w=o.value,k=N.value.rowModelType==="clientSide"?void 0:p(E.sort);w.gridState={...w.gridState,...E},(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(w.pTableParams||(w.pTableParams={sorting:[],filters:[]}),w.pTableParams.sorting=k),o.value=w}}),m=E=>Or(E);function y(E){var w;if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return((w=u.value)==null?void 0:w.map(k=>({type:"bySingleColumn",column:k.column?{type:"column",id:k.column}:{type:"axis",id:k.axis},predicate:{operator:"Equal",reference:E[m(k.axis)]}})))??[]}const B=r.computed({get:()=>o.value.gridState.sheets??{},set:E=>{const w=y(E),k=o.value;k.gridState.sheets=E,(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(k.pTableParams||(k.pTableParams={sorting:[],filters:[]}),k.pTableParams.filters=w),o.value=k}});r.watch(()=>[l.value,u.value],(E,w)=>{const[k,Z]=E;if(!Z)return;if(w){const[ne,be]=w;if((k.sourceType==="ptable"||k.sourceType==="pframe")&&k.sourceType===(ne==null?void 0:ne.sourceType)&&Ge.isEqual(Z,be))return}if(k.sourceType!=="ptable"&&k.sourceType!=="pframe"){B.value={};return}const te=B.value;for(const ne of Z){const be=m(ne.axis);te[be]||(te[be]=ne.defaultValue??ne.options[0].value)}B.value=te},{immediate:!0});const T=r.shallowRef(),N=r.shallowRef({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:f.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:E=>{E.api.autoSizeAllColumns()},onRowDoubleClicked:E=>{E.data&&d("onRowDoubleClicked",E.data.key)},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:E=>E.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:cp,noRowsOverlayComponent:dp,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"},defaultCsvExportParams:{allColumns:!0,suppressQuotes:!0,fileName:"table.csv"}}),M=E=>{const w=E.api;T.value=new Proxy(w,{get(k,Z,te){switch(Z){case"setGridOption":return(ne,be)=>{const Ze=N.value;Ze[ne]=be,N.value=Ze,w.setGridOption(ne,be)};case"updateGridOptions":return ne=>{N.value={...N.value,...ne},w.updateGridOptions(ne)};default:return Reflect.get(k,Z,te)}}})},G=E=>({columnOrder:E.columnOrder,sort:E.sort,columnVisibility:E.columnVisibility??(E.columnOrder?{hiddenColIds:[]}:void 0)}),C=E=>{N.value.initialState=f.value=G(E.state),E.api.autoSizeAllColumns()},F=()=>{N.value.initialState=f.value=G(T.value.getState()),T.value=void 0};let L=!1;const $=()=>{if(!L)return;const E=T.value;E!==void 0&&(E.exportDataAsCsv(),L=!1,E.setGridOption("cacheBlockSize",100))},I=()=>{if(!L)return;const E=T.value;if(E===void 0)return;const w=E.getServerSideGroupLevelState()[0];w.cacheBlockSize===w.rowCount&&E.refreshServerSide({route:w.route,purge:!1})};e({exportCsv:async()=>{const E=T.value;if(E!==void 0){if(N.value.rowModelType==="clientSide"){E.exportDataAsCsv();return}if(N.value.rowModelType==="serverSide"){const w=E.getServerSideGroupLevelState()[0];if(w.rowCount<=w.cacheBlockSize){E.exportDataAsCsv();return}L||(L=!0,E.setGridOption("cacheBlockSize",w.rowCount))}}}});const H=r.ref(0);r.watch(()=>[T.value,f.value],(E,w)=>{if(Ge.isEqual(E,w))return;const[k,Z]=E;if(!k)return;const te=G(k.getState());Ge.isEqual(Z,te)||(N.value.initialState=Z,++H.value)}),r.watch(()=>N.value,(E,w)=>{var k;if(w&&(E.rowModelType!=w.rowModelType&&++H.value,!Ge.isEqual(E.columnDefs,w.columnDefs)&&E.columnDefs)){const Z=be=>!("children"in be),te=(k=E.columnDefs)==null?void 0:k.filter(Z),ne=te==null?void 0:te.map(be=>be.colId).filter(be=>be!==void 0).map(be=>pp(be));d("columnsChanged",ne??[])}});const D=(E,w)=>{var Z;const k=B.value;k[E]!==w&&(k[E]=w,B.value=k,(Z=T.value)==null||Z.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))},K=window.platforma;if(!K)throw Error("platforma not set");const U=K.pFrameDriver;if(!U)throw Error("platforma.pFrameDriver not set");const X=K.blobDriver;if(!X)throw Error("platforma.blobDriver not set");let O;return r.watch(()=>[T.value,l.value,u.value],async E=>{var ne,be;const[w,k,Z]=E;if(!w||Ge.isEqual(k,O))return;O=k;const te=k.sourceType;switch(te){case"pframe":case"ptable":{const Ze=k.pTable;if(!Ze||!Z)return w.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ot=(be=(ne=f.value)==null?void 0:ne.columnVisibility)==null?void 0:be.hiddenColIds,vn=await yT(U,Ze,Z,ot);return w.updateGridOptions({loading:vn.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...vn})}case"xsv":{const Ze=k.xsvFile;if(!(Ze!=null&&Ze.ok)||!Ze.value)return w.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ot=await iT(X,Ze.value);return w.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...ot})}default:throw Error(`unsupported source type: ${te}`)}}),(E,w)=>(r.openBlock(),r.createElementBlock("div",_T,[r.unref(u).value&&r.unref(u).value.length>0?(r.openBlock(),r.createElementBlock("div",vT,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(u).value,(k,Z)=>(r.openBlock(),r.createBlock(r.unref(Iu),{key:Z,"model-value":B.value[m(k.axis)],options:k.options,"onUpdate:modelValue":te=>D(m(k.axis),te)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.unref(dm.AgGridVue),{key:H.value,theme:r.unref(tu),class:"ap-ag-data-table-grid","grid-options":N.value,onGridReady:M,onStateUpdated:C,onGridPreDestroyed:F,onStoreRefreshed:$,onModelUpdated:I},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-5dad3559"]]),wT={key:0,class:"d-flex gap-10 flex-column"},bT={key:0},xT=As(r.defineComponent({__name:"PlTableFilters",props:r.mergeModels({columns:{},restrictions:{},defaults:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{columns:o,restrictions:s,defaults:l}=r.toRefs(n),d=O=>Or(O.id),u=r.computed(()=>o.value.filter(O=>{const E=O.type;switch(E){case"axis":return O.spec.type!=="Bytes";case"column":return O.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${E}`)}}).map(O=>({column:O,id:d(O)}))),p=r.computed(()=>{const O=s.value??[],E={};for(const{column:w,id:k}of u.value){const Z=Ge.find(O,te=>Ge.isEqual(te.column.id,w.id));Z!==void 0&&(E[k]=Z.allowedFilterTypes)}return E}),f=r.computed(()=>{const O=l.value??[],E={};for(const{column:w,id:k}of u.value){const Z=Ge.find(O,te=>Ge.isEqual(te.column.id,w.id));Z!==void 0&&(E[k]=Z.default)}return E}),m=O=>O!==void 0?O:f.value,y=r.reactive({state:m(e.value.state)});r.watch(()=>e.value,O=>{Ge.isEqual(y.state,O.state)||(y.state=m(O.state))}),r.watch(()=>u.value,O=>{if(y.state!==void 0&&O.length===0)return;const E=y.state??{},w={};for(const{id:k}of O)E[k]!==void 0&&(w[k]=E[k]);y.state=w},{immediate:!0});const B=O=>{switch(O){case"isNotNA":return"Is not NA";case"isNA":return"Is NA";case"number_equals":case"string_equals":return"Equals";case"number_notEquals":case"string_notEquals":return"Not equals";case"number_greaterThan":return"Greater than";case"number_greaterThanOrEqualTo":return"Greater than or equal to";case"number_lessThan":return"Less than";case"number_lessThanOrEqualTo":return"Less than or equal to";case"number_between":return"Between";case"string_contains":return"Contains";case"string_doesNotContain":return"Does not contain";case"string_matches":return"Matches";case"string_doesNotMatch":return"Does not match";case"string_containsFuzzyMatch":return"Contains fuzzy match";default:throw Error(`unsupported filter type: ${O}`)}},T=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],N=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"],M=r.computed(()=>{const O=p.value,E={};for(const{column:w,id:k}of u.value){let te=(w.type==="column"?w.spec.valueType:w.spec.type)==="String"?N:T;const ne=O[k];ne!==void 0&&(te=te.filter(be=>ne.includes(be))),E[k]=te.map(be=>({value:be,text:B(be)}))}return E}),G=r.computed(()=>Ge.some(Object.values(M.value),O=>O.length>0)),C=O=>{const E=O.type;switch(E){case"isNotNA":case"isNA":return;case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return O.reference;case"number_between":return O.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return O.reference;default:throw Error(`unsupported filter type: ${E}`)}},F=(O,E)=>{switch(O){case"isNotNA":case"isNA":return{type:O};case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return{type:O,reference:typeof E=="number"?E:0};case"number_between":return{type:O,lowerBound:typeof E=="number"?E:0,includeLowerBound:!0,upperBound:100,includeUpperBound:!1};case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":return{type:O,reference:typeof E=="string"?E:""};case"string_containsFuzzyMatch":return{type:O,reference:typeof E=="string"?E:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${O}`)}},L=(O,E)=>{const w=y.state[O];y.state[O]=F(E,C(w))},$=O=>{y.state[O]=f.value[O]??F(M.value[O][0].value)},I=(O,E)=>{E?$(O):delete y.state[O]},Y=(O,E)=>{var ne,be;const w=Number(E);if(!Number.isFinite(w))throw Error("Model value is not a number.");const k=O.type==="column"?O.spec.valueType:O.spec.type;if((k==="Int"||k==="Long")&&!Number.isInteger(w))throw Error("Model value is not an integer.");const Z=(ne=O.spec.annotations)==null?void 0:ne["pl7.app/min"];if(Z!==void 0){const Ze=Number(Z);if(Number.isFinite(Ze)&&w<Number(Z))throw Error("Model value is too low.")}const te=(be=O.spec.annotations)==null?void 0:be["pl7.app/max"];if(te!==void 0){const Ze=Number(te);if(Number.isFinite(Ze)&&w>Number(te))throw Error("Model value is too high.")}return w},H=(O,E)=>{var k,Z;const w=((k=O.spec.domain)==null?void 0:k["pl7.app/alphabet"])??((Z=O.spec.annotations)==null?void 0:Z["pl7.app/alphabet"]);if(w==="nucleotide"&&!/^[AaTtGgCcNn]+$/.test(E))throw Error("Model value is not a nucleotide.");if(w==="aminoacid"&&!/^[AaCcDdEeFfGgHhIiKkLlMmNnPpQqRrSsTtVvWwYyXx]+$/.test(E))throw Error("Model value is not an aminoacid.");return E},D=O=>{try{return new RegExp(O),O}catch(E){throw E instanceof SyntaxError?Error("Model value is not a regexp."):E}},K=(O,E)=>{var Z,te;const w=((Z=O.spec.domain)==null?void 0:Z["pl7.app/alphabet"])??((te=O.spec.annotations)==null?void 0:te["pl7.app/alphabet"]);if(w==="nucleotide")return[{value:"N",text:"N"}];if(w==="aminoacid")return[{value:"X",text:"X"}];const k=Ge.uniq(E);return k.sort(),k.map(ne=>({value:ne,text:ne}))},U=O=>{const E=O.type;switch(E){case"isNotNA":return{operator:"Not",operand:{operator:"IsNA"}};case"isNA":return{operator:"IsNA"};case"number_equals":case"string_equals":return{operator:"Equal",reference:O.reference};case"number_notEquals":case"string_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:O.reference}};case"number_greaterThan":return{operator:"Greater",reference:O.reference};case"number_greaterThanOrEqualTo":return{operator:"GreaterOrEqual",reference:O.reference};case"number_lessThan":return{operator:"Less",reference:O.reference};case"number_lessThanOrEqualTo":return{operator:"LessOrEqual",reference:O.reference};case"number_between":return{operator:"And",operands:[{operator:O.includeLowerBound?"GreaterOrEqual":"Greater",reference:O.lowerBound},{operator:O.includeUpperBound?"LessOrEqual":"Less",reference:O.upperBound}]};case"string_contains":return{operator:"StringContains",substring:O.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:"StringContains",substring:O.reference}};case"string_matches":return{operator:"Matches",regex:O.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:O.reference}};case"string_containsFuzzyMatch":return{operator:"StringContainsFuzzy",reference:O.reference,maxEdits:O.maxEdits,substitutionsOnly:O.substitutionsOnly,wildcard:O.wildcard};default:throw Error(`unsupported filter type: ${E}`)}},X=O=>u.value.map(({column:E,id:w})=>{if(!(w in O))return;const k=U(O[w]),{spec:Z,...te}=E;return{type:"bySingleColumn",column:te,predicate:k}}).filter(E=>E!==void 0);return r.watch(()=>y,O=>{Ge.isEqual(O.state,e.value.state)||(e.value={state:Ge.cloneDeep(O.state),filters:X(O.state)})},{immediate:!0,deep:!0}),(O,E)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,({column:w,id:k},Z)=>{var te,ne,be,Ze,ot,vn,Rn,xr,Wn,Yr,Fs,kr,Sr,Rs;return r.openBlock(),r.createElementBlock("div",{key:k},[M.value[k].length>0?(r.openBlock(),r.createElementBlock("form",wT,[r.createVNode(r.unref(Ou),{"model-value":!!y.state[k],"onUpdate:modelValue":Se=>I(k,Se)},{default:r.withCtx(()=>{var Se,Jr;return[r.createTextVNode(r.toDisplayString(((Jr=(Se=w.spec.annotations)==null?void 0:Se["pl7.app/label"])==null?void 0:Jr.trim())??"Unlabeled "+w.type+" "+Z.toString()),1)]}),_:2},1032,["model-value","onUpdate:modelValue"]),r.createElementVNode("div",{class:r.normalizeClass(["controls d-flex gap-10 flex-column",{open:!!y.state[k]}])},[y.state[k]?(r.openBlock(),r.createBlock(r.unref(mi),{key:0,"model-value":y.state[k].type,options:M.value[k],label:"Predicate","onUpdate:modelValue":Se=>L(k,Se)},null,8,["model-value","options","onUpdate:modelValue"])):r.createCommentVNode("",!0),((te=y.state[k])==null?void 0:te.type)==="number_equals"||((ne=y.state[k])==null?void 0:ne.type)==="number_notEquals"||((be=y.state[k])==null?void 0:be.type)==="number_lessThan"||((Ze=y.state[k])==null?void 0:Ze.type)==="number_lessThanOrEqualTo"||((ot=y.state[k])==null?void 0:ot.type)==="number_greaterThan"||((vn=y.state[k])==null?void 0:vn.type)==="number_greaterThanOrEqualTo"?(r.openBlock(),r.createBlock(r.unref(hr),{key:1,modelValue:y.state[k].reference,"onUpdate:modelValue":Se=>y.state[k].reference=Se,parse:Se=>Y(w,Se),label:"Reference value"},null,8,["modelValue","onUpdate:modelValue","parse"])):r.createCommentVNode("",!0),((Rn=y.state[k])==null?void 0:Rn.type)==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createVNode(r.unref(hr),{modelValue:y.state[k].lowerBound,"onUpdate:modelValue":Se=>y.state[k].lowerBound=Se,parse:Se=>Y(w,Se),label:"Lower bound"},null,8,["modelValue","onUpdate:modelValue","parse"]),r.createVNode(r.unref(vs),{modelValue:y.state[k].includeLowerBound,"onUpdate:modelValue":Se=>y.state[k].includeLowerBound=Se,label:"Include lower bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(hr),{modelValue:y.state[k].upperBound,"onUpdate:modelValue":Se=>y.state[k].upperBound=Se,parse:Se=>Y(w,Se),label:"Upper bound"},null,8,["modelValue","onUpdate:modelValue","parse"]),r.createVNode(r.unref(vs),{modelValue:y.state[k].includeUpperBound,"onUpdate:modelValue":Se=>y.state[k].includeUpperBound=Se,label:"Include upper bound"},null,8,["modelValue","onUpdate:modelValue"])],64)):r.createCommentVNode("",!0),((xr=y.state[k])==null?void 0:xr.type)==="string_equals"||((Wn=y.state[k])==null?void 0:Wn.type)==="string_notEquals"||((Yr=y.state[k])==null?void 0:Yr.type)==="string_contains"||((Fs=y.state[k])==null?void 0:Fs.type)==="string_doesNotContain"?(r.openBlock(),r.createBlock(r.unref(hr),{key:3,modelValue:y.state[k].reference,"onUpdate:modelValue":Se=>y.state[k].reference=Se,parse:Se=>H(w,Se),label:"Reference value"},null,8,["modelValue","onUpdate:modelValue","parse"])):r.createCommentVNode("",!0),((kr=y.state[k])==null?void 0:kr.type)==="string_matches"||((Sr=y.state[k])==null?void 0:Sr.type)==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(hr),{key:4,modelValue:y.state[k].reference,"onUpdate:modelValue":Se=>y.state[k].reference=Se,parse:D,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"])):r.createCommentVNode("",!0),((Rs=y.state[k])==null?void 0:Rs.type)==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:5},[r.createVNode(r.unref(hr),{modelValue:y.state[k].reference,"onUpdate:modelValue":Se=>y.state[k].reference=Se,parse:Se=>H(w,Se),label:"Reference value"},null,8,["modelValue","onUpdate:modelValue","parse"]),r.createVNode(r.unref(sp),{modelValue:y.state[k].maxEdits,"onUpdate:modelValue":Se=>y.state[k].maxEdits=Se,max:5,breakpoints:"",label:"Maximum nuber of substitutions and indels"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(vs),{modelValue:y.state[k].substitutionsOnly,"onUpdate:modelValue":Se=>y.state[k].substitutionsOnly=Se,label:"Substitutions only"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(mi),{modelValue:y.state[k].wildcard,"onUpdate:modelValue":Se=>y.state[k].wildcard=Se,options:K(w,y.state[k].reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","onUpdate:modelValue","options"])],64)):r.createCommentVNode("",!0)],2)])):r.createCommentVNode("",!0)])}),128)),G.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",bT,"No filters applicable"))],64))}}),[["__scopeId","data-v-6cb52299"]]),kT={key:1,class:"alert-error"},ST={key:2},ET=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),o=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),s=r.computed(()=>n.value===void 0&&o.value===void 0);return(l,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),o.value?(r.openBlock(),r.createElementBlock("div",kT,r.toDisplayString(o.value),1)):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createElementBlock("div",ST,"Unresolved")):r.createCommentVNode("",!0)]))}}),TT={style:{height:"100%"}},BT=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),o=r.computed(()=>e.params.value);function s(d){e.params.setValue(d)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(o.value):void 0);return(d,u)=>(r.openBlock(),r.createElementBlock("div",TT,[r.createVNode(r.unref(op),{"show-filename-only":"",clearable:"","cell-style":"","file-dialog-title":"Select any file",placeholder:`Choose file ${n.value?n.value[0]:""}`,extensions:n.value,"model-value":o.value,progress:l.value,"onUpdate:modelValue":s},null,8,["placeholder","extensions","model-value","progress"])]))}}),AT={class:"pl-ag-grid-open-cell d-flex"},NT={class:"pl-ag-grid-open-cell__value"},VT=r.defineComponent({__name:"PlAgTextAndButtonCell",props:{params:{}},setup(t){const e=t;console.log(e);function n(){if(e.params.invokeRowsOnDoubleClick){const o=e.params.api,s={rowPinned:e.params.node.rowPinned,api:o,rowIndex:e.params.node.rowIndex,context:o,type:"rowDoubleClicked",node:e.params.node,data:e.params.data,event:null};o.dispatchEvent(s)}else e.params.onClick&&e.params.onClick(e.params)}return(o,s)=>(r.openBlock(),r.createElementBlock("div",AT,[r.createElementVNode("div",NT,r.toDisplayString(o.params.value),1),r.createElementVNode("div",{class:"pl-ag-grid-open-cell__activator text-caps11 align-center",onClick:r.withModifiers(n,["stop"])},[r.createVNode(r.unref(ur),{name:o.params.icon??"maximize"},null,8,["name"]),r.createTextVNode(" "+r.toDisplayString(o.params.btnLabel??"Open"),1)])]))}}),Vs=new Map;function PT(t,e){const n=r.getCurrentScope()??r.effectScope(),o=n.run(()=>(r.onScopeDispose(()=>{Vs.delete(t)}),r.reactive(e())));return o[Symbol.dispose]=()=>{n.stop()},o}function DT(t){const e=Symbol();return()=>(Vs.has(e)||Vs.set(e,PT(e,t)),Vs.get(e))}function FT(t){return r.computed(()=>{try{return gd(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function gp(t,e,n){const o=r.ref(0),s=r.reactive({loading:r.computed(()=>o.value>0),loadingRef:o,value:void 0,error:void 0}),l=hm(e);return r.watch(t,async d=>{s.error=void 0,o.value++,l(d).then(u=>{u.ok&&(s.value=u.value)}).catch(u=>{s.value=void 0,s.error=u}).finally(()=>{o.value--})},Object.assign({immediate:!0,deep:!0},n??{})),s}const ko=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,yp=new Set,Vl=typeof process=="object"&&process?process:{},_p=(t,e,n,o)=>{typeof Vl.emitWarning=="function"?Vl.emitWarning(t,e,n,o):console.error(`[${n}] ${e}: ${t}`)};let Ps=globalThis.AbortController,vp=globalThis.AbortSignal;if(typeof Ps>"u"){vp=class{constructor(){Ue(this,"onabort");Ue(this,"_onabort",[]);Ue(this,"reason");Ue(this,"aborted",!1)}addEventListener(o,s){this._onabort.push(s)}},Ps=class{constructor(){Ue(this,"signal",new vp);e()}abort(o){var s,l;if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(const d of this.signal._onabort)d(o);(l=(s=this.signal).onabort)==null||l.call(s,o)}}};let t=((wp=Vl.env)==null?void 0:wp.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,_p("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 RT=t=>!yp.has(t),wr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Cp=t=>wr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ds:null:null;class Ds extends Array{constructor(e){super(e),this.fill(0)}}const Hr=class Hr{constructor(e,n){Ue(this,"heap");Ue(this,"length");if(!b(Hr,So))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=Cp(e);if(!n)return[];me(Hr,So,!0);const o=new Hr(e,n);return me(Hr,So,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};So=new WeakMap,ze(Hr,So,!1);let Pl=Hr;const Rl=class Rl{constructor(e){ze(this,re);ze(this,un);ze(this,Lt);ze(this,pn);ze(this,hn);ze(this,Eo);ze(this,To);Ue(this,"ttl");Ue(this,"ttlResolution");Ue(this,"ttlAutopurge");Ue(this,"updateAgeOnGet");Ue(this,"updateAgeOnHas");Ue(this,"allowStale");Ue(this,"noDisposeOnSet");Ue(this,"noUpdateTTL");Ue(this,"maxEntrySize");Ue(this,"sizeCalculation");Ue(this,"noDeleteOnFetchRejection");Ue(this,"noDeleteOnStaleGet");Ue(this,"allowStaleOnFetchAbort");Ue(this,"allowStaleOnFetchRejection");Ue(this,"ignoreFetchAbort");ze(this,ct);ze(this,fn);ze(this,at);ze(this,Ke);ze(this,xe);ze(this,Tt);ze(this,Gt);ze(this,wt);ze(this,ht);ze(this,mn);ze(this,ft);ze(this,gn);ze(this,yn);ze(this,zt);ze(this,_n);ze(this,br);ze(this,Bt);ze(this,jr,()=>{});ze(this,Un,()=>{});ze(this,Fi,()=>{});ze(this,Zt,()=>!1);ze(this,qr,e=>{});ze(this,Bo,(e,n,o)=>{});ze(this,Ri,(e,n,o,s)=>{if(o||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ue(this,bp,"LRUCache");const{max:n=0,ttl:o,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:d,updateAgeOnHas:u,allowStale:p,dispose:f,disposeAfter:m,noDisposeOnSet:y,noUpdateTTL:B,maxSize:T=0,maxEntrySize:N=0,sizeCalculation:M,fetchMethod:G,memoMethod:C,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:L,allowStaleOnFetchRejection:$,allowStaleOnFetchAbort:I,ignoreFetchAbort:Y}=e;if(n!==0&&!wr(n))throw new TypeError("max option must be a nonnegative integer");const H=n?Cp(n):Array;if(!H)throw new Error("invalid max value: "+n);if(me(this,un,n),me(this,Lt,T),this.maxEntrySize=N||b(this,Lt),this.sizeCalculation=M,this.sizeCalculation){if(!b(this,Lt)&&!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(me(this,To,C),G!==void 0&&typeof G!="function")throw new TypeError("fetchMethod must be a function if specified");if(me(this,Eo,G),me(this,br,!!G),me(this,at,new Map),me(this,Ke,new Array(n).fill(void 0)),me(this,xe,new Array(n).fill(void 0)),me(this,Tt,new H(n)),me(this,Gt,new H(n)),me(this,wt,0),me(this,ht,0),me(this,mn,Pl.create(n)),me(this,ct,0),me(this,fn,0),typeof f=="function"&&me(this,pn,f),typeof m=="function"?(me(this,hn,m),me(this,ft,[])):(me(this,hn,void 0),me(this,ft,void 0)),me(this,_n,!!b(this,pn)),me(this,Bt,!!b(this,hn)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!B,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!$,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!Y,this.maxEntrySize!==0){if(b(this,Lt)!==0&&!wr(b(this,Lt)))throw new TypeError("maxSize must be a positive integer if specified");if(!wr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");de(this,re,om).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!L,this.updateAgeOnGet=!!d,this.updateAgeOnHas=!!u,this.ttlResolution=wr(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=o||0,this.ttl){if(!wr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");de(this,re,od).call(this)}if(b(this,un)===0&&this.ttl===0&&b(this,Lt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!b(this,un)&&!b(this,Lt)){const D="LRU_CACHE_UNBOUNDED";RT(D)&&(yp.add(D),_p("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",D,Rl))}}static unsafeExposeInternals(e){return{starts:b(e,yn),ttls:b(e,zt),sizes:b(e,gn),keyMap:b(e,at),keyList:b(e,Ke),valList:b(e,xe),next:b(e,Tt),prev:b(e,Gt),get head(){return b(e,wt)},get tail(){return b(e,ht)},free:b(e,mn),isBackgroundFetch:n=>{var o;return de(o=e,re,Je).call(o,n)},backgroundFetch:(n,o,s,l)=>{var d;return de(d=e,re,Ta).call(d,n,o,s,l)},moveToTail:n=>{var o;return de(o=e,re,ns).call(o,n)},indexes:n=>{var o;return de(o=e,re,Rr).call(o,n)},rindexes:n=>{var o;return de(o=e,re,Mr).call(o,n)},isStale:n=>{var o;return b(o=e,Zt).call(o,n)}}}get max(){return b(this,un)}get maxSize(){return b(this,Lt)}get calculatedSize(){return b(this,fn)}get size(){return b(this,ct)}get fetchMethod(){return b(this,Eo)}get memoMethod(){return b(this,To)}get dispose(){return b(this,pn)}get disposeAfter(){return b(this,hn)}getRemainingTTL(e){return b(this,at).has(e)?1/0:0}*entries(){for(const e of de(this,re,Rr).call(this))b(this,xe)[e]!==void 0&&b(this,Ke)[e]!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield[b(this,Ke)[e],b(this,xe)[e]])}*rentries(){for(const e of de(this,re,Mr).call(this))b(this,xe)[e]!==void 0&&b(this,Ke)[e]!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield[b(this,Ke)[e],b(this,xe)[e]])}*keys(){for(const e of de(this,re,Rr).call(this)){const n=b(this,Ke)[e];n!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield n)}}*rkeys(){for(const e of de(this,re,Mr).call(this)){const n=b(this,Ke)[e];n!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield n)}}*values(){for(const e of de(this,re,Rr).call(this))b(this,xe)[e]!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield b(this,xe)[e])}*rvalues(){for(const e of de(this,re,Mr).call(this))b(this,xe)[e]!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield b(this,xe)[e])}[(xp=Symbol.iterator,bp=Symbol.toStringTag,xp)](){return this.entries()}find(e,n={}){for(const o of de(this,re,Rr).call(this)){const s=b(this,xe)[o],l=de(this,re,Je).call(this,s)?s.__staleWhileFetching:s;if(l!==void 0&&e(l,b(this,Ke)[o],this))return this.get(b(this,Ke)[o],n)}}forEach(e,n=this){for(const o of de(this,re,Rr).call(this)){const s=b(this,xe)[o],l=de(this,re,Je).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,b(this,Ke)[o],this)}}rforEach(e,n=this){for(const o of de(this,re,Mr).call(this)){const s=b(this,xe)[o],l=de(this,re,Je).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,b(this,Ke)[o],this)}}purgeStale(){let e=!1;for(const n of de(this,re,Mr).call(this,{allowStale:!0}))b(this,Zt).call(this,n)&&(de(this,re,Ir).call(this,b(this,Ke)[n],"expire"),e=!0);return e}info(e){const n=b(this,at).get(e);if(n===void 0)return;const o=b(this,xe)[n],s=de(this,re,Je).call(this,o)?o.__staleWhileFetching:o;if(s===void 0)return;const l={value:s};if(b(this,zt)&&b(this,yn)){const d=b(this,zt)[n],u=b(this,yn)[n];if(d&&u){const p=d-(ko.now()-u);l.ttl=p,l.start=Date.now()}}return b(this,gn)&&(l.size=b(this,gn)[n]),l}dump(){const e=[];for(const n of de(this,re,Rr).call(this,{allowStale:!0})){const o=b(this,Ke)[n],s=b(this,xe)[n],l=de(this,re,Je).call(this,s)?s.__staleWhileFetching:s;if(l===void 0||o===void 0)continue;const d={value:l};if(b(this,zt)&&b(this,yn)){d.ttl=b(this,zt)[n];const u=ko.now()-b(this,yn)[n];d.start=Math.floor(Date.now()-u)}b(this,gn)&&(d.size=b(this,gn)[n]),e.unshift([o,d])}return e}load(e){this.clear();for(const[n,o]of e){if(o.start){const s=Date.now()-o.start;o.start=ko.now()-s}this.set(n,o.value,o)}}set(e,n,o={}){var B,T,N,M,G;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}=o;let{noUpdateTTL:f=this.noUpdateTTL}=o;const m=b(this,Ri).call(this,e,n,o.size||0,u);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),de(this,re,Ir).call(this,e,"set"),this;let y=b(this,ct)===0?void 0:b(this,at).get(e);if(y===void 0)y=b(this,ct)===0?b(this,ht):b(this,mn).length!==0?b(this,mn).pop():b(this,ct)===b(this,un)?de(this,re,Ea).call(this,!1):b(this,ct),b(this,Ke)[y]=e,b(this,xe)[y]=n,b(this,at).set(e,y),b(this,Tt)[b(this,ht)]=y,b(this,Gt)[y]=b(this,ht),me(this,ht,y),Sa(this,ct)._++,b(this,Bo).call(this,y,m,p),p&&(p.set="add"),f=!1;else{de(this,re,ns).call(this,y);const C=b(this,xe)[y];if(n!==C){if(b(this,br)&&de(this,re,Je).call(this,C)){C.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:F}=C;F!==void 0&&!d&&(b(this,_n)&&((B=b(this,pn))==null||B.call(this,F,e,"set")),b(this,Bt)&&((T=b(this,ft))==null||T.push([F,e,"set"])))}else d||(b(this,_n)&&((N=b(this,pn))==null||N.call(this,C,e,"set")),b(this,Bt)&&((M=b(this,ft))==null||M.push([C,e,"set"])));if(b(this,qr).call(this,y),b(this,Bo).call(this,y,m,p),b(this,xe)[y]=n,p){p.set="replace";const F=C&&de(this,re,Je).call(this,C)?C.__staleWhileFetching:C;F!==void 0&&(p.oldValue=F)}}else p&&(p.set="update")}if(s!==0&&!b(this,zt)&&de(this,re,od).call(this),b(this,zt)&&(f||b(this,Fi).call(this,y,s,l),p&&b(this,Un).call(this,p,y)),!d&&b(this,Bt)&&b(this,ft)){const C=b(this,ft);let F;for(;F=C==null?void 0:C.shift();)(G=b(this,hn))==null||G.call(this,...F)}return this}pop(){var e;try{for(;b(this,ct);){const n=b(this,xe)[b(this,wt)];if(de(this,re,Ea).call(this,!0),de(this,re,Je).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(b(this,Bt)&&b(this,ft)){const n=b(this,ft);let o;for(;o=n==null?void 0:n.shift();)(e=b(this,hn))==null||e.call(this,...o)}}}has(e,n={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:s}=n,l=b(this,at).get(e);if(l!==void 0){const d=b(this,xe)[l];if(de(this,re,Je).call(this,d)&&d.__staleWhileFetching===void 0)return!1;if(b(this,Zt).call(this,l))s&&(s.has="stale",b(this,Un).call(this,s,l));else return o&&b(this,jr).call(this,l),s&&(s.has="hit",b(this,Un).call(this,s,l)),!0}else s&&(s.has="miss");return!1}peek(e,n={}){const{allowStale:o=this.allowStale}=n,s=b(this,at).get(e);if(s===void 0||!o&&b(this,Zt).call(this,s))return;const l=b(this,xe)[s];return de(this,re,Je).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:o=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:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:B=this.allowStaleOnFetchRejection,ignoreFetchAbort:T=this.ignoreFetchAbort,allowStaleOnFetchAbort:N=this.allowStaleOnFetchAbort,context:M,forceRefresh:G=!1,status:C,signal:F}=n;if(!b(this,br))return C&&(C.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:C});const L={allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:d,noDisposeOnSet:u,size:p,sizeCalculation:f,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:B,allowStaleOnFetchAbort:N,ignoreFetchAbort:T,status:C,signal:F};let $=b(this,at).get(e);if($===void 0){C&&(C.fetch="miss");const I=de(this,re,Ta).call(this,e,$,L,M);return I.__returned=I}else{const I=b(this,xe)[$];if(de(this,re,Je).call(this,I)){const U=o&&I.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",U&&(C.returnedStale=!0)),U?I.__staleWhileFetching:I.__returned=I}const Y=b(this,Zt).call(this,$);if(!G&&!Y)return C&&(C.fetch="hit"),de(this,re,ns).call(this,$),s&&b(this,jr).call(this,$),C&&b(this,Un).call(this,C,$),I;const H=de(this,re,Ta).call(this,e,$,L,M),K=H.__staleWhileFetching!==void 0&&o;return C&&(C.fetch=Y?"stale":"refresh",K&&Y&&(C.returnedStale=!0)),K?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,n={}){const o=await this.fetch(e,n);if(o===void 0)throw new Error("fetch() returned undefined");return o}memo(e,n={}){const o=b(this,To);if(!o)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=o(e,u,{options:d,context:s});return this.set(e,p,d),p}get(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:d}=n,u=b(this,at).get(e);if(u!==void 0){const p=b(this,xe)[u],f=de(this,re,Je).call(this,p);return d&&b(this,Un).call(this,d,u),b(this,Zt).call(this,u)?(d&&(d.get="stale"),f?(d&&o&&p.__staleWhileFetching!==void 0&&(d.returnedStale=!0),o?p.__staleWhileFetching:void 0):(l||de(this,re,Ir).call(this,e,"expire"),d&&o&&(d.returnedStale=!0),o?p:void 0)):(d&&(d.get="hit"),f?p.__staleWhileFetching:(de(this,re,ns).call(this,u),s&&b(this,jr).call(this,u),p))}else d&&(d.get="miss")}delete(e){return de(this,re,Ir).call(this,e,"delete")}clear(){return de(this,re,ad).call(this,"delete")}};un=new WeakMap,Lt=new WeakMap,pn=new WeakMap,hn=new WeakMap,Eo=new WeakMap,To=new WeakMap,ct=new WeakMap,fn=new WeakMap,at=new WeakMap,Ke=new WeakMap,xe=new WeakMap,Tt=new WeakMap,Gt=new WeakMap,wt=new WeakMap,ht=new WeakMap,mn=new WeakMap,ft=new WeakMap,gn=new WeakMap,yn=new WeakMap,zt=new WeakMap,_n=new WeakMap,br=new WeakMap,Bt=new WeakMap,re=new WeakSet,od=function(){const e=new Ds(b(this,un)),n=new Ds(b(this,un));me(this,zt,e),me(this,yn,n),me(this,Fi,(l,d,u=ko.now())=>{if(n[l]=d!==0?u:0,e[l]=d,d!==0&&this.ttlAutopurge){const p=setTimeout(()=>{b(this,Zt).call(this,l)&&de(this,re,Ir).call(this,b(this,Ke)[l],"expire")},d+1);p.unref&&p.unref()}}),me(this,jr,l=>{n[l]=e[l]!==0?ko.now():0}),me(this,Un,(l,d)=>{if(e[d]){const u=e[d],p=n[d];if(!u||!p)return;l.ttl=u,l.start=p,l.now=o||s();const f=l.now-p;l.remainingTTL=u-f}});let o=0;const s=()=>{const l=ko.now();if(this.ttlResolution>0){o=l;const d=setTimeout(()=>o=0,this.ttlResolution);d.unref&&d.unref()}return l};this.getRemainingTTL=l=>{const d=b(this,at).get(l);if(d===void 0)return 0;const u=e[d],p=n[d];if(!u||!p)return 1/0;const f=(o||s())-p;return u-f},me(this,Zt,l=>{const d=n[l],u=e[l];return!!u&&!!d&&(o||s())-d>u})},jr=new WeakMap,Un=new WeakMap,Fi=new WeakMap,Zt=new WeakMap,om=function(){const e=new Ds(b(this,un));me(this,fn,0),me(this,gn,e),me(this,qr,n=>{me(this,fn,b(this,fn)-e[n]),e[n]=0}),me(this,Ri,(n,o,s,l)=>{if(de(this,re,Je).call(this,o))return 0;if(!wr(s))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(s=l(o,n),!wr(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),me(this,Bo,(n,o,s)=>{if(e[n]=o,b(this,Lt)){const l=b(this,Lt)-e[n];for(;b(this,fn)>l;)de(this,re,Ea).call(this,!0)}me(this,fn,b(this,fn)+e[n]),s&&(s.entrySize=o,s.totalCalculatedSize=b(this,fn))})},qr=new WeakMap,Bo=new WeakMap,Ri=new WeakMap,Rr=function*({allowStale:e=this.allowStale}={}){if(b(this,ct))for(let n=b(this,ht);!(!de(this,re,id).call(this,n)||((e||!b(this,Zt).call(this,n))&&(yield n),n===b(this,wt)));)n=b(this,Gt)[n]},Mr=function*({allowStale:e=this.allowStale}={}){if(b(this,ct))for(let n=b(this,wt);!(!de(this,re,id).call(this,n)||((e||!b(this,Zt).call(this,n))&&(yield n),n===b(this,ht)));)n=b(this,Tt)[n]},id=function(e){return e!==void 0&&b(this,at).get(b(this,Ke)[e])===e},Ea=function(e){var l,d;const n=b(this,wt),o=b(this,Ke)[n],s=b(this,xe)[n];return b(this,br)&&de(this,re,Je).call(this,s)?s.__abortController.abort(new Error("evicted")):(b(this,_n)||b(this,Bt))&&(b(this,_n)&&((l=b(this,pn))==null||l.call(this,s,o,"evict")),b(this,Bt)&&((d=b(this,ft))==null||d.push([s,o,"evict"]))),b(this,qr).call(this,n),e&&(b(this,Ke)[n]=void 0,b(this,xe)[n]=void 0,b(this,mn).push(n)),b(this,ct)===1?(me(this,wt,me(this,ht,0)),b(this,mn).length=0):me(this,wt,b(this,Tt)[n]),b(this,at).delete(o),Sa(this,ct)._--,n},Ta=function(e,n,o,s){const l=n===void 0?void 0:b(this,xe)[n];if(de(this,re,Je).call(this,l))return l;const d=new Ps,{signal:u}=o;u==null||u.addEventListener("abort",()=>d.abort(u.reason),{signal:d.signal});const p={signal:d.signal,options:o,context:s},f=(M,G=!1)=>{const{aborted:C}=d.signal,F=o.ignoreFetchAbort&&M!==void 0;if(o.status&&(C&&!G?(o.status.fetchAborted=!0,o.status.fetchError=d.signal.reason,F&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),C&&!F&&!G)return y(d.signal.reason);const L=T;return b(this,xe)[n]===T&&(M===void 0?L.__staleWhileFetching?b(this,xe)[n]=L.__staleWhileFetching:de(this,re,Ir).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,M,p.options))),M},m=M=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=M),y(M)),y=M=>{const{aborted:G}=d.signal,C=G&&o.allowStaleOnFetchAbort,F=C||o.allowStaleOnFetchRejection,L=F||o.noDeleteOnFetchRejection,$=T;if(b(this,xe)[n]===T&&(!L||$.__staleWhileFetching===void 0?de(this,re,Ir).call(this,e,"fetch"):C||(b(this,xe)[n]=$.__staleWhileFetching)),F)return o.status&&$.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),$.__staleWhileFetching;if($.__returned===$)throw M},B=(M,G)=>{var F;const C=(F=b(this,Eo))==null?void 0:F.call(this,e,l,p);C&&C instanceof Promise&&C.then(L=>M(L===void 0?void 0:L),G),d.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(M(void 0),o.allowStaleOnFetchAbort&&(M=L=>f(L,!0)))})};o.status&&(o.status.fetchDispatched=!0);const T=new Promise(B).then(f,m),N=Object.assign(T,{__abortController:d,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,N,{...p.options,status:void 0}),n=b(this,at).get(e)):b(this,xe)[n]=N,N},Je=function(e){if(!b(this,br))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Ps},sd=function(e,n){b(this,Gt)[n]=e,b(this,Tt)[e]=n},ns=function(e){e!==b(this,ht)&&(e===b(this,wt)?me(this,wt,b(this,Tt)[e]):de(this,re,sd).call(this,b(this,Gt)[e],b(this,Tt)[e]),de(this,re,sd).call(this,b(this,ht),e),me(this,ht,e))},Ir=function(e,n){var s,l,d,u;let o=!1;if(b(this,ct)!==0){const p=b(this,at).get(e);if(p!==void 0)if(o=!0,b(this,ct)===1)de(this,re,ad).call(this,n);else{b(this,qr).call(this,p);const f=b(this,xe)[p];if(de(this,re,Je).call(this,f)?f.__abortController.abort(new Error("deleted")):(b(this,_n)||b(this,Bt))&&(b(this,_n)&&((s=b(this,pn))==null||s.call(this,f,e,n)),b(this,Bt)&&((l=b(this,ft))==null||l.push([f,e,n]))),b(this,at).delete(e),b(this,Ke)[p]=void 0,b(this,xe)[p]=void 0,p===b(this,ht))me(this,ht,b(this,Gt)[p]);else if(p===b(this,wt))me(this,wt,b(this,Tt)[p]);else{const m=b(this,Gt)[p];b(this,Tt)[m]=b(this,Tt)[p];const y=b(this,Tt)[p];b(this,Gt)[y]=b(this,Gt)[p]}Sa(this,ct)._--,b(this,mn).push(p)}}if(b(this,Bt)&&((d=b(this,ft))!=null&&d.length)){const p=b(this,ft);let f;for(;f=p==null?void 0:p.shift();)(u=b(this,hn))==null||u.call(this,...f)}return o},ad=function(e){var n,o,s;for(const l of de(this,re,Mr).call(this,{allowStale:!0})){const d=b(this,xe)[l];if(de(this,re,Je).call(this,d))d.__abortController.abort(new Error("deleted"));else{const u=b(this,Ke)[l];b(this,_n)&&((n=b(this,pn))==null||n.call(this,d,u,e)),b(this,Bt)&&((o=b(this,ft))==null||o.push([d,u,e]))}}if(b(this,at).clear(),b(this,xe).fill(void 0),b(this,Ke).fill(void 0),b(this,zt)&&b(this,yn)&&(b(this,zt).fill(0),b(this,yn).fill(0)),b(this,gn)&&b(this,gn).fill(0),me(this,wt,0),me(this,ht,0),b(this,mn).length=0,me(this,fn,0),me(this,ct,0),b(this,Bt)&&b(this,ft)){const l=b(this,ft);let d;for(;d=l==null?void 0:l.shift();)(s=b(this,hn))==null||s.call(this,...d)}};let Dl=Rl;const MT={cacheSize:15e6};class IT{constructor(e){Ue(this,"_str");Ue(this,"_rawJson");Ue(this,"_zodSchema");Ue(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 Kr=class Kr{constructor(e){Ue(this,"fileDataCache");Ue(this,"fileDataRefs",new Map);const n={...MT,...e??{}};this.fileDataCache=new Dl({maxSize:n.cacheSize,fetchMethod:async o=>new IT(await Ag().blobDriver.getContent(o)),sizeCalculation:o=>o.bytes.length,dispose:(o,s)=>{this.fileDataRefs.delete(s)}})}getDataRef(e){const n=this.fileDataRefs.get(e);if(n!==void 0)return n;const o=r.shallowRef();return this.fileDataRefs.set(e,o),(async()=>{try{const s=await this.fileDataCache.fetch(e);o.value=s}catch(s){console.error(s)}})(),o}getContentBytes(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n.value)==null?void 0:o.bytes})}getContentString(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n==null?void 0:n.value)==null?void 0:o.str})}getContentJson(e,n){if(e===void 0)return;const o=this.getDataRef(e);return r.computed(()=>{var s,l;return n===void 0?(s=o==null?void 0:o.value)==null?void 0:s.rawJson:(l=o==null?void 0:o.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return Kr.globalInstance.getContentBytes(e)}static getContentString(e){return Kr.globalInstance.getContentString(e)}static getContentJson(e,n){return Kr.globalInstance.getContentJson(e,n)}};Ue(Kr,"globalInstance",new Kr);let Fl=Kr;R.AgGridTheme=tu,R.BlockLayout=eT,R.ContextProvider=Ok,R.DataTable=Uv,R.DemoData=LE,R.DropdownListItem=go,R.LongText=Cl,R.MultiError=Na,R.PlAccordion=Yb,R.PlAccordionSection=ix,R.PlAgCellFile=BT,R.PlAgDataTable=CT,R.PlAgOverlayLoading=cp,R.PlAgOverlayNoRows=dp,R.PlAgTextAndButtonCell=VT,R.PlAlert=CC,R.PlBlockPage=sC,R.PlBtnAccent=OC,R.PlBtnDanger=GC,R.PlBtnGhost=fl,R.PlBtnGroup=l0,R.PlBtnLink=UC,R.PlBtnPrimary=pl,R.PlBtnSecondary=hl,R.PlBtnSplit=DC,R.PlCheckbox=Ou,R.PlCheckboxGroup=lb,R.PlChip=wl,R.PlContainer=lC,R.PlDialogModal=xl,R.PlDropdown=mi,R.PlDropdownLegacy=Nw,R.PlDropdownLine=Iu,R.PlDropdownMulti=rb,R.PlDropdownRef=iw,R.PlFileDialog=Zu,R.PlFileInput=op,R.PlGrid=fC,R.PlIcon16=_s,R.PlIcon24=Du,R.PlLogView=Gu,R.PlMaskIcon16=ur,R.PlMaskIcon24=Zn,R.PlNotificationAlert=ip,R.PlNumberField=Zw,R.PlProgressBar=Rw,R.PlRow=dC,R.PlSectionSeparator=zu,R.PlSlideModal=bb,R.PlSpacer=Eu,R.PlTableFilters=xT,R.PlTabs=Ub,R.PlTextArea=L0,R.PlTextField=hr,R.PlToggleSwitch=vs,R.PlTooltip=St,R.ReactiveFileContent=Fl,R.Scrollable=BS,R.Slider=sp,R.SliderRange=kS,R.SliderRangeTriple=pS,R.ThemeSwitcher=eC,R.UnresolvedError=Aa,R.ValueOrErrorsComponent=ET,R.activateAgGrid=eu,R.animate=Cu,R.animateInfinite=Kv,R.call=mu,R.computedResult=FT,R.createModel=Ma,R.debounce=wu,R.defineApp=w_,R.defineStore=DT,R.delay=gu,R.detectOutside=G0,R.ensureError=Da,R.eventListener=_l,R.formatZodError=Ra,R.getElementScrollPosition=Ru,R.identity=Pa,R.isDefined=_m,R.isElementVisible=Fu,R.isJsonEqual=Va,R.isZodError=Fa,R.listToOptions=Yv,R.makeEaseInOut=qv,R.makeEaseOut=vu,R.maskIcons16=IE,R.maskIcons24=OE,R.normalizeListOptions=dr,R.notEmpty=al,R.randomInt=_u,R.randomString=jv,R.requestTick=ll,R.scrollIntoView=fi,R.showContextMenu=ol,R.throttle=bu,R.timeout=yu,R.unwrapOptionalResult=ym,R.unwrapValueOrErrors=md,R.useClickOutside=ys,R.useDraggable=tS,R.useEventListener=rt,R.useFormState=Qk,R.useHover=hu,R.useInterval=Xk,R.useLabelNotch=zn,R.useLocalStorage=xu,R.useMouse=pu,R.useMouseCapture=cr,R.usePosition=yo,R.useQuery=eS,R.useResizeObserver=ap,R.useScroll=Kk,R.useSdkPlugin=Qa,R.useSortable=Jk,R.useTheme=Su,R.useWatchFetch=gp,R.wrapOptionalResult=gd,R.wrapValueOrErrors=gm,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|