@platforma-sdk/ui-vue 1.25.2 → 1.26.0
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 +8 -0
- package/dist/lib.js +165 -165
- package/dist/lib.js.map +1 -1
- package/dist/lib.umd.cjs +1 -1
- package/dist/lib.umd.cjs.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/lib.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(L,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("ag-grid-enterprise"),require("ag-grid-vue3")):typeof define=="function"&&define.amd?define(["exports","vue","ag-grid-enterprise","ag-grid-vue3"],t):(L=typeof globalThis<"u"?globalThis:L||self,t(L.SdkVueLib={},L.Vue,L.agGridEnterprise,L.agGridVue3))})(this,function(L,t,Pe,So){"use strict";var Gz=Object.defineProperty;var R_=L=>{throw TypeError(L)};var Kz=(L,t,Pe)=>t in L?Gz(L,t,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):L[t]=Pe;var je=(L,t,Pe)=>Kz(L,typeof t!="symbol"?t+"":t,Pe),Df=(L,t,Pe)=>t.has(L)||R_("Cannot "+Pe);var E=(L,t,Pe)=>(Df(L,t,"read from private field"),Pe?Pe.call(L):t.get(L)),Me=(L,t,Pe)=>t.has(L)?R_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(L):t.set(L,Pe),he=(L,t,Pe,So)=>(Df(L,t,"write to private field"),So?So.call(L,Pe):t.set(L,Pe),Pe),de=(L,t,Pe)=>(Df(L,t,"access private method"),Pe);var ac=(L,t,Pe,So)=>({set _(cc){he(L,t,cc,Pe)},get _(){return E(L,t,So)}});var Mr,Qg,ti,ey,ty,Sn,Kt,Bn,ho,Tn,ni,ri,pt,Vn,ut,Xe,ve,$t,Xt,Ct,gt,An,yt,$n,Rn,Yt,On,Lr,Rt,oi,ne,Mf,mo,lr,Ea,Jt,O_,go,ii,Ca,Gr,Kr,Lf,sc,lc,Je,Pf,Ga,Xr,Ff;var cc=Object.defineProperty,I_=(n,e,r)=>e in n?cc(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,dc=(n,e,r)=>I_(n,typeof e!="symbol"?e+"":e,r);function D_(n,e){if(n==null)throw Error(e??"Empty (null | undefined) value");return n}let zf=class{constructor(){dc(this,"promise"),dc(this,"resolve",()=>{}),dc(this,"reject",()=>{}),this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};function M_(n,e){if(n!=null)return e(n)}function L_(n,e){return n=Math.ceil(n),e=Math.floor(e),Math.floor(Math.random()*(e-n))+n}function P_(n){let e="";for(let r=0;r<n;r++)e+=String.fromCharCode(L_(65,91));return e}function F_(){return P_(42)}const Ka=Array.isArray;function Zf(n){return n!==null&&typeof n=="object"}function ki(n){if(typeof n!="object"||n===null)return!1;const e=Object.getPrototypeOf(n);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null}function jf(n){return Object.values(n).reduce((e,r)=>r!==void 0?e+1:e,0)}function Wt(n,e){if(!(Zf(n)&&Zf(e)))return n===e;if(Ka(n)&&Ka(e))return n.length!==e.length?!1:[...n.keys()].every(r=>Wt(n[r],e[r]));if(ki(n)&&ki(e))return jf(n)!==jf(e)?!1:Object.keys(n).every(r=>Wt(n[r],e[r]));throw Error(`Cannot compare a ${String(n)} and b ${String(e)}`)}function zn(n){if(Array.isArray(n)){const e=[];for(let r=0;r<n.length;r++)e[r]=zn(n[r]);return e}else if(ki(n)){const e={};return Object.keys(n).forEach(r=>{e[r]=zn(n[r])}),e}else return n}function Uf(n,e){return new Set([...Object.keys(n),...Object.keys(e)]).forEach(r=>{const o=n[r],i=e[r];ki(o)&&ki(i)||Ka(o)&&Ka(i)&&o.length===i.length?Uf(o,i):n[r]=i}),n}function z_(n){let e=0n,r;return async function(...o){const i=++e;try{await r}catch{}if(e!==i)return{ok:!1};const l=n(...o);return r=l,{ok:!0,value:await l}}}class uc extends Error{}class Xa extends Error{constructor(e){super(e.join(`
|
|
2
2
|
`)),this.errors=e}toString(){return this.errors.join(`
|
|
3
|
-
`)}}function Z_(n){return{ok:!0,value:n}}function Wf(n){if(!n)throw new uc;if(!n.ok)throw new Xa(n.errors);return n.value}function Hf(n){return{value:n,errors:void 0}}function j_(n){if(n.errors)throw new Xa(n.errors);if(!n.value)throw new uc;return n.value}function U_(n){return n!==void 0}const fc=n=>n,pc=n=>n instanceof Error?n:Error(String(n)),hc=n=>n.name==="ZodError",mc=n=>{const{formErrors:e,fieldErrors:r}=n.flatten(),o=Object.entries(r).map(([i,l])=>i+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function gc(n){const e=n.validate??fc,{autoSave:r}=n,o=t.ref(),i=t.ref(),l=x=>{i.value={model:zn(x)}};t.watch(()=>n.get(),x=>l(x),{immediate:!0});const c=()=>{var x;n.onSave(e(zn((x=i.value)==null?void 0:x.model)))},d=()=>{l(n.get()),o.value=void 0},u=x=>{const C=pc(x);hc(C)?o.value=Error(mc(C)):o.value=C},p=x=>{o.value=void 0;try{e(x),r&&c()}catch(C){u(C)}},h=t.computed({get:()=>{var x;return(x=i.value)==null?void 0:x.model},set(x){l(x),p(x)}});t.watch(i,(x,C)=>{x&&x===C&&p(x.model)},{deep:!0});const g=t.computed(()=>!o.value),_=t.computed(()=>!Wt(n.get(),t.unref(i))),w=t.computed(()=>o.value?o.value.message:"");return t.reactive({model:h,valid:g,isChanged:_,error:o,errorString:w,save:c,revert:d,setError:u})}function W_(n,e,r){const o=n.validate??fc,{autoSave:i}=n,l=t.ref(),c=t.ref(),d=R=>{var P;if(r.deepPatchModel){const j=(P=c.value)==null?void 0:P.model,B=Object.assign(zn(R),e??{});c.value={model:j?Uf(j,B):B,stage:Symbol()}}else c.value={model:Object.assign(zn(R),e??{}),stage:Symbol()}};t.watch(()=>n.get(),R=>d(R),{immediate:!0});const u=()=>{var R;n.onSave(o(zn((R=c.value)==null?void 0:R.model)))},p=()=>{d(n.get()),l.value=void 0},h=R=>{const P=pc(R);hc(P)?l.value=Error(mc(P)):l.value=P},g=R=>{l.value=void 0;try{o(R),i&&u()}catch(P){h(P)}},_=t.computed({get:()=>{var R;return(R=c.value)==null?void 0:R.model},set(){throw Error("Cannot replace base model")}});t.watch([()=>({args:_.value.args,ui:_.value.ui}),()=>{var R;return(R=c.value)==null?void 0:R.stage}],([R,P],[j,B])=>{P===B&&g(R)},{deep:!0});const w=t.computed(()=>!l.value),x=t.computed(()=>{var j;const{args:R,ui:P}=((j=t.unref(c))==null?void 0:j.model)??{};return!Wt(n.get(),{args:R,ui:P})}),C=t.computed(()=>l.value?l.value.message:"");return t.reactive({model:_,valid:w,isChanged:x,error:l,errorString:C,save:u,revert:p,setError:h})}const H_=n=>Object.fromEntries(new URL(n,"http://dummy").searchParams);function yc(n){return t.getCurrentScope()?(t.onScopeDispose(n),!0):!1}const q_=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const G_=n=>n!=null,K_=Object.prototype.toString,X_=n=>K_.call(n)==="[object Object]",_c=()=>{};function Y_(n,e){function r(...o){return new Promise((i,l)=>{Promise.resolve(n(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(i).catch(l)})}return r}function J_(n,e={}){let r,o,i=_c;const l=d=>{clearTimeout(d),i(),i=_c};return d=>{const u=t.toValue(n),p=t.toValue(e.maxWait);return r&&l(r),u<=0||p!==void 0&&p<=0?(o&&(l(o),o=null),Promise.resolve(d())):new Promise((h,g)=>{i=e.rejectOnCancel?g:h,p&&!o&&(o=setTimeout(()=>{r&&l(r),o=null,h(d())},p)),r=setTimeout(()=>{o&&l(o),o=null,h(d())},u)})}}function Q_(n){return t.getCurrentInstance()}function wc(n){return Array.isArray(n)?n:[n]}function bc(n,e=200,r={}){return Y_(J_(e,r),n)}function ew(n,e=!0,r){Q_()?t.onMounted(n,r):e?n():t.nextTick(n)}function tw(n,e,r){return t.watch(n,(i,l,c)=>{i&&e(i,l,c)},{...r,once:!1})}const kc=q_?window:void 0;function Bo(n){var e;const r=t.toValue(n);return(e=r==null?void 0:r.$el)!=null?e:r}function qf(...n){let e,r,o,i;if(typeof n[0]=="string"||Array.isArray(n[0])?([r,o,i]=n,e=kc):[e,r,o,i]=n,!e)return _c;r=wc(r),o=wc(o);const l=[],c=()=>{l.forEach(h=>h()),l.length=0},d=(h,g,_,w)=>(h.addEventListener(g,_,w),()=>h.removeEventListener(g,_,w)),u=t.watch(()=>[Bo(e),t.toValue(i)],([h,g])=>{if(c(),!h)return;const _=X_(g)?{...g}:g;l.push(...r.flatMap(w=>o.map(x=>d(h,w,x,_))))},{immediate:!0,flush:"post"}),p=()=>{u(),c()};return yc(p),p}function nw(){const n=t.ref(!1),e=t.getCurrentInstance();return e&&t.onMounted(()=>{n.value=!0},e),n}function Gf(n){const e=nw();return t.computed(()=>(e.value,!!n()))}function rw(n,e,r={}){const{window:o=kc,...i}=r;let l;const c=Gf(()=>o&&"MutationObserver"in o),d=()=>{l&&(l.disconnect(),l=void 0)},u=t.computed(()=>{const _=t.toValue(n),w=wc(_).map(Bo).filter(G_);return new Set(w)}),p=t.watch(()=>u.value,_=>{d(),c.value&&_.size&&(l=new MutationObserver(e),_.forEach(w=>l.observe(w,i)))},{immediate:!0,flush:"post"}),h=()=>l==null?void 0:l.takeRecords(),g=()=>{p(),d()};return yc(g),{isSupported:c,stop:g,takeRecords:h}}function ow(n,e,r={}){const{window:o=kc,...i}=r;let l;const c=Gf(()=>o&&"ResizeObserver"in o),d=()=>{l&&(l.disconnect(),l=void 0)},u=t.computed(()=>{const g=t.toValue(n);return Array.isArray(g)?g.map(_=>Bo(_)):[Bo(g)]}),p=t.watch(u,g=>{if(d(),c.value&&o){l=new ResizeObserver(e);for(const _ of g)_&&l.observe(_,i)}},{immediate:!0,flush:"post"}),h=()=>{d(),p()};return yc(h),{isSupported:c,stop:h}}function iw(n,e={}){const{reset:r=!0,windowResize:o=!0,windowScroll:i=!0,immediate:l=!0,updateTiming:c="sync"}=e,d=t.ref(0),u=t.ref(0),p=t.ref(0),h=t.ref(0),g=t.ref(0),_=t.ref(0),w=t.ref(0),x=t.ref(0);function C(){const P=Bo(n);if(!P){r&&(d.value=0,u.value=0,p.value=0,h.value=0,g.value=0,_.value=0,w.value=0,x.value=0);return}const j=P.getBoundingClientRect();d.value=j.height,u.value=j.bottom,p.value=j.left,h.value=j.right,g.value=j.top,_.value=j.width,w.value=j.x,x.value=j.y}function R(){c==="sync"?C():c==="next-frame"&&requestAnimationFrame(()=>C())}return ow(n,R),t.watch(()=>Bo(n),P=>!P&&R()),rw(n,R,{attributeFilter:["style","class"]}),i&&qf("scroll",R,{capture:!0,passive:!0}),o&&qf("resize",R,{passive:!0}),ew(()=>{l&&R()}),{height:d,bottom:u,left:p,right:h,top:g,width:_,x:w,y:x,update:R}}function aw(n,e,r){const o=(j,...B)=>{r.debug&&console.log(`%c>>> %c${j}`,"color: orange; font-weight: bold","color: orange",...B)},i=t.reactive({args:Object.freeze(n.args),outputs:Object.freeze(n.outputs),ui:Object.freeze(n.ui),navigationState:Object.freeze(n.navigationState)}),l=r.debounceSpan??100,c=r.debounceMaxWait??1e3,d=bc(j=>{Wt(j,i.args)||e.setBlockArgs(j)},l,{maxWait:c}),u=bc(j=>{Wt(j,i.ui)||e.setBlockUiState(j)},l,{maxWait:c}),p=bc((j,B)=>{(!Wt(j,i.args)||!Wt(B,i.ui))&&e.setBlockArgsAndUiState(j,B)},l,{maxWait:c});e.onStateUpdates(async j=>{j.forEach(B=>{B.key==="args"&&!Wt(i.args,B.value)&&(i.args=Object.freeze(B.value),o("args patch",i.args)),B.key==="ui"&&!Wt(i.ui,B.value)&&(i.ui=Object.freeze(B.value),o("ui patch",i.ui)),B.key==="outputs"&&!Wt(i.outputs,B.value)&&(i.outputs=Object.freeze(B.value),o("outputs patch",i.outputs)),B.key==="navigationState"&&!Wt(i.navigationState,B.value)&&(i.navigationState=Object.freeze(B.value),o("navigationState patch",i.navigationState))}),await t.nextTick()});const h=()=>zn(i.args),g=()=>zn(i.ui),_=()=>zn(i.navigationState),w={createArgsModel(j={}){return gc({get(){return j.transform?j.transform(i.args):i.args},validate:j.validate,autoSave:!0,onSave(B){d(B)}})},createUiModel(j={},B){return gc({get(){return j.transform?j.transform(i.ui):i.ui??B()},validate:j.validate,autoSave:!0,onSave(W){u(W)}})},useOutputs(...j){const B=t.reactive({errors:void 0,value:void 0});return t.watch(()=>i.outputs,()=>{try{Object.assign(B,{value:this.unwrapOutputs(...j),errors:void 0})}catch(W){Object.assign(B,{value:void 0,errors:[String(W)]})}},{immediate:!0,deep:!0}),B},unwrapOutputs(...j){const B=i.outputs,W=j.map(S=>[S,Wf(B[S])]);return Object.fromEntries(W)},updateArgs(j){const B=h();return j(B),e.setBlockArgs(B)},updateUiState(j){const B=g();return e.setBlockUiState(j(B))},updateNavigationState(j){const B=_();return j(B),e.setNavigationState(B)},navigateTo(j){const B=_();return B.href=j,e.setNavigationState(B)}},x=t.computed(()=>{const j=Object.entries(i.outputs).map(([B,W])=>[B,W.ok&&W.value!==void 0?W.value:void 0]);return Object.fromEntries(j)}),C=t.computed(()=>{const j=Object.entries(i.outputs).map(([B,W])=>[B,W&&!W.ok?new Xa(W.errors):void 0]);return Object.fromEntries(j)}),R={snapshot:i,queryParams:t.computed(()=>H_(i.navigationState.href)),href:t.computed(()=>i.navigationState.href),hasErrors:t.computed(()=>Object.values(i.outputs).some(j=>!(j!=null&&j.ok)))},P=W_({get(){return{args:i.args,ui:i.ui}},autoSave:!0,onSave(j){p(j.args,j.ui)}},{outputs:x,outputErrors:C},r);return t.reactive(Object.assign(P,w,R))}var xi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kf(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var sw=function n(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?n(e.toJSON()):Array.isArray(e)?`[${e.reduce((i,l,c)=>`${i}${c===0?"":","}${n(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((o,i)=>{if(e[i]===void 0||typeof e[i]=="symbol")return o;const l=o.length===0?"":",";return`${o}${l}${n(i)}:${n(e[i])}`},"")}}`};const Yr=Kf(sw);var Fe;(function(n){n.assertEqual=i=>i;function e(i){}n.assertIs=e;function r(i){throw new Error}n.assertNever=r,n.arrayToEnum=i=>{const l={};for(const c of i)l[c]=c;return l},n.getValidEnumValues=i=>{const l=n.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(const d of l)c[d]=i[d];return n.objectValues(c)},n.objectValues=i=>n.objectKeys(i).map(function(l){return i[l]}),n.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const l=[];for(const c in i)Object.prototype.hasOwnProperty.call(i,c)&&l.push(c);return l},n.find=(i,l)=>{for(const c of i)if(l(c))return c},n.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,l=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}n.joinValues=o,n.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})(Fe||(Fe={}));var xc;(function(n){n.mergeShapes=(e,r)=>({...e,...r})})(xc||(xc={}));const se=Fe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wr=n=>{switch(typeof n){case"undefined":return se.undefined;case"string":return se.string;case"number":return isNaN(n)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(n)?se.array:n===null?se.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?se.promise:typeof Map<"u"&&n instanceof Map?se.map:typeof Set<"u"&&n instanceof Set?se.set:typeof Date<"u"&&n instanceof Date?se.date:se.object;default:return se.unknown}},ee=Fe.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"]),lw=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class Ht extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const r=e||function(l){return l.message},o={_errors:[]},i=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(r(c));else{let d=o,u=0;for(;u<c.path.length;){const p=c.path[u];u===c.path.length-1?(d[p]=d[p]||{_errors:[]},d[p]._errors.push(r(c))):d[p]=d[p]||{_errors:[]},d=d[p],u++}}};return i(this),o}static assert(e){if(!(e instanceof Ht))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Fe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},o=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:r}}get formErrors(){return this.flatten()}}Ht.create=n=>new Ht(n);const To=(n,e)=>{let r;switch(n.code){case ee.invalid_type:n.received===se.undefined?r="Required":r=`Expected ${n.expected}, received ${n.received}`;break;case ee.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(n.expected,Fe.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:r=`Unrecognized key(s) in object: ${Fe.joinValues(n.keys,", ")}`;break;case ee.invalid_union:r="Invalid input";break;case ee.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Fe.joinValues(n.options)}`;break;case ee.invalid_enum_value:r=`Invalid enum value. Expected ${Fe.joinValues(n.options)}, received '${n.received}'`;break;case ee.invalid_arguments:r="Invalid function arguments";break;case ee.invalid_return_type:r="Invalid function return type";break;case ee.invalid_date:r="Invalid date";break;case ee.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(r=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?r=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?r=`Invalid input: must end with "${n.validation.endsWith}"`:Fe.assertNever(n.validation):n.validation!=="regex"?r=`Invalid ${n.validation}`:r="Invalid";break;case ee.too_small:n.type==="array"?r=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?r=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?r=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?r=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:r="Invalid input";break;case ee.too_big:n.type==="array"?r=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?r=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?r=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?r=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?r=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:r="Invalid input";break;case ee.custom:r="Invalid input";break;case ee.invalid_intersection_types:r="Intersection results could not be merged";break;case ee.not_multiple_of:r=`Number must be a multiple of ${n.multipleOf}`;break;case ee.not_finite:r="Number must be finite";break;default:r=e.defaultError,Fe.assertNever(n)}return{message:r}};let Xf=To;function cw(n){Xf=n}function Ya(){return Xf}const Ja=n=>{const{data:e,path:r,errorMaps:o,issueData:i}=n,l=[...r,...i.path||[]],c={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let d="";const u=o.filter(p=>!!p).slice().reverse();for(const p of u)d=p(c,{data:e,defaultError:d}).message;return{...i,path:l,message:d}},dw=[];function ie(n,e){const r=Ya(),o=Ja({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,r,r===To?void 0:To].filter(i=>!!i)});n.common.issues.push(o)}class xt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const o=[];for(const i of r){if(i.status==="aborted")return ke;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,r){const o=[];for(const i of r){const l=await i.key,c=await i.value;o.push({key:l,value:c})}return xt.mergeObjectSync(e,o)}static mergeObjectSync(e,r){const o={};for(const i of r){const{key:l,value:c}=i;if(l.status==="aborted"||c.status==="aborted")return ke;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const ke=Object.freeze({status:"aborted"}),Vo=n=>({status:"dirty",value:n}),Bt=n=>({status:"valid",value:n}),vc=n=>n.status==="aborted",Ec=n=>n.status==="dirty",vi=n=>n.status==="valid",Ei=n=>typeof Promise<"u"&&n instanceof Promise;function Qa(n,e,r,o){if(typeof e=="function"?n!==e||!o:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(n)}function Yf(n,e,r,o,i){if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(n,r),r}typeof SuppressedError=="function"&&SuppressedError;var fe;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(fe||(fe={}));var Ci,Ni;class Zn{constructor(e,r,o,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=o,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Jf=(n,e)=>{if(vi(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ht(n.common.issues);return this._error=r,this._error}}};function Be(n){if(!n)return{};const{errorMap:e,invalid_type_error:r,required_error:o,description:i}=n;if(e&&(r||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,d)=>{var u,p;const{message:h}=n;return c.code==="invalid_enum_value"?{message:h??d.defaultError}:typeof d.data>"u"?{message:(u=h??o)!==null&&u!==void 0?u:d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:(p=h??r)!==null&&p!==void 0?p:d.defaultError}},description:i}}class Ae{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return wr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:wr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new xt,ctx:{common:e.parent.common,data:e.data,parsedType:wr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Ei(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const o=this.safeParse(e,r);if(o.success)return o.data;throw o.error}safeParse(e,r){var o;const i={common:{issues:[],async:(o=r==null?void 0:r.async)!==null&&o!==void 0?o:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wr(e)},l=this._parseSync({data:e,path:i.path,parent:i});return Jf(i,l)}async parseAsync(e,r){const o=await this.safeParseAsync(e,r);if(o.success)return o.data;throw o.error}async safeParseAsync(e,r){const o={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wr(e)},i=this._parse({data:e,path:o.path,parent:o}),l=await(Ei(i)?i:Promise.resolve(i));return Jf(o,l)}refine(e,r){const o=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,l)=>{const c=e(i),d=()=>l.addIssue({code:ee.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(u=>u?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,r){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof r=="function"?r(o,i):r),!1))}_refinement(e){return new gn({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Un.create(this,this._def)}nullable(){return vr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mn.create(this,this._def)}promise(){return Oo.create(this,this._def)}or(e){return Vi.create([this,e],this._def)}and(e){return Ai.create(this,e,this._def)}transform(e){return new gn({...Be(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new Di({...Be(this._def),innerType:this,defaultValue:r,typeName:we.ZodDefault})}brand(){return new Sc({typeName:we.ZodBranded,type:this,...Be(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Mi({...Be(this._def),innerType:this,catchValue:r,typeName:we.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Li.create(this,e)}readonly(){return Pi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const uw=/^c[^\s-]{8,}$/i,fw=/^[0-9a-z]+$/,pw=/^[0-9A-HJKMNP-TV-Z]{26}$/,hw=/^[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,mw=/^[a-z0-9_-]{21}$/i,gw=/^[-+]?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)?)??$/,yw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_w="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Cc;const ww=/^(?:(?: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])$/,bw=/^(([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})))$/,kw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Qf="((\\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])))",xw=new RegExp(`^${Qf}$`);function ep(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function vw(n){return new RegExp(`^${ep(n)}$`)}function tp(n){let e=`${Qf}T${ep(n)}`;const r=[];return r.push(n.local?"Z?":"Z"),n.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Ew(n,e){return!!((e==="v4"||!e)&&ww.test(n)||(e==="v6"||!e)&&bw.test(n))}class hn extends Ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==se.string){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:se.string,received:l.parsedType}),ke}const o=new xt;let i;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="max")e.data.length>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,d=e.data.length<l.value;(c||d)&&(i=this._getOrReturnCtx(e,i),c?ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")yw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"email",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")Cc||(Cc=new RegExp(_w,"u")),Cc.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"emoji",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")hw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"uuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")mw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"nanoid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")uw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")fw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid2",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")pw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ulid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ie(i,{validation:"url",code:ee.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"regex",code:ee.invalid_string,message:l.message}),o.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?tp(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?xw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?vw(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?gw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"duration",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?Ew(e.data,l.version)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ip",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?kw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"base64",code:ee.invalid_string,message:l.message}),o.dirty()):Fe.assertNever(l);return{status:o.value,value:e.data}}_regex(e,r,o){return this.refinement(i=>e.test(i),{validation:r,code:ee.invalid_string,...fe.errToObj(o)})}_addCheck(e){return new hn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...fe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...fe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...fe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...fe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...fe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...fe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...fe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...fe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...fe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...fe.errToObj(e)})}datetime(e){var r,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:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...fe.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...fe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...fe.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...fe.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...fe.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...fe.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...fe.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...fe.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...fe.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...fe.errToObj(r)})}nonempty(e){return this.min(1,fe.errToObj(e))}trim(){return new hn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new hn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new hn({...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 r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}hn.create=n=>{var e;return new hn({checks:[],typeName:we.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...Be(n)})};function Cw(n,e){const r=(n.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=r>o?r:o,l=parseInt(n.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return l%c/Math.pow(10,i)}class br extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==se.number){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:se.number,received:l.parsedType}),ke}let o;const i=new xt;for(const l of this._def.checks)l.kind==="int"?Fe.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_type,expected:"integer",received:"float",message:l.message}),i.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="multipleOf"?Cw(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_finite,message:l.message}),i.dirty()):Fe.assertNever(l);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,fe.toString(r))}gt(e,r){return this.setLimit("min",e,!1,fe.toString(r))}lte(e,r){return this.setLimit("max",e,!0,fe.toString(r))}lt(e,r){return this.setLimit("max",e,!1,fe.toString(r))}setLimit(e,r,o,i){return new br({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new br({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:fe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:fe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Fe.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(r===null||o.value>r)&&(r=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(r)&&Number.isFinite(e)}}br.create=n=>new br({checks:[],typeName:we.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...Be(n)});class kr extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==se.bigint){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:se.bigint,received:l.parsedType}),ke}let o;const i=new xt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):Fe.assertNever(l);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,fe.toString(r))}gt(e,r){return this.setLimit("min",e,!1,fe.toString(r))}lte(e,r){return this.setLimit("max",e,!0,fe.toString(r))}lt(e,r){return this.setLimit("max",e,!1,fe.toString(r))}setLimit(e,r,o,i){return new kr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new kr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}kr.create=n=>{var e;return new kr({checks:[],typeName:we.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...Be(n)})};class Si extends Ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==se.boolean){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:se.boolean,received:o.parsedType}),ke}return Bt(e.data)}}Si.create=n=>new Si({typeName:we.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...Be(n)});class Jr extends Ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==se.date){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:se.date,received:l.parsedType}),ke}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_date}),ke}const o=new xt;let i;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Fe.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Jr({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:fe.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:fe.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Jr.create=n=>new Jr({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:we.ZodDate,...Be(n)});class es extends Ae{_parse(e){if(this._getType(e)!==se.symbol){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:se.symbol,received:o.parsedType}),ke}return Bt(e.data)}}es.create=n=>new es({typeName:we.ZodSymbol,...Be(n)});class Bi extends Ae{_parse(e){if(this._getType(e)!==se.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:se.undefined,received:o.parsedType}),ke}return Bt(e.data)}}Bi.create=n=>new Bi({typeName:we.ZodUndefined,...Be(n)});class Ti extends Ae{_parse(e){if(this._getType(e)!==se.null){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:se.null,received:o.parsedType}),ke}return Bt(e.data)}}Ti.create=n=>new Ti({typeName:we.ZodNull,...Be(n)});class Ao extends Ae{constructor(){super(...arguments),this._any=!0}_parse(e){return Bt(e.data)}}Ao.create=n=>new Ao({typeName:we.ZodAny,...Be(n)});class Qr extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Bt(e.data)}}Qr.create=n=>new Qr({typeName:we.ZodUnknown,...Be(n)});class nr extends Ae{_parse(e){const r=this._getOrReturnCtx(e);return ie(r,{code:ee.invalid_type,expected:se.never,received:r.parsedType}),ke}}nr.create=n=>new nr({typeName:we.ZodNever,...Be(n)});class ts extends Ae{_parse(e){if(this._getType(e)!==se.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:se.void,received:o.parsedType}),ke}return Bt(e.data)}}ts.create=n=>new ts({typeName:we.ZodVoid,...Be(n)});class mn extends Ae{_parse(e){const{ctx:r,status:o}=this._processInputParams(e),i=this._def;if(r.parsedType!==se.array)return ie(r,{code:ee.invalid_type,expected:se.array,received:r.parsedType}),ke;if(i.exactLength!==null){const c=r.data.length>i.exactLength.value,d=r.data.length<i.exactLength.value;(c||d)&&(ie(r,{code:c?ee.too_big:ee.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(ie(r,{code:ee.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(ie(r,{code:ee.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),r.common.async)return Promise.all([...r.data].map((c,d)=>i.type._parseAsync(new Zn(r,c,r.path,d)))).then(c=>xt.mergeArray(o,c));const l=[...r.data].map((c,d)=>i.type._parseSync(new Zn(r,c,r.path,d)));return xt.mergeArray(o,l)}get element(){return this._def.type}min(e,r){return new mn({...this._def,minLength:{value:e,message:fe.toString(r)}})}max(e,r){return new mn({...this._def,maxLength:{value:e,message:fe.toString(r)}})}length(e,r){return new mn({...this._def,exactLength:{value:e,message:fe.toString(r)}})}nonempty(e){return this.min(1,e)}}mn.create=(n,e)=>new mn({type:n,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Be(e)});function $o(n){if(n instanceof tt){const e={};for(const r in n.shape){const o=n.shape[r];e[r]=Un.create($o(o))}return new tt({...n._def,shape:()=>e})}else return n instanceof mn?new mn({...n._def,type:$o(n.element)}):n instanceof Un?Un.create($o(n.unwrap())):n instanceof vr?vr.create($o(n.unwrap())):n instanceof jn?jn.create(n.items.map(e=>$o(e))):n}class tt extends Ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=Fe.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==se.object){const p=this._getOrReturnCtx(e);return ie(p,{code:ee.invalid_type,expected:se.object,received:p.parsedType}),ke}const{status:o,ctx:i}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof nr&&this._def.unknownKeys==="strip"))for(const p in i.data)c.includes(p)||d.push(p);const u=[];for(const p of c){const h=l[p],g=i.data[p];u.push({key:{status:"valid",value:p},value:h._parse(new Zn(i,g,i.path,p)),alwaysSet:p in i.data})}if(this._def.catchall instanceof nr){const p=this._def.unknownKeys;if(p==="passthrough")for(const h of d)u.push({key:{status:"valid",value:h},value:{status:"valid",value:i.data[h]}});else if(p==="strict")d.length>0&&(ie(i,{code:ee.unrecognized_keys,keys:d}),o.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const h of d){const g=i.data[h];u.push({key:{status:"valid",value:h},value:p._parse(new Zn(i,g,i.path,h)),alwaysSet:h in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const p=[];for(const h of u){const g=await h.key,_=await h.value;p.push({key:g,value:_,alwaysSet:h.alwaysSet})}return p}).then(p=>xt.mergeObjectSync(o,p)):xt.mergeObjectSync(o,u)}get shape(){return this._def.shape()}strict(e){return fe.errToObj,new tt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,o)=>{var i,l,c,d;const u=(c=(l=(i=this._def).errorMap)===null||l===void 0?void 0:l.call(i,r,o).message)!==null&&c!==void 0?c:o.defaultError;return r.code==="unrecognized_keys"?{message:(d=fe.errToObj(e).message)!==null&&d!==void 0?d:u}:{message:u}}}:{}})}strip(){return new tt({...this._def,unknownKeys:"strip"})}passthrough(){return new tt({...this._def,unknownKeys:"passthrough"})}extend(e){return new tt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new tt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:we.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new tt({...this._def,catchall:e})}pick(e){const r={};return Fe.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(r[o]=this.shape[o])}),new tt({...this._def,shape:()=>r})}omit(e){const r={};return Fe.objectKeys(this.shape).forEach(o=>{e[o]||(r[o]=this.shape[o])}),new tt({...this._def,shape:()=>r})}deepPartial(){return $o(this)}partial(e){const r={};return Fe.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?r[o]=i:r[o]=i.optional()}),new tt({...this._def,shape:()=>r})}required(e){const r={};return Fe.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])r[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof Un;)l=l._def.innerType;r[o]=l}}),new tt({...this._def,shape:()=>r})}keyof(){return np(Fe.objectKeys(this.shape))}}tt.create=(n,e)=>new tt({shape:()=>n,unknownKeys:"strip",catchall:nr.create(),typeName:we.ZodObject,...Be(e)}),tt.strictCreate=(n,e)=>new tt({shape:()=>n,unknownKeys:"strict",catchall:nr.create(),typeName:we.ZodObject,...Be(e)}),tt.lazycreate=(n,e)=>new tt({shape:n,unknownKeys:"strip",catchall:nr.create(),typeName:we.ZodObject,...Be(e)});class Vi extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e),o=this._def.options;function i(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return r.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new Ht(d.ctx.common.issues));return ie(r,{code:ee.invalid_union,unionErrors:c}),ke}if(r.common.async)return Promise.all(o.map(async l=>{const c={...r,common:{...r.common,issues:[]},parent:null};return{result:await l._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(i);{let l;const c=[];for(const u of o){const p={...r,common:{...r.common,issues:[]},parent:null},h=u._parseSync({data:r.data,path:r.path,parent:p});if(h.status==="valid")return h;h.status==="dirty"&&!l&&(l={result:h,ctx:p}),p.common.issues.length&&c.push(p.common.issues)}if(l)return r.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(u=>new Ht(u));return ie(r,{code:ee.invalid_union,unionErrors:d}),ke}}get options(){return this._def.options}}Vi.create=(n,e)=>new Vi({options:n,typeName:we.ZodUnion,...Be(e)});const rr=n=>n instanceof Ri?rr(n.schema):n instanceof gn?rr(n.innerType()):n instanceof Oi?[n.value]:n instanceof xr?n.options:n instanceof Ii?Fe.objectValues(n.enum):n instanceof Di?rr(n._def.innerType):n instanceof Bi?[void 0]:n instanceof Ti?[null]:n instanceof Un?[void 0,...rr(n.unwrap())]:n instanceof vr?[null,...rr(n.unwrap())]:n instanceof Sc||n instanceof Pi?rr(n.unwrap()):n instanceof Mi?rr(n._def.innerType):[];class ns extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==se.object)return ie(r,{code:ee.invalid_type,expected:se.object,received:r.parsedType}),ke;const o=this.discriminator,i=r.data[o],l=this.optionsMap.get(i);return l?r.common.async?l._parseAsync({data:r.data,path:r.path,parent:r}):l._parseSync({data:r.data,path:r.path,parent:r}):(ie(r,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),ke)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,o){const i=new Map;for(const l of r){const c=rr(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,l)}}return new ns({typeName:we.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Be(o)})}}function Nc(n,e){const r=wr(n),o=wr(e);if(n===e)return{valid:!0,data:n};if(r===se.object&&o===se.object){const i=Fe.objectKeys(e),l=Fe.objectKeys(n).filter(d=>i.indexOf(d)!==-1),c={...n,...e};for(const d of l){const u=Nc(n[d],e[d]);if(!u.valid)return{valid:!1};c[d]=u.data}return{valid:!0,data:c}}else if(r===se.array&&o===se.array){if(n.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<n.length;l++){const c=n[l],d=e[l],u=Nc(c,d);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===se.date&&o===se.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class Ai extends Ae{_parse(e){const{status:r,ctx:o}=this._processInputParams(e),i=(l,c)=>{if(vc(l)||vc(c))return ke;const d=Nc(l.value,c.value);return d.valid?((Ec(l)||Ec(c))&&r.dirty(),{status:r.value,value:d.data}):(ie(o,{code:ee.invalid_intersection_types}),ke)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,c])=>i(l,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Ai.create=(n,e,r)=>new Ai({left:n,right:e,typeName:we.ZodIntersection,...Be(r)});class jn extends Ae{_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==se.array)return ie(o,{code:ee.invalid_type,expected:se.array,received:o.parsedType}),ke;if(o.data.length<this._def.items.length)return ie(o,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ke;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const l=[...o.data].map((c,d)=>{const u=this._def.items[d]||this._def.rest;return u?u._parse(new Zn(o,c,o.path,d)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>xt.mergeArray(r,c)):xt.mergeArray(r,l)}get items(){return this._def.items}rest(e){return new jn({...this._def,rest:e})}}jn.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new jn({items:n,typeName:we.ZodTuple,rest:null,...Be(e)})};class $i extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==se.object)return ie(o,{code:ee.invalid_type,expected:se.object,received:o.parsedType}),ke;const i=[],l=this._def.keyType,c=this._def.valueType;for(const d in o.data)i.push({key:l._parse(new Zn(o,d,o.path,d)),value:c._parse(new Zn(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?xt.mergeObjectAsync(r,i):xt.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,o){return r instanceof Ae?new $i({keyType:e,valueType:r,typeName:we.ZodRecord,...Be(o)}):new $i({keyType:hn.create(),valueType:e,typeName:we.ZodRecord,...Be(r)})}}class rs extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==se.map)return ie(o,{code:ee.invalid_type,expected:se.map,received:o.parsedType}),ke;const i=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([d,u],p)=>({key:i._parse(new Zn(o,d,o.path,[p,"key"])),value:l._parse(new Zn(o,u,o.path,[p,"value"]))}));if(o.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const u of c){const p=await u.key,h=await u.value;if(p.status==="aborted"||h.status==="aborted")return ke;(p.status==="dirty"||h.status==="dirty")&&r.dirty(),d.set(p.value,h.value)}return{status:r.value,value:d}})}else{const d=new Map;for(const u of c){const p=u.key,h=u.value;if(p.status==="aborted"||h.status==="aborted")return ke;(p.status==="dirty"||h.status==="dirty")&&r.dirty(),d.set(p.value,h.value)}return{status:r.value,value:d}}}}rs.create=(n,e,r)=>new rs({valueType:e,keyType:n,typeName:we.ZodMap,...Be(r)});class eo extends Ae{_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==se.set)return ie(o,{code:ee.invalid_type,expected:se.set,received:o.parsedType}),ke;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(ie(o,{code:ee.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(ie(o,{code:ee.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const l=this._def.valueType;function c(u){const p=new Set;for(const h of u){if(h.status==="aborted")return ke;h.status==="dirty"&&r.dirty(),p.add(h.value)}return{status:r.value,value:p}}const d=[...o.data.values()].map((u,p)=>l._parse(new Zn(o,u,o.path,p)));return o.common.async?Promise.all(d).then(u=>c(u)):c(d)}min(e,r){return new eo({...this._def,minSize:{value:e,message:fe.toString(r)}})}max(e,r){return new eo({...this._def,maxSize:{value:e,message:fe.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}eo.create=(n,e)=>new eo({valueType:n,minSize:null,maxSize:null,typeName:we.ZodSet,...Be(e)});class Ro extends Ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==se.function)return ie(r,{code:ee.invalid_type,expected:se.function,received:r.parsedType}),ke;function o(d,u){return Ja({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ya(),To].filter(p=>!!p),issueData:{code:ee.invalid_arguments,argumentsError:u}})}function i(d,u){return Ja({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ya(),To].filter(p=>!!p),issueData:{code:ee.invalid_return_type,returnTypeError:u}})}const l={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof Oo){const d=this;return Bt(async function(...u){const p=new Ht([]),h=await d._def.args.parseAsync(u,l).catch(w=>{throw p.addIssue(o(u,w)),p}),g=await Reflect.apply(c,this,h);return await d._def.returns._def.type.parseAsync(g,l).catch(w=>{throw p.addIssue(i(g,w)),p})})}else{const d=this;return Bt(function(...u){const p=d._def.args.safeParse(u,l);if(!p.success)throw new Ht([o(u,p.error)]);const h=Reflect.apply(c,this,p.data),g=d._def.returns.safeParse(h,l);if(!g.success)throw new Ht([i(h,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ro({...this._def,args:jn.create(e).rest(Qr.create())})}returns(e){return new Ro({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,o){return new Ro({args:e||jn.create([]).rest(Qr.create()),returns:r||Qr.create(),typeName:we.ZodFunction,...Be(o)})}}class Ri extends Ae{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Ri.create=(n,e)=>new Ri({getter:n,typeName:we.ZodLazy,...Be(e)});class Oi extends Ae{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return ie(r,{received:r.data,code:ee.invalid_literal,expected:this._def.value}),ke}return{status:"valid",value:e.data}}get value(){return this._def.value}}Oi.create=(n,e)=>new Oi({value:n,typeName:we.ZodLiteral,...Be(e)});function np(n,e){return new xr({values:n,typeName:we.ZodEnum,...Be(e)})}class xr extends Ae{constructor(){super(...arguments),Ci.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),o=this._def.values;return ie(r,{expected:Fe.joinValues(o),received:r.parsedType,code:ee.invalid_type}),ke}if(Qa(this,Ci)||Yf(this,Ci,new Set(this._def.values)),!Qa(this,Ci).has(e.data)){const r=this._getOrReturnCtx(e),o=this._def.values;return ie(r,{received:r.data,code:ee.invalid_enum_value,options:o}),ke}return Bt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return xr.create(e,{...this._def,...r})}exclude(e,r=this._def){return xr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...r})}}Ci=new WeakMap,xr.create=np;class Ii extends Ae{constructor(){super(...arguments),Ni.set(this,void 0)}_parse(e){const r=Fe.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==se.string&&o.parsedType!==se.number){const i=Fe.objectValues(r);return ie(o,{expected:Fe.joinValues(i),received:o.parsedType,code:ee.invalid_type}),ke}if(Qa(this,Ni)||Yf(this,Ni,new Set(Fe.getValidEnumValues(this._def.values))),!Qa(this,Ni).has(e.data)){const i=Fe.objectValues(r);return ie(o,{received:o.data,code:ee.invalid_enum_value,options:i}),ke}return Bt(e.data)}get enum(){return this._def.values}}Ni=new WeakMap,Ii.create=(n,e)=>new Ii({values:n,typeName:we.ZodNativeEnum,...Be(e)});class Oo extends Ae{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==se.promise&&r.common.async===!1)return ie(r,{code:ee.invalid_type,expected:se.promise,received:r.parsedType}),ke;const o=r.parsedType===se.promise?r.data:Promise.resolve(r.data);return Bt(o.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Oo.create=(n,e)=>new Oo({type:n,typeName:we.ZodPromise,...Be(e)});class gn extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:o}=this._processInputParams(e),i=this._def.effect||null,l={addIssue:c=>{ie(o,c),c.fatal?r.abort():r.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const c=i.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async d=>{if(r.value==="aborted")return ke;const u=await this._def.schema._parseAsync({data:d,path:o.path,parent:o});return u.status==="aborted"?ke:u.status==="dirty"||r.value==="dirty"?Vo(u.value):u});{if(r.value==="aborted")return ke;const d=this._def.schema._parseSync({data:c,path:o.path,parent:o});return d.status==="aborted"?ke:d.status==="dirty"||r.value==="dirty"?Vo(d.value):d}}if(i.type==="refinement"){const c=d=>{const u=i.refinement(d,l);if(o.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?ke:(d.status==="dirty"&&r.dirty(),c(d.value),{status:r.value,value:d.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>d.status==="aborted"?ke:(d.status==="dirty"&&r.dirty(),c(d.value).then(()=>({status:r.value,value:d.value}))))}if(i.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!vi(c))return c;const d=i.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:d}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>vi(c)?Promise.resolve(i.transform(c.value,l)).then(d=>({status:r.value,value:d})):c);Fe.assertNever(i)}}gn.create=(n,e,r)=>new gn({schema:n,typeName:we.ZodEffects,effect:e,...Be(r)}),gn.createWithPreprocess=(n,e,r)=>new gn({schema:e,effect:{type:"preprocess",transform:n},typeName:we.ZodEffects,...Be(r)});class Un extends Ae{_parse(e){return this._getType(e)===se.undefined?Bt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Un.create=(n,e)=>new Un({innerType:n,typeName:we.ZodOptional,...Be(e)});class vr extends Ae{_parse(e){return this._getType(e)===se.null?Bt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}vr.create=(n,e)=>new vr({innerType:n,typeName:we.ZodNullable,...Be(e)});class Di extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e);let o=r.data;return r.parsedType===se.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Di.create=(n,e)=>new Di({innerType:n,typeName:we.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Be(e)});class Mi extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e),o={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Ei(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ht(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ht(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Mi.create=(n,e)=>new Mi({innerType:n,typeName:we.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Be(e)});class os extends Ae{_parse(e){if(this._getType(e)!==se.nan){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:se.nan,received:o.parsedType}),ke}return{status:"valid",value:e.data}}}os.create=n=>new os({typeName:we.ZodNaN,...Be(n)});const Nw=Symbol("zod_brand");class Sc extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e),o=r.data;return this._def.type._parse({data:o,path:r.path,parent:r})}unwrap(){return this._def.type}}class Li extends Ae{_parse(e){const{status:r,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"?ke:l.status==="dirty"?(r.dirty(),Vo(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?ke:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,r){return new Li({in:e,out:r,typeName:we.ZodPipeline})}}class Pi extends Ae{_parse(e){const r=this._def.innerType._parse(e),o=i=>(vi(i)&&(i.value=Object.freeze(i.value)),i);return Ei(r)?r.then(i=>o(i)):o(r)}unwrap(){return this._def.innerType}}Pi.create=(n,e)=>new Pi({innerType:n,typeName:we.ZodReadonly,...Be(e)});function rp(n,e={},r){return n?Ao.create().superRefine((o,i)=>{var l,c;if(!n(o)){const d=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,u=(c=(l=d.fatal)!==null&&l!==void 0?l:r)!==null&&c!==void 0?c:!0,p=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...p,fatal:u})}}):Ao.create()}const Sw={object:tt.lazycreate};var we;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(we||(we={}));const Bw=(n,e={message:`Input not instance of ${n.name}`})=>rp(r=>r instanceof n,e),op=hn.create,ip=br.create,Tw=os.create,Vw=kr.create,ap=Si.create,Aw=Jr.create,$w=es.create,Rw=Bi.create,Ow=Ti.create,Iw=Ao.create,Dw=Qr.create,Mw=nr.create,Lw=ts.create,Pw=mn.create,Fw=tt.create,zw=tt.strictCreate,Zw=Vi.create,jw=ns.create,Uw=Ai.create,Ww=jn.create,Hw=$i.create,qw=rs.create,Gw=eo.create,Kw=Ro.create,Xw=Ri.create,Yw=Oi.create,Jw=xr.create,Qw=Ii.create,e1=Oo.create,sp=gn.create,t1=Un.create,n1=vr.create,r1=gn.createWithPreprocess,o1=Li.create;var yn=Object.freeze({__proto__:null,defaultErrorMap:To,setErrorMap:cw,getErrorMap:Ya,makeIssue:Ja,EMPTY_PATH:dw,addIssueToContext:ie,ParseStatus:xt,INVALID:ke,DIRTY:Vo,OK:Bt,isAborted:vc,isDirty:Ec,isValid:vi,isAsync:Ei,get util(){return Fe},get objectUtil(){return xc},ZodParsedType:se,getParsedType:wr,ZodType:Ae,datetimeRegex:tp,ZodString:hn,ZodNumber:br,ZodBigInt:kr,ZodBoolean:Si,ZodDate:Jr,ZodSymbol:es,ZodUndefined:Bi,ZodNull:Ti,ZodAny:Ao,ZodUnknown:Qr,ZodNever:nr,ZodVoid:ts,ZodArray:mn,ZodObject:tt,ZodUnion:Vi,ZodDiscriminatedUnion:ns,ZodIntersection:Ai,ZodTuple:jn,ZodRecord:$i,ZodMap:rs,ZodSet:eo,ZodFunction:Ro,ZodLazy:Ri,ZodLiteral:Oi,ZodEnum:xr,ZodNativeEnum:Ii,ZodPromise:Oo,ZodEffects:gn,ZodTransformer:gn,ZodOptional:Un,ZodNullable:vr,ZodDefault:Di,ZodCatch:Mi,ZodNaN:os,BRAND:Nw,ZodBranded:Sc,ZodPipeline:Li,ZodReadonly:Pi,custom:rp,Schema:Ae,ZodSchema:Ae,late:Sw,get ZodFirstPartyTypeKind(){return we},coerce:{string:n=>hn.create({...n,coerce:!0}),number:n=>br.create({...n,coerce:!0}),boolean:n=>Si.create({...n,coerce:!0}),bigint:n=>kr.create({...n,coerce:!0}),date:n=>Jr.create({...n,coerce:!0})},any:Iw,array:Pw,bigint:Vw,boolean:ap,date:Aw,discriminatedUnion:jw,effect:sp,enum:Jw,function:Kw,instanceof:Bw,intersection:Uw,lazy:Xw,literal:Yw,map:qw,nan:Tw,nativeEnum:Qw,never:Mw,null:Ow,nullable:n1,number:ip,object:Fw,oboolean:()=>ap().optional(),onumber:()=>ip().optional(),optional:t1,ostring:()=>op().optional(),pipeline:o1,preprocess:r1,promise:e1,record:Hw,set:Gw,strictObject:zw,string:op,symbol:$w,transformer:sp,tuple:Ww,undefined:Rw,union:Zw,unknown:Dw,void:Lw,NEVER:ke,ZodIssueCode:ee,quotelessJson:lw,ZodError:Ht});const i1=-2147483648,lp=-9007199254740991n,a1=NaN,s1=NaN,l1=null,c1=null;function d1(n,e){switch(e){case"Int":return n===i1;case"Long":return n===Number(lp)||n===lp;case"Float":return n===a1;case"Double":return n===s1;case"String":return n===l1;case"Bytes":return n===c1;default:throw Error(`unsupported data type: ${e}`)}}function u1(n,e){const r=Math.floor(e/8),o=1<<7-e%8;return(n[r]&o)>0}const f1={type:"absent"},cp=null;function p1(n){return typeof n=="object"&&n!==null&&n.type==="absent"}function is(n,e,r={}){if(u1(n.absent,e))return r.absent===void 0?f1:r.absent;const o=n.data[e],i=n.type;if(d1(o,i))return r.na===void 0?cp:r.na;switch(i){case"Int":return o;case"Long":return Number(o);case"Float":return o;case"Double":return o;case"String":return o;case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${i}`)}}function Io(n){const{type:e,name:r,domain:o}=n;return{type:e,name:r,...o&&{domain:o}}}yn.object({__isRef:yn.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:yn.string().describe("Upstream block id"),name:yn.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(),yn.string().length(24).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");function h1(n){if(n&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(n);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const m1=yn.object({type:yn.string(),importance:yn.number().optional(),id:yn.string().optional(),label:yn.string()});yn.array(m1);const g1="1.25.0";function as(){return h1({sdkVersion:g1})}function y1(n){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(n)}const _1=`.ag-header {
|
|
3
|
+
`)}}function Z_(n){return{ok:!0,value:n}}function Wf(n){if(!n)throw new uc;if(!n.ok)throw new Xa(n.errors);return n.value}function Hf(n){return{value:n,errors:void 0}}function j_(n){if(n.errors)throw new Xa(n.errors);if(!n.value)throw new uc;return n.value}function U_(n){return n!==void 0}const fc=n=>n,pc=n=>n instanceof Error?n:Error(String(n)),hc=n=>n.name==="ZodError",mc=n=>{const{formErrors:e,fieldErrors:r}=n.flatten(),o=Object.entries(r).map(([i,l])=>i+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function gc(n){const e=n.validate??fc,{autoSave:r}=n,o=t.ref(),i=t.ref(),l=x=>{i.value={model:zn(x)}};t.watch(()=>n.get(),x=>l(x),{immediate:!0});const c=()=>{var x;n.onSave(e(zn((x=i.value)==null?void 0:x.model)))},d=()=>{l(n.get()),o.value=void 0},u=x=>{const C=pc(x);hc(C)?o.value=Error(mc(C)):o.value=C},p=x=>{o.value=void 0;try{e(x),r&&c()}catch(C){u(C)}},h=t.computed({get:()=>{var x;return(x=i.value)==null?void 0:x.model},set(x){l(x),p(x)}});t.watch(i,(x,C)=>{x&&x===C&&p(x.model)},{deep:!0});const g=t.computed(()=>!o.value),_=t.computed(()=>!Wt(n.get(),t.unref(i))),w=t.computed(()=>o.value?o.value.message:"");return t.reactive({model:h,valid:g,isChanged:_,error:o,errorString:w,save:c,revert:d,setError:u})}function W_(n,e,r){const o=n.validate??fc,{autoSave:i}=n,l=t.ref(),c=t.ref(),d=R=>{var P;if(r.deepPatchModel){const j=(P=c.value)==null?void 0:P.model,B=Object.assign(zn(R),e??{});c.value={model:j?Uf(j,B):B,stage:Symbol()}}else c.value={model:Object.assign(zn(R),e??{}),stage:Symbol()}};t.watch(()=>n.get(),R=>d(R),{immediate:!0});const u=()=>{var R;n.onSave(o(zn((R=c.value)==null?void 0:R.model)))},p=()=>{d(n.get()),l.value=void 0},h=R=>{const P=pc(R);hc(P)?l.value=Error(mc(P)):l.value=P},g=R=>{l.value=void 0;try{o(R),i&&u()}catch(P){h(P)}},_=t.computed({get:()=>{var R;return(R=c.value)==null?void 0:R.model},set(){throw Error("Cannot replace base model")}});t.watch([()=>({args:_.value.args,ui:_.value.ui}),()=>{var R;return(R=c.value)==null?void 0:R.stage}],([R,P],[j,B])=>{P===B&&g(R)},{deep:!0});const w=t.computed(()=>!l.value),x=t.computed(()=>{var j;const{args:R,ui:P}=((j=t.unref(c))==null?void 0:j.model)??{};return!Wt(n.get(),{args:R,ui:P})}),C=t.computed(()=>l.value?l.value.message:"");return t.reactive({model:_,valid:w,isChanged:x,error:l,errorString:C,save:u,revert:p,setError:h})}const H_=n=>Object.fromEntries(new URL(n,"http://dummy").searchParams);function yc(n){return t.getCurrentScope()?(t.onScopeDispose(n),!0):!1}const q_=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const G_=n=>n!=null,K_=Object.prototype.toString,X_=n=>K_.call(n)==="[object Object]",_c=()=>{};function Y_(n,e){function r(...o){return new Promise((i,l)=>{Promise.resolve(n(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(i).catch(l)})}return r}function J_(n,e={}){let r,o,i=_c;const l=d=>{clearTimeout(d),i(),i=_c};return d=>{const u=t.toValue(n),p=t.toValue(e.maxWait);return r&&l(r),u<=0||p!==void 0&&p<=0?(o&&(l(o),o=null),Promise.resolve(d())):new Promise((h,g)=>{i=e.rejectOnCancel?g:h,p&&!o&&(o=setTimeout(()=>{r&&l(r),o=null,h(d())},p)),r=setTimeout(()=>{o&&l(o),o=null,h(d())},u)})}}function Q_(n){return t.getCurrentInstance()}function wc(n){return Array.isArray(n)?n:[n]}function bc(n,e=200,r={}){return Y_(J_(e,r),n)}function ew(n,e=!0,r){Q_()?t.onMounted(n,r):e?n():t.nextTick(n)}function tw(n,e,r){return t.watch(n,(i,l,c)=>{i&&e(i,l,c)},{...r,once:!1})}const kc=q_?window:void 0;function Bo(n){var e;const r=t.toValue(n);return(e=r==null?void 0:r.$el)!=null?e:r}function qf(...n){let e,r,o,i;if(typeof n[0]=="string"||Array.isArray(n[0])?([r,o,i]=n,e=kc):[e,r,o,i]=n,!e)return _c;r=wc(r),o=wc(o);const l=[],c=()=>{l.forEach(h=>h()),l.length=0},d=(h,g,_,w)=>(h.addEventListener(g,_,w),()=>h.removeEventListener(g,_,w)),u=t.watch(()=>[Bo(e),t.toValue(i)],([h,g])=>{if(c(),!h)return;const _=X_(g)?{...g}:g;l.push(...r.flatMap(w=>o.map(x=>d(h,w,x,_))))},{immediate:!0,flush:"post"}),p=()=>{u(),c()};return yc(p),p}function nw(){const n=t.ref(!1),e=t.getCurrentInstance();return e&&t.onMounted(()=>{n.value=!0},e),n}function Gf(n){const e=nw();return t.computed(()=>(e.value,!!n()))}function rw(n,e,r={}){const{window:o=kc,...i}=r;let l;const c=Gf(()=>o&&"MutationObserver"in o),d=()=>{l&&(l.disconnect(),l=void 0)},u=t.computed(()=>{const _=t.toValue(n),w=wc(_).map(Bo).filter(G_);return new Set(w)}),p=t.watch(()=>u.value,_=>{d(),c.value&&_.size&&(l=new MutationObserver(e),_.forEach(w=>l.observe(w,i)))},{immediate:!0,flush:"post"}),h=()=>l==null?void 0:l.takeRecords(),g=()=>{p(),d()};return yc(g),{isSupported:c,stop:g,takeRecords:h}}function ow(n,e,r={}){const{window:o=kc,...i}=r;let l;const c=Gf(()=>o&&"ResizeObserver"in o),d=()=>{l&&(l.disconnect(),l=void 0)},u=t.computed(()=>{const g=t.toValue(n);return Array.isArray(g)?g.map(_=>Bo(_)):[Bo(g)]}),p=t.watch(u,g=>{if(d(),c.value&&o){l=new ResizeObserver(e);for(const _ of g)_&&l.observe(_,i)}},{immediate:!0,flush:"post"}),h=()=>{d(),p()};return yc(h),{isSupported:c,stop:h}}function iw(n,e={}){const{reset:r=!0,windowResize:o=!0,windowScroll:i=!0,immediate:l=!0,updateTiming:c="sync"}=e,d=t.ref(0),u=t.ref(0),p=t.ref(0),h=t.ref(0),g=t.ref(0),_=t.ref(0),w=t.ref(0),x=t.ref(0);function C(){const P=Bo(n);if(!P){r&&(d.value=0,u.value=0,p.value=0,h.value=0,g.value=0,_.value=0,w.value=0,x.value=0);return}const j=P.getBoundingClientRect();d.value=j.height,u.value=j.bottom,p.value=j.left,h.value=j.right,g.value=j.top,_.value=j.width,w.value=j.x,x.value=j.y}function R(){c==="sync"?C():c==="next-frame"&&requestAnimationFrame(()=>C())}return ow(n,R),t.watch(()=>Bo(n),P=>!P&&R()),rw(n,R,{attributeFilter:["style","class"]}),i&&qf("scroll",R,{capture:!0,passive:!0}),o&&qf("resize",R,{passive:!0}),ew(()=>{l&&R()}),{height:d,bottom:u,left:p,right:h,top:g,width:_,x:w,y:x,update:R}}function aw(n,e,r){const o=(j,...B)=>{r.debug&&console.log(`%c>>> %c${j}`,"color: orange; font-weight: bold","color: orange",...B)},i=t.reactive({args:Object.freeze(n.args),outputs:Object.freeze(n.outputs),ui:Object.freeze(n.ui),navigationState:Object.freeze(n.navigationState)}),l=r.debounceSpan??100,c=r.debounceMaxWait??1e3,d=bc(j=>{Wt(j,i.args)||e.setBlockArgs(j)},l,{maxWait:c}),u=bc(j=>{Wt(j,i.ui)||e.setBlockUiState(j)},l,{maxWait:c}),p=bc((j,B)=>{(!Wt(j,i.args)||!Wt(B,i.ui))&&e.setBlockArgsAndUiState(j,B)},l,{maxWait:c});e.onStateUpdates(async j=>{j.forEach(B=>{B.key==="args"&&!Wt(i.args,B.value)&&(i.args=Object.freeze(B.value),o("args patch",i.args)),B.key==="ui"&&!Wt(i.ui,B.value)&&(i.ui=Object.freeze(B.value),o("ui patch",i.ui)),B.key==="outputs"&&!Wt(i.outputs,B.value)&&(i.outputs=Object.freeze(B.value),o("outputs patch",i.outputs)),B.key==="navigationState"&&!Wt(i.navigationState,B.value)&&(i.navigationState=Object.freeze(B.value),o("navigationState patch",i.navigationState))}),await t.nextTick()});const h=()=>zn(i.args),g=()=>zn(i.ui),_=()=>zn(i.navigationState),w={createArgsModel(j={}){return gc({get(){return j.transform?j.transform(i.args):i.args},validate:j.validate,autoSave:!0,onSave(B){d(B)}})},createUiModel(j={},B){return gc({get(){return j.transform?j.transform(i.ui):i.ui??B()},validate:j.validate,autoSave:!0,onSave(W){u(W)}})},useOutputs(...j){const B=t.reactive({errors:void 0,value:void 0});return t.watch(()=>i.outputs,()=>{try{Object.assign(B,{value:this.unwrapOutputs(...j),errors:void 0})}catch(W){Object.assign(B,{value:void 0,errors:[String(W)]})}},{immediate:!0,deep:!0}),B},unwrapOutputs(...j){const B=i.outputs,W=j.map(S=>[S,Wf(B[S])]);return Object.fromEntries(W)},updateArgs(j){const B=h();return j(B),e.setBlockArgs(B)},updateUiState(j){const B=g();return e.setBlockUiState(j(B))},updateNavigationState(j){const B=_();return j(B),e.setNavigationState(B)},navigateTo(j){const B=_();return B.href=j,e.setNavigationState(B)}},x=t.computed(()=>{const j=Object.entries(i.outputs).map(([B,W])=>[B,W.ok&&W.value!==void 0?W.value:void 0]);return Object.fromEntries(j)}),C=t.computed(()=>{const j=Object.entries(i.outputs).map(([B,W])=>[B,W&&!W.ok?new Xa(W.errors):void 0]);return Object.fromEntries(j)}),R={snapshot:i,queryParams:t.computed(()=>H_(i.navigationState.href)),href:t.computed(()=>i.navigationState.href),hasErrors:t.computed(()=>Object.values(i.outputs).some(j=>!(j!=null&&j.ok)))},P=W_({get(){return{args:i.args,ui:i.ui}},autoSave:!0,onSave(j){p(j.args,j.ui)}},{outputs:x,outputErrors:C},r);return t.reactive(Object.assign(P,w,R))}var xi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kf(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var sw=function n(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?n(e.toJSON()):Array.isArray(e)?`[${e.reduce((i,l,c)=>`${i}${c===0?"":","}${n(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((o,i)=>{if(e[i]===void 0||typeof e[i]=="symbol")return o;const l=o.length===0?"":",";return`${o}${l}${n(i)}:${n(e[i])}`},"")}}`};const Yr=Kf(sw);var Fe;(function(n){n.assertEqual=i=>i;function e(i){}n.assertIs=e;function r(i){throw new Error}n.assertNever=r,n.arrayToEnum=i=>{const l={};for(const c of i)l[c]=c;return l},n.getValidEnumValues=i=>{const l=n.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(const d of l)c[d]=i[d];return n.objectValues(c)},n.objectValues=i=>n.objectKeys(i).map(function(l){return i[l]}),n.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const l=[];for(const c in i)Object.prototype.hasOwnProperty.call(i,c)&&l.push(c);return l},n.find=(i,l)=>{for(const c of i)if(l(c))return c},n.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,l=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}n.joinValues=o,n.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})(Fe||(Fe={}));var xc;(function(n){n.mergeShapes=(e,r)=>({...e,...r})})(xc||(xc={}));const se=Fe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wr=n=>{switch(typeof n){case"undefined":return se.undefined;case"string":return se.string;case"number":return isNaN(n)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(n)?se.array:n===null?se.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?se.promise:typeof Map<"u"&&n instanceof Map?se.map:typeof Set<"u"&&n instanceof Set?se.set:typeof Date<"u"&&n instanceof Date?se.date:se.object;default:return se.unknown}},ee=Fe.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"]),lw=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class Ht extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const r=e||function(l){return l.message},o={_errors:[]},i=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(r(c));else{let d=o,u=0;for(;u<c.path.length;){const p=c.path[u];u===c.path.length-1?(d[p]=d[p]||{_errors:[]},d[p]._errors.push(r(c))):d[p]=d[p]||{_errors:[]},d=d[p],u++}}};return i(this),o}static assert(e){if(!(e instanceof Ht))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Fe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},o=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:r}}get formErrors(){return this.flatten()}}Ht.create=n=>new Ht(n);const To=(n,e)=>{let r;switch(n.code){case ee.invalid_type:n.received===se.undefined?r="Required":r=`Expected ${n.expected}, received ${n.received}`;break;case ee.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(n.expected,Fe.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:r=`Unrecognized key(s) in object: ${Fe.joinValues(n.keys,", ")}`;break;case ee.invalid_union:r="Invalid input";break;case ee.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Fe.joinValues(n.options)}`;break;case ee.invalid_enum_value:r=`Invalid enum value. Expected ${Fe.joinValues(n.options)}, received '${n.received}'`;break;case ee.invalid_arguments:r="Invalid function arguments";break;case ee.invalid_return_type:r="Invalid function return type";break;case ee.invalid_date:r="Invalid date";break;case ee.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(r=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?r=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?r=`Invalid input: must end with "${n.validation.endsWith}"`:Fe.assertNever(n.validation):n.validation!=="regex"?r=`Invalid ${n.validation}`:r="Invalid";break;case ee.too_small:n.type==="array"?r=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?r=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?r=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?r=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:r="Invalid input";break;case ee.too_big:n.type==="array"?r=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?r=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?r=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?r=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?r=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:r="Invalid input";break;case ee.custom:r="Invalid input";break;case ee.invalid_intersection_types:r="Intersection results could not be merged";break;case ee.not_multiple_of:r=`Number must be a multiple of ${n.multipleOf}`;break;case ee.not_finite:r="Number must be finite";break;default:r=e.defaultError,Fe.assertNever(n)}return{message:r}};let Xf=To;function cw(n){Xf=n}function Ya(){return Xf}const Ja=n=>{const{data:e,path:r,errorMaps:o,issueData:i}=n,l=[...r,...i.path||[]],c={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let d="";const u=o.filter(p=>!!p).slice().reverse();for(const p of u)d=p(c,{data:e,defaultError:d}).message;return{...i,path:l,message:d}},dw=[];function ie(n,e){const r=Ya(),o=Ja({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,r,r===To?void 0:To].filter(i=>!!i)});n.common.issues.push(o)}class xt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const o=[];for(const i of r){if(i.status==="aborted")return ke;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,r){const o=[];for(const i of r){const l=await i.key,c=await i.value;o.push({key:l,value:c})}return xt.mergeObjectSync(e,o)}static mergeObjectSync(e,r){const o={};for(const i of r){const{key:l,value:c}=i;if(l.status==="aborted"||c.status==="aborted")return ke;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const ke=Object.freeze({status:"aborted"}),Vo=n=>({status:"dirty",value:n}),Bt=n=>({status:"valid",value:n}),vc=n=>n.status==="aborted",Ec=n=>n.status==="dirty",vi=n=>n.status==="valid",Ei=n=>typeof Promise<"u"&&n instanceof Promise;function Qa(n,e,r,o){if(typeof e=="function"?n!==e||!o:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(n)}function Yf(n,e,r,o,i){if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(n,r),r}typeof SuppressedError=="function"&&SuppressedError;var fe;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(fe||(fe={}));var Ci,Ni;class Zn{constructor(e,r,o,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=o,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Jf=(n,e)=>{if(vi(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ht(n.common.issues);return this._error=r,this._error}}};function Be(n){if(!n)return{};const{errorMap:e,invalid_type_error:r,required_error:o,description:i}=n;if(e&&(r||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,d)=>{var u,p;const{message:h}=n;return c.code==="invalid_enum_value"?{message:h??d.defaultError}:typeof d.data>"u"?{message:(u=h??o)!==null&&u!==void 0?u:d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:(p=h??r)!==null&&p!==void 0?p:d.defaultError}},description:i}}class Ae{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return wr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:wr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new xt,ctx:{common:e.parent.common,data:e.data,parsedType:wr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Ei(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const o=this.safeParse(e,r);if(o.success)return o.data;throw o.error}safeParse(e,r){var o;const i={common:{issues:[],async:(o=r==null?void 0:r.async)!==null&&o!==void 0?o:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wr(e)},l=this._parseSync({data:e,path:i.path,parent:i});return Jf(i,l)}async parseAsync(e,r){const o=await this.safeParseAsync(e,r);if(o.success)return o.data;throw o.error}async safeParseAsync(e,r){const o={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wr(e)},i=this._parse({data:e,path:o.path,parent:o}),l=await(Ei(i)?i:Promise.resolve(i));return Jf(o,l)}refine(e,r){const o=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,l)=>{const c=e(i),d=()=>l.addIssue({code:ee.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(u=>u?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,r){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof r=="function"?r(o,i):r),!1))}_refinement(e){return new gn({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Un.create(this,this._def)}nullable(){return vr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mn.create(this,this._def)}promise(){return Oo.create(this,this._def)}or(e){return Vi.create([this,e],this._def)}and(e){return Ai.create(this,e,this._def)}transform(e){return new gn({...Be(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new Di({...Be(this._def),innerType:this,defaultValue:r,typeName:we.ZodDefault})}brand(){return new Sc({typeName:we.ZodBranded,type:this,...Be(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Mi({...Be(this._def),innerType:this,catchValue:r,typeName:we.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Li.create(this,e)}readonly(){return Pi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const uw=/^c[^\s-]{8,}$/i,fw=/^[0-9a-z]+$/,pw=/^[0-9A-HJKMNP-TV-Z]{26}$/,hw=/^[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,mw=/^[a-z0-9_-]{21}$/i,gw=/^[-+]?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)?)??$/,yw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_w="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Cc;const ww=/^(?:(?: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])$/,bw=/^(([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})))$/,kw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Qf="((\\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])))",xw=new RegExp(`^${Qf}$`);function ep(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function vw(n){return new RegExp(`^${ep(n)}$`)}function tp(n){let e=`${Qf}T${ep(n)}`;const r=[];return r.push(n.local?"Z?":"Z"),n.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Ew(n,e){return!!((e==="v4"||!e)&&ww.test(n)||(e==="v6"||!e)&&bw.test(n))}class hn extends Ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==se.string){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:se.string,received:l.parsedType}),ke}const o=new xt;let i;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="max")e.data.length>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,d=e.data.length<l.value;(c||d)&&(i=this._getOrReturnCtx(e,i),c?ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")yw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"email",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")Cc||(Cc=new RegExp(_w,"u")),Cc.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"emoji",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")hw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"uuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")mw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"nanoid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")uw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")fw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid2",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")pw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ulid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ie(i,{validation:"url",code:ee.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"regex",code:ee.invalid_string,message:l.message}),o.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?tp(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?xw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?vw(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?gw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"duration",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?Ew(e.data,l.version)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ip",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?kw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"base64",code:ee.invalid_string,message:l.message}),o.dirty()):Fe.assertNever(l);return{status:o.value,value:e.data}}_regex(e,r,o){return this.refinement(i=>e.test(i),{validation:r,code:ee.invalid_string,...fe.errToObj(o)})}_addCheck(e){return new hn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...fe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...fe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...fe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...fe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...fe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...fe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...fe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...fe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...fe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...fe.errToObj(e)})}datetime(e){var r,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:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...fe.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...fe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...fe.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...fe.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...fe.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...fe.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...fe.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...fe.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...fe.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...fe.errToObj(r)})}nonempty(e){return this.min(1,fe.errToObj(e))}trim(){return new hn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new hn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new hn({...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 r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}hn.create=n=>{var e;return new hn({checks:[],typeName:we.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...Be(n)})};function Cw(n,e){const r=(n.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=r>o?r:o,l=parseInt(n.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return l%c/Math.pow(10,i)}class br extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==se.number){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:se.number,received:l.parsedType}),ke}let o;const i=new xt;for(const l of this._def.checks)l.kind==="int"?Fe.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_type,expected:"integer",received:"float",message:l.message}),i.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="multipleOf"?Cw(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_finite,message:l.message}),i.dirty()):Fe.assertNever(l);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,fe.toString(r))}gt(e,r){return this.setLimit("min",e,!1,fe.toString(r))}lte(e,r){return this.setLimit("max",e,!0,fe.toString(r))}lt(e,r){return this.setLimit("max",e,!1,fe.toString(r))}setLimit(e,r,o,i){return new br({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new br({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:fe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:fe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Fe.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(r===null||o.value>r)&&(r=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(r)&&Number.isFinite(e)}}br.create=n=>new br({checks:[],typeName:we.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...Be(n)});class kr extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==se.bigint){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:se.bigint,received:l.parsedType}),ke}let o;const i=new xt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):Fe.assertNever(l);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,fe.toString(r))}gt(e,r){return this.setLimit("min",e,!1,fe.toString(r))}lte(e,r){return this.setLimit("max",e,!0,fe.toString(r))}lt(e,r){return this.setLimit("max",e,!1,fe.toString(r))}setLimit(e,r,o,i){return new kr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new kr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}kr.create=n=>{var e;return new kr({checks:[],typeName:we.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...Be(n)})};class Si extends Ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==se.boolean){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:se.boolean,received:o.parsedType}),ke}return Bt(e.data)}}Si.create=n=>new Si({typeName:we.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...Be(n)});class Jr extends Ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==se.date){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:se.date,received:l.parsedType}),ke}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_date}),ke}const o=new xt;let i;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Fe.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Jr({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:fe.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:fe.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Jr.create=n=>new Jr({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:we.ZodDate,...Be(n)});class es extends Ae{_parse(e){if(this._getType(e)!==se.symbol){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:se.symbol,received:o.parsedType}),ke}return Bt(e.data)}}es.create=n=>new es({typeName:we.ZodSymbol,...Be(n)});class Bi extends Ae{_parse(e){if(this._getType(e)!==se.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:se.undefined,received:o.parsedType}),ke}return Bt(e.data)}}Bi.create=n=>new Bi({typeName:we.ZodUndefined,...Be(n)});class Ti extends Ae{_parse(e){if(this._getType(e)!==se.null){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:se.null,received:o.parsedType}),ke}return Bt(e.data)}}Ti.create=n=>new Ti({typeName:we.ZodNull,...Be(n)});class Ao extends Ae{constructor(){super(...arguments),this._any=!0}_parse(e){return Bt(e.data)}}Ao.create=n=>new Ao({typeName:we.ZodAny,...Be(n)});class Qr extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Bt(e.data)}}Qr.create=n=>new Qr({typeName:we.ZodUnknown,...Be(n)});class nr extends Ae{_parse(e){const r=this._getOrReturnCtx(e);return ie(r,{code:ee.invalid_type,expected:se.never,received:r.parsedType}),ke}}nr.create=n=>new nr({typeName:we.ZodNever,...Be(n)});class ts extends Ae{_parse(e){if(this._getType(e)!==se.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:se.void,received:o.parsedType}),ke}return Bt(e.data)}}ts.create=n=>new ts({typeName:we.ZodVoid,...Be(n)});class mn extends Ae{_parse(e){const{ctx:r,status:o}=this._processInputParams(e),i=this._def;if(r.parsedType!==se.array)return ie(r,{code:ee.invalid_type,expected:se.array,received:r.parsedType}),ke;if(i.exactLength!==null){const c=r.data.length>i.exactLength.value,d=r.data.length<i.exactLength.value;(c||d)&&(ie(r,{code:c?ee.too_big:ee.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(ie(r,{code:ee.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(ie(r,{code:ee.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),r.common.async)return Promise.all([...r.data].map((c,d)=>i.type._parseAsync(new Zn(r,c,r.path,d)))).then(c=>xt.mergeArray(o,c));const l=[...r.data].map((c,d)=>i.type._parseSync(new Zn(r,c,r.path,d)));return xt.mergeArray(o,l)}get element(){return this._def.type}min(e,r){return new mn({...this._def,minLength:{value:e,message:fe.toString(r)}})}max(e,r){return new mn({...this._def,maxLength:{value:e,message:fe.toString(r)}})}length(e,r){return new mn({...this._def,exactLength:{value:e,message:fe.toString(r)}})}nonempty(e){return this.min(1,e)}}mn.create=(n,e)=>new mn({type:n,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Be(e)});function $o(n){if(n instanceof tt){const e={};for(const r in n.shape){const o=n.shape[r];e[r]=Un.create($o(o))}return new tt({...n._def,shape:()=>e})}else return n instanceof mn?new mn({...n._def,type:$o(n.element)}):n instanceof Un?Un.create($o(n.unwrap())):n instanceof vr?vr.create($o(n.unwrap())):n instanceof jn?jn.create(n.items.map(e=>$o(e))):n}class tt extends Ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=Fe.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==se.object){const p=this._getOrReturnCtx(e);return ie(p,{code:ee.invalid_type,expected:se.object,received:p.parsedType}),ke}const{status:o,ctx:i}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof nr&&this._def.unknownKeys==="strip"))for(const p in i.data)c.includes(p)||d.push(p);const u=[];for(const p of c){const h=l[p],g=i.data[p];u.push({key:{status:"valid",value:p},value:h._parse(new Zn(i,g,i.path,p)),alwaysSet:p in i.data})}if(this._def.catchall instanceof nr){const p=this._def.unknownKeys;if(p==="passthrough")for(const h of d)u.push({key:{status:"valid",value:h},value:{status:"valid",value:i.data[h]}});else if(p==="strict")d.length>0&&(ie(i,{code:ee.unrecognized_keys,keys:d}),o.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const h of d){const g=i.data[h];u.push({key:{status:"valid",value:h},value:p._parse(new Zn(i,g,i.path,h)),alwaysSet:h in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const p=[];for(const h of u){const g=await h.key,_=await h.value;p.push({key:g,value:_,alwaysSet:h.alwaysSet})}return p}).then(p=>xt.mergeObjectSync(o,p)):xt.mergeObjectSync(o,u)}get shape(){return this._def.shape()}strict(e){return fe.errToObj,new tt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,o)=>{var i,l,c,d;const u=(c=(l=(i=this._def).errorMap)===null||l===void 0?void 0:l.call(i,r,o).message)!==null&&c!==void 0?c:o.defaultError;return r.code==="unrecognized_keys"?{message:(d=fe.errToObj(e).message)!==null&&d!==void 0?d:u}:{message:u}}}:{}})}strip(){return new tt({...this._def,unknownKeys:"strip"})}passthrough(){return new tt({...this._def,unknownKeys:"passthrough"})}extend(e){return new tt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new tt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:we.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new tt({...this._def,catchall:e})}pick(e){const r={};return Fe.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(r[o]=this.shape[o])}),new tt({...this._def,shape:()=>r})}omit(e){const r={};return Fe.objectKeys(this.shape).forEach(o=>{e[o]||(r[o]=this.shape[o])}),new tt({...this._def,shape:()=>r})}deepPartial(){return $o(this)}partial(e){const r={};return Fe.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?r[o]=i:r[o]=i.optional()}),new tt({...this._def,shape:()=>r})}required(e){const r={};return Fe.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])r[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof Un;)l=l._def.innerType;r[o]=l}}),new tt({...this._def,shape:()=>r})}keyof(){return np(Fe.objectKeys(this.shape))}}tt.create=(n,e)=>new tt({shape:()=>n,unknownKeys:"strip",catchall:nr.create(),typeName:we.ZodObject,...Be(e)}),tt.strictCreate=(n,e)=>new tt({shape:()=>n,unknownKeys:"strict",catchall:nr.create(),typeName:we.ZodObject,...Be(e)}),tt.lazycreate=(n,e)=>new tt({shape:n,unknownKeys:"strip",catchall:nr.create(),typeName:we.ZodObject,...Be(e)});class Vi extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e),o=this._def.options;function i(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return r.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new Ht(d.ctx.common.issues));return ie(r,{code:ee.invalid_union,unionErrors:c}),ke}if(r.common.async)return Promise.all(o.map(async l=>{const c={...r,common:{...r.common,issues:[]},parent:null};return{result:await l._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(i);{let l;const c=[];for(const u of o){const p={...r,common:{...r.common,issues:[]},parent:null},h=u._parseSync({data:r.data,path:r.path,parent:p});if(h.status==="valid")return h;h.status==="dirty"&&!l&&(l={result:h,ctx:p}),p.common.issues.length&&c.push(p.common.issues)}if(l)return r.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(u=>new Ht(u));return ie(r,{code:ee.invalid_union,unionErrors:d}),ke}}get options(){return this._def.options}}Vi.create=(n,e)=>new Vi({options:n,typeName:we.ZodUnion,...Be(e)});const rr=n=>n instanceof Ri?rr(n.schema):n instanceof gn?rr(n.innerType()):n instanceof Oi?[n.value]:n instanceof xr?n.options:n instanceof Ii?Fe.objectValues(n.enum):n instanceof Di?rr(n._def.innerType):n instanceof Bi?[void 0]:n instanceof Ti?[null]:n instanceof Un?[void 0,...rr(n.unwrap())]:n instanceof vr?[null,...rr(n.unwrap())]:n instanceof Sc||n instanceof Pi?rr(n.unwrap()):n instanceof Mi?rr(n._def.innerType):[];class ns extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==se.object)return ie(r,{code:ee.invalid_type,expected:se.object,received:r.parsedType}),ke;const o=this.discriminator,i=r.data[o],l=this.optionsMap.get(i);return l?r.common.async?l._parseAsync({data:r.data,path:r.path,parent:r}):l._parseSync({data:r.data,path:r.path,parent:r}):(ie(r,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),ke)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,o){const i=new Map;for(const l of r){const c=rr(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,l)}}return new ns({typeName:we.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Be(o)})}}function Nc(n,e){const r=wr(n),o=wr(e);if(n===e)return{valid:!0,data:n};if(r===se.object&&o===se.object){const i=Fe.objectKeys(e),l=Fe.objectKeys(n).filter(d=>i.indexOf(d)!==-1),c={...n,...e};for(const d of l){const u=Nc(n[d],e[d]);if(!u.valid)return{valid:!1};c[d]=u.data}return{valid:!0,data:c}}else if(r===se.array&&o===se.array){if(n.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<n.length;l++){const c=n[l],d=e[l],u=Nc(c,d);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===se.date&&o===se.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class Ai extends Ae{_parse(e){const{status:r,ctx:o}=this._processInputParams(e),i=(l,c)=>{if(vc(l)||vc(c))return ke;const d=Nc(l.value,c.value);return d.valid?((Ec(l)||Ec(c))&&r.dirty(),{status:r.value,value:d.data}):(ie(o,{code:ee.invalid_intersection_types}),ke)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,c])=>i(l,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Ai.create=(n,e,r)=>new Ai({left:n,right:e,typeName:we.ZodIntersection,...Be(r)});class jn extends Ae{_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==se.array)return ie(o,{code:ee.invalid_type,expected:se.array,received:o.parsedType}),ke;if(o.data.length<this._def.items.length)return ie(o,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ke;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const l=[...o.data].map((c,d)=>{const u=this._def.items[d]||this._def.rest;return u?u._parse(new Zn(o,c,o.path,d)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>xt.mergeArray(r,c)):xt.mergeArray(r,l)}get items(){return this._def.items}rest(e){return new jn({...this._def,rest:e})}}jn.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new jn({items:n,typeName:we.ZodTuple,rest:null,...Be(e)})};class $i extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==se.object)return ie(o,{code:ee.invalid_type,expected:se.object,received:o.parsedType}),ke;const i=[],l=this._def.keyType,c=this._def.valueType;for(const d in o.data)i.push({key:l._parse(new Zn(o,d,o.path,d)),value:c._parse(new Zn(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?xt.mergeObjectAsync(r,i):xt.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,o){return r instanceof Ae?new $i({keyType:e,valueType:r,typeName:we.ZodRecord,...Be(o)}):new $i({keyType:hn.create(),valueType:e,typeName:we.ZodRecord,...Be(r)})}}class rs extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==se.map)return ie(o,{code:ee.invalid_type,expected:se.map,received:o.parsedType}),ke;const i=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([d,u],p)=>({key:i._parse(new Zn(o,d,o.path,[p,"key"])),value:l._parse(new Zn(o,u,o.path,[p,"value"]))}));if(o.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const u of c){const p=await u.key,h=await u.value;if(p.status==="aborted"||h.status==="aborted")return ke;(p.status==="dirty"||h.status==="dirty")&&r.dirty(),d.set(p.value,h.value)}return{status:r.value,value:d}})}else{const d=new Map;for(const u of c){const p=u.key,h=u.value;if(p.status==="aborted"||h.status==="aborted")return ke;(p.status==="dirty"||h.status==="dirty")&&r.dirty(),d.set(p.value,h.value)}return{status:r.value,value:d}}}}rs.create=(n,e,r)=>new rs({valueType:e,keyType:n,typeName:we.ZodMap,...Be(r)});class eo extends Ae{_parse(e){const{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==se.set)return ie(o,{code:ee.invalid_type,expected:se.set,received:o.parsedType}),ke;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(ie(o,{code:ee.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(ie(o,{code:ee.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const l=this._def.valueType;function c(u){const p=new Set;for(const h of u){if(h.status==="aborted")return ke;h.status==="dirty"&&r.dirty(),p.add(h.value)}return{status:r.value,value:p}}const d=[...o.data.values()].map((u,p)=>l._parse(new Zn(o,u,o.path,p)));return o.common.async?Promise.all(d).then(u=>c(u)):c(d)}min(e,r){return new eo({...this._def,minSize:{value:e,message:fe.toString(r)}})}max(e,r){return new eo({...this._def,maxSize:{value:e,message:fe.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}eo.create=(n,e)=>new eo({valueType:n,minSize:null,maxSize:null,typeName:we.ZodSet,...Be(e)});class Ro extends Ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==se.function)return ie(r,{code:ee.invalid_type,expected:se.function,received:r.parsedType}),ke;function o(d,u){return Ja({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ya(),To].filter(p=>!!p),issueData:{code:ee.invalid_arguments,argumentsError:u}})}function i(d,u){return Ja({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ya(),To].filter(p=>!!p),issueData:{code:ee.invalid_return_type,returnTypeError:u}})}const l={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof Oo){const d=this;return Bt(async function(...u){const p=new Ht([]),h=await d._def.args.parseAsync(u,l).catch(w=>{throw p.addIssue(o(u,w)),p}),g=await Reflect.apply(c,this,h);return await d._def.returns._def.type.parseAsync(g,l).catch(w=>{throw p.addIssue(i(g,w)),p})})}else{const d=this;return Bt(function(...u){const p=d._def.args.safeParse(u,l);if(!p.success)throw new Ht([o(u,p.error)]);const h=Reflect.apply(c,this,p.data),g=d._def.returns.safeParse(h,l);if(!g.success)throw new Ht([i(h,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ro({...this._def,args:jn.create(e).rest(Qr.create())})}returns(e){return new Ro({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,o){return new Ro({args:e||jn.create([]).rest(Qr.create()),returns:r||Qr.create(),typeName:we.ZodFunction,...Be(o)})}}class Ri extends Ae{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Ri.create=(n,e)=>new Ri({getter:n,typeName:we.ZodLazy,...Be(e)});class Oi extends Ae{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return ie(r,{received:r.data,code:ee.invalid_literal,expected:this._def.value}),ke}return{status:"valid",value:e.data}}get value(){return this._def.value}}Oi.create=(n,e)=>new Oi({value:n,typeName:we.ZodLiteral,...Be(e)});function np(n,e){return new xr({values:n,typeName:we.ZodEnum,...Be(e)})}class xr extends Ae{constructor(){super(...arguments),Ci.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),o=this._def.values;return ie(r,{expected:Fe.joinValues(o),received:r.parsedType,code:ee.invalid_type}),ke}if(Qa(this,Ci)||Yf(this,Ci,new Set(this._def.values)),!Qa(this,Ci).has(e.data)){const r=this._getOrReturnCtx(e),o=this._def.values;return ie(r,{received:r.data,code:ee.invalid_enum_value,options:o}),ke}return Bt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return xr.create(e,{...this._def,...r})}exclude(e,r=this._def){return xr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...r})}}Ci=new WeakMap,xr.create=np;class Ii extends Ae{constructor(){super(...arguments),Ni.set(this,void 0)}_parse(e){const r=Fe.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==se.string&&o.parsedType!==se.number){const i=Fe.objectValues(r);return ie(o,{expected:Fe.joinValues(i),received:o.parsedType,code:ee.invalid_type}),ke}if(Qa(this,Ni)||Yf(this,Ni,new Set(Fe.getValidEnumValues(this._def.values))),!Qa(this,Ni).has(e.data)){const i=Fe.objectValues(r);return ie(o,{received:o.data,code:ee.invalid_enum_value,options:i}),ke}return Bt(e.data)}get enum(){return this._def.values}}Ni=new WeakMap,Ii.create=(n,e)=>new Ii({values:n,typeName:we.ZodNativeEnum,...Be(e)});class Oo extends Ae{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==se.promise&&r.common.async===!1)return ie(r,{code:ee.invalid_type,expected:se.promise,received:r.parsedType}),ke;const o=r.parsedType===se.promise?r.data:Promise.resolve(r.data);return Bt(o.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Oo.create=(n,e)=>new Oo({type:n,typeName:we.ZodPromise,...Be(e)});class gn extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:o}=this._processInputParams(e),i=this._def.effect||null,l={addIssue:c=>{ie(o,c),c.fatal?r.abort():r.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const c=i.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async d=>{if(r.value==="aborted")return ke;const u=await this._def.schema._parseAsync({data:d,path:o.path,parent:o});return u.status==="aborted"?ke:u.status==="dirty"||r.value==="dirty"?Vo(u.value):u});{if(r.value==="aborted")return ke;const d=this._def.schema._parseSync({data:c,path:o.path,parent:o});return d.status==="aborted"?ke:d.status==="dirty"||r.value==="dirty"?Vo(d.value):d}}if(i.type==="refinement"){const c=d=>{const u=i.refinement(d,l);if(o.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?ke:(d.status==="dirty"&&r.dirty(),c(d.value),{status:r.value,value:d.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>d.status==="aborted"?ke:(d.status==="dirty"&&r.dirty(),c(d.value).then(()=>({status:r.value,value:d.value}))))}if(i.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!vi(c))return c;const d=i.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:d}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>vi(c)?Promise.resolve(i.transform(c.value,l)).then(d=>({status:r.value,value:d})):c);Fe.assertNever(i)}}gn.create=(n,e,r)=>new gn({schema:n,typeName:we.ZodEffects,effect:e,...Be(r)}),gn.createWithPreprocess=(n,e,r)=>new gn({schema:e,effect:{type:"preprocess",transform:n},typeName:we.ZodEffects,...Be(r)});class Un extends Ae{_parse(e){return this._getType(e)===se.undefined?Bt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Un.create=(n,e)=>new Un({innerType:n,typeName:we.ZodOptional,...Be(e)});class vr extends Ae{_parse(e){return this._getType(e)===se.null?Bt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}vr.create=(n,e)=>new vr({innerType:n,typeName:we.ZodNullable,...Be(e)});class Di extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e);let o=r.data;return r.parsedType===se.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Di.create=(n,e)=>new Di({innerType:n,typeName:we.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Be(e)});class Mi extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e),o={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Ei(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ht(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ht(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Mi.create=(n,e)=>new Mi({innerType:n,typeName:we.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Be(e)});class os extends Ae{_parse(e){if(this._getType(e)!==se.nan){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:se.nan,received:o.parsedType}),ke}return{status:"valid",value:e.data}}}os.create=n=>new os({typeName:we.ZodNaN,...Be(n)});const Nw=Symbol("zod_brand");class Sc extends Ae{_parse(e){const{ctx:r}=this._processInputParams(e),o=r.data;return this._def.type._parse({data:o,path:r.path,parent:r})}unwrap(){return this._def.type}}class Li extends Ae{_parse(e){const{status:r,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"?ke:l.status==="dirty"?(r.dirty(),Vo(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?ke:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,r){return new Li({in:e,out:r,typeName:we.ZodPipeline})}}class Pi extends Ae{_parse(e){const r=this._def.innerType._parse(e),o=i=>(vi(i)&&(i.value=Object.freeze(i.value)),i);return Ei(r)?r.then(i=>o(i)):o(r)}unwrap(){return this._def.innerType}}Pi.create=(n,e)=>new Pi({innerType:n,typeName:we.ZodReadonly,...Be(e)});function rp(n,e={},r){return n?Ao.create().superRefine((o,i)=>{var l,c;if(!n(o)){const d=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,u=(c=(l=d.fatal)!==null&&l!==void 0?l:r)!==null&&c!==void 0?c:!0,p=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...p,fatal:u})}}):Ao.create()}const Sw={object:tt.lazycreate};var we;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(we||(we={}));const Bw=(n,e={message:`Input not instance of ${n.name}`})=>rp(r=>r instanceof n,e),op=hn.create,ip=br.create,Tw=os.create,Vw=kr.create,ap=Si.create,Aw=Jr.create,$w=es.create,Rw=Bi.create,Ow=Ti.create,Iw=Ao.create,Dw=Qr.create,Mw=nr.create,Lw=ts.create,Pw=mn.create,Fw=tt.create,zw=tt.strictCreate,Zw=Vi.create,jw=ns.create,Uw=Ai.create,Ww=jn.create,Hw=$i.create,qw=rs.create,Gw=eo.create,Kw=Ro.create,Xw=Ri.create,Yw=Oi.create,Jw=xr.create,Qw=Ii.create,e1=Oo.create,sp=gn.create,t1=Un.create,n1=vr.create,r1=gn.createWithPreprocess,o1=Li.create;var yn=Object.freeze({__proto__:null,defaultErrorMap:To,setErrorMap:cw,getErrorMap:Ya,makeIssue:Ja,EMPTY_PATH:dw,addIssueToContext:ie,ParseStatus:xt,INVALID:ke,DIRTY:Vo,OK:Bt,isAborted:vc,isDirty:Ec,isValid:vi,isAsync:Ei,get util(){return Fe},get objectUtil(){return xc},ZodParsedType:se,getParsedType:wr,ZodType:Ae,datetimeRegex:tp,ZodString:hn,ZodNumber:br,ZodBigInt:kr,ZodBoolean:Si,ZodDate:Jr,ZodSymbol:es,ZodUndefined:Bi,ZodNull:Ti,ZodAny:Ao,ZodUnknown:Qr,ZodNever:nr,ZodVoid:ts,ZodArray:mn,ZodObject:tt,ZodUnion:Vi,ZodDiscriminatedUnion:ns,ZodIntersection:Ai,ZodTuple:jn,ZodRecord:$i,ZodMap:rs,ZodSet:eo,ZodFunction:Ro,ZodLazy:Ri,ZodLiteral:Oi,ZodEnum:xr,ZodNativeEnum:Ii,ZodPromise:Oo,ZodEffects:gn,ZodTransformer:gn,ZodOptional:Un,ZodNullable:vr,ZodDefault:Di,ZodCatch:Mi,ZodNaN:os,BRAND:Nw,ZodBranded:Sc,ZodPipeline:Li,ZodReadonly:Pi,custom:rp,Schema:Ae,ZodSchema:Ae,late:Sw,get ZodFirstPartyTypeKind(){return we},coerce:{string:n=>hn.create({...n,coerce:!0}),number:n=>br.create({...n,coerce:!0}),boolean:n=>Si.create({...n,coerce:!0}),bigint:n=>kr.create({...n,coerce:!0}),date:n=>Jr.create({...n,coerce:!0})},any:Iw,array:Pw,bigint:Vw,boolean:ap,date:Aw,discriminatedUnion:jw,effect:sp,enum:Jw,function:Kw,instanceof:Bw,intersection:Uw,lazy:Xw,literal:Yw,map:qw,nan:Tw,nativeEnum:Qw,never:Mw,null:Ow,nullable:n1,number:ip,object:Fw,oboolean:()=>ap().optional(),onumber:()=>ip().optional(),optional:t1,ostring:()=>op().optional(),pipeline:o1,preprocess:r1,promise:e1,record:Hw,set:Gw,strictObject:zw,string:op,symbol:$w,transformer:sp,tuple:Ww,undefined:Rw,union:Zw,unknown:Dw,void:Lw,NEVER:ke,ZodIssueCode:ee,quotelessJson:lw,ZodError:Ht});const i1=-2147483648,lp=-9007199254740991n,a1=NaN,s1=NaN,l1=null,c1=null;function d1(n,e){switch(e){case"Int":return n===i1;case"Long":return n===Number(lp)||n===lp;case"Float":return n===a1;case"Double":return n===s1;case"String":return n===l1;case"Bytes":return n===c1;default:throw Error(`unsupported data type: ${e}`)}}function u1(n,e){const r=Math.floor(e/8),o=1<<7-e%8;return(n[r]&o)>0}const f1={type:"absent"},cp=null;function p1(n){return typeof n=="object"&&n!==null&&n.type==="absent"}function is(n,e,r={}){if(u1(n.absent,e))return r.absent===void 0?f1:r.absent;const o=n.data[e],i=n.type;if(d1(o,i))return r.na===void 0?cp:r.na;switch(i){case"Int":return o;case"Long":return Number(o);case"Float":return o;case"Double":return o;case"String":return o;case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${i}`)}}function Io(n){const{type:e,name:r,domain:o}=n;return{type:e,name:r,...o&&{domain:o}}}yn.object({__isRef:yn.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:yn.string().describe("Upstream block id"),name:yn.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(),yn.string().length(24).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");function h1(n){if(n&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(n);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const m1=yn.object({type:yn.string(),importance:yn.number().optional(),id:yn.string().optional(),label:yn.string()});yn.array(m1);const g1="1.26.0";function as(){return h1({sdkVersion:g1})}function y1(n){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(n)}const _1=`.ag-header {
|
|
4
4
|
border-bottom: 1px solid var(--border-color-default);
|
|
5
5
|
}
|
|
6
6
|
|