UNPKG

prettier-plugin-classnames

Version:

A Prettier plugin that wraps verbose class name based on the `printWidth` option.

1 lines 98.3 kB
"use strict";var Ge=Object.defineProperty;var Vt=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var qt=Object.prototype.hasOwnProperty;var Qt=(r,e)=>{for(var t in e)Ge(r,t,{get:e[t],enumerable:!0})},Jt=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of zt(e))!qt.call(r,a)&&a!==t&&Ge(r,a,{get:()=>e[a],enumerable:!(s=Vt(e,a))||s.enumerable});return r};var Ut=r=>Jt(Ge({},"__esModule",{value:!0}),r);var Gr={};Qt(Gr,{options:()=>pt,parsers:()=>Pt,printers:()=>Zt});module.exports=Ut(Gr);var pt={customAttributes:{since:"0.1.0",type:"string",array:!0,category:"Format",default:[{value:[]}],description:"List of attributes that enclosing class names. The `class` and `className` attributes are always supported, even if no options are specified."},customFunctions:{since:"0.1.0",type:"string",array:!0,category:"Format",default:[{value:[]}],description:"List of functions that enclosing class names. The `classNames` function is always supported, even if no options are specified."},endingPosition:{since:"0.5.0",type:"choice",category:"Format",default:"absolute",description:"This is the criterion for ending the class name on each line when replacing the original class name with a multi-line class name.",choices:[{value:"absolute",description:"Each line ends at a `printWidth` distance from the start of the line."},{value:"relative",description:"Each line ends at a `printWidth` distance from the start of the class name."}]},syntaxTransformation:{since:"0.7.7",type:"boolean",category:"Format",default:!1,description:"If a line wrapping occurs in a class name written in non-expression syntax, it is transformed into expression syntax. This transformation does not support reversible formatting."}};var We=require("prettier"),Rt=require("prettier/plugins/babel"),Ke=require("prettier/plugins/html"),$t=require("prettier/plugins/typescript");var N;(function(r){r.assertEqual=a=>a;function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{let i={};for(let c of a)i[c]=c;return i},r.getValidEnumValues=a=>{let i=r.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),c={};for(let l of i)c[l]=a[l];return r.objectValues(c)},r.objectValues=a=>r.objectKeys(a).map(function(i){return a[i]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let i=[];for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&i.push(c);return i},r.find=(a,i)=>{for(let c of a)if(i(c))return c},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function s(a,i=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(i)}r.joinValues=s,r.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(N||(N={}));var et;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(et||(et={}));var T=N.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ne=r=>{switch(typeof r){case"undefined":return T.undefined;case"string":return T.string;case"number":return isNaN(r)?T.nan:T.number;case"boolean":return T.boolean;case"function":return T.function;case"bigint":return T.bigint;case"symbol":return T.symbol;case"object":return Array.isArray(r)?T.array:r===null?T.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?T.promise:typeof Map<"u"&&r instanceof Map?T.map:typeof Set<"u"&&r instanceof Set?T.set:typeof Date<"u"&&r instanceof Date?T.date:T.object;default:return T.unknown}},k=N.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"]),Xt=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),J=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(i){return i.message},s={_errors:[]},a=i=>{for(let c of i.issues)if(c.code==="invalid_union")c.unionErrors.map(a);else if(c.code==="invalid_return_type")a(c.returnTypeError);else if(c.code==="invalid_arguments")a(c.argumentsError);else if(c.path.length===0)s._errors.push(t(c));else{let l=s,u=0;for(;u<c.path.length;){let o=c.path[u];u===c.path.length-1?(l[o]=l[o]||{_errors:[]},l[o]._errors.push(t(c))):l[o]=l[o]||{_errors:[]},l=l[o],u++}}};return a(this),s}toString(){return this.message}get message(){return JSON.stringify(this.issues,N.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},s=[];for(let a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):s.push(e(a));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}};J.create=r=>new J(r);var Re=(r,e)=>{let t;switch(r.code){case k.invalid_type:r.received===T.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case k.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,N.jsonStringifyReplacer)}`;break;case k.unrecognized_keys:t=`Unrecognized key(s) in object: ${N.joinValues(r.keys,", ")}`;break;case k.invalid_union:t="Invalid input";break;case k.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${N.joinValues(r.options)}`;break;case k.invalid_enum_value:t=`Invalid enum value. Expected ${N.joinValues(r.options)}, received '${r.received}'`;break;case k.invalid_arguments:t="Invalid function arguments";break;case k.invalid_return_type:t="Invalid function return type";break;case k.invalid_date:t="Invalid date";break;case k.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:N.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case k.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case k.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case k.custom:t="Invalid input";break;case k.invalid_intersection_types:t="Intersection results could not be merged";break;case k.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case k.not_finite:t="Number must be finite";break;default:t=e.defaultError,N.assertNever(r)}return{message:t}},mt=Re;function Wt(r){mt=r}function Me(){return mt}var Be=r=>{let{data:e,path:t,errorMaps:s,issueData:a}=r,i=[...t,...a.path||[]],c={...a,path:i},l="",u=s.filter(o=>!!o).slice().reverse();for(let o of u)l=o(c,{data:e,defaultError:l}).message;return{...a,path:i,message:a.message||l}},Kt=[];function S(r,e){let t=Be({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Me(),Re].filter(s=>!!s)});r.common.issues.push(t)}var z=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let s=[];for(let a of t){if(a.status==="aborted")return O;a.status==="dirty"&&e.dirty(),s.push(a.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){let s=[];for(let a of t)s.push({key:await a.key,value:await a.value});return r.mergeObjectSync(e,s)}static mergeObjectSync(e,t){let s={};for(let a of t){let{key:i,value:c}=a;if(i.status==="aborted"||c.status==="aborted")return O;i.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof c.value<"u"||a.alwaysSet)&&(s[i.value]=c.value)}return{status:e.value,value:s}}},O=Object.freeze({status:"aborted"}),gt=r=>({status:"dirty",value:r}),q=r=>({status:"valid",value:r}),tt=r=>r.status==="aborted",rt=r=>r.status==="dirty",$e=r=>r.status==="valid",Fe=r=>typeof Promise<"u"&&r instanceof Promise,I;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(I||(I={}));var X=class{constructor(e,t,s,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ft=(r,e)=>{if($e(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new J(r.common.issues);return this._error=t,this._error}}};function C(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:s,description:a}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(c,l)=>c.code!=="invalid_type"?{message:l.defaultError}:typeof l.data>"u"?{message:s??l.defaultError}:{message:t??l.defaultError},description:a}}var L=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return ne(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ne(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new z,ctx:{common:e.parent.common,data:e.data,parsedType:ne(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Fe(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;let a={common:{issues:[],async:(s=t?.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ne(e)},i=this._parseSync({data:e,path:a.path,parent:a});return ft(a,i)}async parseAsync(e,t){let s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){let s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ne(e)},a=this._parse({data:e,path:s.path,parent:s}),i=await(Fe(a)?a:Promise.resolve(a));return ft(s,i)}refine(e,t){let s=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,i)=>{let c=e(a),l=()=>i.addIssue({code:k.custom,...s(a)});return typeof Promise<"u"&&c instanceof Promise?c.then(u=>u?!0:(l(),!1)):c?!0:(l(),!1)})}refinement(e,t){return this._refinement((s,a)=>e(s)?!0:(a.addIssue(typeof t=="function"?t(s,a):t),!1))}_refinement(e){return new U({schema:this,typeName:w.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return W.create(this,this._def)}nullable(){return ee.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Y.create(this,this._def)}promise(){return ie.create(this,this._def)}or(e){return fe.create([this,e],this._def)}and(e){return he.create(this,e,this._def)}transform(e){return new U({...C(this._def),schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new ve({...C(this._def),innerType:this,defaultValue:t,typeName:w.ZodDefault})}brand(){return new Qe({typeName:w.ZodBranded,type:this,...C(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Ae({...C(this._def),innerType:this,catchValue:t,typeName:w.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Pe.create(this,e)}readonly(){return Ce.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ht=/^c[^\s-]{8,}$/i,Gt=/^[a-z][a-z0-9]*$/,Yt=/^[0-9A-HJKMNP-TV-Z]{26}$/,er=/^[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,tr=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,rr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ye,nr=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,sr=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ar=r=>r.precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):r.precision===0?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function ir(r,e){return!!((e==="v4"||!e)&&nr.test(r)||(e==="v6"||!e)&&sr.test(r))}var se=class r extends L{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==T.string){let i=this._getOrReturnCtx(e);return S(i,{code:k.invalid_type,expected:T.string,received:i.parsedType}),O}let s=new z,a;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),S(a,{code:k.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),S(a,{code:k.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="length"){let c=e.data.length>i.value,l=e.data.length<i.value;(c||l)&&(a=this._getOrReturnCtx(e,a),c?S(a,{code:k.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&S(a,{code:k.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),s.dirty())}else if(i.kind==="email")tr.test(e.data)||(a=this._getOrReturnCtx(e,a),S(a,{validation:"email",code:k.invalid_string,message:i.message}),s.dirty());else if(i.kind==="emoji")Ye||(Ye=new RegExp(rr,"u")),Ye.test(e.data)||(a=this._getOrReturnCtx(e,a),S(a,{validation:"emoji",code:k.invalid_string,message:i.message}),s.dirty());else if(i.kind==="uuid")er.test(e.data)||(a=this._getOrReturnCtx(e,a),S(a,{validation:"uuid",code:k.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid")Ht.test(e.data)||(a=this._getOrReturnCtx(e,a),S(a,{validation:"cuid",code:k.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid2")Gt.test(e.data)||(a=this._getOrReturnCtx(e,a),S(a,{validation:"cuid2",code:k.invalid_string,message:i.message}),s.dirty());else if(i.kind==="ulid")Yt.test(e.data)||(a=this._getOrReturnCtx(e,a),S(a,{validation:"ulid",code:k.invalid_string,message:i.message}),s.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),S(a,{validation:"url",code:k.invalid_string,message:i.message}),s.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),S(a,{validation:"regex",code:k.invalid_string,message:i.message}),s.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),S(a,{code:k.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),s.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),S(a,{code:k.invalid_string,validation:{startsWith:i.value},message:i.message}),s.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),S(a,{code:k.invalid_string,validation:{endsWith:i.value},message:i.message}),s.dirty()):i.kind==="datetime"?ar(i).test(e.data)||(a=this._getOrReturnCtx(e,a),S(a,{code:k.invalid_string,validation:"datetime",message:i.message}),s.dirty()):i.kind==="ip"?ir(e.data,i.version)||(a=this._getOrReturnCtx(e,a),S(a,{validation:"ip",code:k.invalid_string,message:i.message}),s.dirty()):N.assertNever(i);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(a=>e.test(a),{validation:t,code:k.invalid_string,...I.errToObj(s)})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...I.errToObj(e)})}url(e){return this._addCheck({kind:"url",...I.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...I.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...I.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...I.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...I.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...I.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...I.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(t=e?.offset)!==null&&t!==void 0?t:!1,...I.errToObj(e?.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...I.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...I.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...I.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...I.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...I.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...I.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...I.errToObj(t)})}nonempty(e){return this.min(1,I.errToObj(e))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};se.create=r=>{var e;return new se({checks:[],typeName:w.ZodString,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...C(r)})};function or(r,e){let t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,a=t>s?t:s,i=parseInt(r.toFixed(a).replace(".","")),c=parseInt(e.toFixed(a).replace(".",""));return i%c/Math.pow(10,a)}var oe=class r extends L{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==T.number){let i=this._getOrReturnCtx(e);return S(i,{code:k.invalid_type,expected:T.number,received:i.parsedType}),O}let s,a=new z;for(let i of this._def.checks)i.kind==="int"?N.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),S(s,{code:k.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(s=this._getOrReturnCtx(e,s),S(s,{code:k.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(s=this._getOrReturnCtx(e,s),S(s,{code:k.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?or(e.data,i.value)!==0&&(s=this._getOrReturnCtx(e,s),S(s,{code:k.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),S(s,{code:k.not_finite,message:i.message}),a.dirty()):N.assertNever(i);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,I.toString(t))}gt(e,t){return this.setLimit("min",e,!1,I.toString(t))}lte(e,t){return this.setLimit("max",e,!0,I.toString(t))}lt(e,t){return this.setLimit("max",e,!1,I.toString(t))}setLimit(e,t,s,a){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:I.toString(a)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:I.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:I.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:I.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:I.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:I.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&N.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}};oe.create=r=>new oe({checks:[],typeName:w.ZodNumber,coerce:r?.coerce||!1,...C(r)});var ce=class r extends L{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==T.bigint){let i=this._getOrReturnCtx(e);return S(i,{code:k.invalid_type,expected:T.bigint,received:i.parsedType}),O}let s,a=new z;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(s=this._getOrReturnCtx(e,s),S(s,{code:k.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(s=this._getOrReturnCtx(e,s),S(s,{code:k.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),S(s,{code:k.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):N.assertNever(i);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,I.toString(t))}gt(e,t){return this.setLimit("min",e,!1,I.toString(t))}lte(e,t){return this.setLimit("max",e,!0,I.toString(t))}lt(e,t){return this.setLimit("max",e,!1,I.toString(t))}setLimit(e,t,s,a){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:I.toString(a)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:I.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};ce.create=r=>{var e;return new ce({checks:[],typeName:w.ZodBigInt,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...C(r)})};var le=class extends L{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==T.boolean){let s=this._getOrReturnCtx(e);return S(s,{code:k.invalid_type,expected:T.boolean,received:s.parsedType}),O}return q(e.data)}};le.create=r=>new le({typeName:w.ZodBoolean,coerce:r?.coerce||!1,...C(r)});var ue=class r extends L{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==T.date){let i=this._getOrReturnCtx(e);return S(i,{code:k.invalid_type,expected:T.date,received:i.parsedType}),O}if(isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return S(i,{code:k.invalid_date}),O}let s=new z,a;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),S(a,{code:k.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),s.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),S(a,{code:k.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),s.dirty()):N.assertNever(i);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:I.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:I.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};ue.create=r=>new ue({checks:[],coerce:r?.coerce||!1,typeName:w.ZodDate,...C(r)});var je=class extends L{_parse(e){if(this._getType(e)!==T.symbol){let s=this._getOrReturnCtx(e);return S(s,{code:k.invalid_type,expected:T.symbol,received:s.parsedType}),O}return q(e.data)}};je.create=r=>new je({typeName:w.ZodSymbol,...C(r)});var de=class extends L{_parse(e){if(this._getType(e)!==T.undefined){let s=this._getOrReturnCtx(e);return S(s,{code:k.invalid_type,expected:T.undefined,received:s.parsedType}),O}return q(e.data)}};de.create=r=>new de({typeName:w.ZodUndefined,...C(r)});var pe=class extends L{_parse(e){if(this._getType(e)!==T.null){let s=this._getOrReturnCtx(e);return S(s,{code:k.invalid_type,expected:T.null,received:s.parsedType}),O}return q(e.data)}};pe.create=r=>new pe({typeName:w.ZodNull,...C(r)});var ae=class extends L{constructor(){super(...arguments),this._any=!0}_parse(e){return q(e.data)}};ae.create=r=>new ae({typeName:w.ZodAny,...C(r)});var G=class extends L{constructor(){super(...arguments),this._unknown=!0}_parse(e){return q(e.data)}};G.create=r=>new G({typeName:w.ZodUnknown,...C(r)});var K=class extends L{_parse(e){let t=this._getOrReturnCtx(e);return S(t,{code:k.invalid_type,expected:T.never,received:t.parsedType}),O}};K.create=r=>new K({typeName:w.ZodNever,...C(r)});var Ee=class extends L{_parse(e){if(this._getType(e)!==T.undefined){let s=this._getOrReturnCtx(e);return S(s,{code:k.invalid_type,expected:T.void,received:s.parsedType}),O}return q(e.data)}};Ee.create=r=>new Ee({typeName:w.ZodVoid,...C(r)});var Y=class r extends L{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),a=this._def;if(t.parsedType!==T.array)return S(t,{code:k.invalid_type,expected:T.array,received:t.parsedType}),O;if(a.exactLength!==null){let c=t.data.length>a.exactLength.value,l=t.data.length<a.exactLength.value;(c||l)&&(S(t,{code:c?k.too_big:k.too_small,minimum:l?a.exactLength.value:void 0,maximum:c?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),s.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(S(t,{code:k.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),s.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(S(t,{code:k.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((c,l)=>a.type._parseAsync(new X(t,c,t.path,l)))).then(c=>z.mergeArray(s,c));let i=[...t.data].map((c,l)=>a.type._parseSync(new X(t,c,t.path,l)));return z.mergeArray(s,i)}get element(){return this._def.type}min(e,t){return new r({...this._def,minLength:{value:e,message:I.toString(t)}})}max(e,t){return new r({...this._def,maxLength:{value:e,message:I.toString(t)}})}length(e,t){return new r({...this._def,exactLength:{value:e,message:I.toString(t)}})}nonempty(e){return this.min(1,e)}};Y.create=(r,e)=>new Y({type:r,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray,...C(e)});function Se(r){if(r instanceof Q){let e={};for(let t in r.shape){let s=r.shape[t];e[t]=W.create(Se(s))}return new Q({...r._def,shape:()=>e})}else return r instanceof Y?new Y({...r._def,type:Se(r.element)}):r instanceof W?W.create(Se(r.unwrap())):r instanceof ee?ee.create(Se(r.unwrap())):r instanceof H?H.create(r.items.map(e=>Se(e))):r}var Q=class r extends L{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=N.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==T.object){let o=this._getOrReturnCtx(e);return S(o,{code:k.invalid_type,expected:T.object,received:o.parsedType}),O}let{status:s,ctx:a}=this._processInputParams(e),{shape:i,keys:c}=this._getCached(),l=[];if(!(this._def.catchall instanceof K&&this._def.unknownKeys==="strip"))for(let o in a.data)c.includes(o)||l.push(o);let u=[];for(let o of c){let f=i[o],m=a.data[o];u.push({key:{status:"valid",value:o},value:f._parse(new X(a,m,a.path,o)),alwaysSet:o in a.data})}if(this._def.catchall instanceof K){let o=this._def.unknownKeys;if(o==="passthrough")for(let f of l)u.push({key:{status:"valid",value:f},value:{status:"valid",value:a.data[f]}});else if(o==="strict")l.length>0&&(S(a,{code:k.unrecognized_keys,keys:l}),s.dirty());else if(o!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let o=this._def.catchall;for(let f of l){let m=a.data[f];u.push({key:{status:"valid",value:f},value:o._parse(new X(a,m,a.path,f)),alwaysSet:f in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let o=[];for(let f of u){let m=await f.key;o.push({key:m,value:await f.value,alwaysSet:f.alwaysSet})}return o}).then(o=>z.mergeObjectSync(s,o)):z.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return I.errToObj,new r({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var a,i,c,l;let u=(c=(i=(a=this._def).errorMap)===null||i===void 0?void 0:i.call(a,t,s).message)!==null&&c!==void 0?c:s.defaultError;return t.code==="unrecognized_keys"?{message:(l=I.errToObj(e).message)!==null&&l!==void 0?l:u}:{message:u}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(e){return new r({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:w.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r({...this._def,catchall:e})}pick(e){let t={};return N.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new r({...this._def,shape:()=>t})}omit(e){let t={};return N.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new r({...this._def,shape:()=>t})}deepPartial(){return Se(this)}partial(e){let t={};return N.objectKeys(this.shape).forEach(s=>{let a=this.shape[s];e&&!e[s]?t[s]=a:t[s]=a.optional()}),new r({...this._def,shape:()=>t})}required(e){let t={};return N.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let i=this.shape[s];for(;i instanceof W;)i=i._def.innerType;t[s]=i}}),new r({...this._def,shape:()=>t})}keyof(){return yt(N.objectKeys(this.shape))}};Q.create=(r,e)=>new Q({shape:()=>r,unknownKeys:"strip",catchall:K.create(),typeName:w.ZodObject,...C(e)});Q.strictCreate=(r,e)=>new Q({shape:()=>r,unknownKeys:"strict",catchall:K.create(),typeName:w.ZodObject,...C(e)});Q.lazycreate=(r,e)=>new Q({shape:r,unknownKeys:"strip",catchall:K.create(),typeName:w.ZodObject,...C(e)});var fe=class extends L{_parse(e){let{ctx:t}=this._processInputParams(e),s=this._def.options;function a(i){for(let l of i)if(l.result.status==="valid")return l.result;for(let l of i)if(l.result.status==="dirty")return t.common.issues.push(...l.ctx.common.issues),l.result;let c=i.map(l=>new J(l.ctx.common.issues));return S(t,{code:k.invalid_union,unionErrors:c}),O}if(t.common.async)return Promise.all(s.map(async i=>{let c={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:c}),ctx:c}})).then(a);{let i,c=[];for(let u of s){let o={...t,common:{...t.common,issues:[]},parent:null},f=u._parseSync({data:t.data,path:t.path,parent:o});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:o}),o.common.issues.length&&c.push(o.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;let l=c.map(u=>new J(u));return S(t,{code:k.invalid_union,unionErrors:l}),O}}get options(){return this._def.options}};fe.create=(r,e)=>new fe({options:r,typeName:w.ZodUnion,...C(e)});var De=r=>r instanceof me?De(r.schema):r instanceof U?De(r.innerType()):r instanceof ge?[r.value]:r instanceof ye?r.options:r instanceof be?Object.keys(r.enum):r instanceof ve?De(r._def.innerType):r instanceof de?[void 0]:r instanceof pe?[null]:null,Ve=class r extends L{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==T.object)return S(t,{code:k.invalid_type,expected:T.object,received:t.parsedType}),O;let s=this.discriminator,a=t.data[s],i=this.optionsMap.get(a);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(S(t,{code:k.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),O)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){let a=new Map;for(let i of t){let c=De(i.shape[e]);if(!c)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let l of c){if(a.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);a.set(l,i)}}return new r({typeName:w.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...C(s)})}};function nt(r,e){let t=ne(r),s=ne(e);if(r===e)return{valid:!0,data:r};if(t===T.object&&s===T.object){let a=N.objectKeys(e),i=N.objectKeys(r).filter(l=>a.indexOf(l)!==-1),c={...r,...e};for(let l of i){let u=nt(r[l],e[l]);if(!u.valid)return{valid:!1};c[l]=u.data}return{valid:!0,data:c}}else if(t===T.array&&s===T.array){if(r.length!==e.length)return{valid:!1};let a=[];for(let i=0;i<r.length;i++){let c=r[i],l=e[i],u=nt(c,l);if(!u.valid)return{valid:!1};a.push(u.data)}return{valid:!0,data:a}}else return t===T.date&&s===T.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var he=class extends L{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),a=(i,c)=>{if(tt(i)||tt(c))return O;let l=nt(i.value,c.value);return l.valid?((rt(i)||rt(c))&&t.dirty(),{status:t.value,value:l.data}):(S(s,{code:k.invalid_intersection_types}),O)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,c])=>a(i,c)):a(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};he.create=(r,e,t)=>new he({left:r,right:e,typeName:w.ZodIntersection,...C(t)});var H=class r extends L{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==T.array)return S(s,{code:k.invalid_type,expected:T.array,received:s.parsedType}),O;if(s.data.length<this._def.items.length)return S(s,{code:k.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),O;!this._def.rest&&s.data.length>this._def.items.length&&(S(s,{code:k.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let i=[...s.data].map((c,l)=>{let u=this._def.items[l]||this._def.rest;return u?u._parse(new X(s,c,s.path,l)):null}).filter(c=>!!c);return s.common.async?Promise.all(i).then(c=>z.mergeArray(t,c)):z.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new r({...this._def,rest:e})}};H.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new H({items:r,typeName:w.ZodTuple,rest:null,...C(e)})};var ze=class r extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==T.object)return S(s,{code:k.invalid_type,expected:T.object,received:s.parsedType}),O;let a=[],i=this._def.keyType,c=this._def.valueType;for(let l in s.data)a.push({key:i._parse(new X(s,l,s.path,l)),value:c._parse(new X(s,s.data[l],s.path,l))});return s.common.async?z.mergeObjectAsync(t,a):z.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof L?new r({keyType:e,valueType:t,typeName:w.ZodRecord,...C(s)}):new r({keyType:se.create(),valueType:e,typeName:w.ZodRecord,...C(t)})}},Ie=class extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==T.map)return S(s,{code:k.invalid_type,expected:T.map,received:s.parsedType}),O;let a=this._def.keyType,i=this._def.valueType,c=[...s.data.entries()].map(([l,u],o)=>({key:a._parse(new X(s,l,s.path,[o,"key"])),value:i._parse(new X(s,u,s.path,[o,"value"]))}));if(s.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of c){let o=await u.key,f=await u.value;if(o.status==="aborted"||f.status==="aborted")return O;(o.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(o.value,f.value)}return{status:t.value,value:l}})}else{let l=new Map;for(let u of c){let o=u.key,f=u.value;if(o.status==="aborted"||f.status==="aborted")return O;(o.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(o.value,f.value)}return{status:t.value,value:l}}}};Ie.create=(r,e,t)=>new Ie({valueType:e,keyType:r,typeName:w.ZodMap,...C(t)});var we=class r extends L{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==T.set)return S(s,{code:k.invalid_type,expected:T.set,received:s.parsedType}),O;let a=this._def;a.minSize!==null&&s.data.size<a.minSize.value&&(S(s,{code:k.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&s.data.size>a.maxSize.value&&(S(s,{code:k.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());let i=this._def.valueType;function c(u){let o=new Set;for(let f of u){if(f.status==="aborted")return O;f.status==="dirty"&&t.dirty(),o.add(f.value)}return{status:t.value,value:o}}let l=[...s.data.values()].map((u,o)=>i._parse(new X(s,u,s.path,o)));return s.common.async?Promise.all(l).then(u=>c(u)):c(l)}min(e,t){return new r({...this._def,minSize:{value:e,message:I.toString(t)}})}max(e,t){return new r({...this._def,maxSize:{value:e,message:I.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};we.create=(r,e)=>new we({valueType:r,minSize:null,maxSize:null,typeName:w.ZodSet,...C(e)});var qe=class r extends L{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==T.function)return S(t,{code:k.invalid_type,expected:T.function,received:t.parsedType}),O;function s(l,u){return Be({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Me(),Re].filter(o=>!!o),issueData:{code:k.invalid_arguments,argumentsError:u}})}function a(l,u){return Be({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Me(),Re].filter(o=>!!o),issueData:{code:k.invalid_return_type,returnTypeError:u}})}let i={errorMap:t.common.contextualErrorMap},c=t.data;if(this._def.returns instanceof ie){let l=this;return q(async function(...u){let o=new J([]),f=await l._def.args.parseAsync(u,i).catch(b=>{throw o.addIssue(s(u,b)),o}),m=await Reflect.apply(c,this,f);return await l._def.returns._def.type.parseAsync(m,i).catch(b=>{throw o.addIssue(a(m,b)),o})})}else{let l=this;return q(function(...u){let o=l._def.args.safeParse(u,i);if(!o.success)throw new J([s(u,o.error)]);let f=Reflect.apply(c,this,o.data),m=l._def.returns.safeParse(f,i);if(!m.success)throw new J([a(f,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r({...this._def,args:H.create(e).rest(G.create())})}returns(e){return new r({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new r({args:e||H.create([]).rest(G.create()),returns:t||G.create(),typeName:w.ZodFunction,...C(s)})}},me=class extends L{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};me.create=(r,e)=>new me({getter:r,typeName:w.ZodLazy,...C(e)});var ge=class extends L{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return S(t,{received:t.data,code:k.invalid_literal,expected:this._def.value}),O}return{status:"valid",value:e.data}}get value(){return this._def.value}};ge.create=(r,e)=>new ge({value:r,typeName:w.ZodLiteral,...C(e)});function yt(r,e){return new ye({values:r,typeName:w.ZodEnum,...C(e)})}var ye=class r extends L{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),s=this._def.values;return S(t,{expected:N.joinValues(s),received:t.parsedType,code:k.invalid_type}),O}if(this._def.values.indexOf(e.data)===-1){let t=this._getOrReturnCtx(e),s=this._def.values;return S(t,{received:t.data,code:k.invalid_enum_value,options:s}),O}return q(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e){return r.create(e)}exclude(e){return r.create(this.options.filter(t=>!e.includes(t)))}};ye.create=yt;var be=class extends L{_parse(e){let t=N.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==T.string&&s.parsedType!==T.number){let a=N.objectValues(t);return S(s,{expected:N.joinValues(a),received:s.parsedType,code:k.invalid_type}),O}if(t.indexOf(e.data)===-1){let a=N.objectValues(t);return S(s,{received:s.data,code:k.invalid_enum_value,options:a}),O}return q(e.data)}get enum(){return this._def.values}};be.create=(r,e)=>new be({values:r,typeName:w.ZodNativeEnum,...C(e)});var ie=class extends L{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==T.promise&&t.common.async===!1)return S(t,{code:k.invalid_type,expected:T.promise,received:t.parsedType}),O;let s=t.parsedType===T.promise?t.data:Promise.resolve(t.data);return q(s.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}};ie.create=(r,e)=>new ie({type:r,typeName:w.ZodPromise,...C(e)});var U=class extends L{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:s}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:c=>{S(s,c),c.fatal?t.abort():t.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){let c=a.transform(s.data,i);return s.common.issues.length?{status:"dirty",value:s.data}:s.common.async?Promise.resolve(c).then(l=>this._def.schema._parseAsync({data:l,path:s.path,parent:s})):this._def.schema._parseSync({data:c,path:s.path,parent:s})}if(a.type==="refinement"){let c=l=>{let u=a.refinement(l,i);if(s.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(s.common.async===!1){let l=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return l.status==="aborted"?O:(l.status==="dirty"&&t.dirty(),c(l.value),{status:t.value,value:l.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(l=>l.status==="aborted"?O:(l.status==="dirty"&&t.dirty(),c(l.value).then(()=>({status:t.value,value:l.value}))))}if(a.type==="transform")if(s.common.async===!1){let c=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!$e(c))return c;let l=a.transform(c.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:l}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(c=>$e(c)?Promise.resolve(a.transform(c.value,i)).then(l=>({status:t.value,value:l})):c);N.assertNever(a)}};U.create=(r,e,t)=>new U({schema:r,typeName:w.ZodEffects,effect:e,...C(t)});U.createWithPreprocess=(r,e,t)=>new U({schema:e,effect:{type:"preprocess",transform:r},typeName:w.ZodEffects,...C(t)});var W=class extends L{_parse(e){return this._getType(e)===T.undefined?q(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};W.create=(r,e)=>new W({innerType:r,typeName:w.ZodOptional,...C(e)});var ee=class extends L{_parse(e){return this._getType(e)===T.null?q(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ee.create=(r,e)=>new ee({innerType:r,typeName:w.ZodNullable,...C(e)});var ve=class extends L{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return t.parsedType===T.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};ve.create=(r,e)=>new ve({innerType:r,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...C(e)});var Ae=class extends L{_parse(e){let{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Fe(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new J(s.com