@platforma-sdk/ui-vue 1.13.4 → 1.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/lib.js +3 -7
- package/dist/lib.umd.cjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/lib.js
CHANGED
|
@@ -3367,9 +3367,7 @@ function Ga(t, e) {
|
|
|
3367
3367
|
ri.object({
|
|
3368
3368
|
__isRef: ri.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
|
|
3369
3369
|
blockId: ri.string().describe("Upstream block id"),
|
|
3370
|
-
name: ri.string().describe(
|
|
3371
|
-
"Name of the output provided to the upstream block's output context"
|
|
3372
|
-
)
|
|
3370
|
+
name: ri.string().describe("Name of the output provided to the upstream block's output context")
|
|
3373
3371
|
}).describe(
|
|
3374
3372
|
"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."
|
|
3375
3373
|
).strict().readonly();
|
|
@@ -3386,7 +3384,7 @@ const rS = ri.object({
|
|
|
3386
3384
|
label: ri.string()
|
|
3387
3385
|
});
|
|
3388
3386
|
ri.array(rS);
|
|
3389
|
-
const sS = "1.13.
|
|
3387
|
+
const sS = "1.13.5";
|
|
3390
3388
|
function oS() {
|
|
3391
3389
|
return iS({ sdkVersion: sS });
|
|
3392
3390
|
}
|
|
@@ -15246,9 +15244,7 @@ function iI(t) {
|
|
|
15246
15244
|
si.object({
|
|
15247
15245
|
__isRef: si.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
|
|
15248
15246
|
blockId: si.string().describe("Upstream block id"),
|
|
15249
|
-
name: si.string().describe(
|
|
15250
|
-
"Name of the output provided to the upstream block's output context"
|
|
15251
|
-
)
|
|
15247
|
+
name: si.string().describe("Name of the output provided to the upstream block's output context")
|
|
15252
15248
|
}).describe(
|
|
15253
15249
|
"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."
|
|
15254
15250
|
).strict().readonly();
|
package/dist/lib.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(R,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@ag-grid-enterprise/core"),require("@ag-grid-community/core"),require("@ag-grid-community/client-side-row-model"),require("@ag-grid-community/infinite-row-model"),require("@ag-grid-enterprise/server-side-row-model"),require("@ag-grid-community/csv-export"),require("@ag-grid-enterprise/clipboard"),require("@ag-grid-enterprise/range-selection"),require("@ag-grid-enterprise/rich-select"),require("@ag-grid-enterprise/menu"),require("@ag-grid-enterprise/excel-export"),require("@ag-grid-community/theming"),require("@ag-grid-community/vue3")):typeof define=="function"&&define.amd?define(["exports","vue","@ag-grid-enterprise/core","@ag-grid-community/core","@ag-grid-community/client-side-row-model","@ag-grid-community/infinite-row-model","@ag-grid-enterprise/server-side-row-model","@ag-grid-community/csv-export","@ag-grid-enterprise/clipboard","@ag-grid-enterprise/range-selection","@ag-grid-enterprise/rich-select","@ag-grid-enterprise/menu","@ag-grid-enterprise/excel-export","@ag-grid-community/theming","@ag-grid-community/vue3"],r):(R=typeof globalThis<"u"?globalThis:R||self,r(R.SdkVueLib={},R.Vue,R.core$1,R.core,R.clientSideRowModel,R.infiniteRowModel,R.serverSideRowModel,R.csvExport,R.clipboard,R.rangeSelection,R.richSelect,R.menu,R.excelExport,R.theming,R.vue3))})(this,function(R,r,Ie,x,rs,om,ld,im,cd,dd,sm,am,lm,ud,cm){"use strict";var wR=Object.defineProperty;var tm=R=>{throw TypeError(R)};var bR=(R,r,Ie)=>r in R?wR(R,r,{enumerable:!0,configurable:!0,writable:!0,value:Ie}):R[r]=Ie;var Ue=(R,r,Ie)=>bR(R,typeof r!="symbol"?r+"":r,Ie),rd=(R,r,Ie)=>r.has(R)||tm("Cannot "+Ie);var b=(R,r,Ie)=>(rd(R,r,"read from private field"),Ie?Ie.call(R):r.get(R)),ze=(R,r,Ie)=>r.has(R)?tm("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(R):r.set(R,Ie),me=(R,r,Ie,x)=>(rd(R,r,"write to private field"),x?x.call(R,Ie):r.set(R,Ie),Ie),de=(R,r,Ie)=>(rd(R,r,"access private method"),Ie);var Sa=(R,r,Ie,x)=>({set _(rs){me(R,r,rs,Ie)},get _(){return b(R,r,x)}});var Cp,So,wp,bp,un,Lt,pn,hn,Eo,To,ct,fn,at,Ke,xe,Tt,Gt,wt,ht,mn,ft,gn,yn,zt,_n,br,Bt,re,od,jr,Un,Fi,Zt,rm,qr,Bo,Ri,Rr,Mr,id,Ea,Ta,Je,sd,ns,Ir,ad;function dm(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}const pd=Array.isArray;function um(t){return t!==null&&typeof t=="object"}function hd(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null}function En(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=En(t[n]);return e}else if(um(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=En(t[n])}),e}else return t}function fd(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],s=e[n];hd(o)&&hd(s)||pd(o)&&pd(s)&&o.length===s.length?fd(o,s):t[n]=s}),t}function Ba(t,e,n=!0){let o=0,s;return function(...l){s=()=>{t.apply(this,l),o=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>o&&s()}}function pm(t){let e=0n,n;return async function(...o){const s=++e;try{await n}catch{}if(e!==s)return{ok:!1};const l=t(...o);return n=l,{ok:!0,value:await l}}}var Uo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fm=function t(e){if(typeof e=="number"&&isNaN(e))throw new Error("NaN is not allowed");if(typeof e=="number"&&!isFinite(e))throw new Error("Infinity is not allowed");return e===null||typeof e!="object"?JSON.stringify(e):e.toJSON instanceof Function?t(e.toJSON()):Array.isArray(e)?`[${e.reduce((s,l,c)=>`${s}${c===0?"":","}${t(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((o,s)=>{if(e[s]===void 0||typeof e[s]=="symbol")return o;const l=o.length===0?"":",";return`${o}${l}${t(s)}:${t(e[s])}`},"")}}`};const Or=hm(fm);class Aa extends Error{}class Na extends Error{constructor(e){super(e.join(`
|
|
2
2
|
`)),this.errors=e}toString(){return this.errors.join(`
|
|
3
|
-
`)}}function mm(t){return{ok:!0,value:t}}function md(t){if(!t)throw new Aa;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function gd(t){return{value:t,errors:void 0}}function gm(t){if(t.errors)throw new Na(t.errors);if(!t.value)throw new Aa;return t.value}function ym(t){return t!==void 0}function Va(t,e){return Or(t)===Or(e)}const Pa=t=>t,Da=t=>t instanceof Error?t:Error(String(t)),Fa=t=>t.name==="ZodError",Ra=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),o=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function Ma(t){const e=t.validate??Pa,{autoSave:n}=t,o=r.ref(),s=r.ref(),l=N=>{s.value={model:En(N)}};r.watch(()=>t.get(),N=>l(N),{immediate:!0});const c=()=>{var N;t.onSave(e(En((N=s.value)==null?void 0:N.model)))},u=()=>{l(t.get()),o.value=void 0},p=N=>{const M=Da(N);Fa(M)?o.value=Error(Ra(M)):o.value=M},f=N=>{o.value=void 0;try{e(N),n&&c()}catch(M){p(M)}},m=r.computed({get:()=>{var N;return(N=s.value)==null?void 0:N.model},set(N){l(N),f(N)}});r.watch(s,(N,M)=>{N&&N===M&&f(N.model)},{deep:!0});const y=r.computed(()=>!o.value),B=r.computed(()=>!Va(t.get(),r.unref(s))),T=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:B,error:o,errorString:T,save:c,revert:u,setError:p})}function _m(t,e,n){const o=t.validate??Pa,{autoSave:s}=t,l=r.ref(),c=r.ref(),u=G=>{var C;if(n.deepPatchModel){const F=(C=c.value)==null?void 0:C.model,L=Object.assign(En(G),e??{});c.value={model:F?fd(F,L):L,stage:Symbol()}}else c.value={model:Object.assign(En(G),e??{}),stage:Symbol()}};r.watch(()=>t.get(),G=>u(G),{immediate:!0});const p=()=>{var G;t.onSave(o(En((G=c.value)==null?void 0:G.model)))},f=()=>{u(t.get()),l.value=void 0},m=G=>{const C=Da(G);Fa(C)?l.value=Error(Ra(C)):l.value=C},y=G=>{l.value=void 0;try{o(G),s&&p()}catch(C){m(C)}},B=r.computed({get:()=>{var G;return(G=c.value)==null?void 0:G.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:B.value.args,ui:B.value.ui}),()=>{var G;return(G=c.value)==null?void 0:G.stage}],([G,C],[F,L])=>{C===L&&y(G)},{deep:!0});const T=r.computed(()=>!l.value),N=r.computed(()=>{var F;const{args:G,ui:C}=((F=r.unref(c))==null?void 0:F.model)??{};return!Va(t.get(),{args:G,ui:C})}),M=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:B,valid:T,isChanged:N,error:l,errorString:M,save:p,revert:f,setError:m})}const vm=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function Cm(t,e,n){const o=(C,...F)=>{n.debug&&console.log(`%c>>> %c${C}`,"color: orange; font-weight: bold","color: orange",...F)},l=Ba(e.setBlockArgs,100),c=Ba(e.setBlockUiState,100),u=Ba(e.setBlockArgsAndUiState,100),p=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async C=>{C.forEach(F=>{F.key==="args"&&(p.args=Object.freeze(F.value),o("args patch",p.args)),F.key==="ui"&&(p.ui=Object.freeze(F.value),o("ui patch",p.ui)),F.key==="outputs"&&(p.outputs=Object.freeze(F.value),o("outputs patch",p.outputs)),F.key==="navigationState"&&(p.navigationState=Object.freeze(F.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const f=()=>En(p.args),m=()=>En(p.ui),y=()=>En(p.navigationState),B={createArgsModel(C={}){return Ma({get(){return C.transform?C.transform(p.args):p.args},validate:C.validate,autoSave:!0,onSave(F){l(F)}})},createUiModel(C={},F){return Ma({get(){return C.transform?C.transform(p.ui):p.ui??F()},validate:C.validate,autoSave:!0,onSave(L){c(L)}})},useOutputs(...C){const F=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(F,{value:this.unwrapOutputs(...C),errors:void 0})}catch(L){Object.assign(F,{value:void 0,errors:[String(L)]})}},{immediate:!0,deep:!0}),F},unwrapOutputs(...C){const F=p.outputs,L=C.map($=>[$,md(F[$])]);return Object.fromEntries(L)},getOutputField(C){return p.outputs[C]},getOutputFieldOkOptional(C){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const F=this.getOutputField(C);if(F&&F.ok)return F.value},getOutputFieldErrorsOptional(C){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const F=this.getOutputField(C);if(F&&!F.ok)return F.errors},updateArgs(C){const F=f();return C(F),e.setBlockArgs(F)},updateUiState(C){const F=m();return e.setBlockUiState(C(F))},updateNavigationState(C){const F=y();return C(F),e.setNavigationState(F)},navigateTo(C){const F=y();return F.href=C,e.setNavigationState(F)}},T=r.computed(()=>{const C=Object.entries(p.outputs).map(([F,L])=>[F,L.ok&&L.value!==void 0?L.value:void 0]);return Object.fromEntries(C)}),N=r.computed(()=>{const C=Object.entries(p.outputs).map(([F,L])=>[F,L&&!L.ok?new Na(L.errors):void 0]);return Object.fromEntries(C)}),M={snapshot:p,queryParams:r.computed(()=>vm(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(C=>!(C!=null&&C.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),T.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),N.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),p.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),p.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),p.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),p.navigationState))},G=_m({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(C){u(C.args,C.ui)}},{outputs:T,outputErrors:N},n);return r.reactive(Object.assign(G,B,M))}var Oe;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of l)c[u]=s[u];return t.objectValues(c)},t.objectValues=s=>t.objectKeys(s).map(function(l){return s[l]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},t.find=(s,l)=>{for(const c of s)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function o(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Oe||(Oe={}));var Ia;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Ia||(Ia={}));const ae=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),nr=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map<"u"&&t instanceof Map?ae.map:typeof Set<"u"&&t instanceof Set?ae.set:typeof Date<"u"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},Q=Oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),wm=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class It extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let u=o,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),o}static assert(e){if(!(e instanceof It))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):o.push(e(s));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}It.create=t=>new It(t);const ao=(t,e)=>{let n;switch(t.code){case Q.invalid_type:t.received===ae.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Oe.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:n=`Unrecognized key(s) in object: ${Oe.joinValues(t.keys,", ")}`;break;case Q.invalid_union:n="Invalid input";break;case Q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Oe.joinValues(t.options)}`;break;case Q.invalid_enum_value:n=`Invalid enum value. Expected ${Oe.joinValues(t.options)}, received '${t.received}'`;break;case Q.invalid_arguments:n="Invalid function arguments";break;case Q.invalid_return_type:n="Invalid function return type";break;case Q.invalid_date:n="Invalid date";break;case Q.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Oe.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Q.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Q.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Q.custom:n="Invalid input";break;case Q.invalid_intersection_types:n="Intersection results could not be merged";break;case Q.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Q.not_finite:n="Number must be finite";break;default:n=e.defaultError,Oe.assertNever(t)}return{message:n}};let yd=ao;function bm(t){yd=t}function os(){return yd}const is=t=>{const{data:e,path:n,errorMaps:o,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=o.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},xm=[];function ie(t,e){const n=os(),o=is({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ao?void 0:ao].filter(s=>!!s)});t.common.issues.push(o)}class _t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const s of n){if(s.status==="aborted")return Ce;s.status==="dirty"&&e.dirty(),o.push(s.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const s of n){const l=await s.key,c=await s.value;o.push({key:l,value:c})}return _t.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return Ce;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const Ce=Object.freeze({status:"aborted"}),lo=t=>({status:"dirty",value:t}),kt=t=>({status:"valid",value:t}),Oa=t=>t.status==="aborted",La=t=>t.status==="dirty",Wo=t=>t.status==="valid",Ho=t=>typeof Promise<"u"&&t instanceof Promise;function ss(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function _d(t,e,n,o,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var pe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(pe||(pe={}));var jo,qo;class Tn{constructor(e,n,o,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const vd=(t,e)=>{if(Wo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new It(t.common.issues);return this._error=n,this._error}}};function Te(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:s}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(c,u)=>{var p,f;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(p=m??o)!==null&&p!==void 0?p:u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:(f=m??n)!==null&&f!==void 0?f:u.defaultError}},description:s}}class Ne{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return nr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new _t,ctx:{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Ho(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const s={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},l=this._parseSync({data:e,path:s.path,parent:s});return vd(s,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},s=this._parse({data:e,path:o.path,parent:o}),l=await(Ho(s)?s:Promise.resolve(s));return vd(o,l)}refine(e,n){const o=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:Q.custom,...o(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((o,s)=>e(o)?!0:(s.addIssue(typeof n=="function"?n(o,s):n),!1))}_refinement(e){return new an({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return An.create(this,this._def)}nullable(){return sr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sn.create(this,this._def)}promise(){return ho.create(this,this._def)}or(e){return Xo.create([this,e],this._def)}and(e){return Qo.create(this,e,this._def)}transform(e){return new an({...Te(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new oi({...Te(this._def),innerType:this,defaultValue:n,typeName:_e.ZodDefault})}brand(){return new Za({typeName:_e.ZodBranded,type:this,...Te(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ii({...Te(this._def),innerType:this,catchValue:n,typeName:_e.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return si.create(this,e)}readonly(){return ai.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const km=/^c[^\s-]{8,}$/i,Sm=/^[0-9a-z]+$/,Em=/^[0-9A-HJKMNP-TV-Z]{26}$/,Tm=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Bm=/^[a-z0-9_-]{21}$/i,Am=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Nm=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Vm="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ga;const Pm=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Dm=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Fm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Cd="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Rm=new RegExp(`^${Cd}$`);function wd(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Mm(t){return new RegExp(`^${wd(t)}$`)}function bd(t){let e=`${Cd}T${wd(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Im(t,e){return!!((e==="v4"||!e)&&Pm.test(t)||(e==="v6"||!e)&&Dm.test(t))}class on extends Ne{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){const l=this._getOrReturnCtx(e);return ie(l,{code:Q.invalid_type,expected:ae.string,received:l.parsedType}),Ce}const o=new _t;let s;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="max")e.data.length>l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,u=e.data.length<l.value;(c||u)&&(s=this._getOrReturnCtx(e,s),c?ie(s,{code:Q.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):u&&ie(s,{code:Q.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")Nm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"email",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")Ga||(Ga=new RegExp(Vm,"u")),Ga.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"emoji",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")Tm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"uuid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")Bm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"nanoid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")km.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")Sm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid2",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")Em.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ulid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ie(s,{validation:"url",code:Q.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"regex",code:Q.invalid_string,message:l.message}),o.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?bd(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?Rm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?Mm(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?Am.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"duration",code:Q.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?Im(e.data,l.version)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ip",code:Q.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?Fm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"base64",code:Q.invalid_string,message:l.message}),o.dirty()):Oe.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(s=>e.test(s),{validation:n,code:Q.invalid_string,...pe.errToObj(o)})}_addCheck(e){return new on({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...pe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...pe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...pe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...pe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...pe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...pe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...pe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...pe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...pe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...pe.errToObj(e)})}datetime(e){var n,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...pe.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...pe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...pe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...pe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...pe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...pe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...pe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...pe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...pe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...pe.errToObj(n)})}nonempty(e){return this.min(1,pe.errToObj(e))}trim(){return new on({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new on({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new on({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}on.create=t=>{var e;return new on({checks:[],typeName:_e.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Te(t)})};function Om(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,s=n>o?n:o,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class rr extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ae.number){const l=this._getOrReturnCtx(e);return ie(l,{code:Q.invalid_type,expected:ae.number,received:l.parsedType}),Ce}let o;const s=new _t;for(const l of this._def.checks)l.kind==="int"?Oe.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?Om(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.not_finite,message:l.message}),s.dirty()):Oe.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,o,s){return new rr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:pe.toString(s)}]})}_addCheck(e){return new rr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:pe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:pe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Oe.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}rr.create=t=>new rr({checks:[],typeName:_e.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Te(t)});class or extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ae.bigint){const l=this._getOrReturnCtx(e);return ie(l,{code:Q.invalid_type,expected:ae.bigint,received:l.parsedType}),Ce}let o;const s=new _t;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Oe.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,o,s){return new or({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:pe.toString(s)}]})}_addCheck(e){return new or({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}or.create=t=>{var e;return new or({checks:[],typeName:_e.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Te(t)})};class Ko extends Ne{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.boolean,received:o.parsedType}),Ce}return kt(e.data)}}Ko.create=t=>new Ko({typeName:_e.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Te(t)});class Lr extends Ne{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){const l=this._getOrReturnCtx(e);return ie(l,{code:Q.invalid_type,expected:ae.date,received:l.parsedType}),Ce}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ie(l,{code:Q.invalid_date}),Ce}const o=new _t;let s;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Oe.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Lr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:pe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:pe.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Lr.create=t=>new Lr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_e.ZodDate,...Te(t)});class as extends Ne{_parse(e){if(this._getType(e)!==ae.symbol){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.symbol,received:o.parsedType}),Ce}return kt(e.data)}}as.create=t=>new as({typeName:_e.ZodSymbol,...Te(t)});class Yo extends Ne{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.undefined,received:o.parsedType}),Ce}return kt(e.data)}}Yo.create=t=>new Yo({typeName:_e.ZodUndefined,...Te(t)});class Jo extends Ne{_parse(e){if(this._getType(e)!==ae.null){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.null,received:o.parsedType}),Ce}return kt(e.data)}}Jo.create=t=>new Jo({typeName:_e.ZodNull,...Te(t)});class co extends Ne{constructor(){super(...arguments),this._any=!0}_parse(e){return kt(e.data)}}co.create=t=>new co({typeName:_e.ZodAny,...Te(t)});class Gr extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return kt(e.data)}}Gr.create=t=>new Gr({typeName:_e.ZodUnknown,...Te(t)});class Ln extends Ne{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:Q.invalid_type,expected:ae.never,received:n.parsedType}),Ce}}Ln.create=t=>new Ln({typeName:_e.ZodNever,...Te(t)});class ls extends Ne{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.void,received:o.parsedType}),Ce}return kt(e.data)}}ls.create=t=>new ls({typeName:_e.ZodVoid,...Te(t)});class sn extends Ne{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),s=this._def;if(n.parsedType!==ae.array)return ie(n,{code:Q.invalid_type,expected:ae.array,received:n.parsedType}),Ce;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(ie(n,{code:c?Q.too_big:Q.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),o.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ie(n,{code:Q.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),o.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ie(n,{code:Q.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new Tn(n,c,n.path,u)))).then(c=>_t.mergeArray(o,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new Tn(n,c,n.path,u)));return _t.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new sn({...this._def,minLength:{value:e,message:pe.toString(n)}})}max(e,n){return new sn({...this._def,maxLength:{value:e,message:pe.toString(n)}})}length(e,n){return new sn({...this._def,exactLength:{value:e,message:pe.toString(n)}})}nonempty(e){return this.min(1,e)}}sn.create=(t,e)=>new sn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Te(e)});function uo(t){if(t instanceof Qe){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=An.create(uo(o))}return new Qe({...t._def,shape:()=>e})}else return t instanceof sn?new sn({...t._def,type:uo(t.element)}):t instanceof An?An.create(uo(t.unwrap())):t instanceof sr?sr.create(uo(t.unwrap())):t instanceof Bn?Bn.create(t.items.map(e=>uo(e))):t}class Qe extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Oe.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ae.object){const f=this._getOrReturnCtx(e);return ie(f,{code:Q.invalid_type,expected:ae.object,received:f.parsedType}),Ce}const{status:o,ctx:s}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ln&&this._def.unknownKeys==="strip"))for(const f in s.data)c.includes(f)||u.push(f);const p=[];for(const f of c){const m=l[f],y=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new Tn(s,y,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Ln){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)p.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(f==="strict")u.length>0&&(ie(s,{code:Q.unrecognized_keys,keys:u}),o.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const y=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new Tn(s,y,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of p){const y=await m.key,B=await m.value;f.push({key:y,value:B,alwaysSet:m.alwaysSet})}return f}).then(f=>_t.mergeObjectSync(o,f)):_t.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return pe.errToObj,new Qe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(u=pe.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Qe({...this._def,unknownKeys:"strip"})}passthrough(){return new Qe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Qe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Qe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_e.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Qe({...this._def,catchall:e})}pick(e){const n={};return Oe.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new Qe({...this._def,shape:()=>n})}omit(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new Qe({...this._def,shape:()=>n})}deepPartial(){return uo(this)}partial(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{const s=this.shape[o];e&&!e[o]?n[o]=s:n[o]=s.optional()}),new Qe({...this._def,shape:()=>n})}required(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof An;)l=l._def.innerType;n[o]=l}}),new Qe({...this._def,shape:()=>n})}keyof(){return xd(Oe.objectKeys(this.shape))}}Qe.create=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strip",catchall:Ln.create(),typeName:_e.ZodObject,...Te(e)}),Qe.strictCreate=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strict",catchall:Ln.create(),typeName:_e.ZodObject,...Te(e)}),Qe.lazycreate=(t,e)=>new Qe({shape:t,unknownKeys:"strip",catchall:Ln.create(),typeName:_e.ZodObject,...Te(e)});class Xo extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=l.map(u=>new It(u.ctx.common.issues));return ie(n,{code:Q.invalid_union,unionErrors:c}),Ce}if(n.common.async)return Promise.all(o.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const p of o){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new It(p));return ie(n,{code:Q.invalid_union,unionErrors:u}),Ce}}get options(){return this._def.options}}Xo.create=(t,e)=>new Xo({options:t,typeName:_e.ZodUnion,...Te(e)});const Gn=t=>t instanceof ti?Gn(t.schema):t instanceof an?Gn(t.innerType()):t instanceof ni?[t.value]:t instanceof ir?t.options:t instanceof ri?Oe.objectValues(t.enum):t instanceof oi?Gn(t._def.innerType):t instanceof Yo?[void 0]:t instanceof Jo?[null]:t instanceof An?[void 0,...Gn(t.unwrap())]:t instanceof sr?[null,...Gn(t.unwrap())]:t instanceof Za||t instanceof ai?Gn(t.unwrap()):t instanceof ii?Gn(t._def.innerType):[];class cs extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return ie(n,{code:Q.invalid_type,expected:ae.object,received:n.parsedType}),Ce;const o=this.discriminator,s=n.data[o],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const s=new Map;for(const l of n){const c=Gn(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of c){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,l)}}return new cs({typeName:_e.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Te(o)})}}function za(t,e){const n=nr(t),o=nr(e);if(t===e)return{valid:!0,data:t};if(n===ae.object&&o===ae.object){const s=Oe.objectKeys(e),l=Oe.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=za(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===ae.array&&o===ae.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let l=0;l<t.length;l++){const c=t[l],u=e[l],p=za(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===ae.date&&o===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Qo extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=(l,c)=>{if(Oa(l)||Oa(c))return Ce;const u=za(l.value,c.value);return u.valid?((La(l)||La(c))&&n.dirty(),{status:n.value,value:u.data}):(ie(o,{code:Q.invalid_intersection_types}),Ce)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Qo.create=(t,e,n)=>new Qo({left:t,right:e,typeName:_e.ZodIntersection,...Te(n)});class Bn extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.array)return ie(o,{code:Q.invalid_type,expected:ae.array,received:o.parsedType}),Ce;if(o.data.length<this._def.items.length)return ie(o,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((c,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new Tn(o,c,o.path,u)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>_t.mergeArray(n,c)):_t.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Bn({...this._def,rest:e})}}Bn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bn({items:t,typeName:_e.ZodTuple,rest:null,...Te(e)})};class ei extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.object)return ie(o,{code:Q.invalid_type,expected:ae.object,received:o.parsedType}),Ce;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in o.data)s.push({key:l._parse(new Tn(o,u,o.path,u)),value:c._parse(new Tn(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?_t.mergeObjectAsync(n,s):_t.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Ne?new ei({keyType:e,valueType:n,typeName:_e.ZodRecord,...Te(o)}):new ei({keyType:on.create(),valueType:e,typeName:_e.ZodRecord,...Te(n)})}}class ds extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.map)return ie(o,{code:Q.invalid_type,expected:ae.map,received:o.parsedType}),Ce;const s=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([u,p],f)=>({key:s._parse(new Tn(o,u,o.path,[f,"key"])),value:l._parse(new Tn(o,p,o.path,[f,"value"]))}));if(o.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of c){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return Ce;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of c){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return Ce;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}ds.create=(t,e,n)=>new ds({valueType:e,keyType:t,typeName:_e.ZodMap,...Te(n)});class zr extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.set)return ie(o,{code:Q.invalid_type,expected:ae.set,received:o.parsedType}),Ce;const s=this._def;s.minSize!==null&&o.data.size<s.minSize.value&&(ie(o,{code:Q.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&o.data.size>s.maxSize.value&&(ie(o,{code:Q.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const f=new Set;for(const m of p){if(m.status==="aborted")return Ce;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...o.data.values()].map((p,f)=>l._parse(new Tn(o,p,o.path,f)));return o.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new zr({...this._def,minSize:{value:e,message:pe.toString(n)}})}max(e,n){return new zr({...this._def,maxSize:{value:e,message:pe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}zr.create=(t,e)=>new zr({valueType:t,minSize:null,maxSize:null,typeName:_e.ZodSet,...Te(e)});class po extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.function)return ie(n,{code:Q.invalid_type,expected:ae.function,received:n.parsedType}),Ce;function o(u,p){return is({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,os(),ao].filter(f=>!!f),issueData:{code:Q.invalid_arguments,argumentsError:p}})}function s(u,p){return is({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,os(),ao].filter(f=>!!f),issueData:{code:Q.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof ho){const u=this;return kt(async function(...p){const f=new It([]),m=await u._def.args.parseAsync(p,l).catch(T=>{throw f.addIssue(o(p,T)),f}),y=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(T=>{throw f.addIssue(s(y,T)),f})})}else{const u=this;return kt(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new It([o(p,f.error)]);const m=Reflect.apply(c,this,f.data),y=u._def.returns.safeParse(m,l);if(!y.success)throw new It([s(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new po({...this._def,args:Bn.create(e).rest(Gr.create())})}returns(e){return new po({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new po({args:e||Bn.create([]).rest(Gr.create()),returns:n||Gr.create(),typeName:_e.ZodFunction,...Te(o)})}}class ti extends Ne{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ti.create=(t,e)=>new ti({getter:t,typeName:_e.ZodLazy,...Te(e)});class ni extends Ne{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:Q.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:e.data}}get value(){return this._def.value}}ni.create=(t,e)=>new ni({value:t,typeName:_e.ZodLiteral,...Te(e)});function xd(t,e){return new ir({values:t,typeName:_e.ZodEnum,...Te(e)})}class ir extends Ne{constructor(){super(...arguments),jo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{expected:Oe.joinValues(o),received:n.parsedType,code:Q.invalid_type}),Ce}if(ss(this,jo)||_d(this,jo,new Set(this._def.values)),!ss(this,jo).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{received:n.data,code:Q.invalid_enum_value,options:o}),Ce}return kt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return ir.create(e,{...this._def,...n})}exclude(e,n=this._def){return ir.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}jo=new WeakMap,ir.create=xd;class ri extends Ne{constructor(){super(...arguments),qo.set(this,void 0)}_parse(e){const n=Oe.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ae.string&&o.parsedType!==ae.number){const s=Oe.objectValues(n);return ie(o,{expected:Oe.joinValues(s),received:o.parsedType,code:Q.invalid_type}),Ce}if(ss(this,qo)||_d(this,qo,new Set(Oe.getValidEnumValues(this._def.values))),!ss(this,qo).has(e.data)){const s=Oe.objectValues(n);return ie(o,{received:o.data,code:Q.invalid_enum_value,options:s}),Ce}return kt(e.data)}get enum(){return this._def.values}}qo=new WeakMap,ri.create=(t,e)=>new ri({values:t,typeName:_e.ZodNativeEnum,...Te(e)});class ho extends Ne{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.promise&&n.common.async===!1)return ie(n,{code:Q.invalid_type,expected:ae.promise,received:n.parsedType}),Ce;const o=n.parsedType===ae.promise?n.data:Promise.resolve(n.data);return kt(o.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ho.create=(t,e)=>new ho({type:t,typeName:_e.ZodPromise,...Te(e)});class an extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{ie(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return Ce;const p=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return p.status==="aborted"?Ce:p.status==="dirty"||n.value==="dirty"?lo(p.value):p});{if(n.value==="aborted")return Ce;const u=this._def.schema._parseSync({data:c,path:o.path,parent:o});return u.status==="aborted"?Ce:u.status==="dirty"||n.value==="dirty"?lo(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Wo(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>Wo(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Oe.assertNever(s)}}an.create=(t,e,n)=>new an({schema:t,typeName:_e.ZodEffects,effect:e,...Te(n)}),an.createWithPreprocess=(t,e,n)=>new an({schema:e,effect:{type:"preprocess",transform:t},typeName:_e.ZodEffects,...Te(n)});class An extends Ne{_parse(e){return this._getType(e)===ae.undefined?kt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}An.create=(t,e)=>new An({innerType:t,typeName:_e.ZodOptional,...Te(e)});class sr extends Ne{_parse(e){return this._getType(e)===ae.null?kt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}sr.create=(t,e)=>new sr({innerType:t,typeName:_e.ZodNullable,...Te(e)});class oi extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===ae.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}oi.create=(t,e)=>new oi({innerType:t,typeName:_e.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Te(e)});class ii extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Ho(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new It(o.common.issues)},input:o.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new It(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}ii.create=(t,e)=>new ii({innerType:t,typeName:_e.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Te(e)});class us extends Ne{_parse(e){if(this._getType(e)!==ae.nan){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.nan,received:o.parsedType}),Ce}return{status:"valid",value:e.data}}}us.create=t=>new us({typeName:_e.ZodNaN,...Te(t)});const Lm=Symbol("zod_brand");class Za extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class si extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return l.status==="aborted"?Ce:l.status==="dirty"?(n.dirty(),lo(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const s=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:o.path,parent:o})}}static create(e,n){return new si({in:e,out:n,typeName:_e.ZodPipeline})}}class ai extends Ne{_parse(e){const n=this._def.innerType._parse(e),o=s=>(Wo(s)&&(s.value=Object.freeze(s.value)),s);return Ho(n)?n.then(s=>o(s)):o(n)}unwrap(){return this._def.innerType}}ai.create=(t,e)=>new ai({innerType:t,typeName:_e.ZodReadonly,...Te(e)});function kd(t,e={},n){return t?co.create().superRefine((o,s)=>{var l,c;if(!t(o)){const u=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):co.create()}const Gm={object:Qe.lazycreate};var _e;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_e||(_e={}));const zm=(t,e={message:`Input not instance of ${t.name}`})=>kd(n=>n instanceof t,e),Sd=on.create,Ed=rr.create,Zm=us.create,$m=or.create,Td=Ko.create,Um=Lr.create,Wm=as.create,Hm=Yo.create,jm=Jo.create,qm=co.create,Km=Gr.create,Ym=Ln.create,Jm=ls.create,Xm=sn.create,Qm=Qe.create,eg=Qe.strictCreate,tg=Xo.create,ng=cs.create,rg=Qo.create,og=Bn.create,ig=ei.create,sg=ds.create,ag=zr.create,lg=po.create,cg=ti.create,dg=ni.create,ug=ir.create,pg=ri.create,hg=ho.create,Bd=an.create,fg=An.create,mg=sr.create,gg=an.createWithPreprocess,yg=si.create;var Nn=Object.freeze({__proto__:null,defaultErrorMap:ao,setErrorMap:bm,getErrorMap:os,makeIssue:is,EMPTY_PATH:xm,addIssueToContext:ie,ParseStatus:_t,INVALID:Ce,DIRTY:lo,OK:kt,isAborted:Oa,isDirty:La,isValid:Wo,isAsync:Ho,get util(){return Oe},get objectUtil(){return Ia},ZodParsedType:ae,getParsedType:nr,ZodType:Ne,datetimeRegex:bd,ZodString:on,ZodNumber:rr,ZodBigInt:or,ZodBoolean:Ko,ZodDate:Lr,ZodSymbol:as,ZodUndefined:Yo,ZodNull:Jo,ZodAny:co,ZodUnknown:Gr,ZodNever:Ln,ZodVoid:ls,ZodArray:sn,ZodObject:Qe,ZodUnion:Xo,ZodDiscriminatedUnion:cs,ZodIntersection:Qo,ZodTuple:Bn,ZodRecord:ei,ZodMap:ds,ZodSet:zr,ZodFunction:po,ZodLazy:ti,ZodLiteral:ni,ZodEnum:ir,ZodNativeEnum:ri,ZodPromise:ho,ZodEffects:an,ZodTransformer:an,ZodOptional:An,ZodNullable:sr,ZodDefault:oi,ZodCatch:ii,ZodNaN:us,BRAND:Lm,ZodBranded:Za,ZodPipeline:si,ZodReadonly:ai,custom:kd,Schema:Ne,ZodSchema:Ne,late:Gm,get ZodFirstPartyTypeKind(){return _e},coerce:{string:t=>on.create({...t,coerce:!0}),number:t=>rr.create({...t,coerce:!0}),boolean:t=>Ko.create({...t,coerce:!0}),bigint:t=>or.create({...t,coerce:!0}),date:t=>Lr.create({...t,coerce:!0})},any:qm,array:Xm,bigint:$m,boolean:Td,date:Um,discriminatedUnion:ng,effect:Bd,enum:ug,function:lg,instanceof:zm,intersection:rg,lazy:cg,literal:dg,map:sg,nan:Zm,nativeEnum:pg,never:Ym,null:jm,nullable:mg,number:Ed,object:Qm,oboolean:()=>Td().optional(),onumber:()=>Ed().optional(),optional:fg,ostring:()=>Sd().optional(),pipeline:yg,preprocess:gg,promise:hg,record:ig,set:ag,strictObject:eg,string:Sd,symbol:Wm,transformer:Bd,tuple:og,undefined:Hm,union:tg,unknown:Km,void:Jm,NEVER:Ce,ZodIssueCode:Q,quotelessJson:wm,ZodError:It});function _g(t){throw new Error("Unexpected object: "+t)}const vg=-2147483648,Ad=-9007199254740991n,Cg=NaN,wg=NaN,bg=null,xg=null;function Nd(t,e){switch(e){case"Int":return t===vg;case"Long":return t===Number(Ad)||t===Ad;case"Float":return t===Cg;case"Double":return t===wg;case"String":return t===bg;case"Bytes":return t===xg;default:throw Error(`unsupported data type: ${e}`)}}function kg(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}function $a(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}function Vd(t){return t.map($a)}function ps(t,e){switch(t.type){case"column":return{type:"column",column:e(t.column)};case"inner":case"full":return{type:t.type,entries:t.entries.map(n=>ps(n,e))};case"outer":return{type:"outer",primary:ps(t.primary,e),secondary:t.secondary.map(n=>ps(n,e))};default:_g(t)}}Nn.object({__isRef:Nn.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Nn.string().describe("Upstream block id"),name:Nn.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function Sg(t){if(t&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(t);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const Eg=Nn.object({type:Nn.string(),importance:Nn.number().optional(),id:Nn.string().optional(),label:Nn.string()});Nn.array(Eg);const Tg="1.13.2";function Bg(){return Sg({sdkVersion:Tg})}function Ag(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function fo(t){return!!t&&typeof t.children<"u"}function ar(t){return fo(t)?t.groupId:t.colId}function Pd(t,e,n){const o=(c,u)=>{const p=c.children.map(ar),f=x._includes(p,ar(u)),m=x._last(c.children),y=m&&ar(m)!==ar(u);return f&&y};if(!fo(t))return!0;const s=t,l=n;if(o(s,l))return s.children.push(l),!0;if(s.groupId===e){const c=s.children.map(ar);if(!x._includes(c,ar(l)))return s.children.push(l),!0}for(let c=s.children.length-1;c>=0&&!Pd(s.children[c],e,n);c--);return!1}function Ng(t){const e=(s,l)=>fo(s)&&fo(l)&&ar(s)===ar(l),n=(s,l)=>{if(!fo(l))return s;const c=s,u=l;return u.children&&u.groupId&&Pd(c,u.groupId,u.children[0])||u.children.forEach(p=>n(c,p)),c},o=[];for(let s=1;s<=t.length;s++){const l=t[s-1],c=t[s];e(l,c)?t[s]=n(l,c):o.push(l)}return o}var Vg=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(fo(s)){const c=s,u=typeof c.groupId<"u"?c.groupId:c.headerName,p=new x.AgProvidedColumnGroup(c,u,!1,l),f=[];return c.children.forEach(m=>{const y=n(m,l+1);y&&f.push(y)}),p.setChildren(f),p}else{const c=s,u=c.colId?c.colId:c.field,p=this.columnModel.getColDefCol(u);return p||e.push(c),p}},o=[];return t.forEach(s=>{const l=n(s,0);l&&o.push(l)}),e.length>0&&x._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=Ng(e);t(n)}getLeafPathTrees(){const t=(o,s)=>{let l;if(x.isProvidedColumnGroup(o))if(o.isPadding())l=s;else{const u=Object.assign({},o.getColGroupDef());u.groupId=o.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},o.getColDef());u.colId=o.getColId(),l=u}const c=o.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(o=>{const s=o.getColDef();return o.isPrimary()&&!s.showRowGroup}).map(o=>t(o,o.getColDef()))}};function Pg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function Dg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function Fg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Rg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function Mg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function Ig(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function Og(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function Lg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function Gg(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return x._unwrapUserComp(n)}function zg(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var Zg=class extends x.Component{constructor(t){super(),this.eToggleButton=x.RefPlaceholder,this.eIconWrapper=x.RefPlaceholder,this.eLabel=x.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
|
|
3
|
+
`)}}function mm(t){return{ok:!0,value:t}}function md(t){if(!t)throw new Aa;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function gd(t){return{value:t,errors:void 0}}function gm(t){if(t.errors)throw new Na(t.errors);if(!t.value)throw new Aa;return t.value}function ym(t){return t!==void 0}function Va(t,e){return Or(t)===Or(e)}const Pa=t=>t,Da=t=>t instanceof Error?t:Error(String(t)),Fa=t=>t.name==="ZodError",Ra=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),o=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function Ma(t){const e=t.validate??Pa,{autoSave:n}=t,o=r.ref(),s=r.ref(),l=N=>{s.value={model:En(N)}};r.watch(()=>t.get(),N=>l(N),{immediate:!0});const c=()=>{var N;t.onSave(e(En((N=s.value)==null?void 0:N.model)))},u=()=>{l(t.get()),o.value=void 0},p=N=>{const M=Da(N);Fa(M)?o.value=Error(Ra(M)):o.value=M},f=N=>{o.value=void 0;try{e(N),n&&c()}catch(M){p(M)}},m=r.computed({get:()=>{var N;return(N=s.value)==null?void 0:N.model},set(N){l(N),f(N)}});r.watch(s,(N,M)=>{N&&N===M&&f(N.model)},{deep:!0});const y=r.computed(()=>!o.value),B=r.computed(()=>!Va(t.get(),r.unref(s))),T=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:B,error:o,errorString:T,save:c,revert:u,setError:p})}function _m(t,e,n){const o=t.validate??Pa,{autoSave:s}=t,l=r.ref(),c=r.ref(),u=G=>{var C;if(n.deepPatchModel){const F=(C=c.value)==null?void 0:C.model,L=Object.assign(En(G),e??{});c.value={model:F?fd(F,L):L,stage:Symbol()}}else c.value={model:Object.assign(En(G),e??{}),stage:Symbol()}};r.watch(()=>t.get(),G=>u(G),{immediate:!0});const p=()=>{var G;t.onSave(o(En((G=c.value)==null?void 0:G.model)))},f=()=>{u(t.get()),l.value=void 0},m=G=>{const C=Da(G);Fa(C)?l.value=Error(Ra(C)):l.value=C},y=G=>{l.value=void 0;try{o(G),s&&p()}catch(C){m(C)}},B=r.computed({get:()=>{var G;return(G=c.value)==null?void 0:G.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:B.value.args,ui:B.value.ui}),()=>{var G;return(G=c.value)==null?void 0:G.stage}],([G,C],[F,L])=>{C===L&&y(G)},{deep:!0});const T=r.computed(()=>!l.value),N=r.computed(()=>{var F;const{args:G,ui:C}=((F=r.unref(c))==null?void 0:F.model)??{};return!Va(t.get(),{args:G,ui:C})}),M=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:B,valid:T,isChanged:N,error:l,errorString:M,save:p,revert:f,setError:m})}const vm=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function Cm(t,e,n){const o=(C,...F)=>{n.debug&&console.log(`%c>>> %c${C}`,"color: orange; font-weight: bold","color: orange",...F)},l=Ba(e.setBlockArgs,100),c=Ba(e.setBlockUiState,100),u=Ba(e.setBlockArgsAndUiState,100),p=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async C=>{C.forEach(F=>{F.key==="args"&&(p.args=Object.freeze(F.value),o("args patch",p.args)),F.key==="ui"&&(p.ui=Object.freeze(F.value),o("ui patch",p.ui)),F.key==="outputs"&&(p.outputs=Object.freeze(F.value),o("outputs patch",p.outputs)),F.key==="navigationState"&&(p.navigationState=Object.freeze(F.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const f=()=>En(p.args),m=()=>En(p.ui),y=()=>En(p.navigationState),B={createArgsModel(C={}){return Ma({get(){return C.transform?C.transform(p.args):p.args},validate:C.validate,autoSave:!0,onSave(F){l(F)}})},createUiModel(C={},F){return Ma({get(){return C.transform?C.transform(p.ui):p.ui??F()},validate:C.validate,autoSave:!0,onSave(L){c(L)}})},useOutputs(...C){const F=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(F,{value:this.unwrapOutputs(...C),errors:void 0})}catch(L){Object.assign(F,{value:void 0,errors:[String(L)]})}},{immediate:!0,deep:!0}),F},unwrapOutputs(...C){const F=p.outputs,L=C.map($=>[$,md(F[$])]);return Object.fromEntries(L)},getOutputField(C){return p.outputs[C]},getOutputFieldOkOptional(C){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const F=this.getOutputField(C);if(F&&F.ok)return F.value},getOutputFieldErrorsOptional(C){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const F=this.getOutputField(C);if(F&&!F.ok)return F.errors},updateArgs(C){const F=f();return C(F),e.setBlockArgs(F)},updateUiState(C){const F=m();return e.setBlockUiState(C(F))},updateNavigationState(C){const F=y();return C(F),e.setNavigationState(F)},navigateTo(C){const F=y();return F.href=C,e.setNavigationState(F)}},T=r.computed(()=>{const C=Object.entries(p.outputs).map(([F,L])=>[F,L.ok&&L.value!==void 0?L.value:void 0]);return Object.fromEntries(C)}),N=r.computed(()=>{const C=Object.entries(p.outputs).map(([F,L])=>[F,L&&!L.ok?new Na(L.errors):void 0]);return Object.fromEntries(C)}),M={snapshot:p,queryParams:r.computed(()=>vm(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(C=>!(C!=null&&C.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),T.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),N.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),p.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),p.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),p.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),p.navigationState))},G=_m({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(C){u(C.args,C.ui)}},{outputs:T,outputErrors:N},n);return r.reactive(Object.assign(G,B,M))}var Oe;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of l)c[u]=s[u];return t.objectValues(c)},t.objectValues=s=>t.objectKeys(s).map(function(l){return s[l]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},t.find=(s,l)=>{for(const c of s)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function o(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Oe||(Oe={}));var Ia;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Ia||(Ia={}));const ae=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),nr=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map<"u"&&t instanceof Map?ae.map:typeof Set<"u"&&t instanceof Set?ae.set:typeof Date<"u"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},Q=Oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),wm=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class It extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let u=o,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),o}static assert(e){if(!(e instanceof It))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):o.push(e(s));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}It.create=t=>new It(t);const ao=(t,e)=>{let n;switch(t.code){case Q.invalid_type:t.received===ae.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Oe.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:n=`Unrecognized key(s) in object: ${Oe.joinValues(t.keys,", ")}`;break;case Q.invalid_union:n="Invalid input";break;case Q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Oe.joinValues(t.options)}`;break;case Q.invalid_enum_value:n=`Invalid enum value. Expected ${Oe.joinValues(t.options)}, received '${t.received}'`;break;case Q.invalid_arguments:n="Invalid function arguments";break;case Q.invalid_return_type:n="Invalid function return type";break;case Q.invalid_date:n="Invalid date";break;case Q.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Oe.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Q.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Q.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Q.custom:n="Invalid input";break;case Q.invalid_intersection_types:n="Intersection results could not be merged";break;case Q.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Q.not_finite:n="Number must be finite";break;default:n=e.defaultError,Oe.assertNever(t)}return{message:n}};let yd=ao;function bm(t){yd=t}function os(){return yd}const is=t=>{const{data:e,path:n,errorMaps:o,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=o.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},xm=[];function ie(t,e){const n=os(),o=is({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ao?void 0:ao].filter(s=>!!s)});t.common.issues.push(o)}class _t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const s of n){if(s.status==="aborted")return Ce;s.status==="dirty"&&e.dirty(),o.push(s.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const s of n){const l=await s.key,c=await s.value;o.push({key:l,value:c})}return _t.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return Ce;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const Ce=Object.freeze({status:"aborted"}),lo=t=>({status:"dirty",value:t}),kt=t=>({status:"valid",value:t}),Oa=t=>t.status==="aborted",La=t=>t.status==="dirty",Wo=t=>t.status==="valid",Ho=t=>typeof Promise<"u"&&t instanceof Promise;function ss(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function _d(t,e,n,o,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var pe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(pe||(pe={}));var jo,qo;class Tn{constructor(e,n,o,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const vd=(t,e)=>{if(Wo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new It(t.common.issues);return this._error=n,this._error}}};function Te(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:s}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(c,u)=>{var p,f;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(p=m??o)!==null&&p!==void 0?p:u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:(f=m??n)!==null&&f!==void 0?f:u.defaultError}},description:s}}class Ne{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return nr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new _t,ctx:{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Ho(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const s={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},l=this._parseSync({data:e,path:s.path,parent:s});return vd(s,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:nr(e)},s=this._parse({data:e,path:o.path,parent:o}),l=await(Ho(s)?s:Promise.resolve(s));return vd(o,l)}refine(e,n){const o=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:Q.custom,...o(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((o,s)=>e(o)?!0:(s.addIssue(typeof n=="function"?n(o,s):n),!1))}_refinement(e){return new an({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return An.create(this,this._def)}nullable(){return sr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sn.create(this,this._def)}promise(){return ho.create(this,this._def)}or(e){return Xo.create([this,e],this._def)}and(e){return Qo.create(this,e,this._def)}transform(e){return new an({...Te(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new oi({...Te(this._def),innerType:this,defaultValue:n,typeName:_e.ZodDefault})}brand(){return new Za({typeName:_e.ZodBranded,type:this,...Te(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ii({...Te(this._def),innerType:this,catchValue:n,typeName:_e.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return si.create(this,e)}readonly(){return ai.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const km=/^c[^\s-]{8,}$/i,Sm=/^[0-9a-z]+$/,Em=/^[0-9A-HJKMNP-TV-Z]{26}$/,Tm=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Bm=/^[a-z0-9_-]{21}$/i,Am=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Nm=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Vm="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ga;const Pm=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Dm=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Fm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Cd="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Rm=new RegExp(`^${Cd}$`);function wd(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Mm(t){return new RegExp(`^${wd(t)}$`)}function bd(t){let e=`${Cd}T${wd(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Im(t,e){return!!((e==="v4"||!e)&&Pm.test(t)||(e==="v6"||!e)&&Dm.test(t))}class on extends Ne{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){const l=this._getOrReturnCtx(e);return ie(l,{code:Q.invalid_type,expected:ae.string,received:l.parsedType}),Ce}const o=new _t;let s;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="max")e.data.length>l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,u=e.data.length<l.value;(c||u)&&(s=this._getOrReturnCtx(e,s),c?ie(s,{code:Q.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):u&&ie(s,{code:Q.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")Nm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"email",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")Ga||(Ga=new RegExp(Vm,"u")),Ga.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"emoji",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")Tm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"uuid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")Bm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"nanoid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")km.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")Sm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid2",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")Em.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ulid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ie(s,{validation:"url",code:Q.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"regex",code:Q.invalid_string,message:l.message}),o.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?bd(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?Rm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?Mm(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?Am.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"duration",code:Q.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?Im(e.data,l.version)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ip",code:Q.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?Fm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"base64",code:Q.invalid_string,message:l.message}),o.dirty()):Oe.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(s=>e.test(s),{validation:n,code:Q.invalid_string,...pe.errToObj(o)})}_addCheck(e){return new on({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...pe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...pe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...pe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...pe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...pe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...pe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...pe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...pe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...pe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...pe.errToObj(e)})}datetime(e){var n,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...pe.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...pe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...pe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...pe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...pe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...pe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...pe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...pe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...pe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...pe.errToObj(n)})}nonempty(e){return this.min(1,pe.errToObj(e))}trim(){return new on({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new on({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new on({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}on.create=t=>{var e;return new on({checks:[],typeName:_e.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Te(t)})};function Om(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,s=n>o?n:o,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class rr extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ae.number){const l=this._getOrReturnCtx(e);return ie(l,{code:Q.invalid_type,expected:ae.number,received:l.parsedType}),Ce}let o;const s=new _t;for(const l of this._def.checks)l.kind==="int"?Oe.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?Om(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.not_finite,message:l.message}),s.dirty()):Oe.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,o,s){return new rr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:pe.toString(s)}]})}_addCheck(e){return new rr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:pe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:pe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Oe.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}rr.create=t=>new rr({checks:[],typeName:_e.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Te(t)});class or extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ae.bigint){const l=this._getOrReturnCtx(e);return ie(l,{code:Q.invalid_type,expected:ae.bigint,received:l.parsedType}),Ce}let o;const s=new _t;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:Q.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Oe.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,o,s){return new or({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:pe.toString(s)}]})}_addCheck(e){return new or({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}or.create=t=>{var e;return new or({checks:[],typeName:_e.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Te(t)})};class Ko extends Ne{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.boolean,received:o.parsedType}),Ce}return kt(e.data)}}Ko.create=t=>new Ko({typeName:_e.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Te(t)});class Lr extends Ne{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){const l=this._getOrReturnCtx(e);return ie(l,{code:Q.invalid_type,expected:ae.date,received:l.parsedType}),Ce}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ie(l,{code:Q.invalid_date}),Ce}const o=new _t;let s;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:Q.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Oe.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Lr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:pe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:pe.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Lr.create=t=>new Lr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_e.ZodDate,...Te(t)});class as extends Ne{_parse(e){if(this._getType(e)!==ae.symbol){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.symbol,received:o.parsedType}),Ce}return kt(e.data)}}as.create=t=>new as({typeName:_e.ZodSymbol,...Te(t)});class Yo extends Ne{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.undefined,received:o.parsedType}),Ce}return kt(e.data)}}Yo.create=t=>new Yo({typeName:_e.ZodUndefined,...Te(t)});class Jo extends Ne{_parse(e){if(this._getType(e)!==ae.null){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.null,received:o.parsedType}),Ce}return kt(e.data)}}Jo.create=t=>new Jo({typeName:_e.ZodNull,...Te(t)});class co extends Ne{constructor(){super(...arguments),this._any=!0}_parse(e){return kt(e.data)}}co.create=t=>new co({typeName:_e.ZodAny,...Te(t)});class Gr extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return kt(e.data)}}Gr.create=t=>new Gr({typeName:_e.ZodUnknown,...Te(t)});class Ln extends Ne{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:Q.invalid_type,expected:ae.never,received:n.parsedType}),Ce}}Ln.create=t=>new Ln({typeName:_e.ZodNever,...Te(t)});class ls extends Ne{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.void,received:o.parsedType}),Ce}return kt(e.data)}}ls.create=t=>new ls({typeName:_e.ZodVoid,...Te(t)});class sn extends Ne{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),s=this._def;if(n.parsedType!==ae.array)return ie(n,{code:Q.invalid_type,expected:ae.array,received:n.parsedType}),Ce;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(ie(n,{code:c?Q.too_big:Q.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),o.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ie(n,{code:Q.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),o.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ie(n,{code:Q.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new Tn(n,c,n.path,u)))).then(c=>_t.mergeArray(o,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new Tn(n,c,n.path,u)));return _t.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new sn({...this._def,minLength:{value:e,message:pe.toString(n)}})}max(e,n){return new sn({...this._def,maxLength:{value:e,message:pe.toString(n)}})}length(e,n){return new sn({...this._def,exactLength:{value:e,message:pe.toString(n)}})}nonempty(e){return this.min(1,e)}}sn.create=(t,e)=>new sn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Te(e)});function uo(t){if(t instanceof Qe){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=An.create(uo(o))}return new Qe({...t._def,shape:()=>e})}else return t instanceof sn?new sn({...t._def,type:uo(t.element)}):t instanceof An?An.create(uo(t.unwrap())):t instanceof sr?sr.create(uo(t.unwrap())):t instanceof Bn?Bn.create(t.items.map(e=>uo(e))):t}class Qe extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Oe.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ae.object){const f=this._getOrReturnCtx(e);return ie(f,{code:Q.invalid_type,expected:ae.object,received:f.parsedType}),Ce}const{status:o,ctx:s}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ln&&this._def.unknownKeys==="strip"))for(const f in s.data)c.includes(f)||u.push(f);const p=[];for(const f of c){const m=l[f],y=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new Tn(s,y,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Ln){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)p.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(f==="strict")u.length>0&&(ie(s,{code:Q.unrecognized_keys,keys:u}),o.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const y=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new Tn(s,y,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of p){const y=await m.key,B=await m.value;f.push({key:y,value:B,alwaysSet:m.alwaysSet})}return f}).then(f=>_t.mergeObjectSync(o,f)):_t.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return pe.errToObj,new Qe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(u=pe.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Qe({...this._def,unknownKeys:"strip"})}passthrough(){return new Qe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Qe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Qe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_e.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Qe({...this._def,catchall:e})}pick(e){const n={};return Oe.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new Qe({...this._def,shape:()=>n})}omit(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new Qe({...this._def,shape:()=>n})}deepPartial(){return uo(this)}partial(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{const s=this.shape[o];e&&!e[o]?n[o]=s:n[o]=s.optional()}),new Qe({...this._def,shape:()=>n})}required(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof An;)l=l._def.innerType;n[o]=l}}),new Qe({...this._def,shape:()=>n})}keyof(){return xd(Oe.objectKeys(this.shape))}}Qe.create=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strip",catchall:Ln.create(),typeName:_e.ZodObject,...Te(e)}),Qe.strictCreate=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strict",catchall:Ln.create(),typeName:_e.ZodObject,...Te(e)}),Qe.lazycreate=(t,e)=>new Qe({shape:t,unknownKeys:"strip",catchall:Ln.create(),typeName:_e.ZodObject,...Te(e)});class Xo extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=l.map(u=>new It(u.ctx.common.issues));return ie(n,{code:Q.invalid_union,unionErrors:c}),Ce}if(n.common.async)return Promise.all(o.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const p of o){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new It(p));return ie(n,{code:Q.invalid_union,unionErrors:u}),Ce}}get options(){return this._def.options}}Xo.create=(t,e)=>new Xo({options:t,typeName:_e.ZodUnion,...Te(e)});const Gn=t=>t instanceof ti?Gn(t.schema):t instanceof an?Gn(t.innerType()):t instanceof ni?[t.value]:t instanceof ir?t.options:t instanceof ri?Oe.objectValues(t.enum):t instanceof oi?Gn(t._def.innerType):t instanceof Yo?[void 0]:t instanceof Jo?[null]:t instanceof An?[void 0,...Gn(t.unwrap())]:t instanceof sr?[null,...Gn(t.unwrap())]:t instanceof Za||t instanceof ai?Gn(t.unwrap()):t instanceof ii?Gn(t._def.innerType):[];class cs extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return ie(n,{code:Q.invalid_type,expected:ae.object,received:n.parsedType}),Ce;const o=this.discriminator,s=n.data[o],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const s=new Map;for(const l of n){const c=Gn(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of c){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,l)}}return new cs({typeName:_e.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Te(o)})}}function za(t,e){const n=nr(t),o=nr(e);if(t===e)return{valid:!0,data:t};if(n===ae.object&&o===ae.object){const s=Oe.objectKeys(e),l=Oe.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=za(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===ae.array&&o===ae.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let l=0;l<t.length;l++){const c=t[l],u=e[l],p=za(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===ae.date&&o===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Qo extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=(l,c)=>{if(Oa(l)||Oa(c))return Ce;const u=za(l.value,c.value);return u.valid?((La(l)||La(c))&&n.dirty(),{status:n.value,value:u.data}):(ie(o,{code:Q.invalid_intersection_types}),Ce)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Qo.create=(t,e,n)=>new Qo({left:t,right:e,typeName:_e.ZodIntersection,...Te(n)});class Bn extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.array)return ie(o,{code:Q.invalid_type,expected:ae.array,received:o.parsedType}),Ce;if(o.data.length<this._def.items.length)return ie(o,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((c,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new Tn(o,c,o.path,u)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>_t.mergeArray(n,c)):_t.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Bn({...this._def,rest:e})}}Bn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bn({items:t,typeName:_e.ZodTuple,rest:null,...Te(e)})};class ei extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.object)return ie(o,{code:Q.invalid_type,expected:ae.object,received:o.parsedType}),Ce;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in o.data)s.push({key:l._parse(new Tn(o,u,o.path,u)),value:c._parse(new Tn(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?_t.mergeObjectAsync(n,s):_t.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Ne?new ei({keyType:e,valueType:n,typeName:_e.ZodRecord,...Te(o)}):new ei({keyType:on.create(),valueType:e,typeName:_e.ZodRecord,...Te(n)})}}class ds extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.map)return ie(o,{code:Q.invalid_type,expected:ae.map,received:o.parsedType}),Ce;const s=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([u,p],f)=>({key:s._parse(new Tn(o,u,o.path,[f,"key"])),value:l._parse(new Tn(o,p,o.path,[f,"value"]))}));if(o.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of c){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return Ce;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of c){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return Ce;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}ds.create=(t,e,n)=>new ds({valueType:e,keyType:t,typeName:_e.ZodMap,...Te(n)});class zr extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.set)return ie(o,{code:Q.invalid_type,expected:ae.set,received:o.parsedType}),Ce;const s=this._def;s.minSize!==null&&o.data.size<s.minSize.value&&(ie(o,{code:Q.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&o.data.size>s.maxSize.value&&(ie(o,{code:Q.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const f=new Set;for(const m of p){if(m.status==="aborted")return Ce;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...o.data.values()].map((p,f)=>l._parse(new Tn(o,p,o.path,f)));return o.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new zr({...this._def,minSize:{value:e,message:pe.toString(n)}})}max(e,n){return new zr({...this._def,maxSize:{value:e,message:pe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}zr.create=(t,e)=>new zr({valueType:t,minSize:null,maxSize:null,typeName:_e.ZodSet,...Te(e)});class po extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.function)return ie(n,{code:Q.invalid_type,expected:ae.function,received:n.parsedType}),Ce;function o(u,p){return is({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,os(),ao].filter(f=>!!f),issueData:{code:Q.invalid_arguments,argumentsError:p}})}function s(u,p){return is({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,os(),ao].filter(f=>!!f),issueData:{code:Q.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof ho){const u=this;return kt(async function(...p){const f=new It([]),m=await u._def.args.parseAsync(p,l).catch(T=>{throw f.addIssue(o(p,T)),f}),y=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(T=>{throw f.addIssue(s(y,T)),f})})}else{const u=this;return kt(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new It([o(p,f.error)]);const m=Reflect.apply(c,this,f.data),y=u._def.returns.safeParse(m,l);if(!y.success)throw new It([s(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new po({...this._def,args:Bn.create(e).rest(Gr.create())})}returns(e){return new po({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new po({args:e||Bn.create([]).rest(Gr.create()),returns:n||Gr.create(),typeName:_e.ZodFunction,...Te(o)})}}class ti extends Ne{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ti.create=(t,e)=>new ti({getter:t,typeName:_e.ZodLazy,...Te(e)});class ni extends Ne{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:Q.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:e.data}}get value(){return this._def.value}}ni.create=(t,e)=>new ni({value:t,typeName:_e.ZodLiteral,...Te(e)});function xd(t,e){return new ir({values:t,typeName:_e.ZodEnum,...Te(e)})}class ir extends Ne{constructor(){super(...arguments),jo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{expected:Oe.joinValues(o),received:n.parsedType,code:Q.invalid_type}),Ce}if(ss(this,jo)||_d(this,jo,new Set(this._def.values)),!ss(this,jo).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{received:n.data,code:Q.invalid_enum_value,options:o}),Ce}return kt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return ir.create(e,{...this._def,...n})}exclude(e,n=this._def){return ir.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}jo=new WeakMap,ir.create=xd;class ri extends Ne{constructor(){super(...arguments),qo.set(this,void 0)}_parse(e){const n=Oe.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ae.string&&o.parsedType!==ae.number){const s=Oe.objectValues(n);return ie(o,{expected:Oe.joinValues(s),received:o.parsedType,code:Q.invalid_type}),Ce}if(ss(this,qo)||_d(this,qo,new Set(Oe.getValidEnumValues(this._def.values))),!ss(this,qo).has(e.data)){const s=Oe.objectValues(n);return ie(o,{received:o.data,code:Q.invalid_enum_value,options:s}),Ce}return kt(e.data)}get enum(){return this._def.values}}qo=new WeakMap,ri.create=(t,e)=>new ri({values:t,typeName:_e.ZodNativeEnum,...Te(e)});class ho extends Ne{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.promise&&n.common.async===!1)return ie(n,{code:Q.invalid_type,expected:ae.promise,received:n.parsedType}),Ce;const o=n.parsedType===ae.promise?n.data:Promise.resolve(n.data);return kt(o.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ho.create=(t,e)=>new ho({type:t,typeName:_e.ZodPromise,...Te(e)});class an extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{ie(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return Ce;const p=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return p.status==="aborted"?Ce:p.status==="dirty"||n.value==="dirty"?lo(p.value):p});{if(n.value==="aborted")return Ce;const u=this._def.schema._parseSync({data:c,path:o.path,parent:o});return u.status==="aborted"?Ce:u.status==="dirty"||n.value==="dirty"?lo(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Wo(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>Wo(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Oe.assertNever(s)}}an.create=(t,e,n)=>new an({schema:t,typeName:_e.ZodEffects,effect:e,...Te(n)}),an.createWithPreprocess=(t,e,n)=>new an({schema:e,effect:{type:"preprocess",transform:t},typeName:_e.ZodEffects,...Te(n)});class An extends Ne{_parse(e){return this._getType(e)===ae.undefined?kt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}An.create=(t,e)=>new An({innerType:t,typeName:_e.ZodOptional,...Te(e)});class sr extends Ne{_parse(e){return this._getType(e)===ae.null?kt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}sr.create=(t,e)=>new sr({innerType:t,typeName:_e.ZodNullable,...Te(e)});class oi extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===ae.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}oi.create=(t,e)=>new oi({innerType:t,typeName:_e.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Te(e)});class ii extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Ho(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new It(o.common.issues)},input:o.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new It(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}ii.create=(t,e)=>new ii({innerType:t,typeName:_e.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Te(e)});class us extends Ne{_parse(e){if(this._getType(e)!==ae.nan){const o=this._getOrReturnCtx(e);return ie(o,{code:Q.invalid_type,expected:ae.nan,received:o.parsedType}),Ce}return{status:"valid",value:e.data}}}us.create=t=>new us({typeName:_e.ZodNaN,...Te(t)});const Lm=Symbol("zod_brand");class Za extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class si extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return l.status==="aborted"?Ce:l.status==="dirty"?(n.dirty(),lo(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const s=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:o.path,parent:o})}}static create(e,n){return new si({in:e,out:n,typeName:_e.ZodPipeline})}}class ai extends Ne{_parse(e){const n=this._def.innerType._parse(e),o=s=>(Wo(s)&&(s.value=Object.freeze(s.value)),s);return Ho(n)?n.then(s=>o(s)):o(n)}unwrap(){return this._def.innerType}}ai.create=(t,e)=>new ai({innerType:t,typeName:_e.ZodReadonly,...Te(e)});function kd(t,e={},n){return t?co.create().superRefine((o,s)=>{var l,c;if(!t(o)){const u=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):co.create()}const Gm={object:Qe.lazycreate};var _e;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_e||(_e={}));const zm=(t,e={message:`Input not instance of ${t.name}`})=>kd(n=>n instanceof t,e),Sd=on.create,Ed=rr.create,Zm=us.create,$m=or.create,Td=Ko.create,Um=Lr.create,Wm=as.create,Hm=Yo.create,jm=Jo.create,qm=co.create,Km=Gr.create,Ym=Ln.create,Jm=ls.create,Xm=sn.create,Qm=Qe.create,eg=Qe.strictCreate,tg=Xo.create,ng=cs.create,rg=Qo.create,og=Bn.create,ig=ei.create,sg=ds.create,ag=zr.create,lg=po.create,cg=ti.create,dg=ni.create,ug=ir.create,pg=ri.create,hg=ho.create,Bd=an.create,fg=An.create,mg=sr.create,gg=an.createWithPreprocess,yg=si.create;var Nn=Object.freeze({__proto__:null,defaultErrorMap:ao,setErrorMap:bm,getErrorMap:os,makeIssue:is,EMPTY_PATH:xm,addIssueToContext:ie,ParseStatus:_t,INVALID:Ce,DIRTY:lo,OK:kt,isAborted:Oa,isDirty:La,isValid:Wo,isAsync:Ho,get util(){return Oe},get objectUtil(){return Ia},ZodParsedType:ae,getParsedType:nr,ZodType:Ne,datetimeRegex:bd,ZodString:on,ZodNumber:rr,ZodBigInt:or,ZodBoolean:Ko,ZodDate:Lr,ZodSymbol:as,ZodUndefined:Yo,ZodNull:Jo,ZodAny:co,ZodUnknown:Gr,ZodNever:Ln,ZodVoid:ls,ZodArray:sn,ZodObject:Qe,ZodUnion:Xo,ZodDiscriminatedUnion:cs,ZodIntersection:Qo,ZodTuple:Bn,ZodRecord:ei,ZodMap:ds,ZodSet:zr,ZodFunction:po,ZodLazy:ti,ZodLiteral:ni,ZodEnum:ir,ZodNativeEnum:ri,ZodPromise:ho,ZodEffects:an,ZodTransformer:an,ZodOptional:An,ZodNullable:sr,ZodDefault:oi,ZodCatch:ii,ZodNaN:us,BRAND:Lm,ZodBranded:Za,ZodPipeline:si,ZodReadonly:ai,custom:kd,Schema:Ne,ZodSchema:Ne,late:Gm,get ZodFirstPartyTypeKind(){return _e},coerce:{string:t=>on.create({...t,coerce:!0}),number:t=>rr.create({...t,coerce:!0}),boolean:t=>Ko.create({...t,coerce:!0}),bigint:t=>or.create({...t,coerce:!0}),date:t=>Lr.create({...t,coerce:!0})},any:qm,array:Xm,bigint:$m,boolean:Td,date:Um,discriminatedUnion:ng,effect:Bd,enum:ug,function:lg,instanceof:zm,intersection:rg,lazy:cg,literal:dg,map:sg,nan:Zm,nativeEnum:pg,never:Ym,null:jm,nullable:mg,number:Ed,object:Qm,oboolean:()=>Td().optional(),onumber:()=>Ed().optional(),optional:fg,ostring:()=>Sd().optional(),pipeline:yg,preprocess:gg,promise:hg,record:ig,set:ag,strictObject:eg,string:Sd,symbol:Wm,transformer:Bd,tuple:og,undefined:Hm,union:tg,unknown:Km,void:Jm,NEVER:Ce,ZodIssueCode:Q,quotelessJson:wm,ZodError:It});function _g(t){throw new Error("Unexpected object: "+t)}const vg=-2147483648,Ad=-9007199254740991n,Cg=NaN,wg=NaN,bg=null,xg=null;function Nd(t,e){switch(e){case"Int":return t===vg;case"Long":return t===Number(Ad)||t===Ad;case"Float":return t===Cg;case"Double":return t===wg;case"String":return t===bg;case"Bytes":return t===xg;default:throw Error(`unsupported data type: ${e}`)}}function kg(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}function $a(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}function Vd(t){return t.map($a)}function ps(t,e){switch(t.type){case"column":return{type:"column",column:e(t.column)};case"inner":case"full":return{type:t.type,entries:t.entries.map(n=>ps(n,e))};case"outer":return{type:"outer",primary:ps(t.primary,e),secondary:t.secondary.map(n=>ps(n,e))};default:_g(t)}}Nn.object({__isRef:Nn.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Nn.string().describe("Upstream block id"),name:Nn.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function Sg(t){if(t&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(t);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const Eg=Nn.object({type:Nn.string(),importance:Nn.number().optional(),id:Nn.string().optional(),label:Nn.string()});Nn.array(Eg);const Tg="1.13.5";function Bg(){return Sg({sdkVersion:Tg})}function Ag(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function fo(t){return!!t&&typeof t.children<"u"}function ar(t){return fo(t)?t.groupId:t.colId}function Pd(t,e,n){const o=(c,u)=>{const p=c.children.map(ar),f=x._includes(p,ar(u)),m=x._last(c.children),y=m&&ar(m)!==ar(u);return f&&y};if(!fo(t))return!0;const s=t,l=n;if(o(s,l))return s.children.push(l),!0;if(s.groupId===e){const c=s.children.map(ar);if(!x._includes(c,ar(l)))return s.children.push(l),!0}for(let c=s.children.length-1;c>=0&&!Pd(s.children[c],e,n);c--);return!1}function Ng(t){const e=(s,l)=>fo(s)&&fo(l)&&ar(s)===ar(l),n=(s,l)=>{if(!fo(l))return s;const c=s,u=l;return u.children&&u.groupId&&Pd(c,u.groupId,u.children[0])||u.children.forEach(p=>n(c,p)),c},o=[];for(let s=1;s<=t.length;s++){const l=t[s-1],c=t[s];e(l,c)?t[s]=n(l,c):o.push(l)}return o}var Vg=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(fo(s)){const c=s,u=typeof c.groupId<"u"?c.groupId:c.headerName,p=new x.AgProvidedColumnGroup(c,u,!1,l),f=[];return c.children.forEach(m=>{const y=n(m,l+1);y&&f.push(y)}),p.setChildren(f),p}else{const c=s,u=c.colId?c.colId:c.field,p=this.columnModel.getColDefCol(u);return p||e.push(c),p}},o=[];return t.forEach(s=>{const l=n(s,0);l&&o.push(l)}),e.length>0&&x._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=Ng(e);t(n)}getLeafPathTrees(){const t=(o,s)=>{let l;if(x.isProvidedColumnGroup(o))if(o.isPadding())l=s;else{const u=Object.assign({},o.getColGroupDef());u.groupId=o.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},o.getColDef());u.colId=o.getColId(),l=u}const c=o.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(o=>{const s=o.getColDef();return o.isPrimary()&&!s.showRowGroup}).map(o=>t(o,o.getColDef()))}};function Pg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function Dg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function Fg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Rg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function Mg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function Ig(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function Og(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function Lg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function Gg(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return x._unwrapUserComp(n)}function zg(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var Zg=class extends x.Component{constructor(t){super(),this.eToggleButton=x.RefPlaceholder,this.eIconWrapper=x.RefPlaceholder,this.eLabel=x.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
|
|
4
4
|
<button type="button" data-ref="eToggleButton" tabindex="-1" role="tab" aria-expanded="false" class="ag-button ag-side-button-button">
|
|
5
5
|
<div data-ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>
|
|
6
6
|
<span data-ref="eLabel" class="ag-side-button-label"></span>
|