@walkeros/web-destination-api
Version:
Web API destination for walkerOS
1 lines • 87.6 kB
JavaScript
var e,t,a,r=Object.defineProperty,n=(e,t)=>{for(var a in t)r(e,a,{get:t[a],enumerable:!0})},s={};n(s,{BRAND:()=>Le,DIRTY:()=>x,EMPTY_PATH:()=>g,INVALID:()=>k,NEVER:()=>$t,OK:()=>w,ParseStatus:()=>b,Schema:()=>C,ZodAny:()=>ue,ZodArray:()=>me,ZodBigInt:()=>ne,ZodBoolean:()=>se,ZodBranded:()=>Fe,ZodCatch:()=>Re,ZodDate:()=>ie,ZodDefault:()=>Me,ZodDiscriminatedUnion:()=>_e,ZodEffects:()=>$e,ZodEnum:()=>Ne,ZodError:()=>u,ZodFirstPartyTypeKind:()=>Ke,ZodFunction:()=>Te,ZodIntersection:()=>ke,ZodIssueCode:()=>d,ZodLazy:()=>Oe,ZodLiteral:()=>Se,ZodMap:()=>Ze,ZodNaN:()=>ze,ZodNativeEnum:()=>je,ZodNever:()=>pe,ZodNull:()=>ce,ZodNullable:()=>Ie,ZodNumber:()=>re,ZodObject:()=>ge,ZodOptional:()=>Ee,ZodParsedType:()=>i,ZodPipeline:()=>De,ZodPromise:()=>Ce,ZodReadonly:()=>Ve,ZodRecord:()=>we,ZodSchema:()=>C,ZodSet:()=>Ae,ZodString:()=>te,ZodSymbol:()=>oe,ZodTransformer:()=>$e,ZodTuple:()=>xe,ZodType:()=>C,ZodUndefined:()=>de,ZodUnion:()=>ye,ZodUnknown:()=>le,ZodVoid:()=>he,addIssueToContext:()=>y,any:()=>nt,array:()=>dt,bigint:()=>Xe,boolean:()=>Qe,coerce:()=>Ct,custom:()=>Be,date:()=>et,datetimeRegex:()=>G,defaultErrorMap:()=>l,discriminatedUnion:()=>pt,effect:()=>Zt,enum:()=>kt,function:()=>vt,getErrorMap:()=>m,getParsedType:()=>o,instanceof:()=>Je,intersection:()=>ht,isAborted:()=>Z,isAsync:()=>O,isDirty:()=>A,isValid:()=>T,late:()=>qe,lazy:()=>_t,literal:()=>bt,makeIssue:()=>f,map:()=>gt,nan:()=>Ge,nativeEnum:()=>xt,never:()=>it,null:()=>rt,nullable:()=>Tt,number:()=>Ye,object:()=>ct,objectUtil:()=>a,oboolean:()=>jt,onumber:()=>Nt,optional:()=>At,ostring:()=>Pt,pipeline:()=>St,preprocess:()=>Ot,promise:()=>wt,quotelessJson:()=>c,record:()=>ft,set:()=>yt,setErrorMap:()=>h,strictObject:()=>ut,string:()=>He,symbol:()=>tt,transformer:()=>Zt,tuple:()=>mt,undefined:()=>at,union:()=>lt,unknown:()=>st,util:()=>e,void:()=>ot}),(t=e||(e={})).assertEqual=e=>{},t.assertIs=function(e){},t.assertNever=function(e){throw new Error},t.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},t.getValidEnumValues=e=>{const a=t.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),r={};for(const t of a)r[t]=e[t];return t.objectValues(r)},t.objectValues=e=>t.objectKeys(e).map(function(t){return e[t]}),t.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},t.find=(e,t)=>{for(const a of e)if(t(a))return a},t.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,t.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},t.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(a||(a={})).mergeShapes=(e,t)=>({...e,...t});var i=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),o=e=>{switch(typeof e){case"undefined":return i.undefined;case"string":return i.string;case"number":return Number.isNaN(e)?i.nan:i.number;case"boolean":return i.boolean;case"function":return i.function;case"bigint":return i.bigint;case"symbol":return i.symbol;case"object":return Array.isArray(e)?i.array:null===e?i.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?i.promise:"undefined"!=typeof Map&&e instanceof Map?i.map:"undefined"!=typeof Set&&e instanceof Set?i.set:"undefined"!=typeof Date&&e instanceof Date?i.date:i.object;default:return i.unknown}},d=e.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),c=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),u=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},a={_errors:[]},r=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(r);else if("invalid_return_type"===n.code)r(n.returnTypeError);else if("invalid_arguments"===n.code)r(n.argumentsError);else if(0===n.path.length)a._errors.push(t(n));else{let e=a,r=0;for(;r<n.path.length;){const a=n.path[r];r===n.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(n))):e[a]=e[a]||{_errors:[]},e=e[a],r++}}};return r(this),a}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},a=[];for(const r of this.issues)if(r.path.length>0){const a=r.path[0];t[a]=t[a]||[],t[a].push(e(r))}else a.push(e(r));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}};u.create=e=>new u(e);var l=(t,a)=>{let r;switch(t.code){case d.invalid_type:r=t.received===i.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case d.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,e.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:r=`Unrecognized key(s) in object: ${e.joinValues(t.keys,", ")}`;break;case d.invalid_union:r="Invalid input";break;case d.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${e.joinValues(t.options)}`;break;case d.invalid_enum_value:r=`Invalid enum value. Expected ${e.joinValues(t.options)}, received '${t.received}'`;break;case d.invalid_arguments:r="Invalid function arguments";break;case d.invalid_return_type:r="Invalid function return type";break;case d.invalid_date:r="Invalid date";break;case d.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:e.assertNever(t.validation):r="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case d.too_small:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type||"bigint"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case d.too_big:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case d.custom:r="Invalid input";break;case d.invalid_intersection_types:r="Intersection results could not be merged";break;case d.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case d.not_finite:r="Number must be finite";break;default:r=a.defaultError,e.assertNever(t)}return{message:r}},p=l;function h(e){p=e}function m(){return p}var f=e=>{const{data:t,path:a,errorMaps:r,issueData:n}=e,s=[...a,...n.path||[]],i={...n,path:s};if(void 0!==n.message)return{...n,path:s,message:n.message};let o="";const d=r.filter(e=>!!e).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...n,path:s,message:o}},g=[];function y(e,t){const a=m(),r=f({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===l?void 0:l].filter(e=>!!e)});e.common.issues.push(r)}var v,_,b=class e{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const r of t){if("aborted"===r.status)return k;"dirty"===r.status&&e.dirty(),a.push(r.value)}return{status:e.value,value:a}}static async mergeObjectAsync(t,a){const r=[];for(const e of a){const t=await e.key,a=await e.value;r.push({key:t,value:a})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){const a={};for(const r of t){const{key:t,value:n}=r;if("aborted"===t.status)return k;if("aborted"===n.status)return k;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"===t.value||void 0===n.value&&!r.alwaysSet||(a[t.value]=n.value)}return{status:e.value,value:a}}},k=Object.freeze({status:"aborted"}),x=e=>({status:"dirty",value:e}),w=e=>({status:"valid",value:e}),Z=e=>"aborted"===e.status,A=e=>"dirty"===e.status,T=e=>"valid"===e.status,O=e=>"undefined"!=typeof Promise&&e instanceof Promise;(_=v||(v={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},_.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;var S=class{constructor(e,t,a,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},P=(e,t)=>{if(T(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new u(e.common.issues);return this._error=t,this._error}}};function N(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:r,description:n}=e;if(t&&(a||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:n};return{errorMap:(t,n)=>{var s,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:n.defaultError}:void 0===n.data?{message:null!=(s=null!=o?o:r)?s:n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:null!=(i=null!=o?o:a)?i:n.defaultError}},description:n}}var j,C=class{get description(){return this._def.description}_getType(e){return o(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new b,ctx:{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(O(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const r={common:{issues:[],async:null!=(a=null==t?void 0:t.async)&&a,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)},n=this._parseSync({data:e,path:r.path,parent:r});return P(r,n)}"~validate"(e){var t,a;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:r});return T(t)?{value:t.value}:{issues:r.common.issues}}catch(e){(null==(a=null==(t=null==e?void 0:e.message)?void 0:t.toLowerCase())?void 0:a.includes("encountered"))&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(e=>T(e)?{value:e.value}:{issues:r.common.issues})}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)},r=this._parse({data:e,path:a.path,parent:a}),n=await(O(r)?r:Promise.resolve(r));return P(a,n)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,r)=>{const n=e(t),s=()=>r.addIssue({code:d.custom,...a(t)});return"undefined"!=typeof Promise&&n instanceof Promise?n.then(e=>!!e||(s(),!1)):!!n||(s(),!1)})}refinement(e,t){return this._refinement((a,r)=>!!e(a)||(r.addIssue("function"==typeof t?t(a,r):t),!1))}_refinement(e){return new $e({schema:this,typeName:Ke.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Ee.create(this,this._def)}nullable(){return Ie.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return me.create(this)}promise(){return Ce.create(this,this._def)}or(e){return ye.create([this,e],this._def)}and(e){return ke.create(this,e,this._def)}transform(e){return new $e({...N(this._def),schema:this,typeName:Ke.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Me({...N(this._def),innerType:this,defaultValue:t,typeName:Ke.ZodDefault})}brand(){return new Fe({typeName:Ke.ZodBranded,type:this,...N(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Re({...N(this._def),innerType:this,catchValue:t,typeName:Ke.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return De.create(this,e)}readonly(){return Ve.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},$=/^c[^\s-]{8,}$/i,E=/^[0-9a-z]+$/,I=/^[0-9A-HJKMNP-TV-Z]{26}$/i,M=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,R=/^[a-z0-9_-]{21}$/i,z=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,L=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,F=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,D=/^(?:(?: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])$/,V=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,U=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,B=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,K=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,W=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,q="((\\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])))",J=new RegExp(`^${q}$`);function H(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function Y(e){return new RegExp(`^${H(e)}$`)}function G(e){let t=`${q}T${H(e)}`;const a=[];return a.push(e.local?"Z?":"Z"),e.offset&&a.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${a.join("|")})`,new RegExp(`^${t}$`)}function X(e,t){return!("v4"!==t&&t||!D.test(e))||!("v6"!==t&&t||!U.test(e))}function Q(e,t){if(!z.test(e))return!1;try{const[a]=e.split(".");if(!a)return!1;const r=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),n=JSON.parse(atob(r));return"object"==typeof n&&null!==n&&((!("typ"in n)||"JWT"===(null==n?void 0:n.typ))&&(!!n.alg&&(!t||n.alg===t)))}catch(e){return!1}}function ee(e,t){return!("v4"!==t&&t||!V.test(e))||!("v6"!==t&&t||!B.test(e))}var te=class t extends C{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==i.string){const e=this._getOrReturnCtx(t);return y(e,{code:d.invalid_type,expected:i.string,received:e.parsedType}),k}const a=new b;let r;for(const n of this._def.checks)if("min"===n.kind)t.data.length<n.value&&(r=this._getOrReturnCtx(t,r),y(r,{code:d.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if("max"===n.kind)t.data.length>n.value&&(r=this._getOrReturnCtx(t,r),y(r,{code:d.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if("length"===n.kind){const e=t.data.length>n.value,s=t.data.length<n.value;(e||s)&&(r=this._getOrReturnCtx(t,r),e?y(r,{code:d.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):s&&y(r,{code:d.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),a.dirty())}else if("email"===n.kind)F.test(t.data)||(r=this._getOrReturnCtx(t,r),y(r,{validation:"email",code:d.invalid_string,message:n.message}),a.dirty());else if("emoji"===n.kind)j||(j=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),j.test(t.data)||(r=this._getOrReturnCtx(t,r),y(r,{validation:"emoji",code:d.invalid_string,message:n.message}),a.dirty());else if("uuid"===n.kind)M.test(t.data)||(r=this._getOrReturnCtx(t,r),y(r,{validation:"uuid",code:d.invalid_string,message:n.message}),a.dirty());else if("nanoid"===n.kind)R.test(t.data)||(r=this._getOrReturnCtx(t,r),y(r,{validation:"nanoid",code:d.invalid_string,message:n.message}),a.dirty());else if("cuid"===n.kind)$.test(t.data)||(r=this._getOrReturnCtx(t,r),y(r,{validation:"cuid",code:d.invalid_string,message:n.message}),a.dirty());else if("cuid2"===n.kind)E.test(t.data)||(r=this._getOrReturnCtx(t,r),y(r,{validation:"cuid2",code:d.invalid_string,message:n.message}),a.dirty());else if("ulid"===n.kind)I.test(t.data)||(r=this._getOrReturnCtx(t,r),y(r,{validation:"ulid",code:d.invalid_string,message:n.message}),a.dirty());else if("url"===n.kind)try{new URL(t.data)}catch(e){r=this._getOrReturnCtx(t,r),y(r,{validation:"url",code:d.invalid_string,message:n.message}),a.dirty()}else if("regex"===n.kind){n.regex.lastIndex=0;n.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),y(r,{validation:"regex",code:d.invalid_string,message:n.message}),a.dirty())}else if("trim"===n.kind)t.data=t.data.trim();else if("includes"===n.kind)t.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(t,r),y(r,{code:d.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),a.dirty());else if("toLowerCase"===n.kind)t.data=t.data.toLowerCase();else if("toUpperCase"===n.kind)t.data=t.data.toUpperCase();else if("startsWith"===n.kind)t.data.startsWith(n.value)||(r=this._getOrReturnCtx(t,r),y(r,{code:d.invalid_string,validation:{startsWith:n.value},message:n.message}),a.dirty());else if("endsWith"===n.kind)t.data.endsWith(n.value)||(r=this._getOrReturnCtx(t,r),y(r,{code:d.invalid_string,validation:{endsWith:n.value},message:n.message}),a.dirty());else if("datetime"===n.kind){G(n).test(t.data)||(r=this._getOrReturnCtx(t,r),y(r,{code:d.invalid_string,validation:"datetime",message:n.message}),a.dirty())}else if("date"===n.kind){J.test(t.data)||(r=this._getOrReturnCtx(t,r),y(r,{code:d.invalid_string,validation:"date",message:n.message}),a.dirty())}else if("time"===n.kind){Y(n).test(t.data)||(r=this._getOrReturnCtx(t,r),y(r,{code:d.invalid_string,validation:"time",message:n.message}),a.dirty())}else"duration"===n.kind?L.test(t.data)||(r=this._getOrReturnCtx(t,r),y(r,{validation:"duration",code:d.invalid_string,message:n.message}),a.dirty()):"ip"===n.kind?X(t.data,n.version)||(r=this._getOrReturnCtx(t,r),y(r,{validation:"ip",code:d.invalid_string,message:n.message}),a.dirty()):"jwt"===n.kind?Q(t.data,n.alg)||(r=this._getOrReturnCtx(t,r),y(r,{validation:"jwt",code:d.invalid_string,message:n.message}),a.dirty()):"cidr"===n.kind?ee(t.data,n.version)||(r=this._getOrReturnCtx(t,r),y(r,{validation:"cidr",code:d.invalid_string,message:n.message}),a.dirty()):"base64"===n.kind?K.test(t.data)||(r=this._getOrReturnCtx(t,r),y(r,{validation:"base64",code:d.invalid_string,message:n.message}),a.dirty()):"base64url"===n.kind?W.test(t.data)||(r=this._getOrReturnCtx(t,r),y(r,{validation:"base64url",code:d.invalid_string,message:n.message}),a.dirty()):e.assertNever(n);return{status:a.value,value:t.data}}_regex(e,t,a){return this.refinement(t=>e.test(t),{validation:t,code:d.invalid_string,...v.errToObj(a)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...v.errToObj(e)})}url(e){return this._addCheck({kind:"url",...v.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...v.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...v.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...v.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...v.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...v.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...v.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...v.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...v.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...v.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...v.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...v.errToObj(e)})}datetime(e){var t,a;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!=(t=null==e?void 0:e.offset)&&t,local:null!=(a=null==e?void 0:e.local)&&a,...v.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...v.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...v.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...v.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...v.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...v.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...v.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...v.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...v.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...v.errToObj(t)})}nonempty(e){return this.min(1,v.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}};function ae(e,t){const a=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,n=a>r?a:r;return Number.parseInt(e.toFixed(n).replace(".",""))%Number.parseInt(t.toFixed(n).replace(".",""))/10**n}te.create=e=>{var t;return new te({checks:[],typeName:Ke.ZodString,coerce:null!=(t=null==e?void 0:e.coerce)&&t,...N(e)})};var re=class t extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==i.number){const e=this._getOrReturnCtx(t);return y(e,{code:d.invalid_type,expected:i.number,received:e.parsedType}),k}let a;const r=new b;for(const n of this._def.checks)if("int"===n.kind)e.isInteger(t.data)||(a=this._getOrReturnCtx(t,a),y(a,{code:d.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty());else if("min"===n.kind){(n.inclusive?t.data<n.value:t.data<=n.value)&&(a=this._getOrReturnCtx(t,a),y(a,{code:d.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else if("max"===n.kind){(n.inclusive?t.data>n.value:t.data>=n.value)&&(a=this._getOrReturnCtx(t,a),y(a,{code:d.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else"multipleOf"===n.kind?0!==ae(t.data,n.value)&&(a=this._getOrReturnCtx(t,a),y(a,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(t.data)||(a=this._getOrReturnCtx(t,a),y(a,{code:d.not_finite,message:n.message}),r.dirty()):e.assertNever(n);return{status:r.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:v.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:v.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:v.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(t=>"int"===t.kind||"multipleOf"===t.kind&&e.isInteger(t.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}};re.create=e=>new re({checks:[],typeName:Ke.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...N(e)});var ne=class t extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch(e){return this._getInvalidInput(t)}if(this._getType(t)!==i.bigint)return this._getInvalidInput(t);let a;const r=new b;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?t.data<n.value:t.data<=n.value)&&(a=this._getOrReturnCtx(t,a),y(a,{code:d.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else if("max"===n.kind){(n.inclusive?t.data>n.value:t.data>=n.value)&&(a=this._getOrReturnCtx(t,a),y(a,{code:d.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else"multipleOf"===n.kind?t.data%n.value!==BigInt(0)&&(a=this._getOrReturnCtx(t,a),y(a,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):e.assertNever(n);return{status:r.value,value:t.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return y(t,{code:d.invalid_type,expected:i.bigint,received:t.parsedType}),k}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:v.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}};ne.create=e=>{var t;return new ne({checks:[],typeName:Ke.ZodBigInt,coerce:null!=(t=null==e?void 0:e.coerce)&&t,...N(e)})};var se=class extends C{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==i.boolean){const t=this._getOrReturnCtx(e);return y(t,{code:d.invalid_type,expected:i.boolean,received:t.parsedType}),k}return w(e.data)}};se.create=e=>new se({typeName:Ke.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...N(e)});var ie=class t extends C{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==i.date){const e=this._getOrReturnCtx(t);return y(e,{code:d.invalid_type,expected:i.date,received:e.parsedType}),k}if(Number.isNaN(t.data.getTime())){return y(this._getOrReturnCtx(t),{code:d.invalid_date}),k}const a=new b;let r;for(const n of this._def.checks)"min"===n.kind?t.data.getTime()<n.value&&(r=this._getOrReturnCtx(t,r),y(r,{code:d.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),a.dirty()):"max"===n.kind?t.data.getTime()>n.value&&(r=this._getOrReturnCtx(t,r),y(r,{code:d.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),a.dirty()):e.assertNever(n);return{status:a.value,value:new Date(t.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:v.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:v.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}};ie.create=e=>new ie({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ke.ZodDate,...N(e)});var oe=class extends C{_parse(e){if(this._getType(e)!==i.symbol){const t=this._getOrReturnCtx(e);return y(t,{code:d.invalid_type,expected:i.symbol,received:t.parsedType}),k}return w(e.data)}};oe.create=e=>new oe({typeName:Ke.ZodSymbol,...N(e)});var de=class extends C{_parse(e){if(this._getType(e)!==i.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:d.invalid_type,expected:i.undefined,received:t.parsedType}),k}return w(e.data)}};de.create=e=>new de({typeName:Ke.ZodUndefined,...N(e)});var ce=class extends C{_parse(e){if(this._getType(e)!==i.null){const t=this._getOrReturnCtx(e);return y(t,{code:d.invalid_type,expected:i.null,received:t.parsedType}),k}return w(e.data)}};ce.create=e=>new ce({typeName:Ke.ZodNull,...N(e)});var ue=class extends C{constructor(){super(...arguments),this._any=!0}_parse(e){return w(e.data)}};ue.create=e=>new ue({typeName:Ke.ZodAny,...N(e)});var le=class extends C{constructor(){super(...arguments),this._unknown=!0}_parse(e){return w(e.data)}};le.create=e=>new le({typeName:Ke.ZodUnknown,...N(e)});var pe=class extends C{_parse(e){const t=this._getOrReturnCtx(e);return y(t,{code:d.invalid_type,expected:i.never,received:t.parsedType}),k}};pe.create=e=>new pe({typeName:Ke.ZodNever,...N(e)});var he=class extends C{_parse(e){if(this._getType(e)!==i.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:d.invalid_type,expected:i.void,received:t.parsedType}),k}return w(e.data)}};he.create=e=>new he({typeName:Ke.ZodVoid,...N(e)});var me=class e extends C{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),r=this._def;if(t.parsedType!==i.array)return y(t,{code:d.invalid_type,expected:i.array,received:t.parsedType}),k;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,n=t.data.length<r.exactLength.value;(e||n)&&(y(t,{code:e?d.too_big:d.too_small,minimum:n?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),a.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(y(t,{code:d.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),a.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(y(t,{code:d.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((e,a)=>r.type._parseAsync(new S(t,e,t.path,a)))).then(e=>b.mergeArray(a,e));const n=[...t.data].map((e,a)=>r.type._parseSync(new S(t,e,t.path,a)));return b.mergeArray(a,n)}get element(){return this._def.type}min(t,a){return new e({...this._def,minLength:{value:t,message:v.toString(a)}})}max(t,a){return new e({...this._def,maxLength:{value:t,message:v.toString(a)}})}length(t,a){return new e({...this._def,exactLength:{value:t,message:v.toString(a)}})}nonempty(e){return this.min(1,e)}};function fe(e){if(e instanceof ge){const t={};for(const a in e.shape){const r=e.shape[a];t[a]=Ee.create(fe(r))}return new ge({...e._def,shape:()=>t})}return e instanceof me?new me({...e._def,type:fe(e.element)}):e instanceof Ee?Ee.create(fe(e.unwrap())):e instanceof Ie?Ie.create(fe(e.unwrap())):e instanceof xe?xe.create(e.items.map(e=>fe(e))):e}me.create=(e,t)=>new me({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ke.ZodArray,...N(t)});var ge=class t extends C{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const t=this._def.shape(),a=e.objectKeys(t);return this._cached={shape:t,keys:a},this._cached}_parse(e){if(this._getType(e)!==i.object){const t=this._getOrReturnCtx(e);return y(t,{code:d.invalid_type,expected:i.object,received:t.parsedType}),k}const{status:t,ctx:a}=this._processInputParams(e),{shape:r,keys:n}=this._getCached(),s=[];if(!(this._def.catchall instanceof pe&&"strip"===this._def.unknownKeys))for(const e in a.data)n.includes(e)||s.push(e);const o=[];for(const e of n){const t=r[e],n=a.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new S(a,n,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof pe){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)o.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)s.length>0&&(y(a,{code:d.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const r=a.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new S(a,r,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of o){const a=await t.key,r=await t.value;e.push({key:a,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>b.mergeObjectSync(t,e)):b.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return v.errToObj,new t({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{var r,n,s,i;const o=null!=(s=null==(n=(r=this._def).errorMap)?void 0:n.call(r,t,a).message)?s:a.defaultError;return"unrecognized_keys"===t.code?{message:null!=(i=v.errToObj(e).message)?i:o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ke.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new t({...this._def,catchall:e})}pick(a){const r={};for(const t of e.objectKeys(a))a[t]&&this.shape[t]&&(r[t]=this.shape[t]);return new t({...this._def,shape:()=>r})}omit(a){const r={};for(const t of e.objectKeys(this.shape))a[t]||(r[t]=this.shape[t]);return new t({...this._def,shape:()=>r})}deepPartial(){return fe(this)}partial(a){const r={};for(const t of e.objectKeys(this.shape)){const e=this.shape[t];a&&!a[t]?r[t]=e:r[t]=e.optional()}return new t({...this._def,shape:()=>r})}required(a){const r={};for(const t of e.objectKeys(this.shape))if(a&&!a[t])r[t]=this.shape[t];else{let e=this.shape[t];for(;e instanceof Ee;)e=e._def.innerType;r[t]=e}return new t({...this._def,shape:()=>r})}keyof(){return Pe(e.objectKeys(this.shape))}};ge.create=(e,t)=>new ge({shape:()=>e,unknownKeys:"strip",catchall:pe.create(),typeName:Ke.ZodObject,...N(t)}),ge.strictCreate=(e,t)=>new ge({shape:()=>e,unknownKeys:"strict",catchall:pe.create(),typeName:Ke.ZodObject,...N(t)}),ge.lazycreate=(e,t)=>new ge({shape:e,unknownKeys:"strip",catchall:pe.create(),typeName:Ke.ZodObject,...N(t)});var ye=class extends C{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map(async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map(e=>new u(e.ctx.common.issues));return y(t,{code:d.invalid_union,unionErrors:a}),k});{let e;const r=[];for(const n of a){const a={...t,common:{...t.common,issues:[]},parent:null},s=n._parseSync({data:t.data,path:t.path,parent:a});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:a}),a.common.issues.length&&r.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const n=r.map(e=>new u(e));return y(t,{code:d.invalid_union,unionErrors:n}),k}}get options(){return this._def.options}};ye.create=(e,t)=>new ye({options:e,typeName:Ke.ZodUnion,...N(t)});var ve=t=>t instanceof Oe?ve(t.schema):t instanceof $e?ve(t.innerType()):t instanceof Se?[t.value]:t instanceof Ne?t.options:t instanceof je?e.objectValues(t.enum):t instanceof Me?ve(t._def.innerType):t instanceof de?[void 0]:t instanceof ce?[null]:t instanceof Ee?[void 0,...ve(t.unwrap())]:t instanceof Ie?[null,...ve(t.unwrap())]:t instanceof Fe||t instanceof Ve?ve(t.unwrap()):t instanceof Re?ve(t._def.innerType):[],_e=class e extends C{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.object)return y(t,{code:d.invalid_type,expected:i.object,received:t.parsedType}),k;const a=this.discriminator,r=t.data[a],n=this.optionsMap.get(r);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(y(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),k)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,a,r){const n=new Map;for(const e of a){const a=ve(e.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const r of a){if(n.has(r))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);n.set(r,e)}}return new e({typeName:Ke.ZodDiscriminatedUnion,discriminator:t,options:a,optionsMap:n,...N(r)})}};function be(t,a){const r=o(t),n=o(a);if(t===a)return{valid:!0,data:t};if(r===i.object&&n===i.object){const r=e.objectKeys(a),n=e.objectKeys(t).filter(e=>-1!==r.indexOf(e)),s={...t,...a};for(const e of n){const r=be(t[e],a[e]);if(!r.valid)return{valid:!1};s[e]=r.data}return{valid:!0,data:s}}if(r===i.array&&n===i.array){if(t.length!==a.length)return{valid:!1};const e=[];for(let r=0;r<t.length;r++){const n=be(t[r],a[r]);if(!n.valid)return{valid:!1};e.push(n.data)}return{valid:!0,data:e}}return r===i.date&&n===i.date&&+t===+a?{valid:!0,data:t}:{valid:!1}}var ke=class extends C{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),r=(e,r)=>{if(Z(e)||Z(r))return k;const n=be(e.value,r.value);return n.valid?((A(e)||A(r))&&t.dirty(),{status:t.value,value:n.data}):(y(a,{code:d.invalid_intersection_types}),k)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};ke.create=(e,t,a)=>new ke({left:e,right:t,typeName:Ke.ZodIntersection,...N(a)});var xe=class e extends C{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==i.array)return y(a,{code:d.invalid_type,expected:i.array,received:a.parsedType}),k;if(a.data.length<this._def.items.length)return y(a,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),k;!this._def.rest&&a.data.length>this._def.items.length&&(y(a,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...a.data].map((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new S(a,e,a.path,t)):null}).filter(e=>!!e);return a.common.async?Promise.all(r).then(e=>b.mergeArray(t,e)):b.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};xe.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xe({items:e,typeName:Ke.ZodTuple,rest:null,...N(t)})};var we=class e extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==i.object)return y(a,{code:d.invalid_type,expected:i.object,received:a.parsedType}),k;const r=[],n=this._def.keyType,s=this._def.valueType;for(const e in a.data)r.push({key:n._parse(new S(a,e,a.path,e)),value:s._parse(new S(a,a.data[e],a.path,e)),alwaysSet:e in a.data});return a.common.async?b.mergeObjectAsync(t,r):b.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,a,r){return new e(a instanceof C?{keyType:t,valueType:a,typeName:Ke.ZodRecord,...N(r)}:{keyType:te.create(),valueType:t,typeName:Ke.ZodRecord,...N(a)})}},Ze=class extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==i.map)return y(a,{code:d.invalid_type,expected:i.map,received:a.parsedType}),k;const r=this._def.keyType,n=this._def.valueType,s=[...a.data.entries()].map(([e,t],s)=>({key:r._parse(new S(a,e,a.path,[s,"key"])),value:n._parse(new S(a,t,a.path,[s,"value"]))}));if(a.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const a of s){const r=await a.key,n=await a.value;if("aborted"===r.status||"aborted"===n.status)return k;"dirty"!==r.status&&"dirty"!==n.status||t.dirty(),e.set(r.value,n.value)}return{status:t.value,value:e}})}{const e=new Map;for(const a of s){const r=a.key,n=a.value;if("aborted"===r.status||"aborted"===n.status)return k;"dirty"!==r.status&&"dirty"!==n.status||t.dirty(),e.set(r.value,n.value)}return{status:t.value,value:e}}}};Ze.create=(e,t,a)=>new Ze({valueType:t,keyType:e,typeName:Ke.ZodMap,...N(a)});var Ae=class e extends C{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==i.set)return y(a,{code:d.invalid_type,expected:i.set,received:a.parsedType}),k;const r=this._def;null!==r.minSize&&a.data.size<r.minSize.value&&(y(a,{code:d.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&a.data.size>r.maxSize.value&&(y(a,{code:d.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const n=this._def.valueType;function s(e){const a=new Set;for(const r of e){if("aborted"===r.status)return k;"dirty"===r.status&&t.dirty(),a.add(r.value)}return{status:t.value,value:a}}const o=[...a.data.values()].map((e,t)=>n._parse(new S(a,e,a.path,t)));return a.common.async?Promise.all(o).then(e=>s(e)):s(o)}min(t,a){return new e({...this._def,minSize:{value:t,message:v.toString(a)}})}max(t,a){return new e({...this._def,maxSize:{value:t,message:v.toString(a)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Ae.create=(e,t)=>new Ae({valueType:e,minSize:null,maxSize:null,typeName:Ke.ZodSet,...N(t)});var Te=class e extends C{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.function)return y(t,{code:d.invalid_type,expected:i.function,received:t.parsedType}),k;function a(e,a){return f({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,m(),l].filter(e=>!!e),issueData:{code:d.invalid_arguments,argumentsError:a}})}function r(e,a){return f({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,m(),l].filter(e=>!!e),issueData:{code:d.invalid_return_type,returnTypeError:a}})}const n={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Ce){const e=this;return w(async function(...t){const i=new u([]),o=await e._def.args.parseAsync(t,n).catch(e=>{throw i.addIssue(a(t,e)),i}),