n}/${a}`}}if(t[1]===i)return{ref:"#"};let r=`#/${n}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:r+a}})(t);n.def={...n.schema},a&&(n.defId=a);let o=n.schema;for(let e in o)delete o[e];o.$ref=r};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>

Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let n=i[1];if(t===i[0]){r(i);continue}if(e.external){let n=e.external.registry.get(i[0])?.id;if(t!==i[0]&&n){r(i);continue}}if(e.metadataRegistry.get(i[0])?.id||n.cycle||n.count>1&&"ref"===e.reused){r(i);continue}}}function oJ(e,t){let i=e.seen.get(t);if(!i)throw Error("Unprocessed schema. This is a bug in Zod.");let n=t=>{let i=e.seen.get(t);if(null===i.ref)return;let r=i.def??i.schema,a={...r},o=i.ref;if(i.ref=null,o){n(o);let i=e.seen.get(o),s=i.schema;if(s.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(r.allOf=r.allOf??[],r.allOf.push(s)):Object.assign(r,s),Object.assign(r,a),t._zod.parent===o)for(let e in r)"$ref"!==e&&"allOf"!==e&&(e in a||delete r[e]);if(s.$ref)for(let e in r)"$ref"!==e&&"allOf"!==e&&e in i.def&&JSON.stringify(r[e])===JSON.stringify(i.def[e])&&delete r[e]}let s=t._zod.parent;if(s&&s!==o){n(s);let t=e.seen.get(s);if(t?.schema.$ref&&(r.$ref=t.schema.$ref,t.def))for(let e in r)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(r[e])===JSON.stringify(t.def[e])&&delete r[e]}e.override({zodSchema:t,jsonSchema:r,path:i.path??[]})};for(let t of[...e.seen.entries()].reverse())n(t[0]);let r={};if("draft-2020-12"===e.target?r.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?r.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let i=e.external.registry.get(t)?.id;if(!i)throw Error("Schema is missing an `id` property");r.$id=e.external.uri(i)}Object.assign(r,i.def??i.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?r.$defs=a:r.definitions=a);try{let i=JSON.parse(JSON.stringify(r));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:oF(t,"input",e.processors),output:oF(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch(e){throw Error("Error converting schema to JSON.")}}var oM=(e,t={})=>i=>{let n=oC({...i,processors:t});return oR(e,n),oL(n,e),oJ(n,e)},oF=(e,t,i={})=>n=>{let{libraryOptions:r,target:a}=n??{},o=oC({...r??{},target:a,io:t,processors:i});return oR(e,o),oL(o,e),oJ(o,e)},oW={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},oq=(e,t,i,n)=>{i.type="string";let{minimum:r,maximum:a,format:o,patterns:s,contentEncoding:u}=e._zod.bag;if("number"==typeof r&&(i.minLength=r),"number"==typeof a&&(i.maxLength=a),o&&(i.format=oW[o]??o,""===i.format&&delete i.format,"time"===o&&delete i.format),u&&(i.contentEncoding=u),s&&s.size>0){let e=[...s];1===e.length?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}},oK=(e,t,i,n)=>{let{minimum:r,maximum:a,format:o,multipleOf:s,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;"string"==typeof o&&o.includes("int")?i.type="integer":i.type="number","number"==typeof l&&("draft-04"===t.target||"openapi-3.0"===t.target?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l),"number"==typeof r&&(i.minimum=r,"number"==typeof l&&"draft-04"!==t.target)&&(l>=r?delete i.minimum:delete i.exclusiveMinimum),"number"==typeof u&&("draft-04"===t.target||"openapi-3.0"===t.target?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),"number"==typeof a&&(i.maximum=a,"number"==typeof u&&"draft-04"!==t.target)&&(u<=a?delete i.maximum:delete i.exclusiveMaximum),"number"==typeof s&&(i.multipleOf=s)},oV=(e,t,i,n)=>{i.type="boolean"},oG=(e,t,i,n)=>{if("throw"===t.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema")},oB=(e,t,i,n)=>{if("throw"===t.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema")},oX=(e,t,i,n)=>{"openapi-3.0"===t.target?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},oH=(e,t,i,n)=>{if("throw"===t.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema")},oY=(e,t,i,n)=>{if("throw"===t.unrepresentable)throw Error("Void cannot be represented in JSON Schema")},oQ=(e,t,i,n)=>{i.not={}},o4=(e,t,i,n)=>{},o6=(e,t,i,n)=>{},o0=(e,t,i,n)=>{if("throw"===t.unrepresentable)throw Error("Date cannot be represented in JSON Schema")},o1=(e,t,i,n)=>{let r=I(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(i.type="number"),r.every(e=>"string"==typeof e)&&(i.type="string"),i.enum=r},o2=(e,t,i,n)=>{let r=e._zod.def,a=[];for(let e of r.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e)if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else a.push(Number(e));else a.push(e);if(0===a.length);else if(1===a.length){let e=a[0];(i.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target)?i.enum=[e]:i.const=e}else a.every(e=>"number"==typeof e)&&(i.type="number"),a.every(e=>"string"==typeof e)&&(i.type="string"),a.every(e=>"boolean"==typeof e)&&(i.type="boolean"),a.every(e=>null===e)&&(i.type="null"),i.enum=a},o9=(e,t,i,n)=>{if("throw"===t.unrepresentable)throw Error("NaN cannot be represented in JSON Schema")},o3=(e,t,i,n)=>{let r=e._zod.pattern;if(!r)throw Error("Pattern not found in template literal");i.type="string",i.pattern=r.source},o7=(e,t,i,n)=>{let r={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:o,mime:s}=e._zod.bag;void 0!==a&&(r.minLength=a),void 0!==o&&(r.maxLength=o),s?1===s.length?(r.contentMediaType=s[0],Object.assign(i,r)):(Object.assign(i,r),i.anyOf=s.map(e=>({contentMediaType:e}))):Object.assign(i,r)},o5=(e,t,i,n)=>{i.type="boolean"},o8=(e,t,i,n)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")},se=(e,t,i,n)=>{if("throw"===t.unrepresentable)throw Error("Function types cannot be represented in JSON Schema")},st=(e,t,i,n)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")},si=(e,t,i,n)=>{if("throw"===t.unrepresentable)throw Error("Map cannot be represented in JSON Schema")},sn=(e,t,i,n)=>{if("throw"===t.unrepresentable)throw Error("Set cannot be represented in JSON Schema")},sr=(e,t,i,n)=>{let r=e._zod.def,{minimum:a,maximum:o}=e._zod.bag;"number"==typeof a&&(i.minItems=a),"number"==typeof o&&(i.maxItems=o),i.type="array",i.items=oR(r.element,t,{...n,path:[...n.path,"items"]})},sa=(e,t,i,n)=>{let r=e._zod.def;i.type="object",i.properties={};let a=r.shape;for(let e in a)i.properties[e]=oR(a[e],t,{...n,path:[...n.path,"properties",e]});let o=new Set([...new Set(Object.keys(a))].filter(e=>{let i=r.shape[e]._zod;return"input"===t.io?void 0===i.optin:void 0===i.optout}));o.size>0&&(i.required=Array.from(o)),r.catchall?._zod.def.type==="never"?i.additionalProperties=!1:r.catchall?r.catchall&&(i.additionalProperties=oR(r.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(i.additionalProperties=!1)},so=(e,t,i,n)=>{let r=e._zod.def,a=!1===r.inclusive,o=r.options.map((e,i)=>oR(e,t,{...n,path:[...n.path,a?"oneOf":"anyOf",i]}));a?i.oneOf=o:i.anyOf=o},ss=(e,t,i,n)=>{let r=e._zod.def,a=oR(r.left,t,{...n,path:[...n.path,"allOf",0]}),o=oR(r.right,t,{...n,path:[...n.path,"allOf",1]}),s=e=>"allOf"in e&&1===Object.keys(e).length;i.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},su=(e,t,i,n)=>{let r=e._zod.def;i.type="array";let a="draft-2020-12"===t.target?"prefixItems":"items",o="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",s=r.items.map((e,i)=>oR(e,t,{...n,path:[...n.path,a,i]})),u=r.rest?oR(r.rest,t,{...n,path:[...n.path,o,..."openapi-3.0"===t.target?[r.items.length]:[]]}):null;"draft-2020-12"===t.target?(i.prefixItems=s,u&&(i.items=u)):"openapi-3.0"===t.target?(i.items={anyOf:s},u&&i.items.anyOf.push(u),i.minItems=s.length,u||(i.maxItems=s.length)):(i.items=s,u&&(i.additionalItems=u));let{minimum:l,maximum:d}=e._zod.bag;"number"==typeof l&&(i.minItems=l),"number"==typeof d&&(i.maxItems=d)},sl=(e,t,i,n)=>{let r=e._zod.def;i.type="object";let a=r.keyType,o=a._zod.bag?.patterns;if("loose"===r.mode&&o&&o.size>0){let e=oR(r.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});for(let t of(i.patternProperties={},o))i.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(i.propertyNames=oR(r.keyType,t,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=oR(r.valueType,t,{...n,path:[...n.path,"additionalProperties"]});let s=a._zod.values;if(s){let e=[...s].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(i.required=e)}},sd=(e,t,i,n)=>{let r=e._zod.def,a=oR(r.innerType,t,n),o=t.seen.get(e);"openapi-3.0"===t.target?(o.ref=r.innerType,i.nullable=!0):i.anyOf=[a,{type:"null"}]},sc=(e,t,i,n)=>{let r=e._zod.def;oR(r.innerType,t,n),t.seen.get(e).ref=r.innerType},sm=(e,t,i,n)=>{let r=e._zod.def;oR(r.innerType,t,n),t.seen.get(e).ref=r.innerType,i.default=JSON.parse(JSON.stringify(r.defaultValue))},sf=(e,t,i,n)=>{let r=e._zod.def;oR(r.innerType,t,n),t.seen.get(e).ref=r.innerType,"input"===t.io&&(i._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},sp=(e,t,i,n)=>{let r,a=e._zod.def;oR(a.innerType,t,n),t.seen.get(e).ref=a.innerType;try{r=a.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}i.default=r},sv=(e,t,i,n)=>{let r=e._zod.def,a="input"===t.io?"transform"===r.in._zod.def.type?r.out:r.in:r.out;oR(a,t,n),t.seen.get(e).ref=a},sg=(e,t,i,n)=>{let r=e._zod.def;oR(r.innerType,t,n),t.seen.get(e).ref=r.innerType,i.readOnly=!0},sh=(e,t,i,n)=>{let r=e._zod.def;oR(r.innerType,t,n),t.seen.get(e).ref=r.innerType},s$=(e,t,i,n)=>{let r=e._zod.def;oR(r.innerType,t,n),t.seen.get(e).ref=r.innerType},sb=(e,t,i,n)=>{let r=e._zod.innerType;oR(r,t,n),t.seen.get(e).ref=r},sy={string:oq,number:oK,boolean:oV,bigint:oG,symbol:oB,null:oX,undefined:oH,void:oY,never:oQ,any:o4,unknown:o6,date:o0,enum:o1,literal:o2,nan:o9,template_literal:o3,file:o7,success:o5,custom:o8,function:se,transform:st,map:si,set:sn,array:sr,object:sa,union:so,intersection:ss,tuple:su,record:sl,nullable:sd,nonoptional:sc,default:sm,prefault:sf,catch:sp,pipe:sv,readonly:sg,promise:sh,optional:s$,lazy:sb};function s_(e,t){if("_idmap"in e){let i=oC({...t,processors:sy}),n={};for(let t of e._idmap.entries()){let[e,n]=t;oR(n,i)}let r={};for(let a of(i.external={registry:e,uri:t?.uri,defs:n},e._idmap.entries())){let[e,t]=a;oL(i,t),r[e]=oJ(i,t)}return Object.keys(n).length>0&&(r.__shared={["draft-2020-12"===i.target?"$defs":"definitions"]:n}),{schemas:r}}let i=oC({...t,processors:sy});return oR(e,i),oL(i,e),oJ(i,e)}class sx{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),this.ctx=oC({processors:sy,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return oR(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),oL(this.ctx,e);let{"~standard":i,...n}=oJ(this.ctx,e);return n}}var sk={},sI={};s(sI,{xor:()=>lh,xid:()=>up,void:()=>lr,uuidv7:()=>s8,uuidv6:()=>s5,uuidv4:()=>s7,uuid:()=>s3,url:()=>ut,unknown:()=>le,union:()=>lv,undefined:()=>u2,ulid:()=>um,uint64:()=>u4,uint32:()=>uV,tuple:()=>lk,transform:()=>lL,templateLiteral:()=>dn,symbol:()=>u0,superRefine:()=>dv,success:()=>l6,stringbool:()=>db,stringFormat:()=>uT,string:()=>sQ,strictObject:()=>lm,set:()=>lZ,refine:()=>dp,record:()=>lw,readonly:()=>dt,promise:()=>du,preprocess:()=>d_,prefault:()=>lH,pipe:()=>l7,partialRecord:()=>lS,optional:()=>lM,object:()=>lc,number:()=>uJ,nullish:()=>lV,nullable:()=>lK,null:()=>u3,nonoptional:()=>lQ,never:()=>li,nativeEnum:()=>lP,nanoid:()=>uo,nan:()=>l9,meta:()=>dh,map:()=>lO,mac:()=>uy,looseRecord:()=>lz,looseObject:()=>lf,literal:()=>lT,lazy:()=>da,ksuid:()=>ug,keyof:()=>ll,jwt:()=>uP,json:()=>dy,ipv6:()=>ux,ipv4:()=>u$,intersection:()=>l_,int64:()=>uQ,int32:()=>uK,int:()=>uF,instanceof:()=>d$,httpUrl:()=>ui,hostname:()=>uA,hex:()=>uC,hash:()=>uR,guid:()=>s2,function:()=>dd,float64:()=>uq,float32:()=>uW,file:()=>lC,exactOptional:()=>lW,enum:()=>lN,emoji:()=>ur,email:()=>s0,e164:()=>uD,discriminatedUnion:()=>lb,describe:()=>dg,date:()=>lo,custom:()=>df,cuid2:()=>ud,cuid:()=>uu,codec:()=>l8,cidrv6:()=>uS,cidrv4:()=>uI,check:()=>dm,catch:()=>l1,boolean:()=>uB,bigint:()=>uH,base64url:()=>uj,base64:()=>uU,array:()=>lu,any:()=>u5,_function:()=>dd,_default:()=>lB,_ZodString:()=>sH,ZodXor:()=>lg,ZodXID:()=>uf,ZodVoid:()=>ln,ZodUnknown:()=>u8,ZodUnion:()=>lp,ZodUndefined:()=>u1,ZodUUID:()=>s9,ZodURL:()=>ue,ZodULID:()=>uc,ZodType:()=>sX,ZodTuple:()=>lx,ZodTransform:()=>lR,ZodTemplateLiteral:()=>di,ZodSymbol:()=>u6,ZodSuccess:()=>l4,ZodStringFormat:()=>s4,ZodString:()=>sY,ZodSet:()=>lj,ZodRecord:()=>lI,ZodReadonly:()=>de,ZodPromise:()=>ds,ZodPrefault:()=>lX,ZodPipe:()=>l3,ZodOptional:()=>lJ,ZodObject:()=>ld,ZodNumberFormat:()=>uM,ZodNumber:()=>uL,ZodNullable:()=>lq,ZodNull:()=>u9,ZodNonOptional:()=>lY,ZodNever:()=>lt,ZodNanoID:()=>ua,ZodNaN:()=>l2,ZodMap:()=>lU,ZodMAC:()=>ub,ZodLiteral:()=>lE,ZodLazy:()=>dr,ZodKSUID:()=>uv,ZodJWT:()=>uN,ZodIntersection:()=>ly,ZodIPv6:()=>u_,ZodIPv4:()=>uh,ZodGUID:()=>s1,ZodFunction:()=>dl,ZodFile:()=>lA,ZodExactOptional:()=>lF,ZodEnum:()=>lD,ZodEmoji:()=>un,ZodEmail:()=>s6,ZodE164:()=>uZ,ZodDiscriminatedUnion:()=>l$,ZodDefault:()=>lG,ZodDate:()=>la,ZodCustomStringFormat:()=>uE,ZodCustom:()=>dc,ZodCodec:()=>l5,ZodCatch:()=>l0,ZodCUID2:()=>ul,ZodCUID:()=>us,ZodCIDRv6:()=>uw,ZodCIDRv4:()=>uk,ZodBoolean:()=>uG,ZodBigIntFormat:()=>uY,ZodBigInt:()=>uX,ZodBase64URL:()=>uO,ZodBase64:()=>uz,ZodArray:()=>ls,ZodAny:()=>u7});var sw={};s(sw,{uppercase:()=>a1,trim:()=>ot,toUpperCase:()=>on,toLowerCase:()=>oi,startsWith:()=>a9,slugify:()=>or,size:()=>aH,regex:()=>a6,property:()=>a7,positive:()=>aW,overwrite:()=>a8,normalize:()=>oe,nonpositive:()=>aK,nonnegative:()=>aV,negative:()=>aq,multipleOf:()=>aG,minSize:()=>aX,minLength:()=>aQ,mime:()=>a5,maxSize:()=>aB,maxLength:()=>aY,lte:()=>aJ,lt:()=>aL,lowercase:()=>a0,length:()=>a4,includes:()=>a2,gte:()=>aF,gt:()=>aM,endsWith:()=>a3});var sS={};s(sS,{time:()=>sD,duration:()=>sP,datetime:()=>sU,date:()=>sj,ZodISOTime:()=>sZ,ZodISODuration:()=>sN,ZodISODateTime:()=>sz,ZodISODate:()=>sO});var sz=m("ZodISODateTime",(e,t)=>{iA.init(e,t),s4.init(e,t)});function sU(e){return af(sz,e)}var sO=m("ZodISODate",(e,t)=>{iC.init(e,t),s4.init(e,t)});function sj(e){return ap(sO,e)}var sZ=m("ZodISOTime",(e,t)=>{iR.init(e,t),s4.init(e,t)});function sD(e){return av(sZ,e)}var sN=m("ZodISODuration",(e,t)=>{iL.init(e,t),s4.init(e,t)});function sP(e){return ag(sN,e)}var sE=(e,t)=>{eO.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>eD(e,t)},flatten:{value:t=>eZ(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,S,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,S,2)}},isEmpty:{get:()=>0===e.issues.length}})},sT=m("ZodError",sE),sA=m("ZodError",sE,{Parent:Error}),sC=eT(sA),sR=eC(sA),sL=eL(sA),sJ=eM(sA),sM=eW(sA),sF=eK(sA),sW=eG(sA),sq=eX(sA),sK=eY(sA),sV=e4(sA),sG=e0(sA),sB=e2(sA),sX=m("ZodType",(e,t)=>(ik.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:oF(e,"input"),output:oF(e,"output")}}),e.toJSONSchema=oM(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone($.mergeDefs(t,{checks:[...t.checks??[],...i.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,i)=>Y(e,t,i),e.brand=()=>e,e.register=(t,i)=>(t.add(e,i),e),e.parse=(t,i)=>sC(e,t,i,{callee:e.parse}),e.safeParse=(t,i)=>sL(e,t,i),e.parseAsync=async(t,i)=>sR(e,t,i,{callee:e.parseAsync}),e.safeParseAsync=async(t,i)=>sJ(e,t,i),e.spa=e.safeParseAsync,e.encode=(t,i)=>sM(e,t,i),e.decode=(t,i)=>sF(e,t,i),e.encodeAsync=async(t,i)=>sW(e,t,i),e.decodeAsync=async(t,i)=>sq(e,t,i),e.safeEncode=(t,i)=>sK(e,t,i),e.safeDecode=(t,i)=>sV(e,t,i),e.safeEncodeAsync=async(t,i)=>sG(e,t,i),e.safeDecodeAsync=async(t,i)=>sB(e,t,i),e.refine=(t,i)=>e.check(dp(t,i)),e.superRefine=t=>e.check(oD(t)),e.overwrite=t=>e.check(a8(t)),e.optional=()=>lM(e),e.exactOptional=()=>lW(e),e.nullable=()=>lK(e),e.nullish=()=>lM(lK(e)),e.nonoptional=t=>lQ(e,t),e.array=()=>lu(e),e.or=t=>lv([e,t]),e.and=t=>l_(e,t),e.transform=t=>l7(e,lL(t)),e.default=t=>lB(e,t),e.prefault=t=>lH(e,t),e.catch=t=>l1(e,t),e.pipe=t=>l7(e,t),e.readonly=()=>dt(e),e.describe=t=>{let i=e.clone();return rX.add(i,{description:t}),i},Object.defineProperty(e,"description",{get:()=>rX.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return rX.get(e);let i=e.clone();return rX.add(i,t[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),sH=m("_ZodString",(e,t)=>{iI.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>oq(e,t,i,n);let i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...t)=>e.check(a6(...t)),e.includes=(...t)=>e.check(a2(...t)),e.startsWith=(...t)=>e.check(a9(...t)),e.endsWith=(...t)=>e.check(a3(...t)),e.min=(...t)=>e.check(aQ(...t)),e.max=(...t)=>e.check(aY(...t)),e.length=(...t)=>e.check(a4(...t)),e.nonempty=(...t)=>e.check(aQ(1,...t)),e.lowercase=t=>e.check(a0(t)),e.uppercase=t=>e.check(a1(t)),e.trim=()=>e.check(ot()),e.normalize=(...t)=>e.check(oe(...t)),e.toLowerCase=()=>e.check(oi()),e.toUpperCase=()=>e.check(on()),e.slugify=()=>e.check(or())}),sY=m("ZodString",(e,t)=>{iI.init(e,t),sH.init(e,t),e.email=t=>e.check(rQ(s6,t)),e.url=t=>e.check(r9(ue,t)),e.jwt=t=>e.check(ac(uN,t)),e.emoji=t=>e.check(r3(un,t)),e.guid=t=>e.check(r4(s1,t)),e.uuid=t=>e.check(r6(s9,t)),e.uuidv4=t=>e.check(r0(s9,t)),e.uuidv6=t=>e.check(r1(s9,t)),e.uuidv7=t=>e.check(r2(s9,t)),e.nanoid=t=>e.check(r7(ua,t)),e.guid=t=>e.check(r4(s1,t)),e.cuid=t=>e.check(r5(us,t)),e.cuid2=t=>e.check(r8(ul,t)),e.ulid=t=>e.check(ae(uc,t)),e.base64=t=>e.check(au(uz,t)),e.base64url=t=>e.check(al(uO,t)),e.xid=t=>e.check(at(uf,t)),e.ksuid=t=>e.check(ai(uv,t)),e.ipv4=t=>e.check(an(uh,t)),e.ipv6=t=>e.check(ar(u_,t)),e.cidrv4=t=>e.check(ao(uk,t)),e.cidrv6=t=>e.check(as(uw,t)),e.e164=t=>e.check(ad(uZ,t)),e.datetime=t=>e.check(sU(t)),e.date=t=>e.check(sj(t)),e.time=t=>e.check(sD(t)),e.duration=t=>e.check(sP(t))});function sQ(e){return rH(sY,e)}var s4=m("ZodStringFormat",(e,t)=>{iw.init(e,t),sH.init(e,t)}),s6=m("ZodEmail",(e,t)=>{iU.init(e,t),s4.init(e,t)});function s0(e){return rQ(s6,e)}var s1=m("ZodGUID",(e,t)=>{iS.init(e,t),s4.init(e,t)});function s2(e){return r4(s1,e)}var s9=m("ZodUUID",(e,t)=>{iz.init(e,t),s4.init(e,t)});function s3(e){return r6(s9,e)}function s7(e){return r0(s9,e)}function s5(e){return r1(s9,e)}function s8(e){return r2(s9,e)}var ue=m("ZodURL",(e,t)=>{iO.init(e,t),s4.init(e,t)});function ut(e){return r9(ue,e)}function ui(e){return r9(ue,{protocol:/^https?$/,hostname:e3.domain,...$.normalizeParams(e)})}var un=m("ZodEmoji",(e,t)=>{ij.init(e,t),s4.init(e,t)});function ur(e){return r3(un,e)}var ua=m("ZodNanoID",(e,t)=>{iZ.init(e,t),s4.init(e,t)});function uo(e){return r7(ua,e)}var us=m("ZodCUID",(e,t)=>{iD.init(e,t),s4.init(e,t)});function uu(e){return r5(us,e)}var ul=m("ZodCUID2",(e,t)=>{iN.init(e,t),s4.init(e,t)});function ud(e){return r8(ul,e)}var uc=m("ZodULID",(e,t)=>{iP.init(e,t),s4.init(e,t)});function um(e){return ae(uc,e)}var uf=m("ZodXID",(e,t)=>{iE.init(e,t),s4.init(e,t)});function up(e){return at(uf,e)}var uv=m("ZodKSUID",(e,t)=>{iT.init(e,t),s4.init(e,t)});function ug(e){return ai(uv,e)}var uh=m("ZodIPv4",(e,t)=>{iJ.init(e,t),s4.init(e,t)});function u$(e){return an(uh,e)}var ub=m("ZodMAC",(e,t)=>{iF.init(e,t),s4.init(e,t)});function uy(e){return aa(ub,e)}var u_=m("ZodIPv6",(e,t)=>{iM.init(e,t),s4.init(e,t)});function ux(e){return ar(u_,e)}var uk=m("ZodCIDRv4",(e,t)=>{iW.init(e,t),s4.init(e,t)});function uI(e){return ao(uk,e)}var uw=m("ZodCIDRv6",(e,t)=>{iq.init(e,t),s4.init(e,t)});function uS(e){return as(uw,e)}var uz=m("ZodBase64",(e,t)=>{iV.init(e,t),s4.init(e,t)});function uU(e){return au(uz,e)}var uO=m("ZodBase64URL",(e,t)=>{iB.init(e,t),s4.init(e,t)});function uj(e){return al(uO,e)}var uZ=m("ZodE164",(e,t)=>{iX.init(e,t),s4.init(e,t)});function uD(e){return ad(uZ,e)}var uN=m("ZodJWT",(e,t)=>{iY.init(e,t),s4.init(e,t)});function uP(e){return ac(uN,e)}var uE=m("ZodCustomStringFormat",(e,t)=>{iQ.init(e,t),s4.init(e,t)});function uT(e,t,i={}){return oA(uE,e,t,i)}function uA(e){return oA(uE,"hostname",e3.hostname,e)}function uC(e){return oA(uE,"hex",e3.hex,e)}function uR(e,t){let i=t?.enc??"hex",n=`${e}_${i}`,r=e3[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return oA(uE,n,r,t)}var uL=m("ZodNumber",(e,t)=>{i4.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>oK(e,t,i,n),e.gt=(t,i)=>e.check(aM(t,i)),e.gte=(t,i)=>e.check(aF(t,i)),e.min=(t,i)=>e.check(aF(t,i)),e.lt=(t,i)=>e.check(aL(t,i)),e.lte=(t,i)=>e.check(aJ(t,i)),e.max=(t,i)=>e.check(aJ(t,i)),e.int=t=>e.check(uF(t)),e.safe=t=>e.check(uF(t)),e.positive=t=>e.check(aM(0,t)),e.nonnegative=t=>e.check(aF(0,t)),e.negative=t=>e.check(aL(0,t)),e.nonpositive=t=>e.check(aJ(0,t)),e.multipleOf=(t,i)=>e.check(aG(t,i)),e.step=(t,i)=>e.check(aG(t,i)),e.finite=()=>e;let i=e._zod.bag;e.minValue=Math.max(i.minimum??-1/0,i.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(i.maximum??1/0,i.exclusiveMaximum??1/0)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function uJ(e){return ah(uL,e)}var uM=m("ZodNumberFormat",(e,t)=>{i6.init(e,t),uL.init(e,t)});function uF(e){return ab(uM,e)}function uW(e){return ay(uM,e)}function uq(e){return a_(uM,e)}function uK(e){return ax(uM,e)}function uV(e){return ak(uM,e)}var uG=m("ZodBoolean",(e,t)=>{i0.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>oV(e,t,i,n)});function uB(e){return aI(uG,e)}var uX=m("ZodBigInt",(e,t)=>{i1.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>oG(e,t,i,n),e.gte=(t,i)=>e.check(aF(t,i)),e.min=(t,i)=>e.check(aF(t,i)),e.gt=(t,i)=>e.check(aM(t,i)),e.gte=(t,i)=>e.check(aF(t,i)),e.min=(t,i)=>e.check(aF(t,i)),e.lt=(t,i)=>e.check(aL(t,i)),e.lte=(t,i)=>e.check(aJ(t,i)),e.max=(t,i)=>e.check(aJ(t,i)),e.positive=t=>e.check(aM(BigInt(0),t)),e.negative=t=>e.check(aL(BigInt(0),t)),e.nonpositive=t=>e.check(aJ(BigInt(0),t)),e.nonnegative=t=>e.check(aF(BigInt(0),t)),e.multipleOf=(t,i)=>e.check(aG(t,i));let i=e._zod.bag;e.minValue=i.minimum??null,e.maxValue=i.maximum??null,e.format=i.format??null});function uH(e){return aS(uX,e)}var uY=m("ZodBigIntFormat",(e,t)=>{i2.init(e,t),uX.init(e,t)});function uQ(e){return aU(uY,e)}function u4(e){return aO(uY,e)}var u6=m("ZodSymbol",(e,t)=>{i9.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>oB(e,t,i,n)});function u0(e){return aj(u6,e)}var u1=m("ZodUndefined",(e,t)=>{i3.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>oH(e,t,i,n)});function u2(e){return aZ(u1,e)}var u9=m("ZodNull",(e,t)=>{i7.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>oX(e,t,i,n)});function u3(e){return aD(u9,e)}var u7=m("ZodAny",(e,t)=>{i5.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>o4(e,t,i,n)});function u5(){return aN(u7)}var u8=m("ZodUnknown",(e,t)=>{i8.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>o6(e,t,i,n)});function le(){return aP(u8)}var lt=m("ZodNever",(e,t)=>{ne.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>oQ(e,t,i,n)});function li(e){return aE(lt,e)}var ln=m("ZodVoid",(e,t)=>{nt.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>oY(e,t,i,n)});function lr(e){return aT(ln,e)}var la=m("ZodDate",(e,t)=>{ni.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>o0(e,t,i,n),e.min=(t,i)=>e.check(aF(t,i)),e.max=(t,i)=>e.check(aJ(t,i));let i=e._zod.bag;e.minDate=i.minimum?new Date(i.minimum):null,e.maxDate=i.maximum?new Date(i.maximum):null});function lo(e){return aA(la,e)}var ls=m("ZodArray",(e,t)=>{nr.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>sr(e,t,i,n),e.element=t.element,e.min=(t,i)=>e.check(aQ(t,i)),e.nonempty=t=>e.check(aQ(1,t)),e.max=(t,i)=>e.check(aY(t,i)),e.length=(t,i)=>e.check(a4(t,i)),e.unwrap=()=>e.element});function lu(e,t){return oa(ls,e,t)}function ll(e){return lN(Object.keys(e._zod.def.shape))}var ld=m("ZodObject",(e,t)=>{nl.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>sa(e,t,i,n),$.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>lN(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:le()}),e.loose=()=>e.clone({...e._zod.def,catchall:le()}),e.strict=()=>e.clone({...e._zod.def,catchall:li()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>$.extend(e,t),e.safeExtend=t=>$.safeExtend(e,t),e.merge=t=>$.merge(e,t),e.pick=t=>$.pick(e,t),e.omit=t=>$.omit(e,t),e.partial=(...t)=>$.partial(lJ,e,t[0]),e.required=(...t)=>$.required(lY,e,t[0])});function lc(e,t){return new ld({type:"object",shape:e??{},...$.normalizeParams(t)})}function lm(e,t){return new ld({type:"object",shape:e,catchall:li(),...$.normalizeParams(t)})}function lf(e,t){return new ld({type:"object",shape:e,catchall:le(),...$.normalizeParams(t)})}var lp=m("ZodUnion",(e,t)=>{nc.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>so(e,t,i,n),e.options=t.options});function lv(e,t){return new lp({type:"union",options:e,...$.normalizeParams(t)})}var lg=m("ZodXor",(e,t)=>{lp.init(e,t),nf.init(e,t),e._zod.processJSONSchema=(t,i,n)=>so(e,t,i,n),e.options=t.options});function lh(e,t){return new lg({type:"union",options:e,inclusive:!1,...$.normalizeParams(t)})}var l$=m("ZodDiscriminatedUnion",(e,t)=>{lp.init(e,t),np.init(e,t)});function lb(e,t,i){return new l$({type:"union",options:t,discriminator:e,...$.normalizeParams(i)})}var ly=m("ZodIntersection",(e,t)=>{nv.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>ss(e,t,i,n)});function l_(e,t){return new ly({type:"intersection",left:e,right:t})}var lx=m("ZodTuple",(e,t)=>{nh.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>su(e,t,i,n),e.rest=t=>e.clone({...e._zod.def,rest:t})});function lk(e,t,i){let n=t instanceof ik,r=n?i:t;return new lx({type:"tuple",items:e,rest:n?t:null,...$.normalizeParams(r)})}var lI=m("ZodRecord",(e,t)=>{nb.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>sl(e,t,i,n),e.keyType=t.keyType,e.valueType=t.valueType});function lw(e,t,i){return new lI({type:"record",keyType:e,valueType:t,...$.normalizeParams(i)})}function lS(e,t,i){let n=Y(e);return n._zod.values=void 0,new lI({type:"record",keyType:n,valueType:t,...$.normalizeParams(i)})}function lz(e,t,i){return new lI({type:"record",keyType:e,valueType:t,mode:"loose",...$.normalizeParams(i)})}var lU=m("ZodMap",(e,t)=>{ny.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>si(e,t,i,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(aX(...t)),e.nonempty=t=>e.check(aX(1,t)),e.max=(...t)=>e.check(aB(...t)),e.size=(...t)=>e.check(aH(...t))});function lO(e,t,i){return new lU({type:"map",keyType:e,valueType:t,...$.normalizeParams(i)})}var lj=m("ZodSet",(e,t)=>{nx.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>sn(e,t,i,n),e.min=(...t)=>e.check(aX(...t)),e.nonempty=t=>e.check(aX(1,t)),e.max=(...t)=>e.check(aB(...t)),e.size=(...t)=>e.check(aH(...t))});function lZ(e,t){return new lj({type:"set",valueType:e,...$.normalizeParams(t)})}var lD=m("ZodEnum",(e,t)=>{nI.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>o1(e,t,i,n),e.enum=t.entries,e.options=Object.values(t.entries);let i=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let r={};for(let n of e)if(i.has(n))r[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new lD({...t,checks:[],...$.normalizeParams(n),entries:r})},e.exclude=(e,n)=>{let r={...t.entries};for(let t of e)if(i.has(t))delete r[t];else throw Error(`Key ${t} not found in enum`);return new lD({...t,checks:[],...$.normalizeParams(n),entries:r})}});function lN(e,t){return new lD({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...$.normalizeParams(t)})}function lP(e,t){return new lD({type:"enum",entries:e,...$.normalizeParams(t)})}var lE=m("ZodLiteral",(e,t)=>{nw.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>o2(e,t,i,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function lT(e,t){return new lE({type:"literal",values:Array.isArray(e)?e:[e],...$.normalizeParams(t)})}var lA=m("ZodFile",(e,t)=>{nS.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>o7(e,t,i,n),e.min=(t,i)=>e.check(aX(t,i)),e.max=(t,i)=>e.check(aB(t,i)),e.mime=(t,i)=>e.check(a5(Array.isArray(t)?t:[t],i))});function lC(e){return oh(lA,e)}var lR=m("ZodTransform",(e,t)=>{nz.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>st(e,t,i,n),e._zod.parse=(i,n)=>{if("backward"===n.direction)throw new v(e.constructor.name);i.addIssue=n=>{"string"==typeof n?i.issues.push($.issue(n,i.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=i.value),n.inst??(n.inst=e),i.issues.push($.issue(n)))};let r=t.transform(i.value,i);return r instanceof Promise?r.then(e=>(i.value=e,i)):(i.value=r,i)}});function lL(e){return new lR({type:"transform",transform:e})}var lJ=m("ZodOptional",(e,t)=>{nO.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>s$(e,t,i,n),e.unwrap=()=>e._zod.def.innerType});function lM(e){return new lJ({type:"optional",innerType:e})}var lF=m("ZodExactOptional",(e,t)=>{nj.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>s$(e,t,i,n),e.unwrap=()=>e._zod.def.innerType});function lW(e){return new lF({type:"optional",innerType:e})}var lq=m("ZodNullable",(e,t)=>{nZ.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>sd(e,t,i,n),e.unwrap=()=>e._zod.def.innerType});function lK(e){return new lq({type:"nullable",innerType:e})}function lV(e){return lM(lK(e))}var lG=m("ZodDefault",(e,t)=>{nD.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>sm(e,t,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function lB(e,t){return new lG({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():$.shallowClone(t)}})}var lX=m("ZodPrefault",(e,t)=>{nP.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>sf(e,t,i,n),e.unwrap=()=>e._zod.def.innerType});function lH(e,t){return new lX({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():$.shallowClone(t)}})}var lY=m("ZodNonOptional",(e,t)=>{nE.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>sc(e,t,i,n),e.unwrap=()=>e._zod.def.innerType});function lQ(e,t){return new lY({type:"nonoptional",innerType:e,...$.normalizeParams(t)})}var l4=m("ZodSuccess",(e,t)=>{nA.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>o5(e,t,i,n),e.unwrap=()=>e._zod.def.innerType});function l6(e){return new l4({type:"success",innerType:e})}var l0=m("ZodCatch",(e,t)=>{nC.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>sp(e,t,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function l1(e,t){return new l0({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}var l2=m("ZodNaN",(e,t)=>{nR.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>o9(e,t,i,n)});function l9(e){return aR(l2,e)}var l3=m("ZodPipe",(e,t)=>{nL.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>sv(e,t,i,n),e.in=t.in,e.out=t.out});function l7(e,t){return new l3({type:"pipe",in:e,out:t})}var l5=m("ZodCodec",(e,t)=>{l3.init(e,t),nM.init(e,t)});function l8(e,t,i){return new l5({type:"pipe",in:e,out:t,transform:i.decode,reverseTransform:i.encode})}var de=m("ZodReadonly",(e,t)=>{nq.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>sg(e,t,i,n),e.unwrap=()=>e._zod.def.innerType});function dt(e){return new de({type:"readonly",innerType:e})}var di=m("ZodTemplateLiteral",(e,t)=>{nV.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>o3(e,t,i,n)});function dn(e,t){return new di({type:"template_literal",parts:e,...$.normalizeParams(t)})}var dr=m("ZodLazy",(e,t)=>{nX.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>sb(e,t,i,n),e.unwrap=()=>e._zod.def.getter()});function da(e){return new dr({type:"lazy",getter:e})}var ds=m("ZodPromise",(e,t)=>{nB.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>sh(e,t,i,n),e.unwrap=()=>e._zod.def.innerType});function du(e){return new ds({type:"promise",innerType:e})}var dl=m("ZodFunction",(e,t)=>{nG.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>se(e,t,i,n)});function dd(e){return new dl({type:"function",input:Array.isArray(e?.input)?lk(e?.input):e?.input??lu(le()),output:e?.output??le()})}var dc=m("ZodCustom",(e,t)=>{nH.init(e,t),sX.init(e,t),e._zod.processJSONSchema=(t,i,n)=>o8(e,t,i,n)});function dm(e){let t=new t9({check:"custom"});return t._zod.check=e,t}function df(e,t){return oj(dc,e??(()=>!0),t)}function dp(e,t={}){return oZ(dc,e,t)}function dv(e){return oD(e)}var dg=oP,dh=oE;function d$(e,t={}){let i=new dc({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...$.normalizeParams(t)});return i._zod.bag.Class=e,i._zod.check=t=>{t.value instanceof e||t.issues.push({code:"invalid_type",expected:e.name,input:t.value,inst:i,path:[...i._zod.def.path??[]]})},i}var db=(...e)=>oT({Codec:l5,Boolean:uG,String:sY},...e);function dy(e){let t=da(()=>lv([sQ(e),uJ(),uB(),u3(),lu(t),lw(sQ(),t)]));return t}function d_(e,t){return l7(lL(e),t)}var dx={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function dk(e){h({customError:e})}function dI(){return h().customError}n||(n={});var dw={...sI,...sw,iso:sS},dS=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function dz(e,t){var i;let n;if("boolean"==typeof e)return e?dw.any():dw.never();let r={version:(i=t?.defaultTarget,"https://json-schema.org/draft/2020-12/schema"===(n=e.$schema)?"draft-2020-12":"http://json-schema.org/draft-07/schema#"===n?"draft-7":"http://json-schema.org/draft-04/schema#"===n?"draft-4":i??"draft-2020-12"),defs:e.$defs||e.definitions||{},refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??rX};return function e(t,i){if("boolean"==typeof t)return t?dw.any():dw.never();let n=function t(i,n){let r;if(void 0!==i.not){if("object"==typeof i.not&&0===Object.keys(i.not).length)return dw.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(void 0!==i.unevaluatedItems)throw Error("unevaluatedItems is not supported");if(void 0!==i.unevaluatedProperties)throw Error("unevaluatedProperties is not supported");if(void 0!==i.if||void 0!==i.then||void 0!==i.else)throw Error("Conditional schemas (if/then/else) are not supported");if(void 0!==i.dependentSchemas||void 0!==i.dependentRequired)throw Error("dependentSchemas and dependentRequired are not supported");if(i.$ref){let t=i.$ref;if(n.refs.has(t))return n.refs.get(t);if(n.processing.has(t))return dw.lazy(()=>{if(!n.refs.has(t))throw Error(`Circular reference not resolved: ${t}`);return n.refs.get(t)});n.processing.add(t);let r=e(function(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let i=e.slice(1).split("/").filter(Boolean);if(0===i.length)return t.rootSchema;let n="draft-2020-12"===t.version?"$defs":"definitions";if(i[0]===n){let n=i[1];if(!n||!t.defs[n])throw Error(`Reference not found: ${e}`);return t.defs[n]}throw Error(`Reference not found: ${e}`)}(t,n),n);return n.refs.set(t,r),n.processing.delete(t),r}if(void 0!==i.enum){let e=i.enum;if("openapi-3.0"===n.version&&!0===i.nullable&&1===e.length&&null===e[0])return dw.null();if(0===e.length)return dw.never();if(1===e.length)return dw.literal(e[0]);if(e.every(e=>"string"==typeof e))return dw.enum(e);let t=e.map(e=>dw.literal(e));return t.length<2?t[0]:dw.union([t[0],t[1],...t.slice(2)])}if(void 0!==i.const)return dw.literal(i.const);let a=i.type;if(Array.isArray(a)){let e=a.map(e=>t({...i,type:e},n));return 0===e.length?dw.never():1===e.length?e[0]:dw.union(e)}if(!a)return dw.any();switch(a){case"string":{let e=dw.string();if(i.format){let t=i.format;"email"===t?e=e.check(dw.email()):"uri"===t||"uri-reference"===t?e=e.check(dw.url()):"uuid"===t||"guid"===t?e=e.check(dw.uuid()):"date-time"===t?e=e.check(dw.iso.datetime()):"date"===t?e=e.check(dw.iso.date()):"time"===t?e=e.check(dw.iso.time()):"duration"===t?e=e.check(dw.iso.duration()):"ipv4"===t?e=e.check(dw.ipv4()):"ipv6"===t?e=e.check(dw.ipv6()):"mac"===t?e=e.check(dw.mac()):"cidr"===t?e=e.check(dw.cidrv4()):"cidr-v6"===t?e=e.check(dw.cidrv6()):"base64"===t?e=e.check(dw.base64()):"base64url"===t?e=e.check(dw.base64url()):"e164"===t?e=e.check(dw.e164()):"jwt"===t?e=e.check(dw.jwt()):"emoji"===t?e=e.check(dw.emoji()):"nanoid"===t?e=e.check(dw.nanoid()):"cuid"===t?e=e.check(dw.cuid()):"cuid2"===t?e=e.check(dw.cuid2()):"ulid"===t?e=e.check(dw.ulid()):"xid"===t?e=e.check(dw.xid()):"ksuid"===t&&(e=e.check(dw.ksuid()))}"number"==typeof i.minLength&&(e=e.min(i.minLength)),"number"==typeof i.maxLength&&(e=e.max(i.maxLength)),i.pattern&&(e=e.regex(new RegExp(i.pattern))),r=e;break}case"number":case"integer":{let e="integer"===a?dw.number().int():dw.number();"number"==typeof i.minimum&&(e=e.min(i.minimum)),"number"==typeof i.maximum&&(e=e.max(i.maximum)),"number"==typeof i.exclusiveMinimum?e=e.gt(i.exclusiveMinimum):!0===i.exclusiveMinimum&&"number"==typeof i.minimum&&(e=e.gt(i.minimum)),"number"==typeof i.exclusiveMaximum?e=e.lt(i.exclusiveMaximum):!0===i.exclusiveMaximum&&"number"==typeof i.maximum&&(e=e.lt(i.maximum)),"number"==typeof i.multipleOf&&(e=e.multipleOf(i.multipleOf)),r=e;break}case"boolean":r=dw.boolean();break;case"null":r=dw.null();break;case"object":{let t={},a=i.properties||{},o=new Set(i.required||[]);for(let[i,r]of Object.entries(a)){let a=e(r,n);t[i]=o.has(i)?a:a.optional()}if(i.propertyNames){let a=e(i.propertyNames,n),o=i.additionalProperties&&"object"==typeof i.additionalProperties?e(i.additionalProperties,n):dw.any();if(0===Object.keys(t).length){r=dw.record(a,o);break}let s=dw.object(t).passthrough(),u=dw.looseRecord(a,o);r=dw.intersection(s,u);break}if(i.patternProperties){let a=i.patternProperties,o=Object.keys(a),s=[];for(let t of o){let i=e(a[t],n),r=dw.string().regex(new RegExp(t));s.push(dw.looseRecord(r,i))}let u=[];if(Object.keys(t).length>0&&u.push(dw.object(t).pas