@surfai/docs-mcp
Version:
Model Context Protocol (MCP) server for Surfboard Payments documentation
3 lines • 112 kB
JavaScript
#!/usr/bin/env bun
// @bun
var D;(function(X){X.assertEqual=(Q)=>Q;function $(Q){}X.assertIs=$;function W(Q){throw new Error}X.assertNever=W,X.arrayToEnum=(Q)=>{let H={};for(let J of Q)H[J]=J;return H},X.getValidEnumValues=(Q)=>{let H=X.objectKeys(Q).filter((M)=>typeof Q[Q[M]]!=="number"),J={};for(let M of H)J[M]=Q[M];return X.objectValues(J)},X.objectValues=(Q)=>{return X.objectKeys(Q).map(function(H){return Q[H]})},X.objectKeys=typeof Object.keys==="function"?(Q)=>Object.keys(Q):(Q)=>{let H=[];for(let J in Q)if(Object.prototype.hasOwnProperty.call(Q,J))H.push(J);return H},X.find=(Q,H)=>{for(let J of Q)if(H(J))return J;return},X.isInteger=typeof Number.isInteger==="function"?(Q)=>Number.isInteger(Q):(Q)=>typeof Q==="number"&&isFinite(Q)&&Math.floor(Q)===Q;function G(Q,H=" | "){return Q.map((J)=>typeof J==="string"?`'${J}'`:J).join(H)}X.joinValues=G,X.jsonStringifyReplacer=(Q,H)=>{if(typeof H==="bigint")return H.toString();return H}})(D||(D={}));var G0;(function(X){X.mergeShapes=($,W)=>{return{...$,...W}}})(G0||(G0={}));var O=D.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),s=(X)=>{switch(typeof X){case"undefined":return O.undefined;case"string":return O.string;case"number":return isNaN(X)?O.nan:O.number;case"boolean":return O.boolean;case"function":return O.function;case"bigint":return O.bigint;case"symbol":return O.symbol;case"object":if(Array.isArray(X))return O.array;if(X===null)return O.null;if(X.then&&typeof X.then==="function"&&X.catch&&typeof X.catch==="function")return O.promise;if(typeof Map!=="undefined"&&X instanceof Map)return O.map;if(typeof Set!=="undefined"&&X instanceof Set)return O.set;if(typeof Date!=="undefined"&&X instanceof Date)return O.date;return O.object;default:return O.unknown}},w=D.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"]),D1=(X)=>{return JSON.stringify(X,null,2).replace(/"([^"]+)":/g,"$1:")};class g extends Error{get errors(){return this.issues}constructor(X){super();this.issues=[],this.addIssue=(W)=>{this.issues=[...this.issues,W]},this.addIssues=(W=[])=>{this.issues=[...this.issues,...W]};let $=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,$);else this.__proto__=$;this.name="ZodError",this.issues=X}format(X){let $=X||function(Q){return Q.message},W={_errors:[]},G=(Q)=>{for(let H of Q.issues)if(H.code==="invalid_union")H.unionErrors.map(G);else if(H.code==="invalid_return_type")G(H.returnTypeError);else if(H.code==="invalid_arguments")G(H.argumentsError);else if(H.path.length===0)W._errors.push($(H));else{let J=W,M=0;while(M<H.path.length){let B=H.path[M];if(M!==H.path.length-1)J[B]=J[B]||{_errors:[]};else J[B]=J[B]||{_errors:[]},J[B]._errors.push($(H));J=J[B],M++}}};return G(this),W}static assert(X){if(!(X instanceof g))throw new Error(`Not a ZodError: ${X}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,D.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(X=($)=>$.message){let $={},W=[];for(let G of this.issues)if(G.path.length>0)$[G.path[0]]=$[G.path[0]]||[],$[G.path[0]].push(X(G));else W.push(X(G));return{formErrors:W,fieldErrors:$}}get formErrors(){return this.flatten()}}g.create=(X)=>{return new g(X)};var LX=(X,$)=>{let W;switch(X.code){case w.invalid_type:if(X.received===O.undefined)W="Required";else W=`Expected ${X.expected}, received ${X.received}`;break;case w.invalid_literal:W=`Invalid literal value, expected ${JSON.stringify(X.expected,D.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:W=`Unrecognized key(s) in object: ${D.joinValues(X.keys,", ")}`;break;case w.invalid_union:W="Invalid input";break;case w.invalid_union_discriminator:W=`Invalid discriminator value. Expected ${D.joinValues(X.options)}`;break;case w.invalid_enum_value:W=`Invalid enum value. Expected ${D.joinValues(X.options)}, received '${X.received}'`;break;case w.invalid_arguments:W="Invalid function arguments";break;case w.invalid_return_type:W="Invalid function return type";break;case w.invalid_date:W="Invalid date";break;case w.invalid_string:if(typeof X.validation==="object")if("includes"in X.validation){if(W=`Invalid input: must include "${X.validation.includes}"`,typeof X.validation.position==="number")W=`${W} at one or more positions greater than or equal to ${X.validation.position}`}else if("startsWith"in X.validation)W=`Invalid input: must start with "${X.validation.startsWith}"`;else if("endsWith"in X.validation)W=`Invalid input: must end with "${X.validation.endsWith}"`;else D.assertNever(X.validation);else if(X.validation!=="regex")W=`Invalid ${X.validation}`;else W="Invalid";break;case w.too_small:if(X.type==="array")W=`Array must contain ${X.exact?"exactly":X.inclusive?"at least":"more than"} ${X.minimum} element(s)`;else if(X.type==="string")W=`String must contain ${X.exact?"exactly":X.inclusive?"at least":"over"} ${X.minimum} character(s)`;else if(X.type==="number")W=`Number must be ${X.exact?"exactly equal to ":X.inclusive?"greater than or equal to ":"greater than "}${X.minimum}`;else if(X.type==="date")W=`Date must be ${X.exact?"exactly equal to ":X.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(X.minimum))}`;else W="Invalid input";break;case w.too_big:if(X.type==="array")W=`Array must contain ${X.exact?"exactly":X.inclusive?"at most":"less than"} ${X.maximum} element(s)`;else if(X.type==="string")W=`String must contain ${X.exact?"exactly":X.inclusive?"at most":"under"} ${X.maximum} character(s)`;else if(X.type==="number")W=`Number must be ${X.exact?"exactly":X.inclusive?"less than or equal to":"less than"} ${X.maximum}`;else if(X.type==="bigint")W=`BigInt must be ${X.exact?"exactly":X.inclusive?"less than or equal to":"less than"} ${X.maximum}`;else if(X.type==="date")W=`Date must be ${X.exact?"exactly":X.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(X.maximum))}`;else W="Invalid input";break;case w.custom:W="Invalid input";break;case w.invalid_intersection_types:W="Intersection results could not be merged";break;case w.not_multiple_of:W=`Number must be a multiple of ${X.multipleOf}`;break;case w.not_finite:W="Number must be finite";break;default:W=$.defaultError,D.assertNever(X)}return{message:W}},T0=LX;function K1(X){T0=X}function yX(){return T0}var lX=(X)=>{let{data:$,path:W,errorMaps:G,issueData:Q}=X,H=[...W,...Q.path||[]],J={...Q,path:H};if(Q.message!==void 0)return{...Q,path:H,message:Q.message};let M="",B=G.filter((V)=>!!V).slice().reverse();for(let V of B)M=V(J,{data:$,defaultError:M}).message;return{...Q,path:H,message:M}},N1=[];function z(X,$){let W=yX(),G=lX({issueData:$,data:X.data,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,W,W===LX?void 0:LX].filter((Q)=>!!Q)});X.common.issues.push(G)}class b{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(X,$){let W=[];for(let G of $){if(G.status==="aborted")return L;if(G.status==="dirty")X.dirty();W.push(G.value)}return{status:X.value,value:W}}static async mergeObjectAsync(X,$){let W=[];for(let G of $){let Q=await G.key,H=await G.value;W.push({key:Q,value:H})}return b.mergeObjectSync(X,W)}static mergeObjectSync(X,$){let W={};for(let G of $){let{key:Q,value:H}=G;if(Q.status==="aborted")return L;if(H.status==="aborted")return L;if(Q.status==="dirty")X.dirty();if(H.status==="dirty")X.dirty();if(Q.value!=="__proto__"&&(typeof H.value!=="undefined"||G.alwaysSet))W[Q.value]=H.value}return{status:X.value,value:W}}}var L=Object.freeze({status:"aborted"}),AX=(X)=>({status:"dirty",value:X}),v=(X)=>({status:"valid",value:X}),Q0=(X)=>X.status==="aborted",H0=(X)=>X.status==="dirty",JX=(X)=>X.status==="valid",IX=(X)=>typeof Promise!=="undefined"&&X instanceof Promise;function mX(X,$,W,G){if(W==="a"&&!G)throw new TypeError("Private accessor was defined without a getter");if(typeof $==="function"?X!==$||!G:!$.has(X))throw new TypeError("Cannot read private member from an object whose class did not declare it");return W==="m"?G:W==="a"?G.call(X):G?G.value:$.get(X)}function x0(X,$,W,G,Q){if(G==="m")throw new TypeError("Private method is not writable");if(G==="a"&&!Q)throw new TypeError("Private accessor was defined without a setter");if(typeof $==="function"?X!==$||!Q:!$.has(X))throw new TypeError("Cannot write private member to an object whose class did not declare it");return G==="a"?Q.call(X,W):Q?Q.value=W:$.set(X,W),W}var A;(function(X){X.errToObj=($)=>typeof $==="string"?{message:$}:$||{},X.toString=($)=>typeof $==="string"?$:$===null||$===void 0?void 0:$.message})(A||(A={}));var fX,CX;class c{constructor(X,$,W,G){this._cachedPath=[],this.parent=X,this.data=$,this._path=W,this._key=G}get path(){if(!this._cachedPath.length)if(this._key instanceof Array)this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var k0=(X,$)=>{if(JX($))return{success:!0,data:$.value};else{if(!X.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let W=new g(X.common.issues);return this._error=W,this._error}}}};function F(X){if(!X)return{};let{errorMap:$,invalid_type_error:W,required_error:G,description:Q}=X;if($&&(W||G))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if($)return{errorMap:$,description:Q};return{errorMap:(J,M)=>{var B,V;let{message:U}=X;if(J.code==="invalid_enum_value")return{message:U!==null&&U!==void 0?U:M.defaultError};if(typeof M.data==="undefined")return{message:(B=U!==null&&U!==void 0?U:G)!==null&&B!==void 0?B:M.defaultError};if(J.code!=="invalid_type")return{message:M.defaultError};return{message:(V=U!==null&&U!==void 0?U:W)!==null&&V!==void 0?V:M.defaultError}},description:Q}}class R{get description(){return this._def.description}_getType(X){return s(X.data)}_getOrReturnCtx(X,$){return $||{common:X.parent.common,data:X.data,parsedType:s(X.data),schemaErrorMap:this._def.errorMap,path:X.path,parent:X.parent}}_processInputParams(X){return{status:new b,ctx:{common:X.parent.common,data:X.data,parsedType:s(X.data),schemaErrorMap:this._def.errorMap,path:X.path,parent:X.parent}}}_parseSync(X){let $=this._parse(X);if(IX($))throw new Error("Synchronous parse encountered promise.");return $}_parseAsync(X){let $=this._parse(X);return Promise.resolve($)}parse(X,$){let W=this.safeParse(X,$);if(W.success)return W.data;throw W.error}safeParse(X,$){var W;let G={common:{issues:[],async:(W=$===null||$===void 0?void 0:$.async)!==null&&W!==void 0?W:!1,contextualErrorMap:$===null||$===void 0?void 0:$.errorMap},path:($===null||$===void 0?void 0:$.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:X,parsedType:s(X)},Q=this._parseSync({data:X,path:G.path,parent:G});return k0(G,Q)}"~validate"(X){var $,W;let G={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:X,parsedType:s(X)};if(!this["~standard"].async)try{let Q=this._parseSync({data:X,path:[],parent:G});return JX(Q)?{value:Q.value}:{issues:G.common.issues}}catch(Q){if((W=($=Q===null||Q===void 0?void 0:Q.message)===null||$===void 0?void 0:$.toLowerCase())===null||W===void 0?void 0:W.includes("encountered"))this["~standard"].async=!0;G.common={issues:[],async:!0}}return this._parseAsync({data:X,path:[],parent:G}).then((Q)=>JX(Q)?{value:Q.value}:{issues:G.common.issues})}async parseAsync(X,$){let W=await this.safeParseAsync(X,$);if(W.success)return W.data;throw W.error}async safeParseAsync(X,$){let W={common:{issues:[],contextualErrorMap:$===null||$===void 0?void 0:$.errorMap,async:!0},path:($===null||$===void 0?void 0:$.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:X,parsedType:s(X)},G=this._parse({data:X,path:W.path,parent:W}),Q=await(IX(G)?G:Promise.resolve(G));return k0(W,Q)}refine(X,$){let W=(G)=>{if(typeof $==="string"||typeof $==="undefined")return{message:$};else if(typeof $==="function")return $(G);else return $};return this._refinement((G,Q)=>{let H=X(G),J=()=>Q.addIssue({code:w.custom,...W(G)});if(typeof Promise!=="undefined"&&H instanceof Promise)return H.then((M)=>{if(!M)return J(),!1;else return!0});if(!H)return J(),!1;else return!0})}refinement(X,$){return this._refinement((W,G)=>{if(!X(W))return G.addIssue(typeof $==="function"?$(W,G):$),!1;else return!0})}_refinement(X){return new h({schema:this,typeName:q.ZodEffects,effect:{type:"refinement",refinement:X}})}superRefine(X){return this._refinement(X)}constructor(X){this.spa=this.safeParseAsync,this._def=X,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:($)=>this["~validate"]($)}}optional(){return m.create(this,this._def)}nullable(){return t.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return l.create(this)}promise(){return VX.create(this,this._def)}or(X){return RX.create([this,X],this._def)}and(X){return DX.create(this,X,this._def)}transform(X){return new h({...F(this._def),schema:this,typeName:q.ZodEffects,effect:{type:"transform",transform:X}})}default(X){let $=typeof X==="function"?X:()=>X;return new _X({...F(this._def),innerType:this,defaultValue:$,typeName:q.ZodDefault})}brand(){return new uX({typeName:q.ZodBranded,type:this,...F(this._def)})}catch(X){let $=typeof X==="function"?X:()=>X;return new EX({...F(this._def),innerType:this,catchValue:$,typeName:q.ZodCatch})}describe(X){return new this.constructor({...this._def,description:X})}pipe(X){return hX.create(this,X)}readonly(){return bX.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var S1=/^c[^\s-]{8,}$/i,_1=/^[0-9a-z]+$/,E1=/^[0-9A-HJKMNP-TV-Z]{26}$/i,b1=/^[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,v1=/^[a-z0-9_-]{21}$/i,f1=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,C1=/^[-+]?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)?)??$/,I1=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,k1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",W0,P1=/^(?:(?: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])$/,g1=/^(?:(?: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])$/,T1=/^(([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]))$/,x1=/^(([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])$/,h1=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Z1=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,h0="((\\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])))",y1=new RegExp(`^${h0}$`);function Z0(X){let $="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if(X.precision)$=`${$}\\.\\d{${X.precision}}`;else if(X.precision==null)$=`${$}(\\.\\d+)?`;return $}function l1(X){return new RegExp(`^${Z0(X)}$`)}function y0(X){let $=`${h0}T${Z0(X)}`,W=[];if(W.push(X.local?"Z?":"Z"),X.offset)W.push("([+-]\\d{2}:?\\d{2})");return $=`${$}(${W.join("|")})`,new RegExp(`^${$}$`)}function m1(X,$){if(($==="v4"||!$)&&P1.test(X))return!0;if(($==="v6"||!$)&&T1.test(X))return!0;return!1}function c1(X,$){if(!f1.test(X))return!1;try{let[W]=X.split("."),G=W.replace(/-/g,"+").replace(/_/g,"/").padEnd(W.length+(4-W.length%4)%4,"="),Q=JSON.parse(atob(G));if(typeof Q!=="object"||Q===null)return!1;if(!Q.typ||!Q.alg)return!1;if($&&Q.alg!==$)return!1;return!0}catch(W){return!1}}function u1(X,$){if(($==="v4"||!$)&&g1.test(X))return!0;if(($==="v6"||!$)&&x1.test(X))return!0;return!1}class y extends R{_parse(X){if(this._def.coerce)X.data=String(X.data);if(this._getType(X)!==O.string){let Q=this._getOrReturnCtx(X);return z(Q,{code:w.invalid_type,expected:O.string,received:Q.parsedType}),L}let W=new b,G=void 0;for(let Q of this._def.checks)if(Q.kind==="min"){if(X.data.length<Q.value)G=this._getOrReturnCtx(X,G),z(G,{code:w.too_small,minimum:Q.value,type:"string",inclusive:!0,exact:!1,message:Q.message}),W.dirty()}else if(Q.kind==="max"){if(X.data.length>Q.value)G=this._getOrReturnCtx(X,G),z(G,{code:w.too_big,maximum:Q.value,type:"string",inclusive:!0,exact:!1,message:Q.message}),W.dirty()}else if(Q.kind==="length"){let H=X.data.length>Q.value,J=X.data.length<Q.value;if(H||J){if(G=this._getOrReturnCtx(X,G),H)z(G,{code:w.too_big,maximum:Q.value,type:"string",inclusive:!0,exact:!0,message:Q.message});else if(J)z(G,{code:w.too_small,minimum:Q.value,type:"string",inclusive:!0,exact:!0,message:Q.message});W.dirty()}}else if(Q.kind==="email"){if(!I1.test(X.data))G=this._getOrReturnCtx(X,G),z(G,{validation:"email",code:w.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="emoji"){if(!W0)W0=new RegExp(k1,"u");if(!W0.test(X.data))G=this._getOrReturnCtx(X,G),z(G,{validation:"emoji",code:w.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="uuid"){if(!b1.test(X.data))G=this._getOrReturnCtx(X,G),z(G,{validation:"uuid",code:w.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="nanoid"){if(!v1.test(X.data))G=this._getOrReturnCtx(X,G),z(G,{validation:"nanoid",code:w.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="cuid"){if(!S1.test(X.data))G=this._getOrReturnCtx(X,G),z(G,{validation:"cuid",code:w.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="cuid2"){if(!_1.test(X.data))G=this._getOrReturnCtx(X,G),z(G,{validation:"cuid2",code:w.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="ulid"){if(!E1.test(X.data))G=this._getOrReturnCtx(X,G),z(G,{validation:"ulid",code:w.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="url")try{new URL(X.data)}catch(H){G=this._getOrReturnCtx(X,G),z(G,{validation:"url",code:w.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="regex"){if(Q.regex.lastIndex=0,!Q.regex.test(X.data))G=this._getOrReturnCtx(X,G),z(G,{validation:"regex",code:w.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="trim")X.data=X.data.trim();else if(Q.kind==="includes"){if(!X.data.includes(Q.value,Q.position))G=this._getOrReturnCtx(X,G),z(G,{code:w.invalid_string,validation:{includes:Q.value,position:Q.position},message:Q.message}),W.dirty()}else if(Q.kind==="toLowerCase")X.data=X.data.toLowerCase();else if(Q.kind==="toUpperCase")X.data=X.data.toUpperCase();else if(Q.kind==="startsWith"){if(!X.data.startsWith(Q.value))G=this._getOrReturnCtx(X,G),z(G,{code:w.invalid_string,validation:{startsWith:Q.value},message:Q.message}),W.dirty()}else if(Q.kind==="endsWith"){if(!X.data.endsWith(Q.value))G=this._getOrReturnCtx(X,G),z(G,{code:w.invalid_string,validation:{endsWith:Q.value},message:Q.message}),W.dirty()}else if(Q.kind==="datetime"){if(!y0(Q).test(X.data))G=this._getOrReturnCtx(X,G),z(G,{code:w.invalid_string,validation:"datetime",message:Q.message}),W.dirty()}else if(Q.kind==="date"){if(!y1.test(X.data))G=this._getOrReturnCtx(X,G),z(G,{code:w.invalid_string,validation:"date",message:Q.message}),W.dirty()}else if(Q.kind==="time"){if(!l1(Q).test(X.data))G=this._getOrReturnCtx(X,G),z(G,{code:w.invalid_string,validation:"time",message:Q.message}),W.dirty()}else if(Q.kind==="duration"){if(!C1.test(X.data))G=this._getOrReturnCtx(X,G),z(G,{validation:"duration",code:w.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="ip"){if(!m1(X.data,Q.version))G=this._getOrReturnCtx(X,G),z(G,{validation:"ip",code:w.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="jwt"){if(!c1(X.data,Q.alg))G=this._getOrReturnCtx(X,G),z(G,{validation:"jwt",code:w.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="cidr"){if(!u1(X.data,Q.version))G=this._getOrReturnCtx(X,G),z(G,{validation:"cidr",code:w.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="base64"){if(!h1.test(X.data))G=this._getOrReturnCtx(X,G),z(G,{validation:"base64",code:w.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="base64url"){if(!Z1.test(X.data))G=this._getOrReturnCtx(X,G),z(G,{validation:"base64url",code:w.invalid_string,message:Q.message}),W.dirty()}else D.assertNever(Q);return{status:W.value,value:X.data}}_regex(X,$,W){return this.refinement((G)=>X.test(G),{validation:$,code:w.invalid_string,...A.errToObj(W)})}_addCheck(X){return new y({...this._def,checks:[...this._def.checks,X]})}email(X){return this._addCheck({kind:"email",...A.errToObj(X)})}url(X){return this._addCheck({kind:"url",...A.errToObj(X)})}emoji(X){return this._addCheck({kind:"emoji",...A.errToObj(X)})}uuid(X){return this._addCheck({kind:"uuid",...A.errToObj(X)})}nanoid(X){return this._addCheck({kind:"nanoid",...A.errToObj(X)})}cuid(X){return this._addCheck({kind:"cuid",...A.errToObj(X)})}cuid2(X){return this._addCheck({kind:"cuid2",...A.errToObj(X)})}ulid(X){return this._addCheck({kind:"ulid",...A.errToObj(X)})}base64(X){return this._addCheck({kind:"base64",...A.errToObj(X)})}base64url(X){return this._addCheck({kind:"base64url",...A.errToObj(X)})}jwt(X){return this._addCheck({kind:"jwt",...A.errToObj(X)})}ip(X){return this._addCheck({kind:"ip",...A.errToObj(X)})}cidr(X){return this._addCheck({kind:"cidr",...A.errToObj(X)})}datetime(X){var $,W;if(typeof X==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:X});return this._addCheck({kind:"datetime",precision:typeof(X===null||X===void 0?void 0:X.precision)==="undefined"?null:X===null||X===void 0?void 0:X.precision,offset:($=X===null||X===void 0?void 0:X.offset)!==null&&$!==void 0?$:!1,local:(W=X===null||X===void 0?void 0:X.local)!==null&&W!==void 0?W:!1,...A.errToObj(X===null||X===void 0?void 0:X.message)})}date(X){return this._addCheck({kind:"date",message:X})}time(X){if(typeof X==="string")return this._addCheck({kind:"time",precision:null,message:X});return this._addCheck({kind:"time",precision:typeof(X===null||X===void 0?void 0:X.precision)==="undefined"?null:X===null||X===void 0?void 0:X.precision,...A.errToObj(X===null||X===void 0?void 0:X.message)})}duration(X){return this._addCheck({kind:"duration",...A.errToObj(X)})}regex(X,$){return this._addCheck({kind:"regex",regex:X,...A.errToObj($)})}includes(X,$){return this._addCheck({kind:"includes",value:X,position:$===null||$===void 0?void 0:$.position,...A.errToObj($===null||$===void 0?void 0:$.message)})}startsWith(X,$){return this._addCheck({kind:"startsWith",value:X,...A.errToObj($)})}endsWith(X,$){return this._addCheck({kind:"endsWith",value:X,...A.errToObj($)})}min(X,$){return this._addCheck({kind:"min",value:X,...A.errToObj($)})}max(X,$){return this._addCheck({kind:"max",value:X,...A.errToObj($)})}length(X,$){return this._addCheck({kind:"length",value:X,...A.errToObj($)})}nonempty(X){return this.min(1,A.errToObj(X))}trim(){return new y({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new y({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new y({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((X)=>X.kind==="datetime")}get isDate(){return!!this._def.checks.find((X)=>X.kind==="date")}get isTime(){return!!this._def.checks.find((X)=>X.kind==="time")}get isDuration(){return!!this._def.checks.find((X)=>X.kind==="duration")}get isEmail(){return!!this._def.checks.find((X)=>X.kind==="email")}get isURL(){return!!this._def.checks.find((X)=>X.kind==="url")}get isEmoji(){return!!this._def.checks.find((X)=>X.kind==="emoji")}get isUUID(){return!!this._def.checks.find((X)=>X.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((X)=>X.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((X)=>X.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((X)=>X.kind==="cuid2")}get isULID(){return!!this._def.checks.find((X)=>X.kind==="ulid")}get isIP(){return!!this._def.checks.find((X)=>X.kind==="ip")}get isCIDR(){return!!this._def.checks.find((X)=>X.kind==="cidr")}get isBase64(){return!!this._def.checks.find((X)=>X.kind==="base64")}get isBase64url(){return!!this._def.checks.find((X)=>X.kind==="base64url")}get minLength(){let X=null;for(let $ of this._def.checks)if($.kind==="min"){if(X===null||$.value>X)X=$.value}return X}get maxLength(){let X=null;for(let $ of this._def.checks)if($.kind==="max"){if(X===null||$.value<X)X=$.value}return X}}y.create=(X)=>{var $;return new y({checks:[],typeName:q.ZodString,coerce:($=X===null||X===void 0?void 0:X.coerce)!==null&&$!==void 0?$:!1,...F(X)})};function p1(X,$){let W=(X.toString().split(".")[1]||"").length,G=($.toString().split(".")[1]||"").length,Q=W>G?W:G,H=parseInt(X.toFixed(Q).replace(".","")),J=parseInt($.toFixed(Q).replace(".",""));return H%J/Math.pow(10,Q)}class QX extends R{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(X){if(this._def.coerce)X.data=Number(X.data);if(this._getType(X)!==O.number){let Q=this._getOrReturnCtx(X);return z(Q,{code:w.invalid_type,expected:O.number,received:Q.parsedType}),L}let W=void 0,G=new b;for(let Q of this._def.checks)if(Q.kind==="int"){if(!D.isInteger(X.data))W=this._getOrReturnCtx(X,W),z(W,{code:w.invalid_type,expected:"integer",received:"float",message:Q.message}),G.dirty()}else if(Q.kind==="min"){if(Q.inclusive?X.data<Q.value:X.data<=Q.value)W=this._getOrReturnCtx(X,W),z(W,{code:w.too_small,minimum:Q.value,type:"number",inclusive:Q.inclusive,exact:!1,message:Q.message}),G.dirty()}else if(Q.kind==="max"){if(Q.inclusive?X.data>Q.value:X.data>=Q.value)W=this._getOrReturnCtx(X,W),z(W,{code:w.too_big,maximum:Q.value,type:"number",inclusive:Q.inclusive,exact:!1,message:Q.message}),G.dirty()}else if(Q.kind==="multipleOf"){if(p1(X.data,Q.value)!==0)W=this._getOrReturnCtx(X,W),z(W,{code:w.not_multiple_of,multipleOf:Q.value,message:Q.message}),G.dirty()}else if(Q.kind==="finite"){if(!Number.isFinite(X.data))W=this._getOrReturnCtx(X,W),z(W,{code:w.not_finite,message:Q.message}),G.dirty()}else D.assertNever(Q);return{status:G.value,value:X.data}}gte(X,$){return this.setLimit("min",X,!0,A.toString($))}gt(X,$){return this.setLimit("min",X,!1,A.toString($))}lte(X,$){return this.setLimit("max",X,!0,A.toString($))}lt(X,$){return this.setLimit("max",X,!1,A.toString($))}setLimit(X,$,W,G){return new QX({...this._def,checks:[...this._def.checks,{kind:X,value:$,inclusive:W,message:A.toString(G)}]})}_addCheck(X){return new QX({...this._def,checks:[...this._def.checks,X]})}int(X){return this._addCheck({kind:"int",message:A.toString(X)})}positive(X){return this._addCheck({kind:"min",value:0,inclusive:!1,message:A.toString(X)})}negative(X){return this._addCheck({kind:"max",value:0,inclusive:!1,message:A.toString(X)})}nonpositive(X){return this._addCheck({kind:"max",value:0,inclusive:!0,message:A.toString(X)})}nonnegative(X){return this._addCheck({kind:"min",value:0,inclusive:!0,message:A.toString(X)})}multipleOf(X,$){return this._addCheck({kind:"multipleOf",value:X,message:A.toString($)})}finite(X){return this._addCheck({kind:"finite",message:A.toString(X)})}safe(X){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:A.toString(X)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:A.toString(X)})}get minValue(){let X=null;for(let $ of this._def.checks)if($.kind==="min"){if(X===null||$.value>X)X=$.value}return X}get maxValue(){let X=null;for(let $ of this._def.checks)if($.kind==="max"){if(X===null||$.value<X)X=$.value}return X}get isInt(){return!!this._def.checks.find((X)=>X.kind==="int"||X.kind==="multipleOf"&&D.isInteger(X.value))}get isFinite(){let X=null,$=null;for(let W of this._def.checks)if(W.kind==="finite"||W.kind==="int"||W.kind==="multipleOf")return!0;else if(W.kind==="min"){if($===null||W.value>$)$=W.value}else if(W.kind==="max"){if(X===null||W.value<X)X=W.value}return Number.isFinite($)&&Number.isFinite(X)}}QX.create=(X)=>{return new QX({checks:[],typeName:q.ZodNumber,coerce:(X===null||X===void 0?void 0:X.coerce)||!1,...F(X)})};class HX extends R{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(X){if(this._def.coerce)try{X.data=BigInt(X.data)}catch(Q){return this._getInvalidInput(X)}if(this._getType(X)!==O.bigint)return this._getInvalidInput(X);let W=void 0,G=new b;for(let Q of this._def.checks)if(Q.kind==="min"){if(Q.inclusive?X.data<Q.value:X.data<=Q.value)W=this._getOrReturnCtx(X,W),z(W,{code:w.too_small,type:"bigint",minimum:Q.value,inclusive:Q.inclusive,message:Q.message}),G.dirty()}else if(Q.kind==="max"){if(Q.inclusive?X.data>Q.value:X.data>=Q.value)W=this._getOrReturnCtx(X,W),z(W,{code:w.too_big,type:"bigint",maximum:Q.value,inclusive:Q.inclusive,message:Q.message}),G.dirty()}else if(Q.kind==="multipleOf"){if(X.data%Q.value!==BigInt(0))W=this._getOrReturnCtx(X,W),z(W,{code:w.not_multiple_of,multipleOf:Q.value,message:Q.message}),G.dirty()}else D.assertNever(Q);return{status:G.value,value:X.data}}_getInvalidInput(X){let $=this._getOrReturnCtx(X);return z($,{code:w.invalid_type,expected:O.bigint,received:$.parsedType}),L}gte(X,$){return this.setLimit("min",X,!0,A.toString($))}gt(X,$){return this.setLimit("min",X,!1,A.toString($))}lte(X,$){return this.setLimit("max",X,!0,A.toString($))}lt(X,$){return this.setLimit("max",X,!1,A.toString($))}setLimit(X,$,W,G){return new HX({...this._def,checks:[...this._def.checks,{kind:X,value:$,inclusive:W,message:A.toString(G)}]})}_addCheck(X){return new HX({...this._def,checks:[...this._def.checks,X]})}positive(X){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:A.toString(X)})}negative(X){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:A.toString(X)})}nonpositive(X){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:A.toString(X)})}nonnegative(X){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:A.toString(X)})}multipleOf(X,$){return this._addCheck({kind:"multipleOf",value:X,message:A.toString($)})}get minValue(){let X=null;for(let $ of this._def.checks)if($.kind==="min"){if(X===null||$.value>X)X=$.value}return X}get maxValue(){let X=null;for(let $ of this._def.checks)if($.kind==="max"){if(X===null||$.value<X)X=$.value}return X}}HX.create=(X)=>{var $;return new HX({checks:[],typeName:q.ZodBigInt,coerce:($=X===null||X===void 0?void 0:X.coerce)!==null&&$!==void 0?$:!1,...F(X)})};class UX extends R{_parse(X){if(this._def.coerce)X.data=Boolean(X.data);if(this._getType(X)!==O.boolean){let W=this._getOrReturnCtx(X);return z(W,{code:w.invalid_type,expected:O.boolean,received:W.parsedType}),L}return v(X.data)}}UX.create=(X)=>{return new UX({typeName:q.ZodBoolean,coerce:(X===null||X===void 0?void 0:X.coerce)||!1,...F(X)})};class BX extends R{_parse(X){if(this._def.coerce)X.data=new Date(X.data);if(this._getType(X)!==O.date){let Q=this._getOrReturnCtx(X);return z(Q,{code:w.invalid_type,expected:O.date,received:Q.parsedType}),L}if(isNaN(X.data.getTime())){let Q=this._getOrReturnCtx(X);return z(Q,{code:w.invalid_date}),L}let W=new b,G=void 0;for(let Q of this._def.checks)if(Q.kind==="min"){if(X.data.getTime()<Q.value)G=this._getOrReturnCtx(X,G),z(G,{code:w.too_small,message:Q.message,inclusive:!0,exact:!1,minimum:Q.value,type:"date"}),W.dirty()}else if(Q.kind==="max"){if(X.data.getTime()>Q.value)G=this._getOrReturnCtx(X,G),z(G,{code:w.too_big,message:Q.message,inclusive:!0,exact:!1,maximum:Q.value,type:"date"}),W.dirty()}else D.assertNever(Q);return{status:W.value,value:new Date(X.data.getTime())}}_addCheck(X){return new BX({...this._def,checks:[...this._def.checks,X]})}min(X,$){return this._addCheck({kind:"min",value:X.getTime(),message:A.toString($)})}max(X,$){return this._addCheck({kind:"max",value:X.getTime(),message:A.toString($)})}get minDate(){let X=null;for(let $ of this._def.checks)if($.kind==="min"){if(X===null||$.value>X)X=$.value}return X!=null?new Date(X):null}get maxDate(){let X=null;for(let $ of this._def.checks)if($.kind==="max"){if(X===null||$.value<X)X=$.value}return X!=null?new Date(X):null}}BX.create=(X)=>{return new BX({checks:[],coerce:(X===null||X===void 0?void 0:X.coerce)||!1,typeName:q.ZodDate,...F(X)})};class kX extends R{_parse(X){if(this._getType(X)!==O.symbol){let W=this._getOrReturnCtx(X);return z(W,{code:w.invalid_type,expected:O.symbol,received:W.parsedType}),L}return v(X.data)}}kX.create=(X)=>{return new kX({typeName:q.ZodSymbol,...F(X)})};class jX extends R{_parse(X){if(this._getType(X)!==O.undefined){let W=this._getOrReturnCtx(X);return z(W,{code:w.invalid_type,expected:O.undefined,received:W.parsedType}),L}return v(X.data)}}jX.create=(X)=>{return new jX({typeName:q.ZodUndefined,...F(X)})};class FX extends R{_parse(X){if(this._getType(X)!==O.null){let W=this._getOrReturnCtx(X);return z(W,{code:w.invalid_type,expected:O.null,received:W.parsedType}),L}return v(X.data)}}FX.create=(X)=>{return new FX({typeName:q.ZodNull,...F(X)})};class MX extends R{constructor(){super(...arguments);this._any=!0}_parse(X){return v(X.data)}}MX.create=(X)=>{return new MX({typeName:q.ZodAny,...F(X)})};class GX extends R{constructor(){super(...arguments);this._unknown=!0}_parse(X){return v(X.data)}}GX.create=(X)=>{return new GX({typeName:q.ZodUnknown,...F(X)})};class n extends R{_parse(X){let $=this._getOrReturnCtx(X);return z($,{code:w.invalid_type,expected:O.never,received:$.parsedType}),L}}n.create=(X)=>{return new n({typeName:q.ZodNever,...F(X)})};class PX extends R{_parse(X){if(this._getType(X)!==O.undefined){let W=this._getOrReturnCtx(X);return z(W,{code:w.invalid_type,expected:O.void,received:W.parsedType}),L}return v(X.data)}}PX.create=(X)=>{return new PX({typeName:q.ZodVoid,...F(X)})};class l extends R{_parse(X){let{ctx:$,status:W}=this._processInputParams(X),G=this._def;if($.parsedType!==O.array)return z($,{code:w.invalid_type,expected:O.array,received:$.parsedType}),L;if(G.exactLength!==null){let H=$.data.length>G.exactLength.value,J=$.data.length<G.exactLength.value;if(H||J)z($,{code:H?w.too_big:w.too_small,minimum:J?G.exactLength.value:void 0,maximum:H?G.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:G.exactLength.message}),W.dirty()}if(G.minLength!==null){if($.data.length<G.minLength.value)z($,{code:w.too_small,minimum:G.minLength.value,type:"array",inclusive:!0,exact:!1,message:G.minLength.message}),W.dirty()}if(G.maxLength!==null){if($.data.length>G.maxLength.value)z($,{code:w.too_big,maximum:G.maxLength.value,type:"array",inclusive:!0,exact:!1,message:G.maxLength.message}),W.dirty()}if($.common.async)return Promise.all([...$.data].map((H,J)=>{return G.type._parseAsync(new c($,H,$.path,J))})).then((H)=>{return b.mergeArray(W,H)});let Q=[...$.data].map((H,J)=>{return G.type._parseSync(new c($,H,$.path,J))});return b.mergeArray(W,Q)}get element(){return this._def.type}min(X,$){return new l({...this._def,minLength:{value:X,message:A.toString($)}})}max(X,$){return new l({...this._def,maxLength:{value:X,message:A.toString($)}})}length(X,$){return new l({...this._def,exactLength:{value:X,message:A.toString($)}})}nonempty(X){return this.min(1,X)}}l.create=(X,$)=>{return new l({type:X,minLength:null,maxLength:null,exactLength:null,typeName:q.ZodArray,...F($)})};function OX(X){if(X instanceof S){let $={};for(let W in X.shape){let G=X.shape[W];$[W]=m.create(OX(G))}return new S({...X._def,shape:()=>$})}else if(X instanceof l)return new l({...X._def,type:OX(X.element)});else if(X instanceof m)return m.create(OX(X.unwrap()));else if(X instanceof t)return t.create(OX(X.unwrap()));else if(X instanceof d)return d.create(X.items.map(($)=>OX($)));else return X}class S extends R{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let X=this._def.shape(),$=D.objectKeys(X);return this._cached={shape:X,keys:$}}_parse(X){if(this._getType(X)!==O.object){let B=this._getOrReturnCtx(X);return z(B,{code:w.invalid_type,expected:O.object,received:B.parsedType}),L}let{status:W,ctx:G}=this._processInputParams(X),{shape:Q,keys:H}=this._getCached(),J=[];if(!(this._def.catchall instanceof n&&this._def.unknownKeys==="strip")){for(let B in G.data)if(!H.includes(B))J.push(B)}let M=[];for(let B of H){let V=Q[B],U=G.data[B];M.push({key:{status:"valid",value:B},value:V._parse(new c(G,U,G.path,B)),alwaysSet:B in G.data})}if(this._def.catchall instanceof n){let B=this._def.unknownKeys;if(B==="passthrough")for(let V of J)M.push({key:{status:"valid",value:V},value:{status:"valid",value:G.data[V]}});else if(B==="strict"){if(J.length>0)z(G,{code:w.unrecognized_keys,keys:J}),W.dirty()}else if(B==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let B=this._def.catchall;for(let V of J){let U=G.data[V];M.push({key:{status:"valid",value:V},value:B._parse(new c(G,U,G.path,V)),alwaysSet:V in G.data})}}if(G.common.async)return Promise.resolve().then(async()=>{let B=[];for(let V of M){let U=await V.key,_=await V.value;B.push({key:U,value:_,alwaysSet:V.alwaysSet})}return B}).then((B)=>{return b.mergeObjectSync(W,B)});else return b.mergeObjectSync(W,M)}get shape(){return this._def.shape()}strict(X){return A.errToObj,new S({...this._def,unknownKeys:"strict",...X!==void 0?{errorMap:($,W)=>{var G,Q,H,J;let M=(H=(Q=(G=this._def).errorMap)===null||Q===void 0?void 0:Q.call(G,$,W).message)!==null&&H!==void 0?H:W.defaultError;if($.code==="unrecognized_keys")return{message:(J=A.errToObj(X).message)!==null&&J!==void 0?J:M};return{message:M}}}:{}})}strip(){return new S({...this._def,unknownKeys:"strip"})}passthrough(){return new S({...this._def,unknownKeys:"passthrough"})}extend(X){return new S({...this._def,shape:()=>({...this._def.shape(),...X})})}merge(X){return new S({unknownKeys:X._def.unknownKeys,catchall:X._def.catchall,shape:()=>({...this._def.shape(),...X._def.shape()}),typeName:q.ZodObject})}setKey(X,$){return this.augment({[X]:$})}catchall(X){return new S({...this._def,catchall:X})}pick(X){let $={};return D.objectKeys(X).forEach((W)=>{if(X[W]&&this.shape[W])$[W]=this.shape[W]}),new S({...this._def,shape:()=>$})}omit(X){let $={};return D.objectKeys(this.shape).forEach((W)=>{if(!X[W])$[W]=this.shape[W]}),new S({...this._def,shape:()=>$})}deepPartial(){return OX(this)}partial(X){let $={};return D.objectKeys(this.shape).forEach((W)=>{let G=this.shape[W];if(X&&!X[W])$[W]=G;else $[W]=G.optional()}),new S({...this._def,shape:()=>$})}required(X){let $={};return D.objectKeys(this.shape).forEach((W)=>{if(X&&!X[W])$[W]=this.shape[W];else{let Q=this.shape[W];while(Q instanceof m)Q=Q._def.innerType;$[W]=Q}}),new S({...this._def,shape:()=>$})}keyof(){return l0(D.objectKeys(this.shape))}}S.create=(X,$)=>{return new S({shape:()=>X,unknownKeys:"strip",catchall:n.create(),typeName:q.ZodObject,...F($)})};S.strictCreate=(X,$)=>{return new S({shape:()=>X,unknownKeys:"strict",catchall:n.create(),typeName:q.ZodObject,...F($)})};S.lazycreate=(X,$)=>{return new S({shape:X,unknownKeys:"strip",catchall:n.create(),typeName:q.ZodObject,...F($)})};class RX extends R{_parse(X){let{ctx:$}=this._processInputParams(X),W=this._def.options;function G(Q){for(let J of Q)if(J.result.status==="valid")return J.result;for(let J of Q)if(J.result.status==="dirty")return $.common.issues.push(...J.ctx.common.issues),J.result;let H=Q.map((J)=>new g(J.ctx.common.issues));return z($,{code:w.invalid_union,unionErrors:H}),L}if($.common.async)return Promise.all(W.map(async(Q)=>{let H={...$,common:{...$.common,issues:[]},parent:null};return{result:await Q._parseAsync({data:$.data,path:$.path,parent:H}),ctx:H}})).then(G);else{let Q=void 0,H=[];for(let M of W){let B={...$,common:{...$.common,issues:[]},parent:null},V=M._parseSync({data:$.data,path:$.path,parent:B});if(V.status==="valid")return V;else if(V.status==="dirty"&&!Q)Q={result:V,ctx:B};if(B.common.issues.length)H.push(B.common.issues)}if(Q)return $.common.issues.push(...Q.ctx.common.issues),Q.result;let J=H.map((M)=>new g(M));return z($,{code:w.invalid_union,unionErrors:J}),L}}get options(){return this._def.options}}RX.create=(X,$)=>{return new RX({options:X,typeName:q.ZodUnion,...F($)})};var a=(X)=>{if(X instanceof KX)return a(X.schema);else if(X instanceof h)return a(X.innerType());else if(X instanceof NX)return[X.value];else if(X instanceof YX)return X.options;else if(X instanceof SX)return D.objectValues(X.enum);else if(X instanceof _X)return a(X._def.innerType);else if(X instanceof jX)return[void 0];else if(X instanceof FX)return[null];else if(X instanceof m)return[void 0,...a(X.unwrap())];else if(X instanceof t)return[null,...a(X.unwrap())];else if(X instanceof uX)return a(X.unwrap());else if(X instanceof bX)return a(X.unwrap());else if(X instanceof EX)return a(X._def.innerType);else return[]};class cX extends R{_parse(X){let{ctx:$}=this._processInputParams(X);if($.parsedType!==O.object)return z($,{code:w.invalid_type,expected:O.object,received:$.parsedType}),L;let W=this.discriminator,G=$.data[W],Q=this.optionsMap.get(G);if(!Q)return z($,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[W]}),L;if($.common.async)return Q._parseAsync({data:$.data,path:$.path,parent:$});else return Q._parseSync({data:$.data,path:$.path,parent:$})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(X,$,W){let G=new Map;for(let Q of $){let H=a(Q.shape[X]);if(!H.length)throw new Error(`A discriminator value for key \`${X}\` could not be extracted from all schema options`);for(let J of H){if(G.has(J))throw new Error(`Discriminator property ${String(X)} has duplicate value ${String(J)}`);G.set(J,Q)}}return new cX({typeName:q.ZodDiscriminatedUnion,discriminator:X,options:$,optionsMap:G,...F(W)})}}function Y0(X,$){let W=s(X),G=s($);if(X===$)return{valid:!0,data:X};else if(W===O.object&&G===O.object){let Q=D.objectKeys($),H=D.objectKeys(X).filter((M)=>Q.indexOf(M)!==-1),J={...X,...$};for(let M of H){let B=Y0(X[M],$[M]);if(!B.valid)return{valid:!1};J[M]=B.data}return{valid:!0,data:J}}else if(W===O.array&&G===O.array){if(X.length!==$.length)return{valid:!1};let Q=[];for(let H=0;H<X.length;H++){let J=X[H],M=$[H],B=Y0(J,M);if(!B.valid)return{valid:!1};Q.push(B.data)}return{valid:!0,data:Q}}else if(W===O.date&&G===O.date&&+X===+$)return{valid:!0,data:X};else return{valid:!1}}class DX extends R{_parse(X){let{status:$,ctx:W}=this._processInputParams(X),G=(Q,H)=>{if(Q0(Q)||Q0(H))return L;let J=Y0(Q.value,H.value);if(!J.valid)return z(W,{code:w.invalid_intersection_types}),L;if(H0(Q)||H0(H))$.dirty();return{status:$.value,value:J.data}};if(W.common.async)return Promise.all([this._def.left._parseAsync({data:W.data,path:W.path,parent:W}),this._def.right._parseAsync({data:W.data,path:W.path,parent:W})]).then(([Q,H])=>G(Q,H));else return G(this._def.left._parseSync({data:W.data,path:W.path,parent:W}),this._def.right._parseSync({data:W.data,path:W.path,parent:W}))}}DX.create=(X,$,W)=>{return new DX({left:X,right:$,typeName:q.ZodIntersection,...F(W)})};class d extends R{_parse(X){let{status:$,ctx:W}=this._processInputParams(X);if(W.parsedType!==O.array)return z(W,{code:w.invalid_type,expected:O.array,received:W.parsedType}),L;if(W.data.length<this._def.items.length)return z(W,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),L;if(!this._def.rest&&W.data.length>this._def.items.length)z(W,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$.dirty();let Q=[...W.data].map((H,J)=>{let M=this._def.items[J]||this._def.rest;if(!M)return null;return M._parse(new c(W,H,W.path,J))}).filter((H)=>!!H);if(W.common.async)return Promise.all(Q).then((H)=>{return b.mergeArray($,H)});else return b.mergeArray($,Q)}get items(){return this._def.items}rest(X){return new d({...this._def,rest:X})}}d.create=(X,$)=>{if(!Array.isArray(X))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new d({items:X,typeName:q.ZodTuple,rest:null,...F($)})};class gX extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(X){let{status:$,ctx:W}=this._processInputParams(X);if(W.parsedType!==O.object)return z(W,{code:w.invalid_type,expected:O.object,received:W.parsedType}),L;let G=[],Q=this._def.keyType,H=this._def.valueType;for(let J in W.data)G.push({key:Q._parse(new c(W,J,W.path,J)),value:H._parse(new c(W,W.data[J],W.path,J)),alwaysSet:J in W.data});if(W.common.async)return b.mergeObjectAsync($,G);else return b.mergeObjectSync($,G)}get element(){return this._def.valueType}static create(X,$,W){if($ instanceof R)return new gX({keyType:X,valueType:$,typeName:q.ZodRecord,...F(W)});return new gX({keyType:y.create(),valueType:X,typeName:q.ZodRecord,...F($)})}}class TX extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(X){let{status:$,ctx:W}=this._processInputParams(X);if(W.parsedType!==O.map)return z(W,{code:w.invalid_type,expected:O.map,received:W.parsedType}),L;let G=this._def.keyType,Q=this._def.valueType,H=[...W.data.entries()].map(([J,M],B)=>{return{key:G._parse(new c(W,J,W.path,[B,"key"])),value:Q._parse(new c(W,M,W.path,[B,"value"]))}});if(W.common.async){let J=new Map;return Promise.resolve().then(async()=>{for(let M of H){let B=await M.key,V=await M.value;if(B.status==="aborted"||V.status==="aborted")return L;if(B.status==="dirty"||V.status==="dirty")$.dirty();J.set(B.value,V.value)}return{status:$.value,value:J}})}else{let J=new Map;for(let M of H){let{key:B,value:V}=M;if(B.status==="aborted"||V.status==="aborted")return L;if(B.status==="dirty"||V.status==="dirty")$.dirty();J.set(B.value,V.value)}return{status:$.value,value:J}}}}TX.create=(X,$,W)=>{return new TX({valueType:$,keyType:X,typeName:q.ZodMap,...F(W)})};class wX extends R{_parse(X){let{status:$,ctx:W}=this._processInputParams(X);if(W.parsedType!==O.set)return z(W,{code:w.invalid_type,expected:O.set,received:W.parsedType}),L;let G=this._def;if(G.minSize!==null){if(W.data.size<G.minSize.value)z(W,{code:w.too_small,minimum:G.minSize.value,type:"set",inclusive:!0,exact:!1,message:G.minSize.message}),$.dirty()}if(G.maxSize!==null){if(W.data.size>G.maxSize.value)z(W,{code:w.too_big,maximum:G.maxSize.value,type:"set",inclusive:!0,exact:!1,message:G.maxSize.message}),$.dirty()}let Q=this._def.valueType;function H(M){let B=new Set;for(let V of M){if(V.status==="aborted")return L;if(V.status==="dirty")$.dirty();B.add(V.value)}return{status:$.value,value:B}}let J=[...W.data.values()].map((M,B)=>Q._parse(new c(W,M,W.path,B)));if(W.common.async)return Promise.all(J).then((M)=>H(M));else return H(J)}min(X,$){return new wX({...this._def,minSize:{value:X,message:A.toString($)}})}max(X,$){return new wX({...this._def,maxSize:{value:X,message:A.toString($)}})}size(X,$){return this.min(X,$).max(X,$)}nonempty(X){return this.min(1,X)}}wX.create=(X,$)=>{return new wX({valueType:X,minSize:null,maxSize:null,typeName:q.ZodSet,...F($)})};class qX extends R{constructor(){super(...arguments);this.validate=this.implement}_parse(X){let{ctx:$}=this._processInputParams(X);if($.parsedType!==O.function)return z($,{code:w.invalid_type,expected:O.function,received:$.parsedType}),L;function W(J,M){return lX({data:J,path:$.pa