@platforma-sdk/ui-vue 1.27.6 → 1.27.8
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 +7 -0
- package/dist/lib.js +167 -167
- 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 +5 -5
package/dist/lib.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(P,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):(P=typeof globalThis<"u"?globalThis:P||self,t(P.SdkVueLib={},P.Vue,P.agGridEnterprise,P.agGridVue3))})(this,function(P,t,Le,So){"use strict";var qz=Object.defineProperty;var D_=P=>{throw TypeError(P)};var Gz=(P,t,Le)=>t in P?qz(P,t,{enumerable:!0,configurable:!0,writable:!0,value:Le}):P[t]=Le;var je=(P,t,Le)=>Gz(P,typeof t!="symbol"?t+"":t,Le),Df=(P,t,Le)=>t.has(P)||D_("Cannot "+Le);var x=(P,t,Le)=>(Df(P,t,"read from private field"),Le?Le.call(P):t.get(P)),Me=(P,t,Le)=>t.has(P)?D_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(P):t.set(P,Le),he=(P,t,Le,So)=>(Df(P,t,"write to private field"),So?So.call(P,Le):t.set(P,Le),Le),de=(P,t,Le)=>(Df(P,t,"access private method"),Le);var ac=(P,t,Le,So)=>({set _(cc){he(P,t,cc,Le)},get _(){return x(P,t,So)}});var pt,ny,ti,ry,oy,Bn,Xt,Tn,ho,Vn,ni,ri,ht,An,ut,Xe,ve,$t,Yt,Nt,yt,Rn,_t,$n,On,Jt,In,Pr,Ot,oi,ne,Mf,mo,cr,Ea,Qt,M_,go,ii,Ca,Gr,Kr,Pf,sc,lc,Je,Lf,Ga,Xr,Ff;var cc=Object.defineProperty,P_=(n,e,r)=>e in n?cc(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,dc=(n,e,r)=>P_(n,typeof e!="symbol"?e+"":e,r);function L_(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 F_(n,e){if(n!=null)return e(n)}function z_(n,e){return n=Math.ceil(n),e=Math.floor(e),Math.floor(Math.random()*(e-n))+n}function Z_(n){let e="";for(let r=0;r<n;r++)e+=String.fromCharCode(z_(65,91));return e}function j_(){return Z_(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 Ht(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=>Ht(n[r],e[r]));if(ki(n)&&ki(e))return jf(n)!==jf(e)?!1:Object.keys(n).every(r=>Ht(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 U_(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 W_(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 H_(n){if(n.errors)throw new Xa(n.errors);if(!n.value)throw new uc;return n.value}function q_(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=v=>{i.value={model:Zn(v)}};t.watch(()=>n.get(),v=>l(v),{immediate:!0});const c=()=>{var v;n.onSave(e(Zn((v=i.value)==null?void 0:v.model)))},d=()=>{l(n.get()),o.value=void 0},u=v=>{const C=pc(v);hc(C)?o.value=Error(mc(C)):o.value=C},p=v=>{o.value=void 0;try{e(v),r&&c()}catch(C){u(C)}},h=t.computed({get:()=>{var v;return(v=i.value)==null?void 0:v.model},set(v){l(v),p(v)}});t.watch(i,(v,C)=>{v&&v===C&&p(v.model)},{deep:!0});const g=t.computed(()=>!o.value),_=t.computed(()=>!Ht(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 G_(n,e,r){const o=n.validate??fc,{autoSave:i}=n,l=t.ref(),c=t.ref(),d=$=>{var L;if(r.deepPatchModel){const j=(L=c.value)==null?void 0:L.model,B=Object.assign(Zn($),e??{});c.value={model:j?Uf(j,B):B,stage:Symbol()}}else c.value={model:Object.assign(Zn($),e??{}),stage:Symbol()}};t.watch(()=>n.get(),$=>d($),{immediate:!0});const u=()=>{var $;n.onSave(o(Zn(($=c.value)==null?void 0:$.model)))},p=()=>{d(n.get()),l.value=void 0},h=$=>{const L=pc($);hc(L)?l.value=Error(mc(L)):l.value=L},g=$=>{l.value=void 0;try{o($),i&&u()}catch(L){h(L)}},_=t.computed({get:()=>{var $;return($=c.value)==null?void 0:$.model},set(){throw Error("Cannot replace base model")}});t.watch([()=>({args:_.value.args,ui:_.value.ui}),()=>{var $;return($=c.value)==null?void 0:$.stage}],([$,L],[j,B])=>{L===B&&g($)},{deep:!0});const w=t.computed(()=>!l.value),v=t.computed(()=>{var j;const{args:$,ui:L}=((j=t.unref(c))==null?void 0:j.model)??{};return!Ht(n.get(),{args:$,ui:L})}),C=t.computed(()=>l.value?l.value.message:"");return t.reactive({model:_,valid:w,isChanged:v,error:l,errorString:C,save:u,revert:p,setError:h})}const K_=n=>Object.fromEntries(new URL(n,"http://dummy").searchParams);function yc(n){return t.getCurrentScope()?(t.onScopeDispose(n),!0):!1}const X_=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Y_=n=>n!=null,J_=Object.prototype.toString,Q_=n=>J_.call(n)==="[object Object]",_c=()=>{};function ew(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 tw(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 nw(n){return t.getCurrentInstance()}function wc(n){return Array.isArray(n)?n:[n]}function bc(n,e=200,r={}){return ew(tw(e,r),n)}function rw(n,e=!0,r){nw()?t.onMounted(n,r):e?n():t.nextTick(n)}function ow(n,e,r){return t.watch(n,(i,l,c)=>{i&&e(i,l,c)},{...r,once:!1})}const kc=X_?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 _=Q_(g)?{...g}:g;l.push(...r.flatMap(w=>o.map(v=>d(h,w,v,_))))},{immediate:!0,flush:"post"}),p=()=>{u(),c()};return yc(p),p}function iw(){const n=t.ref(!1),e=t.getCurrentInstance();return e&&t.onMounted(()=>{n.value=!0},e),n}function Gf(n){const e=iw();return t.computed(()=>(e.value,!!n()))}function aw(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(Y_);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 sw(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 lw(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),v=t.ref(0);function C(){const L=Bo(n);if(!L){r&&(d.value=0,u.value=0,p.value=0,h.value=0,g.value=0,_.value=0,w.value=0,v.value=0);return}const j=L.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,v.value=j.y}function $(){c==="sync"?C():c==="next-frame"&&requestAnimationFrame(()=>C())}return sw(n,$),t.watch(()=>Bo(n),L=>!L&&$()),aw(n,$,{attributeFilter:["style","class"]}),i&&qf("scroll",$,{capture:!0,passive:!0}),o&&qf("resize",$,{passive:!0}),rw(()=>{l&&$()}),{height:d,bottom:u,left:p,right:h,top:g,width:_,x:w,y:v,update:$}}function cw(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=>{Ht(j,i.args)||e.setBlockArgs(j)},l,{maxWait:c}),u=bc(j=>{Ht(j,i.ui)||e.setBlockUiState(j)},l,{maxWait:c}),p=bc((j,B)=>{(!Ht(j,i.args)||!Ht(B,i.ui))&&e.setBlockArgsAndUiState(j,B)},l,{maxWait:c});e.onStateUpdates(async j=>{j.forEach(B=>{B.key==="args"&&!Ht(i.args,B.value)&&(i.args=Object.freeze(B.value),o("args patch",i.args)),B.key==="ui"&&!Ht(i.ui,B.value)&&(i.ui=Object.freeze(B.value),o("ui patch",i.ui)),B.key==="outputs"&&!Ht(i.outputs,B.value)&&(i.outputs=Object.freeze(B.value),o("outputs patch",i.outputs)),B.key==="navigationState"&&!Ht(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)}},v=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)}),$={snapshot:i,queryParams:t.computed(()=>K_(i.navigationState.href)),href:t.computed(()=>i.navigationState.href),hasErrors:t.computed(()=>Object.values(i.outputs).some(j=>!(j!=null&&j.ok)))},L=G_({get(){return{args:i.args,ui:i.ui}},autoSave:!0,onSave(j){p(j.args,j.ui)}},{outputs:v,outputErrors:C},r);return t.reactive(Object.assign(L,w,$))}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 dw=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(dw);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"]),br=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"]),uw=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class qt 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 qt))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()}}qt.create=n=>new qt(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 fw(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}},pw=[];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 vt{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 vt.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}),Tt=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 jn{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 qt(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 br(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:br(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new vt,ctx:{common:e.parent.common,data:e.data,parsedType:br(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:br(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:br(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 yn({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Wn.create(this,this._def)}nullable(){return Er.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gn.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 yn({...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 Pi.create(this,e)}readonly(){return Li.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const hw=/^c[^\s-]{8,}$/i,mw=/^[0-9a-z]+$/,gw=/^[0-9A-HJKMNP-TV-Z]{26}$/,yw=/^[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,_w=/^[a-z0-9_-]{21}$/i,ww=/^[-+]?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)?)??$/,bw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Cc;const xw=/^(?:(?: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])$/,vw=/^(([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})))$/,Ew=/^([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])))",Cw=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 Nw(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 Sw(n,e){return!!((e==="v4"||!e)&&xw.test(n)||(e==="v6"||!e)&&vw.test(n))}class mn 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 vt;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")bw.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(kw,"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")yw.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")_w.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")hw.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")mw.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")gw.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"?Cw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?Nw(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"?ww.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"duration",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?Sw(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"?Ew.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 mn({...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 mn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new mn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new mn({...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}}mn.create=n=>{var e;return new mn({checks:[],typeName:we.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...Be(n)})};function Bw(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 kr 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 vt;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"?Bw(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 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]})}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)}}kr.create=n=>new kr({checks:[],typeName:we.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...Be(n)});class xr 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 vt;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 xr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new xr({...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}}xr.create=n=>{var e;return new xr({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 Tt(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 vt;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 Tt(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 Tt(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 Tt(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 Tt(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 Tt(e.data)}}Qr.create=n=>new Qr({typeName:we.ZodUnknown,...Be(n)});class rr extends Ae{_parse(e){const r=this._getOrReturnCtx(e);return ie(r,{code:ee.invalid_type,expected:se.never,received:r.parsedType}),ke}}rr.create=n=>new rr({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 Tt(e.data)}}ts.create=n=>new ts({typeName:we.ZodVoid,...Be(n)});class gn 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 jn(r,c,r.path,d)))).then(c=>vt.mergeArray(o,c));const l=[...r.data].map((c,d)=>i.type._parseSync(new jn(r,c,r.path,d)));return vt.mergeArray(o,l)}get element(){return this._def.type}min(e,r){return new gn({...this._def,minLength:{value:e,message:fe.toString(r)}})}max(e,r){return new gn({...this._def,maxLength:{value:e,message:fe.toString(r)}})}length(e,r){return new gn({...this._def,exactLength:{value:e,message:fe.toString(r)}})}nonempty(e){return this.min(1,e)}}gn.create=(n,e)=>new gn({type:n,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Be(e)});function Ro(n){if(n instanceof tt){const e={};for(const r in n.shape){const o=n.shape[r];e[r]=Wn.create(Ro(o))}return new tt({...n._def,shape:()=>e})}else return n instanceof gn?new gn({...n._def,type:Ro(n.element)}):n instanceof Wn?Wn.create(Ro(n.unwrap())):n instanceof Er?Er.create(Ro(n.unwrap())):n instanceof Un?Un.create(n.items.map(e=>Ro(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 rr&&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 jn(i,g,i.path,p)),alwaysSet:p in i.data})}if(this._def.catchall instanceof rr){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 jn(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=>vt.mergeObjectSync(o,p)):vt.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 Ro(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 Wn;)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:rr.create(),typeName:we.ZodObject,...Be(e)}),tt.strictCreate=(n,e)=>new tt({shape:()=>n,unknownKeys:"strict",catchall:rr.create(),typeName:we.ZodObject,...Be(e)}),tt.lazycreate=(n,e)=>new tt({shape:n,unknownKeys:"strip",catchall:rr.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 qt(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 qt(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 or=n=>n instanceof $i?or(n.schema):n instanceof yn?or(n.innerType()):n instanceof Oi?[n.value]:n instanceof vr?n.options:n instanceof Ii?Fe.objectValues(n.enum):n instanceof Di?or(n._def.innerType):n instanceof Bi?[void 0]:n instanceof Ti?[null]:n instanceof Wn?[void 0,...or(n.unwrap())]:n instanceof Er?[null,...or(n.unwrap())]:n instanceof Sc||n instanceof Li?or(n.unwrap()):n instanceof Mi?or(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=or(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=br(n),o=br(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 Un 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 jn(o,c,o.path,d)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>vt.mergeArray(r,c)):vt.mergeArray(r,l)}get items(){return this._def.items}rest(e){return new Un({...this._def,rest:e})}}Un.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Un({items:n,typeName:we.ZodTuple,rest:null,...Be(e)})};class Ri 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 jn(o,d,o.path,d)),value:c._parse(new jn(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?vt.mergeObjectAsync(r,i):vt.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,o){return r instanceof Ae?new Ri({keyType:e,valueType:r,typeName:we.ZodRecord,...Be(o)}):new Ri({keyType:mn.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 jn(o,d,o.path,[p,"key"])),value:l._parse(new jn(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 jn(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 $o 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 Tt(async function(...u){const p=new qt([]),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 Tt(function(...u){const p=d._def.args.safeParse(u,l);if(!p.success)throw new qt([o(u,p.error)]);const h=Reflect.apply(c,this,p.data),g=d._def.returns.safeParse(h,l);if(!g.success)throw new qt([i(h,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new $o({...this._def,args:Un.create(e).rest(Qr.create())})}returns(e){return new $o({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,o){return new $o({args:e||Un.create([]).rest(Qr.create()),returns:r||Qr.create(),typeName:we.ZodFunction,...Be(o)})}}class $i 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})}}$i.create=(n,e)=>new $i({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 vr({values:n,typeName:we.ZodEnum,...Be(e)})}class vr 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 Tt(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 vr.create(e,{...this._def,...r})}exclude(e,r=this._def){return vr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...r})}}Ci=new WeakMap,vr.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 Tt(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 Tt(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 yn 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)}}yn.create=(n,e,r)=>new yn({schema:n,typeName:we.ZodEffects,effect:e,...Be(r)}),yn.createWithPreprocess=(n,e,r)=>new yn({schema:e,effect:{type:"preprocess",transform:n},typeName:we.ZodEffects,...Be(r)});class Wn extends Ae{_parse(e){return this._getType(e)===se.undefined?Tt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Wn.create=(n,e)=>new Wn({innerType:n,typeName:we.ZodOptional,...Be(e)});class Er extends Ae{_parse(e){return this._getType(e)===se.null?Tt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Er.create=(n,e)=>new Er({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 qt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new qt(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 Tw=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 Pi 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 Pi({in:e,out:r,typeName:we.ZodPipeline})}}class Li 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}}Li.create=(n,e)=>new Li({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 Vw={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 Aw=(n,e={message:`Input not instance of ${n.name}`})=>rp(r=>r instanceof n,e),op=mn.create,ip=kr.create,Rw=os.create,$w=xr.create,ap=Si.create,Ow=Jr.create,Iw=es.create,Dw=Bi.create,Mw=Ti.create,Pw=Ao.create,Lw=Qr.create,Fw=rr.create,zw=ts.create,Zw=gn.create,jw=tt.create,Uw=tt.strictCreate,Ww=Vi.create,Hw=ns.create,qw=Ai.create,Gw=Un.create,Kw=Ri.create,Xw=rs.create,Yw=eo.create,Jw=$o.create,Qw=$i.create,e1=Oi.create,t1=vr.create,n1=Ii.create,r1=Oo.create,sp=yn.create,o1=Wn.create,i1=Er.create,a1=yn.createWithPreprocess,s1=Pi.create;var _n=Object.freeze({__proto__:null,defaultErrorMap:To,setErrorMap:fw,getErrorMap:Ya,makeIssue:Ja,EMPTY_PATH:pw,addIssueToContext:ie,ParseStatus:vt,INVALID:ke,DIRTY:Vo,OK:Tt,isAborted:vc,isDirty:Ec,isValid:vi,isAsync:Ei,get util(){return Fe},get objectUtil(){return xc},ZodParsedType:se,getParsedType:br,ZodType:Ae,datetimeRegex:tp,ZodString:mn,ZodNumber:kr,ZodBigInt:xr,ZodBoolean:Si,ZodDate:Jr,ZodSymbol:es,ZodUndefined:Bi,ZodNull:Ti,ZodAny:Ao,ZodUnknown:Qr,ZodNever:rr,ZodVoid:ts,ZodArray:gn,ZodObject:tt,ZodUnion:Vi,ZodDiscriminatedUnion:ns,ZodIntersection:Ai,ZodTuple:Un,ZodRecord:Ri,ZodMap:rs,ZodSet:eo,ZodFunction:$o,ZodLazy:$i,ZodLiteral:Oi,ZodEnum:vr,ZodNativeEnum:Ii,ZodPromise:Oo,ZodEffects:yn,ZodTransformer:yn,ZodOptional:Wn,ZodNullable:Er,ZodDefault:Di,ZodCatch:Mi,ZodNaN:os,BRAND:Tw,ZodBranded:Sc,ZodPipeline:Pi,ZodReadonly:Li,custom:rp,Schema:Ae,ZodSchema:Ae,late:Vw,get ZodFirstPartyTypeKind(){return we},coerce:{string:n=>mn.create({...n,coerce:!0}),number:n=>kr.create({...n,coerce:!0}),boolean:n=>Si.create({...n,coerce:!0}),bigint:n=>xr.create({...n,coerce:!0}),date:n=>Jr.create({...n,coerce:!0})},any:Pw,array:Zw,bigint:$w,boolean:ap,date:Ow,discriminatedUnion:Hw,effect:sp,enum:t1,function:Jw,instanceof:Aw,intersection:qw,lazy:Qw,literal:e1,map:Xw,nan:Rw,nativeEnum:n1,never:Fw,null:Mw,nullable:i1,number:ip,object:jw,oboolean:()=>ap().optional(),onumber:()=>ip().optional(),optional:o1,ostring:()=>op().optional(),pipeline:s1,preprocess:a1,promise:r1,record:Kw,set:Yw,strictObject:Uw,string:op,symbol:Iw,transformer:sp,tuple:Gw,undefined:Dw,union:Ww,unknown:Lw,void:zw,NEVER:ke,ZodIssueCode:ee,quotelessJson:uw,ZodError:qt});const l1=-2147483648,lp=-9007199254740991n,c1=null,d1=null;function u1(n,e){switch(e){case"Int":return n===l1;case"Long":return n===Number(lp)||n===lp;case"Float":return Number.isNaN(n);case"Double":return Number.isNaN(n);case"String":return n===c1;case"Bytes":return n===d1;default:throw Error(`unsupported data type: ${e}`)}}function f1(n,e){const r=Math.floor(e/8),o=1<<7-e%8;return(n[r]&o)>0}const p1={type:"absent"},cp=null;function h1(n){return typeof n=="object"&&n!==null&&n.type==="absent"}function is(n,e,r={}){if(f1(n.absent,e))return r.absent===void 0?p1:r.absent;const o=n.data[e],i=n.type;if(u1(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}}}_n.object({__isRef:_n.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:_n.string().describe("Upstream block id"),name:_n.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(),_n.string().length(24).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");function m1(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 g1=_n.object({type:_n.string(),importance:_n.number().optional(),id:_n.string().optional(),label:_n.string()});_n.array(g1);const y1="1.27.6";function as(){return m1({sdkVersion:y1})}function _1(n){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(n)}const w1=`.ag-header {
|
|
3
|
+
`)}}function W_(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 H_(n){if(n.errors)throw new Xa(n.errors);if(!n.value)throw new uc;return n.value}function q_(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=v=>{i.value={model:Zn(v)}};t.watch(()=>n.get(),v=>l(v),{immediate:!0});const c=()=>{var v;n.onSave(e(Zn((v=i.value)==null?void 0:v.model)))},d=()=>{l(n.get()),o.value=void 0},u=v=>{const C=pc(v);hc(C)?o.value=Error(mc(C)):o.value=C},p=v=>{o.value=void 0;try{e(v),r&&c()}catch(C){u(C)}},h=t.computed({get:()=>{var v;return(v=i.value)==null?void 0:v.model},set(v){l(v),p(v)}});t.watch(i,(v,C)=>{v&&v===C&&p(v.model)},{deep:!0});const g=t.computed(()=>!o.value),_=t.computed(()=>!Ht(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 G_(n,e,r){const o=n.validate??fc,{autoSave:i}=n,l=t.ref(),c=t.ref(),d=$=>{var L;if(r.deepPatchModel){const j=(L=c.value)==null?void 0:L.model,B=Object.assign(Zn($),e??{});c.value={model:j?Uf(j,B):B,stage:Symbol()}}else c.value={model:Object.assign(Zn($),e??{}),stage:Symbol()}};t.watch(()=>n.get(),$=>d($),{immediate:!0});const u=()=>{var $;n.onSave(o(Zn(($=c.value)==null?void 0:$.model)))},p=()=>{d(n.get()),l.value=void 0},h=$=>{const L=pc($);hc(L)?l.value=Error(mc(L)):l.value=L},g=$=>{l.value=void 0;try{o($),i&&u()}catch(L){h(L)}},_=t.computed({get:()=>{var $;return($=c.value)==null?void 0:$.model},set(){throw Error("Cannot replace base model")}});t.watch([()=>({args:_.value.args,ui:_.value.ui}),()=>{var $;return($=c.value)==null?void 0:$.stage}],([$,L],[j,B])=>{L===B&&g($)},{deep:!0});const w=t.computed(()=>!l.value),v=t.computed(()=>{var j;const{args:$,ui:L}=((j=t.unref(c))==null?void 0:j.model)??{};return!Ht(n.get(),{args:$,ui:L})}),C=t.computed(()=>l.value?l.value.message:"");return t.reactive({model:_,valid:w,isChanged:v,error:l,errorString:C,save:u,revert:p,setError:h})}const K_=n=>Object.fromEntries(new URL(n,"http://dummy").searchParams);function yc(n){return t.getCurrentScope()?(t.onScopeDispose(n),!0):!1}const X_=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Y_=n=>n!=null,J_=Object.prototype.toString,Q_=n=>J_.call(n)==="[object Object]",_c=()=>{};function ew(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 tw(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 nw(n){return t.getCurrentInstance()}function wc(n){return Array.isArray(n)?n:[n]}function bc(n,e=200,r={}){return ew(tw(e,r),n)}function rw(n,e=!0,r){nw()?t.onMounted(n,r):e?n():t.nextTick(n)}function ow(n,e,r){return t.watch(n,(i,l,c)=>{i&&e(i,l,c)},{...r,once:!1})}const kc=X_?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 _=Q_(g)?{...g}:g;l.push(...r.flatMap(w=>o.map(v=>d(h,w,v,_))))},{immediate:!0,flush:"post"}),p=()=>{u(),c()};return yc(p),p}function iw(){const n=t.ref(!1),e=t.getCurrentInstance();return e&&t.onMounted(()=>{n.value=!0},e),n}function Gf(n){const e=iw();return t.computed(()=>(e.value,!!n()))}function aw(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(Y_);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 sw(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 lw(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),v=t.ref(0);function C(){const L=Bo(n);if(!L){r&&(d.value=0,u.value=0,p.value=0,h.value=0,g.value=0,_.value=0,w.value=0,v.value=0);return}const j=L.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,v.value=j.y}function $(){c==="sync"?C():c==="next-frame"&&requestAnimationFrame(()=>C())}return sw(n,$),t.watch(()=>Bo(n),L=>!L&&$()),aw(n,$,{attributeFilter:["style","class"]}),i&&qf("scroll",$,{capture:!0,passive:!0}),o&&qf("resize",$,{passive:!0}),rw(()=>{l&&$()}),{height:d,bottom:u,left:p,right:h,top:g,width:_,x:w,y:v,update:$}}function cw(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=>{Ht(j,i.args)||e.setBlockArgs(j)},l,{maxWait:c}),u=bc(j=>{Ht(j,i.ui)||e.setBlockUiState(j)},l,{maxWait:c}),p=bc((j,B)=>{(!Ht(j,i.args)||!Ht(B,i.ui))&&e.setBlockArgsAndUiState(j,B)},l,{maxWait:c});e.onStateUpdates(async j=>{j.forEach(B=>{B.key==="args"&&!Ht(i.args,B.value)&&(i.args=Object.freeze(B.value),o("args patch",i.args)),B.key==="ui"&&!Ht(i.ui,B.value)&&(i.ui=Object.freeze(B.value),o("ui patch",i.ui)),B.key==="outputs"&&!Ht(i.outputs,B.value)&&(i.outputs=Object.freeze(B.value),o("outputs patch",i.outputs)),B.key==="navigationState"&&!Ht(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)}},v=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)}),$={snapshot:i,queryParams:t.computed(()=>K_(i.navigationState.href)),href:t.computed(()=>i.navigationState.href),hasErrors:t.computed(()=>Object.values(i.outputs).some(j=>!(j!=null&&j.ok)))},L=G_({get(){return{args:i.args,ui:i.ui}},autoSave:!0,onSave(j){p(j.args,j.ui)}},{outputs:v,outputErrors:C},r);return t.reactive(Object.assign(L,w,$))}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 dw=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(dw);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"]),br=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"]),uw=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class qt 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 qt))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()}}qt.create=n=>new qt(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 fw(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}},pw=[];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 vt{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 vt.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}),Tt=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 jn{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 qt(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 br(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:br(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new vt,ctx:{common:e.parent.common,data:e.data,parsedType:br(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:br(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:br(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 yn({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Wn.create(this,this._def)}nullable(){return Er.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gn.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 yn({...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 Pi.create(this,e)}readonly(){return Li.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const hw=/^c[^\s-]{8,}$/i,mw=/^[0-9a-z]+$/,gw=/^[0-9A-HJKMNP-TV-Z]{26}$/,yw=/^[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,_w=/^[a-z0-9_-]{21}$/i,ww=/^[-+]?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)?)??$/,bw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Cc;const xw=/^(?:(?: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])$/,vw=/^(([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})))$/,Ew=/^([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])))",Cw=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 Nw(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 Sw(n,e){return!!((e==="v4"||!e)&&xw.test(n)||(e==="v6"||!e)&&vw.test(n))}class mn 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 vt;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")bw.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(kw,"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")yw.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")_w.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")hw.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")mw.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")gw.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"?Cw.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?Nw(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"?ww.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"duration",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?Sw(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"?Ew.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 mn({...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 mn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new mn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new mn({...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}}mn.create=n=>{var e;return new mn({checks:[],typeName:we.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...Be(n)})};function Bw(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 kr 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 vt;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"?Bw(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 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]})}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)}}kr.create=n=>new kr({checks:[],typeName:we.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...Be(n)});class xr 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 vt;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 xr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new xr({...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}}xr.create=n=>{var e;return new xr({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 Tt(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 vt;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 Tt(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 Tt(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 Tt(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 Tt(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 Tt(e.data)}}Qr.create=n=>new Qr({typeName:we.ZodUnknown,...Be(n)});class rr extends Ae{_parse(e){const r=this._getOrReturnCtx(e);return ie(r,{code:ee.invalid_type,expected:se.never,received:r.parsedType}),ke}}rr.create=n=>new rr({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 Tt(e.data)}}ts.create=n=>new ts({typeName:we.ZodVoid,...Be(n)});class gn 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 jn(r,c,r.path,d)))).then(c=>vt.mergeArray(o,c));const l=[...r.data].map((c,d)=>i.type._parseSync(new jn(r,c,r.path,d)));return vt.mergeArray(o,l)}get element(){return this._def.type}min(e,r){return new gn({...this._def,minLength:{value:e,message:fe.toString(r)}})}max(e,r){return new gn({...this._def,maxLength:{value:e,message:fe.toString(r)}})}length(e,r){return new gn({...this._def,exactLength:{value:e,message:fe.toString(r)}})}nonempty(e){return this.min(1,e)}}gn.create=(n,e)=>new gn({type:n,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Be(e)});function Ro(n){if(n instanceof tt){const e={};for(const r in n.shape){const o=n.shape[r];e[r]=Wn.create(Ro(o))}return new tt({...n._def,shape:()=>e})}else return n instanceof gn?new gn({...n._def,type:Ro(n.element)}):n instanceof Wn?Wn.create(Ro(n.unwrap())):n instanceof Er?Er.create(Ro(n.unwrap())):n instanceof Un?Un.create(n.items.map(e=>Ro(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 rr&&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 jn(i,g,i.path,p)),alwaysSet:p in i.data})}if(this._def.catchall instanceof rr){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 jn(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=>vt.mergeObjectSync(o,p)):vt.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 Ro(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 Wn;)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:rr.create(),typeName:we.ZodObject,...Be(e)}),tt.strictCreate=(n,e)=>new tt({shape:()=>n,unknownKeys:"strict",catchall:rr.create(),typeName:we.ZodObject,...Be(e)}),tt.lazycreate=(n,e)=>new tt({shape:n,unknownKeys:"strip",catchall:rr.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 qt(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 qt(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 or=n=>n instanceof $i?or(n.schema):n instanceof yn?or(n.innerType()):n instanceof Oi?[n.value]:n instanceof vr?n.options:n instanceof Ii?Fe.objectValues(n.enum):n instanceof Di?or(n._def.innerType):n instanceof Bi?[void 0]:n instanceof Ti?[null]:n instanceof Wn?[void 0,...or(n.unwrap())]:n instanceof Er?[null,...or(n.unwrap())]:n instanceof Sc||n instanceof Li?or(n.unwrap()):n instanceof Mi?or(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=or(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=br(n),o=br(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 Un 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 jn(o,c,o.path,d)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>vt.mergeArray(r,c)):vt.mergeArray(r,l)}get items(){return this._def.items}rest(e){return new Un({...this._def,rest:e})}}Un.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Un({items:n,typeName:we.ZodTuple,rest:null,...Be(e)})};class Ri 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 jn(o,d,o.path,d)),value:c._parse(new jn(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?vt.mergeObjectAsync(r,i):vt.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,o){return r instanceof Ae?new Ri({keyType:e,valueType:r,typeName:we.ZodRecord,...Be(o)}):new Ri({keyType:mn.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 jn(o,d,o.path,[p,"key"])),value:l._parse(new jn(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 jn(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 $o 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 Tt(async function(...u){const p=new qt([]),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 Tt(function(...u){const p=d._def.args.safeParse(u,l);if(!p.success)throw new qt([o(u,p.error)]);const h=Reflect.apply(c,this,p.data),g=d._def.returns.safeParse(h,l);if(!g.success)throw new qt([i(h,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new $o({...this._def,args:Un.create(e).rest(Qr.create())})}returns(e){return new $o({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,o){return new $o({args:e||Un.create([]).rest(Qr.create()),returns:r||Qr.create(),typeName:we.ZodFunction,...Be(o)})}}class $i 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})}}$i.create=(n,e)=>new $i({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 vr({values:n,typeName:we.ZodEnum,...Be(e)})}class vr 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 Tt(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 vr.create(e,{...this._def,...r})}exclude(e,r=this._def){return vr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...r})}}Ci=new WeakMap,vr.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 Tt(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 Tt(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 yn 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)}}yn.create=(n,e,r)=>new yn({schema:n,typeName:we.ZodEffects,effect:e,...Be(r)}),yn.createWithPreprocess=(n,e,r)=>new yn({schema:e,effect:{type:"preprocess",transform:n},typeName:we.ZodEffects,...Be(r)});class Wn extends Ae{_parse(e){return this._getType(e)===se.undefined?Tt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Wn.create=(n,e)=>new Wn({innerType:n,typeName:we.ZodOptional,...Be(e)});class Er extends Ae{_parse(e){return this._getType(e)===se.null?Tt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Er.create=(n,e)=>new Er({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 qt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new qt(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 Tw=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 Pi 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 Pi({in:e,out:r,typeName:we.ZodPipeline})}}class Li 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}}Li.create=(n,e)=>new Li({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 Vw={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 Aw=(n,e={message:`Input not instance of ${n.name}`})=>rp(r=>r instanceof n,e),op=mn.create,ip=kr.create,Rw=os.create,$w=xr.create,ap=Si.create,Ow=Jr.create,Iw=es.create,Dw=Bi.create,Mw=Ti.create,Pw=Ao.create,Lw=Qr.create,Fw=rr.create,zw=ts.create,Zw=gn.create,jw=tt.create,Uw=tt.strictCreate,Ww=Vi.create,Hw=ns.create,qw=Ai.create,Gw=Un.create,Kw=Ri.create,Xw=rs.create,Yw=eo.create,Jw=$o.create,Qw=$i.create,e1=Oi.create,t1=vr.create,n1=Ii.create,r1=Oo.create,sp=yn.create,o1=Wn.create,i1=Er.create,a1=yn.createWithPreprocess,s1=Pi.create;var _n=Object.freeze({__proto__:null,defaultErrorMap:To,setErrorMap:fw,getErrorMap:Ya,makeIssue:Ja,EMPTY_PATH:pw,addIssueToContext:ie,ParseStatus:vt,INVALID:ke,DIRTY:Vo,OK:Tt,isAborted:vc,isDirty:Ec,isValid:vi,isAsync:Ei,get util(){return Fe},get objectUtil(){return xc},ZodParsedType:se,getParsedType:br,ZodType:Ae,datetimeRegex:tp,ZodString:mn,ZodNumber:kr,ZodBigInt:xr,ZodBoolean:Si,ZodDate:Jr,ZodSymbol:es,ZodUndefined:Bi,ZodNull:Ti,ZodAny:Ao,ZodUnknown:Qr,ZodNever:rr,ZodVoid:ts,ZodArray:gn,ZodObject:tt,ZodUnion:Vi,ZodDiscriminatedUnion:ns,ZodIntersection:Ai,ZodTuple:Un,ZodRecord:Ri,ZodMap:rs,ZodSet:eo,ZodFunction:$o,ZodLazy:$i,ZodLiteral:Oi,ZodEnum:vr,ZodNativeEnum:Ii,ZodPromise:Oo,ZodEffects:yn,ZodTransformer:yn,ZodOptional:Wn,ZodNullable:Er,ZodDefault:Di,ZodCatch:Mi,ZodNaN:os,BRAND:Tw,ZodBranded:Sc,ZodPipeline:Pi,ZodReadonly:Li,custom:rp,Schema:Ae,ZodSchema:Ae,late:Vw,get ZodFirstPartyTypeKind(){return we},coerce:{string:n=>mn.create({...n,coerce:!0}),number:n=>kr.create({...n,coerce:!0}),boolean:n=>Si.create({...n,coerce:!0}),bigint:n=>xr.create({...n,coerce:!0}),date:n=>Jr.create({...n,coerce:!0})},any:Pw,array:Zw,bigint:$w,boolean:ap,date:Ow,discriminatedUnion:Hw,effect:sp,enum:t1,function:Jw,instanceof:Aw,intersection:qw,lazy:Qw,literal:e1,map:Xw,nan:Rw,nativeEnum:n1,never:Fw,null:Mw,nullable:i1,number:ip,object:jw,oboolean:()=>ap().optional(),onumber:()=>ip().optional(),optional:o1,ostring:()=>op().optional(),pipeline:s1,preprocess:a1,promise:r1,record:Kw,set:Yw,strictObject:Uw,string:op,symbol:Iw,transformer:sp,tuple:Gw,undefined:Dw,union:Ww,unknown:Lw,void:zw,NEVER:ke,ZodIssueCode:ee,quotelessJson:uw,ZodError:qt});const l1=-2147483648,lp=-9007199254740991n,c1=null,d1=null;function u1(n,e){switch(e){case"Int":return n===l1;case"Long":return n===Number(lp)||n===lp;case"Float":return Number.isNaN(n);case"Double":return Number.isNaN(n);case"String":return n===c1;case"Bytes":return n===d1;default:throw Error(`unsupported data type: ${e}`)}}function f1(n,e){const r=Math.floor(e/8),o=1<<7-e%8;return(n[r]&o)>0}const p1={type:"absent"},cp=null;function h1(n){return typeof n=="object"&&n!==null&&n.type==="absent"}function is(n,e,r={}){if(f1(n.absent,e))return r.absent===void 0?p1:r.absent;const o=n.data[e],i=n.type;if(u1(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}}}_n.object({__isRef:_n.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:_n.string().describe("Upstream block id"),name:_n.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(),_n.string().length(24).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");function m1(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 g1=_n.object({type:_n.string(),importance:_n.number().optional(),id:_n.string().optional(),label:_n.string()});_n.array(g1);const y1="1.27.8";function as(){return m1({sdkVersion:y1})}function _1(n){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(n)}const w1=`.ag-header {
|
|
4
4
|
border-bottom: 1px solid var(--border-color-default);
|
|
5
5
|
}
|
|
6
6
|
|