@techdocs/cli 0.0.0-nightly-20260919022921 → 0.0.0-nightly-20260920023043

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +6 -6
  2. package/dist/commands/generate/generate.cjs.js.map +1 -1
  3. package/dist/commands/index.cjs.js.map +1 -1
  4. package/dist/commands/migrate/migrate.cjs.js.map +1 -1
  5. package/dist/commands/publish/publish.cjs.js.map +1 -1
  6. package/dist/commands/serve/mkdocs.cjs.js.map +1 -1
  7. package/dist/commands/serve/serve.cjs.js.map +1 -1
  8. package/dist/commands/serve/utils.cjs.js.map +1 -1
  9. package/dist/embedded-app/.config-schema.json +171 -171
  10. package/dist/embedded-app/index.html +1 -1
  11. package/dist/embedded-app/index.html.tmpl +1 -1
  12. package/dist/embedded-app/static/{123.22c46cc9261e.chunk.js → 123.91b76c2db3c7.chunk.js} +2 -2
  13. package/dist/embedded-app/static/{123.22c46cc9261e.chunk.js.map → 123.91b76c2db3c7.chunk.js.map} +1 -1
  14. package/dist/embedded-app/static/{1659.d2cf8ac24a6e.chunk.js → 1659.d331ae7a2aa0.chunk.js} +2 -2
  15. package/dist/embedded-app/static/{1659.d2cf8ac24a6e.chunk.js.map → 1659.d331ae7a2aa0.chunk.js.map} +1 -1
  16. package/dist/embedded-app/static/3031.f2ee3495211a.chunk.js +2 -0
  17. package/dist/embedded-app/static/{3031.cd0a0f1ddfd2.chunk.js.map → 3031.f2ee3495211a.chunk.js.map} +1 -1
  18. package/dist/embedded-app/static/{4587.6317f7d55bec.chunk.js → 4587.51046685b224.chunk.js} +2 -2
  19. package/dist/embedded-app/static/{4587.6317f7d55bec.chunk.js.map → 4587.51046685b224.chunk.js.map} +1 -1
  20. package/dist/embedded-app/static/{4609.4edf12369fbb.chunk.js → 4609.9d9e4473afcc.chunk.js} +2 -2
  21. package/dist/embedded-app/static/{4609.4edf12369fbb.chunk.js.map → 4609.9d9e4473afcc.chunk.js.map} +1 -1
  22. package/dist/embedded-app/static/4876.fa3ad2676113.chunk.js +2 -0
  23. package/dist/embedded-app/static/4876.fa3ad2676113.chunk.js.map +1 -0
  24. package/dist/embedded-app/static/main.541fb5168686.js +2 -0
  25. package/dist/embedded-app/static/main.541fb5168686.js.map +1 -0
  26. package/dist/embedded-app/static/module-zod.da562d5b5226.js +56 -0
  27. package/dist/embedded-app/static/module-zod.da562d5b5226.js.map +1 -0
  28. package/dist/embedded-app/static/{runtime.62449901f546.js → runtime.f85ef6e514f1.js} +2 -2
  29. package/dist/embedded-app/static/{runtime.62449901f546.js.map → runtime.f85ef6e514f1.js.map} +1 -1
  30. package/dist/index.cjs.js.map +1 -1
  31. package/dist/lib/PublisherConfig.cjs.js.map +1 -1
  32. package/dist/lib/etag.cjs.js.map +1 -1
  33. package/dist/lib/httpServer.cjs.js.map +1 -1
  34. package/dist/lib/livereload.cjs.js.map +1 -1
  35. package/dist/lib/mkdocsServer.cjs.js.map +1 -1
  36. package/dist/lib/utility.cjs.js.map +1 -1
  37. package/dist/package.json.cjs.js +1 -1
  38. package/dist/package.json.cjs.js.map +1 -1
  39. package/package.json +7 -7
  40. package/dist/embedded-app/static/3031.cd0a0f1ddfd2.chunk.js +0 -2
  41. package/dist/embedded-app/static/4876.67117dbbe8d1.chunk.js +0 -2
  42. package/dist/embedded-app/static/4876.67117dbbe8d1.chunk.js.map +0 -1
  43. package/dist/embedded-app/static/main.dfc454d027aa.js +0 -2
  44. package/dist/embedded-app/static/main.dfc454d027aa.js.map +0 -1
  45. package/dist/embedded-app/static/module-zod.faf74f910029.js +0 -38
  46. package/dist/embedded-app/static/module-zod.faf74f910029.js.map +0 -1
