UNPKG

@cloudbase/cloudbase-mcp

Version:

腾讯云开发 MCP Server,通过AI提示词和MCP协议+云开发,让开发更智能、更高效,当你在Cursor/ VSCode GitHub Copilot/WinSurf/CodeBuddy/Augment Code/Claude Code等AI编程工具里写代码时,它能自动帮你生成可直接部署的前后端应用+小程序,并一键发布到腾讯云开发 CloudBase。

1 lines 4.28 MB
"use strict";var e=require("fs"),t=require("util"),r=require("path"),n=require("stream"),i=require("events"),o=require("assert"),s=require("os"),p=require("constants"),l=require("crypto"),u=require("url"),h=require("http"),g=require("punycode"),y=require("https"),b=require("zlib"),x=require("net"),w=require("tls"),k=require("tty"),C=require("module"),j=require("child_process"),P=require("buffer"),O=require("string_decoder"),I=require("console"),$=require("readline"),z=require("fs/promises"),H=require("node:zlib"),V=require("node:events"),W=require("node:path"),G=require("node:fs"),Y=require("node:http"),X=require("querystring"),ee=require("node:net"),te=require("async_hooks"),re=require("dns"),ae=require("node:process"),ne=require("node:buffer"),ie=require("node:url"),oe=require("node:util"),se=require("node:child_process"),ce=require("node:fs/promises"),pe=require("node:os");var le="undefined"!=typeof document?document.currentScript:null;function _interopNamespaceDefault(e){var t=Object.create(null);e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}});t.default=e;return Object.freeze(t)}var ue=_interopNamespaceDefault(e);var de=_interopNamespaceDefault(r);var fe=_interopNamespaceDefault(s);var me=_interopNamespaceDefault(l);var he=_interopNamespaceDefault(h);var ve=_interopNamespaceDefault(y);var ge=_interopNamespaceDefault(x);var ye=_interopNamespaceDefault(z);var be=_interopNamespaceDefault(re);var xe;!function(e){e.assertEqual=e=>e;function assertIs(e){}e.assertIs=assertIs;function assertNever(e){throw new Error}e.assertNever=assertNever;e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t};e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]);const n={};for(const e of r)n[e]=t[e];return e.objectValues(n)};e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]});e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t};e.find=(e,t)=>{for(const r of e)if(t(r))return r};e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e;function joinValues(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)}e.joinValues=joinValues;e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(xe||(xe={}));var we;!function(e){e.mergeShapes=(e,t)=>({...e,...t})}(we||(we={}));const _e=xe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const getParsedType=e=>{const t=undefined;switch(typeof e){case"undefined":return _e.undefined;case"string":return _e.string;case"number":return isNaN(e)?_e.nan:_e.number;case"boolean":return _e.boolean;case"function":return _e.function;case"bigint":return _e.bigint;case"symbol":return _e.symbol;case"object":return Array.isArray(e)?_e.array:null===e?_e.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?_e.promise:"undefined"!=typeof Map&&e instanceof Map?_e.map:"undefined"!=typeof Set&&e instanceof Set?_e.set:"undefined"!=typeof Date&&e instanceof Date?_e.date:_e.object;default:return _e.unknown}};const ke=xe.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"]);const quotelessJson=e=>{const t=undefined;return JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:")};class ZodError 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};const r={_errors:[]};const processError=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(processError);else if("invalid_return_type"===n.code)processError(n.returnTypeError);else if("invalid_arguments"===n.code)processError(n.argumentsError);else if(0===n.path.length)r._errors.push(t(n));else{let e=r;let i=0;for(;i<n.path.length;){const r=n.path[i];const o=undefined;if(i===n.path.length-1){e[r]=e[r]||{_errors:[]};e[r]._errors.push(t(n))}else e[r]=e[r]||{_errors:[]};e=e[r];i++}}};processError(this);return r}static assert(e){if(!(e instanceof ZodError))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,xe.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={};const r=[];for(const n of this.issues)if(n.path.length>0){t[n.path[0]]=t[n.path[0]]||[];t[n.path[0]].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}ZodError.create=e=>{const t=undefined;return new ZodError(e)};const errorMap=(e,t)=>{let r;switch(e.code){case ke.invalid_type:r=e.received===_e.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case ke.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,xe.jsonStringifyReplacer)}`;break;case ke.unrecognized_keys:r=`Unrecognized key(s) in object: ${xe.joinValues(e.keys,", ")}`;break;case ke.invalid_union:r="Invalid input";break;case ke.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${xe.joinValues(e.options)}`;break;case ke.invalid_enum_value:r=`Invalid enum value. Expected ${xe.joinValues(e.options)}, received '${e.received}'`;break;case ke.invalid_arguments:r="Invalid function arguments";break;case ke.invalid_return_type:r="Invalid function return type";break;case ke.invalid_date:r="Invalid date";break;case ke.invalid_string:if("object"==typeof e.validation)if("includes"in e.validation){r=`Invalid input: must include "${e.validation.includes}"`;"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)}else"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:xe.assertNever(e.validation);else r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case ke.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case ke.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case ke.custom:r="Invalid input";break;case ke.invalid_intersection_types:r="Intersection results could not be merged";break;case ke.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ke.not_finite:r="Number must be finite";break;default:r=t.defaultError;xe.assertNever(e)}return{message:r}};let Se=errorMap;function setErrorMap(e){Se=e}function getErrorMap(){return Se}const makeIssue=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e;const o=[...r,...i.path||[]];const s={...i,path:o};if(void 0!==i.message)return{...i,path:o,message:i.message};let p="";const l=n.filter(e=>!!e).slice().reverse();for(const e of l)p=e(s,{data:t,defaultError:p}).message;return{...i,path:o,message:p}};const Ee=[];function addIssueToContext(e,t){const r=getErrorMap();const n=makeIssue({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===errorMap?void 0:errorMap].filter(e=>!!e)});e.common.issues.push(n)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return Ce;"dirty"===n.status&&e.dirty();r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key;const n=await e.value;r.push({key:t,value:n})}return ParseStatus.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:i}=n;if("aborted"===t.status)return Ce;if("aborted"===i.status)return Ce;"dirty"===t.status&&e.dirty();"dirty"===i.status&&e.dirty();"__proto__"===t.value||void 0===i.value&&!n.alwaysSet||(r[t.value]=i.value)}return{status:e.value,value:r}}}const Ce=Object.freeze({status:"aborted"});const DIRTY=e=>({status:"dirty",value:e});const OK=e=>({status:"valid",value:e});const isAborted=e=>"aborted"===e.status;const isDirty=e=>"dirty"===e.status;const isValid=e=>"valid"===e.status;const isAsync$2=e=>"undefined"!=typeof Promise&&e instanceof Promise;function __classPrivateFieldGet(e,t,r,n){if("function"==typeof t?(e!==t,1):!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function __classPrivateFieldSet(e,t,r,n,i){if("function"==typeof t?(e!==t,1):!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}"function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};var je;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{};e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(je||(je={}));var Pe,De;class ParseInputLazyPath{constructor(e,t,r,n){this._cachedPath=[];this.parent=e;this.data=t;this._path=r;this._key=n}get path(){this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key));return this._cachedPath}}const handleResult=(e,t)=>{if(isValid(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 ZodError(e.common.issues);this._error=t;return this._error}}};function processCreateParams$1(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};const o=undefined;return{errorMap:(t,i)=>{var o,s;const{message:p}=e;return"invalid_enum_value"===t.code?{message:null!=p?p:i.defaultError}:void 0===i.data?{message:null!==(o=null!=p?p:n)&&void 0!==o?o:i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:null!==(s=null!=p?p:r)&&void 0!==s?s:i.defaultError}},description:i}}class ZodType{get description(){return this._def.description}_getType(e){return getParsedType(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(isAsync$2(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 r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)};const i=this._parseSync({data:e,path:n.path,parent:n});return handleResult(n,i)}"~validate"(e){var t,r;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:n});return isValid(t)?{value:t.value}:{issues:n.common.issues}}catch(e){(null===(r=null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.toLowerCase())||void 0===r?void 0:r.includes("encountered"))&&(this["~standard"].async=!0);n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(e=>isValid(e)?{value:e.value}:{issues:n.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={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:getParsedType(e)};const n=this._parse({data:e,path:r.path,parent:r});const i=await(isAsync$2(n)?n:Promise.resolve(n));return handleResult(r,i)}refine(e,t){const getIssueProperties=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,r)=>{const n=e(t);const setError=()=>r.addIssue({code:ke.custom,...getIssueProperties(t)});if("undefined"!=typeof Promise&&n instanceof Promise)return n.then(e=>{if(e)return!0;setError();return!1});if(n)return!0;setError();return!1})}refinement(e,t){return this._refinement((r,n)=>{if(e(r))return!0;n.addIssue("function"==typeof t?t(r,n):t);return!1})}_refinement(e){return new ZodEffects({schema:this,typeName:Ye.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 ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...processCreateParams$1(this._def),schema:this,typeName:Ye.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ZodDefault({...processCreateParams$1(this._def),innerType:this,defaultValue:t,typeName:Ye.ZodDefault})}brand(){return new ZodBranded({typeName:Ye.ZodBranded,type:this,...processCreateParams$1(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ZodCatch({...processCreateParams$1(this._def),innerType:this,catchValue:t,typeName:Ye.ZodCatch})}describe(e){const t=undefined;return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ae=/^c[^\s-]{8,}$/i;const Te=/^[0-9a-z]+$/;const Oe=/^[0-9A-HJKMNP-TV-Z]{26}$/i;const Re=/^[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;const Ie=/^[a-z0-9_-]{21}$/i;const qe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;const Fe=/^[-+]?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)?)??$/;const Ne=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;const Le="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $e;const Be=/^(?:(?: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])$/;const Me=/^(?:(?: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])$/;const ze=/^(([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]))$/;const Ue=/^(([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])$/;const He=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;const Ve=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;const We="((\\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])))";const Ke=new RegExp(`^${We}$`);function timeRegexSource(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return t}function timeRegex(e){return new RegExp(`^${timeRegexSource(e)}$`)}function datetimeRegex(e){let t=`${We}T${timeRegexSource(e)}`;const r=[];r.push(e.local?"Z?":"Z");e.offset&&r.push("([+-]\\d{2}:?\\d{2})");t=`${t}(${r.join("|")})`;return new RegExp(`^${t}$`)}function isValidIP(e,t){return!("v4"!==t&&t||!Be.test(e))||!("v6"!==t&&t||!ze.test(e))}function isValidJWT(e,t){if(!qe.test(e))return!1;try{const[r]=e.split(".");const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"=");const i=JSON.parse(atob(n));return"object"==typeof i&&null!==i&&(!(!i.typ||!i.alg)&&(!t||i.alg===t))}catch(e){return!1}}function isValidCidr(e,t){return!("v4"!==t&&t||!Me.test(e))||!("v6"!==t&&t||!Ue.test(e))}class ZodString extends ZodType{_parse(e){this._def.coerce&&(e.data=String(e.data));const t=undefined;if(this._getType(e)!==_e.string){const t=this._getOrReturnCtx(e);addIssueToContext(t,{code:ke.invalid_type,expected:_e.string,received:t.parsedType});return Ce}const r=new ParseStatus;let n;for(const t of this._def.checks)if("min"===t.kind){if(e.data.length<t.value){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ke.too_small,minimum:t.value,type:"string",inclusive:!0,exact:!1,message:t.message});r.dirty()}}else if("max"===t.kind){if(e.data.length>t.value){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ke.too_big,maximum:t.value,type:"string",inclusive:!0,exact:!1,message:t.message});r.dirty()}}else if("length"===t.kind){const i=e.data.length>t.value;const o=e.data.length<t.value;if(i||o){n=this._getOrReturnCtx(e,n);i?addIssueToContext(n,{code:ke.too_big,maximum:t.value,type:"string",inclusive:!0,exact:!0,message:t.message}):o&&addIssueToContext(n,{code:ke.too_small,minimum:t.value,type:"string",inclusive:!0,exact:!0,message:t.message});r.dirty()}}else if("email"===t.kind){if(!Ne.test(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{validation:"email",code:ke.invalid_string,message:t.message});r.dirty()}}else if("emoji"===t.kind){$e||($e=new RegExp(Le,"u"));if(!$e.test(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{validation:"emoji",code:ke.invalid_string,message:t.message});r.dirty()}}else if("uuid"===t.kind){if(!Re.test(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{validation:"uuid",code:ke.invalid_string,message:t.message});r.dirty()}}else if("nanoid"===t.kind){if(!Ie.test(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{validation:"nanoid",code:ke.invalid_string,message:t.message});r.dirty()}}else if("cuid"===t.kind){if(!Ae.test(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{validation:"cuid",code:ke.invalid_string,message:t.message});r.dirty()}}else if("cuid2"===t.kind){if(!Te.test(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{validation:"cuid2",code:ke.invalid_string,message:t.message});r.dirty()}}else if("ulid"===t.kind){if(!Oe.test(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{validation:"ulid",code:ke.invalid_string,message:t.message});r.dirty()}}else if("url"===t.kind)try{new URL(e.data)}catch(i){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{validation:"url",code:ke.invalid_string,message:t.message});r.dirty()}else if("regex"===t.kind){t.regex.lastIndex=0;const i=undefined;if(!t.regex.test(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{validation:"regex",code:ke.invalid_string,message:t.message});r.dirty()}}else if("trim"===t.kind)e.data=e.data.trim();else if("includes"===t.kind){if(!e.data.includes(t.value,t.position)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ke.invalid_string,validation:{includes:t.value,position:t.position},message:t.message});r.dirty()}}else if("toLowerCase"===t.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===t.kind)e.data=e.data.toUpperCase();else if("startsWith"===t.kind){if(!e.data.startsWith(t.value)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ke.invalid_string,validation:{startsWith:t.value},message:t.message});r.dirty()}}else if("endsWith"===t.kind){if(!e.data.endsWith(t.value)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ke.invalid_string,validation:{endsWith:t.value},message:t.message});r.dirty()}}else if("datetime"===t.kind){const i=undefined;if(!datetimeRegex(t).test(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ke.invalid_string,validation:"datetime",message:t.message});r.dirty()}}else if("date"===t.kind){const i=undefined;if(!Ke.test(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ke.invalid_string,validation:"date",message:t.message});r.dirty()}}else if("time"===t.kind){const i=undefined;if(!timeRegex(t).test(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ke.invalid_string,validation:"time",message:t.message});r.dirty()}}else if("duration"===t.kind){if(!Fe.test(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{validation:"duration",code:ke.invalid_string,message:t.message});r.dirty()}}else if("ip"===t.kind){if(!isValidIP(e.data,t.version)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{validation:"ip",code:ke.invalid_string,message:t.message});r.dirty()}}else if("jwt"===t.kind){if(!isValidJWT(e.data,t.alg)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{validation:"jwt",code:ke.invalid_string,message:t.message});r.dirty()}}else if("cidr"===t.kind){if(!isValidCidr(e.data,t.version)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{validation:"cidr",code:ke.invalid_string,message:t.message});r.dirty()}}else if("base64"===t.kind){if(!He.test(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{validation:"base64",code:ke.invalid_string,message:t.message});r.dirty()}}else if("base64url"===t.kind){if(!Ve.test(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{validation:"base64url",code:ke.invalid_string,message:t.message});r.dirty()}}else xe.assertNever(t);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:ke.invalid_string,...je.errToObj(r)})}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...je.errToObj(e)})}url(e){return this._addCheck({kind:"url",...je.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...je.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...je.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...je.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...je.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...je.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...je.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...je.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...je.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...je.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...je.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...je.errToObj(e)})}datetime(e){var t,r;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)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...je.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,...je.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...je.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...je.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...je.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...je.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...je.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...je.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...je.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...je.errToObj(t)})}nonempty(e){return this.min(1,je.errToObj(e))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...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}}ZodString.create=e=>{var t;return new ZodString({checks:[],typeName:Ye.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams$1(e)})};function floatSafeRemainder(e,t){const r=(e.toString().split(".")[1]||"").length;const n=(t.toString().split(".")[1]||"").length;const i=r>n?r:n;const o=undefined;const s=undefined;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}class ZodNumber extends ZodType{constructor(){super(...arguments);this.min=this.gte;this.max=this.lte;this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));const t=undefined;if(this._getType(e)!==_e.number){const t=this._getOrReturnCtx(e);addIssueToContext(t,{code:ke.invalid_type,expected:_e.number,received:t.parsedType});return Ce}let r;const n=new ParseStatus;for(const t of this._def.checks)if("int"===t.kind){if(!xe.isInteger(e.data)){r=this._getOrReturnCtx(e,r);addIssueToContext(r,{code:ke.invalid_type,expected:"integer",received:"float",message:t.message});n.dirty()}}else if("min"===t.kind){const i=undefined;if(t.inclusive?e.data<t.value:e.data<=t.value){r=this._getOrReturnCtx(e,r);addIssueToContext(r,{code:ke.too_small,minimum:t.value,type:"number",inclusive:t.inclusive,exact:!1,message:t.message});n.dirty()}}else if("max"===t.kind){const i=undefined;if(t.inclusive?e.data>t.value:e.data>=t.value){r=this._getOrReturnCtx(e,r);addIssueToContext(r,{code:ke.too_big,maximum:t.value,type:"number",inclusive:t.inclusive,exact:!1,message:t.message});n.dirty()}}else if("multipleOf"===t.kind){if(0!==floatSafeRemainder(e.data,t.value)){r=this._getOrReturnCtx(e,r);addIssueToContext(r,{code:ke.not_multiple_of,multipleOf:t.value,message:t.message});n.dirty()}}else if("finite"===t.kind){if(!Number.isFinite(e.data)){r=this._getOrReturnCtx(e,r);addIssueToContext(r,{code:ke.not_finite,message:t.message});n.dirty()}}else xe.assertNever(t);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,je.toString(t))}gt(e,t){return this.setLimit("min",e,!1,je.toString(t))}lte(e,t){return this.setLimit("max",e,!0,je.toString(t))}lt(e,t){return this.setLimit("max",e,!1,je.toString(t))}setLimit(e,t,r,n){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:je.toString(n)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:je.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:je.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:je.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:je.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:je.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:je.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:je.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:je.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:je.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(e=>"int"===e.kind||"multipleOf"===e.kind&&xe.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ZodNumber.create=e=>new ZodNumber({checks:[],typeName:Ye.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams$1(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments);this.min=this.gte;this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}const t=undefined;if(this._getType(e)!==_e.bigint)return this._getInvalidInput(e);let r;const n=new ParseStatus;for(const t of this._def.checks)if("min"===t.kind){const i=undefined;if(t.inclusive?e.data<t.value:e.data<=t.value){r=this._getOrReturnCtx(e,r);addIssueToContext(r,{code:ke.too_small,type:"bigint",minimum:t.value,inclusive:t.inclusive,message:t.message});n.dirty()}}else if("max"===t.kind){const i=undefined;if(t.inclusive?e.data>t.value:e.data>=t.value){r=this._getOrReturnCtx(e,r);addIssueToContext(r,{code:ke.too_big,type:"bigint",maximum:t.value,inclusive:t.inclusive,message:t.message});n.dirty()}}else if("multipleOf"===t.kind){if(e.data%t.value!==BigInt(0)){r=this._getOrReturnCtx(e,r);addIssueToContext(r,{code:ke.not_multiple_of,multipleOf:t.value,message:t.message});n.dirty()}}else xe.assertNever(t);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);addIssueToContext(t,{code:ke.invalid_type,expected:_e.bigint,received:t.parsedType});return Ce}gte(e,t){return this.setLimit("min",e,!0,je.toString(t))}gt(e,t){return this.setLimit("min",e,!1,je.toString(t))}lte(e,t){return this.setLimit("max",e,!0,je.toString(t))}lt(e,t){return this.setLimit("max",e,!1,je.toString(t))}setLimit(e,t,r,n){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:je.toString(n)}]})}_addCheck(e){return new ZodBigInt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:je.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:je.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:je.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:je.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:je.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}}ZodBigInt.create=e=>{var t;return new ZodBigInt({checks:[],typeName:Ye.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams$1(e)})};class ZodBoolean extends ZodType{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));const t=undefined;if(this._getType(e)!==_e.boolean){const t=this._getOrReturnCtx(e);addIssueToContext(t,{code:ke.invalid_type,expected:_e.boolean,received:t.parsedType});return Ce}return OK(e.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:Ye.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams$1(e)});class ZodDate extends ZodType{_parse(e){this._def.coerce&&(e.data=new Date(e.data));const t=undefined;if(this._getType(e)!==_e.date){const t=this._getOrReturnCtx(e);addIssueToContext(t,{code:ke.invalid_type,expected:_e.date,received:t.parsedType});return Ce}if(isNaN(e.data.getTime())){const t=undefined;addIssueToContext(this._getOrReturnCtx(e),{code:ke.invalid_date});return Ce}const r=new ParseStatus;let n;for(const t of this._def.checks)if("min"===t.kind){if(e.data.getTime()<t.value){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ke.too_small,message:t.message,inclusive:!0,exact:!1,minimum:t.value,type:"date"});r.dirty()}}else if("max"===t.kind){if(e.data.getTime()>t.value){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ke.too_big,message:t.message,inclusive:!0,exact:!1,maximum:t.value,type:"date"});r.dirty()}}else xe.assertNever(t);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:je.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:je.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}}ZodDate.create=e=>new ZodDate({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ye.ZodDate,...processCreateParams$1(e)});class ZodSymbol extends ZodType{_parse(e){const t=undefined;if(this._getType(e)!==_e.symbol){const t=this._getOrReturnCtx(e);addIssueToContext(t,{code:ke.invalid_type,expected:_e.symbol,received:t.parsedType});return Ce}return OK(e.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:Ye.ZodSymbol,...processCreateParams$1(e)});class ZodUndefined extends ZodType{_parse(e){const t=undefined;if(this._getType(e)!==_e.undefined){const t=this._getOrReturnCtx(e);addIssueToContext(t,{code:ke.invalid_type,expected:_e.undefined,received:t.parsedType});return Ce}return OK(e.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:Ye.ZodUndefined,...processCreateParams$1(e)});class ZodNull extends ZodType{_parse(e){const t=undefined;if(this._getType(e)!==_e.null){const t=this._getOrReturnCtx(e);addIssueToContext(t,{code:ke.invalid_type,expected:_e.null,received:t.parsedType});return Ce}return OK(e.data)}}ZodNull.create=e=>new ZodNull({typeName:Ye.ZodNull,...processCreateParams$1(e)});class ZodAny extends ZodType{constructor(){super(...arguments);this._any=!0}_parse(e){return OK(e.data)}}ZodAny.create=e=>new ZodAny({typeName:Ye.ZodAny,...processCreateParams$1(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments);this._unknown=!0}_parse(e){return OK(e.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:Ye.ZodUnknown,...processCreateParams$1(e)});class ZodNever extends ZodType{_parse(e){const t=this._getOrReturnCtx(e);addIssueToContext(t,{code:ke.invalid_type,expected:_e.never,received:t.parsedType});return Ce}}ZodNever.create=e=>new ZodNever({typeName:Ye.ZodNever,...processCreateParams$1(e)});class ZodVoid extends ZodType{_parse(e){const t=undefined;if(this._getType(e)!==_e.undefined){const t=this._getOrReturnCtx(e);addIssueToContext(t,{code:ke.invalid_type,expected:_e.void,received:t.parsedType});return Ce}return OK(e.data)}}ZodVoid.create=e=>new ZodVoid({typeName:Ye.ZodVoid,...processCreateParams$1(e)});class ZodArray extends ZodType{_parse(e){const{ctx:t,status:r}=this._processInputParams(e);const n=this._def;if(t.parsedType!==_e.array){addIssueToContext(t,{code:ke.invalid_type,expected:_e.array,received:t.parsedType});return Ce}if(null!==n.exactLength){const e=t.data.length>n.exactLength.value;const i=t.data.length<n.exactLength.value;if(e||i){addIssueToContext(t,{code:e?ke.too_big:ke.too_small,minimum:i?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message});r.dirty()}}if(null!==n.minLength&&t.data.length<n.minLength.value){addIssueToContext(t,{code:ke.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message});r.dirty()}if(null!==n.maxLength&&t.data.length>n.maxLength.value){addIssueToContext(t,{code:ke.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message});r.dirty()}if(t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new ParseInputLazyPath(t,e,t.path,r)))).then(e=>ParseStatus.mergeArray(r,e));const i=[...t.data].map((e,r)=>n.type._parseSync(new ParseInputLazyPath(t,e,t.path,r)));return ParseStatus.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new ZodArray({...this._def,minLength:{value:e,message:je.toString(t)}})}max(e,t){return new ZodArray({...this._def,maxLength:{value:e,message:je.toString(t)}})}length(e,t){return new ZodArray({...this._def,exactLength:{value:e,message:je.toString(t)}})}nonempty(e){return this.min(1,e)}}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ye.ZodArray,...processCreateParams$1(t)});function deepPartialify(e){if(e instanceof ZodObject){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=ZodOptional.create(deepPartialify(n))}return new ZodObject({...e._def,shape:()=>t})}return e instanceof ZodArray?new ZodArray({...e._def,type:deepPartialify(e.element)}):e instanceof ZodOptional?ZodOptional.create(deepPartialify(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(deepPartialify(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map(e=>deepPartialify(e))):e}class ZodObject extends ZodType{constructor(){super(...arguments);this._cached=null;this.nonstrict=this.passthrough;this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape();const t=xe.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){const t=undefined;if(this._getType(e)!==_e.object){const t=this._getOrReturnCtx(e);addIssueToContext(t,{code:ke.invalid_type,expected:_e.object,received:t.parsedType});return Ce}const{status:r,ctx:n}=this._processInputParams(e);const{shape:i,keys:o}=this._getCached();const s=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const e in n.data)o.includes(e)||s.push(e);const p=[];for(const e of o){const t=i[e];const r=n.data[e];p.push({key:{status:"valid",value:e},value:t._parse(new ParseInputLazyPath(n,r,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ZodNever){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)p.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e){if(s.length>0){addIssueToContext(n,{code:ke.unrecognized_keys,keys:s});r.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=n.data[t];p.push({key:{status:"valid",value:t},value:e._parse(new ParseInputLazyPath(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of p){const r=await t.key;const n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>ParseStatus.mergeObjectSync(r,e)):ParseStatus.mergeObjectSync(r,p)}get shape(){return this._def.shape()}strict(e){je.errToObj;return new ZodObject({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,i,o,s;const p=null!==(o=null===(i=(n=this._def).errorMap)||void 0===i?void 0:i.call(n,t,r).message)&&void 0!==o?o:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(s=je.errToObj(e).message)&&void 0!==s?s:p}:{message:p}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){const t=undefined;return new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ye.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ZodObject({...this._def,catchall:e})}pick(e){const t={};xe.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])});return new ZodObject({...this._def,shape:()=>t})}omit(e){const t={};xe.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])});return new ZodObject({...this._def,shape:()=>t})}deepPartial(){return deepPartialify(this)}partial(e){const t={};xe.objectKeys(this.shape).forEach(r=>{const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()});return new ZodObject({...this._def,shape:()=>t})}required(e){const t={};xe.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{const e=undefined;let n=this.shape[r];for(;n instanceof ZodOptional;)n=n._def.innerType;t[r]=n}});return new ZodObject({...this._def,shape:()=>t})}keyof(){return createZodEnum(xe.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:Ye.ZodObject,...processCreateParams$1(t)});ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:Ye.ZodObject,...processCreateParams$1(t)});ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:Ye.ZodObject,...processCreateParams$1(t)});class ZodUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);const r=this._def.options;function handleResults(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status){t.common.issues.push(...r.ctx.common.issues);return r.result}const r=e.map(e=>new ZodError(e.ctx.common.issues));addIssueToContext(t,{code:ke.invalid_union,unionErrors:r});return Ce}if(t.common.async)return Promise.all(r.map(async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(handleResults);{let e;const n=[];for(const i of r){const r={...t,common:{...t.common,issues:[]},parent:null};const o=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:r});r.common.issues.length&&n.push(r.common.issues)}if(e){t.common.issues.push(...e.ctx.common.issues);return e.result}const i=n.map(e=>new ZodError(e));addIssueToContext(t,{code:ke.invalid_union,unionErrors:i});return Ce}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:Ye.ZodUnion,...processCreateParams$1(t)});const getDiscriminator=e=>e instanceof ZodLazy?getDiscriminator(e.schema):e instanceof ZodEffects?getDiscriminator(e.innerType()):e instanceof ZodLiteral?[e.value]:e instanceof ZodEnum?e.options:e instanceof ZodNativeEnum?xe.objectValues(e.enum):e instanceof ZodDefault?getDiscriminator(e._def.innerType):e instanceof ZodUndefined?[void 0]:e instanceof ZodNull?[null]:e instanceof ZodOptional?[void 0,...getDiscriminator(e.unwrap())]:e instanceof ZodNullable?[null,...getDiscriminator(e.unwrap())]:e instanceof ZodBranded||e instanceof ZodReadonly?getDiscriminator(e.unwrap()):e instanceof ZodCatch?getDiscriminator(e._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==_e.object){addIssueToContext(t,{code:ke.invalid_type,expected:_e.object,received:t.parsedType});return Ce}const r=this.discriminator;const n=t.data[r];const i=this.optionsMap.get(n);if(!i){addIssueToContext(t,{code:ke.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]});return Ce}return t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const r of t){const t=getDiscriminator(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,r)}}return new ZodDiscriminatedUnion({typeName:Ye.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...processCreateParams$1(r)})}}function mergeValues(e,t){const r=getParsedType(e);const n=getParsedType(t);if(e===t)return{valid:!0,data:e};if(r===_e.object&&n===_e.object){const r=xe.objectKeys(t);const n=xe.objectKeys(e).filter(e=>-1!==r.indexOf(e));const i={...e,...t};for(const r of n){const n=mergeValues(e[r],t[r]);if(!n.valid)return{valid:!1};i[r]=n.data}return{valid:!0,data:i}}if(r===_e.array&&n===_e.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const i=undefined;const o=undefined;const s=mergeValues(e[n],t[n]);if(!s.valid)return{valid:!1};r.push(s.data)}return{valid:!0,data:r}}return r===_e.date&&n===_e.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class ZodIntersection extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);const handleParsed=(e,n)=>{if(isAborted(e)||isAborted