@platforma-sdk/ui-vue 1.15.0 → 1.15.4
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 +15 -0
- package/dist/lib.js +3 -2
- package/dist/lib.umd.cjs +2 -2
- package/dist/src/components/PlAgDataTable/PlAgDataTable.vue.d.ts.map +1 -1
- package/dist/src/components/PlAgDataTable/sources/row-number.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/PlAgDataTable/PlAgDataTable.vue +6 -0
- package/src/components/PlAgDataTable/sources/row-number.ts +1 -0
package/dist/lib.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(F,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):(F=typeof globalThis<"u"?globalThis:F||self,r(F.SdkVueLib={},F.Vue,F.core$1,F.core,F.clientSideRowModel,F.infiniteRowModel,F.serverSideRowModel,F.csvExport,F.clipboard,F.rangeSelection,F.richSelect,F.menu,F.excelExport,F.theming,F.vue3))})(this,function(F,r,Me,T,ps,Vg,jd,Ag,Hd,qd,Bg,Pg,Rg,Kd,Dg){"use strict";var HM=Object.defineProperty;var Sg=F=>{throw TypeError(F)};var qM=(F,r,Me)=>r in F?HM(F,r,{enumerable:!0,configurable:!0,writable:!0,value:Me}):F[r]=Me;var We=(F,r,Me)=>qM(F,typeof r!="symbol"?r+"":r,Me),$d=(F,r,Me)=>r.has(F)||Sg("Cannot "+Me);var E=(F,r,Me)=>($d(F,r,"read from private field"),Me?Me.call(F):r.get(F)),Ue=(F,r,Me)=>r.has(F)?Sg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(F):r.set(F,Me),ye=(F,r,Me,T)=>($d(F,r,"write to private field"),T?T.call(F,Me):r.set(F,Me),Me),ue=(F,r,Me)=>($d(F,r,"access private method"),Me);var Ha=(F,r,Me,T)=>({set _(ps){ye(F,r,ps,Me)},get _(){return E(F,r,T)}});var Wh,Bo,jh,Hh,vn,Ht,wn,bn,Po,Ro,ut,xn,dt,Je,Se,Rt,qt,Et,mt,kn,gt,En,Sn,Kt,Tn,Nr,Dt,re,zd,Jr,Jn,$i,Yt,Ng,Qr,Do,zi,Or,Mr,Ud,qa,Ka,et,Zd,us,Gr,Wd;function Ig(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}function Fg(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function Lg(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(Fg(65,91));return e}function Og(){return Lg(42)}const Yd=Array.isArray;function Mg(t){return t!==null&&typeof t=="object"}function Xd(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null}function Dn(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Dn(t[n]);return e}else if(Mg(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Dn(t[n])}),e}else return t}function Jd(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],i=e[n];Xd(o)&&Xd(i)||Yd(o)&&Yd(i)&&o.length===i.length?Jd(o,i):t[n]=i}),t}function Ya(t,e,n=!0){let o=0,i;return function(...l){i=()=>{t.apply(this,l),o=new Date().getTime()+e,i=null,n&&setTimeout(()=>{i&&i()},e)},new Date().getTime()>o&&i()}}function Gg(t){let e=0n,n;return async function(...o){const i=++e;try{await n}catch{}if(e!==i)return{ok:!1};const l=t(...o);return n=l,{ok:!0,value:await l}}}var Yo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $g=function t(e){if(typeof e=="number"&&isNaN(e))throw new Error("NaN is not allowed");if(typeof e=="number"&&!isFinite(e))throw new Error("Infinity is not allowed");return e===null||typeof e!="object"?JSON.stringify(e):e.toJSON instanceof Function?t(e.toJSON()):Array.isArray(e)?`[${e.reduce((i,l,c)=>`${i}${c===0?"":","}${t(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((o,i)=>{if(e[i]===void 0||typeof e[i]=="symbol")return o;const l=o.length===0?"":",";return`${o}${l}${t(i)}:${t(e[i])}`},"")}}`};const $r=Qd($g);class Xa extends Error{}class hs extends Error{constructor(e){super(e.join(`
|
|
2
2
|
`)),this.errors=e}toString(){return this.errors.join(`
|
|
3
|
-
`)}}function zg(t){return{ok:!0,value:t}}function eu(t){if(!t)throw new Xa;if(!t.ok)throw new hs(t.errors);return t.value}function tu(t){return{value:t,errors:void 0}}function Ug(t){if(t.errors)throw new hs(t.errors);if(!t.value)throw new Xa;return t.value}function Zg(t){return t!==void 0}function Ja(t,e){return $r(t)===$r(e)}const Qa=t=>t,el=t=>t instanceof Error?t:Error(String(t)),tl=t=>t.name==="ZodError",nl=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),o=Object.entries(n).map(([i,l])=>i+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function rl(t){const e=t.validate??Qa,{autoSave:n}=t,o=r.ref(),i=r.ref(),l=S=>{i.value={model:Dn(S)}};r.watch(()=>t.get(),S=>l(S),{immediate:!0});const c=()=>{var S;t.onSave(e(Dn((S=i.value)==null?void 0:S.model)))},d=()=>{l(t.get()),o.value=void 0},p=S=>{const M=el(S);tl(M)?o.value=Error(nl(M)):o.value=M},h=S=>{o.value=void 0;try{e(S),n&&c()}catch(M){p(M)}},m=r.computed({get:()=>{var S;return(S=i.value)==null?void 0:S.model},set(S){l(S),h(S)}});r.watch(i,(S,M)=>{S&&S===M&&h(S.model)},{deep:!0});const y=r.computed(()=>!o.value),b=r.computed(()=>!Ja(t.get(),r.unref(i))),w=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:b,error:o,errorString:w,save:c,revert:d,setError:p})}function Wg(t,e,n){const o=t.validate??Qa,{autoSave:i}=t,l=r.ref(),c=r.ref(),d=O=>{var v;if(n.deepPatchModel){const L=(v=c.value)==null?void 0:v.model,I=Object.assign(Dn(O),e??{});c.value={model:L?Jd(L,I):I,stage:Symbol()}}else c.value={model:Object.assign(Dn(O),e??{}),stage:Symbol()}};r.watch(()=>t.get(),O=>d(O),{immediate:!0});const p=()=>{var O;t.onSave(o(Dn((O=c.value)==null?void 0:O.model)))},h=()=>{d(t.get()),l.value=void 0},m=O=>{const v=el(O);tl(v)?l.value=Error(nl(v)):l.value=v},y=O=>{l.value=void 0;try{o(O),i&&p()}catch(v){m(v)}},b=r.computed({get:()=>{var O;return(O=c.value)==null?void 0:O.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:b.value.args,ui:b.value.ui}),()=>{var O;return(O=c.value)==null?void 0:O.stage}],([O,v],[L,I])=>{v===I&&y(O)},{deep:!0});const w=r.computed(()=>!l.value),S=r.computed(()=>{var L;const{args:O,ui:v}=((L=r.unref(c))==null?void 0:L.model)??{};return!Ja(t.get(),{args:O,ui:v})}),M=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:b,valid:w,isChanged:S,error:l,errorString:M,save:p,revert:h,setError:m})}const jg=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function Hg(t,e,n){const o=(v,...L)=>{n.debug&&console.log(`%c>>> %c${v}`,"color: orange; font-weight: bold","color: orange",...L)},l=Ya(e.setBlockArgs,100),c=Ya(e.setBlockUiState,100),d=Ya(e.setBlockArgsAndUiState,100),p=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async v=>{v.forEach(L=>{L.key==="args"&&(p.args=Object.freeze(L.value),o("args patch",p.args)),L.key==="ui"&&(p.ui=Object.freeze(L.value),o("ui patch",p.ui)),L.key==="outputs"&&(p.outputs=Object.freeze(L.value),o("outputs patch",p.outputs)),L.key==="navigationState"&&(p.navigationState=Object.freeze(L.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const h=()=>Dn(p.args),m=()=>Dn(p.ui),y=()=>Dn(p.navigationState),b={createArgsModel(v={}){return rl({get(){return v.transform?v.transform(p.args):p.args},validate:v.validate,autoSave:!0,onSave(L){l(L)}})},createUiModel(v={},L){return rl({get(){return v.transform?v.transform(p.ui):p.ui??L()},validate:v.validate,autoSave:!0,onSave(I){c(I)}})},useOutputs(...v){const L=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(L,{value:this.unwrapOutputs(...v),errors:void 0})}catch(I){Object.assign(L,{value:void 0,errors:[String(I)]})}},{immediate:!0,deep:!0}),L},unwrapOutputs(...v){const L=p.outputs,I=v.map(W=>[W,eu(L[W])]);return Object.fromEntries(I)},updateArgs(v){const L=h();return v(L),e.setBlockArgs(L)},updateUiState(v){const L=m();return e.setBlockUiState(v(L))},updateNavigationState(v){const L=y();return v(L),e.setNavigationState(L)},navigateTo(v){const L=y();return L.href=v,e.setNavigationState(L)}},w=r.computed(()=>{const v=Object.entries(p.outputs).map(([L,I])=>[L,I.ok&&I.value!==void 0?I.value:void 0]);return Object.fromEntries(v)}),S=r.computed(()=>{const v=Object.entries(p.outputs).map(([L,I])=>[L,I&&!I.ok?new hs(I.errors):void 0]);return Object.fromEntries(v)}),M={snapshot:p,queryParams:r.computed(()=>jg(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(v=>!(v!=null&&v.ok)))},O=Wg({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(v){d(v.args,v.ui)}},{outputs:w,outputErrors:S},n);return r.reactive(Object.assign(O,b,M))}var Ge;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const l={};for(const c of i)l[c]=c;return l},t.getValidEnumValues=i=>{const l=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(const d of l)c[d]=i[d];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(l){return i[l]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const l=[];for(const c in i)Object.prototype.hasOwnProperty.call(i,c)&&l.push(c);return l},t.find=(i,l)=>{for(const c of i)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,l=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})(Ge||(Ge={}));var ol;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ol||(ol={}));const le=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cr=t=>{switch(typeof t){case"undefined":return le.undefined;case"string":return le.string;case"number":return isNaN(t)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(t)?le.array:t===null?le.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?le.promise:typeof Map<"u"&&t instanceof Map?le.map:typeof Set<"u"&&t instanceof Set?le.set:typeof Date<"u"&&t instanceof Date?le.date:le.object;default:return le.unknown}},ee=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),qg=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Wt extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},i=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let d=o,p=0;for(;p<c.path.length;){const h=c.path[p];p===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(n(c))):d[h]=d[h]||{_errors:[]},d=d[h],p++}}};return i(this),o}static assert(e){if(!(e instanceof Wt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Wt.create=t=>new Wt(t);const uo=(t,e)=>{let n;switch(t.code){case ee.invalid_type:t.received===le.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ge.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ge.joinValues(t.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ge.joinValues(t.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Ge.joinValues(t.options)}, received '${t.received}'`;break;case ee.invalid_arguments:n="Invalid function arguments";break;case ee.invalid_return_type:n="Invalid function return type";break;case ee.invalid_date:n="Invalid date";break;case ee.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ge.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ee.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ee.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ee.custom:n="Invalid input";break;case ee.invalid_intersection_types:n="Intersection results could not be merged";break;case ee.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ee.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ge.assertNever(t)}return{message:n}};let nu=uo;function Kg(t){nu=t}function fs(){return nu}const ms=t=>{const{data:e,path:n,errorMaps:o,issueData:i}=t,l=[...n,...i.path||[]],c={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let d="";const p=o.filter(h=>!!h).slice().reverse();for(const h of p)d=h(c,{data:e,defaultError:d}).message;return{...i,path:l,message:d}},Yg=[];function ie(t,e){const n=fs(),o=ms({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===uo?void 0:uo].filter(i=>!!i)});t.common.issues.push(o)}class bt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const i of n){if(i.status==="aborted")return be;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const i of n){const l=await i.key,c=await i.value;o.push({key:l,value:c})}return bt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const i of n){const{key:l,value:c}=i;if(l.status==="aborted"||c.status==="aborted")return be;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const be=Object.freeze({status:"aborted"}),po=t=>({status:"dirty",value:t}),Nt=t=>({status:"valid",value:t}),il=t=>t.status==="aborted",sl=t=>t.status==="dirty",Xo=t=>t.status==="valid",Jo=t=>typeof Promise<"u"&&t instanceof Promise;function gs(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function ru(t,e,n,o,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var fe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(fe||(fe={}));var Qo,ei;class In{constructor(e,n,o,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ou=(t,e)=>{if(Xo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Wt(t.common.issues);return this._error=n,this._error}}};function Ve(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:i}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,d)=>{var p,h;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??d.defaultError}:typeof d.data>"u"?{message:(p=m??o)!==null&&p!==void 0?p:d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:(h=m??n)!==null&&h!==void 0?h:d.defaultError}},description:i}}class Pe{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return cr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new bt,ctx:{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Jo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const i={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},l=this._parseSync({data:e,path:i.path,parent:i});return ou(i,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},i=this._parse({data:e,path:o.path,parent:o}),l=await(Jo(i)?i:Promise.resolve(i));return ou(o,l)}refine(e,n){const o=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,l)=>{const c=e(i),d=()=>l.addIssue({code:ee.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,n){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof n=="function"?n(o,i):n),!1))}_refinement(e){return new fn({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ln.create(this,this._def)}nullable(){return hr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hn.create(this,this._def)}promise(){return go.create(this,this._def)}or(e){return oi.create([this,e],this._def)}and(e){return ii.create(this,e,this._def)}transform(e){return new fn({...Ve(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new di({...Ve(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new cl({typeName:ve.ZodBranded,type:this,...Ve(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ui({...Ve(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return pi.create(this,e)}readonly(){return hi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Xg=/^c[^\s-]{8,}$/i,Jg=/^[0-9a-z]+$/,Qg=/^[0-9A-HJKMNP-TV-Z]{26}$/,ey=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ty=/^[a-z0-9_-]{21}$/i,ny=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ry=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,oy="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let al;const iy=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,sy=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ay=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iu="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ly=new RegExp(`^${iu}$`);function su(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function cy(t){return new RegExp(`^${su(t)}$`)}function au(t){let e=`${iu}T${su(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function dy(t,e){return!!((e==="v4"||!e)&&iy.test(t)||(e==="v6"||!e)&&sy.test(t))}class pn extends Pe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==le.string){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.string,received:l.parsedType}),be}const o=new bt;let i;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="max")e.data.length>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,d=e.data.length<l.value;(c||d)&&(i=this._getOrReturnCtx(e,i),c?ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")ry.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"email",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")al||(al=new RegExp(oy,"u")),al.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"emoji",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")ey.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"uuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")ty.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"nanoid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")Xg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")Jg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid2",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")Qg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ulid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ie(i,{validation:"url",code:ee.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"regex",code:ee.invalid_string,message:l.message}),o.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?au(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?ly.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?cy(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?ny.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"duration",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?dy(e.data,l.version)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ip",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?ay.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"base64",code:ee.invalid_string,message:l.message}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(i=>e.test(i),{validation:n,code:ee.invalid_string,...fe.errToObj(o)})}_addCheck(e){return new pn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...fe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...fe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...fe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...fe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...fe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...fe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...fe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...fe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...fe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...fe.errToObj(e)})}datetime(e){var n,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...fe.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...fe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...fe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...fe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...fe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...fe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...fe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...fe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...fe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...fe.errToObj(n)})}nonempty(e){return this.min(1,fe.errToObj(e))}trim(){return new pn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new pn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new pn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}pn.create=t=>{var e;return new pn({checks:[],typeName:ve.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};function uy(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=n>o?n:o,l=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return l%c/Math.pow(10,i)}class dr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==le.number){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.number,received:l.parsedType}),be}let o;const i=new bt;for(const l of this._def.checks)l.kind==="int"?Ge.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_type,expected:"integer",received:"float",message:l.message}),i.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="multipleOf"?uy(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_finite,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,o,i){return new dr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new dr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:fe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:fe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ge.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}dr.create=t=>new dr({checks:[],typeName:ve.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class ur extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==le.bigint){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.bigint,received:l.parsedType}),be}let o;const i=new bt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,o,i){return new ur({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new ur({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ur.create=t=>{var e;return new ur({checks:[],typeName:ve.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};class ti extends Pe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==le.boolean){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.boolean,received:o.parsedType}),be}return Nt(e.data)}}ti.create=t=>new ti({typeName:ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class zr extends Pe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==le.date){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.date,received:l.parsedType}),be}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_date}),be}const o=new bt;let i;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new zr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:fe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:fe.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}zr.create=t=>new zr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ve.ZodDate,...Ve(t)});class ys extends Pe{_parse(e){if(this._getType(e)!==le.symbol){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.symbol,received:o.parsedType}),be}return Nt(e.data)}}ys.create=t=>new ys({typeName:ve.ZodSymbol,...Ve(t)});class ni extends Pe{_parse(e){if(this._getType(e)!==le.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.undefined,received:o.parsedType}),be}return Nt(e.data)}}ni.create=t=>new ni({typeName:ve.ZodUndefined,...Ve(t)});class ri extends Pe{_parse(e){if(this._getType(e)!==le.null){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.null,received:o.parsedType}),be}return Nt(e.data)}}ri.create=t=>new ri({typeName:ve.ZodNull,...Ve(t)});class ho extends Pe{constructor(){super(...arguments),this._any=!0}_parse(e){return Nt(e.data)}}ho.create=t=>new ho({typeName:ve.ZodAny,...Ve(t)});class Ur extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Nt(e.data)}}Ur.create=t=>new Ur({typeName:ve.ZodUnknown,...Ve(t)});class qn extends Pe{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:le.never,received:n.parsedType}),be}}qn.create=t=>new qn({typeName:ve.ZodNever,...Ve(t)});class _s extends Pe{_parse(e){if(this._getType(e)!==le.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.void,received:o.parsedType}),be}return Nt(e.data)}}_s.create=t=>new _s({typeName:ve.ZodVoid,...Ve(t)});class hn extends Pe{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==le.array)return ie(n,{code:ee.invalid_type,expected:le.array,received:n.parsedType}),be;if(i.exactLength!==null){const c=n.data.length>i.exactLength.value,d=n.data.length<i.exactLength.value;(c||d)&&(ie(n,{code:c?ee.too_big:ee.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ie(n,{code:ee.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ie(n,{code:ee.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>i.type._parseAsync(new In(n,c,n.path,d)))).then(c=>bt.mergeArray(o,c));const l=[...n.data].map((c,d)=>i.type._parseSync(new In(n,c,n.path,d)));return bt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new hn({...this._def,minLength:{value:e,message:fe.toString(n)}})}max(e,n){return new hn({...this._def,maxLength:{value:e,message:fe.toString(n)}})}length(e,n){return new hn({...this._def,exactLength:{value:e,message:fe.toString(n)}})}nonempty(e){return this.min(1,e)}}hn.create=(t,e)=>new hn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Ve(e)});function fo(t){if(t instanceof nt){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=Ln.create(fo(o))}return new nt({...t._def,shape:()=>e})}else return t instanceof hn?new hn({...t._def,type:fo(t.element)}):t instanceof Ln?Ln.create(fo(t.unwrap())):t instanceof hr?hr.create(fo(t.unwrap())):t instanceof Fn?Fn.create(t.items.map(e=>fo(e))):t}class nt extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ge.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==le.object){const h=this._getOrReturnCtx(e);return ie(h,{code:ee.invalid_type,expected:le.object,received:h.parsedType}),be}const{status:o,ctx:i}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof qn&&this._def.unknownKeys==="strip"))for(const h in i.data)c.includes(h)||d.push(h);const p=[];for(const h of c){const m=l[h],y=i.data[h];p.push({key:{status:"valid",value:h},value:m._parse(new In(i,y,i.path,h)),alwaysSet:h in i.data})}if(this._def.catchall instanceof qn){const h=this._def.unknownKeys;if(h==="passthrough")for(const m of d)p.push({key:{status:"valid",value:m},value:{status:"valid",value:i.data[m]}});else if(h==="strict")d.length>0&&(ie(i,{code:ee.unrecognized_keys,keys:d}),o.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const m of d){const y=i.data[m];p.push({key:{status:"valid",value:m},value:h._parse(new In(i,y,i.path,m)),alwaysSet:m in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const h=[];for(const m of p){const y=await m.key,b=await m.value;h.push({key:y,value:b,alwaysSet:m.alwaysSet})}return h}).then(h=>bt.mergeObjectSync(o,h)):bt.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return fe.errToObj,new nt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var i,l,c,d;const p=(c=(l=(i=this._def).errorMap)===null||l===void 0?void 0:l.call(i,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(d=fe.errToObj(e).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}strip(){return new nt({...this._def,unknownKeys:"strip"})}passthrough(){return new nt({...this._def,unknownKeys:"passthrough"})}extend(e){return new nt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new nt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ve.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new nt({...this._def,catchall:e})}pick(e){const n={};return Ge.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}omit(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}deepPartial(){return fo(this)}partial(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?n[o]=i:n[o]=i.optional()}),new nt({...this._def,shape:()=>n})}required(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof Ln;)l=l._def.innerType;n[o]=l}}),new nt({...this._def,shape:()=>n})}keyof(){return lu(Ge.objectKeys(this.shape))}}nt.create=(t,e)=>new nt({shape:()=>t,unknownKeys:"strip",catchall:qn.create(),typeName:ve.ZodObject,...Ve(e)}),nt.strictCreate=(t,e)=>new nt({shape:()=>t,unknownKeys:"strict",catchall:qn.create(),typeName:ve.ZodObject,...Ve(e)}),nt.lazycreate=(t,e)=>new nt({shape:t,unknownKeys:"strip",catchall:qn.create(),typeName:ve.ZodObject,...Ve(e)});class oi extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function i(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new Wt(d.ctx.common.issues));return ie(n,{code:ee.invalid_union,unionErrors:c}),be}if(n.common.async)return Promise.all(o.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(i);{let l;const c=[];for(const p of o){const h={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:h});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(p=>new Wt(p));return ie(n,{code:ee.invalid_union,unionErrors:d}),be}}get options(){return this._def.options}}oi.create=(t,e)=>new oi({options:t,typeName:ve.ZodUnion,...Ve(e)});const Kn=t=>t instanceof ai?Kn(t.schema):t instanceof fn?Kn(t.innerType()):t instanceof li?[t.value]:t instanceof pr?t.options:t instanceof ci?Ge.objectValues(t.enum):t instanceof di?Kn(t._def.innerType):t instanceof ni?[void 0]:t instanceof ri?[null]:t instanceof Ln?[void 0,...Kn(t.unwrap())]:t instanceof hr?[null,...Kn(t.unwrap())]:t instanceof cl||t instanceof hi?Kn(t.unwrap()):t instanceof ui?Kn(t._def.innerType):[];class Cs extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.object)return ie(n,{code:ee.invalid_type,expected:le.object,received:n.parsedType}),be;const o=this.discriminator,i=n.data[o],l=this.optionsMap.get(i);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const i=new Map;for(const l of n){const c=Kn(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,l)}}return new Cs({typeName:ve.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ve(o)})}}function ll(t,e){const n=cr(t),o=cr(e);if(t===e)return{valid:!0,data:t};if(n===le.object&&o===le.object){const i=Ge.objectKeys(e),l=Ge.objectKeys(t).filter(d=>i.indexOf(d)!==-1),c={...t,...e};for(const d of l){const p=ll(t[d],e[d]);if(!p.valid)return{valid:!1};c[d]=p.data}return{valid:!0,data:c}}else if(n===le.array&&o===le.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<t.length;l++){const c=t[l],d=e[l],p=ll(c,d);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return n===le.date&&o===le.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ii extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=(l,c)=>{if(il(l)||il(c))return be;const d=ll(l.value,c.value);return d.valid?((sl(l)||sl(c))&&n.dirty(),{status:n.value,value:d.data}):(ie(o,{code:ee.invalid_intersection_types}),be)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,c])=>i(l,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}ii.create=(t,e,n)=>new ii({left:t,right:e,typeName:ve.ZodIntersection,...Ve(n)});class Fn extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.array)return ie(o,{code:ee.invalid_type,expected:le.array,received:o.parsedType}),be;if(o.data.length<this._def.items.length)return ie(o,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((c,d)=>{const p=this._def.items[d]||this._def.rest;return p?p._parse(new In(o,c,o.path,d)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>bt.mergeArray(n,c)):bt.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Fn({...this._def,rest:e})}}Fn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fn({items:t,typeName:ve.ZodTuple,rest:null,...Ve(e)})};class si extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.object)return ie(o,{code:ee.invalid_type,expected:le.object,received:o.parsedType}),be;const i=[],l=this._def.keyType,c=this._def.valueType;for(const d in o.data)i.push({key:l._parse(new In(o,d,o.path,d)),value:c._parse(new In(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?bt.mergeObjectAsync(n,i):bt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Pe?new si({keyType:e,valueType:n,typeName:ve.ZodRecord,...Ve(o)}):new si({keyType:pn.create(),valueType:e,typeName:ve.ZodRecord,...Ve(n)})}}class vs extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.map)return ie(o,{code:ee.invalid_type,expected:le.map,received:o.parsedType}),be;const i=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([d,p],h)=>({key:i._parse(new In(o,d,o.path,[h,"key"])),value:l._parse(new In(o,p,o.path,[h,"value"]))}));if(o.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of c){const h=await p.key,m=await p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const p of c){const h=p.key,m=p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}}}}vs.create=(t,e,n)=>new vs({valueType:e,keyType:t,typeName:ve.ZodMap,...Ve(n)});class Zr extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.set)return ie(o,{code:ee.invalid_type,expected:le.set,received:o.parsedType}),be;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(ie(o,{code:ee.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(ie(o,{code:ee.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const h=new Set;for(const m of p){if(m.status==="aborted")return be;m.status==="dirty"&&n.dirty(),h.add(m.value)}return{status:n.value,value:h}}const d=[...o.data.values()].map((p,h)=>l._parse(new In(o,p,o.path,h)));return o.common.async?Promise.all(d).then(p=>c(p)):c(d)}min(e,n){return new Zr({...this._def,minSize:{value:e,message:fe.toString(n)}})}max(e,n){return new Zr({...this._def,maxSize:{value:e,message:fe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Zr.create=(t,e)=>new Zr({valueType:t,minSize:null,maxSize:null,typeName:ve.ZodSet,...Ve(e)});class mo extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.function)return ie(n,{code:ee.invalid_type,expected:le.function,received:n.parsedType}),be;function o(d,p){return ms({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fs(),uo].filter(h=>!!h),issueData:{code:ee.invalid_arguments,argumentsError:p}})}function i(d,p){return ms({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fs(),uo].filter(h=>!!h),issueData:{code:ee.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof go){const d=this;return Nt(async function(...p){const h=new Wt([]),m=await d._def.args.parseAsync(p,l).catch(w=>{throw h.addIssue(o(p,w)),h}),y=await Reflect.apply(c,this,m);return await d._def.returns._def.type.parseAsync(y,l).catch(w=>{throw h.addIssue(i(y,w)),h})})}else{const d=this;return Nt(function(...p){const h=d._def.args.safeParse(p,l);if(!h.success)throw new Wt([o(p,h.error)]);const m=Reflect.apply(c,this,h.data),y=d._def.returns.safeParse(m,l);if(!y.success)throw new Wt([i(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new mo({...this._def,args:Fn.create(e).rest(Ur.create())})}returns(e){return new mo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new mo({args:e||Fn.create([]).rest(Ur.create()),returns:n||Ur.create(),typeName:ve.ZodFunction,...Ve(o)})}}class ai extends Pe{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ai.create=(t,e)=>new ai({getter:t,typeName:ve.ZodLazy,...Ve(e)});class li extends Pe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:ee.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:e.data}}get value(){return this._def.value}}li.create=(t,e)=>new li({value:t,typeName:ve.ZodLiteral,...Ve(e)});function lu(t,e){return new pr({values:t,typeName:ve.ZodEnum,...Ve(e)})}class pr extends Pe{constructor(){super(...arguments),Qo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{expected:Ge.joinValues(o),received:n.parsedType,code:ee.invalid_type}),be}if(gs(this,Qo)||ru(this,Qo,new Set(this._def.values)),!gs(this,Qo).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{received:n.data,code:ee.invalid_enum_value,options:o}),be}return Nt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return pr.create(e,{...this._def,...n})}exclude(e,n=this._def){return pr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}Qo=new WeakMap,pr.create=lu;class ci extends Pe{constructor(){super(...arguments),ei.set(this,void 0)}_parse(e){const n=Ge.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==le.string&&o.parsedType!==le.number){const i=Ge.objectValues(n);return ie(o,{expected:Ge.joinValues(i),received:o.parsedType,code:ee.invalid_type}),be}if(gs(this,ei)||ru(this,ei,new Set(Ge.getValidEnumValues(this._def.values))),!gs(this,ei).has(e.data)){const i=Ge.objectValues(n);return ie(o,{received:o.data,code:ee.invalid_enum_value,options:i}),be}return Nt(e.data)}get enum(){return this._def.values}}ei=new WeakMap,ci.create=(t,e)=>new ci({values:t,typeName:ve.ZodNativeEnum,...Ve(e)});class go extends Pe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.promise&&n.common.async===!1)return ie(n,{code:ee.invalid_type,expected:le.promise,received:n.parsedType}),be;const o=n.parsedType===le.promise?n.data:Promise.resolve(n.data);return Nt(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}go.create=(t,e)=>new go({type:t,typeName:ve.ZodPromise,...Ve(e)});class fn extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=this._def.effect||null,l={addIssue:c=>{ie(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const c=i.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return be;const p=await this._def.schema._parseAsync({data:d,path:o.path,parent:o});return p.status==="aborted"?be:p.status==="dirty"||n.value==="dirty"?po(p.value):p});{if(n.value==="aborted")return be;const d=this._def.schema._parseSync({data:c,path:o.path,parent:o});return d.status==="aborted"?be:d.status==="dirty"||n.value==="dirty"?po(d.value):d}}if(i.type==="refinement"){const c=d=>{const p=i.refinement(d,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(i.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Xo(c))return c;const d=i.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>Xo(c)?Promise.resolve(i.transform(c.value,l)).then(d=>({status:n.value,value:d})):c);Ge.assertNever(i)}}fn.create=(t,e,n)=>new fn({schema:t,typeName:ve.ZodEffects,effect:e,...Ve(n)}),fn.createWithPreprocess=(t,e,n)=>new fn({schema:e,effect:{type:"preprocess",transform:t},typeName:ve.ZodEffects,...Ve(n)});class Ln extends Pe{_parse(e){return this._getType(e)===le.undefined?Nt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ln.create=(t,e)=>new Ln({innerType:t,typeName:ve.ZodOptional,...Ve(e)});class hr extends Pe{_parse(e){return this._getType(e)===le.null?Nt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}hr.create=(t,e)=>new hr({innerType:t,typeName:ve.ZodNullable,...Ve(e)});class di extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===le.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}di.create=(t,e)=>new di({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ve(e)});class ui extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Jo(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Wt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Wt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}ui.create=(t,e)=>new ui({innerType:t,typeName:ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ve(e)});class ws extends Pe{_parse(e){if(this._getType(e)!==le.nan){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.nan,received:o.parsedType}),be}return{status:"valid",value:e.data}}}ws.create=t=>new ws({typeName:ve.ZodNaN,...Ve(t)});const py=Symbol("zod_brand");class cl extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class pi extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return l.status==="aborted"?be:l.status==="dirty"?(n.dirty(),po(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?be:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,n){return new pi({in:e,out:n,typeName:ve.ZodPipeline})}}class hi extends Pe{_parse(e){const n=this._def.innerType._parse(e),o=i=>(Xo(i)&&(i.value=Object.freeze(i.value)),i);return Jo(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}hi.create=(t,e)=>new hi({innerType:t,typeName:ve.ZodReadonly,...Ve(e)});function cu(t,e={},n){return t?ho.create().superRefine((o,i)=>{var l,c;if(!t(o)){const d=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=d.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,h=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...h,fatal:p})}}):ho.create()}const hy={object:nt.lazycreate};var ve;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ve||(ve={}));const fy=(t,e={message:`Input not instance of ${t.name}`})=>cu(n=>n instanceof t,e),du=pn.create,uu=dr.create,my=ws.create,gy=ur.create,pu=ti.create,yy=zr.create,_y=ys.create,Cy=ni.create,vy=ri.create,wy=ho.create,by=Ur.create,xy=qn.create,ky=_s.create,Ey=hn.create,Sy=nt.create,Ty=nt.strictCreate,Ny=oi.create,Vy=Cs.create,Ay=ii.create,By=Fn.create,Py=si.create,Ry=vs.create,Dy=Zr.create,Iy=mo.create,Fy=ai.create,Ly=li.create,Oy=pr.create,My=ci.create,Gy=go.create,hu=fn.create,$y=Ln.create,zy=hr.create,Uy=fn.createWithPreprocess,Zy=pi.create;var On=Object.freeze({__proto__:null,defaultErrorMap:uo,setErrorMap:Kg,getErrorMap:fs,makeIssue:ms,EMPTY_PATH:Yg,addIssueToContext:ie,ParseStatus:bt,INVALID:be,DIRTY:po,OK:Nt,isAborted:il,isDirty:sl,isValid:Xo,isAsync:Jo,get util(){return Ge},get objectUtil(){return ol},ZodParsedType:le,getParsedType:cr,ZodType:Pe,datetimeRegex:au,ZodString:pn,ZodNumber:dr,ZodBigInt:ur,ZodBoolean:ti,ZodDate:zr,ZodSymbol:ys,ZodUndefined:ni,ZodNull:ri,ZodAny:ho,ZodUnknown:Ur,ZodNever:qn,ZodVoid:_s,ZodArray:hn,ZodObject:nt,ZodUnion:oi,ZodDiscriminatedUnion:Cs,ZodIntersection:ii,ZodTuple:Fn,ZodRecord:si,ZodMap:vs,ZodSet:Zr,ZodFunction:mo,ZodLazy:ai,ZodLiteral:li,ZodEnum:pr,ZodNativeEnum:ci,ZodPromise:go,ZodEffects:fn,ZodTransformer:fn,ZodOptional:Ln,ZodNullable:hr,ZodDefault:di,ZodCatch:ui,ZodNaN:ws,BRAND:py,ZodBranded:cl,ZodPipeline:pi,ZodReadonly:hi,custom:cu,Schema:Pe,ZodSchema:Pe,late:hy,get ZodFirstPartyTypeKind(){return ve},coerce:{string:t=>pn.create({...t,coerce:!0}),number:t=>dr.create({...t,coerce:!0}),boolean:t=>ti.create({...t,coerce:!0}),bigint:t=>ur.create({...t,coerce:!0}),date:t=>zr.create({...t,coerce:!0})},any:wy,array:Ey,bigint:gy,boolean:pu,date:yy,discriminatedUnion:Vy,effect:hu,enum:Oy,function:Iy,instanceof:fy,intersection:Ay,lazy:Fy,literal:Ly,map:Ry,nan:my,nativeEnum:My,never:xy,null:vy,nullable:zy,number:uu,object:Sy,oboolean:()=>pu().optional(),onumber:()=>uu().optional(),optional:$y,ostring:()=>du().optional(),pipeline:Zy,preprocess:Uy,promise:Gy,record:Py,set:Dy,strictObject:Ty,string:du,symbol:_y,transformer:hu,tuple:By,undefined:Cy,union:Ny,unknown:by,void:ky,NEVER:be,ZodIssueCode:ee,quotelessJson:qg,ZodError:Wt});function Wy(t){throw new Error("Unexpected object: "+t)}const jy=-2147483648,fu=-9007199254740991n,Hy=NaN,qy=NaN,Ky=null,Yy=null;function mu(t,e){switch(e){case"Int":return t===jy;case"Long":return t===Number(fu)||t===fu;case"Float":return t===Hy;case"Double":return t===qy;case"String":return t===Ky;case"Bytes":return t===Yy;default:throw Error(`unsupported data type: ${e}`)}}function Xy(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}function dl(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}function gu(t){return t.map(dl)}function bs(t,e){switch(t.type){case"column":return{type:"column",column:e(t.column)};case"inner":case"full":return{type:t.type,entries:t.entries.map(n=>bs(n,e))};case"outer":return{type:"outer",primary:bs(t.primary,e),secondary:t.secondary.map(n=>bs(n,e))};default:Wy(t)}}On.object({__isRef:On.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:On.string().describe("Upstream block id"),name:On.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function Jy(t){if(t&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(t);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const Qy=On.object({type:On.string(),importance:On.number().optional(),id:On.string().optional(),label:On.string()});On.array(Qy);const e_="1.14.1";function yu(){return Jy({sdkVersion:e_})}function t_(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function yo(t){return!!t&&typeof t.children<"u"}function fr(t){return yo(t)?t.groupId:t.colId}function _u(t,e,n){const o=(c,d)=>{const p=c.children.map(fr),h=T._includes(p,fr(d)),m=T._last(c.children),y=m&&fr(m)!==fr(d);return h&&y};if(!yo(t))return!0;const i=t,l=n;if(o(i,l))return i.children.push(l),!0;if(i.groupId===e){const c=i.children.map(fr);if(!T._includes(c,fr(l)))return i.children.push(l),!0}for(let c=i.children.length-1;c>=0&&!_u(i.children[c],e,n);c--);return!1}function n_(t){const e=(i,l)=>yo(i)&&yo(l)&&fr(i)===fr(l),n=(i,l)=>{if(!yo(l))return i;const c=i,d=l;return d.children&&d.groupId&&_u(c,d.groupId,d.children[0])||d.children.forEach(p=>n(c,p)),c},o=[];for(let i=1;i<=t.length;i++){const l=t[i-1],c=t[i];e(l,c)?t[i]=n(l,c):o.push(l)}return o}var r_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(i,l)=>{if(yo(i)){const c=i,d=typeof c.groupId<"u"?c.groupId:c.headerName,p=new T.AgProvidedColumnGroup(c,d,!1,l),h=[];return c.children.forEach(m=>{const y=n(m,l+1);y&&h.push(y)}),p.setChildren(h),p}else{const c=i,d=c.colId?c.colId:c.field,p=this.columnModel.getColDefCol(d);return p||e.push(c),p}},o=[];return t.forEach(i=>{const l=n(i,0);l&&o.push(l)}),e.length>0&&T._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=n_(e);t(n)}getLeafPathTrees(){const t=(o,i)=>{let l;if(T.isProvidedColumnGroup(o))if(o.isPadding())l=i;else{const d=Object.assign({},o.getColGroupDef());d.groupId=o.getGroupId(),d.children=[i],l=d}else{const d=Object.assign({},o.getColDef());d.colId=o.getColId(),l=d}const c=o.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(o=>{const i=o.getColDef();return o.isPrimary()&&!i.showRowGroup}).map(o=>t(o,o.getColDef()))}};function o_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function i_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function s_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function a_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function l_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function c_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function d_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function u_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function p_(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return T._unwrapUserComp(n)}function h_(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var f_=class extends T.Component{constructor(t){super(),this.eToggleButton=T.RefPlaceholder,this.eIconWrapper=T.RefPlaceholder,this.eLabel=T.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
|
|
3
|
+
`)}}function zg(t){return{ok:!0,value:t}}function eu(t){if(!t)throw new Xa;if(!t.ok)throw new hs(t.errors);return t.value}function tu(t){return{value:t,errors:void 0}}function Ug(t){if(t.errors)throw new hs(t.errors);if(!t.value)throw new Xa;return t.value}function Zg(t){return t!==void 0}function Ja(t,e){return $r(t)===$r(e)}const Qa=t=>t,el=t=>t instanceof Error?t:Error(String(t)),tl=t=>t.name==="ZodError",nl=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),o=Object.entries(n).map(([i,l])=>i+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function rl(t){const e=t.validate??Qa,{autoSave:n}=t,o=r.ref(),i=r.ref(),l=S=>{i.value={model:Dn(S)}};r.watch(()=>t.get(),S=>l(S),{immediate:!0});const c=()=>{var S;t.onSave(e(Dn((S=i.value)==null?void 0:S.model)))},d=()=>{l(t.get()),o.value=void 0},p=S=>{const M=el(S);tl(M)?o.value=Error(nl(M)):o.value=M},h=S=>{o.value=void 0;try{e(S),n&&c()}catch(M){p(M)}},m=r.computed({get:()=>{var S;return(S=i.value)==null?void 0:S.model},set(S){l(S),h(S)}});r.watch(i,(S,M)=>{S&&S===M&&h(S.model)},{deep:!0});const y=r.computed(()=>!o.value),b=r.computed(()=>!Ja(t.get(),r.unref(i))),w=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:b,error:o,errorString:w,save:c,revert:d,setError:p})}function Wg(t,e,n){const o=t.validate??Qa,{autoSave:i}=t,l=r.ref(),c=r.ref(),d=O=>{var v;if(n.deepPatchModel){const L=(v=c.value)==null?void 0:v.model,I=Object.assign(Dn(O),e??{});c.value={model:L?Jd(L,I):I,stage:Symbol()}}else c.value={model:Object.assign(Dn(O),e??{}),stage:Symbol()}};r.watch(()=>t.get(),O=>d(O),{immediate:!0});const p=()=>{var O;t.onSave(o(Dn((O=c.value)==null?void 0:O.model)))},h=()=>{d(t.get()),l.value=void 0},m=O=>{const v=el(O);tl(v)?l.value=Error(nl(v)):l.value=v},y=O=>{l.value=void 0;try{o(O),i&&p()}catch(v){m(v)}},b=r.computed({get:()=>{var O;return(O=c.value)==null?void 0:O.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:b.value.args,ui:b.value.ui}),()=>{var O;return(O=c.value)==null?void 0:O.stage}],([O,v],[L,I])=>{v===I&&y(O)},{deep:!0});const w=r.computed(()=>!l.value),S=r.computed(()=>{var L;const{args:O,ui:v}=((L=r.unref(c))==null?void 0:L.model)??{};return!Ja(t.get(),{args:O,ui:v})}),M=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:b,valid:w,isChanged:S,error:l,errorString:M,save:p,revert:h,setError:m})}const jg=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function Hg(t,e,n){const o=(v,...L)=>{n.debug&&console.log(`%c>>> %c${v}`,"color: orange; font-weight: bold","color: orange",...L)},l=Ya(e.setBlockArgs,100),c=Ya(e.setBlockUiState,100),d=Ya(e.setBlockArgsAndUiState,100),p=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async v=>{v.forEach(L=>{L.key==="args"&&(p.args=Object.freeze(L.value),o("args patch",p.args)),L.key==="ui"&&(p.ui=Object.freeze(L.value),o("ui patch",p.ui)),L.key==="outputs"&&(p.outputs=Object.freeze(L.value),o("outputs patch",p.outputs)),L.key==="navigationState"&&(p.navigationState=Object.freeze(L.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const h=()=>Dn(p.args),m=()=>Dn(p.ui),y=()=>Dn(p.navigationState),b={createArgsModel(v={}){return rl({get(){return v.transform?v.transform(p.args):p.args},validate:v.validate,autoSave:!0,onSave(L){l(L)}})},createUiModel(v={},L){return rl({get(){return v.transform?v.transform(p.ui):p.ui??L()},validate:v.validate,autoSave:!0,onSave(I){c(I)}})},useOutputs(...v){const L=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(L,{value:this.unwrapOutputs(...v),errors:void 0})}catch(I){Object.assign(L,{value:void 0,errors:[String(I)]})}},{immediate:!0,deep:!0}),L},unwrapOutputs(...v){const L=p.outputs,I=v.map(W=>[W,eu(L[W])]);return Object.fromEntries(I)},updateArgs(v){const L=h();return v(L),e.setBlockArgs(L)},updateUiState(v){const L=m();return e.setBlockUiState(v(L))},updateNavigationState(v){const L=y();return v(L),e.setNavigationState(L)},navigateTo(v){const L=y();return L.href=v,e.setNavigationState(L)}},w=r.computed(()=>{const v=Object.entries(p.outputs).map(([L,I])=>[L,I.ok&&I.value!==void 0?I.value:void 0]);return Object.fromEntries(v)}),S=r.computed(()=>{const v=Object.entries(p.outputs).map(([L,I])=>[L,I&&!I.ok?new hs(I.errors):void 0]);return Object.fromEntries(v)}),M={snapshot:p,queryParams:r.computed(()=>jg(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(v=>!(v!=null&&v.ok)))},O=Wg({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(v){d(v.args,v.ui)}},{outputs:w,outputErrors:S},n);return r.reactive(Object.assign(O,b,M))}var Ge;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const l={};for(const c of i)l[c]=c;return l},t.getValidEnumValues=i=>{const l=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(const d of l)c[d]=i[d];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(l){return i[l]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const l=[];for(const c in i)Object.prototype.hasOwnProperty.call(i,c)&&l.push(c);return l},t.find=(i,l)=>{for(const c of i)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,l=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})(Ge||(Ge={}));var ol;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ol||(ol={}));const le=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cr=t=>{switch(typeof t){case"undefined":return le.undefined;case"string":return le.string;case"number":return isNaN(t)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(t)?le.array:t===null?le.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?le.promise:typeof Map<"u"&&t instanceof Map?le.map:typeof Set<"u"&&t instanceof Set?le.set:typeof Date<"u"&&t instanceof Date?le.date:le.object;default:return le.unknown}},ee=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),qg=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Wt extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},i=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let d=o,p=0;for(;p<c.path.length;){const h=c.path[p];p===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(n(c))):d[h]=d[h]||{_errors:[]},d=d[h],p++}}};return i(this),o}static assert(e){if(!(e instanceof Wt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Wt.create=t=>new Wt(t);const uo=(t,e)=>{let n;switch(t.code){case ee.invalid_type:t.received===le.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ge.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ge.joinValues(t.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ge.joinValues(t.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Ge.joinValues(t.options)}, received '${t.received}'`;break;case ee.invalid_arguments:n="Invalid function arguments";break;case ee.invalid_return_type:n="Invalid function return type";break;case ee.invalid_date:n="Invalid date";break;case ee.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ge.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ee.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ee.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ee.custom:n="Invalid input";break;case ee.invalid_intersection_types:n="Intersection results could not be merged";break;case ee.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ee.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ge.assertNever(t)}return{message:n}};let nu=uo;function Kg(t){nu=t}function fs(){return nu}const ms=t=>{const{data:e,path:n,errorMaps:o,issueData:i}=t,l=[...n,...i.path||[]],c={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let d="";const p=o.filter(h=>!!h).slice().reverse();for(const h of p)d=h(c,{data:e,defaultError:d}).message;return{...i,path:l,message:d}},Yg=[];function ie(t,e){const n=fs(),o=ms({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===uo?void 0:uo].filter(i=>!!i)});t.common.issues.push(o)}class bt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const i of n){if(i.status==="aborted")return be;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const i of n){const l=await i.key,c=await i.value;o.push({key:l,value:c})}return bt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const i of n){const{key:l,value:c}=i;if(l.status==="aborted"||c.status==="aborted")return be;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const be=Object.freeze({status:"aborted"}),po=t=>({status:"dirty",value:t}),Nt=t=>({status:"valid",value:t}),il=t=>t.status==="aborted",sl=t=>t.status==="dirty",Xo=t=>t.status==="valid",Jo=t=>typeof Promise<"u"&&t instanceof Promise;function gs(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function ru(t,e,n,o,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var fe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(fe||(fe={}));var Qo,ei;class In{constructor(e,n,o,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ou=(t,e)=>{if(Xo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Wt(t.common.issues);return this._error=n,this._error}}};function Ve(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:i}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,d)=>{var p,h;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??d.defaultError}:typeof d.data>"u"?{message:(p=m??o)!==null&&p!==void 0?p:d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:(h=m??n)!==null&&h!==void 0?h:d.defaultError}},description:i}}class Pe{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return cr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new bt,ctx:{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Jo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const i={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},l=this._parseSync({data:e,path:i.path,parent:i});return ou(i,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},i=this._parse({data:e,path:o.path,parent:o}),l=await(Jo(i)?i:Promise.resolve(i));return ou(o,l)}refine(e,n){const o=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,l)=>{const c=e(i),d=()=>l.addIssue({code:ee.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,n){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof n=="function"?n(o,i):n),!1))}_refinement(e){return new fn({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ln.create(this,this._def)}nullable(){return hr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hn.create(this,this._def)}promise(){return go.create(this,this._def)}or(e){return oi.create([this,e],this._def)}and(e){return ii.create(this,e,this._def)}transform(e){return new fn({...Ve(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new di({...Ve(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new cl({typeName:ve.ZodBranded,type:this,...Ve(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ui({...Ve(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return pi.create(this,e)}readonly(){return hi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Xg=/^c[^\s-]{8,}$/i,Jg=/^[0-9a-z]+$/,Qg=/^[0-9A-HJKMNP-TV-Z]{26}$/,ey=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ty=/^[a-z0-9_-]{21}$/i,ny=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ry=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,oy="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let al;const iy=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,sy=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ay=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iu="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ly=new RegExp(`^${iu}$`);function su(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function cy(t){return new RegExp(`^${su(t)}$`)}function au(t){let e=`${iu}T${su(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function dy(t,e){return!!((e==="v4"||!e)&&iy.test(t)||(e==="v6"||!e)&&sy.test(t))}class pn extends Pe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==le.string){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.string,received:l.parsedType}),be}const o=new bt;let i;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="max")e.data.length>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,d=e.data.length<l.value;(c||d)&&(i=this._getOrReturnCtx(e,i),c?ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")ry.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"email",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")al||(al=new RegExp(oy,"u")),al.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"emoji",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")ey.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"uuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")ty.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"nanoid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")Xg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")Jg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid2",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")Qg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ulid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ie(i,{validation:"url",code:ee.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"regex",code:ee.invalid_string,message:l.message}),o.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?au(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?ly.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?cy(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?ny.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"duration",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?dy(e.data,l.version)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ip",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?ay.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"base64",code:ee.invalid_string,message:l.message}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(i=>e.test(i),{validation:n,code:ee.invalid_string,...fe.errToObj(o)})}_addCheck(e){return new pn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...fe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...fe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...fe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...fe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...fe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...fe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...fe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...fe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...fe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...fe.errToObj(e)})}datetime(e){var n,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...fe.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...fe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...fe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...fe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...fe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...fe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...fe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...fe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...fe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...fe.errToObj(n)})}nonempty(e){return this.min(1,fe.errToObj(e))}trim(){return new pn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new pn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new pn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}pn.create=t=>{var e;return new pn({checks:[],typeName:ve.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};function uy(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=n>o?n:o,l=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return l%c/Math.pow(10,i)}class dr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==le.number){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.number,received:l.parsedType}),be}let o;const i=new bt;for(const l of this._def.checks)l.kind==="int"?Ge.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_type,expected:"integer",received:"float",message:l.message}),i.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="multipleOf"?uy(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_finite,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,o,i){return new dr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new dr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:fe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:fe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ge.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}dr.create=t=>new dr({checks:[],typeName:ve.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class ur extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==le.bigint){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.bigint,received:l.parsedType}),be}let o;const i=new bt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,o,i){return new ur({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new ur({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ur.create=t=>{var e;return new ur({checks:[],typeName:ve.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};class ti extends Pe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==le.boolean){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.boolean,received:o.parsedType}),be}return Nt(e.data)}}ti.create=t=>new ti({typeName:ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class zr extends Pe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==le.date){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:le.date,received:l.parsedType}),be}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_date}),be}const o=new bt;let i;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new zr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:fe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:fe.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}zr.create=t=>new zr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ve.ZodDate,...Ve(t)});class ys extends Pe{_parse(e){if(this._getType(e)!==le.symbol){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.symbol,received:o.parsedType}),be}return Nt(e.data)}}ys.create=t=>new ys({typeName:ve.ZodSymbol,...Ve(t)});class ni extends Pe{_parse(e){if(this._getType(e)!==le.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.undefined,received:o.parsedType}),be}return Nt(e.data)}}ni.create=t=>new ni({typeName:ve.ZodUndefined,...Ve(t)});class ri extends Pe{_parse(e){if(this._getType(e)!==le.null){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.null,received:o.parsedType}),be}return Nt(e.data)}}ri.create=t=>new ri({typeName:ve.ZodNull,...Ve(t)});class ho extends Pe{constructor(){super(...arguments),this._any=!0}_parse(e){return Nt(e.data)}}ho.create=t=>new ho({typeName:ve.ZodAny,...Ve(t)});class Ur extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Nt(e.data)}}Ur.create=t=>new Ur({typeName:ve.ZodUnknown,...Ve(t)});class qn extends Pe{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:le.never,received:n.parsedType}),be}}qn.create=t=>new qn({typeName:ve.ZodNever,...Ve(t)});class _s extends Pe{_parse(e){if(this._getType(e)!==le.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.void,received:o.parsedType}),be}return Nt(e.data)}}_s.create=t=>new _s({typeName:ve.ZodVoid,...Ve(t)});class hn extends Pe{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==le.array)return ie(n,{code:ee.invalid_type,expected:le.array,received:n.parsedType}),be;if(i.exactLength!==null){const c=n.data.length>i.exactLength.value,d=n.data.length<i.exactLength.value;(c||d)&&(ie(n,{code:c?ee.too_big:ee.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ie(n,{code:ee.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ie(n,{code:ee.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>i.type._parseAsync(new In(n,c,n.path,d)))).then(c=>bt.mergeArray(o,c));const l=[...n.data].map((c,d)=>i.type._parseSync(new In(n,c,n.path,d)));return bt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new hn({...this._def,minLength:{value:e,message:fe.toString(n)}})}max(e,n){return new hn({...this._def,maxLength:{value:e,message:fe.toString(n)}})}length(e,n){return new hn({...this._def,exactLength:{value:e,message:fe.toString(n)}})}nonempty(e){return this.min(1,e)}}hn.create=(t,e)=>new hn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Ve(e)});function fo(t){if(t instanceof nt){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=Ln.create(fo(o))}return new nt({...t._def,shape:()=>e})}else return t instanceof hn?new hn({...t._def,type:fo(t.element)}):t instanceof Ln?Ln.create(fo(t.unwrap())):t instanceof hr?hr.create(fo(t.unwrap())):t instanceof Fn?Fn.create(t.items.map(e=>fo(e))):t}class nt extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ge.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==le.object){const h=this._getOrReturnCtx(e);return ie(h,{code:ee.invalid_type,expected:le.object,received:h.parsedType}),be}const{status:o,ctx:i}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof qn&&this._def.unknownKeys==="strip"))for(const h in i.data)c.includes(h)||d.push(h);const p=[];for(const h of c){const m=l[h],y=i.data[h];p.push({key:{status:"valid",value:h},value:m._parse(new In(i,y,i.path,h)),alwaysSet:h in i.data})}if(this._def.catchall instanceof qn){const h=this._def.unknownKeys;if(h==="passthrough")for(const m of d)p.push({key:{status:"valid",value:m},value:{status:"valid",value:i.data[m]}});else if(h==="strict")d.length>0&&(ie(i,{code:ee.unrecognized_keys,keys:d}),o.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const m of d){const y=i.data[m];p.push({key:{status:"valid",value:m},value:h._parse(new In(i,y,i.path,m)),alwaysSet:m in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const h=[];for(const m of p){const y=await m.key,b=await m.value;h.push({key:y,value:b,alwaysSet:m.alwaysSet})}return h}).then(h=>bt.mergeObjectSync(o,h)):bt.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return fe.errToObj,new nt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var i,l,c,d;const p=(c=(l=(i=this._def).errorMap)===null||l===void 0?void 0:l.call(i,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(d=fe.errToObj(e).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}strip(){return new nt({...this._def,unknownKeys:"strip"})}passthrough(){return new nt({...this._def,unknownKeys:"passthrough"})}extend(e){return new nt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new nt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ve.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new nt({...this._def,catchall:e})}pick(e){const n={};return Ge.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}omit(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}deepPartial(){return fo(this)}partial(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?n[o]=i:n[o]=i.optional()}),new nt({...this._def,shape:()=>n})}required(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof Ln;)l=l._def.innerType;n[o]=l}}),new nt({...this._def,shape:()=>n})}keyof(){return lu(Ge.objectKeys(this.shape))}}nt.create=(t,e)=>new nt({shape:()=>t,unknownKeys:"strip",catchall:qn.create(),typeName:ve.ZodObject,...Ve(e)}),nt.strictCreate=(t,e)=>new nt({shape:()=>t,unknownKeys:"strict",catchall:qn.create(),typeName:ve.ZodObject,...Ve(e)}),nt.lazycreate=(t,e)=>new nt({shape:t,unknownKeys:"strip",catchall:qn.create(),typeName:ve.ZodObject,...Ve(e)});class oi extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function i(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new Wt(d.ctx.common.issues));return ie(n,{code:ee.invalid_union,unionErrors:c}),be}if(n.common.async)return Promise.all(o.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(i);{let l;const c=[];for(const p of o){const h={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:h});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(p=>new Wt(p));return ie(n,{code:ee.invalid_union,unionErrors:d}),be}}get options(){return this._def.options}}oi.create=(t,e)=>new oi({options:t,typeName:ve.ZodUnion,...Ve(e)});const Kn=t=>t instanceof ai?Kn(t.schema):t instanceof fn?Kn(t.innerType()):t instanceof li?[t.value]:t instanceof pr?t.options:t instanceof ci?Ge.objectValues(t.enum):t instanceof di?Kn(t._def.innerType):t instanceof ni?[void 0]:t instanceof ri?[null]:t instanceof Ln?[void 0,...Kn(t.unwrap())]:t instanceof hr?[null,...Kn(t.unwrap())]:t instanceof cl||t instanceof hi?Kn(t.unwrap()):t instanceof ui?Kn(t._def.innerType):[];class Cs extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.object)return ie(n,{code:ee.invalid_type,expected:le.object,received:n.parsedType}),be;const o=this.discriminator,i=n.data[o],l=this.optionsMap.get(i);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const i=new Map;for(const l of n){const c=Kn(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,l)}}return new Cs({typeName:ve.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ve(o)})}}function ll(t,e){const n=cr(t),o=cr(e);if(t===e)return{valid:!0,data:t};if(n===le.object&&o===le.object){const i=Ge.objectKeys(e),l=Ge.objectKeys(t).filter(d=>i.indexOf(d)!==-1),c={...t,...e};for(const d of l){const p=ll(t[d],e[d]);if(!p.valid)return{valid:!1};c[d]=p.data}return{valid:!0,data:c}}else if(n===le.array&&o===le.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<t.length;l++){const c=t[l],d=e[l],p=ll(c,d);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return n===le.date&&o===le.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ii extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=(l,c)=>{if(il(l)||il(c))return be;const d=ll(l.value,c.value);return d.valid?((sl(l)||sl(c))&&n.dirty(),{status:n.value,value:d.data}):(ie(o,{code:ee.invalid_intersection_types}),be)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,c])=>i(l,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}ii.create=(t,e,n)=>new ii({left:t,right:e,typeName:ve.ZodIntersection,...Ve(n)});class Fn extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.array)return ie(o,{code:ee.invalid_type,expected:le.array,received:o.parsedType}),be;if(o.data.length<this._def.items.length)return ie(o,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((c,d)=>{const p=this._def.items[d]||this._def.rest;return p?p._parse(new In(o,c,o.path,d)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>bt.mergeArray(n,c)):bt.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Fn({...this._def,rest:e})}}Fn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fn({items:t,typeName:ve.ZodTuple,rest:null,...Ve(e)})};class si extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.object)return ie(o,{code:ee.invalid_type,expected:le.object,received:o.parsedType}),be;const i=[],l=this._def.keyType,c=this._def.valueType;for(const d in o.data)i.push({key:l._parse(new In(o,d,o.path,d)),value:c._parse(new In(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?bt.mergeObjectAsync(n,i):bt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Pe?new si({keyType:e,valueType:n,typeName:ve.ZodRecord,...Ve(o)}):new si({keyType:pn.create(),valueType:e,typeName:ve.ZodRecord,...Ve(n)})}}class vs extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.map)return ie(o,{code:ee.invalid_type,expected:le.map,received:o.parsedType}),be;const i=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([d,p],h)=>({key:i._parse(new In(o,d,o.path,[h,"key"])),value:l._parse(new In(o,p,o.path,[h,"value"]))}));if(o.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of c){const h=await p.key,m=await p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const p of c){const h=p.key,m=p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}}}}vs.create=(t,e,n)=>new vs({valueType:e,keyType:t,typeName:ve.ZodMap,...Ve(n)});class Zr extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.set)return ie(o,{code:ee.invalid_type,expected:le.set,received:o.parsedType}),be;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(ie(o,{code:ee.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(ie(o,{code:ee.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const h=new Set;for(const m of p){if(m.status==="aborted")return be;m.status==="dirty"&&n.dirty(),h.add(m.value)}return{status:n.value,value:h}}const d=[...o.data.values()].map((p,h)=>l._parse(new In(o,p,o.path,h)));return o.common.async?Promise.all(d).then(p=>c(p)):c(d)}min(e,n){return new Zr({...this._def,minSize:{value:e,message:fe.toString(n)}})}max(e,n){return new Zr({...this._def,maxSize:{value:e,message:fe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Zr.create=(t,e)=>new Zr({valueType:t,minSize:null,maxSize:null,typeName:ve.ZodSet,...Ve(e)});class mo extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.function)return ie(n,{code:ee.invalid_type,expected:le.function,received:n.parsedType}),be;function o(d,p){return ms({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fs(),uo].filter(h=>!!h),issueData:{code:ee.invalid_arguments,argumentsError:p}})}function i(d,p){return ms({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fs(),uo].filter(h=>!!h),issueData:{code:ee.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof go){const d=this;return Nt(async function(...p){const h=new Wt([]),m=await d._def.args.parseAsync(p,l).catch(w=>{throw h.addIssue(o(p,w)),h}),y=await Reflect.apply(c,this,m);return await d._def.returns._def.type.parseAsync(y,l).catch(w=>{throw h.addIssue(i(y,w)),h})})}else{const d=this;return Nt(function(...p){const h=d._def.args.safeParse(p,l);if(!h.success)throw new Wt([o(p,h.error)]);const m=Reflect.apply(c,this,h.data),y=d._def.returns.safeParse(m,l);if(!y.success)throw new Wt([i(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new mo({...this._def,args:Fn.create(e).rest(Ur.create())})}returns(e){return new mo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new mo({args:e||Fn.create([]).rest(Ur.create()),returns:n||Ur.create(),typeName:ve.ZodFunction,...Ve(o)})}}class ai extends Pe{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ai.create=(t,e)=>new ai({getter:t,typeName:ve.ZodLazy,...Ve(e)});class li extends Pe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:ee.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:e.data}}get value(){return this._def.value}}li.create=(t,e)=>new li({value:t,typeName:ve.ZodLiteral,...Ve(e)});function lu(t,e){return new pr({values:t,typeName:ve.ZodEnum,...Ve(e)})}class pr extends Pe{constructor(){super(...arguments),Qo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{expected:Ge.joinValues(o),received:n.parsedType,code:ee.invalid_type}),be}if(gs(this,Qo)||ru(this,Qo,new Set(this._def.values)),!gs(this,Qo).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{received:n.data,code:ee.invalid_enum_value,options:o}),be}return Nt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return pr.create(e,{...this._def,...n})}exclude(e,n=this._def){return pr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}Qo=new WeakMap,pr.create=lu;class ci extends Pe{constructor(){super(...arguments),ei.set(this,void 0)}_parse(e){const n=Ge.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==le.string&&o.parsedType!==le.number){const i=Ge.objectValues(n);return ie(o,{expected:Ge.joinValues(i),received:o.parsedType,code:ee.invalid_type}),be}if(gs(this,ei)||ru(this,ei,new Set(Ge.getValidEnumValues(this._def.values))),!gs(this,ei).has(e.data)){const i=Ge.objectValues(n);return ie(o,{received:o.data,code:ee.invalid_enum_value,options:i}),be}return Nt(e.data)}get enum(){return this._def.values}}ei=new WeakMap,ci.create=(t,e)=>new ci({values:t,typeName:ve.ZodNativeEnum,...Ve(e)});class go extends Pe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.promise&&n.common.async===!1)return ie(n,{code:ee.invalid_type,expected:le.promise,received:n.parsedType}),be;const o=n.parsedType===le.promise?n.data:Promise.resolve(n.data);return Nt(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}go.create=(t,e)=>new go({type:t,typeName:ve.ZodPromise,...Ve(e)});class fn extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=this._def.effect||null,l={addIssue:c=>{ie(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const c=i.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return be;const p=await this._def.schema._parseAsync({data:d,path:o.path,parent:o});return p.status==="aborted"?be:p.status==="dirty"||n.value==="dirty"?po(p.value):p});{if(n.value==="aborted")return be;const d=this._def.schema._parseSync({data:c,path:o.path,parent:o});return d.status==="aborted"?be:d.status==="dirty"||n.value==="dirty"?po(d.value):d}}if(i.type==="refinement"){const c=d=>{const p=i.refinement(d,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(i.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Xo(c))return c;const d=i.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>Xo(c)?Promise.resolve(i.transform(c.value,l)).then(d=>({status:n.value,value:d})):c);Ge.assertNever(i)}}fn.create=(t,e,n)=>new fn({schema:t,typeName:ve.ZodEffects,effect:e,...Ve(n)}),fn.createWithPreprocess=(t,e,n)=>new fn({schema:e,effect:{type:"preprocess",transform:t},typeName:ve.ZodEffects,...Ve(n)});class Ln extends Pe{_parse(e){return this._getType(e)===le.undefined?Nt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ln.create=(t,e)=>new Ln({innerType:t,typeName:ve.ZodOptional,...Ve(e)});class hr extends Pe{_parse(e){return this._getType(e)===le.null?Nt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}hr.create=(t,e)=>new hr({innerType:t,typeName:ve.ZodNullable,...Ve(e)});class di extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===le.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}di.create=(t,e)=>new di({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ve(e)});class ui extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Jo(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Wt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Wt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}ui.create=(t,e)=>new ui({innerType:t,typeName:ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ve(e)});class ws extends Pe{_parse(e){if(this._getType(e)!==le.nan){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:le.nan,received:o.parsedType}),be}return{status:"valid",value:e.data}}}ws.create=t=>new ws({typeName:ve.ZodNaN,...Ve(t)});const py=Symbol("zod_brand");class cl extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class pi extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return l.status==="aborted"?be:l.status==="dirty"?(n.dirty(),po(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?be:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,n){return new pi({in:e,out:n,typeName:ve.ZodPipeline})}}class hi extends Pe{_parse(e){const n=this._def.innerType._parse(e),o=i=>(Xo(i)&&(i.value=Object.freeze(i.value)),i);return Jo(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}hi.create=(t,e)=>new hi({innerType:t,typeName:ve.ZodReadonly,...Ve(e)});function cu(t,e={},n){return t?ho.create().superRefine((o,i)=>{var l,c;if(!t(o)){const d=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=d.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,h=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...h,fatal:p})}}):ho.create()}const hy={object:nt.lazycreate};var ve;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ve||(ve={}));const fy=(t,e={message:`Input not instance of ${t.name}`})=>cu(n=>n instanceof t,e),du=pn.create,uu=dr.create,my=ws.create,gy=ur.create,pu=ti.create,yy=zr.create,_y=ys.create,Cy=ni.create,vy=ri.create,wy=ho.create,by=Ur.create,xy=qn.create,ky=_s.create,Ey=hn.create,Sy=nt.create,Ty=nt.strictCreate,Ny=oi.create,Vy=Cs.create,Ay=ii.create,By=Fn.create,Py=si.create,Ry=vs.create,Dy=Zr.create,Iy=mo.create,Fy=ai.create,Ly=li.create,Oy=pr.create,My=ci.create,Gy=go.create,hu=fn.create,$y=Ln.create,zy=hr.create,Uy=fn.createWithPreprocess,Zy=pi.create;var On=Object.freeze({__proto__:null,defaultErrorMap:uo,setErrorMap:Kg,getErrorMap:fs,makeIssue:ms,EMPTY_PATH:Yg,addIssueToContext:ie,ParseStatus:bt,INVALID:be,DIRTY:po,OK:Nt,isAborted:il,isDirty:sl,isValid:Xo,isAsync:Jo,get util(){return Ge},get objectUtil(){return ol},ZodParsedType:le,getParsedType:cr,ZodType:Pe,datetimeRegex:au,ZodString:pn,ZodNumber:dr,ZodBigInt:ur,ZodBoolean:ti,ZodDate:zr,ZodSymbol:ys,ZodUndefined:ni,ZodNull:ri,ZodAny:ho,ZodUnknown:Ur,ZodNever:qn,ZodVoid:_s,ZodArray:hn,ZodObject:nt,ZodUnion:oi,ZodDiscriminatedUnion:Cs,ZodIntersection:ii,ZodTuple:Fn,ZodRecord:si,ZodMap:vs,ZodSet:Zr,ZodFunction:mo,ZodLazy:ai,ZodLiteral:li,ZodEnum:pr,ZodNativeEnum:ci,ZodPromise:go,ZodEffects:fn,ZodTransformer:fn,ZodOptional:Ln,ZodNullable:hr,ZodDefault:di,ZodCatch:ui,ZodNaN:ws,BRAND:py,ZodBranded:cl,ZodPipeline:pi,ZodReadonly:hi,custom:cu,Schema:Pe,ZodSchema:Pe,late:hy,get ZodFirstPartyTypeKind(){return ve},coerce:{string:t=>pn.create({...t,coerce:!0}),number:t=>dr.create({...t,coerce:!0}),boolean:t=>ti.create({...t,coerce:!0}),bigint:t=>ur.create({...t,coerce:!0}),date:t=>zr.create({...t,coerce:!0})},any:wy,array:Ey,bigint:gy,boolean:pu,date:yy,discriminatedUnion:Vy,effect:hu,enum:Oy,function:Iy,instanceof:fy,intersection:Ay,lazy:Fy,literal:Ly,map:Ry,nan:my,nativeEnum:My,never:xy,null:vy,nullable:zy,number:uu,object:Sy,oboolean:()=>pu().optional(),onumber:()=>uu().optional(),optional:$y,ostring:()=>du().optional(),pipeline:Zy,preprocess:Uy,promise:Gy,record:Py,set:Dy,strictObject:Ty,string:du,symbol:_y,transformer:hu,tuple:By,undefined:Cy,union:Ny,unknown:by,void:ky,NEVER:be,ZodIssueCode:ee,quotelessJson:qg,ZodError:Wt});function Wy(t){throw new Error("Unexpected object: "+t)}const jy=-2147483648,fu=-9007199254740991n,Hy=NaN,qy=NaN,Ky=null,Yy=null;function mu(t,e){switch(e){case"Int":return t===jy;case"Long":return t===Number(fu)||t===fu;case"Float":return t===Hy;case"Double":return t===qy;case"String":return t===Ky;case"Bytes":return t===Yy;default:throw Error(`unsupported data type: ${e}`)}}function Xy(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}function dl(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}function gu(t){return t.map(dl)}function bs(t,e){switch(t.type){case"column":return{type:"column",column:e(t.column)};case"inner":case"full":return{type:t.type,entries:t.entries.map(n=>bs(n,e))};case"outer":return{type:"outer",primary:bs(t.primary,e),secondary:t.secondary.map(n=>bs(n,e))};default:Wy(t)}}On.object({__isRef:On.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:On.string().describe("Upstream block id"),name:On.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function Jy(t){if(t&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(t);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const Qy=On.object({type:On.string(),importance:On.number().optional(),id:On.string().optional(),label:On.string()});On.array(Qy);const e_="1.15.4";function yu(){return Jy({sdkVersion:e_})}function t_(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function yo(t){return!!t&&typeof t.children<"u"}function fr(t){return yo(t)?t.groupId:t.colId}function _u(t,e,n){const o=(c,d)=>{const p=c.children.map(fr),h=T._includes(p,fr(d)),m=T._last(c.children),y=m&&fr(m)!==fr(d);return h&&y};if(!yo(t))return!0;const i=t,l=n;if(o(i,l))return i.children.push(l),!0;if(i.groupId===e){const c=i.children.map(fr);if(!T._includes(c,fr(l)))return i.children.push(l),!0}for(let c=i.children.length-1;c>=0&&!_u(i.children[c],e,n);c--);return!1}function n_(t){const e=(i,l)=>yo(i)&&yo(l)&&fr(i)===fr(l),n=(i,l)=>{if(!yo(l))return i;const c=i,d=l;return d.children&&d.groupId&&_u(c,d.groupId,d.children[0])||d.children.forEach(p=>n(c,p)),c},o=[];for(let i=1;i<=t.length;i++){const l=t[i-1],c=t[i];e(l,c)?t[i]=n(l,c):o.push(l)}return o}var r_=class extends T.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(i,l)=>{if(yo(i)){const c=i,d=typeof c.groupId<"u"?c.groupId:c.headerName,p=new T.AgProvidedColumnGroup(c,d,!1,l),h=[];return c.children.forEach(m=>{const y=n(m,l+1);y&&h.push(y)}),p.setChildren(h),p}else{const c=i,d=c.colId?c.colId:c.field,p=this.columnModel.getColDefCol(d);return p||e.push(c),p}},o=[];return t.forEach(i=>{const l=n(i,0);l&&o.push(l)}),e.length>0&&T._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=n_(e);t(n)}getLeafPathTrees(){const t=(o,i)=>{let l;if(T.isProvidedColumnGroup(o))if(o.isPadding())l=i;else{const d=Object.assign({},o.getColGroupDef());d.groupId=o.getGroupId(),d.children=[i],l=d}else{const d=Object.assign({},o.getColDef());d.colId=o.getColId(),l=d}const c=o.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(o=>{const i=o.getColDef();return o.isPrimary()&&!i.showRowGroup}).map(o=>t(o,o.getColDef()))}};function o_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function i_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function s_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function a_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function l_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function c_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function d_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function u_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function p_(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return T._unwrapUserComp(n)}function h_(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var f_=class extends T.Component{constructor(t){super(),this.eToggleButton=T.RefPlaceholder,this.eIconWrapper=T.RefPlaceholder,this.eLabel=T.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
|
|
4
4
|
<button type="button" data-ref="eToggleButton" tabindex="-1" role="tab" aria-expanded="false" class="ag-button ag-side-button-button">
|
|
5
5
|
<div data-ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>
|
|
6
6
|
<span data-ref="eLabel" class="ag-side-button-label"></span>
|
|
@@ -88,4 +88,4 @@ __p += '`),Oe&&(Q+=`' +
|
|
|
88
88
|
function print() { __p += __j.call(arguments, '') }
|
|
89
89
|
`:`;
|
|
90
90
|
`)+Q+`return __p
|
|
91
|
-
}`;var De=xg(function(){return Ze(C,he+"return "+Q).apply(n,N)});if(De.source=Q,Ad(De))throw De;return De}function eM(s){return je(s).toLowerCase()}function tM(s){return je(s).toUpperCase()}function nM(s,a,u){if(s=je(s),s&&(u||a===n))return Pf(s);if(!s||!(a=Qt(a)))return s;var f=An(s),g=An(a),C=Rf(f,g),N=Df(f,g)+1;return Fr(f,C,N).join("")}function rM(s,a,u){if(s=je(s),s&&(u||a===n))return s.slice(0,Ff(s)+1);if(!s||!(a=Qt(a)))return s;var f=An(s),g=Df(f,An(a))+1;return Fr(f,0,g).join("")}function oM(s,a,u){if(s=je(s),s&&(u||a===n))return s.replace(Ac,"");if(!s||!(a=Qt(a)))return s;var f=An(s),g=Rf(f,An(a));return Fr(f,g).join("")}function iM(s,a){var u=$,f=j;if(ot(a)){var g="separator"in a?a.separator:g;u="length"in a?Be(a.length):u,f="omission"in a?Qt(a.omission):f}s=je(s);var C=s.length;if(Oo(s)){var N=An(s);C=N.length}if(u>=C)return s;var A=u-Mo(f);if(A<1)return f;var D=N?Fr(N,0,A).join(""):s.slice(0,A);if(g===n)return D+f;if(N&&(A+=D.length-A),Bd(g)){if(s.slice(A).search(g)){var Y,X=D;for(g.global||(g=Hc(g.source,je(Qh.exec(g))+"g")),g.lastIndex=0;Y=g.exec(X);)var Q=Y.index;D=D.slice(0,Q===n?A:Q)}}else if(s.indexOf(Qt(g),A)!=A){var oe=D.lastIndexOf(g);oe>-1&&(D=D.slice(0,oe))}return D+f}function sM(s){return s=je(s),s&&yP.test(s)?s.replace(Yh,IR):s}var aM=jo(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),Dd=km("toUpperCase");function bg(s,a,u){return s=je(s),a=u?n:a,a===n?AR(s)?OR(s):wR(s):s.match(a)||[]}var xg=Ie(function(s,a){try{return Xt(s,n,a)}catch(u){return Ad(u)?u:new Te(u)}}),lM=or(function(s,a){return on(a,function(u){u=jn(u),nr(s,u,Nd(s[u],s))}),s});function cM(s){var a=s==null?0:s.length,u=ge();return s=a?tt(s,function(f){if(typeof f[1]!="function")throw new sn(c);return[u(f[0]),f[1]]}):[],Ie(function(f){for(var g=-1;++g<a;){var C=s[g];if(Xt(C[0],this,f))return Xt(C[1],this,f)}})}function dM(s){return ID(ln(s,y))}function Id(s){return function(){return s}}function uM(s,a){return s==null||s!==s?a:s}var pM=Sm(),hM=Sm(!0);function Zt(s){return s}function Fd(s){return nm(typeof s=="function"?s:ln(s,y))}function fM(s){return om(ln(s,y))}function mM(s,a){return im(s,ln(a,y))}var gM=Ie(function(s,a){return function(u){return os(u,s,a)}}),yM=Ie(function(s,a){return function(u){return os(s,u,a)}});function Ld(s,a,u){var f=yt(a),g=Ta(a,f);u==null&&!(ot(a)&&(g.length||!f.length))&&(u=a,a=s,s=this,g=Ta(a,yt(a)));var C=!(ot(u)&&"chain"in u)||!!u.chain,N=sr(s);return on(g,function(A){var D=a[A];s[A]=D,N&&(s.prototype[A]=function(){var Y=this.__chain__;if(C||Y){var X=s(this.__wrapped__),Q=X.__actions__=$t(this.__actions__);return Q.push({func:D,args:arguments,thisArg:s}),X.__chain__=Y,X}return D.apply(s,Ar([this.value()],arguments))})}),s}function _M(){return vt._===this&&(vt._=ZR),this}function Od(){}function CM(s){return s=Be(s),Ie(function(a){return sm(a,s)})}var vM=md(tt),wM=md(Tf),bM=md(Gc);function kg(s){return bd(s)?$c(jn(s)):JD(s)}function xM(s){return function(a){return s==null?n:so(s,a)}}var kM=Nm(),EM=Nm(!0);function Md(){return[]}function Gd(){return!1}function SM(){return{}}function TM(){return""}function NM(){return!0}function VM(s,a){if(s=Be(s),s<1||s>K)return[];var u=ke,f=St(s,ke);a=ge(a),s-=ke;for(var g=Zc(f,a);++u<s;)a(u);return g}function AM(s){return Ne(s)?tt(s,jn):en(s)?[s]:$t(Zm(je(s)))}function BM(s){var a=++zR;return je(s)+a}var PM=Ra(function(s,a){return s+a},0),RM=gd("ceil"),DM=Ra(function(s,a){return s/a},1),IM=gd("floor");function FM(s){return s&&s.length?Sa(s,Zt,td):n}function LM(s,a){return s&&s.length?Sa(s,ge(a,2),td):n}function OM(s){return Af(s,Zt)}function MM(s,a){return Af(s,ge(a,2))}function GM(s){return s&&s.length?Sa(s,Zt,id):n}function $M(s,a){return s&&s.length?Sa(s,ge(a,2),id):n}var zM=Ra(function(s,a){return s*a},1),UM=gd("round"),ZM=Ra(function(s,a){return s-a},0);function WM(s){return s&&s.length?Uc(s,Zt):0}function jM(s,a){return s&&s.length?Uc(s,ge(a,2)):0}return _.after=fL,_.ary=tg,_.assign=tO,_.assignIn=mg,_.assignInWith=ja,_.assignWith=nO,_.at=rO,_.before=ng,_.bind=Nd,_.bindAll=lM,_.bindKey=rg,_.castArray=SL,_.chain=Jm,_.chunk=II,_.compact=FI,_.concat=LI,_.cond=cM,_.conforms=dM,_.constant=Id,_.countBy=WF,_.create=oO,_.curry=og,_.curryRight=ig,_.debounce=sg,_.defaults=iO,_.defaultsDeep=sO,_.defer=mL,_.delay=gL,_.difference=OI,_.differenceBy=MI,_.differenceWith=GI,_.drop=$I,_.dropRight=zI,_.dropRightWhile=UI,_.dropWhile=ZI,_.fill=WI,_.filter=HF,_.flatMap=YF,_.flatMapDeep=XF,_.flatMapDepth=JF,_.flatten=qm,_.flattenDeep=jI,_.flattenDepth=HI,_.flip=yL,_.flow=pM,_.flowRight=hM,_.fromPairs=qI,_.functions=hO,_.functionsIn=fO,_.groupBy=QF,_.initial=YI,_.intersection=XI,_.intersectionBy=JI,_.intersectionWith=QI,_.invert=gO,_.invertBy=yO,_.invokeMap=tL,_.iteratee=Fd,_.keyBy=nL,_.keys=yt,_.keysIn=Ut,_.map=Ga,_.mapKeys=CO,_.mapValues=vO,_.matches=fM,_.matchesProperty=mM,_.memoize=za,_.merge=wO,_.mergeWith=gg,_.method=gM,_.methodOf=yM,_.mixin=Ld,_.negate=Ua,_.nthArg=CM,_.omit=bO,_.omitBy=xO,_.once=_L,_.orderBy=rL,_.over=vM,_.overArgs=CL,_.overEvery=wM,_.overSome=bM,_.partial=Vd,_.partialRight=ag,_.partition=oL,_.pick=kO,_.pickBy=yg,_.property=kg,_.propertyOf=xM,_.pull=rF,_.pullAll=Ym,_.pullAllBy=oF,_.pullAllWith=iF,_.pullAt=sF,_.range=kM,_.rangeRight=EM,_.rearg=vL,_.reject=aL,_.remove=aF,_.rest=wL,_.reverse=Sd,_.sampleSize=cL,_.set=SO,_.setWith=TO,_.shuffle=dL,_.slice=lF,_.sortBy=hL,_.sortedUniq=mF,_.sortedUniqBy=gF,_.split=YO,_.spread=bL,_.tail=yF,_.take=_F,_.takeRight=CF,_.takeRightWhile=vF,_.takeWhile=wF,_.tap=FF,_.throttle=xL,_.thru=Ma,_.toArray=pg,_.toPairs=_g,_.toPairsIn=Cg,_.toPath=AM,_.toPlainObject=fg,_.transform=NO,_.unary=kL,_.union=bF,_.unionBy=xF,_.unionWith=kF,_.uniq=EF,_.uniqBy=SF,_.uniqWith=TF,_.unset=VO,_.unzip=Td,_.unzipWith=Xm,_.update=AO,_.updateWith=BO,_.values=Ko,_.valuesIn=PO,_.without=NF,_.words=bg,_.wrap=EL,_.xor=VF,_.xorBy=AF,_.xorWith=BF,_.zip=PF,_.zipObject=RF,_.zipObjectDeep=DF,_.zipWith=IF,_.entries=_g,_.entriesIn=Cg,_.extend=mg,_.extendWith=ja,Ld(_,_),_.add=PM,_.attempt=xg,_.camelCase=FO,_.capitalize=vg,_.ceil=RM,_.clamp=RO,_.clone=TL,_.cloneDeep=VL,_.cloneDeepWith=AL,_.cloneWith=NL,_.conformsTo=BL,_.deburr=wg,_.defaultTo=uM,_.divide=DM,_.endsWith=LO,_.eq=Pn,_.escape=OO,_.escapeRegExp=MO,_.every=jF,_.find=qF,_.findIndex=jm,_.findKey=aO,_.findLast=KF,_.findLastIndex=Hm,_.findLastKey=lO,_.floor=IM,_.forEach=Qm,_.forEachRight=eg,_.forIn=cO,_.forInRight=dO,_.forOwn=uO,_.forOwnRight=pO,_.get=Pd,_.gt=PL,_.gte=RL,_.has=mO,_.hasIn=Rd,_.head=Km,_.identity=Zt,_.includes=eL,_.indexOf=KI,_.inRange=DO,_.invoke=_O,_.isArguments=co,_.isArray=Ne,_.isArrayBuffer=DL,_.isArrayLike=zt,_.isArrayLikeObject=at,_.isBoolean=IL,_.isBuffer=Lr,_.isDate=FL,_.isElement=LL,_.isEmpty=OL,_.isEqual=ML,_.isEqualWith=GL,_.isError=Ad,_.isFinite=$L,_.isFunction=sr,_.isInteger=lg,_.isLength=Za,_.isMap=cg,_.isMatch=zL,_.isMatchWith=UL,_.isNaN=ZL,_.isNative=WL,_.isNil=HL,_.isNull=jL,_.isNumber=dg,_.isObject=ot,_.isObjectLike=it,_.isPlainObject=ds,_.isRegExp=Bd,_.isSafeInteger=qL,_.isSet=ug,_.isString=Wa,_.isSymbol=en,_.isTypedArray=qo,_.isUndefined=KL,_.isWeakMap=YL,_.isWeakSet=XL,_.join=eF,_.kebabCase=GO,_.last=dn,_.lastIndexOf=tF,_.lowerCase=$O,_.lowerFirst=zO,_.lt=JL,_.lte=QL,_.max=FM,_.maxBy=LM,_.mean=OM,_.meanBy=MM,_.min=GM,_.minBy=$M,_.stubArray=Md,_.stubFalse=Gd,_.stubObject=SM,_.stubString=TM,_.stubTrue=NM,_.multiply=zM,_.nth=nF,_.noConflict=_M,_.noop=Od,_.now=$a,_.pad=UO,_.padEnd=ZO,_.padStart=WO,_.parseInt=jO,_.random=IO,_.reduce=iL,_.reduceRight=sL,_.repeat=HO,_.replace=qO,_.result=EO,_.round=UM,_.runInContext=R,_.sample=lL,_.size=uL,_.snakeCase=KO,_.some=pL,_.sortedIndex=cF,_.sortedIndexBy=dF,_.sortedIndexOf=uF,_.sortedLastIndex=pF,_.sortedLastIndexBy=hF,_.sortedLastIndexOf=fF,_.startCase=XO,_.startsWith=JO,_.subtract=ZM,_.sum=WM,_.sumBy=jM,_.template=QO,_.times=VM,_.toFinite=ar,_.toInteger=Be,_.toLength=hg,_.toLower=eM,_.toNumber=un,_.toSafeInteger=eO,_.toString=je,_.toUpper=tM,_.trim=nM,_.trimEnd=rM,_.trimStart=oM,_.truncate=iM,_.unescape=sM,_.uniqueId=BM,_.upperCase=aM,_.upperFirst=Dd,_.each=Qm,_.eachRight=eg,_.first=Km,Ld(_,function(){var s={};return Zn(_,function(a,u){qe.call(_.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),_.VERSION=o,on(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){_[s].placeholder=_}),on(["drop","take"],function(s,a){Le.prototype[s]=function(u){u=u===n?1:ht(Be(u),0);var f=this.__filtered__&&!a?new Le(this):this.clone();return f.__filtered__?f.__takeCount__=St(u,f.__takeCount__):f.__views__.push({size:St(u,ke),type:s+(f.__dir__<0?"Right":"")}),f},Le.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),on(["filter","map","takeWhile"],function(s,a){var u=a+1,f=u==x||u==G;Le.prototype[s]=function(g){var C=this.clone();return C.__iteratees__.push({iteratee:ge(g,3),type:u}),C.__filtered__=C.__filtered__||f,C}}),on(["head","last"],function(s,a){var u="take"+(a?"Right":"");Le.prototype[s]=function(){return this[u](1).value()[0]}}),on(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");Le.prototype[s]=function(){return this.__filtered__?new Le(this):this[u](1)}}),Le.prototype.compact=function(){return this.filter(Zt)},Le.prototype.find=function(s){return this.filter(s).head()},Le.prototype.findLast=function(s){return this.reverse().find(s)},Le.prototype.invokeMap=Ie(function(s,a){return typeof s=="function"?new Le(this):this.map(function(u){return os(u,s,a)})}),Le.prototype.reject=function(s){return this.filter(Ua(ge(s)))},Le.prototype.slice=function(s,a){s=Be(s);var u=this;return u.__filtered__&&(s>0||a<0)?new Le(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),a!==n&&(a=Be(a),u=a<0?u.dropRight(-a):u.take(a-s)),u)},Le.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Le.prototype.toArray=function(){return this.take(ke)},Zn(Le.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),f=/^(?:head|last)$/.test(a),g=_[f?"take"+(a=="last"?"Right":""):a],C=f||/^find/.test(a);g&&(_.prototype[a]=function(){var N=this.__wrapped__,A=f?[1]:arguments,D=N instanceof Le,Y=A[0],X=D||Ne(N),Q=function(Fe){var Oe=g.apply(_,Ar([Fe],A));return f&&oe?Oe[0]:Oe};X&&u&&typeof Y=="function"&&Y.length!=1&&(D=X=!1);var oe=this.__chain__,he=!!this.__actions__.length,_e=C&&!oe,De=D&&!he;if(!C&&X){N=De?N:new Le(this);var Ce=s.apply(N,A);return Ce.__actions__.push({func:Ma,args:[Q],thisArg:n}),new an(Ce,oe)}return _e&&De?s.apply(this,A):(Ce=this.thru(Q),_e?f?Ce.value()[0]:Ce.value():Ce)})}),on(["pop","push","shift","sort","splice","unshift"],function(s){var a=ua[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",f=/^(?:pop|shift)$/.test(s);_.prototype[s]=function(){var g=arguments;if(f&&!this.__chain__){var C=this.value();return a.apply(Ne(C)?C:[],g)}return this[u](function(N){return a.apply(Ne(N)?N:[],g)})}}),Zn(Le.prototype,function(s,a){var u=_[a];if(u){var f=u.name+"";qe.call(Uo,f)||(Uo[f]=[]),Uo[f].push({name:a,func:u})}}),Uo[Pa(n,v).name]=[{name:"wrapper",func:n}],Le.prototype.clone=sD,Le.prototype.reverse=aD,Le.prototype.value=lD,_.prototype.at=LF,_.prototype.chain=OF,_.prototype.commit=MF,_.prototype.next=GF,_.prototype.plant=zF,_.prototype.reverse=UF,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=ZF,_.prototype.first=_.prototype.head,Xi&&(_.prototype[Xi]=$F),_},Go=MR();to?((to.exports=Go)._=Go,Fc._=Go):vt._=Go}).call(Yo)}(Us,Us.exports);var ze=Us.exports;const QN={class:"grid-overlay-container"},Jp=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",QN,[e.params.notReady?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[n[0]||(n[0]=r.createElementVNode("div",{class:"grid-icon-cat-in-bag"},null,-1)),n[1]||(n[1]=r.createElementVNode("span",{class:"text-subtitle-m"},"Not calculated",-1))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[n[2]||(n[2]=r.createElementVNode("div",{class:"mask-24 mask-loading grid-mask-loading"},null,-1)),n[3]||(n[3]=r.createElementVNode("span",{class:"text-subtitle-m"},"Loading",-1))],64))]))}}),eV={},tV={class:"grid-overlay-container"};function nV(t,e){return r.openBlock(),r.createElementBlock("div",tV,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const Qp=Jl(eV,[["render",nV]]);async function rV(t,e){throw Error("not implemented")}function oV(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function iV(t,e){const n=[];for(const o of e)if(t[o].type==="column"){const i=oV(t[o].spec);for(const l of i){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const c=dl(l),d=t.findIndex(p=>ze.isEqual(p.id,c));if(d===-1)throw console.error("axis not found",o,c,t),Error("axis not found");n.push({columnIdx:o,axisIdx:d})}}return n}const eh=(t,e)=>(t+e).toString();function sV(t,e,n,o,i,l){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const c=t[0];let d=-1,p=-1;for(let y=0;y<l.length;++y)l[y]===c.axisIdx&&(d=y),l[y]===c.columnIdx&&(p=y);const h=(()=>{const b=o[d].data.filter(w=>w!==null);return Array.from(new Set(b))})();h.sort(),p>d?(n.splice(p,1),n.splice(d,1)):(n.splice(d,1),n.splice(p,1));const m=aV(i,o,d,p,h,e.rows);for(let y=0;y<h.length;++y){const b=h[y],w=$r(b+"@"+y);n.push({colId:w,field:eh(o.length,y),headerName:b,valueFormatter:oh})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function aV(t,e,n,o,i,l){const c=new Map;let d=0;for(let h=0;h<l;h++){const m={};for(let M=0;M<e.length;++M){if(M===n||M===o)continue;const O=t[M].toString();m[O]=e[M].data[h]}let y;const b=$r(Object.values(m))??"";c.has(b)?y=c.get(b):(c.set(b,m),y=m,y.id=d.toString(),d++);const w=i.indexOf(e[n].data[h]);if(w===-1)throw Error("index not found");const S=eh(e.length,w);y[S]=e[o].data[h]}return Array.from(c.values())}const Yr='"##RowNumberColumnId##"';function lV(){return{colId:Yr,headerName:"#",valueGetter:t=>t.node===null||t.node.rowIndex===null?null:t.node.rowIndex+1,suppressNavigable:!0,lockPosition:"left",suppressMovable:!0,mainMenuItems:[],contextMenuItems:[],pinned:"left",lockPinned:!0,minWidth:45,suppressSizeToFit:!0,suppressAutoSize:!0,cellStyle:{color:"var(--txt-03)","background-color":"var(--bg-base-light)",overflow:"visible !important","text-align":"center"},sortable:!1,resizable:!1}}function cV(){const t=document.createElement("div");return t.style.visibility="hidden",t.style.position="absolute",t.style.boxSizing="border-box",t.style.padding="15.5px",t.style.border="1px solid",t.style.width="auto",document.body.appendChild(t),t}function th(t,e){const n=t.getCellValue({rowNode:t.getDisplayedRowAtIndex(t.getLastDisplayedRowIndex()),colKey:Yr});if(typeof n!="number")return;const o=n.toString().length;if(e.innerHTML.length===o)return;const i="5";e.innerHTML=i.repeat(o),r.nextTick(()=>{t.setColumnWidths([{key:Yr,newWidth:e.offsetWidth}])})}function dV(t){document.body.removeChild(t)}function uV(t){const e=cV();t.addEventListener("viewportChanged",()=>{th(t,e)}),t.addEventListener("columnVisible",n=>{n.columns&&n.columns.some(o=>o.isVisible()&&o.getColId()===Yr)&&th(t,e)}),t.addEventListener("gridPreDestroyed",()=>{dV(e)})}const pV={class:"pl-ag-column-header__title d-flex align-center gap-6 flex-grow-1"},nh=r.defineComponent({__name:"PlAgColumnHeader",props:{params:{}},setup(t){const e=t,n=r.computed(()=>{var m,y;const h=(y=(m=e.params.column.getUserProvidedColDef())==null?void 0:m.headerComponentParams)==null?void 0:y.type;switch(h){case void 0:case"Text":return"cell-type-txt";case"Number":return"cell-type-num";case"File":return"paper-clip";case"Date":return"calendar";case"Duration":return"time";default:throw Error(`unsupported data type: ${h} for PlAgColumnHeader component. Column ${e.params.column.getColId()}`)}}),o=r.ref(null),i=()=>o.value=e.params.column.getSort()??null;r.onMounted(()=>i());function l(){e.params.column.isSortable()&&(e.params.progressSort(),i())}const c=r.computed(()=>{const h=o.value;switch(h){case"asc":return"arrow-up";case"desc":return"arrow-down";case null:return null;default:throw Error(`unsupported sort direction: ${h}. Column ${e.params.column.getColId()}`)}}),d=r.ref();function p(){const h=d.value;h&&e.params.showColumnMenu(h)}return(h,m)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-ag-column-header d-flex align-center gap-6",onClick:l},[r.createElementVNode("div",pV,[r.createVNode(r.unref(Vt),{name:n.value,class:"pl-ag-column-header__type-icon"},null,8,["name"]),r.createElementVNode("span",null,r.toDisplayString(h.params.displayName),1),c.value?(r.openBlock(),r.createBlock(r.unref(Vt),{key:0,name:c.value},null,8,["name"])):r.createCommentVNode("",!0)]),h.params.enableMenu?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"menuActivatorBtn",ref:d,class:"pl-ag-column-header__menu-icon",onClick:r.withModifiers(p,["stop"])},[r.createVNode(r.unref(Vt),{name:"more"})],512)):r.createCommentVNode("",!0)]))}});function hV(t){return $r(t)}function rh(t){return JSON.parse(t)}const oh=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function fV(t,e,n){var l,c,d;const o=hV(e),i=e.type==="axis"?e.spec.type:e.spec.valueType;return{colId:o,field:t.toString(),headerName:((c=(l=e.spec.annotations)==null?void 0:l["pl7.app/label"])==null?void 0:c.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(n==null?void 0:n.includes(o))??((d=e.spec.annotations)==null?void 0:d["pl7.app/table/visibility"])==="optional",valueFormatter:oh,headerComponent:nh,headerComponentParams:{type:(()=>{switch(i){case"Int":case"Long":case"Float":case"Double":return"Number";case"String":case"Bytes":return"Text";default:throw Error(`unsupported data type: ${i}`)}})()},cellDataType:(()=>{switch(i){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${i}`)}})()}}function ih(t,e){switch(e){case"Int":return t;case"Long":return typeof t=="bigint"?Number(t):t;case"Float":return t;case"Double":return t;case"String":return t;case"Bytes":return Buffer.from(t).toString("hex");default:throw Error(`unsupported data type: ${e}`)}}function sh(t){const e=[];return bs(t,n=>(e.push(n),n)),e}async function mV(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:ze.uniqWith(n.map(i=>gu(i.spec.axesSpec).map(ze.cloneDeep)).flat(),ze.isEqual),strictlyCompatible:!0})).hits.filter(i=>i.spec.axesSpec.length===1):[]}async function gV(t,e,n){const o=sh(n),l=(await mV(t,e,o)).filter(c=>!ze.find(o,d=>c.columnId===d.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(c=>({type:"column",column:c}))}}async function yV(t,e,n,o){const i=n.filter(m=>m.type!=="Bytes"),l=sh(o),c=i.map(m=>[]),d=i.map(m=>null);for(let m=0;m<l.length;++m){const y=gu(l[m].spec.axesSpec);for(let b=0;b<y.length;++b){const w=ze.findIndex(i,S=>ze.isEqual(S,y[b]));w===-1||d[w]||(y.length===1&&l[m].spec.name==="pl7.app/label"?(c[w]=[[m,b]],d[w]=l[m].columnId):c[w].push([m,b]))}}for(let m=i.length-1;m>=0;--m)c[m].length||(d.splice(m,1),c.splice(m,1),i.splice(m,1));const p=100,h=i.map(m=>new Set);e:for(let m=i.length-1;m>=0;--m){for(const[y,b]of c[m]){const w=await t.getUniqueValues(e,{columnId:l[y].columnId,...!d[m]&&{axis:ze.cloneDeep(i[m])},filters:[],limit:p});if(w.overflow){d.splice(m,1),c.splice(m,1),i.splice(m,1);continue e}const S=w.values.type;for(const M of w.values.data)if(!(mu(M,S)||M===null)&&(h[m].add(ih(M,S)),h[m].size===p)){d.splice(m,1),c.splice(m,1),i.splice(m,1);continue e}}if(!h[m].size){d.splice(m,1),c.splice(m,1),i.splice(m,1);continue e}}return i.map((m,y)=>{const b=[...h[y]].map(S=>({value:S,label:S.toString()})),w=b[0].value;return{axis:ze.cloneDeep(m),...d[y]&&{column:d[y]},options:b,defaultValue:w}})}function _V(t,e,n,o){const i=t.length,l=[];for(let c=0;c<e[0].data.length;++c){const d=[],p=(o++).toString();for(const m of n)d.push(e[m].data[c]);const h={key:d,id:p};for(let m=0;m<i;++m){const y=t[m].toString(),b=e[m].data[c],w=e[m].type;Xy(e[m].absent,c)?h[y]=void 0:mu(b,w)||b===null?h[y]=null:h[y]=ih(b,w)}l.push(h)}return l}const CV=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function vV(t,e,n,o){const i=await t.getSpec(e);let l=i.findIndex(v=>v.type==="column");l===-1&&(l=i.length);const c=[...i.keys()].filter(v=>!ze.find(n,L=>ze.isEqual(L.axis,i[v].id)||ze.isEqual(L.column,i[v].id))).sort((v,L)=>{var P,V;if(i[v].type!==i[L].type)return i[v].type==="axis"?-1:1;const I=(P=i[v].spec.annotations)==null?void 0:P["pl7.app/table/orderPriority"],W=(V=i[L].spec.annotations)==null?void 0:V["pl7.app/table/orderPriority"];return I===void 0?W===void 0?0:1:W===void 0?-1:Number(W)-Number(I)}),d=ze.cloneDeep(c),p=iV(i,c);for(let v=c.length-1;v>=0;--v){const L=c[v];if(!CV(i[L]))continue;const I=dl(i[L].spec.axesSpec[0]),W=ze.findIndex(c,P=>ze.isEqual(i[P].id,I));if(W===-1&&ze.findIndex(n,V=>ze.isEqual(V.axis,I))===-1){console.warn(`added label column, but the axis is not in the data; axisId: ${I}`);continue}c[W]=L;for(const P of p)P.axisIdx===L&&(P.axisIdx=W);c.splice(v,1),d.splice(v,1)}const h=await t.getShape(e),m=h.rows,y=[lV(),...d.map(v=>fV(v,i[v],o))];if(p.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",p.length," transposition will not be applied."),p.length===1)return sV(p,h,y,await t.getData(e,c),d,c);const b=[...c],w=new Map;for(let v=0;v<l;++v)w.set(v,-1);for(let v=0;v<b.length;++v){const L=b[v];w.has(L)&&w.set(L,v)}for(const[v,L]of w)L===-1&&(w.set(v,b.length),b.push(v));const S=[];for(let v=0;v<l;++v){const L=w.get(v);if(L===void 0||L===-1)throw new Error("assertion exception");S.push(L)}let M;return{rowModelType:"serverSide",columnDefs:y,serverSideDatasource:{getRows:async v=>{try{if(m==0){v.success({rowData:[],rowCount:m}),v.api.setGridOption("loading",!1),v.api.showNoRowsOverlay();return}if(M&&!ze.isEqual(M.request.sortModel,v.request.sortModel)){M=void 0,v.api.setGridOption("loading",!0),v.success({rowData:[],rowCount:0});return}M=v;let L=0,I=[];if(m>0&&v.request.startRow!==void 0&&v.request.endRow!==void 0&&(L=Math.min(m,v.request.endRow)-v.request.startRow,L>0)){const W=await t.getData(e,b,{offset:v.request.startRow,length:L});I=_V(d,W,S,v.request.startRow)}v.success({rowData:I,rowCount:m}),v.api.setGridOption("loading",!1)}catch(L){v.api.setGridOption("loading",!0),v.fail(),console.trace(L)}}}}}const Ql=Og(),wV=["onClick"],ah=r.defineComponent({__name:"PlAgGridColumnManager",props:{api:{}},setup(t){const e=t,{api:n}=r.toRefs(e),o=r.ref([]),i=r.ref(),l=r.ref(!1),c=r.ref(0);Xp(i,{handle:".handle",onChange(h){n.value.moveColumns(p(h.map(m=>o.value[m])),0)}});function d(h){n.value.setColumnsVisible([h],!h.isVisible())}function p(h){const m=h.findIndex(y=>y.getId()===Yr);if(m!==0){const[y]=h.splice(m,1);return h.splice(0,0,y)}return h}return r.onMounted(()=>{n.value.getAllGridColumns().length>0&&n.value.moveColumns(p(n.value.getAllGridColumns()),0),n.value.addEventListener("displayedColumnsChanged",()=>{o.value=[...n.value.getAllGridColumns()??[]],c.value++}),o.value=n.value.getAllGridColumns()??[]}),(h,m)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createBlock(r.Teleport,{to:`#${r.unref(Ql)}`},[r.createVNode(r.unref(vo),{onClick:m[0]||(m[0]=r.withModifiers(y=>l.value=!l.value,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(At),{name:"columns"})]),default:r.withCtx(()=>[m[2]||(m[2]=r.createTextVNode(" Columns "))]),_:1})],8,["to"])),r.createVNode(r.unref(Ps),{modelValue:l.value,"onUpdate:modelValue":m[1]||(m[1]=y=>l.value=y),width:"368px","close-on-outside-click":""},{title:r.withCtx(()=>m[3]||(m[3]=[r.createTextVNode("Columns")])),default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("div",{ref_key:"listRef",ref:i,key:c.value,class:"pl-ag-columns"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,y=>(r.openBlock(),r.createElementBlock("div",{key:y.getId(),class:"pl-ag-columns__item"},[r.createElementVNode("div",{class:r.normalizeClass([{handle:!y.getColDef().lockPosition},"pl-ag-columns__drag"])},[r.createVNode(r.unref(Vt),{name:"drag-dots"})],2),r.createElementVNode("div",{class:r.normalizeClass([{visible:y.isVisible()},"pl-ag-columns__title text-s-btn"])},r.toDisplayString(y.getColDef().headerName),3),r.createElementVNode("div",{class:"pl-ag-columns__visibility",onClick:b=>d(y)},[r.createVNode(r.unref(Ct),{"close-delay":500,position:"top"},{tooltip:r.withCtx(()=>m[4]||(m[4]=[r.createTextVNode("Show/Hide")])),default:r.withCtx(()=>[r.createVNode(r.unref(At),{name:y.isVisible()?"view-show":"view-hide"},null,8,["name"])]),_:2},1024)],8,wV)]))),128))]))]),_:1},8,["modelValue"])]))}}),bV=["id"],xV=r.defineComponent({__name:"PlAgDataTableToolsPanel",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(Ql),class:"d-flex gap-6"},[r.renderSlot(e.$slots,"default")],8,bV))}}),kV={class:"ap-ag-data-table-container"},EV={key:1,class:"ap-ag-data-table-sheets"},SV=Jl(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{},showColumnsPanel:{type:Boolean}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:r.mergeModels(["onRowDoubleClicked","columnsChanged"],["update:modelValue"]),setup(t,{expose:e,emit:n}){T.ModuleRegistry.registerModules([ps.ClientSideRowModelModule,Hd.ClipboardModule,jd.ServerSideRowModelModule,qd.RangeSelectionModule,fl,Mu]);const o=r.useModel(t,"modelValue"),i=t,{settings:l}=r.toRefs(i),c=n;r.watch(()=>l.value,async(k,x)=>{if(k.sourceType!=="pframe"||!k.pFrame||!k.join||x&&x.sourceType==="pframe"&&ze.isEqual(k.pFrame,x.pFrame)&&ze.isEqual(k.join,x.join))return;const B=window.platforma;if(!B)throw Error("platforma not set");const G=B.pFrameDriver;if(!G)throw Error("platforma.pFrameDriver not set");const H=await gV(G,k.pFrame,k.join),K=o.value;K.pTableParams||(K.pTableParams={sorting:[],filters:[]}),K.pTableParams.join=H,o.value=K});const d=Gh(()=>l.value.sourceType,async k=>{var B;const x=l.value.sourceType;switch(x){case"pframe":{const G=window.platforma;if(!G)throw Error("platforma not set");const H=G.pFrameDriver;if(!H)throw Error("platforma.pFrameDriver not set");if(!l.value.pFrame)return[];const K=l.value.pFrame,ne=(B=o.value.pTableParams)==null?void 0:B.join;return ne?await yV(H,K,l.value.sheetAxes,ne):[]}case"ptable":return l.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${x}`)}});function p(k){if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return(k==null?void 0:k.sortModel.map(x=>{const{spec:B,...G}=rh(x.colId);return{column:G,ascending:x.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const h=r.computed({get:()=>{const k=o.value;return{columnOrder:k.gridState.columnOrder,sort:k.gridState.sort,columnVisibility:k.gridState.columnVisibility}},set:k=>{const x=o.value,B=S.value.rowModelType==="clientSide"?void 0:p(k.sort);x.gridState={...x.gridState,...k},(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(x.pTableParams||(x.pTableParams={sorting:[],filters:[]}),x.pTableParams.sorting=B),o.value=x}}),m=k=>$r(k);function y(k){var x;if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return((x=d.value)==null?void 0:x.map(B=>({type:"bySingleColumnV2",column:B.column?{type:"column",id:B.column}:{type:"axis",id:B.axis},predicate:{operator:"Equal",reference:k[m(B.axis)]}})))??[]}const b=r.computed({get:()=>o.value.gridState.sheets??{},set:k=>{const x=y(k),B=o.value;B.gridState.sheets=k,(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(B.pTableParams||(B.pTableParams={sorting:[],filters:[]}),B.pTableParams.filters=x),o.value=B}});r.watch(()=>[l.value,d.value],(k,x)=>{const[B,G]=k;if(!G)return;if(x){const[K,ne]=x;if((B.sourceType==="ptable"||B.sourceType==="pframe")&&B.sourceType===(K==null?void 0:K.sourceType)&&ze.isEqual(G,ne))return}if(B.sourceType!=="ptable"&&B.sourceType!=="pframe"){b.value={};return}const H=b.value;for(const K of G){const ne=m(K.axis);H[ne]||(H[ne]=K.defaultValue??K.options[0].value)}b.value=H},{immediate:!0});const w=r.shallowRef(),S=r.shallowRef({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:h.value,autoSizeStrategy:{type:"fitCellContents"},onRowDoubleClicked:k=>{k.data&&c("onRowDoubleClicked",k.data.key)},onSortChanged:k=>{k.api.refreshCells()},onFilterChanged:k=>{k.api.refreshCells()},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:k=>k.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:Jp,noRowsOverlayComponent:Qp,sideBar:{},defaultCsvExportParams:{allColumns:!0,suppressQuotes:!0,fileName:"table.csv"}}),M=k=>{const x=k.api;uV(x),w.value=new Proxy(x,{get(B,G,H){switch(G){case"setGridOption":return(K,ne)=>{const pe=S.value;pe[K]=ne,S.value=pe,x.setGridOption(K,ne)};case"updateGridOptions":return K=>{S.value={...S.value,...K},x.updateGridOptions(K)};default:return Reflect.get(B,G,H)}}})},O=k=>({columnOrder:k.columnOrder,sort:k.sort,columnVisibility:k.columnVisibility??(k.columnOrder?{hiddenColIds:[]}:void 0)}),v=k=>{S.value.initialState=h.value=O(k.state),k.api.autoSizeColumns(k.api.getAllDisplayedColumns().filter(x=>x.getColId()!==Yr))},L=()=>{S.value.initialState=h.value=O(w.value.getState()),w.value=void 0};let I=!1;const W=()=>{if(!I)return;const k=w.value;k!==void 0&&(k.exportDataAsCsv(),I=!1,k.setGridOption("cacheBlockSize",100))},P=()=>{if(!I)return;const k=w.value;if(k===void 0)return;const x=k.getServerSideGroupLevelState()[0];x.cacheBlockSize===x.rowCount&&k.refreshServerSide({route:x.route,purge:!1})};e({exportCsv:async()=>{const k=w.value;if(k!==void 0){if(S.value.rowModelType==="clientSide"){k.exportDataAsCsv();return}if(S.value.rowModelType==="serverSide"){const x=k.getServerSideGroupLevelState()[0];if(x.rowCount<=x.cacheBlockSize){k.exportDataAsCsv();return}I||(I=!0,k.setGridOption("cacheBlockSize",x.rowCount))}}}});const Z=r.ref(0);r.watch(()=>[w.value,h.value],(k,x)=>{if(ze.isEqual(k,x))return;const[B,G]=k;if(!B)return;const H=O(B.getState());ze.isEqual(G,H)||(S.value.initialState=G,++Z.value)}),r.watch(()=>S.value,(k,x)=>{var B;if(x&&(k.rowModelType!=x.rowModelType&&++Z.value,!ze.isEqual(k.columnDefs,x.columnDefs)&&k.columnDefs)){const G=ne=>!("children"in ne),H=(B=k.columnDefs)==null?void 0:B.filter(G),K=H==null?void 0:H.map(ne=>ne.colId).filter(ne=>ne!==void 0).filter(ne=>ne!==Yr).map(ne=>rh(ne));c("columnsChanged",K??[])}});const J=(k,x)=>{var G;const B=b.value;B[k]!==x&&(B[k]=x,b.value=B,(G=w.value)==null||G.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))},ae=window.platforma;if(!ae)throw Error("platforma not set");const $=ae.pFrameDriver;if(!$)throw Error("platforma.pFrameDriver not set");const j=ae.blobDriver;if(!j)throw Error("platforma.blobDriver not set");let U;return r.watch(()=>[w.value,l.value,d.value],async k=>{var K,ne;const[x,B,G]=k;if(!x||ze.isEqual(B,U))return;U=B;const H=B.sourceType;switch(H){case"pframe":case"ptable":{const pe=B.pTable;if(!pe||!G)return x.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ke=(ne=(K=h.value)==null?void 0:K.columnVisibility)==null?void 0:ne.hiddenColIds,Ee=await vV($,pe,G,ke);return x.updateGridOptions({loading:Ee.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...Ee})}case"xsv":{const pe=B.xsvFile;if(!(pe!=null&&pe.ok)||!pe.value)return x.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ke=await rV(j,pe.value);return x.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...ke})}default:throw Error(`unsupported source type: ${H}`)}}),(k,x)=>(r.openBlock(),r.createElementBlock("div",kV,[w.value&&k.showColumnsPanel?(r.openBlock(),r.createBlock(r.unref(ah),{key:0,api:w.value},null,8,["api"])):r.createCommentVNode("",!0),r.unref(d).value&&r.unref(d).value.length>0?(r.openBlock(),r.createElementBlock("div",EV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(d).value,(B,G)=>(r.openBlock(),r.createBlock(r.unref(bp),{key:G,"model-value":b.value[m(B.axis)],options:B.options,"onUpdate:modelValue":H=>J(m(B.axis),H)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.unref(Dg.AgGridVue),{key:Z.value,theme:r.unref($u),class:"ap-ag-data-table-grid","grid-options":S.value,onGridReady:M,onStateUpdated:v,onGridPreDestroyed:L,onStoreRefreshed:W,onModelUpdated:P},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-6e23bf04"]]),TV={key:1,class:"alert-error"},NV={key:2},VV=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),o=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),i=r.computed(()=>n.value===void 0&&o.value===void 0);return(l,c)=>(r.openBlock(),r.createElementBlock("div",null,[n.value!==void 0?r.renderSlot(l.$slots,"default",r.normalizeProps(r.mergeProps({key:0},{value:n.value}))):r.createCommentVNode("",!0),o.value?(r.openBlock(),r.createElementBlock("div",TV,r.toDisplayString(o.value),1)):r.createCommentVNode("",!0),i.value?(r.openBlock(),r.createElementBlock("div",NV,"Unresolved")):r.createCommentVNode("",!0)]))}}),AV={style:{height:"100%"}},BV=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),o=r.computed(()=>e.params.value);function i(c){e.params.setValue(c)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(o.value):void 0);return(c,d)=>(r.openBlock(),r.createElementBlock("div",AV,[r.createVNode(r.unref(jp),{"show-filename-only":"",clearable:"","cell-style":"","file-dialog-title":"Select any file",placeholder:`Choose file ${n.value?n.value[0]:""}`,extensions:n.value,"model-value":o.value,progress:l.value,"onUpdate:modelValue":i},null,8,["placeholder","extensions","model-value","progress"])]))}}),PV={class:"pl-ag-grid-open-cell d-flex"},RV={class:"pl-ag-grid-open-cell__value"},DV=r.defineComponent({__name:"PlAgTextAndButtonCell",props:{params:{}},setup(t){const e=t;function n(){if(e.params.invokeRowsOnDoubleClick){const o=e.params.api,i={rowPinned:e.params.node.rowPinned,api:o,rowIndex:e.params.node.rowIndex,context:o,type:"rowDoubleClicked",node:e.params.node,data:e.params.data,event:null};o.dispatchEvent(i)}else e.params.onClick&&e.params.onClick(e.params)}return(o,i)=>(r.openBlock(),r.createElementBlock("div",PV,[r.createElementVNode("div",RV,r.toDisplayString(o.params.value),1),r.createElementVNode("div",{class:"pl-ag-grid-open-cell__activator text-caps11 align-center",onClick:r.withModifiers(n,["stop"])},[r.createVNode(r.unref(Vt),{name:o.params.icon??"maximize"},null,8,["name"]),r.createTextVNode(" "+r.toDisplayString(o.params.btnLabel??"Open"),1)])]))}});var ec={exports:{}};const IV="2.0.0",lh=256,FV=Number.MAX_SAFE_INTEGER||9007199254740991,LV=16,OV=lh-6;var Zs={MAX_LENGTH:lh,MAX_SAFE_COMPONENT_LENGTH:LV,MAX_SAFE_BUILD_LENGTH:OV,MAX_SAFE_INTEGER:FV,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:IV,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Ws=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:i}=Zs,l=Ws;e=t.exports={};const c=e.re=[],d=e.safeRe=[],p=e.src=[],h=e.t={};let m=0;const y="[a-zA-Z0-9-]",b=[["\\s",1],["\\d",i],[y,o]],w=M=>{for(const[O,v]of b)M=M.split(`${O}*`).join(`${O}{0,${v}}`).split(`${O}+`).join(`${O}{1,${v}}`);return M},S=(M,O,v)=>{const L=w(O),I=m++;l(M,I,O),h[M]=I,p[I]=O,c[I]=new RegExp(O,v?"g":void 0),d[I]=new RegExp(L,v?"g":void 0)};S("NUMERICIDENTIFIER","0|[1-9]\\d*"),S("NUMERICIDENTIFIERLOOSE","\\d+"),S("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),S("MAINVERSION",`(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})`),S("MAINVERSIONLOOSE",`(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASEIDENTIFIER",`(?:${p[h.NUMERICIDENTIFIER]}|${p[h.NONNUMERICIDENTIFIER]})`),S("PRERELEASEIDENTIFIERLOOSE",`(?:${p[h.NUMERICIDENTIFIERLOOSE]}|${p[h.NONNUMERICIDENTIFIER]})`),S("PRERELEASE",`(?:-(${p[h.PRERELEASEIDENTIFIER]}(?:\\.${p[h.PRERELEASEIDENTIFIER]})*))`),S("PRERELEASELOOSE",`(?:-?(${p[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[h.PRERELEASEIDENTIFIERLOOSE]})*))`),S("BUILDIDENTIFIER",`${y}+`),S("BUILD",`(?:\\+(${p[h.BUILDIDENTIFIER]}(?:\\.${p[h.BUILDIDENTIFIER]})*))`),S("FULLPLAIN",`v?${p[h.MAINVERSION]}${p[h.PRERELEASE]}?${p[h.BUILD]}?`),S("FULL",`^${p[h.FULLPLAIN]}$`),S("LOOSEPLAIN",`[v=\\s]*${p[h.MAINVERSIONLOOSE]}${p[h.PRERELEASELOOSE]}?${p[h.BUILD]}?`),S("LOOSE",`^${p[h.LOOSEPLAIN]}$`),S("GTLT","((?:<|>)?=?)"),S("XRANGEIDENTIFIERLOOSE",`${p[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),S("XRANGEIDENTIFIER",`${p[h.NUMERICIDENTIFIER]}|x|X|\\*`),S("XRANGEPLAIN",`[v=\\s]*(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:${p[h.PRERELEASE]})?${p[h.BUILD]}?)?)?`),S("XRANGEPLAINLOOSE",`[v=\\s]*(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:${p[h.PRERELEASELOOSE]})?${p[h.BUILD]}?)?)?`),S("XRANGE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAIN]}$`),S("XRANGELOOSE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAINLOOSE]}$`),S("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),S("COERCE",`${p[h.COERCEPLAIN]}(?:$|[^\\d])`),S("COERCEFULL",p[h.COERCEPLAIN]+`(?:${p[h.PRERELEASE]})?(?:${p[h.BUILD]})?(?:$|[^\\d])`),S("COERCERTL",p[h.COERCE],!0),S("COERCERTLFULL",p[h.COERCEFULL],!0),S("LONETILDE","(?:~>?)"),S("TILDETRIM",`(\\s*)${p[h.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",S("TILDE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAIN]}$`),S("TILDELOOSE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAINLOOSE]}$`),S("LONECARET","(?:\\^)"),S("CARETTRIM",`(\\s*)${p[h.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",S("CARET",`^${p[h.LONECARET]}${p[h.XRANGEPLAIN]}$`),S("CARETLOOSE",`^${p[h.LONECARET]}${p[h.XRANGEPLAINLOOSE]}$`),S("COMPARATORLOOSE",`^${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]})$|^$`),S("COMPARATOR",`^${p[h.GTLT]}\\s*(${p[h.FULLPLAIN]})$|^$`),S("COMPARATORTRIM",`(\\s*)${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]}|${p[h.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",S("HYPHENRANGE",`^\\s*(${p[h.XRANGEPLAIN]})\\s+-\\s+(${p[h.XRANGEPLAIN]})\\s*$`),S("HYPHENRANGELOOSE",`^\\s*(${p[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[h.XRANGEPLAINLOOSE]})\\s*$`),S("STAR","(<|>)?=?\\s*\\*"),S("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),S("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ec,ec.exports);var Mi=ec.exports;const MV=Object.freeze({loose:!0}),GV=Object.freeze({});var tc=t=>t?typeof t!="object"?MV:t:GV;const ch=/^[0-9]+$/,dh=(t,e)=>{const n=ch.test(t),o=ch.test(e);return n&&o&&(t=+t,e=+e),t===e?0:n&&!o?-1:o&&!n?1:t<e?-1:1};var uh={compareIdentifiers:dh,rcompareIdentifiers:(t,e)=>dh(e,t)};const js=Ws,{MAX_LENGTH:ph,MAX_SAFE_INTEGER:Hs}=Zs,{safeRe:hh,t:fh}=Mi,$V=tc,{compareIdentifiers:No}=uh;var Pt=class Hn{constructor(e,n){if(n=$V(n),e instanceof Hn){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ph)throw new TypeError(`version is longer than ${ph} characters`);js("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const o=e.trim().match(n.loose?hh[fh.LOOSE]:hh[fh.FULL]);if(!o)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>Hs||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Hs||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Hs||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const l=+i;if(l>=0&&l<Hs)return l}return i}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(js("SemVer.compare",this.version,this.options,e),!(e instanceof Hn)){if(typeof e=="string"&&e===this.version)return 0;e=new Hn(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof Hn||(e=new Hn(e,this.options)),No(this.major,e.major)||No(this.minor,e.minor)||No(this.patch,e.patch)}comparePre(e){if(e instanceof Hn||(e=new Hn(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const o=this.prerelease[n],i=e.prerelease[n];if(js("prerelease compare",n,o,i),o===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(o===void 0)return-1;if(o===i)continue;return No(o,i)}while(++n)}compareBuild(e){e instanceof Hn||(e=new Hn(e,this.options));let n=0;do{const o=this.build[n],i=e.build[n];if(js("build compare",n,o,i),o===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(o===void 0)return-1;if(o===i)continue;return No(o,i)}while(++n)}inc(e,n,o){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,o),this.inc("pre",n,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,o),this.inc("pre",n,o);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(o)?1:0;if(!n&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let l=this.prerelease.length;for(;--l>=0;)typeof this.prerelease[l]=="number"&&(this.prerelease[l]++,l=-2);if(l===-1){if(n===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let l=[n,i];o===!1&&(l=[n]),No(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=l):this.prerelease=l}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const mh=Pt;var Vo=(t,e,n=!1)=>{if(t instanceof mh)return t;try{return new mh(t,e)}catch(o){if(!n)return null;throw o}};const zV=Vo;var UV=(t,e)=>{const n=zV(t,e);return n?n.version:null};const ZV=Vo;var WV=(t,e)=>{const n=ZV(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};const gh=Pt;var jV=(t,e,n,o,i)=>{typeof n=="string"&&(i=o,o=n,n=void 0);try{return new gh(t instanceof gh?t.version:t,n).inc(e,o,i).version}catch{return null}};const yh=Vo;var HV=(t,e)=>{const n=yh(t,null,!0),o=yh(e,null,!0),i=n.compare(o);if(i===0)return null;const l=i>0,c=l?n:o,d=l?o:n,p=!!c.prerelease.length;if(!!d.prerelease.length&&!p)return!d.patch&&!d.minor?"major":c.patch?"patch":c.minor?"minor":"major";const m=p?"pre":"";return n.major!==o.major?m+"major":n.minor!==o.minor?m+"minor":n.patch!==o.patch?m+"patch":"prerelease"};const qV=Pt;var KV=(t,e)=>new qV(t,e).major;const YV=Pt;var XV=(t,e)=>new YV(t,e).minor;const JV=Pt;var QV=(t,e)=>new JV(t,e).patch;const eA=Vo;var tA=(t,e)=>{const n=eA(t,e);return n&&n.prerelease.length?n.prerelease:null};const _h=Pt;var _n=(t,e,n)=>new _h(t,n).compare(new _h(e,n));const nA=_n;var rA=(t,e,n)=>nA(e,t,n);const oA=_n;var iA=(t,e)=>oA(t,e,!0);const Ch=Pt;var nc=(t,e,n)=>{const o=new Ch(t,n),i=new Ch(e,n);return o.compare(i)||o.compareBuild(i)};const sA=nc;var aA=(t,e)=>t.sort((n,o)=>sA(n,o,e));const lA=nc;var cA=(t,e)=>t.sort((n,o)=>lA(o,n,e));const dA=_n;var qs=(t,e,n)=>dA(t,e,n)>0;const uA=_n;var rc=(t,e,n)=>uA(t,e,n)<0;const pA=_n;var vh=(t,e,n)=>pA(t,e,n)===0;const hA=_n;var wh=(t,e,n)=>hA(t,e,n)!==0;const fA=_n;var oc=(t,e,n)=>fA(t,e,n)>=0;const mA=_n;var ic=(t,e,n)=>mA(t,e,n)<=0;const gA=vh,yA=wh,_A=qs,CA=oc,vA=rc,wA=ic;var bh=(t,e,n,o)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return gA(t,n,o);case"!=":return yA(t,n,o);case">":return _A(t,n,o);case">=":return CA(t,n,o);case"<":return vA(t,n,o);case"<=":return wA(t,n,o);default:throw new TypeError(`Invalid operator: ${e}`)}};const bA=Pt,xA=Vo,{safeRe:Ks,t:Ys}=Mi;var kA=(t,e)=>{if(t instanceof bA)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?Ks[Ys.COERCEFULL]:Ks[Ys.COERCE]);else{const p=e.includePrerelease?Ks[Ys.COERCERTLFULL]:Ks[Ys.COERCERTL];let h;for(;(h=p.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||h.index+h[0].length!==n.index+n[0].length)&&(n=h),p.lastIndex=h.index+h[1].length+h[2].length;p.lastIndex=-1}if(n===null)return null;const o=n[2],i=n[3]||"0",l=n[4]||"0",c=e.includePrerelease&&n[5]?`-${n[5]}`:"",d=e.includePrerelease&&n[6]?`+${n[6]}`:"";return xA(`${o}.${i}.${l}${c}${d}`,e)},EA=class{constructor(){this.max=1e3,this.map=new Map}get(e){const n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(e,n)}return this}},sc,xh;function Cn(){if(xh)return sc;xh=1;const t=/\s+/g;class e{constructor(B,G){if(G=i(G),B instanceof e)return B.loose===!!G.loose&&B.includePrerelease===!!G.includePrerelease?B:new e(B.raw,G);if(B instanceof l)return this.raw=B.value,this.set=[[B]],this.formatted=void 0,this;if(this.options=G,this.loose=!!G.loose,this.includePrerelease=!!G.includePrerelease,this.raw=B.trim().replace(t," "),this.set=this.raw.split("||").map(H=>this.parseRange(H.trim())).filter(H=>H.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const H=this.set[0];if(this.set=this.set.filter(K=>!M(K[0])),this.set.length===0)this.set=[H];else if(this.set.length>1){for(const K of this.set)if(K.length===1&&O(K[0])){this.set=[K];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let B=0;B<this.set.length;B++){B>0&&(this.formatted+="||");const G=this.set[B];for(let H=0;H<G.length;H++)H>0&&(this.formatted+=" "),this.formatted+=G[H].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(B){const H=((this.options.includePrerelease&&w)|(this.options.loose&&S))+":"+B,K=o.get(H);if(K)return K;const ne=this.options.loose,pe=ne?p[h.HYPHENRANGELOOSE]:p[h.HYPHENRANGE];B=B.replace(pe,U(this.options.includePrerelease)),c("hyphen replace",B),B=B.replace(p[h.COMPARATORTRIM],m),c("comparator trim",B),B=B.replace(p[h.TILDETRIM],y),c("tilde trim",B),B=B.replace(p[h.CARETTRIM],b),c("caret trim",B);let ke=B.split(" ").map(Ke=>L(Ke,this.options)).join(" ").split(/\s+/).map(Ke=>j(Ke,this.options));ne&&(ke=ke.filter(Ke=>(c("loose invalid filter",Ke,this.options),!!Ke.match(p[h.COMPARATORLOOSE])))),c("range list",ke);const Ee=new Map,He=ke.map(Ke=>new l(Ke,this.options));for(const Ke of He){if(M(Ke))return[Ke];Ee.set(Ke.value,Ke)}Ee.size>1&&Ee.has("")&&Ee.delete("");const It=[...Ee.values()];return o.set(H,It),It}intersects(B,G){if(!(B instanceof e))throw new TypeError("a Range is required");return this.set.some(H=>v(H,G)&&B.set.some(K=>v(K,G)&&H.every(ne=>K.every(pe=>ne.intersects(pe,G)))))}test(B){if(!B)return!1;if(typeof B=="string")try{B=new d(B,this.options)}catch{return!1}for(let G=0;G<this.set.length;G++)if(k(this.set[G],B,this.options))return!0;return!1}}sc=e;const n=EA,o=new n,i=tc,l=Xs(),c=Ws,d=Pt,{safeRe:p,t:h,comparatorTrimReplace:m,tildeTrimReplace:y,caretTrimReplace:b}=Mi,{FLAG_INCLUDE_PRERELEASE:w,FLAG_LOOSE:S}=Zs,M=x=>x.value==="<0.0.0-0",O=x=>x.value==="",v=(x,B)=>{let G=!0;const H=x.slice();let K=H.pop();for(;G&&H.length;)G=H.every(ne=>K.intersects(ne,B)),K=H.pop();return G},L=(x,B)=>(c("comp",x,B),x=V(x,B),c("caret",x),x=W(x,B),c("tildes",x),x=J(x,B),c("xrange",x),x=$(x,B),c("stars",x),x),I=x=>!x||x.toLowerCase()==="x"||x==="*",W=(x,B)=>x.trim().split(/\s+/).map(G=>P(G,B)).join(" "),P=(x,B)=>{const G=B.loose?p[h.TILDELOOSE]:p[h.TILDE];return x.replace(G,(H,K,ne,pe,ke)=>{c("tilde",x,H,K,ne,pe,ke);let Ee;return I(K)?Ee="":I(ne)?Ee=`>=${K}.0.0 <${+K+1}.0.0-0`:I(pe)?Ee=`>=${K}.${ne}.0 <${K}.${+ne+1}.0-0`:ke?(c("replaceTilde pr",ke),Ee=`>=${K}.${ne}.${pe}-${ke} <${K}.${+ne+1}.0-0`):Ee=`>=${K}.${ne}.${pe} <${K}.${+ne+1}.0-0`,c("tilde return",Ee),Ee})},V=(x,B)=>x.trim().split(/\s+/).map(G=>Z(G,B)).join(" "),Z=(x,B)=>{c("caret",x,B);const G=B.loose?p[h.CARETLOOSE]:p[h.CARET],H=B.includePrerelease?"-0":"";return x.replace(G,(K,ne,pe,ke,Ee)=>{c("caret",x,K,ne,pe,ke,Ee);let He;return I(ne)?He="":I(pe)?He=`>=${ne}.0.0${H} <${+ne+1}.0.0-0`:I(ke)?ne==="0"?He=`>=${ne}.${pe}.0${H} <${ne}.${+pe+1}.0-0`:He=`>=${ne}.${pe}.0${H} <${+ne+1}.0.0-0`:Ee?(c("replaceCaret pr",Ee),ne==="0"?pe==="0"?He=`>=${ne}.${pe}.${ke}-${Ee} <${ne}.${pe}.${+ke+1}-0`:He=`>=${ne}.${pe}.${ke}-${Ee} <${ne}.${+pe+1}.0-0`:He=`>=${ne}.${pe}.${ke}-${Ee} <${+ne+1}.0.0-0`):(c("no pr"),ne==="0"?pe==="0"?He=`>=${ne}.${pe}.${ke}${H} <${ne}.${pe}.${+ke+1}-0`:He=`>=${ne}.${pe}.${ke}${H} <${ne}.${+pe+1}.0-0`:He=`>=${ne}.${pe}.${ke} <${+ne+1}.0.0-0`),c("caret return",He),He})},J=(x,B)=>(c("replaceXRanges",x,B),x.split(/\s+/).map(G=>ae(G,B)).join(" ")),ae=(x,B)=>{x=x.trim();const G=B.loose?p[h.XRANGELOOSE]:p[h.XRANGE];return x.replace(G,(H,K,ne,pe,ke,Ee)=>{c("xRange",x,H,K,ne,pe,ke,Ee);const He=I(ne),It=He||I(pe),Ke=It||I(ke),Un=Ke;return K==="="&&Un&&(K=""),Ee=B.includePrerelease?"-0":"",He?K===">"||K==="<"?H="<0.0.0-0":H="*":K&&Un?(It&&(pe=0),ke=0,K===">"?(K=">=",It?(ne=+ne+1,pe=0,ke=0):(pe=+pe+1,ke=0)):K==="<="&&(K="<",It?ne=+ne+1:pe=+pe+1),K==="<"&&(Ee="-0"),H=`${K+ne}.${pe}.${ke}${Ee}`):It?H=`>=${ne}.0.0${Ee} <${+ne+1}.0.0-0`:Ke&&(H=`>=${ne}.${pe}.0${Ee} <${ne}.${+pe+1}.0-0`),c("xRange return",H),H})},$=(x,B)=>(c("replaceStars",x,B),x.trim().replace(p[h.STAR],"")),j=(x,B)=>(c("replaceGTE0",x,B),x.trim().replace(p[B.includePrerelease?h.GTE0PRE:h.GTE0],"")),U=x=>(B,G,H,K,ne,pe,ke,Ee,He,It,Ke,Un)=>(I(H)?G="":I(K)?G=`>=${H}.0.0${x?"-0":""}`:I(ne)?G=`>=${H}.${K}.0${x?"-0":""}`:pe?G=`>=${G}`:G=`>=${G}${x?"-0":""}`,I(He)?Ee="":I(It)?Ee=`<${+He+1}.0.0-0`:I(Ke)?Ee=`<${He}.${+It+1}.0-0`:Un?Ee=`<=${He}.${It}.${Ke}-${Un}`:x?Ee=`<${He}.${It}.${+Ke+1}-0`:Ee=`<=${Ee}`,`${G} ${Ee}`.trim()),k=(x,B,G)=>{for(let H=0;H<x.length;H++)if(!x[H].test(B))return!1;if(B.prerelease.length&&!G.includePrerelease){for(let H=0;H<x.length;H++)if(c(x[H].semver),x[H].semver!==l.ANY&&x[H].semver.prerelease.length>0){const K=x[H].semver;if(K.major===B.major&&K.minor===B.minor&&K.patch===B.patch)return!0}return!1}return!0};return sc}var ac,kh;function Xs(){if(kh)return ac;kh=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(m,y){if(y=n(y),m instanceof e){if(m.loose===!!y.loose)return m;m=m.value}m=m.trim().split(/\s+/).join(" "),c("comparator",m,y),this.options=y,this.loose=!!y.loose,this.parse(m),this.semver===t?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(m){const y=this.options.loose?o[i.COMPARATORLOOSE]:o[i.COMPARATOR],b=m.match(y);if(!b)throw new TypeError(`Invalid comparator: ${m}`);this.operator=b[1]!==void 0?b[1]:"",this.operator==="="&&(this.operator=""),b[2]?this.semver=new d(b[2],this.options.loose):this.semver=t}toString(){return this.value}test(m){if(c("Comparator.test",m,this.options.loose),this.semver===t||m===t)return!0;if(typeof m=="string")try{m=new d(m,this.options)}catch{return!1}return l(m,this.operator,this.semver,this.options)}intersects(m,y){if(!(m instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new p(m.value,y).test(this.value):m.operator===""?m.value===""?!0:new p(this.value,y).test(m.semver):(y=n(y),y.includePrerelease&&(this.value==="<0.0.0-0"||m.value==="<0.0.0-0")||!y.includePrerelease&&(this.value.startsWith("<0.0.0")||m.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&m.operator.startsWith(">")||this.operator.startsWith("<")&&m.operator.startsWith("<")||this.semver.version===m.semver.version&&this.operator.includes("=")&&m.operator.includes("=")||l(this.semver,"<",m.semver,y)&&this.operator.startsWith(">")&&m.operator.startsWith("<")||l(this.semver,">",m.semver,y)&&this.operator.startsWith("<")&&m.operator.startsWith(">")))}}ac=e;const n=tc,{safeRe:o,t:i}=Mi,l=bh,c=Ws,d=Pt,p=Cn();return ac}const SA=Cn();var Js=(t,e,n)=>{try{e=new SA(e,n)}catch{return!1}return e.test(t)};const TA=Cn();var NA=(t,e)=>new TA(t,e).set.map(n=>n.map(o=>o.value).join(" ").trim().split(" "));const VA=Pt,AA=Cn();var BA=(t,e,n)=>{let o=null,i=null,l=null;try{l=new AA(e,n)}catch{return null}return t.forEach(c=>{l.test(c)&&(!o||i.compare(c)===-1)&&(o=c,i=new VA(o,n))}),o};const PA=Pt,RA=Cn();var DA=(t,e,n)=>{let o=null,i=null,l=null;try{l=new RA(e,n)}catch{return null}return t.forEach(c=>{l.test(c)&&(!o||i.compare(c)===1)&&(o=c,i=new PA(o,n))}),o};const lc=Pt,IA=Cn(),Eh=qs;var FA=(t,e)=>{t=new IA(t,e);let n=new lc("0.0.0");if(t.test(n)||(n=new lc("0.0.0-0"),t.test(n)))return n;n=null;for(let o=0;o<t.set.length;++o){const i=t.set[o];let l=null;i.forEach(c=>{const d=new lc(c.semver.version);switch(c.operator){case">":d.prerelease.length===0?d.patch++:d.prerelease.push(0),d.raw=d.format();case"":case">=":(!l||Eh(d,l))&&(l=d);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),l&&(!n||Eh(n,l))&&(n=l)}return n&&t.test(n)?n:null};const LA=Cn();var OA=(t,e)=>{try{return new LA(t,e).range||"*"}catch{return null}};const MA=Pt,Sh=Xs(),{ANY:GA}=Sh,$A=Cn(),zA=Js,Th=qs,Nh=rc,UA=ic,ZA=oc;var cc=(t,e,n,o)=>{t=new MA(t,o),e=new $A(e,o);let i,l,c,d,p;switch(n){case">":i=Th,l=UA,c=Nh,d=">",p=">=";break;case"<":i=Nh,l=ZA,c=Th,d="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(zA(t,e,o))return!1;for(let h=0;h<e.set.length;++h){const m=e.set[h];let y=null,b=null;if(m.forEach(w=>{w.semver===GA&&(w=new Sh(">=0.0.0")),y=y||w,b=b||w,i(w.semver,y.semver,o)?y=w:c(w.semver,b.semver,o)&&(b=w)}),y.operator===d||y.operator===p||(!b.operator||b.operator===d)&&l(t,b.semver))return!1;if(b.operator===p&&c(t,b.semver))return!1}return!0};const WA=cc;var jA=(t,e,n)=>WA(t,e,">",n);const HA=cc;var qA=(t,e,n)=>HA(t,e,"<",n);const Vh=Cn();var KA=(t,e,n)=>(t=new Vh(t,n),e=new Vh(e,n),t.intersects(e,n));const YA=Js,XA=_n;var JA=(t,e,n)=>{const o=[];let i=null,l=null;const c=t.sort((m,y)=>XA(m,y,n));for(const m of c)YA(m,e,n)?(l=m,i||(i=m)):(l&&o.push([i,l]),l=null,i=null);i&&o.push([i,null]);const d=[];for(const[m,y]of o)m===y?d.push(m):!y&&m===c[0]?d.push("*"):y?m===c[0]?d.push(`<=${y}`):d.push(`${m} - ${y}`):d.push(`>=${m}`);const p=d.join(" || "),h=typeof e.raw=="string"?e.raw:String(e);return p.length<h.length?p:e};const Ah=Cn(),dc=Xs(),{ANY:uc}=dc,Gi=Js,pc=_n,QA=(t,e,n={})=>{if(t===e)return!0;t=new Ah(t,n),e=new Ah(e,n);let o=!1;e:for(const i of t.set){for(const l of e.set){const c=tB(i,l,n);if(o=o||c!==null,c)continue e}if(o)return!1}return!0},eB=[new dc(">=0.0.0-0")],Bh=[new dc(">=0.0.0")],tB=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===uc){if(e.length===1&&e[0].semver===uc)return!0;n.includePrerelease?t=eB:t=Bh}if(e.length===1&&e[0].semver===uc){if(n.includePrerelease)return!0;e=Bh}const o=new Set;let i,l;for(const w of t)w.operator===">"||w.operator===">="?i=Ph(i,w,n):w.operator==="<"||w.operator==="<="?l=Rh(l,w,n):o.add(w.semver);if(o.size>1)return null;let c;if(i&&l){if(c=pc(i.semver,l.semver,n),c>0)return null;if(c===0&&(i.operator!==">="||l.operator!=="<="))return null}for(const w of o){if(i&&!Gi(w,String(i),n)||l&&!Gi(w,String(l),n))return null;for(const S of e)if(!Gi(w,String(S),n))return!1;return!0}let d,p,h,m,y=l&&!n.includePrerelease&&l.semver.prerelease.length?l.semver:!1,b=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;y&&y.prerelease.length===1&&l.operator==="<"&&y.prerelease[0]===0&&(y=!1);for(const w of e){if(m=m||w.operator===">"||w.operator===">=",h=h||w.operator==="<"||w.operator==="<=",i){if(b&&w.semver.prerelease&&w.semver.prerelease.length&&w.semver.major===b.major&&w.semver.minor===b.minor&&w.semver.patch===b.patch&&(b=!1),w.operator===">"||w.operator===">="){if(d=Ph(i,w,n),d===w&&d!==i)return!1}else if(i.operator===">="&&!Gi(i.semver,String(w),n))return!1}if(l){if(y&&w.semver.prerelease&&w.semver.prerelease.length&&w.semver.major===y.major&&w.semver.minor===y.minor&&w.semver.patch===y.patch&&(y=!1),w.operator==="<"||w.operator==="<="){if(p=Rh(l,w,n),p===w&&p!==l)return!1}else if(l.operator==="<="&&!Gi(l.semver,String(w),n))return!1}if(!w.operator&&(l||i)&&c!==0)return!1}return!(i&&h&&!l&&c!==0||l&&m&&!i&&c!==0||b||y)},Ph=(t,e,n)=>{if(!t)return e;const o=pc(t.semver,e.semver,n);return o>0?t:o<0||e.operator===">"&&t.operator===">="?e:t},Rh=(t,e,n)=>{if(!t)return e;const o=pc(t.semver,e.semver,n);return o<0?t:o>0||e.operator==="<"&&t.operator==="<="?e:t};var nB=QA;const hc=Mi,Dh=Zs,rB=Pt,Ih=uh,oB=Vo,iB=UV,sB=WV,aB=jV,lB=HV,cB=KV,dB=XV,uB=QV,pB=tA,hB=_n,fB=rA,mB=iA,gB=nc,yB=aA,_B=cA,CB=qs,vB=rc,wB=vh,bB=wh,xB=oc,kB=ic,EB=bh,SB=kA,TB=Xs(),NB=Cn();var VB={parse:oB,valid:iB,clean:sB,inc:aB,diff:lB,major:cB,minor:dB,patch:uB,prerelease:pB,compare:hB,rcompare:fB,compareLoose:mB,compareBuild:gB,sort:yB,rsort:_B,gt:CB,lt:vB,eq:wB,neq:bB,gte:xB,lte:kB,cmp:EB,coerce:SB,Comparator:TB,Range:NB,satisfies:Js,toComparators:NA,maxSatisfying:BA,minSatisfying:DA,minVersion:FA,validRange:OA,outside:cc,gtr:jA,ltr:qA,intersects:KA,simplifyRange:JA,subset:nB,SemVer:rB,re:hc.re,src:hc.src,tokens:hc.t,SEMVER_SPEC_VERSION:Dh.SEMVER_SPEC_VERSION,RELEASE_TYPES:Dh.RELEASE_TYPES,compareIdentifiers:Ih.compareIdentifiers,rcompareIdentifiers:Ih.rcompareIdentifiers};const AB=Qd(VB);function BB(t){return $r(t.id)}function PB(t){switch(t){case"isNotNA":return"Is not NA";case"isNA":return"Is NA";case"number_equals":case"string_equals":return"Equals";case"number_notEquals":case"string_notEquals":return"Not equals";case"number_greaterThan":return"Greater than";case"number_greaterThanOrEqualTo":return"Greater than or equal to";case"number_lessThan":return"Less than";case"number_lessThanOrEqualTo":return"Less than or equal to";case"number_between":return"Between";case"string_contains":return"Contains";case"string_doesNotContain":return"Does not contain";case"string_matches":return"Matches";case"string_doesNotMatch":return"Does not match";case"string_containsFuzzyMatch":return"Contains fuzzy match";default:throw Error(`unsupported filter type: ${t}`)}}const RB=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],DB=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"];function Fh(t,e){var n,o;return((o=(n=t.spec.annotations)==null?void 0:n["pl7.app/label"])==null?void 0:o.trim())??"Unlabeled "+t.type+" "+e.toString()}function IB(t){const e=t.type;switch(e){case"isNotNA":case"isNA":return;case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return t.reference;case"number_between":return t.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return t.reference;default:throw Error(`unsupported filter type: ${e}`)}}function Lh(t,e){switch(t){case"isNotNA":case"isNA":return{type:t};case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return{type:t,reference:typeof e=="number"?e:0};case"number_between":return{type:t,lowerBound:typeof e=="number"?e:0,includeLowerBound:!0,upperBound:100,includeUpperBound:!1};case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":return{type:t,reference:typeof e=="string"?e:""};case"string_containsFuzzyMatch":return{type:t,reference:typeof e=="string"?e:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${t}`)}}function FB(t,e){return{columnId:t.columnId,filter:Lh(e,IB(t.filter)),disabled:t.disabled}}function fc(t,e){var c,d;const n=Number(e);if(!Number.isFinite(n))throw Error("Model value is not a number.");const o=t.type==="column"?t.spec.valueType:t.spec.type;if((o==="Int"||o==="Long")&&!Number.isInteger(n))throw Error("Model value is not an integer.");const i=(c=t.spec.annotations)==null?void 0:c["pl7.app/min"];if(i!==void 0){const p=Number(i);if(Number.isFinite(p)&&n<Number(i))throw Error("Model value is too low.")}const l=(d=t.spec.annotations)==null?void 0:d["pl7.app/max"];if(l!==void 0){const p=Number(l);if(Number.isFinite(p)&&n>Number(l))throw Error("Model value is too high.")}return n}function Oh(t,e){var o,i;const n=((o=t.spec.domain)==null?void 0:o["pl7.app/alphabet"])??((i=t.spec.annotations)==null?void 0:i["pl7.app/alphabet"]);if(n==="nucleotide"&&!/^[AaTtGgCcNn]+$/.test(e))throw Error("Model value is not a nucleotide.");if(n==="aminoacid"&&!/^[AaCcDdEeFfGgHhIiKkLlMmNnPpQqRrSsTtVvWwYyXx]+$/.test(e))throw Error("Model value is not an aminoacid.");return e}function LB(t){try{return new RegExp(t),t}catch(e){throw e instanceof SyntaxError?Error("Model value is not a regexp."):e}}function OB(t,e){var i,l;const n=((i=t.spec.domain)==null?void 0:i["pl7.app/alphabet"])??((l=t.spec.annotations)==null?void 0:l["pl7.app/alphabet"]);if(n==="nucleotide")return[{value:"N",text:"N"}];if(n==="aminoacid")return[{value:"X",text:"X"}];const o=ze.uniq(e);return o.sort(),o.map(c=>({value:c,text:c}))}function MB(t,e){var i,l;const n=AB.gt(yu().sdkInfo.sdkVersion,"1.14.0")&&(t.type==="column"?t.spec.valueType:t.spec.type)==="String"&&(((i=t.spec.domain)==null?void 0:i["pl7.app/alphabet"])??((l=t.spec.annotations)==null?void 0:l["pl7.app/alphabet"]))!==void 0,o=e.type;switch(o){case"isNotNA":return{operator:"Not",operand:{operator:"IsNA"}};case"isNA":return{operator:"IsNA"};case"number_equals":return{operator:"Equal",reference:e.reference};case"string_equals":return{operator:n?"IEqual":"Equal",reference:e.reference};case"number_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:e.reference}};case"string_notEquals":return{operator:"Not",operand:{operator:n?"IEqual":"Equal",reference:e.reference}};case"number_greaterThan":return{operator:"Greater",reference:e.reference};case"number_greaterThanOrEqualTo":return{operator:"GreaterOrEqual",reference:e.reference};case"number_lessThan":return{operator:"Less",reference:e.reference};case"number_lessThanOrEqualTo":return{operator:"LessOrEqual",reference:e.reference};case"number_between":return{operator:"And",operands:[{operator:e.includeLowerBound?"GreaterOrEqual":"Greater",reference:e.lowerBound},{operator:e.includeUpperBound?"LessOrEqual":"Less",reference:e.upperBound}]};case"string_contains":return{operator:n?"StringIContains":"StringContains",substring:e.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:n?"StringIContains":"StringContains",substring:e.reference}};case"string_matches":return{operator:"Matches",regex:e.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:e.reference}};case"string_containsFuzzyMatch":return{operator:n?"StringIContainsFuzzy":"StringContainsFuzzy",reference:e.reference,maxEdits:e.maxEdits,substitutionsOnly:e.substitutionsOnly,wildcard:e.wildcard};default:throw Error(`unsupported filter type: ${o}`)}}const GB={class:"d-flex flex-column gap-24"},Mh=r.defineComponent({__name:"PlTableFilterEntry",props:r.mergeModels({column:{},options:{},disabled:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{column:o,options:i}=r.toRefs(n);return(l,c)=>(r.openBlock(),r.createElementBlock("div",GB,[r.createVNode(r.unref(wo),{"model-value":e.value.filter.type,options:r.unref(i),disabled:l.disabled,label:"Predicate","onUpdate:modelValue":c[0]||(c[0]=d=>e.value=r.unref(FB)(e.value,d))},null,8,["model-value","options","disabled"]),e.value.filter.type==="number_equals"||e.value.filter.type==="number_notEquals"||e.value.filter.type==="number_lessThan"||e.value.filter.type==="number_lessThanOrEqualTo"||e.value.filter.type==="number_greaterThan"||e.value.filter.type==="number_greaterThanOrEqualTo"?(r.openBlock(),r.createBlock(r.unref(jr),{key:0,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[1]||(c[1]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(fc)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createVNode(r.unref(jr),{modelValue:e.value.filter.lowerBound,"onUpdate:modelValue":c[2]||(c[2]=d=>e.value.filter.lowerBound=d),disabled:l.disabled,parse:d=>r.unref(fc)(r.unref(o),d),label:"Lower bound"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(Rs),{modelValue:e.value.filter.includeLowerBound,"onUpdate:modelValue":c[3]||(c[3]=d=>e.value.filter.includeLowerBound=d),disabled:l.disabled,label:"Include lower bound"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(jr),{modelValue:e.value.filter.upperBound,"onUpdate:modelValue":c[4]||(c[4]=d=>e.value.filter.upperBound=d),disabled:l.disabled,parse:d=>r.unref(fc)(r.unref(o),d),label:"Upper bound"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(Rs),{modelValue:e.value.filter.includeUpperBound,"onUpdate:modelValue":c[5]||(c[5]=d=>e.value.filter.includeUpperBound=d),disabled:l.disabled,label:"Include upper bound"},null,8,["modelValue","disabled"])],64)):r.createCommentVNode("",!0),e.value.filter.type==="string_equals"||e.value.filter.type==="string_notEquals"||e.value.filter.type==="string_contains"||e.value.filter.type==="string_doesNotContain"?(r.openBlock(),r.createBlock(r.unref(jr),{key:2,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[6]||(c[6]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(Oh)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="string_matches"||e.value.filter.type==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(jr),{key:3,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[7]||(c[7]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:r.unref(LB),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:4},[r.createVNode(r.unref(jr),{modelValue:e.value.filter.reference,"onUpdate:modelValue":c[8]||(c[8]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(Oh)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(qp),{modelValue:e.value.filter.maxEdits,"onUpdate:modelValue":c[9]||(c[9]=d=>e.value.filter.maxEdits=d),max:5,disabled:l.disabled,breakpoints:"",label:"Maximum nuber of substitutions and indels"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(Rs),{modelValue:e.value.filter.substitutionsOnly,"onUpdate:modelValue":c[10]||(c[10]=d=>e.value.filter.substitutionsOnly=d),disabled:l.disabled,label:"Substitutions only"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(wo),{modelValue:e.value.filter.wildcard,"onUpdate:modelValue":c[11]||(c[11]=d=>e.value.filter.wildcard=d),disabled:l.disabled,options:r.unref(OB)(r.unref(o),e.value.filter.reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","disabled","options"])],64)):r.createCommentVNode("",!0)]))}}),$B={class:"d-flex flex-column gap-24"},zB={key:0,class:"text-subtitle-m",style:{color:"var(--txt-mask)"}},UB=r.defineComponent({__name:"PlTableAddFilter",props:r.mergeModels({columnsById:{},columnOptions:{},filterOptions:{},makeFilter:{type:Function}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:r.mergeModels(["addFilter"],["update:modelValue"]),setup(t,{emit:e}){const n=r.useModel(t,"modelValue"),o=t,{columnsById:i,columnOptions:l,filterOptions:c}=r.toRefs(o),d=e,p=r.ref(),h=r.ref();r.watch(()=>p.value,b=>{b?h.value=o.makeFilter(b):h.value=void 0});const m=()=>{p.value=void 0,n.value=!1},y=()=>{h.value&&(d("addFilter",h.value),m())};return(b,w)=>(r.openBlock(),r.createBlock(r.unref(Ps),{modelValue:n.value,"onUpdate:modelValue":w[2]||(w[2]=S=>n.value=S),"close-on-outside-click":!1},{title:r.withCtx(()=>w[3]||(w[3]=[r.createTextVNode("Add Filter")])),actions:r.withCtx(()=>[r.createVNode(r.unref(Ns),{disabled:!h.value,onClick:y},{default:r.withCtx(()=>w[4]||(w[4]=[r.createTextVNode("Add Filter")])),_:1},8,["disabled"]),r.createVNode(r.unref(vo),{"justify-center":!1,onClick:m},{default:r.withCtx(()=>w[5]||(w[5]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",$B,[r.createVNode(r.unref(wo),{modelValue:p.value,"onUpdate:modelValue":w[0]||(w[0]=S=>p.value=S),options:r.unref(l),label:"Column",placeholder:"Choose..."},null,8,["modelValue","options"]),h.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",zB,"Choose a column to view and adjust its options")),h.value?(r.openBlock(),r.createBlock(Mh,{key:1,modelValue:h.value,"onUpdate:modelValue":w[1]||(w[1]=S=>h.value=S),column:r.unref(i)[h.value.columnId],options:r.unref(c)[h.value.columnId]},null,8,["modelValue","column","options"])):r.createCommentVNode("",!0)])]),_:1},8,["modelValue"]))}}),ZB=["onClick"],WB={class:"pl-filter-manager__expand-icon"},jB={class:"pl-filter-manager__title flex-grow-1 text-s-btn"},HB={class:"pl-filter-manager__actions d-flex gap-12"},qB=["onClick"],KB=["onClick"],YB={class:"pl-filter-manager__content d-flex gap-24 p-24 flex-column"},XB={class:"d-flex justify-center"},JB=["onClick"],QB={class:"pl-filter-manager__add-btn-icon"},eP={key:0},tP=r.defineComponent({__name:"PlTableFilters",props:r.mergeModels({columns:{},restrictions:{},defaults:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{columns:o,restrictions:i,defaults:l}=r.toRefs(n),c=r.computed(()=>{const $=o.value.filter(U=>{const k=U.type;switch(k){case"axis":return U.spec.type!=="Bytes";case"column":return U.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${k}`)}}),j={};for(const U of $)j[BB(U)]=U;return j}),d=r.computed(()=>{const $=i.value??[],j={};for(const[U,k]of Object.entries(c.value)){const x=ze.find($,B=>ze.isEqual(B.column.id,k.id));x&&(j[U]=x.allowedFilterTypes)}return j}),p=r.computed(()=>{const $=l.value??[],j={};for(const[U,k]of Object.entries(c.value)){const x=ze.find($,B=>ze.isEqual(B.column.id,k.id));x&&(j[U]={columnId:U,filter:x.default,disabled:!1})}return j});(()=>{let $=e.value.state;typeof $=="object"&&!Array.isArray($)&&(e.value.state=Object.entries($).map(([j,U])=>({columnId:j,filter:U,disabled:!1})))})();const h=$=>$??Object.values(p.value),m=r.reactive({state:h(e.value.state)});r.watch(()=>e.value,$=>{ze.isEqual(m.state,$.state)||(m.state=h($.state))}),r.watch(()=>m,$=>{ze.isEqual($.state,e.value.state)||(e.value={state:ze.cloneDeep($.state),filters:$.state.filter(j=>!j.disabled).map(j=>{const U=c.value[j.columnId],{spec:k,...x}=U;return{type:"bySingleColumnV2",column:x,predicate:MB(U,j.filter)}})})},{immediate:!0,deep:!0}),r.watch(()=>c.value,$=>{Object.keys($).length===0&&m.state!==void 0||(m.state=m.state.filter(j=>!!$[j.columnId]))},{immediate:!0});const y=r.computed(()=>Object.keys(c).length>0&&m.state.length>0),b=r.computed(()=>{const $=d.value,j={};for(const[U,k]of Object.entries(c.value)){let B=(k.type==="column"?k.spec.valueType:k.spec.type)==="String"?DB:RB;const G=$[U];G&&(B=B.filter(H=>G.includes(H))),j[U]=B.map(H=>({value:H,text:PB(H)}))}return j}),w=r.computed(()=>ze.some(Object.values(b.value),$=>$.length>0)),S=r.computed(()=>Object.entries(Object.entries(c.value)).filter(([$,[j,U]])=>b.value[j].length>0).filter(([$,[j,U]])=>!m.state.some(k=>k.columnId===j)).map(([$,[j,U]])=>({label:Fh(U,$),value:j}))),M=$=>p.value[$]??{columnId:$,filter:Lh(b.value[$][0].value),disabled:!1},O=$=>{m.state[$]=M(m.state[$].columnId)},v=$=>m.state.splice($,1),L=r.ref(!1),I=r.ref(!1),W=r.ref(!1);r.onMounted(()=>{W.value=!0});const P=r.reactive({}),V=$=>{P[$]?delete P[$]:P[$]=!0},Z=r.ref(!1),J=r.ref();let ae;return r.onMounted(()=>{ae=new ResizeObserver(()=>{var j;const $=(j=J.value)==null?void 0:j.parentElement;$&&(Z.value=$.scrollHeight>$.clientHeight||$.scrollWidth>$.clientWidth)}),J.value&&J.value.parentElement&&ae.observe(J.value.parentElement)}),r.watch(J,($,j)=>{j!=null&&j.parentElement&&ae.unobserve(j.parentElement),$!=null&&$.parentElement&&ae.observe($.parentElement)}),r.onBeforeUnmount(()=>{ae!==void 0&&ae.disconnect()}),($,j)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[W.value?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:`#${r.unref(Ql)}`},[r.createVNode(r.unref(vo),{onClick:j[0]||(j[0]=r.withModifiers(U=>L.value=!0,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(As),{name:y.value?"filter-on":"filter"},null,8,["name"])]),default:r.withCtx(()=>[j[5]||(j[5]=r.createTextVNode(" Filters "))]),_:1})],8,["to"])):r.createCommentVNode("",!0),r.createVNode(r.unref(Ps),{modelValue:L.value,"onUpdate:modelValue":j[2]||(j[2]=U=>L.value=U),"close-on-outside-click":!1},{title:r.withCtx(()=>j[6]||(j[6]=[r.createTextVNode("Manage Filters")])),default:r.withCtx(()=>[r.createElementVNode("div",{ref_key:"filterManager",ref:J,class:"pl-filter-manager d-flex flex-column gap-6"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.state,(U,k)=>(r.openBlock(),r.createElementBlock("div",{key:U.columnId,class:r.normalizeClass([{open:P[U.columnId],disabled:U.disabled},"pl-filter-manager__filter"])},[r.createElementVNode("div",{class:"pl-filter-manager__header d-flex align-center gap-8",onClick:x=>V(U.columnId)},[r.createElementVNode("div",WB,[r.createVNode(r.unref(Vt),{name:"chevron-right"})]),r.createElementVNode("div",jB,r.toDisplayString(r.unref(Fh)(c.value[U.columnId],k)),1),r.createElementVNode("div",HB,[r.createElementVNode("div",{class:"pl-filter-manager__toggle",onClick:r.withModifiers(x=>U.disabled=!U.disabled,["stop"])},[r.createVNode(r.unref(At),{name:U.disabled?"view-hide":"view-show"},null,8,["name"])],8,qB),r.createElementVNode("div",{class:"pl-filter-manager__delete",onClick:r.withModifiers(x=>v(k),["stop"])},[r.createVNode(r.unref(At),{name:"close"})],8,KB)])],8,ZB),r.createElementVNode("div",YB,[r.createVNode(Mh,{modelValue:m.state[k],"onUpdate:modelValue":x=>m.state[k]=x,disabled:U.disabled,column:c.value[U.columnId],options:b.value[U.columnId]},null,8,["modelValue","onUpdate:modelValue","disabled","column","options"]),r.createElementVNode("div",XB,[r.createElementVNode("div",{class:r.normalizeClass([{disabled:U.disabled},"pl-filter-manager__revert-btn text-s-btn d-flex align-center gap-8"]),onClick:x=>O(k)},[j[7]||(j[7]=r.createTextVNode(" Revert Settings to Default ")),r.createVNode(r.unref(At),{name:"reverse"})],10,JB)])])],2))),128)),r.createElementVNode("div",{class:r.normalizeClass([{"pt-24":Z.value},"pl-filter-manager__add-action-wrapper"])},[S.value.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-filter-manager__add-btn",onClick:j[1]||(j[1]=U=>I.value=!0)},[r.createElementVNode("div",QB,[r.createVNode(r.unref(Vt),{name:"add"})]),j[8]||(j[8]=r.createElementVNode("div",{class:"pl-filter-manager__add-btn-title text-s-btn"},"Add Filter",-1))])):r.createCommentVNode("",!0)],2),w.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",eP,"No filters applicable"))],512)]),_:1},8,["modelValue"]),r.createVNode(UB,{modelValue:I.value,"onUpdate:modelValue":j[3]||(j[3]=U=>I.value=U),"columns-by-id":c.value,"column-options":S.value,"filter-options":b.value,"make-filter":M,onAddFilter:j[4]||(j[4]=U=>m.state.push(U))},null,8,["modelValue","columns-by-id","column-options","filter-options"])],64))}}),Qs=new Map;function nP(t,e){const n=r.getCurrentScope()??r.effectScope(),o=n.run(()=>(r.onScopeDispose(()=>{Qs.delete(t)}),r.reactive(e())));return o[Symbol.dispose]=()=>{n.stop()},o}function rP(t){const e=Symbol();return()=>(Qs.has(e)||Qs.set(e,nP(e,t)),Qs.get(e))}function oP(t){return r.computed(()=>{try{return tu(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function Gh(t,e,n){const o=r.ref(0),i=r.reactive({loading:r.computed(()=>o.value>0),loadingRef:o,value:void 0,error:void 0}),l=Gg(e);return r.watch(t,async c=>{i.error=void 0,o.value++,l(c).then(d=>{d.ok&&(i.value=d.value)}).catch(d=>{i.value=void 0,i.error=d}).finally(()=>{o.value--})},Object.assign({immediate:!0,deep:!0},n??{})),i}const Ao=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,$h=new Set,mc=typeof process=="object"&&process?process:{},zh=(t,e,n,o)=>{typeof mc.emitWarning=="function"?mc.emitWarning(t,e,n,o):console.error(`[${n}] ${e}: ${t}`)};let ea=globalThis.AbortController,Uh=globalThis.AbortSignal;if(typeof ea>"u"){Uh=class{constructor(){We(this,"onabort");We(this,"_onabort",[]);We(this,"reason");We(this,"aborted",!1)}addEventListener(o,i){this._onabort.push(i)}},ea=class{constructor(){We(this,"signal",new Uh);e()}abort(o){var i,l;if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(const c of this.signal._onabort)c(o);(l=(i=this.signal).onabort)==null||l.call(i,o)}}};let t=((Wh=mc.env)==null?void 0:Wh.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,zh("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const iP=t=>!$h.has(t),Tr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Zh=t=>Tr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ta:null:null;class ta extends Array{constructor(e){super(e),this.fill(0)}}const Xr=class Xr{constructor(e,n){We(this,"heap");We(this,"length");if(!E(Xr,Bo))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=Zh(e);if(!n)return[];ye(Xr,Bo,!0);const o=new Xr(e,n);return ye(Xr,Bo,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Bo=new WeakMap,Ue(Xr,Bo,!1);let gc=Xr;const Cc=class Cc{constructor(e){Ue(this,re);Ue(this,vn);Ue(this,Ht);Ue(this,wn);Ue(this,bn);Ue(this,Po);Ue(this,Ro);We(this,"ttl");We(this,"ttlResolution");We(this,"ttlAutopurge");We(this,"updateAgeOnGet");We(this,"updateAgeOnHas");We(this,"allowStale");We(this,"noDisposeOnSet");We(this,"noUpdateTTL");We(this,"maxEntrySize");We(this,"sizeCalculation");We(this,"noDeleteOnFetchRejection");We(this,"noDeleteOnStaleGet");We(this,"allowStaleOnFetchAbort");We(this,"allowStaleOnFetchRejection");We(this,"ignoreFetchAbort");Ue(this,ut);Ue(this,xn);Ue(this,dt);Ue(this,Je);Ue(this,Se);Ue(this,Rt);Ue(this,qt);Ue(this,Et);Ue(this,mt);Ue(this,kn);Ue(this,gt);Ue(this,En);Ue(this,Sn);Ue(this,Kt);Ue(this,Tn);Ue(this,Nr);Ue(this,Dt);Ue(this,Jr,()=>{});Ue(this,Jn,()=>{});Ue(this,$i,()=>{});Ue(this,Yt,()=>!1);Ue(this,Qr,e=>{});Ue(this,Do,(e,n,o)=>{});Ue(this,zi,(e,n,o,i)=>{if(o||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});We(this,jh,"LRUCache");const{max:n=0,ttl:o,ttlResolution:i=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:d,allowStale:p,dispose:h,disposeAfter:m,noDisposeOnSet:y,noUpdateTTL:b,maxSize:w=0,maxEntrySize:S=0,sizeCalculation:M,fetchMethod:O,memoMethod:v,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:I,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:P,ignoreFetchAbort:V}=e;if(n!==0&&!Tr(n))throw new TypeError("max option must be a nonnegative integer");const Z=n?Zh(n):Array;if(!Z)throw new Error("invalid max value: "+n);if(ye(this,vn,n),ye(this,Ht,w),this.maxEntrySize=S||E(this,Ht),this.sizeCalculation=M,this.sizeCalculation){if(!E(this,Ht)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(v!==void 0&&typeof v!="function")throw new TypeError("memoMethod must be a function if defined");if(ye(this,Ro,v),O!==void 0&&typeof O!="function")throw new TypeError("fetchMethod must be a function if specified");if(ye(this,Po,O),ye(this,Nr,!!O),ye(this,dt,new Map),ye(this,Je,new Array(n).fill(void 0)),ye(this,Se,new Array(n).fill(void 0)),ye(this,Rt,new Z(n)),ye(this,qt,new Z(n)),ye(this,Et,0),ye(this,mt,0),ye(this,kn,gc.create(n)),ye(this,ut,0),ye(this,xn,0),typeof h=="function"&&ye(this,wn,h),typeof m=="function"?(ye(this,bn,m),ye(this,gt,[])):(ye(this,bn,void 0),ye(this,gt,void 0)),ye(this,Tn,!!E(this,wn)),ye(this,Dt,!!E(this,bn)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!W,this.allowStaleOnFetchAbort=!!P,this.ignoreFetchAbort=!!V,this.maxEntrySize!==0){if(E(this,Ht)!==0&&!Tr(E(this,Ht)))throw new TypeError("maxSize must be a positive integer if specified");if(!Tr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ue(this,re,Ng).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!I,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!d,this.ttlResolution=Tr(i)||i===0?i:1,this.ttlAutopurge=!!l,this.ttl=o||0,this.ttl){if(!Tr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ue(this,re,zd).call(this)}if(E(this,vn)===0&&this.ttl===0&&E(this,Ht)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!E(this,vn)&&!E(this,Ht)){const J="LRU_CACHE_UNBOUNDED";iP(J)&&($h.add(J),zh("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",J,Cc))}}static unsafeExposeInternals(e){return{starts:E(e,Sn),ttls:E(e,Kt),sizes:E(e,En),keyMap:E(e,dt),keyList:E(e,Je),valList:E(e,Se),next:E(e,Rt),prev:E(e,qt),get head(){return E(e,Et)},get tail(){return E(e,mt)},free:E(e,kn),isBackgroundFetch:n=>{var o;return ue(o=e,re,et).call(o,n)},backgroundFetch:(n,o,i,l)=>{var c;return ue(c=e,re,Ka).call(c,n,o,i,l)},moveToTail:n=>{var o;return ue(o=e,re,us).call(o,n)},indexes:n=>{var o;return ue(o=e,re,Or).call(o,n)},rindexes:n=>{var o;return ue(o=e,re,Mr).call(o,n)},isStale:n=>{var o;return E(o=e,Yt).call(o,n)}}}get max(){return E(this,vn)}get maxSize(){return E(this,Ht)}get calculatedSize(){return E(this,xn)}get size(){return E(this,ut)}get fetchMethod(){return E(this,Po)}get memoMethod(){return E(this,Ro)}get dispose(){return E(this,wn)}get disposeAfter(){return E(this,bn)}getRemainingTTL(e){return E(this,dt).has(e)?1/0:0}*entries(){for(const e of ue(this,re,Or).call(this))E(this,Se)[e]!==void 0&&E(this,Je)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield[E(this,Je)[e],E(this,Se)[e]])}*rentries(){for(const e of ue(this,re,Mr).call(this))E(this,Se)[e]!==void 0&&E(this,Je)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield[E(this,Je)[e],E(this,Se)[e]])}*keys(){for(const e of ue(this,re,Or).call(this)){const n=E(this,Je)[e];n!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield n)}}*rkeys(){for(const e of ue(this,re,Mr).call(this)){const n=E(this,Je)[e];n!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield n)}}*values(){for(const e of ue(this,re,Or).call(this))E(this,Se)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield E(this,Se)[e])}*rvalues(){for(const e of ue(this,re,Mr).call(this))E(this,Se)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield E(this,Se)[e])}[(Hh=Symbol.iterator,jh=Symbol.toStringTag,Hh)](){return this.entries()}find(e,n={}){for(const o of ue(this,re,Or).call(this)){const i=E(this,Se)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;if(l!==void 0&&e(l,E(this,Je)[o],this))return this.get(E(this,Je)[o],n)}}forEach(e,n=this){for(const o of ue(this,re,Or).call(this)){const i=E(this,Se)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;l!==void 0&&e.call(n,l,E(this,Je)[o],this)}}rforEach(e,n=this){for(const o of ue(this,re,Mr).call(this)){const i=E(this,Se)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;l!==void 0&&e.call(n,l,E(this,Je)[o],this)}}purgeStale(){let e=!1;for(const n of ue(this,re,Mr).call(this,{allowStale:!0}))E(this,Yt).call(this,n)&&(ue(this,re,Gr).call(this,E(this,Je)[n],"expire"),e=!0);return e}info(e){const n=E(this,dt).get(e);if(n===void 0)return;const o=E(this,Se)[n],i=ue(this,re,et).call(this,o)?o.__staleWhileFetching:o;if(i===void 0)return;const l={value:i};if(E(this,Kt)&&E(this,Sn)){const c=E(this,Kt)[n],d=E(this,Sn)[n];if(c&&d){const p=c-(Ao.now()-d);l.ttl=p,l.start=Date.now()}}return E(this,En)&&(l.size=E(this,En)[n]),l}dump(){const e=[];for(const n of ue(this,re,Or).call(this,{allowStale:!0})){const o=E(this,Je)[n],i=E(this,Se)[n],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;if(l===void 0||o===void 0)continue;const c={value:l};if(E(this,Kt)&&E(this,Sn)){c.ttl=E(this,Kt)[n];const d=Ao.now()-E(this,Sn)[n];c.start=Math.floor(Date.now()-d)}E(this,En)&&(c.size=E(this,En)[n]),e.unshift([o,c])}return e}load(e){this.clear();for(const[n,o]of e){if(o.start){const i=Date.now()-o.start;o.start=Ao.now()-i}this.set(n,o.value,o)}}set(e,n,o={}){var b,w,S,M,O;if(n===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:p}=o;let{noUpdateTTL:h=this.noUpdateTTL}=o;const m=E(this,zi).call(this,e,n,o.size||0,d);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),ue(this,re,Gr).call(this,e,"set"),this;let y=E(this,ut)===0?void 0:E(this,dt).get(e);if(y===void 0)y=E(this,ut)===0?E(this,mt):E(this,kn).length!==0?E(this,kn).pop():E(this,ut)===E(this,vn)?ue(this,re,qa).call(this,!1):E(this,ut),E(this,Je)[y]=e,E(this,Se)[y]=n,E(this,dt).set(e,y),E(this,Rt)[E(this,mt)]=y,E(this,qt)[y]=E(this,mt),ye(this,mt,y),Ha(this,ut)._++,E(this,Do).call(this,y,m,p),p&&(p.set="add"),h=!1;else{ue(this,re,us).call(this,y);const v=E(this,Se)[y];if(n!==v){if(E(this,Nr)&&ue(this,re,et).call(this,v)){v.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:L}=v;L!==void 0&&!c&&(E(this,Tn)&&((b=E(this,wn))==null||b.call(this,L,e,"set")),E(this,Dt)&&((w=E(this,gt))==null||w.push([L,e,"set"])))}else c||(E(this,Tn)&&((S=E(this,wn))==null||S.call(this,v,e,"set")),E(this,Dt)&&((M=E(this,gt))==null||M.push([v,e,"set"])));if(E(this,Qr).call(this,y),E(this,Do).call(this,y,m,p),E(this,Se)[y]=n,p){p.set="replace";const L=v&&ue(this,re,et).call(this,v)?v.__staleWhileFetching:v;L!==void 0&&(p.oldValue=L)}}else p&&(p.set="update")}if(i!==0&&!E(this,Kt)&&ue(this,re,zd).call(this),E(this,Kt)&&(h||E(this,$i).call(this,y,i,l),p&&E(this,Jn).call(this,p,y)),!c&&E(this,Dt)&&E(this,gt)){const v=E(this,gt);let L;for(;L=v==null?void 0:v.shift();)(O=E(this,bn))==null||O.call(this,...L)}return this}pop(){var e;try{for(;E(this,ut);){const n=E(this,Se)[E(this,Et)];if(ue(this,re,qa).call(this,!0),ue(this,re,et).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(E(this,Dt)&&E(this,gt)){const n=E(this,gt);let o;for(;o=n==null?void 0:n.shift();)(e=E(this,bn))==null||e.call(this,...o)}}}has(e,n={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:i}=n,l=E(this,dt).get(e);if(l!==void 0){const c=E(this,Se)[l];if(ue(this,re,et).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(E(this,Yt).call(this,l))i&&(i.has="stale",E(this,Jn).call(this,i,l));else return o&&E(this,Jr).call(this,l),i&&(i.has="hit",E(this,Jn).call(this,i,l)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){const{allowStale:o=this.allowStale}=n,i=E(this,dt).get(e);if(i===void 0||!o&&E(this,Yt).call(this,i))return;const l=E(this,Se)[i];return ue(this,re,et).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:p=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:w=this.ignoreFetchAbort,allowStaleOnFetchAbort:S=this.allowStaleOnFetchAbort,context:M,forceRefresh:O=!1,status:v,signal:L}=n;if(!E(this,Nr))return v&&(v.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:l,status:v});const I={allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:d,size:p,sizeCalculation:h,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:S,ignoreFetchAbort:w,status:v,signal:L};let W=E(this,dt).get(e);if(W===void 0){v&&(v.fetch="miss");const P=ue(this,re,Ka).call(this,e,W,I,M);return P.__returned=P}else{const P=E(this,Se)[W];if(ue(this,re,et).call(this,P)){const $=o&&P.__staleWhileFetching!==void 0;return v&&(v.fetch="inflight",$&&(v.returnedStale=!0)),$?P.__staleWhileFetching:P.__returned=P}const V=E(this,Yt).call(this,W);if(!O&&!V)return v&&(v.fetch="hit"),ue(this,re,us).call(this,W),i&&E(this,Jr).call(this,W),v&&E(this,Jn).call(this,v,W),P;const Z=ue(this,re,Ka).call(this,e,W,I,M),ae=Z.__staleWhileFetching!==void 0&&o;return v&&(v.fetch=V?"stale":"refresh",ae&&V&&(v.returnedStale=!0)),ae?Z.__staleWhileFetching:Z.__returned=Z}}async forceFetch(e,n={}){const o=await this.fetch(e,n);if(o===void 0)throw new Error("fetch() returned undefined");return o}memo(e,n={}){const o=E(this,Ro);if(!o)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:l,...c}=n,d=this.get(e,c);if(!l&&d!==void 0)return d;const p=o(e,d,{options:c,context:i});return this.set(e,p,c),p}get(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,d=E(this,dt).get(e);if(d!==void 0){const p=E(this,Se)[d],h=ue(this,re,et).call(this,p);return c&&E(this,Jn).call(this,c,d),E(this,Yt).call(this,d)?(c&&(c.get="stale"),h?(c&&o&&p.__staleWhileFetching!==void 0&&(c.returnedStale=!0),o?p.__staleWhileFetching:void 0):(l||ue(this,re,Gr).call(this,e,"expire"),c&&o&&(c.returnedStale=!0),o?p:void 0)):(c&&(c.get="hit"),h?p.__staleWhileFetching:(ue(this,re,us).call(this,d),i&&E(this,Jr).call(this,d),p))}else c&&(c.get="miss")}delete(e){return ue(this,re,Gr).call(this,e,"delete")}clear(){return ue(this,re,Wd).call(this,"delete")}};vn=new WeakMap,Ht=new WeakMap,wn=new WeakMap,bn=new WeakMap,Po=new WeakMap,Ro=new WeakMap,ut=new WeakMap,xn=new WeakMap,dt=new WeakMap,Je=new WeakMap,Se=new WeakMap,Rt=new WeakMap,qt=new WeakMap,Et=new WeakMap,mt=new WeakMap,kn=new WeakMap,gt=new WeakMap,En=new WeakMap,Sn=new WeakMap,Kt=new WeakMap,Tn=new WeakMap,Nr=new WeakMap,Dt=new WeakMap,re=new WeakSet,zd=function(){const e=new ta(E(this,vn)),n=new ta(E(this,vn));ye(this,Kt,e),ye(this,Sn,n),ye(this,$i,(l,c,d=Ao.now())=>{if(n[l]=c!==0?d:0,e[l]=c,c!==0&&this.ttlAutopurge){const p=setTimeout(()=>{E(this,Yt).call(this,l)&&ue(this,re,Gr).call(this,E(this,Je)[l],"expire")},c+1);p.unref&&p.unref()}}),ye(this,Jr,l=>{n[l]=e[l]!==0?Ao.now():0}),ye(this,Jn,(l,c)=>{if(e[c]){const d=e[c],p=n[c];if(!d||!p)return;l.ttl=d,l.start=p,l.now=o||i();const h=l.now-p;l.remainingTTL=d-h}});let o=0;const i=()=>{const l=Ao.now();if(this.ttlResolution>0){o=l;const c=setTimeout(()=>o=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{const c=E(this,dt).get(l);if(c===void 0)return 0;const d=e[c],p=n[c];if(!d||!p)return 1/0;const h=(o||i())-p;return d-h},ye(this,Yt,l=>{const c=n[l],d=e[l];return!!d&&!!c&&(o||i())-c>d})},Jr=new WeakMap,Jn=new WeakMap,$i=new WeakMap,Yt=new WeakMap,Ng=function(){const e=new ta(E(this,vn));ye(this,xn,0),ye(this,En,e),ye(this,Qr,n=>{ye(this,xn,E(this,xn)-e[n]),e[n]=0}),ye(this,zi,(n,o,i,l)=>{if(ue(this,re,et).call(this,o))return 0;if(!Tr(i))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(i=l(o,n),!Tr(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i}),ye(this,Do,(n,o,i)=>{if(e[n]=o,E(this,Ht)){const l=E(this,Ht)-e[n];for(;E(this,xn)>l;)ue(this,re,qa).call(this,!0)}ye(this,xn,E(this,xn)+e[n]),i&&(i.entrySize=o,i.totalCalculatedSize=E(this,xn))})},Qr=new WeakMap,Do=new WeakMap,zi=new WeakMap,Or=function*({allowStale:e=this.allowStale}={}){if(E(this,ut))for(let n=E(this,mt);!(!ue(this,re,Ud).call(this,n)||((e||!E(this,Yt).call(this,n))&&(yield n),n===E(this,Et)));)n=E(this,qt)[n]},Mr=function*({allowStale:e=this.allowStale}={}){if(E(this,ut))for(let n=E(this,Et);!(!ue(this,re,Ud).call(this,n)||((e||!E(this,Yt).call(this,n))&&(yield n),n===E(this,mt)));)n=E(this,Rt)[n]},Ud=function(e){return e!==void 0&&E(this,dt).get(E(this,Je)[e])===e},qa=function(e){var l,c;const n=E(this,Et),o=E(this,Je)[n],i=E(this,Se)[n];return E(this,Nr)&&ue(this,re,et).call(this,i)?i.__abortController.abort(new Error("evicted")):(E(this,Tn)||E(this,Dt))&&(E(this,Tn)&&((l=E(this,wn))==null||l.call(this,i,o,"evict")),E(this,Dt)&&((c=E(this,gt))==null||c.push([i,o,"evict"]))),E(this,Qr).call(this,n),e&&(E(this,Je)[n]=void 0,E(this,Se)[n]=void 0,E(this,kn).push(n)),E(this,ut)===1?(ye(this,Et,ye(this,mt,0)),E(this,kn).length=0):ye(this,Et,E(this,Rt)[n]),E(this,dt).delete(o),Ha(this,ut)._--,n},Ka=function(e,n,o,i){const l=n===void 0?void 0:E(this,Se)[n];if(ue(this,re,et).call(this,l))return l;const c=new ea,{signal:d}=o;d==null||d.addEventListener("abort",()=>c.abort(d.reason),{signal:c.signal});const p={signal:c.signal,options:o,context:i},h=(M,O=!1)=>{const{aborted:v}=c.signal,L=o.ignoreFetchAbort&&M!==void 0;if(o.status&&(v&&!O?(o.status.fetchAborted=!0,o.status.fetchError=c.signal.reason,L&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),v&&!L&&!O)return y(c.signal.reason);const I=w;return E(this,Se)[n]===w&&(M===void 0?I.__staleWhileFetching?E(this,Se)[n]=I.__staleWhileFetching:ue(this,re,Gr).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,M,p.options))),M},m=M=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=M),y(M)),y=M=>{const{aborted:O}=c.signal,v=O&&o.allowStaleOnFetchAbort,L=v||o.allowStaleOnFetchRejection,I=L||o.noDeleteOnFetchRejection,W=w;if(E(this,Se)[n]===w&&(!I||W.__staleWhileFetching===void 0?ue(this,re,Gr).call(this,e,"fetch"):v||(E(this,Se)[n]=W.__staleWhileFetching)),L)return o.status&&W.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),W.__staleWhileFetching;if(W.__returned===W)throw M},b=(M,O)=>{var L;const v=(L=E(this,Po))==null?void 0:L.call(this,e,l,p);v&&v instanceof Promise&&v.then(I=>M(I===void 0?void 0:I),O),c.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(M(void 0),o.allowStaleOnFetchAbort&&(M=I=>h(I,!0)))})};o.status&&(o.status.fetchDispatched=!0);const w=new Promise(b).then(h,m),S=Object.assign(w,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,S,{...p.options,status:void 0}),n=E(this,dt).get(e)):E(this,Se)[n]=S,S},et=function(e){if(!E(this,Nr))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof ea},Zd=function(e,n){E(this,qt)[n]=e,E(this,Rt)[e]=n},us=function(e){e!==E(this,mt)&&(e===E(this,Et)?ye(this,Et,E(this,Rt)[e]):ue(this,re,Zd).call(this,E(this,qt)[e],E(this,Rt)[e]),ue(this,re,Zd).call(this,E(this,mt),e),ye(this,mt,e))},Gr=function(e,n){var i,l,c,d;let o=!1;if(E(this,ut)!==0){const p=E(this,dt).get(e);if(p!==void 0)if(o=!0,E(this,ut)===1)ue(this,re,Wd).call(this,n);else{E(this,Qr).call(this,p);const h=E(this,Se)[p];if(ue(this,re,et).call(this,h)?h.__abortController.abort(new Error("deleted")):(E(this,Tn)||E(this,Dt))&&(E(this,Tn)&&((i=E(this,wn))==null||i.call(this,h,e,n)),E(this,Dt)&&((l=E(this,gt))==null||l.push([h,e,n]))),E(this,dt).delete(e),E(this,Je)[p]=void 0,E(this,Se)[p]=void 0,p===E(this,mt))ye(this,mt,E(this,qt)[p]);else if(p===E(this,Et))ye(this,Et,E(this,Rt)[p]);else{const m=E(this,qt)[p];E(this,Rt)[m]=E(this,Rt)[p];const y=E(this,Rt)[p];E(this,qt)[y]=E(this,qt)[p]}Ha(this,ut)._--,E(this,kn).push(p)}}if(E(this,Dt)&&((c=E(this,gt))!=null&&c.length)){const p=E(this,gt);let h;for(;h=p==null?void 0:p.shift();)(d=E(this,bn))==null||d.call(this,...h)}return o},Wd=function(e){var n,o,i;for(const l of ue(this,re,Mr).call(this,{allowStale:!0})){const c=E(this,Se)[l];if(ue(this,re,et).call(this,c))c.__abortController.abort(new Error("deleted"));else{const d=E(this,Je)[l];E(this,Tn)&&((n=E(this,wn))==null||n.call(this,c,d,e)),E(this,Dt)&&((o=E(this,gt))==null||o.push([c,d,e]))}}if(E(this,dt).clear(),E(this,Se).fill(void 0),E(this,Je).fill(void 0),E(this,Kt)&&E(this,Sn)&&(E(this,Kt).fill(0),E(this,Sn).fill(0)),E(this,En)&&E(this,En).fill(0),ye(this,Et,0),ye(this,mt,0),E(this,kn).length=0,ye(this,xn,0),ye(this,ut,0),E(this,Dt)&&E(this,gt)){const l=E(this,gt);let c;for(;c=l==null?void 0:l.shift();)(i=E(this,bn))==null||i.call(this,...c)}};let yc=Cc;const sP={cacheSize:15e6};class aP{constructor(e){We(this,"_str");We(this,"_rawJson");We(this,"_zodSchema");We(this,"_validatedJson");this.bytes=e}get str(){return this._str===void 0&&(this._str=new TextDecoder().decode(this.bytes)),this._str}get rawJson(){return this._rawJson===void 0&&(this._rawJson=JSON.parse(this.str)),this._rawJson}validatedJson(e){return this._zodSchema!==e&&(this._validatedJson=e.parse(this.rawJson),this._zodSchema=e),this._validatedJson}}const eo=class eo{constructor(e){We(this,"fileDataCache");We(this,"fileDataRefs",new Map);const n={...sP,...e??{}};this.fileDataCache=new yc({maxSize:n.cacheSize,fetchMethod:async o=>new aP(await yu().blobDriver.getContent(o)),sizeCalculation:o=>o.bytes.length,dispose:(o,i)=>{this.fileDataRefs.delete(i)}})}getDataRef(e){const n=this.fileDataRefs.get(e);if(n!==void 0)return n;const o=r.shallowRef();return this.fileDataRefs.set(e,o),(async()=>{try{const i=await this.fileDataCache.fetch(e);o.value=i}catch(i){console.error(i)}})(),o}getContentBytes(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n.value)==null?void 0:o.bytes})}getContentString(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n==null?void 0:n.value)==null?void 0:o.str})}getContentJson(e,n){if(e===void 0)return;const o=this.getDataRef(e);return r.computed(()=>{var i,l;return n===void 0?(i=o==null?void 0:o.value)==null?void 0:i.rawJson:(l=o==null?void 0:o.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return eo.globalInstance.getContentBytes(e)}static getContentString(e){return eo.globalInstance.getContentString(e)}static getContentJson(e,n){return eo.globalInstance.getContentJson(e,n)}};We(eo,"globalInstance",new eo);let _c=eo;F.AgGridTheme=$u,F.BlockLayout=JN,F.ContextProvider=LS,F.DataTable=y0,F.DemoData=LN,F.DropdownListItem=Co,F.DropdownOverlay=$l,F.LongText=Ml,F.MultiError=hs,F.PlAccordion=Ik,F.PlAccordionSection=Zk,F.PlAgCellFile=BV,F.PlAgColumnHeader=nh,F.PlAgDataTable=SV,F.PlAgDataTableToolsPanel=xV,F.PlAgGridColumnManager=ah,F.PlAgOverlayLoading=Jp,F.PlAgOverlayNoRows=Qp,F.PlAgTextAndButtonCell=DV,F.PlAlert=q0,F.PlBlockPage=D0,F.PlBtnAccent=pw,F.PlBtnDanger=fw,F.PlBtnGhost=vo,F.PlBtnGroup=pp,F.PlBtnLink=_w,F.PlBtnPrimary=Ns,F.PlBtnSecondary=Rl,F.PlBtnSplit=aw,F.PlCheckbox=Wx,F.PlCheckboxGroup=Kx,F.PlChip=zl,F.PlCloseModalBtn=xp,F.PlContainer=F0,F.PlDialogModal=Zl,F.PlDropdown=wo,F.PlDropdownLegacy=gx,F.PlDropdownLine=bp,F.PlDropdownMulti=Ux,F.PlDropdownRef=Wb,F.PlEditableTitle=zw,F.PlFileDialog=Ap,F.PlFileInput=jp,F.PlGrid=z0,F.PlIcon16=Wr,F.PlIcon24=As,F.PlLogView=Ep,F.PlMaskIcon16=Vt,F.PlMaskIcon24=At,F.PlNotificationAlert=Hp,F.PlNumberField=Nx,F.PlProgressBar=wx,F.PlRow=O0,F.PlSearchField=_p,F.PlSectionSeparator=Sp,F.PlSlideModal=Ps,F.PlSpacer=dp,F.PlTableFilters=tP,F.PlTabs=Vk,F.PlTextArea=Vb,F.PlTextField=jr,F.PlToggleSwitch=Rs,F.PlTooltip=Ct,F.ReactiveFileContent=_c,F.Scrollable=S1,F.Slider=qp,F.SliderRange=b1,F.SliderRangeTriple=d1,F.ThemeSwitcher=T0,F.UnresolvedError=Xa,F.ValueOrErrorsComponent=VV,F.activateAgGrid=Gu,F.animate=op,F.animateInfinite=b0,F.call=Qu,F.computedResult=oP,F.createModel=rl,F.debounce=ip,F.defineApp=jC,F.defineStore=rP,F.delay=ep,F.detectOutside=Ab,F.ensureError=el,F.eventListener=Gl,F.formatZodError=nl,F.getElementScrollPosition=wp,F.identity=Qa,F.isDefined=Zg,F.isElementVisible=vp,F.isJsonEqual=Ja,F.isZodError=tl,F.listToOptions=x0,F.makeEaseInOut=w0,F.makeEaseOut=rp,F.maskIcons16=IN,F.maskIcons24=FN,F.normalizeListOptions=_r,F.notEmpty=Nl,F.randomInt=np,F.randomString=v0,F.requestTick=Vl,F.scrollIntoView=Bs,F.showContextMenu=El,F.throttle=sp,F.timeout=tp,F.unwrapOptionalResult=Ug,F.unwrapValueOrErrors=eu,F.useClickOutside=Vs,F.useDraggable=QS,F.useEventListener=st,F.useFormState=XS,F.useHover=Xu,F.useInterval=YS,F.useLabelNotch=Yn,F.useLocalStorage=ap,F.useMouse=Yu,F.useMouseCapture=yr,F.usePosition=Ci,F.useQuery=JS,F.useResizeObserver=Kp,F.useScroll=qS,F.useSdkPlugin=vl,F.useSortable=Xp,F.useTheme=cp,F.useWatchFetch=Gh,F.wrapOptionalResult=tu,F.wrapValueOrErrors=zg,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
|
|
91
|
+
}`;var De=xg(function(){return Ze(C,he+"return "+Q).apply(n,N)});if(De.source=Q,Ad(De))throw De;return De}function eM(s){return je(s).toLowerCase()}function tM(s){return je(s).toUpperCase()}function nM(s,a,u){if(s=je(s),s&&(u||a===n))return Pf(s);if(!s||!(a=Qt(a)))return s;var f=An(s),g=An(a),C=Rf(f,g),N=Df(f,g)+1;return Fr(f,C,N).join("")}function rM(s,a,u){if(s=je(s),s&&(u||a===n))return s.slice(0,Ff(s)+1);if(!s||!(a=Qt(a)))return s;var f=An(s),g=Df(f,An(a))+1;return Fr(f,0,g).join("")}function oM(s,a,u){if(s=je(s),s&&(u||a===n))return s.replace(Ac,"");if(!s||!(a=Qt(a)))return s;var f=An(s),g=Rf(f,An(a));return Fr(f,g).join("")}function iM(s,a){var u=$,f=j;if(ot(a)){var g="separator"in a?a.separator:g;u="length"in a?Be(a.length):u,f="omission"in a?Qt(a.omission):f}s=je(s);var C=s.length;if(Oo(s)){var N=An(s);C=N.length}if(u>=C)return s;var A=u-Mo(f);if(A<1)return f;var D=N?Fr(N,0,A).join(""):s.slice(0,A);if(g===n)return D+f;if(N&&(A+=D.length-A),Bd(g)){if(s.slice(A).search(g)){var Y,X=D;for(g.global||(g=Hc(g.source,je(Qh.exec(g))+"g")),g.lastIndex=0;Y=g.exec(X);)var Q=Y.index;D=D.slice(0,Q===n?A:Q)}}else if(s.indexOf(Qt(g),A)!=A){var oe=D.lastIndexOf(g);oe>-1&&(D=D.slice(0,oe))}return D+f}function sM(s){return s=je(s),s&&yP.test(s)?s.replace(Yh,IR):s}var aM=jo(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),Dd=km("toUpperCase");function bg(s,a,u){return s=je(s),a=u?n:a,a===n?AR(s)?OR(s):wR(s):s.match(a)||[]}var xg=Ie(function(s,a){try{return Xt(s,n,a)}catch(u){return Ad(u)?u:new Te(u)}}),lM=or(function(s,a){return on(a,function(u){u=jn(u),nr(s,u,Nd(s[u],s))}),s});function cM(s){var a=s==null?0:s.length,u=ge();return s=a?tt(s,function(f){if(typeof f[1]!="function")throw new sn(c);return[u(f[0]),f[1]]}):[],Ie(function(f){for(var g=-1;++g<a;){var C=s[g];if(Xt(C[0],this,f))return Xt(C[1],this,f)}})}function dM(s){return ID(ln(s,y))}function Id(s){return function(){return s}}function uM(s,a){return s==null||s!==s?a:s}var pM=Sm(),hM=Sm(!0);function Zt(s){return s}function Fd(s){return nm(typeof s=="function"?s:ln(s,y))}function fM(s){return om(ln(s,y))}function mM(s,a){return im(s,ln(a,y))}var gM=Ie(function(s,a){return function(u){return os(u,s,a)}}),yM=Ie(function(s,a){return function(u){return os(s,u,a)}});function Ld(s,a,u){var f=yt(a),g=Ta(a,f);u==null&&!(ot(a)&&(g.length||!f.length))&&(u=a,a=s,s=this,g=Ta(a,yt(a)));var C=!(ot(u)&&"chain"in u)||!!u.chain,N=sr(s);return on(g,function(A){var D=a[A];s[A]=D,N&&(s.prototype[A]=function(){var Y=this.__chain__;if(C||Y){var X=s(this.__wrapped__),Q=X.__actions__=$t(this.__actions__);return Q.push({func:D,args:arguments,thisArg:s}),X.__chain__=Y,X}return D.apply(s,Ar([this.value()],arguments))})}),s}function _M(){return vt._===this&&(vt._=ZR),this}function Od(){}function CM(s){return s=Be(s),Ie(function(a){return sm(a,s)})}var vM=md(tt),wM=md(Tf),bM=md(Gc);function kg(s){return bd(s)?$c(jn(s)):JD(s)}function xM(s){return function(a){return s==null?n:so(s,a)}}var kM=Nm(),EM=Nm(!0);function Md(){return[]}function Gd(){return!1}function SM(){return{}}function TM(){return""}function NM(){return!0}function VM(s,a){if(s=Be(s),s<1||s>K)return[];var u=ke,f=St(s,ke);a=ge(a),s-=ke;for(var g=Zc(f,a);++u<s;)a(u);return g}function AM(s){return Ne(s)?tt(s,jn):en(s)?[s]:$t(Zm(je(s)))}function BM(s){var a=++zR;return je(s)+a}var PM=Ra(function(s,a){return s+a},0),RM=gd("ceil"),DM=Ra(function(s,a){return s/a},1),IM=gd("floor");function FM(s){return s&&s.length?Sa(s,Zt,td):n}function LM(s,a){return s&&s.length?Sa(s,ge(a,2),td):n}function OM(s){return Af(s,Zt)}function MM(s,a){return Af(s,ge(a,2))}function GM(s){return s&&s.length?Sa(s,Zt,id):n}function $M(s,a){return s&&s.length?Sa(s,ge(a,2),id):n}var zM=Ra(function(s,a){return s*a},1),UM=gd("round"),ZM=Ra(function(s,a){return s-a},0);function WM(s){return s&&s.length?Uc(s,Zt):0}function jM(s,a){return s&&s.length?Uc(s,ge(a,2)):0}return _.after=fL,_.ary=tg,_.assign=tO,_.assignIn=mg,_.assignInWith=ja,_.assignWith=nO,_.at=rO,_.before=ng,_.bind=Nd,_.bindAll=lM,_.bindKey=rg,_.castArray=SL,_.chain=Jm,_.chunk=II,_.compact=FI,_.concat=LI,_.cond=cM,_.conforms=dM,_.constant=Id,_.countBy=WF,_.create=oO,_.curry=og,_.curryRight=ig,_.debounce=sg,_.defaults=iO,_.defaultsDeep=sO,_.defer=mL,_.delay=gL,_.difference=OI,_.differenceBy=MI,_.differenceWith=GI,_.drop=$I,_.dropRight=zI,_.dropRightWhile=UI,_.dropWhile=ZI,_.fill=WI,_.filter=HF,_.flatMap=YF,_.flatMapDeep=XF,_.flatMapDepth=JF,_.flatten=qm,_.flattenDeep=jI,_.flattenDepth=HI,_.flip=yL,_.flow=pM,_.flowRight=hM,_.fromPairs=qI,_.functions=hO,_.functionsIn=fO,_.groupBy=QF,_.initial=YI,_.intersection=XI,_.intersectionBy=JI,_.intersectionWith=QI,_.invert=gO,_.invertBy=yO,_.invokeMap=tL,_.iteratee=Fd,_.keyBy=nL,_.keys=yt,_.keysIn=Ut,_.map=Ga,_.mapKeys=CO,_.mapValues=vO,_.matches=fM,_.matchesProperty=mM,_.memoize=za,_.merge=wO,_.mergeWith=gg,_.method=gM,_.methodOf=yM,_.mixin=Ld,_.negate=Ua,_.nthArg=CM,_.omit=bO,_.omitBy=xO,_.once=_L,_.orderBy=rL,_.over=vM,_.overArgs=CL,_.overEvery=wM,_.overSome=bM,_.partial=Vd,_.partialRight=ag,_.partition=oL,_.pick=kO,_.pickBy=yg,_.property=kg,_.propertyOf=xM,_.pull=rF,_.pullAll=Ym,_.pullAllBy=oF,_.pullAllWith=iF,_.pullAt=sF,_.range=kM,_.rangeRight=EM,_.rearg=vL,_.reject=aL,_.remove=aF,_.rest=wL,_.reverse=Sd,_.sampleSize=cL,_.set=SO,_.setWith=TO,_.shuffle=dL,_.slice=lF,_.sortBy=hL,_.sortedUniq=mF,_.sortedUniqBy=gF,_.split=YO,_.spread=bL,_.tail=yF,_.take=_F,_.takeRight=CF,_.takeRightWhile=vF,_.takeWhile=wF,_.tap=FF,_.throttle=xL,_.thru=Ma,_.toArray=pg,_.toPairs=_g,_.toPairsIn=Cg,_.toPath=AM,_.toPlainObject=fg,_.transform=NO,_.unary=kL,_.union=bF,_.unionBy=xF,_.unionWith=kF,_.uniq=EF,_.uniqBy=SF,_.uniqWith=TF,_.unset=VO,_.unzip=Td,_.unzipWith=Xm,_.update=AO,_.updateWith=BO,_.values=Ko,_.valuesIn=PO,_.without=NF,_.words=bg,_.wrap=EL,_.xor=VF,_.xorBy=AF,_.xorWith=BF,_.zip=PF,_.zipObject=RF,_.zipObjectDeep=DF,_.zipWith=IF,_.entries=_g,_.entriesIn=Cg,_.extend=mg,_.extendWith=ja,Ld(_,_),_.add=PM,_.attempt=xg,_.camelCase=FO,_.capitalize=vg,_.ceil=RM,_.clamp=RO,_.clone=TL,_.cloneDeep=VL,_.cloneDeepWith=AL,_.cloneWith=NL,_.conformsTo=BL,_.deburr=wg,_.defaultTo=uM,_.divide=DM,_.endsWith=LO,_.eq=Pn,_.escape=OO,_.escapeRegExp=MO,_.every=jF,_.find=qF,_.findIndex=jm,_.findKey=aO,_.findLast=KF,_.findLastIndex=Hm,_.findLastKey=lO,_.floor=IM,_.forEach=Qm,_.forEachRight=eg,_.forIn=cO,_.forInRight=dO,_.forOwn=uO,_.forOwnRight=pO,_.get=Pd,_.gt=PL,_.gte=RL,_.has=mO,_.hasIn=Rd,_.head=Km,_.identity=Zt,_.includes=eL,_.indexOf=KI,_.inRange=DO,_.invoke=_O,_.isArguments=co,_.isArray=Ne,_.isArrayBuffer=DL,_.isArrayLike=zt,_.isArrayLikeObject=at,_.isBoolean=IL,_.isBuffer=Lr,_.isDate=FL,_.isElement=LL,_.isEmpty=OL,_.isEqual=ML,_.isEqualWith=GL,_.isError=Ad,_.isFinite=$L,_.isFunction=sr,_.isInteger=lg,_.isLength=Za,_.isMap=cg,_.isMatch=zL,_.isMatchWith=UL,_.isNaN=ZL,_.isNative=WL,_.isNil=HL,_.isNull=jL,_.isNumber=dg,_.isObject=ot,_.isObjectLike=it,_.isPlainObject=ds,_.isRegExp=Bd,_.isSafeInteger=qL,_.isSet=ug,_.isString=Wa,_.isSymbol=en,_.isTypedArray=qo,_.isUndefined=KL,_.isWeakMap=YL,_.isWeakSet=XL,_.join=eF,_.kebabCase=GO,_.last=dn,_.lastIndexOf=tF,_.lowerCase=$O,_.lowerFirst=zO,_.lt=JL,_.lte=QL,_.max=FM,_.maxBy=LM,_.mean=OM,_.meanBy=MM,_.min=GM,_.minBy=$M,_.stubArray=Md,_.stubFalse=Gd,_.stubObject=SM,_.stubString=TM,_.stubTrue=NM,_.multiply=zM,_.nth=nF,_.noConflict=_M,_.noop=Od,_.now=$a,_.pad=UO,_.padEnd=ZO,_.padStart=WO,_.parseInt=jO,_.random=IO,_.reduce=iL,_.reduceRight=sL,_.repeat=HO,_.replace=qO,_.result=EO,_.round=UM,_.runInContext=R,_.sample=lL,_.size=uL,_.snakeCase=KO,_.some=pL,_.sortedIndex=cF,_.sortedIndexBy=dF,_.sortedIndexOf=uF,_.sortedLastIndex=pF,_.sortedLastIndexBy=hF,_.sortedLastIndexOf=fF,_.startCase=XO,_.startsWith=JO,_.subtract=ZM,_.sum=WM,_.sumBy=jM,_.template=QO,_.times=VM,_.toFinite=ar,_.toInteger=Be,_.toLength=hg,_.toLower=eM,_.toNumber=un,_.toSafeInteger=eO,_.toString=je,_.toUpper=tM,_.trim=nM,_.trimEnd=rM,_.trimStart=oM,_.truncate=iM,_.unescape=sM,_.uniqueId=BM,_.upperCase=aM,_.upperFirst=Dd,_.each=Qm,_.eachRight=eg,_.first=Km,Ld(_,function(){var s={};return Zn(_,function(a,u){qe.call(_.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),_.VERSION=o,on(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){_[s].placeholder=_}),on(["drop","take"],function(s,a){Le.prototype[s]=function(u){u=u===n?1:ht(Be(u),0);var f=this.__filtered__&&!a?new Le(this):this.clone();return f.__filtered__?f.__takeCount__=St(u,f.__takeCount__):f.__views__.push({size:St(u,ke),type:s+(f.__dir__<0?"Right":"")}),f},Le.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),on(["filter","map","takeWhile"],function(s,a){var u=a+1,f=u==x||u==G;Le.prototype[s]=function(g){var C=this.clone();return C.__iteratees__.push({iteratee:ge(g,3),type:u}),C.__filtered__=C.__filtered__||f,C}}),on(["head","last"],function(s,a){var u="take"+(a?"Right":"");Le.prototype[s]=function(){return this[u](1).value()[0]}}),on(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");Le.prototype[s]=function(){return this.__filtered__?new Le(this):this[u](1)}}),Le.prototype.compact=function(){return this.filter(Zt)},Le.prototype.find=function(s){return this.filter(s).head()},Le.prototype.findLast=function(s){return this.reverse().find(s)},Le.prototype.invokeMap=Ie(function(s,a){return typeof s=="function"?new Le(this):this.map(function(u){return os(u,s,a)})}),Le.prototype.reject=function(s){return this.filter(Ua(ge(s)))},Le.prototype.slice=function(s,a){s=Be(s);var u=this;return u.__filtered__&&(s>0||a<0)?new Le(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),a!==n&&(a=Be(a),u=a<0?u.dropRight(-a):u.take(a-s)),u)},Le.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Le.prototype.toArray=function(){return this.take(ke)},Zn(Le.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),f=/^(?:head|last)$/.test(a),g=_[f?"take"+(a=="last"?"Right":""):a],C=f||/^find/.test(a);g&&(_.prototype[a]=function(){var N=this.__wrapped__,A=f?[1]:arguments,D=N instanceof Le,Y=A[0],X=D||Ne(N),Q=function(Fe){var Oe=g.apply(_,Ar([Fe],A));return f&&oe?Oe[0]:Oe};X&&u&&typeof Y=="function"&&Y.length!=1&&(D=X=!1);var oe=this.__chain__,he=!!this.__actions__.length,_e=C&&!oe,De=D&&!he;if(!C&&X){N=De?N:new Le(this);var Ce=s.apply(N,A);return Ce.__actions__.push({func:Ma,args:[Q],thisArg:n}),new an(Ce,oe)}return _e&&De?s.apply(this,A):(Ce=this.thru(Q),_e?f?Ce.value()[0]:Ce.value():Ce)})}),on(["pop","push","shift","sort","splice","unshift"],function(s){var a=ua[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",f=/^(?:pop|shift)$/.test(s);_.prototype[s]=function(){var g=arguments;if(f&&!this.__chain__){var C=this.value();return a.apply(Ne(C)?C:[],g)}return this[u](function(N){return a.apply(Ne(N)?N:[],g)})}}),Zn(Le.prototype,function(s,a){var u=_[a];if(u){var f=u.name+"";qe.call(Uo,f)||(Uo[f]=[]),Uo[f].push({name:a,func:u})}}),Uo[Pa(n,v).name]=[{name:"wrapper",func:n}],Le.prototype.clone=sD,Le.prototype.reverse=aD,Le.prototype.value=lD,_.prototype.at=LF,_.prototype.chain=OF,_.prototype.commit=MF,_.prototype.next=GF,_.prototype.plant=zF,_.prototype.reverse=UF,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=ZF,_.prototype.first=_.prototype.head,Xi&&(_.prototype[Xi]=$F),_},Go=MR();to?((to.exports=Go)._=Go,Fc._=Go):vt._=Go}).call(Yo)}(Us,Us.exports);var ze=Us.exports;const QN={class:"grid-overlay-container"},Jp=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",QN,[e.params.notReady?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[n[0]||(n[0]=r.createElementVNode("div",{class:"grid-icon-cat-in-bag"},null,-1)),n[1]||(n[1]=r.createElementVNode("span",{class:"text-subtitle-m"},"Not calculated",-1))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[n[2]||(n[2]=r.createElementVNode("div",{class:"mask-24 mask-loading grid-mask-loading"},null,-1)),n[3]||(n[3]=r.createElementVNode("span",{class:"text-subtitle-m"},"Loading",-1))],64))]))}}),eV={},tV={class:"grid-overlay-container"};function nV(t,e){return r.openBlock(),r.createElementBlock("div",tV,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const Qp=Jl(eV,[["render",nV]]);async function rV(t,e){throw Error("not implemented")}function oV(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function iV(t,e){const n=[];for(const o of e)if(t[o].type==="column"){const i=oV(t[o].spec);for(const l of i){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const c=dl(l),d=t.findIndex(p=>ze.isEqual(p.id,c));if(d===-1)throw console.error("axis not found",o,c,t),Error("axis not found");n.push({columnIdx:o,axisIdx:d})}}return n}const eh=(t,e)=>(t+e).toString();function sV(t,e,n,o,i,l){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const c=t[0];let d=-1,p=-1;for(let y=0;y<l.length;++y)l[y]===c.axisIdx&&(d=y),l[y]===c.columnIdx&&(p=y);const h=(()=>{const b=o[d].data.filter(w=>w!==null);return Array.from(new Set(b))})();h.sort(),p>d?(n.splice(p,1),n.splice(d,1)):(n.splice(d,1),n.splice(p,1));const m=aV(i,o,d,p,h,e.rows);for(let y=0;y<h.length;++y){const b=h[y],w=$r(b+"@"+y);n.push({colId:w,field:eh(o.length,y),headerName:b,valueFormatter:oh})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function aV(t,e,n,o,i,l){const c=new Map;let d=0;for(let h=0;h<l;h++){const m={};for(let M=0;M<e.length;++M){if(M===n||M===o)continue;const O=t[M].toString();m[O]=e[M].data[h]}let y;const b=$r(Object.values(m))??"";c.has(b)?y=c.get(b):(c.set(b,m),y=m,y.id=d.toString(),d++);const w=i.indexOf(e[n].data[h]);if(w===-1)throw Error("index not found");const S=eh(e.length,w);y[S]=e[o].data[h]}return Array.from(c.values())}const Yr='"##RowNumberColumnId##"';function lV(){return{colId:Yr,headerName:"#",valueGetter:t=>t.node===null||t.node.rowIndex===null?null:t.node.rowIndex+1,headerClass:"pl-ag-header-align-center",suppressNavigable:!0,lockPosition:"left",suppressMovable:!0,mainMenuItems:[],contextMenuItems:[],pinned:"left",lockPinned:!0,minWidth:45,suppressSizeToFit:!0,suppressAutoSize:!0,cellStyle:{color:"var(--txt-03)","background-color":"var(--bg-base-light)",overflow:"visible !important","text-align":"center"},sortable:!1,resizable:!1}}function cV(){const t=document.createElement("div");return t.style.visibility="hidden",t.style.position="absolute",t.style.boxSizing="border-box",t.style.padding="15.5px",t.style.border="1px solid",t.style.width="auto",document.body.appendChild(t),t}function th(t,e){const n=t.getCellValue({rowNode:t.getDisplayedRowAtIndex(t.getLastDisplayedRowIndex()),colKey:Yr});if(typeof n!="number")return;const o=n.toString().length;if(e.innerHTML.length===o)return;const i="5";e.innerHTML=i.repeat(o),r.nextTick(()=>{t.setColumnWidths([{key:Yr,newWidth:e.offsetWidth}])})}function dV(t){document.body.removeChild(t)}function uV(t){const e=cV();t.addEventListener("viewportChanged",()=>{th(t,e)}),t.addEventListener("columnVisible",n=>{n.columns&&n.columns.some(o=>o.isVisible()&&o.getColId()===Yr)&&th(t,e)}),t.addEventListener("gridPreDestroyed",()=>{dV(e)})}const pV={class:"pl-ag-column-header__title d-flex align-center gap-6 flex-grow-1"},nh=r.defineComponent({__name:"PlAgColumnHeader",props:{params:{}},setup(t){const e=t,n=r.computed(()=>{var m,y;const h=(y=(m=e.params.column.getUserProvidedColDef())==null?void 0:m.headerComponentParams)==null?void 0:y.type;switch(h){case void 0:case"Text":return"cell-type-txt";case"Number":return"cell-type-num";case"File":return"paper-clip";case"Date":return"calendar";case"Duration":return"time";default:throw Error(`unsupported data type: ${h} for PlAgColumnHeader component. Column ${e.params.column.getColId()}`)}}),o=r.ref(null),i=()=>o.value=e.params.column.getSort()??null;r.onMounted(()=>i());function l(){e.params.column.isSortable()&&(e.params.progressSort(),i())}const c=r.computed(()=>{const h=o.value;switch(h){case"asc":return"arrow-up";case"desc":return"arrow-down";case null:return null;default:throw Error(`unsupported sort direction: ${h}. Column ${e.params.column.getColId()}`)}}),d=r.ref();function p(){const h=d.value;h&&e.params.showColumnMenu(h)}return(h,m)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-ag-column-header d-flex align-center gap-6",onClick:l},[r.createElementVNode("div",pV,[r.createVNode(r.unref(Vt),{name:n.value,class:"pl-ag-column-header__type-icon"},null,8,["name"]),r.createElementVNode("span",null,r.toDisplayString(h.params.displayName),1),c.value?(r.openBlock(),r.createBlock(r.unref(Vt),{key:0,name:c.value},null,8,["name"])):r.createCommentVNode("",!0)]),h.params.enableMenu?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"menuActivatorBtn",ref:d,class:"pl-ag-column-header__menu-icon",onClick:r.withModifiers(p,["stop"])},[r.createVNode(r.unref(Vt),{name:"more"})],512)):r.createCommentVNode("",!0)]))}});function hV(t){return $r(t)}function rh(t){return JSON.parse(t)}const oh=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function fV(t,e,n){var l,c,d;const o=hV(e),i=e.type==="axis"?e.spec.type:e.spec.valueType;return{colId:o,field:t.toString(),headerName:((c=(l=e.spec.annotations)==null?void 0:l["pl7.app/label"])==null?void 0:c.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(n==null?void 0:n.includes(o))??((d=e.spec.annotations)==null?void 0:d["pl7.app/table/visibility"])==="optional",valueFormatter:oh,headerComponent:nh,headerComponentParams:{type:(()=>{switch(i){case"Int":case"Long":case"Float":case"Double":return"Number";case"String":case"Bytes":return"Text";default:throw Error(`unsupported data type: ${i}`)}})()},cellDataType:(()=>{switch(i){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${i}`)}})()}}function ih(t,e){switch(e){case"Int":return t;case"Long":return typeof t=="bigint"?Number(t):t;case"Float":return t;case"Double":return t;case"String":return t;case"Bytes":return Buffer.from(t).toString("hex");default:throw Error(`unsupported data type: ${e}`)}}function sh(t){const e=[];return bs(t,n=>(e.push(n),n)),e}async function mV(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:ze.uniqWith(n.map(i=>gu(i.spec.axesSpec).map(ze.cloneDeep)).flat(),ze.isEqual),strictlyCompatible:!0})).hits.filter(i=>i.spec.axesSpec.length===1):[]}async function gV(t,e,n){const o=sh(n),l=(await mV(t,e,o)).filter(c=>!ze.find(o,d=>c.columnId===d.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(c=>({type:"column",column:c}))}}async function yV(t,e,n,o){const i=n.filter(m=>m.type!=="Bytes"),l=sh(o),c=i.map(m=>[]),d=i.map(m=>null);for(let m=0;m<l.length;++m){const y=gu(l[m].spec.axesSpec);for(let b=0;b<y.length;++b){const w=ze.findIndex(i,S=>ze.isEqual(S,y[b]));w===-1||d[w]||(y.length===1&&l[m].spec.name==="pl7.app/label"?(c[w]=[[m,b]],d[w]=l[m].columnId):c[w].push([m,b]))}}for(let m=i.length-1;m>=0;--m)c[m].length||(d.splice(m,1),c.splice(m,1),i.splice(m,1));const p=100,h=i.map(m=>new Set);e:for(let m=i.length-1;m>=0;--m){for(const[y,b]of c[m]){const w=await t.getUniqueValues(e,{columnId:l[y].columnId,...!d[m]&&{axis:ze.cloneDeep(i[m])},filters:[],limit:p});if(w.overflow){d.splice(m,1),c.splice(m,1),i.splice(m,1);continue e}const S=w.values.type;for(const M of w.values.data)if(!(mu(M,S)||M===null)&&(h[m].add(ih(M,S)),h[m].size===p)){d.splice(m,1),c.splice(m,1),i.splice(m,1);continue e}}if(!h[m].size){d.splice(m,1),c.splice(m,1),i.splice(m,1);continue e}}return i.map((m,y)=>{const b=[...h[y]].map(S=>({value:S,label:S.toString()})),w=b[0].value;return{axis:ze.cloneDeep(m),...d[y]&&{column:d[y]},options:b,defaultValue:w}})}function _V(t,e,n,o){const i=t.length,l=[];for(let c=0;c<e[0].data.length;++c){const d=[],p=(o++).toString();for(const m of n)d.push(e[m].data[c]);const h={key:d,id:p};for(let m=0;m<i;++m){const y=t[m].toString(),b=e[m].data[c],w=e[m].type;Xy(e[m].absent,c)?h[y]=void 0:mu(b,w)||b===null?h[y]=null:h[y]=ih(b,w)}l.push(h)}return l}const CV=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function vV(t,e,n,o){const i=await t.getSpec(e);let l=i.findIndex(v=>v.type==="column");l===-1&&(l=i.length);const c=[...i.keys()].filter(v=>!ze.find(n,L=>ze.isEqual(L.axis,i[v].id)||ze.isEqual(L.column,i[v].id))).sort((v,L)=>{var P,V;if(i[v].type!==i[L].type)return i[v].type==="axis"?-1:1;const I=(P=i[v].spec.annotations)==null?void 0:P["pl7.app/table/orderPriority"],W=(V=i[L].spec.annotations)==null?void 0:V["pl7.app/table/orderPriority"];return I===void 0?W===void 0?0:1:W===void 0?-1:Number(W)-Number(I)}),d=ze.cloneDeep(c),p=iV(i,c);for(let v=c.length-1;v>=0;--v){const L=c[v];if(!CV(i[L]))continue;const I=dl(i[L].spec.axesSpec[0]),W=ze.findIndex(c,P=>ze.isEqual(i[P].id,I));if(W===-1&&ze.findIndex(n,V=>ze.isEqual(V.axis,I))===-1){console.warn(`added label column, but the axis is not in the data; axisId: ${I}`);continue}c[W]=L;for(const P of p)P.axisIdx===L&&(P.axisIdx=W);c.splice(v,1),d.splice(v,1)}const h=await t.getShape(e),m=h.rows,y=[lV(),...d.map(v=>fV(v,i[v],o))];if(p.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",p.length," transposition will not be applied."),p.length===1)return sV(p,h,y,await t.getData(e,c),d,c);const b=[...c],w=new Map;for(let v=0;v<l;++v)w.set(v,-1);for(let v=0;v<b.length;++v){const L=b[v];w.has(L)&&w.set(L,v)}for(const[v,L]of w)L===-1&&(w.set(v,b.length),b.push(v));const S=[];for(let v=0;v<l;++v){const L=w.get(v);if(L===void 0||L===-1)throw new Error("assertion exception");S.push(L)}let M;return{rowModelType:"serverSide",columnDefs:y,serverSideDatasource:{getRows:async v=>{try{if(m==0){v.success({rowData:[],rowCount:m}),v.api.setGridOption("loading",!1),v.api.showNoRowsOverlay();return}if(M&&!ze.isEqual(M.request.sortModel,v.request.sortModel)){M=void 0,v.api.setGridOption("loading",!0),v.success({rowData:[],rowCount:0});return}M=v;let L=0,I=[];if(m>0&&v.request.startRow!==void 0&&v.request.endRow!==void 0&&(L=Math.min(m,v.request.endRow)-v.request.startRow,L>0)){const W=await t.getData(e,b,{offset:v.request.startRow,length:L});I=_V(d,W,S,v.request.startRow)}v.success({rowData:I,rowCount:m}),v.api.setGridOption("loading",!1)}catch(L){v.api.setGridOption("loading",!0),v.fail(),console.trace(L)}}}}}const Ql=Og(),wV=["onClick"],ah=r.defineComponent({__name:"PlAgGridColumnManager",props:{api:{}},setup(t){const e=t,{api:n}=r.toRefs(e),o=r.ref([]),i=r.ref(),l=r.ref(!1),c=r.ref(0);Xp(i,{handle:".handle",onChange(h){n.value.moveColumns(p(h.map(m=>o.value[m])),0)}});function d(h){n.value.setColumnsVisible([h],!h.isVisible())}function p(h){const m=h.findIndex(y=>y.getId()===Yr);if(m!==0){const[y]=h.splice(m,1);return h.splice(0,0,y)}return h}return r.onMounted(()=>{n.value.getAllGridColumns().length>0&&n.value.moveColumns(p(n.value.getAllGridColumns()),0),n.value.addEventListener("displayedColumnsChanged",()=>{o.value=[...n.value.getAllGridColumns()??[]],c.value++}),o.value=n.value.getAllGridColumns()??[]}),(h,m)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createBlock(r.Teleport,{to:`#${r.unref(Ql)}`},[r.createVNode(r.unref(vo),{onClick:m[0]||(m[0]=r.withModifiers(y=>l.value=!l.value,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(At),{name:"columns"})]),default:r.withCtx(()=>[m[2]||(m[2]=r.createTextVNode(" Columns "))]),_:1})],8,["to"])),r.createVNode(r.unref(Ps),{modelValue:l.value,"onUpdate:modelValue":m[1]||(m[1]=y=>l.value=y),width:"368px","close-on-outside-click":""},{title:r.withCtx(()=>m[3]||(m[3]=[r.createTextVNode("Columns")])),default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("div",{ref_key:"listRef",ref:i,key:c.value,class:"pl-ag-columns"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,y=>(r.openBlock(),r.createElementBlock("div",{key:y.getId(),class:"pl-ag-columns__item"},[r.createElementVNode("div",{class:r.normalizeClass([{handle:!y.getColDef().lockPosition},"pl-ag-columns__drag"])},[r.createVNode(r.unref(Vt),{name:"drag-dots"})],2),r.createElementVNode("div",{class:r.normalizeClass([{visible:y.isVisible()},"pl-ag-columns__title text-s-btn"])},r.toDisplayString(y.getColDef().headerName),3),r.createElementVNode("div",{class:"pl-ag-columns__visibility",onClick:b=>d(y)},[r.createVNode(r.unref(Ct),{"close-delay":500,position:"top"},{tooltip:r.withCtx(()=>m[4]||(m[4]=[r.createTextVNode("Show/Hide")])),default:r.withCtx(()=>[r.createVNode(r.unref(At),{name:y.isVisible()?"view-show":"view-hide"},null,8,["name"])]),_:2},1024)],8,wV)]))),128))]))]),_:1},8,["modelValue"])]))}}),bV=["id"],xV=r.defineComponent({__name:"PlAgDataTableToolsPanel",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(Ql),class:"d-flex gap-6"},[r.renderSlot(e.$slots,"default")],8,bV))}}),kV={class:"ap-ag-data-table-container"},EV={key:1,class:"ap-ag-data-table-sheets"},SV=Jl(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{},showColumnsPanel:{type:Boolean}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:r.mergeModels(["onRowDoubleClicked","columnsChanged"],["update:modelValue"]),setup(t,{expose:e,emit:n}){T.ModuleRegistry.registerModules([ps.ClientSideRowModelModule,Hd.ClipboardModule,jd.ServerSideRowModelModule,qd.RangeSelectionModule,fl,Mu]);const o=r.useModel(t,"modelValue"),i=t,{settings:l}=r.toRefs(i),c=n;r.watch(()=>l.value,async(k,x)=>{if(k.sourceType!=="pframe"||!k.pFrame||!k.join||x&&x.sourceType==="pframe"&&ze.isEqual(k.pFrame,x.pFrame)&&ze.isEqual(k.join,x.join))return;const B=window.platforma;if(!B)throw Error("platforma not set");const G=B.pFrameDriver;if(!G)throw Error("platforma.pFrameDriver not set");const H=await gV(G,k.pFrame,k.join),K=o.value;K.pTableParams||(K.pTableParams={sorting:[],filters:[]}),K.pTableParams.join=H,o.value=K});const d=Gh(()=>l.value.sourceType,async k=>{var B;const x=l.value.sourceType;switch(x){case"pframe":{const G=window.platforma;if(!G)throw Error("platforma not set");const H=G.pFrameDriver;if(!H)throw Error("platforma.pFrameDriver not set");if(!l.value.pFrame)return[];const K=l.value.pFrame,ne=(B=o.value.pTableParams)==null?void 0:B.join;return ne?await yV(H,K,l.value.sheetAxes,ne):[]}case"ptable":return l.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${x}`)}});function p(k){if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return(k==null?void 0:k.sortModel.map(x=>{const{spec:B,...G}=rh(x.colId);return{column:G,ascending:x.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const h=r.computed({get:()=>{const k=o.value;return{columnOrder:k.gridState.columnOrder,sort:k.gridState.sort,columnVisibility:k.gridState.columnVisibility}},set:k=>{const x=o.value,B=S.value.rowModelType==="clientSide"?void 0:p(k.sort);x.gridState={...x.gridState,...k},(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(x.pTableParams||(x.pTableParams={sorting:[],filters:[]}),x.pTableParams.sorting=B),o.value=x}}),m=k=>$r(k);function y(k){var x;if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return((x=d.value)==null?void 0:x.map(B=>({type:"bySingleColumnV2",column:B.column?{type:"column",id:B.column}:{type:"axis",id:B.axis},predicate:{operator:"Equal",reference:k[m(B.axis)]}})))??[]}const b=r.computed({get:()=>o.value.gridState.sheets??{},set:k=>{const x=y(k),B=o.value;B.gridState.sheets=k,(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(B.pTableParams||(B.pTableParams={sorting:[],filters:[]}),B.pTableParams.filters=x),o.value=B}});r.watch(()=>[l.value,d.value],(k,x)=>{const[B,G]=k;if(!G)return;if(x){const[K,ne]=x;if((B.sourceType==="ptable"||B.sourceType==="pframe")&&B.sourceType===(K==null?void 0:K.sourceType)&&ze.isEqual(G,ne))return}if(B.sourceType!=="ptable"&&B.sourceType!=="pframe"){b.value={};return}const H=b.value;for(const K of G){const ne=m(K.axis);H[ne]||(H[ne]=K.defaultValue??K.options[0].value)}b.value=H},{immediate:!0});const w=r.shallowRef(),S=r.shallowRef({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:h.value,autoSizeStrategy:{type:"fitCellContents"},onRowDoubleClicked:k=>{k.data&&c("onRowDoubleClicked",k.data.key)},onSortChanged:k=>{k.api.refreshCells()},onFilterChanged:k=>{k.api.refreshCells()},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:k=>k.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:Jp,noRowsOverlayComponent:Qp,sideBar:{},defaultCsvExportParams:{allColumns:!0,suppressQuotes:!0,fileName:"table.csv"}}),M=k=>{const x=k.api;uV(x),w.value=new Proxy(x,{get(B,G,H){switch(G){case"setGridOption":return(K,ne)=>{const pe=S.value;pe[K]=ne,S.value=pe,x.setGridOption(K,ne)};case"updateGridOptions":return K=>{S.value={...S.value,...K},x.updateGridOptions(K)};default:return Reflect.get(B,G,H)}}})},O=k=>({columnOrder:k.columnOrder,sort:k.sort,columnVisibility:k.columnVisibility??(k.columnOrder?{hiddenColIds:[]}:void 0)}),v=k=>{S.value.initialState=h.value=O(k.state),k.api.autoSizeColumns(k.api.getAllDisplayedColumns().filter(x=>x.getColId()!==Yr))},L=()=>{S.value.initialState=h.value=O(w.value.getState()),w.value=void 0};let I=!1;const W=()=>{if(!I)return;const k=w.value;k!==void 0&&(k.exportDataAsCsv(),I=!1,k.setGridOption("cacheBlockSize",100))},P=()=>{if(!I)return;const k=w.value;if(k===void 0)return;const x=k.getServerSideGroupLevelState()[0];x.cacheBlockSize===x.rowCount&&k.refreshServerSide({route:x.route,purge:!1})};e({exportCsv:async()=>{const k=w.value;if(k!==void 0){if(S.value.rowModelType==="clientSide"){k.exportDataAsCsv();return}if(S.value.rowModelType==="serverSide"){const x=k.getServerSideGroupLevelState()[0];if(x.rowCount<=x.cacheBlockSize){k.exportDataAsCsv();return}I||(I=!0,k.setGridOption("cacheBlockSize",x.rowCount))}}}});const Z=r.ref(0);r.watch(()=>[w.value,h.value],(k,x)=>{if(ze.isEqual(k,x))return;const[B,G]=k;if(!B)return;const H=O(B.getState());ze.isEqual(G,H)||(S.value.initialState=G,++Z.value)}),r.watch(()=>S.value,(k,x)=>{var B;if(x&&(k.rowModelType!=x.rowModelType&&++Z.value,!ze.isEqual(k.columnDefs,x.columnDefs)&&k.columnDefs)){const G=ne=>!("children"in ne),H=(B=k.columnDefs)==null?void 0:B.filter(G),K=H==null?void 0:H.map(ne=>ne.colId).filter(ne=>ne!==void 0).filter(ne=>ne!==Yr).map(ne=>rh(ne));c("columnsChanged",K??[])}});const J=(k,x)=>{var G;const B=b.value;B[k]!==x&&(B[k]=x,b.value=B,(G=w.value)==null||G.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))},ae=window.platforma;if(!ae)throw Error("platforma not set");const $=ae.pFrameDriver;if(!$)throw Error("platforma.pFrameDriver not set");const j=ae.blobDriver;if(!j)throw Error("platforma.blobDriver not set");let U;return r.watch(()=>[w.value,l.value,d.value],async k=>{var K,ne;const[x,B,G]=k;if(!x||ze.isEqual(B,U))return;U=B;const H=B.sourceType;switch(H){case"pframe":case"ptable":{const pe=B.pTable;if(!pe||!G)return x.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ke=(ne=(K=h.value)==null?void 0:K.columnVisibility)==null?void 0:ne.hiddenColIds,Ee=await vV($,pe,G,ke);return x.updateGridOptions({loading:Ee.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...Ee})}case"xsv":{const pe=B.xsvFile;if(!(pe!=null&&pe.ok)||!pe.value)return x.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ke=await rV(j,pe.value);return x.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...ke})}default:throw Error(`unsupported source type: ${H}`)}}),(k,x)=>(r.openBlock(),r.createElementBlock("div",kV,[w.value&&k.showColumnsPanel?(r.openBlock(),r.createBlock(r.unref(ah),{key:0,api:w.value},null,8,["api"])):r.createCommentVNode("",!0),r.unref(d).value&&r.unref(d).value.length>0?(r.openBlock(),r.createElementBlock("div",EV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(d).value,(B,G)=>(r.openBlock(),r.createBlock(r.unref(bp),{key:G,"model-value":b.value[m(B.axis)],options:B.options,"onUpdate:modelValue":H=>J(m(B.axis),H)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.unref(Dg.AgGridVue),{key:Z.value,theme:r.unref($u),class:"ap-ag-data-table-grid","grid-options":S.value,onGridReady:M,onStateUpdated:v,onGridPreDestroyed:L,onStoreRefreshed:W,onModelUpdated:P},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-8eb98dd8"]]),TV={key:1,class:"alert-error"},NV={key:2},VV=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),o=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),i=r.computed(()=>n.value===void 0&&o.value===void 0);return(l,c)=>(r.openBlock(),r.createElementBlock("div",null,[n.value!==void 0?r.renderSlot(l.$slots,"default",r.normalizeProps(r.mergeProps({key:0},{value:n.value}))):r.createCommentVNode("",!0),o.value?(r.openBlock(),r.createElementBlock("div",TV,r.toDisplayString(o.value),1)):r.createCommentVNode("",!0),i.value?(r.openBlock(),r.createElementBlock("div",NV,"Unresolved")):r.createCommentVNode("",!0)]))}}),AV={style:{height:"100%"}},BV=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),o=r.computed(()=>e.params.value);function i(c){e.params.setValue(c)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(o.value):void 0);return(c,d)=>(r.openBlock(),r.createElementBlock("div",AV,[r.createVNode(r.unref(jp),{"show-filename-only":"",clearable:"","cell-style":"","file-dialog-title":"Select any file",placeholder:`Choose file ${n.value?n.value[0]:""}`,extensions:n.value,"model-value":o.value,progress:l.value,"onUpdate:modelValue":i},null,8,["placeholder","extensions","model-value","progress"])]))}}),PV={class:"pl-ag-grid-open-cell d-flex"},RV={class:"pl-ag-grid-open-cell__value"},DV=r.defineComponent({__name:"PlAgTextAndButtonCell",props:{params:{}},setup(t){const e=t;function n(){if(e.params.invokeRowsOnDoubleClick){const o=e.params.api,i={rowPinned:e.params.node.rowPinned,api:o,rowIndex:e.params.node.rowIndex,context:o,type:"rowDoubleClicked",node:e.params.node,data:e.params.data,event:null};o.dispatchEvent(i)}else e.params.onClick&&e.params.onClick(e.params)}return(o,i)=>(r.openBlock(),r.createElementBlock("div",PV,[r.createElementVNode("div",RV,r.toDisplayString(o.params.value),1),r.createElementVNode("div",{class:"pl-ag-grid-open-cell__activator text-caps11 align-center",onClick:r.withModifiers(n,["stop"])},[r.createVNode(r.unref(Vt),{name:o.params.icon??"maximize"},null,8,["name"]),r.createTextVNode(" "+r.toDisplayString(o.params.btnLabel??"Open"),1)])]))}});var ec={exports:{}};const IV="2.0.0",lh=256,FV=Number.MAX_SAFE_INTEGER||9007199254740991,LV=16,OV=lh-6;var Zs={MAX_LENGTH:lh,MAX_SAFE_COMPONENT_LENGTH:LV,MAX_SAFE_BUILD_LENGTH:OV,MAX_SAFE_INTEGER:FV,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:IV,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Ws=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:i}=Zs,l=Ws;e=t.exports={};const c=e.re=[],d=e.safeRe=[],p=e.src=[],h=e.t={};let m=0;const y="[a-zA-Z0-9-]",b=[["\\s",1],["\\d",i],[y,o]],w=M=>{for(const[O,v]of b)M=M.split(`${O}*`).join(`${O}{0,${v}}`).split(`${O}+`).join(`${O}{1,${v}}`);return M},S=(M,O,v)=>{const L=w(O),I=m++;l(M,I,O),h[M]=I,p[I]=O,c[I]=new RegExp(O,v?"g":void 0),d[I]=new RegExp(L,v?"g":void 0)};S("NUMERICIDENTIFIER","0|[1-9]\\d*"),S("NUMERICIDENTIFIERLOOSE","\\d+"),S("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),S("MAINVERSION",`(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})`),S("MAINVERSIONLOOSE",`(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASEIDENTIFIER",`(?:${p[h.NUMERICIDENTIFIER]}|${p[h.NONNUMERICIDENTIFIER]})`),S("PRERELEASEIDENTIFIERLOOSE",`(?:${p[h.NUMERICIDENTIFIERLOOSE]}|${p[h.NONNUMERICIDENTIFIER]})`),S("PRERELEASE",`(?:-(${p[h.PRERELEASEIDENTIFIER]}(?:\\.${p[h.PRERELEASEIDENTIFIER]})*))`),S("PRERELEASELOOSE",`(?:-?(${p[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[h.PRERELEASEIDENTIFIERLOOSE]})*))`),S("BUILDIDENTIFIER",`${y}+`),S("BUILD",`(?:\\+(${p[h.BUILDIDENTIFIER]}(?:\\.${p[h.BUILDIDENTIFIER]})*))`),S("FULLPLAIN",`v?${p[h.MAINVERSION]}${p[h.PRERELEASE]}?${p[h.BUILD]}?`),S("FULL",`^${p[h.FULLPLAIN]}$`),S("LOOSEPLAIN",`[v=\\s]*${p[h.MAINVERSIONLOOSE]}${p[h.PRERELEASELOOSE]}?${p[h.BUILD]}?`),S("LOOSE",`^${p[h.LOOSEPLAIN]}$`),S("GTLT","((?:<|>)?=?)"),S("XRANGEIDENTIFIERLOOSE",`${p[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),S("XRANGEIDENTIFIER",`${p[h.NUMERICIDENTIFIER]}|x|X|\\*`),S("XRANGEPLAIN",`[v=\\s]*(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:${p[h.PRERELEASE]})?${p[h.BUILD]}?)?)?`),S("XRANGEPLAINLOOSE",`[v=\\s]*(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:${p[h.PRERELEASELOOSE]})?${p[h.BUILD]}?)?)?`),S("XRANGE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAIN]}$`),S("XRANGELOOSE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAINLOOSE]}$`),S("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),S("COERCE",`${p[h.COERCEPLAIN]}(?:$|[^\\d])`),S("COERCEFULL",p[h.COERCEPLAIN]+`(?:${p[h.PRERELEASE]})?(?:${p[h.BUILD]})?(?:$|[^\\d])`),S("COERCERTL",p[h.COERCE],!0),S("COERCERTLFULL",p[h.COERCEFULL],!0),S("LONETILDE","(?:~>?)"),S("TILDETRIM",`(\\s*)${p[h.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",S("TILDE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAIN]}$`),S("TILDELOOSE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAINLOOSE]}$`),S("LONECARET","(?:\\^)"),S("CARETTRIM",`(\\s*)${p[h.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",S("CARET",`^${p[h.LONECARET]}${p[h.XRANGEPLAIN]}$`),S("CARETLOOSE",`^${p[h.LONECARET]}${p[h.XRANGEPLAINLOOSE]}$`),S("COMPARATORLOOSE",`^${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]})$|^$`),S("COMPARATOR",`^${p[h.GTLT]}\\s*(${p[h.FULLPLAIN]})$|^$`),S("COMPARATORTRIM",`(\\s*)${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]}|${p[h.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",S("HYPHENRANGE",`^\\s*(${p[h.XRANGEPLAIN]})\\s+-\\s+(${p[h.XRANGEPLAIN]})\\s*$`),S("HYPHENRANGELOOSE",`^\\s*(${p[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[h.XRANGEPLAINLOOSE]})\\s*$`),S("STAR","(<|>)?=?\\s*\\*"),S("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),S("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ec,ec.exports);var Mi=ec.exports;const MV=Object.freeze({loose:!0}),GV=Object.freeze({});var tc=t=>t?typeof t!="object"?MV:t:GV;const ch=/^[0-9]+$/,dh=(t,e)=>{const n=ch.test(t),o=ch.test(e);return n&&o&&(t=+t,e=+e),t===e?0:n&&!o?-1:o&&!n?1:t<e?-1:1};var uh={compareIdentifiers:dh,rcompareIdentifiers:(t,e)=>dh(e,t)};const js=Ws,{MAX_LENGTH:ph,MAX_SAFE_INTEGER:Hs}=Zs,{safeRe:hh,t:fh}=Mi,$V=tc,{compareIdentifiers:No}=uh;var Pt=class Hn{constructor(e,n){if(n=$V(n),e instanceof Hn){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ph)throw new TypeError(`version is longer than ${ph} characters`);js("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const o=e.trim().match(n.loose?hh[fh.LOOSE]:hh[fh.FULL]);if(!o)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>Hs||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Hs||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Hs||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const l=+i;if(l>=0&&l<Hs)return l}return i}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(js("SemVer.compare",this.version,this.options,e),!(e instanceof Hn)){if(typeof e=="string"&&e===this.version)return 0;e=new Hn(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof Hn||(e=new Hn(e,this.options)),No(this.major,e.major)||No(this.minor,e.minor)||No(this.patch,e.patch)}comparePre(e){if(e instanceof Hn||(e=new Hn(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const o=this.prerelease[n],i=e.prerelease[n];if(js("prerelease compare",n,o,i),o===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(o===void 0)return-1;if(o===i)continue;return No(o,i)}while(++n)}compareBuild(e){e instanceof Hn||(e=new Hn(e,this.options));let n=0;do{const o=this.build[n],i=e.build[n];if(js("build compare",n,o,i),o===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(o===void 0)return-1;if(o===i)continue;return No(o,i)}while(++n)}inc(e,n,o){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,o),this.inc("pre",n,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,o),this.inc("pre",n,o);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(o)?1:0;if(!n&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let l=this.prerelease.length;for(;--l>=0;)typeof this.prerelease[l]=="number"&&(this.prerelease[l]++,l=-2);if(l===-1){if(n===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let l=[n,i];o===!1&&(l=[n]),No(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=l):this.prerelease=l}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const mh=Pt;var Vo=(t,e,n=!1)=>{if(t instanceof mh)return t;try{return new mh(t,e)}catch(o){if(!n)return null;throw o}};const zV=Vo;var UV=(t,e)=>{const n=zV(t,e);return n?n.version:null};const ZV=Vo;var WV=(t,e)=>{const n=ZV(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};const gh=Pt;var jV=(t,e,n,o,i)=>{typeof n=="string"&&(i=o,o=n,n=void 0);try{return new gh(t instanceof gh?t.version:t,n).inc(e,o,i).version}catch{return null}};const yh=Vo;var HV=(t,e)=>{const n=yh(t,null,!0),o=yh(e,null,!0),i=n.compare(o);if(i===0)return null;const l=i>0,c=l?n:o,d=l?o:n,p=!!c.prerelease.length;if(!!d.prerelease.length&&!p)return!d.patch&&!d.minor?"major":c.patch?"patch":c.minor?"minor":"major";const m=p?"pre":"";return n.major!==o.major?m+"major":n.minor!==o.minor?m+"minor":n.patch!==o.patch?m+"patch":"prerelease"};const qV=Pt;var KV=(t,e)=>new qV(t,e).major;const YV=Pt;var XV=(t,e)=>new YV(t,e).minor;const JV=Pt;var QV=(t,e)=>new JV(t,e).patch;const eA=Vo;var tA=(t,e)=>{const n=eA(t,e);return n&&n.prerelease.length?n.prerelease:null};const _h=Pt;var _n=(t,e,n)=>new _h(t,n).compare(new _h(e,n));const nA=_n;var rA=(t,e,n)=>nA(e,t,n);const oA=_n;var iA=(t,e)=>oA(t,e,!0);const Ch=Pt;var nc=(t,e,n)=>{const o=new Ch(t,n),i=new Ch(e,n);return o.compare(i)||o.compareBuild(i)};const sA=nc;var aA=(t,e)=>t.sort((n,o)=>sA(n,o,e));const lA=nc;var cA=(t,e)=>t.sort((n,o)=>lA(o,n,e));const dA=_n;var qs=(t,e,n)=>dA(t,e,n)>0;const uA=_n;var rc=(t,e,n)=>uA(t,e,n)<0;const pA=_n;var vh=(t,e,n)=>pA(t,e,n)===0;const hA=_n;var wh=(t,e,n)=>hA(t,e,n)!==0;const fA=_n;var oc=(t,e,n)=>fA(t,e,n)>=0;const mA=_n;var ic=(t,e,n)=>mA(t,e,n)<=0;const gA=vh,yA=wh,_A=qs,CA=oc,vA=rc,wA=ic;var bh=(t,e,n,o)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return gA(t,n,o);case"!=":return yA(t,n,o);case">":return _A(t,n,o);case">=":return CA(t,n,o);case"<":return vA(t,n,o);case"<=":return wA(t,n,o);default:throw new TypeError(`Invalid operator: ${e}`)}};const bA=Pt,xA=Vo,{safeRe:Ks,t:Ys}=Mi;var kA=(t,e)=>{if(t instanceof bA)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?Ks[Ys.COERCEFULL]:Ks[Ys.COERCE]);else{const p=e.includePrerelease?Ks[Ys.COERCERTLFULL]:Ks[Ys.COERCERTL];let h;for(;(h=p.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||h.index+h[0].length!==n.index+n[0].length)&&(n=h),p.lastIndex=h.index+h[1].length+h[2].length;p.lastIndex=-1}if(n===null)return null;const o=n[2],i=n[3]||"0",l=n[4]||"0",c=e.includePrerelease&&n[5]?`-${n[5]}`:"",d=e.includePrerelease&&n[6]?`+${n[6]}`:"";return xA(`${o}.${i}.${l}${c}${d}`,e)},EA=class{constructor(){this.max=1e3,this.map=new Map}get(e){const n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(e,n)}return this}},sc,xh;function Cn(){if(xh)return sc;xh=1;const t=/\s+/g;class e{constructor(B,G){if(G=i(G),B instanceof e)return B.loose===!!G.loose&&B.includePrerelease===!!G.includePrerelease?B:new e(B.raw,G);if(B instanceof l)return this.raw=B.value,this.set=[[B]],this.formatted=void 0,this;if(this.options=G,this.loose=!!G.loose,this.includePrerelease=!!G.includePrerelease,this.raw=B.trim().replace(t," "),this.set=this.raw.split("||").map(H=>this.parseRange(H.trim())).filter(H=>H.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const H=this.set[0];if(this.set=this.set.filter(K=>!M(K[0])),this.set.length===0)this.set=[H];else if(this.set.length>1){for(const K of this.set)if(K.length===1&&O(K[0])){this.set=[K];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let B=0;B<this.set.length;B++){B>0&&(this.formatted+="||");const G=this.set[B];for(let H=0;H<G.length;H++)H>0&&(this.formatted+=" "),this.formatted+=G[H].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(B){const H=((this.options.includePrerelease&&w)|(this.options.loose&&S))+":"+B,K=o.get(H);if(K)return K;const ne=this.options.loose,pe=ne?p[h.HYPHENRANGELOOSE]:p[h.HYPHENRANGE];B=B.replace(pe,U(this.options.includePrerelease)),c("hyphen replace",B),B=B.replace(p[h.COMPARATORTRIM],m),c("comparator trim",B),B=B.replace(p[h.TILDETRIM],y),c("tilde trim",B),B=B.replace(p[h.CARETTRIM],b),c("caret trim",B);let ke=B.split(" ").map(Ke=>L(Ke,this.options)).join(" ").split(/\s+/).map(Ke=>j(Ke,this.options));ne&&(ke=ke.filter(Ke=>(c("loose invalid filter",Ke,this.options),!!Ke.match(p[h.COMPARATORLOOSE])))),c("range list",ke);const Ee=new Map,He=ke.map(Ke=>new l(Ke,this.options));for(const Ke of He){if(M(Ke))return[Ke];Ee.set(Ke.value,Ke)}Ee.size>1&&Ee.has("")&&Ee.delete("");const It=[...Ee.values()];return o.set(H,It),It}intersects(B,G){if(!(B instanceof e))throw new TypeError("a Range is required");return this.set.some(H=>v(H,G)&&B.set.some(K=>v(K,G)&&H.every(ne=>K.every(pe=>ne.intersects(pe,G)))))}test(B){if(!B)return!1;if(typeof B=="string")try{B=new d(B,this.options)}catch{return!1}for(let G=0;G<this.set.length;G++)if(k(this.set[G],B,this.options))return!0;return!1}}sc=e;const n=EA,o=new n,i=tc,l=Xs(),c=Ws,d=Pt,{safeRe:p,t:h,comparatorTrimReplace:m,tildeTrimReplace:y,caretTrimReplace:b}=Mi,{FLAG_INCLUDE_PRERELEASE:w,FLAG_LOOSE:S}=Zs,M=x=>x.value==="<0.0.0-0",O=x=>x.value==="",v=(x,B)=>{let G=!0;const H=x.slice();let K=H.pop();for(;G&&H.length;)G=H.every(ne=>K.intersects(ne,B)),K=H.pop();return G},L=(x,B)=>(c("comp",x,B),x=V(x,B),c("caret",x),x=W(x,B),c("tildes",x),x=J(x,B),c("xrange",x),x=$(x,B),c("stars",x),x),I=x=>!x||x.toLowerCase()==="x"||x==="*",W=(x,B)=>x.trim().split(/\s+/).map(G=>P(G,B)).join(" "),P=(x,B)=>{const G=B.loose?p[h.TILDELOOSE]:p[h.TILDE];return x.replace(G,(H,K,ne,pe,ke)=>{c("tilde",x,H,K,ne,pe,ke);let Ee;return I(K)?Ee="":I(ne)?Ee=`>=${K}.0.0 <${+K+1}.0.0-0`:I(pe)?Ee=`>=${K}.${ne}.0 <${K}.${+ne+1}.0-0`:ke?(c("replaceTilde pr",ke),Ee=`>=${K}.${ne}.${pe}-${ke} <${K}.${+ne+1}.0-0`):Ee=`>=${K}.${ne}.${pe} <${K}.${+ne+1}.0-0`,c("tilde return",Ee),Ee})},V=(x,B)=>x.trim().split(/\s+/).map(G=>Z(G,B)).join(" "),Z=(x,B)=>{c("caret",x,B);const G=B.loose?p[h.CARETLOOSE]:p[h.CARET],H=B.includePrerelease?"-0":"";return x.replace(G,(K,ne,pe,ke,Ee)=>{c("caret",x,K,ne,pe,ke,Ee);let He;return I(ne)?He="":I(pe)?He=`>=${ne}.0.0${H} <${+ne+1}.0.0-0`:I(ke)?ne==="0"?He=`>=${ne}.${pe}.0${H} <${ne}.${+pe+1}.0-0`:He=`>=${ne}.${pe}.0${H} <${+ne+1}.0.0-0`:Ee?(c("replaceCaret pr",Ee),ne==="0"?pe==="0"?He=`>=${ne}.${pe}.${ke}-${Ee} <${ne}.${pe}.${+ke+1}-0`:He=`>=${ne}.${pe}.${ke}-${Ee} <${ne}.${+pe+1}.0-0`:He=`>=${ne}.${pe}.${ke}-${Ee} <${+ne+1}.0.0-0`):(c("no pr"),ne==="0"?pe==="0"?He=`>=${ne}.${pe}.${ke}${H} <${ne}.${pe}.${+ke+1}-0`:He=`>=${ne}.${pe}.${ke}${H} <${ne}.${+pe+1}.0-0`:He=`>=${ne}.${pe}.${ke} <${+ne+1}.0.0-0`),c("caret return",He),He})},J=(x,B)=>(c("replaceXRanges",x,B),x.split(/\s+/).map(G=>ae(G,B)).join(" ")),ae=(x,B)=>{x=x.trim();const G=B.loose?p[h.XRANGELOOSE]:p[h.XRANGE];return x.replace(G,(H,K,ne,pe,ke,Ee)=>{c("xRange",x,H,K,ne,pe,ke,Ee);const He=I(ne),It=He||I(pe),Ke=It||I(ke),Un=Ke;return K==="="&&Un&&(K=""),Ee=B.includePrerelease?"-0":"",He?K===">"||K==="<"?H="<0.0.0-0":H="*":K&&Un?(It&&(pe=0),ke=0,K===">"?(K=">=",It?(ne=+ne+1,pe=0,ke=0):(pe=+pe+1,ke=0)):K==="<="&&(K="<",It?ne=+ne+1:pe=+pe+1),K==="<"&&(Ee="-0"),H=`${K+ne}.${pe}.${ke}${Ee}`):It?H=`>=${ne}.0.0${Ee} <${+ne+1}.0.0-0`:Ke&&(H=`>=${ne}.${pe}.0${Ee} <${ne}.${+pe+1}.0-0`),c("xRange return",H),H})},$=(x,B)=>(c("replaceStars",x,B),x.trim().replace(p[h.STAR],"")),j=(x,B)=>(c("replaceGTE0",x,B),x.trim().replace(p[B.includePrerelease?h.GTE0PRE:h.GTE0],"")),U=x=>(B,G,H,K,ne,pe,ke,Ee,He,It,Ke,Un)=>(I(H)?G="":I(K)?G=`>=${H}.0.0${x?"-0":""}`:I(ne)?G=`>=${H}.${K}.0${x?"-0":""}`:pe?G=`>=${G}`:G=`>=${G}${x?"-0":""}`,I(He)?Ee="":I(It)?Ee=`<${+He+1}.0.0-0`:I(Ke)?Ee=`<${He}.${+It+1}.0-0`:Un?Ee=`<=${He}.${It}.${Ke}-${Un}`:x?Ee=`<${He}.${It}.${+Ke+1}-0`:Ee=`<=${Ee}`,`${G} ${Ee}`.trim()),k=(x,B,G)=>{for(let H=0;H<x.length;H++)if(!x[H].test(B))return!1;if(B.prerelease.length&&!G.includePrerelease){for(let H=0;H<x.length;H++)if(c(x[H].semver),x[H].semver!==l.ANY&&x[H].semver.prerelease.length>0){const K=x[H].semver;if(K.major===B.major&&K.minor===B.minor&&K.patch===B.patch)return!0}return!1}return!0};return sc}var ac,kh;function Xs(){if(kh)return ac;kh=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(m,y){if(y=n(y),m instanceof e){if(m.loose===!!y.loose)return m;m=m.value}m=m.trim().split(/\s+/).join(" "),c("comparator",m,y),this.options=y,this.loose=!!y.loose,this.parse(m),this.semver===t?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(m){const y=this.options.loose?o[i.COMPARATORLOOSE]:o[i.COMPARATOR],b=m.match(y);if(!b)throw new TypeError(`Invalid comparator: ${m}`);this.operator=b[1]!==void 0?b[1]:"",this.operator==="="&&(this.operator=""),b[2]?this.semver=new d(b[2],this.options.loose):this.semver=t}toString(){return this.value}test(m){if(c("Comparator.test",m,this.options.loose),this.semver===t||m===t)return!0;if(typeof m=="string")try{m=new d(m,this.options)}catch{return!1}return l(m,this.operator,this.semver,this.options)}intersects(m,y){if(!(m instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new p(m.value,y).test(this.value):m.operator===""?m.value===""?!0:new p(this.value,y).test(m.semver):(y=n(y),y.includePrerelease&&(this.value==="<0.0.0-0"||m.value==="<0.0.0-0")||!y.includePrerelease&&(this.value.startsWith("<0.0.0")||m.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&m.operator.startsWith(">")||this.operator.startsWith("<")&&m.operator.startsWith("<")||this.semver.version===m.semver.version&&this.operator.includes("=")&&m.operator.includes("=")||l(this.semver,"<",m.semver,y)&&this.operator.startsWith(">")&&m.operator.startsWith("<")||l(this.semver,">",m.semver,y)&&this.operator.startsWith("<")&&m.operator.startsWith(">")))}}ac=e;const n=tc,{safeRe:o,t:i}=Mi,l=bh,c=Ws,d=Pt,p=Cn();return ac}const SA=Cn();var Js=(t,e,n)=>{try{e=new SA(e,n)}catch{return!1}return e.test(t)};const TA=Cn();var NA=(t,e)=>new TA(t,e).set.map(n=>n.map(o=>o.value).join(" ").trim().split(" "));const VA=Pt,AA=Cn();var BA=(t,e,n)=>{let o=null,i=null,l=null;try{l=new AA(e,n)}catch{return null}return t.forEach(c=>{l.test(c)&&(!o||i.compare(c)===-1)&&(o=c,i=new VA(o,n))}),o};const PA=Pt,RA=Cn();var DA=(t,e,n)=>{let o=null,i=null,l=null;try{l=new RA(e,n)}catch{return null}return t.forEach(c=>{l.test(c)&&(!o||i.compare(c)===1)&&(o=c,i=new PA(o,n))}),o};const lc=Pt,IA=Cn(),Eh=qs;var FA=(t,e)=>{t=new IA(t,e);let n=new lc("0.0.0");if(t.test(n)||(n=new lc("0.0.0-0"),t.test(n)))return n;n=null;for(let o=0;o<t.set.length;++o){const i=t.set[o];let l=null;i.forEach(c=>{const d=new lc(c.semver.version);switch(c.operator){case">":d.prerelease.length===0?d.patch++:d.prerelease.push(0),d.raw=d.format();case"":case">=":(!l||Eh(d,l))&&(l=d);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),l&&(!n||Eh(n,l))&&(n=l)}return n&&t.test(n)?n:null};const LA=Cn();var OA=(t,e)=>{try{return new LA(t,e).range||"*"}catch{return null}};const MA=Pt,Sh=Xs(),{ANY:GA}=Sh,$A=Cn(),zA=Js,Th=qs,Nh=rc,UA=ic,ZA=oc;var cc=(t,e,n,o)=>{t=new MA(t,o),e=new $A(e,o);let i,l,c,d,p;switch(n){case">":i=Th,l=UA,c=Nh,d=">",p=">=";break;case"<":i=Nh,l=ZA,c=Th,d="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(zA(t,e,o))return!1;for(let h=0;h<e.set.length;++h){const m=e.set[h];let y=null,b=null;if(m.forEach(w=>{w.semver===GA&&(w=new Sh(">=0.0.0")),y=y||w,b=b||w,i(w.semver,y.semver,o)?y=w:c(w.semver,b.semver,o)&&(b=w)}),y.operator===d||y.operator===p||(!b.operator||b.operator===d)&&l(t,b.semver))return!1;if(b.operator===p&&c(t,b.semver))return!1}return!0};const WA=cc;var jA=(t,e,n)=>WA(t,e,">",n);const HA=cc;var qA=(t,e,n)=>HA(t,e,"<",n);const Vh=Cn();var KA=(t,e,n)=>(t=new Vh(t,n),e=new Vh(e,n),t.intersects(e,n));const YA=Js,XA=_n;var JA=(t,e,n)=>{const o=[];let i=null,l=null;const c=t.sort((m,y)=>XA(m,y,n));for(const m of c)YA(m,e,n)?(l=m,i||(i=m)):(l&&o.push([i,l]),l=null,i=null);i&&o.push([i,null]);const d=[];for(const[m,y]of o)m===y?d.push(m):!y&&m===c[0]?d.push("*"):y?m===c[0]?d.push(`<=${y}`):d.push(`${m} - ${y}`):d.push(`>=${m}`);const p=d.join(" || "),h=typeof e.raw=="string"?e.raw:String(e);return p.length<h.length?p:e};const Ah=Cn(),dc=Xs(),{ANY:uc}=dc,Gi=Js,pc=_n,QA=(t,e,n={})=>{if(t===e)return!0;t=new Ah(t,n),e=new Ah(e,n);let o=!1;e:for(const i of t.set){for(const l of e.set){const c=tB(i,l,n);if(o=o||c!==null,c)continue e}if(o)return!1}return!0},eB=[new dc(">=0.0.0-0")],Bh=[new dc(">=0.0.0")],tB=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===uc){if(e.length===1&&e[0].semver===uc)return!0;n.includePrerelease?t=eB:t=Bh}if(e.length===1&&e[0].semver===uc){if(n.includePrerelease)return!0;e=Bh}const o=new Set;let i,l;for(const w of t)w.operator===">"||w.operator===">="?i=Ph(i,w,n):w.operator==="<"||w.operator==="<="?l=Rh(l,w,n):o.add(w.semver);if(o.size>1)return null;let c;if(i&&l){if(c=pc(i.semver,l.semver,n),c>0)return null;if(c===0&&(i.operator!==">="||l.operator!=="<="))return null}for(const w of o){if(i&&!Gi(w,String(i),n)||l&&!Gi(w,String(l),n))return null;for(const S of e)if(!Gi(w,String(S),n))return!1;return!0}let d,p,h,m,y=l&&!n.includePrerelease&&l.semver.prerelease.length?l.semver:!1,b=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;y&&y.prerelease.length===1&&l.operator==="<"&&y.prerelease[0]===0&&(y=!1);for(const w of e){if(m=m||w.operator===">"||w.operator===">=",h=h||w.operator==="<"||w.operator==="<=",i){if(b&&w.semver.prerelease&&w.semver.prerelease.length&&w.semver.major===b.major&&w.semver.minor===b.minor&&w.semver.patch===b.patch&&(b=!1),w.operator===">"||w.operator===">="){if(d=Ph(i,w,n),d===w&&d!==i)return!1}else if(i.operator===">="&&!Gi(i.semver,String(w),n))return!1}if(l){if(y&&w.semver.prerelease&&w.semver.prerelease.length&&w.semver.major===y.major&&w.semver.minor===y.minor&&w.semver.patch===y.patch&&(y=!1),w.operator==="<"||w.operator==="<="){if(p=Rh(l,w,n),p===w&&p!==l)return!1}else if(l.operator==="<="&&!Gi(l.semver,String(w),n))return!1}if(!w.operator&&(l||i)&&c!==0)return!1}return!(i&&h&&!l&&c!==0||l&&m&&!i&&c!==0||b||y)},Ph=(t,e,n)=>{if(!t)return e;const o=pc(t.semver,e.semver,n);return o>0?t:o<0||e.operator===">"&&t.operator===">="?e:t},Rh=(t,e,n)=>{if(!t)return e;const o=pc(t.semver,e.semver,n);return o<0?t:o>0||e.operator==="<"&&t.operator==="<="?e:t};var nB=QA;const hc=Mi,Dh=Zs,rB=Pt,Ih=uh,oB=Vo,iB=UV,sB=WV,aB=jV,lB=HV,cB=KV,dB=XV,uB=QV,pB=tA,hB=_n,fB=rA,mB=iA,gB=nc,yB=aA,_B=cA,CB=qs,vB=rc,wB=vh,bB=wh,xB=oc,kB=ic,EB=bh,SB=kA,TB=Xs(),NB=Cn();var VB={parse:oB,valid:iB,clean:sB,inc:aB,diff:lB,major:cB,minor:dB,patch:uB,prerelease:pB,compare:hB,rcompare:fB,compareLoose:mB,compareBuild:gB,sort:yB,rsort:_B,gt:CB,lt:vB,eq:wB,neq:bB,gte:xB,lte:kB,cmp:EB,coerce:SB,Comparator:TB,Range:NB,satisfies:Js,toComparators:NA,maxSatisfying:BA,minSatisfying:DA,minVersion:FA,validRange:OA,outside:cc,gtr:jA,ltr:qA,intersects:KA,simplifyRange:JA,subset:nB,SemVer:rB,re:hc.re,src:hc.src,tokens:hc.t,SEMVER_SPEC_VERSION:Dh.SEMVER_SPEC_VERSION,RELEASE_TYPES:Dh.RELEASE_TYPES,compareIdentifiers:Ih.compareIdentifiers,rcompareIdentifiers:Ih.rcompareIdentifiers};const AB=Qd(VB);function BB(t){return $r(t.id)}function PB(t){switch(t){case"isNotNA":return"Is not NA";case"isNA":return"Is NA";case"number_equals":case"string_equals":return"Equals";case"number_notEquals":case"string_notEquals":return"Not equals";case"number_greaterThan":return"Greater than";case"number_greaterThanOrEqualTo":return"Greater than or equal to";case"number_lessThan":return"Less than";case"number_lessThanOrEqualTo":return"Less than or equal to";case"number_between":return"Between";case"string_contains":return"Contains";case"string_doesNotContain":return"Does not contain";case"string_matches":return"Matches";case"string_doesNotMatch":return"Does not match";case"string_containsFuzzyMatch":return"Contains fuzzy match";default:throw Error(`unsupported filter type: ${t}`)}}const RB=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],DB=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"];function Fh(t,e){var n,o;return((o=(n=t.spec.annotations)==null?void 0:n["pl7.app/label"])==null?void 0:o.trim())??"Unlabeled "+t.type+" "+e.toString()}function IB(t){const e=t.type;switch(e){case"isNotNA":case"isNA":return;case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return t.reference;case"number_between":return t.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return t.reference;default:throw Error(`unsupported filter type: ${e}`)}}function Lh(t,e){switch(t){case"isNotNA":case"isNA":return{type:t};case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return{type:t,reference:typeof e=="number"?e:0};case"number_between":return{type:t,lowerBound:typeof e=="number"?e:0,includeLowerBound:!0,upperBound:100,includeUpperBound:!1};case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":return{type:t,reference:typeof e=="string"?e:""};case"string_containsFuzzyMatch":return{type:t,reference:typeof e=="string"?e:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${t}`)}}function FB(t,e){return{columnId:t.columnId,filter:Lh(e,IB(t.filter)),disabled:t.disabled}}function fc(t,e){var c,d;const n=Number(e);if(!Number.isFinite(n))throw Error("Model value is not a number.");const o=t.type==="column"?t.spec.valueType:t.spec.type;if((o==="Int"||o==="Long")&&!Number.isInteger(n))throw Error("Model value is not an integer.");const i=(c=t.spec.annotations)==null?void 0:c["pl7.app/min"];if(i!==void 0){const p=Number(i);if(Number.isFinite(p)&&n<Number(i))throw Error("Model value is too low.")}const l=(d=t.spec.annotations)==null?void 0:d["pl7.app/max"];if(l!==void 0){const p=Number(l);if(Number.isFinite(p)&&n>Number(l))throw Error("Model value is too high.")}return n}function Oh(t,e){var o,i;const n=((o=t.spec.domain)==null?void 0:o["pl7.app/alphabet"])??((i=t.spec.annotations)==null?void 0:i["pl7.app/alphabet"]);if(n==="nucleotide"&&!/^[AaTtGgCcNn]+$/.test(e))throw Error("Model value is not a nucleotide.");if(n==="aminoacid"&&!/^[AaCcDdEeFfGgHhIiKkLlMmNnPpQqRrSsTtVvWwYyXx]+$/.test(e))throw Error("Model value is not an aminoacid.");return e}function LB(t){try{return new RegExp(t),t}catch(e){throw e instanceof SyntaxError?Error("Model value is not a regexp."):e}}function OB(t,e){var i,l;const n=((i=t.spec.domain)==null?void 0:i["pl7.app/alphabet"])??((l=t.spec.annotations)==null?void 0:l["pl7.app/alphabet"]);if(n==="nucleotide")return[{value:"N",text:"N"}];if(n==="aminoacid")return[{value:"X",text:"X"}];const o=ze.uniq(e);return o.sort(),o.map(c=>({value:c,text:c}))}function MB(t,e){var i,l;const n=AB.gt(yu().sdkInfo.sdkVersion,"1.14.0")&&(t.type==="column"?t.spec.valueType:t.spec.type)==="String"&&(((i=t.spec.domain)==null?void 0:i["pl7.app/alphabet"])??((l=t.spec.annotations)==null?void 0:l["pl7.app/alphabet"]))!==void 0,o=e.type;switch(o){case"isNotNA":return{operator:"Not",operand:{operator:"IsNA"}};case"isNA":return{operator:"IsNA"};case"number_equals":return{operator:"Equal",reference:e.reference};case"string_equals":return{operator:n?"IEqual":"Equal",reference:e.reference};case"number_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:e.reference}};case"string_notEquals":return{operator:"Not",operand:{operator:n?"IEqual":"Equal",reference:e.reference}};case"number_greaterThan":return{operator:"Greater",reference:e.reference};case"number_greaterThanOrEqualTo":return{operator:"GreaterOrEqual",reference:e.reference};case"number_lessThan":return{operator:"Less",reference:e.reference};case"number_lessThanOrEqualTo":return{operator:"LessOrEqual",reference:e.reference};case"number_between":return{operator:"And",operands:[{operator:e.includeLowerBound?"GreaterOrEqual":"Greater",reference:e.lowerBound},{operator:e.includeUpperBound?"LessOrEqual":"Less",reference:e.upperBound}]};case"string_contains":return{operator:n?"StringIContains":"StringContains",substring:e.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:n?"StringIContains":"StringContains",substring:e.reference}};case"string_matches":return{operator:"Matches",regex:e.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:e.reference}};case"string_containsFuzzyMatch":return{operator:n?"StringIContainsFuzzy":"StringContainsFuzzy",reference:e.reference,maxEdits:e.maxEdits,substitutionsOnly:e.substitutionsOnly,wildcard:e.wildcard};default:throw Error(`unsupported filter type: ${o}`)}}const GB={class:"d-flex flex-column gap-24"},Mh=r.defineComponent({__name:"PlTableFilterEntry",props:r.mergeModels({column:{},options:{},disabled:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{column:o,options:i}=r.toRefs(n);return(l,c)=>(r.openBlock(),r.createElementBlock("div",GB,[r.createVNode(r.unref(wo),{"model-value":e.value.filter.type,options:r.unref(i),disabled:l.disabled,label:"Predicate","onUpdate:modelValue":c[0]||(c[0]=d=>e.value=r.unref(FB)(e.value,d))},null,8,["model-value","options","disabled"]),e.value.filter.type==="number_equals"||e.value.filter.type==="number_notEquals"||e.value.filter.type==="number_lessThan"||e.value.filter.type==="number_lessThanOrEqualTo"||e.value.filter.type==="number_greaterThan"||e.value.filter.type==="number_greaterThanOrEqualTo"?(r.openBlock(),r.createBlock(r.unref(jr),{key:0,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[1]||(c[1]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(fc)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createVNode(r.unref(jr),{modelValue:e.value.filter.lowerBound,"onUpdate:modelValue":c[2]||(c[2]=d=>e.value.filter.lowerBound=d),disabled:l.disabled,parse:d=>r.unref(fc)(r.unref(o),d),label:"Lower bound"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(Rs),{modelValue:e.value.filter.includeLowerBound,"onUpdate:modelValue":c[3]||(c[3]=d=>e.value.filter.includeLowerBound=d),disabled:l.disabled,label:"Include lower bound"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(jr),{modelValue:e.value.filter.upperBound,"onUpdate:modelValue":c[4]||(c[4]=d=>e.value.filter.upperBound=d),disabled:l.disabled,parse:d=>r.unref(fc)(r.unref(o),d),label:"Upper bound"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(Rs),{modelValue:e.value.filter.includeUpperBound,"onUpdate:modelValue":c[5]||(c[5]=d=>e.value.filter.includeUpperBound=d),disabled:l.disabled,label:"Include upper bound"},null,8,["modelValue","disabled"])],64)):r.createCommentVNode("",!0),e.value.filter.type==="string_equals"||e.value.filter.type==="string_notEquals"||e.value.filter.type==="string_contains"||e.value.filter.type==="string_doesNotContain"?(r.openBlock(),r.createBlock(r.unref(jr),{key:2,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[6]||(c[6]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(Oh)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="string_matches"||e.value.filter.type==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(jr),{key:3,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[7]||(c[7]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:r.unref(LB),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:4},[r.createVNode(r.unref(jr),{modelValue:e.value.filter.reference,"onUpdate:modelValue":c[8]||(c[8]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(Oh)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(qp),{modelValue:e.value.filter.maxEdits,"onUpdate:modelValue":c[9]||(c[9]=d=>e.value.filter.maxEdits=d),max:5,disabled:l.disabled,breakpoints:"",label:"Maximum nuber of substitutions and indels"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(Rs),{modelValue:e.value.filter.substitutionsOnly,"onUpdate:modelValue":c[10]||(c[10]=d=>e.value.filter.substitutionsOnly=d),disabled:l.disabled,label:"Substitutions only"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(wo),{modelValue:e.value.filter.wildcard,"onUpdate:modelValue":c[11]||(c[11]=d=>e.value.filter.wildcard=d),disabled:l.disabled,options:r.unref(OB)(r.unref(o),e.value.filter.reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","disabled","options"])],64)):r.createCommentVNode("",!0)]))}}),$B={class:"d-flex flex-column gap-24"},zB={key:0,class:"text-subtitle-m",style:{color:"var(--txt-mask)"}},UB=r.defineComponent({__name:"PlTableAddFilter",props:r.mergeModels({columnsById:{},columnOptions:{},filterOptions:{},makeFilter:{type:Function}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:r.mergeModels(["addFilter"],["update:modelValue"]),setup(t,{emit:e}){const n=r.useModel(t,"modelValue"),o=t,{columnsById:i,columnOptions:l,filterOptions:c}=r.toRefs(o),d=e,p=r.ref(),h=r.ref();r.watch(()=>p.value,b=>{b?h.value=o.makeFilter(b):h.value=void 0});const m=()=>{p.value=void 0,n.value=!1},y=()=>{h.value&&(d("addFilter",h.value),m())};return(b,w)=>(r.openBlock(),r.createBlock(r.unref(Ps),{modelValue:n.value,"onUpdate:modelValue":w[2]||(w[2]=S=>n.value=S),"close-on-outside-click":!1},{title:r.withCtx(()=>w[3]||(w[3]=[r.createTextVNode("Add Filter")])),actions:r.withCtx(()=>[r.createVNode(r.unref(Ns),{disabled:!h.value,onClick:y},{default:r.withCtx(()=>w[4]||(w[4]=[r.createTextVNode("Add Filter")])),_:1},8,["disabled"]),r.createVNode(r.unref(vo),{"justify-center":!1,onClick:m},{default:r.withCtx(()=>w[5]||(w[5]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",$B,[r.createVNode(r.unref(wo),{modelValue:p.value,"onUpdate:modelValue":w[0]||(w[0]=S=>p.value=S),options:r.unref(l),label:"Column",placeholder:"Choose..."},null,8,["modelValue","options"]),h.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",zB,"Choose a column to view and adjust its options")),h.value?(r.openBlock(),r.createBlock(Mh,{key:1,modelValue:h.value,"onUpdate:modelValue":w[1]||(w[1]=S=>h.value=S),column:r.unref(i)[h.value.columnId],options:r.unref(c)[h.value.columnId]},null,8,["modelValue","column","options"])):r.createCommentVNode("",!0)])]),_:1},8,["modelValue"]))}}),ZB=["onClick"],WB={class:"pl-filter-manager__expand-icon"},jB={class:"pl-filter-manager__title flex-grow-1 text-s-btn"},HB={class:"pl-filter-manager__actions d-flex gap-12"},qB=["onClick"],KB=["onClick"],YB={class:"pl-filter-manager__content d-flex gap-24 p-24 flex-column"},XB={class:"d-flex justify-center"},JB=["onClick"],QB={class:"pl-filter-manager__add-btn-icon"},eP={key:0},tP=r.defineComponent({__name:"PlTableFilters",props:r.mergeModels({columns:{},restrictions:{},defaults:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{columns:o,restrictions:i,defaults:l}=r.toRefs(n),c=r.computed(()=>{const $=o.value.filter(U=>{const k=U.type;switch(k){case"axis":return U.spec.type!=="Bytes";case"column":return U.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${k}`)}}),j={};for(const U of $)j[BB(U)]=U;return j}),d=r.computed(()=>{const $=i.value??[],j={};for(const[U,k]of Object.entries(c.value)){const x=ze.find($,B=>ze.isEqual(B.column.id,k.id));x&&(j[U]=x.allowedFilterTypes)}return j}),p=r.computed(()=>{const $=l.value??[],j={};for(const[U,k]of Object.entries(c.value)){const x=ze.find($,B=>ze.isEqual(B.column.id,k.id));x&&(j[U]={columnId:U,filter:x.default,disabled:!1})}return j});(()=>{let $=e.value.state;typeof $=="object"&&!Array.isArray($)&&(e.value.state=Object.entries($).map(([j,U])=>({columnId:j,filter:U,disabled:!1})))})();const h=$=>$??Object.values(p.value),m=r.reactive({state:h(e.value.state)});r.watch(()=>e.value,$=>{ze.isEqual(m.state,$.state)||(m.state=h($.state))}),r.watch(()=>m,$=>{ze.isEqual($.state,e.value.state)||(e.value={state:ze.cloneDeep($.state),filters:$.state.filter(j=>!j.disabled).map(j=>{const U=c.value[j.columnId],{spec:k,...x}=U;return{type:"bySingleColumnV2",column:x,predicate:MB(U,j.filter)}})})},{immediate:!0,deep:!0}),r.watch(()=>c.value,$=>{Object.keys($).length===0&&m.state!==void 0||(m.state=m.state.filter(j=>!!$[j.columnId]))},{immediate:!0});const y=r.computed(()=>Object.keys(c).length>0&&m.state.length>0),b=r.computed(()=>{const $=d.value,j={};for(const[U,k]of Object.entries(c.value)){let B=(k.type==="column"?k.spec.valueType:k.spec.type)==="String"?DB:RB;const G=$[U];G&&(B=B.filter(H=>G.includes(H))),j[U]=B.map(H=>({value:H,text:PB(H)}))}return j}),w=r.computed(()=>ze.some(Object.values(b.value),$=>$.length>0)),S=r.computed(()=>Object.entries(Object.entries(c.value)).filter(([$,[j,U]])=>b.value[j].length>0).filter(([$,[j,U]])=>!m.state.some(k=>k.columnId===j)).map(([$,[j,U]])=>({label:Fh(U,$),value:j}))),M=$=>p.value[$]??{columnId:$,filter:Lh(b.value[$][0].value),disabled:!1},O=$=>{m.state[$]=M(m.state[$].columnId)},v=$=>m.state.splice($,1),L=r.ref(!1),I=r.ref(!1),W=r.ref(!1);r.onMounted(()=>{W.value=!0});const P=r.reactive({}),V=$=>{P[$]?delete P[$]:P[$]=!0},Z=r.ref(!1),J=r.ref();let ae;return r.onMounted(()=>{ae=new ResizeObserver(()=>{var j;const $=(j=J.value)==null?void 0:j.parentElement;$&&(Z.value=$.scrollHeight>$.clientHeight||$.scrollWidth>$.clientWidth)}),J.value&&J.value.parentElement&&ae.observe(J.value.parentElement)}),r.watch(J,($,j)=>{j!=null&&j.parentElement&&ae.unobserve(j.parentElement),$!=null&&$.parentElement&&ae.observe($.parentElement)}),r.onBeforeUnmount(()=>{ae!==void 0&&ae.disconnect()}),($,j)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[W.value?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:`#${r.unref(Ql)}`},[r.createVNode(r.unref(vo),{onClick:j[0]||(j[0]=r.withModifiers(U=>L.value=!0,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(As),{name:y.value?"filter-on":"filter"},null,8,["name"])]),default:r.withCtx(()=>[j[5]||(j[5]=r.createTextVNode(" Filters "))]),_:1})],8,["to"])):r.createCommentVNode("",!0),r.createVNode(r.unref(Ps),{modelValue:L.value,"onUpdate:modelValue":j[2]||(j[2]=U=>L.value=U),"close-on-outside-click":!1},{title:r.withCtx(()=>j[6]||(j[6]=[r.createTextVNode("Manage Filters")])),default:r.withCtx(()=>[r.createElementVNode("div",{ref_key:"filterManager",ref:J,class:"pl-filter-manager d-flex flex-column gap-6"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.state,(U,k)=>(r.openBlock(),r.createElementBlock("div",{key:U.columnId,class:r.normalizeClass([{open:P[U.columnId],disabled:U.disabled},"pl-filter-manager__filter"])},[r.createElementVNode("div",{class:"pl-filter-manager__header d-flex align-center gap-8",onClick:x=>V(U.columnId)},[r.createElementVNode("div",WB,[r.createVNode(r.unref(Vt),{name:"chevron-right"})]),r.createElementVNode("div",jB,r.toDisplayString(r.unref(Fh)(c.value[U.columnId],k)),1),r.createElementVNode("div",HB,[r.createElementVNode("div",{class:"pl-filter-manager__toggle",onClick:r.withModifiers(x=>U.disabled=!U.disabled,["stop"])},[r.createVNode(r.unref(At),{name:U.disabled?"view-hide":"view-show"},null,8,["name"])],8,qB),r.createElementVNode("div",{class:"pl-filter-manager__delete",onClick:r.withModifiers(x=>v(k),["stop"])},[r.createVNode(r.unref(At),{name:"close"})],8,KB)])],8,ZB),r.createElementVNode("div",YB,[r.createVNode(Mh,{modelValue:m.state[k],"onUpdate:modelValue":x=>m.state[k]=x,disabled:U.disabled,column:c.value[U.columnId],options:b.value[U.columnId]},null,8,["modelValue","onUpdate:modelValue","disabled","column","options"]),r.createElementVNode("div",XB,[r.createElementVNode("div",{class:r.normalizeClass([{disabled:U.disabled},"pl-filter-manager__revert-btn text-s-btn d-flex align-center gap-8"]),onClick:x=>O(k)},[j[7]||(j[7]=r.createTextVNode(" Revert Settings to Default ")),r.createVNode(r.unref(At),{name:"reverse"})],10,JB)])])],2))),128)),r.createElementVNode("div",{class:r.normalizeClass([{"pt-24":Z.value},"pl-filter-manager__add-action-wrapper"])},[S.value.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-filter-manager__add-btn",onClick:j[1]||(j[1]=U=>I.value=!0)},[r.createElementVNode("div",QB,[r.createVNode(r.unref(Vt),{name:"add"})]),j[8]||(j[8]=r.createElementVNode("div",{class:"pl-filter-manager__add-btn-title text-s-btn"},"Add Filter",-1))])):r.createCommentVNode("",!0)],2),w.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",eP,"No filters applicable"))],512)]),_:1},8,["modelValue"]),r.createVNode(UB,{modelValue:I.value,"onUpdate:modelValue":j[3]||(j[3]=U=>I.value=U),"columns-by-id":c.value,"column-options":S.value,"filter-options":b.value,"make-filter":M,onAddFilter:j[4]||(j[4]=U=>m.state.push(U))},null,8,["modelValue","columns-by-id","column-options","filter-options"])],64))}}),Qs=new Map;function nP(t,e){const n=r.getCurrentScope()??r.effectScope(),o=n.run(()=>(r.onScopeDispose(()=>{Qs.delete(t)}),r.reactive(e())));return o[Symbol.dispose]=()=>{n.stop()},o}function rP(t){const e=Symbol();return()=>(Qs.has(e)||Qs.set(e,nP(e,t)),Qs.get(e))}function oP(t){return r.computed(()=>{try{return tu(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function Gh(t,e,n){const o=r.ref(0),i=r.reactive({loading:r.computed(()=>o.value>0),loadingRef:o,value:void 0,error:void 0}),l=Gg(e);return r.watch(t,async c=>{i.error=void 0,o.value++,l(c).then(d=>{d.ok&&(i.value=d.value)}).catch(d=>{i.value=void 0,i.error=d}).finally(()=>{o.value--})},Object.assign({immediate:!0,deep:!0},n??{})),i}const Ao=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,$h=new Set,mc=typeof process=="object"&&process?process:{},zh=(t,e,n,o)=>{typeof mc.emitWarning=="function"?mc.emitWarning(t,e,n,o):console.error(`[${n}] ${e}: ${t}`)};let ea=globalThis.AbortController,Uh=globalThis.AbortSignal;if(typeof ea>"u"){Uh=class{constructor(){We(this,"onabort");We(this,"_onabort",[]);We(this,"reason");We(this,"aborted",!1)}addEventListener(o,i){this._onabort.push(i)}},ea=class{constructor(){We(this,"signal",new Uh);e()}abort(o){var i,l;if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(const c of this.signal._onabort)c(o);(l=(i=this.signal).onabort)==null||l.call(i,o)}}};let t=((Wh=mc.env)==null?void 0:Wh.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,zh("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const iP=t=>!$h.has(t),Tr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Zh=t=>Tr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ta:null:null;class ta extends Array{constructor(e){super(e),this.fill(0)}}const Xr=class Xr{constructor(e,n){We(this,"heap");We(this,"length");if(!E(Xr,Bo))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=Zh(e);if(!n)return[];ye(Xr,Bo,!0);const o=new Xr(e,n);return ye(Xr,Bo,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Bo=new WeakMap,Ue(Xr,Bo,!1);let gc=Xr;const Cc=class Cc{constructor(e){Ue(this,re);Ue(this,vn);Ue(this,Ht);Ue(this,wn);Ue(this,bn);Ue(this,Po);Ue(this,Ro);We(this,"ttl");We(this,"ttlResolution");We(this,"ttlAutopurge");We(this,"updateAgeOnGet");We(this,"updateAgeOnHas");We(this,"allowStale");We(this,"noDisposeOnSet");We(this,"noUpdateTTL");We(this,"maxEntrySize");We(this,"sizeCalculation");We(this,"noDeleteOnFetchRejection");We(this,"noDeleteOnStaleGet");We(this,"allowStaleOnFetchAbort");We(this,"allowStaleOnFetchRejection");We(this,"ignoreFetchAbort");Ue(this,ut);Ue(this,xn);Ue(this,dt);Ue(this,Je);Ue(this,Se);Ue(this,Rt);Ue(this,qt);Ue(this,Et);Ue(this,mt);Ue(this,kn);Ue(this,gt);Ue(this,En);Ue(this,Sn);Ue(this,Kt);Ue(this,Tn);Ue(this,Nr);Ue(this,Dt);Ue(this,Jr,()=>{});Ue(this,Jn,()=>{});Ue(this,$i,()=>{});Ue(this,Yt,()=>!1);Ue(this,Qr,e=>{});Ue(this,Do,(e,n,o)=>{});Ue(this,zi,(e,n,o,i)=>{if(o||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});We(this,jh,"LRUCache");const{max:n=0,ttl:o,ttlResolution:i=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:d,allowStale:p,dispose:h,disposeAfter:m,noDisposeOnSet:y,noUpdateTTL:b,maxSize:w=0,maxEntrySize:S=0,sizeCalculation:M,fetchMethod:O,memoMethod:v,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:I,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:P,ignoreFetchAbort:V}=e;if(n!==0&&!Tr(n))throw new TypeError("max option must be a nonnegative integer");const Z=n?Zh(n):Array;if(!Z)throw new Error("invalid max value: "+n);if(ye(this,vn,n),ye(this,Ht,w),this.maxEntrySize=S||E(this,Ht),this.sizeCalculation=M,this.sizeCalculation){if(!E(this,Ht)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(v!==void 0&&typeof v!="function")throw new TypeError("memoMethod must be a function if defined");if(ye(this,Ro,v),O!==void 0&&typeof O!="function")throw new TypeError("fetchMethod must be a function if specified");if(ye(this,Po,O),ye(this,Nr,!!O),ye(this,dt,new Map),ye(this,Je,new Array(n).fill(void 0)),ye(this,Se,new Array(n).fill(void 0)),ye(this,Rt,new Z(n)),ye(this,qt,new Z(n)),ye(this,Et,0),ye(this,mt,0),ye(this,kn,gc.create(n)),ye(this,ut,0),ye(this,xn,0),typeof h=="function"&&ye(this,wn,h),typeof m=="function"?(ye(this,bn,m),ye(this,gt,[])):(ye(this,bn,void 0),ye(this,gt,void 0)),ye(this,Tn,!!E(this,wn)),ye(this,Dt,!!E(this,bn)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!W,this.allowStaleOnFetchAbort=!!P,this.ignoreFetchAbort=!!V,this.maxEntrySize!==0){if(E(this,Ht)!==0&&!Tr(E(this,Ht)))throw new TypeError("maxSize must be a positive integer if specified");if(!Tr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ue(this,re,Ng).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!I,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!d,this.ttlResolution=Tr(i)||i===0?i:1,this.ttlAutopurge=!!l,this.ttl=o||0,this.ttl){if(!Tr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ue(this,re,zd).call(this)}if(E(this,vn)===0&&this.ttl===0&&E(this,Ht)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!E(this,vn)&&!E(this,Ht)){const J="LRU_CACHE_UNBOUNDED";iP(J)&&($h.add(J),zh("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",J,Cc))}}static unsafeExposeInternals(e){return{starts:E(e,Sn),ttls:E(e,Kt),sizes:E(e,En),keyMap:E(e,dt),keyList:E(e,Je),valList:E(e,Se),next:E(e,Rt),prev:E(e,qt),get head(){return E(e,Et)},get tail(){return E(e,mt)},free:E(e,kn),isBackgroundFetch:n=>{var o;return ue(o=e,re,et).call(o,n)},backgroundFetch:(n,o,i,l)=>{var c;return ue(c=e,re,Ka).call(c,n,o,i,l)},moveToTail:n=>{var o;return ue(o=e,re,us).call(o,n)},indexes:n=>{var o;return ue(o=e,re,Or).call(o,n)},rindexes:n=>{var o;return ue(o=e,re,Mr).call(o,n)},isStale:n=>{var o;return E(o=e,Yt).call(o,n)}}}get max(){return E(this,vn)}get maxSize(){return E(this,Ht)}get calculatedSize(){return E(this,xn)}get size(){return E(this,ut)}get fetchMethod(){return E(this,Po)}get memoMethod(){return E(this,Ro)}get dispose(){return E(this,wn)}get disposeAfter(){return E(this,bn)}getRemainingTTL(e){return E(this,dt).has(e)?1/0:0}*entries(){for(const e of ue(this,re,Or).call(this))E(this,Se)[e]!==void 0&&E(this,Je)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield[E(this,Je)[e],E(this,Se)[e]])}*rentries(){for(const e of ue(this,re,Mr).call(this))E(this,Se)[e]!==void 0&&E(this,Je)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield[E(this,Je)[e],E(this,Se)[e]])}*keys(){for(const e of ue(this,re,Or).call(this)){const n=E(this,Je)[e];n!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield n)}}*rkeys(){for(const e of ue(this,re,Mr).call(this)){const n=E(this,Je)[e];n!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield n)}}*values(){for(const e of ue(this,re,Or).call(this))E(this,Se)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield E(this,Se)[e])}*rvalues(){for(const e of ue(this,re,Mr).call(this))E(this,Se)[e]!==void 0&&!ue(this,re,et).call(this,E(this,Se)[e])&&(yield E(this,Se)[e])}[(Hh=Symbol.iterator,jh=Symbol.toStringTag,Hh)](){return this.entries()}find(e,n={}){for(const o of ue(this,re,Or).call(this)){const i=E(this,Se)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;if(l!==void 0&&e(l,E(this,Je)[o],this))return this.get(E(this,Je)[o],n)}}forEach(e,n=this){for(const o of ue(this,re,Or).call(this)){const i=E(this,Se)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;l!==void 0&&e.call(n,l,E(this,Je)[o],this)}}rforEach(e,n=this){for(const o of ue(this,re,Mr).call(this)){const i=E(this,Se)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;l!==void 0&&e.call(n,l,E(this,Je)[o],this)}}purgeStale(){let e=!1;for(const n of ue(this,re,Mr).call(this,{allowStale:!0}))E(this,Yt).call(this,n)&&(ue(this,re,Gr).call(this,E(this,Je)[n],"expire"),e=!0);return e}info(e){const n=E(this,dt).get(e);if(n===void 0)return;const o=E(this,Se)[n],i=ue(this,re,et).call(this,o)?o.__staleWhileFetching:o;if(i===void 0)return;const l={value:i};if(E(this,Kt)&&E(this,Sn)){const c=E(this,Kt)[n],d=E(this,Sn)[n];if(c&&d){const p=c-(Ao.now()-d);l.ttl=p,l.start=Date.now()}}return E(this,En)&&(l.size=E(this,En)[n]),l}dump(){const e=[];for(const n of ue(this,re,Or).call(this,{allowStale:!0})){const o=E(this,Je)[n],i=E(this,Se)[n],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;if(l===void 0||o===void 0)continue;const c={value:l};if(E(this,Kt)&&E(this,Sn)){c.ttl=E(this,Kt)[n];const d=Ao.now()-E(this,Sn)[n];c.start=Math.floor(Date.now()-d)}E(this,En)&&(c.size=E(this,En)[n]),e.unshift([o,c])}return e}load(e){this.clear();for(const[n,o]of e){if(o.start){const i=Date.now()-o.start;o.start=Ao.now()-i}this.set(n,o.value,o)}}set(e,n,o={}){var b,w,S,M,O;if(n===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:p}=o;let{noUpdateTTL:h=this.noUpdateTTL}=o;const m=E(this,zi).call(this,e,n,o.size||0,d);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),ue(this,re,Gr).call(this,e,"set"),this;let y=E(this,ut)===0?void 0:E(this,dt).get(e);if(y===void 0)y=E(this,ut)===0?E(this,mt):E(this,kn).length!==0?E(this,kn).pop():E(this,ut)===E(this,vn)?ue(this,re,qa).call(this,!1):E(this,ut),E(this,Je)[y]=e,E(this,Se)[y]=n,E(this,dt).set(e,y),E(this,Rt)[E(this,mt)]=y,E(this,qt)[y]=E(this,mt),ye(this,mt,y),Ha(this,ut)._++,E(this,Do).call(this,y,m,p),p&&(p.set="add"),h=!1;else{ue(this,re,us).call(this,y);const v=E(this,Se)[y];if(n!==v){if(E(this,Nr)&&ue(this,re,et).call(this,v)){v.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:L}=v;L!==void 0&&!c&&(E(this,Tn)&&((b=E(this,wn))==null||b.call(this,L,e,"set")),E(this,Dt)&&((w=E(this,gt))==null||w.push([L,e,"set"])))}else c||(E(this,Tn)&&((S=E(this,wn))==null||S.call(this,v,e,"set")),E(this,Dt)&&((M=E(this,gt))==null||M.push([v,e,"set"])));if(E(this,Qr).call(this,y),E(this,Do).call(this,y,m,p),E(this,Se)[y]=n,p){p.set="replace";const L=v&&ue(this,re,et).call(this,v)?v.__staleWhileFetching:v;L!==void 0&&(p.oldValue=L)}}else p&&(p.set="update")}if(i!==0&&!E(this,Kt)&&ue(this,re,zd).call(this),E(this,Kt)&&(h||E(this,$i).call(this,y,i,l),p&&E(this,Jn).call(this,p,y)),!c&&E(this,Dt)&&E(this,gt)){const v=E(this,gt);let L;for(;L=v==null?void 0:v.shift();)(O=E(this,bn))==null||O.call(this,...L)}return this}pop(){var e;try{for(;E(this,ut);){const n=E(this,Se)[E(this,Et)];if(ue(this,re,qa).call(this,!0),ue(this,re,et).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(E(this,Dt)&&E(this,gt)){const n=E(this,gt);let o;for(;o=n==null?void 0:n.shift();)(e=E(this,bn))==null||e.call(this,...o)}}}has(e,n={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:i}=n,l=E(this,dt).get(e);if(l!==void 0){const c=E(this,Se)[l];if(ue(this,re,et).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(E(this,Yt).call(this,l))i&&(i.has="stale",E(this,Jn).call(this,i,l));else return o&&E(this,Jr).call(this,l),i&&(i.has="hit",E(this,Jn).call(this,i,l)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){const{allowStale:o=this.allowStale}=n,i=E(this,dt).get(e);if(i===void 0||!o&&E(this,Yt).call(this,i))return;const l=E(this,Se)[i];return ue(this,re,et).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:p=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:w=this.ignoreFetchAbort,allowStaleOnFetchAbort:S=this.allowStaleOnFetchAbort,context:M,forceRefresh:O=!1,status:v,signal:L}=n;if(!E(this,Nr))return v&&(v.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:l,status:v});const I={allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:d,size:p,sizeCalculation:h,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:S,ignoreFetchAbort:w,status:v,signal:L};let W=E(this,dt).get(e);if(W===void 0){v&&(v.fetch="miss");const P=ue(this,re,Ka).call(this,e,W,I,M);return P.__returned=P}else{const P=E(this,Se)[W];if(ue(this,re,et).call(this,P)){const $=o&&P.__staleWhileFetching!==void 0;return v&&(v.fetch="inflight",$&&(v.returnedStale=!0)),$?P.__staleWhileFetching:P.__returned=P}const V=E(this,Yt).call(this,W);if(!O&&!V)return v&&(v.fetch="hit"),ue(this,re,us).call(this,W),i&&E(this,Jr).call(this,W),v&&E(this,Jn).call(this,v,W),P;const Z=ue(this,re,Ka).call(this,e,W,I,M),ae=Z.__staleWhileFetching!==void 0&&o;return v&&(v.fetch=V?"stale":"refresh",ae&&V&&(v.returnedStale=!0)),ae?Z.__staleWhileFetching:Z.__returned=Z}}async forceFetch(e,n={}){const o=await this.fetch(e,n);if(o===void 0)throw new Error("fetch() returned undefined");return o}memo(e,n={}){const o=E(this,Ro);if(!o)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:l,...c}=n,d=this.get(e,c);if(!l&&d!==void 0)return d;const p=o(e,d,{options:c,context:i});return this.set(e,p,c),p}get(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,d=E(this,dt).get(e);if(d!==void 0){const p=E(this,Se)[d],h=ue(this,re,et).call(this,p);return c&&E(this,Jn).call(this,c,d),E(this,Yt).call(this,d)?(c&&(c.get="stale"),h?(c&&o&&p.__staleWhileFetching!==void 0&&(c.returnedStale=!0),o?p.__staleWhileFetching:void 0):(l||ue(this,re,Gr).call(this,e,"expire"),c&&o&&(c.returnedStale=!0),o?p:void 0)):(c&&(c.get="hit"),h?p.__staleWhileFetching:(ue(this,re,us).call(this,d),i&&E(this,Jr).call(this,d),p))}else c&&(c.get="miss")}delete(e){return ue(this,re,Gr).call(this,e,"delete")}clear(){return ue(this,re,Wd).call(this,"delete")}};vn=new WeakMap,Ht=new WeakMap,wn=new WeakMap,bn=new WeakMap,Po=new WeakMap,Ro=new WeakMap,ut=new WeakMap,xn=new WeakMap,dt=new WeakMap,Je=new WeakMap,Se=new WeakMap,Rt=new WeakMap,qt=new WeakMap,Et=new WeakMap,mt=new WeakMap,kn=new WeakMap,gt=new WeakMap,En=new WeakMap,Sn=new WeakMap,Kt=new WeakMap,Tn=new WeakMap,Nr=new WeakMap,Dt=new WeakMap,re=new WeakSet,zd=function(){const e=new ta(E(this,vn)),n=new ta(E(this,vn));ye(this,Kt,e),ye(this,Sn,n),ye(this,$i,(l,c,d=Ao.now())=>{if(n[l]=c!==0?d:0,e[l]=c,c!==0&&this.ttlAutopurge){const p=setTimeout(()=>{E(this,Yt).call(this,l)&&ue(this,re,Gr).call(this,E(this,Je)[l],"expire")},c+1);p.unref&&p.unref()}}),ye(this,Jr,l=>{n[l]=e[l]!==0?Ao.now():0}),ye(this,Jn,(l,c)=>{if(e[c]){const d=e[c],p=n[c];if(!d||!p)return;l.ttl=d,l.start=p,l.now=o||i();const h=l.now-p;l.remainingTTL=d-h}});let o=0;const i=()=>{const l=Ao.now();if(this.ttlResolution>0){o=l;const c=setTimeout(()=>o=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{const c=E(this,dt).get(l);if(c===void 0)return 0;const d=e[c],p=n[c];if(!d||!p)return 1/0;const h=(o||i())-p;return d-h},ye(this,Yt,l=>{const c=n[l],d=e[l];return!!d&&!!c&&(o||i())-c>d})},Jr=new WeakMap,Jn=new WeakMap,$i=new WeakMap,Yt=new WeakMap,Ng=function(){const e=new ta(E(this,vn));ye(this,xn,0),ye(this,En,e),ye(this,Qr,n=>{ye(this,xn,E(this,xn)-e[n]),e[n]=0}),ye(this,zi,(n,o,i,l)=>{if(ue(this,re,et).call(this,o))return 0;if(!Tr(i))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(i=l(o,n),!Tr(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i}),ye(this,Do,(n,o,i)=>{if(e[n]=o,E(this,Ht)){const l=E(this,Ht)-e[n];for(;E(this,xn)>l;)ue(this,re,qa).call(this,!0)}ye(this,xn,E(this,xn)+e[n]),i&&(i.entrySize=o,i.totalCalculatedSize=E(this,xn))})},Qr=new WeakMap,Do=new WeakMap,zi=new WeakMap,Or=function*({allowStale:e=this.allowStale}={}){if(E(this,ut))for(let n=E(this,mt);!(!ue(this,re,Ud).call(this,n)||((e||!E(this,Yt).call(this,n))&&(yield n),n===E(this,Et)));)n=E(this,qt)[n]},Mr=function*({allowStale:e=this.allowStale}={}){if(E(this,ut))for(let n=E(this,Et);!(!ue(this,re,Ud).call(this,n)||((e||!E(this,Yt).call(this,n))&&(yield n),n===E(this,mt)));)n=E(this,Rt)[n]},Ud=function(e){return e!==void 0&&E(this,dt).get(E(this,Je)[e])===e},qa=function(e){var l,c;const n=E(this,Et),o=E(this,Je)[n],i=E(this,Se)[n];return E(this,Nr)&&ue(this,re,et).call(this,i)?i.__abortController.abort(new Error("evicted")):(E(this,Tn)||E(this,Dt))&&(E(this,Tn)&&((l=E(this,wn))==null||l.call(this,i,o,"evict")),E(this,Dt)&&((c=E(this,gt))==null||c.push([i,o,"evict"]))),E(this,Qr).call(this,n),e&&(E(this,Je)[n]=void 0,E(this,Se)[n]=void 0,E(this,kn).push(n)),E(this,ut)===1?(ye(this,Et,ye(this,mt,0)),E(this,kn).length=0):ye(this,Et,E(this,Rt)[n]),E(this,dt).delete(o),Ha(this,ut)._--,n},Ka=function(e,n,o,i){const l=n===void 0?void 0:E(this,Se)[n];if(ue(this,re,et).call(this,l))return l;const c=new ea,{signal:d}=o;d==null||d.addEventListener("abort",()=>c.abort(d.reason),{signal:c.signal});const p={signal:c.signal,options:o,context:i},h=(M,O=!1)=>{const{aborted:v}=c.signal,L=o.ignoreFetchAbort&&M!==void 0;if(o.status&&(v&&!O?(o.status.fetchAborted=!0,o.status.fetchError=c.signal.reason,L&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),v&&!L&&!O)return y(c.signal.reason);const I=w;return E(this,Se)[n]===w&&(M===void 0?I.__staleWhileFetching?E(this,Se)[n]=I.__staleWhileFetching:ue(this,re,Gr).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,M,p.options))),M},m=M=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=M),y(M)),y=M=>{const{aborted:O}=c.signal,v=O&&o.allowStaleOnFetchAbort,L=v||o.allowStaleOnFetchRejection,I=L||o.noDeleteOnFetchRejection,W=w;if(E(this,Se)[n]===w&&(!I||W.__staleWhileFetching===void 0?ue(this,re,Gr).call(this,e,"fetch"):v||(E(this,Se)[n]=W.__staleWhileFetching)),L)return o.status&&W.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),W.__staleWhileFetching;if(W.__returned===W)throw M},b=(M,O)=>{var L;const v=(L=E(this,Po))==null?void 0:L.call(this,e,l,p);v&&v instanceof Promise&&v.then(I=>M(I===void 0?void 0:I),O),c.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(M(void 0),o.allowStaleOnFetchAbort&&(M=I=>h(I,!0)))})};o.status&&(o.status.fetchDispatched=!0);const w=new Promise(b).then(h,m),S=Object.assign(w,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,S,{...p.options,status:void 0}),n=E(this,dt).get(e)):E(this,Se)[n]=S,S},et=function(e){if(!E(this,Nr))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof ea},Zd=function(e,n){E(this,qt)[n]=e,E(this,Rt)[e]=n},us=function(e){e!==E(this,mt)&&(e===E(this,Et)?ye(this,Et,E(this,Rt)[e]):ue(this,re,Zd).call(this,E(this,qt)[e],E(this,Rt)[e]),ue(this,re,Zd).call(this,E(this,mt),e),ye(this,mt,e))},Gr=function(e,n){var i,l,c,d;let o=!1;if(E(this,ut)!==0){const p=E(this,dt).get(e);if(p!==void 0)if(o=!0,E(this,ut)===1)ue(this,re,Wd).call(this,n);else{E(this,Qr).call(this,p);const h=E(this,Se)[p];if(ue(this,re,et).call(this,h)?h.__abortController.abort(new Error("deleted")):(E(this,Tn)||E(this,Dt))&&(E(this,Tn)&&((i=E(this,wn))==null||i.call(this,h,e,n)),E(this,Dt)&&((l=E(this,gt))==null||l.push([h,e,n]))),E(this,dt).delete(e),E(this,Je)[p]=void 0,E(this,Se)[p]=void 0,p===E(this,mt))ye(this,mt,E(this,qt)[p]);else if(p===E(this,Et))ye(this,Et,E(this,Rt)[p]);else{const m=E(this,qt)[p];E(this,Rt)[m]=E(this,Rt)[p];const y=E(this,Rt)[p];E(this,qt)[y]=E(this,qt)[p]}Ha(this,ut)._--,E(this,kn).push(p)}}if(E(this,Dt)&&((c=E(this,gt))!=null&&c.length)){const p=E(this,gt);let h;for(;h=p==null?void 0:p.shift();)(d=E(this,bn))==null||d.call(this,...h)}return o},Wd=function(e){var n,o,i;for(const l of ue(this,re,Mr).call(this,{allowStale:!0})){const c=E(this,Se)[l];if(ue(this,re,et).call(this,c))c.__abortController.abort(new Error("deleted"));else{const d=E(this,Je)[l];E(this,Tn)&&((n=E(this,wn))==null||n.call(this,c,d,e)),E(this,Dt)&&((o=E(this,gt))==null||o.push([c,d,e]))}}if(E(this,dt).clear(),E(this,Se).fill(void 0),E(this,Je).fill(void 0),E(this,Kt)&&E(this,Sn)&&(E(this,Kt).fill(0),E(this,Sn).fill(0)),E(this,En)&&E(this,En).fill(0),ye(this,Et,0),ye(this,mt,0),E(this,kn).length=0,ye(this,xn,0),ye(this,ut,0),E(this,Dt)&&E(this,gt)){const l=E(this,gt);let c;for(;c=l==null?void 0:l.shift();)(i=E(this,bn))==null||i.call(this,...c)}};let yc=Cc;const sP={cacheSize:15e6};class aP{constructor(e){We(this,"_str");We(this,"_rawJson");We(this,"_zodSchema");We(this,"_validatedJson");this.bytes=e}get str(){return this._str===void 0&&(this._str=new TextDecoder().decode(this.bytes)),this._str}get rawJson(){return this._rawJson===void 0&&(this._rawJson=JSON.parse(this.str)),this._rawJson}validatedJson(e){return this._zodSchema!==e&&(this._validatedJson=e.parse(this.rawJson),this._zodSchema=e),this._validatedJson}}const eo=class eo{constructor(e){We(this,"fileDataCache");We(this,"fileDataRefs",new Map);const n={...sP,...e??{}};this.fileDataCache=new yc({maxSize:n.cacheSize,fetchMethod:async o=>new aP(await yu().blobDriver.getContent(o)),sizeCalculation:o=>o.bytes.length,dispose:(o,i)=>{this.fileDataRefs.delete(i)}})}getDataRef(e){const n=this.fileDataRefs.get(e);if(n!==void 0)return n;const o=r.shallowRef();return this.fileDataRefs.set(e,o),(async()=>{try{const i=await this.fileDataCache.fetch(e);o.value=i}catch(i){console.error(i)}})(),o}getContentBytes(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n.value)==null?void 0:o.bytes})}getContentString(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n==null?void 0:n.value)==null?void 0:o.str})}getContentJson(e,n){if(e===void 0)return;const o=this.getDataRef(e);return r.computed(()=>{var i,l;return n===void 0?(i=o==null?void 0:o.value)==null?void 0:i.rawJson:(l=o==null?void 0:o.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return eo.globalInstance.getContentBytes(e)}static getContentString(e){return eo.globalInstance.getContentString(e)}static getContentJson(e,n){return eo.globalInstance.getContentJson(e,n)}};We(eo,"globalInstance",new eo);let _c=eo;F.AgGridTheme=$u,F.BlockLayout=JN,F.ContextProvider=LS,F.DataTable=y0,F.DemoData=LN,F.DropdownListItem=Co,F.DropdownOverlay=$l,F.LongText=Ml,F.MultiError=hs,F.PlAccordion=Ik,F.PlAccordionSection=Zk,F.PlAgCellFile=BV,F.PlAgColumnHeader=nh,F.PlAgDataTable=SV,F.PlAgDataTableToolsPanel=xV,F.PlAgGridColumnManager=ah,F.PlAgOverlayLoading=Jp,F.PlAgOverlayNoRows=Qp,F.PlAgTextAndButtonCell=DV,F.PlAlert=q0,F.PlBlockPage=D0,F.PlBtnAccent=pw,F.PlBtnDanger=fw,F.PlBtnGhost=vo,F.PlBtnGroup=pp,F.PlBtnLink=_w,F.PlBtnPrimary=Ns,F.PlBtnSecondary=Rl,F.PlBtnSplit=aw,F.PlCheckbox=Wx,F.PlCheckboxGroup=Kx,F.PlChip=zl,F.PlCloseModalBtn=xp,F.PlContainer=F0,F.PlDialogModal=Zl,F.PlDropdown=wo,F.PlDropdownLegacy=gx,F.PlDropdownLine=bp,F.PlDropdownMulti=Ux,F.PlDropdownRef=Wb,F.PlEditableTitle=zw,F.PlFileDialog=Ap,F.PlFileInput=jp,F.PlGrid=z0,F.PlIcon16=Wr,F.PlIcon24=As,F.PlLogView=Ep,F.PlMaskIcon16=Vt,F.PlMaskIcon24=At,F.PlNotificationAlert=Hp,F.PlNumberField=Nx,F.PlProgressBar=wx,F.PlRow=O0,F.PlSearchField=_p,F.PlSectionSeparator=Sp,F.PlSlideModal=Ps,F.PlSpacer=dp,F.PlTableFilters=tP,F.PlTabs=Vk,F.PlTextArea=Vb,F.PlTextField=jr,F.PlToggleSwitch=Rs,F.PlTooltip=Ct,F.ReactiveFileContent=_c,F.Scrollable=S1,F.Slider=qp,F.SliderRange=b1,F.SliderRangeTriple=d1,F.ThemeSwitcher=T0,F.UnresolvedError=Xa,F.ValueOrErrorsComponent=VV,F.activateAgGrid=Gu,F.animate=op,F.animateInfinite=b0,F.call=Qu,F.computedResult=oP,F.createModel=rl,F.debounce=ip,F.defineApp=jC,F.defineStore=rP,F.delay=ep,F.detectOutside=Ab,F.ensureError=el,F.eventListener=Gl,F.formatZodError=nl,F.getElementScrollPosition=wp,F.identity=Qa,F.isDefined=Zg,F.isElementVisible=vp,F.isJsonEqual=Ja,F.isZodError=tl,F.listToOptions=x0,F.makeEaseInOut=w0,F.makeEaseOut=rp,F.maskIcons16=IN,F.maskIcons24=FN,F.normalizeListOptions=_r,F.notEmpty=Nl,F.randomInt=np,F.randomString=v0,F.requestTick=Vl,F.scrollIntoView=Bs,F.showContextMenu=El,F.throttle=sp,F.timeout=tp,F.unwrapOptionalResult=Ug,F.unwrapValueOrErrors=eu,F.useClickOutside=Vs,F.useDraggable=QS,F.useEventListener=st,F.useFormState=XS,F.useHover=Xu,F.useInterval=YS,F.useLabelNotch=Yn,F.useLocalStorage=ap,F.useMouse=Yu,F.useMouseCapture=yr,F.usePosition=Ci,F.useQuery=JS,F.useResizeObserver=Kp,F.useScroll=qS,F.useSdkPlugin=vl,F.useSortable=Xp,F.useTheme=cp,F.useWatchFetch=Gh,F.wrapOptionalResult=tu,F.wrapValueOrErrors=zg,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
|