@regojs/erp-sdk 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +24 -24
- package/dist/browser/index.js.map +8 -5
- package/dist/browser/vanilla/constants/enums.d.ts +4 -3
- package/dist/browser/vanilla/providers/regoProvider.d.ts +11 -3
- package/dist/browser/vanilla/types/regoProvider.d.ts +11 -2
- package/dist/browser/vanilla/validators/data.d.ts +3 -0
- package/dist/browser/vanilla/validators/index.d.ts +6 -0
- package/dist/browser/vanilla/validators/metadata.d.ts +3 -0
- package/dist/browser/vanilla/validators/staticData.d.ts +3 -0
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +3 -3
- package/dist/server/types/cms.app.d.ts +3 -4
- package/package.json +1 -6
- package/src/browser/vanilla/constants/enums.ts +4 -3
- package/src/browser/vanilla/providers/regoProvider.ts +181 -7
- package/src/browser/vanilla/types/regoProvider.ts +12 -2
- package/src/browser/vanilla/validators/data.ts +7 -0
- package/src/browser/vanilla/validators/index.ts +6 -0
- package/src/browser/vanilla/validators/metadata.ts +7 -0
- package/src/browser/vanilla/validators/staticData.ts +10 -0
- package/src/server/providers/cms.app.ts +3 -1
- package/src/server/types/cms.app.ts +3 -4
package/dist/browser/index.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var Yi=Object.defineProperty;var Hi=(e)=>e;function Qi(e,t){this[e]=Hi.bind(null,t)}var Mt=(e,t)=>{for(var r in t)Yi(e,r,{get:t[r],enumerable:!0,configurable:!0,set:Qi.bind(t,r)})};var Gi={};Mt(Gi,{Enums:()=>_e,RegoProvider:()=>Rt,routeSchema:()=>jt});var _e={};Mt(_e,{EScriptIds:()=>Ue});var Ue;((n)=>{n.routesId="rego-routes";n.dataId="rego-data";n.metadataId="rego-metadata"})(Ue||={});function ce(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Be(e,t="|"){return e.map((r)=>We(r)).join(t)}function ue(e,t){if(typeof t==="bigint")return t.toString();return t}class Jt{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function xe(e){return new Jt(e)}function Bt(e){return e===null||e===void 0}function ye(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function D(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function be(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function U(e){return be(e._zod.def)??e._zod.def.shape}function Vt(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return D(this,t,n),n},enumerable:!0,configurable:!0})}function Kt(e,t,r){if(t in e)D(e,t,r);else e[t]=r}function W(e,t,r,n){let o=U(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);if(!s.enumerable)continue;if(s.get)Vt(e,i,()=>{let c=t._zod.def.shape[i];return n?n(c,i):c});else Kt(e,i,n?n(s.value,i):s.value)}}function es(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);if(!n.enumerable)continue;if(n.get)Vt(e,r,()=>t[r]);else Kt(e,r,n.value)}}function A(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Wt(e){return JSON.stringify(e)}function Gt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ve="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function se(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var qt=xe(()=>{if(I.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function X(e){if(se(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(se(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function Ke(e){if(X(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var Xt=new Set(["string","number","symbol"]);function Y(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function L(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return n}function g(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function We(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Yt(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Ge=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),qe={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ts(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return W(i,e,ve(e,t)),L(e,A(r,{shape:i,checks:[]}))}function ve(e,t){let r=U(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw Error(`Unrecognized key: "${String(o)}"`);if(t[o])n.push(o)}return n}function rs(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(ve(e,t)),s={};return W(s,e,Reflect.ownKeys(U(e)).filter((c)=>!i.has(c))),L(e,A(r,{shape:s,checks:[]}))}function ns(e,t){if(!X(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=U(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return L(e,A(e._zod.def,{shape:Ht(e,t)}))}function Ht(e,t){let r={};return W(r,e,Reflect.ownKeys(U(e))),es(r,t),r}function os(e,t){if(!X(t))throw Error("Invalid input to safeExtend: expected a plain object");return L(e,A(e._zod.def,{shape:Ht(e,t)}))}function is(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};W(r,e,Reflect.ownKeys(U(e))),W(r,t,Reflect.ownKeys(U(t)));let n=A(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return L(e,n)}function Qt(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let c=r?new Set(ve(t,r)):void 0,u={};return W(u,t,Reflect.ownKeys(U(t)),e&&((a,l)=>c&&!c.has(l)?a:new e({type:"optional",innerType:a}))),L(t,A(t._zod.def,{shape:u,checks:[]}))}function ss(e,t,r){let n=r?new Set(ve(t,r)):void 0,o={};return W(o,t,Reflect.ownKeys(U(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),L(t,A(t._zod.def,{shape:o}))}function F(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function er(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function ae(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ie(e){return typeof e==="string"?e:e?.message}function Xe(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function V(e,t,r){var n;let o=e.inst?._zod?.traits;if(o?.has("$ZodType"))if(o.has("$ZodCheck"))(n=e).schema??(n.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ie(e.inst?._zod.def?.error?.(e))??ie(i?.(e))??ie(t?.error?.(e))??ie(r.customError?.(e))??ie(r.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e)){if(u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__")continue;c[u]=e[u]}if(c.path??(c.path=[]),c.message=s,t?.reportInput)c.input=e.input;return c}var cs=/[\uD800-\uDBFF]/;function ze(e){let t=e.length;if(!cs.test(e))return t;let r=t;for(let n=0;n<t-1;n++)if((e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320)r--,n++;return r}function $e(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function tr(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function G(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}function rr(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);if(n.get)Object.defineProperty(e,r,{...n,enumerable:!1});else Ut(e,r,n.value)}for(let r of Object.getOwnPropertySymbols(t))Ut(e,r,t[r])}function J(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Ye(e,t,r){return J(e,t,r,!1)}function us(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return J(this,r,n(this))},set(o){J(this,r,o)}})}return t}function Ut(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:J(this,t,r.bind(this))},set(n){J(this,t,n)}})}function as(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Je,B=!1,ls={configurable:!0,get(){B=!0;return}};function y(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&Je!==e._zod){Je=void 0;return}Je=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,ls);let o=B;B=!1;try{let i=r(this);if(B)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i});return B=B||o,i}catch(i){throw delete this[t],B=B||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function ps(e,t,r,n){let o=as(e,t);if(!o)return;Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var fs="~constantCatch";function nr(e){let t=()=>e;return t[fs]=!0,t}var or;var He={value:void 0,enumerable:!1},ir="captureStackTrace"in Error?Error:null;function ds(e){let t=ir;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return ir=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function p(e,t,r,n){let o={};function i(d){this.def=d,this.constr=f,this.traits=new Set}i.prototype=o;let s=r,c=s&&new WeakSet;function u(d,m){if(!d._zod){He.value=new i(m);try{Object.defineProperty(d,"_zod",He)}finally{He.value=void 0}}if(d._zod.traits.has(e))return;if(d._zod.traits.add(e),t(d,m),c){let _=Object.getPrototypeOf(d),x=d._zod.constr.prototype,P=_;while(P&&P!==x)P=Object.getPrototypeOf(P);let j=P??_;if(!c.has(j))c.add(j),rr(j,s)}let h=f.prototype;for(let _ in h){if(!Object.prototype.hasOwnProperty.call(h,_))continue;if(!(_ in d))d[_]=h[_].bind(d)}}let a=n?.Parent??Object;class l extends a{}Object.defineProperty(l,"name",{value:e});function f(d){let m=n?.Parent?ds(l):this;u(m,d);let h=m._zod.deferred;if(h){for(let x of h)x();m._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;if(_)_(m);return m}return Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:(d)=>{if(n?.Parent&&d instanceof n.Parent)return!0;return d?._zod?.traits?.has(e)}}),Object.defineProperty(f,"name",{value:e}),f}class M extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class le extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(or=globalThis).__zod_globalConfig??(or.__zod_globalConfig={});var I=globalThis.__zod_globalConfig;function C(e){if(e)Object.assign(I,e);return I}function ms(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,ue,2)),e.message}function hs(e){this._zod.message=e}var gs={get:ms,set:hs,enumerable:!0,configurable:!0},et={value:void 0,enumerable:!1},sr=new WeakSet([Object.prototype,Error.prototype]),cr=(e,t)=>{e.name="$ZodError",et.value=t,Object.defineProperty(e,"issues",et),et.value=void 0,Object.defineProperty(e,"message",gs);let r=Object.getPrototypeOf(e);if(!sr.has(r))sr.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}})},ur=p("$ZodError",cr),fu=p("$ZodError",cr,void 0,{Parent:Error});function _s(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function ar(e,t=(r)=>r.message){let r={},n=[];for(let o of e.issues)if(o.path.length>0)_s(r,o.path[0],()=>[]).push(t(o));else n.push(t(o));return{formErrors:n,fieldErrors:r}}function lr(e,t=(r)=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((c)=>n({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0)r._errors.push(t(s));else{let u=r,a=0;while(a<c.length){let l=c[a],f=a===c.length-1;if(l==="_errors"){if(f)u._errors.push(t(s));a++;continue}if(!Object.prototype.hasOwnProperty.call(u,l))Object.defineProperty(u,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let d=u[l];if(f)d._errors.push(t(s));u=d,a++}}}};return n(e),r}function we(e,t){return{callee:t?.callee??e,Err:t?.Err}}var ke=(e)=>{let t=(r,n,o,i)=>{let s=o?{...o,async:!1}:{async:!1},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new M;if(c.issues.length){let u=new(i?.Err??e)(c.issues.map((a)=>V(a,s,C())));throw Ve(u,i?.callee??t),u}return c.value};return t};var Ze=(e)=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:!0}:{async:!0},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise)c=await c;if(c.issues.length){let u=new(i?.Err??e)(c.issues.map((a)=>V(a,s,C())));throw Ve(u,i?.callee??t),u}return c.value};return t};var Pe=(e)=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new M;return i.issues.length?pr(e,i.issues,o):{success:!0,data:i.value}};function pr(e,t,r){let n;return{success:!1,get error(){if(!n)n=new e(t.map((o)=>V(o,r,C()))),t=void 0,r=void 0;return n},set error(o){n=o,t=void 0,r=void 0}}}var Se=(e)=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)i=await i;return i.issues.length?pr(e,i.issues,o):{success:!0,data:i.value}};var xs=Symbol.for("zod.compile.invalid"),ys=Symbol.for("zod.compile.fallback"),tt=(e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==xs)return!0;if(n.definite===!0&&r===void 0)return!1}return bs(e,t,r)};function bs(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o)n[ys]=!0,i=o({value:t,issues:[]},n);else i=e._zod.run({value:t,issues:[]},n);if(i instanceof Promise)throw new M;return i.issues.length===0}var rt=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);if(o instanceof Promise)o=await o;return o.issues.length===0},fr=(e)=>{let t=ke(e),r=(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,c,we(r,s))};return r};var dr=(e)=>{let t=ke(e),r=(n,o,i,s)=>t(n,o,i,we(r,s));return r};var mr=(e)=>{let t=Ze(e),r=async(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,c,we(r,s))};return r};var hr=(e)=>{let t=Ze(e),r=async(n,o,i,s)=>await t(n,o,i,we(r,s));return r};var gr=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Pe(e)(t,r,o)};var _r=(e)=>(t,r,n)=>Pe(e)(t,r,n);var xr=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Se(e)(t,r,o)};var yr=(e)=>async(t,r,n)=>Se(e)(t,r,n);var br=/^[cC][0-9a-z]{6,}$/,vr=/^[0-9a-z]+$/,zr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,$r=/^[0-9a-vA-V]{20}$/,wr=/^[A-Za-z0-9]{27}$/,kr=/^[a-zA-Z0-9_-]{21}$/;function Zr(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Pr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Sr=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ot=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var Or=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var vs="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Ir(){return new RegExp(vs,"u")}var Er=/^(?:(?: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])$/,Ar=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Tr=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Nr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Cr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,jr=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var Rr=/^https?$/,Dr=/^\+[1-9]\d{6,14}$/;var Lr="(?:(?:\\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])))";function zs(e){return new RegExp(`^${e}$`)}var Fr=zs(Lr);function nt(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Mr(e){return new RegExp(`^${nt(e)}$`)}function Ur(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${nt({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${nt({precision:e.precision})}`:r;return new RegExp(`^${Lr}T(?:${n})$`)}var Jr=/^[\s\S]{0,}$/;var Br=/^[^A-Z]*$/,Vr=/^[^a-z]*$/;var E=p("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var it=(e)=>{let t=e.value;return!Bt(t)&&t.length!==void 0};var Kr=p("$ZodCheckMaxLength",(e,t)=>{var r;E.init(e,t),(r=e._zod.def).when??(r.when=it),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>t.maximum?ze(o):i)<=t.maximum)return;let c=$e(o);n.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Wr=p("$ZodCheckMinLength",(e,t)=>{var r;E.init(e,t),(r=e._zod.def).when??(r.when=it),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>=t.minimum&&i<t.minimum*2?ze(o):i)>=t.minimum)return;let c=$e(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Gr=p("$ZodCheckLengthEquals",(e,t)=>{var r;E.init(e,t),(r=e._zod.def).when??(r.when=it),e._zod.check=(n)=>{let o=n.value,i=o.length,s=typeof o==="string"&&i>=t.length&&i<=t.length*2?ze(o):i;if(s===t.length)return;let c=$e(o),u=s>t.length;n.issues.push({origin:c,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),fe=p("$ZodCheckStringFormat",(e,t)=>{var r,n;if(E.init(e,t),t.pattern)(r=e._zod).check??(r.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})}),qr=p("$ZodCheckRegex",(e,t)=>{fe.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Xr=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Br),fe.init(e,t)}),Yr=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Vr),fe.init(e,t)}),Hr=p("$ZodCheckIncludes",(e,t)=>{E.init(e,t);let r=Y(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Qr=p("$ZodCheckStartsWith",(e,t)=>{E.init(e,t);let r=new RegExp(`^${Y(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),en=p("$ZodCheckEndsWith",(e,t)=>{E.init(e,t);let r=new RegExp(`.*${Y(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var tn=p("$ZodCheckOverwrite",(e,t)=>{E.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class st{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
2
|
+
var ls=Object.defineProperty;var ps=(e)=>e;function fs(e,t){this[e]=ps.bind(null,t)}var Yt=(e,t)=>{for(var r in t)ls(e,r,{get:t[r],enumerable:!0,configurable:!0,set:fs.bind(t,r)})};var cs={};Yt(cs,{Enums:()=>ve,RegoProvider:()=>qt,dataSchema:()=>Ge,metadataSchema:()=>Xe,routeSchema:()=>Wt,staticDataSchema:()=>He});var ve={};Yt(ve,{EScriptIds:()=>te});var te;((o)=>{o.routes="rego-routes";o.data="rego-data";o.metadata="rego-metadata";o.staticData="rego-static-data"})(te||={});function fe(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function et(e,t="|"){return e.map((r)=>nt(r)).join(t)}function de(e,t){if(typeof t==="bigint")return t.toString();return t}class er{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function $e(e){return new er(e)}function tr(e){return e===null||e===void 0}function ze(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function j(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function we(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function B(e){return we(e._zod.def)??e._zod.def.shape}function rr(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return j(this,t,n),n},enumerable:!0,configurable:!0})}function nr(e,t,r){if(t in e)j(e,t,r);else e[t]=r}function G(e,t,r,n){let o=B(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);if(!s.enumerable)continue;if(s.get)rr(e,i,()=>{let c=t._zod.def.shape[i];return n?n(c,i):c});else nr(e,i,n?n(s.value,i):s.value)}}function ds(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);if(!n.enumerable)continue;if(n.get)rr(e,r,()=>t[r]);else nr(e,r,n.value)}}function A(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function or(e){return JSON.stringify(e)}function ir(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var tt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function pe(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var sr=$e(()=>{if(I.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function X(e){if(pe(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(pe(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function rt(e){if(X(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var cr=new Set(["string","number","symbol"]);function re(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return n}function g(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function nt(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function ur(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var ot=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),it={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ms(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return G(i,e,ke(e,t)),F(e,A(r,{shape:i,checks:[]}))}function ke(e,t){let r=B(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw Error(`Unrecognized key: "${String(o)}"`);if(t[o])n.push(o)}return n}function hs(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(ke(e,t)),s={};return G(s,e,Reflect.ownKeys(B(e)).filter((c)=>!i.has(c))),F(e,A(r,{shape:s,checks:[]}))}function gs(e,t){if(!X(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=B(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return F(e,A(e._zod.def,{shape:ar(e,t)}))}function ar(e,t){let r={};return G(r,e,Reflect.ownKeys(B(e))),ds(r,t),r}function _s(e,t){if(!X(t))throw Error("Invalid input to safeExtend: expected a plain object");return F(e,A(e._zod.def,{shape:ar(e,t)}))}function xs(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};G(r,e,Reflect.ownKeys(B(e))),G(r,t,Reflect.ownKeys(B(t)));let n=A(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return F(e,n)}function lr(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let c=r?new Set(ke(t,r)):void 0,u={};return G(u,t,Reflect.ownKeys(B(t)),e&&((a,l)=>c&&!c.has(l)?a:new e({type:"optional",innerType:a}))),F(t,A(t._zod.def,{shape:u,checks:[]}))}function ys(e,t,r){let n=r?new Set(ke(t,r)):void 0,o={};return G(o,t,Reflect.ownKeys(B(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),F(t,A(t._zod.def,{shape:o}))}function M(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function pr(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function K(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function le(e){return typeof e==="string"?e:e?.message}function st(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function U(e,t,r){var n;let o=e.inst?._zod?.traits;if(o?.has("$ZodType"))if(o.has("$ZodCheck"))(n=e).schema??(n.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:le(e.inst?._zod.def?.error?.(e))??le(i?.(e))??le(t?.error?.(e))??le(r.customError?.(e))??le(r.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e)){if(u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__")continue;c[u]=e[u]}if(c.path??(c.path=[]),c.message=s,t?.reportInput)c.input=e.input;return c}var bs=/[\uD800-\uDBFF]/;function Ze(e){let t=e.length;if(!bs.test(e))return t;let r=t;for(let n=0;n<t-1;n++)if((e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320)r--,n++;return r}function Pe(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function fr(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function H(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}function dr(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);if(n.get)Object.defineProperty(e,r,{...n,enumerable:!1});else Qt(e,r,n.value)}for(let r of Object.getOwnPropertySymbols(t))Qt(e,r,t[r])}function V(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function ct(e,t,r){return V(e,t,r,!1)}function vs(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return V(this,r,n(this))},set(o){V(this,r,o)}})}return t}function Qt(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:V(this,t,r.bind(this))},set(n){V(this,t,n)}})}function $s(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Qe,W=!1,zs={configurable:!0,get(){W=!0;return}};function y(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&Qe!==e._zod){Qe=void 0;return}Qe=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,zs);let o=W;W=!1;try{let i=r(this);if(W)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i});return W=W||o,i}catch(i){throw delete this[t],W=W||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function ws(e,t,r,n){let o=$s(e,t);if(!o)return;Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var ks="~constantCatch";function mr(e){let t=()=>e;return t[ks]=!0,t}var hr;var ut={value:void 0,enumerable:!1},gr="captureStackTrace"in Error?Error:null;function Zs(e){let t=gr;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return gr=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function p(e,t,r,n){let o={};function i(d){this.def=d,this.constr=f,this.traits=new Set}i.prototype=o;let s=r,c=s&&new WeakSet;function u(d,m){if(!d._zod){ut.value=new i(m);try{Object.defineProperty(d,"_zod",ut)}finally{ut.value=void 0}}if(d._zod.traits.has(e))return;if(d._zod.traits.add(e),t(d,m),c){let _=Object.getPrototypeOf(d),x=d._zod.constr.prototype,w=_;while(w&&w!==x)w=Object.getPrototypeOf(w);let C=w??_;if(!c.has(C))c.add(C),dr(C,s)}let h=f.prototype;for(let _ in h){if(!Object.prototype.hasOwnProperty.call(h,_))continue;if(!(_ in d))d[_]=h[_].bind(d)}}let a=n?.Parent??Object;class l extends a{}Object.defineProperty(l,"name",{value:e});function f(d){let m=n?.Parent?Zs(l):this;u(m,d);let h=m._zod.deferred;if(h){for(let x of h)x();m._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;if(_)_(m);return m}return Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:(d)=>{if(n?.Parent&&d instanceof n.Parent)return!0;return d?._zod?.traits?.has(e)}}),Object.defineProperty(f,"name",{value:e}),f}class J extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class me extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(hr=globalThis).__zod_globalConfig??(hr.__zod_globalConfig={});var I=globalThis.__zod_globalConfig;function T(e){if(e)Object.assign(I,e);return I}function Ps(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,de,2)),e.message}function Ss(e){this._zod.message=e}var Os={get:Ps,set:Ss,enumerable:!0,configurable:!0},lt={value:void 0,enumerable:!1},_r=new WeakSet([Object.prototype,Error.prototype]),xr=(e,t)=>{e.name="$ZodError",lt.value=t,Object.defineProperty(e,"issues",lt),lt.value=void 0,Object.defineProperty(e,"message",Os);let r=Object.getPrototypeOf(e);if(!_r.has(r))_r.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}})},yr=p("$ZodError",xr),zu=p("$ZodError",xr,void 0,{Parent:Error});function Is(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function br(e,t=(r)=>r.message){let r={},n=[];for(let o of e.issues)if(o.path.length>0)Is(r,o.path[0],()=>[]).push(t(o));else n.push(t(o));return{formErrors:n,fieldErrors:r}}function vr(e,t=(r)=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((c)=>n({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0)r._errors.push(t(s));else{let u=r,a=0;while(a<c.length){let l=c[a],f=a===c.length-1;if(l==="_errors"){if(f)u._errors.push(t(s));a++;continue}if(!Object.prototype.hasOwnProperty.call(u,l))Object.defineProperty(u,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let d=u[l];if(f)d._errors.push(t(s));u=d,a++}}}};return n(e),r}function Se(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Oe=(e)=>{let t=(r,n,o,i)=>{let s=o?{...o,async:!1}:{async:!1},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new J;if(c.issues.length){let u=new(i?.Err??e)(c.issues.map((a)=>U(a,s,T())));throw tt(u,i?.callee??t),u}return c.value};return t};var Ie=(e)=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:!0}:{async:!0},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise)c=await c;if(c.issues.length){let u=new(i?.Err??e)(c.issues.map((a)=>U(a,s,T())));throw tt(u,i?.callee??t),u}return c.value};return t};var Ee=(e)=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new J;return i.issues.length?$r(e,i.issues,o):{success:!0,data:i.value}};function $r(e,t,r){let n;return{success:!1,get error(){if(!n)n=new e(t.map((o)=>U(o,r,T()))),t=void 0,r=void 0;return n},set error(o){n=o,t=void 0,r=void 0}}}var Ae=(e)=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)i=await i;return i.issues.length?$r(e,i.issues,o):{success:!0,data:i.value}};var Es=Symbol.for("zod.compile.invalid"),As=Symbol.for("zod.compile.fallback"),pt=(e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Es)return!0;if(n.definite===!0&&r===void 0)return!1}return Ts(e,t,r)};function Ts(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o)n[As]=!0,i=o({value:t,issues:[]},n);else i=e._zod.run({value:t,issues:[]},n);if(i instanceof Promise)throw new J;return i.issues.length===0}var ft=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);if(o instanceof Promise)o=await o;return o.issues.length===0},zr=(e)=>{let t=Oe(e),r=(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,c,Se(r,s))};return r};var wr=(e)=>{let t=Oe(e),r=(n,o,i,s)=>t(n,o,i,Se(r,s));return r};var kr=(e)=>{let t=Ie(e),r=async(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,c,Se(r,s))};return r};var Zr=(e)=>{let t=Ie(e),r=async(n,o,i,s)=>await t(n,o,i,Se(r,s));return r};var Pr=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Ee(e)(t,r,o)};var Sr=(e)=>(t,r,n)=>Ee(e)(t,r,n);var Or=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Ae(e)(t,r,o)};var Ir=(e)=>async(t,r,n)=>Ae(e)(t,r,n);var Er=/^[cC][0-9a-z]{6,}$/,Ar=/^[0-9a-z]+$/,Tr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Nr=/^[0-9a-vA-V]{20}$/,Cr=/^[A-Za-z0-9]{27}$/,jr=/^[a-zA-Z0-9_-]{21}$/;function Rr(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Dr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Lr=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,mt=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var Fr=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Ns="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Mr(){return new RegExp(Ns,"u")}var Ur=/^(?:(?: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])$/,Jr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Br=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Vr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Kr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Wr=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var qr=/^https?$/,Gr=/^\+[1-9]\d{6,14}$/;var Xr="(?:(?:\\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])))";function Cs(e){return new RegExp(`^${e}$`)}var Hr=Cs(Xr);function dt(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Yr(e){return new RegExp(`^${dt(e)}$`)}function Qr(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${dt({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${dt({precision:e.precision})}`:r;return new RegExp(`^${Xr}T(?:${n})$`)}var en=/^[\s\S]{0,}$/;var ht=/^-?\d+$/,Te=/^-?\d+(?:\.\d+)?$/;var tn=/^[^A-Z]*$/,rn=/^[^a-z]*$/;var E=p("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var gt=(e)=>{let t=e.value;return!tr(t)&&t.length!==void 0};var nn=p("$ZodCheckMaxLength",(e,t)=>{var r;E.init(e,t),(r=e._zod.def).when??(r.when=gt),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>t.maximum?Ze(o):i)<=t.maximum)return;let c=Pe(o);n.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),on=p("$ZodCheckMinLength",(e,t)=>{var r;E.init(e,t),(r=e._zod.def).when??(r.when=gt),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>=t.minimum&&i<t.minimum*2?Ze(o):i)>=t.minimum)return;let c=Pe(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),sn=p("$ZodCheckLengthEquals",(e,t)=>{var r;E.init(e,t),(r=e._zod.def).when??(r.when=gt),e._zod.check=(n)=>{let o=n.value,i=o.length,s=typeof o==="string"&&i>=t.length&&i<=t.length*2?Ze(o):i;if(s===t.length)return;let c=Pe(o),u=s>t.length;n.issues.push({origin:c,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ge=p("$ZodCheckStringFormat",(e,t)=>{var r,n;if(E.init(e,t),t.pattern)(r=e._zod).check??(r.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})}),cn=p("$ZodCheckRegex",(e,t)=>{ge.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),un=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tn),ge.init(e,t)}),an=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=rn),ge.init(e,t)}),ln=p("$ZodCheckIncludes",(e,t)=>{E.init(e,t);let r=re(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),pn=p("$ZodCheckStartsWith",(e,t)=>{E.init(e,t);let r=new RegExp(`^${re(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),fn=p("$ZodCheckEndsWith",(e,t)=>{E.init(e,t);let r=new RegExp(`.*${re(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var dn=p("$ZodCheckOverwrite",(e,t)=>{E.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class _t{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
3
3
|
`).filter((i)=>i),n=Math.min(...r.map((i)=>i.length-i.trimStart().length)),o=r.map((i)=>i.slice(n)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of o)this.content.push(i)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
4
4
|
${t.join(`
|
|
5
5
|
`)}
|
|
6
|
-
};`)(...Object.values(this.closed))}}var nn={major:4,minor:6,patch:1};var w=p("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nn;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(c,u,a)=>{if(c.memo)return c;let l=F(c),f;for(let d of u){if(d._zod.def.when){if(er(c))continue;if(!d._zod.def.when(c))continue}else if(l)continue;let m=c.issues.length,h=d._zod.check(c);if(h instanceof Promise&&a?.async===!1)throw new M;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{if(await h,c.issues.length===m)return;if(Xe(c.issues,m,e),!l)l=F(c,m)});else{if(c.issues.length===m)continue;if(Xe(c.issues,m,e),!l)l=F(c,m)}}if(f)return f.then(()=>c);return c},s=(c,u,a)=>{if(F(c))return c.aborted=!0,c;let l=i(u,o,a);if(l instanceof Promise){if(a.async===!1)throw new M;return l.then((f)=>e._zod.parse(f,a))}return e._zod.parse(l,a)};e._zod.run=(c,u)=>{if(u.skipChecks)return e._zod.parse(c,u);if(u.direction==="backward"){let l=e._zod.parse({value:c.value,issues:[]},{...u,skipChecks:!0});if(l instanceof Promise)return l.then((f)=>s(f,c,u));return s(l,c,u)}let a=e._zod.parse(c,u);if(a instanceof Promise){if(u.async===!1)throw new M;return a.then((l)=>i(l,o,u))}return i(a,o,u)}}},{get "~standard"(){return Ye(this,"~standard",ut(this))},set "~standard"(e){J(this,"~standard",e)}}),hn=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>V(r,t,C()))}:{value:e.value};async function ks(e,t){let r={async:!0};return hn(await e._zod.run({value:t,issues:[]},r),r)}function ut(e){return{validate:(t)=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return hn(n,r)}catch(n){}return ks(e,t)},vendor:"zod",version:1}}var Ee=p("$ZodString",(e,t)=>{w.init(e,t),e._zod.pattern=t.pattern??Jr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(o){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),b=p("$ZodStringFormat",(e,t)=>{fe.init(e,t),Ee.init(e,t)}),gn=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Sr),b.init(e,t)}),_n=p("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ot(n))}else t.pattern??(t.pattern=ot());b.init(e,t)}),xn=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Or),b.init(e,t)}),yn=1,bn=2;function Zs(e,t){if(!t.normalize&&t.protocol?.source===Rr.source&&!/^https?:\/\//i.test(e))return yn;try{return new URL(e)}catch{return bn}}var Ps=/[\t\n\r]/g;function Ss(e){return e.replace(Ps,"")}function Os(e,t){return t.lastIndex=0,t.test(e.hostname)}function Is(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var vn=p("$ZodURL",(e,t)=>{b.init(e,t),e._zod.check=(r)=>{try{let n=r.value.trim(),o=Zs(n,t);if(o===yn){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===bn){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(t.hostname&&!Os(o,t.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort});if(t.protocol&&!Is(o,t.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort});r.value=t.normalize?o.href:Ss(n);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),zn=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ir()),b.init(e,t)}),$n=p("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?kr:Zr(t.length)),b.init(e,t)}),wn=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=br),b.init(e,t)}),kn=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=vr),b.init(e,t)}),Zn=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=zr),b.init(e,t)}),Pn=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=$r),b.init(e,t)}),Sn=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=wr),b.init(e,t)}),On=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ur(t)),b.init(e,t)}),In=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Fr),b.init(e,t)}),En=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Mr(t)),b.init(e,t)}),An=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Pr),b.init(e,t)}),Tn=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Er),b.init(e,t)}),Es=/^[0-9a-fA-F:.]+$/;function Nn(e){if(!Es.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var Cn=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ar),b.init(e,t),e._zod.check=(r)=>{if(!Nn(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var jn=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Tr),b.init(e,t)});function As(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);if(`${o}`!==n)return!1;if(o<0||o>128)return!1;return Nn(r)}var Rn=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Nr),b.init(e,t),e._zod.check=(r)=>{if(!As(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function Dn(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var at=/^[0-9a-zA-Z+/]*={0,2}$/,Ln=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=at),b.init(e,t),e._zod.check=(r)=>{if(Dn(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Ae=/^[A-Za-z0-9_-]*$/;function Ts(e){if(!Ae.test(e))return!1;let t=e.replace(/[-_]/g,(n)=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Dn(r)}var Fn=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ae),b.init(e,t),e._zod.check=(r)=>{if(Ts(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Mn=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Dr),b.init(e,t)});function Ns(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}var Un=p("$ZodJWT",(e,t)=>{b.init(e,t),e._zod.check=(r)=>{if(Ns(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Jn=p("$ZodUnknown",(e,t)=>{w.init(e,t),e._zod.parse=(r)=>r}),Bn=p("$ZodNever",(e,t)=>{w.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function on(e,t,r){if(e.issues.length)t.issues.push(...ae(r,e.issues));t.value[r]=e.value}var Vn=p("$ZodArray",(e,t)=>{w.init(e,t);let r=I.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let s=[],c=o?.abortEarly;for(let u=0;u<i.length;u++){let a=i[u],l=t.element._zod.run({value:a,issues:[]},o);if(l instanceof Promise)s.push(l.then((f)=>on(f,n,u)));else if(on(l,n,u),c&&l.issues.length!==0&&F(l))break}if(s.length)return Promise.all(s).then(()=>n);return n}});function Ie(e,t,r,n,o,i){let s=r in n,c=i==="optional";if(!s&&c&&o==="optional")return;if(e.issues.length){if(o!==void 0&&c&&!s)return;t.issues.push(...ae(r,e.issues))}if(!s&&o===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(s)t.value[r]=void 0}else t.value[r]=e.value}var Cs=[];function Kn(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:Cs,o=n.length?[...t,...n]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=Yt(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function Wn(e,t,r,n,o,i,s){let c=[],u=o.keySet,a=o.catchall._zod,l=a.def.type,{optin:f,optout:d}=a,m=0;for(let h in t){if(s&&r.issues.length!==m){if(F(r,m))break;m=r.issues.length}if(u.has(h))continue;if(h==="__proto__"){if(l==="never")c.push(h);continue}if(l==="never"){c.push(h);continue}let _=a.run({value:t[h],issues:[]},n);if(_ instanceof Promise)e.push(_.then((x)=>Ie(x,r,h,t,f,d)));else Ie(_,r,h,t,f,d)}if(c.length)r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:i,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var js=p("$ZodObject",(e,t)=>{w.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let a=()=>{let l={...n};return Object.defineProperty(t,"shape",{value:l}),a.raw=l,l};a.raw=n,Object.defineProperty(t,"shape",{get:a})}let o=xe(()=>Kn(t));y(e,"propValues",(a)=>{let l=a.def.shape,f={};for(let d in l){let m=l[d]._zod;if(m.values){if(!Object.prototype.hasOwnProperty.call(f,d))D(f,d,new Set);for(let h of m.values)f[d].add(h);if(m.optin!==void 0)f[d].add(void 0)}}return f});let i=se,s=t.catchall,c,u=I.memoizer;u?.attach(e),e._zod.parse=(a,l)=>{c??(c=o.value);let f=a.value;if(!i(f))return a.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),a;a.value=u?u.alloc(e,a,{},l):{};let d=[],m=c.shape,h=l?.abortEarly,_=a.issues.length;for(let x of c.allKeys){if(h&&a.issues.length!==_){if(F(a,_))break;_=a.issues.length}if(x==="__proto__")continue;let P=m[x],j=P._zod.optin,ne=P._zod.optout,oe=P._zod.run({value:f[x],issues:[]},l);if(oe instanceof Promise)d.push(oe.then((k)=>Ie(k,a,x,f,j,ne)));else Ie(oe,a,x,f,j,ne)}if(!s)return d.length?Promise.all(d).then(()=>a):a;return Wn(d,f,a,l,o.value,e,h===!0)}}),Gn=p("$ZodObjectJIT",(e,t)=>{js.init(e,t);let r=e._zod.parse,n=xe(()=>Kn(t)),o=I.memoizer,i=(m)=>{let h=n.value,_=h.symbolKeys,x=new st(["payload","ctx"],{shape:m,inst:e,memo:o,syms:_}),P=(k)=>`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`,j=(k,v)=>`
|
|
7
|
-
let ${
|
|
8
|
-
for (let i = 0; i < ${
|
|
9
|
-
const iss = ${
|
|
6
|
+
};`)(...Object.values(this.closed))}}var hn={major:4,minor:6,patch:1};var k=p("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=hn;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(c,u,a)=>{if(c.memo)return c;let l=M(c),f;for(let d of u){if(d._zod.def.when){if(pr(c))continue;if(!d._zod.def.when(c))continue}else if(l)continue;let m=c.issues.length,h=d._zod.check(c);if(h instanceof Promise&&a?.async===!1)throw new J;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{if(await h,c.issues.length===m)return;if(st(c.issues,m,e),!l)l=M(c,m)});else{if(c.issues.length===m)continue;if(st(c.issues,m,e),!l)l=M(c,m)}}if(f)return f.then(()=>c);return c},s=(c,u,a)=>{if(M(c))return c.aborted=!0,c;let l=i(u,o,a);if(l instanceof Promise){if(a.async===!1)throw new J;return l.then((f)=>e._zod.parse(f,a))}return e._zod.parse(l,a)};e._zod.run=(c,u)=>{if(u.skipChecks)return e._zod.parse(c,u);if(u.direction==="backward"){let l=e._zod.parse({value:c.value,issues:[]},{...u,skipChecks:!0});if(l instanceof Promise)return l.then((f)=>s(f,c,u));return s(l,c,u)}let a=e._zod.parse(c,u);if(a instanceof Promise){if(u.async===!1)throw new J;return a.then((l)=>i(l,o,u))}return i(a,o,u)}}},{get "~standard"(){return ct(this,"~standard",yt(this))},set "~standard"(e){V(this,"~standard",e)}}),Zn=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>U(r,t,T()))}:{value:e.value};async function js(e,t){let r={async:!0};return Zn(await e._zod.run({value:t,issues:[]},r),r)}function yt(e){return{validate:(t)=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return Zn(n,r)}catch(n){}return js(e,t)},vendor:"zod",version:1}}var je=p("$ZodString",(e,t)=>{k.init(e,t),e._zod.pattern=t.pattern??en,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(o){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),b=p("$ZodStringFormat",(e,t)=>{ge.init(e,t),je.init(e,t)}),Pn=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Lr),b.init(e,t)}),Sn=p("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=mt(n))}else t.pattern??(t.pattern=mt());b.init(e,t)}),On=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Fr),b.init(e,t)}),In=1,En=2;function Rs(e,t){if(!t.normalize&&t.protocol?.source===qr.source&&!/^https?:\/\//i.test(e))return In;try{return new URL(e)}catch{return En}}var Ds=/[\t\n\r]/g;function Ls(e){return e.replace(Ds,"")}function Fs(e,t){return t.lastIndex=0,t.test(e.hostname)}function Ms(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var An=p("$ZodURL",(e,t)=>{b.init(e,t),e._zod.check=(r)=>{try{let n=r.value.trim(),o=Rs(n,t);if(o===In){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===En){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(t.hostname&&!Fs(o,t.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort});if(t.protocol&&!Ms(o,t.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort});r.value=t.normalize?o.href:Ls(n);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Tn=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Mr()),b.init(e,t)}),Nn=p("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?jr:Rr(t.length)),b.init(e,t)}),Cn=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Er),b.init(e,t)}),jn=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ar),b.init(e,t)}),Rn=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Tr),b.init(e,t)}),Dn=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Nr),b.init(e,t)}),Ln=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Cr),b.init(e,t)}),Fn=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Qr(t)),b.init(e,t)}),Mn=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Hr),b.init(e,t)}),Un=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Yr(t)),b.init(e,t)}),Jn=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Dr),b.init(e,t)}),Bn=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ur),b.init(e,t)}),Us=/^[0-9a-fA-F:.]+$/;function Vn(e){if(!Us.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var Kn=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Jr),b.init(e,t),e._zod.check=(r)=>{if(!Vn(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var Wn=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Br),b.init(e,t)});function Js(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);if(`${o}`!==n)return!1;if(o<0||o>128)return!1;return Vn(r)}var qn=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Vr),b.init(e,t),e._zod.check=(r)=>{if(!Js(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function Gn(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var bt=/^[0-9a-zA-Z+/]*={0,2}$/,Xn=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=bt),b.init(e,t),e._zod.check=(r)=>{if(Gn(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Re=/^[A-Za-z0-9_-]*$/;function Bs(e){if(!Re.test(e))return!1;let t=e.replace(/[-_]/g,(n)=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Gn(r)}var Hn=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Re),b.init(e,t),e._zod.check=(r)=>{if(Bs(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Yn=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Gr),b.init(e,t)});function Vs(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}var Qn=p("$ZodJWT",(e,t)=>{b.init(e,t),e._zod.check=(r)=>{if(Vs(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var eo=p("$ZodUnknown",(e,t)=>{k.init(e,t),e._zod.parse=(r)=>r}),to=p("$ZodNever",(e,t)=>{k.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function gn(e,t,r){if(e.issues.length)t.issues.push(...K(r,e.issues));t.value[r]=e.value}var ro=p("$ZodArray",(e,t)=>{k.init(e,t);let r=I.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let s=[],c=o?.abortEarly;for(let u=0;u<i.length;u++){let a=i[u],l=t.element._zod.run({value:a,issues:[]},o);if(l instanceof Promise)s.push(l.then((f)=>gn(f,n,u)));else if(gn(l,n,u),c&&l.issues.length!==0&&M(l))break}if(s.length)return Promise.all(s).then(()=>n);return n}});function Ce(e,t,r,n,o,i){let s=r in n,c=i==="optional";if(!s&&c&&o==="optional")return;if(e.issues.length){if(o!==void 0&&c&&!s)return;t.issues.push(...K(r,e.issues))}if(!s&&o===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(s)t.value[r]=void 0}else t.value[r]=e.value}var Ks=[];function no(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:Ks,o=n.length?[...t,...n]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=ur(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function oo(e,t,r,n,o,i,s){let c=[],u=o.keySet,a=o.catchall._zod,l=a.def.type,{optin:f,optout:d}=a,m=0;for(let h in t){if(s&&r.issues.length!==m){if(M(r,m))break;m=r.issues.length}if(u.has(h))continue;if(h==="__proto__"){if(l==="never")c.push(h);continue}if(l==="never"){c.push(h);continue}let _=a.run({value:t[h],issues:[]},n);if(_ instanceof Promise)e.push(_.then((x)=>Ce(x,r,h,t,f,d)));else Ce(_,r,h,t,f,d)}if(c.length)r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:i,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var Ws=p("$ZodObject",(e,t)=>{k.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let a=()=>{let l={...n};return Object.defineProperty(t,"shape",{value:l}),a.raw=l,l};a.raw=n,Object.defineProperty(t,"shape",{get:a})}let o=$e(()=>no(t));y(e,"propValues",(a)=>{let l=a.def.shape,f={};for(let d in l){let m=l[d]._zod;if(m.values){if(!Object.prototype.hasOwnProperty.call(f,d))j(f,d,new Set);for(let h of m.values)f[d].add(h);if(m.optin!==void 0)f[d].add(void 0)}}return f});let i=pe,s=t.catchall,c,u=I.memoizer;u?.attach(e),e._zod.parse=(a,l)=>{c??(c=o.value);let f=a.value;if(!i(f))return a.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),a;a.value=u?u.alloc(e,a,{},l):{};let d=[],m=c.shape,h=l?.abortEarly,_=a.issues.length;for(let x of c.allKeys){if(h&&a.issues.length!==_){if(M(a,_))break;_=a.issues.length}if(x==="__proto__")continue;let w=m[x],C=w._zod.optin,ue=w._zod.optout,ae=w._zod.run({value:f[x],issues:[]},l);if(ae instanceof Promise)d.push(ae.then((S)=>Ce(S,a,x,f,C,ue)));else Ce(ae,a,x,f,C,ue)}if(!s)return d.length?Promise.all(d).then(()=>a):a;return oo(d,f,a,l,o.value,e,h===!0)}}),io=p("$ZodObjectJIT",(e,t)=>{Ws.init(e,t);let r=e._zod.parse,n=$e(()=>no(t)),o=I.memoizer,i=(m)=>{let h=n.value,_=h.symbolKeys,x=new _t(["payload","ctx"],{shape:m,inst:e,memo:o,syms:_}),w=(S)=>`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`,C=(S,v)=>`
|
|
7
|
+
let ${S}_ab = false;
|
|
8
|
+
for (let i = 0; i < ${S}.issues.length; i++) {
|
|
9
|
+
const iss = ${S}.issues[i];
|
|
10
10
|
iss.path = iss.path ? [${v}, ...iss.path] : [${v}];
|
|
11
11
|
payload.issues.push(iss);
|
|
12
|
-
if (iss.continue !== true) ${
|
|
12
|
+
if (iss.continue !== true) ${S}_ab = true;
|
|
13
13
|
}
|
|
14
|
-
if (${
|
|
14
|
+
if (${S}_ab && ctx && ctx.abortEarly) {
|
|
15
15
|
payload.value = newResult;
|
|
16
16
|
return payload;
|
|
17
|
-
}`;x.write("const input = payload.value;");let
|
|
18
|
-
const ${v}_present = ${
|
|
17
|
+
}`;x.write("const input = payload.value;");let ue=Object.create(null),ae=0;for(let S of h.allKeys)ue[S]=`key_${ae++}`;x.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let S of h.allKeys){if(S==="__proto__")continue;let v=ue[S],L=typeof S==="symbol"?`syms[${_.indexOf(S)}]`:or(S),Ye=`${L} in input`,Gt=m[S],Xt=Gt?._zod?.optin,Ht=Xt!==void 0,us=Gt?._zod?.optout==="optional";if(x.write(`const ${v} = ${w(L)};`),Ht&&us){let as=Xt==="optional"?`${v}_present`:`${v}.value !== undefined || ${v}_present`;x.write(`
|
|
18
|
+
const ${v}_present = ${Ye};
|
|
19
19
|
if (!${v}.issues.length || ${v}_present) {
|
|
20
|
-
if (${v}.issues.length) {${
|
|
20
|
+
if (${v}.issues.length) {${C(v,L)}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
if (${
|
|
24
|
-
newResult[${
|
|
23
|
+
if (${as}) {
|
|
24
|
+
newResult[${L}] = ${v}.value;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
`)}else if(!
|
|
29
|
-
const ${v}_present = ${
|
|
30
|
-
if (${v}.issues.length) {${
|
|
28
|
+
`)}else if(!Ht)x.write(`
|
|
29
|
+
const ${v}_present = ${Ye};
|
|
30
|
+
if (${v}.issues.length) {${C(v,L)}
|
|
31
31
|
}
|
|
32
32
|
if (!${v}_present && !${v}.issues.length) {
|
|
33
33
|
payload.issues.push({
|
|
34
34
|
code: "invalid_type",
|
|
35
35
|
expected: "nonoptional",
|
|
36
36
|
input: undefined,
|
|
37
|
-
path: [${
|
|
37
|
+
path: [${L}]
|
|
38
38
|
});
|
|
39
39
|
if (ctx && ctx.abortEarly) {
|
|
40
40
|
payload.value = newResult;
|
|
@@ -43,23 +43,23 @@ ${t.join(`
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
if (${v}_present) {
|
|
46
|
-
newResult[${
|
|
46
|
+
newResult[${L}] = ${v}.value;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
`);else x.write(`
|
|
50
|
-
if (${v}.issues.length) {${
|
|
50
|
+
if (${v}.issues.length) {${C(v,L)}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
if (${v}.value === undefined) {
|
|
54
|
-
if (${
|
|
55
|
-
newResult[${
|
|
54
|
+
if (${Ye}) {
|
|
55
|
+
newResult[${L}] = undefined;
|
|
56
56
|
}
|
|
57
57
|
} else {
|
|
58
|
-
newResult[${
|
|
58
|
+
newResult[${L}] = ${v}.value;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
`)}return x.write("payload.value = newResult;"),x.write("return payload;"),x.compile()},s,c=se,u=!I.jitless,l=u&&qt.value,f=t.catchall,d;e._zod.parse=(m,h)=>{d??(d=n.value);let _=m.value;if(!c(_))return m.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),m;if(u&&l&&h?.async===!1&&h.jitless!==!0){if(!s)s=i(t.shape);if(m=s(m,h),!f)return m;return Wn([],_,m,h,d,e,h?.abortEarly===!0)}return r(m,h)}});function sn(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter((i)=>!F(i));if(o.length===1)return t.value=o[0].value,o[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((s)=>V(s,n,C())))}),t}var qn=p("$ZodUnion",(e,t)=>{w.init(e,t),y(e,"optin",(n)=>n.def.options.some((o)=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some((o)=>o._zod.optin!==void 0)?"optional":void 0),y(e,"optout",(n)=>n.def.options.some((o)=>o._zod.optout==="optional")?"optional":void 0),y(e,"values",(n)=>{if(n.def.options.every((o)=>o._zod.values))return new Set(n.def.options.flatMap((o)=>Array.from(o._zod.values)));return}),y(e,"pattern",(n)=>{if(n.def.options.every((o)=>o._zod.pattern)){let o=n.def.options.map((i)=>i._zod.pattern);return new RegExp(`^(${o.map((i)=>ye(i.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,s=[];for(let c of t.options){let u=c._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)s.push(u),i=!0;else{if(u.issues.length===0)return u;s.push(u)}}if(!i)return sn(s,n,e,o);return Promise.all(s).then((c)=>sn(c,n,e,o))}});var Xn=p("$ZodIntersection",(e,t)=>{w.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([u,a])=>cn(r,u,a));return cn(r,i,s)}});function ct(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(X(e)&&X(t)){let r=Object.keys(t),n=Object.keys(e).filter((i)=>r.indexOf(i)!==-1),o={...e,...t};if(Object.prototype.hasOwnProperty.call(o,"__proto__"))delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let s=ct(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=ct(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function cn(e,t,r){let n=new Map,o,i=new Map,s=(a,l)=>{let f;if(a.code==="unrecognized_keys"&&!a.path?.length)o??(o=a),f=a.keys;else if(a.code==="invalid_key"&&a.origin==="record"&&a.path?.length===1){let d=String(a.path[0]);if(!i.has(d))i.set(d,a);f=[d]}else return!1;for(let d of f){if(!n.has(d))n.set(d,{});n.get(d)[l]=!0}return!0};for(let a of t.issues)if(!s(a,"l"))e.issues.push(a);for(let a of r.issues)if(!s(a,"r"))e.issues.push(a);let c=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(c.length){let a=o?c.filter((l)=>o.keys.includes(l)):[];if(a.length)e.issues.push({...o,keys:a});for(let l of c)if(!a.includes(l)&&i.has(l))e.issues.push(i.get(l))}let u=ct(t.value,r.value);if(!u.valid){if(F(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}var Yn=p("$ZodEnum",(e,t)=>{w.init(e,t);let r=ce(t.entries),n=new Set(r);e._zod.values=n,y(e,"pattern",(o)=>{let i=ce(o.def.entries).filter((s)=>Xt.has(typeof s));return new RegExp(i.length?`^(${i.map((s)=>Y(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;if(n.has(s))return o;return o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}});var Hn=p("$ZodTransform",(e,t)=>{w.init(e,t),e._zod.optin="optional",I.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new le(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then((s)=>(r.value=s,r));if(o instanceof Promise)throw new M;return r.value=o,r}});function un(e,t){return e.value=t.issues.length?void 0:t.value,e}var lt=p("$ZodOptional",(e,t)=>{w.init(e,t),y(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",y(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),y(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${ye(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((i)=>un(r,i));return un(r,o)}return t.innerType._zod.run(r,n)}}),Qn=p("$ZodExactOptional",(e,t)=>{lt.init(e,t),y(e,"values",(r)=>r.def.innerType._zod.values),y(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),eo=p("$ZodNullable",(e,t)=>{w.init(e,t),y(e,"optin",(r)=>r.def.innerType._zod.optin),y(e,"optout",(r)=>r.def.innerType._zod.optout),y(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${ye(n.source)}|null)$`):void 0}),y(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>{if(r.value===null)return r;return t.innerType._zod.run(r,n)}}),to=p("$ZodDefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",y(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>an(i,t));return an(o,t)}});function an(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var ro=p("$ZodPrefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",y(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,n)}}),no=p("$ZodNonOptional",(e,t)=>{w.init(e,t),y(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>ln(i,e));return ln(o,e)}});function ln(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function pn(e,t,r,n){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((o)=>V(o,n,C()))},input:e.value}),e}var oo=p("$ZodCatch",(e,t)=>{w.init(e,t),y(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),y(e,"optout",(r)=>r.def.innerType._zod.optout),y(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((i)=>pn(r,i,t,n));return pn(r,o,t,n)}});var io=p("$ZodPipe",(e,t)=>{w.init(e,t),y(e,"values",(r)=>r.def.in._zod.values),y(e,"optin",(r)=>r.def.in._zod.optin),y(e,"optout",(r)=>r.def.out._zod.optout),y(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);if(i instanceof Promise)return i.then((s)=>Oe(s,t.in,n));return Oe(i,t.in,n)}let o=t.in._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>Oe(i,t.out,n));return Oe(o,t.out,n)}});function Oe(e,t,r){if(e.issues.some((n)=>n.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var so=p("$ZodReadonly",(e,t)=>{w.init(e,t),y(e,"propValues",(r)=>r.def.innerType._zod.propValues),y(e,"values",(r)=>r.def.innerType._zod.values),y(e,"optin",(r)=>r.def.innerType?._zod?.optin),y(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then(fn);return fn(o)}});function fn(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var co=p("$ZodCustom",(e,t)=>{E.init(e,t),w.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=(r)=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then((i)=>dn(i,r,n,e));dn(o,r,n,e);return}});function dn(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};if(n._zod.def.params)o.params=n._zod.def.params;t.issues.push(G(o))}}function mn(e,t,r){if(e.issues.length)t.issues.push(...ae(r,e.issues))}var Rs=p("$ZodProperties",(e,t)=>{w.init(e,t),E.init(e,t);let r=I.memoizer;r?.attach(e);let n,o=(i,s)=>{n??(n=Reflect.ownKeys(t.shape).map((a)=>[a,t.shape[a]]));let c=i.value,u;for(let[a,l]of n){let f=l._zod.run({value:c[a],issues:[]},s);if(f instanceof Promise)u??(u=[]),u.push(f.then((d)=>mn(d,i,a)));else mn(f,i,a)}if(u)return Promise.all(u).then(()=>{return});return};e._zod.parse=(i,s)=>{let c=i.value;if(c===null||typeof c!=="object"&&typeof c!=="function")return i.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),i;if(s.direction==="backward")s={...s,direction:"forward"};if(r)r.alloc(e,i,c,s);let u=o(i,s);return u instanceof Promise?u.then(()=>i):i},e._zod.check=(i)=>{if(i.value==null){i.issues.push({expected:"object",code:"invalid_type",input:i.value,inst:e});return}return o(i,{})}},{*[Symbol.iterator](){yield this}});class ao extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var ft="~memo",uo=[];function lo(e){return e!==null&&(typeof e==="object"||typeof e==="function")}function pt(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var po=new WeakMap,de=0,Ce=1,me=2;function je(e,t,r){let n=po.get(e);if(n!==void 0)return n?me:de;if(t.has(e))return me;t.add(e);let o=de,i=(l)=>{if(o!==me&&l?._zod){let f=je(l,t,r);if(f>o)o=f}},s=(l,f)=>{let d=de;for(let m of Reflect.ownKeys(l)){let h=Object.getOwnPropertyDescriptor(l,m);if(f&&!h.enumerable)continue;let _=h.get?Ce:h.value?._zod?je(h.value,t,r):de;if(_>d)d=_}return d},c=(l)=>{if(l>o)o=l},u=e._zod.def,a=u.type;switch(a){case"object":{let l=be(u);c(l?s(l,!0):Ce),i(u.catchall);break}case"properties":c(s(u.shape,!1));break;case"array":i(u.element);break;case"tuple":for(let l of u.items)i(l);i(u.rest);break;case"record":case"map":i(u.keyType),i(u.valueType);break;case"set":i(u.valueType);break;case"union":for(let l of u.options)i(l);break;case"intersection":i(u.left),i(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(u.innerType);break;case"pipe":i(u.in),i(u.out);break;case"function":i(u.input),i(u.output);break;case"lazy":{let l=u._cachedInner??(r?e._zod.innerType:void 0);c(l?je(l,t,!1):Ce);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let l in u){let f=Object.getOwnPropertyDescriptor(u,l);if(!f||f.get)continue;let d=f.value;if(!d||typeof d!=="object")continue;if(d._zod)i(d);else if(Array.isArray(d))for(let m of d)i(m)}}return t.delete(e),Ds(e,o)}function Ds(e,t){if(t!==Ce)po.set(e,t===me);return t}function Ls(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var Te,Ne=[],Fs={alloc(e,t,r){let n=Te;if(!n)return r;Te=void 0;let o={value:r,issues:null};return n.set(t.value,o),Ne.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&Ms(i,o.value))throw new ao;return r(o,i)};if(e._zod.parse=n,e._zod.run===r)e._zod.run=n})},attach(e){var t;let r,n=!1,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,c=(u,a)=>{if(r===void 0){let P=je(e,new Set,!1);if(P===de){if(e._zod.parse=s,e._zod.run===c)e._zod.run=s;return s(u,a)}if(P===me||n)r=!0;else n=!0}let l=u.value;if(!lo(l))return s(u,a);let f=a[ft];if(!f)f={buckets:new WeakMap,backEdges:void 0},a[ft]=f;let d;if(o===a)d=i;else d=Ls(f,e),o=a,i=d;let m=d.get(l);if(m){if(u.value=m.value,m.issues){if(m.issues.length)u.issues.push(...pt(m.issues))}else u.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value);return u}Te=d;let h=Ne.length,_=s(u,a);Te=void 0;let x=Ne.length>h?Ne.pop():void 0;if(_ instanceof Promise)return _.then((P)=>{if(x)x.issues=P.issues.length?pt(P.issues):uo;return P});if(x)x.issues=_.issues.length?pt(_.issues):uo;return _};if(e._zod.parse=c,e._zod.run===s)e._zod.run=c})}};function fo(){return Fs}function Ms(e,t){let r=e[ft]?.backEdges;return r!==void 0&&lo(t)&&r.has(t)}var Us=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,s){if(i==="number"&&typeof s==="number"&&!Number.isFinite(s))return String(s);return n[i]??i}return(i)=>{switch(i.code){case"invalid_type":{let s=o(i.expected),c=tr(i.input),u=o(c,i.input);return`Invalid input: expected ${s}, received ${u}`}case"invalid_value":if(i.values.length===1)return`Invalid input: expected ${We(i.values[0])}`;return`Invalid option: expected one of ${Be(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",c=t(i.origin);if(c)return`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${c.unit??"elements"}`;return`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",c=t(i.origin);if(c)return`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${c.unit}`;return`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;if(s.format==="starts_with")return`Invalid string: must start with "${s.prefix}"`;if(s.format==="ends_with")return`Invalid string: must end with "${s.suffix}"`;if(s.format==="includes")return`Invalid string: must include "${s.includes}"`;if(s.format==="regex")return`Invalid string: must match pattern ${s.pattern}`;return`Invalid ${r[s.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${Be(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":if(i.options&&Array.isArray(i.options)&&i.options.length>0)return`Invalid discriminator value. Expected ${i.options.map((c)=>`'${c}'`).join(" | ")}`;if(i.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function dt(){return{localeError:Us()}}var mo;class ho{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Js(){return new ho}(mo=globalThis).__zod_globalRegistry??(mo.__zod_globalRegistry=Js());var q=globalThis.__zod_globalRegistry;function go(e,t){return new e({type:"string",...g(t)})}function _o(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function xo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function yo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function bo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function vo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function zo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function $o(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function wo(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function ko(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function Zo(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function Po(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function So(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function Oo(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function Io(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function Eo(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function Ao(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function To(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function No(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function Co(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function jo(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function Ro(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function Do(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function Lo(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function Fo(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function Mo(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function Uo(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function Jo(e){return new e({type:"unknown"})}function Bo(e,t){return new e({type:"never",...g(t)})}function Re(e,t){return new Kr({check:"max_length",...g(t),maximum:e})}function H(e,t){return new Wr({check:"min_length",...g(t),minimum:e})}function De(e,t){return new Gr({check:"length_equals",...g(t),length:e})}function mt(e,t){return new qr({check:"string_format",format:"regex",...g(t),pattern:e})}function ht(e){return new Xr({check:"string_format",format:"lowercase",...g(e)})}function gt(e){return new Yr({check:"string_format",format:"uppercase",...g(e)})}function _t(e,t){return new Hr({check:"string_format",format:"includes",...g(t),includes:e})}function xt(e,t){return new Qr({check:"string_format",format:"starts_with",...g(t),prefix:e})}function yt(e,t){return new en({check:"string_format",format:"ends_with",...g(t),suffix:e})}function K(e){return new tn({check:"overwrite",tx:e})}function bt(e){return K((t)=>t.normalize(e))}function vt(){return K((e)=>e.trim())}function zt(){return K((e)=>e.toLowerCase())}function $t(){return K((e)=>e.toUpperCase())}function wt(){return K((e)=>Gt(e))}function Vo(e,t,r){return new e({type:"array",element:t,...g(r)})}function Ko(e,t,r){return new e({type:"custom",check:"custom",fn:t,...g(r)})}function Wo(e,t){let r=Bs((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(G(o,n.value,r._zod.def));else{let i=o;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=n.value;i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(G(i))}},e(n.value,n)),t);return r}function Bs(e,t){let r=new E({check:"custom",...g(t)});return r._zod.check=e,r}function he(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,n))D(e,n,r[n]);return e}function Zt(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??q,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Q(e,t,r,n,o){let i=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw Error(o);return Object.assign(r,i),!0}function S(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{let d=s.schema,m=t.processors[o.type];if(!m)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,d,l)}let f=e._zod.parent;if(f){if(!s.ref)s.ref=f;S(f,t,l),t.seen.get(f).isParent=!0}}let u=t.metadataRegistry.get(e);if(u)he(s.schema,u);if(t.io==="input"&&O(e))delete s.schema.examples,delete s.schema.default;if(t.io==="input"&&"_prefault"in s.schema)(n=s.schema).default??(n.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function Go(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Pt(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let u=n.get(c);if(u&&u!==s[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,s[0])}}let o=(s)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,d=e.external.uri??((h)=>h);if(f)return{ref:d(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${d("__shared")}#/${c}/${Go(m)}`}}let u="#",a=`${u}/${c}/`;if(s[1]===r&&!s[1].schema.id)return{ref:u};let l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:a+Go(l)}},i=(s)=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:a}=o(s);if(c.def={...c.schema},a)c.defId=a;let l=c.schema;for(let f in l)delete l[f];l.$ref=u};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
61
|
+
`)}return x.write("payload.value = newResult;"),x.write("return payload;"),x.compile()},s,c=pe,u=!I.jitless,l=u&&sr.value,f=t.catchall,d;e._zod.parse=(m,h)=>{d??(d=n.value);let _=m.value;if(!c(_))return m.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),m;if(u&&l&&h?.async===!1&&h.jitless!==!0){if(!s)s=i(t.shape);if(m=s(m,h),!f)return m;return oo([],_,m,h,d,e,h?.abortEarly===!0)}return r(m,h)}});function _n(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter((i)=>!M(i));if(o.length===1)return t.value=o[0].value,o[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((s)=>U(s,n,T())))}),t}var so=p("$ZodUnion",(e,t)=>{k.init(e,t),y(e,"optin",(n)=>n.def.options.some((o)=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some((o)=>o._zod.optin!==void 0)?"optional":void 0),y(e,"optout",(n)=>n.def.options.some((o)=>o._zod.optout==="optional")?"optional":void 0),y(e,"values",(n)=>{if(n.def.options.every((o)=>o._zod.values))return new Set(n.def.options.flatMap((o)=>Array.from(o._zod.values)));return}),y(e,"pattern",(n)=>{if(n.def.options.every((o)=>o._zod.pattern)){let o=n.def.options.map((i)=>i._zod.pattern);return new RegExp(`^(${o.map((i)=>ze(i.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,s=[];for(let c of t.options){let u=c._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)s.push(u),i=!0;else{if(u.issues.length===0)return u;s.push(u)}}if(!i)return _n(s,n,e,o);return Promise.all(s).then((c)=>_n(c,n,e,o))}});var co=p("$ZodIntersection",(e,t)=>{k.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([u,a])=>xn(r,u,a));return xn(r,i,s)}});function xt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(X(e)&&X(t)){let r=Object.keys(t),n=Object.keys(e).filter((i)=>r.indexOf(i)!==-1),o={...e,...t};if(Object.prototype.hasOwnProperty.call(o,"__proto__"))delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let s=xt(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=xt(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function xn(e,t,r){let n=new Map,o,i=new Map,s=(a,l)=>{let f;if(a.code==="unrecognized_keys"&&!a.path?.length)o??(o=a),f=a.keys;else if(a.code==="invalid_key"&&a.origin==="record"&&a.path?.length===1){let d=String(a.path[0]);if(!i.has(d))i.set(d,a);f=[d]}else return!1;for(let d of f){if(!n.has(d))n.set(d,{});n.get(d)[l]=!0}return!0};for(let a of t.issues)if(!s(a,"l"))e.issues.push(a);for(let a of r.issues)if(!s(a,"r"))e.issues.push(a);let c=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(c.length){let a=o?c.filter((l)=>o.keys.includes(l)):[];if(a.length)e.issues.push({...o,keys:a});for(let l of c)if(!a.includes(l)&&i.has(l))e.issues.push(i.get(l))}let u=xt(t.value,r.value);if(!u.valid){if(M(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}var uo=p("$ZodRecord",(e,t)=>{k.init(e,t);let r=I.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!X(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let s=[],c=t.keyType._zod.values;if(c&&!t.partial){n.value=r?r.alloc(e,n,{},o):{};let u=new Set;for(let l of c)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){if(u.add(typeof l==="number"?l.toString():l),l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},o);if(f instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(f.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map((h)=>U(h,o,T())),input:l,path:[l],inst:e});continue}let d=f.value;if(d==="__proto__")continue;let m=t.valueType._zod.run({value:i[l],issues:[]},o);if(m instanceof Promise)s.push(m.then((h)=>{if(h.issues.length)n.issues.push(...K(l,h.issues));n.value[d]=h.value}));else{if(m.issues.length)n.issues.push(...K(l,m.issues));n.value[d]=m.value}}let a;for(let l in i)if(!u.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;n.value[l]=i[l]}else a=a??[],a.push(l);if(a&&a.length>0)n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:a,continue:!0})}else{n.value=r?r.alloc(e,n,{},o):{};let u;for(let a of Reflect.ownKeys(i)){if(a==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(i,a))continue;let l=t.keyType._zod.run({value:a,issues:[]},o);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof a==="string"&&Te.test(a)&&l.issues.length){let h=t.keyType._zod.run({value:Number(a),issues:[]},o);if(h instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(h.issues.length===0)l=h}if(l.issues.length){if(t.mode==="loose")n.value[a]=i[a];else if(c)u=u??[],u.push(a);else n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map((h)=>U(h,o,T())),input:a,path:[a],inst:e});continue}let d=l.value;if(d==="__proto__")continue;let m=t.valueType._zod.run({value:i[a],issues:[]},o);if(m instanceof Promise)s.push(m.then((h)=>{if(h.issues.length)n.issues.push(...K(a,h.issues));n.value[d]=h.value}));else{if(m.issues.length)n.issues.push(...K(a,m.issues));n.value[d]=m.value}}if(u&&u.length>0)n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u,continue:!0})}if(s.length)return Promise.all(s).then(()=>n);return n}});var ao=p("$ZodEnum",(e,t)=>{k.init(e,t);let r=fe(t.entries),n=new Set(r);e._zod.values=n,y(e,"pattern",(o)=>{let i=fe(o.def.entries).filter((s)=>cr.has(typeof s));return new RegExp(i.length?`^(${i.map((s)=>re(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;if(n.has(s))return o;return o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}});var lo=p("$ZodTransform",(e,t)=>{k.init(e,t),e._zod.optin="optional",I.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new me(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then((s)=>(r.value=s,r));if(o instanceof Promise)throw new J;return r.value=o,r}});function yn(e,t){return e.value=t.issues.length?void 0:t.value,e}var vt=p("$ZodOptional",(e,t)=>{k.init(e,t),y(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",y(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),y(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${ze(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((i)=>yn(r,i));return yn(r,o)}return t.innerType._zod.run(r,n)}}),po=p("$ZodExactOptional",(e,t)=>{vt.init(e,t),y(e,"values",(r)=>r.def.innerType._zod.values),y(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),fo=p("$ZodNullable",(e,t)=>{k.init(e,t),y(e,"optin",(r)=>r.def.innerType._zod.optin),y(e,"optout",(r)=>r.def.innerType._zod.optout),y(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${ze(n.source)}|null)$`):void 0}),y(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>{if(r.value===null)return r;return t.innerType._zod.run(r,n)}}),mo=p("$ZodDefault",(e,t)=>{k.init(e,t),e._zod.optin="defaulted",y(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>bn(i,t));return bn(o,t)}});function bn(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var ho=p("$ZodPrefault",(e,t)=>{k.init(e,t),e._zod.optin="defaulted",y(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,n)}}),go=p("$ZodNonOptional",(e,t)=>{k.init(e,t),y(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>vn(i,e));return vn(o,e)}});function vn(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function $n(e,t,r,n){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((o)=>U(o,n,T()))},input:e.value}),e}var _o=p("$ZodCatch",(e,t)=>{k.init(e,t),y(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),y(e,"optout",(r)=>r.def.innerType._zod.optout),y(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((i)=>$n(r,i,t,n));return $n(r,o,t,n)}});var xo=p("$ZodPipe",(e,t)=>{k.init(e,t),y(e,"values",(r)=>r.def.in._zod.values),y(e,"optin",(r)=>r.def.in._zod.optin),y(e,"optout",(r)=>r.def.out._zod.optout),y(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);if(i instanceof Promise)return i.then((s)=>Ne(s,t.in,n));return Ne(i,t.in,n)}let o=t.in._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>Ne(i,t.out,n));return Ne(o,t.out,n)}});function Ne(e,t,r){if(e.issues.some((n)=>n.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var yo=p("$ZodReadonly",(e,t)=>{k.init(e,t),y(e,"propValues",(r)=>r.def.innerType._zod.propValues),y(e,"values",(r)=>r.def.innerType._zod.values),y(e,"optin",(r)=>r.def.innerType?._zod?.optin),y(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then(zn);return zn(o)}});function zn(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var bo=p("$ZodCustom",(e,t)=>{E.init(e,t),k.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=(r)=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then((i)=>wn(i,r,n,e));wn(o,r,n,e);return}});function wn(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};if(n._zod.def.params)o.params=n._zod.def.params;t.issues.push(H(o))}}function kn(e,t,r){if(e.issues.length)t.issues.push(...K(r,e.issues))}var qs=p("$ZodProperties",(e,t)=>{k.init(e,t),E.init(e,t);let r=I.memoizer;r?.attach(e);let n,o=(i,s)=>{n??(n=Reflect.ownKeys(t.shape).map((a)=>[a,t.shape[a]]));let c=i.value,u;for(let[a,l]of n){let f=l._zod.run({value:c[a],issues:[]},s);if(f instanceof Promise)u??(u=[]),u.push(f.then((d)=>kn(d,i,a)));else kn(f,i,a)}if(u)return Promise.all(u).then(()=>{return});return};e._zod.parse=(i,s)=>{let c=i.value;if(c===null||typeof c!=="object"&&typeof c!=="function")return i.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),i;if(s.direction==="backward")s={...s,direction:"forward"};if(r)r.alloc(e,i,c,s);let u=o(i,s);return u instanceof Promise?u.then(()=>i):i},e._zod.check=(i)=>{if(i.value==null){i.issues.push({expected:"object",code:"invalid_type",input:i.value,inst:e});return}return o(i,{})}},{*[Symbol.iterator](){yield this}});class $o extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var zt="~memo",vo=[];function zo(e){return e!==null&&(typeof e==="object"||typeof e==="function")}function $t(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var wo=new WeakMap,_e=0,Fe=1,xe=2;function Me(e,t,r){let n=wo.get(e);if(n!==void 0)return n?xe:_e;if(t.has(e))return xe;t.add(e);let o=_e,i=(l)=>{if(o!==xe&&l?._zod){let f=Me(l,t,r);if(f>o)o=f}},s=(l,f)=>{let d=_e;for(let m of Reflect.ownKeys(l)){let h=Object.getOwnPropertyDescriptor(l,m);if(f&&!h.enumerable)continue;let _=h.get?Fe:h.value?._zod?Me(h.value,t,r):_e;if(_>d)d=_}return d},c=(l)=>{if(l>o)o=l},u=e._zod.def,a=u.type;switch(a){case"object":{let l=we(u);c(l?s(l,!0):Fe),i(u.catchall);break}case"properties":c(s(u.shape,!1));break;case"array":i(u.element);break;case"tuple":for(let l of u.items)i(l);i(u.rest);break;case"record":case"map":i(u.keyType),i(u.valueType);break;case"set":i(u.valueType);break;case"union":for(let l of u.options)i(l);break;case"intersection":i(u.left),i(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(u.innerType);break;case"pipe":i(u.in),i(u.out);break;case"function":i(u.input),i(u.output);break;case"lazy":{let l=u._cachedInner??(r?e._zod.innerType:void 0);c(l?Me(l,t,!1):Fe);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let l in u){let f=Object.getOwnPropertyDescriptor(u,l);if(!f||f.get)continue;let d=f.value;if(!d||typeof d!=="object")continue;if(d._zod)i(d);else if(Array.isArray(d))for(let m of d)i(m)}}return t.delete(e),Gs(e,o)}function Gs(e,t){if(t!==Fe)wo.set(e,t===xe);return t}function Xs(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var De,Le=[],Hs={alloc(e,t,r){let n=De;if(!n)return r;De=void 0;let o={value:r,issues:null};return n.set(t.value,o),Le.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&Ys(i,o.value))throw new $o;return r(o,i)};if(e._zod.parse=n,e._zod.run===r)e._zod.run=n})},attach(e){var t;let r,n=!1,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,c=(u,a)=>{if(r===void 0){let w=Me(e,new Set,!1);if(w===_e){if(e._zod.parse=s,e._zod.run===c)e._zod.run=s;return s(u,a)}if(w===xe||n)r=!0;else n=!0}let l=u.value;if(!zo(l))return s(u,a);let f=a[zt];if(!f)f={buckets:new WeakMap,backEdges:void 0},a[zt]=f;let d;if(o===a)d=i;else d=Xs(f,e),o=a,i=d;let m=d.get(l);if(m){if(u.value=m.value,m.issues){if(m.issues.length)u.issues.push(...$t(m.issues))}else u.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value);return u}De=d;let h=Le.length,_=s(u,a);De=void 0;let x=Le.length>h?Le.pop():void 0;if(_ instanceof Promise)return _.then((w)=>{if(x)x.issues=w.issues.length?$t(w.issues):vo;return w});if(x)x.issues=_.issues.length?$t(_.issues):vo;return _};if(e._zod.parse=c,e._zod.run===s)e._zod.run=c})}};function ko(){return Hs}function Ys(e,t){let r=e[zt]?.backEdges;return r!==void 0&&zo(t)&&r.has(t)}var Qs=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,s){if(i==="number"&&typeof s==="number"&&!Number.isFinite(s))return String(s);return n[i]??i}return(i)=>{switch(i.code){case"invalid_type":{let s=o(i.expected),c=fr(i.input),u=o(c,i.input);return`Invalid input: expected ${s}, received ${u}`}case"invalid_value":if(i.values.length===1)return`Invalid input: expected ${nt(i.values[0])}`;return`Invalid option: expected one of ${et(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",c=t(i.origin);if(c)return`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${c.unit??"elements"}`;return`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",c=t(i.origin);if(c)return`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${c.unit}`;return`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;if(s.format==="starts_with")return`Invalid string: must start with "${s.prefix}"`;if(s.format==="ends_with")return`Invalid string: must end with "${s.suffix}"`;if(s.format==="includes")return`Invalid string: must include "${s.includes}"`;if(s.format==="regex")return`Invalid string: must match pattern ${s.pattern}`;return`Invalid ${r[s.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${et(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":if(i.options&&Array.isArray(i.options)&&i.options.length>0)return`Invalid discriminator value. Expected ${i.options.map((c)=>`'${c}'`).join(" | ")}`;if(i.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function wt(){return{localeError:Qs()}}var Zo;class Po{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function ec(){return new Po}(Zo=globalThis).__zod_globalRegistry??(Zo.__zod_globalRegistry=ec());var Y=globalThis.__zod_globalRegistry;function So(e,t){return new e({type:"string",...g(t)})}function Oo(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function Io(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function Eo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function Ao(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function To(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function No(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function Co(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function jo(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function Ro(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function Do(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function Lo(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function Fo(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function Mo(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function Uo(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function Jo(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function Bo(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function Vo(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function Ko(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function Wo(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function qo(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function Go(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function Xo(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function Ho(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function Yo(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function Qo(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function ei(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function ti(e){return new e({type:"unknown"})}function ri(e,t){return new e({type:"never",...g(t)})}function Ue(e,t){return new nn({check:"max_length",...g(t),maximum:e})}function ne(e,t){return new on({check:"min_length",...g(t),minimum:e})}function Je(e,t){return new sn({check:"length_equals",...g(t),length:e})}function kt(e,t){return new cn({check:"string_format",format:"regex",...g(t),pattern:e})}function Zt(e){return new un({check:"string_format",format:"lowercase",...g(e)})}function Pt(e){return new an({check:"string_format",format:"uppercase",...g(e)})}function St(e,t){return new ln({check:"string_format",format:"includes",...g(t),includes:e})}function Ot(e,t){return new pn({check:"string_format",format:"starts_with",...g(t),prefix:e})}function It(e,t){return new fn({check:"string_format",format:"ends_with",...g(t),suffix:e})}function q(e){return new dn({check:"overwrite",tx:e})}function Et(e){return q((t)=>t.normalize(e))}function At(){return q((e)=>e.trim())}function Tt(){return q((e)=>e.toLowerCase())}function Nt(){return q((e)=>e.toUpperCase())}function Ct(){return q((e)=>ir(e))}function ni(e,t,r){return new e({type:"array",element:t,...g(r)})}function oi(e,t,r){return new e({type:"custom",check:"custom",fn:t,...g(r)})}function ii(e,t){let r=tc((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(H(o,n.value,r._zod.def));else{let i=o;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=n.value;i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(H(i))}},e(n.value,n)),t);return r}function tc(e,t){let r=new E({check:"custom",...g(t)});return r._zod.check=e,r}function ye(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,n))j(e,n,r[n]);return e}function Rt(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??Y,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function oe(e,t,r,n,o){let i=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw Error(o);return Object.assign(r,i),!0}function Z(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{let d=s.schema,m=t.processors[o.type];if(!m)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,d,l)}let f=e._zod.parent;if(f){if(!s.ref)s.ref=f;Z(f,t,l),t.seen.get(f).isParent=!0}}let u=t.metadataRegistry.get(e);if(u)ye(s.schema,u);if(t.io==="input"&&O(e))delete s.schema.examples,delete s.schema.default;if(t.io==="input"&&"_prefault"in s.schema)(n=s.schema).default??(n.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function si(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Dt(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let u=n.get(c);if(u&&u!==s[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,s[0])}}let o=(s)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,d=e.external.uri??((h)=>h);if(f)return{ref:d(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${d("__shared")}#/${c}/${si(m)}`}}let u="#",a=`${u}/${c}/`;if(s[1]===r&&!s[1].schema.id)return{ref:u};let l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:a+si(l)}},i=(s)=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:a}=o(s);if(c.def={...c.schema},a)c.defId=a;let l=c.schema;for(let f in l)delete l[f];l.$ref=u};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
62
62
|
|
|
63
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){i(s);continue}if(e.external){let a=e.external.registry.get(s[0])?.id;if(t!==s[0]&&a){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}if(c.count>1){if(e.reused==="ref")i(s)}}if(e.external)e.sharedDefsExtractedFor=e.external}function Yo(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!=="object")return;Yo(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!=="string")return;if(!r.includes(s))r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Ho=new Set(["type","properties","required","additionalProperties"]),qo=["oneOf","anyOf"];function Xo(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function kt(e){let t=[];for(let i of e){if(typeof i!=="object"||i.type!=="object")return null;for(let s in i)if(!Ho.has(s))return null;t.push(i)}let r={},n=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let c=[];for(let a of t){let l=a.properties?.[s]??Xo(a);if(l===null||l===void 0)continue;if(!c.some((f)=>JSON.stringify(f)===JSON.stringify(l)))c.push(l)}let u=c.length===1?c[0]:kt(c)??{allOf:c};D(r,s,u)}for(let s of i.required??[])n.add(s)}let o={type:"object",properties:r};if(n.size)o.required=[...n];if(t.every((i)=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let s of t){let c=Xo(s);if(c&&!i.some((u)=>JSON.stringify(u)===JSON.stringify(c)))i.push(c)}if(i.length===1)o.additionalProperties=i[0];else if(i.length>1)o.additionalProperties={allOf:i}}return o}function Vs(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of Ho)if(o in e)return;let r=t.filter((o)=>qo.some((i)=>Array.isArray(o[i]))),n=null;if(!r.length)n=kt(t);else{let o=r[0],i=qo.find((u)=>Array.isArray(o[u]));if(Object.keys(o).length!==1)return;let s=t.filter((u)=>u!==o),c=o[i].map((u)=>kt([...s,u]));if(c.some((u)=>!u))return;n={[i]:c}}if(!n)return;delete e.allOf,he(e,n)}function St(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=(c)=>{let u=e.seen.get(c);if(u.ref===null)return;let a=u.def??u.schema,l={...a},f=u.ref;if(u.ref=null,f){n(f);let m=e.seen.get(f),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))a.allOf=a.allOf??[],a.allOf.push(h);else he(a,h);if(he(a,l),c._zod.parent===f)for(let x in a){if(x==="$ref"||x==="allOf")continue;if(!(x in l))delete a[x]}if(h.$ref&&m.def)for(let x in a){if(x==="$ref"||x==="allOf")continue;if(x in m.def&&JSON.stringify(a[x])===JSON.stringify(m.def[x]))delete a[x]}}let d=c._zod.parent;if(d&&d!==f){n(d);let m=e.seen.get(d);if(m?.schema.$ref){if(a.$ref=m.schema.$ref,m.def)for(let h in a){if(h==="$ref"||h==="allOf")continue;if(h in m.def&&JSON.stringify(a[h])===JSON.stringify(m.def[h]))delete a[h]}}}e.override({zodSchema:c,jsonSchema:a,path:u.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())n(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())Yo(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let u of e.seen.values())for(let a of[u.schema,u.def]){let l=a?.allOf;if(!Array.isArray(l))continue;let f=c.get(l);if(f)f.push(a);else c.set(l,[a])}for(let u of e.intersections)for(let a of c.get(u)??[])Vs(a)}}let o={};if(e.target==="draft-2020-12")o.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")o.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")o.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}he(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&o.id===i)delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let u=c[1];if(u.def&&u.defId){if(u.def.id===u.defId)delete u.def.id;D(s,u.defId,u.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(s).length>0)if(e.target==="draft-2020-12")o.$defs=s;else o.definitions=s;try{let c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:ge(t,"input",e.processors),output:ge(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){throw Error("Error converting schema to JSON.")}}function O(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return O(n.element,r);if(n.type==="set")return O(n.valueType,r);if(n.type==="lazy")return O(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return O(n.innerType,r);if(n.type==="intersection")return O(n.left,r)||O(n.right,r);if(n.type==="record"||n.type==="map")return O(n.keyType,r)||O(n.valueType,r);if(n.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return O(n.in,r)||O(n.out,r)}if(n.type==="object"){for(let o in n.shape)if(O(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(O(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(O(o,r))return!0;if(n.rest&&O(n.rest,r))return!0;return!1}return!1}var Qo=(e,t={})=>(r)=>{let n=Zt({...r,processors:t});return S(e,n),Pt(n,e),St(n,e)},ge=(e,t,r={})=>(n)=>{let{libraryOptions:o,target:i}=n??{},s=Zt({...o??{},target:i,io:t,processors:r});return S(e,s),Pt(s,e),St(s,e)};var ee=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},te=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},ei=(e,t)=>{ee(e,"minimum",t),te(e,"maximum",t)},oi=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},ii=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},si=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},ci=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},ti=(e,t)=>ee(e,"minimum",t.minimum),ri=(e,t)=>te(e,"maximum",t.maximum),ni=(e)=>(t,r)=>{ci(t,r.format);let[n,o]=e[r.format];ee(t,"minimum",n),te(t,"maximum",o)},Ks={greater_than:(e,t)=>ee(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>te(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>oi(e,t.value),number_format:ni(Ge),bigint_format:ni(qe),min_length:ti,max_length:ri,length_equals:(e,t)=>ei(e,t.length),min_size:ti,max_size:ri,size_equals:(e,t)=>ei(e,t.size),string_format:(e,t)=>{if(ci(e,t.format),t.pattern)ii(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>si(e,t.mime)};function re(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)Ks[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;if(o.minimum!==void 0)ee(t,"minimum",o.minimum);if(o.exclusiveMinimum!==void 0)ee(t,"exclusiveMinimum",o.exclusiveMinimum);if(o.maximum!==void 0)te(t,"maximum",o.maximum);if(o.exclusiveMaximum!==void 0)te(t,"exclusiveMaximum",o.exclusiveMaximum);if(o.multipleOf!==void 0)oi(t,o.multipleOf);if(o.format!==void 0){if(t.format??(t.format=o.format),o.format.includes("int"))t.isInt=!0}if(o.mime)si(t,o.mime);for(let i of o.patterns??[])ii(t,i);return t}var Ws={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Gs=new Map([[at,Cr],[Ae,jr]]),qs=(e)=>Gs.get(e)??e,ui=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:c,patterns:u,contentEncoding:a,laxFormat:l}=re(e);if(typeof i==="number")o.minLength=i;if(typeof s==="number")o.maxLength=s;if(c){if(o.format=Ws[c]??c,o.format==="")delete o.format;if(c==="time"||l)delete o.format}if(a)o.contentEncoding=a;if(u&&u.size>0){let f=[...u].map(qs);if(f.length===1)o.pattern=f[0].source;else if(f.length>1)o.allOf=[...f.map((d)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))]}};var ai=(e,t,r,n)=>{r.not={}};var li=(e,t,r,n)=>{};var pi=(e,t,r,n)=>{let o=e._zod.def,i=ce(o.entries);if(i.length===0){r.not={};return}if(i.every((s)=>typeof s==="number"))r.type="number";if(i.every((s)=>typeof s==="string"))r.type="string";r.enum=i};var fi=(e,t,r,n)=>{Q(e,t,r,n,"Custom types cannot be represented in JSON Schema")};var di=(e,t,r,n)=>{Q(e,t,r,n,"Transforms cannot be represented in JSON Schema")};var mi=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:c}=re(e);if(typeof s==="number")o.minItems=s;if(typeof c==="number")o.maxItems=c;o.type="array",o.items=S(i.element,t,{...n,path:[...n.path,"items"]})};function Ot(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return Ot(t.out);if(t.type==="catch")return Ot(t.innerType);return e._zod.optin}var hi=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&Q(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let l in s)D(o.properties,l,S(s[l],t,{...n,path:[...n.path,"properties",l]}));let u=new Set(Object.keys(s)),a=new Set([...u].filter((l)=>{let f=i.shape[l];if(t.io==="input")return Ot(f)===void 0;else return f._zod.optout===void 0}));if(a.size>0)o.required=Array.from(a);if(i.catchall?._zod.def.type==="never")o.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")o.additionalProperties=!1}else if(i.catchall)o.additionalProperties=S(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})};var gi=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((c,u)=>S(c,t,{...n,path:[...n.path,i?"oneOf":"anyOf",u]}));if(i)r.oneOf=s;else r.anyOf=s},_i=(e,t,r,n)=>{let o=e._zod.def,i=S(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=S(o.right,t,{...n,path:[...n.path,"allOf",1]}),c=(a)=>("allOf"in a)&&Object.keys(a).length===1,u=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];r.allOf=u,t.intersections.push(u)};var xi=(e,t,r,n)=>{let o=e._zod.def,i=S(o.innerType,t,n),s=t.seen.get(e);if(t.target==="openapi-3.0")s.ref=o.innerType,r.nullable=!0;else r.anyOf=[i,{type:"null"}]},yi=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},It=Symbol();function bi(e,t,r,n,o){let i=!1,s=JSON.stringify(e,(c,u)=>{if(typeof u!=="bigint")return u;return i=!0,null});if(!i)return JSON.parse(s);return Q(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),It}var vi=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=bi(o.defaultValue,e,t,r,n);if(s!==It)r.default=s},zi=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=bi(o.defaultValue,e,t,r,n);if(s!==It)r._prefault=s},$i=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{Q(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},wi=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;S(s,t,n);let c=t.seen.get(e);c.ref=s},ki=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0};var Et=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType};var Zi=new WeakSet([Object.prototype,Error.prototype]);function Le(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var cc=(e,t)=>{ur.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(Zi.has(r))return;Zi.add(r),Le(r,"format",(n)=>(o)=>lr(n,o)),Le(r,"flatten",(n)=>(o)=>ar(n,o)),Le(r,"addIssue",(n)=>(o)=>{n.issues.push(o),n.message=JSON.stringify(n.issues,ue,2)}),Le(r,"addIssues",(n)=>(o)=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,ue,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var T=p("ZodError",cc,void 0,{Parent:Error});var Pi=ke(T),Si=Ze(T),Oi=Pe(T),Ii=Se(T),Ei=fr(T),Ai=dr(T),Ti=mr(T),Ni=hr(T),Ci=gr(T),ji=_r(T),Ri=xr(T),Di=yr(T);function ac(){if(!I.localeError)C(dt())}function Nt(){if(!I.memoizer)C({memoizer:fo()})}var Z=p("ZodType",(e,t)=>(ac(),w.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(A(t,{checks:[...t.checks??[],...e.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return L(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(iu(e,t))},superRefine(e,t){return this.check(su(e,t))},overwrite(e){return this.check(K(e))},optional(){return Fi(this)},exactOptional(){return Kc(this)},nullable(){return Mi(this)},nullish(){return Fi(Mi(this))},nonoptional(e){return Hc(this,e)},array(){return Rc(this)},or(e){return Fc([this,e])},and(e){return Uc(this,e)},transform(e){return Ui(this,Vc(e))},default(e){return qc(this,e)},prefault(e){return Yc(this,e)},catch(e){return eu(this,e)},pipe(e){return Ui(this,e)},readonly(){return nu(this)},describe(e){let t=this.clone();return q.add(t,{description:e}),t},meta(...e){if(e.length===0)return q.get(this);let t=this.clone();return q.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get "~standard"(){return Ye(this,"~standard",{...ut(this),jsonSchema:{input:ge(this,"input"),output:ge(this,"output")}})},set "~standard"(e){J(this,"~standard",e)},parse:function e(t,r){return Pi(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await Si(this,t,r,{callee:e})},safeParse(e,t){return Oi(this,e,t)},async safeParseAsync(e,t){return Ii(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){J(this,"spa",e)},validate(e,t){return tt(this,e,t)},validateAsync(e,t){return rt(this,e,t)},encode:function e(t,r){return Ei(this,t,r,{callee:e})},decode:function e(t,r){return Ai(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Ti(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await Ni(this,t,r,{callee:e})},safeEncode(e,t){return Ci(this,e,t)},safeDecode(e,t){return ji(this,e,t)},async safeEncodeAsync(e,t){return Ri(this,e,t)},async safeDecodeAsync(e,t){return Di(this,e,t)},toJSONSchema(e){return Qo(this,{})(e)},get description(){return q.get(this)?.description},get _def(){return this._zod.def}}),Ji=p("_ZodString",(e,t)=>{Ee.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ui(e,r,n,o)},us({format:(e)=>re(e).format??null,minLength:(e)=>re(e).minimum??null,maxLength:(e)=>re(e).maximum??null},{regex(...e){return this.check(mt(...e))},includes(...e){return this.check(_t(...e))},startsWith(...e){return this.check(xt(...e))},endsWith(...e){return this.check(yt(...e))},min(...e){return this.check(H(...e))},max(...e){return this.check(Re(...e))},length(...e){return this.check(De(...e))},nonempty(...e){return this.check(H(1,...e))},lowercase(e){return this.check(ht(e))},uppercase(e){return this.check(gt(e))},trim(){return this.check(vt())},normalize(...e){return this.check(bt(...e))},toLowerCase(){return this.check(zt())},toUpperCase(){return this.check($t())},slugify(){return this.check(wt())}})),lc=p("ZodString",(e,t)=>{Ee.init(e,t),Ji.init(e,t)},{email(e){return this.check(_o(hc,e))},url(e){return this.check($o(_c,e))},jwt(e){return this.check(Do(Ac,e))},emoji(e){return this.check(wo(xc,e))},guid(e){return this.check(xo(gc,e))},uuid(e){return this.check(yo(Fe,e))},uuidv4(e){return this.check(bo(Fe,e))},uuidv6(e){return this.check(vo(Fe,e))},uuidv7(e){return this.check(zo(Fe,e))},nanoid(e){return this.check(ko(yc,e))},cuid(e){return this.check(Zo(bc,e))},cuid2(e){return this.check(Po(vc,e))},ulid(e){return this.check(So(zc,e))},base64(e){return this.check(Co(Oc,e))},base64url(e){return this.check(jo(Ic,e))},xid(e){return this.check(Oo($c,e))},ksuid(e){return this.check(Io(wc,e))},ipv4(e){return this.check(Eo(kc,e))},ipv6(e){return this.check(Ao(Zc,e))},cidrv4(e){return this.check(To(Pc,e))},cidrv6(e){return this.check(No(Sc,e))},e164(e){return this.check(Ro(Ec,e))},datetime(e){return this.check(Lo(pc,e))},date(e){return this.check(Fo(fc,e))},time(e){return this.check(Mo(dc,e))},duration(e){return this.check(Uo(mc,e))}});function Ct(e){return go(lc,e)}var z=p("ZodStringFormat",(e,t)=>{b.init(e,t),Ji.init(e,t)}),pc=p("ZodISODateTime",(e,t)=>{On.init(e,t),z.init(e,t)}),fc=p("ZodISODate",(e,t)=>{In.init(e,t),z.init(e,t)}),dc=p("ZodISOTime",(e,t)=>{En.init(e,t),z.init(e,t)}),mc=p("ZodISODuration",(e,t)=>{An.init(e,t),z.init(e,t)}),hc=p("ZodEmail",(e,t)=>{xn.init(e,t),z.init(e,t)});var gc=p("ZodGUID",(e,t)=>{gn.init(e,t),z.init(e,t)});var Fe=p("ZodUUID",(e,t)=>{_n.init(e,t),z.init(e,t)});var _c=p("ZodURL",(e,t)=>{vn.init(e,t),z.init(e,t)});var xc=p("ZodEmoji",(e,t)=>{zn.init(e,t),z.init(e,t)});var yc=p("ZodNanoID",(e,t)=>{$n.init(e,t),z.init(e,t)});var bc=p("ZodCUID",(e,t)=>{wn.init(e,t),z.init(e,t)});var vc=p("ZodCUID2",(e,t)=>{kn.init(e,t),z.init(e,t)});var zc=p("ZodULID",(e,t)=>{Zn.init(e,t),z.init(e,t)});var $c=p("ZodXID",(e,t)=>{Pn.init(e,t),z.init(e,t)});var wc=p("ZodKSUID",(e,t)=>{Sn.init(e,t),z.init(e,t)});var kc=p("ZodIPv4",(e,t)=>{Tn.init(e,t),z.init(e,t)});var Zc=p("ZodIPv6",(e,t)=>{Cn.init(e,t),z.init(e,t)});var Pc=p("ZodCIDRv4",(e,t)=>{jn.init(e,t),z.init(e,t)});var Sc=p("ZodCIDRv6",(e,t)=>{Rn.init(e,t),z.init(e,t)});var Oc=p("ZodBase64",(e,t)=>{Ln.init(e,t),z.init(e,t)});var Ic=p("ZodBase64URL",(e,t)=>{Fn.init(e,t),z.init(e,t)});var Ec=p("ZodE164",(e,t)=>{Mn.init(e,t),z.init(e,t)});var Ac=p("ZodJWT",(e,t)=>{Un.init(e,t),z.init(e,t)});var Tc=p("ZodUnknown",(e,t)=>{Jn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>li(e,r,n,o)});function Li(){return Jo(Tc)}var Nc=p("ZodNever",(e,t)=>{Bn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ai(e,r,n,o)});function Cc(e){return Bo(Nc,e)}var jc=p("ZodArray",(e,t)=>{Nt(),Vn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mi(e,r,n,o),e.element=t.element},{min(e,t){return this.check(H(e,t))},nonempty(e){return this.check(H(1,e))},max(e,t){return this.check(Re(e,t))},length(e,t){return this.check(De(e,t))},unwrap(){return this.element}});function Rc(e,t){return Vo(jc,e,t)}var Dc=p("ZodObject",(e,t)=>{Nt(),Gn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>hi(e,r,n,o),ps(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return Jc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(A(this._zod.def,{catchall:e}))},passthrough(){return this.clone(A(this._zod.def,{catchall:Li()}))},loose(){return this.clone(A(this._zod.def,{catchall:Li()}))},strict(){return this.clone(A(this._zod.def,{catchall:Cc()}))},strip(){return this.clone(A(this._zod.def,{catchall:void 0}))},extend(e){return ns(this,e)},safeExtend(e){return os(this,e)},merge(e){return is(this,e)},pick(e){return ts(this,e)},omit(e){return rs(this,e)},partial(...e){return Qt(Vi,this,e[0])},exactPartial(...e){return Qt(Ki,this,e[0],"exactPartial")},required(...e){return ss(Wi,this,e[0])}});function Bi(e,t){let r={type:"object",shape:e??{},...g(t)};return new Dc(r)}var Lc=p("ZodUnion",(e,t)=>{qn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>gi(e,r,n,o),e.options=t.options});function Fc(e,t){return new Lc({type:"union",options:e,...g(t)})}var Mc=p("ZodIntersection",(e,t)=>{Xn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_i(e,r,n,o)});function Uc(e,t){return new Mc({type:"intersection",left:e,right:t})}var Tt=p("ZodEnum",(e,t)=>{Yn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(n,o,i)=>pi(e,n,o,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new Tt({...t,checks:[],...g(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new Tt({...t,checks:[],...g(o),entries:i})}});function Jc(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((n)=>[n,n])):e;return new Tt({type:"enum",entries:r,...g(t)})}var Bc=p("ZodTransform",(e,t)=>{Nt(),Hn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>di(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new le(e.constructor.name);r.addIssue=(i)=>{if(typeof i==="string")r.issues.push(G(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=r.value;s.inst??(s.inst=e),r.issues.push(G(s))}};let o=t.transform(r.value,r);if(o instanceof Promise)return o.then((i)=>(r.value=i,r));return r.value=o,r}});function Vc(e){return new Bc({type:"transform",transform:e})}var Vi=p("ZodOptional",(e,t)=>{lt.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Et(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Fi(e){return new Vi({type:"optional",innerType:e})}var Ki=p("ZodExactOptional",(e,t)=>{Qn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Et(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Kc(e){return new Ki({type:"optional",innerType:e})}var Wc=p("ZodNullable",(e,t)=>{eo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>xi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Mi(e){return new Wc({type:"nullable",innerType:e})}var Gc=p("ZodDefault",(e,t)=>{to.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function qc(e,t){return new Gc({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():Ke(t)}})}var Xc=p("ZodPrefault",(e,t)=>{ro.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Yc(e,t){return new Xc({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():Ke(t)}})}var Wi=p("ZodNonOptional",(e,t)=>{no.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Hc(e,t){return new Wi({type:"nonoptional",innerType:e,...g(t)})}var Qc=p("ZodCatch",(e,t)=>{oo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$i(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function eu(e,t){return new Qc({type:"catch",innerType:e,catchValue:typeof t==="function"?t:nr(t)})}var tu=p("ZodPipe",(e,t)=>{io.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wi(e,r,n,o),e.in=t.in,e.out=t.out});function Ui(e,t){return new tu({type:"pipe",in:e,out:t})}var ru=p("ZodReadonly",(e,t)=>{so.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ki(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function nu(e){return new ru({type:"readonly",innerType:e})}var ou=p("ZodCustom",(e,t)=>{co.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fi(e,r,n,o)});function iu(e,t={}){return Ko(ou,e,t)}function su(e,t){return Wo(e,t)}var jt=Bi({path:Ct().trim().nonempty(),component:Ct().trim().nonempty()});class Rt{document;constructor(e){this.document=e}getRoutes(){let e=this.document.querySelector(`script#${Ue.routesId}[type="application/json"]`);if(!e)return;try{let t=e.textContent.trim(),r=JSON.parse(t);if(!Array.isArray(r))return;return r.map((n)=>{let o=jt.safeParse(n);return!o.success?null:o.data}).filter((n)=>!!n)}catch(t){console.error("Error on parse JSON:",t);return}}}export{Gi as Vanilla};
|
|
63
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){i(s);continue}if(e.external){let a=e.external.registry.get(s[0])?.id;if(t!==s[0]&&a){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}if(c.count>1){if(e.reused==="ref")i(s)}}if(e.external)e.sharedDefsExtractedFor=e.external}function ai(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!=="object")return;ai(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!=="string")return;if(!r.includes(s))r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var li=new Set(["type","properties","required","additionalProperties"]),ci=["oneOf","anyOf"];function ui(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function jt(e){let t=[];for(let i of e){if(typeof i!=="object"||i.type!=="object")return null;for(let s in i)if(!li.has(s))return null;t.push(i)}let r={},n=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let c=[];for(let a of t){let l=a.properties?.[s]??ui(a);if(l===null||l===void 0)continue;if(!c.some((f)=>JSON.stringify(f)===JSON.stringify(l)))c.push(l)}let u=c.length===1?c[0]:jt(c)??{allOf:c};j(r,s,u)}for(let s of i.required??[])n.add(s)}let o={type:"object",properties:r};if(n.size)o.required=[...n];if(t.every((i)=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let s of t){let c=ui(s);if(c&&!i.some((u)=>JSON.stringify(u)===JSON.stringify(c)))i.push(c)}if(i.length===1)o.additionalProperties=i[0];else if(i.length>1)o.additionalProperties={allOf:i}}return o}function rc(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of li)if(o in e)return;let r=t.filter((o)=>ci.some((i)=>Array.isArray(o[i]))),n=null;if(!r.length)n=jt(t);else{let o=r[0],i=ci.find((u)=>Array.isArray(o[u]));if(Object.keys(o).length!==1)return;let s=t.filter((u)=>u!==o),c=o[i].map((u)=>jt([...s,u]));if(c.some((u)=>!u))return;n={[i]:c}}if(!n)return;delete e.allOf,ye(e,n)}function Lt(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=(c)=>{let u=e.seen.get(c);if(u.ref===null)return;let a=u.def??u.schema,l={...a},f=u.ref;if(u.ref=null,f){n(f);let m=e.seen.get(f),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))a.allOf=a.allOf??[],a.allOf.push(h);else ye(a,h);if(ye(a,l),c._zod.parent===f)for(let x in a){if(x==="$ref"||x==="allOf")continue;if(!(x in l))delete a[x]}if(h.$ref&&m.def)for(let x in a){if(x==="$ref"||x==="allOf")continue;if(x in m.def&&JSON.stringify(a[x])===JSON.stringify(m.def[x]))delete a[x]}}let d=c._zod.parent;if(d&&d!==f){n(d);let m=e.seen.get(d);if(m?.schema.$ref){if(a.$ref=m.schema.$ref,m.def)for(let h in a){if(h==="$ref"||h==="allOf")continue;if(h in m.def&&JSON.stringify(a[h])===JSON.stringify(m.def[h]))delete a[h]}}}e.override({zodSchema:c,jsonSchema:a,path:u.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())n(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())ai(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let u of e.seen.values())for(let a of[u.schema,u.def]){let l=a?.allOf;if(!Array.isArray(l))continue;let f=c.get(l);if(f)f.push(a);else c.set(l,[a])}for(let u of e.intersections)for(let a of c.get(u)??[])rc(a)}}let o={};if(e.target==="draft-2020-12")o.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")o.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")o.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}ye(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&o.id===i)delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let u=c[1];if(u.def&&u.defId){if(u.def.id===u.defId)delete u.def.id;j(s,u.defId,u.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(s).length>0)if(e.target==="draft-2020-12")o.$defs=s;else o.definitions=s;try{let c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:be(t,"input",e.processors),output:be(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){throw Error("Error converting schema to JSON.")}}function O(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return O(n.element,r);if(n.type==="set")return O(n.valueType,r);if(n.type==="lazy")return O(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return O(n.innerType,r);if(n.type==="intersection")return O(n.left,r)||O(n.right,r);if(n.type==="record"||n.type==="map")return O(n.keyType,r)||O(n.valueType,r);if(n.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return O(n.in,r)||O(n.out,r)}if(n.type==="object"){for(let o in n.shape)if(O(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(O(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(O(o,r))return!0;if(n.rest&&O(n.rest,r))return!0;return!1}return!1}var pi=(e,t={})=>(r)=>{let n=Rt({...r,processors:t});return Z(e,n),Dt(n,e),Lt(n,e)},be=(e,t,r={})=>(n)=>{let{libraryOptions:o,target:i}=n??{},s=Rt({...o??{},target:i,io:t,processors:r});return Z(e,s),Dt(s,e),Lt(s,e)};var ie=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},se=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},fi=(e,t)=>{ie(e,"minimum",t),se(e,"maximum",t)},gi=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},_i=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},xi=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},yi=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},di=(e,t)=>ie(e,"minimum",t.minimum),mi=(e,t)=>se(e,"maximum",t.maximum),hi=(e)=>(t,r)=>{yi(t,r.format);let[n,o]=e[r.format];ie(t,"minimum",n),se(t,"maximum",o)},nc={greater_than:(e,t)=>ie(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>se(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>gi(e,t.value),number_format:hi(ot),bigint_format:hi(it),min_length:di,max_length:mi,length_equals:(e,t)=>fi(e,t.length),min_size:di,max_size:mi,size_equals:(e,t)=>fi(e,t.size),string_format:(e,t)=>{if(yi(e,t.format),t.pattern)_i(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>xi(e,t.mime)};function Q(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)nc[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;if(o.minimum!==void 0)ie(t,"minimum",o.minimum);if(o.exclusiveMinimum!==void 0)ie(t,"exclusiveMinimum",o.exclusiveMinimum);if(o.maximum!==void 0)se(t,"maximum",o.maximum);if(o.exclusiveMaximum!==void 0)se(t,"exclusiveMaximum",o.exclusiveMaximum);if(o.multipleOf!==void 0)gi(t,o.multipleOf);if(o.format!==void 0){if(t.format??(t.format=o.format),o.format.includes("int"))t.isInt=!0}if(o.mime)xi(t,o.mime);for(let i of o.patterns??[])_i(t,i);return t}var oc={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ic=new Map([[bt,Kr],[Re,Wr]]),bi=(e)=>ic.get(e)??e,vi=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:c,patterns:u,contentEncoding:a,laxFormat:l}=Q(e);if(typeof i==="number")o.minLength=i;if(typeof s==="number")o.maxLength=s;if(c){if(o.format=oc[c]??c,o.format==="")delete o.format;if(c==="time"||l)delete o.format}if(a)o.contentEncoding=a;if(u&&u.size>0){let f=[...u].map(bi);if(f.length===1)o.pattern=f[0].source;else if(f.length>1)o.allOf=[...f.map((d)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))]}};var $i=(e,t,r,n)=>{r.not={}};var zi=(e,t,r,n)=>{};var wi=(e,t,r,n)=>{let o=e._zod.def,i=fe(o.entries);if(i.length===0){r.not={};return}if(i.every((s)=>typeof s==="number"))r.type="number";if(i.every((s)=>typeof s==="string"))r.type="string";r.enum=i};var ki=(e,t,r,n)=>{oe(e,t,r,n,"Custom types cannot be represented in JSON Schema")};var Zi=(e,t,r,n)=>{oe(e,t,r,n,"Transforms cannot be represented in JSON Schema")};var Pi=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:c}=Q(e);if(typeof s==="number")o.minItems=s;if(typeof c==="number")o.maxItems=c;o.type="array",o.items=Z(i.element,t,{...n,path:[...n.path,"items"]})};function Be(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return Be(t.out);if(t.type==="catch")return Be(t.innerType);return e._zod.optin}var Si=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&oe(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let l in s)j(o.properties,l,Z(s[l],t,{...n,path:[...n.path,"properties",l]}));let u=new Set(Object.keys(s)),a=new Set([...u].filter((l)=>{let f=i.shape[l];if(t.io==="input")return Be(f)===void 0;else return f._zod.optout===void 0}));if(a.size>0)o.required=Array.from(a);if(i.catchall?._zod.def.type==="never")o.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")o.additionalProperties=!1}else if(i.catchall)o.additionalProperties=Z(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})};var Oi=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((c,u)=>Z(c,t,{...n,path:[...n.path,i?"oneOf":"anyOf",u]}));if(i)r.oneOf=s;else r.anyOf=s},Ii=(e,t,r,n)=>{let o=e._zod.def,i=Z(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=Z(o.right,t,{...n,path:[...n.path,"allOf",1]}),c=(a)=>("allOf"in a)&&Object.keys(a).length===1,u=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];r.allOf=u,t.intersections.push(u)};function Ft(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let h=e.get(t)?.def;if(!h)return t;let _=Ft(e,h,r);return _===h?t:_}for(let h of["anyOf","oneOf"]){let _=t[h];if(!Array.isArray(_))continue;let x=_.map((w)=>Ft(e,w,r));if(x.some((w,C)=>w!==_[C]))t={...t,[h]:x}}let n=Array.isArray(t.type)?t.type:[t.type],o=!n.includes("string")&&n.some((h)=>h==="number"||h==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some((h)=>typeof h==="number"))return t;let{minimum:s,maximum:c,exclusiveMinimum:u,exclusiveMaximum:a,multipleOf:l,format:f,id:d,...m}=t;if(m.enum)m.enum=m.enum.map((h)=>typeof h==="number"?String(h):h);else if(typeof m.const==="number")m.const=String(m.const);if(!o)return m;if(m.type="string",!i)m.pattern=(n.includes("number")?Te:ht).source;return m}var Mt=new WeakMap;function sc(e){let t=new Map;for(let n of e.seen.values())if(n.def&&!t.has(n.schema))t.set(n.schema,n);let r=new Map;for(let n of Mt.get(e)??[]){let o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===!0||r.has(i))continue;let s=Ft(t,i,new Set);if(s!==i)r.set(i,s)}if(!r.size)return;for(let n of e.seen.values())for(let o of[n.schema,n.def]){let i=o&&r.get(o.propertyNames);if(i)o.propertyNames=i}}var Ei=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object";let s=i.keyType,c=Q(s).patterns;if(i.mode==="loose"&&c&&c.size>0){let l=Z(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let f of c)j(o.patternProperties,bi(f).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=Z(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let l=Mt.get(t);if(!l)l=[],Mt.set(t,l),t.deferred.push(()=>sc(t));l.push(e)}o.additionalProperties=Z(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let u=s._zod.values,a=t.io==="input"&&Be(i.valueType)!==void 0;if(u&&!i.partial&&!a){let l=[...u].filter((f)=>typeof f==="string"||typeof f==="number");if(l.length>0)o.required=l.map(String)}},Ai=(e,t,r,n)=>{let o=e._zod.def,i=Z(o.innerType,t,n),s=t.seen.get(e);if(t.target==="openapi-3.0")s.ref=o.innerType,r.nullable=!0;else r.anyOf=[i,{type:"null"}]},Ti=(e,t,r,n)=>{let o=e._zod.def;Z(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},Ut=Symbol();function Ni(e,t,r,n,o){let i=!1,s=JSON.stringify(e,(c,u)=>{if(typeof u!=="bigint")return u;return i=!0,null});if(!i)return JSON.parse(s);return oe(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),Ut}var Ci=(e,t,r,n)=>{let o=e._zod.def;Z(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=Ni(o.defaultValue,e,t,r,n);if(s!==Ut)r.default=s},ji=(e,t,r,n)=>{let o=e._zod.def;Z(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=Ni(o.defaultValue,e,t,r,n);if(s!==Ut)r._prefault=s},Ri=(e,t,r,n)=>{let o=e._zod.def;Z(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{oe(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},Di=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;Z(s,t,n);let c=t.seen.get(e);c.ref=s},Li=(e,t,r,n)=>{let o=e._zod.def;Z(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0};var Jt=(e,t,r,n)=>{let o=e._zod.def;Z(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType};var Fi=new WeakSet([Object.prototype,Error.prototype]);function Ve(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var xc=(e,t)=>{yr.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(Fi.has(r))return;Fi.add(r),Ve(r,"format",(n)=>(o)=>vr(n,o)),Ve(r,"flatten",(n)=>(o)=>br(n,o)),Ve(r,"addIssue",(n)=>(o)=>{n.issues.push(o),n.message=JSON.stringify(n.issues,de,2)}),Ve(r,"addIssues",(n)=>(o)=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,de,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var N=p("ZodError",xc,void 0,{Parent:Error});var Mi=Oe(N),Ui=Ie(N),Ji=Ee(N),Bi=Ae(N),Vi=zr(N),Ki=wr(N),Wi=kr(N),qi=Zr(N),Gi=Pr(N),Xi=Sr(N),Hi=Or(N),Yi=Ir(N);function bc(){if(!I.localeError)T(wt())}function We(){if(!I.memoizer)T({memoizer:ko()})}var P=p("ZodType",(e,t)=>(bc(),k.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(A(t,{checks:[...t.checks??[],...e.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return F(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(hu(e,t))},superRefine(e,t){return this.check(gu(e,t))},overwrite(e){return this.check(q(e))},optional(){return es(this)},exactOptional(){return ru(this)},nullable(){return ts(this)},nullish(){return es(ts(this))},nonoptional(e){return uu(this,e)},array(){return qc(this)},or(e){return Kt([this,e])},and(e){return Yc(this,e)},transform(e){return rs(this,tu(e))},default(e){return iu(this,e)},prefault(e){return cu(this,e)},catch(e){return lu(this,e)},pipe(e){return rs(this,e)},readonly(){return du(this)},describe(e){let t=this.clone();return Y.add(t,{description:e}),t},meta(...e){if(e.length===0)return Y.get(this);let t=this.clone();return Y.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get "~standard"(){return ct(this,"~standard",{...yt(this),jsonSchema:{input:be(this,"input"),output:be(this,"output")}})},set "~standard"(e){V(this,"~standard",e)},parse:function e(t,r){return Mi(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await Ui(this,t,r,{callee:e})},safeParse(e,t){return Ji(this,e,t)},async safeParseAsync(e,t){return Bi(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){V(this,"spa",e)},validate(e,t){return pt(this,e,t)},validateAsync(e,t){return ft(this,e,t)},encode:function e(t,r){return Vi(this,t,r,{callee:e})},decode:function e(t,r){return Ki(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Wi(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await qi(this,t,r,{callee:e})},safeEncode(e,t){return Gi(this,e,t)},safeDecode(e,t){return Xi(this,e,t)},async safeEncodeAsync(e,t){return Hi(this,e,t)},async safeDecodeAsync(e,t){return Yi(this,e,t)},toJSONSchema(e){return pi(this,{})(e)},get description(){return Y.get(this)?.description},get _def(){return this._zod.def}}),ns=p("_ZodString",(e,t)=>{je.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vi(e,r,n,o)},vs({format:(e)=>Q(e).format??null,minLength:(e)=>Q(e).minimum??null,maxLength:(e)=>Q(e).maximum??null},{regex(...e){return this.check(kt(...e))},includes(...e){return this.check(St(...e))},startsWith(...e){return this.check(Ot(...e))},endsWith(...e){return this.check(It(...e))},min(...e){return this.check(ne(...e))},max(...e){return this.check(Ue(...e))},length(...e){return this.check(Je(...e))},nonempty(...e){return this.check(ne(1,...e))},lowercase(e){return this.check(Zt(e))},uppercase(e){return this.check(Pt(e))},trim(){return this.check(At())},normalize(...e){return this.check(Et(...e))},toLowerCase(){return this.check(Tt())},toUpperCase(){return this.check(Nt())},slugify(){return this.check(Ct())}})),vc=p("ZodString",(e,t)=>{je.init(e,t),ns.init(e,t)},{email(e){return this.check(Oo(Zc,e))},url(e){return this.check(Co(Sc,e))},jwt(e){return this.check(Xo(Jc,e))},emoji(e){return this.check(jo(Oc,e))},guid(e){return this.check(Io(Pc,e))},uuid(e){return this.check(Eo(Ke,e))},uuidv4(e){return this.check(Ao(Ke,e))},uuidv6(e){return this.check(To(Ke,e))},uuidv7(e){return this.check(No(Ke,e))},nanoid(e){return this.check(Ro(Ic,e))},cuid(e){return this.check(Do(Ec,e))},cuid2(e){return this.check(Lo(Ac,e))},ulid(e){return this.check(Fo(Tc,e))},base64(e){return this.check(Wo(Fc,e))},base64url(e){return this.check(qo(Mc,e))},xid(e){return this.check(Mo(Nc,e))},ksuid(e){return this.check(Uo(Cc,e))},ipv4(e){return this.check(Jo(jc,e))},ipv6(e){return this.check(Bo(Rc,e))},cidrv4(e){return this.check(Vo(Dc,e))},cidrv6(e){return this.check(Ko(Lc,e))},e164(e){return this.check(Go(Uc,e))},datetime(e){return this.check(Ho($c,e))},date(e){return this.check(Yo(zc,e))},time(e){return this.check(Qo(wc,e))},duration(e){return this.check(ei(kc,e))}});function D(e){return So(vc,e)}var z=p("ZodStringFormat",(e,t)=>{b.init(e,t),ns.init(e,t)}),$c=p("ZodISODateTime",(e,t)=>{Fn.init(e,t),z.init(e,t)}),zc=p("ZodISODate",(e,t)=>{Mn.init(e,t),z.init(e,t)}),wc=p("ZodISOTime",(e,t)=>{Un.init(e,t),z.init(e,t)}),kc=p("ZodISODuration",(e,t)=>{Jn.init(e,t),z.init(e,t)}),Zc=p("ZodEmail",(e,t)=>{On.init(e,t),z.init(e,t)});var Pc=p("ZodGUID",(e,t)=>{Pn.init(e,t),z.init(e,t)});var Ke=p("ZodUUID",(e,t)=>{Sn.init(e,t),z.init(e,t)});var Sc=p("ZodURL",(e,t)=>{An.init(e,t),z.init(e,t)});var Oc=p("ZodEmoji",(e,t)=>{Tn.init(e,t),z.init(e,t)});var Ic=p("ZodNanoID",(e,t)=>{Nn.init(e,t),z.init(e,t)});var Ec=p("ZodCUID",(e,t)=>{Cn.init(e,t),z.init(e,t)});var Ac=p("ZodCUID2",(e,t)=>{jn.init(e,t),z.init(e,t)});var Tc=p("ZodULID",(e,t)=>{Rn.init(e,t),z.init(e,t)});var Nc=p("ZodXID",(e,t)=>{Dn.init(e,t),z.init(e,t)});var Cc=p("ZodKSUID",(e,t)=>{Ln.init(e,t),z.init(e,t)});var jc=p("ZodIPv4",(e,t)=>{Bn.init(e,t),z.init(e,t)});var Rc=p("ZodIPv6",(e,t)=>{Kn.init(e,t),z.init(e,t)});var Dc=p("ZodCIDRv4",(e,t)=>{Wn.init(e,t),z.init(e,t)});var Lc=p("ZodCIDRv6",(e,t)=>{qn.init(e,t),z.init(e,t)});var Fc=p("ZodBase64",(e,t)=>{Xn.init(e,t),z.init(e,t)});var Mc=p("ZodBase64URL",(e,t)=>{Hn.init(e,t),z.init(e,t)});var Uc=p("ZodE164",(e,t)=>{Yn.init(e,t),z.init(e,t)});var Jc=p("ZodJWT",(e,t)=>{Qn.init(e,t),z.init(e,t)});var Bc=p("ZodUnknown",(e,t)=>{eo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zi(e,r,n,o)});function ee(){return ti(Bc)}var Vc=p("ZodNever",(e,t)=>{to.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$i(e,r,n,o)});function Kc(e){return ri(Vc,e)}var Wc=p("ZodArray",(e,t)=>{We(),ro.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Pi(e,r,n,o),e.element=t.element},{min(e,t){return this.check(ne(e,t))},nonempty(e){return this.check(ne(1,e))},max(e,t){return this.check(Ue(e,t))},length(e,t){return this.check(Je(e,t))},unwrap(){return this.element}});function qc(e,t){return ni(Wc,e,t)}var Gc=p("ZodObject",(e,t)=>{We(),io.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Si(e,r,n,o),ws(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return Qc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(A(this._zod.def,{catchall:e}))},passthrough(){return this.clone(A(this._zod.def,{catchall:ee()}))},loose(){return this.clone(A(this._zod.def,{catchall:ee()}))},strict(){return this.clone(A(this._zod.def,{catchall:Kc()}))},strip(){return this.clone(A(this._zod.def,{catchall:void 0}))},extend(e){return gs(this,e)},safeExtend(e){return _s(this,e)},merge(e){return xs(this,e)},pick(e){return ms(this,e)},omit(e){return hs(this,e)},partial(...e){return lr(os,this,e[0])},exactPartial(...e){return lr(is,this,e[0],"exactPartial")},required(...e){return ys(ss,this,e[0])}});function qe(e,t){let r={type:"object",shape:e??{},...g(t)};return new Gc(r)}var Xc=p("ZodUnion",(e,t)=>{so.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Oi(e,r,n,o),e.options=t.options});function Kt(e,t){return new Xc({type:"union",options:e,...g(t)})}var Hc=p("ZodIntersection",(e,t)=>{co.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ii(e,r,n,o)});function Yc(e,t){return new Hc({type:"intersection",left:e,right:t})}var Qi=p("ZodRecord",(e,t)=>{We(),uo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ei(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function ce(e,t,r){if(!t||!t._zod)return new Qi({type:"record",keyType:D(),valueType:e,...g(t)});return new Qi({type:"record",keyType:e,valueType:t,...g(r)})}var Vt=p("ZodEnum",(e,t)=>{ao.init(e,t),P.init(e,t),e._zod.processJSONSchema=(n,o,i)=>wi(e,n,o,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new Vt({...t,checks:[],...g(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new Vt({...t,checks:[],...g(o),entries:i})}});function Qc(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((n)=>[n,n])):e;return new Vt({type:"enum",entries:r,...g(t)})}var eu=p("ZodTransform",(e,t)=>{We(),lo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zi(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new me(e.constructor.name);r.addIssue=(i)=>{if(typeof i==="string")r.issues.push(H(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=r.value;s.inst??(s.inst=e),r.issues.push(H(s))}};let o=t.transform(r.value,r);if(o instanceof Promise)return o.then((i)=>(r.value=i,r));return r.value=o,r}});function tu(e){return new eu({type:"transform",transform:e})}var os=p("ZodOptional",(e,t)=>{vt.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Jt(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function es(e){return new os({type:"optional",innerType:e})}var is=p("ZodExactOptional",(e,t)=>{po.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Jt(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ru(e){return new is({type:"optional",innerType:e})}var nu=p("ZodNullable",(e,t)=>{fo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ai(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ts(e){return new nu({type:"nullable",innerType:e})}var ou=p("ZodDefault",(e,t)=>{mo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ci(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function iu(e,t){return new ou({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():rt(t)}})}var su=p("ZodPrefault",(e,t)=>{ho.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ji(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function cu(e,t){return new su({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():rt(t)}})}var ss=p("ZodNonOptional",(e,t)=>{go.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ti(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function uu(e,t){return new ss({type:"nonoptional",innerType:e,...g(t)})}var au=p("ZodCatch",(e,t)=>{_o.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ri(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lu(e,t){return new au({type:"catch",innerType:e,catchValue:typeof t==="function"?t:mr(t)})}var pu=p("ZodPipe",(e,t)=>{xo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Di(e,r,n,o),e.in=t.in,e.out=t.out});function rs(e,t){return new pu({type:"pipe",in:e,out:t})}var fu=p("ZodReadonly",(e,t)=>{yo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Li(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function du(e){return new fu({type:"readonly",innerType:e})}var mu=p("ZodCustom",(e,t)=>{bo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ki(e,r,n,o)});function hu(e,t={}){return oi(mu,e,t)}function gu(e,t){return ii(e,t)}var Ge=ce(D(),ee()).nullish();var Xe=ce(D(),D().nullish()).nullish();var Wt=qe({path:D().trim().nonempty(),component:D().trim().nonempty()});var He=Kt([ce(D(),ee()),ee().array()]).nullish();var _u=qe({metadata:Xe,data:Ge,staticData:He});class qt{window;#n;#e=new Map;#t=new Map;#r=new Map;constructor(e){this.window=e;this.#o(),this.#c(),this.#i(),this.#s()}#o(){let e=this.window.document.body.querySelector(`script#${te.routes}[type="application/json"]`);if(!e)return;try{let t=e.textContent.trim(),r=JSON.parse(t);if(!Array.isArray(r))return;this.#n=r.map((n)=>{let o=Wt.safeParse(n);return!o.success?null:o.data}).filter((n)=>!!n)}catch(t){console.error("Error on parse routes:",t);return}}#i(){let e=this.window.document.body.querySelector(`script#${te.staticData}[type="application/json"]`);if(!e)return;try{let{pathname:t,search:r}=this.window.location,n=e.textContent.trim(),o=JSON.parse(n),i=He.safeParse(o);if(!i.success)return;this.#e.set(`${t}${r}`,i.data)}catch(t){console.error("Error on parse static data:",t);return}}#s(){let e=this.window.document.body.querySelector(`script#${te.data}[type="application/json"]`);if(!e)return;try{let{pathname:t,search:r}=this.window.location,n=e.textContent.trim(),o=JSON.parse(n),i=Ge.safeParse(o);if(!i.success)return;this.#t.set(`${t}${r}`,i.data)}catch(t){console.error("Error on parse data:",t);return}}#c(){let e=this.window.document.body.querySelector(`script#${te.metadata}[type="application/json"]`);if(!e)return;try{let{pathname:t,search:r}=this.window.location,n=e.textContent.trim(),o=JSON.parse(n),i=Xe.safeParse(o);if(!i.success)return;this.#r.set(`${t}${r}`,i.data)}catch(t){console.error("Error on parse metadata:",t);return}}async fetchRoute({origin:e,search:t,pathname:r,cache:n}={pathname:this.window.location.pathname,search:this.window.location.search,origin:this.window.location.origin,cache:!1}){let o=`${r}${t}`;if(n&&this.#t.has(o)&&this.#r.has(o)&&this.#e.has(o))return;try{let i=new Headers;i.append("X-Requested-With","XMLHttpRequest"),i.append("Content-Type","application/json");let s=await fetch(`${e}${o}`,{method:"GET",headers:i});if(!s.ok)throw Error(`Can not fetch data [${o}]`);let c=await s.json(),u=_u.safeParse(c);if(!u.success)throw u.error;this.#t.set(o,u.data.data),this.#r.set(o,u.data.metadata),this.#e.set(o,u.data.staticData)}catch(i){console.error("Error on fetch full route data:",i);return}}get routes(){return this.#n}get staticData(){let{pathname:e,search:t}=this.window.location;return this.#e.get(`${e}${t}`)}get data(){let{pathname:e,search:t}=this.window.location;return this.#t.get(`${e}${t}`)}get metadata(){let{pathname:e,search:t}=this.window.location;return this.#r.get(`${e}${t}`)}}export{cs as Vanilla};
|
|
64
64
|
|
|
65
|
-
//# debugId=
|
|
65
|
+
//# debugId=3F94F1F0D8294A0364756E2164756E21
|