@@ -0,0 +1,56 @@
1
+ "use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["9343"],{31533(t,r,n){var i,a,s,o,u,l,d;let c;n.d(r,{L5:()=>eA,E$:()=>eI,bz:()=>ej,g1:()=>eC,RZ:()=>eR,Ik:()=>eE,YO:()=>eP,Yj:()=>eT,eu:()=>eF,KC:()=>eN}),(u=i||(i={})).assertEqual=t=>{},u.assertIs=function(t){},u.assertNever=function(t){throw Error()},u.arrayToEnum=t=>{let r={};for(let n of t)r[n]=n;return r},u.getValidEnumValues=t=>{let r=u.objectKeys(t).filter(r=>"number"!=typeof t[t[r]]),n={};for(let i of r)n[i]=t[i];return u.objectValues(n)},u.objectValues=t=>u.objectKeys(t).map(function(r){return t[r]}),u.objectKeys="function"==typeof Object.keys?t=>Object.keys(t):t=>{let r=[];for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.push(n);return r},u.find=(t,r)=>{for(let n of t)if(r(n))return n},u.isInteger="function"==typeof Number.isInteger?t=>Number.isInteger(t):t=>"number"==typeof t&&Number.isFinite(t)&&Math.floor(t)===t,u.joinValues=function(t,r=" | "){return t.map(t=>"string"==typeof t?`'${t}'`:t).join(r)},u.jsonStringifyReplacer=(t,r)=>"bigint"==typeof r?r.toString():r,(a||(a={})).mergeShapes=(t,r)=>({...t,...r});let p=i.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),f=t=>{switch(typeof t){case"undefined":return p.undefined;case"string":return p.string;case"number":return Number.isNaN(t)?p.nan:p.number;case"boolean":return p.boolean;case"function":return p.function;case"bigint":return p.bigint;case"symbol":return p.symbol;case"object":if(Array.isArray(t))return p.array;if(null===t)return p.null;if(t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch)return p.promise;if("u">typeof Map&&t instanceof Map)return p.map;if("u">typeof Set&&t instanceof Set)return p.set;if("u">typeof Date&&t instanceof Date)return p.date;return p.object;default:return p.unknown}},h=i.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"]);class m extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=t=>{this.issues=[...this.issues,t]},this.addIssues=(t=[])=>{this.issues=[...this.issues,...t]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(t){return t.message},n={_errors:[]},i=t=>{for(let a of t.issues)if("invalid_union"===a.code)a.unionErrors.map(i);else if("invalid_return_type"===a.code)i(a.returnTypeError);else if("invalid_arguments"===a.code)i(a.argumentsError);else if(0===a.path.length)n._errors.push(r(a));else{let t=n,i=0;for(;i<a.path.length;){let n=a.path[i],s=i===a.path.length-1;if("_errors"===n){s&&t._errors.push(r(a)),i++;continue}Object.prototype.hasOwnProperty.call(t,n)||("__proto__"===n?Object.defineProperty(t,n,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):t[n]={_errors:[]}),t=t[n],s&&t._errors.push(r(a)),i++}}};return i(this),n}static assert(t){if(!(t instanceof m))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,i.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(t=t=>t.message){let r=Object.create(null),n=[];for(let i of this.issues)if(i.path.length>0){let n=i.path[0];r[n]=r[n]||[],r[n].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}m.create=t=>new m(t);let y=(t,r)=>{let n;switch(t.code){case h.invalid_type:n=t.received===p.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case h.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,i.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:n=`Unrecognized key(s) in object: ${i.joinValues(t.keys,", ")}`;break;case h.invalid_union:n="Invalid input";break;case h.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${i.joinValues(t.options)}`;break;case h.invalid_enum_value:n=`Invalid enum value. Expected ${i.joinValues(t.options)}, received '${t.received}'`;break;case h.invalid_arguments:n="Invalid function arguments";break;case h.invalid_return_type:n="Invalid function return type";break;case h.invalid_date:n="Invalid date";break;case h.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:i.assertNever(t.validation):n="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case h.too_small:n="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type||"bigint"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case h.too_big:n="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case h.custom:n="Invalid input";break;case h.invalid_intersection_types:n="Intersection results could not be merged";break;case h.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case h.not_finite:n="Number must be finite";break;default:n=r.defaultError,i.assertNever(t)}return{message:n}};(l=s||(s={})).errToObj=t=>"string"==typeof t?{message:t}:t||{},l.toString=t=>"string"==typeof t?t:t?.message;let _=t=>{let{data:r,path:n,errorMaps:i,issueData:a}=t,s=[...n,...a.path||[]],o={...a,path:s};if(void 0!==a.message)return{...a,path:s,message:a.message};let u="";for(let t of i.filter(t=>!!t).slice().reverse())u=t(o,{data:r,defaultError:u}).message;return{...a,path:s,message:u}};function g(t,r){let n=_({issueData:r,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,y,void 0].filter(t=>!!t)});t.common.issues.push(n)}class v{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if("aborted"===i.status)return b;"dirty"===i.status&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let t of r){let r=await t.key,i=await t.value;n.push({key:r,value:i})}return v.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:r,value:a}=i;if("aborted"===r.status||"aborted"===a.status)return b;"dirty"===r.status&&t.dirty(),"dirty"===a.status&&t.dirty(),"__proto__"!==r.value&&(void 0!==a.value||i.alwaysSet)&&(n[r.value]=a.value)}return{status:t.value,value:n}}}let b=Object.freeze({status:"aborted"}),k=t=>({status:"dirty",value:t}),w=t=>({status:"valid",value:t}),x=t=>"u">typeof Promise&&t instanceof Promise;class z{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let O=(t,r)=>{if("valid"===r.status)return{success:!0,data:r.value};if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new m(t.common.issues);return this._error=r,this._error}}};function $(t){if(!t)return{};let{errorMap:r,invalid_type_error:n,required_error:i,description:a}=t;if(r&&(n||i))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return r?{errorMap:r,description:a}:{errorMap:(r,a)=>{let{message:s}=t;return"invalid_enum_value"===r.code?{message:s??a.defaultError}:void 0===a.data?{message:s??i??a.defaultError}:"invalid_type"!==r.code?{message:a.defaultError}:{message:s??n??a.defaultError}},description:a}}class S{get description(){return this._def.description}_getType(t){return f(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:f(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new v,ctx:{common:t.parent.common,data:t.data,parsedType:f(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(x(r))throw Error("Synchronous parse encountered promise.");return r}_parseAsync(t){return Promise.resolve(this._parse(t))}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:f(t)},i=this._parseSync({data:t,path:n.path,parent:n});return O(n,i)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:f(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return"valid"===n.status?{value:n.value}:{issues:r.common.issues}}catch(t){t?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(t=>"valid"===t.status?{value:t.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:f(t)},i=this._parse({data:t,path:n.path,parent:n});return O(n,await (x(i)?i:Promise.resolve(i)))}refine(t,r){return this._refinement((n,i)=>{let a=t(n),s=()=>i.addIssue({code:h.custom,..."string"==typeof r||void 0===r?{message:r}:"function"==typeof r?r(n):r});return"u">typeof Promise&&a instanceof Promise?a.then(t=>!!t||(s(),!1)):!!a||(s(),!1)})}refinement(t,r){return this._refinement((n,i)=>!!t(n)||(i.addIssue("function"==typeof r?r(n,i):r),!1))}_refinement(t){return new eb({schema:this,typeName:o.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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:t=>this["~validate"](t)}}optional(){return ek.create(this,this._def)}nullable(){return ew.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return en.create(this)}promise(){return ev.create(this,this._def)}or(t){return ea.create([this,t],this._def)}and(t){return eu.create(this,t,this._def)}transform(t){return new eb({...$(this._def),schema:this,typeName:o.ZodEffects,effect:{type:"transform",transform:t}})}default(t){return new ex({...$(this._def),innerType:this,defaultValue:"function"==typeof t?t:()=>t,typeName:o.ZodDefault})}brand(){return new e$({typeName:o.ZodBranded,type:this,...$(this._def)})}catch(t){return new ez({...$(this._def),innerType:this,catchValue:"function"==typeof t?t:()=>t,typeName:o.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return eS.create(this,t)}readonly(){return eZ.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let Z=/^c[^\s-]{8,}$/i,T=/^[0-9a-z]+$/,j=/^[0-9A-HJKMNP-TV-Z]{26}$/i,A=/^[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,P=/^[a-z0-9_-]{21}$/i,E=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,N=/^[-+]?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)?)??$/,I=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,C=/^(?:(?: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])$/,R=/^(?:(?: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])$/,F=/^(([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]))$/,M=/^(([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])$/,D=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,L=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,U="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",J=RegExp(`^${U}$`);function V(t){let r="[0-5]\\d";t.precision?r=`${r}\\.\\d{${t.precision}}`:null==t.precision&&(r=`${r}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${r})${n}`}class K extends S{_parse(t){var r,n,a,s;let o;if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==p.string){let r=this._getOrReturnCtx(t);return g(r,{code:h.invalid_type,expected:p.string,received:r.parsedType}),b}let u=new v;for(let l of this._def.checks)if("min"===l.kind)t.data.length<l.value&&(g(o=this._getOrReturnCtx(t,o),{code:h.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),u.dirty());else if("max"===l.kind)t.data.length>l.value&&(g(o=this._getOrReturnCtx(t,o),{code:h.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),u.dirty());else if("length"===l.kind){let r=t.data.length>l.value,n=t.data.length<l.value;(r||n)&&(o=this._getOrReturnCtx(t,o),r?g(o,{code:h.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):n&&g(o,{code:h.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),u.dirty())}else if("email"===l.kind)I.test(t.data)||(g(o=this._getOrReturnCtx(t,o),{validation:"email",code:h.invalid_string,message:l.message}),u.dirty());else if("emoji"===l.kind)c||(c=RegExp("^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")),c.test(t.data)||(g(o=this._getOrReturnCtx(t,o),{validation:"emoji",code:h.invalid_string,message:l.message}),u.dirty());else if("uuid"===l.kind)A.test(t.data)||(g(o=this._getOrReturnCtx(t,o),{validation:"uuid",code:h.invalid_string,message:l.message}),u.dirty());else if("nanoid"===l.kind)P.test(t.data)||(g(o=this._getOrReturnCtx(t,o),{validation:"nanoid",code:h.invalid_string,message:l.message}),u.dirty());else if("cuid"===l.kind)Z.test(t.data)||(g(o=this._getOrReturnCtx(t,o),{validation:"cuid",code:h.invalid_string,message:l.message}),u.dirty());else if("cuid2"===l.kind)T.test(t.data)||(g(o=this._getOrReturnCtx(t,o),{validation:"cuid2",code:h.invalid_string,message:l.message}),u.dirty());else if("ulid"===l.kind)j.test(t.data)||(g(o=this._getOrReturnCtx(t,o),{validation:"ulid",code:h.invalid_string,message:l.message}),u.dirty());else if("url"===l.kind)try{new URL(t.data)}catch{g(o=this._getOrReturnCtx(t,o),{validation:"url",code:h.invalid_string,message:l.message}),u.dirty()}else"regex"===l.kind?(l.regex.lastIndex=0,l.regex.test(t.data)||(g(o=this._getOrReturnCtx(t,o),{validation:"regex",code:h.invalid_string,message:l.message}),u.dirty())):"trim"===l.kind?t.data=t.data.trim():"includes"===l.kind?t.data.includes(l.value,l.position)||(g(o=this._getOrReturnCtx(t,o),{code:h.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),u.dirty()):"toLowerCase"===l.kind?t.data=t.data.toLowerCase():"toUpperCase"===l.kind?t.data=t.data.toUpperCase():"startsWith"===l.kind?t.data.startsWith(l.value)||(g(o=this._getOrReturnCtx(t,o),{code:h.invalid_string,validation:{startsWith:l.value},message:l.message}),u.dirty()):"endsWith"===l.kind?t.data.endsWith(l.value)||(g(o=this._getOrReturnCtx(t,o),{code:h.invalid_string,validation:{endsWith:l.value},message:l.message}),u.dirty()):"datetime"===l.kind?(function(t){let r=`${U}T${V(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),r=`${r}(${n.join("|")})`,RegExp(`^${r}$`)})(l).test(t.data)||(g(o=this._getOrReturnCtx(t,o),{code:h.invalid_string,validation:"datetime",message:l.message}),u.dirty()):"date"===l.kind?J.test(t.data)||(g(o=this._getOrReturnCtx(t,o),{code:h.invalid_string,validation:"date",message:l.message}),u.dirty()):"time"===l.kind?RegExp(`^${V(l)}$`).test(t.data)||(g(o=this._getOrReturnCtx(t,o),{code:h.invalid_string,validation:"time",message:l.message}),u.dirty()):"duration"===l.kind?N.test(t.data)||(g(o=this._getOrReturnCtx(t,o),{validation:"duration",code:h.invalid_string,message:l.message}),u.dirty()):"ip"===l.kind?(r=t.data,!(("v4"===(n=l.version)||!n)&&C.test(r)||("v6"===n||!n)&&F.test(r))&&1&&(g(o=this._getOrReturnCtx(t,o),{validation:"ip",code:h.invalid_string,message:l.message}),u.dirty())):"jwt"===l.kind?!function(t,r){if(!E.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(i));if("object"!=typeof a||null===a||"typ"in a&&a?.typ!=="JWT"||!a.alg||r&&a.alg!==r)return!1;return!0}catch{return!1}}(t.data,l.alg)&&(g(o=this._getOrReturnCtx(t,o),{validation:"jwt",code:h.invalid_string,message:l.message}),u.dirty()):"cidr"===l.kind?(a=t.data,!(("v4"===(s=l.version)||!s)&&R.test(a)||("v6"===s||!s)&&M.test(a))&&1&&(g(o=this._getOrReturnCtx(t,o),{validation:"cidr",code:h.invalid_string,message:l.message}),u.dirty())):"base64"===l.kind?D.test(t.data)||(g(o=this._getOrReturnCtx(t,o),{validation:"base64",code:h.invalid_string,message:l.message}),u.dirty()):"base64url"===l.kind?L.test(t.data)||(g(o=this._getOrReturnCtx(t,o),{validation:"base64url",code:h.invalid_string,message:l.message}),u.dirty()):i.assertNever(l);return{status:u.value,value:t.data}}_regex(t,r,n){return this.refinement(r=>t.test(r),{validation:r,code:h.invalid_string,...s.errToObj(n)})}_addCheck(t){return new K({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...s.errToObj(t)})}url(t){return this._addCheck({kind:"url",...s.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...s.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...s.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...s.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...s.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...s.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...s.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...s.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...s.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...s.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...s.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...s.errToObj(t)})}datetime(t){return"string"==typeof t?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:void 0===t?.precision?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...s.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return"string"==typeof t?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:void 0===t?.precision?null:t?.precision,...s.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...s.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...s.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...s.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...s.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...s.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...s.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...s.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...s.errToObj(r)})}nonempty(t){return this.min(1,s.errToObj(t))}trim(){return new K({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new K({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new K({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>"datetime"===t.kind)}get isDate(){return!!this._def.checks.find(t=>"date"===t.kind)}get isTime(){return!!this._def.checks.find(t=>"time"===t.kind)}get isDuration(){return!!this._def.checks.find(t=>"duration"===t.kind)}get isEmail(){return!!this._def.checks.find(t=>"email"===t.kind)}get isURL(){return!!this._def.checks.find(t=>"url"===t.kind)}get isEmoji(){return!!this._def.checks.find(t=>"emoji"===t.kind)}get isUUID(){return!!this._def.checks.find(t=>"uuid"===t.kind)}get isNANOID(){return!!this._def.checks.find(t=>"nanoid"===t.kind)}get isCUID(){return!!this._def.checks.find(t=>"cuid"===t.kind)}get isCUID2(){return!!this._def.checks.find(t=>"cuid2"===t.kind)}get isULID(){return!!this._def.checks.find(t=>"ulid"===t.kind)}get isIP(){return!!this._def.checks.find(t=>"ip"===t.kind)}get isCIDR(){return!!this._def.checks.find(t=>"cidr"===t.kind)}get isBase64(){return!!this._def.checks.find(t=>"base64"===t.kind)}get isBase64url(){return!!this._def.checks.find(t=>"base64url"===t.kind)}get minLength(){let t=null;for(let r of this._def.checks)"min"===r.kind&&(null===t||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)"max"===r.kind&&(null===t||r.value<t)&&(t=r.value);return t}}K.create=t=>new K({checks:[],typeName:o.ZodString,coerce:t?.coerce??!1,...$(t)});class W extends S{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){let r;if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==p.number){let r=this._getOrReturnCtx(t);return g(r,{code:h.invalid_type,expected:p.number,received:r.parsedType}),b}let n=new v;for(let a of this._def.checks)"int"===a.kind?i.isInteger(t.data)||(g(r=this._getOrReturnCtx(t,r),{code:h.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):"min"===a.kind?(a.inclusive?t.data<a.value:t.data<=a.value)&&(g(r=this._getOrReturnCtx(t,r),{code:h.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):"max"===a.kind?(a.inclusive?t.data>a.value:t.data>=a.value)&&(g(r=this._getOrReturnCtx(t,r),{code:h.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):"multipleOf"===a.kind?0!==function(t,r){let n=(t.toString().split(".")[1]||"").length,i=(r.toString().split(".")[1]||"").length,a=n>i?n:i;return Number.parseInt(t.toFixed(a).replace(".",""))%Number.parseInt(r.toFixed(a).replace(".",""))/10**a}(t.data,a.value)&&(g(r=this._getOrReturnCtx(t,r),{code:h.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):"finite"===a.kind?Number.isFinite(t.data)||(g(r=this._getOrReturnCtx(t,r),{code:h.not_finite,message:a.message}),n.dirty()):i.assertNever(a);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,s.toString(r))}gt(t,r){return this.setLimit("min",t,!1,s.toString(r))}lte(t,r){return this.setLimit("max",t,!0,s.toString(r))}lt(t,r){return this.setLimit("max",t,!1,s.toString(r))}setLimit(t,r,n,i){return new W({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:s.toString(i)}]})}_addCheck(t){return new W({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:s.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:s.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:s.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:s.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:s.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:s.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:s.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:s.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:s.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)"min"===r.kind&&(null===t||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)"max"===r.kind&&(null===t||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>"int"===t.kind||"multipleOf"===t.kind&&i.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks)if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;else"min"===n.kind?(null===r||n.value>r)&&(r=n.value):"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return Number.isFinite(r)&&Number.isFinite(t)}}W.create=t=>new W({checks:[],typeName:o.ZodNumber,coerce:t?.coerce||!1,...$(t)});class B extends S{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){let r;if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==p.bigint)return this._getInvalidInput(t);let n=new v;for(let a of this._def.checks)"min"===a.kind?(a.inclusive?t.data<a.value:t.data<=a.value)&&(g(r=this._getOrReturnCtx(t,r),{code:h.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):"max"===a.kind?(a.inclusive?t.data>a.value:t.data>=a.value)&&(g(r=this._getOrReturnCtx(t,r),{code:h.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):"multipleOf"===a.kind?t.data%a.value!==BigInt(0)&&(g(r=this._getOrReturnCtx(t,r),{code:h.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):i.assertNever(a);return{status:n.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return g(r,{code:h.invalid_type,expected:p.bigint,received:r.parsedType}),b}gte(t,r){return this.setLimit("min",t,!0,s.toString(r))}gt(t,r){return this.setLimit("min",t,!1,s.toString(r))}lte(t,r){return this.setLimit("max",t,!0,s.toString(r))}lt(t,r){return this.setLimit("max",t,!1,s.toString(r))}setLimit(t,r,n,i){return new B({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:s.toString(i)}]})}_addCheck(t){return new B({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:s.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:s.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:s.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:s.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:s.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)"min"===r.kind&&(null===t||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)"max"===r.kind&&(null===t||r.value<t)&&(t=r.value);return t}}B.create=t=>new B({checks:[],typeName:o.ZodBigInt,coerce:t?.coerce??!1,...$(t)});class q extends S{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==p.boolean){let r=this._getOrReturnCtx(t);return g(r,{code:h.invalid_type,expected:p.boolean,received:r.parsedType}),b}return w(t.data)}}q.create=t=>new q({typeName:o.ZodBoolean,coerce:t?.coerce||!1,...$(t)});class G extends S{_parse(t){let r;if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==p.date){let r=this._getOrReturnCtx(t);return g(r,{code:h.invalid_type,expected:p.date,received:r.parsedType}),b}if(Number.isNaN(t.data.getTime()))return g(this._getOrReturnCtx(t),{code:h.invalid_date}),b;let n=new v;for(let a of this._def.checks)"min"===a.kind?t.data.getTime()<a.value&&(g(r=this._getOrReturnCtx(t,r),{code:h.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):"max"===a.kind?t.data.getTime()>a.value&&(g(r=this._getOrReturnCtx(t,r),{code:h.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):i.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new G({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:s.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:s.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)"min"===r.kind&&(null===t||r.value>t)&&(t=r.value);return null!=t?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)"max"===r.kind&&(null===t||r.value<t)&&(t=r.value);return null!=t?new Date(t):null}}G.create=t=>new G({checks:[],coerce:t?.coerce||!1,typeName:o.ZodDate,...$(t)});class Y extends S{_parse(t){if(this._getType(t)!==p.symbol){let r=this._getOrReturnCtx(t);return g(r,{code:h.invalid_type,expected:p.symbol,received:r.parsedType}),b}return w(t.data)}}Y.create=t=>new Y({typeName:o.ZodSymbol,...$(t)});class X extends S{_parse(t){if(this._getType(t)!==p.undefined){let r=this._getOrReturnCtx(t);return g(r,{code:h.invalid_type,expected:p.undefined,received:r.parsedType}),b}return w(t.data)}}X.create=t=>new X({typeName:o.ZodUndefined,...$(t)});class H extends S{_parse(t){if(this._getType(t)!==p.null){let r=this._getOrReturnCtx(t);return g(r,{code:h.invalid_type,expected:p.null,received:r.parsedType}),b}return w(t.data)}}H.create=t=>new H({typeName:o.ZodNull,...$(t)});class Q extends S{constructor(){super(...arguments),this._any=!0}_parse(t){return w(t.data)}}Q.create=t=>new Q({typeName:o.ZodAny,...$(t)});class ee extends S{constructor(){super(...arguments),this._unknown=!0}_parse(t){return w(t.data)}}ee.create=t=>new ee({typeName:o.ZodUnknown,...$(t)});class et extends S{_parse(t){let r=this._getOrReturnCtx(t);return g(r,{code:h.invalid_type,expected:p.never,received:r.parsedType}),b}}et.create=t=>new et({typeName:o.ZodNever,...$(t)});class er extends S{_parse(t){if(this._getType(t)!==p.undefined){let r=this._getOrReturnCtx(t);return g(r,{code:h.invalid_type,expected:p.void,received:r.parsedType}),b}return w(t.data)}}er.create=t=>new er({typeName:o.ZodVoid,...$(t)});class en extends S{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==p.array)return g(r,{code:h.invalid_type,expected:p.array,received:r.parsedType}),b;if(null!==i.exactLength){let t=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(t||a)&&(g(r,{code:t?h.too_big:h.too_small,minimum:a?i.exactLength.value:void 0,maximum:t?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(null!==i.minLength&&r.data.length<i.minLength.value&&(g(r,{code:h.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),null!==i.maxLength&&r.data.length>i.maxLength.value&&(g(r,{code:h.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((t,n)=>i.type._parseAsync(new z(r,t,r.path,n)))).then(t=>v.mergeArray(n,t));let a=[...r.data].map((t,n)=>i.type._parseSync(new z(r,t,r.path,n)));return v.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new en({...this._def,minLength:{value:t,message:s.toString(r)}})}max(t,r){return new en({...this._def,maxLength:{value:t,message:s.toString(r)}})}length(t,r){return new en({...this._def,exactLength:{value:t,message:s.toString(r)}})}nonempty(t){return this.min(1,t)}}en.create=(t,r)=>new en({type:t,minLength:null,maxLength:null,exactLength:null,typeName:o.ZodArray,...$(r)});class ei extends S{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let t=this._def.shape(),r=i.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==p.object){let r=this._getOrReturnCtx(t);return g(r,{code:h.invalid_type,expected:p.object,received:r.parsedType}),b}let{status:r,ctx:n}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof et&&"strip"===this._def.unknownKeys))for(let t in n.data)a.includes(t)||s.push(t);let o=[];for(let t of a){let r=i[t],a=n.data[t];o.push({key:{status:"valid",value:t},value:r._parse(new z(n,a,n.path,t)),alwaysSet:t in n.data})}if(this._def.catchall instanceof et){let t=this._def.unknownKeys;if("passthrough"===t)for(let t of s)o.push({key:{status:"valid",value:t},value:{status:"valid",value:n.data[t]}});else if("strict"===t)s.length>0&&(g(n,{code:h.unrecognized_keys,keys:s}),r.dirty());else if("strip"===t);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let t=this._def.catchall;for(let r of s){let i=n.data[r];o.push({key:{status:"valid",value:r},value:t._parse(new z(n,i,n.path,r)),alwaysSet:r in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let t=[];for(let r of o){let n=await r.key,i=await r.value;t.push({key:n,value:i,alwaysSet:r.alwaysSet})}return t}).then(t=>v.mergeObjectSync(r,t)):v.mergeObjectSync(r,o)}get shape(){return this._def.shape()}strict(t){return s.errToObj,new ei({...this._def,unknownKeys:"strict",...void 0!==t?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return"unrecognized_keys"===r.code?{message:s.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new ei({...this._def,unknownKeys:"strip"})}passthrough(){return new ei({...this._def,unknownKeys:"passthrough"})}extend(t){return new ei({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ei({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:o.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new ei({...this._def,catchall:t})}pick(t){let r={};for(let n of i.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new ei({...this._def,shape:()=>r})}omit(t){let r={};for(let n of i.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new ei({...this._def,shape:()=>r})}deepPartial(){return function t(r){if(r instanceof ei){let n={};for(let i in r.shape){let a=r.shape[i];n[i]=ek.create(t(a))}return new ei({...r._def,shape:()=>n})}if(r instanceof en)return new en({...r._def,type:t(r.element)});if(r instanceof ek)return ek.create(t(r.unwrap()));if(r instanceof ew)return ew.create(t(r.unwrap()));if(r instanceof el)return el.create(r.items.map(r=>t(r)));else return r}(this)}partial(t){let r={};for(let n of i.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new ei({...this._def,shape:()=>r})}required(t){let r={};for(let n of i.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let t=this.shape[n];for(;t instanceof ek;)t=t._def.innerType;r[n]=t}return new ei({...this._def,shape:()=>r})}keyof(){return ey(i.objectKeys(this.shape))}}ei.create=(t,r)=>new ei({shape:()=>t,unknownKeys:"strip",catchall:et.create(),typeName:o.ZodObject,...$(r)}),ei.strictCreate=(t,r)=>new ei({shape:()=>t,unknownKeys:"strict",catchall:et.create(),typeName:o.ZodObject,...$(r)}),ei.lazycreate=(t,r)=>new ei({shape:t,unknownKeys:"strip",catchall:et.create(),typeName:o.ZodObject,...$(r)});class ea extends S{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;if(r.common.async)return Promise.all(n.map(async t=>{let n={...r,common:{...r.common,issues:[]},parent:null};return{result:await t._parseAsync({data:r.data,path:r.path,parent:n}),ctx:n}})).then(function(t){for(let r of t)if("valid"===r.result.status)return r.result;for(let n of t)if("dirty"===n.result.status)return r.common.issues.push(...n.ctx.common.issues),n.result;let n=t.map(t=>new m(t.ctx.common.issues));return g(r,{code:h.invalid_union,unionErrors:n}),b});{let t,i=[];for(let a of n){let n={...r,common:{...r.common,issues:[]},parent:null},s=a._parseSync({data:r.data,path:r.path,parent:n});if("valid"===s.status)return s;"dirty"!==s.status||t||(t={result:s,ctx:n}),n.common.issues.length&&i.push(n.common.issues)}if(t)return r.common.issues.push(...t.ctx.common.issues),t.result;let a=i.map(t=>new m(t));return g(r,{code:h.invalid_union,unionErrors:a}),b}}get options(){return this._def.options}}ea.create=(t,r)=>new ea({options:t,typeName:o.ZodUnion,...$(r)});let es=t=>{if(t instanceof eh)return es(t.schema);if(t instanceof eb)return es(t.innerType());if(t instanceof em)return[t.value];if(t instanceof e_)return t.options;if(t instanceof eg)return i.objectValues(t.enum);else if(t instanceof ex)return es(t._def.innerType);else if(t instanceof X)return[void 0];else if(t instanceof H)return[null];else if(t instanceof ek)return[void 0,...es(t.unwrap())];else if(t instanceof ew)return[null,...es(t.unwrap())];else if(t instanceof e$)return es(t.unwrap());else if(t instanceof eZ)return es(t.unwrap());else if(t instanceof ez)return es(t._def.innerType);else return[]};class eo extends S{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==p.object)return g(r,{code:h.invalid_type,expected:p.object,received:r.parsedType}),b;let n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(g(r,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),b)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let i=new Map;for(let n of r){let r=es(n.shape[t]);if(!r.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of r){if(i.has(a))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,n)}}return new eo({typeName:o.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...$(n)})}}class eu extends S{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=(t,a)=>{if("aborted"===t.status||"aborted"===a.status)return b;let s=function t(r,n){let a=f(r),s=f(n);if(r===n)return{valid:!0,data:r};if(a===p.object&&s===p.object){let a=i.objectKeys(n),s=i.objectKeys(r).filter(t=>-1!==a.indexOf(t)),o={...r,...n};for(let i of(Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__,s)){if("__proto__"===i)continue;let a=t(r[i],n[i]);if(!a.valid)return{valid:!1};o[i]=a.data}return{valid:!0,data:o}}if(a===p.array&&s===p.array){if(r.length!==n.length)return{valid:!1};let i=[];for(let a=0;a<r.length;a++){let s=t(r[a],n[a]);if(!s.valid)return{valid:!1};i.push(s.data)}return{valid:!0,data:i}}if(a===p.date&&s===p.date&&+r==+n)return{valid:!0,data:r};return{valid:!1}}(t.value,a.value);return s.valid?(("dirty"===t.status||"dirty"===a.status)&&r.dirty(),{status:r.value,value:s.data}):(g(n,{code:h.invalid_intersection_types}),b)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([t,r])=>a(t,r)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}eu.create=(t,r,n)=>new eu({left:t,right:r,typeName:o.ZodIntersection,...$(n)});class el extends S{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==p.array)return g(n,{code:h.invalid_type,expected:p.array,received:n.parsedType}),b;if(n.data.length<this._def.items.length)return g(n,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b;!this._def.rest&&n.data.length>this._def.items.length&&(g(n,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((t,r)=>{let i=this._def.items[r]||this._def.rest;return i?i._parse(new z(n,t,n.path,r)):null}).filter(t=>!!t);return n.common.async?Promise.all(i).then(t=>v.mergeArray(r,t)):v.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new el({...this._def,rest:t})}}el.create=(t,r)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new el({items:t,typeName:o.ZodTuple,rest:null,...$(r)})};class ed extends S{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==p.object)return g(n,{code:h.invalid_type,expected:p.object,received:n.parsedType}),b;let i=[],a=this._def.keyType,s=this._def.valueType;for(let t in n.data)i.push({key:a._parse(new z(n,t,n.path,t)),value:s._parse(new z(n,n.data[t],n.path,t)),alwaysSet:t in n.data});return n.common.async?v.mergeObjectAsync(r,i):v.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return new ed(r instanceof S?{keyType:t,valueType:r,typeName:o.ZodRecord,...$(n)}:{keyType:K.create(),valueType:t,typeName:o.ZodRecord,...$(r)})}}class ec extends S{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==p.map)return g(n,{code:h.invalid_type,expected:p.map,received:n.parsedType}),b;let i=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map(([t,r],s)=>({key:i._parse(new z(n,t,n.path,[s,"key"])),value:a._parse(new z(n,r,n.path,[s,"value"]))}));if(n.common.async){let t=new Map;return Promise.resolve().then(async()=>{for(let n of s){let i=await n.key,a=await n.value;if("aborted"===i.status||"aborted"===a.status)return b;("dirty"===i.status||"dirty"===a.status)&&r.dirty(),t.set(i.value,a.value)}return{status:r.value,value:t}})}{let t=new Map;for(let n of s){let i=n.key,a=n.value;if("aborted"===i.status||"aborted"===a.status)return b;("dirty"===i.status||"dirty"===a.status)&&r.dirty(),t.set(i.value,a.value)}return{status:r.value,value:t}}}}ec.create=(t,r,n)=>new ec({valueType:r,keyType:t,typeName:o.ZodMap,...$(n)});class ep extends S{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==p.set)return g(n,{code:h.invalid_type,expected:p.set,received:n.parsedType}),b;let i=this._def;null!==i.minSize&&n.data.size<i.minSize.value&&(g(n,{code:h.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),null!==i.maxSize&&n.data.size>i.maxSize.value&&(g(n,{code:h.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let a=this._def.valueType;function s(t){let n=new Set;for(let i of t){if("aborted"===i.status)return b;"dirty"===i.status&&r.dirty(),n.add(i.value)}return{status:r.value,value:n}}let o=[...n.data.values()].map((t,r)=>a._parse(new z(n,t,n.path,r)));return n.common.async?Promise.all(o).then(t=>s(t)):s(o)}min(t,r){return new ep({...this._def,minSize:{value:t,message:s.toString(r)}})}max(t,r){return new ep({...this._def,maxSize:{value:t,message:s.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}ep.create=(t,r)=>new ep({valueType:t,minSize:null,maxSize:null,typeName:o.ZodSet,...$(r)});class ef extends S{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==p.function)return g(r,{code:h.invalid_type,expected:p.function,received:r.parsedType}),b;function n(t,n){return _({data:t,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,y,y].filter(t=>!!t),issueData:{code:h.invalid_arguments,argumentsError:n}})}function i(t,n){return _({data:t,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,y,y].filter(t=>!!t),issueData:{code:h.invalid_return_type,returnTypeError:n}})}let a={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof ev){let t=this;return w(async function(...r){let o=new m([]),u=await t._def.args.parseAsync(r,a).catch(t=>{throw o.addIssue(n(r,t)),o}),l=await Reflect.apply(s,this,u);return await t._def.returns._def.type.parseAsync(l,a).catch(t=>{throw o.addIssue(i(l,t)),o})})}{let t=this;return w(function(...r){let o=t._def.args.safeParse(r,a);if(!o.success)throw new m([n(r,o.error)]);let u=Reflect.apply(s,this,o.data),l=t._def.returns.safeParse(u,a);if(!l.success)throw new m([i(u,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ef({...this._def,args:el.create(t).rest(ee.create())})}returns(t){return new ef({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new ef({args:t||el.create([]).rest(ee.create()),returns:r||ee.create(),typeName:o.ZodFunction,...$(n)})}}class eh extends S{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}eh.create=(t,r)=>new eh({getter:t,typeName:o.ZodLazy,...$(r)});class em extends S{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return g(r,{received:r.data,code:h.invalid_literal,expected:this._def.value}),b}return{status:"valid",value:t.data}}get value(){return this._def.value}}function ey(t,r){return new e_({values:t,typeName:o.ZodEnum,...$(r)})}em.create=(t,r)=>new em({value:t,typeName:o.ZodLiteral,...$(r)});class e_ extends S{_parse(t){if("string"!=typeof t.data){let r=this._getOrReturnCtx(t),n=this._def.values;return g(r,{expected:i.joinValues(n),received:r.parsedType,code:h.invalid_type}),b}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return g(r,{received:r.data,code:h.invalid_enum_value,options:n}),b}return w(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e_.create(t,{...this._def,...r})}exclude(t,r=this._def){return e_.create(this.options.filter(r=>!t.includes(r)),{...this._def,...r})}}e_.create=ey;class eg extends S{_parse(t){let r=i.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==p.string&&n.parsedType!==p.number){let t=i.objectValues(r);return g(n,{expected:i.joinValues(t),received:n.parsedType,code:h.invalid_type}),b}if(this._cache||(this._cache=new Set(i.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let t=i.objectValues(r);return g(n,{received:n.data,code:h.invalid_enum_value,options:t}),b}return w(t.data)}get enum(){return this._def.values}}eg.create=(t,r)=>new eg({values:t,typeName:o.ZodNativeEnum,...$(r)});class ev extends S{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);return r.parsedType!==p.promise&&!1===r.common.async?(g(r,{code:h.invalid_type,expected:p.promise,received:r.parsedType}),b):w((r.parsedType===p.promise?r.data:Promise.resolve(r.data)).then(t=>this._def.type.parseAsync(t,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ev.create=(t,r)=>new ev({type:t,typeName:o.ZodPromise,...$(r)});class eb extends S{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===o.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,s={addIssue:t=>{g(n,t),t.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===a.type){let t=a.transform(n.data,s);if(n.common.async)return Promise.resolve(t).then(async t=>{if("aborted"===r.value)return b;let i=await this._def.schema._parseAsync({data:t,path:n.path,parent:n});return"aborted"===i.status?b:"dirty"===i.status||"dirty"===r.value?k(i.value):i});{if("aborted"===r.value)return b;let i=this._def.schema._parseSync({data:t,path:n.path,parent:n});return"aborted"===i.status?b:"dirty"===i.status||"dirty"===r.value?k(i.value):i}}if("refinement"===a.type){let t=t=>{let r=a.refinement(t,s);if(n.common.async)return Promise.resolve(r);if(r instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return t};if(!1!==n.common.async)return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>"aborted"===n.status?b:("dirty"===n.status&&r.dirty(),t(n.value).then(()=>({status:r.value,value:n.value}))));{let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===i.status?b:("dirty"===i.status&&r.dirty(),t(i.value),{status:r.value,value:i.value})}}if("transform"===a.type)if(!1!==n.common.async)return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(t=>"valid"!==t.status?b:Promise.resolve(a.transform(t.value,s)).then(t=>({status:r.value,value:t})));else{let t=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if("valid"!==t.status)return b;let i=a.transform(t.value,s);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:i}}i.assertNever(a)}}eb.create=(t,r,n)=>new eb({schema:t,typeName:o.ZodEffects,effect:r,...$(n)}),eb.createWithPreprocess=(t,r,n)=>new eb({schema:r,effect:{type:"preprocess",transform:t},typeName:o.ZodEffects,...$(n)});class ek extends S{_parse(t){return this._getType(t)===p.undefined?w(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ek.create=(t,r)=>new ek({innerType:t,typeName:o.ZodOptional,...$(r)});class ew extends S{_parse(t){return this._getType(t)===p.null?w(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ew.create=(t,r)=>new ew({innerType:t,typeName:o.ZodNullable,...$(r)});class ex extends S{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===p.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ex.create=(t,r)=>new ex({innerType:t,typeName:o.ZodDefault,defaultValue:"function"==typeof r.default?r.default:()=>r.default,...$(r)});class ez extends S{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return x(i)?i.then(t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new m(n.common.issues)},input:n.data})})):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new m(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ez.create=(t,r)=>new ez({innerType:t,typeName:o.ZodCatch,catchValue:"function"==typeof r.catch?r.catch:()=>r.catch,...$(r)});class eO extends S{_parse(t){if(this._getType(t)!==p.nan){let r=this._getOrReturnCtx(t);return g(r,{code:h.invalid_type,expected:p.nan,received:r.parsedType}),b}return{status:"valid",value:t.data}}}eO.create=t=>new eO({typeName:o.ZodNaN,...$(t)}),Symbol("zod_brand");class e$ extends S{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class eS extends S{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let t=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===t.status?b:"dirty"===t.status?(r.dirty(),k(t.value)):this._def.out._parseAsync({data:t.value,path:n.path,parent:n})})();{let t=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===t.status?b:"dirty"===t.status?(r.dirty(),{status:"dirty",value:t.value}):this._def.out._parseSync({data:t.value,path:n.path,parent:n})}}static create(t,r){return new eS({in:t,out:r,typeName:o.ZodPipeline})}}class eZ extends S{_parse(t){let r=this._def.innerType._parse(t),n=t=>("valid"===t.status&&(t.value=Object.freeze(t.value)),t);return x(r)?r.then(t=>n(t)):n(r)}unwrap(){return this._def.innerType}}eZ.create=(t,r)=>new eZ({innerType:t,typeName:o.ZodReadonly,...$(r)}),ei.lazycreate,(d=o||(o={})).ZodString="ZodString",d.ZodNumber="ZodNumber",d.ZodNaN="ZodNaN",d.ZodBigInt="ZodBigInt",d.ZodBoolean="ZodBoolean",d.ZodDate="ZodDate",d.ZodSymbol="ZodSymbol",d.ZodUndefined="ZodUndefined",d.ZodNull="ZodNull",d.ZodAny="ZodAny",d.ZodUnknown="ZodUnknown",d.ZodNever="ZodNever",d.ZodVoid="ZodVoid",d.ZodArray="ZodArray",d.ZodObject="ZodObject",d.ZodUnion="ZodUnion",d.ZodDiscriminatedUnion="ZodDiscriminatedUnion",d.ZodIntersection="ZodIntersection",d.ZodTuple="ZodTuple",d.ZodRecord="ZodRecord",d.ZodMap="ZodMap",d.ZodSet="ZodSet",d.ZodFunction="ZodFunction",d.ZodLazy="ZodLazy",d.ZodLiteral="ZodLiteral",d.ZodEnum="ZodEnum",d.ZodEffects="ZodEffects",d.ZodNativeEnum="ZodNativeEnum",d.ZodOptional="ZodOptional",d.ZodNullable="ZodNullable",d.ZodDefault="ZodDefault",d.ZodCatch="ZodCatch",d.ZodPromise="ZodPromise",d.ZodBranded="ZodBranded",d.ZodPipeline="ZodPipeline",d.ZodReadonly="ZodReadonly";let eT=K.create;W.create,eO.create,B.create,q.create,G.create,Y.create,X.create,H.create;let ej=Q.create,eA=ee.create;et.create,er.create;let eP=en.create,eE=ei.create;ei.strictCreate;let eN=ea.create;eo.create;let eI=eu.create;el.create;let eC=ed.create;ec.create,ep.create,ef.create;let eR=eh.create,eF=em.create;e_.create,eg.create,ev.create,eb.create,ek.create,ew.create,eb.createWithPreprocess,eS.create},74404(t,r,n){var i,a;let s,o,u,l,d,c,p,f,h,m;function y(t){let r=Object.values(t).filter(t=>"number"==typeof t);return Object.entries(t).filter(([t,n])=>-1===r.indexOf(+t)).map(([t,r])=>r)}function _(t,r="|"){return t.map(t=>F(t)).join(r)}function g(t,r){return"bigint"==typeof r?r.toString():r}n.d(r,{YjP:()=>nz,Ikc:()=>n7,RZV:()=>iz,zMY:()=>n0,g1P:()=>ii,KCZ:()=>ie,ZmZ:()=>n2,aig:()=>nY,euz:()=>iu,k5n:()=>is,YOg:()=>n3});class v{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return void 0!==t&&(this._value=t(),this._getter=void 0),this._value}}function b(t){let r=+!!t.startsWith("^"),n=t.endsWith("$")?t.length-1:t.length;return t.slice(r,n)}let k=Symbol("evaluating");function w(t,r,n){Object.defineProperty(t,r,{value:n,writable:!0,enumerable:!0,configurable:!0})}function x(t){let r=Object.getOwnPropertyDescriptor(t,"shape");return r?.get?r.get.raw:r?.value}function z(t){return x(t._zod.def)??t._zod.def.shape}function O(t,r,n){Object.defineProperty(t,r,{get(){let t=n();return w(this,r,t),t},enumerable:!0,configurable:!0})}function $(t,r,n){r in t?w(t,r,n):t[r]=n}function S(t,r,n,i){let a=z(r);for(let s of n){let n=Object.getOwnPropertyDescriptor(a,s);n.enumerable&&(n.get?O(t,s,()=>{let t=r._zod.def.shape[s];return i?i(t,s):t}):$(t,s,i?i(n.value,s):n.value))}}function Z(...t){let r={};for(let n of t)Object.assign(r,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},r)}let T="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function j(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}let A=new v(()=>{if(el.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(t){return!1}});function P(t){if(!1===j(t))return!1;let r=t.constructor;if(void 0===r||"function"!=typeof r)return!0;let n=r.prototype;return!1!==j(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function E(t){return P(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}let N=new Set(["string","number","symbol"]);function I(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function C(t,r,n){let i=new t._zod.constr(r??t._zod.def);return(!r||n?.parent)&&(i._zod.parent=t),i}function R(t){if(!t)return{};if("string"==typeof t)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return(delete t.message,"string"==typeof t.error)?{...t,error:()=>t.error}:t}function F(t){return"bigint"==typeof t?t.toString()+"n":"string"==typeof t?`"${t}"`:`${t}`}let M={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},D={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function L(t,r){let n=z(t),i=[];for(let t of Reflect.ownKeys(r)){if(!Object.getOwnPropertyDescriptor(n,t)?.enumerable)throw Error(`Unrecognized key: "${String(t)}"`);r[t]&&i.push(t)}return i}function U(t,r){let n={};S(n,t,Reflect.ownKeys(z(t)));for(let t of Reflect.ownKeys(r)){let i=Object.getOwnPropertyDescriptor(r,t);i.enumerable&&(i.get?O(n,t,()=>r[t]):$(n,t,i.value))}return n}function J(t,r,n,i="partial"){let a=r._zod.def.checks;if(a&&a.length>0)throw Error(`.${i}() cannot be used on object schemas containing refinements`);let s=n?new Set(L(r,n)):void 0,o={};return S(o,r,Reflect.ownKeys(z(r)),t&&((r,n)=>s&&!s.has(n)?r:new t({type:"optional",innerType:r}))),C(r,Z(r._zod.def,{shape:o,checks:[]}))}function V(t,r=0){if(!0===t.aborted)return!0;for(let n=r;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function K(t,r){return r.map(r=>(r.path??(r.path=[]),r.path.unshift(t),r))}function W(t){return"string"==typeof t?t:t?.message}function B(t,r,n){var i;for(let a=r;a<t.length;a++)(i=t[a]).schema??(i.schema=n)}function q(t,r,n){let i=t.inst?._zod?.traits;i?.has("$ZodType")&&(i.has("$ZodCheck")?t.schema??(t.schema=t.inst):t.schema=t.inst);let a=t.schema!==t.inst?t.schema?._zod.def?.error:void 0,s=t.message?t.message:W(t.inst?._zod.def?.error?.(t))??W(a?.(t))??W(r?.error?.(t))??W(n.customError?.(t))??W(n.localeError?.(t))??"Invalid input",o={};for(let r of Object.keys(t))"inst"!==r&&"schema"!==r&&"continue"!==r&&"input"!==r&&"__proto__"!==r&&(o[r]=t[r]);return o.path??(o.path=[]),o.message=s,r?.reportInput&&(o.input=t.input),o}let G=/[\uD800-\uDBFF]/;function Y(t){let r=t.length;if(!G.test(t))return r;let n=r;for(let i=0;i<r-1;i++)(64512&t.charCodeAt(i))==55296&&(64512&t.charCodeAt(i+1))==56320&&(n--,i++);return n}function X(t){return Array.isArray(t)?"array":"string"==typeof t?"string":"unknown"}function H(...t){let[r,n,i]=t;return"string"==typeof r?{message:r,code:"custom",input:n,inst:i}:{...r}}function Q(t,r,n,i=!0){return Object.defineProperty(t,r,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function ee(t,r){for(let n in t){let i=t[n];Object.defineProperty(r,n,{configurable:!0,enumerable:!0,get(){return Q(this,n,i(this))},set(t){Q(this,n,t)}})}return r}let et=!1,er={configurable:!0,get(){et=!0}};function en(t,r,n){let i=Object.getPrototypeOf(t._zod);if(r in i&&s!==t._zod){s=void 0;return}s=t._zod,Object.defineProperty(i,r,{configurable:!0,get(){Object.defineProperty(this,r,er);let t=et;et=!1;try{let i=n(this);return et?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:i}),et=et||t,i}catch(n){throw delete this[r],et=et||t,n}},set(t){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t})}})}let ei={value:void 0,enumerable:!1},ea="captureStackTrace"in Error?Error:null;function es(t,r,n,i){function a(t){this.def=t,this.constr=d,this.traits=new Set}a.prototype={};let s=n&&new WeakSet;function o(i,o){if(i._zod){if(i._zod.traits.has(t))return}else{ei.value=new a(o);try{Object.defineProperty(i,"_zod",ei)}finally{ei.value=void 0}}if(i._zod.traits.add(t),r(i,o),s){let t=Object.getPrototypeOf(i),r=i._zod.constr.prototype,a=t;for(;a&&a!==r;)a=Object.getPrototypeOf(a);let o=a??t;if(!s.has(o)){s.add(o);for(let t in n){let r=Object.getOwnPropertyDescriptor(n,t);r.get?Object.defineProperty(o,t,{...r,enumerable:!1}):function(t,r,n){Object.defineProperty(t,r,{configurable:!0,get(){return this==null?n:Q(this,r,n.bind(this))},set(t){Q(this,r,t)}})}(o,t,r.value)}}}let u=d.prototype;for(let t in u)Object.prototype.hasOwnProperty.call(u,t)&&(t in i||(i[t]=u[t].bind(i)))}let u=i?.Parent??Object;class l extends u{}function d(t){let r=i?.Parent?function(t){let r=ea;if(r){let n=r.stackTraceLimit;if("number"==typeof n){try{r.stackTraceLimit=0}catch{return ea=null,new t}try{return new t}finally{r.stackTraceLimit=n}}}return new t}(l):this;o(r,t);let n=r._zod.deferred;if(n){for(let t of n)t();r._zod.deferred=void 0}let a=globalThis.__zod_globalConfig?.postProcessor;return a&&a(r),r}return Object.defineProperty(l,"name",{value:t}),Object.defineProperty(d,"init",{value:o}),Object.defineProperty(d,Symbol.hasInstance,{value:r=>!!i?.Parent&&r instanceof i.Parent||r?._zod?.traits?.has(t)}),Object.defineProperty(d,"name",{value:t}),d}class eo extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class eu extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(i=globalThis).__zod_globalConfig??(i.__zod_globalConfig={});let el=globalThis.__zod_globalConfig;function ed(t){return t&&Object.assign(el,t),el}class ec extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let ep="~memo",ef=[];function eh(t){return null!==t&&"object"==typeof t}function em(t){return t.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}let ey=new WeakMap,e_=[],eg={alloc(t,r,n){let i=o;if(!i)return n;o=void 0;let a={value:n,issues:null};return i.set(r.value,a),e_.push(a),n},guard(t){var r;(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred.push(()=>{let r=t._zod.parse,n=(t,n)=>{var i,a;let s;if("backward"!==n.direction&&(i=n,a=t.value,void 0!==(s=i[ep]?.backEdges)&&eh(a)&&s.has(a)))throw new ec;return r(t,n)};t._zod.parse=n,t._zod.run===r&&(t._zod.run=n)})},attach(t){var r;let n,i,a,s=!1;(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred.push(()=>{let r=t._zod.parse,u=(l,d)=>{let c;if(void 0===n){let i=function t(r,n,i){var a,s;let o=ey.get(r);if(void 0!==o)return 2*!!o;if(n.has(r))return 2;n.add(r);let u=0,l=r=>{if(2!==u&&r?._zod){let a=t(r,n,i);a>u&&(u=a)}},d=t=>{t>u&&(u=t)},c=r._zod.def;switch(c.type){case"object":{let r=x(c);d(r?((r,a)=>{let s=0;for(let o of Reflect.ownKeys(r)){let u=Object.getOwnPropertyDescriptor(r,o);if(a&&!u.enumerable)continue;let l=u.get?1:u.value?._zod?t(u.value,n,i):0;l>s&&(s=l)}return s})(r,!0):1),l(c.catchall);break}case"array":l(c.element);break;case"tuple":for(let t of c.items)l(t);l(c.rest);break;case"record":case"map":l(c.keyType),l(c.valueType);break;case"set":l(c.valueType);break;case"union":for(let t of c.options)l(t);break;case"intersection":l(c.left),l(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(c.innerType);break;case"pipe":l(c.in),l(c.out);break;case"function":l(c.input),l(c.output);break;case"lazy":{let a=c._cachedInner??(i?r._zod.innerType:void 0);d(a?t(a,n,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let t in c){let r=Object.getOwnPropertyDescriptor(c,t);if(!r||r.get)continue;let n=r.value;if(n&&"object"==typeof n){if(n._zod)l(n);else if(Array.isArray(n))for(let t of n)l(t)}}}return n.delete(r),a=r,1!==(s=u)&&ey.set(a,2===s),s}(t,new Set,!1);if(0===i)return t._zod.parse=r,t._zod.run===u&&(t._zod.run=r),r(l,d);2===i||s?n=!0:s=!0}let p=l.value;if(!eh(p))return r(l,d);let f=d[ep];if(f||(f={buckets:new WeakMap,backEdges:void 0},d[ep]=f),i===d)c=a;else{var h;let r;(r=(h=f).buckets.get(t))||(r=new WeakMap,h.buckets.set(t,r)),c=r,i=d,a=c}let m=c.get(p);if(m)return l.value=m.value,m.issues?m.issues.length&&l.issues.push(...em(m.issues)):(l.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value)),l;o=c;let y=e_.length,_=r(l,d);o=void 0;let g=e_.length>y?e_.pop():void 0;return _ instanceof Promise?_.then(t=>(g&&(g.issues=t.issues.length?em(t.issues):ef),t)):(g&&(g.issues=_.issues.length?em(_.issues):ef),_)};t._zod.parse=u,t._zod.run===r&&(t._zod.run=u)})}},ev=/^[cC][0-9a-z]{6,}$/,eb=/^[0-9a-z]+$/,ek=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ew=/^[0-9a-vA-V]{20}$/,ex=/^[A-Za-z0-9]{27}$/,ez=/^[a-zA-Z0-9_-]{21}$/,eO=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,e$=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,eS=t=>t?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,eZ=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eT=/^(?:(?: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])$/,ej=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,eA=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,eP=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,eE=/^https?$/,eN=/^\+[1-9]\d{6,14}$/,eI="(?:(?:\\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])))",eC=RegExp(`^${eI}$`);function eR(t){let r="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof t.precision?-1===t.precision?`${r}`:0===t.precision?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${t.precision}}`:t.seconds?`${r}:[0-5]\\d(?:\\.\\d+)?`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}let eF=/^[\s\S]{0,}$/,eM=/^-?\d+$/,eD=/^-?\d+(?:\.\d+)?$/,eL=/^(?:true|false)$/i,eU=/^[^A-Z]*$/,eJ=/^[^a-z]*$/,eV=es("$ZodCheck",(t,r)=>{var n;t._zod??(t._zod={}),t._zod.def=r,(n=t._zod).onattach??(n.onattach=[])}),eK=t=>{let r=t.value;return null!=r&&void 0!==r.length},eW={number:"number",bigint:"bigint",object:"date"},eB=es("$ZodCheckLessThan",(t,r)=>{eV.init(t,r);let n=eW[typeof r.value];t._zod.check=i=>{(r.inclusive?i.value<=r.value:i.value<r.value)||i.issues.push({origin:eW[typeof i.value]??n,code:"too_big",maximum:"object"==typeof r.value?r.value.getTime():r.value,input:i.value,inclusive:r.inclusive,inst:t,continue:!r.abort})}}),eq=es("$ZodCheckGreaterThan",(t,r)=>{eV.init(t,r);let n=eW[typeof r.value];t._zod.check=i=>{(r.inclusive?i.value>=r.value:i.value>r.value)||i.issues.push({origin:eW[typeof i.value]??n,code:"too_small",minimum:"object"==typeof r.value?r.value.getTime():r.value,input:i.value,inclusive:r.inclusive,inst:t,continue:!r.abort})}}),eG=es("$ZodCheckMultipleOf",(t,r)=>{eV.init(t,r),t._zod.check=n=>{let i,a,s;if(typeof n.value!=typeof r.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?r.value!==BigInt(0)&&n.value%r.value===BigInt(0):0==(a=Math.round(i=n.value/r.value),s=4*Number.EPSILON*Math.max(Math.abs(i),1),Math.abs(i-a)<s?0:i-a))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:r.value,input:n.value,inst:t,continue:!r.abort})}}),eY=es("$ZodCheckNumberFormat",(t,r)=>{eV.init(t,r),r.format=r.format||"float64";let n=r.format?.includes("int"),i=n?"int":"number",[a,s]=M[r.format];t._zod.check=o=>{let u=o.value;if(n){if(!Number.isInteger(u))return void o.issues.push({expected:i,format:r.format,code:"invalid_type",continue:!1,input:u,inst:t});if(!Number.isSafeInteger(u))return void(u>0?o.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!r.abort}):o.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!r.abort}))}u<a&&o.issues.push({origin:"number",input:u,code:"too_small",minimum:a,inclusive:!0,inst:t,continue:!r.abort}),u>s&&o.issues.push({origin:"number",input:u,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!r.abort})}}),eX=es("$ZodCheckMaxLength",(t,r)=>{var n;eV.init(t,r),(n=t._zod.def).when??(n.when=eK),t._zod.check=n=>{let i=n.value,a=i.length;if(("string"==typeof i&&a>r.maximum?Y(i):a)<=r.maximum)return;let s=X(i);n.issues.push({origin:s,code:"too_big",maximum:r.maximum,inclusive:!0,input:i,inst:t,continue:!r.abort})}}),eH=es("$ZodCheckMinLength",(t,r)=>{var n;eV.init(t,r),(n=t._zod.def).when??(n.when=eK),t._zod.check=n=>{let i=n.value,a=i.length;if(("string"==typeof i&&a>=r.minimum&&a<2*r.minimum?Y(i):a)>=r.minimum)return;let s=X(i);n.issues.push({origin:s,code:"too_small",minimum:r.minimum,inclusive:!0,input:i,inst:t,continue:!r.abort})}}),eQ=es("$ZodCheckLengthEquals",(t,r)=>{var n;eV.init(t,r),(n=t._zod.def).when??(n.when=eK),t._zod.check=n=>{let i=n.value,a=i.length,s="string"==typeof i&&a>=r.length&&a<=2*r.length?Y(i):a;if(s===r.length)return;let o=X(i),u=s>r.length;n.issues.push({origin:o,...u?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!r.abort})}}),e0=es("$ZodCheckStringFormat",(t,r)=>{var n,i;eV.init(t,r),r.pattern?(n=t._zod).check??(n.check=n=>{r.pattern.lastIndex=0,r.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:r.format,input:n.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:t,continue:!r.abort})}):(i=t._zod).check??(i.check=()=>{})}),e1=es("$ZodCheckRegex",(t,r)=>{e0.init(t,r),t._zod.check=n=>{r.pattern.lastIndex=0,r.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:r.pattern.toString(),inst:t,continue:!r.abort})}}),e9=es("$ZodCheckLowerCase",(t,r)=>{r.pattern??(r.pattern=eU),e0.init(t,r)}),e4=es("$ZodCheckUpperCase",(t,r)=>{r.pattern??(r.pattern=eJ),e0.init(t,r)}),e2=es("$ZodCheckIncludes",(t,r)=>{eV.init(t,r);let n=I(r.includes),i=new RegExp("number"==typeof r.position?`^.{${r.position},}${n}`:n);r.pattern=i,t._zod.check=n=>{n.value.includes(r.includes,r.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:n.value,inst:t,continue:!r.abort})}}),e6=es("$ZodCheckStartsWith",(t,r)=>{eV.init(t,r);let n=RegExp(`^${I(r.prefix)}.*`);r.pattern??(r.pattern=n),t._zod.check=n=>{n.value.startsWith(r.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:n.value,inst:t,continue:!r.abort})}}),e3=es("$ZodCheckEndsWith",(t,r)=>{eV.init(t,r);let n=RegExp(`.*${I(r.suffix)}$`);r.pattern??(r.pattern=n),t._zod.check=n=>{n.value.endsWith(r.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:n.value,inst:t,continue:!r.abort})}}),e5=es("$ZodCheckOverwrite",(t,r)=>{eV.init(t,r),t._zod.check=t=>{t.value=r.tx(t.value)}});class e7{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if("function"==typeof t){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split("\n").filter(t=>t),n=Math.min(...r.map(t=>t.length-t.trimStart().length));for(let t of r.map(t=>t.slice(n)).map(t=>" ".repeat(2*this.indent)+t))this.content.push(t)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
2
+ ${r.join("\n")}
3
+ };`)(...Object.values(this.closed))}}let e8={major:4,minor:6,patch:5},te=es("$ZodType",(t,r)=>{var n;t??(t={}),t._zod.def=r,t._zod.bag=t._zod.bag||{},t._zod.version=e8;let i=t._zod.def.checks,a=t._zod.traits.has("$ZodCheck")?[t,...i??[]]:i?.length?[...i]:[];for(let r of a)for(let n of r._zod.onattach)n(t);if(0===a.length)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let r=(r,n,i)=>{let a;if(r.memo)return r;let s=V(r);for(let o of n){if(o._zod.def.when){if(function(t,r=0){if(!0===t.aborted)return!0;for(let n=r;n<t.issues.length;n++)if(t.issues[n]?.continue===!1)return!0;return!1}(r)||!o._zod.def.when(r))continue}else if(s)continue;let n=r.issues.length,u=o._zod.check(r);if(u instanceof Promise&&i?.async===!1)throw new eo;if(a||u instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await u,r.issues.length!==n&&(B(r.issues,n,t),s||(s=V(r,n)))});else{if(r.issues.length===n)continue;B(r.issues,n,t),s||(s=V(r,n))}}return a?a.then(()=>r):r},n=(n,i,s)=>{if(V(n))return n.aborted=!0,n;let o=r(i,a,s);if(o instanceof Promise){if(!1===s.async)throw new eo;return o.then(r=>t._zod.parse(r,s))}return t._zod.parse(o,s)};t._zod.run=(i,s)=>{if(s.skipChecks)return t._zod.parse(i,s);if("backward"===s.direction){let r=t._zod.parse({value:i.value,issues:[]},{...s,skipChecks:!0});return r instanceof Promise?r.then(t=>n(t,i,s)):n(r,i,s)}let o=t._zod.parse(i,s);if(o instanceof Promise){if(!1===s.async)throw new eo;return o.then(t=>r(t,a,s))}return r(o,a,s)}}},{get"~standard"(){return Q(this,"~standard",tn(this),!1)},set"~standard"(value){Q(this,"~standard",value)}}),tt=(t,r)=>t.issues.length?{issues:t.issues.map(t=>q(t,r,ed()))}:{value:t.value};async function tr(t,r){let n={async:!0};return tt(await t._zod.run({value:r,issues:[]},n),n)}function tn(t){return{validate:r=>{let n={async:!1};try{let i=t._zod.run({value:r,issues:[]},n);if(!(i instanceof Promise))return tt(i,n)}catch(t){}return tr(t,r)},vendor:"zod",version:1}}let ti=es("$ZodString",(t,r)=>{te.init(t,r),t._zod.pattern=r.pattern??eF,t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=String(n.value)}catch(t){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),ta=es("$ZodStringFormat",(t,r)=>{e0.init(t,r),ti.init(t,r)}),ts=es("$ZodGUID",(t,r)=>{r.pattern??(r.pattern=e$),ta.init(t,r)}),to=es("$ZodUUID",(t,r)=>{if(r.version){let t={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(void 0===t)throw Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=eS(t))}else r.pattern??(r.pattern=eS());ta.init(t,r)}),tu=es("$ZodEmail",(t,r)=>{r.pattern??(r.pattern=eZ),ta.init(t,r)});function tl(t){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(t);return new URL(t),!0}catch{return!1}}let td=/[\t\n\r]/g;function tc(t){return t.replace(td,"")}let tp=es("$ZodURL",(t,r)=>{ta.init(t,r),t._zod.check=n=>{try{var i,a;let s=n.value.trim(),o="normalize"in r||"hostname"in r||"protocol"in r?function(t,r){if(!r.normalize&&r.protocol?.source===eE.source&&!/^https?:\/\//i.test(t))return 1;try{if("u">typeof URL){let r=URL;if("function"==typeof r.parse)return r.parse(t)??2}return new URL(t)}catch{return 2}}(s,r):tl(s)||2;if(1===o)return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!r.abort});if(2===o)return void n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!r.abort});if(!0===o){n.value=tc(s);return}r.hostname&&((i=r.hostname).lastIndex=0,!i.test(o.hostname))&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:r.hostname.source,input:n.value,inst:t,continue:!r.abort}),r.protocol&&((a=r.protocol).lastIndex=0,!a.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol))&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:n.value,inst:t,continue:!r.abort}),n.value=r.normalize?o.href:tc(s);return}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!r.abort})}}}),tf=es("$ZodEmoji",(t,r)=>{r.pattern??(r.pattern=RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")),ta.init(t,r)}),th=es("$ZodNanoID",(t,r)=>{var n;if(void 0!==r.length&&(!Number.isInteger(r.length)||r.length<1))throw Error(`Invalid nanoid length: ${r.length}`);r.pattern??(r.pattern=void 0===r.length?ez:(n=r.length,RegExp(`^[a-zA-Z0-9_-]{${n}}$`))),ta.init(t,r)}),tm=es("$ZodCUID",(t,r)=>{r.pattern??(r.pattern=ev),ta.init(t,r)}),ty=es("$ZodCUID2",(t,r)=>{r.pattern??(r.pattern=eb),ta.init(t,r)}),t_=es("$ZodULID",(t,r)=>{r.pattern??(r.pattern=ek),ta.init(t,r)}),tg=es("$ZodXID",(t,r)=>{r.pattern??(r.pattern=ew),ta.init(t,r)}),tv=es("$ZodKSUID",(t,r)=>{r.pattern??(r.pattern=ex),ta.init(t,r)}),tb=es("$ZodISODateTime",(t,r)=>{let n,i,a;r.pattern??(n=["Z"],r.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),i=`${eR({precision:r.precision,seconds:!0})}(?:${n.join("|")})`,a=r.local?`${i}|${eR({precision:r.precision})}`:i,r.pattern=RegExp(`^${eI}T(?:${a})$`)),ta.init(t,r)}),tk=es("$ZodISODate",(t,r)=>{r.pattern??(r.pattern=eC),ta.init(t,r)}),tw=es("$ZodISOTime",(t,r)=>{r.pattern??(r.pattern=RegExp(`^${eR(r)}$`)),ta.init(t,r)}),tx=es("$ZodISODuration",(t,r)=>{r.pattern??(r.pattern=eO),ta.init(t,r)}),tz=es("$ZodIPv4",(t,r)=>{r.pattern??(r.pattern=eT),ta.init(t,r)}),tO=/^[0-9a-fA-F:.]+$/;function t$(t){return!!tO.test(t)&&tl(`http://[${t}]`)}let tS=es("$ZodIPv6",(t,r)=>{r.pattern??(r.pattern=ej),ta.init(t,r),t._zod.check=n=>{t$(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!r.abort})}}),tZ=es("$ZodCIDRv4",(t,r)=>{r.pattern??(r.pattern=eA),ta.init(t,r)}),tT=es("$ZodCIDRv6",(t,r)=>{r.pattern??(r.pattern=eP),ta.init(t,r),t._zod.check=n=>{!function(t){let r=t.split("/");if(2!==r.length)return!1;let[n,i]=r;if(!i)return!1;let a=Number(i);return`${a}`===i&&!(a<0)&&!(a>128)&&t$(n)}(n.value)&&n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!r.abort})}});function tj(t){if(""===t)return!0;if(/\s/.test(t)||t.length%4!=0)return!1;try{return atob(t),!0}catch{return!1}}let tA=/^[0-9a-zA-Z+/]*={0,2}$/,tP=es("$ZodBase64",(t,r)=>{r.pattern??(r.pattern=tA),ta.init(t,r),t._zod.check=n=>{tj(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!r.abort})}}),tE=/^[A-Za-z0-9_-]*$/,tN=es("$ZodBase64URL",(t,r)=>{r.pattern??(r.pattern=tE),ta.init(t,r),t._zod.check=n=>{!function(t){if(!tE.test(t))return!1;let r=t.replace(/[-_]/g,t=>"-"===t?"+":"/");return tj(r.padEnd(4*Math.ceil(r.length/4),"="))}(n.value)&&n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!r.abort})}}),tI=es("$ZodE164",(t,r)=>{r.pattern??(r.pattern=eN),ta.init(t,r)}),tC=es("$ZodJWT",(t,r)=>{ta.init(t,r),t._zod.check=n=>{!function(t,r=null){try{let n=t.split(".");if(3!==n.length)return!1;let[i]=n;if(!i)return!1;let a=JSON.parse(atob(i));if("typ"in a&&a?.typ!=="JWT"||!a.alg||r&&(!("alg"in a)||a.alg!==r))return!1;return!0}catch{return!1}}(n.value,r.alg)&&n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!r.abort})}}),tR=es("$ZodNumber",(t,r)=>{te.init(t,r),t._zod.pattern=eD,t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=Number(n.value)}catch(t){}let a=n.value;if("number"==typeof a&&!Number.isNaN(a)&&Number.isFinite(a))return n;let s="number"==typeof a?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:String(a):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:a,inst:t,...s?{received:s}:{}}),n}}),tF=es("$ZodNumberFormat",(t,r)=>{eY.init(t,r),tR.init(t,r)}),tM=es("$ZodBoolean",(t,r)=>{te.init(t,r),t._zod.pattern=eL,t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=!!n.value}catch(t){}let a=n.value;return"boolean"==typeof a||n.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:t}),n}}),tD=es("$ZodUnknown",(t,r)=>{te.init(t,r),t._zod.parse=t=>t}),tL=es("$ZodNever",(t,r)=>{te.init(t,r),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function tU(t,r,n){t.issues.length&&r.issues.push(...K(n,t.issues)),r.value[n]=t.value}let tJ=es("$ZodArray",(t,r)=>{te.init(t,r);let n=el.memoizer;n?.attach(t),t._zod.parse=(i,a)=>{let s=i.value;if(!Array.isArray(s))return i.issues.push({expected:"array",code:"invalid_type",input:s,inst:t}),i;i.value=n?n.alloc(t,i,Array(s.length),a):Array(s.length);let o=[],u=a?.abortEarly;for(let t=0;t<s.length;t++){let n=s[t],l=r.element._zod.run({value:n,issues:[]},a);if(l instanceof Promise)o.push(l.then(r=>tU(r,i,t)));else if(tU(l,i,t),u&&0!==l.issues.length&&V(l))break}return o.length?Promise.all(o).then(()=>i):i}});function tV(t,r,n,i,a,s){let o=n in i,u="optional"===s;if(o||!u||"optional"!==a){if(t.issues.length){if(void 0!==a&&u&&!o)return;r.issues.push(...K(n,t.issues))}if(!o&&void 0===a){t.issues.length||r.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}void 0===t.value?(o||"defaulted"===a&&!u)&&(r.value[n]=void 0):r.value[n]=t.value}}let tK=[];function tW(t){var r;let n=Object.keys(t.shape),i=Object.getOwnPropertySymbols(t.shape),a=i.length?i:tK,s=a.length?[...n,...a]:n;for(let r of s)if(!t.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(r)}": expected a Zod schema`);let o=Object.keys(r=t.shape).filter(t=>void 0!==r[t]._zod.optin&&"optional"===r[t]._zod.optout);return{...t,allKeys:s,symbolKeys:a,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(o)}}function tB(t,r,n,i,a,s,o){let u=[],l=a.keySet,d=a.catchall._zod,c=d.def.type,p=d.optin,f=d.optout,h=0;for(let a in r){if(o&&n.issues.length!==h){if(V(n,h))break;h=n.issues.length}if(l.has(a))continue;if("__proto__"===a){"never"===c&&u.push(a);continue}if("never"===c){u.push(a);continue}let s=d.run({value:r[a],issues:[]},i);s instanceof Promise?t.push(s.then(t=>tV(t,n,a,r,p,f))):tV(s,n,a,r,p,f)}return(u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:r,inst:s,continue:!0}),t.length)?Promise.all(t).then(()=>n):n}let tq=es("$ZodObject",(t,r)=>{let n;te.init(t,r);let i=Object.getOwnPropertyDescriptor(r,"shape"),a=i?.get?i.get.raw:r.shape??{};if(a){let t=()=>{let n={...a};return Object.defineProperty(r,"shape",{value:n}),t.raw=n,n};t.raw=a,Object.defineProperty(r,"shape",{get:t})}let s=new v(()=>tW(r));en(t,"propValues",t=>{let r=t.def.shape,n={};for(let t in r){let i=r[t]._zod;if(i.values){for(let r of(Object.prototype.hasOwnProperty.call(n,t)||w(n,t,new Set),i.values))n[t].add(r);void 0!==i.optin&&n[t].add(void 0)}}return n});let o=r.catchall,u=el.memoizer;u?.attach(t),t._zod.parse=(r,i)=>{n??(n=s.value);let a=r.value;if(!j(a))return r.issues.push({expected:"object",code:"invalid_type",input:a,inst:t}),r;r.value=u?u.alloc(t,r,{},i):{};let l=[],d=n.shape,c=i?.abortEarly,p=r.issues.length;for(let t of n.allKeys){if(c&&r.issues.length!==p){if(V(r,p))break;p=r.issues.length}if("__proto__"===t)continue;let n=d[t],s=n._zod.optin,o=n._zod.optout,u=n._zod.run({value:a[t],issues:[]},i);u instanceof Promise?l.push(u.then(n=>tV(n,r,t,a,s,o))):tV(u,r,t,a,s,o)}return o?tB(l,a,r,i,s.value,t,!0===c):l.length?Promise.all(l).then(()=>r):r}}),tG=es("$ZodObjectJIT",(t,r)=>{let n,i;tq.init(t,r);let a=t._zod.parse,s=new v(()=>tW(r)),o=el.memoizer,u=!el.jitless,l=u&&A.value,d=r.catchall;t._zod.parse=(c,p)=>{i??(i=s.value);let f=c.value;return j(f)?u&&l&&p?.async===!1&&!0!==p.jitless?(n||(n=(r=>{let n=s.value,i=n.symbolKeys,a=new e7(["payload","ctx"],{shape:r,inst:t,memo:o,syms:i}),u=t=>`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`,l=(t,r)=>`
4
+ let ${t}_ab = false;
5
+ for (let i = 0; i < ${t}.issues.length; i++) {
6
+ const iss = ${t}.issues[i];
7
+ iss.path = iss.path ? [${r}, ...iss.path] : [${r}];
8
+ payload.issues.push(iss);
9
+ if (iss.continue !== true) ${t}_ab = true;
10
+ }
11
+ if (${t}_ab && ctx && ctx.abortEarly) {
12
+ payload.value = newResult;
13
+ return payload;
14
+ }`;a.write("const input = payload.value;");let d=Object.create(null),c=0;for(let t of n.allKeys)d[t]=`key_${c++}`;for(let t of(a.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};"),n.allKeys)){if("__proto__"===t)continue;let n=d[t],s="symbol"==typeof t?`syms[${i.indexOf(t)}]`:JSON.stringify(t),o=`${s} in input`,c=r[t],p=c?._zod?.optin,f=void 0!==p,h=c?._zod?.optout==="optional";if(a.write(`const ${n} = ${u(s)};`),f&&h){let t="optional"===p?`${n}_present`:`${n}.value !== undefined || ${n}_present`;a.write(`
15
+ const ${n}_present = ${o};
16
+ if (!${n}.issues.length || ${n}_present) {
17
+ if (${n}.issues.length) {${l(n,s)}
18
+ }
19
+
20
+ if (${t}) {
21
+ newResult[${s}] = ${n}.value;
22
+ }
23
+ }
24
+
25
+ `)}else f?(a.write(`
26
+ if (${n}.issues.length) {${l(n,s)}
27
+ }
28
+ `),"defaulted"===p?a.write(`newResult[${s}] = ${n}.value;`):a.write(`
29
+ if (${n}.value !== undefined || ${o}) {
30
+ newResult[${s}] = ${n}.value;
31
+ }
32
+ `)):a.write(`
33
+ const ${n}_present = ${o};
34
+ if (${n}.issues.length) {${l(n,s)}
35
+ }
36
+ if (!${n}_present && !${n}.issues.length) {
37
+ payload.issues.push({
38
+ code: "invalid_type",
39
+ expected: "nonoptional",
40
+ input: undefined,
41
+ path: [${s}]
42
+ });
43
+ if (ctx && ctx.abortEarly) {
44
+ payload.value = newResult;
45
+ return payload;
46
+ }
47
+ }
48
+
49
+ if (${n}_present) {
50
+ newResult[${s}] = ${n}.value;
51
+ }
52
+
53
+ `)}return a.write("payload.value = newResult;"),a.write("return payload;"),a.compile()})(r.shape)),c=n(c,p),d)?tB([],f,c,p,i,t,p?.abortEarly===!0):c:a(c,p):(c.issues.push({expected:"object",code:"invalid_type",input:f,inst:t}),c)}});function tY(t,r,n,i){for(let n of t)if(0===n.issues.length)return r.value=n.value,r;let a=t.filter(t=>!V(t));return 1===a.length?(r.value=a[0].value,a[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:n,errors:t.map(t=>t.issues.map(t=>q(t,i,ed())))}),r)}let tX=es("$ZodUnion",(t,r)=>{te.init(t,r),en(t,"optin",t=>t.def.options.some(t=>"defaulted"===t._zod.optin)?"defaulted":t.def.options.some(t=>void 0!==t._zod.optin)?"optional":void 0),en(t,"optout",t=>t.def.options.some(t=>"optional"===t._zod.optout)?"optional":void 0),en(t,"values",t=>{if(t.def.options.every(t=>t._zod.values))return new Set(t.def.options.flatMap(t=>Array.from(t._zod.values)))}),en(t,"pattern",t=>{if(t.def.options.every(t=>t._zod.pattern)){let r=t.def.options.map(t=>t._zod.pattern);return RegExp(`^(${r.map(t=>b(t.source)).join("|")})$`)}});let n=1===r.options.length?r.options[0]._zod.run:null;t._zod.parse=(i,a)=>{if(n)return n(i,a);let s=!1,o=[];for(let t of r.options){let r=t._zod.run({value:i.value,issues:[]},a);if(r instanceof Promise)o.push(r),s=!0;else{if(0===r.issues.length)return r;o.push(r)}}return s?Promise.all(o).then(r=>tY(r,i,t,a)):tY(o,i,t,a)}}),tH=es("$ZodIntersection",(t,r)=>{te.init(t,r),t._zod.parse=(t,n)=>{let i=t.value,a=r.left._zod.run({value:i,issues:[]},n),s=r.right._zod.run({value:i,issues:[]},n);return a instanceof Promise||s instanceof Promise?Promise.all([a,s]).then(([r,n])=>tQ(t,r,n)):tQ(t,a,s)}});function tQ(t,r,n){let i,a=new Map,s=new Map,o=(t,r)=>{let n;if("unrecognized_keys"!==t.code||t.path?.length)if("invalid_key"!==t.code||"record"!==t.origin||t.path?.length!==1)return!1;else{let r=String(t.path[0]);s.has(r)||s.set(r,t),n=[r]}else i??(i=t),n=t.keys;for(let t of n)a.has(t)||a.set(t,{}),a.get(t)[r]=!0;return!0};for(let n of r.issues)o(n,"l")||t.issues.push(n);for(let r of n.issues)o(r,"r")||t.issues.push(r);let u=[...a].filter(([,t])=>t.l&&t.r).map(([t])=>t);if(u.length){let r=i?u.filter(t=>i.keys.includes(t)):[];for(let n of(r.length&&t.issues.push({...i,keys:r}),u))!r.includes(n)&&s.has(n)&&t.issues.push(s.get(n))}let l=function t(r,n){if(r===n||r instanceof Date&&n instanceof Date&&+r==+n)return{valid:!0,data:r};if(P(r)&&P(n)){let i=Object.keys(n),a=Object.keys(r).filter(t=>-1!==i.indexOf(t)),s={...r,...n};for(let i of(Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__,a)){if("__proto__"===i)continue;let a=t(r[i],n[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};s[i]=a.data}return{valid:!0,data:s}}if(Array.isArray(r)&&Array.isArray(n)){if(r.length!==n.length)return{valid:!1,mergeErrorPath:[]};let i=[];for(let a=0;a<r.length;a++){let s=t(r[a],n[a]);if(!s.valid)return{valid:!1,mergeErrorPath:[a,...s.mergeErrorPath]};i.push(s.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}(r.value,n.value);if(!l.valid){if(V(t))return t;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return t.value=l.data,t}let t0=es("$ZodRecord",(t,r)=>{te.init(t,r);let n=el.memoizer;n?.attach(t),t._zod.parse=(i,a)=>{let s=i.value;if(!P(s))return i.issues.push({expected:"record",code:"invalid_type",input:s,inst:t}),i;let o=[],u=r.keyType._zod.values;if(u&&!r.partial){let l;i.value=n?n.alloc(t,i,{},a):{};let d=new Set;for(let n of u)if("string"==typeof n||"number"==typeof n||"symbol"==typeof n){if(d.add("number"==typeof n?n.toString():n),"__proto__"===n)continue;let u=r.keyType._zod.run({value:n,issues:[]},a);if(u instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(u.issues.length){i.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(t=>q(t,a,ed())),input:n,path:[n],inst:t});continue}let l=u.value;if("__proto__"===l)continue;let c=r.valueType._zod.run({value:s[n],issues:[]},a);c instanceof Promise?o.push(c.then(t=>{t.issues.length&&i.issues.push(...K(n,t.issues)),i.value[l]=t.value})):(c.issues.length&&i.issues.push(...K(n,c.issues)),i.value[l]=c.value)}for(let t in s)if(!d.has(t))if("loose"===r.mode){if("__proto__"===t)continue;i.value[t]=s[t]}else(l=l??[]).push(t);l&&l.length>0&&i.issues.push({code:"unrecognized_keys",input:s,inst:t,keys:l,continue:!0})}else{let l;for(let d of(i.value=n?n.alloc(t,i,{},a):{},Reflect.ownKeys(s))){if("__proto__"===d||!Object.prototype.propertyIsEnumerable.call(s,d))continue;let n=r.keyType._zod.run({value:d,issues:[]},a);if(n instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof d&&eD.test(d)&&n.issues.length){let t=r.keyType._zod.run({value:Number(d),issues:[]},a);if(t instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===t.issues.length&&(n=t)}if(n.issues.length){"loose"===r.mode?i.value[d]=s[d]:u?(l=l??[]).push(d):i.issues.push({code:"invalid_key",origin:"record",issues:n.issues.map(t=>q(t,a,ed())),input:d,path:[d],inst:t});continue}let c=n.value;if("__proto__"===c)continue;let p=r.valueType._zod.run({value:s[d],issues:[]},a);p instanceof Promise?o.push(p.then(t=>{t.issues.length&&i.issues.push(...K(d,t.issues)),i.value[c]=t.value})):(p.issues.length&&i.issues.push(...K(d,p.issues)),i.value[c]=p.value)}l&&l.length>0&&i.issues.push({code:"unrecognized_keys",input:s,inst:t,keys:l,continue:!0})}return o.length?Promise.all(o).then(()=>i):i}}),t1=es("$ZodEnum",(t,r)=>{te.init(t,r);let n=y(r.entries),i=new Set(n);t._zod.values=i,en(t,"pattern",t=>{let r=y(t.def.entries).filter(t=>N.has(typeof t));return new RegExp(r.length?`^(${r.map(t=>I(t.toString())).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(r,a)=>{let s=r.value;return i.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:t}),r}}),t9=es("$ZodLiteral",(t,r)=>{te.init(t,r);let n=new Set(r.values);t._zod.values=n,en(t,"pattern",t=>{let r=t.def.values;return new RegExp(r.length?`^(${r.map(t=>"string"==typeof t?I(t):t?I(t.toString()):String(t)).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(i,a)=>{let s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:r.values,input:s,inst:t}),i}}),t4=es("$ZodTransform",(t,r)=>{te.init(t,r),t._zod.optin="optional",el.memoizer?.guard(t),t._zod.parse=(n,i)=>{if("backward"===i.direction)throw new eu(t.constructor.name);let a=r.transform(n.value,n);if(i.async)return(a instanceof Promise?a:Promise.resolve(a)).then(t=>(n.value=t,n));if(a instanceof Promise)throw new eo;return n.value=a,n}});function t2(t,r){return t.value=r.issues.length?void 0:r.value,t}let t6=es("$ZodOptional",(t,r)=>{te.init(t,r),en(t,"optin",t=>"defaulted"===t.def.innerType._zod.optin?"defaulted":"optional"),t._zod.optout="optional",en(t,"values",t=>{let r=t.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),en(t,"pattern",t=>{let r=t.def.innerType._zod.pattern;return r?RegExp(`^(${b(r.source)})?$`):void 0}),t._zod.parse=(t,n)=>{if(void 0===t.value){if("defaulted"!==r.innerType._zod.optin)return t;let i=r.innerType._zod.run({value:t.value,issues:[]},n);return i instanceof Promise?i.then(r=>t2(t,r)):t2(t,i)}return r.innerType._zod.run(t,n)}}),t3=es("$ZodExactOptional",(t,r)=>{t6.init(t,r),en(t,"values",t=>t.def.innerType._zod.values),en(t,"pattern",t=>t.def.innerType._zod.pattern),t._zod.parse=(t,n)=>r.innerType._zod.run(t,n)}),t5=es("$ZodNullable",(t,r)=>{te.init(t,r),en(t,"optin",t=>t.def.innerType._zod.optin),en(t,"optout",t=>t.def.innerType._zod.optout),en(t,"pattern",t=>{let r=t.def.innerType._zod.pattern;return r?RegExp(`^(${b(r.source)}|null)$`):void 0}),en(t,"values",t=>t.def.innerType._zod.values?new Set([...t.def.innerType._zod.values,null]):void 0),t._zod.parse=(t,n)=>null===t.value?t:r.innerType._zod.run(t,n)}),t7=es("$ZodDefault",(t,r)=>{te.init(t,r),t._zod.optin="defaulted",en(t,"values",t=>t.def.innerType._zod.values),t._zod.parse=(t,n)=>{if("backward"===n.direction)return r.innerType._zod.run(t,n);if(void 0===t.value)return t.value=r.defaultValue,t;let i=r.innerType._zod.run(t,n);return i instanceof Promise?i.then(t=>t8(t,r)):t8(i,r)}});function t8(t,r){return void 0===t.value&&(t.value=r.defaultValue),t}let re=es("$ZodPrefault",(t,r)=>{te.init(t,r),t._zod.optin="defaulted",en(t,"values",t=>t.def.innerType._zod.values),t._zod.parse=(t,n)=>("backward"===n.direction||void 0===t.value&&(t.value=r.defaultValue),r.innerType._zod.run(t,n))}),rt=es("$ZodNonOptional",(t,r)=>{te.init(t,r),en(t,"values",t=>{let r=t.def.innerType._zod.values;return r?new Set([...r].filter(t=>void 0!==t)):void 0}),t._zod.parse=(n,i)=>{let a=r.innerType._zod.run(n,i);return a instanceof Promise?a.then(r=>rr(r,t)):rr(a,t)}});function rr(t,r){return t.issues.length||void 0!==t.value||t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:r}),t}function rn(t,r,n,i){return r.issues.length?t.value=n.catchValue({...r,value:t.value,error:{issues:r.issues.map(t=>q(t,i,ed()))},input:t.value}):(t.value=r.value,r.memo&&(t.memo=!0)),t}let ri=es("$ZodCatch",(t,r)=>{te.init(t,r),en(t,"optin",t=>"defaulted"===t.def.innerType._zod.optin?"defaulted":"optional"),en(t,"optout",t=>t.def.innerType._zod.optout),en(t,"values",t=>t.def.innerType._zod.values),t._zod.parse=(t,n)=>{if("backward"===n.direction)return r.innerType._zod.run(t,n);let i=r.innerType._zod.run({value:t.value,issues:[]},n);return i instanceof Promise?i.then(i=>rn(t,i,r,n)):rn(t,i,r,n)}}),ra=es("$ZodPipe",(t,r)=>{te.init(t,r),en(t,"values",t=>t.def.in._zod.values),en(t,"optin",t=>t.def.in._zod.optin),en(t,"optout",t=>t.def.out._zod.optout),en(t,"propValues",t=>t.def.in._zod.propValues),t._zod.parse=(t,n)=>{if("backward"===n.direction){let i=r.out._zod.run(t,n);return i instanceof Promise?i.then(t=>rs(t,r.in,n)):rs(i,r.in,n)}let i=r.in._zod.run(t,n);return i instanceof Promise?i.then(t=>rs(t,r.out,n)):rs(i,r.out,n)}});function rs(t,r,n){return t.issues.some(t=>"unrecognized_keys"!==t.code)?(t.aborted=!0,t):r._zod.run({value:t.value,issues:t.issues},n)}let ro=es("$ZodReadonly",(t,r)=>{te.init(t,r),en(t,"propValues",t=>t.def.innerType._zod.propValues),en(t,"values",t=>t.def.innerType._zod.values),en(t,"optin",t=>t.def.innerType?._zod?.optin),en(t,"optout",t=>t.def.innerType?._zod?.optout),t._zod.parse=(t,n)=>{if("backward"===n.direction)return r.innerType._zod.run(t,n);let i=r.innerType._zod.run(t,n);return i instanceof Promise?i.then(ru):ru(i)}});function ru(t){return t.memo||(t.value=Object.freeze(t.value)),t}let rl=es("$ZodLazy",(t,r)=>{var n;let i;te.init(t,r),n=t._zod,Object.defineProperty(n,"innerType",{get(){if(i!==k)return void 0===i&&(i=k,i=(()=>(r._cachedInner||(r._cachedInner=r.getter()),r._cachedInner))()),i},set(t){Object.defineProperty(n,"innerType",{value:t})},configurable:!0}),en(t,"pattern",t=>t.innerType?._zod?.pattern),en(t,"propValues",t=>t.innerType?._zod?.propValues),en(t,"optin",t=>t.innerType?._zod?.optin??void 0),en(t,"optout",t=>t.innerType?._zod?.optout??void 0),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),rd=es("$ZodCustom",(t,r)=>{eV.init(t,r),te.init(t,r),t._zod.parse=(t,r)=>t,t._zod.check=n=>{let i=n.value,a=r.fn(i);if(a instanceof Promise)return a.then(r=>rc(r,n,i,t));rc(a,n,i,t)}});function rc(t,r,n,i){if(!t){let t={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(t.params=i._zod.def.params),r.issues.push(H(t))}}(a=globalThis).__zod_globalRegistry??(a.__zod_globalRegistry=new class t{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&"object"==typeof r&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}});let rp=globalThis.__zod_globalRegistry;function rf(t){return t.checks&&(t.checks=[...t.checks]),t}function rh(t,r){return new eB({check:"less_than",...R(r),value:t,inclusive:!1})}function rm(t,r){return new eB({check:"less_than",...R(r),value:t,inclusive:!0})}function ry(t,r){return new eq({check:"greater_than",...R(r),value:t,inclusive:!1})}function r_(t,r){return new eq({check:"greater_than",...R(r),value:t,inclusive:!0})}function rg(t,r){return new eG({check:"multiple_of",...R(r),value:t})}function rv(t,r){return new eX({check:"max_length",...R(r),maximum:t})}function rb(t,r){return new eH({check:"min_length",...R(r),minimum:t})}function rk(t,r){return new eQ({check:"length_equals",...R(r),length:t})}function rw(t){return new e5({check:"overwrite",tx:t})}function rx(t,...r){for(let n of r)for(let r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&w(t,r,n[r]);return t}function rz(t){let r=t?.target??"draft-2020-12";return"draft-4"===r&&(r="draft-04"),"draft-7"===r&&(r="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??rp,target:r,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:t?.cycles??"ref",reused:t?.reused??"inline",intersections:[],deferred:[],external:t?.external??void 0}}function rO(t,r,n,i,a){let s="function"==typeof r.unrepresentable?r.unrepresentable({zodSchema:t,path:i.path,message:a}):r.unrepresentable;if("any"===s)return!1;if(void 0===s||"throw"===s)throw Error(a);return Object.assign(n,s),!0}function r$(t,r,n={path:[],schemaPath:[]}){var i;let a=t._zod.def,s=r.seen.get(t);if(s)return s.count++,n.schemaPath.includes(t)&&(s.cycle=n.path),s.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};r.seen.set(t,o),r.sharedDefsExtractedFor=void 0,r.sharedEmitDoneFor=void 0;let u=t._zod.toJSONSchema?.();if(u)o.schema=u;else{let i={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(r,o.schema,i);else{let n=o.schema,s=r.processors[a.type];if(!s)throw Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);s(t,r,n,i)}let s=t._zod.parent;s&&(o.ref||(o.ref=s),r$(s,r,i),r.seen.get(s).isParent=!0)}let l=r.metadataRegistry.get(t);return l&&rx(o.schema,l),"input"===r.io&&function t(r,n){let i=n??{seen:new Set};if(i.seen.has(r))return!1;i.seen.add(r);let a=r._zod.def;if("transform"===a.type)return!0;if("array"===a.type)return t(a.element,i);if("set"===a.type)return t(a.valueType,i);if("lazy"===a.type)return t(a.getter(),i);if("promise"===a.type||"optional"===a.type||"nonoptional"===a.type||"nullable"===a.type||"readonly"===a.type||"default"===a.type||"prefault"===a.type||"catch"===a.type)return t(a.innerType,i);if("intersection"===a.type)return t(a.left,i)||t(a.right,i);if("record"===a.type||"map"===a.type)return t(a.keyType,i)||t(a.valueType,i);if("pipe"===a.type)return!!r._zod.traits.has("$ZodCodec")||t(a.in,i)||t(a.out,i);if("object"===a.type){for(let r in a.shape)if(t(a.shape[r],i))return!0;return!1}if("union"===a.type){for(let r of a.options)if(t(r,i))return!0;return!1}if("tuple"===a.type){for(let r of a.items)if(t(r,i))return!0;if(a.rest&&t(a.rest,i))return!0}return!1}(t)&&(delete o.schema.examples,delete o.schema.default),"input"===r.io&&"_prefault"in o.schema&&((i=o.schema).default??(i.default=o.schema._prefault)),delete o.schema._prefault,r.seen.get(t).schema}function rS(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function rZ(t,r){let n=t.seen.get(r);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;let i=new Map;for(let r of t.seen.entries()){let n=t.metadataRegistry.get(r[0])?.id;if(n){let t=i.get(n);if(t&&t!==r[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(n,r[0])}}let a=r=>{if(r[1].schema.$ref)return;let i=r[1],{ref:a,defId:s}=(r=>{let i="draft-2020-12"===t.target?"$defs":"definitions";if(t.external){let n=t.external.registry.get(r[0])?.id,a=t.external.uri??(t=>t);if(n)return{ref:a(n)};let s=r[1].defId??r[1].schema.id??`schema${t.counter++}`;return r[1].defId=s,{defId:s,ref:`${a("__shared")}#/${i}/${rS(s)}`}}let a=`#/${i}/`;if(r[1]===n&&!r[1].schema.id)return{ref:"#"};let s=r[1].schema.id??`__schema${t.counter++}`;return{defId:s,ref:a+rS(s)}})(r);i.def={...i.schema},s&&(i.defId=s);let o=i.schema;for(let t in o)delete o[t];o.$ref=a};if("throw"===t.cycles)for(let r of t.seen.entries()){let t=r[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join("/")}/<root>
54
+
55
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of t.seen.entries()){let i=n[1];if(r===n[0]){a(n);continue}if(t.external){let i=t.external.registry.get(n[0])?.id;if(r!==n[0]&&i){a(n);continue}}if(t.metadataRegistry.get(n[0])?.id||i.cycle){a(n);continue}i.count>1&&"ref"===t.reused&&a(n)}t.external&&(t.sharedDefsExtractedFor=t.external)}let rT=new Set(["type","properties","required","additionalProperties"]),rj=["oneOf","anyOf"];function rA(t){let r=t.additionalProperties;return void 0===r||!1===r||"object"!=typeof r||null===r?null:Object.keys(r).length?r:null}function rP(t){let r=[];for(let n of t){if("object"!=typeof n||"object"!==n.type)return null;for(let t in n)if(!rT.has(t))return null;r.push(n)}let n={},i=new Set;for(let t of r){for(let i in t.properties){if(Object.prototype.hasOwnProperty.call(n,i))continue;let t=[];for(let n of r){let r=n.properties?.[i]??rA(n);null!=r&&(t.some(t=>JSON.stringify(t)===JSON.stringify(r))||t.push(r))}w(n,i,1===t.length?t[0]:rP(t)??{allOf:t})}for(let r of t.required??[])i.add(r)}let a={type:"object",properties:n};if(i.size&&(a.required=[...i]),r.every(t=>!1===t.additionalProperties))a.additionalProperties=!1;else{let t=[];for(let n of r){let r=rA(n);r&&!t.some(t=>JSON.stringify(t)===JSON.stringify(r))&&t.push(r)}1===t.length?a.additionalProperties=t[0]:t.length>1&&(a.additionalProperties={allOf:t})}return a}function rE(t,r){let n=t.seen.get(r);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let i=r=>{let n=t.seen.get(r);if(null===n.ref)return;let a=n.def??n.schema,s={...a},o=n.ref;if(n.ref=null,o){i(o);let n=t.seen.get(o),u=n.schema;if(u.$ref&&("draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target)?(a.allOf=a.allOf??[],a.allOf.push(u)):rx(a,u),rx(a,s),r._zod.parent===o)for(let t in a)"$ref"!==t&&"allOf"!==t&&(t in s||delete a[t]);if(u.$ref&&n.def)for(let t in a)"$ref"!==t&&"allOf"!==t&&t in n.def&&JSON.stringify(a[t])===JSON.stringify(n.def[t])&&delete a[t]}let u=r._zod.parent;if(u&&u!==o){i(u);let r=t.seen.get(u);if(r?.schema.$ref&&(a.$ref=r.schema.$ref,r.def))for(let t in a)"$ref"!==t&&"allOf"!==t&&t in r.def&&JSON.stringify(a[t])===JSON.stringify(r.def[t])&&delete a[t]}t.override({zodSchema:r,jsonSchema:a,path:n.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(let r of[...t.seen.entries()].reverse())i(r[0]);if("openapi-3.0"!==t.target)for(let r of t.seen.entries())!function t(r){let n=r.anyOf;if(!Array.isArray(n)||0===n.length||void 0!==r.type)return;let i=[];for(let r of n){if(!r||"object"!=typeof r)return;t(r);let n=Object.keys(r);if(1!==n.length||"type"!==n[0])return;let a=r.type;for(let t of Array.isArray(a)?a:[a]){if("string"!=typeof t)return;i.includes(t)||i.push(t)}}delete r.anyOf,r.type=1===i.length?i[0]:i}(r[1].def??r[1].schema);for(let r of t.deferred)r();if(t.intersections.length){let r=new Map;for(let n of t.seen.values())for(let t of[n.schema,n.def]){let n=t?.allOf;if(!Array.isArray(n))continue;let i=r.get(n);i?i.push(t):r.set(n,[t])}for(let n of t.intersections)for(let t of r.get(n)??[])!function(t){let r=t.allOf;if(!Array.isArray(r)||r.length<2)return;for(let r of rT)if(r in t)return;let n=r.filter(t=>rj.some(r=>Array.isArray(t[r]))),i=null;if(n.length){let t=n[0],a=rj.find(r=>Array.isArray(t[r]));if(1!==Object.keys(t).length)return;let s=r.filter(r=>r!==t),o=t[a].map(t=>rP([...s,t]));if(o.some(t=>!t))return;i={[a]:o}}else i=rP(r);i&&(delete t.allOf,rx(t,i))}(t)}}let a={};if("draft-2020-12"===t.target?a.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===t.target?a.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===t.target?a.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let n=t.external.registry.get(r)?.id;if(!n)throw Error("Schema is missing an `id` property");a.$id=t.external.uri(n)}rx(a,n.defId?n.schema:n.def??n.schema);let s=t.metadataRegistry.get(r)?.id;void 0!==s&&a.id===s&&delete a.id;let o=t.external?.defs??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(let r of t.seen.entries()){let t=r[1];t.def&&t.defId&&(t.def.id===t.defId&&delete t.def.id,w(o,t.defId,t.def))}t.external&&(t.sharedEmitDoneFor=t.external),t.external||Object.keys(o).length>0&&("draft-2020-12"===t.target?a.$defs=o:a.definitions=o);try{let n=JSON.parse(JSON.stringify(a));return Object.defineProperty(n,"~standard",{value:{...r["~standard"],jsonSchema:{input:rN(r,"input",t.processors),output:rN(r,"output",t.processors)}},enumerable:!1,writable:!1}),n}catch(t){throw Error("Error converting schema to JSON.")}}let rN=(t,r,n={})=>i=>{let{libraryOptions:a,target:s}=i??{},o=rz({...a??{},target:s,io:r,processors:n});return r$(t,o),rZ(o,t),rE(o,t)},rI=(t,r,n)=>{(void 0===t[r]||n>t[r])&&(t[r]=n)},rC=(t,r,n)=>{(void 0===t[r]||n<t[r])&&(t[r]=n)},rR=(t,r)=>{rI(t,"minimum",r),rC(t,"maximum",r)},rF=(t,r)=>{t.multipleOf??(t.multipleOf=[]),t.multipleOf.includes(r)||t.multipleOf.push(r)},rM=(t,r)=>{t.patterns??(t.patterns=new Set),t.patterns.add(r)},rD=(t,r)=>{t.mime=t.mime?t.mime.filter(t=>r.includes(t)):[...r]},rL=(t,r)=>{t.format=r,r.includes("int")&&(t.isInt=!0)},rU=(t,r)=>rI(t,"minimum",r.minimum),rJ=(t,r)=>rC(t,"maximum",r.maximum),rV=t=>(r,n)=>{rL(r,n.format);let[i,a]=t[n.format];rI(r,"minimum",i),rC(r,"maximum",a)},rK={greater_than:(t,r)=>rI(t,r.inclusive?"minimum":"exclusiveMinimum",r.value),less_than:(t,r)=>rC(t,r.inclusive?"maximum":"exclusiveMaximum",r.value),multiple_of:(t,r)=>rF(t,r.value),number_format:rV(M),bigint_format:rV(D),min_length:rU,max_length:rJ,length_equals:(t,r)=>rR(t,r.length),min_size:rU,max_size:rJ,size_equals:(t,r)=>rR(t,r.size),string_format:(t,r)=>{rL(t,r.format),r.pattern&&rM(t,r.pattern),("base64"===r.format||"base64url"===r.format)&&(t.contentEncoding=r.format),(r.local||-1===r.precision)&&(t.laxFormat=!0)},mime_type:(t,r)=>rD(t,r.mime)};function rW(t){let r={},n=t._zod.def;for(let i of t._zod.traits.has("$ZodCheck")?[t,...n.checks??[]]:n.checks??[])rK[i._zod.def.check]?.(r,i._zod.def);let i=t._zod.bag;for(let t of(void 0!==i.minimum&&rI(r,"minimum",i.minimum),void 0!==i.exclusiveMinimum&&rI(r,"exclusiveMinimum",i.exclusiveMinimum),void 0!==i.maximum&&rC(r,"maximum",i.maximum),void 0!==i.exclusiveMaximum&&rC(r,"exclusiveMaximum",i.exclusiveMaximum),void 0!==i.multipleOf&&rF(r,i.multipleOf),void 0!==i.format&&(r.format??(r.format=i.format),i.format.includes("int")&&(r.isInt=!0)),i.mime&&rD(r,i.mime),i.patterns??[]))rM(r,t);return r}let rB={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},rq=new Map([[tA,/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/],[tE,/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/]]),rG=t=>rq.get(t)??t;function rY(t){let r=t._zod.def;return"pipe"===r.type&&r.in._zod.traits.has("$ZodTransform")?rY(r.out):"catch"===r.type?rY(r.innerType):t._zod.optin}let rX=new WeakMap,rH=Symbol();function rQ(t,r,n,i,a){let s=!1,o=JSON.stringify(t,(t,r)=>"bigint"!=typeof r?r:(s=!0,null));return s?(rO(r,n,i,a,"BigInt defaults cannot be represented in JSON Schema"),rH):JSON.parse(o)}let r0=(t,r,n,i)=>{let a=t._zod.def;r$(a.innerType,r,i),r.seen.get(t).ref=a.innerType},r1={get:function(){let t=this._zod;return t.message??(t.message=JSON.stringify(t.def,g,2)),t.message},set:function(t){this._zod.message=t},enumerable:!0,configurable:!0},r9={value:void 0,enumerable:!1},r4=new WeakSet([Object.prototype,Error.prototype]),r2=(t,r)=>{t.name="$ZodError",r9.value=r,Object.defineProperty(t,"issues",r9),r9.value=void 0,Object.defineProperty(t,"message",r1);let n=Object.getPrototypeOf(t);r4.has(n)||(r4.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let t=()=>this.message;return Object.defineProperty(this,"toString",{value:t,configurable:!0,writable:!0}),t},set(t){Object.defineProperty(this,"toString",{value:t,configurable:!0,writable:!0})}}))},r6=es("$ZodError",r2);function r3(t,r){return{callee:r?.callee??t,Err:r?.Err}}es("$ZodError",r2,void 0,{Parent:Error});let r5=t=>{let r=(n,i,a,s)=>{let o=a?{...a,async:!1}:{async:!1},u=n._zod.run({value:i,issues:[]},o);if(u instanceof Promise)throw new eo;if(u.issues.length){let n=new(s?.Err??t)(u.issues.map(t=>q(t,o,ed())));throw T(n,s?.callee??r),n}return u.value};return r},r7=t=>{let r=async(n,i,a,s)=>{let o=a?{...a,async:!0}:{async:!0},u=n._zod.run({value:i,issues:[]},o);if(u instanceof Promise&&(u=await u),u.issues.length){let n=new(s?.Err??t)(u.issues.map(t=>q(t,o,ed())));throw T(n,s?.callee??r),n}return u.value};return r},r8=t=>(r,n,i)=>{let a=i?{...i,async:!1}:{async:!1},s=r._zod.run({value:n,issues:[]},a);if(s instanceof Promise)throw new eo;return s.issues.length?ne(t,s.issues,a):{success:!0,data:s.value}};function ne(t,r,n){let i;return{success:!1,get error(){return i||(i=new t(r.map(t=>q(t,n,ed()))),r=void 0,n=void 0),i},set error(e){i=e,r=void 0,n=void 0}}}let nt=t=>async(r,n,i)=>{let a=i?{...i,async:!0}:{async:!0},s=r._zod.run({value:n,issues:[]},a);return s instanceof Promise&&(s=await s),s.issues.length?ne(t,s.issues,a):{success:!0,data:s.value}},nr=Symbol.for("zod.compile.invalid"),nn=Symbol.for("zod.compile.fallback"),ni=async(t,r,n)=>{let i=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},a=t._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),0===a.issues.length},na=new WeakSet([Object.prototype,Error.prototype]);function ns(t,r,n){Object.defineProperty(t,r,{configurable:!0,enumerable:!1,get(){let t=n(this);return Object.defineProperty(this,r,{value:t,configurable:!0,writable:!0}),t},set(t){Object.defineProperty(this,r,{value:t,configurable:!0,writable:!0})}})}let no=es("ZodError",(t,r)=>{r6.init(t,r),t.name="ZodError";let n=Object.getPrototypeOf(t);na.has(n)||(na.add(n),ns(n,"format",t=>r=>(function(t,r=t=>t.message){let n={_errors:[]},i=(t,a=[])=>{for(let s of t.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(t=>i({issues:t},[...a,...s.path]));else if("invalid_key"===s.code)i({issues:s.issues},[...a,...s.path]);else if("invalid_element"===s.code)i({issues:s.issues},[...a,...s.path]);else{let t=[...a,...s.path];if(0===t.length)n._errors.push(r(s));else{let i=n,a=0;for(;a<t.length;){let n=t[a],o=a===t.length-1;if("_errors"===n){o&&i._errors.push(r(s)),a++;continue}Object.prototype.hasOwnProperty.call(i,n)||Object.defineProperty(i,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let u=i[n];o&&u._errors.push(r(s)),i=u,a++}}}};return i(t),n})(t,r)),ns(n,"flatten",t=>r=>(function(t,r=t=>t.message){let n={},i=[];for(let o of t.issues)if(o.path.length>0){var a,s;(a=o.path[0],s=()=>[],!Object.prototype.hasOwnProperty.call(n,a)&&("__proto__"===a?Object.defineProperty(n,a,{value:s(),writable:!0,enumerable:!0,configurable:!0}):n[a]=s()),n[a]).push(r(o))}else i.push(r(o));return{formErrors:i,fieldErrors:n}})(t,r)),ns(n,"addIssue",t=>r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,g,2)}),ns(n,"addIssues",t=>r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,g,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error}),nu=r5(no),nl=r7(no),nd=r8(no),nc=nt(no),np=(u=r5(no),l=(t,r,n,i)=>u(t,r,n?{...n,direction:"backward"}:{direction:"backward"},r3(l,i))),nf=(d=r5(no),c=(t,r,n,i)=>d(t,r,n,r3(c,i))),nh=(p=r7(no),f=async(t,r,n,i)=>{let a=n?{...n,direction:"backward"}:{direction:"backward"};return await p(t,r,a,r3(f,i))}),nm=(h=r7(no),m=async(t,r,n,i)=>await h(t,r,n,r3(m,i))),ny=(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return r8(no)(t,r,i)},n_=(t,r,n)=>r8(no)(t,r,n),ng=async(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return nt(no)(t,r,i)},nv=async(t,r,n)=>nt(no)(t,r,n);function nb(){el.memoizer||ed({memoizer:eg})}let nk=es("ZodType",(t,r)=>(el.localeError||ed({localeError:(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function i(t,r){return"number"!==t||"number"!=typeof r||Number.isFinite(r)?n[t]??t:String(r)}return n=>{switch(n.code){case"invalid_type":{let t=i(n.expected),r=i(function(t){let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"nan":"number";case"object":if(null===t)return"null";if(Array.isArray(t))return"array";if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}return r}(n.input),n.input);return`Invalid input: expected ${t}, received ${r}`}case"invalid_value":if(1===n.values.length)return`Invalid input: expected ${F(n.values[0])}`;return`Invalid option: expected one of ${_(n.values,"|")}`;case"too_big":{let r=n.exact?"exactly ":n.inclusive?"<=":"<",i=t[n.origin]??null;if(i)return`Too big: expected ${n.origin??"value"} to have ${r}${n.maximum.toString()} ${i.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${r}${n.maximum.toString()}`}case"too_small":{let r=n.exact?"exactly ":n.inclusive?">=":">",i=t[n.origin]??null;if(i)return`Too small: expected ${n.origin} to have ${r}${n.minimum.toString()} ${i.unit}`;return`Too small: expected ${n.origin} to be ${r}${n.minimum.toString()}`}case"invalid_format":if("starts_with"===n.format)return`Invalid string: must start with "${n.prefix}"`;if("ends_with"===n.format)return`Invalid string: must end with "${n.suffix}"`;if("includes"===n.format)return`Invalid string: must include "${n.includes}"`;if("regex"===n.format)return`Invalid string: must match pattern ${n.pattern}`;return`Invalid ${r[n.format]??n.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":if(n.options&&Array.isArray(n.options)&&n.options.length>0){let t=n.options.map(t=>`'${t}'`).join(" | ");return`Invalid discriminator value. Expected ${t}`}if(!1===n.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}})()}),te.init(t,r),t.def=r,t.type=r.type,t),{check(...t){let r=this.def;return this.clone(Z(r,{checks:[...r.checks??[],...t.map(t=>"function"==typeof t?{_zod:{check:t,def:{check:"custom"},onattach:[]}}:t)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,r){return C(this,t,r)},brand(){return this},register(t,r){return t.add(this,r),this},refine(t,r){return this.check(function(t,r={}){return new iO({type:"custom",check:"custom",fn:t,...R(r)})}(t,r))},superRefine(t,r){return this.check(function(t,r){var n;let i,a;return n=r=>(r.addIssue=t=>{"string"==typeof t?r.issues.push(H(t,r.value,i._zod.def)):(t.fatal&&(t.continue=!1),t.code??(t.code="custom"),"input"in t||(t.input=r.value),t.inst??(t.inst=i),t.continue??(t.continue=!i._zod.def.abort),r.issues.push(H(t)))},t(r.value,r)),(a=new eV({check:"custom",...R(r)}))._zod.check=n,i=a}(t,r))},overwrite(t){return this.check(rw(t))},optional(){return ic(this)},exactOptional(){var t;return t=this,new ip({type:"optional",innerType:t})},nullable(){return im(this)},nullish(){return ic(im(this))},nonoptional(t){var r;return r=this,new ig({type:"nonoptional",innerType:r,...R(t)})},array(){return n3(this)},or(t){return ie([this,t])},and(t){var r;return r=this,new it({type:"intersection",left:r,right:t})},transform(t){return ik(this,new il({type:"transform",transform:t}))},default(t){var r,n;return r=this,n=t,new iy({type:"default",innerType:r,get defaultValue(){return"function"==typeof n?n():E(n)}})},prefault(t){var r,n;return r=this,n=t,new i_({type:"prefault",innerType:r,get defaultValue(){return"function"==typeof n?n():E(n)}})},catch(t){return function(t,r){let n;return new iv({type:"catch",innerType:t,catchValue:"function"==typeof r?r:((n=()=>r)["~constantCatch"]=!0,n)})}(this,t)},pipe(t){return ik(this,t)},readonly(){var t;return t=this,new iw({type:"readonly",innerType:t})},describe(t){let r=this.clone();return rp.add(r,{description:t}),r},meta(...t){if(0===t.length)return rp.get(this);let r=this.clone();return rp.add(r,t[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...r){return 0===r.length?t(this):t(this,...r)},get"~standard"(){return Q(this,"~standard",{...tn(this),jsonSchema:{input:rN(this,"input"),output:rN(this,"output")}},!1)},set"~standard"(value){Q(this,"~standard",value)},parse:function t(r,n){return nu(this,r,n,{callee:t})},parseAsync:async function t(r,n){return await nl(this,r,n,{callee:t})},safeParse(t,r){return nd(this,t,r)},async safeParseAsync(t,r){return nc(this,t,r)},get spa(){return this?.safeParseAsync},set spa(value){Q(this,"spa",value)},validate(t,r){let n=this._zod.bag.validator;if(void 0!==n){if(n(t)!==nr)return!0;if(!0===n.definite&&void 0===r)return!1}return function(t,r,n){let i,a=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},s=t._zod.bag.fallbackRun;if(s?(a[nn]=!0,i=s({value:r,issues:[]},a)):i=t._zod.run({value:r,issues:[]},a),i instanceof Promise)throw new eo;return 0===i.issues.length}(this,t,r)},validateAsync(t,r){return ni(this,t,r)},encode:function t(r,n){return np(this,r,n,{callee:t})},decode:function t(r,n){return nf(this,r,n,{callee:t})},encodeAsync:async function t(r,n){return await nh(this,r,n,{callee:t})},decodeAsync:async function t(r,n){return await nm(this,r,n,{callee:t})},safeEncode(t,r){return ny(this,t,r)},safeDecode(t,r){return n_(this,t,r)},async safeEncodeAsync(t,r){return ng(this,t,r)},async safeDecodeAsync(t,r){return nv(this,t,r)},toJSONSchema(t){return((t,r={})=>n=>{let i=rz({...n,processors:r});return r$(t,i),rZ(i,t),rE(i,t)})(this,{})(t)},get description(){return rp.get(this)?.description},get _def(){return this._zod.def}}),nw=es("_ZodString",(t,r)=>{ti.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{n.type="string";let{minimum:a,maximum:s,format:o,patterns:u,contentEncoding:l,laxFormat:d}=rW(t);if("number"==typeof a&&(n.minLength=a),"number"==typeof s&&(n.maxLength=s),o&&(n.format=rB[o]??o,""===n.format&&delete n.format,("time"===o||d)&&delete n.format),l&&(n.contentEncoding=l),u&&u.size>0){let t=[...u].map(rG);1===t.length?n.pattern=t[0].source:t.length>1&&(n.allOf=[...t.map(t=>({..."draft-07"===r.target||"draft-04"===r.target||"openapi-3.0"===r.target?{type:"string"}:{},pattern:t.source}))])}})(t,r,n,0)},ee({format:t=>rW(t).format??null,minLength:t=>rW(t).minimum??null,maxLength:t=>rW(t).maximum??null},{regex(...t){return this.check(function(t,r){return new e1({check:"string_format",format:"regex",...R(r),pattern:t})}(...t))},includes(...t){return this.check(function(t,r){return new e2({check:"string_format",format:"includes",...R(r),includes:t})}(...t))},startsWith(...t){return this.check(function(t,r){return new e6({check:"string_format",format:"starts_with",...R(r),prefix:t})}(...t))},endsWith(...t){return this.check(function(t,r){return new e3({check:"string_format",format:"ends_with",...R(r),suffix:t})}(...t))},min(...t){return this.check(rb(...t))},max(...t){return this.check(rv(...t))},length(...t){return this.check(rk(...t))},nonempty(...t){return this.check(rb(1,...t))},lowercase(t){return this.check(new e9({check:"string_format",format:"lowercase",...R(t)}))},uppercase(t){return this.check(new e4({check:"string_format",format:"uppercase",...R(t)}))},trim(){return this.check(rw(t=>t.trim()))},normalize(...t){return this.check(function(t){return rw(r=>r.normalize(t))}(...t))},toLowerCase(){return this.check(rw(t=>t.toLowerCase()))},toUpperCase(){return this.check(rw(t=>t.toUpperCase()))},slugify(){return this.check(rw(t=>t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}})),nx=es("ZodString",(t,r)=>{ti.init(t,r),nw.init(t,r)},{email(t){return this.check(new nj({type:"string",format:"email",check:"string_format",abort:!1,...R(t)}))},url(t){return this.check(new nE({type:"string",format:"url",check:"string_format",abort:!1,...R(t)}))},jwt(t){return this.check(new nq({type:"string",format:"jwt",check:"string_format",abort:!1,...R(t)}))},emoji(t){return this.check(new nN({type:"string",format:"emoji",check:"string_format",abort:!1,...R(t)}))},guid(t){return this.check(new nA({type:"string",format:"guid",check:"string_format",abort:!1,...R(t)}))},uuid(t){return this.check(new nP({type:"string",format:"uuid",check:"string_format",abort:!1,...R(t)}))},uuidv4(t){return this.check(new nP({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...R(t)}))},uuidv6(t){return this.check(new nP({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...R(t)}))},uuidv7(t){return this.check(new nP({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...R(t)}))},nanoid(t){return this.check(new nI({type:"string",format:"nanoid",check:"string_format",abort:!1,...R(t)}))},cuid(t){return this.check(new nC({type:"string",format:"cuid",check:"string_format",abort:!1,...R(t)}))},cuid2(t){return this.check(new nR({type:"string",format:"cuid2",check:"string_format",abort:!1,...R(t)}))},ulid(t){return this.check(new nF({type:"string",format:"ulid",check:"string_format",abort:!1,...R(t)}))},base64(t){return this.check(new nK({type:"string",format:"base64",check:"string_format",abort:!1,...R(t)}))},base64url(t){return this.check(new nW({type:"string",format:"base64url",check:"string_format",abort:!1,...R(t)}))},xid(t){return this.check(new nM({type:"string",format:"xid",check:"string_format",abort:!1,...R(t)}))},ksuid(t){return this.check(new nD({type:"string",format:"ksuid",check:"string_format",abort:!1,...R(t)}))},ipv4(t){return this.check(new nL({type:"string",format:"ipv4",check:"string_format",abort:!1,...R(t)}))},ipv6(t){return this.check(new nU({type:"string",format:"ipv6",check:"string_format",abort:!1,...R(t)}))},cidrv4(t){return this.check(new nJ({type:"string",format:"cidrv4",check:"string_format",abort:!1,...R(t)}))},cidrv6(t){return this.check(new nV({type:"string",format:"cidrv6",check:"string_format",abort:!1,...R(t)}))},e164(t){return this.check(new nB({type:"string",format:"e164",check:"string_format",abort:!1,...R(t)}))},datetime(t){return this.check(new n$({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...R(t)}))},date(t){return this.check(new nS({type:"string",format:"date",check:"string_format",...R(t)}))},time(t){return this.check(new nZ({type:"string",format:"time",check:"string_format",precision:null,...R(t)}))},duration(t){return this.check(new nT({type:"string",format:"duration",check:"string_format",...R(t)}))}});function nz(t){return new nx(rf({type:"string",...R(t)}))}let nO=es("ZodStringFormat",(t,r)=>{ta.init(t,r),nw.init(t,r)}),n$=es("ZodISODateTime",(t,r)=>{tb.init(t,r),nO.init(t,r)}),nS=es("ZodISODate",(t,r)=>{tk.init(t,r),nO.init(t,r)}),nZ=es("ZodISOTime",(t,r)=>{tw.init(t,r),nO.init(t,r)}),nT=es("ZodISODuration",(t,r)=>{tx.init(t,r),nO.init(t,r)}),nj=es("ZodEmail",(t,r)=>{tu.init(t,r),nO.init(t,r)}),nA=es("ZodGUID",(t,r)=>{ts.init(t,r),nO.init(t,r)}),nP=es("ZodUUID",(t,r)=>{to.init(t,r),nO.init(t,r)}),nE=es("ZodURL",(t,r)=>{tp.init(t,r),nO.init(t,r)}),nN=es("ZodEmoji",(t,r)=>{tf.init(t,r),nO.init(t,r)}),nI=es("ZodNanoID",(t,r)=>{th.init(t,r),nO.init(t,r)}),nC=es("ZodCUID",(t,r)=>{tm.init(t,r),nO.init(t,r)}),nR=es("ZodCUID2",(t,r)=>{ty.init(t,r),nO.init(t,r)}),nF=es("ZodULID",(t,r)=>{t_.init(t,r),nO.init(t,r)}),nM=es("ZodXID",(t,r)=>{tg.init(t,r),nO.init(t,r)}),nD=es("ZodKSUID",(t,r)=>{tv.init(t,r),nO.init(t,r)}),nL=es("ZodIPv4",(t,r)=>{tz.init(t,r),nO.init(t,r)}),nU=es("ZodIPv6",(t,r)=>{tS.init(t,r),nO.init(t,r)}),nJ=es("ZodCIDRv4",(t,r)=>{tZ.init(t,r),nO.init(t,r)}),nV=es("ZodCIDRv6",(t,r)=>{tT.init(t,r),nO.init(t,r)}),nK=es("ZodBase64",(t,r)=>{tP.init(t,r),nO.init(t,r)}),nW=es("ZodBase64URL",(t,r)=>{tN.init(t,r),nO.init(t,r)}),nB=es("ZodE164",(t,r)=>{tI.init(t,r),nO.init(t,r)}),nq=es("ZodJWT",(t,r)=>{tC.init(t,r),nO.init(t,r)}),nG=es("ZodNumber",(t,r)=>{tR.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let{minimum:a,maximum:s,multipleOf:o,exclusiveMaximum:u,exclusiveMinimum:l,isInt:d}=rW(t);n.type=d?"integer":"number";let c="number"==typeof l&&l>=(a??-1/0),p="number"==typeof u&&u<=(s??1/0),f="draft-04"===r.target||"openapi-3.0"===r.target;if(c?f?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:"number"==typeof a&&(n.minimum=a),p?f?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:"number"==typeof s&&(n.maximum=s),o){let a=new Set;for(let s of o)Number.isFinite(s)&&0!==s?a.add(Math.abs(s)):rO(t,r,n,i,`A multipleOf divisor of ${s} cannot be represented in JSON Schema`);let[s,...u]=a;void 0!==s&&(n.multipleOf=s),u.length&&(n.allOf=[...n.allOf??[],...u.map(t=>({multipleOf:t}))])}})(t,r,n,i),t.isFinite=!0},ee({minValue:t=>{let{minimum:r,exclusiveMinimum:n}=rW(t);return Math.max(r??-1/0,n??-1/0)},maxValue:t=>{let{maximum:r,exclusiveMaximum:n}=rW(t);return Math.min(r??1/0,n??1/0)},isInt:t=>{let{isInt:r,multipleOf:n}=rW(t);return!!r||!!n?.some(Number.isSafeInteger)},format:t=>rW(t).format??null},{gt(t,r){return this.check(ry(t,r))},gte(t,r){return this.check(r_(t,r))},min(t,r){return this.check(r_(t,r))},lt(t,r){return this.check(rh(t,r))},lte(t,r){return this.check(rm(t,r))},max(t,r){return this.check(rm(t,r))},int(t){return this.check(nH(t))},safe(t){return this.check(nH(t))},positive(t){return this.check(ry(0,t))},nonnegative(t){return this.check(r_(0,t))},negative(t){return this.check(rh(0,t))},nonpositive(t){return this.check(rm(0,t))},multipleOf(t,r){return this.check(rg(t,r))},step(t,r){return this.check(rg(t,r))},finite(){return this}}));function nY(t){return new nG(rf({type:"number",checks:[],...R(t)}))}let nX=es("ZodNumberFormat",(t,r)=>{tF.init(t,r),nG.init(t,r)});function nH(t){return new nX({type:"number",check:"number_format",abort:!1,format:"safeint",...R(t)})}let nQ=es("ZodBoolean",(t,r)=>{tM.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(t,r,n)=>{r.type="boolean"}});function n0(t){return new nQ({type:"boolean",...R(t)})}let n1=es("ZodUnknown",(t,r)=>{tD.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(t,r,n)=>{}});function n9(){return new n1({type:"unknown"})}let n4=es("ZodNever",(t,r)=>{tL.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(t,r,n)=>{r.not={}}});function n2(t){return new n4({type:"never",...R(t)})}let n6=es("ZodArray",(t,r)=>{nb(),tJ.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let a=t._zod.def,{minimum:s,maximum:o}=rW(t);"number"==typeof s&&(n.minItems=s),"number"==typeof o&&(n.maxItems=o),n.type="array",n.items=r$(a.element,r,{...i,path:[...i.path,"items"]})})(t,r,n,i),t.element=r.element},{min(t,r){return this.check(rb(t,r))},nonempty(t){return this.check(rb(1,t))},max(t,r){return this.check(rv(t,r))},length(t,r){return this.check(rk(t,r))},unwrap(){return this.element}});function n3(t,r){return new n6({type:"array",element:t,...R(r)})}let n5=es("ZodObject",(t,r)=>{var n;let i,a;nb(),tG.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let a=t._zod.def,s=a.shape;if(Object.getOwnPropertySymbols(s).length&&rO(t,r,n,i,"Symbol keys cannot be represented in JSON Schema"))return;for(let t in n.type="object",n.properties={},s)w(n.properties,t,r$(s[t],r,{...i,path:[...i.path,"properties",t]}));let o=[];for(let t of Object.keys(s)){let n=a.shape[t];("input"===r.io?void 0===rY(n):void 0===n._zod.optout)&&o.push(t)}o.length>0&&(n.required=o),a.catchall?._zod.def.type==="never"?n.additionalProperties=!1:a.catchall?a.catchall&&(n.additionalProperties=r$(a.catchall,r,{...i,path:[...i.path,"additionalProperties"]})):"output"===r.io&&(n.additionalProperties=!1)})(t,r,n,i),n="shape",(a=n in(i=Object.getPrototypeOf(t))?void 0:i)&&Object.defineProperty(a,n,{configurable:!0,get(){let t={configurable:!0,writable:!0,enumerable:!1,value:void 0};return Object.defineProperty(this,n,t),t.value=(t=>t._zod.def.shape)(this),Object.defineProperty(this,n,t),t.value},set(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:!1,value:t})}})},{keyof(){return is(Object.keys(this._zod.def.shape))},catchall(t){return this.clone(Z(this._zod.def,{catchall:t}))},passthrough(){return this.clone(Z(this._zod.def,{catchall:n9()}))},loose(){return this.clone(Z(this._zod.def,{catchall:n9()}))},strict(){return this.clone(Z(this._zod.def,{catchall:n2()}))},strip(){return this.clone(Z(this._zod.def,{catchall:void 0}))},extend(t){if(!P(t))throw Error("Invalid input to extend: expected a plain object");let r=this._zod.def.checks;if(r&&r.length>0){let r=z(this);for(let n of Reflect.ownKeys(t))if(void 0!==Object.getOwnPropertyDescriptor(r,n))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return C(this,Z(this._zod.def,{shape:U(this,t)}))},safeExtend(t){if(!P(t))throw Error("Invalid input to safeExtend: expected a plain object");return C(this,Z(this._zod.def,{shape:U(this,t)}))},merge(t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(this._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};return S(r,this,Reflect.ownKeys(z(this))),S(r,t,Reflect.ownKeys(z(t))),C(this,Z(this._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))},pick(t){return function(t,r){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let a={};return S(a,t,L(t,r)),C(t,Z(n,{shape:a,checks:[]}))}(this,t)},omit(t){return function(t,r){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let a=new Set(L(t,r)),s={};return S(s,t,Reflect.ownKeys(z(t)).filter(t=>!a.has(t))),C(t,Z(n,{shape:s,checks:[]}))}(this,t)},partial(...t){return J(id,this,t[0])},exactPartial(...t){return J(ip,this,t[0],"exactPartial")},required(...t){var r;let n,i;return n=(r=t[0])?new Set(L(this,r)):void 0,S(i={},this,Reflect.ownKeys(z(this)),(t,r)=>n&&!n.has(r)?t:new ig({type:"nonoptional",innerType:t})),C(this,Z(this._zod.def,{shape:i}))}});function n7(t,r){return new n5({type:"object",shape:t??{},...R(r)})}let n8=es("ZodUnion",(t,r)=>{tX.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>{let a,s,o;return s=!1===(a=t._zod.def).inclusive,o=a.options.map((t,n)=>r$(t,r,{...i,path:[...i.path,s?"oneOf":"anyOf",n]})),void(s?n.oneOf=o:n.anyOf=o)},t.options=r.options});function ie(t,r){return new n8({type:"union",options:t,...R(r)})}let it=es("ZodIntersection",(t,r)=>{tH.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>{let a,s,o,u,l;return s=r$((a=t._zod.def).left,r,{...i,path:[...i.path,"allOf",0]}),o=r$(a.right,r,{...i,path:[...i.path,"allOf",1]}),void(n.allOf=l=[...(u=t=>"allOf"in t&&1===Object.keys(t).length)(s)?s.allOf:[s],...u(o)?o.allOf:[o]],r.intersections.push(l))}}),ir=es("ZodRecord",(t,r)=>{nb(),t0.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let a=t._zod.def;n.type="object";let s=a.keyType,o=rW(s).patterns;if("loose"===a.mode&&o&&o.size>0){let t=r$(a.valueType,r,{...i,path:[...i.path,"patternProperties","*"]});for(let r of(n.patternProperties={},o))w(n.patternProperties,rG(r).source,t)}else{if("draft-07"===r.target||"draft-2020-12"===r.target){n.propertyNames=r$(a.keyType,r,{...i,path:[...i.path,"propertyNames"]});let s=rX.get(r);s||(s=[],rX.set(r,s),r.deferred.push(()=>(function(t){let r=new Map;for(let n of t.seen.values())n.def&&!r.has(n.schema)&&r.set(n.schema,n);let n=new Map;for(let i of rX.get(t)??[]){let a=t.seen.get(i),s=(a?.def??a?.schema)?.propertyNames;if(!s||!0===s||n.has(s))continue;let o=function t(r,n,i){if(n.$ref){if(i.has(n))return n;i.add(n);let a=r.get(n)?.def;if(!a)return n;let s=t(r,a,i);return s===a?n:s}for(let a of["anyOf","oneOf"]){let s=n[a];if(!Array.isArray(s))continue;let o=s.map(n=>t(r,n,i));o.some((t,r)=>t!==s[r])&&(n={...n,[a]:o})}let a=Array.isArray(n.type)?n.type:[n.type],s=!a.includes("string")&&a.some(t=>"number"===t||"integer"===t),o=n.enum??(void 0!==n.const?[n.const]:void 0);if(!s&&!o?.some(t=>"number"==typeof t))return n;let{minimum:u,maximum:l,exclusiveMinimum:d,exclusiveMaximum:c,multipleOf:p,format:f,id:h,...m}=n;return m.enum?m.enum=m.enum.map(t=>"number"==typeof t?String(t):t):"number"==typeof m.const&&(m.const=String(m.const)),s&&(m.type="string",o||(m.pattern=(a.includes("number")?eD:eM).source)),m}(r,s,new Set);o!==s&&n.set(s,o)}if(n.size)for(let r of t.seen.values())for(let t of[r.schema,r.def]){let r=t&&n.get(t.propertyNames);r&&(t.propertyNames=r)}})(r))),s.push(t)}n.additionalProperties=r$(a.valueType,r,{...i,path:[...i.path,"additionalProperties"]})}let u=s._zod.values,l="input"===r.io&&void 0!==rY(a.valueType);if(u&&!a.partial&&!l){let t=[...u].filter(t=>"string"==typeof t||"number"==typeof t);t.length>0&&(n.required=t.map(String))}})(t,r,n,i),t.keyType=r.keyType,t.valueType=r.valueType});function ii(t,r,n){return new ir(r&&r._zod?{type:"record",keyType:t,valueType:r,...R(n)}:{type:"record",keyType:nz(),valueType:t,...R(r)})}let ia=es("ZodEnum",(t,r)=>{t1.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let a=y(t._zod.def.entries);if(0===a.length){n.not={};return}a.every(t=>"number"==typeof t)&&(n.type="number"),a.every(t=>"string"==typeof t)&&(n.type="string"),n.enum=a})(t,0,n,0),t.enum=r.entries,t.options=[...t._zod.values];let n=new Set(Object.keys(r.entries));t.extract=(t,i)=>{let a={};for(let i of t)if(n.has(i))a[i]=r.entries[i];else throw Error(`Key ${i} not found in enum`);return new ia({...r,checks:[],...R(i),entries:a})},t.exclude=(t,i)=>{let a={...r.entries};for(let r of t)if(n.has(r))delete a[r];else throw Error(`Key ${r} not found in enum`);return new ia({...r,checks:[],...R(i),entries:a})}});function is(t,r){return new ia({type:"enum",entries:Array.isArray(t)?Object.fromEntries(t.map(t=>[t,t])):t,...R(r)})}let io=es("ZodLiteral",(t,r)=>{t9.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let a=t._zod.def;if(0===a.values.length){n.not={};return}let s=[];for(let o of a.values)if(void 0===o){if(rO(t,r,n,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if("bigint"==typeof o){if(rO(t,r,n,i,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(o))}else s.push(o);if(0===s.length);else if(1===s.length){let t=s[0];n.type=null===t?"null":typeof t,"draft-04"===r.target||"openapi-3.0"===r.target?n.enum=[t]:n.const=t}else s.every(t=>"number"==typeof t)&&(n.type="number"),s.every(t=>"string"==typeof t)&&(n.type="string"),s.every(t=>"boolean"==typeof t)&&(n.type="boolean"),s.every(t=>null===t)&&(n.type="null"),n.enum=s})(t,r,n,i),t.values=new Set(r.values),Object.defineProperty(t,"value",{get(){if(r.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function iu(t,r){return new io({type:"literal",values:Array.isArray(t)?t:[t],...R(r)})}let il=es("ZodTransform",(t,r)=>{nb(),t4.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>{rO(t,r,n,i,"Transforms cannot be represented in JSON Schema")},t._zod.parse=(n,i)=>{if("backward"===i.direction)throw new eu(t.constructor.name);n.addIssue=i=>{"string"==typeof i?n.issues.push(H(i,n.value,r)):(i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=t),n.issues.push(H(i)))};let a=r.transform(n.value,n);return a instanceof Promise?a.then(t=>(n.value=t,n)):(n.value=a,n)}}),id=es("ZodOptional",(t,r)=>{t6.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>r0(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function ic(t){return new id({type:"optional",innerType:t})}let ip=es("ZodExactOptional",(t,r)=>{t3.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>r0(t,r,n,i),t.unwrap=()=>t._zod.def.innerType}),ih=es("ZodNullable",(t,r)=>{t5.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>{let a,s,o;return s=r$((a=t._zod.def).innerType,r,i),o=r.seen.get(t),void("openapi-3.0"===r.target?(o.ref=a.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}])},t.unwrap=()=>t._zod.def.innerType});function im(t){return new ih({type:"nullable",innerType:t})}let iy=es("ZodDefault",(t,r)=>{t7.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>{let a,s;return r$((a=t._zod.def).innerType,r,i),r.seen.get(t).ref=a.innerType,void((s=rQ(a.defaultValue,t,r,n,i))!==rH&&(n.default=s))},t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap}),i_=es("ZodPrefault",(t,r)=>{re.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let a=t._zod.def;if(r$(a.innerType,r,i),r.seen.get(t).ref=a.innerType,"input"!==r.io)return;let s=rQ(a.defaultValue,t,r,n,i);s!==rH&&(n._prefault=s)})(t,r,n,i),t.unwrap=()=>t._zod.def.innerType}),ig=es("ZodNonOptional",(t,r)=>{rt.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>{let a;r$((a=t._zod.def).innerType,r,i),r.seen.get(t).ref=a.innerType},t.unwrap=()=>t._zod.def.innerType}),iv=es("ZodCatch",(t,r)=>{ri.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let a,s=t._zod.def;r$(s.innerType,r,i),r.seen.get(t).ref=s.innerType;try{a=s.catchValue(void 0)}catch{rO(t,r,n,i,"Dynamic catch values are not supported in JSON Schema");return}n.default=a})(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap}),ib=es("ZodPipe",(t,r)=>{ra.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>{let a,s,o;return s=(a=t._zod.def).in._zod.traits.has("$ZodTransform"),void(r$(o="input"===r.io?s?a.out:a.in:a.out,r,i),r.seen.get(t).ref=o)},t.in=r.in,t.out=r.out});function ik(t,r){return new ib({type:"pipe",in:t,out:r})}let iw=es("ZodReadonly",(t,r)=>{ro.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>{let a;r$((a=t._zod.def).innerType,r,i),r.seen.get(t).ref=a.innerType,n.readOnly=!0},t.unwrap=()=>t._zod.def.innerType}),ix=es("ZodLazy",(t,r)=>{rl.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>{let a;r$(a=t._zod.innerType,r,i),r.seen.get(t).ref=a},t.unwrap=()=>t._zod.def.getter()});function iz(t){return new ix({type:"lazy",getter:t})}let iO=es("ZodCustom",(t,r)=>{rd.init(t,r),nk.init(t,r),t._zod.processJSONSchema=(r,n,i)=>{rO(t,r,n,i,"Custom types cannot be represented in JSON Schema")}})}}]);
56
+ //# sourceMappingURL=module-zod.da562d5b5226.js.map