@halcyonlabs/app 0.47.0-halcyon.706 → 0.47.0-halcyon.708
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.
- package/dist/index.d.ts +75 -75
- package/package.json +2 -2
- package/server/dist/builtin-plugins/orbit/dist/assets/moonlet/fixed-runner/linux-x64/manifest.json +4 -4
- package/server/dist/builtin-plugins/orbit/dist/assets/moonlet/revision +1 -1
- package/server/dist/builtin-plugins/orbit/dist/assets/moonlet/source.json +1 -1
- package/server/dist/builtin-plugins/orbit/dist/server.js +32 -32
- package/server/dist/builtin-plugins/people/dist/host.js +9 -9
- package/server/dist/builtin-plugins/people/dist/host.meta.json +1 -1
- package/server/dist/builtin-plugins/people/dist/server.js +1 -1
|
@@ -4,12 +4,12 @@ import { fileURLToPath as __fileURLToPath } from "node:url";
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
var jm=Object.create;var Ur=Object.defineProperty;var Lm=Object.getOwnPropertyDescriptor;var Vm=Object.getOwnPropertyNames;var Fm=Object.getPrototypeOf,Mm=Object.prototype.hasOwnProperty;var s=(e,t)=>Ur(e,"name",{value:t,configurable:!0}),ke=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var ie=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},_e=(e,t)=>{for(var r in t)Ur(e,r,{get:t[r],enumerable:!0})},Um=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vm(t))!Mm.call(e,o)&&o!==r&&Ur(e,o,{get:()=>t[o],enumerable:!(n=Lm(t,o))||n.enumerable});return e};var Bm=(e,t,r)=>(r=e!=null?jm(Fm(e)):{},Um(t||!e||!e.__esModule?Ur(r,"default",{value:e,enumerable:!0}):r,e));var Td=ie((Sb,Cd)=>{Cd.exports=Ed;Ed.sync=P_;var Zd=ke("fs");function S_(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}s(S_,"checkPathExt");function Nd(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:S_(t,r)}s(Nd,"checkStat");function Ed(e,t,r){Zd.stat(e,function(n,o){r(n,n?!1:Nd(o,e,t))})}s(Ed,"isexe");function P_(e,t){return Nd(Zd.statSync(e),e,t)}s(P_,"sync")});var Vd=ie((Ib,Ld)=>{Ld.exports=Rd;Rd.sync=I_;var Dd=ke("fs");function Rd(e,t,r){Dd.stat(e,function(n,o){r(n,n?!1:jd(o,t))})}s(Rd,"isexe");function I_(e,t){return jd(Dd.statSync(e),t)}s(I_,"sync");function jd(e,t){return e.isFile()&&O_(e,t)}s(jd,"checkStat");function O_(e,t){var r=e.mode,n=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),c=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),u=parseInt("100",8),a=parseInt("010",8),l=parseInt("001",8),f=u|a,p=r&l||r&a&&o===c||r&u&&n===i||r&f&&i===0;return p}s(O_,"checkMode")});var Md=ie((Zb,Fd)=>{var Ab=ke("fs"),Xo;process.platform==="win32"||global.TESTING_WINDOWS?Xo=Td():Xo=Vd();Fd.exports=zl;zl.sync=A_;function zl(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){zl(e,t||{},function(i,c){i?o(i):n(c)})})}Xo(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}s(zl,"isexe");function A_(e,t){try{return Xo.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}s(A_,"sync")});var Gd=ie((Eb,qd)=>{var Ft=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Ud=ke("path"),Z_=Ft?";":":",Bd=Md(),Jd=s(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),Kd=s((e,t)=>{let r=t.colon||Z_,n=e.match(/\//)||Ft&&e.match(/\\/)?[""]:[...Ft?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=Ft?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=Ft?o.split(r):[""];return Ft&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},"getPathInfo"),Wd=s((e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:i}=Kd(e,t),c=[],u=s(l=>new Promise((f,p)=>{if(l===n.length)return t.all&&c.length?f(c):p(Jd(e));let m=n[l],h=/^".*"$/.test(m)?m.slice(1,-1):m,g=Ud.join(h,e),_=!h&&/^\.[\\\/]/.test(e)?e.slice(0,2)+g:g;f(a(_,l,0))}),"step"),a=s((l,f,p)=>new Promise((m,h)=>{if(p===o.length)return m(u(f+1));let g=o[p];Bd(l+g,{pathExt:i},(_,w)=>{if(!_&&w)if(t.all)c.push(l+g);else return m(l+g);return m(a(l,f,p+1))})}),"subStep");return r?u(0).then(l=>r(null,l),r):u(0)},"which"),N_=s((e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=Kd(e,t),i=[];for(let c=0;c<r.length;c++){let u=r[c],a=/^".*"$/.test(u)?u.slice(1,-1):u,l=Ud.join(a,e),f=!a&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let p=0;p<n.length;p++){let m=f+n[p];try{if(Bd.sync(m,{pathExt:o}))if(t.all)i.push(m);else return m}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw Jd(e)},"whichSync");qd.exports=Wd;Wd.sync=N_});var Xd=ie((Tb,Sl)=>{"use strict";var Hd=s((e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");Sl.exports=Hd;Sl.exports.default=Hd});var tm=ie((Rb,em)=>{"use strict";var Yd=ke("path"),E_=Gd(),C_=Xd();function Qd(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let c;try{c=E_.sync(e.command,{path:r[C_({env:r})],pathExt:t?Yd.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return c&&(c=Yd.resolve(o?e.options.cwd:"",c)),c}s(Qd,"resolveCommandAttempt");function T_(e){return Qd(e)||Qd(e,!0)}s(T_,"resolveCommand");em.exports=T_});var rm=ie((Lb,Il)=>{"use strict";var Pl=/([()\][%!^"`<>&|;, *?])/g;function D_(e){return e=e.replace(Pl,"^$1"),e}s(D_,"escapeCommand");function R_(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Pl,"^$1"),t&&(e=e.replace(Pl,"^$1")),e}s(R_,"escapeArgument");Il.exports.command=D_;Il.exports.argument=R_});var om=ie((Fb,nm)=>{"use strict";nm.exports=/^#!(.*)/});var sm=ie((Mb,im)=>{"use strict";var j_=om();im.exports=(e="")=>{let t=e.match(j_);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var um=ie((Ub,cm)=>{"use strict";var Ol=ke("fs"),L_=sm();function V_(e){let r=Buffer.alloc(150),n;try{n=Ol.openSync(e,"r"),Ol.readSync(n,r,0,150,0),Ol.closeSync(n)}catch{}return L_(r.toString())}s(V_,"readShebang");cm.exports=V_});var pm=ie((Jb,fm)=>{"use strict";var F_=ke("path"),am=tm(),lm=rm(),M_=um(),U_=process.platform==="win32",B_=/\.(?:com|exe)$/i,J_=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function K_(e){e.file=am(e);let t=e.file&&M_(e.file);return t?(e.args.unshift(e.file),e.command=t,am(e)):e.file}s(K_,"detectShebang");function W_(e){if(!U_)return e;let t=K_(e),r=!B_.test(t);if(e.options.forceShell||r){let n=J_.test(t);e.command=F_.normalize(e.command),e.command=lm.command(e.command),e.args=e.args.map(i=>lm.argument(i,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}s(W_,"parseNonShell");function q_(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:W_(n)}s(q_,"parse");fm.exports=q_});var hm=ie((Wb,mm)=>{"use strict";var Al=process.platform==="win32";function Zl(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}s(Zl,"notFoundError");function G_(e,t){if(!Al)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let i=dm(o,t);if(i)return r.call(e,"error",i)}return r.apply(e,arguments)}}s(G_,"hookChildProcess");function dm(e,t){return Al&&e===1&&!t.file?Zl(t.original,"spawn"):null}s(dm,"verifyENOENT");function H_(e,t){return Al&&e===1&&!t.file?Zl(t.original,"spawnSync"):null}s(H_,"verifyENOENTSync");mm.exports={hookChildProcess:G_,verifyENOENT:dm,verifyENOENTSync:H_,notFoundError:Zl}});var _m=ie((Gb,Mt)=>{"use strict";var gm=ke("child_process"),Nl=pm(),El=hm();function ym(e,t,r){let n=Nl(e,t,r),o=gm.spawn(n.command,n.args,n.options);return El.hookChildProcess(o,n),o}s(ym,"spawn");function X_(e,t,r){let n=Nl(e,t,r),o=gm.spawnSync(n.command,n.args,n.options);return o.error=o.error||El.verifyENOENTSync(o.status,n),o}s(X_,"spawnSync");Mt.exports=ym;Mt.exports.spawn=ym;Mt.exports.sync=X_;Mt.exports._parse=Nl;Mt.exports._enoent=El});import{execFile as I$}from"node:child_process";import{promisify as O$}from"node:util";var y={};_e(y,{$brand:()=>mi,$input:()=>Lc,$output:()=>jc,INVALID:()=>X,NEVER:()=>di,TimePrecision:()=>Hc,ZodAny:()=>Ra,ZodArray:()=>Fa,ZodBase64:()=>Fo,ZodBase64URL:()=>Mo,ZodBigInt:()=>jt,ZodBigIntFormat:()=>Jo,ZodBoolean:()=>Rt,ZodCIDRv4:()=>Lo,ZodCIDRv6:()=>Vo,ZodCUID:()=>No,ZodCUID2:()=>Eo,ZodCatch:()=>ul,ZodCodec:()=>Rr,ZodCompileAsyncError:()=>pe,ZodCompileUnsupportedError:()=>Z,ZodCreditCard:()=>Oa,ZodCustom:()=>jr,ZodCustomStringFormat:()=>et,ZodDate:()=>Zr,ZodDefault:()=>rl,ZodDiscriminatedUnion:()=>Ua,ZodE164:()=>Uo,ZodEmail:()=>Io,ZodEmoji:()=>Ao,ZodEnum:()=>Ct,ZodError:()=>e_,ZodExactOptional:()=>Go,ZodFile:()=>Ya,ZodFirstPartyTypeKind:()=>vl,ZodFunction:()=>_l,ZodGUID:()=>Oo,ZodIBAN:()=>Aa,ZodIPv4:()=>Ro,ZodIPv6:()=>jo,ZodISODate:()=>Ce,ZodISODateTime:()=>Ee,ZodISODuration:()=>De,ZodISOTime:()=>Te,ZodInstanceOf:()=>bl,ZodIntersection:()=>Ba,ZodIssueCode:()=>n_,ZodJWT:()=>Bo,ZodKSUID:()=>Do,ZodLazy:()=>hl,ZodLiteral:()=>Xa,ZodMAC:()=>Ia,ZodMap:()=>Ga,ZodNaN:()=>ll,ZodNanoID:()=>Zo,ZodNever:()=>La,ZodNonOptional:()=>Ho,ZodNull:()=>Ta,ZodNullable:()=>tl,ZodNumber:()=>Dt,ZodNumberFormat:()=>tt,ZodObject:()=>Er,ZodOptional:()=>Tr,ZodPipe:()=>Dr,ZodPrefault:()=>ol,ZodPreprocess:()=>fl,ZodPromise:()=>yl,ZodReadonly:()=>pl,ZodRealError:()=>oe,ZodRecord:()=>Et,ZodSet:()=>Ha,ZodString:()=>Tt,ZodStringFormat:()=>R,ZodSuccess:()=>cl,ZodSymbol:()=>Ea,ZodTemplateLiteral:()=>ml,ZodTransform:()=>Qa,ZodTuple:()=>Ka,ZodType:()=>O,ZodULID:()=>Co,ZodURL:()=>Ar,ZodUUID:()=>ye,ZodUndefined:()=>Ca,ZodUnion:()=>Cr,ZodUnknown:()=>ja,ZodVoid:()=>Va,ZodXID:()=>To,ZodXor:()=>Ma,_ZodString:()=>Po,_default:()=>nl,_function:()=>pd,any:()=>Up,array:()=>Nr,base64:()=>xp,base64url:()=>kp,bigint:()=>jp,boolean:()=>Na,catch:()=>al,check:()=>dd,cidrv4:()=>bp,cidrv6:()=>vp,clone:()=>C,codec:()=>ud,coerce:()=>kl,compile:()=>Uc,config:()=>F,core:()=>xe,creditCard:()=>Sp,cuid:()=>dp,cuid2:()=>mp,currencyCode:()=>Np,custom:()=>md,date:()=>Jp,decode:()=>ba,decodeAsync:()=>xa,deepPartial:()=>Pd,describe:()=>hd,discriminatedUnion:()=>Xp,e164:()=>zp,email:()=>np,emoji:()=>fp,encode:()=>wa,encodeAsync:()=>va,endsWith:()=>vt,enum:()=>Wo,exactOptional:()=>el,file:()=>od,flattenError:()=>Qt,float32:()=>Cp,float64:()=>Tp,formatError:()=>er,fromJSONSchema:()=>zd,function:()=>pd,getDiscriminatedOption:()=>pc,getErrorMap:()=>i_,globalRegistry:()=>K,gt:()=>he,gte:()=>ce,guid:()=>op,hash:()=>Ep,hex:()=>Zp,hostname:()=>Ap,httpUrl:()=>lp,iban:()=>Pp,includes:()=>wt,input:()=>Od,instanceof:()=>yd,int:()=>zo,int32:()=>Dp,int64:()=>Lp,intersection:()=>Ja,invertCodec:()=>ad,ipv4:()=>_p,ipv6:()=>wp,iso:()=>Lr,json:()=>$d,jwt:()=>Ip,keyof:()=>Kp,ksuid:()=>yp,lazy:()=>gl,length:()=>Ge,literal:()=>nd,locales:()=>wr,looseObject:()=>Gp,looseRecord:()=>Qp,lowercase:()=>_t,lt:()=>me,lte:()=>se,mac:()=>$p,map:()=>ed,maxLength:()=>qe,maxSize:()=>Oe,memoizer:()=>_r,meta:()=>gd,mime:()=>kt,minLength:()=>ve,minSize:()=>ge,multipleOf:()=>Ie,nan:()=>cd,nanoid:()=>pp,nativeEnum:()=>rd,negative:()=>mo,never:()=>Ko,nonnegative:()=>go,nonoptional:()=>sl,nonpositive:()=>ho,normalize:()=>zt,null:()=>Da,nullable:()=>Or,nullish:()=>id,number:()=>Za,object:()=>Wp,optional:()=>Ye,output:()=>Ad,overwrite:()=>de,parse:()=>ga,parseAsync:()=>ya,partialRecord:()=>Yp,pipe:()=>So,positive:()=>po,prefault:()=>il,preprocess:()=>wd,prettifyError:()=>$i,promise:()=>fd,properties:()=>xt,property:()=>yo,readonly:()=>dl,record:()=>qa,refine:()=>$l,regex:()=>yt,regexes:()=>le,registry:()=>Fn,safeDecode:()=>za,safeDecodeAsync:()=>Pa,safeEncode:()=>ka,safeEncodeAsync:()=>Sa,safeParse:()=>_a,safeParseAsync:()=>$a,set:()=>td,setErrorMap:()=>o_,size:()=>We,slugify:()=>Ot,startsWith:()=>bt,strictObject:()=>qp,string:()=>Ir,stringFormat:()=>Op,stringbool:()=>_d,success:()=>sd,superRefine:()=>wl,symbol:()=>Fp,templateLiteral:()=>ld,toJSONSchema:()=>bo,toLowerCase:()=>Pt,toUpperCase:()=>It,toZod:()=>Bt,transform:()=>qo,treeifyError:()=>_i,trim:()=>St,tuple:()=>Wa,uint32:()=>Rp,uint64:()=>Vp,ulid:()=>hp,undefined:()=>Mp,union:()=>Lt,unknown:()=>Xe,uppercase:()=>$t,url:()=>ap,util:()=>v,uuid:()=>ip,uuidv4:()=>sp,uuidv6:()=>cp,uuidv7:()=>up,validate:()=>tr,validateAsync:()=>rr,void:()=>Bp,withParser:()=>Mn,xid:()=>gp,xor:()=>Hp});var xe={};_e(xe,{$ZodAny:()=>oc,$ZodArray:()=>ac,$ZodAsyncError:()=>re,$ZodBase64:()=>Ks,$ZodBase64URL:()=>Ws,$ZodBigInt:()=>An,$ZodBigIntFormat:()=>ec,$ZodBoolean:()=>pr,$ZodCIDRv4:()=>Bs,$ZodCIDRv6:()=>Js,$ZodCUID:()=>Ns,$ZodCUID2:()=>Es,$ZodCatch:()=>Ic,$ZodCheck:()=>j,$ZodCheckBigIntFormat:()=>is,$ZodCheckEndsWith:()=>ys,$ZodCheckGreaterThan:()=>mn,$ZodCheckIncludes:()=>hs,$ZodCheckLengthEquals:()=>fs,$ZodCheckLessThan:()=>dn,$ZodCheckLowerCase:()=>ds,$ZodCheckMaxLength:()=>as,$ZodCheckMaxSize:()=>ss,$ZodCheckMimeType:()=>ws,$ZodCheckMinLength:()=>ls,$ZodCheckMinSize:()=>cs,$ZodCheckMultipleOf:()=>ns,$ZodCheckNumberFormat:()=>os,$ZodCheckOverwrite:()=>bs,$ZodCheckProperties:()=>$s,$ZodCheckProperty:()=>_s,$ZodCheckRegex:()=>ps,$ZodCheckSizeEquals:()=>us,$ZodCheckStartsWith:()=>gs,$ZodCheckStringFormat:()=>dt,$ZodCheckUpperCase:()=>ms,$ZodCodec:()=>mr,$ZodCreditCard:()=>Gs,$ZodCustom:()=>Tc,$ZodCustomStringFormat:()=>Ys,$ZodCyclicError:()=>Rn,$ZodDate:()=>uc,$ZodDefault:()=>kc,$ZodDiscriminatedUnion:()=>dc,$ZodE164:()=>qs,$ZodEmail:()=>Ss,$ZodEmoji:()=>As,$ZodEncodeError:()=>Pe,$ZodEnum:()=>_c,$ZodError:()=>yi,$ZodExactOptional:()=>vc,$ZodFile:()=>wc,$ZodFunction:()=>Ec,$ZodGUID:()=>ks,$ZodIBAN:()=>Hs,$ZodIPv4:()=>Fs,$ZodIPv6:()=>Ms,$ZodISODate:()=>js,$ZodISODateTime:()=>Rs,$ZodISODuration:()=>Vs,$ZodISOTime:()=>Ls,$ZodIntersection:()=>mc,$ZodJWT:()=>Xs,$ZodKSUID:()=>Ds,$ZodLazy:()=>hr,$ZodLiteral:()=>$c,$ZodMAC:()=>Us,$ZodMap:()=>gc,$ZodNaN:()=>Oc,$ZodNanoID:()=>Zs,$ZodNever:()=>sc,$ZodNonOptional:()=>Sc,$ZodNull:()=>nc,$ZodNullable:()=>xc,$ZodNumber:()=>On,$ZodNumberFormat:()=>Qs,$ZodObject:()=>xf,$ZodObjectJIT:()=>lc,$ZodOptional:()=>Nn,$ZodPipe:()=>En,$ZodPrefault:()=>zc,$ZodPreprocess:()=>Ac,$ZodPromise:()=>Cc,$ZodReadonly:()=>Zc,$ZodRealError:()=>ne,$ZodRecord:()=>hc,$ZodRegistry:()=>Vn,$ZodSet:()=>yc,$ZodString:()=>Me,$ZodStringFormat:()=>T,$ZodSuccess:()=>Pc,$ZodSymbol:()=>tc,$ZodTemplateLiteral:()=>Nc,$ZodTransform:()=>bc,$ZodTuple:()=>Zn,$ZodType:()=>P,$ZodULID:()=>Cs,$ZodURL:()=>Os,$ZodUUID:()=>zs,$ZodUndefined:()=>rc,$ZodUnion:()=>dr,$ZodUnknown:()=>ic,$ZodVoid:()=>cc,$ZodXID:()=>Ts,$ZodXor:()=>fc,$brand:()=>mi,$constructor:()=>d,$input:()=>Lc,$output:()=>jc,Doc:()=>Fe,INVALID:()=>X,JSONSchema:()=>ep,JSONSchemaGenerator:()=>vo,NEVER:()=>di,TimePrecision:()=>Hc,URL_BAD_FORMAT:()=>Ps,URL_UNPARSEABLE:()=>cr,ZodCompileAsyncError:()=>pe,ZodCompileUnsupportedError:()=>Z,_any:()=>du,_array:()=>wu,_base64:()=>uo,_base64url:()=>ao,_bigint:()=>su,_boolean:()=>ou,_catch:()=>My,_check:()=>jf,_cidrv4:()=>so,_cidrv6:()=>co,_coercedBigint:()=>cu,_coercedBoolean:()=>iu,_coercedDate:()=>_u,_coercedNumber:()=>Yc,_coercedString:()=>Kc,_creditCard:()=>qc,_cuid:()=>Qn,_cuid2:()=>eo,_custom:()=>vu,_date:()=>yu,_decode:()=>tn,_decodeAsync:()=>nn,_default:()=>Ly,_discriminatedUnion:()=>Py,_e164:()=>lo,_email:()=>Jn,_emoji:()=>Xn,_encode:()=>en,_encodeAsync:()=>rn,_endsWith:()=>vt,_enum:()=>Ey,_file:()=>bu,_float32:()=>eu,_float64:()=>tu,_gt:()=>he,_gte:()=>ce,_guid:()=>Kn,_iban:()=>Gc,_includes:()=>wt,_int:()=>Qc,_int32:()=>ru,_int64:()=>uu,_intersection:()=>Iy,_ipv4:()=>oo,_ipv6:()=>io,_isoDate:()=>xr,_isoDateTime:()=>vr,_isoDuration:()=>zr,_isoTime:()=>kr,_jwt:()=>fo,_ksuid:()=>no,_lazy:()=>Ky,_length:()=>Ge,_literal:()=>Ty,_lowercase:()=>_t,_lt:()=>me,_lte:()=>se,_mac:()=>Wc,_map:()=>Zy,_max:()=>se,_maxLength:()=>qe,_maxSize:()=>Oe,_mime:()=>kt,_min:()=>ce,_minLength:()=>ve,_minSize:()=>ge,_multipleOf:()=>Ie,_nan:()=>$u,_nanoid:()=>Yn,_nativeEnum:()=>Cy,_negative:()=>mo,_never:()=>hu,_nonnegative:()=>go,_nonoptional:()=>Vy,_nonpositive:()=>ho,_normalize:()=>zt,_null:()=>pu,_nullable:()=>jy,_number:()=>Xc,_optional:()=>Ry,_overwrite:()=>de,_parse:()=>at,_parseAsync:()=>lt,_pipe:()=>Uy,_positive:()=>po,_promise:()=>Wy,_properties:()=>xt,_property:()=>yo,_readonly:()=>By,_record:()=>Ay,_refine:()=>xu,_regex:()=>yt,_safeDecode:()=>sn,_safeDecodeAsync:()=>un,_safeEncode:()=>on,_safeEncodeAsync:()=>cn,_safeParse:()=>ft,_safeParseAsync:()=>pt,_set:()=>Ny,_size:()=>We,_slugify:()=>Ot,_startsWith:()=>bt,_string:()=>Jc,_stringFormat:()=>He,_stringbool:()=>Pu,_success:()=>Fy,_superRefine:()=>ku,_symbol:()=>lu,_templateLiteral:()=>Jy,_toLowerCase:()=>Pt,_toUpperCase:()=>It,_transform:()=>Dy,_trim:()=>St,_tuple:()=>Oy,_uint32:()=>nu,_uint64:()=>au,_ulid:()=>to,_undefined:()=>fu,_union:()=>zy,_unknown:()=>mu,_uppercase:()=>$t,_url:()=>br,_uuid:()=>Wn,_uuidv4:()=>qn,_uuidv6:()=>Gn,_uuidv7:()=>Hn,_void:()=>gu,_xid:()=>ro,_xor:()=>Sy,base64Charset:()=>kn,base64urlCharset:()=>fr,canParseURL:()=>Is,clone:()=>C,compile:()=>Uc,compileFn:()=>Un,config:()=>F,createStandardJSONSchemaMethod:()=>At,createToJSONSchemaMethod:()=>Ou,decode:()=>Th,decodeAsync:()=>Rh,describe:()=>zu,encode:()=>Ch,encodeAsync:()=>Dh,extractDefs:()=>Ze,finalize:()=>Ne,flattenError:()=>Qt,formatError:()=>er,getDiscriminatedOption:()=>pc,globalConfig:()=>B,globalRegistry:()=>K,handleUnrepresentable:()=>M,initializeContext:()=>Ae,isBackEdge:()=>Ln,isRecursiveSchema:()=>jn,isValidBase64:()=>lr,isValidBase64URL:()=>zn,isValidCIDRv6:()=>xn,isValidCreditCard:()=>Sn,isValidIBAN:()=>Pn,isValidIPv6:()=>ar,isValidJWT:()=>In,locales:()=>wr,memoizer:()=>_r,mergeValues:()=>mt,meta:()=>Su,parse:()=>Yr,parseAsync:()=>Qr,parseURLObject:()=>wf,prettifyError:()=>$i,process:()=>D,processSchema:()=>D,regexes:()=>le,registry:()=>Fn,safeDecode:()=>Lh,safeDecodeAsync:()=>Fh,safeEncode:()=>jh,safeEncodeAsync:()=>Vh,safeParse:()=>Oh,safeParseAsync:()=>Ah,standardProps:()=>$n,stripTabAndNewline:()=>ur,toDotPath:()=>Yl,toJSONSchema:()=>bo,toZod:()=>Bt,treeifyError:()=>_i,urlHostnameOk:()=>bn,urlProtocolOk:()=>vn,util:()=>v,validate:()=>tr,validateAsync:()=>rr,validateURL:()=>wn,version:()=>vs,withParser:()=>Mn});var v={};_e(v,{BIGINT_FORMAT_RANGES:()=>Gt,CONSTANT_CATCH:()=>Hr,Class:()=>ri,NUMBER_FORMAT_RANGES:()=>qt,aborted:()=>H,allowsEval:()=>ii,assert:()=>Gm,assertEqual:()=>Jm,assertIs:()=>Wm,assertNever:()=>qm,assertNotEqual:()=>Km,assignProp:()=>J,attachSchema:()=>Gr,base64ToUint8Array:()=>Kl,base64urlToUint8Array:()=>mh,cached:()=>st,captureStackTrace:()=>Kr,cleanEnum:()=>dh,cleanRegex:()=>we,clone:()=>C,cloneDef:()=>Ym,codePointLength:()=>Le,constantCatch:()=>fi,createTransparentProxy:()=>oh,defineLazy:()=>ni,defineLazyInternal:()=>A,derived:()=>_h,esc:()=>G,escapeRegex:()=>ae,explicitlyAborted:()=>ui,extend:()=>ch,finalizeIssue:()=>te,floatSafeRemainder:()=>Jt,getElementAtPath:()=>Qm,getEnumValues:()=>ot,getLengthableOrigin:()=>Xt,getParsedType:()=>nh,getSizableOrigin:()=>Ht,hexToUint8Array:()=>gh,hide:()=>Yt,installLazyProp:()=>vh,isObject:()=>je,isPlainObject:()=>ue,issue:()=>ut,joinValues:()=>Br,jsonStringifyReplacer:()=>it,members:()=>li,merge:()=>ah,mergeDefs:()=>fe,normalizeParams:()=>$,nullish:()=>Jr,numKeys:()=>rh,objectClone:()=>Hm,omit:()=>sh,optionalKeys:()=>ci,own:()=>Se,parsedType:()=>ai,partial:()=>lh,pick:()=>ih,prefixIssues:()=>ee,primitiveTypes:()=>si,promiseAllObject:()=>eh,propertyKeyTypes:()=>Wt,randomString:()=>th,rawShape:()=>ct,required:()=>fh,safeExtend:()=>uh,shallowClone:()=>Kt,slugify:()=>oi,stringifyPrimitive:()=>Wr,toZod:()=>Bt,uint8ArrayToBase64:()=>Wl,uint8ArrayToBase64url:()=>hh,uint8ArrayToHex:()=>yh,unwrapMessage:()=>nt});function Jm(e){return e}s(Jm,"assertEqual");function Km(e){return e}s(Km,"assertNotEqual");function Bt(){return e=>e}s(Bt,"toZod");function Wm(e){}s(Wm,"assertIs");function qm(e){throw new Error("Unexpected value in exhaustive check")}s(qm,"assertNever");function Gm(e){}s(Gm,"assert");function ot(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}s(ot,"getEnumValues");function Br(e,t="|"){return e.map(r=>Wr(r)).join(t)}s(Br,"joinValues");function it(e,t){return typeof t=="bigint"?t.toString():t}s(it,"jsonStringifyReplacer");var ti=class{static{s(this,"Cached")}constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function st(e){return new ti(e)}s(st,"cached");function Jr(e){return e==null}s(Jr,"nullish");function we(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}s(we,"cleanRegex");function Jt(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}s(Jt,"floatSafeRemainder");var Ml=Symbol("evaluating");function ni(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Ml)return n===void 0&&(n=Ml,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}s(ni,"defineLazy");function Hm(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}s(Hm,"objectClone");function J(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}s(J,"assignProp");function ct(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}s(ct,"rawShape");function $e(e){return ct(e._zod.def)??e._zod.def.shape}s($e,"sourceShape");function Ul(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return J(this,t,n),n},enumerable:!0,configurable:!0})}s(Ul,"deferProp");function Bl(e,t,r){t in e?J(e,t,r):e[t]=r}s(Bl,"putProp");function Re(e,t,r,n){let o=$e(t);for(let i of r){let c=Object.getOwnPropertyDescriptor(o,i);c.enumerable&&(c.get?Ul(e,i,()=>{let u=t._zod.def.shape[i];return n?n(u,i):u}):Bl(e,i,n?n(c.value,i):c.value))}}s(Re,"mirrorShape");function Xm(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?Ul(e,r,()=>t[r]):Bl(e,r,n.value))}}s(Xm,"mirrorProps");function fe(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}s(fe,"mergeDefs");function Ym(e){return fe(e._zod.def)}s(Ym,"cloneDef");function Qm(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}s(Qm,"getElementAtPath");function eh(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}s(eh,"promiseAllObject");function th(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}s(th,"randomString");function G(e){return JSON.stringify(e)}s(G,"esc");function oi(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}s(oi,"slugify");var Kr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function je(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(je,"isObject");var ii=st(()=>{if(B.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ue(e){if(je(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(je(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}s(ue,"isPlainObject");function Kt(e){return ue(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}s(Kt,"shallowClone");function rh(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}s(rh,"numKeys");var nh=s(e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},"getParsedType"),Wt=new Set(["string","number","symbol"]),si=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ae(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(ae,"escapeRegex");function C(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}s(C,"clone");function $(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:s(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:s(()=>t.error,"error")}:t}s($,"normalizeParams");function oh(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}s(oh,"createTransparentProxy");function Wr(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}s(Wr,"stringifyPrimitive");function ci(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}s(ci,"optionalKeys");var qt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Gt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ih(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return Re(i,e,qr(e,t)),C(e,fe(r,{shape:i,checks:[]}))}s(ih,"pick");function qr(e,t){let r=$e(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o)}return n}s(qr,"maskedKeys");function sh(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(qr(e,t)),c={};return Re(c,e,Reflect.ownKeys($e(e)).filter(u=>!i.has(u))),C(e,fe(r,{shape:c,checks:[]}))}s(sh,"omit");function ch(e,t){if(!ue(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=$e(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return C(e,fe(e._zod.def,{shape:Jl(e,t)}))}s(ch,"extend");function Jl(e,t){let r={};return Re(r,e,Reflect.ownKeys($e(e))),Xm(r,t),r}s(Jl,"extended");function uh(e,t){if(!ue(t))throw new Error("Invalid input to safeExtend: expected a plain object");return C(e,fe(e._zod.def,{shape:Jl(e,t)}))}s(uh,"safeExtend");function ah(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Re(r,e,Reflect.ownKeys($e(e))),Re(r,t,Reflect.ownKeys($e(t)));let n=fe(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return C(e,n)}s(ah,"merge");function lh(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let u=r?new Set(qr(t,r)):void 0,a={};return Re(a,t,Reflect.ownKeys($e(t)),e&&((l,f)=>u&&!u.has(f)?l:new e({type:"optional",innerType:l}))),C(t,fe(t._zod.def,{shape:a,checks:[]}))}s(lh,"partial");function fh(e,t,r){let n=r?new Set(qr(t,r)):void 0,o={};return Re(o,t,Reflect.ownKeys($e(t)),(i,c)=>n&&!n.has(c)?i:new e({type:"nonoptional",innerType:i})),C(t,fe(t._zod.def,{shape:o}))}s(fh,"required");function H(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}s(H,"aborted");function ui(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}s(ui,"explicitlyAborted");function ee(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}s(ee,"prefixIssues");function nt(e){return typeof e=="string"?e:e?.message}s(nt,"unwrapMessage");function Gr(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}s(Gr,"attachSchema");function te(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,c=e.message?e.message:nt(e.inst?._zod.def?.error?.(e))??nt(i?.(e))??nt(t?.error?.(e))??nt(r.customError?.(e))??nt(r.localeError?.(e))??"Invalid input",u={};for(let a of Object.keys(e))a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__"||(u[a]=e[a]);return u.path??(u.path=[]),u.message=c,t?.reportInput&&(u.input=e.input),u}s(te,"finalizeIssue");function Ht(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}s(Ht,"getSizableOrigin");var ph=/[\uD800-\uDBFF]/;function Le(e){let t=e.length;if(!ph.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}s(Le,"codePointLength");function Xt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}s(Xt,"getLengthableOrigin");function ai(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}s(ai,"parsedType");function ut(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}s(ut,"issue");function dh(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}s(dh,"cleanEnum");function Kl(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}s(Kl,"base64ToUint8Array");function Wl(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}s(Wl,"uint8ArrayToBase64");function mh(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Kl(t+r)}s(mh,"base64urlToUint8Array");function hh(e){return Wl(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}s(hh,"uint8ArrayToBase64url");function gh(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}s(gh,"hexToUint8Array");function yh(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}s(yh,"uint8ArrayToHex");var ri=class{static{s(this,"Class")}constructor(...t){}};function li(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):$h(e,r,n.value)}}s(li,"members");function Se(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}s(Se,"own");function Yt(e,t,r){return Se(e,t,r,!1)}s(Yt,"hide");function _h(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Se(this,r,n(this))},set(o){Se(this,r,o)}})}return t}s(_h,"derived");function $h(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Se(this,t,r.bind(this))},set(n){Se(this,t,n)}})}s($h,"defineBound");function wh(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}s(wh,"claim");var ei,ze=!1,bh={configurable:!0,get(){ze=!0}};function A(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&ei!==e._zod){ei=void 0;return}ei=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,bh);let o=ze;ze=!1;try{let i=r(this);return ze?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),ze=ze||o,i}catch(i){throw delete this[t],ze=ze||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}s(A,"defineLazyInternal");function vh(e,t,r,n){let o=wh(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}s(vh,"installLazyProp");var Hr="~constantCatch";function fi(e){let t=s(()=>e,"fn");return t[Hr]=!0,t}s(fi,"constantCatch");var ql,di=Object.freeze({status:"aborted"}),pi={value:void 0,enumerable:!1},Gl="captureStackTrace"in Error?Error:null;function xh(e){let t=Gl;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return Gl=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}s(xh,"newError");function d(e,t,r,n){let o={};function i(m){this.def=m,this.constr=p,this.traits=new Set}s(i,"Internals"),i.prototype=o;let c=r,u=c&&new WeakSet;function a(m,h){if(m._zod){if(m._zod.traits.has(e))return}else{pi.value=new i(h);try{Object.defineProperty(m,"_zod",pi)}finally{pi.value=void 0}}if(m._zod.traits.add(e),t(m,h),u){let _=Object.getPrototypeOf(m),w=m._zod.constr.prototype,z=_;for(;z&&z!==w;)z=Object.getPrototypeOf(z);let x=z??_;u.has(x)||(u.add(x),li(x,c))}let g=p.prototype;for(let _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(_ in m||(m[_]=g[_].bind(m)))}s(a,"init");let l=n?.Parent??Object;class f extends l{static{s(this,"Definition")}}Object.defineProperty(f,"name",{value:e});function p(m){let h=n?.Parent?xh(f):this;a(h,m);let g=h._zod.deferred;if(g){for(let w of g)w();h._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(h),h}return s(p,"_"),Object.defineProperty(p,"init",{value:a}),Object.defineProperty(p,Symbol.hasInstance,{value:s(m=>n?.Parent&&m instanceof n.Parent?!0:m?._zod?.traits?.has(e),"value")}),Object.defineProperty(p,"name",{value:e}),p}s(d,"$constructor");var mi=Symbol("zod_brand"),re=class extends Error{static{s(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Pe=class extends Error{static{s(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(ql=globalThis).__zod_globalConfig??(ql.__zod_globalConfig={});var B=globalThis.__zod_globalConfig;function F(e){return e&&Object.assign(B,e),B}s(F,"config");function kh(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,it,2)),e.message}s(kh,"_getMessage");function zh(e){this._zod.message=e}s(zh,"_setMessage");var Sh={get:kh,set:zh,enumerable:!0,configurable:!0},gi={value:void 0,enumerable:!1},Hl=new WeakSet([Object.prototype,Error.prototype]),Xl=s((e,t)=>{e.name="$ZodError",gi.value=t,Object.defineProperty(e,"issues",gi),gi.value=void 0,Object.defineProperty(e,"message",Sh);let r=Object.getPrototypeOf(e);Hl.has(r)||(Hl.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=s(()=>this.message,"value");return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},"initializer"),yi=d("$ZodError",Xl),ne=d("$ZodError",Xl,void 0,{Parent:Error});function Ph(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}s(Ph,"node");function Qt(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?Ph(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return{formErrors:n,fieldErrors:r}}s(Qt,"flattenError");function er(e,t=r=>r.message){let r={_errors:[]},n=s((o,i=[])=>{for(let c of o.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>n({issues:u},[...i,...c.path]));else if(c.code==="invalid_key")n({issues:c.issues},[...i,...c.path]);else if(c.code==="invalid_element")n({issues:c.issues},[...i,...c.path]);else{let u=[...i,...c.path];if(u.length===0)r._errors.push(t(c));else{let a=r,l=0;for(;l<u.length;){let f=u[l],p=l===u.length-1;if(f==="_errors"){p&&a._errors.push(t(c)),l++;continue}Object.prototype.hasOwnProperty.call(a,f)||Object.defineProperty(a,f,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=a[f];p&&m._errors.push(t(c)),a=m,l++}}}},"processError");return n(e),r}s(er,"formatError");function _i(e,t=r=>r.message){let r={errors:[]},n=s((o,i=[])=>{var c;for(let u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(a=>n({issues:a},[...i,...u.path]));else if(u.code==="invalid_key")n({issues:u.issues},[...i,...u.path]);else if(u.code==="invalid_element")n({issues:u.issues},[...i,...u.path]);else{let a=[...i,...u.path];if(a.length===0){r.errors.push(t(u));continue}let l=r,f=0;for(;f<a.length;){let p=a[f],m=f===a.length-1;typeof p=="string"?(l.properties??(l.properties={}),Object.prototype.hasOwnProperty.call(l.properties,p)||Object.defineProperty(l.properties,p,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),l=l.properties[p]):(l.items??(l.items=[]),(c=l.items)[p]??(c[p]={errors:[]}),l=l.items[p]),m&&l.errors.push(t(u)),f++}}},"processError");return n(e),r}s(_i,"treeifyError");function Yl(e){let t=[],r=e.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?t.push(`[${n}]`):typeof n=="symbol"?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push("."),t.push(n));return t.join("")}s(Yl,"toDotPath");function $i(e){let t=[],r=[...e.issues].sort((n,o)=>(n.path??[]).length-(o.path??[]).length);for(let n of r)t.push(`\u2716 ${n.message}`),n.path?.length&&t.push(` \u2192 at ${Yl(n.path)}`);return t.join(`
|
|
8
|
-
`)}s($i,"prettifyError");function Xr(e,t){return{callee:t?.callee??e,Err:t?.Err}}s(Xr,"finalizeParams");var at=s(e=>{let t=s((r,n,o,i)=>{let c=o?{...o,async:!1}:{async:!1},u=r._zod.run({value:n,issues:[]},c);if(u instanceof Promise)throw new re;if(u.issues.length){let a=new(i?.Err??e)(u.issues.map(l=>te(l,c,F())));throw Kr(a,i?.callee??t),a}return u.value},"fn");return t},"_parse"),Yr=at(ne),lt=s(e=>{let t=s(async(r,n,o,i)=>{let c=o?{...o,async:!0}:{async:!0},u=r._zod.run({value:n,issues:[]},c);if(u instanceof Promise&&(u=await u),u.issues.length){let a=new(i?.Err??e)(u.issues.map(l=>te(l,c,F())));throw Kr(a,i?.callee??t),a}return u.value},"fn");return t},"_parseAsync"),Qr=lt(ne),ft=s(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new re;return i.issues.length?Ql(e,i.issues,o):{success:!0,data:i.value}},"_safeParse"),Oh=ft(ne);function Ql(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>te(o,r,F()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}s(Ql,"failure");var pt=s(e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?Ql(e,i.issues,o):{success:!0,data:i.value}},"_safeParseAsync"),Ah=pt(ne),Zh=Symbol.for("zod.compile.invalid"),Nh=Symbol.for("zod.compile.fallback"),tr=s(((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Zh)return!0;if(n.definite===!0&&r===void 0)return!1}return Eh(e,t,r)}),"validate");function Eh(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o?(n[Nh]=!0,i=o({value:t,issues:[]},n)):i=e._zod.run({value:t,issues:[]},n),i instanceof Promise)throw new re;return i.issues.length===0}s(Eh,"validateFallback");var rr=s(async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},"validateAsync"),en=s(e=>{let t=at(e),r=s((n,o,i,c)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,u,Xr(r,c))},"fn");return r},"_encode"),Ch=en(ne),tn=s(e=>{let t=at(e),r=s((n,o,i,c)=>t(n,o,i,Xr(r,c)),"fn");return r},"_decode"),Th=tn(ne),rn=s(e=>{let t=lt(e),r=s(async(n,o,i,c)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,u,Xr(r,c))},"fn");return r},"_encodeAsync"),Dh=rn(ne),nn=s(e=>{let t=lt(e),r=s(async(n,o,i,c)=>await t(n,o,i,Xr(r,c)),"fn");return r},"_decodeAsync"),Rh=nn(ne),on=s(e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return ft(e)(t,r,o)},"_safeEncode"),jh=on(ne),sn=s(e=>(t,r,n)=>ft(e)(t,r,n),"_safeDecode"),Lh=sn(ne),cn=s(e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return pt(e)(t,r,o)},"_safeEncodeAsync"),Vh=cn(ne),un=s(e=>async(t,r,n)=>pt(e)(t,r,n),"_safeDecodeAsync"),Fh=un(ne);var le={};_e(le,{anyString:()=>Ki,base64:()=>Ri,base64url:()=>ji,bigint:()=>qi,boolean:()=>Gi,browserEmail:()=>Gh,cidrv4:()=>Ti,cidrv6:()=>Di,creditCard:()=>an,cuid:()=>bi,cuid2:()=>vi,currencyCode:()=>Mi,date:()=>Ui,datetime:()=>Ji,domain:()=>Vi,duration:()=>Ii,e164:()=>Fi,email:()=>Ai,emoji:()=>Zi,extendedDuration:()=>Mh,guid:()=>Oi,hex:()=>es,hostname:()=>Li,html5Email:()=>Kh,httpProtocol:()=>nr,iban:()=>ln,idnEmail:()=>qh,integer:()=>or,ipv4:()=>Ni,ipv6:()=>Ei,ksuid:()=>zi,lowercase:()=>Yi,mac:()=>Ci,md5_base64:()=>Qh,md5_base64url:()=>eg,md5_hex:()=>Yh,nanoid:()=>Si,nanoidOfLength:()=>Pi,null:()=>Hi,number:()=>be,rfc5322Email:()=>Wh,sha1_base64:()=>rg,sha1_base64url:()=>ng,sha1_hex:()=>tg,sha256_base64:()=>ig,sha256_base64url:()=>sg,sha256_hex:()=>og,sha384_base64:()=>ug,sha384_base64url:()=>ag,sha384_hex:()=>cg,sha512_base64:()=>fg,sha512_base64url:()=>pg,sha512_hex:()=>lg,string:()=>Wi,time:()=>Bi,ulid:()=>xi,undefined:()=>Xi,unicodeEmail:()=>ef,uppercase:()=>Qi,uuid:()=>Ve,uuid4:()=>Uh,uuid6:()=>Bh,uuid7:()=>Jh,xid:()=>ki});var bi=/^[cC][0-9a-z]{6,}$/,vi=/^[0-9a-z]+$/,xi=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ki=/^[0-9a-vA-V]{20}$/,zi=/^[A-Za-z0-9]{27}$/,Si=/^[a-zA-Z0-9_-]{21}$/;function Pi(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}s(Pi,"nanoidOfLength");var Ii=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Mh=/^[-+]?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)?)??$/,Oi=/^([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})$/,Ve=s(e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[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)$/,"uuid"),Uh=Ve(4),Bh=Ve(6),Jh=Ve(7),Ai=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Kh=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Wh=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ef=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,qh=ef,Gh=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Hh="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Zi(){return new RegExp(Hh,"u")}s(Zi,"emoji");var Ni=/^(?:(?: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])$/,Ei=/^(([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}|:))$/,Ci=s(e=>{let t=ae(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},"mac"),Ti=/^((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])$/,Di=/^(([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])$/,Ri=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ji=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Li=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Vi=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,nr=/^https?$/,Fi=/^\+[1-9]\d{6,14}$/,an=/^\d(?:[ -]?\d){11,18}$/,Mi=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,ln=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,tf="(?:(?:\\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])))";function Xh(e){return new RegExp(`^${e}$`)}s(Xh,"anchor");var Ui=Xh(tf);function wi(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}s(wi,"timeSource");function Bi(e){return new RegExp(`^${wi(e)}$`)}s(Bi,"time");function Ji(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${wi({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${wi({precision:e.precision})}`:r;return new RegExp(`^${tf}T(?:${n})$`)}s(Ji,"datetime");var Ki=/^[\s\S]{0,}$/,Wi=s(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),qi=/^-?\d+n?$/,or=/^-?\d+$/,be=/^-?\d+(?:\.\d+)?$/,Gi=/^(?:true|false)$/i,Hi=/^null$/i;var Xi=/^undefined$/i;var Yi=/^[^A-Z]*$/,Qi=/^[^a-z]*$/,es=/^[0-9a-fA-F]*$/;function ir(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}s(ir,"fixedBase64");function sr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}s(sr,"fixedBase64url");var Yh=/^[0-9a-fA-F]{32}$/,Qh=ir(22,"=="),eg=sr(22),tg=/^[0-9a-fA-F]{40}$/,rg=ir(27,"="),ng=sr(27),og=/^[0-9a-fA-F]{64}$/,ig=ir(43,"="),sg=sr(43),cg=/^[0-9a-fA-F]{96}$/,ug=ir(64,""),ag=sr(64),lg=/^[0-9a-fA-F]{128}$/,fg=ir(86,"=="),pg=sr(86);var j=d("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),ts=s(e=>{let t=e.value;return!Jr(t)&&t.size!==void 0},"_whenHasSize"),rs=s(e=>{let t=e.value;return!Jr(t)&&t.length!==void 0},"_whenHasLength"),fn={number:"number",bigint:"bigint",object:"date"},dn=d("$ZodCheckLessThan",(e,t)=>{j.init(e,t);let r=fn[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:fn[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),mn=d("$ZodCheckGreaterThan",(e,t)=>{j.init(e,t);let r=fn[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:fn[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ns=d("$ZodCheckMultipleOf",(e,t)=>{j.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):Jt(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),os=d("$ZodCheckNumberFormat",(e,t)=>{j.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=qt[t.format];e._zod.check=c=>{let u=c.value;if(r){if(!Number.isInteger(u)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?c.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}u<o&&c.issues.push({origin:"number",input:u,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),u>i&&c.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),is=d("$ZodCheckBigIntFormat",(e,t)=>{j.init(e,t);let[r,n]=Gt[t.format];e._zod.check=o=>{let i=o.value;i<r&&o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>n&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),ss=d("$ZodCheckMaxSize",(e,t)=>{var r;j.init(e,t),(r=e._zod.def).when??(r.when=ts),e._zod.check=n=>{let o=n.value;o.size<=t.maximum||n.issues.push({origin:Ht(o),code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),cs=d("$ZodCheckMinSize",(e,t)=>{var r;j.init(e,t),(r=e._zod.def).when??(r.when=ts),e._zod.check=n=>{let o=n.value;o.size>=t.minimum||n.issues.push({origin:Ht(o),code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),us=d("$ZodCheckSizeEquals",(e,t)=>{var r;j.init(e,t),(r=e._zod.def).when??(r.when=ts),e._zod.check=n=>{let o=n.value,i=o.size;if(i===t.size)return;let c=i>t.size;n.issues.push({origin:Ht(o),...c?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),as=d("$ZodCheckMaxLength",(e,t)=>{var r;j.init(e,t),(r=e._zod.def).when??(r.when=rs),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?Le(o):i)<=t.maximum)return;let u=Xt(o);n.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ls=d("$ZodCheckMinLength",(e,t)=>{var r;j.init(e,t),(r=e._zod.def).when??(r.when=rs),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?Le(o):i)>=t.minimum)return;let u=Xt(o);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),fs=d("$ZodCheckLengthEquals",(e,t)=>{var r;j.init(e,t),(r=e._zod.def).when??(r.when=rs),e._zod.check=n=>{let o=n.value,i=o.length,c=typeof o=="string"&&i>=t.length&&i<=t.length*2?Le(o):i;if(c===t.length)return;let u=Xt(o),a=c>t.length;n.issues.push({origin:u,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),dt=d("$ZodCheckStringFormat",(e,t)=>{var r,n;j.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),ps=d("$ZodCheckRegex",(e,t)=>{dt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ds=d("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Yi),dt.init(e,t)}),ms=d("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Qi),dt.init(e,t)}),hs=d("$ZodCheckIncludes",(e,t)=>{j.init(e,t);let r=ae(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),gs=d("$ZodCheckStartsWith",(e,t)=>{j.init(e,t);let r=new RegExp(`^${ae(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ys=d("$ZodCheckEndsWith",(e,t)=>{j.init(e,t);let r=new RegExp(`.*${ae(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function pn(e,t,r){e.issues.length&&t.issues.push(...ee(r,e.issues))}s(pn,"handleCheckPropertyResult");var _s=d("$ZodCheckProperty",(e,t)=>{j.init(e,t),e._zod.check=r=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>pn(o,r,t.property));pn(n,r,t.property)}}),$s=d("$ZodCheckProperties",(e,t)=>{j.init(e,t),Yt(e,Symbol.iterator,function*(){yield e});let r;e._zod.check=n=>{if(n.value==null){n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});return}r??(r=Reflect.ownKeys(t.shape).map(c=>[c,t.shape[c]]));let o=n.value,i;for(let[c,u]of r){let a=u._zod.run({value:o[c],issues:[]},{});a instanceof Promise?(i??(i=[]),i.push(a.then(l=>pn(l,n,c)))):pn(a,n,c)}if(i)return Promise.all(i).then(()=>{})}}),ws=d("$ZodCheckMimeType",(e,t)=>{j.init(e,t);let r=new Set(t.mime);e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}}),bs=d("$ZodCheckOverwrite",(e,t)=>{j.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Fe=class{static{s(this,"Doc")}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(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
|
|
7
|
+
var Lm=Object.create;var Ur=Object.defineProperty;var Vm=Object.getOwnPropertyDescriptor;var Fm=Object.getOwnPropertyNames;var Mm=Object.getPrototypeOf,Um=Object.prototype.hasOwnProperty;var s=(e,t)=>Ur(e,"name",{value:t,configurable:!0}),ze=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var ie=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},_e=(e,t)=>{for(var r in t)Ur(e,r,{get:t[r],enumerable:!0})},Bm=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Fm(t))!Um.call(e,o)&&o!==r&&Ur(e,o,{get:()=>t[o],enumerable:!(n=Vm(t,o))||n.enumerable});return e};var Jm=(e,t,r)=>(r=e!=null?Lm(Mm(e)):{},Bm(t||!e||!e.__esModule?Ur(r,"default",{value:e,enumerable:!0}):r,e));var Td=ie((Pb,Cd)=>{Cd.exports=Ed;Ed.sync=I_;var Zd=ze("fs");function P_(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}s(P_,"checkPathExt");function Nd(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:P_(t,r)}s(Nd,"checkStat");function Ed(e,t,r){Zd.stat(e,function(n,o){r(n,n?!1:Nd(o,e,t))})}s(Ed,"isexe");function I_(e,t){return Nd(Zd.statSync(e),e,t)}s(I_,"sync")});var Vd=ie((Ob,Ld)=>{Ld.exports=Rd;Rd.sync=O_;var Dd=ze("fs");function Rd(e,t,r){Dd.stat(e,function(n,o){r(n,n?!1:jd(o,t))})}s(Rd,"isexe");function O_(e,t){return jd(Dd.statSync(e),t)}s(O_,"sync");function jd(e,t){return e.isFile()&&A_(e,t)}s(jd,"checkStat");function A_(e,t){var r=e.mode,n=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),c=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),u=parseInt("100",8),a=parseInt("010",8),l=parseInt("001",8),f=u|a,p=r&l||r&a&&o===c||r&u&&n===i||r&f&&i===0;return p}s(A_,"checkMode")});var Md=ie((Nb,Fd)=>{var Zb=ze("fs"),Xo;process.platform==="win32"||global.TESTING_WINDOWS?Xo=Td():Xo=Vd();Fd.exports=Sl;Sl.sync=Z_;function Sl(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){Sl(e,t||{},function(i,c){i?o(i):n(c)})})}Xo(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}s(Sl,"isexe");function Z_(e,t){try{return Xo.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}s(Z_,"sync")});var Gd=ie((Cb,qd)=>{var Ft=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Ud=ze("path"),N_=Ft?";":":",Bd=Md(),Jd=s(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),Kd=s((e,t)=>{let r=t.colon||N_,n=e.match(/\//)||Ft&&e.match(/\\/)?[""]:[...Ft?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=Ft?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=Ft?o.split(r):[""];return Ft&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},"getPathInfo"),Wd=s((e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:i}=Kd(e,t),c=[],u=s(l=>new Promise((f,p)=>{if(l===n.length)return t.all&&c.length?f(c):p(Jd(e));let m=n[l],h=/^".*"$/.test(m)?m.slice(1,-1):m,g=Ud.join(h,e),_=!h&&/^\.[\\\/]/.test(e)?e.slice(0,2)+g:g;f(a(_,l,0))}),"step"),a=s((l,f,p)=>new Promise((m,h)=>{if(p===o.length)return m(u(f+1));let g=o[p];Bd(l+g,{pathExt:i},(_,w)=>{if(!_&&w)if(t.all)c.push(l+g);else return m(l+g);return m(a(l,f,p+1))})}),"subStep");return r?u(0).then(l=>r(null,l),r):u(0)},"which"),E_=s((e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=Kd(e,t),i=[];for(let c=0;c<r.length;c++){let u=r[c],a=/^".*"$/.test(u)?u.slice(1,-1):u,l=Ud.join(a,e),f=!a&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let p=0;p<n.length;p++){let m=f+n[p];try{if(Bd.sync(m,{pathExt:o}))if(t.all)i.push(m);else return m}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw Jd(e)},"whichSync");qd.exports=Wd;Wd.sync=E_});var Xd=ie((Db,Pl)=>{"use strict";var Hd=s((e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");Pl.exports=Hd;Pl.exports.default=Hd});var tm=ie((jb,em)=>{"use strict";var Yd=ze("path"),C_=Gd(),T_=Xd();function Qd(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let c;try{c=C_.sync(e.command,{path:r[T_({env:r})],pathExt:t?Yd.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return c&&(c=Yd.resolve(o?e.options.cwd:"",c)),c}s(Qd,"resolveCommandAttempt");function D_(e){return Qd(e)||Qd(e,!0)}s(D_,"resolveCommand");em.exports=D_});var rm=ie((Vb,Ol)=>{"use strict";var Il=/([()\][%!^"`<>&|;, *?])/g;function R_(e){return e=e.replace(Il,"^$1"),e}s(R_,"escapeCommand");function j_(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Il,"^$1"),t&&(e=e.replace(Il,"^$1")),e}s(j_,"escapeArgument");Ol.exports.command=R_;Ol.exports.argument=j_});var om=ie((Mb,nm)=>{"use strict";nm.exports=/^#!(.*)/});var sm=ie((Ub,im)=>{"use strict";var L_=om();im.exports=(e="")=>{let t=e.match(L_);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var um=ie((Bb,cm)=>{"use strict";var Al=ze("fs"),V_=sm();function F_(e){let r=Buffer.alloc(150),n;try{n=Al.openSync(e,"r"),Al.readSync(n,r,0,150,0),Al.closeSync(n)}catch{}return V_(r.toString())}s(F_,"readShebang");cm.exports=F_});var pm=ie((Kb,fm)=>{"use strict";var M_=ze("path"),am=tm(),lm=rm(),U_=um(),B_=process.platform==="win32",J_=/\.(?:com|exe)$/i,K_=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function W_(e){e.file=am(e);let t=e.file&&U_(e.file);return t?(e.args.unshift(e.file),e.command=t,am(e)):e.file}s(W_,"detectShebang");function q_(e){if(!B_)return e;let t=W_(e),r=!J_.test(t);if(e.options.forceShell||r){let n=K_.test(t);e.command=M_.normalize(e.command),e.command=lm.command(e.command),e.args=e.args.map(i=>lm.argument(i,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}s(q_,"parseNonShell");function G_(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:q_(n)}s(G_,"parse");fm.exports=G_});var hm=ie((qb,mm)=>{"use strict";var Zl=process.platform==="win32";function Nl(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}s(Nl,"notFoundError");function H_(e,t){if(!Zl)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let i=dm(o,t);if(i)return r.call(e,"error",i)}return r.apply(e,arguments)}}s(H_,"hookChildProcess");function dm(e,t){return Zl&&e===1&&!t.file?Nl(t.original,"spawn"):null}s(dm,"verifyENOENT");function X_(e,t){return Zl&&e===1&&!t.file?Nl(t.original,"spawnSync"):null}s(X_,"verifyENOENTSync");mm.exports={hookChildProcess:H_,verifyENOENT:dm,verifyENOENTSync:X_,notFoundError:Nl}});var _m=ie((Hb,Mt)=>{"use strict";var gm=ze("child_process"),El=pm(),Cl=hm();function ym(e,t,r){let n=El(e,t,r),o=gm.spawn(n.command,n.args,n.options);return Cl.hookChildProcess(o,n),o}s(ym,"spawn");function Y_(e,t,r){let n=El(e,t,r),o=gm.spawnSync(n.command,n.args,n.options);return o.error=o.error||Cl.verifyENOENTSync(o.status,n),o}s(Y_,"spawnSync");Mt.exports=ym;Mt.exports.spawn=ym;Mt.exports.sync=Y_;Mt.exports._parse=El;Mt.exports._enoent=Cl});import{execFile as O$}from"node:child_process";import{promisify as A$}from"node:util";var y={};_e(y,{$brand:()=>hi,$input:()=>Vc,$output:()=>Lc,INVALID:()=>X,NEVER:()=>mi,TimePrecision:()=>Xc,ZodAny:()=>ja,ZodArray:()=>Ma,ZodBase64:()=>Fo,ZodBase64URL:()=>Mo,ZodBigInt:()=>jt,ZodBigIntFormat:()=>Jo,ZodBoolean:()=>Rt,ZodCIDRv4:()=>Lo,ZodCIDRv6:()=>Vo,ZodCUID:()=>No,ZodCUID2:()=>Eo,ZodCatch:()=>al,ZodCodec:()=>Rr,ZodCompileAsyncError:()=>pe,ZodCompileUnsupportedError:()=>Z,ZodCreditCard:()=>Aa,ZodCustom:()=>jr,ZodCustomStringFormat:()=>tt,ZodDate:()=>Zr,ZodDefault:()=>nl,ZodDiscriminatedUnion:()=>Ba,ZodE164:()=>Uo,ZodEmail:()=>Io,ZodEmoji:()=>Ao,ZodEnum:()=>Ct,ZodError:()=>t_,ZodExactOptional:()=>Go,ZodFile:()=>Qa,ZodFirstPartyTypeKind:()=>xl,ZodFunction:()=>$l,ZodGUID:()=>Oo,ZodIBAN:()=>Za,ZodIPv4:()=>Ro,ZodIPv6:()=>jo,ZodISODate:()=>Te,ZodISODateTime:()=>Ce,ZodISODuration:()=>Re,ZodISOTime:()=>De,ZodInstanceOf:()=>vl,ZodIntersection:()=>Ja,ZodIssueCode:()=>o_,ZodJWT:()=>Bo,ZodKSUID:()=>Do,ZodLazy:()=>gl,ZodLiteral:()=>Ya,ZodMAC:()=>Oa,ZodMap:()=>Ha,ZodNaN:()=>fl,ZodNanoID:()=>Zo,ZodNever:()=>Va,ZodNonOptional:()=>Ho,ZodNull:()=>Da,ZodNullable:()=>rl,ZodNumber:()=>Dt,ZodNumberFormat:()=>rt,ZodObject:()=>Er,ZodOptional:()=>Tr,ZodPipe:()=>Dr,ZodPrefault:()=>il,ZodPreprocess:()=>pl,ZodPromise:()=>_l,ZodReadonly:()=>dl,ZodRealError:()=>oe,ZodRecord:()=>Et,ZodSet:()=>Xa,ZodString:()=>Tt,ZodStringFormat:()=>R,ZodSuccess:()=>ul,ZodSymbol:()=>Ca,ZodTemplateLiteral:()=>hl,ZodTransform:()=>el,ZodTuple:()=>Wa,ZodType:()=>O,ZodULID:()=>Co,ZodURL:()=>Ar,ZodUUID:()=>ye,ZodUndefined:()=>Ta,ZodUnion:()=>Cr,ZodUnknown:()=>La,ZodVoid:()=>Fa,ZodXID:()=>To,ZodXor:()=>Ua,_ZodString:()=>Po,_default:()=>ol,_function:()=>pd,any:()=>Up,array:()=>Nr,base64:()=>xp,base64url:()=>kp,bigint:()=>jp,boolean:()=>Ea,catch:()=>ll,check:()=>dd,cidrv4:()=>bp,cidrv6:()=>vp,clone:()=>C,codec:()=>ud,coerce:()=>zl,compile:()=>Bc,config:()=>F,core:()=>xe,creditCard:()=>Sp,cuid:()=>dp,cuid2:()=>mp,currencyCode:()=>Np,custom:()=>md,date:()=>Jp,decode:()=>va,decodeAsync:()=>ka,deepPartial:()=>Pd,describe:()=>hd,discriminatedUnion:()=>Xp,e164:()=>zp,email:()=>np,emoji:()=>fp,encode:()=>ba,encodeAsync:()=>xa,endsWith:()=>vt,enum:()=>Wo,exactOptional:()=>tl,file:()=>od,flattenError:()=>Qt,float32:()=>Cp,float64:()=>Tp,formatError:()=>er,fromJSONSchema:()=>zd,function:()=>pd,getDiscriminatedOption:()=>dc,getErrorMap:()=>s_,globalRegistry:()=>K,gt:()=>he,gte:()=>ce,guid:()=>op,hash:()=>Ep,hex:()=>Zp,hostname:()=>Ap,httpUrl:()=>lp,iban:()=>Pp,includes:()=>wt,input:()=>Od,instanceof:()=>yd,int:()=>zo,int32:()=>Dp,int64:()=>Lp,intersection:()=>Ka,invertCodec:()=>ad,ipv4:()=>_p,ipv6:()=>wp,iso:()=>Lr,json:()=>$d,jwt:()=>Ip,keyof:()=>Kp,ksuid:()=>yp,lazy:()=>yl,length:()=>He,literal:()=>nd,locales:()=>wr,looseObject:()=>Gp,looseRecord:()=>Qp,lowercase:()=>_t,lt:()=>me,lte:()=>se,mac:()=>$p,map:()=>ed,maxLength:()=>Ge,maxSize:()=>Ae,memoizer:()=>_r,meta:()=>gd,mime:()=>kt,minLength:()=>ve,minSize:()=>ge,multipleOf:()=>Oe,nan:()=>cd,nanoid:()=>pp,nativeEnum:()=>rd,negative:()=>mo,never:()=>Ko,nonnegative:()=>go,nonoptional:()=>cl,nonpositive:()=>ho,normalize:()=>zt,null:()=>Ra,nullable:()=>Or,nullish:()=>id,number:()=>Na,object:()=>Wp,optional:()=>Qe,output:()=>Ad,overwrite:()=>de,parse:()=>ya,parseAsync:()=>_a,partialRecord:()=>Yp,pipe:()=>So,positive:()=>po,prefault:()=>sl,preprocess:()=>wd,prettifyError:()=>wi,promise:()=>fd,properties:()=>xt,property:()=>yo,readonly:()=>ml,record:()=>Ga,refine:()=>wl,regex:()=>yt,regexes:()=>le,registry:()=>Fn,safeDecode:()=>Sa,safeDecodeAsync:()=>Ia,safeEncode:()=>za,safeEncodeAsync:()=>Pa,safeParse:()=>$a,safeParseAsync:()=>wa,set:()=>td,setErrorMap:()=>i_,size:()=>qe,slugify:()=>Ot,startsWith:()=>bt,strictObject:()=>qp,string:()=>Ir,stringFormat:()=>Op,stringbool:()=>_d,success:()=>sd,superRefine:()=>bl,symbol:()=>Fp,templateLiteral:()=>ld,toJSONSchema:()=>bo,toLowerCase:()=>Pt,toUpperCase:()=>It,toZod:()=>Bt,transform:()=>qo,treeifyError:()=>$i,trim:()=>St,tuple:()=>qa,uint32:()=>Rp,uint64:()=>Vp,ulid:()=>hp,undefined:()=>Mp,union:()=>Lt,unknown:()=>Ye,uppercase:()=>$t,url:()=>ap,util:()=>v,uuid:()=>ip,uuidv4:()=>sp,uuidv6:()=>cp,uuidv7:()=>up,validate:()=>tr,validateAsync:()=>rr,void:()=>Bp,withParser:()=>Mn,xid:()=>gp,xor:()=>Hp});var xe={};_e(xe,{$ZodAny:()=>ic,$ZodArray:()=>lc,$ZodAsyncError:()=>re,$ZodBase64:()=>Ws,$ZodBase64URL:()=>qs,$ZodBigInt:()=>An,$ZodBigIntFormat:()=>tc,$ZodBoolean:()=>pr,$ZodCIDRv4:()=>Js,$ZodCIDRv6:()=>Ks,$ZodCUID:()=>Es,$ZodCUID2:()=>Cs,$ZodCatch:()=>Oc,$ZodCheck:()=>j,$ZodCheckBigIntFormat:()=>ss,$ZodCheckEndsWith:()=>_s,$ZodCheckGreaterThan:()=>mn,$ZodCheckIncludes:()=>gs,$ZodCheckLengthEquals:()=>ps,$ZodCheckLessThan:()=>dn,$ZodCheckLowerCase:()=>ms,$ZodCheckMaxLength:()=>ls,$ZodCheckMaxSize:()=>cs,$ZodCheckMimeType:()=>bs,$ZodCheckMinLength:()=>fs,$ZodCheckMinSize:()=>us,$ZodCheckMultipleOf:()=>os,$ZodCheckNumberFormat:()=>is,$ZodCheckOverwrite:()=>vs,$ZodCheckProperties:()=>ws,$ZodCheckProperty:()=>$s,$ZodCheckRegex:()=>ds,$ZodCheckSizeEquals:()=>as,$ZodCheckStartsWith:()=>ys,$ZodCheckStringFormat:()=>dt,$ZodCheckUpperCase:()=>hs,$ZodCodec:()=>mr,$ZodCreditCard:()=>Hs,$ZodCustom:()=>Dc,$ZodCustomStringFormat:()=>Qs,$ZodCyclicError:()=>Rn,$ZodDate:()=>ac,$ZodDefault:()=>zc,$ZodDiscriminatedUnion:()=>mc,$ZodE164:()=>Gs,$ZodEmail:()=>Ps,$ZodEmoji:()=>Zs,$ZodEncodeError:()=>Ie,$ZodEnum:()=>$c,$ZodError:()=>_i,$ZodExactOptional:()=>xc,$ZodFile:()=>bc,$ZodFunction:()=>Cc,$ZodGUID:()=>zs,$ZodIBAN:()=>Xs,$ZodIPv4:()=>Ms,$ZodIPv6:()=>Us,$ZodISODate:()=>Ls,$ZodISODateTime:()=>js,$ZodISODuration:()=>Fs,$ZodISOTime:()=>Vs,$ZodIntersection:()=>hc,$ZodJWT:()=>Ys,$ZodKSUID:()=>Rs,$ZodLazy:()=>hr,$ZodLiteral:()=>wc,$ZodMAC:()=>Bs,$ZodMap:()=>yc,$ZodNaN:()=>Ac,$ZodNanoID:()=>Ns,$ZodNever:()=>cc,$ZodNonOptional:()=>Pc,$ZodNull:()=>oc,$ZodNullable:()=>kc,$ZodNumber:()=>On,$ZodNumberFormat:()=>ec,$ZodObject:()=>xf,$ZodObjectJIT:()=>fc,$ZodOptional:()=>Nn,$ZodPipe:()=>En,$ZodPrefault:()=>Sc,$ZodPreprocess:()=>Zc,$ZodPromise:()=>Tc,$ZodReadonly:()=>Nc,$ZodRealError:()=>ne,$ZodRecord:()=>gc,$ZodRegistry:()=>Vn,$ZodSet:()=>_c,$ZodString:()=>Ue,$ZodStringFormat:()=>T,$ZodSuccess:()=>Ic,$ZodSymbol:()=>rc,$ZodTemplateLiteral:()=>Ec,$ZodTransform:()=>vc,$ZodTuple:()=>Zn,$ZodType:()=>P,$ZodULID:()=>Ts,$ZodURL:()=>As,$ZodUUID:()=>Ss,$ZodUndefined:()=>nc,$ZodUnion:()=>dr,$ZodUnknown:()=>sc,$ZodVoid:()=>uc,$ZodXID:()=>Ds,$ZodXor:()=>pc,$brand:()=>hi,$constructor:()=>d,$input:()=>Vc,$output:()=>Lc,Doc:()=>Me,INVALID:()=>X,JSONSchema:()=>ep,JSONSchemaGenerator:()=>vo,NEVER:()=>mi,TimePrecision:()=>Xc,URL_BAD_FORMAT:()=>Is,URL_UNPARSEABLE:()=>cr,ZodCompileAsyncError:()=>pe,ZodCompileUnsupportedError:()=>Z,_any:()=>mu,_array:()=>bu,_base64:()=>uo,_base64url:()=>ao,_bigint:()=>cu,_boolean:()=>iu,_catch:()=>Uy,_check:()=>jf,_cidrv4:()=>so,_cidrv6:()=>co,_coercedBigint:()=>uu,_coercedBoolean:()=>su,_coercedDate:()=>$u,_coercedNumber:()=>Qc,_coercedString:()=>Wc,_creditCard:()=>Gc,_cuid:()=>Qn,_cuid2:()=>eo,_custom:()=>xu,_date:()=>_u,_decode:()=>tn,_decodeAsync:()=>nn,_default:()=>Vy,_discriminatedUnion:()=>Iy,_e164:()=>lo,_email:()=>Jn,_emoji:()=>Xn,_encode:()=>en,_encodeAsync:()=>rn,_endsWith:()=>vt,_enum:()=>Cy,_file:()=>vu,_float32:()=>tu,_float64:()=>ru,_gt:()=>he,_gte:()=>ce,_guid:()=>Kn,_iban:()=>Hc,_includes:()=>wt,_int:()=>eu,_int32:()=>nu,_int64:()=>au,_intersection:()=>Oy,_ipv4:()=>oo,_ipv6:()=>io,_isoDate:()=>xr,_isoDateTime:()=>vr,_isoDuration:()=>zr,_isoTime:()=>kr,_jwt:()=>fo,_ksuid:()=>no,_lazy:()=>Wy,_length:()=>He,_literal:()=>Dy,_lowercase:()=>_t,_lt:()=>me,_lte:()=>se,_mac:()=>qc,_map:()=>Ny,_max:()=>se,_maxLength:()=>Ge,_maxSize:()=>Ae,_mime:()=>kt,_min:()=>ce,_minLength:()=>ve,_minSize:()=>ge,_multipleOf:()=>Oe,_nan:()=>wu,_nanoid:()=>Yn,_nativeEnum:()=>Ty,_negative:()=>mo,_never:()=>gu,_nonnegative:()=>go,_nonoptional:()=>Fy,_nonpositive:()=>ho,_normalize:()=>zt,_null:()=>du,_nullable:()=>Ly,_number:()=>Yc,_optional:()=>jy,_overwrite:()=>de,_parse:()=>at,_parseAsync:()=>lt,_pipe:()=>By,_positive:()=>po,_promise:()=>qy,_properties:()=>xt,_property:()=>yo,_readonly:()=>Jy,_record:()=>Zy,_refine:()=>ku,_regex:()=>yt,_safeDecode:()=>sn,_safeDecodeAsync:()=>un,_safeEncode:()=>on,_safeEncodeAsync:()=>cn,_safeParse:()=>ft,_safeParseAsync:()=>pt,_set:()=>Ey,_size:()=>qe,_slugify:()=>Ot,_startsWith:()=>bt,_string:()=>Kc,_stringFormat:()=>Xe,_stringbool:()=>Iu,_success:()=>My,_superRefine:()=>zu,_symbol:()=>fu,_templateLiteral:()=>Ky,_toLowerCase:()=>Pt,_toUpperCase:()=>It,_transform:()=>Ry,_trim:()=>St,_tuple:()=>Ay,_uint32:()=>ou,_uint64:()=>lu,_ulid:()=>to,_undefined:()=>pu,_union:()=>Sy,_unknown:()=>hu,_uppercase:()=>$t,_url:()=>br,_uuid:()=>Wn,_uuidv4:()=>qn,_uuidv6:()=>Gn,_uuidv7:()=>Hn,_void:()=>yu,_xid:()=>ro,_xor:()=>Py,base64Charset:()=>kn,base64urlCharset:()=>fr,canParseURL:()=>Os,clone:()=>C,compile:()=>Bc,compileFn:()=>Un,config:()=>F,createStandardJSONSchemaMethod:()=>At,createToJSONSchemaMethod:()=>Au,decode:()=>Dh,decodeAsync:()=>jh,describe:()=>Su,encode:()=>Th,encodeAsync:()=>Rh,extractDefs:()=>Ne,finalize:()=>Ee,flattenError:()=>Qt,formatError:()=>er,getDiscriminatedOption:()=>dc,globalConfig:()=>B,globalRegistry:()=>K,handleUnrepresentable:()=>M,initializeContext:()=>Ze,isBackEdge:()=>Ln,isRecursiveSchema:()=>jn,isValidBase64:()=>lr,isValidBase64URL:()=>zn,isValidCIDRv6:()=>xn,isValidCreditCard:()=>Sn,isValidIBAN:()=>Pn,isValidIPv6:()=>ar,isValidJWT:()=>In,locales:()=>wr,memoizer:()=>_r,mergeValues:()=>mt,meta:()=>Pu,parse:()=>Yr,parseAsync:()=>Qr,parseURLObject:()=>wf,prettifyError:()=>wi,process:()=>D,processSchema:()=>D,regexes:()=>le,registry:()=>Fn,safeDecode:()=>Vh,safeDecodeAsync:()=>Mh,safeEncode:()=>Lh,safeEncodeAsync:()=>Fh,safeParse:()=>Ah,safeParseAsync:()=>Zh,standardProps:()=>$n,stripTabAndNewline:()=>ur,toDotPath:()=>Yl,toJSONSchema:()=>bo,toZod:()=>Bt,treeifyError:()=>$i,urlHostnameOk:()=>bn,urlProtocolOk:()=>vn,util:()=>v,validate:()=>tr,validateAsync:()=>rr,validateURL:()=>wn,version:()=>xs,withParser:()=>Mn});var v={};_e(v,{BIGINT_FORMAT_RANGES:()=>Gt,CONSTANT_CATCH:()=>Hr,Class:()=>ni,NUMBER_FORMAT_RANGES:()=>qt,aborted:()=>H,allowsEval:()=>si,assert:()=>Hm,assertEqual:()=>Km,assertIs:()=>qm,assertNever:()=>Gm,assertNotEqual:()=>Wm,assignProp:()=>J,attachSchema:()=>Gr,base64ToUint8Array:()=>Kl,base64urlToUint8Array:()=>hh,cached:()=>st,captureStackTrace:()=>Kr,cleanEnum:()=>mh,cleanRegex:()=>we,clone:()=>C,cloneDef:()=>Qm,codePointLength:()=>Ve,constantCatch:()=>pi,createTransparentProxy:()=>ih,defineLazy:()=>oi,defineLazyInternal:()=>A,derived:()=>$h,esc:()=>G,escapeRegex:()=>ae,explicitlyAborted:()=>ai,extend:()=>uh,finalizeIssue:()=>te,floatSafeRemainder:()=>Jt,getElementAtPath:()=>eh,getEnumValues:()=>ot,getLengthableOrigin:()=>Xt,getParsedType:()=>oh,getSizableOrigin:()=>Ht,hexToUint8Array:()=>yh,hide:()=>Yt,installLazyProp:()=>xh,isObject:()=>Le,isPlainObject:()=>ue,issue:()=>ut,joinValues:()=>Br,jsonStringifyReplacer:()=>it,members:()=>fi,merge:()=>lh,mergeDefs:()=>fe,normalizeParams:()=>$,nullish:()=>Jr,numKeys:()=>nh,objectClone:()=>Xm,omit:()=>ch,optionalKeys:()=>ui,own:()=>Pe,parsedType:()=>li,partial:()=>fh,pick:()=>sh,prefixIssues:()=>ee,primitiveTypes:()=>ci,promiseAllObject:()=>th,propertyKeyTypes:()=>Wt,randomString:()=>rh,rawShape:()=>ct,required:()=>ph,safeExtend:()=>ah,shallowClone:()=>Kt,slugify:()=>ii,stringifyPrimitive:()=>Wr,toZod:()=>Bt,uint8ArrayToBase64:()=>Wl,uint8ArrayToBase64url:()=>gh,uint8ArrayToHex:()=>_h,unwrapMessage:()=>nt});function Km(e){return e}s(Km,"assertEqual");function Wm(e){return e}s(Wm,"assertNotEqual");function Bt(){return e=>e}s(Bt,"toZod");function qm(e){}s(qm,"assertIs");function Gm(e){throw new Error("Unexpected value in exhaustive check")}s(Gm,"assertNever");function Hm(e){}s(Hm,"assert");function ot(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}s(ot,"getEnumValues");function Br(e,t="|"){return e.map(r=>Wr(r)).join(t)}s(Br,"joinValues");function it(e,t){return typeof t=="bigint"?t.toString():t}s(it,"jsonStringifyReplacer");var ri=class{static{s(this,"Cached")}constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function st(e){return new ri(e)}s(st,"cached");function Jr(e){return e==null}s(Jr,"nullish");function we(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}s(we,"cleanRegex");function Jt(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}s(Jt,"floatSafeRemainder");var Ml=Symbol("evaluating");function oi(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Ml)return n===void 0&&(n=Ml,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}s(oi,"defineLazy");function Xm(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}s(Xm,"objectClone");function J(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}s(J,"assignProp");function ct(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}s(ct,"rawShape");function $e(e){return ct(e._zod.def)??e._zod.def.shape}s($e,"sourceShape");function Ul(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return J(this,t,n),n},enumerable:!0,configurable:!0})}s(Ul,"deferProp");function Bl(e,t,r){t in e?J(e,t,r):e[t]=r}s(Bl,"putProp");function je(e,t,r,n){let o=$e(t);for(let i of r){let c=Object.getOwnPropertyDescriptor(o,i);c.enumerable&&(c.get?Ul(e,i,()=>{let u=t._zod.def.shape[i];return n?n(u,i):u}):Bl(e,i,n?n(c.value,i):c.value))}}s(je,"mirrorShape");function Ym(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?Ul(e,r,()=>t[r]):Bl(e,r,n.value))}}s(Ym,"mirrorProps");function fe(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}s(fe,"mergeDefs");function Qm(e){return fe(e._zod.def)}s(Qm,"cloneDef");function eh(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}s(eh,"getElementAtPath");function th(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}s(th,"promiseAllObject");function rh(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}s(rh,"randomString");function G(e){return JSON.stringify(e)}s(G,"esc");function ii(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}s(ii,"slugify");var Kr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Le(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(Le,"isObject");var si=st(()=>{if(B.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ue(e){if(Le(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Le(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}s(ue,"isPlainObject");function Kt(e){return ue(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}s(Kt,"shallowClone");function nh(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}s(nh,"numKeys");var oh=s(e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},"getParsedType"),Wt=new Set(["string","number","symbol"]),ci=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ae(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(ae,"escapeRegex");function C(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}s(C,"clone");function $(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:s(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:s(()=>t.error,"error")}:t}s($,"normalizeParams");function ih(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}s(ih,"createTransparentProxy");function Wr(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}s(Wr,"stringifyPrimitive");function ui(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}s(ui,"optionalKeys");var qt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Gt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function sh(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return je(i,e,qr(e,t)),C(e,fe(r,{shape:i,checks:[]}))}s(sh,"pick");function qr(e,t){let r=$e(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o)}return n}s(qr,"maskedKeys");function ch(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(qr(e,t)),c={};return je(c,e,Reflect.ownKeys($e(e)).filter(u=>!i.has(u))),C(e,fe(r,{shape:c,checks:[]}))}s(ch,"omit");function uh(e,t){if(!ue(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=$e(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return C(e,fe(e._zod.def,{shape:Jl(e,t)}))}s(uh,"extend");function Jl(e,t){let r={};return je(r,e,Reflect.ownKeys($e(e))),Ym(r,t),r}s(Jl,"extended");function ah(e,t){if(!ue(t))throw new Error("Invalid input to safeExtend: expected a plain object");return C(e,fe(e._zod.def,{shape:Jl(e,t)}))}s(ah,"safeExtend");function lh(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};je(r,e,Reflect.ownKeys($e(e))),je(r,t,Reflect.ownKeys($e(t)));let n=fe(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return C(e,n)}s(lh,"merge");function fh(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let u=r?new Set(qr(t,r)):void 0,a={};return je(a,t,Reflect.ownKeys($e(t)),e&&((l,f)=>u&&!u.has(f)?l:new e({type:"optional",innerType:l}))),C(t,fe(t._zod.def,{shape:a,checks:[]}))}s(fh,"partial");function ph(e,t,r){let n=r?new Set(qr(t,r)):void 0,o={};return je(o,t,Reflect.ownKeys($e(t)),(i,c)=>n&&!n.has(c)?i:new e({type:"nonoptional",innerType:i})),C(t,fe(t._zod.def,{shape:o}))}s(ph,"required");function H(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}s(H,"aborted");function ai(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}s(ai,"explicitlyAborted");function ee(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}s(ee,"prefixIssues");function nt(e){return typeof e=="string"?e:e?.message}s(nt,"unwrapMessage");function Gr(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}s(Gr,"attachSchema");function te(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,c=e.message?e.message:nt(e.inst?._zod.def?.error?.(e))??nt(i?.(e))??nt(t?.error?.(e))??nt(r.customError?.(e))??nt(r.localeError?.(e))??"Invalid input",u={};for(let a of Object.keys(e))a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__"||(u[a]=e[a]);return u.path??(u.path=[]),u.message=c,t?.reportInput&&(u.input=e.input),u}s(te,"finalizeIssue");function Ht(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}s(Ht,"getSizableOrigin");var dh=/[\uD800-\uDBFF]/;function Ve(e){let t=e.length;if(!dh.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}s(Ve,"codePointLength");function Xt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}s(Xt,"getLengthableOrigin");function li(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}s(li,"parsedType");function ut(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}s(ut,"issue");function mh(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}s(mh,"cleanEnum");function Kl(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}s(Kl,"base64ToUint8Array");function Wl(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}s(Wl,"uint8ArrayToBase64");function hh(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Kl(t+r)}s(hh,"base64urlToUint8Array");function gh(e){return Wl(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}s(gh,"uint8ArrayToBase64url");function yh(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}s(yh,"hexToUint8Array");function _h(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}s(_h,"uint8ArrayToHex");var ni=class{static{s(this,"Class")}constructor(...t){}};function fi(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):wh(e,r,n.value)}}s(fi,"members");function Pe(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}s(Pe,"own");function Yt(e,t,r){return Pe(e,t,r,!1)}s(Yt,"hide");function $h(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Pe(this,r,n(this))},set(o){Pe(this,r,o)}})}return t}s($h,"derived");function wh(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Pe(this,t,r.bind(this))},set(n){Pe(this,t,n)}})}s(wh,"defineBound");function bh(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}s(bh,"claim");var ti,Se=!1,vh={configurable:!0,get(){Se=!0}};function A(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&ti!==e._zod){ti=void 0;return}ti=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,vh);let o=Se;Se=!1;try{let i=r(this);return Se?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),Se=Se||o,i}catch(i){throw delete this[t],Se=Se||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}s(A,"defineLazyInternal");function xh(e,t,r,n){let o=bh(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}s(xh,"installLazyProp");var Hr="~constantCatch";function pi(e){let t=s(()=>e,"fn");return t[Hr]=!0,t}s(pi,"constantCatch");var ql,mi=Object.freeze({status:"aborted"}),di={value:void 0,enumerable:!1},Gl="captureStackTrace"in Error?Error:null;function kh(e){let t=Gl;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return Gl=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}s(kh,"newError");function d(e,t,r,n){let o={};function i(m){this.def=m,this.constr=p,this.traits=new Set}s(i,"Internals"),i.prototype=o;let c=r,u=c&&new WeakSet;function a(m,h){if(m._zod){if(m._zod.traits.has(e))return}else{di.value=new i(h);try{Object.defineProperty(m,"_zod",di)}finally{di.value=void 0}}if(m._zod.traits.add(e),t(m,h),u){let _=Object.getPrototypeOf(m),w=m._zod.constr.prototype,z=_;for(;z&&z!==w;)z=Object.getPrototypeOf(z);let x=z??_;u.has(x)||(u.add(x),fi(x,c))}let g=p.prototype;for(let _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(_ in m||(m[_]=g[_].bind(m)))}s(a,"init");let l=n?.Parent??Object;class f extends l{static{s(this,"Definition")}}Object.defineProperty(f,"name",{value:e});function p(m){let h=n?.Parent?kh(f):this;a(h,m);let g=h._zod.deferred;if(g){for(let w of g)w();h._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(h),h}return s(p,"_"),Object.defineProperty(p,"init",{value:a}),Object.defineProperty(p,Symbol.hasInstance,{value:s(m=>n?.Parent&&m instanceof n.Parent?!0:m?._zod?.traits?.has(e),"value")}),Object.defineProperty(p,"name",{value:e}),p}s(d,"$constructor");var hi=Symbol("zod_brand"),re=class extends Error{static{s(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ie=class extends Error{static{s(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(ql=globalThis).__zod_globalConfig??(ql.__zod_globalConfig={});var B=globalThis.__zod_globalConfig;function F(e){return e&&Object.assign(B,e),B}s(F,"config");function zh(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,it,2)),e.message}s(zh,"_getMessage");function Sh(e){this._zod.message=e}s(Sh,"_setMessage");var Ph={get:zh,set:Sh,enumerable:!0,configurable:!0},yi={value:void 0,enumerable:!1},Hl=new WeakSet([Object.prototype,Error.prototype]),Xl=s((e,t)=>{e.name="$ZodError",yi.value=t,Object.defineProperty(e,"issues",yi),yi.value=void 0,Object.defineProperty(e,"message",Ph);let r=Object.getPrototypeOf(e);Hl.has(r)||(Hl.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=s(()=>this.message,"value");return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},"initializer"),_i=d("$ZodError",Xl),ne=d("$ZodError",Xl,void 0,{Parent:Error});function Ih(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}s(Ih,"node");function Qt(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?Ih(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return{formErrors:n,fieldErrors:r}}s(Qt,"flattenError");function er(e,t=r=>r.message){let r={_errors:[]},n=s((o,i=[])=>{for(let c of o.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>n({issues:u},[...i,...c.path]));else if(c.code==="invalid_key")n({issues:c.issues},[...i,...c.path]);else if(c.code==="invalid_element")n({issues:c.issues},[...i,...c.path]);else{let u=[...i,...c.path];if(u.length===0)r._errors.push(t(c));else{let a=r,l=0;for(;l<u.length;){let f=u[l],p=l===u.length-1;if(f==="_errors"){p&&a._errors.push(t(c)),l++;continue}Object.prototype.hasOwnProperty.call(a,f)||Object.defineProperty(a,f,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=a[f];p&&m._errors.push(t(c)),a=m,l++}}}},"processError");return n(e),r}s(er,"formatError");function $i(e,t=r=>r.message){let r={errors:[]},n=s((o,i=[])=>{var c;for(let u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(a=>n({issues:a},[...i,...u.path]));else if(u.code==="invalid_key")n({issues:u.issues},[...i,...u.path]);else if(u.code==="invalid_element")n({issues:u.issues},[...i,...u.path]);else{let a=[...i,...u.path];if(a.length===0){r.errors.push(t(u));continue}let l=r,f=0;for(;f<a.length;){let p=a[f],m=f===a.length-1;typeof p=="string"?(l.properties??(l.properties={}),Object.prototype.hasOwnProperty.call(l.properties,p)||Object.defineProperty(l.properties,p,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),l=l.properties[p]):(l.items??(l.items=[]),(c=l.items)[p]??(c[p]={errors:[]}),l=l.items[p]),m&&l.errors.push(t(u)),f++}}},"processError");return n(e),r}s($i,"treeifyError");function Yl(e){let t=[],r=e.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?t.push(`[${n}]`):typeof n=="symbol"?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push("."),t.push(n));return t.join("")}s(Yl,"toDotPath");function wi(e){let t=[],r=[...e.issues].sort((n,o)=>(n.path??[]).length-(o.path??[]).length);for(let n of r)t.push(`\u2716 ${n.message}`),n.path?.length&&t.push(` \u2192 at ${Yl(n.path)}`);return t.join(`
|
|
8
|
+
`)}s(wi,"prettifyError");function Xr(e,t){return{callee:t?.callee??e,Err:t?.Err}}s(Xr,"finalizeParams");var at=s(e=>{let t=s((r,n,o,i)=>{let c=o?{...o,async:!1}:{async:!1},u=r._zod.run({value:n,issues:[]},c);if(u instanceof Promise)throw new re;if(u.issues.length){let a=new(i?.Err??e)(u.issues.map(l=>te(l,c,F())));throw Kr(a,i?.callee??t),a}return u.value},"fn");return t},"_parse"),Yr=at(ne),lt=s(e=>{let t=s(async(r,n,o,i)=>{let c=o?{...o,async:!0}:{async:!0},u=r._zod.run({value:n,issues:[]},c);if(u instanceof Promise&&(u=await u),u.issues.length){let a=new(i?.Err??e)(u.issues.map(l=>te(l,c,F())));throw Kr(a,i?.callee??t),a}return u.value},"fn");return t},"_parseAsync"),Qr=lt(ne),ft=s(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new re;return i.issues.length?Ql(e,i.issues,o):{success:!0,data:i.value}},"_safeParse"),Ah=ft(ne);function Ql(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>te(o,r,F()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}s(Ql,"failure");var pt=s(e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?Ql(e,i.issues,o):{success:!0,data:i.value}},"_safeParseAsync"),Zh=pt(ne),Nh=Symbol.for("zod.compile.invalid"),Eh=Symbol.for("zod.compile.fallback"),tr=s(((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Nh)return!0;if(n.definite===!0&&r===void 0)return!1}return Ch(e,t,r)}),"validate");function Ch(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o?(n[Eh]=!0,i=o({value:t,issues:[]},n)):i=e._zod.run({value:t,issues:[]},n),i instanceof Promise)throw new re;return i.issues.length===0}s(Ch,"validateFallback");var rr=s(async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},"validateAsync"),en=s(e=>{let t=at(e),r=s((n,o,i,c)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,u,Xr(r,c))},"fn");return r},"_encode"),Th=en(ne),tn=s(e=>{let t=at(e),r=s((n,o,i,c)=>t(n,o,i,Xr(r,c)),"fn");return r},"_decode"),Dh=tn(ne),rn=s(e=>{let t=lt(e),r=s(async(n,o,i,c)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,u,Xr(r,c))},"fn");return r},"_encodeAsync"),Rh=rn(ne),nn=s(e=>{let t=lt(e),r=s(async(n,o,i,c)=>await t(n,o,i,Xr(r,c)),"fn");return r},"_decodeAsync"),jh=nn(ne),on=s(e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return ft(e)(t,r,o)},"_safeEncode"),Lh=on(ne),sn=s(e=>(t,r,n)=>ft(e)(t,r,n),"_safeDecode"),Vh=sn(ne),cn=s(e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return pt(e)(t,r,o)},"_safeEncodeAsync"),Fh=cn(ne),un=s(e=>async(t,r,n)=>pt(e)(t,r,n),"_safeDecodeAsync"),Mh=un(ne);var le={};_e(le,{anyString:()=>Wi,base64:()=>ji,base64url:()=>Li,bigint:()=>Gi,boolean:()=>Hi,browserEmail:()=>Hh,cidrv4:()=>Di,cidrv6:()=>Ri,creditCard:()=>an,cuid:()=>vi,cuid2:()=>xi,currencyCode:()=>Ui,date:()=>Bi,datetime:()=>Ki,domain:()=>Fi,duration:()=>Oi,e164:()=>Mi,email:()=>Zi,emoji:()=>Ni,extendedDuration:()=>Uh,guid:()=>Ai,hex:()=>ts,hostname:()=>Vi,html5Email:()=>Wh,httpProtocol:()=>nr,iban:()=>ln,idnEmail:()=>Gh,integer:()=>or,ipv4:()=>Ei,ipv6:()=>Ci,ksuid:()=>Si,lowercase:()=>Qi,mac:()=>Ti,md5_base64:()=>eg,md5_base64url:()=>tg,md5_hex:()=>Qh,nanoid:()=>Pi,nanoidOfLength:()=>Ii,null:()=>Xi,number:()=>be,rfc5322Email:()=>qh,sha1_base64:()=>ng,sha1_base64url:()=>og,sha1_hex:()=>rg,sha256_base64:()=>sg,sha256_base64url:()=>cg,sha256_hex:()=>ig,sha384_base64:()=>ag,sha384_base64url:()=>lg,sha384_hex:()=>ug,sha512_base64:()=>pg,sha512_base64url:()=>dg,sha512_hex:()=>fg,string:()=>qi,time:()=>Ji,ulid:()=>ki,undefined:()=>Yi,unicodeEmail:()=>ef,uppercase:()=>es,uuid:()=>Fe,uuid4:()=>Bh,uuid6:()=>Jh,uuid7:()=>Kh,xid:()=>zi});var vi=/^[cC][0-9a-z]{6,}$/,xi=/^[0-9a-z]+$/,ki=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,zi=/^[0-9a-vA-V]{20}$/,Si=/^[A-Za-z0-9]{27}$/,Pi=/^[a-zA-Z0-9_-]{21}$/;function Ii(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}s(Ii,"nanoidOfLength");var Oi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Uh=/^[-+]?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)?)??$/,Ai=/^([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})$/,Fe=s(e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[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)$/,"uuid"),Bh=Fe(4),Jh=Fe(6),Kh=Fe(7),Zi=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Wh=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,qh=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ef=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Gh=ef,Hh=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Xh="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Ni(){return new RegExp(Xh,"u")}s(Ni,"emoji");var Ei=/^(?:(?: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])$/,Ci=/^(([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}|:))$/,Ti=s(e=>{let t=ae(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},"mac"),Di=/^((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])$/,Ri=/^(([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])$/,ji=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Li=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Vi=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Fi=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,nr=/^https?$/,Mi=/^\+[1-9]\d{6,14}$/,an=/^\d(?:[ -]?\d){11,18}$/,Ui=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,ln=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,tf="(?:(?:\\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])))";function Yh(e){return new RegExp(`^${e}$`)}s(Yh,"anchor");var Bi=Yh(tf);function bi(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}s(bi,"timeSource");function Ji(e){return new RegExp(`^${bi(e)}$`)}s(Ji,"time");function Ki(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${bi({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${bi({precision:e.precision})}`:r;return new RegExp(`^${tf}T(?:${n})$`)}s(Ki,"datetime");var Wi=/^[\s\S]{0,}$/,qi=s(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Gi=/^-?\d+n?$/,or=/^-?\d+$/,be=/^-?\d+(?:\.\d+)?$/,Hi=/^(?:true|false)$/i,Xi=/^null$/i;var Yi=/^undefined$/i;var Qi=/^[^A-Z]*$/,es=/^[^a-z]*$/,ts=/^[0-9a-fA-F]*$/;function ir(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}s(ir,"fixedBase64");function sr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}s(sr,"fixedBase64url");var Qh=/^[0-9a-fA-F]{32}$/,eg=ir(22,"=="),tg=sr(22),rg=/^[0-9a-fA-F]{40}$/,ng=ir(27,"="),og=sr(27),ig=/^[0-9a-fA-F]{64}$/,sg=ir(43,"="),cg=sr(43),ug=/^[0-9a-fA-F]{96}$/,ag=ir(64,""),lg=sr(64),fg=/^[0-9a-fA-F]{128}$/,pg=ir(86,"=="),dg=sr(86);var j=d("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),rs=s(e=>{let t=e.value;return!Jr(t)&&t.size!==void 0},"_whenHasSize"),ns=s(e=>{let t=e.value;return!Jr(t)&&t.length!==void 0},"_whenHasLength"),fn={number:"number",bigint:"bigint",object:"date"},dn=d("$ZodCheckLessThan",(e,t)=>{j.init(e,t);let r=fn[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:fn[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),mn=d("$ZodCheckGreaterThan",(e,t)=>{j.init(e,t);let r=fn[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:fn[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),os=d("$ZodCheckMultipleOf",(e,t)=>{j.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):Jt(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),is=d("$ZodCheckNumberFormat",(e,t)=>{j.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=qt[t.format];e._zod.check=c=>{let u=c.value;if(r){if(!Number.isInteger(u)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?c.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}u<o&&c.issues.push({origin:"number",input:u,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),u>i&&c.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),ss=d("$ZodCheckBigIntFormat",(e,t)=>{j.init(e,t);let[r,n]=Gt[t.format];e._zod.check=o=>{let i=o.value;i<r&&o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>n&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),cs=d("$ZodCheckMaxSize",(e,t)=>{var r;j.init(e,t),(r=e._zod.def).when??(r.when=rs),e._zod.check=n=>{let o=n.value;o.size<=t.maximum||n.issues.push({origin:Ht(o),code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),us=d("$ZodCheckMinSize",(e,t)=>{var r;j.init(e,t),(r=e._zod.def).when??(r.when=rs),e._zod.check=n=>{let o=n.value;o.size>=t.minimum||n.issues.push({origin:Ht(o),code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),as=d("$ZodCheckSizeEquals",(e,t)=>{var r;j.init(e,t),(r=e._zod.def).when??(r.when=rs),e._zod.check=n=>{let o=n.value,i=o.size;if(i===t.size)return;let c=i>t.size;n.issues.push({origin:Ht(o),...c?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ls=d("$ZodCheckMaxLength",(e,t)=>{var r;j.init(e,t),(r=e._zod.def).when??(r.when=ns),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?Ve(o):i)<=t.maximum)return;let u=Xt(o);n.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),fs=d("$ZodCheckMinLength",(e,t)=>{var r;j.init(e,t),(r=e._zod.def).when??(r.when=ns),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?Ve(o):i)>=t.minimum)return;let u=Xt(o);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ps=d("$ZodCheckLengthEquals",(e,t)=>{var r;j.init(e,t),(r=e._zod.def).when??(r.when=ns),e._zod.check=n=>{let o=n.value,i=o.length,c=typeof o=="string"&&i>=t.length&&i<=t.length*2?Ve(o):i;if(c===t.length)return;let u=Xt(o),a=c>t.length;n.issues.push({origin:u,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),dt=d("$ZodCheckStringFormat",(e,t)=>{var r,n;j.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),ds=d("$ZodCheckRegex",(e,t)=>{dt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ms=d("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Qi),dt.init(e,t)}),hs=d("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=es),dt.init(e,t)}),gs=d("$ZodCheckIncludes",(e,t)=>{j.init(e,t);let r=ae(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),ys=d("$ZodCheckStartsWith",(e,t)=>{j.init(e,t);let r=new RegExp(`^${ae(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),_s=d("$ZodCheckEndsWith",(e,t)=>{j.init(e,t);let r=new RegExp(`.*${ae(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function pn(e,t,r){e.issues.length&&t.issues.push(...ee(r,e.issues))}s(pn,"handleCheckPropertyResult");var $s=d("$ZodCheckProperty",(e,t)=>{j.init(e,t),e._zod.check=r=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>pn(o,r,t.property));pn(n,r,t.property)}}),ws=d("$ZodCheckProperties",(e,t)=>{j.init(e,t),Yt(e,Symbol.iterator,function*(){yield e});let r;e._zod.check=n=>{if(n.value==null){n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});return}r??(r=Reflect.ownKeys(t.shape).map(c=>[c,t.shape[c]]));let o=n.value,i;for(let[c,u]of r){let a=u._zod.run({value:o[c],issues:[]},{});a instanceof Promise?(i??(i=[]),i.push(a.then(l=>pn(l,n,c)))):pn(a,n,c)}if(i)return Promise.all(i).then(()=>{})}}),bs=d("$ZodCheckMimeType",(e,t)=>{j.init(e,t);let r=new Set(t.mime);e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}}),vs=d("$ZodCheckOverwrite",(e,t)=>{j.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Me=class{static{s(this,"Doc")}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(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
|
|
9
9
|
`).filter(c=>c),o=Math.min(...n.map(c=>c.length-c.trimStart().length)),i=n.map(c=>c.slice(o)).map(c=>" ".repeat(this.indent*2)+c);for(let c of i)this.content.push(c)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
10
10
|
${r.join(`
|
|
11
11
|
`)}
|
|
12
|
-
};`)(...Object.values(this.closed))}};var vs={major:4,minor:6,patch:5};var P=d("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=vs;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let c of i._zod.onattach)c(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=s((u,a,l)=>{if(u.memo)return u;let f=H(u),p;for(let m of a){if(m._zod.def.when){if(ui(u)||!m._zod.def.when(u))continue}else if(f)continue;let h=u.issues.length,g=m._zod.check(u);if(g instanceof Promise&&l?.async===!1)throw new re;if(p||g instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await g,u.issues.length!==h&&(Gr(u.issues,h,e),f||(f=H(u,h)))});else{if(u.issues.length===h)continue;Gr(u.issues,h,e),f||(f=H(u,h))}}return p?p.then(()=>u):u},"runChecks"),c=s((u,a,l)=>{if(H(u))return u.aborted=!0,u;let f=i(a,o,l);if(f instanceof Promise){if(l.async===!1)throw new re;return f.then(p=>e._zod.parse(p,l))}return e._zod.parse(f,l)},"handleCanaryResult");e._zod.run=(u,a)=>{if(a.skipChecks)return e._zod.parse(u,a);if(a.direction==="backward"){let f=e._zod.parse({value:u.value,issues:[]},{...a,skipChecks:!0});return f instanceof Promise?f.then(p=>c(p,u,a)):c(f,u,a)}let l=e._zod.parse(u,a);if(l instanceof Promise){if(a.async===!1)throw new re;return l.then(f=>i(f,o,a))}return i(l,o,a)}}},{get"~standard"(){return Yt(this,"~standard",$n(this))},set"~standard"(e){Se(this,"~standard",e)}}),$f=s((e,t)=>e.issues.length?{issues:e.issues.map(r=>te(r,t,F()))}:{value:e.value},"toStandardResult");async function dg(e,t){let r={async:!0};return $f(await e._zod.run({value:t,issues:[]},r),r)}s(dg,"validateAsync");function $n(e){return{validate:s(t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return $f(n,r)}catch{}return dg(e,t)},"validate"),vendor:"zod",version:1}}s($n,"standardProps");var Me=d("$ZodString",(e,t)=>{P.init(e,t),e._zod.pattern=t.pattern??Ki,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),T=d("$ZodStringFormat",(e,t)=>{dt.init(e,t),Me.init(e,t)}),ks=d("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Oi),T.init(e,t)}),zs=d("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ve(n))}else t.pattern??(t.pattern=Ve());T.init(e,t)}),Ss=d("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ai),T.init(e,t)}),Ps=1,cr=2;function Is(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}s(Is,"canParseURL");function wn(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?Is(e)||cr:wf(e,t)}s(wn,"validateURL");function wf(e,t){if(!t.normalize&&t.protocol?.source===nr.source&&!/^https?:\/\//i.test(e))return Ps;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??cr}return new URL(e)}catch{return cr}}s(wf,"parseURLObject");var mg=/[\t\n\r]/g;function ur(e){return e.replace(mg,"")}s(ur,"stripTabAndNewline");function bn(e,t){return t.lastIndex=0,t.test(e.hostname)}s(bn,"urlHostnameOk");function vn(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}s(vn,"urlProtocolOk");var Os=d("$ZodURL",(e,t)=>{T.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=wn(n,t);if(o===Ps){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===cr){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=ur(n);return}t.hostname&&!bn(o,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!vn(o,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?o.href:ur(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),As=d("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Zi()),T.init(e,t)}),Zs=d("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Si:Pi(t.length)),T.init(e,t)}),Ns=d("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=bi),T.init(e,t)}),Es=d("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=vi),T.init(e,t)}),Cs=d("$ZodULID",(e,t)=>{t.pattern??(t.pattern=xi),T.init(e,t)}),Ts=d("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ki),T.init(e,t)}),Ds=d("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=zi),T.init(e,t)}),Rs=d("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ji(t)),T.init(e,t)}),js=d("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ui),T.init(e,t)}),Ls=d("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Bi(t)),T.init(e,t)}),Vs=d("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ii),T.init(e,t)}),Fs=d("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ni),T.init(e,t)}),hg=/^[0-9a-fA-F:.]+$/;function ar(e){return hg.test(e)?Is(`http://[${e}]`):!1}s(ar,"isValidIPv6");var Ms=d("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ei),T.init(e,t),e._zod.check=r=>{ar(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),Us=d("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Ci(t.delimiter)),T.init(e,t)}),Bs=d("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ti),T.init(e,t)});function xn(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);return`${o}`!==n||o<0||o>128?!1:ar(r)}s(xn,"isValidCIDRv6");var Js=d("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Di),T.init(e,t),e._zod.check=r=>{xn(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function lr(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}s(lr,"isValidBase64");var kn=/^[0-9a-zA-Z+/]*={0,2}$/,Ks=d("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=kn),T.init(e,t),e._zod.check=r=>{lr(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),fr=/^[A-Za-z0-9_-]*$/;function zn(e){if(!fr.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return lr(r)}s(zn,"isValidBase64URL");var Ws=d("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=fr),T.init(e,t),e._zod.check=r=>{zn(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),qs=d("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Fi),T.init(e,t)}),gg=/[- ]/g;function yg(e){let t=e.length,r=1,n=0;for(;t;){let o=e.charCodeAt(--t)-48;r^=1,n+=r?[0,2,4,6,8,1,3,5,7,9][o]:o}return n%10===0}s(yg,"isLuhnAlgo");function Sn(e){return an.test(e)?yg(e.replace(gg,"")):!1}s(Sn,"isValidCreditCard");var Gs=d("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=an),T.init(e,t),e._zod.check=r=>{Sn(r.value)||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort})}});function _g(e){let t=0,r=e.length;for(let n=4;n<r;n++){let o=e.charCodeAt(n);t=(o>=65?t*100+(o-55):t*10+(o-48))%97}for(let n=0;n<4;n++){let o=e.charCodeAt(n);t=(o>=65?t*100+(o-55):t*10+(o-48))%97}return t===1}s(_g,"isIso7064Mod97");function Pn(e){return ln.test(e)?_g(e):!1}s(Pn,"isValidIBAN");var Hs=d("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=ln),T.init(e,t),e._zod.check=r=>{Pn(r.value)||r.issues.push({code:"invalid_format",format:"iban",input:r.value,inst:e,continue:!t.abort})}});function In(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}s(In,"isValidJWT");var Xs=d("$ZodJWT",(e,t)=>{T.init(e,t),e._zod.check=r=>{In(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Ys=d("$ZodCustomStringFormat",(e,t)=>{T.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),On=d("$ZodNumber",(e,t)=>{P.init(e,t),e._zod.pattern=be,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),Qs=d("$ZodNumberFormat",(e,t)=>{os.init(e,t),On.init(e,t)}),pr=d("$ZodBoolean",(e,t)=>{P.init(e,t),e._zod.pattern=Gi,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),An=d("$ZodBigInt",(e,t)=>{P.init(e,t),e._zod.pattern=qi,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),ec=d("$ZodBigIntFormat",(e,t)=>{is.init(e,t),An.init(e,t)}),tc=d("$ZodSymbol",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:e}),r}}),rc=d("$ZodUndefined",(e,t)=>{P.init(e,t),e._zod.pattern=Xi,e._zod.values=new Set([void 0]),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),r}}),nc=d("$ZodNull",(e,t)=>{P.init(e,t),e._zod.pattern=Hi,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}}),oc=d("$ZodAny",(e,t)=>{P.init(e,t),e._zod.parse=r=>r}),ic=d("$ZodUnknown",(e,t)=>{P.init(e,t),e._zod.parse=r=>r}),sc=d("$ZodNever",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),cc=d("$ZodVoid",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),uc=d("$ZodDate",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r}});function nf(e,t,r){e.issues.length&&t.issues.push(...ee(r,e.issues)),t.value[r]=e.value}s(nf,"handleArrayResult");var ac=d("$ZodArray",(e,t)=>{P.init(e,t);let r=B.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let c=[],u=o?.abortEarly;for(let a=0;a<i.length;a++){let l=i[a],f=t.element._zod.run({value:l,issues:[]},o);if(f instanceof Promise)c.push(f.then(p=>nf(p,n,a)));else if(nf(f,n,a),u&&f.issues.length!==0&&H(f))break}return c.length?Promise.all(c).then(()=>n):n}});function _n(e,t,r,n,o,i){let c=r in n,u=i==="optional";if(!(!c&&u&&o==="optional")){if(e.issues.length){if(o!==void 0&&u&&!c)return;t.issues.push(...ee(r,e.issues))}if(!c&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(c||o==="defaulted"&&!u)&&(t.value[r]=void 0):t.value[r]=e.value}}s(_n,"handlePropertyResult");var $g=[];function bf(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:$g,o=n.length?[...t,...n]:t;for(let c of o)if(!e.shape?.[c]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(c)}": expected a Zod schema`);let i=ci(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}s(bf,"normalizeDef");function vf(e,t,r,n,o,i,c){let u=[],a=o.keySet,l=o.catchall._zod,f=l.def.type,p=l.optin,m=l.optout,h=0;for(let g in t){if(c&&r.issues.length!==h){if(H(r,h))break;h=r.issues.length}if(a.has(g))continue;if(g==="__proto__"){f==="never"&&u.push(g);continue}if(f==="never"){u.push(g);continue}let _=l.run({value:t[g],issues:[]},n);_ instanceof Promise?e.push(_.then(w=>_n(w,r,g,t,p,m))):_n(_,r,g,t,p,m)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>r):r}s(vf,"handleCatchall");var xf=d("$ZodObject",(e,t)=>{P.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let l=s(()=>{let f={...n};return Object.defineProperty(t,"shape",{value:f}),l.raw=f,f},"get");l.raw=n,Object.defineProperty(t,"shape",{get:l})}let o=st(()=>bf(t));A(e,"propValues",l=>{let f=l.def.shape,p={};for(let m in f){let h=f[m]._zod;if(h.values){Object.prototype.hasOwnProperty.call(p,m)||J(p,m,new Set);for(let g of h.values)p[m].add(g);h.optin!==void 0&&p[m].add(void 0)}}return p});let i=je,c=t.catchall,u,a=B.memoizer;a?.attach(e),e._zod.parse=(l,f)=>{u??(u=o.value);let p=l.value;if(!i(p))return l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l;l.value=a?a.alloc(e,l,{},f):{};let m=[],h=u.shape,g=f?.abortEarly,_=l.issues.length;for(let w of u.allKeys){if(g&&l.issues.length!==_){if(H(l,_))break;_=l.issues.length}if(w==="__proto__")continue;let z=h[w],x=z._zod.optin,I=z._zod.optout,E=z._zod.run({value:p[w],issues:[]},f);E instanceof Promise?m.push(E.then(L=>_n(L,l,w,p,x,I))):_n(E,l,w,p,x,I)}return c?vf(m,p,l,f,o.value,e,g===!0):m.length?Promise.all(m).then(()=>l):l}}),lc=d("$ZodObjectJIT",(e,t)=>{xf.init(e,t);let r=e._zod.parse,n=st(()=>bf(t)),o=B.memoizer,i=s(h=>{let g=n.value,_=g.symbolKeys,w=new Fe(["payload","ctx"],{shape:h,inst:e,memo:o,syms:_}),z=s(L=>`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`,"parseStr"),x=s((L,N)=>`
|
|
12
|
+
};`)(...Object.values(this.closed))}};var xs={major:4,minor:6,patch:5};var P=d("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=xs;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let c of i._zod.onattach)c(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=s((u,a,l)=>{if(u.memo)return u;let f=H(u),p;for(let m of a){if(m._zod.def.when){if(ai(u)||!m._zod.def.when(u))continue}else if(f)continue;let h=u.issues.length,g=m._zod.check(u);if(g instanceof Promise&&l?.async===!1)throw new re;if(p||g instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await g,u.issues.length!==h&&(Gr(u.issues,h,e),f||(f=H(u,h)))});else{if(u.issues.length===h)continue;Gr(u.issues,h,e),f||(f=H(u,h))}}return p?p.then(()=>u):u},"runChecks"),c=s((u,a,l)=>{if(H(u))return u.aborted=!0,u;let f=i(a,o,l);if(f instanceof Promise){if(l.async===!1)throw new re;return f.then(p=>e._zod.parse(p,l))}return e._zod.parse(f,l)},"handleCanaryResult");e._zod.run=(u,a)=>{if(a.skipChecks)return e._zod.parse(u,a);if(a.direction==="backward"){let f=e._zod.parse({value:u.value,issues:[]},{...a,skipChecks:!0});return f instanceof Promise?f.then(p=>c(p,u,a)):c(f,u,a)}let l=e._zod.parse(u,a);if(l instanceof Promise){if(a.async===!1)throw new re;return l.then(f=>i(f,o,a))}return i(l,o,a)}}},{get"~standard"(){return Yt(this,"~standard",$n(this))},set"~standard"(e){Pe(this,"~standard",e)}}),$f=s((e,t)=>e.issues.length?{issues:e.issues.map(r=>te(r,t,F()))}:{value:e.value},"toStandardResult");async function mg(e,t){let r={async:!0};return $f(await e._zod.run({value:t,issues:[]},r),r)}s(mg,"validateAsync");function $n(e){return{validate:s(t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return $f(n,r)}catch{}return mg(e,t)},"validate"),vendor:"zod",version:1}}s($n,"standardProps");var Ue=d("$ZodString",(e,t)=>{P.init(e,t),e._zod.pattern=t.pattern??Wi,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),T=d("$ZodStringFormat",(e,t)=>{dt.init(e,t),Ue.init(e,t)}),zs=d("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ai),T.init(e,t)}),Ss=d("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Fe(n))}else t.pattern??(t.pattern=Fe());T.init(e,t)}),Ps=d("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Zi),T.init(e,t)}),Is=1,cr=2;function Os(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}s(Os,"canParseURL");function wn(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?Os(e)||cr:wf(e,t)}s(wn,"validateURL");function wf(e,t){if(!t.normalize&&t.protocol?.source===nr.source&&!/^https?:\/\//i.test(e))return Is;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??cr}return new URL(e)}catch{return cr}}s(wf,"parseURLObject");var hg=/[\t\n\r]/g;function ur(e){return e.replace(hg,"")}s(ur,"stripTabAndNewline");function bn(e,t){return t.lastIndex=0,t.test(e.hostname)}s(bn,"urlHostnameOk");function vn(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}s(vn,"urlProtocolOk");var As=d("$ZodURL",(e,t)=>{T.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=wn(n,t);if(o===Is){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===cr){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=ur(n);return}t.hostname&&!bn(o,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!vn(o,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?o.href:ur(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Zs=d("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ni()),T.init(e,t)}),Ns=d("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Pi:Ii(t.length)),T.init(e,t)}),Es=d("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=vi),T.init(e,t)}),Cs=d("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=xi),T.init(e,t)}),Ts=d("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ki),T.init(e,t)}),Ds=d("$ZodXID",(e,t)=>{t.pattern??(t.pattern=zi),T.init(e,t)}),Rs=d("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Si),T.init(e,t)}),js=d("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ki(t)),T.init(e,t)}),Ls=d("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Bi),T.init(e,t)}),Vs=d("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ji(t)),T.init(e,t)}),Fs=d("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Oi),T.init(e,t)}),Ms=d("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ei),T.init(e,t)}),gg=/^[0-9a-fA-F:.]+$/;function ar(e){return gg.test(e)?Os(`http://[${e}]`):!1}s(ar,"isValidIPv6");var Us=d("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ci),T.init(e,t),e._zod.check=r=>{ar(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),Bs=d("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Ti(t.delimiter)),T.init(e,t)}),Js=d("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Di),T.init(e,t)});function xn(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);return`${o}`!==n||o<0||o>128?!1:ar(r)}s(xn,"isValidCIDRv6");var Ks=d("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ri),T.init(e,t),e._zod.check=r=>{xn(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function lr(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}s(lr,"isValidBase64");var kn=/^[0-9a-zA-Z+/]*={0,2}$/,Ws=d("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=kn),T.init(e,t),e._zod.check=r=>{lr(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),fr=/^[A-Za-z0-9_-]*$/;function zn(e){if(!fr.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return lr(r)}s(zn,"isValidBase64URL");var qs=d("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=fr),T.init(e,t),e._zod.check=r=>{zn(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Gs=d("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Mi),T.init(e,t)}),yg=/[- ]/g;function _g(e){let t=e.length,r=1,n=0;for(;t;){let o=e.charCodeAt(--t)-48;r^=1,n+=r?[0,2,4,6,8,1,3,5,7,9][o]:o}return n%10===0}s(_g,"isLuhnAlgo");function Sn(e){return an.test(e)?_g(e.replace(yg,"")):!1}s(Sn,"isValidCreditCard");var Hs=d("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=an),T.init(e,t),e._zod.check=r=>{Sn(r.value)||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort})}});function $g(e){let t=0,r=e.length;for(let n=4;n<r;n++){let o=e.charCodeAt(n);t=(o>=65?t*100+(o-55):t*10+(o-48))%97}for(let n=0;n<4;n++){let o=e.charCodeAt(n);t=(o>=65?t*100+(o-55):t*10+(o-48))%97}return t===1}s($g,"isIso7064Mod97");function Pn(e){return ln.test(e)?$g(e):!1}s(Pn,"isValidIBAN");var Xs=d("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=ln),T.init(e,t),e._zod.check=r=>{Pn(r.value)||r.issues.push({code:"invalid_format",format:"iban",input:r.value,inst:e,continue:!t.abort})}});function In(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}s(In,"isValidJWT");var Ys=d("$ZodJWT",(e,t)=>{T.init(e,t),e._zod.check=r=>{In(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Qs=d("$ZodCustomStringFormat",(e,t)=>{T.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),On=d("$ZodNumber",(e,t)=>{P.init(e,t),e._zod.pattern=be,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),ec=d("$ZodNumberFormat",(e,t)=>{is.init(e,t),On.init(e,t)}),pr=d("$ZodBoolean",(e,t)=>{P.init(e,t),e._zod.pattern=Hi,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),An=d("$ZodBigInt",(e,t)=>{P.init(e,t),e._zod.pattern=Gi,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),tc=d("$ZodBigIntFormat",(e,t)=>{ss.init(e,t),An.init(e,t)}),rc=d("$ZodSymbol",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:e}),r}}),nc=d("$ZodUndefined",(e,t)=>{P.init(e,t),e._zod.pattern=Yi,e._zod.values=new Set([void 0]),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),r}}),oc=d("$ZodNull",(e,t)=>{P.init(e,t),e._zod.pattern=Xi,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}}),ic=d("$ZodAny",(e,t)=>{P.init(e,t),e._zod.parse=r=>r}),sc=d("$ZodUnknown",(e,t)=>{P.init(e,t),e._zod.parse=r=>r}),cc=d("$ZodNever",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),uc=d("$ZodVoid",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),ac=d("$ZodDate",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r}});function nf(e,t,r){e.issues.length&&t.issues.push(...ee(r,e.issues)),t.value[r]=e.value}s(nf,"handleArrayResult");var lc=d("$ZodArray",(e,t)=>{P.init(e,t);let r=B.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let c=[],u=o?.abortEarly;for(let a=0;a<i.length;a++){let l=i[a],f=t.element._zod.run({value:l,issues:[]},o);if(f instanceof Promise)c.push(f.then(p=>nf(p,n,a)));else if(nf(f,n,a),u&&f.issues.length!==0&&H(f))break}return c.length?Promise.all(c).then(()=>n):n}});function _n(e,t,r,n,o,i){let c=r in n,u=i==="optional";if(!(!c&&u&&o==="optional")){if(e.issues.length){if(o!==void 0&&u&&!c)return;t.issues.push(...ee(r,e.issues))}if(!c&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(c||o==="defaulted"&&!u)&&(t.value[r]=void 0):t.value[r]=e.value}}s(_n,"handlePropertyResult");var wg=[];function bf(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:wg,o=n.length?[...t,...n]:t;for(let c of o)if(!e.shape?.[c]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(c)}": expected a Zod schema`);let i=ui(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}s(bf,"normalizeDef");function vf(e,t,r,n,o,i,c){let u=[],a=o.keySet,l=o.catchall._zod,f=l.def.type,p=l.optin,m=l.optout,h=0;for(let g in t){if(c&&r.issues.length!==h){if(H(r,h))break;h=r.issues.length}if(a.has(g))continue;if(g==="__proto__"){f==="never"&&u.push(g);continue}if(f==="never"){u.push(g);continue}let _=l.run({value:t[g],issues:[]},n);_ instanceof Promise?e.push(_.then(w=>_n(w,r,g,t,p,m))):_n(_,r,g,t,p,m)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>r):r}s(vf,"handleCatchall");var xf=d("$ZodObject",(e,t)=>{P.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let l=s(()=>{let f={...n};return Object.defineProperty(t,"shape",{value:f}),l.raw=f,f},"get");l.raw=n,Object.defineProperty(t,"shape",{get:l})}let o=st(()=>bf(t));A(e,"propValues",l=>{let f=l.def.shape,p={};for(let m in f){let h=f[m]._zod;if(h.values){Object.prototype.hasOwnProperty.call(p,m)||J(p,m,new Set);for(let g of h.values)p[m].add(g);h.optin!==void 0&&p[m].add(void 0)}}return p});let i=Le,c=t.catchall,u,a=B.memoizer;a?.attach(e),e._zod.parse=(l,f)=>{u??(u=o.value);let p=l.value;if(!i(p))return l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l;l.value=a?a.alloc(e,l,{},f):{};let m=[],h=u.shape,g=f?.abortEarly,_=l.issues.length;for(let w of u.allKeys){if(g&&l.issues.length!==_){if(H(l,_))break;_=l.issues.length}if(w==="__proto__")continue;let z=h[w],x=z._zod.optin,I=z._zod.optout,E=z._zod.run({value:p[w],issues:[]},f);E instanceof Promise?m.push(E.then(L=>_n(L,l,w,p,x,I))):_n(E,l,w,p,x,I)}return c?vf(m,p,l,f,o.value,e,g===!0):m.length?Promise.all(m).then(()=>l):l}}),fc=d("$ZodObjectJIT",(e,t)=>{xf.init(e,t);let r=e._zod.parse,n=st(()=>bf(t)),o=B.memoizer,i=s(h=>{let g=n.value,_=g.symbolKeys,w=new Me(["payload","ctx"],{shape:h,inst:e,memo:o,syms:_}),z=s(L=>`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`,"parseStr"),x=s((L,N)=>`
|
|
13
13
|
let ${L}_ab = false;
|
|
14
14
|
for (let i = 0; i < ${L}.issues.length; i++) {
|
|
15
15
|
const iss = ${L}.issues[i];
|
|
@@ -20,13 +20,13 @@ ${r.join(`
|
|
|
20
20
|
if (${L}_ab && ctx && ctx.abortEarly) {
|
|
21
21
|
payload.value = newResult;
|
|
22
22
|
return payload;
|
|
23
|
-
}`,"prefixStr");w.write("const input = payload.value;");let I=Object.create(null),E=0;for(let L of g.allKeys)I[L]=`key_${E++}`;w.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let L of g.allKeys){if(L==="__proto__")continue;let N=I[L],W=typeof L=="symbol"?`syms[${_.indexOf(L)}]`:G(L),Ut=`${W} in input`,Vl=h[L],
|
|
23
|
+
}`,"prefixStr");w.write("const input = payload.value;");let I=Object.create(null),E=0;for(let L of g.allKeys)I[L]=`key_${E++}`;w.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let L of g.allKeys){if(L==="__proto__")continue;let N=I[L],W=typeof L=="symbol"?`syms[${_.indexOf(L)}]`:G(L),Ut=`${W} in input`,Vl=h[L],ei=Vl?._zod?.optin,Fl=ei!==void 0,Rm=Vl?._zod?.optout==="optional";if(w.write(`const ${N} = ${z(W)};`),Fl&&Rm){let jm=ei==="optional"?`${N}_present`:`${N}.value !== undefined || ${N}_present`;w.write(`
|
|
24
24
|
const ${N}_present = ${Ut};
|
|
25
25
|
if (!${N}.issues.length || ${N}_present) {
|
|
26
26
|
if (${N}.issues.length) {${x(N,W)}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
if (${
|
|
29
|
+
if (${jm}) {
|
|
30
30
|
newResult[${W}] = ${N}.value;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -34,7 +34,7 @@ ${r.join(`
|
|
|
34
34
|
`)}else Fl?(w.write(`
|
|
35
35
|
if (${N}.issues.length) {${x(N,W)}
|
|
36
36
|
}
|
|
37
|
-
`),
|
|
37
|
+
`),ei==="defaulted"?w.write(`newResult[${W}] = ${N}.value;`):w.write(`
|
|
38
38
|
if (${N}.value !== undefined || ${Ut}) {
|
|
39
39
|
newResult[${W}] = ${N}.value;
|
|
40
40
|
}
|
|
@@ -59,11 +59,11 @@ ${r.join(`
|
|
|
59
59
|
newResult[${W}] = ${N}.value;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
`)}return w.write("payload.value = newResult;"),w.write("return payload;"),w.compile()},"generateFastpass"),c,u=je,a=!B.jitless,f=a&&ii.value,p=t.catchall,m;e._zod.parse=(h,g)=>{m??(m=n.value);let _=h.value;return u(_)?a&&f&&g?.async===!1&&g.jitless!==!0?(c||(c=i(t.shape)),h=c(h,g),p?vf([],_,h,g,m,e,g?.abortEarly===!0):h):r(h,g):(h.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),h)}});function of(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!H(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(c=>te(c,n,F())))}),t)}s(of,"handleUnionResults");var dr=d("$ZodUnion",(e,t)=>{P.init(e,t),A(e,"optin",n=>n.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),A(e,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),A(e,"values",n=>{if(n.def.options.every(o=>o._zod.values))return new Set(n.def.options.flatMap(o=>Array.from(o._zod.values)))}),A(e,"pattern",n=>{if(n.def.options.every(o=>o._zod.pattern)){let o=n.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>we(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,c=[];for(let u of t.options){let a=u._zod.run({value:n.value,issues:[]},o);if(a instanceof Promise)c.push(a),i=!0;else{if(a.issues.length===0)return a;c.push(a)}}return i?Promise.all(c).then(u=>of(u,n,e,o)):of(c,n,e,o)}});function sf(e,t,r,n){let o=[];for(let i=0;i<e.length;i++)e[i].issues.length===0&&o.push(i);return o.length===1?(t.value=e[o[0]].value,t):(o.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(c=>te(c,n,F())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1,matches:o}),t)}s(sf,"handleExclusiveUnionResults");var fc=d("$ZodXor",(e,t)=>{dr.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,c=[];for(let u of t.options){let a=u._zod.run({value:n.value,issues:[]},o);a instanceof Promise?(c.push(a),i=!0):c.push(a)}return i?Promise.all(c).then(u=>sf(u,n,e,o)):sf(c,n,e,o)}});function pc(e,t){let r=e._zod,n=r.bag.optionsMap;n||(n=kf(r.def),r.bag.optionsMap=n);let o=n.get(t);if(o===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return o}s(pc,"getDiscriminatedOption");function kf(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||n.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let o of n)if(t.has(o)){if(o!==void 0)throw new Error(`Duplicate discriminator value "${String(o)}"`);t.set(o,null)}else t.set(o,r)}return t}s(kf,"discriminatorMap");var dc=d("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,dr.init(e,t);let r=e._zod.parse;A(e,"propValues",o=>{let i={},c=0;for(let u of o.def.options){let a=u._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(u)}"`);a[o.def.discriminator]?.has(void 0)&&c++;for(let[l,f]of Object.entries(a)){Object.prototype.hasOwnProperty.call(i,l)||J(i,l,new Set);for(let p of f)i[l].add(p)}}return!o.def.unionFallback&&c>1&&i[o.def.discriminator]?.delete(void 0),i}),t.options.forEach((o,i)=>{let c=ct(o._zod.def);if(c&&!Object.prototype.hasOwnProperty.call(c,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});let n=st(()=>kf(t));e._zod.parse=(o,i)=>{let c=o.value;if(!je(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;let u=c?.[t.discriminator],a=n.value.get(u);return a&&(u!==void 0||i.direction!=="backward")?a._zod.run(o,i):t.unionFallback||i.direction==="backward"?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter(l=>n.value.get(l)!==null),input:c,path:[t.discriminator],inst:e}),o)}}),mc=d("$ZodIntersection",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),c=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||c instanceof Promise?Promise.all([i,c]).then(([a,l])=>cf(r,a,l)):cf(r,i,c)}});function mt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ue(e)&&ue(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let c=mt(e[i],t[i]);if(!c.valid)return{valid:!1,mergeErrorPath:[i,...c.mergeErrorPath]};o[i]=c.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],c=mt(o,i);if(!c.valid)return{valid:!1,mergeErrorPath:[n,...c.mergeErrorPath]};r.push(c.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}s(mt,"mergeValues");function cf(e,t,r){let n=new Map,o,i=new Map,c=s((l,f)=>{let p;if(l.code==="unrecognized_keys"&&!l.path?.length)o??(o=l),p=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let m=String(l.path[0]);i.has(m)||i.set(m,l),p=[m]}else return!1;for(let m of p)n.has(m)||n.set(m,{}),n.get(m)[f]=!0;return!0},"collect");for(let l of t.issues)c(l,"l")||e.issues.push(l);for(let l of r.issues)c(l,"r")||e.issues.push(l);let u=[...n].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(u.length){let l=o?u.filter(f=>o.keys.includes(f)):[];l.length&&e.issues.push({...o,keys:l});for(let f of u)!l.includes(f)&&i.has(f)&&e.issues.push(i.get(f))}let a=mt(t.value,r.value);if(!a.valid){if(H(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}s(cf,"handleIntersectionResults");var Zn=d("$ZodTuple",(e,t)=>{P.init(e,t);let r=t.items,n=B.memoizer;n?.attach(e),e._zod.parse=(o,i)=>{let c=o.value;if(!Array.isArray(c))return o.issues.push({input:c,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=n?n.alloc(e,o,[],i):[];let u=[],a=uf(r,"optin"),l=uf(r,"optout");if(!t.rest){if(c.length<a)return o.issues.push({code:"too_small",minimum:a,inclusive:!0,input:c,inst:e,origin:"array"}),o;c.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:c,inst:e,origin:"array"})}let f=new Array(r.length),p=t.rest?i?.abortEarly:void 0,m=!1;for(let h=0;h<r.length;h++){let g=r[h]._zod.run({value:c[h],issues:[]},i);g instanceof Promise?u.push(g.then(_=>{f[h]=_})):(f[h]=g,p&&!m&&g.issues.length&&(m=H(g)))}if(t.rest&&!m){let h=r.length-1,g=c.slice(r.length),_=o.issues.length;for(let w of g){if(p&&o.issues.length!==_){if(H(o,_))break;_=o.issues.length}h++;let z=t.rest._zod.run({value:w,issues:[]},i);z instanceof Promise?u.push(z.then(x=>af(x,o,h))):af(z,o,h)}}return u.length?Promise.all(u).then(()=>lf(f,o,r,c,l)):lf(f,o,r,c,l)}});function uf(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}s(uf,"getTupleOptStart");function af(e,t,r){e.issues.length&&t.issues.push(...ee(r,e.issues)),t.value[r]=e.value}s(af,"handleTupleResult");function lf(e,t,r,n,o){for(let i=0;i<r.length;i++){let c=e[i],u=i<n.length;if(!u&&i>=o&&r[i]._zod.optin==="optional"){t.value.length=i;break}if(c.issues.length){if(!u&&i>=o){t.value.length=i;break}t.issues.push(...ee(i,c.issues))}t.value[i]=c.value}for(let i=t.value.length-1;i>=n.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}s(lf,"handleTupleResults");var hc=d("$ZodRecord",(e,t)=>{P.init(e,t);let r=B.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!ue(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let c=[],u=t.keyType._zod.values;if(u&&!t.partial){n.value=r?r.alloc(e,n,{},o):{};let a=new Set;for(let f of u)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){if(a.add(typeof f=="number"?f.toString():f),f==="__proto__")continue;let p=t.keyType._zod.run({value:f,issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(g=>te(g,o,F())),input:f,path:[f],inst:e});continue}let m=p.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:i[f],issues:[]},o);h instanceof Promise?c.push(h.then(g=>{g.issues.length&&n.issues.push(...ee(f,g.issues)),n.value[m]=g.value})):(h.issues.length&&n.issues.push(...ee(f,h.issues)),n.value[m]=h.value)}let l;for(let f in i)if(!a.has(f))if(t.mode==="loose"){if(f==="__proto__")continue;n.value[f]=i[f]}else l=l??[],l.push(f);l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l,continue:!0})}else{n.value=r?r.alloc(e,n,{},o):{};let a;for(let l of Reflect.ownKeys(i)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,l))continue;let f=t.keyType._zod.run({value:l,issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&be.test(l)&&f.issues.length){let g=t.keyType._zod.run({value:Number(l),issues:[]},o);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(f=g)}if(f.issues.length){t.mode==="loose"?n.value[l]=i[l]:u?(a=a??[],a.push(l)):n.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(g=>te(g,o,F())),input:l,path:[l],inst:e});continue}let m=f.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:i[l],issues:[]},o);h instanceof Promise?c.push(h.then(g=>{g.issues.length&&n.issues.push(...ee(l,g.issues)),n.value[m]=g.value})):(h.issues.length&&n.issues.push(...ee(l,h.issues)),n.value[m]=h.value)}a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:a,continue:!0})}return c.length?Promise.all(c).then(()=>n):n}}),gc=d("$ZodMap",(e,t)=>{P.init(e,t);let r=B.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),n;let c=[];n.value=r?r.alloc(e,n,new Map,o):new Map;let u=o?.abortEarly,a=n.issues.length;for(let[l,f]of i){if(u&&n.issues.length!==a){if(H(n,a))break;a=n.issues.length}let p=t.keyType._zod.run({value:l,issues:[]},o),m=t.valueType._zod.run({value:f,issues:[]},o);p instanceof Promise||m instanceof Promise?c.push(Promise.all([p,m]).then(([h,g])=>{ff(h,g,n,l,i,e,o)})):ff(p,m,n,l,i,e,o)}return c.length?Promise.all(c).then(()=>n):n}});function ff(e,t,r,n,o,i,c){e.issues.length&&(Wt.has(typeof n)?r.issues.push(...ee(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:o,inst:i,issues:e.issues.map(u=>te(u,c,F()))})),t.issues.length&&(Wt.has(typeof n)?r.issues.push(...ee(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:i,key:n,issues:t.issues.map(u=>te(u,c,F()))})),r.value.set(e.value,t.value)}s(ff,"handleMapResult");var yc=d("$ZodSet",(e,t)=>{P.init(e,t);let r=B.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),n;let c=[];n.value=r?r.alloc(e,n,new Set,o):new Set;let u=o?.abortEarly,a=n.issues.length;for(let l of i){if(u&&n.issues.length!==a){if(H(n,a))break;a=n.issues.length}let f=t.valueType._zod.run({value:l,issues:[]},o);f instanceof Promise?c.push(f.then(p=>pf(p,n))):pf(f,n)}return c.length?Promise.all(c).then(()=>n):n}});function pf(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}s(pf,"handleSetResult");var _c=d("$ZodEnum",(e,t)=>{P.init(e,t);let r=ot(t.entries),n=new Set(r);e._zod.values=n,A(e,"pattern",o=>{let i=ot(o.def.entries).filter(c=>Wt.has(typeof c));return new RegExp(i.length?`^(${i.map(c=>ae(c.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),$c=d("$ZodLiteral",(e,t)=>{P.init(e,t);let r=new Set(t.values);e._zod.values=r,A(e,"pattern",n=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?ae(i):i?ae(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),wc=d("$ZodFile",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),r}}),bc=d("$ZodTransform",(e,t)=>{P.init(e,t),e._zod.optin="optional",B.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Pe(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new re;return r.value=o,r}});function df(e,t){return e.value=t.issues.length?void 0:t.value,e}s(df,"handleOptionalResult");var Nn=d("$ZodOptional",(e,t)=>{P.init(e,t),A(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",A(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),A(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${we(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>df(r,i)):df(r,o)}return t.innerType._zod.run(r,n)}}),vc=d("$ZodExactOptional",(e,t)=>{Nn.init(e,t),A(e,"values",r=>r.def.innerType._zod.values),A(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),xc=d("$ZodNullable",(e,t)=>{P.init(e,t),A(e,"optin",r=>r.def.innerType._zod.optin),A(e,"optout",r=>r.def.innerType._zod.optout),A(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${we(n.source)}|null)$`):void 0}),A(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),kc=d("$ZodDefault",(e,t)=>{P.init(e,t),e._zod.optin="defaulted",A(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>mf(i,t)):mf(o,t)}});function mf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}s(mf,"handleDefaultResult");var zc=d("$ZodPrefault",(e,t)=>{P.init(e,t),e._zod.optin="defaulted",A(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Sc=d("$ZodNonOptional",(e,t)=>{P.init(e,t),A(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>hf(i,e)):hf(o,e)}});function hf(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}s(hf,"handleNonOptionalResult");var Pc=d("$ZodSuccess",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Pe("ZodSuccess");let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.issues.length===0,r)):(r.value=o.issues.length===0,r)}});function gf(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>te(o,n,F()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}s(gf,"handleCatchResult");var Ic=d("$ZodCatch",(e,t)=>{P.init(e,t),A(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),A(e,"optout",r=>r.def.innerType._zod.optout),A(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>gf(r,i,t,n)):gf(r,o,t,n)}}),Oc=d("$ZodNaN",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),En=d("$ZodPipe",(e,t)=>{P.init(e,t),A(e,"values",r=>r.def.in._zod.values),A(e,"optin",r=>r.def.in._zod.optin),A(e,"optout",r=>r.def.out._zod.optout),A(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(c=>hn(c,t.in,n)):hn(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>hn(i,t.out,n)):hn(o,t.out,n)}});function hn(e,t,r){return e.issues.some(n=>n.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}s(hn,"handlePipeResult");var mr=d("$ZodCodec",(e,t)=>{P.init(e,t),A(e,"values",r=>r.def.in._zod.values),A(e,"optin",r=>r.def.in._zod.optin),A(e,"optout",r=>r.def.out._zod.optout),A(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(c=>gn(c,t,n)):gn(i,t,n)}else{let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(c=>gn(c,t,n)):gn(i,t,n)}}});function gn(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let o=t.transform(e.value,e);return o instanceof Promise?o.then(i=>yn(e,i,t.out,r)):yn(e,o,t.out,r)}else{let o=t.reverseTransform(e.value,e);return o instanceof Promise?o.then(i=>yn(e,i,t.in,r)):yn(e,o,t.in,r)}}s(gn,"handleCodecAResult");function yn(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}s(yn,"handleCodecTxResult");var Ac=d("$ZodPreprocess",(e,t)=>{En.init(e,t)}),Zc=d("$ZodReadonly",(e,t)=>{P.init(e,t),A(e,"propValues",r=>r.def.innerType._zod.propValues),A(e,"values",r=>r.def.innerType._zod.values),A(e,"optin",r=>r.def.innerType?._zod?.optin),A(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(yf):yf(o)}});function yf(e){return e.memo||(e.value=Object.freeze(e.value)),e}s(yf,"handleReadonlyResult");function wg(e){let t=e._zod.def,r=t.pattern,n=!!t.format?.includes("int"),o,i;for(let u of t.checks??[]){let a=u._zod.def;a.pattern&&(r=a.pattern),n||(n=!!a.format?.includes("int"));let l=a.minimum??a.length,f=a.maximum??a.length;l!==void 0&&(o===void 0||l>o)&&(o=l),f!==void 0&&(i===void 0||f<i)&&(i=f)}if(r)return r.source;if(o!==void 0&&i!==void 0&&o>i)return"(?!)";if(o!==void 0||i!==void 0)return Wi({minimum:o,maximum:i}).source;let c=e._zod.pattern;return(n&&c===be?or:c)?.source}s(wg,"leafPattern");function xs(e){let t=e._zod.def,r=e._zod.pattern?.source,n=t.innerType??e._zod.innerType;if(n){let o=n._zod.pattern?.source,i=xs(n);return r&&o&&i&&i!==o?r.replace(we(o),()=>we(i)):r}if(t.options){let o=t.options.map(xs);if(o.every(Boolean))return`^(${o.map(i=>we(i)).join("|")})$`}return wg(e)}s(xs,"partPattern");var Nc=d("$ZodTemplateLiteral",(e,t)=>{P.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){let o=xs(n);if(!o)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);r.push(we(o))}else if(n===null||si.has(typeof n))r.push(ae(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)}),Ec=d("$ZodFunction",(e,t)=>(P.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...n){let o=e._def.input?Yr(e._def.input,n):n,i=Reflect.apply(r,this,o);return e._def.output?Yr(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...n){let o=e._def.input?await Qr(e._def.input,n):n,i=await Reflect.apply(r,this,o);return e._def.output?await Qr(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let n=e.constructor;return Array.isArray(r[0])?new n({type:"function",input:new Zn({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new n({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let n=e.constructor;return new n({type:"function",input:e._def.input,output:r})},e)),Cc=d("$ZodPromise",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>t.innerType._zod.run({value:o,issues:[]},n))}),hr=d("$ZodLazy",(e,t)=>{P.init(e,t),ni(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),A(e,"pattern",r=>r.innerType?._zod?.pattern),A(e,"propValues",r=>r.innerType?._zod?.propValues),A(e,"optin",r=>r.innerType?._zod?.optin??void 0),A(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),Tc=d("$ZodCustom",(e,t)=>{j.init(e,t),P.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>_f(i,r,n,e));_f(o,r,n,e)}});function _f(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(ut(o))}}s(_f,"handleRefineResult");var Rn=class extends Error{static{s(this,"$ZodCyclicError")}constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},Rc="~memo",Sf=[];function Pf(e){return e!==null&&typeof e=="object"}s(Pf,"isRef");function Dc(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}s(Dc,"cloneIssues");var If=new WeakMap,ht=0,Dn=1,gr=2;function yr(e,t,r){let n=If.get(e);if(n!==void 0)return n?gr:ht;if(t.has(e))return gr;t.add(e);let o=ht,i=s(f=>{if(o!==gr&&f?._zod){let p=yr(f,t,r);p>o&&(o=p)}},"check"),c=s((f,p)=>{let m=ht;for(let h of Reflect.ownKeys(f)){let g=Object.getOwnPropertyDescriptor(f,h);if(p&&!g.enumerable)continue;let _=g.get?Dn:g.value?._zod?yr(g.value,t,r):ht;_>m&&(m=_)}return m},"shape"),u=s(f=>{f>o&&(o=f)},"merge"),a=e._zod.def,l=a.type;switch(l){case"object":{let f=ct(a);u(f?c(f,!0):Dn),i(a.catchall);break}case"array":i(a.element);break;case"tuple":for(let f of a.items)i(f);i(a.rest);break;case"record":case"map":i(a.keyType),i(a.valueType);break;case"set":i(a.valueType);break;case"union":for(let f of a.options)i(f);break;case"intersection":i(a.left),i(a.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(a.innerType);break;case"pipe":i(a.in),i(a.out);break;case"function":i(a.input),i(a.output);break;case"lazy":{let f=a._cachedInner??(r?e._zod.innerType:void 0);u(f?yr(f,t,!1):Dn);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 f in a){let p=Object.getOwnPropertyDescriptor(a,f);if(!p||p.get)continue;let m=p.value;if(!(!m||typeof m!="object")){if(m._zod)i(m);else if(Array.isArray(m))for(let h of m)i(h)}}}return t.delete(e),bg(e,o)}s(yr,"isRecursive");function bg(e,t){return t!==Dn&&If.set(e,t===gr),t}s(bg,"settle");function jn(e){return yr(e,new Set,!0)!==ht}s(jn,"isRecursiveSchema");function vg(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}s(vg,"bucketFor");var Cn,Tn=[],xg={alloc(e,t,r){let n=Cn;if(!n)return r;Cn=void 0;let o={value:r,issues:null};return n.set(t.value,o),Tn.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=s((o,i)=>{if(i.direction!=="backward"&&Ln(i,o.value))throw new Rn;return r(o,i)},"wrapped");e._zod.parse=n,e._zod.run===r&&(e._zod.run=n)})},attach(e){var t;let r,n=!1,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let c=e._zod.parse,u=s((a,l)=>{if(r===void 0){let z=yr(e,new Set,!1);if(z===ht)return e._zod.parse=c,e._zod.run===u&&(e._zod.run=c),c(a,l);z===gr||n?r=!0:n=!0}let f=a.value;if(!Pf(f))return c(a,l);let p=l[Rc];p||(p={buckets:new WeakMap,backEdges:void 0},l[Rc]=p);let m;o===l?m=i:(m=vg(p,e),o=l,i=m);let h=m.get(f);if(h)return a.value=h.value,h.issues?h.issues.length&&a.issues.push(...Dc(h.issues)):(a.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(h.value)),a;Cn=m;let g=Tn.length,_=c(a,l);Cn=void 0;let w=Tn.length>g?Tn.pop():void 0;return _ instanceof Promise?_.then(z=>(w&&(w.issues=z.issues.length?Dc(z.issues):Sf),z)):(w&&(w.issues=_.issues.length?Dc(_.issues):Sf),_)},"wrapped");e._zod.parse=u,e._zod.run===c&&(e._zod.run=u)})}};function _r(){return xg}s(_r,"memoizer");function Ln(e,t){let r=e[Rc]?.backEdges;return r!==void 0&&Pf(t)&&r.has(t)}s(Ln,"isBackEdge");var wr={};_e(wr,{en:()=>$r});var kg=s(()=>{let e={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"}};function t(i){return e[i]??null}s(t,"getSizing");let 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 o(i,c){return i==="number"&&typeof c=="number"&&!Number.isFinite(c)?String(c):n[i]??i}return s(o,"getTypeName"),i=>{switch(i.code){case"invalid_type":{let c=o(i.expected),u=ai(i.input),a=o(u,i.input);return`Invalid input: expected ${c}, received ${a}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${Wr(i.values[0])}`:`Invalid option: expected one of ${Br(i.values,"|")}`;case"too_big":{let c=i.exact?"exactly ":i.inclusive?"<=":"<",u=t(i.origin);return u?`Too big: expected ${i.origin??"value"} to have ${c}${i.maximum.toString()} ${u.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${c}${i.maximum.toString()}`}case"too_small":{let c=i.exact?"exactly ":i.inclusive?">=":">",u=t(i.origin);return u?`Too small: expected ${i.origin} to have ${c}${i.minimum.toString()} ${u.unit}`:`Too small: expected ${i.origin} to be ${c}${i.minimum.toString()}`}case"invalid_format":{let c=i;return c.format==="starts_with"?`Invalid string: must start with "${c.prefix}"`:c.format==="ends_with"?`Invalid string: must end with "${c.suffix}"`:c.format==="includes"?`Invalid string: must include "${c.includes}"`:c.format==="regex"?`Invalid string: must match pattern ${c.pattern}`:`Invalid ${r[c.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${Br(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(u=>`'${u}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}},"error");function $r(){return{localeError:kg()}}s($r,"default");var Of,jc=Symbol("ZodOutput"),Lc=Symbol("ZodInput"),Vn=class{static{s(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"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&&typeof r=="object"&&"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 o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Fn(){return new Vn}s(Fn,"registry");(Of=globalThis).__zod_globalRegistry??(Of.__zod_globalRegistry=Fn());var K=globalThis.__zod_globalRegistry;var X=Symbol.for("zod.compile.invalid"),Af=Symbol.for("zod.compile.fallback"),pe=class extends Error{static{s(this,"ZodCompileAsyncError")}constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},Z=class extends Error{static{s(this,"ZodCompileUnsupportedError")}constructor(t,r=!0){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=r}};function Sg(e,t){try{return Un(e,{assertOnly:!0})}catch{return t}}s(Sg,"compileValidator");function Uc(e,t){try{let r=Un(e),n=Mn(e,r);return n._zod.bag.validator=Sg(e,r),n}catch(r){if(t?.strict)throw r;return e}}s(Uc,"compile");function Mn(e,t){if(jn(e))throw new Z("a schema whose subtree contains a reference cycle");let r=C(e),n=e._zod.run,o=n.__originalRun??n,i=s((c,u)=>{if(u?.async||u?.direction==="backward"||u?.skipChecks||u?.[Af]||u&&Ln(u,c.value))return o(c,u);let a=t(c.value);return a!==X?(c.value=a,c):(u&&(u[Af]=!0),o(c,u))},"wrapped");return i.__originalRun=o,r._zod.bag.fallbackRun=o,r._zod.bag.validator=t,r._zod.run=i,n.__originalRun||Pg(r,e,t),r}s(Mn,"withParser");function Pg(e,t,r){let n=e,o=t;if(typeof o.safeParse=="function"){let i=o.safeParse;n.safeParse=(c,u)=>{let a=r(c);return a!==X?{success:!0,data:a}:i(c,u)}}if(typeof o.parse=="function"){let i=o.parse;n.parse=(c,u)=>{let a=r(c);return a!==X?a:i(c,u)}}}s(Pg,"installCompiledUserMethods");function Un(e,t){let r=!0;try{r=jn(e)}catch{}if(r)throw new Z("a schema whose subtree contains a reference cycle");let n={constants:new Map,constantCounter:0,varCounter:0,definite:!0},o=new Fe(["input"]),i=V(o,n,e,"input",!t?.assertOnly);o.write(i===null?"return true;":`return ${i};`);let c=["INVALID",...n.constants.keys()],u=[X,...n.constants.values()],a=o.content.join(`
|
|
62
|
+
`)}return w.write("payload.value = newResult;"),w.write("return payload;"),w.compile()},"generateFastpass"),c,u=Le,a=!B.jitless,f=a&&si.value,p=t.catchall,m;e._zod.parse=(h,g)=>{m??(m=n.value);let _=h.value;return u(_)?a&&f&&g?.async===!1&&g.jitless!==!0?(c||(c=i(t.shape)),h=c(h,g),p?vf([],_,h,g,m,e,g?.abortEarly===!0):h):r(h,g):(h.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),h)}});function of(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!H(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(c=>te(c,n,F())))}),t)}s(of,"handleUnionResults");var dr=d("$ZodUnion",(e,t)=>{P.init(e,t),A(e,"optin",n=>n.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),A(e,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),A(e,"values",n=>{if(n.def.options.every(o=>o._zod.values))return new Set(n.def.options.flatMap(o=>Array.from(o._zod.values)))}),A(e,"pattern",n=>{if(n.def.options.every(o=>o._zod.pattern)){let o=n.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>we(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,c=[];for(let u of t.options){let a=u._zod.run({value:n.value,issues:[]},o);if(a instanceof Promise)c.push(a),i=!0;else{if(a.issues.length===0)return a;c.push(a)}}return i?Promise.all(c).then(u=>of(u,n,e,o)):of(c,n,e,o)}});function sf(e,t,r,n){let o=[];for(let i=0;i<e.length;i++)e[i].issues.length===0&&o.push(i);return o.length===1?(t.value=e[o[0]].value,t):(o.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(c=>te(c,n,F())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1,matches:o}),t)}s(sf,"handleExclusiveUnionResults");var pc=d("$ZodXor",(e,t)=>{dr.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,c=[];for(let u of t.options){let a=u._zod.run({value:n.value,issues:[]},o);a instanceof Promise?(c.push(a),i=!0):c.push(a)}return i?Promise.all(c).then(u=>sf(u,n,e,o)):sf(c,n,e,o)}});function dc(e,t){let r=e._zod,n=r.bag.optionsMap;n||(n=kf(r.def),r.bag.optionsMap=n);let o=n.get(t);if(o===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return o}s(dc,"getDiscriminatedOption");function kf(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||n.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let o of n)if(t.has(o)){if(o!==void 0)throw new Error(`Duplicate discriminator value "${String(o)}"`);t.set(o,null)}else t.set(o,r)}return t}s(kf,"discriminatorMap");var mc=d("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,dr.init(e,t);let r=e._zod.parse;A(e,"propValues",o=>{let i={},c=0;for(let u of o.def.options){let a=u._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(u)}"`);a[o.def.discriminator]?.has(void 0)&&c++;for(let[l,f]of Object.entries(a)){Object.prototype.hasOwnProperty.call(i,l)||J(i,l,new Set);for(let p of f)i[l].add(p)}}return!o.def.unionFallback&&c>1&&i[o.def.discriminator]?.delete(void 0),i}),t.options.forEach((o,i)=>{let c=ct(o._zod.def);if(c&&!Object.prototype.hasOwnProperty.call(c,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});let n=st(()=>kf(t));e._zod.parse=(o,i)=>{let c=o.value;if(!Le(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;let u=c?.[t.discriminator],a=n.value.get(u);return a&&(u!==void 0||i.direction!=="backward")?a._zod.run(o,i):t.unionFallback||i.direction==="backward"?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter(l=>n.value.get(l)!==null),input:c,path:[t.discriminator],inst:e}),o)}}),hc=d("$ZodIntersection",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),c=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||c instanceof Promise?Promise.all([i,c]).then(([a,l])=>cf(r,a,l)):cf(r,i,c)}});function mt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ue(e)&&ue(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let c=mt(e[i],t[i]);if(!c.valid)return{valid:!1,mergeErrorPath:[i,...c.mergeErrorPath]};o[i]=c.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],c=mt(o,i);if(!c.valid)return{valid:!1,mergeErrorPath:[n,...c.mergeErrorPath]};r.push(c.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}s(mt,"mergeValues");function cf(e,t,r){let n=new Map,o,i=new Map,c=s((l,f)=>{let p;if(l.code==="unrecognized_keys"&&!l.path?.length)o??(o=l),p=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let m=String(l.path[0]);i.has(m)||i.set(m,l),p=[m]}else return!1;for(let m of p)n.has(m)||n.set(m,{}),n.get(m)[f]=!0;return!0},"collect");for(let l of t.issues)c(l,"l")||e.issues.push(l);for(let l of r.issues)c(l,"r")||e.issues.push(l);let u=[...n].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(u.length){let l=o?u.filter(f=>o.keys.includes(f)):[];l.length&&e.issues.push({...o,keys:l});for(let f of u)!l.includes(f)&&i.has(f)&&e.issues.push(i.get(f))}let a=mt(t.value,r.value);if(!a.valid){if(H(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}s(cf,"handleIntersectionResults");var Zn=d("$ZodTuple",(e,t)=>{P.init(e,t);let r=t.items,n=B.memoizer;n?.attach(e),e._zod.parse=(o,i)=>{let c=o.value;if(!Array.isArray(c))return o.issues.push({input:c,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=n?n.alloc(e,o,[],i):[];let u=[],a=uf(r,"optin"),l=uf(r,"optout");if(!t.rest){if(c.length<a)return o.issues.push({code:"too_small",minimum:a,inclusive:!0,input:c,inst:e,origin:"array"}),o;c.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:c,inst:e,origin:"array"})}let f=new Array(r.length),p=t.rest?i?.abortEarly:void 0,m=!1;for(let h=0;h<r.length;h++){let g=r[h]._zod.run({value:c[h],issues:[]},i);g instanceof Promise?u.push(g.then(_=>{f[h]=_})):(f[h]=g,p&&!m&&g.issues.length&&(m=H(g)))}if(t.rest&&!m){let h=r.length-1,g=c.slice(r.length),_=o.issues.length;for(let w of g){if(p&&o.issues.length!==_){if(H(o,_))break;_=o.issues.length}h++;let z=t.rest._zod.run({value:w,issues:[]},i);z instanceof Promise?u.push(z.then(x=>af(x,o,h))):af(z,o,h)}}return u.length?Promise.all(u).then(()=>lf(f,o,r,c,l)):lf(f,o,r,c,l)}});function uf(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}s(uf,"getTupleOptStart");function af(e,t,r){e.issues.length&&t.issues.push(...ee(r,e.issues)),t.value[r]=e.value}s(af,"handleTupleResult");function lf(e,t,r,n,o){for(let i=0;i<r.length;i++){let c=e[i],u=i<n.length;if(!u&&i>=o&&r[i]._zod.optin==="optional"){t.value.length=i;break}if(c.issues.length){if(!u&&i>=o){t.value.length=i;break}t.issues.push(...ee(i,c.issues))}t.value[i]=c.value}for(let i=t.value.length-1;i>=n.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}s(lf,"handleTupleResults");var gc=d("$ZodRecord",(e,t)=>{P.init(e,t);let r=B.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!ue(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let c=[],u=t.keyType._zod.values;if(u&&!t.partial){n.value=r?r.alloc(e,n,{},o):{};let a=new Set;for(let f of u)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){if(a.add(typeof f=="number"?f.toString():f),f==="__proto__")continue;let p=t.keyType._zod.run({value:f,issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(g=>te(g,o,F())),input:f,path:[f],inst:e});continue}let m=p.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:i[f],issues:[]},o);h instanceof Promise?c.push(h.then(g=>{g.issues.length&&n.issues.push(...ee(f,g.issues)),n.value[m]=g.value})):(h.issues.length&&n.issues.push(...ee(f,h.issues)),n.value[m]=h.value)}let l;for(let f in i)if(!a.has(f))if(t.mode==="loose"){if(f==="__proto__")continue;n.value[f]=i[f]}else l=l??[],l.push(f);l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l,continue:!0})}else{n.value=r?r.alloc(e,n,{},o):{};let a;for(let l of Reflect.ownKeys(i)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,l))continue;let f=t.keyType._zod.run({value:l,issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&be.test(l)&&f.issues.length){let g=t.keyType._zod.run({value:Number(l),issues:[]},o);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(f=g)}if(f.issues.length){t.mode==="loose"?n.value[l]=i[l]:u?(a=a??[],a.push(l)):n.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(g=>te(g,o,F())),input:l,path:[l],inst:e});continue}let m=f.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:i[l],issues:[]},o);h instanceof Promise?c.push(h.then(g=>{g.issues.length&&n.issues.push(...ee(l,g.issues)),n.value[m]=g.value})):(h.issues.length&&n.issues.push(...ee(l,h.issues)),n.value[m]=h.value)}a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:a,continue:!0})}return c.length?Promise.all(c).then(()=>n):n}}),yc=d("$ZodMap",(e,t)=>{P.init(e,t);let r=B.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),n;let c=[];n.value=r?r.alloc(e,n,new Map,o):new Map;let u=o?.abortEarly,a=n.issues.length;for(let[l,f]of i){if(u&&n.issues.length!==a){if(H(n,a))break;a=n.issues.length}let p=t.keyType._zod.run({value:l,issues:[]},o),m=t.valueType._zod.run({value:f,issues:[]},o);p instanceof Promise||m instanceof Promise?c.push(Promise.all([p,m]).then(([h,g])=>{ff(h,g,n,l,i,e,o)})):ff(p,m,n,l,i,e,o)}return c.length?Promise.all(c).then(()=>n):n}});function ff(e,t,r,n,o,i,c){e.issues.length&&(Wt.has(typeof n)?r.issues.push(...ee(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:o,inst:i,issues:e.issues.map(u=>te(u,c,F()))})),t.issues.length&&(Wt.has(typeof n)?r.issues.push(...ee(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:i,key:n,issues:t.issues.map(u=>te(u,c,F()))})),r.value.set(e.value,t.value)}s(ff,"handleMapResult");var _c=d("$ZodSet",(e,t)=>{P.init(e,t);let r=B.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),n;let c=[];n.value=r?r.alloc(e,n,new Set,o):new Set;let u=o?.abortEarly,a=n.issues.length;for(let l of i){if(u&&n.issues.length!==a){if(H(n,a))break;a=n.issues.length}let f=t.valueType._zod.run({value:l,issues:[]},o);f instanceof Promise?c.push(f.then(p=>pf(p,n))):pf(f,n)}return c.length?Promise.all(c).then(()=>n):n}});function pf(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}s(pf,"handleSetResult");var $c=d("$ZodEnum",(e,t)=>{P.init(e,t);let r=ot(t.entries),n=new Set(r);e._zod.values=n,A(e,"pattern",o=>{let i=ot(o.def.entries).filter(c=>Wt.has(typeof c));return new RegExp(i.length?`^(${i.map(c=>ae(c.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),wc=d("$ZodLiteral",(e,t)=>{P.init(e,t);let r=new Set(t.values);e._zod.values=r,A(e,"pattern",n=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?ae(i):i?ae(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),bc=d("$ZodFile",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),r}}),vc=d("$ZodTransform",(e,t)=>{P.init(e,t),e._zod.optin="optional",B.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ie(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new re;return r.value=o,r}});function df(e,t){return e.value=t.issues.length?void 0:t.value,e}s(df,"handleOptionalResult");var Nn=d("$ZodOptional",(e,t)=>{P.init(e,t),A(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",A(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),A(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${we(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>df(r,i)):df(r,o)}return t.innerType._zod.run(r,n)}}),xc=d("$ZodExactOptional",(e,t)=>{Nn.init(e,t),A(e,"values",r=>r.def.innerType._zod.values),A(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),kc=d("$ZodNullable",(e,t)=>{P.init(e,t),A(e,"optin",r=>r.def.innerType._zod.optin),A(e,"optout",r=>r.def.innerType._zod.optout),A(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${we(n.source)}|null)$`):void 0}),A(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),zc=d("$ZodDefault",(e,t)=>{P.init(e,t),e._zod.optin="defaulted",A(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>mf(i,t)):mf(o,t)}});function mf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}s(mf,"handleDefaultResult");var Sc=d("$ZodPrefault",(e,t)=>{P.init(e,t),e._zod.optin="defaulted",A(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Pc=d("$ZodNonOptional",(e,t)=>{P.init(e,t),A(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>hf(i,e)):hf(o,e)}});function hf(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}s(hf,"handleNonOptionalResult");var Ic=d("$ZodSuccess",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ie("ZodSuccess");let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.issues.length===0,r)):(r.value=o.issues.length===0,r)}});function gf(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>te(o,n,F()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}s(gf,"handleCatchResult");var Oc=d("$ZodCatch",(e,t)=>{P.init(e,t),A(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),A(e,"optout",r=>r.def.innerType._zod.optout),A(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>gf(r,i,t,n)):gf(r,o,t,n)}}),Ac=d("$ZodNaN",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),En=d("$ZodPipe",(e,t)=>{P.init(e,t),A(e,"values",r=>r.def.in._zod.values),A(e,"optin",r=>r.def.in._zod.optin),A(e,"optout",r=>r.def.out._zod.optout),A(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(c=>hn(c,t.in,n)):hn(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>hn(i,t.out,n)):hn(o,t.out,n)}});function hn(e,t,r){return e.issues.some(n=>n.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}s(hn,"handlePipeResult");var mr=d("$ZodCodec",(e,t)=>{P.init(e,t),A(e,"values",r=>r.def.in._zod.values),A(e,"optin",r=>r.def.in._zod.optin),A(e,"optout",r=>r.def.out._zod.optout),A(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(c=>gn(c,t,n)):gn(i,t,n)}else{let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(c=>gn(c,t,n)):gn(i,t,n)}}});function gn(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let o=t.transform(e.value,e);return o instanceof Promise?o.then(i=>yn(e,i,t.out,r)):yn(e,o,t.out,r)}else{let o=t.reverseTransform(e.value,e);return o instanceof Promise?o.then(i=>yn(e,i,t.in,r)):yn(e,o,t.in,r)}}s(gn,"handleCodecAResult");function yn(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}s(yn,"handleCodecTxResult");var Zc=d("$ZodPreprocess",(e,t)=>{En.init(e,t)}),Nc=d("$ZodReadonly",(e,t)=>{P.init(e,t),A(e,"propValues",r=>r.def.innerType._zod.propValues),A(e,"values",r=>r.def.innerType._zod.values),A(e,"optin",r=>r.def.innerType?._zod?.optin),A(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(yf):yf(o)}});function yf(e){return e.memo||(e.value=Object.freeze(e.value)),e}s(yf,"handleReadonlyResult");function bg(e){let t=e._zod.def,r=t.pattern,n=!!t.format?.includes("int"),o,i;for(let u of t.checks??[]){let a=u._zod.def;a.pattern&&(r=a.pattern),n||(n=!!a.format?.includes("int"));let l=a.minimum??a.length,f=a.maximum??a.length;l!==void 0&&(o===void 0||l>o)&&(o=l),f!==void 0&&(i===void 0||f<i)&&(i=f)}if(r)return r.source;if(o!==void 0&&i!==void 0&&o>i)return"(?!)";if(o!==void 0||i!==void 0)return qi({minimum:o,maximum:i}).source;let c=e._zod.pattern;return(n&&c===be?or:c)?.source}s(bg,"leafPattern");function ks(e){let t=e._zod.def,r=e._zod.pattern?.source,n=t.innerType??e._zod.innerType;if(n){let o=n._zod.pattern?.source,i=ks(n);return r&&o&&i&&i!==o?r.replace(we(o),()=>we(i)):r}if(t.options){let o=t.options.map(ks);if(o.every(Boolean))return`^(${o.map(i=>we(i)).join("|")})$`}return bg(e)}s(ks,"partPattern");var Ec=d("$ZodTemplateLiteral",(e,t)=>{P.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){let o=ks(n);if(!o)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);r.push(we(o))}else if(n===null||ci.has(typeof n))r.push(ae(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)}),Cc=d("$ZodFunction",(e,t)=>(P.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...n){let o=e._def.input?Yr(e._def.input,n):n,i=Reflect.apply(r,this,o);return e._def.output?Yr(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...n){let o=e._def.input?await Qr(e._def.input,n):n,i=await Reflect.apply(r,this,o);return e._def.output?await Qr(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let n=e.constructor;return Array.isArray(r[0])?new n({type:"function",input:new Zn({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new n({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let n=e.constructor;return new n({type:"function",input:e._def.input,output:r})},e)),Tc=d("$ZodPromise",(e,t)=>{P.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>t.innerType._zod.run({value:o,issues:[]},n))}),hr=d("$ZodLazy",(e,t)=>{P.init(e,t),oi(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),A(e,"pattern",r=>r.innerType?._zod?.pattern),A(e,"propValues",r=>r.innerType?._zod?.propValues),A(e,"optin",r=>r.innerType?._zod?.optin??void 0),A(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),Dc=d("$ZodCustom",(e,t)=>{j.init(e,t),P.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>_f(i,r,n,e));_f(o,r,n,e)}});function _f(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(ut(o))}}s(_f,"handleRefineResult");var Rn=class extends Error{static{s(this,"$ZodCyclicError")}constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},jc="~memo",Sf=[];function Pf(e){return e!==null&&typeof e=="object"}s(Pf,"isRef");function Rc(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}s(Rc,"cloneIssues");var If=new WeakMap,ht=0,Dn=1,gr=2;function yr(e,t,r){let n=If.get(e);if(n!==void 0)return n?gr:ht;if(t.has(e))return gr;t.add(e);let o=ht,i=s(f=>{if(o!==gr&&f?._zod){let p=yr(f,t,r);p>o&&(o=p)}},"check"),c=s((f,p)=>{let m=ht;for(let h of Reflect.ownKeys(f)){let g=Object.getOwnPropertyDescriptor(f,h);if(p&&!g.enumerable)continue;let _=g.get?Dn:g.value?._zod?yr(g.value,t,r):ht;_>m&&(m=_)}return m},"shape"),u=s(f=>{f>o&&(o=f)},"merge"),a=e._zod.def,l=a.type;switch(l){case"object":{let f=ct(a);u(f?c(f,!0):Dn),i(a.catchall);break}case"array":i(a.element);break;case"tuple":for(let f of a.items)i(f);i(a.rest);break;case"record":case"map":i(a.keyType),i(a.valueType);break;case"set":i(a.valueType);break;case"union":for(let f of a.options)i(f);break;case"intersection":i(a.left),i(a.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(a.innerType);break;case"pipe":i(a.in),i(a.out);break;case"function":i(a.input),i(a.output);break;case"lazy":{let f=a._cachedInner??(r?e._zod.innerType:void 0);u(f?yr(f,t,!1):Dn);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 f in a){let p=Object.getOwnPropertyDescriptor(a,f);if(!p||p.get)continue;let m=p.value;if(!(!m||typeof m!="object")){if(m._zod)i(m);else if(Array.isArray(m))for(let h of m)i(h)}}}return t.delete(e),vg(e,o)}s(yr,"isRecursive");function vg(e,t){return t!==Dn&&If.set(e,t===gr),t}s(vg,"settle");function jn(e){return yr(e,new Set,!0)!==ht}s(jn,"isRecursiveSchema");function xg(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}s(xg,"bucketFor");var Cn,Tn=[],kg={alloc(e,t,r){let n=Cn;if(!n)return r;Cn=void 0;let o={value:r,issues:null};return n.set(t.value,o),Tn.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=s((o,i)=>{if(i.direction!=="backward"&&Ln(i,o.value))throw new Rn;return r(o,i)},"wrapped");e._zod.parse=n,e._zod.run===r&&(e._zod.run=n)})},attach(e){var t;let r,n=!1,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let c=e._zod.parse,u=s((a,l)=>{if(r===void 0){let z=yr(e,new Set,!1);if(z===ht)return e._zod.parse=c,e._zod.run===u&&(e._zod.run=c),c(a,l);z===gr||n?r=!0:n=!0}let f=a.value;if(!Pf(f))return c(a,l);let p=l[jc];p||(p={buckets:new WeakMap,backEdges:void 0},l[jc]=p);let m;o===l?m=i:(m=xg(p,e),o=l,i=m);let h=m.get(f);if(h)return a.value=h.value,h.issues?h.issues.length&&a.issues.push(...Rc(h.issues)):(a.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(h.value)),a;Cn=m;let g=Tn.length,_=c(a,l);Cn=void 0;let w=Tn.length>g?Tn.pop():void 0;return _ instanceof Promise?_.then(z=>(w&&(w.issues=z.issues.length?Rc(z.issues):Sf),z)):(w&&(w.issues=_.issues.length?Rc(_.issues):Sf),_)},"wrapped");e._zod.parse=u,e._zod.run===c&&(e._zod.run=u)})}};function _r(){return kg}s(_r,"memoizer");function Ln(e,t){let r=e[jc]?.backEdges;return r!==void 0&&Pf(t)&&r.has(t)}s(Ln,"isBackEdge");var wr={};_e(wr,{en:()=>$r});var zg=s(()=>{let e={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"}};function t(i){return e[i]??null}s(t,"getSizing");let 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 o(i,c){return i==="number"&&typeof c=="number"&&!Number.isFinite(c)?String(c):n[i]??i}return s(o,"getTypeName"),i=>{switch(i.code){case"invalid_type":{let c=o(i.expected),u=li(i.input),a=o(u,i.input);return`Invalid input: expected ${c}, received ${a}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${Wr(i.values[0])}`:`Invalid option: expected one of ${Br(i.values,"|")}`;case"too_big":{let c=i.exact?"exactly ":i.inclusive?"<=":"<",u=t(i.origin);return u?`Too big: expected ${i.origin??"value"} to have ${c}${i.maximum.toString()} ${u.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${c}${i.maximum.toString()}`}case"too_small":{let c=i.exact?"exactly ":i.inclusive?">=":">",u=t(i.origin);return u?`Too small: expected ${i.origin} to have ${c}${i.minimum.toString()} ${u.unit}`:`Too small: expected ${i.origin} to be ${c}${i.minimum.toString()}`}case"invalid_format":{let c=i;return c.format==="starts_with"?`Invalid string: must start with "${c.prefix}"`:c.format==="ends_with"?`Invalid string: must end with "${c.suffix}"`:c.format==="includes"?`Invalid string: must include "${c.includes}"`:c.format==="regex"?`Invalid string: must match pattern ${c.pattern}`:`Invalid ${r[c.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${Br(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(u=>`'${u}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}},"error");function $r(){return{localeError:zg()}}s($r,"default");var Of,Lc=Symbol("ZodOutput"),Vc=Symbol("ZodInput"),Vn=class{static{s(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"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&&typeof r=="object"&&"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 o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Fn(){return new Vn}s(Fn,"registry");(Of=globalThis).__zod_globalRegistry??(Of.__zod_globalRegistry=Fn());var K=globalThis.__zod_globalRegistry;var X=Symbol.for("zod.compile.invalid"),Af=Symbol.for("zod.compile.fallback"),pe=class extends Error{static{s(this,"ZodCompileAsyncError")}constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},Z=class extends Error{static{s(this,"ZodCompileUnsupportedError")}constructor(t,r=!0){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=r}};function Pg(e,t){try{return Un(e,{assertOnly:!0})}catch{return t}}s(Pg,"compileValidator");function Bc(e,t){try{let r=Un(e),n=Mn(e,r);return n._zod.bag.validator=Pg(e,r),n}catch(r){if(t?.strict)throw r;return e}}s(Bc,"compile");function Mn(e,t){if(jn(e))throw new Z("a schema whose subtree contains a reference cycle");let r=C(e),n=e._zod.run,o=n.__originalRun??n,i=s((c,u)=>{if(u?.async||u?.direction==="backward"||u?.skipChecks||u?.[Af]||u&&Ln(u,c.value))return o(c,u);let a=t(c.value);return a!==X?(c.value=a,c):(u&&(u[Af]=!0),o(c,u))},"wrapped");return i.__originalRun=o,r._zod.bag.fallbackRun=o,r._zod.bag.validator=t,r._zod.run=i,n.__originalRun||Ig(r,e,t),r}s(Mn,"withParser");function Ig(e,t,r){let n=e,o=t;if(typeof o.safeParse=="function"){let i=o.safeParse;n.safeParse=(c,u)=>{let a=r(c);return a!==X?{success:!0,data:a}:i(c,u)}}if(typeof o.parse=="function"){let i=o.parse;n.parse=(c,u)=>{let a=r(c);return a!==X?a:i(c,u)}}}s(Ig,"installCompiledUserMethods");function Un(e,t){let r=!0;try{r=jn(e)}catch{}if(r)throw new Z("a schema whose subtree contains a reference cycle");let n={constants:new Map,constantCounter:0,varCounter:0,definite:!0},o=new Me(["input"]),i=V(o,n,e,"input",!t?.assertOnly);o.write(i===null?"return true;":`return ${i};`);let c=["INVALID",...n.constants.keys()],u=[X,...n.constants.values()],a=o.content.join(`
|
|
63
63
|
`),l=t?.debug?c.length>0?`// Constants: ${c.join(", ")}
|
|
64
64
|
${a}`:a:"",f=Function,p=`return (input) => {
|
|
65
65
|
${a}
|
|
66
|
-
}`,m;try{m=new f(...c,p)(...u)}catch(h){throw new Z(`this schema (generated code failed to evaluate: ${h.message})`)}return t?.debug&&(m.code=l),m.definite=n.definite,m}s(Un,"compileFn");function S(e,t){for(let[n,o]of e.constants)if(o===t)return n;let r=`c${e.constantCounter++}`;return e.constants.set(r,t),r}s(S,"addConstant");function Je(e,t){return e.definite=!1,S(e,t)}s(Je,"addUserConstant");function k(e){return`v${e.varCounter++}`}s(k,"newVar");function Ig(e,t){let r=e._zod.run({value:t,issues:[]},{});if(r&&typeof r.then=="function")return X;let n=r;return n.issues.length===0?n.value:X}s(Ig,"runtimeRun");function q(e,t,r,n,o=!0){let i=e.content.length,c=t.constants.size,u=t.constantCounter,a=t.varCounter;try{return V(e,t,r,n,o)}catch(l){if(!(l instanceof Z)||!l.islandable)throw l;if(e.content.length=i,t.constants.size>c){let f=Array.from(t.constants.keys()).slice(c);for(let p of f)t.constants.delete(p)}return t.constantCounter=u,t.varCounter=a,Og(e,t,r,n)}}s(q,"compileChild");function Og(e,t,r,n){t.definite=!1;let o=S(t,r),i=S(t,Ig),c=k(t);return e.write(`const ${c} = ${i}(${o}, ${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}s(Og,"emitRuntimeIsland");var Ag=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function Zg(e,t,r,n){let o=r._zod.def.checks;if(!o||o.length===0)return n;let i=n;for(let c of o){let u=c._zod.def;if(u.when&&!Ag.has(u.check))throw new Z('check with a custom "when" condition');switch(u.check){case"greater_than":Ng(e,t,u,i);break;case"less_than":Eg(e,t,u,i);break;case"multiple_of":Cg(e,t,u,i);break;case"number_format":Df(e,u,i);break;case"min_length":{let a=Ue(u.minimum,"min_length"),l=Vc(e,t,i,`${i}.length >= ${a} && ${i}.length < ${u.minimum*2}`);e.write(`if (${l} < ${a}) return INVALID;`);break}case"max_length":{let a=Ue(u.maximum,"max_length"),l=Vc(e,t,i,`${i}.length > ${a}`);e.write(`if (${l} > ${a}) return INVALID;`);break}case"length_equals":{let a=Ue(u.length,"length_equals"),l=Vc(e,t,i,`${i}.length >= ${a} && ${i}.length <= ${u.length*2}`);e.write(`if (${l} !== ${a}) return INVALID;`);break}case"min_size":e.write(`if (${i}.size < ${Ue(u.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${i}.size > ${Ue(u.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${i}.size !== ${Ue(u.size,"size_equals")}) return INVALID;`);break;case"string_format":i=Rf(e,t,u,i);break;case"custom":i=Vg(e,t,c,i);break;case"bigint_format":Tg(e,u,i);break;case"mime_type":Dg(e,t,u,i);break;case"property":jg(e,t,u,i);break;case"properties":Rg(e,t,u,i);break;case"overwrite":{let a=k(t);Lg(e,t,c,i,a),i=a;break}default:throw new Z(`check type ${u.check}`)}}return i}s(Zg,"generateChecks");function Vc(e,t,r,n){let o=S(t,Le),i=k(t);return e.write(`const ${i} = typeof ${r} === "string" && ${n} ? ${o}(${r}) : ${r}.length;`),i}s(Vc,"codePointLengthVar");function Ue(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new Z(`${t} bound of type ${typeof e}`);return`${e}`}s(Ue,"numericOperand");function Tf(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new Z("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new Z("comparison check with Invalid Date bound");return S(e,t)}throw new Z(`comparison check bound of type ${typeof t}`)}s(Tf,"comparisonOperand");function Ng(e,t,r,n){let o=r.inclusive?"<":"<=";e.write(`if (${n} ${o} ${Tf(t,r.value)}) return INVALID;`)}s(Ng,"generateGreaterThanCheck");function Eg(e,t,r,n){let o=r.inclusive?">":">=";e.write(`if (${n} ${o} ${Tf(t,r.value)}) return INVALID;`)}s(Eg,"generateLessThanCheck");function Cg(e,t,r,n){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new Z("multiple_of check with a zero divisor");e.write(`if (${n} % ${r.value}n !== 0n) return INVALID;`)}else{let o=S(t,Jt);e.write(`if (${o}(${n}, ${Ue(r.value,"multiple_of")}) !== 0) return INVALID;`)}}s(Cg,"generateMultipleOfCheck");function Df(e,t,r){let n=t.format;switch(n){case"safeint":e.write(`if (!Number.isSafeInteger(${r})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${r}) || ${r} < -2147483648 || ${r} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${r}) || ${r} < 0 || ${r} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${r}) || ${r} < -3.4028234663852886e38 || ${r} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${r})) return INVALID;`);break;default:throw new Z(`number format ${n}`)}}s(Df,"generateNumberFormatCheck");function Tg(e,t,r){let n=t.format;if(n)switch(n){case"int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break;default:throw new Z(`bigint format ${n}`)}}s(Tg,"generateBigIntFormatCheck");function Dg(e,t,r,n){let o=r.mime;if(o&&o.length>0){let i=S(t,new Set(o));e.write(`if (!${i}.has(${n}.type)) return INVALID;`)}}s(Dg,"generateMimeTypeCheck");function Rg(e,t,r,n){if(r.when)throw new Z('check with a custom "when" condition');e.write(`if (${n} == null) return INVALID;`);let o=r.shape;for(let i of Reflect.ownKeys(o)){let c=typeof i=="symbol"?S(t,i):G(i),u=k(t);e.write(`const ${u} = ${n}[${c}];`),q(e,t,o[i],u,!1)}}s(Rg,"generatePropertiesChecks");function jg(e,t,r,n){let o=`${n}[${JSON.stringify(r.property)}]`;V(e,t,r.schema,o)}s(jg,"generatePropertyCheck");function Lg(e,t,r,n,o){let i=r._zod.def.tx;if(!i)throw new Z("overwrite check without a transform function");if(Ke(i))throw new pe("z.compile: async overwrite transforms are not supported");let c=S(t,i);e.write(`const ${o} = ${c}(${n});`)}s(Lg,"generateOverwriteCheck");function Fc(){throw new re}s(Fc,"throwAsync");function Bc(e){this.issues.push(e)}s(Bc,"pushIssue");function Vg(e,t,r,n){let o=r._zod.def;if(o.fn){if(Ke(o.fn))throw new pe("z.compile: async .refine() predicates are not supported");let i=Je(t,o.fn),c=S(t,Fc),u=k(t);return e.write(`const ${u} = ${i}(${n});`),e.write(`if (${u} instanceof Promise) ${c}();`),e.write(`if (!${u}) return INVALID;`),n}if(r._zod.check){if(Ke(r._zod.check))throw new pe("z.compile: async .superRefine() / check functions are not supported");let i=r._zod.check,u=Je(t,s(l=>{let f={value:l,issues:[],addIssue:Bc};return i(f)instanceof Promise&&Fc(),f.issues.length===0?f.value:X},"helperFn")),a=k(t);return e.write(`const ${a} = ${u}(${n});`),e.write(`if (${a} === INVALID) return INVALID;`),a}throw new Z("custom check without a predicate or check function")}s(Vg,"generateCustomRefineCheck");var Fg=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function Rf(e,t,r,n,o=!0){let i=r.format;if(i==="base64"){let l=S(t,lr);return e.write(`if (!${l}(${n})) return INVALID;`),n}if(i==="base64url"){let l=S(t,zn);return e.write(`if (!${l}(${n})) return INVALID;`),n}if(i==="jwt"){let l=S(t,In),f=S(t,r.alg??null);return e.write(`if (!${l}(${n}, ${f})) return INVALID;`),n}if(i==="ipv6"){let l=S(t,ar);return e.write(`if (!${l}(${n})) return INVALID;`),n}if(i==="cidrv6"){let l=S(t,xn);return e.write(`if (!${l}(${n})) return INVALID;`),n}if(i==="credit_card"){let l=S(t,Sn);return e.write(`if (!${l}(${n})) return INVALID;`),n}if(i==="iban"){let l=S(t,Pn);return e.write(`if (!${l}(${n})) return INVALID;`),n}let c=r;if(i==="url"||i==="httpurl"||c.normalize||c.hostname!==void 0||c.protocol!==void 0){let l=S(t,wn),f=S(t,r),p=k(t),m=k(t);if(e.write(`const ${p} = ${n}.trim();`),e.write(`const ${m} = ${l}(${p}, ${f});`),e.write(`if (typeof ${m} === "number") return INVALID;`),c.hostname!==void 0){let _=S(t,bn);e.write(`if (!${_}(${m}, ${f}.hostname)) return INVALID;`)}if(c.protocol!==void 0){let _=S(t,vn);e.write(`if (!${_}(${m}, ${f}.protocol)) return INVALID;`)}if(!o)return null;let h=k(t),g=c.normalize?`${m}.href`:`${S(t,ur)}(${p})`;return e.write(`const ${h} = ${g};`),h}let u=r.fn;if(u){if(Ke(u))throw new Z(`async string format ${i}`);let l=S(t,u);return e.write(`if (!${l}(${n})) return INVALID;`),n}if(Fg.has(i)&&r.pattern){let l=S(t,r.pattern);return e.write(`${l}.lastIndex = 0;`),e.write(`if (!${l}.test(${n})) return INVALID;`),n}let a=r.format;switch(a){case"regex":throw new Z("regex format without a pattern");case"lowercase":e.write(`if (${n} !== ${n}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${n} !== ${n}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${n}.includes(${G(r.includes)})) return INVALID;`);break;case"starts_with":{let l=r.prefix;e.write(`if (${n}.slice(0, ${l.length}) !== ${G(l)}) return INVALID;`);break}case"ends_with":{let l=r.suffix;e.write(`if (${n}.slice(-${l.length}) !== ${G(l)}) return INVALID;`);break}default:throw new Z(`string format ${a}`)}return n}s(Rf,"generateStringFormatCheck");function V(e,t,r,n,o=!0){let i=r._zod.def,c=i.type;if(i.coerce)throw new Z(`coercion (z.coerce.${c}())`);let u=o||!!i.checks?.length,a;switch(c){case"string":a=Mg(e,t,r,n,u);break;case"number":a=Ug(e,r,n);break;case"boolean":a=Bg(e,n);break;case"bigint":a=Jg(e,r,n);break;case"symbol":a=Kg(e,n);break;case"undefined":a=Wg(e,n);break;case"null":a=qg(e,n);break;case"any":case"unknown":a=n;break;case"never":e.write("return INVALID;"),a=n;break;case"void":a=Gg(e,n);break;case"nan":a=Hg(e,n);break;case"date":a=Xg(e,n);break;case"object":a=Yg(e,t,r,n,u);break;case"optional":a=Qg(e,t,r,n,u);break;case"nullable":a=ry(e,t,r,n,u);break;case"array":a=ny(e,t,r,n,u);break;case"literal":a=oy(e,t,r,n);break;case"enum":a=iy(e,t,r,n);break;case"readonly":{let l=Nf(e,t,r,n),f=k(t);e.write(`const ${f} = Object.freeze(${l});`),a=f;break}case"success":Nf(e,t,r,n),a="true";break;case"default":case"prefault":a=sy(e,t,r,n);break;case"nonoptional":a=cy(e,t,r,n);break;case"tuple":a=uy(e,t,r,n);break;case"union":a=ay(e,t,r,n);break;case"intersection":a=py(e,t,r,n);break;case"record":a=dy(e,t,r,n);break;case"map":a=hy(e,t,r,n);break;case"set":a=gy(e,t,r,n);break;case"file":a=yy(e,n);break;case"template_literal":a=_y(e,t,r,n);break;case"lazy":a=$y(e,t,r,n);break;case"pipe":a=wy(e,t,r,n);break;case"custom":a=by(e,t,r,n);break;case"transform":a=ky(e,t,r,n);break;case"catch":a=xy(e,t,r,n);break;default:throw new Z(`schema type ${c}`)}return a===null?null:Zg(e,t,r,a)}s(V,"generateCheck");function Mg(e,t,r,n,o=!0){e.write(`if (typeof ${n} !== "string") return INVALID;`);let i=r._zod.def;return i.format===void 0?n:Rf(e,t,i,n,o)}s(Mg,"generateStringCheck");function Ug(e,t,r){e.write(`if (typeof ${r} !== "number" || !Number.isFinite(${r})) return INVALID;`);let n=t._zod.def;return n.check==="number_format"&&n.format&&Df(e,{format:n.format},r),r}s(Ug,"generateNumberCheck");function Bg(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}s(Bg,"generateBooleanCheck");function Jg(e,t,r){e.write(`if (typeof ${r} !== "bigint") return INVALID;`);let n=t._zod.def;if(n.format)switch(n.format){case"int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break}return r}s(Jg,"generateBigIntCheck");function Kg(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}s(Kg,"generateSymbolCheck");function Wg(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}s(Wg,"generateUndefinedCheck");function qg(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}s(qg,"generateNullCheck");function Gg(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}s(Gg,"generateVoidCheck");function Hg(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}s(Hg,"generateNaNCheck");function Xg(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}s(Xg,"generateDateCheck");function Yg(e,t,r,n,o=!0){let i=r._zod.def;e.write(`if (typeof ${n} !== "object" || ${n} === null || Array.isArray(${n})) return INVALID;`);let c=i.shape,u=Object.keys(c),a=Object.getOwnPropertySymbols(c),l=a.length?[...u,...a]:u,f=s(x=>typeof x=="symbol"?S(t,x):G(x),"keyExpr"),p=s(x=>typeof x=="symbol"?`[${f(x)}]`:G(x),"propKey"),m=c;if(u.includes("__proto__"))throw new Z('object shape key "__proto__"');let h=new Map;for(let x of l){let I=m[x],E=f(x),L=k(t);if(e.write(`const ${L} = ${n}[${E}];`),I._zod.optin!==void 0){let N=k(t);e.write(`let ${N} = (() => {`),e.indented(W=>{let Ut=q(W,t,I,L);W.write(`return ${Ut};`)}),e.write("})();"),I._zod.optout==="optional"?(e.write(`if (${N} === INVALID) {`),e.indented(W=>{W.write(`if (${E} in ${n}) return INVALID;`),W.write(`${N} = undefined;`)}),e.write("}")):e.write(`if (${N} === INVALID) return INVALID;`),h.set(x,N)}else{ty(I)&&e.write(`if (!(${E} in ${n})) return INVALID;`);let N=q(e,t,I,L,o);N!==null&&h.set(x,N)}}let g=i.catchall,_="none";if(g){let x=g._zod.def.type;if(x==="never"){let I=u.map(E=>`k !== ${G(E)}`).join(" && ")||"true";e.write(`for (const k in ${n}) {`),e.indented(E=>{E.write(`if (${I}) return INVALID;`)}),e.write("}")}else(x==="unknown"||x==="any")&&!g._zod.def.checks?.length?_="passthrough":_="schema"}let w=k(t),z=l.some(x=>Zf(m[x])||Mc(m[x]));if(!o){if(_==="schema"){let x=u.length>0?S(t,new Set(u)):null;e.write(`for (const k in ${n}) {`),e.indented(I=>{I.write('if (k === "__proto__") continue;'),x&&I.write(`if (${x}.has(k)) continue;`);let E=k(t);I.write(`const ${E} = ${n}[k];`),q(I,t,g,E,!1)}),e.write("}")}return null}if(z){e.write(`const ${w} = {};`);for(let x of l){let I=f(x),E=h.get(x);Mc(m[x])?e.write(`if (${I} in ${n}) ${w}[${I}] = ${E};`):Zf(m[x])?e.write(`if (${E} !== undefined || ${I} in ${n}) ${w}[${I}] = ${E};`):e.write(`${w}[${I}] = ${E};`)}}else{let x=l.map(I=>`${p(I)}: ${h.get(I)}`).join(", ");e.write(`const ${w} = { ${x} };`)}if(_!=="none"){let x=u.length>0?S(t,new Set(u)):null;e.write(`for (const k in ${n}) {`),e.indented(I=>{if(I.write('if (k === "__proto__") continue;'),x&&I.write(`if (${x}.has(k)) continue;`),_==="passthrough")I.write(`${w}[k] = ${n}[k];`);else{let E=k(t);I.write(`const ${E} = ${n}[k];`);let L=q(I,t,g,E);I.write(`${w}[k] = ${L};`)}}),e.write("}")}return w}s(Yg,"generateObjectCheck");function Qg(e,t,r,n,o=!0){let i=r._zod.def;if(ey(r))return V(e,t,i.innerType,n,o);if(i.innerType._zod.optin==="defaulted"){let u=k(t),a=k(t);return e.write(`let ${u};`),e.write(`if (${n} === undefined) {`),e.indented(l=>{l.write(`const ${a} = (() => {`),l.indented(f=>{let p=V(f,t,i.innerType,n);f.write(`return ${p};`)}),l.write("})();"),l.write(`if (${a} !== INVALID) ${u} = ${a};`)}),e.write("} else {"),e.indented(l=>{let f=V(l,t,i.innerType,n);l.write(`${u} = ${f};`)}),e.write("}"),u}let c=o?k(t):null;return c&&e.write(`let ${c};`),e.write(`if (${n} !== undefined) {`),e.indented(u=>{let a=V(u,t,i.innerType,n,o);c&&a!==null&&u.write(`${c} = ${a};`)}),e.write("}"),c}s(Qg,"generateOptionalCheck");function ey(e){return e._zod.traits?.has("$ZodExactOptional")===!0}s(ey,"isExactOptional");function ty(e){return e._zod.optin===void 0&&Be(e)}s(ty,"requiresPresenceCheck");function Be(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?Be(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?Be(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(Be):!0;case"intersection":return!t.left||!t.right?!0:Be(t.left)&&Be(t.right);case"pipe":return t.in?Be(t.in):!0;default:return!0}}s(Be,"fastPathAcceptsAbsence");function Mc(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}s(Mc,"dropsWhenAbsent");function Zf(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&>(e)}s(Zf,"mayOmitUndefined");function gt(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?gt(t.innerType):!0;case"union":return t.options?t.options.some(gt):!0;case"intersection":return!t.left||!t.right||gt(t.left)||gt(t.right);case"pipe":return t.out?gt(t.out):!0;default:return!0}}s(gt,"mayOutputUndefined");function ry(e,t,r,n,o=!0){let i=r._zod.def,c=o?k(t):null;return c&&e.write(`let ${c} = null;`),e.write(`if (${n} !== null) {`),e.indented(u=>{let a=V(u,t,i.innerType,n,o);c&&a!==null&&u.write(`${c} = ${a};`)}),e.write("}"),c}s(ry,"generateNullableCheck");function ny(e,t,r,n,o=!0){let i=r._zod.def;e.write(`if (!Array.isArray(${n})) return INVALID;`);let c=o?k(t):null,u=k(t),a=k(t);return c&&e.write(`const ${c} = new Array(${n}.length);`),e.write(`for (let ${u} = 0; ${u} < ${n}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${a} = ${n}[${u}];`);let f=q(l,t,i.element,a,o);c&&f!==null&&l.write(`${c}[${u}] = ${f};`)}),e.write("}"),c}s(ny,"generateArrayCheck");function oy(e,t,r,n){let i=r._zod.def.values;if(i.length!==1){let u=S(t,new Set(i));return e.write(`if (!${u}.has(${n})) return INVALID;`),n}let c=i[0];if(typeof c=="number"&&Number.isNaN(c)){let u=S(t,new Set(i));return e.write(`if (!${u}.has(${n})) return INVALID;`),n}if(typeof c=="string")e.write(`if (${n} !== ${G(c)}) return INVALID;`);else if(typeof c=="number"||typeof c=="boolean")e.write(`if (${n} !== ${c}) return INVALID;`);else if(c===null)e.write(`if (${n} !== null) return INVALID;`);else if(c===void 0)e.write(`if (${n} !== undefined) return INVALID;`);else if(typeof c=="bigint")e.write(`if (${n} !== ${c}n) return INVALID;`);else throw new Z(`literal type ${typeof c}`);return n}s(oy,"generateLiteralCheck");function iy(e,t,r,n){let o=r._zod.values;if(!o)throw new Z("enum schema without enumerated values");let i=S(t,o);return e.write(`if (!${i}.has(${n})) return INVALID;`),n}s(iy,"generateEnumCheck");function Nf(e,t,r,n){let o=r._zod.def;return V(e,t,o.innerType,n)}s(Nf,"generateWrapperCheck");function sy(e,t,r,n){let o=r._zod.def,c=Object.getOwnPropertyDescriptor(r._zod.def,"defaultValue")?()=>r._zod.def.defaultValue:void 0;if(r._zod.def.type==="prefault"){if(!c)return V(e,t,o.innerType,n);let a=S(t,c),l=k(t);return e.write(`let ${l} = ${n};`),e.write(`if (${n} === undefined) ${l} = ${a}();`),V(e,t,o.innerType,l)}let u=k(t);if(c){let a=S(t,c),l=S(t,Kt);e.write(`let ${u};`),e.write(`if (${n} === undefined) {`),e.indented(f=>{f.write(`${u} = ${l}(${a}());`)}),e.write("} else {"),e.indented(f=>{let p=V(f,t,o.innerType,n);f.write(`${u} = ${p} === undefined ? ${l}(${a}()) : ${p};`)}),e.write("}")}else e.write(`let ${u};`),e.write(`if (${n} !== undefined) {`),e.indented(a=>{let l=V(a,t,o.innerType,n);a.write(`${u} = ${l};`)}),e.write("}");return u}s(sy,"generateDefaultCheck");function cy(e,t,r,n){let o=r._zod.def,i=V(e,t,o.innerType,n),c=k(t);return e.write(`const ${c} = ${i};`),e.write(`if (${c} === undefined) return INVALID;`),c}s(cy,"generateNonOptionalCheck");function uy(e,t,r,n){let o=r._zod.def,i=o.items,c=o.rest;e.write(`if (!Array.isArray(${n})) return INVALID;`);let u=Ef(i,"optin"),a=Ef(i,"optout");c?e.write(`if (${n}.length < ${u}) return INVALID;`):e.write(`if (${n}.length < ${u} || ${n}.length > ${i.length}) return INVALID;`);let l=k(t);e.write(`const ${l} = [];`);for(let f=0;f<i.length;f++){let p=i[f];if(f>=a)e.write(`if (${l}.length === ${f}) {`),e.indented(m=>{m.write(`if (${f} < ${n}.length) {`),m.indented(h=>{let g=k(t);h.write(`const ${g} = ${n}[${f}];`);let _=q(h,t,p,g);h.write(`${l}[${f}] = ${_};`)}),m.write("} else {"),m.indented(h=>{if(Mc(p)){h.write(`${l}.length = ${f};`);return}let g=k(t),_=k(t);h.write(`const ${g} = undefined;`),h.write(`const ${_} = (() => {`),h.indented(w=>{let z=q(w,t,p,g);w.write(`return ${z};`)}),h.write("})();"),h.write(`if (${_} === INVALID || ${_} === undefined) ${l}.length = ${f};`),h.write(`else ${l}[${f}] = ${_};`)}),m.write("}")}),e.write("}");else{let m=k(t);e.write(`const ${m} = ${n}[${f}];`);let h=q(e,t,p,m);e.write(`${l}[${f}] = ${h};`)}}if(c){let f=k(t),p=k(t);e.write(`for (let ${f} = ${i.length}; ${f} < ${n}.length; ${f}++) {`),e.indented(m=>{m.write(`const ${p} = ${n}[${f}];`);let h=q(m,t,c,p);m.write(`${l}[${f}] = ${h};`)}),e.write("}")}return l}s(uy,"generateTupleCheck");function Ef(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}s(Ef,"getTupleOptStart");function ay(e,t,r,n){let o=r._zod.def,i=o.options;if(o.discriminator)return ly(e,t,o,n);if(o.inclusive===!1)throw new Z("exclusive unions (z.xor)");if(i.length===0)return e.write("return INVALID;"),n;if(i.length===1)return V(e,t,i[0],n);if(i.every(a=>a._zod.def.type==="literal"&&!a._zod.def.checks?.length)){let a=new Set(i.flatMap(f=>f._zod.def.values)),l=S(t,a);return e.write(`if (!${l}.has(${n})) return INVALID;`),n}let u=k(t);e.write(`let ${u};`);for(let a=0;a<i.length;a++){let l=i[a];a===0?e.write(`${u} = (() => {`):e.write(`if (${u} === INVALID) ${u} = (() => {`),e.indented(f=>{let p=V(f,t,l,n);f.write(`return ${p};`)}),e.write("})();")}return e.write(`if (${u} === INVALID) return INVALID;`),u}s(ay,"generateUnionCheck");function ly(e,t,r,n){if(r.unionFallback)throw new Z("discriminated union with unionFallback");if(r.options.length===0)return e.write("return INVALID;"),n;let o=k(t),i=k(t);e.write(`const ${o} = ${n}?.[${G(r.discriminator)}];`),e.write(`let ${i};`);let c=!0,u=new Set;for(let a of r.options){let l=a._zod.propValues?.[r.discriminator];if(!l||l.size===0)throw new Z("discriminated union option without static discriminator values");for(let m of l){if(u.has(m))throw new Z(`duplicate discriminator value ${String(m)}`);u.add(m)}let f=Array.from(l,m=>fy(t,o,m)),p=c?"if":"else if";e.write(`${p} (${f.join(" || ")}) {`),e.indented(m=>{let h=V(m,t,a,n);m.write(`${i} = ${h};`)}),e.write("}"),c=!1}return e.write("else { return INVALID; }"),i}s(ly,"generateDiscriminatedUnionCheck");function fy(e,t,r){if(typeof r=="string")return`${t} === ${G(r)}`;if(typeof r=="number")return Number.isNaN(r)?`Number.isNaN(${t})`:`${t} === ${r}`;if(typeof r=="boolean")return`${t} === ${r}`;if(r===null)return`${t} === null`;if(r===void 0)return`${t} === undefined`;if(typeof r=="bigint")return`${t} === ${r}n`;if(typeof r=="symbol"){let n=S(e,r);return`${t} === ${n}`}throw new Z(`literal discriminator value ${String(r)}`)}s(fy,"literalEquality");function py(e,t,r,n){let o=r._zod.def;t.definite=!1;let i=q(e,t,o.left,n),c=q(e,t,o.right,n),u=S(t,mt),a=k(t);return e.write(`const ${a} = ${u}(${i}, ${c});`),e.write(`if (!${a}.valid) return INVALID;`),`${a}.data`}s(py,"generateIntersectionCheck");function dy(e,t,r,n){let o=r._zod.def,i=S(t,ue);e.write(`if (!${i}(${n})) return INVALID;`);let c=k(t),u=k(t),a=k(t);e.write(`const ${c} = {};`);let l=o,f=l.partial?void 0:o.keyType._zod.values;if(f){let h=[];for(let _ of f){if(!(typeof _=="string"||typeof _=="number"||typeof _=="symbol"))throw new Z(`record key value ${String(_)}`);let w=typeof _=="number"?_.toString():_;if(w==="__proto__")throw new Z('record key "__proto__"');h.push(w);let z=S(t,_),x=V(e,t,o.keyType,z),I=k(t);e.write(`const ${I} = ${n}[${my(t,w)}];`);let E=q(e,t,o.valueType,I);e.write(`${c}[${x}] = ${E};`)}let g=S(t,new Set(h));return e.write(`for (const ${u} in ${n}) {`),e.indented(_=>{_.write(`if (${g}.has(${u})) continue;`),l.mode==="loose"?_.write(`if (${u} !== "__proto__") ${c}[${u}] = ${n}[${u}];`):_.write("return INVALID;")}),e.write("}"),c}let p=o.keyType._zod.def;if(!(p.type==="string"&&p.format===void 0&&!p.coerce&&(p.checks?.length??0)===0)){let h=o.mode==="loose",g=Un(o.keyType);g.definite===!1&&(t.definite=!1);let _=S(t,g),w=S(t,be),z=k(t);return Cf(e,t,n,u,x=>{x.write(`let ${z} = ${_}(${u});`),x.write(`if (${z} === INVALID && typeof ${u} === "string" && ${w}.test(${u})) ${z} = ${_}(Number(${u}));`),h?x.write(`if (${z} === INVALID) { ${c}[${u}] = ${n}[${u}]; continue; }`):x.write(`if (${z} === INVALID) return INVALID;`),x.write(`if (${z} === "__proto__") continue;`);let I=k(t);x.write(`const ${I} = ${n}[${u}];`);let E=q(x,t,o.valueType,I);x.write(`${c}[${z}] = ${E};`)}),c}return Cf(e,t,n,u,h=>{h.write(`const ${a} = ${n}[${u}];`);let g=q(h,t,o.valueType,a);h.write(`${c}[${u}] = ${g};`)},"return INVALID;"),c}s(dy,"generateRecordCheck");function Cf(e,t,r,n,o,i){let c=S(t,Object.prototype.propertyIsEnumerable),u=k(t),a=k(t),l=k(t);e.write(`const ${u} = Object.getOwnPropertySymbols(${r});`),e.write(`const ${a} = Object.getOwnPropertyNames(${r});`),e.write(`for (let ${l} = 0; ${l} < ${a}.length; ${l}++) {`),e.indented(f=>{f.write(`const ${n} = ${a}[${l}];`),f.write(`if (${n} === "__proto__" || !${c}.call(${r}, ${n})) continue;`),o(f)}),e.write("}"),e.write(`for (let ${l} = 0; ${l} < ${u}.length; ${l}++) {`),e.indented(f=>{f.write(`const ${n} = ${u}[${l}];`),f.write(`if (!${c}.call(${r}, ${n})) continue;`),i?f.write(i):o(f)}),e.write("}")}s(Cf,"emitOwnKeys");function my(e,t){return typeof t=="string"?G(t):S(e,t)}s(my,"literalPropertyKey");function hy(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Map)) return INVALID;`);let i=k(t),c=k(t),u=k(t);return e.write(`const ${i} = new Map();`),e.write(`for (const [${c}, ${u}] of ${n}) {`),e.indented(a=>{let l=V(a,t,o.keyType,c),f=V(a,t,o.valueType,u);a.write(`${i}.set(${l}, ${f});`)}),e.write("}"),i}s(hy,"generateMapCheck");function gy(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Set)) return INVALID;`);let i=k(t),c=k(t);return e.write(`const ${i} = new Set();`),e.write(`for (const ${c} of ${n}) {`),e.indented(u=>{let a=V(u,t,o.valueType,c);u.write(`${i}.add(${a});`)}),e.write("}"),i}s(gy,"generateSetCheck");function yy(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}s(yy,"generateFileCheck");function _y(e,t,r,n){e.write(`if (typeof ${n} !== "string") return INVALID;`);let o=r._zod.pattern;if(o){let i=S(t,o);e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${n})) return INVALID;`)}return n}s(_y,"generateTemplateLiteralCheck");function $y(e,t,r,n){let o=r._zod.def,i=Je(t,o.getter),c=S(t,{parser:null});e.write(`if (!${c}.parser) {`),e.indented(a=>{a.write(`const inner = ${i}();`),a.write(`${c}.parser = function(input) {`),a.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),a.write("};")}),e.write("}");let u=k(t);return e.write(`const ${u} = ${c}.parser(${n});`),e.write(`if (${u} === INVALID) return INVALID;`),u}s($y,"generateLazyCheck");function wy(e,t,r,n){let o=r._zod.def,i=V(e,t,o.in,n);if(o.transform){if(Ke(o.transform))throw new pe("z.compile: async transforms in pipes are not supported");let c=o.transform,a=Je(t,s(f=>{let p={value:f,issues:[],addIssue:Bc},m=c(f,p);return m instanceof Promise?X:p.issues.length===0?m:X},"helperFn")),l=k(t);return e.write(`const ${l} = ${a}(${i});`),e.write(`if (${l} === INVALID) return INVALID;`),V(e,t,o.out,l)}else return V(e,t,o.out,i)}s(wy,"generatePipeCheck");function Ke(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}s(Ke,"isAsyncFunction");function by(e,t,r,n){let o=r._zod.def;if(o.fn){if(Ke(o.fn))throw new pe("z.compile: async custom predicates are not supported");let i=Je(t,o.fn),c=S(t,Fc),u=k(t);e.write(`const ${u} = ${i}(${n});`),e.write(`if (${u} instanceof Promise) ${c}();`),e.write(`if (!${u}) return INVALID;`)}else throw new Z("custom schema without a predicate function");return n}s(by,"generateCustomCheck");function vy(e,t,r){let n=e._zod.run({value:r,issues:[]},{});if(n&&typeof n.then=="function")return X;let o=n;return o.issues.length===0?o.value:t()}s(vy,"runtimeCatch");function xy(e,t,r,n){let o=r._zod.def;if(!o.catchValue[Hr])throw new Z("catch with a callback (only a constant catch value compiles)",!1);let i=k(t);e.write(`let ${i} = (() => {`),e.indented(l=>{let f=q(l,t,o.innerType,n);l.write(`return ${f};`)}),e.write("})();");let c=S(t,o.innerType),u=Je(t,o.catchValue),a=S(t,vy);return e.write(`if (${i} === INVALID) {`),e.indented(l=>{l.write(`${i} = ${a}(${c}, ${u}, ${n});`),l.write(`if (${i} === INVALID) return INVALID;`)}),e.write("}"),i}s(xy,"generateCatchCheck");function ky(e,t,r,n){let o=r._zod.def;if(o.transform){if(Ke(o.transform))throw new pe("z.compile: async transforms are not supported");let i=o.transform,u=Je(t,s(l=>{let f={value:l,issues:[],addIssue:Bc},p=i(l,f);return p instanceof Promise?X:f.issues.length===0?p:X},"helperFn")),a=k(t);return e.write(`const ${a} = ${u}(${n});`),e.write(`if (${a} === INVALID) return INVALID;`),a}return n}s(ky,"generateTransformCheck");function Bn(e){return e.checks&&(e.checks=[...e.checks]),e}s(Bn,"snapshotChecks");function Jc(e,t){return new e(Bn({type:"string",...$(t)}))}s(Jc,"_string");function Kc(e,t){return new e(Bn({type:"string",coerce:!0,...$(t)}))}s(Kc,"_coercedString");function Jn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...$(t)})}s(Jn,"_email");function Kn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...$(t)})}s(Kn,"_guid");function Wn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...$(t)})}s(Wn,"_uuid");function qn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...$(t)})}s(qn,"_uuidv4");function Gn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$(t)})}s(Gn,"_uuidv6");function Hn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$(t)})}s(Hn,"_uuidv7");function br(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...$(t)})}s(br,"_url");function Xn(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...$(t)})}s(Xn,"_emoji");function Yn(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...$(t)})}s(Yn,"_nanoid");function Qn(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...$(t)})}s(Qn,"_cuid");function eo(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...$(t)})}s(eo,"_cuid2");function to(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...$(t)})}s(to,"_ulid");function ro(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...$(t)})}s(ro,"_xid");function no(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...$(t)})}s(no,"_ksuid");function oo(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...$(t)})}s(oo,"_ipv4");function io(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...$(t)})}s(io,"_ipv6");function Wc(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...$(t)})}s(Wc,"_mac");function so(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...$(t)})}s(so,"_cidrv4");function co(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...$(t)})}s(co,"_cidrv6");function uo(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...$(t)})}s(uo,"_base64");function ao(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...$(t)})}s(ao,"_base64url");function lo(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...$(t)})}s(lo,"_e164");function qc(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...$(t)})}s(qc,"_creditCard");function Gc(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...$(t)})}s(Gc,"_iban");function fo(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...$(t)})}s(fo,"_jwt");var Hc={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function vr(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$(t)})}s(vr,"_isoDateTime");function xr(e,t){return new e({type:"string",format:"date",check:"string_format",...$(t)})}s(xr,"_isoDate");function kr(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...$(t)})}s(kr,"_isoTime");function zr(e,t){return new e({type:"string",format:"duration",check:"string_format",...$(t)})}s(zr,"_isoDuration");function Xc(e,t){return new e(Bn({type:"number",checks:[],...$(t)}))}s(Xc,"_number");function Yc(e,t){return new e(Bn({type:"number",coerce:!0,checks:[],...$(t)}))}s(Yc,"_coercedNumber");function Qc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...$(t)})}s(Qc,"_int");function eu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...$(t)})}s(eu,"_float32");function tu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...$(t)})}s(tu,"_float64");function ru(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...$(t)})}s(ru,"_int32");function nu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...$(t)})}s(nu,"_uint32");function ou(e,t){return new e({type:"boolean",...$(t)})}s(ou,"_boolean");function iu(e,t){return new e({type:"boolean",coerce:!0,...$(t)})}s(iu,"_coercedBoolean");function su(e,t){return new e({type:"bigint",...$(t)})}s(su,"_bigint");function cu(e,t){return new e({type:"bigint",coerce:!0,...$(t)})}s(cu,"_coercedBigint");function uu(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...$(t)})}s(uu,"_int64");function au(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...$(t)})}s(au,"_uint64");function lu(e,t){return new e({type:"symbol",...$(t)})}s(lu,"_symbol");function fu(e,t){return new e({type:"undefined",...$(t)})}s(fu,"_undefined");function pu(e,t){return new e({type:"null",...$(t)})}s(pu,"_null");function du(e){return new e({type:"any"})}s(du,"_any");function mu(e){return new e({type:"unknown"})}s(mu,"_unknown");function hu(e,t){return new e({type:"never",...$(t)})}s(hu,"_never");function gu(e,t){return new e({type:"void",...$(t)})}s(gu,"_void");function yu(e,t){return new e({type:"date",...$(t)})}s(yu,"_date");function _u(e,t){return new e({type:"date",coerce:!0,...$(t)})}s(_u,"_coercedDate");function $u(e,t){return new e({type:"nan",...$(t)})}s($u,"_nan");function me(e,t){return new dn({check:"less_than",...$(t),value:e,inclusive:!1})}s(me,"_lt");function se(e,t){return new dn({check:"less_than",...$(t),value:e,inclusive:!0})}s(se,"_lte");function he(e,t){return new mn({check:"greater_than",...$(t),value:e,inclusive:!1})}s(he,"_gt");function ce(e,t){return new mn({check:"greater_than",...$(t),value:e,inclusive:!0})}s(ce,"_gte");function po(e){return he(0,e)}s(po,"_positive");function mo(e){return me(0,e)}s(mo,"_negative");function ho(e){return se(0,e)}s(ho,"_nonpositive");function go(e){return ce(0,e)}s(go,"_nonnegative");function Ie(e,t){return new ns({check:"multiple_of",...$(t),value:e})}s(Ie,"_multipleOf");function Oe(e,t){return new ss({check:"max_size",...$(t),maximum:e})}s(Oe,"_maxSize");function ge(e,t){return new cs({check:"min_size",...$(t),minimum:e})}s(ge,"_minSize");function We(e,t){return new us({check:"size_equals",...$(t),size:e})}s(We,"_size");function qe(e,t){return new as({check:"max_length",...$(t),maximum:e})}s(qe,"_maxLength");function ve(e,t){return new ls({check:"min_length",...$(t),minimum:e})}s(ve,"_minLength");function Ge(e,t){return new fs({check:"length_equals",...$(t),length:e})}s(Ge,"_length");function yt(e,t){return new ps({check:"string_format",format:"regex",...$(t),pattern:e})}s(yt,"_regex");function _t(e){return new ds({check:"string_format",format:"lowercase",...$(e)})}s(_t,"_lowercase");function $t(e){return new ms({check:"string_format",format:"uppercase",...$(e)})}s($t,"_uppercase");function wt(e,t){return new hs({check:"string_format",format:"includes",...$(t),includes:e})}s(wt,"_includes");function bt(e,t){return new gs({check:"string_format",format:"starts_with",...$(t),prefix:e})}s(bt,"_startsWith");function vt(e,t){return new ys({check:"string_format",format:"ends_with",...$(t),suffix:e})}s(vt,"_endsWith");function yo(e,t,r){return new _s({check:"property",property:e,schema:t,...$(r)})}s(yo,"_property");function xt(e,t){return new $s({check:"properties",shape:e,...$(t)})}s(xt,"_properties");function kt(e,t){return new ws({check:"mime_type",mime:e,...$(t)})}s(kt,"_mime");function de(e){return new bs({check:"overwrite",tx:e})}s(de,"_overwrite");function zt(e){return de(t=>t.normalize(e))}s(zt,"_normalize");function St(){return de(e=>e.trim())}s(St,"_trim");function Pt(){return de(e=>e.toLowerCase())}s(Pt,"_toLowerCase");function It(){return de(e=>e.toUpperCase())}s(It,"_toUpperCase");function Ot(){return de(e=>oi(e))}s(Ot,"_slugify");function wu(e,t,r){return new e({type:"array",element:t,...$(r)})}s(wu,"_array");function zy(e,t,r){return new e({type:"union",options:t,...$(r)})}s(zy,"_union");function Sy(e,t,r){return new e({type:"union",options:t,inclusive:!1,...$(r)})}s(Sy,"_xor");function Py(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...$(n)})}s(Py,"_discriminatedUnion");function Iy(e,t,r){return new e({type:"intersection",left:t,right:r})}s(Iy,"_intersection");function Oy(e,t,r,n){let o=r instanceof P,i=o?n:r,c=o?r:null;return new e({type:"tuple",items:t,rest:c,...$(i)})}s(Oy,"_tuple");function Ay(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...$(n)})}s(Ay,"_record");function Zy(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...$(n)})}s(Zy,"_map");function Ny(e,t,r){return new e({type:"set",valueType:t,...$(r)})}s(Ny,"_set");function Ey(e,t,r){let n=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:n,...$(r)})}s(Ey,"_enum");function Cy(e,t,r){return new e({type:"enum",entries:t,...$(r)})}s(Cy,"_nativeEnum");function Ty(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...$(r)})}s(Ty,"_literal");function bu(e,t){return new e({type:"file",...$(t)})}s(bu,"_file");function Dy(e,t){return new e({type:"transform",transform:t})}s(Dy,"_transform");function Ry(e,t){return new e({type:"optional",innerType:t})}s(Ry,"_optional");function jy(e,t){return new e({type:"nullable",innerType:t})}s(jy,"_nullable");function Ly(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Kt(r)}})}s(Ly,"_default");function Vy(e,t,r){return new e({type:"nonoptional",innerType:t,...$(r)})}s(Vy,"_nonoptional");function Fy(e,t){return new e({type:"success",innerType:t})}s(Fy,"_success");function My(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:fi(r)})}s(My,"_catch");function Uy(e,t,r){return new e({type:"pipe",in:t,out:r})}s(Uy,"_pipe");function By(e,t){return new e({type:"readonly",innerType:t})}s(By,"_readonly");function Jy(e,t,r){return new e({type:"template_literal",parts:t,...$(r)})}s(Jy,"_templateLiteral");function Ky(e,t){return new e({type:"lazy",getter:t})}s(Ky,"_lazy");function Wy(e,t){return new e({type:"promise",innerType:t})}s(Wy,"_promise");function vu(e,t,r){let n=$(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}s(vu,"_custom");function xu(e,t,r){return new e({type:"custom",check:"custom",fn:t,...$(r)})}s(xu,"_refine");function ku(e,t){let r=jf(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(ut(o,n.value,r._zod.def));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(ut(i))}},e(n.value,n)),t);return r}s(ku,"_superRefine");function jf(e,t){let r=new j({check:"custom",...$(t)});return r._zod.check=e,r}s(jf,"_check");function zu(e){let t=new j({check:"describe"});return t._zod.onattach=[r=>{let n=K.get(r)??{};K.add(r,{...n,description:e})}],t._zod.check=()=>{},t}s(zu,"describe");function Su(e){let t=new j({check:"meta"});return t._zod.onattach=[r=>{let n=K.get(r)??{};K.add(r,{...n,...e})}],t._zod.check=()=>{},t}s(Su,"meta");function Pu(e,t){let r=$(t),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(h=>typeof h=="string"?h.toLowerCase():h),o=o.map(h=>typeof h=="string"?h.toLowerCase():h));let i=new Set(n),c=new Set(o),u=e.Codec??mr,a=e.Boolean??pr,l=e.String??Me,f=new l({type:"string",error:r.error}),p=new a({type:"boolean",error:r.error}),m=new u({type:"pipe",in:f,out:p,transform:s(((h,g)=>{let _=h;return r.case!=="sensitive"&&(_=_.toLowerCase()),i.has(_)?!0:c.has(_)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...c],input:g.value,inst:m,continue:!1}),{})}),"transform"),reverseTransform:s(((h,g)=>h===!0?n[0]||"true":o[0]||"false"),"reverseTransform"),error:r.error});return m._zod.bag.truthy=n,m._zod.bag.falsy=o,m._zod.bag.case=r.case??"insensitive",m}s(Pu,"_stringbool");function He(e,t,r,n={}){let o=$(n),i={check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:u=>r.test(u),...o};return r instanceof RegExp&&(i.pattern=r),new e(i)}s(He,"_stringFormat");function Sr(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&J(e,n,r[n]);return e}s(Sr,"assignProps");function Ae(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??K,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}s(Ae,"initializeContext");function M(e,t,r,n,o){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(r,i),!0}s(M,"handleUnrepresentable");function D(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let c={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,c),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let u=e._zod.toJSONSchema?.();if(u)c.schema=u;else{let f={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,f);else{let m=c.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,m,f)}let p=e._zod.parent;p&&(c.ref||(c.ref=p),D(p,t,f),t.seen.get(p).isParent=!0)}let a=t.metadataRegistry.get(e);return a&&Sr(c.schema,a),t.io==="input"&&Y(e)&&(delete c.schema.examples,delete c.schema.default),t.io==="input"&&"_prefault"in c.schema&&((n=c.schema).default??(n.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}s(D,"processSchema");function Lf(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}s(Lf,"encodeJSONPointerSegment");function Ze(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let c of e.seen.entries()){let u=e.metadataRegistry.get(c[0])?.id;if(u){let a=n.get(u);if(a&&a!==c[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(u,c[0])}}let o=s(c=>{let u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(c[0])?.id,m=e.external.uri??(g=>g);if(p)return{ref:m(p)};let h=c[1].defId??c[1].schema.id??`schema${e.counter++}`;return c[1].defId=h,{defId:h,ref:`${m("__shared")}#/${u}/${Lf(h)}`}}let a="#",l=`${a}/${u}/`;if(c[1]===r&&!c[1].schema.id)return{ref:a};let f=c[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:l+Lf(f)}},"makeURI"),i=s(c=>{if(c[1].schema.$ref)return;let u=c[1],{ref:a,defId:l}=o(c);u.def={...u.schema},l&&(u.defId=l);let f=u.schema;for(let p in f)delete f[p];f.$ref=a},"extractToDef");if(e.cycles==="throw")for(let c of e.seen.entries()){let u=c[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
|
|
66
|
+
}`,m;try{m=new f(...c,p)(...u)}catch(h){throw new Z(`this schema (generated code failed to evaluate: ${h.message})`)}return t?.debug&&(m.code=l),m.definite=n.definite,m}s(Un,"compileFn");function S(e,t){for(let[n,o]of e.constants)if(o===t)return n;let r=`c${e.constantCounter++}`;return e.constants.set(r,t),r}s(S,"addConstant");function Ke(e,t){return e.definite=!1,S(e,t)}s(Ke,"addUserConstant");function k(e){return`v${e.varCounter++}`}s(k,"newVar");function Og(e,t){let r=e._zod.run({value:t,issues:[]},{});if(r&&typeof r.then=="function")return X;let n=r;return n.issues.length===0?n.value:X}s(Og,"runtimeRun");function q(e,t,r,n,o=!0){let i=e.content.length,c=t.constants.size,u=t.constantCounter,a=t.varCounter;try{return V(e,t,r,n,o)}catch(l){if(!(l instanceof Z)||!l.islandable)throw l;if(e.content.length=i,t.constants.size>c){let f=Array.from(t.constants.keys()).slice(c);for(let p of f)t.constants.delete(p)}return t.constantCounter=u,t.varCounter=a,Ag(e,t,r,n)}}s(q,"compileChild");function Ag(e,t,r,n){t.definite=!1;let o=S(t,r),i=S(t,Og),c=k(t);return e.write(`const ${c} = ${i}(${o}, ${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}s(Ag,"emitRuntimeIsland");var Zg=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function Ng(e,t,r,n){let o=r._zod.def.checks;if(!o||o.length===0)return n;let i=n;for(let c of o){let u=c._zod.def;if(u.when&&!Zg.has(u.check))throw new Z('check with a custom "when" condition');switch(u.check){case"greater_than":Eg(e,t,u,i);break;case"less_than":Cg(e,t,u,i);break;case"multiple_of":Tg(e,t,u,i);break;case"number_format":Df(e,u,i);break;case"min_length":{let a=Be(u.minimum,"min_length"),l=Fc(e,t,i,`${i}.length >= ${a} && ${i}.length < ${u.minimum*2}`);e.write(`if (${l} < ${a}) return INVALID;`);break}case"max_length":{let a=Be(u.maximum,"max_length"),l=Fc(e,t,i,`${i}.length > ${a}`);e.write(`if (${l} > ${a}) return INVALID;`);break}case"length_equals":{let a=Be(u.length,"length_equals"),l=Fc(e,t,i,`${i}.length >= ${a} && ${i}.length <= ${u.length*2}`);e.write(`if (${l} !== ${a}) return INVALID;`);break}case"min_size":e.write(`if (${i}.size < ${Be(u.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${i}.size > ${Be(u.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${i}.size !== ${Be(u.size,"size_equals")}) return INVALID;`);break;case"string_format":i=Rf(e,t,u,i);break;case"custom":i=Fg(e,t,c,i);break;case"bigint_format":Dg(e,u,i);break;case"mime_type":Rg(e,t,u,i);break;case"property":Lg(e,t,u,i);break;case"properties":jg(e,t,u,i);break;case"overwrite":{let a=k(t);Vg(e,t,c,i,a),i=a;break}default:throw new Z(`check type ${u.check}`)}}return i}s(Ng,"generateChecks");function Fc(e,t,r,n){let o=S(t,Ve),i=k(t);return e.write(`const ${i} = typeof ${r} === "string" && ${n} ? ${o}(${r}) : ${r}.length;`),i}s(Fc,"codePointLengthVar");function Be(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new Z(`${t} bound of type ${typeof e}`);return`${e}`}s(Be,"numericOperand");function Tf(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new Z("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new Z("comparison check with Invalid Date bound");return S(e,t)}throw new Z(`comparison check bound of type ${typeof t}`)}s(Tf,"comparisonOperand");function Eg(e,t,r,n){let o=r.inclusive?"<":"<=";e.write(`if (${n} ${o} ${Tf(t,r.value)}) return INVALID;`)}s(Eg,"generateGreaterThanCheck");function Cg(e,t,r,n){let o=r.inclusive?">":">=";e.write(`if (${n} ${o} ${Tf(t,r.value)}) return INVALID;`)}s(Cg,"generateLessThanCheck");function Tg(e,t,r,n){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new Z("multiple_of check with a zero divisor");e.write(`if (${n} % ${r.value}n !== 0n) return INVALID;`)}else{let o=S(t,Jt);e.write(`if (${o}(${n}, ${Be(r.value,"multiple_of")}) !== 0) return INVALID;`)}}s(Tg,"generateMultipleOfCheck");function Df(e,t,r){let n=t.format;switch(n){case"safeint":e.write(`if (!Number.isSafeInteger(${r})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${r}) || ${r} < -2147483648 || ${r} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${r}) || ${r} < 0 || ${r} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${r}) || ${r} < -3.4028234663852886e38 || ${r} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${r})) return INVALID;`);break;default:throw new Z(`number format ${n}`)}}s(Df,"generateNumberFormatCheck");function Dg(e,t,r){let n=t.format;if(n)switch(n){case"int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break;default:throw new Z(`bigint format ${n}`)}}s(Dg,"generateBigIntFormatCheck");function Rg(e,t,r,n){let o=r.mime;if(o&&o.length>0){let i=S(t,new Set(o));e.write(`if (!${i}.has(${n}.type)) return INVALID;`)}}s(Rg,"generateMimeTypeCheck");function jg(e,t,r,n){if(r.when)throw new Z('check with a custom "when" condition');e.write(`if (${n} == null) return INVALID;`);let o=r.shape;for(let i of Reflect.ownKeys(o)){let c=typeof i=="symbol"?S(t,i):G(i),u=k(t);e.write(`const ${u} = ${n}[${c}];`),q(e,t,o[i],u,!1)}}s(jg,"generatePropertiesChecks");function Lg(e,t,r,n){let o=`${n}[${JSON.stringify(r.property)}]`;V(e,t,r.schema,o)}s(Lg,"generatePropertyCheck");function Vg(e,t,r,n,o){let i=r._zod.def.tx;if(!i)throw new Z("overwrite check without a transform function");if(We(i))throw new pe("z.compile: async overwrite transforms are not supported");let c=S(t,i);e.write(`const ${o} = ${c}(${n});`)}s(Vg,"generateOverwriteCheck");function Mc(){throw new re}s(Mc,"throwAsync");function Jc(e){this.issues.push(e)}s(Jc,"pushIssue");function Fg(e,t,r,n){let o=r._zod.def;if(o.fn){if(We(o.fn))throw new pe("z.compile: async .refine() predicates are not supported");let i=Ke(t,o.fn),c=S(t,Mc),u=k(t);return e.write(`const ${u} = ${i}(${n});`),e.write(`if (${u} instanceof Promise) ${c}();`),e.write(`if (!${u}) return INVALID;`),n}if(r._zod.check){if(We(r._zod.check))throw new pe("z.compile: async .superRefine() / check functions are not supported");let i=r._zod.check,u=Ke(t,s(l=>{let f={value:l,issues:[],addIssue:Jc};return i(f)instanceof Promise&&Mc(),f.issues.length===0?f.value:X},"helperFn")),a=k(t);return e.write(`const ${a} = ${u}(${n});`),e.write(`if (${a} === INVALID) return INVALID;`),a}throw new Z("custom check without a predicate or check function")}s(Fg,"generateCustomRefineCheck");var Mg=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function Rf(e,t,r,n,o=!0){let i=r.format;if(i==="base64"){let l=S(t,lr);return e.write(`if (!${l}(${n})) return INVALID;`),n}if(i==="base64url"){let l=S(t,zn);return e.write(`if (!${l}(${n})) return INVALID;`),n}if(i==="jwt"){let l=S(t,In),f=S(t,r.alg??null);return e.write(`if (!${l}(${n}, ${f})) return INVALID;`),n}if(i==="ipv6"){let l=S(t,ar);return e.write(`if (!${l}(${n})) return INVALID;`),n}if(i==="cidrv6"){let l=S(t,xn);return e.write(`if (!${l}(${n})) return INVALID;`),n}if(i==="credit_card"){let l=S(t,Sn);return e.write(`if (!${l}(${n})) return INVALID;`),n}if(i==="iban"){let l=S(t,Pn);return e.write(`if (!${l}(${n})) return INVALID;`),n}let c=r;if(i==="url"||i==="httpurl"||c.normalize||c.hostname!==void 0||c.protocol!==void 0){let l=S(t,wn),f=S(t,r),p=k(t),m=k(t);if(e.write(`const ${p} = ${n}.trim();`),e.write(`const ${m} = ${l}(${p}, ${f});`),e.write(`if (typeof ${m} === "number") return INVALID;`),c.hostname!==void 0){let _=S(t,bn);e.write(`if (!${_}(${m}, ${f}.hostname)) return INVALID;`)}if(c.protocol!==void 0){let _=S(t,vn);e.write(`if (!${_}(${m}, ${f}.protocol)) return INVALID;`)}if(!o)return null;let h=k(t),g=c.normalize?`${m}.href`:`${S(t,ur)}(${p})`;return e.write(`const ${h} = ${g};`),h}let u=r.fn;if(u){if(We(u))throw new Z(`async string format ${i}`);let l=S(t,u);return e.write(`if (!${l}(${n})) return INVALID;`),n}if(Mg.has(i)&&r.pattern){let l=S(t,r.pattern);return e.write(`${l}.lastIndex = 0;`),e.write(`if (!${l}.test(${n})) return INVALID;`),n}let a=r.format;switch(a){case"regex":throw new Z("regex format without a pattern");case"lowercase":e.write(`if (${n} !== ${n}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${n} !== ${n}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${n}.includes(${G(r.includes)})) return INVALID;`);break;case"starts_with":{let l=r.prefix;e.write(`if (${n}.slice(0, ${l.length}) !== ${G(l)}) return INVALID;`);break}case"ends_with":{let l=r.suffix;e.write(`if (${n}.slice(-${l.length}) !== ${G(l)}) return INVALID;`);break}default:throw new Z(`string format ${a}`)}return n}s(Rf,"generateStringFormatCheck");function V(e,t,r,n,o=!0){let i=r._zod.def,c=i.type;if(i.coerce)throw new Z(`coercion (z.coerce.${c}())`);let u=o||!!i.checks?.length,a;switch(c){case"string":a=Ug(e,t,r,n,u);break;case"number":a=Bg(e,r,n);break;case"boolean":a=Jg(e,n);break;case"bigint":a=Kg(e,r,n);break;case"symbol":a=Wg(e,n);break;case"undefined":a=qg(e,n);break;case"null":a=Gg(e,n);break;case"any":case"unknown":a=n;break;case"never":e.write("return INVALID;"),a=n;break;case"void":a=Hg(e,n);break;case"nan":a=Xg(e,n);break;case"date":a=Yg(e,n);break;case"object":a=Qg(e,t,r,n,u);break;case"optional":a=ey(e,t,r,n,u);break;case"nullable":a=ny(e,t,r,n,u);break;case"array":a=oy(e,t,r,n,u);break;case"literal":a=iy(e,t,r,n);break;case"enum":a=sy(e,t,r,n);break;case"readonly":{let l=Nf(e,t,r,n),f=k(t);e.write(`const ${f} = Object.freeze(${l});`),a=f;break}case"success":Nf(e,t,r,n),a="true";break;case"default":case"prefault":a=cy(e,t,r,n);break;case"nonoptional":a=uy(e,t,r,n);break;case"tuple":a=ay(e,t,r,n);break;case"union":a=ly(e,t,r,n);break;case"intersection":a=dy(e,t,r,n);break;case"record":a=my(e,t,r,n);break;case"map":a=gy(e,t,r,n);break;case"set":a=yy(e,t,r,n);break;case"file":a=_y(e,n);break;case"template_literal":a=$y(e,t,r,n);break;case"lazy":a=wy(e,t,r,n);break;case"pipe":a=by(e,t,r,n);break;case"custom":a=vy(e,t,r,n);break;case"transform":a=zy(e,t,r,n);break;case"catch":a=ky(e,t,r,n);break;default:throw new Z(`schema type ${c}`)}return a===null?null:Ng(e,t,r,a)}s(V,"generateCheck");function Ug(e,t,r,n,o=!0){e.write(`if (typeof ${n} !== "string") return INVALID;`);let i=r._zod.def;return i.format===void 0?n:Rf(e,t,i,n,o)}s(Ug,"generateStringCheck");function Bg(e,t,r){e.write(`if (typeof ${r} !== "number" || !Number.isFinite(${r})) return INVALID;`);let n=t._zod.def;return n.check==="number_format"&&n.format&&Df(e,{format:n.format},r),r}s(Bg,"generateNumberCheck");function Jg(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}s(Jg,"generateBooleanCheck");function Kg(e,t,r){e.write(`if (typeof ${r} !== "bigint") return INVALID;`);let n=t._zod.def;if(n.format)switch(n.format){case"int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break}return r}s(Kg,"generateBigIntCheck");function Wg(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}s(Wg,"generateSymbolCheck");function qg(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}s(qg,"generateUndefinedCheck");function Gg(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}s(Gg,"generateNullCheck");function Hg(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}s(Hg,"generateVoidCheck");function Xg(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}s(Xg,"generateNaNCheck");function Yg(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}s(Yg,"generateDateCheck");function Qg(e,t,r,n,o=!0){let i=r._zod.def;e.write(`if (typeof ${n} !== "object" || ${n} === null || Array.isArray(${n})) return INVALID;`);let c=i.shape,u=Object.keys(c),a=Object.getOwnPropertySymbols(c),l=a.length?[...u,...a]:u,f=s(x=>typeof x=="symbol"?S(t,x):G(x),"keyExpr"),p=s(x=>typeof x=="symbol"?`[${f(x)}]`:G(x),"propKey"),m=c;if(u.includes("__proto__"))throw new Z('object shape key "__proto__"');let h=new Map;for(let x of l){let I=m[x],E=f(x),L=k(t);if(e.write(`const ${L} = ${n}[${E}];`),I._zod.optin!==void 0){let N=k(t);e.write(`let ${N} = (() => {`),e.indented(W=>{let Ut=q(W,t,I,L);W.write(`return ${Ut};`)}),e.write("})();"),I._zod.optout==="optional"?(e.write(`if (${N} === INVALID) {`),e.indented(W=>{W.write(`if (${E} in ${n}) return INVALID;`),W.write(`${N} = undefined;`)}),e.write("}")):e.write(`if (${N} === INVALID) return INVALID;`),h.set(x,N)}else{ry(I)&&e.write(`if (!(${E} in ${n})) return INVALID;`);let N=q(e,t,I,L,o);N!==null&&h.set(x,N)}}let g=i.catchall,_="none";if(g){let x=g._zod.def.type;if(x==="never"){let I=u.map(E=>`k !== ${G(E)}`).join(" && ")||"true";e.write(`for (const k in ${n}) {`),e.indented(E=>{E.write(`if (${I}) return INVALID;`)}),e.write("}")}else(x==="unknown"||x==="any")&&!g._zod.def.checks?.length?_="passthrough":_="schema"}let w=k(t),z=l.some(x=>Zf(m[x])||Uc(m[x]));if(!o){if(_==="schema"){let x=u.length>0?S(t,new Set(u)):null;e.write(`for (const k in ${n}) {`),e.indented(I=>{I.write('if (k === "__proto__") continue;'),x&&I.write(`if (${x}.has(k)) continue;`);let E=k(t);I.write(`const ${E} = ${n}[k];`),q(I,t,g,E,!1)}),e.write("}")}return null}if(z){e.write(`const ${w} = {};`);for(let x of l){let I=f(x),E=h.get(x);Uc(m[x])?e.write(`if (${I} in ${n}) ${w}[${I}] = ${E};`):Zf(m[x])?e.write(`if (${E} !== undefined || ${I} in ${n}) ${w}[${I}] = ${E};`):e.write(`${w}[${I}] = ${E};`)}}else{let x=l.map(I=>`${p(I)}: ${h.get(I)}`).join(", ");e.write(`const ${w} = { ${x} };`)}if(_!=="none"){let x=u.length>0?S(t,new Set(u)):null;e.write(`for (const k in ${n}) {`),e.indented(I=>{if(I.write('if (k === "__proto__") continue;'),x&&I.write(`if (${x}.has(k)) continue;`),_==="passthrough")I.write(`${w}[k] = ${n}[k];`);else{let E=k(t);I.write(`const ${E} = ${n}[k];`);let L=q(I,t,g,E);I.write(`${w}[k] = ${L};`)}}),e.write("}")}return w}s(Qg,"generateObjectCheck");function ey(e,t,r,n,o=!0){let i=r._zod.def;if(ty(r))return V(e,t,i.innerType,n,o);if(i.innerType._zod.optin==="defaulted"){let u=k(t),a=k(t);return e.write(`let ${u};`),e.write(`if (${n} === undefined) {`),e.indented(l=>{l.write(`const ${a} = (() => {`),l.indented(f=>{let p=V(f,t,i.innerType,n);f.write(`return ${p};`)}),l.write("})();"),l.write(`if (${a} !== INVALID) ${u} = ${a};`)}),e.write("} else {"),e.indented(l=>{let f=V(l,t,i.innerType,n);l.write(`${u} = ${f};`)}),e.write("}"),u}let c=o?k(t):null;return c&&e.write(`let ${c};`),e.write(`if (${n} !== undefined) {`),e.indented(u=>{let a=V(u,t,i.innerType,n,o);c&&a!==null&&u.write(`${c} = ${a};`)}),e.write("}"),c}s(ey,"generateOptionalCheck");function ty(e){return e._zod.traits?.has("$ZodExactOptional")===!0}s(ty,"isExactOptional");function ry(e){return e._zod.optin===void 0&&Je(e)}s(ry,"requiresPresenceCheck");function Je(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?Je(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?Je(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(Je):!0;case"intersection":return!t.left||!t.right?!0:Je(t.left)&&Je(t.right);case"pipe":return t.in?Je(t.in):!0;default:return!0}}s(Je,"fastPathAcceptsAbsence");function Uc(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}s(Uc,"dropsWhenAbsent");function Zf(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&>(e)}s(Zf,"mayOmitUndefined");function gt(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?gt(t.innerType):!0;case"union":return t.options?t.options.some(gt):!0;case"intersection":return!t.left||!t.right||gt(t.left)||gt(t.right);case"pipe":return t.out?gt(t.out):!0;default:return!0}}s(gt,"mayOutputUndefined");function ny(e,t,r,n,o=!0){let i=r._zod.def,c=o?k(t):null;return c&&e.write(`let ${c} = null;`),e.write(`if (${n} !== null) {`),e.indented(u=>{let a=V(u,t,i.innerType,n,o);c&&a!==null&&u.write(`${c} = ${a};`)}),e.write("}"),c}s(ny,"generateNullableCheck");function oy(e,t,r,n,o=!0){let i=r._zod.def;e.write(`if (!Array.isArray(${n})) return INVALID;`);let c=o?k(t):null,u=k(t),a=k(t);return c&&e.write(`const ${c} = new Array(${n}.length);`),e.write(`for (let ${u} = 0; ${u} < ${n}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${a} = ${n}[${u}];`);let f=q(l,t,i.element,a,o);c&&f!==null&&l.write(`${c}[${u}] = ${f};`)}),e.write("}"),c}s(oy,"generateArrayCheck");function iy(e,t,r,n){let i=r._zod.def.values;if(i.length!==1){let u=S(t,new Set(i));return e.write(`if (!${u}.has(${n})) return INVALID;`),n}let c=i[0];if(typeof c=="number"&&Number.isNaN(c)){let u=S(t,new Set(i));return e.write(`if (!${u}.has(${n})) return INVALID;`),n}if(typeof c=="string")e.write(`if (${n} !== ${G(c)}) return INVALID;`);else if(typeof c=="number"||typeof c=="boolean")e.write(`if (${n} !== ${c}) return INVALID;`);else if(c===null)e.write(`if (${n} !== null) return INVALID;`);else if(c===void 0)e.write(`if (${n} !== undefined) return INVALID;`);else if(typeof c=="bigint")e.write(`if (${n} !== ${c}n) return INVALID;`);else throw new Z(`literal type ${typeof c}`);return n}s(iy,"generateLiteralCheck");function sy(e,t,r,n){let o=r._zod.values;if(!o)throw new Z("enum schema without enumerated values");let i=S(t,o);return e.write(`if (!${i}.has(${n})) return INVALID;`),n}s(sy,"generateEnumCheck");function Nf(e,t,r,n){let o=r._zod.def;return V(e,t,o.innerType,n)}s(Nf,"generateWrapperCheck");function cy(e,t,r,n){let o=r._zod.def,c=Object.getOwnPropertyDescriptor(r._zod.def,"defaultValue")?()=>r._zod.def.defaultValue:void 0;if(r._zod.def.type==="prefault"){if(!c)return V(e,t,o.innerType,n);let a=S(t,c),l=k(t);return e.write(`let ${l} = ${n};`),e.write(`if (${n} === undefined) ${l} = ${a}();`),V(e,t,o.innerType,l)}let u=k(t);if(c){let a=S(t,c),l=S(t,Kt);e.write(`let ${u};`),e.write(`if (${n} === undefined) {`),e.indented(f=>{f.write(`${u} = ${l}(${a}());`)}),e.write("} else {"),e.indented(f=>{let p=V(f,t,o.innerType,n);f.write(`${u} = ${p} === undefined ? ${l}(${a}()) : ${p};`)}),e.write("}")}else e.write(`let ${u};`),e.write(`if (${n} !== undefined) {`),e.indented(a=>{let l=V(a,t,o.innerType,n);a.write(`${u} = ${l};`)}),e.write("}");return u}s(cy,"generateDefaultCheck");function uy(e,t,r,n){let o=r._zod.def,i=V(e,t,o.innerType,n),c=k(t);return e.write(`const ${c} = ${i};`),e.write(`if (${c} === undefined) return INVALID;`),c}s(uy,"generateNonOptionalCheck");function ay(e,t,r,n){let o=r._zod.def,i=o.items,c=o.rest;e.write(`if (!Array.isArray(${n})) return INVALID;`);let u=Ef(i,"optin"),a=Ef(i,"optout");c?e.write(`if (${n}.length < ${u}) return INVALID;`):e.write(`if (${n}.length < ${u} || ${n}.length > ${i.length}) return INVALID;`);let l=k(t);e.write(`const ${l} = [];`);for(let f=0;f<i.length;f++){let p=i[f];if(f>=a)e.write(`if (${l}.length === ${f}) {`),e.indented(m=>{m.write(`if (${f} < ${n}.length) {`),m.indented(h=>{let g=k(t);h.write(`const ${g} = ${n}[${f}];`);let _=q(h,t,p,g);h.write(`${l}[${f}] = ${_};`)}),m.write("} else {"),m.indented(h=>{if(Uc(p)){h.write(`${l}.length = ${f};`);return}let g=k(t),_=k(t);h.write(`const ${g} = undefined;`),h.write(`const ${_} = (() => {`),h.indented(w=>{let z=q(w,t,p,g);w.write(`return ${z};`)}),h.write("})();"),h.write(`if (${_} === INVALID || ${_} === undefined) ${l}.length = ${f};`),h.write(`else ${l}[${f}] = ${_};`)}),m.write("}")}),e.write("}");else{let m=k(t);e.write(`const ${m} = ${n}[${f}];`);let h=q(e,t,p,m);e.write(`${l}[${f}] = ${h};`)}}if(c){let f=k(t),p=k(t);e.write(`for (let ${f} = ${i.length}; ${f} < ${n}.length; ${f}++) {`),e.indented(m=>{m.write(`const ${p} = ${n}[${f}];`);let h=q(m,t,c,p);m.write(`${l}[${f}] = ${h};`)}),e.write("}")}return l}s(ay,"generateTupleCheck");function Ef(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}s(Ef,"getTupleOptStart");function ly(e,t,r,n){let o=r._zod.def,i=o.options;if(o.discriminator)return fy(e,t,o,n);if(o.inclusive===!1)throw new Z("exclusive unions (z.xor)");if(i.length===0)return e.write("return INVALID;"),n;if(i.length===1)return V(e,t,i[0],n);if(i.every(a=>a._zod.def.type==="literal"&&!a._zod.def.checks?.length)){let a=new Set(i.flatMap(f=>f._zod.def.values)),l=S(t,a);return e.write(`if (!${l}.has(${n})) return INVALID;`),n}let u=k(t);e.write(`let ${u};`);for(let a=0;a<i.length;a++){let l=i[a];a===0?e.write(`${u} = (() => {`):e.write(`if (${u} === INVALID) ${u} = (() => {`),e.indented(f=>{let p=V(f,t,l,n);f.write(`return ${p};`)}),e.write("})();")}return e.write(`if (${u} === INVALID) return INVALID;`),u}s(ly,"generateUnionCheck");function fy(e,t,r,n){if(r.unionFallback)throw new Z("discriminated union with unionFallback");if(r.options.length===0)return e.write("return INVALID;"),n;let o=k(t),i=k(t);e.write(`const ${o} = ${n}?.[${G(r.discriminator)}];`),e.write(`let ${i};`);let c=!0,u=new Set;for(let a of r.options){let l=a._zod.propValues?.[r.discriminator];if(!l||l.size===0)throw new Z("discriminated union option without static discriminator values");for(let m of l){if(u.has(m))throw new Z(`duplicate discriminator value ${String(m)}`);u.add(m)}let f=Array.from(l,m=>py(t,o,m)),p=c?"if":"else if";e.write(`${p} (${f.join(" || ")}) {`),e.indented(m=>{let h=V(m,t,a,n);m.write(`${i} = ${h};`)}),e.write("}"),c=!1}return e.write("else { return INVALID; }"),i}s(fy,"generateDiscriminatedUnionCheck");function py(e,t,r){if(typeof r=="string")return`${t} === ${G(r)}`;if(typeof r=="number")return Number.isNaN(r)?`Number.isNaN(${t})`:`${t} === ${r}`;if(typeof r=="boolean")return`${t} === ${r}`;if(r===null)return`${t} === null`;if(r===void 0)return`${t} === undefined`;if(typeof r=="bigint")return`${t} === ${r}n`;if(typeof r=="symbol"){let n=S(e,r);return`${t} === ${n}`}throw new Z(`literal discriminator value ${String(r)}`)}s(py,"literalEquality");function dy(e,t,r,n){let o=r._zod.def;t.definite=!1;let i=q(e,t,o.left,n),c=q(e,t,o.right,n),u=S(t,mt),a=k(t);return e.write(`const ${a} = ${u}(${i}, ${c});`),e.write(`if (!${a}.valid) return INVALID;`),`${a}.data`}s(dy,"generateIntersectionCheck");function my(e,t,r,n){let o=r._zod.def,i=S(t,ue);e.write(`if (!${i}(${n})) return INVALID;`);let c=k(t),u=k(t),a=k(t);e.write(`const ${c} = {};`);let l=o,f=l.partial?void 0:o.keyType._zod.values;if(f){let h=[];for(let _ of f){if(!(typeof _=="string"||typeof _=="number"||typeof _=="symbol"))throw new Z(`record key value ${String(_)}`);let w=typeof _=="number"?_.toString():_;if(w==="__proto__")throw new Z('record key "__proto__"');h.push(w);let z=S(t,_),x=V(e,t,o.keyType,z),I=k(t);e.write(`const ${I} = ${n}[${hy(t,w)}];`);let E=q(e,t,o.valueType,I);e.write(`${c}[${x}] = ${E};`)}let g=S(t,new Set(h));return e.write(`for (const ${u} in ${n}) {`),e.indented(_=>{_.write(`if (${g}.has(${u})) continue;`),l.mode==="loose"?_.write(`if (${u} !== "__proto__") ${c}[${u}] = ${n}[${u}];`):_.write("return INVALID;")}),e.write("}"),c}let p=o.keyType._zod.def;if(!(p.type==="string"&&p.format===void 0&&!p.coerce&&(p.checks?.length??0)===0)){let h=o.mode==="loose",g=Un(o.keyType);g.definite===!1&&(t.definite=!1);let _=S(t,g),w=S(t,be),z=k(t);return Cf(e,t,n,u,x=>{x.write(`let ${z} = ${_}(${u});`),x.write(`if (${z} === INVALID && typeof ${u} === "string" && ${w}.test(${u})) ${z} = ${_}(Number(${u}));`),h?x.write(`if (${z} === INVALID) { ${c}[${u}] = ${n}[${u}]; continue; }`):x.write(`if (${z} === INVALID) return INVALID;`),x.write(`if (${z} === "__proto__") continue;`);let I=k(t);x.write(`const ${I} = ${n}[${u}];`);let E=q(x,t,o.valueType,I);x.write(`${c}[${z}] = ${E};`)}),c}return Cf(e,t,n,u,h=>{h.write(`const ${a} = ${n}[${u}];`);let g=q(h,t,o.valueType,a);h.write(`${c}[${u}] = ${g};`)},"return INVALID;"),c}s(my,"generateRecordCheck");function Cf(e,t,r,n,o,i){let c=S(t,Object.prototype.propertyIsEnumerable),u=k(t),a=k(t),l=k(t);e.write(`const ${u} = Object.getOwnPropertySymbols(${r});`),e.write(`const ${a} = Object.getOwnPropertyNames(${r});`),e.write(`for (let ${l} = 0; ${l} < ${a}.length; ${l}++) {`),e.indented(f=>{f.write(`const ${n} = ${a}[${l}];`),f.write(`if (${n} === "__proto__" || !${c}.call(${r}, ${n})) continue;`),o(f)}),e.write("}"),e.write(`for (let ${l} = 0; ${l} < ${u}.length; ${l}++) {`),e.indented(f=>{f.write(`const ${n} = ${u}[${l}];`),f.write(`if (!${c}.call(${r}, ${n})) continue;`),i?f.write(i):o(f)}),e.write("}")}s(Cf,"emitOwnKeys");function hy(e,t){return typeof t=="string"?G(t):S(e,t)}s(hy,"literalPropertyKey");function gy(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Map)) return INVALID;`);let i=k(t),c=k(t),u=k(t);return e.write(`const ${i} = new Map();`),e.write(`for (const [${c}, ${u}] of ${n}) {`),e.indented(a=>{let l=V(a,t,o.keyType,c),f=V(a,t,o.valueType,u);a.write(`${i}.set(${l}, ${f});`)}),e.write("}"),i}s(gy,"generateMapCheck");function yy(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Set)) return INVALID;`);let i=k(t),c=k(t);return e.write(`const ${i} = new Set();`),e.write(`for (const ${c} of ${n}) {`),e.indented(u=>{let a=V(u,t,o.valueType,c);u.write(`${i}.add(${a});`)}),e.write("}"),i}s(yy,"generateSetCheck");function _y(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}s(_y,"generateFileCheck");function $y(e,t,r,n){e.write(`if (typeof ${n} !== "string") return INVALID;`);let o=r._zod.pattern;if(o){let i=S(t,o);e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${n})) return INVALID;`)}return n}s($y,"generateTemplateLiteralCheck");function wy(e,t,r,n){let o=r._zod.def,i=Ke(t,o.getter),c=S(t,{parser:null});e.write(`if (!${c}.parser) {`),e.indented(a=>{a.write(`const inner = ${i}();`),a.write(`${c}.parser = function(input) {`),a.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),a.write("};")}),e.write("}");let u=k(t);return e.write(`const ${u} = ${c}.parser(${n});`),e.write(`if (${u} === INVALID) return INVALID;`),u}s(wy,"generateLazyCheck");function by(e,t,r,n){let o=r._zod.def,i=V(e,t,o.in,n);if(o.transform){if(We(o.transform))throw new pe("z.compile: async transforms in pipes are not supported");let c=o.transform,a=Ke(t,s(f=>{let p={value:f,issues:[],addIssue:Jc},m=c(f,p);return m instanceof Promise?X:p.issues.length===0?m:X},"helperFn")),l=k(t);return e.write(`const ${l} = ${a}(${i});`),e.write(`if (${l} === INVALID) return INVALID;`),V(e,t,o.out,l)}else return V(e,t,o.out,i)}s(by,"generatePipeCheck");function We(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}s(We,"isAsyncFunction");function vy(e,t,r,n){let o=r._zod.def;if(o.fn){if(We(o.fn))throw new pe("z.compile: async custom predicates are not supported");let i=Ke(t,o.fn),c=S(t,Mc),u=k(t);e.write(`const ${u} = ${i}(${n});`),e.write(`if (${u} instanceof Promise) ${c}();`),e.write(`if (!${u}) return INVALID;`)}else throw new Z("custom schema without a predicate function");return n}s(vy,"generateCustomCheck");function xy(e,t,r){let n=e._zod.run({value:r,issues:[]},{});if(n&&typeof n.then=="function")return X;let o=n;return o.issues.length===0?o.value:t()}s(xy,"runtimeCatch");function ky(e,t,r,n){let o=r._zod.def;if(!o.catchValue[Hr])throw new Z("catch with a callback (only a constant catch value compiles)",!1);let i=k(t);e.write(`let ${i} = (() => {`),e.indented(l=>{let f=q(l,t,o.innerType,n);l.write(`return ${f};`)}),e.write("})();");let c=S(t,o.innerType),u=Ke(t,o.catchValue),a=S(t,xy);return e.write(`if (${i} === INVALID) {`),e.indented(l=>{l.write(`${i} = ${a}(${c}, ${u}, ${n});`),l.write(`if (${i} === INVALID) return INVALID;`)}),e.write("}"),i}s(ky,"generateCatchCheck");function zy(e,t,r,n){let o=r._zod.def;if(o.transform){if(We(o.transform))throw new pe("z.compile: async transforms are not supported");let i=o.transform,u=Ke(t,s(l=>{let f={value:l,issues:[],addIssue:Jc},p=i(l,f);return p instanceof Promise?X:f.issues.length===0?p:X},"helperFn")),a=k(t);return e.write(`const ${a} = ${u}(${n});`),e.write(`if (${a} === INVALID) return INVALID;`),a}return n}s(zy,"generateTransformCheck");function Bn(e){return e.checks&&(e.checks=[...e.checks]),e}s(Bn,"snapshotChecks");function Kc(e,t){return new e(Bn({type:"string",...$(t)}))}s(Kc,"_string");function Wc(e,t){return new e(Bn({type:"string",coerce:!0,...$(t)}))}s(Wc,"_coercedString");function Jn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...$(t)})}s(Jn,"_email");function Kn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...$(t)})}s(Kn,"_guid");function Wn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...$(t)})}s(Wn,"_uuid");function qn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...$(t)})}s(qn,"_uuidv4");function Gn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$(t)})}s(Gn,"_uuidv6");function Hn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$(t)})}s(Hn,"_uuidv7");function br(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...$(t)})}s(br,"_url");function Xn(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...$(t)})}s(Xn,"_emoji");function Yn(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...$(t)})}s(Yn,"_nanoid");function Qn(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...$(t)})}s(Qn,"_cuid");function eo(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...$(t)})}s(eo,"_cuid2");function to(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...$(t)})}s(to,"_ulid");function ro(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...$(t)})}s(ro,"_xid");function no(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...$(t)})}s(no,"_ksuid");function oo(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...$(t)})}s(oo,"_ipv4");function io(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...$(t)})}s(io,"_ipv6");function qc(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...$(t)})}s(qc,"_mac");function so(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...$(t)})}s(so,"_cidrv4");function co(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...$(t)})}s(co,"_cidrv6");function uo(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...$(t)})}s(uo,"_base64");function ao(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...$(t)})}s(ao,"_base64url");function lo(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...$(t)})}s(lo,"_e164");function Gc(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...$(t)})}s(Gc,"_creditCard");function Hc(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...$(t)})}s(Hc,"_iban");function fo(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...$(t)})}s(fo,"_jwt");var Xc={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function vr(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$(t)})}s(vr,"_isoDateTime");function xr(e,t){return new e({type:"string",format:"date",check:"string_format",...$(t)})}s(xr,"_isoDate");function kr(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...$(t)})}s(kr,"_isoTime");function zr(e,t){return new e({type:"string",format:"duration",check:"string_format",...$(t)})}s(zr,"_isoDuration");function Yc(e,t){return new e(Bn({type:"number",checks:[],...$(t)}))}s(Yc,"_number");function Qc(e,t){return new e(Bn({type:"number",coerce:!0,checks:[],...$(t)}))}s(Qc,"_coercedNumber");function eu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...$(t)})}s(eu,"_int");function tu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...$(t)})}s(tu,"_float32");function ru(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...$(t)})}s(ru,"_float64");function nu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...$(t)})}s(nu,"_int32");function ou(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...$(t)})}s(ou,"_uint32");function iu(e,t){return new e({type:"boolean",...$(t)})}s(iu,"_boolean");function su(e,t){return new e({type:"boolean",coerce:!0,...$(t)})}s(su,"_coercedBoolean");function cu(e,t){return new e({type:"bigint",...$(t)})}s(cu,"_bigint");function uu(e,t){return new e({type:"bigint",coerce:!0,...$(t)})}s(uu,"_coercedBigint");function au(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...$(t)})}s(au,"_int64");function lu(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...$(t)})}s(lu,"_uint64");function fu(e,t){return new e({type:"symbol",...$(t)})}s(fu,"_symbol");function pu(e,t){return new e({type:"undefined",...$(t)})}s(pu,"_undefined");function du(e,t){return new e({type:"null",...$(t)})}s(du,"_null");function mu(e){return new e({type:"any"})}s(mu,"_any");function hu(e){return new e({type:"unknown"})}s(hu,"_unknown");function gu(e,t){return new e({type:"never",...$(t)})}s(gu,"_never");function yu(e,t){return new e({type:"void",...$(t)})}s(yu,"_void");function _u(e,t){return new e({type:"date",...$(t)})}s(_u,"_date");function $u(e,t){return new e({type:"date",coerce:!0,...$(t)})}s($u,"_coercedDate");function wu(e,t){return new e({type:"nan",...$(t)})}s(wu,"_nan");function me(e,t){return new dn({check:"less_than",...$(t),value:e,inclusive:!1})}s(me,"_lt");function se(e,t){return new dn({check:"less_than",...$(t),value:e,inclusive:!0})}s(se,"_lte");function he(e,t){return new mn({check:"greater_than",...$(t),value:e,inclusive:!1})}s(he,"_gt");function ce(e,t){return new mn({check:"greater_than",...$(t),value:e,inclusive:!0})}s(ce,"_gte");function po(e){return he(0,e)}s(po,"_positive");function mo(e){return me(0,e)}s(mo,"_negative");function ho(e){return se(0,e)}s(ho,"_nonpositive");function go(e){return ce(0,e)}s(go,"_nonnegative");function Oe(e,t){return new os({check:"multiple_of",...$(t),value:e})}s(Oe,"_multipleOf");function Ae(e,t){return new cs({check:"max_size",...$(t),maximum:e})}s(Ae,"_maxSize");function ge(e,t){return new us({check:"min_size",...$(t),minimum:e})}s(ge,"_minSize");function qe(e,t){return new as({check:"size_equals",...$(t),size:e})}s(qe,"_size");function Ge(e,t){return new ls({check:"max_length",...$(t),maximum:e})}s(Ge,"_maxLength");function ve(e,t){return new fs({check:"min_length",...$(t),minimum:e})}s(ve,"_minLength");function He(e,t){return new ps({check:"length_equals",...$(t),length:e})}s(He,"_length");function yt(e,t){return new ds({check:"string_format",format:"regex",...$(t),pattern:e})}s(yt,"_regex");function _t(e){return new ms({check:"string_format",format:"lowercase",...$(e)})}s(_t,"_lowercase");function $t(e){return new hs({check:"string_format",format:"uppercase",...$(e)})}s($t,"_uppercase");function wt(e,t){return new gs({check:"string_format",format:"includes",...$(t),includes:e})}s(wt,"_includes");function bt(e,t){return new ys({check:"string_format",format:"starts_with",...$(t),prefix:e})}s(bt,"_startsWith");function vt(e,t){return new _s({check:"string_format",format:"ends_with",...$(t),suffix:e})}s(vt,"_endsWith");function yo(e,t,r){return new $s({check:"property",property:e,schema:t,...$(r)})}s(yo,"_property");function xt(e,t){return new ws({check:"properties",shape:e,...$(t)})}s(xt,"_properties");function kt(e,t){return new bs({check:"mime_type",mime:e,...$(t)})}s(kt,"_mime");function de(e){return new vs({check:"overwrite",tx:e})}s(de,"_overwrite");function zt(e){return de(t=>t.normalize(e))}s(zt,"_normalize");function St(){return de(e=>e.trim())}s(St,"_trim");function Pt(){return de(e=>e.toLowerCase())}s(Pt,"_toLowerCase");function It(){return de(e=>e.toUpperCase())}s(It,"_toUpperCase");function Ot(){return de(e=>ii(e))}s(Ot,"_slugify");function bu(e,t,r){return new e({type:"array",element:t,...$(r)})}s(bu,"_array");function Sy(e,t,r){return new e({type:"union",options:t,...$(r)})}s(Sy,"_union");function Py(e,t,r){return new e({type:"union",options:t,inclusive:!1,...$(r)})}s(Py,"_xor");function Iy(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...$(n)})}s(Iy,"_discriminatedUnion");function Oy(e,t,r){return new e({type:"intersection",left:t,right:r})}s(Oy,"_intersection");function Ay(e,t,r,n){let o=r instanceof P,i=o?n:r,c=o?r:null;return new e({type:"tuple",items:t,rest:c,...$(i)})}s(Ay,"_tuple");function Zy(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...$(n)})}s(Zy,"_record");function Ny(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...$(n)})}s(Ny,"_map");function Ey(e,t,r){return new e({type:"set",valueType:t,...$(r)})}s(Ey,"_set");function Cy(e,t,r){let n=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:n,...$(r)})}s(Cy,"_enum");function Ty(e,t,r){return new e({type:"enum",entries:t,...$(r)})}s(Ty,"_nativeEnum");function Dy(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...$(r)})}s(Dy,"_literal");function vu(e,t){return new e({type:"file",...$(t)})}s(vu,"_file");function Ry(e,t){return new e({type:"transform",transform:t})}s(Ry,"_transform");function jy(e,t){return new e({type:"optional",innerType:t})}s(jy,"_optional");function Ly(e,t){return new e({type:"nullable",innerType:t})}s(Ly,"_nullable");function Vy(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Kt(r)}})}s(Vy,"_default");function Fy(e,t,r){return new e({type:"nonoptional",innerType:t,...$(r)})}s(Fy,"_nonoptional");function My(e,t){return new e({type:"success",innerType:t})}s(My,"_success");function Uy(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:pi(r)})}s(Uy,"_catch");function By(e,t,r){return new e({type:"pipe",in:t,out:r})}s(By,"_pipe");function Jy(e,t){return new e({type:"readonly",innerType:t})}s(Jy,"_readonly");function Ky(e,t,r){return new e({type:"template_literal",parts:t,...$(r)})}s(Ky,"_templateLiteral");function Wy(e,t){return new e({type:"lazy",getter:t})}s(Wy,"_lazy");function qy(e,t){return new e({type:"promise",innerType:t})}s(qy,"_promise");function xu(e,t,r){let n=$(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}s(xu,"_custom");function ku(e,t,r){return new e({type:"custom",check:"custom",fn:t,...$(r)})}s(ku,"_refine");function zu(e,t){let r=jf(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(ut(o,n.value,r._zod.def));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(ut(i))}},e(n.value,n)),t);return r}s(zu,"_superRefine");function jf(e,t){let r=new j({check:"custom",...$(t)});return r._zod.check=e,r}s(jf,"_check");function Su(e){let t=new j({check:"describe"});return t._zod.onattach=[r=>{let n=K.get(r)??{};K.add(r,{...n,description:e})}],t._zod.check=()=>{},t}s(Su,"describe");function Pu(e){let t=new j({check:"meta"});return t._zod.onattach=[r=>{let n=K.get(r)??{};K.add(r,{...n,...e})}],t._zod.check=()=>{},t}s(Pu,"meta");function Iu(e,t){let r=$(t),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(h=>typeof h=="string"?h.toLowerCase():h),o=o.map(h=>typeof h=="string"?h.toLowerCase():h));let i=new Set(n),c=new Set(o),u=e.Codec??mr,a=e.Boolean??pr,l=e.String??Ue,f=new l({type:"string",error:r.error}),p=new a({type:"boolean",error:r.error}),m=new u({type:"pipe",in:f,out:p,transform:s(((h,g)=>{let _=h;return r.case!=="sensitive"&&(_=_.toLowerCase()),i.has(_)?!0:c.has(_)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...c],input:g.value,inst:m,continue:!1}),{})}),"transform"),reverseTransform:s(((h,g)=>h===!0?n[0]||"true":o[0]||"false"),"reverseTransform"),error:r.error});return m._zod.bag.truthy=n,m._zod.bag.falsy=o,m._zod.bag.case=r.case??"insensitive",m}s(Iu,"_stringbool");function Xe(e,t,r,n={}){let o=$(n),i={check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:u=>r.test(u),...o};return r instanceof RegExp&&(i.pattern=r),new e(i)}s(Xe,"_stringFormat");function Sr(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&J(e,n,r[n]);return e}s(Sr,"assignProps");function Ze(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??K,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}s(Ze,"initializeContext");function M(e,t,r,n,o){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(r,i),!0}s(M,"handleUnrepresentable");function D(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let c={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,c),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let u=e._zod.toJSONSchema?.();if(u)c.schema=u;else{let f={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,f);else{let m=c.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,m,f)}let p=e._zod.parent;p&&(c.ref||(c.ref=p),D(p,t,f),t.seen.get(p).isParent=!0)}let a=t.metadataRegistry.get(e);return a&&Sr(c.schema,a),t.io==="input"&&Y(e)&&(delete c.schema.examples,delete c.schema.default),t.io==="input"&&"_prefault"in c.schema&&((n=c.schema).default??(n.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}s(D,"processSchema");function Lf(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}s(Lf,"encodeJSONPointerSegment");function Ne(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let c of e.seen.entries()){let u=e.metadataRegistry.get(c[0])?.id;if(u){let a=n.get(u);if(a&&a!==c[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(u,c[0])}}let o=s(c=>{let u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(c[0])?.id,m=e.external.uri??(g=>g);if(p)return{ref:m(p)};let h=c[1].defId??c[1].schema.id??`schema${e.counter++}`;return c[1].defId=h,{defId:h,ref:`${m("__shared")}#/${u}/${Lf(h)}`}}let a="#",l=`${a}/${u}/`;if(c[1]===r&&!c[1].schema.id)return{ref:a};let f=c[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:l+Lf(f)}},"makeURI"),i=s(c=>{if(c[1].schema.$ref)return;let u=c[1],{ref:a,defId:l}=o(c);u.def={...u.schema},l&&(u.defId=l);let f=u.schema;for(let p in f)delete f[p];f.$ref=a},"extractToDef");if(e.cycles==="throw")for(let c of e.seen.entries()){let u=c[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
|
|
67
67
|
|
|
68
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let c of e.seen.entries()){let u=c[1];if(t===c[0]){i(c);continue}if(e.external){let l=e.external.registry.get(c[0])?.id;if(t!==c[0]&&l){i(c);continue}}if(e.metadataRegistry.get(c[0])?.id){i(c);continue}if(u.cycle){i(c);continue}u.count>1&&e.reused==="ref"&&i(c)}e.external&&(e.sharedDefsExtractedFor=e.external)}s(Ze,"extractDefs");function Mf(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!="object")return;Mf(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let c of Array.isArray(i)?i:[i]){if(typeof c!="string")return;r.includes(c)||r.push(c)}}delete e.anyOf,e.type=r.length===1?r[0]:r}s(Mf,"compactTypeUnion");var Uf=new Set(["type","properties","required","additionalProperties"]),Vf=["oneOf","anyOf"];function Ff(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}s(Ff,"undeclaredConstraint");function Iu(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let c in i)if(!Uf.has(c))return null;t.push(i)}let r={},n=new Set;for(let i of t){for(let c in i.properties){if(Object.prototype.hasOwnProperty.call(r,c))continue;let u=[];for(let l of t){let f=l.properties?.[c]??Ff(l);f!=null&&(u.some(p=>JSON.stringify(p)===JSON.stringify(f))||u.push(f))}let a=u.length===1?u[0]:Iu(u)??{allOf:u};J(r,c,a)}for(let c of i.required??[])n.add(c)}let o={type:"object",properties:r};if(n.size&&(o.required=[...n]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let c of t){let u=Ff(c);u&&!i.some(a=>JSON.stringify(a)===JSON.stringify(u))&&i.push(u)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}s(Iu,"foldObjects");function qy(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of Uf)if(o in e)return;let r=t.filter(o=>Vf.some(i=>Array.isArray(o[i]))),n=null;if(!r.length)n=Iu(t);else{let o=r[0],i=Vf.find(a=>Array.isArray(o[a]));if(Object.keys(o).length!==1)return;let c=t.filter(a=>a!==o),u=o[i].map(a=>Iu([...c,a]));if(u.some(a=>!a))return;n={[i]:u}}n&&(delete e.allOf,Sr(e,n))}s(qy,"foldIntersection");function Ne(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=s(u=>{let a=e.seen.get(u);if(a.ref===null)return;let l=a.def??a.schema,f={...l},p=a.ref;if(a.ref=null,p){n(p);let h=e.seen.get(p),g=h.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(g)):Sr(l,g),Sr(l,f),u._zod.parent===p)for(let w in l)w==="$ref"||w==="allOf"||w in f||delete l[w];if(g.$ref&&h.def)for(let w in l)w==="$ref"||w==="allOf"||w in h.def&&JSON.stringify(l[w])===JSON.stringify(h.def[w])&&delete l[w]}let m=u._zod.parent;if(m&&m!==p){n(m);let h=e.seen.get(m);if(h?.schema.$ref&&(l.$ref=h.schema.$ref,h.def))for(let g in l)g==="$ref"||g==="allOf"||g in h.def&&JSON.stringify(l[g])===JSON.stringify(h.def[g])&&delete l[g]}e.override({zodSchema:u,jsonSchema:l,path:a.path??[]})},"flattenRef");if(!e.external||e.sharedEmitDoneFor!==e.external){for(let u of[...e.seen.entries()].reverse())n(u[0]);if(e.target!=="openapi-3.0")for(let u of e.seen.entries())Mf(u[1].def??u[1].schema);for(let u of e.deferred)u();if(e.intersections.length){let u=new Map;for(let a of e.seen.values())for(let l of[a.schema,a.def]){let f=l?.allOf;if(!Array.isArray(f))continue;let p=u.get(f);p?p.push(l):u.set(f,[l])}for(let a of e.intersections)for(let l of u.get(a)??[])qy(l)}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let u=e.external.registry.get(t)?.id;if(!u)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(u)}Sr(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let c=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let u of e.seen.entries()){let a=u[1];a.def&&a.defId&&(a.def.id===a.defId&&delete a.def.id,J(c,a.defId,a.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?o.$defs=c:o.definitions=c);try{let u=JSON.parse(JSON.stringify(o));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:At(t,"input",e.processors),output:At(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}s(Ne,"finalize");function Y(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Y(n.element,r);if(n.type==="set")return Y(n.valueType,r);if(n.type==="lazy")return Y(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return Y(n.innerType,r);if(n.type==="intersection")return Y(n.left,r)||Y(n.right,r);if(n.type==="record"||n.type==="map")return Y(n.keyType,r)||Y(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Y(n.in,r)||Y(n.out,r);if(n.type==="object"){for(let o in n.shape)if(Y(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(Y(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(Y(o,r))return!0;return!!(n.rest&&Y(n.rest,r))}return!1}s(Y,"isTransforming");var Ou=s((e,t={})=>r=>{let n=Ae({...r,processors:t});return D(e,n),Ze(n,e),Ne(n,e)},"createToJSONSchemaMethod"),At=s((e,t,r={})=>n=>{let{libraryOptions:o,target:i}=n??{},c=Ae({...o??{},target:i,io:t,processors:r});return D(e,c),Ze(c,e),Ne(c,e)},"createStandardJSONSchemaMethod");var Zt=s((e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},"narrowMin"),Nt=s((e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},"narrowMax"),Bf=s((e,t)=>{Zt(e,"minimum",t),Nt(e,"maximum",t)},"narrowBoth"),qf=s((e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},"addDivisor"),Gf=s((e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},"addPattern"),Hf=s((e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},"intersectMime"),Xf=s((e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},"setFormat"),Jf=s((e,t)=>Zt(e,"minimum",t.minimum),"minContributor"),Kf=s((e,t)=>Nt(e,"maximum",t.maximum),"maxContributor"),Wf=s(e=>(t,r)=>{Xf(t,r.format);let[n,o]=e[r.format];Zt(t,"minimum",n),Nt(t,"maximum",o)},"formatContributor"),Gy={greater_than:s((e,t)=>Zt(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),"greater_than"),less_than:s((e,t)=>Nt(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),"less_than"),multiple_of:s((e,t)=>qf(e,t.value),"multiple_of"),number_format:Wf(qt),bigint_format:Wf(Gt),min_length:Jf,max_length:Kf,length_equals:s((e,t)=>Bf(e,t.length),"length_equals"),min_size:Jf,max_size:Kf,size_equals:s((e,t)=>Bf(e,t.size),"size_equals"),string_format:s((e,t)=>{Xf(e,t.format),t.pattern&&Gf(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},"string_format"),mime_type:s((e,t)=>Hf(e,t.mime),"mime_type")};function U(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)Gy[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&Zt(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&Zt(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&Nt(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&Nt(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&qf(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&Hf(t,o.mime);for(let i of o.patterns??[])Gf(t,i);return t}s(U,"aggregateChecks");var Hy={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Xy=new Map([[kn,Ri],[fr,ji]]),Yf=s(e=>Xy.get(e)??e,"exactPattern"),Nu=s((e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:c,format:u,patterns:a,contentEncoding:l,laxFormat:f}=U(e);if(typeof i=="number"&&(o.minLength=i),typeof c=="number"&&(o.maxLength=c),u&&(o.format=Hy[u]??u,o.format===""&&delete o.format,(u==="time"||f)&&delete o.format),l&&(o.contentEncoding=l),a&&a.size>0){let p=[...a].map(Yf);p.length===1?o.pattern=p[0].source:p.length>1&&(o.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},"stringProcessor"),Eu=s((e,t,r,n)=>{let o=r,{minimum:i,maximum:c,multipleOf:u,exclusiveMaximum:a,exclusiveMinimum:l,isInt:f}=U(e);o.type=f?"integer":"number";let p=typeof l=="number"&&l>=(i??Number.NEGATIVE_INFINITY),m=typeof a=="number"&&a<=(c??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(p?h?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l:typeof i=="number"&&(o.minimum=i),m?h?(o.maximum=a,o.exclusiveMaximum=!0):o.exclusiveMaximum=a:typeof c=="number"&&(o.maximum=c),u){let g=new Set;for(let z of u)Number.isFinite(z)&&z!==0?g.add(Math.abs(z)):M(e,t,o,n,`A multipleOf divisor of ${z} cannot be represented in JSON Schema`);let[_,...w]=g;_!==void 0&&(o.multipleOf=_),w.length&&(o.allOf=[...o.allOf??[],...w.map(z=>({multipleOf:z}))])}},"numberProcessor"),Cu=s((e,t,r,n)=>{r.type="boolean"},"booleanProcessor"),Tu=s((e,t,r,n)=>{M(e,t,r,n,"BigInt cannot be represented in JSON Schema")},"bigintProcessor"),Du=s((e,t,r,n)=>{M(e,t,r,n,"Symbols cannot be represented in JSON Schema")},"symbolProcessor"),Ru=s((e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},"nullProcessor"),ju=s((e,t,r,n)=>{M(e,t,r,n,"Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),Lu=s((e,t,r,n)=>{M(e,t,r,n,"Void cannot be represented in JSON Schema")},"voidProcessor"),Vu=s((e,t,r,n)=>{r.not={}},"neverProcessor"),Fu=s((e,t,r,n)=>{},"anyProcessor"),Mu=s((e,t,r,n)=>{},"unknownProcessor"),Uu=s((e,t,r,n)=>{M(e,t,r,n,"Date cannot be represented in JSON Schema")},"dateProcessor"),Bu=s((e,t,r,n)=>{let o=e._zod.def,i=ot(o.entries);if(i.length===0){r.not={};return}i.every(c=>typeof c=="number")&&(r.type="number"),i.every(c=>typeof c=="string")&&(r.type="string"),r.enum=i},"enumProcessor"),Ju=s((e,t,r,n)=>{let o=e._zod.def;if(o.values.length===0){r.not={};return}let i=[];for(let c of o.values)if(c===void 0){if(M(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof c=="bigint"){if(M(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(c))}else i.push(c);if(i.length!==0)if(i.length===1){let c=i[0];r.type=c===null?"null":typeof c,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[c]:r.const=c}else i.every(c=>typeof c=="number")&&(r.type="number"),i.every(c=>typeof c=="string")&&(r.type="string"),i.every(c=>typeof c=="boolean")&&(r.type="boolean"),i.every(c=>c===null)&&(r.type="null"),r.enum=i},"literalProcessor"),Ku=s((e,t,r,n)=>{M(e,t,r,n,"NaN cannot be represented in JSON Schema")},"nanProcessor"),Wu=s((e,t,r,n)=>{let o=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source},"templateLiteralProcessor"),qu=s((e,t,r,n)=>{let o=r;o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:i,maximum:c,mime:u}=U(e);i!==void 0&&(o.minLength=i),c!==void 0&&(o.maxLength=c),u&&(u.length===0?o.not={}:u.length===1?o.contentMediaType=u[0]:o.anyOf=u.map(a=>({contentMediaType:a})))},"fileProcessor"),Gu=s((e,t,r,n)=>{r.type="boolean"},"successProcessor"),Hu=s((e,t,r,n)=>{M(e,t,r,n,"Custom types cannot be represented in JSON Schema")},"customProcessor"),Xu=s((e,t,r,n)=>{M(e,t,r,n,"Function types cannot be represented in JSON Schema")},"functionProcessor"),Yu=s((e,t,r,n)=>{M(e,t,r,n,"Transforms cannot be represented in JSON Schema")},"transformProcessor"),Qu=s((e,t,r,n)=>{M(e,t,r,n,"Map cannot be represented in JSON Schema")},"mapProcessor"),ea=s((e,t,r,n)=>{M(e,t,r,n,"Set cannot be represented in JSON Schema")},"setProcessor"),ta=s((e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:c,maximum:u}=U(e);typeof c=="number"&&(o.minItems=c),typeof u=="number"&&(o.maxItems=u),o.type="array",o.items=D(i.element,t,{...n,path:[...n.path,"items"]})},"arrayProcessor");function Pr(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Pr(t.out):t.type==="catch"?Pr(t.innerType):e._zod.optin}s(Pr,"inputOptin");var ra=s((e,t,r,n)=>{let o=r,i=e._zod.def,c=i.shape;if(Object.getOwnPropertySymbols(c).length&&M(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let l in c)J(o.properties,l,D(c[l],t,{...n,path:[...n.path,"properties",l]}));let a=[];for(let l of Object.keys(c)){let f=i.shape[l];(t.io==="input"?Pr(f)===void 0:f._zod.optout===void 0)&&a.push(l)}a.length>0&&(o.required=a),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=D(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},"objectProcessor"),$o=s((e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===!1,c=o.options.map((u,a)=>D(u,t,{...n,path:[...n.path,i?"oneOf":"anyOf",a]}));i?r.oneOf=c:r.anyOf=c},"unionProcessor"),na=s((e,t,r,n)=>{let o=e._zod.def,i=D(o.left,t,{...n,path:[...n.path,"allOf",0]}),c=D(o.right,t,{...n,path:[...n.path,"allOf",1]}),u=s(l=>"allOf"in l&&Object.keys(l).length===1,"isSimpleIntersection"),a=[...u(i)?i.allOf:[i],...u(c)?c.allOf:[c]];r.allOf=a,t.intersections.push(a)},"intersectionProcessor"),oa=s((e,t,r,n)=>{let o=r,i=e._zod.def;o.type="array";let c=t.target==="draft-2020-12"?"prefixItems":"items",u=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",a=i.items.map((_,w)=>D(_,t,{...n,path:[...n.path,c,w]})),l=i.rest?D(i.rest,t,{...n,path:[...n.path,u,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null,f=i.items.length;for(;f>0;){let _=i.items[f-1];if(!(t.io==="input"?Pr(_)!==void 0:_._zod.optout==="optional"))break;f--}let p=i.items.length,m=!i.rest;t.target==="draft-2020-12"?(o.prefixItems=a,m?o.items=!1:l&&(o.items=l),f>0&&(o.minItems=f),m&&(o.maxItems=p)):t.target==="openapi-3.0"?(o.items={anyOf:a},l&&o.items.anyOf.push(l),f>0&&(o.minItems=f),m&&(o.maxItems=p)):(o.items=a,m?o.additionalItems=!1:l&&(o.additionalItems=l),f>0&&(o.minItems=f),m&&(o.maxItems=p));let{minimum:h,maximum:g}=U(e);typeof h=="number"&&(o.minItems=h),typeof g=="number"&&(o.maxItems=g)},"tupleProcessor");function Au(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let g=e.get(t)?.def;if(!g)return t;let _=Au(e,g,r);return _===g?t:_}for(let g of["anyOf","oneOf"]){let _=t[g];if(!Array.isArray(_))continue;let w=_.map(z=>Au(e,z,r));w.some((z,x)=>z!==_[x])&&(t={...t,[g]:w})}let n=Array.isArray(t.type)?t.type:[t.type],o=!n.includes("string")&&n.some(g=>g==="number"||g==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(g=>typeof g=="number"))return t;let{minimum:c,maximum:u,exclusiveMinimum:a,exclusiveMaximum:l,multipleOf:f,format:p,id:m,...h}=t;return h.enum?h.enum=h.enum.map(g=>typeof g=="number"?String(g):g):typeof h.const=="number"&&(h.const=String(h.const)),o&&(h.type="string",i||(h.pattern=(n.includes("number")?be:or).source)),h}s(Au,"stringifyKeyNames");var Zu=new WeakMap;function Yy(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let r=new Map;for(let n of Zu.get(e)??[]){let o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===!0||r.has(i))continue;let c=Au(t,i,new Set);c!==i&&r.set(i,c)}if(r.size)for(let n of e.seen.values())for(let o of[n.schema,n.def]){let i=o&&r.get(o.propertyNames);i&&(o.propertyNames=i)}}s(Yy,"rewriteKeyNames");var ia=s((e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object";let c=i.keyType,u=U(c).patterns;if(i.mode==="loose"&&u&&u.size>0){let f=D(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let p of u)J(o.patternProperties,Yf(p).source,f)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=D(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let f=Zu.get(t);f||(f=[],Zu.set(t,f),t.deferred.push(()=>Yy(t))),f.push(e)}o.additionalProperties=D(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let a=c._zod.values,l=t.io==="input"&&Pr(i.valueType)!==void 0;if(a&&!i.partial&&!l){let f=[...a].filter(p=>typeof p=="string"||typeof p=="number");f.length>0&&(o.required=f.map(String))}},"recordProcessor"),sa=s((e,t,r,n)=>{let o=e._zod.def,i=D(o.innerType,t,n),c=t.seen.get(e);t.target==="openapi-3.0"?(c.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},"nullableProcessor"),ca=s((e,t,r,n)=>{let o=e._zod.def;D(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},"nonoptionalProcessor"),ua=Symbol();function Qf(e,t,r,n,o){let i=!1,c=JSON.stringify(e,(u,a)=>typeof a!="bigint"?a:(i=!0,null));return i?(M(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),ua):JSON.parse(c)}s(Qf,"serializeDefaultValue");var aa=s((e,t,r,n)=>{let o=e._zod.def;D(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let c=Qf(o.defaultValue,e,t,r,n);c!==ua&&(r.default=c)},"defaultProcessor"),la=s((e,t,r,n)=>{let o=e._zod.def;D(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let c=Qf(o.defaultValue,e,t,r,n);c!==ua&&(r._prefault=c)},"prefaultProcessor"),fa=s((e,t,r,n)=>{let o=e._zod.def;D(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let c;try{c=o.catchValue(void 0)}catch{M(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=c},"catchProcessor"),pa=s((e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),c=t.io==="input"?i?o.out:o.in:o.out;D(c,t,n);let u=t.seen.get(e);u.ref=c},"pipeProcessor"),da=s((e,t,r,n)=>{let o=e._zod.def;D(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0},"readonlyProcessor"),ma=s((e,t,r,n)=>{let o=e._zod.def;D(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},"promiseProcessor"),wo=s((e,t,r,n)=>{let o=e._zod.def;D(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},"optionalProcessor"),ha=s((e,t,r,n)=>{let o=e._zod.innerType;D(o,t,n);let i=t.seen.get(e);i.ref=o},"lazyProcessor"),_o={string:Nu,number:Eu,boolean:Cu,bigint:Tu,symbol:Du,null:Ru,undefined:ju,void:Lu,never:Vu,any:Fu,unknown:Mu,date:Uu,enum:Bu,literal:Ju,nan:Ku,template_literal:Wu,file:qu,success:Gu,custom:Hu,function:Xu,transform:Yu,map:Qu,set:ea,array:ta,object:ra,union:$o,intersection:na,tuple:oa,record:ia,nullable:sa,nonoptional:ca,default:aa,prefault:la,catch:fa,pipe:pa,readonly:da,promise:ma,optional:wo,lazy:ha};function bo(e,t){if("_idmap"in e){let n=e,o=Ae({...t,processors:_o}),i={};for(let a of n._idmap.entries()){let[l,f]=a;D(f,o)}let c={},u={registry:n,uri:t?.uri,defs:i};o.external=u;for(let a of n._idmap.entries()){let[l,f]=a;Ze(o,f),J(c,l,Ne(o,f))}if(Object.keys(i).length>0){let a=o.target==="draft-2020-12"?"$defs":"definitions";c.__shared={[a]:i}}return{schemas:c}}let r=Ae({...t,processors:_o});return D(e,r),Ze(r,e),Ne(r,e)}s(bo,"toJSONSchema");var vo=class{static{s(this,"JSONSchemaGenerator")}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(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Ae({processors:_o,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return D(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Ze(this.ctx,t);let n=Ne(this.ctx,t),{"~standard":o,...i}=n;return i}};var ep={};var Vt={};_e(Vt,{ZodAny:()=>Ra,ZodArray:()=>Fa,ZodBase64:()=>Fo,ZodBase64URL:()=>Mo,ZodBigInt:()=>jt,ZodBigIntFormat:()=>Jo,ZodBoolean:()=>Rt,ZodCIDRv4:()=>Lo,ZodCIDRv6:()=>Vo,ZodCUID:()=>No,ZodCUID2:()=>Eo,ZodCatch:()=>ul,ZodCodec:()=>Rr,ZodCreditCard:()=>Oa,ZodCustom:()=>jr,ZodCustomStringFormat:()=>et,ZodDate:()=>Zr,ZodDefault:()=>rl,ZodDiscriminatedUnion:()=>Ua,ZodE164:()=>Uo,ZodEmail:()=>Io,ZodEmoji:()=>Ao,ZodEnum:()=>Ct,ZodExactOptional:()=>Go,ZodFile:()=>Ya,ZodFunction:()=>_l,ZodGUID:()=>Oo,ZodIBAN:()=>Aa,ZodIPv4:()=>Ro,ZodIPv6:()=>jo,ZodISODate:()=>Ce,ZodISODateTime:()=>Ee,ZodISODuration:()=>De,ZodISOTime:()=>Te,ZodInstanceOf:()=>bl,ZodIntersection:()=>Ba,ZodJWT:()=>Bo,ZodKSUID:()=>Do,ZodLazy:()=>hl,ZodLiteral:()=>Xa,ZodMAC:()=>Ia,ZodMap:()=>Ga,ZodNaN:()=>ll,ZodNanoID:()=>Zo,ZodNever:()=>La,ZodNonOptional:()=>Ho,ZodNull:()=>Ta,ZodNullable:()=>tl,ZodNumber:()=>Dt,ZodNumberFormat:()=>tt,ZodObject:()=>Er,ZodOptional:()=>Tr,ZodPipe:()=>Dr,ZodPrefault:()=>ol,ZodPreprocess:()=>fl,ZodPromise:()=>yl,ZodReadonly:()=>pl,ZodRecord:()=>Et,ZodSet:()=>Ha,ZodString:()=>Tt,ZodStringFormat:()=>R,ZodSuccess:()=>cl,ZodSymbol:()=>Ea,ZodTemplateLiteral:()=>ml,ZodTransform:()=>Qa,ZodTuple:()=>Ka,ZodType:()=>O,ZodULID:()=>Co,ZodURL:()=>Ar,ZodUUID:()=>ye,ZodUndefined:()=>Ca,ZodUnion:()=>Cr,ZodUnknown:()=>ja,ZodVoid:()=>Va,ZodXID:()=>To,ZodXor:()=>Ma,_ZodString:()=>Po,_default:()=>nl,_function:()=>pd,any:()=>Up,array:()=>Nr,base64:()=>xp,base64url:()=>kp,bigint:()=>jp,boolean:()=>Na,catch:()=>al,check:()=>dd,cidrv4:()=>bp,cidrv6:()=>vp,codec:()=>ud,creditCard:()=>Sp,cuid:()=>dp,cuid2:()=>mp,currencyCode:()=>Np,custom:()=>md,date:()=>Jp,describe:()=>hd,discriminatedUnion:()=>Xp,e164:()=>zp,email:()=>np,emoji:()=>fp,enum:()=>Wo,exactOptional:()=>el,file:()=>od,float32:()=>Cp,float64:()=>Tp,function:()=>pd,guid:()=>op,hash:()=>Ep,hex:()=>Zp,hostname:()=>Ap,httpUrl:()=>lp,iban:()=>Pp,instanceof:()=>yd,int:()=>zo,int32:()=>Dp,int64:()=>Lp,intersection:()=>Ja,invertCodec:()=>ad,ipv4:()=>_p,ipv6:()=>wp,json:()=>$d,jwt:()=>Ip,keyof:()=>Kp,ksuid:()=>yp,lazy:()=>gl,literal:()=>nd,looseObject:()=>Gp,looseRecord:()=>Qp,mac:()=>$p,map:()=>ed,meta:()=>gd,nan:()=>cd,nanoid:()=>pp,nativeEnum:()=>rd,never:()=>Ko,nonoptional:()=>sl,null:()=>Da,nullable:()=>Or,nullish:()=>id,number:()=>Za,object:()=>Wp,optional:()=>Ye,partialRecord:()=>Yp,pipe:()=>So,prefault:()=>il,preprocess:()=>wd,promise:()=>fd,readonly:()=>dl,record:()=>qa,refine:()=>$l,set:()=>td,strictObject:()=>qp,string:()=>Ir,stringFormat:()=>Op,stringbool:()=>_d,success:()=>sd,superRefine:()=>wl,symbol:()=>Fp,templateLiteral:()=>ld,transform:()=>qo,tuple:()=>Wa,uint32:()=>Rp,uint64:()=>Vp,ulid:()=>hp,undefined:()=>Mp,union:()=>Lt,unknown:()=>Xe,url:()=>ap,uuid:()=>ip,uuidv4:()=>sp,uuidv6:()=>cp,uuidv7:()=>up,void:()=>Bp,xid:()=>gp,xor:()=>Hp});var xo={};_e(xo,{endsWith:()=>vt,gt:()=>he,gte:()=>ce,includes:()=>wt,length:()=>Ge,lowercase:()=>_t,lt:()=>me,lte:()=>se,maxLength:()=>qe,maxSize:()=>Oe,mime:()=>kt,minLength:()=>ve,minSize:()=>ge,multipleOf:()=>Ie,negative:()=>mo,nonnegative:()=>go,nonpositive:()=>ho,normalize:()=>zt,overwrite:()=>de,positive:()=>po,properties:()=>xt,property:()=>yo,regex:()=>yt,size:()=>We,slugify:()=>Ot,startsWith:()=>bt,toLowerCase:()=>Pt,toUpperCase:()=>It,trim:()=>St,uppercase:()=>$t});var tp=new WeakSet([Object.prototype,Error.prototype]);function ko(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}s(ko,"_lazyMethod");var rp=s((e,t)=>{yi.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);tp.has(r)||(tp.add(r),ko(r,"format",n=>o=>er(n,o)),ko(r,"flatten",n=>o=>Qt(n,o)),ko(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,it,2)}),ko(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,it,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},"initializer"),e_=d("ZodError",rp),oe=d("ZodError",rp,void 0,{Parent:Error});var ga=at(oe),ya=lt(oe),_a=ft(oe),$a=pt(oe),wa=en(oe),ba=tn(oe),va=rn(oe),xa=nn(oe),ka=on(oe),za=sn(oe),Sa=cn(oe),Pa=un(oe);function r_(){B.localeError||F($r())}s(r_,"_ensureDefaultLocale");function Qe(){B.memoizer||F({memoizer:_r()})}s(Qe,"_ensureDefaultMemoizer");var O=d("ZodType",(e,t)=>(r_(),P.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(v.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return C(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check($l(e,t))},superRefine(e,t){return this.check(wl(e,t))},overwrite(e){return this.check(de(e))},optional(){return Ye(this)},exactOptional(){return el(this)},nullable(){return Or(this)},nullish(){return Ye(Or(this))},nonoptional(e){return sl(this,e)},array(){return Nr(this)},or(e){return Lt([this,e])},and(e){return Ja(this,e)},transform(e){return So(this,qo(e))},default(e){return nl(this,e)},prefault(e){return il(this,e)},catch(e){return al(this,e)},pipe(e){return So(this,e)},readonly(){return dl(this)},describe(e){let t=this.clone();return K.add(t,{description:e}),t},meta(...e){if(e.length===0)return K.get(this);let t=this.clone();return K.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return v.hide(this,"~standard",{...$n(this),jsonSchema:{input:At(this,"input"),output:At(this,"output")}})},set"~standard"(e){v.own(this,"~standard",e)},parse:s(function e(t,r){return ga(this,t,r,{callee:e})},"_parse"),parseAsync:s(async function e(t,r){return await ya(this,t,r,{callee:e})},"_parseAsync"),safeParse(e,t){return _a(this,e,t)},async safeParseAsync(e,t){return $a(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){v.own(this,"spa",e)},validate(e,t){return tr(this,e,t)},validateAsync(e,t){return rr(this,e,t)},encode:s(function e(t,r){return wa(this,t,r,{callee:e})},"_encode"),decode:s(function e(t,r){return ba(this,t,r,{callee:e})},"_decode"),encodeAsync:s(async function e(t,r){return await va(this,t,r,{callee:e})},"_encodeAsync"),decodeAsync:s(async function e(t,r){return await xa(this,t,r,{callee:e})},"_decodeAsync"),safeEncode(e,t){return ka(this,e,t)},safeDecode(e,t){return za(this,e,t)},async safeEncodeAsync(e,t){return Sa(this,e,t)},async safeDecodeAsync(e,t){return Pa(this,e,t)},toJSONSchema(e){return Ou(this,{})(e)},get description(){return K.get(this)?.description},get _def(){return this._zod.def}}),Po=d("_ZodString",(e,t)=>{Me.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Nu(e,r,n,o)},v.derived({format:s(e=>U(e).format??null,"format"),minLength:s(e=>U(e).minimum??null,"minLength"),maxLength:s(e=>U(e).maximum??null,"maxLength")},{regex(...e){return this.check(yt(...e))},includes(...e){return this.check(wt(...e))},startsWith(...e){return this.check(bt(...e))},endsWith(...e){return this.check(vt(...e))},min(...e){return this.check(ve(...e))},max(...e){return this.check(qe(...e))},length(...e){return this.check(Ge(...e))},nonempty(...e){return this.check(ve(1,...e))},lowercase(e){return this.check(_t(e))},uppercase(e){return this.check($t(e))},trim(){return this.check(St())},normalize(...e){return this.check(zt(...e))},toLowerCase(){return this.check(Pt())},toUpperCase(){return this.check(It())},slugify(){return this.check(Ot())}})),Tt=d("ZodString",(e,t)=>{Me.init(e,t),Po.init(e,t)},{email(e){return this.check(Jn(Io,e))},url(e){return this.check(br(Ar,e))},jwt(e){return this.check(fo(Bo,e))},emoji(e){return this.check(Xn(Ao,e))},guid(e){return this.check(Kn(Oo,e))},uuid(e){return this.check(Wn(ye,e))},uuidv4(e){return this.check(qn(ye,e))},uuidv6(e){return this.check(Gn(ye,e))},uuidv7(e){return this.check(Hn(ye,e))},nanoid(e){return this.check(Yn(Zo,e))},cuid(e){return this.check(Qn(No,e))},cuid2(e){return this.check(eo(Eo,e))},ulid(e){return this.check(to(Co,e))},base64(e){return this.check(uo(Fo,e))},base64url(e){return this.check(ao(Mo,e))},xid(e){return this.check(ro(To,e))},ksuid(e){return this.check(no(Do,e))},ipv4(e){return this.check(oo(Ro,e))},ipv6(e){return this.check(io(jo,e))},cidrv4(e){return this.check(so(Lo,e))},cidrv6(e){return this.check(co(Vo,e))},e164(e){return this.check(lo(Uo,e))},datetime(e){return this.check(vr(Ee,e))},date(e){return this.check(xr(Ce,e))},time(e){return this.check(kr(Te,e))},duration(e){return this.check(zr(De,e))}});function Ir(e){return Jc(Tt,e)}s(Ir,"string");var R=d("ZodStringFormat",(e,t)=>{T.init(e,t),Po.init(e,t)}),Ee=d("ZodISODateTime",(e,t)=>{Rs.init(e,t),R.init(e,t)}),Ce=d("ZodISODate",(e,t)=>{js.init(e,t),R.init(e,t)}),Te=d("ZodISOTime",(e,t)=>{Ls.init(e,t),R.init(e,t)}),De=d("ZodISODuration",(e,t)=>{Vs.init(e,t),R.init(e,t)}),Io=d("ZodEmail",(e,t)=>{Ss.init(e,t),R.init(e,t)});function np(e){return Jn(Io,e)}s(np,"email");var Oo=d("ZodGUID",(e,t)=>{ks.init(e,t),R.init(e,t)});function op(e){return Kn(Oo,e)}s(op,"guid");var ye=d("ZodUUID",(e,t)=>{zs.init(e,t),R.init(e,t)});function ip(e){return Wn(ye,e)}s(ip,"uuid");function sp(e){return qn(ye,e)}s(sp,"uuidv4");function cp(e){return Gn(ye,e)}s(cp,"uuidv6");function up(e){return Hn(ye,e)}s(up,"uuidv7");var Ar=d("ZodURL",(e,t)=>{Os.init(e,t),R.init(e,t)});function ap(e){return br(Ar,e)}s(ap,"url");function lp(e){return br(Ar,{protocol:nr,hostname:Vi,...v.normalizeParams(e)})}s(lp,"httpUrl");var Ao=d("ZodEmoji",(e,t)=>{As.init(e,t),R.init(e,t)});function fp(e){return Xn(Ao,e)}s(fp,"emoji");var Zo=d("ZodNanoID",(e,t)=>{Zs.init(e,t),R.init(e,t)});function pp(e){return Yn(Zo,e)}s(pp,"nanoid");var No=d("ZodCUID",(e,t)=>{Ns.init(e,t),R.init(e,t)});function dp(e){return Qn(No,e)}s(dp,"cuid");var Eo=d("ZodCUID2",(e,t)=>{Es.init(e,t),R.init(e,t)});function mp(e){return eo(Eo,e)}s(mp,"cuid2");var Co=d("ZodULID",(e,t)=>{Cs.init(e,t),R.init(e,t)});function hp(e){return to(Co,e)}s(hp,"ulid");var To=d("ZodXID",(e,t)=>{Ts.init(e,t),R.init(e,t)});function gp(e){return ro(To,e)}s(gp,"xid");var Do=d("ZodKSUID",(e,t)=>{Ds.init(e,t),R.init(e,t)});function yp(e){return no(Do,e)}s(yp,"ksuid");var Ro=d("ZodIPv4",(e,t)=>{Fs.init(e,t),R.init(e,t)});function _p(e){return oo(Ro,e)}s(_p,"ipv4");var Ia=d("ZodMAC",(e,t)=>{Us.init(e,t),R.init(e,t)});function $p(e){return Wc(Ia,e)}s($p,"mac");var jo=d("ZodIPv6",(e,t)=>{Ms.init(e,t),R.init(e,t)});function wp(e){return io(jo,e)}s(wp,"ipv6");var Lo=d("ZodCIDRv4",(e,t)=>{Bs.init(e,t),R.init(e,t)});function bp(e){return so(Lo,e)}s(bp,"cidrv4");var Vo=d("ZodCIDRv6",(e,t)=>{Js.init(e,t),R.init(e,t)});function vp(e){return co(Vo,e)}s(vp,"cidrv6");var Fo=d("ZodBase64",(e,t)=>{Ks.init(e,t),R.init(e,t)});function xp(e){return uo(Fo,e)}s(xp,"base64");var Mo=d("ZodBase64URL",(e,t)=>{Ws.init(e,t),R.init(e,t)});function kp(e){return ao(Mo,e)}s(kp,"base64url");var Uo=d("ZodE164",(e,t)=>{qs.init(e,t),R.init(e,t)});function zp(e){return lo(Uo,e)}s(zp,"e164");var Oa=d("ZodCreditCard",(e,t)=>{Gs.init(e,t),R.init(e,t)});function Sp(e){return qc(Oa,e)}s(Sp,"creditCard");var Aa=d("ZodIBAN",(e,t)=>{Hs.init(e,t),R.init(e,t)});function Pp(e){return Gc(Aa,e)}s(Pp,"iban");var Bo=d("ZodJWT",(e,t)=>{Xs.init(e,t),R.init(e,t)});function Ip(e){return fo(Bo,e)}s(Ip,"jwt");var et=d("ZodCustomStringFormat",(e,t)=>{Ys.init(e,t),R.init(e,t)});function Op(e,t,r={}){return He(et,e,t,r)}s(Op,"stringFormat");function Ap(e){return He(et,"hostname",Li,e)}s(Ap,"hostname");function Zp(e){return He(et,"hex",es,e)}s(Zp,"hex");function Np(e){return He(et,"currency_code",Mi,e)}s(Np,"currencyCode");function Ep(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,o=le[n];if(!o)throw new Error(`Unrecognized hash format: ${n}`);return He(et,n,o,t)}s(Ep,"hash");var Dt=d("ZodNumber",(e,t)=>{On.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Eu(e,r,n,o),e.isFinite=!0},v.derived({minValue:s(e=>{let{minimum:t,exclusiveMinimum:r}=U(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},"minValue"),maxValue:s(e=>{let{maximum:t,exclusiveMaximum:r}=U(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},"maxValue"),isInt:s(e=>{let{isInt:t,multipleOf:r}=U(e);return!!t||!!r?.some(Number.isSafeInteger)},"isInt"),format:s(e=>U(e).format??null,"format")},{gt(e,t){return this.check(he(e,t))},gte(e,t){return this.check(ce(e,t))},min(e,t){return this.check(ce(e,t))},lt(e,t){return this.check(me(e,t))},lte(e,t){return this.check(se(e,t))},max(e,t){return this.check(se(e,t))},int(e){return this.check(zo(e))},safe(e){return this.check(zo(e))},positive(e){return this.check(he(0,e))},nonnegative(e){return this.check(ce(0,e))},negative(e){return this.check(me(0,e))},nonpositive(e){return this.check(se(0,e))},multipleOf(e,t){return this.check(Ie(e,t))},step(e,t){return this.check(Ie(e,t))},finite(){return this}}));function Za(e){return Xc(Dt,e)}s(Za,"number");var tt=d("ZodNumberFormat",(e,t)=>{Qs.init(e,t),Dt.init(e,t)});function zo(e){return Qc(tt,e)}s(zo,"int");function Cp(e){return eu(tt,e)}s(Cp,"float32");function Tp(e){return tu(tt,e)}s(Tp,"float64");function Dp(e){return ru(tt,e)}s(Dp,"int32");function Rp(e){return nu(tt,e)}s(Rp,"uint32");var Rt=d("ZodBoolean",(e,t)=>{pr.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Cu(e,r,n,o)});function Na(e){return ou(Rt,e)}s(Na,"boolean");var jt=d("ZodBigInt",(e,t)=>{An.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Tu(e,r,n,o)},v.derived({minValue:s(e=>U(e).minimum??null,"minValue"),maxValue:s(e=>U(e).maximum??null,"maxValue"),format:s(e=>U(e).format??null,"format")},{gte(e,t){return this.check(ce(e,t))},min(e,t){return this.check(ce(e,t))},gt(e,t){return this.check(he(e,t))},lt(e,t){return this.check(me(e,t))},lte(e,t){return this.check(se(e,t))},max(e,t){return this.check(se(e,t))},positive(e){return this.check(he(BigInt(0),e))},negative(e){return this.check(me(BigInt(0),e))},nonpositive(e){return this.check(se(BigInt(0),e))},nonnegative(e){return this.check(ce(BigInt(0),e))},multipleOf(e,t){return this.check(Ie(e,t))}}));function jp(e){return su(jt,e)}s(jp,"bigint");var Jo=d("ZodBigIntFormat",(e,t)=>{ec.init(e,t),jt.init(e,t)});function Lp(e){return uu(Jo,e)}s(Lp,"int64");function Vp(e){return au(Jo,e)}s(Vp,"uint64");var Ea=d("ZodSymbol",(e,t)=>{tc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Du(e,r,n,o)});function Fp(e){return lu(Ea,e)}s(Fp,"symbol");var Ca=d("ZodUndefined",(e,t)=>{rc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ju(e,r,n,o)});function Mp(e){return fu(Ca,e)}s(Mp,"_undefined");var Ta=d("ZodNull",(e,t)=>{nc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ru(e,r,n,o)});function Da(e){return pu(Ta,e)}s(Da,"_null");var Ra=d("ZodAny",(e,t)=>{oc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fu(e,r,n,o)});function Up(){return du(Ra)}s(Up,"any");var ja=d("ZodUnknown",(e,t)=>{ic.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mu(e,r,n,o)});function Xe(){return mu(ja)}s(Xe,"unknown");var La=d("ZodNever",(e,t)=>{sc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vu(e,r,n,o)});function Ko(e){return hu(La,e)}s(Ko,"never");var Va=d("ZodVoid",(e,t)=>{cc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Lu(e,r,n,o)});function Bp(e){return gu(Va,e)}s(Bp,"_void");var Zr=d("ZodDate",(e,t)=>{uc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Uu(e,r,n,o),e.min=(r,n)=>e.check(ce(r,n)),e.max=(r,n)=>e.check(se(r,n))},v.derived({minDate:s(e=>{let{minimum:t}=U(e);return t?new Date(t):null},"minDate"),maxDate:s(e=>{let{maximum:t}=U(e);return t?new Date(t):null},"maxDate")},{}));function Jp(e){return yu(Zr,e)}s(Jp,"date");var Fa=d("ZodArray",(e,t)=>{Qe(),ac.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ta(e,r,n,o),e.element=t.element},{min(e,t){return this.check(ve(e,t))},nonempty(e){return this.check(ve(1,e))},max(e,t){return this.check(qe(e,t))},length(e,t){return this.check(Ge(e,t))},unwrap(){return this.element}});function Nr(e,t){return wu(Fa,e,t)}s(Nr,"array");function Kp(e){let t=e._zod.def.shape;return Wo(Object.keys(t))}s(Kp,"keyof");var Er=d("ZodObject",(e,t)=>{Qe(),lc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ra(e,r,n,o),v.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return Wo(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(v.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(v.mergeDefs(this._zod.def,{catchall:Xe()}))},loose(){return this.clone(v.mergeDefs(this._zod.def,{catchall:Xe()}))},strict(){return this.clone(v.mergeDefs(this._zod.def,{catchall:Ko()}))},strip(){return this.clone(v.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return v.extend(this,e)},safeExtend(e){return v.safeExtend(this,e)},merge(e){return v.merge(this,e)},pick(e){return v.pick(this,e)},omit(e){return v.omit(this,e)},partial(...e){return v.partial(Tr,this,e[0])},exactPartial(...e){return v.partial(Go,this,e[0],"exactPartial")},required(...e){return v.required(Ho,this,e[0])}});function Wp(e,t){let r={type:"object",shape:e??{},...v.normalizeParams(t)};return new Er(r)}s(Wp,"object");function qp(e,t){return new Er({type:"object",shape:e,catchall:Ko(),...v.normalizeParams(t)})}s(qp,"strictObject");function Gp(e,t){return new Er({type:"object",shape:e,catchall:Xe(),...v.normalizeParams(t)})}s(Gp,"looseObject");var Cr=d("ZodUnion",(e,t)=>{dr.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$o(e,r,n,o),e.options=t.options});function Lt(e,t){return new Cr({type:"union",options:e,...v.normalizeParams(t)})}s(Lt,"union");var Ma=d("ZodXor",(e,t)=>{Cr.init(e,t),fc.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$o(e,r,n,o),e.options=t.options});function Hp(e,t){return new Ma({type:"union",options:e,inclusive:!1,...v.normalizeParams(t)})}s(Hp,"xor");var Ua=d("ZodDiscriminatedUnion",(e,t)=>{Cr.init(e,t),dc.init(e,t)});function Xp(e,t,r){return new Ua({type:"union",options:t,discriminator:e,...v.normalizeParams(r)})}s(Xp,"discriminatedUnion");var Ba=d("ZodIntersection",(e,t)=>{mc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>na(e,r,n,o)});function Ja(e,t){return new Ba({type:"intersection",left:e,right:t})}s(Ja,"intersection");var Ka=d("ZodTuple",(e,t)=>{Qe(),Zn.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>oa(e,r,n,o)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Tr({type:"optional",innerType:t}))})}});function Wa(e,t,r){let n=t instanceof P,o=n?r:t,i=n?t:null;return new Ka({type:"tuple",items:e,rest:i,...v.normalizeParams(o)})}s(Wa,"tuple");var Et=d("ZodRecord",(e,t)=>{Qe(),hc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ia(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function qa(e,t,r){return!t||!t._zod?new Et({type:"record",keyType:Ir(),valueType:e,...v.normalizeParams(t)}):new Et({type:"record",keyType:e,valueType:t,...v.normalizeParams(r)})}s(qa,"record");function Yp(e,t,r){return new Et({type:"record",keyType:e,valueType:t,...v.normalizeParams(r),partial:!0})}s(Yp,"partialRecord");function Qp(e,t,r){return new Et({type:"record",keyType:e,valueType:t,mode:"loose",...v.normalizeParams(r)})}s(Qp,"looseRecord");var Ga=d("ZodMap",(e,t)=>{Qe(),gc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qu(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(ge(...r)),e.nonempty=r=>e.check(ge(1,r)),e.max=(...r)=>e.check(Oe(...r)),e.size=(...r)=>e.check(We(...r))});function ed(e,t,r){return new Ga({type:"map",keyType:e,valueType:t,...v.normalizeParams(r)})}s(ed,"map");var Ha=d("ZodSet",(e,t)=>{Qe(),yc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ea(e,r,n,o),e.min=(...r)=>e.check(ge(...r)),e.nonempty=r=>e.check(ge(1,r)),e.max=(...r)=>e.check(Oe(...r)),e.size=(...r)=>e.check(We(...r))});function td(e,t){return new Ha({type:"set",valueType:e,...v.normalizeParams(t)})}s(td,"set");var Ct=d("ZodEnum",(e,t)=>{_c.init(e,t),O.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Bu(e,n,o,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let c of n)if(r.has(c))i[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Ct({...t,checks:[],...v.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let c of n)if(r.has(c))delete i[c];else throw new Error(`Key ${c} not found in enum`);return new Ct({...t,checks:[],...v.normalizeParams(o),entries:i})}});function Wo(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ct({type:"enum",entries:r,...v.normalizeParams(t)})}s(Wo,"_enum");function rd(e,t){return new Ct({type:"enum",entries:e,...v.normalizeParams(t)})}s(rd,"nativeEnum");var Xa=d("ZodLiteral",(e,t)=>{$c.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ju(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function nd(e,t){return new Xa({type:"literal",values:Array.isArray(e)?e:[e],...v.normalizeParams(t)})}s(nd,"literal");var Ya=d("ZodFile",(e,t)=>{wc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qu(e,r,n,o),e.min=(r,n)=>e.check(ge(r,n)),e.max=(r,n)=>e.check(Oe(r,n)),e.mime=(r,n)=>e.check(kt(Array.isArray(r)?r:[r],n))});function od(e){return bu(Ya,e)}s(od,"file");var Qa=d("ZodTransform",(e,t)=>{Qe(),bc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yu(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Pe(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(v.issue(i,r.value,t));else{let c=i;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),"input"in c||(c.input=r.value),c.inst??(c.inst=e),r.issues.push(v.issue(c))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function qo(e){return new Qa({type:"transform",transform:e})}s(qo,"transform");var Tr=d("ZodOptional",(e,t)=>{Nn.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Ye(e){return new Tr({type:"optional",innerType:e})}s(Ye,"optional");var Go=d("ZodExactOptional",(e,t)=>{vc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function el(e){return new Go({type:"optional",innerType:e})}s(el,"exactOptional");var tl=d("ZodNullable",(e,t)=>{xc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>sa(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Or(e){return new tl({type:"nullable",innerType:e})}s(Or,"nullable");function id(e){return Ye(Or(e))}s(id,"nullish");var rl=d("ZodDefault",(e,t)=>{kc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>aa(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function nl(e,t){return new rl({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():v.shallowClone(t)}})}s(nl,"_default");var ol=d("ZodPrefault",(e,t)=>{zc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>la(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function il(e,t){return new ol({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():v.shallowClone(t)}})}s(il,"prefault");var Ho=d("ZodNonOptional",(e,t)=>{Sc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ca(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function sl(e,t){return new Ho({type:"nonoptional",innerType:e,...v.normalizeParams(t)})}s(sl,"nonoptional");var cl=d("ZodSuccess",(e,t)=>{Pc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gu(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function sd(e){return new cl({type:"success",innerType:e})}s(sd,"success");var ul=d("ZodCatch",(e,t)=>{Ic.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fa(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function al(e,t){return new ul({type:"catch",innerType:e,catchValue:typeof t=="function"?t:v.constantCatch(t)})}s(al,"_catch");var ll=d("ZodNaN",(e,t)=>{Oc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ku(e,r,n,o)});function cd(e){return $u(ll,e)}s(cd,"nan");var Dr=d("ZodPipe",(e,t)=>{En.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pa(e,r,n,o),e.in=t.in,e.out=t.out});function So(e,t){return new Dr({type:"pipe",in:e,out:t})}s(So,"pipe");var Rr=d("ZodCodec",(e,t)=>{Dr.init(e,t),mr.init(e,t)});function ud(e,t,r){return new Rr({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}s(ud,"codec");function ad(e){let t=e._zod.def;return new Rr({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}s(ad,"invertCodec");var fl=d("ZodPreprocess",(e,t)=>{Dr.init(e,t),Ac.init(e,t)}),pl=d("ZodReadonly",(e,t)=>{Zc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>da(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function dl(e){return new pl({type:"readonly",innerType:e})}s(dl,"readonly");var ml=d("ZodTemplateLiteral",(e,t)=>{Nc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wu(e,r,n,o)});function ld(e,t){return new ml({type:"template_literal",parts:e,...v.normalizeParams(t)})}s(ld,"templateLiteral");var hl=d("ZodLazy",(e,t)=>{hr.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ha(e,r,n,o),e.unwrap=()=>e._zod.def.getter()});function gl(e){return new hl({type:"lazy",getter:e})}s(gl,"lazy");var yl=d("ZodPromise",(e,t)=>{Cc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ma(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function fd(e){return new yl({type:"promise",innerType:e})}s(fd,"promise");var _l=d("ZodFunction",(e,t)=>{Ec.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xu(e,r,n,o)});function pd(e){return new _l({type:"function",input:Array.isArray(e?.input)?Wa(e?.input):e?.input??Nr(Xe()),output:e?.output??Xe()})}s(pd,"_function");var jr=d("ZodCustom",(e,t)=>{Tc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Hu(e,r,n,o)});function dd(e){let t=new j({check:"custom"});return t._zod.check=e,t}s(dd,"check");function md(e,t){return vu(jr,e??(()=>!0),t)}s(md,"custom");function $l(e,t={}){return xu(jr,e,t)}s($l,"refine");function wl(e,t){return ku(e,t)}s(wl,"superRefine");var hd=zu,gd=Su,bl=d("ZodInstanceOf",(e,t)=>{jr.init(e,t)},{properties(e,t){return this.check(xt(e,t))}});function yd(e,t={}){let r=new bl({type:"custom",check:"custom",fn:s(n=>n instanceof e,"fn"),abort:!0,...v.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}s(yd,"_instanceof");var _d=s((...e)=>Pu({Codec:Rr,Boolean:Rt,String:Tt},...e),"stringbool");function $d(e){let t=gl(()=>Lt([Ir(e),Za(),Na(),Da(),Nr(t),qa(Ir(),t)]));return t}s($d,"json");function wd(e,t){return new fl({type:"pipe",in:qo(e),out:t})}s(wd,"preprocess");var n_={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 o_(e){F({customError:e})}s(o_,"setErrorMap");function i_(){return F().customError}s(i_,"getErrorMap");var vl;vl||(vl={});var Lr={};_e(Lr,{ZodISODate:()=>Ce,ZodISODateTime:()=>Ee,ZodISODuration:()=>De,ZodISOTime:()=>Te,date:()=>c_,datetime:()=>s_,duration:()=>a_,time:()=>u_});function s_(e){return vr(Ee,e)}s(s_,"datetime");function c_(e){return xr(Ce,e)}s(c_,"date");function u_(e){return kr(Te,e)}s(u_,"time");function a_(e){return zr(De,e)}s(a_,"duration");var b={...Vt,...xo,iso:Lr},l_=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 f_(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}s(f_,"detectVersion");function bd(e,t){return e.map((r,n)=>n<t?r:r.optional())}s(bd,"applyMinItems");function p_(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}s(p_,"decodeJSONPointerSegment");function d_(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let n=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let o=r[1]===void 0?void 0:p_(r[1]);if(!o||!t.defs[o])throw new Error(`Reference not found: ${e}`);return t.defs[o]}throw new Error(`Reference not found: ${e}`)}s(d_,"resolveRef");function m_(e,t){return b.transform(n=>n).check(n=>{let o=n.value;if(typeof o!="object"||o===null||Array.isArray(o))return;let i=Object.getOwnPropertyNames(o);if(t.minProperties!==void 0&&i.length<t.minProperties&&n.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:!0,message:`Too small: expected object to have >=${t.minProperties} properties`,input:o,inst:e,continue:!0}),t.maxProperties!==void 0&&i.length>t.maxProperties&&n.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:o,inst:e,continue:!0}),t.keySchema)for(let c of i){let u=t.keySchema.safeParse(c);u.success||n.issues.push({code:"invalid_key",origin:"record",issues:u.error.issues,input:c,path:[c],continue:!0})}}).pipe(e)}s(m_,"checkObjectGuards");function xl(e,t){if(e===null)return"z";let r=typeof e;if(r!=="object"){if(r==="number"&&Number.isNaN(e))return null;let n=String(e);return`${r[0]}${n.length}:${n}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let i=[];for(let c of e){let u=xl(c,t);if(u===null)return null;i.push(u)}return`a${i.length}:[${i.join(",")}]`}let n=Object.keys(e).sort(),o=[];for(let i of n){let c=xl(e[i],t);if(c===null)return null;o.push(`${i.length}:${i}=${c}`)}return`o${o.length}:{${o.join(",")}}`}finally{t.delete(e)}}s(xl,"canonicalKey");var h_=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),g_=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Vr(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Vr):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,r])=>h_.has(t)?Vr(r):!g_.has(t)||typeof r!="object"||r===null?!1:Object.values(r).some(Vr))}s(Vr,"containsRef");function vd(e){return e===1?"element":"elements"}s(vd,"plural");function y_(e,t){return b.transform(n=>n).check(n=>{let o=n.value;if(Array.isArray(o)){if(t.uniqueItems===!0){let i=new Map;for(let c=0;c<o.length;c++){let u=xl(o[c],new Set);if(u===null)continue;let a=i.get(u);if(a===void 0){i.set(u,c);continue}n.issues.push({code:"custom",message:`Array items must be unique: element at index ${c} duplicates the one at index ${a}`,input:o,path:[c],continue:!0})}}if(t.containsSchema){let i=t.minContains??1,c=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,u=0;for(let a of o)if(t.containsSchema.safeParse(a).success&&++u>=c)break;u<i&&n.issues.push({code:"custom",message:`Array must contain at least ${i} matching ${vd(i)}; found ${u}`,input:o,continue:!0}),t.maxContains!==void 0&&u>t.maxContains&&n.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${vd(t.maxContains)}`,input:o,continue:!0})}}}).pipe(e)}s(y_,"checkArrayGuards");function xd(e,t){if(e!==!1)return e===void 0||e===!0?b.any():Q(e,t)}s(xd,"getTupleRest");var __=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function kd(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return b.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return b.lazy(()=>{if(!t.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let i=d_(o,t),c=Q(i,t);return t.refs.set(o,c),t.processing.delete(o),c}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&o.length===1&&o[0]===null)return b.null();if(o.length===0)return b.never();if(o.length===1)return b.literal(o[0]);if(o.every(c=>typeof c=="string"))return b.enum(o);let i=o.map(c=>b.literal(c));return i.length<2?i[0]:b.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return b.literal(e.const);let r=e.type;if(Array.isArray(r)){let o=r.map(i=>{let c={...e,type:i};return kd(c,t)});return o.length===0?b.never():o.length===1?o[0]:b.union(o)}if(!r)return b.any();let n;switch(r){case"string":{let o=b.string();if(e.format){let i=e.format;i==="email"?o=o.check(b.email()):i==="uri"||i==="uri-reference"?o=o.check(b.url()):i==="uuid"||i==="guid"?o=o.check(b.uuid()):i==="date-time"?o=o.check(b.iso.datetime({offset:!0})):i==="date"?o=o.check(b.iso.date()):i==="time"?o=o.check(b.regex(__)):i==="duration"?o=o.check(b.iso.duration()):i==="hostname"?o=o.check(b.hostname()):i==="ipv4"?o=o.check(b.ipv4()):i==="ipv6"?o=o.check(b.ipv6()):i==="mac"?o=o.check(b.mac()):i==="cidr"?o=o.check(b.cidrv4()):i==="cidr-v6"?o=o.check(b.cidrv6()):i==="base64"?o=o.check(b.base64()):i==="base64url"?o=o.check(b.base64url()):i==="e164"?o=o.check(b.e164()):i==="credit_card"?o=o.check(b.creditCard()):i==="iban"?o=o.check(b.iban()):i==="jwt"?o=o.check(b.jwt()):i==="emoji"?o=o.check(b.emoji()):i==="nanoid"?o=o.check(b.nanoid()):i==="cuid"?o=o.check(b.cuid()):i==="cuid2"?o=o.check(b.cuid2()):i==="ulid"?o=o.check(b.ulid()):i==="xid"?o=o.check(b.xid()):i==="ksuid"&&(o=o.check(b.ksuid()))}typeof e.minLength=="number"&&(o=o.min(e.minLength)),typeof e.maxLength=="number"&&(o=o.max(e.maxLength)),e.pattern&&(o=o.regex(new RegExp(e.pattern))),n=o;break}case"number":case"integer":{let o=r==="integer"?b.number().int():b.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(o=o.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(o=o.max(e.maximum)),typeof e.exclusiveMinimum=="number"?o=o.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(o=o.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?o=o.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(o=o.lt(e.maximum)),typeof e.multipleOf=="number"&&(o=o.multipleOf(e.multipleOf)),n=o;break}case"boolean":{n=b.boolean();break}case"null":{n=b.null();break}case"object":{let o={},i=e.properties||{},c=new Set(e.required||[]),u=typeof e.additionalProperties=="object"?Q(e.additionalProperties,t):void 0;for(let[p,m]of Object.entries(i)){let h=Q(m,t);J(o,p,c.has(p)?h:h.optional())}if(e.patternProperties){let p=e.patternProperties,m=Object.keys(p),h=[];for(let _ of m){let w=Q(p[_],t),z=b.string().regex(new RegExp(_));h.push(b.looseRecord(z,w))}let g=[];if(Object.keys(o).length>0&&g.push(b.object(o).passthrough()),g.push(...h),g.length===0)n=b.object({}).passthrough();else if(g.length===1)n=g[0];else{let _=b.intersection(g[0],g[1]);for(let w=2;w<g.length;w++)_=b.intersection(_,g[w]);n=_}if(e.additionalProperties===!1){let _=Object.keys(o),w=m.map(x=>new RegExp(x)),z=n;n=n.check(x=>{if(!ue(x.value))return;let I=[];for(let E of Object.keys(x.value))_.includes(E)||w.some(L=>L.test(E))||I.push(E);I.length&&x.issues.push({code:"unrecognized_keys",keys:I,input:x.value,inst:z})})}}else{let p=b.object(o);e.additionalProperties===!1?n=p.strict():u?n=p.catchall(u):n=p.passthrough()}let a=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,f=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(a||l!==void 0||f!==void 0){let p;if(a){let m=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;p=Q(m,t)}n=m_(n,{keySchema:p,minProperties:l,maxProperties:f})}break}case"array":{let o=e.prefixItems,i=e.items;if(o&&Array.isArray(o)){let c=typeof e.minItems=="number"?e.minItems:0,u=o.map(p=>Q(p,t)),a=bd(u,c),l=Array.isArray(i)?void 0:xd(i,t),f=b.tuple(a);n=l?f.rest(l):f,typeof e.minItems=="number"&&(n=n.check(b.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(b.maxLength(e.maxItems)))}else if(Array.isArray(i)){let c=typeof e.minItems=="number"?e.minItems:0,u=i.map(p=>Q(p,t)),a=bd(u,c),l=xd(e.additionalItems,t),f=b.tuple(a);n=l?f.rest(l):f,typeof e.minItems=="number"&&(n=n.check(b.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(b.maxLength(e.maxItems)))}else if(i!==void 0){let c=Q(i,t),u=b.array(c);typeof e.minItems=="number"&&(u=u.min(e.minItems)),typeof e.maxItems=="number"&&(u=u.max(e.maxItems)),n=u}else n=b.array(b.any());(e.uniqueItems===!0||e.contains!==void 0)&&(n=y_(n,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?Q(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${r}`)}return n}s(kd,"convertBaseSchema");function Q(e,t){if(typeof e=="boolean")return e?b.any():b.never();let r=kd(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let u=e.anyOf.map(l=>Q(l,t)),a=b.union(u);r=n?b.intersection(r,a):a}if(e.oneOf&&Array.isArray(e.oneOf)){let u=e.oneOf.map(l=>Q(l,t)),a=b.xor(u);r=n?b.intersection(r,a):a}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:b.any();else{let u=n?r:Q(e.allOf[0],t),a=n?0:1;for(let l=a;l<e.allOf.length;l++)u=b.intersection(u,Q(e.allOf[l],t));r=u}e.nullable===!0&&t.version==="openapi-3.0"&&(r=b.nullable(r)),e.readOnly===!0&&(r=b.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let o={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let u of i)u in e&&(o[u]=e[u]);let c=["contentEncoding","contentMediaType","contentSchema"];for(let u of c)u in e&&(o[u]=e[u]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Vr(e.propertyNames)&&(o.propertyNames=e.propertyNames);for(let u of["minProperties","maxProperties"])e[u]!==void 0&&(o[u]=e[u])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Vr(e.contains)&&(o.contains=e.contains);for(let u of["uniqueItems","minContains","maxContains"])e[u]!==void 0&&(o[u]=e[u])}for(let u of Object.keys(e))l_.has(u)||J(o,u,e[u]);return Object.keys(o).length>0&&t.registry.add(r,o),e.description&&(r=r.describe(e.description)),r}s(Q,"convertSchema");function zd(e,t){if(typeof e=="boolean")return e?b.any():b.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=f_(r,t?.defaultTarget),o=r.$defs||r.definitions||{},i={version:n,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??K};return Q(r,i)}s(zd,"fromJSONSchema");var Sd=Symbol("z.visit/resolving");function Fr(e,t){let r=typeof t=="function"?t:(c,u)=>{let a=t[c._zod.def.type];return a?a(c,u):c},n=new Map;function o(c){let u=n.get(c);if(u===Sd)return new hr({type:"lazy",getter:s(()=>n.get(c),"getter")});if(u!==void 0)return u;n.set(c,Sd);let a=i(c),l=r(a,a!==c);return n.set(c,l),l}s(o,"run");function i(c){let u=c._zod.def,a=u.type;switch(a){case"object":{let l=u.shape,f=Object.keys(l),p=!1,m={};for(let g of f){let _=o(l[g]);_!==l[g]&&(p=!0),m[g]=_}let h=u.catchall;return u.catchall&&(h=o(u.catchall),h!==u.catchall&&(p=!0)),p?C(c,{...u,shape:m,catchall:h}):c}case"array":{let l=o(u.element);return l===u.element?c:C(c,{...u,element:l})}case"tuple":{let l=u.items,f=!1,p=[];for(let h of l){let g=o(h);g!==h&&(f=!0),p.push(g)}let m=u.rest;return u.rest&&(m=o(u.rest),m!==u.rest&&(f=!0)),f?C(c,{...u,items:p,rest:m}):c}case"record":case"map":{let l=o(u.keyType),f=o(u.valueType);return l===u.keyType&&f===u.valueType?c:C(c,{...u,keyType:l,valueType:f})}case"set":{let l=o(u.valueType);return l===u.valueType?c:C(c,{...u,valueType:l})}case"union":{let l=u.options,f=!1,p=[];for(let m of l){let h=o(m);h!==m&&(f=!0),p.push(h)}return f?C(c,{...u,options:p}):c}case"intersection":{let l=o(u.left),f=o(u.right);return l===u.left&&f===u.right?c:C(c,{...u,left:l,right:f})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=o(u.innerType);return l===u.innerType?c:C(c,{...u,innerType:l})}case"pipe":{let l=o(u.in),f=o(u.out);return l===u.in&&f===u.out?c:C(c,{...u,in:l,out:f})}case"function":{let l=o(u.input),f=o(u.output);return l===u.input&&f===u.output?c:C(c,{...u,input:l,output:f})}case"lazy":{let l=u.getter,{_cachedInner:f,...p}=u;return C(c,{...p,getter:s(()=>o(l()),"getter")})}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":return c;default:return c}}return s(i,"mapInner"),o(e)}s(Fr,"visit");function Pd(e){return Fr(e,{object:s(t=>t.partial(),"object"),union:s(t=>{let r=t._zod.def;return r.discriminator===void 0?t:Lt(r.options)},"union")})}s(Pd,"deepPartial");function $_(e,t){if(!t?.length)return e;let r=e._zod.def;return C(e,fe(r,{checks:[...r.checks??[],...t]}),{parent:!0})}s($_,"withChecks");function Id(e){return $_(e.out,e.checks)}s(Id,"outSide");function w_(e){return e.in._zod.traits.has("$ZodTransform")?Id(e):e.in}s(w_,"inSide");function Od(e){return Fr(e,{pipe:s(t=>w_(t._zod.def),"pipe"),default:s((t,r)=>r?Ye(t._zod.def.innerType):t,"default"),catch:s((t,r)=>r?t._zod.def.innerType:t,"catch")})}s(Od,"input");function Ad(e){return Fr(e,{pipe:s(t=>Id(t._zod.def),"pipe"),prefault:s((t,r)=>r?t._zod.def.innerType:t,"prefault")})}s(Ad,"output");var kl={};_e(kl,{bigint:()=>k_,boolean:()=>x_,date:()=>z_,number:()=>v_,string:()=>b_});function b_(e){return Kc(Tt,e)}s(b_,"string");function v_(e){return Yc(Dt,e)}s(v_,"number");function x_(e){return iu(Rt,e)}s(x_,"boolean");function k_(e){return cu(jt,e)}s(k_,"bigint");function z_(e){return _u(Zr,e)}s(z_,"date");import f$ from"node:path";var m$=Bm(_m());import{AsyncLocalStorage as Sm}from"node:async_hooks";import{availableParallelism as h$}from"node:os";import{execFile as x$}from"node:child_process";import{promisify as k$}from"node:util";function Om(e){return{experimental_apiVersion:1,contract:e.contract,handlers:e.handlers,...e.experimental_signals===void 0?{}:{experimental_signals:e.experimental_signals},...e.dispose===void 0?{}:{dispose:e.dispose}}}s(Om,"experimental_defineHostEntry");function Y_(e){if(e.length===0)return!1;let t=e.replaceAll("\\","/"),r=/^[a-zA-Z]:\//u.exec(t),n=r?t.slice(r[0].length):t.slice(1);return!r&&!t.startsWith("/")?!1:n.split("/").every(o=>o!==""&&o!=="."&&o!=="..")}s(Y_,"isAbsoluteProviderSkillRootPath");function Am(e){if(e.length===0)return!1;let t=e.replaceAll("\\","/");return!t.startsWith("/")&&!/^[a-zA-Z]:\//u.test(t)&&t.split("/").every(r=>r!==""&&r!=="."&&r!=="..")}s(Am,"isRelativeProviderSkillRootPath");var Q_=32,e$=/^[A-Za-z0-9][A-Za-z0-9._-]{0,62}:$/u,Tl=y.string().refine(e=>e===""||e$.test(e),"A root name prefix is a plugin-name-like token ending in ':'"),Dl=y.string().min(1).refine(Am,"A manifest marker is a relative path without dot segments"),t$=y.string().min(1).refine(Am,"Roots must be relative paths without dot segments"),r$=y.string().min(1).refine(Y_,"Absolute roots must be absolute paths without dot segments"),$m=y.union([y.string().min(1),y.object({path:y.string().min(1),recursive:y.boolean().optional(),ancestors:y.boolean().optional(),namePrefix:Tl.optional(),skipIfManifest:Dl.optional()}).strict()]),Qb=y.object({user:y.array($m).optional(),project:y.array($m).optional()}).strict(),n$=y.object({path:y.string().min(1),recursive:y.boolean(),ancestors:y.boolean(),namePrefix:Tl,skipIfManifest:Dl.optional()}).strict();function o$(e){return new Set(e.map(t=>t.path)).size===e.length}s(o$,"uniqueByPath");function wm(e){return y.array(n$.extend({path:t$}).superRefine((t,r)=>{t.ancestors&&e!=="project"&&r.addIssue({code:"custom",message:"Only project roots may walk ancestors"})})).max(Q_).refine(o$,"Roots must not repeat a path")}s(wm,"nativeRootSideSchema");var bm=y.object({user:wm("user"),project:wm("project")}).strict(),ev=Object.freeze({user:Object.freeze([]),project:Object.freeze([])}),i$=y.enum(["skills","skill","skill-file","commands","command-file"]),Zm=y.object({path:r$,origin:y.enum(["user","project"]),recursive:y.boolean(),ancestors:y.boolean(),namePrefix:Tl,shape:i$,fallbackName:y.string().min(1).optional(),skipIfManifest:Dl.optional()}).strict(),vm=Zm.superRefine((e,t)=>{e.skipIfManifest!==void 0&&e.shape!=="skills"&&t.addIssue({code:"custom",message:"Only a skills root carries a manifest marker"}),e.ancestors&&e.origin!=="project"&&t.addIssue({code:"custom",message:"Only project roots may walk ancestors"}),e.fallbackName!==void 0&&e.shape!=="skill-file"&&t.addIssue({code:"custom",message:"Only a skill-file root carries a fallback name"})}),xm=Zm.partial({recursive:!0,ancestors:!0,namePrefix:!0,shape:!0});function km(e,t){return{path:e.path,origin:e.origin,recursive:e.recursive??!1,ancestors:e.ancestors??!1,namePrefix:e.namePrefix??"",shape:e.shape??(t==="skills"?"skills":"commands"),...e.fallbackName===void 0?{}:{fallbackName:e.fallbackName},...t==="skills"&&e.skipIfManifest!==void 0?{skipIfManifest:e.skipIfManifest}:{}}}s(km,"normalizeProviderResolvedNativeRoot");var s$=new Set(["skills","skill","skill-file"]),c$=new Set(["commands","command-file"]),Yo=256,Nm=y.object({skills:y.array(vm.refine(e=>s$.has(e.shape),"A skills root needs a skill shape")).max(Yo),commands:y.array(vm.refine(e=>c$.has(e.shape),"A commands root needs a command shape")).max(Yo)}).strict(),tv=Object.freeze({skills:Object.freeze([]),commands:Object.freeze([])}),rv=y.object({skills:bm,commands:bm,resolved:Nm}).strict(),u$=Symbol.for("@get-bb/plugin-sdk/rpc-refusal"),nv=class extends Error{static{s(this,"experimental_PluginRpcRefusal")}[u$]=!0;code;issues;constructor(e){super(e.message),this.name="experimental_PluginRpcRefusal",this.code=e.code,this.issues=e.issues}};var a$=y.object({providerId:y.string().min(1),cwd:y.string().min(1).nullable()}).strict(),l$=y.object({skills:y.array(xm).optional(),commands:y.array(xm).optional()}).strict().transform(e=>({skills:(e.skills??[]).slice(0,Yo).map(t=>km(t,"skills")),commands:(e.commands??[]).slice(0,Yo).map(t=>km(t,"commands"))})).pipe(Nm);var ov={resolveNativeRoots:{input:a$,output:l$}};var cv=f$.join(".claude-plugin","plugin.json");var p$=y.enum(["managed","project","local","user"]),uv=y.object({enabledPlugins:y.record(y.string(),y.boolean()).optional()}).passthrough(),d$=y.object({gitCommitSha:y.string().nullable().optional(),installPath:y.string().min(1),scope:p$}).passthrough(),av=y.object({plugins:y.record(y.string(),y.array(d$))}).passthrough(),zm=y.union([y.string(),y.array(y.string())]),lv=y.object({name:y.string().min(1).optional(),defaultEnabled:y.boolean().optional(),skills:zm.optional(),commands:zm.optional()}).passthrough();var Pm={interactive:0,status:1,background:2};function g$(e){let t=Math.min(6,Math.max(4,e-2));return[t,t-1,t-2]}s(g$,"localProcessCapacities");var Im={local:g$(h$()),network:[4,3,2]},y$=2,Cl=15e3,_$=new Set(["fetch","pull","push","clone","ls-remote"]),$$=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--config-env"]);function w$(e){let t=0;for(;t<e.length&&e[t].startsWith("-");)t+=$$.has(e[t])?2:1;let r=e[t];if(r===void 0)return!1;if(_$.has(r))return!0;let n=e.slice(t+1).find(o=>!o.startsWith("-"));return(r==="submodule"||r==="remote")&&n==="update"}s(w$,"isNetworkGitCommand");var b$=class{static{s(this,"VcsProcessScheduler")}priority=new Sm;admitted=new Sm;active={local:0,network:0};githubActive=0;queue=[];timer;acquire(e,t,r){let n=e==="gh"||w$(t)?"network":"local",o=r.slots??1;return!Number.isInteger(o)||o<1||o>Im[n][Pm.background]?Promise.reject(new Error("Invalid VCS process slot count")):r.signal?.aborted?Promise.reject(this.abortError(r.signal)):new Promise((i,c)=>{let u={command:e,pool:n,priority:r.priority??this.priority.getStore()??"status",slots:o,queuedAt:performance.now(),signal:r.signal,grant:i,onAbort:s(()=>{let a=this.queue.indexOf(u);a!==-1&&(this.queue.splice(a,1),c(this.abortError(r.signal)),this.drain())},"onAbort")};this.queue.push(u),r.signal?.addEventListener("abort",u.onAbort,{once:!0}),this.drain()})}abortError(e){return Object.assign(new Error("The operation was aborted",{cause:e?.reason}),{name:"AbortError",code:"ABORT_ERR"})}rank(e){return Math.max(0,Pm[e.priority]-Math.floor((performance.now()-e.queuedAt)/Cl))}drain(){clearTimeout(this.timer),this.queue.sort((t,r)=>this.rank(t)-this.rank(r)||t.queuedAt-r.queuedAt);let e=new Set;for(let t=0;t<this.queue.length;){let r=this.queue[t];if(e.has(r.pool)||r.command==="gh"&&this.githubActive+r.slots>y$){t+=1;continue}if(this.active[r.pool]+r.slots>Im[r.pool][this.rank(r)]){e.add(r.pool),t+=1;continue}this.queue.splice(t,1),r.signal?.removeEventListener("abort",r.onAbort),this.active[r.pool]+=r.slots,r.command==="gh"&&(this.githubActive+=r.slots);let n=!1;r.grant(()=>{n||(n=!0,this.active[r.pool]-=r.slots,r.command==="gh"&&(this.githubActive-=r.slots),this.drain())})}if(this.queue.length>0){let t=Math.min(...this.queue.map(r=>Cl-(performance.now()-r.queuedAt)%Cl));this.timer=setTimeout(()=>this.drain(),t)}}},v$=globalThis,dv=v$.__bbVcsProcessScheduler??=new b$;var gv=k$(x$);var Rl=y.enum(["directory","grouped"]),Em=y.string().min(1).max(80),Cm=y.object({kind:y.string(),reference:y.string(),group:y.string(),person:y.string().optional()}),z$=y.object({predicate:y.string(),value:y.string(),label:Em.optional(),confidence:y.number().min(0).max(1),status:y.string(),id:y.string().optional(),entity:y.string().optional(),source:Cm.optional(),observed:y.string().optional(),recorded:y.string().optional(),category:y.string().optional(),visibility:y.object({scope:y.enum(["private","named","general"]),people:y.array(y.string()).optional(),until:y.string().optional(),jobs:y.boolean().optional()}).optional(),supersedes:y.string().optional(),sourcesCompared:y.array(y.string()).optional()}).passthrough(),rt=y.object({entity:y.string().optional(),name:y.string().optional(),facts:y.array(z$)}).passthrough(),jl=y.object({hostId:y.string().min(1),entity:y.string().min(1).max(200)}),S$=jl.extend({factId:y.string().min(1),value:y.string().trim().min(1).max(2e3),reason:y.string().trim().refine(e=>new TextEncoder().encode(e).length<=100,"Keep the source note within 100 bytes")}),Mr=y.object({id:y.string(),added:y.boolean()}).passthrough(),P$=y.object({type:y.literal("fact"),entity:y.string(),predicate:y.string(),value:y.string(),label:Em.optional(),source:Cm,observed:y.string(),confidence:y.literal(1),category:y.string(),visibility:y.object({scope:y.literal("private")}),supersedes:y.string()}),Tm={lookup:{input:y.object({query:y.string().min(1).max(200)}),output:y.array(rt)},known:{input:y.object({entity:y.string().min(1).max(200)}),output:rt},record:{input:y.object({record:P$}),output:Mr}},Sv={stations:{input:y.null(),output:y.array(y.object({id:y.string(),name:y.string(),status:y.string()}))},lookup:{input:y.object({hostId:y.string(),query:y.string().trim().max(200).default("")}),output:y.array(rt)},known:{input:jl,output:rt},correct:{input:S$,output:Mr},undo:{input:jl.extend({factId:y.string()}),output:Mr},getDefault:{input:y.null(),output:Rl},setDefault:{input:y.object({view:Rl}),output:Rl}};var A$=O$(I$);async function Ll(e,t){try{let{stdout:r}=await A$("/usr/local/orbit/bin/orbit-people",e,{signal:t,timeout:35e3,maxBuffer:1e6});return JSON.parse(r)}catch{throw new Error("The people service did not complete the request. Refresh before trying a correction again.")}}s(Ll,"request");var Ev=Om({contract:Tm,handlers:{lookup:s(async({query:e},{signal:t})=>y.array(rt).parse(await Ll(["lookup",e],t)),"lookup"),known:s(async({entity:e},{signal:t})=>rt.parse(await Ll(["known",e],t)),"known"),record:s(async(e,{signal:t})=>Mr.parse(await Ll(["record",JSON.stringify(e)],t)),"record")}});export{Ev as default};
|
|
68
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let c of e.seen.entries()){let u=c[1];if(t===c[0]){i(c);continue}if(e.external){let l=e.external.registry.get(c[0])?.id;if(t!==c[0]&&l){i(c);continue}}if(e.metadataRegistry.get(c[0])?.id){i(c);continue}if(u.cycle){i(c);continue}u.count>1&&e.reused==="ref"&&i(c)}e.external&&(e.sharedDefsExtractedFor=e.external)}s(Ne,"extractDefs");function Mf(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!="object")return;Mf(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let c of Array.isArray(i)?i:[i]){if(typeof c!="string")return;r.includes(c)||r.push(c)}}delete e.anyOf,e.type=r.length===1?r[0]:r}s(Mf,"compactTypeUnion");var Uf=new Set(["type","properties","required","additionalProperties"]),Vf=["oneOf","anyOf"];function Ff(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}s(Ff,"undeclaredConstraint");function Ou(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let c in i)if(!Uf.has(c))return null;t.push(i)}let r={},n=new Set;for(let i of t){for(let c in i.properties){if(Object.prototype.hasOwnProperty.call(r,c))continue;let u=[];for(let l of t){let f=l.properties?.[c]??Ff(l);f!=null&&(u.some(p=>JSON.stringify(p)===JSON.stringify(f))||u.push(f))}let a=u.length===1?u[0]:Ou(u)??{allOf:u};J(r,c,a)}for(let c of i.required??[])n.add(c)}let o={type:"object",properties:r};if(n.size&&(o.required=[...n]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let c of t){let u=Ff(c);u&&!i.some(a=>JSON.stringify(a)===JSON.stringify(u))&&i.push(u)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}s(Ou,"foldObjects");function Gy(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of Uf)if(o in e)return;let r=t.filter(o=>Vf.some(i=>Array.isArray(o[i]))),n=null;if(!r.length)n=Ou(t);else{let o=r[0],i=Vf.find(a=>Array.isArray(o[a]));if(Object.keys(o).length!==1)return;let c=t.filter(a=>a!==o),u=o[i].map(a=>Ou([...c,a]));if(u.some(a=>!a))return;n={[i]:u}}n&&(delete e.allOf,Sr(e,n))}s(Gy,"foldIntersection");function Ee(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=s(u=>{let a=e.seen.get(u);if(a.ref===null)return;let l=a.def??a.schema,f={...l},p=a.ref;if(a.ref=null,p){n(p);let h=e.seen.get(p),g=h.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(g)):Sr(l,g),Sr(l,f),u._zod.parent===p)for(let w in l)w==="$ref"||w==="allOf"||w in f||delete l[w];if(g.$ref&&h.def)for(let w in l)w==="$ref"||w==="allOf"||w in h.def&&JSON.stringify(l[w])===JSON.stringify(h.def[w])&&delete l[w]}let m=u._zod.parent;if(m&&m!==p){n(m);let h=e.seen.get(m);if(h?.schema.$ref&&(l.$ref=h.schema.$ref,h.def))for(let g in l)g==="$ref"||g==="allOf"||g in h.def&&JSON.stringify(l[g])===JSON.stringify(h.def[g])&&delete l[g]}e.override({zodSchema:u,jsonSchema:l,path:a.path??[]})},"flattenRef");if(!e.external||e.sharedEmitDoneFor!==e.external){for(let u of[...e.seen.entries()].reverse())n(u[0]);if(e.target!=="openapi-3.0")for(let u of e.seen.entries())Mf(u[1].def??u[1].schema);for(let u of e.deferred)u();if(e.intersections.length){let u=new Map;for(let a of e.seen.values())for(let l of[a.schema,a.def]){let f=l?.allOf;if(!Array.isArray(f))continue;let p=u.get(f);p?p.push(l):u.set(f,[l])}for(let a of e.intersections)for(let l of u.get(a)??[])Gy(l)}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let u=e.external.registry.get(t)?.id;if(!u)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(u)}Sr(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let c=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let u of e.seen.entries()){let a=u[1];a.def&&a.defId&&(a.def.id===a.defId&&delete a.def.id,J(c,a.defId,a.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?o.$defs=c:o.definitions=c);try{let u=JSON.parse(JSON.stringify(o));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:At(t,"input",e.processors),output:At(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}s(Ee,"finalize");function Y(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Y(n.element,r);if(n.type==="set")return Y(n.valueType,r);if(n.type==="lazy")return Y(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return Y(n.innerType,r);if(n.type==="intersection")return Y(n.left,r)||Y(n.right,r);if(n.type==="record"||n.type==="map")return Y(n.keyType,r)||Y(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Y(n.in,r)||Y(n.out,r);if(n.type==="object"){for(let o in n.shape)if(Y(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(Y(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(Y(o,r))return!0;return!!(n.rest&&Y(n.rest,r))}return!1}s(Y,"isTransforming");var Au=s((e,t={})=>r=>{let n=Ze({...r,processors:t});return D(e,n),Ne(n,e),Ee(n,e)},"createToJSONSchemaMethod"),At=s((e,t,r={})=>n=>{let{libraryOptions:o,target:i}=n??{},c=Ze({...o??{},target:i,io:t,processors:r});return D(e,c),Ne(c,e),Ee(c,e)},"createStandardJSONSchemaMethod");var Zt=s((e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},"narrowMin"),Nt=s((e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},"narrowMax"),Bf=s((e,t)=>{Zt(e,"minimum",t),Nt(e,"maximum",t)},"narrowBoth"),qf=s((e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},"addDivisor"),Gf=s((e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},"addPattern"),Hf=s((e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},"intersectMime"),Xf=s((e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},"setFormat"),Jf=s((e,t)=>Zt(e,"minimum",t.minimum),"minContributor"),Kf=s((e,t)=>Nt(e,"maximum",t.maximum),"maxContributor"),Wf=s(e=>(t,r)=>{Xf(t,r.format);let[n,o]=e[r.format];Zt(t,"minimum",n),Nt(t,"maximum",o)},"formatContributor"),Hy={greater_than:s((e,t)=>Zt(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),"greater_than"),less_than:s((e,t)=>Nt(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),"less_than"),multiple_of:s((e,t)=>qf(e,t.value),"multiple_of"),number_format:Wf(qt),bigint_format:Wf(Gt),min_length:Jf,max_length:Kf,length_equals:s((e,t)=>Bf(e,t.length),"length_equals"),min_size:Jf,max_size:Kf,size_equals:s((e,t)=>Bf(e,t.size),"size_equals"),string_format:s((e,t)=>{Xf(e,t.format),t.pattern&&Gf(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},"string_format"),mime_type:s((e,t)=>Hf(e,t.mime),"mime_type")};function U(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)Hy[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&Zt(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&Zt(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&Nt(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&Nt(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&qf(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&Hf(t,o.mime);for(let i of o.patterns??[])Gf(t,i);return t}s(U,"aggregateChecks");var Xy={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Yy=new Map([[kn,ji],[fr,Li]]),Yf=s(e=>Yy.get(e)??e,"exactPattern"),Eu=s((e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:c,format:u,patterns:a,contentEncoding:l,laxFormat:f}=U(e);if(typeof i=="number"&&(o.minLength=i),typeof c=="number"&&(o.maxLength=c),u&&(o.format=Xy[u]??u,o.format===""&&delete o.format,(u==="time"||f)&&delete o.format),l&&(o.contentEncoding=l),a&&a.size>0){let p=[...a].map(Yf);p.length===1?o.pattern=p[0].source:p.length>1&&(o.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},"stringProcessor"),Cu=s((e,t,r,n)=>{let o=r,{minimum:i,maximum:c,multipleOf:u,exclusiveMaximum:a,exclusiveMinimum:l,isInt:f}=U(e);o.type=f?"integer":"number";let p=typeof l=="number"&&l>=(i??Number.NEGATIVE_INFINITY),m=typeof a=="number"&&a<=(c??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(p?h?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l:typeof i=="number"&&(o.minimum=i),m?h?(o.maximum=a,o.exclusiveMaximum=!0):o.exclusiveMaximum=a:typeof c=="number"&&(o.maximum=c),u){let g=new Set;for(let z of u)Number.isFinite(z)&&z!==0?g.add(Math.abs(z)):M(e,t,o,n,`A multipleOf divisor of ${z} cannot be represented in JSON Schema`);let[_,...w]=g;_!==void 0&&(o.multipleOf=_),w.length&&(o.allOf=[...o.allOf??[],...w.map(z=>({multipleOf:z}))])}},"numberProcessor"),Tu=s((e,t,r,n)=>{r.type="boolean"},"booleanProcessor"),Du=s((e,t,r,n)=>{M(e,t,r,n,"BigInt cannot be represented in JSON Schema")},"bigintProcessor"),Ru=s((e,t,r,n)=>{M(e,t,r,n,"Symbols cannot be represented in JSON Schema")},"symbolProcessor"),ju=s((e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},"nullProcessor"),Lu=s((e,t,r,n)=>{M(e,t,r,n,"Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),Vu=s((e,t,r,n)=>{M(e,t,r,n,"Void cannot be represented in JSON Schema")},"voidProcessor"),Fu=s((e,t,r,n)=>{r.not={}},"neverProcessor"),Mu=s((e,t,r,n)=>{},"anyProcessor"),Uu=s((e,t,r,n)=>{},"unknownProcessor"),Bu=s((e,t,r,n)=>{M(e,t,r,n,"Date cannot be represented in JSON Schema")},"dateProcessor"),Ju=s((e,t,r,n)=>{let o=e._zod.def,i=ot(o.entries);if(i.length===0){r.not={};return}i.every(c=>typeof c=="number")&&(r.type="number"),i.every(c=>typeof c=="string")&&(r.type="string"),r.enum=i},"enumProcessor"),Ku=s((e,t,r,n)=>{let o=e._zod.def;if(o.values.length===0){r.not={};return}let i=[];for(let c of o.values)if(c===void 0){if(M(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof c=="bigint"){if(M(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(c))}else i.push(c);if(i.length!==0)if(i.length===1){let c=i[0];r.type=c===null?"null":typeof c,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[c]:r.const=c}else i.every(c=>typeof c=="number")&&(r.type="number"),i.every(c=>typeof c=="string")&&(r.type="string"),i.every(c=>typeof c=="boolean")&&(r.type="boolean"),i.every(c=>c===null)&&(r.type="null"),r.enum=i},"literalProcessor"),Wu=s((e,t,r,n)=>{M(e,t,r,n,"NaN cannot be represented in JSON Schema")},"nanProcessor"),qu=s((e,t,r,n)=>{let o=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source},"templateLiteralProcessor"),Gu=s((e,t,r,n)=>{let o=r;o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:i,maximum:c,mime:u}=U(e);i!==void 0&&(o.minLength=i),c!==void 0&&(o.maxLength=c),u&&(u.length===0?o.not={}:u.length===1?o.contentMediaType=u[0]:o.anyOf=u.map(a=>({contentMediaType:a})))},"fileProcessor"),Hu=s((e,t,r,n)=>{r.type="boolean"},"successProcessor"),Xu=s((e,t,r,n)=>{M(e,t,r,n,"Custom types cannot be represented in JSON Schema")},"customProcessor"),Yu=s((e,t,r,n)=>{M(e,t,r,n,"Function types cannot be represented in JSON Schema")},"functionProcessor"),Qu=s((e,t,r,n)=>{M(e,t,r,n,"Transforms cannot be represented in JSON Schema")},"transformProcessor"),ea=s((e,t,r,n)=>{M(e,t,r,n,"Map cannot be represented in JSON Schema")},"mapProcessor"),ta=s((e,t,r,n)=>{M(e,t,r,n,"Set cannot be represented in JSON Schema")},"setProcessor"),ra=s((e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:c,maximum:u}=U(e);typeof c=="number"&&(o.minItems=c),typeof u=="number"&&(o.maxItems=u),o.type="array",o.items=D(i.element,t,{...n,path:[...n.path,"items"]})},"arrayProcessor");function Pr(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Pr(t.out):t.type==="catch"?Pr(t.innerType):e._zod.optin}s(Pr,"inputOptin");var na=s((e,t,r,n)=>{let o=r,i=e._zod.def,c=i.shape;if(Object.getOwnPropertySymbols(c).length&&M(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let l in c)J(o.properties,l,D(c[l],t,{...n,path:[...n.path,"properties",l]}));let a=[];for(let l of Object.keys(c)){let f=i.shape[l];(t.io==="input"?Pr(f)===void 0:f._zod.optout===void 0)&&a.push(l)}a.length>0&&(o.required=a),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=D(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},"objectProcessor"),$o=s((e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===!1,c=o.options.map((u,a)=>D(u,t,{...n,path:[...n.path,i?"oneOf":"anyOf",a]}));i?r.oneOf=c:r.anyOf=c},"unionProcessor"),oa=s((e,t,r,n)=>{let o=e._zod.def,i=D(o.left,t,{...n,path:[...n.path,"allOf",0]}),c=D(o.right,t,{...n,path:[...n.path,"allOf",1]}),u=s(l=>"allOf"in l&&Object.keys(l).length===1,"isSimpleIntersection"),a=[...u(i)?i.allOf:[i],...u(c)?c.allOf:[c]];r.allOf=a,t.intersections.push(a)},"intersectionProcessor"),ia=s((e,t,r,n)=>{let o=r,i=e._zod.def;o.type="array";let c=t.target==="draft-2020-12"?"prefixItems":"items",u=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",a=i.items.map((_,w)=>D(_,t,{...n,path:[...n.path,c,w]})),l=i.rest?D(i.rest,t,{...n,path:[...n.path,u,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null,f=i.items.length;for(;f>0;){let _=i.items[f-1];if(!(t.io==="input"?Pr(_)!==void 0:_._zod.optout==="optional"))break;f--}let p=i.items.length,m=!i.rest;t.target==="draft-2020-12"?(o.prefixItems=a,m?o.items=!1:l&&(o.items=l),f>0&&(o.minItems=f),m&&(o.maxItems=p)):t.target==="openapi-3.0"?(o.items={anyOf:a},l&&o.items.anyOf.push(l),f>0&&(o.minItems=f),m&&(o.maxItems=p)):(o.items=a,m?o.additionalItems=!1:l&&(o.additionalItems=l),f>0&&(o.minItems=f),m&&(o.maxItems=p));let{minimum:h,maximum:g}=U(e);typeof h=="number"&&(o.minItems=h),typeof g=="number"&&(o.maxItems=g)},"tupleProcessor");function Zu(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let g=e.get(t)?.def;if(!g)return t;let _=Zu(e,g,r);return _===g?t:_}for(let g of["anyOf","oneOf"]){let _=t[g];if(!Array.isArray(_))continue;let w=_.map(z=>Zu(e,z,r));w.some((z,x)=>z!==_[x])&&(t={...t,[g]:w})}let n=Array.isArray(t.type)?t.type:[t.type],o=!n.includes("string")&&n.some(g=>g==="number"||g==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(g=>typeof g=="number"))return t;let{minimum:c,maximum:u,exclusiveMinimum:a,exclusiveMaximum:l,multipleOf:f,format:p,id:m,...h}=t;return h.enum?h.enum=h.enum.map(g=>typeof g=="number"?String(g):g):typeof h.const=="number"&&(h.const=String(h.const)),o&&(h.type="string",i||(h.pattern=(n.includes("number")?be:or).source)),h}s(Zu,"stringifyKeyNames");var Nu=new WeakMap;function Qy(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let r=new Map;for(let n of Nu.get(e)??[]){let o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===!0||r.has(i))continue;let c=Zu(t,i,new Set);c!==i&&r.set(i,c)}if(r.size)for(let n of e.seen.values())for(let o of[n.schema,n.def]){let i=o&&r.get(o.propertyNames);i&&(o.propertyNames=i)}}s(Qy,"rewriteKeyNames");var sa=s((e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object";let c=i.keyType,u=U(c).patterns;if(i.mode==="loose"&&u&&u.size>0){let f=D(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let p of u)J(o.patternProperties,Yf(p).source,f)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=D(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let f=Nu.get(t);f||(f=[],Nu.set(t,f),t.deferred.push(()=>Qy(t))),f.push(e)}o.additionalProperties=D(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let a=c._zod.values,l=t.io==="input"&&Pr(i.valueType)!==void 0;if(a&&!i.partial&&!l){let f=[...a].filter(p=>typeof p=="string"||typeof p=="number");f.length>0&&(o.required=f.map(String))}},"recordProcessor"),ca=s((e,t,r,n)=>{let o=e._zod.def,i=D(o.innerType,t,n),c=t.seen.get(e);t.target==="openapi-3.0"?(c.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},"nullableProcessor"),ua=s((e,t,r,n)=>{let o=e._zod.def;D(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},"nonoptionalProcessor"),aa=Symbol();function Qf(e,t,r,n,o){let i=!1,c=JSON.stringify(e,(u,a)=>typeof a!="bigint"?a:(i=!0,null));return i?(M(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),aa):JSON.parse(c)}s(Qf,"serializeDefaultValue");var la=s((e,t,r,n)=>{let o=e._zod.def;D(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let c=Qf(o.defaultValue,e,t,r,n);c!==aa&&(r.default=c)},"defaultProcessor"),fa=s((e,t,r,n)=>{let o=e._zod.def;D(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let c=Qf(o.defaultValue,e,t,r,n);c!==aa&&(r._prefault=c)},"prefaultProcessor"),pa=s((e,t,r,n)=>{let o=e._zod.def;D(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let c;try{c=o.catchValue(void 0)}catch{M(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=c},"catchProcessor"),da=s((e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),c=t.io==="input"?i?o.out:o.in:o.out;D(c,t,n);let u=t.seen.get(e);u.ref=c},"pipeProcessor"),ma=s((e,t,r,n)=>{let o=e._zod.def;D(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0},"readonlyProcessor"),ha=s((e,t,r,n)=>{let o=e._zod.def;D(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},"promiseProcessor"),wo=s((e,t,r,n)=>{let o=e._zod.def;D(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},"optionalProcessor"),ga=s((e,t,r,n)=>{let o=e._zod.innerType;D(o,t,n);let i=t.seen.get(e);i.ref=o},"lazyProcessor"),_o={string:Eu,number:Cu,boolean:Tu,bigint:Du,symbol:Ru,null:ju,undefined:Lu,void:Vu,never:Fu,any:Mu,unknown:Uu,date:Bu,enum:Ju,literal:Ku,nan:Wu,template_literal:qu,file:Gu,success:Hu,custom:Xu,function:Yu,transform:Qu,map:ea,set:ta,array:ra,object:na,union:$o,intersection:oa,tuple:ia,record:sa,nullable:ca,nonoptional:ua,default:la,prefault:fa,catch:pa,pipe:da,readonly:ma,promise:ha,optional:wo,lazy:ga};function bo(e,t){if("_idmap"in e){let n=e,o=Ze({...t,processors:_o}),i={};for(let a of n._idmap.entries()){let[l,f]=a;D(f,o)}let c={},u={registry:n,uri:t?.uri,defs:i};o.external=u;for(let a of n._idmap.entries()){let[l,f]=a;Ne(o,f),J(c,l,Ee(o,f))}if(Object.keys(i).length>0){let a=o.target==="draft-2020-12"?"$defs":"definitions";c.__shared={[a]:i}}return{schemas:c}}let r=Ze({...t,processors:_o});return D(e,r),Ne(r,e),Ee(r,e)}s(bo,"toJSONSchema");var vo=class{static{s(this,"JSONSchemaGenerator")}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(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Ze({processors:_o,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return D(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Ne(this.ctx,t);let n=Ee(this.ctx,t),{"~standard":o,...i}=n;return i}};var ep={};var Vt={};_e(Vt,{ZodAny:()=>ja,ZodArray:()=>Ma,ZodBase64:()=>Fo,ZodBase64URL:()=>Mo,ZodBigInt:()=>jt,ZodBigIntFormat:()=>Jo,ZodBoolean:()=>Rt,ZodCIDRv4:()=>Lo,ZodCIDRv6:()=>Vo,ZodCUID:()=>No,ZodCUID2:()=>Eo,ZodCatch:()=>al,ZodCodec:()=>Rr,ZodCreditCard:()=>Aa,ZodCustom:()=>jr,ZodCustomStringFormat:()=>tt,ZodDate:()=>Zr,ZodDefault:()=>nl,ZodDiscriminatedUnion:()=>Ba,ZodE164:()=>Uo,ZodEmail:()=>Io,ZodEmoji:()=>Ao,ZodEnum:()=>Ct,ZodExactOptional:()=>Go,ZodFile:()=>Qa,ZodFunction:()=>$l,ZodGUID:()=>Oo,ZodIBAN:()=>Za,ZodIPv4:()=>Ro,ZodIPv6:()=>jo,ZodISODate:()=>Te,ZodISODateTime:()=>Ce,ZodISODuration:()=>Re,ZodISOTime:()=>De,ZodInstanceOf:()=>vl,ZodIntersection:()=>Ja,ZodJWT:()=>Bo,ZodKSUID:()=>Do,ZodLazy:()=>gl,ZodLiteral:()=>Ya,ZodMAC:()=>Oa,ZodMap:()=>Ha,ZodNaN:()=>fl,ZodNanoID:()=>Zo,ZodNever:()=>Va,ZodNonOptional:()=>Ho,ZodNull:()=>Da,ZodNullable:()=>rl,ZodNumber:()=>Dt,ZodNumberFormat:()=>rt,ZodObject:()=>Er,ZodOptional:()=>Tr,ZodPipe:()=>Dr,ZodPrefault:()=>il,ZodPreprocess:()=>pl,ZodPromise:()=>_l,ZodReadonly:()=>dl,ZodRecord:()=>Et,ZodSet:()=>Xa,ZodString:()=>Tt,ZodStringFormat:()=>R,ZodSuccess:()=>ul,ZodSymbol:()=>Ca,ZodTemplateLiteral:()=>hl,ZodTransform:()=>el,ZodTuple:()=>Wa,ZodType:()=>O,ZodULID:()=>Co,ZodURL:()=>Ar,ZodUUID:()=>ye,ZodUndefined:()=>Ta,ZodUnion:()=>Cr,ZodUnknown:()=>La,ZodVoid:()=>Fa,ZodXID:()=>To,ZodXor:()=>Ua,_ZodString:()=>Po,_default:()=>ol,_function:()=>pd,any:()=>Up,array:()=>Nr,base64:()=>xp,base64url:()=>kp,bigint:()=>jp,boolean:()=>Ea,catch:()=>ll,check:()=>dd,cidrv4:()=>bp,cidrv6:()=>vp,codec:()=>ud,creditCard:()=>Sp,cuid:()=>dp,cuid2:()=>mp,currencyCode:()=>Np,custom:()=>md,date:()=>Jp,describe:()=>hd,discriminatedUnion:()=>Xp,e164:()=>zp,email:()=>np,emoji:()=>fp,enum:()=>Wo,exactOptional:()=>tl,file:()=>od,float32:()=>Cp,float64:()=>Tp,function:()=>pd,guid:()=>op,hash:()=>Ep,hex:()=>Zp,hostname:()=>Ap,httpUrl:()=>lp,iban:()=>Pp,instanceof:()=>yd,int:()=>zo,int32:()=>Dp,int64:()=>Lp,intersection:()=>Ka,invertCodec:()=>ad,ipv4:()=>_p,ipv6:()=>wp,json:()=>$d,jwt:()=>Ip,keyof:()=>Kp,ksuid:()=>yp,lazy:()=>yl,literal:()=>nd,looseObject:()=>Gp,looseRecord:()=>Qp,mac:()=>$p,map:()=>ed,meta:()=>gd,nan:()=>cd,nanoid:()=>pp,nativeEnum:()=>rd,never:()=>Ko,nonoptional:()=>cl,null:()=>Ra,nullable:()=>Or,nullish:()=>id,number:()=>Na,object:()=>Wp,optional:()=>Qe,partialRecord:()=>Yp,pipe:()=>So,prefault:()=>sl,preprocess:()=>wd,promise:()=>fd,readonly:()=>ml,record:()=>Ga,refine:()=>wl,set:()=>td,strictObject:()=>qp,string:()=>Ir,stringFormat:()=>Op,stringbool:()=>_d,success:()=>sd,superRefine:()=>bl,symbol:()=>Fp,templateLiteral:()=>ld,transform:()=>qo,tuple:()=>qa,uint32:()=>Rp,uint64:()=>Vp,ulid:()=>hp,undefined:()=>Mp,union:()=>Lt,unknown:()=>Ye,url:()=>ap,uuid:()=>ip,uuidv4:()=>sp,uuidv6:()=>cp,uuidv7:()=>up,void:()=>Bp,xid:()=>gp,xor:()=>Hp});var xo={};_e(xo,{endsWith:()=>vt,gt:()=>he,gte:()=>ce,includes:()=>wt,length:()=>He,lowercase:()=>_t,lt:()=>me,lte:()=>se,maxLength:()=>Ge,maxSize:()=>Ae,mime:()=>kt,minLength:()=>ve,minSize:()=>ge,multipleOf:()=>Oe,negative:()=>mo,nonnegative:()=>go,nonpositive:()=>ho,normalize:()=>zt,overwrite:()=>de,positive:()=>po,properties:()=>xt,property:()=>yo,regex:()=>yt,size:()=>qe,slugify:()=>Ot,startsWith:()=>bt,toLowerCase:()=>Pt,toUpperCase:()=>It,trim:()=>St,uppercase:()=>$t});var tp=new WeakSet([Object.prototype,Error.prototype]);function ko(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}s(ko,"_lazyMethod");var rp=s((e,t)=>{_i.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);tp.has(r)||(tp.add(r),ko(r,"format",n=>o=>er(n,o)),ko(r,"flatten",n=>o=>Qt(n,o)),ko(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,it,2)}),ko(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,it,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},"initializer"),t_=d("ZodError",rp),oe=d("ZodError",rp,void 0,{Parent:Error});var ya=at(oe),_a=lt(oe),$a=ft(oe),wa=pt(oe),ba=en(oe),va=tn(oe),xa=rn(oe),ka=nn(oe),za=on(oe),Sa=sn(oe),Pa=cn(oe),Ia=un(oe);function n_(){B.localeError||F($r())}s(n_,"_ensureDefaultLocale");function et(){B.memoizer||F({memoizer:_r()})}s(et,"_ensureDefaultMemoizer");var O=d("ZodType",(e,t)=>(n_(),P.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(v.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return C(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(wl(e,t))},superRefine(e,t){return this.check(bl(e,t))},overwrite(e){return this.check(de(e))},optional(){return Qe(this)},exactOptional(){return tl(this)},nullable(){return Or(this)},nullish(){return Qe(Or(this))},nonoptional(e){return cl(this,e)},array(){return Nr(this)},or(e){return Lt([this,e])},and(e){return Ka(this,e)},transform(e){return So(this,qo(e))},default(e){return ol(this,e)},prefault(e){return sl(this,e)},catch(e){return ll(this,e)},pipe(e){return So(this,e)},readonly(){return ml(this)},describe(e){let t=this.clone();return K.add(t,{description:e}),t},meta(...e){if(e.length===0)return K.get(this);let t=this.clone();return K.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return v.hide(this,"~standard",{...$n(this),jsonSchema:{input:At(this,"input"),output:At(this,"output")}})},set"~standard"(e){v.own(this,"~standard",e)},parse:s(function e(t,r){return ya(this,t,r,{callee:e})},"_parse"),parseAsync:s(async function e(t,r){return await _a(this,t,r,{callee:e})},"_parseAsync"),safeParse(e,t){return $a(this,e,t)},async safeParseAsync(e,t){return wa(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){v.own(this,"spa",e)},validate(e,t){return tr(this,e,t)},validateAsync(e,t){return rr(this,e,t)},encode:s(function e(t,r){return ba(this,t,r,{callee:e})},"_encode"),decode:s(function e(t,r){return va(this,t,r,{callee:e})},"_decode"),encodeAsync:s(async function e(t,r){return await xa(this,t,r,{callee:e})},"_encodeAsync"),decodeAsync:s(async function e(t,r){return await ka(this,t,r,{callee:e})},"_decodeAsync"),safeEncode(e,t){return za(this,e,t)},safeDecode(e,t){return Sa(this,e,t)},async safeEncodeAsync(e,t){return Pa(this,e,t)},async safeDecodeAsync(e,t){return Ia(this,e,t)},toJSONSchema(e){return Au(this,{})(e)},get description(){return K.get(this)?.description},get _def(){return this._zod.def}}),Po=d("_ZodString",(e,t)=>{Ue.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Eu(e,r,n,o)},v.derived({format:s(e=>U(e).format??null,"format"),minLength:s(e=>U(e).minimum??null,"minLength"),maxLength:s(e=>U(e).maximum??null,"maxLength")},{regex(...e){return this.check(yt(...e))},includes(...e){return this.check(wt(...e))},startsWith(...e){return this.check(bt(...e))},endsWith(...e){return this.check(vt(...e))},min(...e){return this.check(ve(...e))},max(...e){return this.check(Ge(...e))},length(...e){return this.check(He(...e))},nonempty(...e){return this.check(ve(1,...e))},lowercase(e){return this.check(_t(e))},uppercase(e){return this.check($t(e))},trim(){return this.check(St())},normalize(...e){return this.check(zt(...e))},toLowerCase(){return this.check(Pt())},toUpperCase(){return this.check(It())},slugify(){return this.check(Ot())}})),Tt=d("ZodString",(e,t)=>{Ue.init(e,t),Po.init(e,t)},{email(e){return this.check(Jn(Io,e))},url(e){return this.check(br(Ar,e))},jwt(e){return this.check(fo(Bo,e))},emoji(e){return this.check(Xn(Ao,e))},guid(e){return this.check(Kn(Oo,e))},uuid(e){return this.check(Wn(ye,e))},uuidv4(e){return this.check(qn(ye,e))},uuidv6(e){return this.check(Gn(ye,e))},uuidv7(e){return this.check(Hn(ye,e))},nanoid(e){return this.check(Yn(Zo,e))},cuid(e){return this.check(Qn(No,e))},cuid2(e){return this.check(eo(Eo,e))},ulid(e){return this.check(to(Co,e))},base64(e){return this.check(uo(Fo,e))},base64url(e){return this.check(ao(Mo,e))},xid(e){return this.check(ro(To,e))},ksuid(e){return this.check(no(Do,e))},ipv4(e){return this.check(oo(Ro,e))},ipv6(e){return this.check(io(jo,e))},cidrv4(e){return this.check(so(Lo,e))},cidrv6(e){return this.check(co(Vo,e))},e164(e){return this.check(lo(Uo,e))},datetime(e){return this.check(vr(Ce,e))},date(e){return this.check(xr(Te,e))},time(e){return this.check(kr(De,e))},duration(e){return this.check(zr(Re,e))}});function Ir(e){return Kc(Tt,e)}s(Ir,"string");var R=d("ZodStringFormat",(e,t)=>{T.init(e,t),Po.init(e,t)}),Ce=d("ZodISODateTime",(e,t)=>{js.init(e,t),R.init(e,t)}),Te=d("ZodISODate",(e,t)=>{Ls.init(e,t),R.init(e,t)}),De=d("ZodISOTime",(e,t)=>{Vs.init(e,t),R.init(e,t)}),Re=d("ZodISODuration",(e,t)=>{Fs.init(e,t),R.init(e,t)}),Io=d("ZodEmail",(e,t)=>{Ps.init(e,t),R.init(e,t)});function np(e){return Jn(Io,e)}s(np,"email");var Oo=d("ZodGUID",(e,t)=>{zs.init(e,t),R.init(e,t)});function op(e){return Kn(Oo,e)}s(op,"guid");var ye=d("ZodUUID",(e,t)=>{Ss.init(e,t),R.init(e,t)});function ip(e){return Wn(ye,e)}s(ip,"uuid");function sp(e){return qn(ye,e)}s(sp,"uuidv4");function cp(e){return Gn(ye,e)}s(cp,"uuidv6");function up(e){return Hn(ye,e)}s(up,"uuidv7");var Ar=d("ZodURL",(e,t)=>{As.init(e,t),R.init(e,t)});function ap(e){return br(Ar,e)}s(ap,"url");function lp(e){return br(Ar,{protocol:nr,hostname:Fi,...v.normalizeParams(e)})}s(lp,"httpUrl");var Ao=d("ZodEmoji",(e,t)=>{Zs.init(e,t),R.init(e,t)});function fp(e){return Xn(Ao,e)}s(fp,"emoji");var Zo=d("ZodNanoID",(e,t)=>{Ns.init(e,t),R.init(e,t)});function pp(e){return Yn(Zo,e)}s(pp,"nanoid");var No=d("ZodCUID",(e,t)=>{Es.init(e,t),R.init(e,t)});function dp(e){return Qn(No,e)}s(dp,"cuid");var Eo=d("ZodCUID2",(e,t)=>{Cs.init(e,t),R.init(e,t)});function mp(e){return eo(Eo,e)}s(mp,"cuid2");var Co=d("ZodULID",(e,t)=>{Ts.init(e,t),R.init(e,t)});function hp(e){return to(Co,e)}s(hp,"ulid");var To=d("ZodXID",(e,t)=>{Ds.init(e,t),R.init(e,t)});function gp(e){return ro(To,e)}s(gp,"xid");var Do=d("ZodKSUID",(e,t)=>{Rs.init(e,t),R.init(e,t)});function yp(e){return no(Do,e)}s(yp,"ksuid");var Ro=d("ZodIPv4",(e,t)=>{Ms.init(e,t),R.init(e,t)});function _p(e){return oo(Ro,e)}s(_p,"ipv4");var Oa=d("ZodMAC",(e,t)=>{Bs.init(e,t),R.init(e,t)});function $p(e){return qc(Oa,e)}s($p,"mac");var jo=d("ZodIPv6",(e,t)=>{Us.init(e,t),R.init(e,t)});function wp(e){return io(jo,e)}s(wp,"ipv6");var Lo=d("ZodCIDRv4",(e,t)=>{Js.init(e,t),R.init(e,t)});function bp(e){return so(Lo,e)}s(bp,"cidrv4");var Vo=d("ZodCIDRv6",(e,t)=>{Ks.init(e,t),R.init(e,t)});function vp(e){return co(Vo,e)}s(vp,"cidrv6");var Fo=d("ZodBase64",(e,t)=>{Ws.init(e,t),R.init(e,t)});function xp(e){return uo(Fo,e)}s(xp,"base64");var Mo=d("ZodBase64URL",(e,t)=>{qs.init(e,t),R.init(e,t)});function kp(e){return ao(Mo,e)}s(kp,"base64url");var Uo=d("ZodE164",(e,t)=>{Gs.init(e,t),R.init(e,t)});function zp(e){return lo(Uo,e)}s(zp,"e164");var Aa=d("ZodCreditCard",(e,t)=>{Hs.init(e,t),R.init(e,t)});function Sp(e){return Gc(Aa,e)}s(Sp,"creditCard");var Za=d("ZodIBAN",(e,t)=>{Xs.init(e,t),R.init(e,t)});function Pp(e){return Hc(Za,e)}s(Pp,"iban");var Bo=d("ZodJWT",(e,t)=>{Ys.init(e,t),R.init(e,t)});function Ip(e){return fo(Bo,e)}s(Ip,"jwt");var tt=d("ZodCustomStringFormat",(e,t)=>{Qs.init(e,t),R.init(e,t)});function Op(e,t,r={}){return Xe(tt,e,t,r)}s(Op,"stringFormat");function Ap(e){return Xe(tt,"hostname",Vi,e)}s(Ap,"hostname");function Zp(e){return Xe(tt,"hex",ts,e)}s(Zp,"hex");function Np(e){return Xe(tt,"currency_code",Ui,e)}s(Np,"currencyCode");function Ep(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,o=le[n];if(!o)throw new Error(`Unrecognized hash format: ${n}`);return Xe(tt,n,o,t)}s(Ep,"hash");var Dt=d("ZodNumber",(e,t)=>{On.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Cu(e,r,n,o),e.isFinite=!0},v.derived({minValue:s(e=>{let{minimum:t,exclusiveMinimum:r}=U(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},"minValue"),maxValue:s(e=>{let{maximum:t,exclusiveMaximum:r}=U(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},"maxValue"),isInt:s(e=>{let{isInt:t,multipleOf:r}=U(e);return!!t||!!r?.some(Number.isSafeInteger)},"isInt"),format:s(e=>U(e).format??null,"format")},{gt(e,t){return this.check(he(e,t))},gte(e,t){return this.check(ce(e,t))},min(e,t){return this.check(ce(e,t))},lt(e,t){return this.check(me(e,t))},lte(e,t){return this.check(se(e,t))},max(e,t){return this.check(se(e,t))},int(e){return this.check(zo(e))},safe(e){return this.check(zo(e))},positive(e){return this.check(he(0,e))},nonnegative(e){return this.check(ce(0,e))},negative(e){return this.check(me(0,e))},nonpositive(e){return this.check(se(0,e))},multipleOf(e,t){return this.check(Oe(e,t))},step(e,t){return this.check(Oe(e,t))},finite(){return this}}));function Na(e){return Yc(Dt,e)}s(Na,"number");var rt=d("ZodNumberFormat",(e,t)=>{ec.init(e,t),Dt.init(e,t)});function zo(e){return eu(rt,e)}s(zo,"int");function Cp(e){return tu(rt,e)}s(Cp,"float32");function Tp(e){return ru(rt,e)}s(Tp,"float64");function Dp(e){return nu(rt,e)}s(Dp,"int32");function Rp(e){return ou(rt,e)}s(Rp,"uint32");var Rt=d("ZodBoolean",(e,t)=>{pr.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Tu(e,r,n,o)});function Ea(e){return iu(Rt,e)}s(Ea,"boolean");var jt=d("ZodBigInt",(e,t)=>{An.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Du(e,r,n,o)},v.derived({minValue:s(e=>U(e).minimum??null,"minValue"),maxValue:s(e=>U(e).maximum??null,"maxValue"),format:s(e=>U(e).format??null,"format")},{gte(e,t){return this.check(ce(e,t))},min(e,t){return this.check(ce(e,t))},gt(e,t){return this.check(he(e,t))},lt(e,t){return this.check(me(e,t))},lte(e,t){return this.check(se(e,t))},max(e,t){return this.check(se(e,t))},positive(e){return this.check(he(BigInt(0),e))},negative(e){return this.check(me(BigInt(0),e))},nonpositive(e){return this.check(se(BigInt(0),e))},nonnegative(e){return this.check(ce(BigInt(0),e))},multipleOf(e,t){return this.check(Oe(e,t))}}));function jp(e){return cu(jt,e)}s(jp,"bigint");var Jo=d("ZodBigIntFormat",(e,t)=>{tc.init(e,t),jt.init(e,t)});function Lp(e){return au(Jo,e)}s(Lp,"int64");function Vp(e){return lu(Jo,e)}s(Vp,"uint64");var Ca=d("ZodSymbol",(e,t)=>{rc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ru(e,r,n,o)});function Fp(e){return fu(Ca,e)}s(Fp,"symbol");var Ta=d("ZodUndefined",(e,t)=>{nc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Lu(e,r,n,o)});function Mp(e){return pu(Ta,e)}s(Mp,"_undefined");var Da=d("ZodNull",(e,t)=>{oc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ju(e,r,n,o)});function Ra(e){return du(Da,e)}s(Ra,"_null");var ja=d("ZodAny",(e,t)=>{ic.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mu(e,r,n,o)});function Up(){return mu(ja)}s(Up,"any");var La=d("ZodUnknown",(e,t)=>{sc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Uu(e,r,n,o)});function Ye(){return hu(La)}s(Ye,"unknown");var Va=d("ZodNever",(e,t)=>{cc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fu(e,r,n,o)});function Ko(e){return gu(Va,e)}s(Ko,"never");var Fa=d("ZodVoid",(e,t)=>{uc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vu(e,r,n,o)});function Bp(e){return yu(Fa,e)}s(Bp,"_void");var Zr=d("ZodDate",(e,t)=>{ac.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bu(e,r,n,o),e.min=(r,n)=>e.check(ce(r,n)),e.max=(r,n)=>e.check(se(r,n))},v.derived({minDate:s(e=>{let{minimum:t}=U(e);return t?new Date(t):null},"minDate"),maxDate:s(e=>{let{maximum:t}=U(e);return t?new Date(t):null},"maxDate")},{}));function Jp(e){return _u(Zr,e)}s(Jp,"date");var Ma=d("ZodArray",(e,t)=>{et(),lc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ra(e,r,n,o),e.element=t.element},{min(e,t){return this.check(ve(e,t))},nonempty(e){return this.check(ve(1,e))},max(e,t){return this.check(Ge(e,t))},length(e,t){return this.check(He(e,t))},unwrap(){return this.element}});function Nr(e,t){return bu(Ma,e,t)}s(Nr,"array");function Kp(e){let t=e._zod.def.shape;return Wo(Object.keys(t))}s(Kp,"keyof");var Er=d("ZodObject",(e,t)=>{et(),fc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>na(e,r,n,o),v.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return Wo(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(v.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(v.mergeDefs(this._zod.def,{catchall:Ye()}))},loose(){return this.clone(v.mergeDefs(this._zod.def,{catchall:Ye()}))},strict(){return this.clone(v.mergeDefs(this._zod.def,{catchall:Ko()}))},strip(){return this.clone(v.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return v.extend(this,e)},safeExtend(e){return v.safeExtend(this,e)},merge(e){return v.merge(this,e)},pick(e){return v.pick(this,e)},omit(e){return v.omit(this,e)},partial(...e){return v.partial(Tr,this,e[0])},exactPartial(...e){return v.partial(Go,this,e[0],"exactPartial")},required(...e){return v.required(Ho,this,e[0])}});function Wp(e,t){let r={type:"object",shape:e??{},...v.normalizeParams(t)};return new Er(r)}s(Wp,"object");function qp(e,t){return new Er({type:"object",shape:e,catchall:Ko(),...v.normalizeParams(t)})}s(qp,"strictObject");function Gp(e,t){return new Er({type:"object",shape:e,catchall:Ye(),...v.normalizeParams(t)})}s(Gp,"looseObject");var Cr=d("ZodUnion",(e,t)=>{dr.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$o(e,r,n,o),e.options=t.options});function Lt(e,t){return new Cr({type:"union",options:e,...v.normalizeParams(t)})}s(Lt,"union");var Ua=d("ZodXor",(e,t)=>{Cr.init(e,t),pc.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$o(e,r,n,o),e.options=t.options});function Hp(e,t){return new Ua({type:"union",options:e,inclusive:!1,...v.normalizeParams(t)})}s(Hp,"xor");var Ba=d("ZodDiscriminatedUnion",(e,t)=>{Cr.init(e,t),mc.init(e,t)});function Xp(e,t,r){return new Ba({type:"union",options:t,discriminator:e,...v.normalizeParams(r)})}s(Xp,"discriminatedUnion");var Ja=d("ZodIntersection",(e,t)=>{hc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>oa(e,r,n,o)});function Ka(e,t){return new Ja({type:"intersection",left:e,right:t})}s(Ka,"intersection");var Wa=d("ZodTuple",(e,t)=>{et(),Zn.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ia(e,r,n,o)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Tr({type:"optional",innerType:t}))})}});function qa(e,t,r){let n=t instanceof P,o=n?r:t,i=n?t:null;return new Wa({type:"tuple",items:e,rest:i,...v.normalizeParams(o)})}s(qa,"tuple");var Et=d("ZodRecord",(e,t)=>{et(),gc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>sa(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function Ga(e,t,r){return!t||!t._zod?new Et({type:"record",keyType:Ir(),valueType:e,...v.normalizeParams(t)}):new Et({type:"record",keyType:e,valueType:t,...v.normalizeParams(r)})}s(Ga,"record");function Yp(e,t,r){return new Et({type:"record",keyType:e,valueType:t,...v.normalizeParams(r),partial:!0})}s(Yp,"partialRecord");function Qp(e,t,r){return new Et({type:"record",keyType:e,valueType:t,mode:"loose",...v.normalizeParams(r)})}s(Qp,"looseRecord");var Ha=d("ZodMap",(e,t)=>{et(),yc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ea(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(ge(...r)),e.nonempty=r=>e.check(ge(1,r)),e.max=(...r)=>e.check(Ae(...r)),e.size=(...r)=>e.check(qe(...r))});function ed(e,t,r){return new Ha({type:"map",keyType:e,valueType:t,...v.normalizeParams(r)})}s(ed,"map");var Xa=d("ZodSet",(e,t)=>{et(),_c.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ta(e,r,n,o),e.min=(...r)=>e.check(ge(...r)),e.nonempty=r=>e.check(ge(1,r)),e.max=(...r)=>e.check(Ae(...r)),e.size=(...r)=>e.check(qe(...r))});function td(e,t){return new Xa({type:"set",valueType:e,...v.normalizeParams(t)})}s(td,"set");var Ct=d("ZodEnum",(e,t)=>{$c.init(e,t),O.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Ju(e,n,o,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let c of n)if(r.has(c))i[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Ct({...t,checks:[],...v.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let c of n)if(r.has(c))delete i[c];else throw new Error(`Key ${c} not found in enum`);return new Ct({...t,checks:[],...v.normalizeParams(o),entries:i})}});function Wo(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ct({type:"enum",entries:r,...v.normalizeParams(t)})}s(Wo,"_enum");function rd(e,t){return new Ct({type:"enum",entries:e,...v.normalizeParams(t)})}s(rd,"nativeEnum");var Ya=d("ZodLiteral",(e,t)=>{wc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ku(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function nd(e,t){return new Ya({type:"literal",values:Array.isArray(e)?e:[e],...v.normalizeParams(t)})}s(nd,"literal");var Qa=d("ZodFile",(e,t)=>{bc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gu(e,r,n,o),e.min=(r,n)=>e.check(ge(r,n)),e.max=(r,n)=>e.check(Ae(r,n)),e.mime=(r,n)=>e.check(kt(Array.isArray(r)?r:[r],n))});function od(e){return vu(Qa,e)}s(od,"file");var el=d("ZodTransform",(e,t)=>{et(),vc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qu(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ie(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(v.issue(i,r.value,t));else{let c=i;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),"input"in c||(c.input=r.value),c.inst??(c.inst=e),r.issues.push(v.issue(c))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function qo(e){return new el({type:"transform",transform:e})}s(qo,"transform");var Tr=d("ZodOptional",(e,t)=>{Nn.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Qe(e){return new Tr({type:"optional",innerType:e})}s(Qe,"optional");var Go=d("ZodExactOptional",(e,t)=>{xc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function tl(e){return new Go({type:"optional",innerType:e})}s(tl,"exactOptional");var rl=d("ZodNullable",(e,t)=>{kc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ca(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Or(e){return new rl({type:"nullable",innerType:e})}s(Or,"nullable");function id(e){return Qe(Or(e))}s(id,"nullish");var nl=d("ZodDefault",(e,t)=>{zc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>la(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ol(e,t){return new nl({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():v.shallowClone(t)}})}s(ol,"_default");var il=d("ZodPrefault",(e,t)=>{Sc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fa(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function sl(e,t){return new il({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():v.shallowClone(t)}})}s(sl,"prefault");var Ho=d("ZodNonOptional",(e,t)=>{Pc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ua(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function cl(e,t){return new Ho({type:"nonoptional",innerType:e,...v.normalizeParams(t)})}s(cl,"nonoptional");var ul=d("ZodSuccess",(e,t)=>{Ic.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Hu(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function sd(e){return new ul({type:"success",innerType:e})}s(sd,"success");var al=d("ZodCatch",(e,t)=>{Oc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pa(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ll(e,t){return new al({type:"catch",innerType:e,catchValue:typeof t=="function"?t:v.constantCatch(t)})}s(ll,"_catch");var fl=d("ZodNaN",(e,t)=>{Ac.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wu(e,r,n,o)});function cd(e){return wu(fl,e)}s(cd,"nan");var Dr=d("ZodPipe",(e,t)=>{En.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>da(e,r,n,o),e.in=t.in,e.out=t.out});function So(e,t){return new Dr({type:"pipe",in:e,out:t})}s(So,"pipe");var Rr=d("ZodCodec",(e,t)=>{Dr.init(e,t),mr.init(e,t)});function ud(e,t,r){return new Rr({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}s(ud,"codec");function ad(e){let t=e._zod.def;return new Rr({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}s(ad,"invertCodec");var pl=d("ZodPreprocess",(e,t)=>{Dr.init(e,t),Zc.init(e,t)}),dl=d("ZodReadonly",(e,t)=>{Nc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ma(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ml(e){return new dl({type:"readonly",innerType:e})}s(ml,"readonly");var hl=d("ZodTemplateLiteral",(e,t)=>{Ec.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qu(e,r,n,o)});function ld(e,t){return new hl({type:"template_literal",parts:e,...v.normalizeParams(t)})}s(ld,"templateLiteral");var gl=d("ZodLazy",(e,t)=>{hr.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ga(e,r,n,o),e.unwrap=()=>e._zod.def.getter()});function yl(e){return new gl({type:"lazy",getter:e})}s(yl,"lazy");var _l=d("ZodPromise",(e,t)=>{Tc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ha(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function fd(e){return new _l({type:"promise",innerType:e})}s(fd,"promise");var $l=d("ZodFunction",(e,t)=>{Cc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yu(e,r,n,o)});function pd(e){return new $l({type:"function",input:Array.isArray(e?.input)?qa(e?.input):e?.input??Nr(Ye()),output:e?.output??Ye()})}s(pd,"_function");var jr=d("ZodCustom",(e,t)=>{Dc.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xu(e,r,n,o)});function dd(e){let t=new j({check:"custom"});return t._zod.check=e,t}s(dd,"check");function md(e,t){return xu(jr,e??(()=>!0),t)}s(md,"custom");function wl(e,t={}){return ku(jr,e,t)}s(wl,"refine");function bl(e,t){return zu(e,t)}s(bl,"superRefine");var hd=Su,gd=Pu,vl=d("ZodInstanceOf",(e,t)=>{jr.init(e,t)},{properties(e,t){return this.check(xt(e,t))}});function yd(e,t={}){let r=new vl({type:"custom",check:"custom",fn:s(n=>n instanceof e,"fn"),abort:!0,...v.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}s(yd,"_instanceof");var _d=s((...e)=>Iu({Codec:Rr,Boolean:Rt,String:Tt},...e),"stringbool");function $d(e){let t=yl(()=>Lt([Ir(e),Na(),Ea(),Ra(),Nr(t),Ga(Ir(),t)]));return t}s($d,"json");function wd(e,t){return new pl({type:"pipe",in:qo(e),out:t})}s(wd,"preprocess");var o_={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 i_(e){F({customError:e})}s(i_,"setErrorMap");function s_(){return F().customError}s(s_,"getErrorMap");var xl;xl||(xl={});var Lr={};_e(Lr,{ZodISODate:()=>Te,ZodISODateTime:()=>Ce,ZodISODuration:()=>Re,ZodISOTime:()=>De,date:()=>u_,datetime:()=>c_,duration:()=>l_,time:()=>a_});function c_(e){return vr(Ce,e)}s(c_,"datetime");function u_(e){return xr(Te,e)}s(u_,"date");function a_(e){return kr(De,e)}s(a_,"time");function l_(e){return zr(Re,e)}s(l_,"duration");var b={...Vt,...xo,iso:Lr},f_=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 p_(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}s(p_,"detectVersion");function bd(e,t){return e.map((r,n)=>n<t?r:r.optional())}s(bd,"applyMinItems");function d_(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}s(d_,"decodeJSONPointerSegment");function m_(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let n=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let o=r[1]===void 0?void 0:d_(r[1]);if(!o||!t.defs[o])throw new Error(`Reference not found: ${e}`);return t.defs[o]}throw new Error(`Reference not found: ${e}`)}s(m_,"resolveRef");function h_(e,t){return b.transform(n=>n).check(n=>{let o=n.value;if(typeof o!="object"||o===null||Array.isArray(o))return;let i=Object.getOwnPropertyNames(o);if(t.minProperties!==void 0&&i.length<t.minProperties&&n.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:!0,message:`Too small: expected object to have >=${t.minProperties} properties`,input:o,inst:e,continue:!0}),t.maxProperties!==void 0&&i.length>t.maxProperties&&n.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:o,inst:e,continue:!0}),t.keySchema)for(let c of i){let u=t.keySchema.safeParse(c);u.success||n.issues.push({code:"invalid_key",origin:"record",issues:u.error.issues,input:c,path:[c],continue:!0})}}).pipe(e)}s(h_,"checkObjectGuards");function kl(e,t){if(e===null)return"z";let r=typeof e;if(r!=="object"){if(r==="number"&&Number.isNaN(e))return null;let n=String(e);return`${r[0]}${n.length}:${n}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let i=[];for(let c of e){let u=kl(c,t);if(u===null)return null;i.push(u)}return`a${i.length}:[${i.join(",")}]`}let n=Object.keys(e).sort(),o=[];for(let i of n){let c=kl(e[i],t);if(c===null)return null;o.push(`${i.length}:${i}=${c}`)}return`o${o.length}:{${o.join(",")}}`}finally{t.delete(e)}}s(kl,"canonicalKey");var g_=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),y_=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Vr(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Vr):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,r])=>g_.has(t)?Vr(r):!y_.has(t)||typeof r!="object"||r===null?!1:Object.values(r).some(Vr))}s(Vr,"containsRef");function vd(e){return e===1?"element":"elements"}s(vd,"plural");function __(e,t){return b.transform(n=>n).check(n=>{let o=n.value;if(Array.isArray(o)){if(t.uniqueItems===!0){let i=new Map;for(let c=0;c<o.length;c++){let u=kl(o[c],new Set);if(u===null)continue;let a=i.get(u);if(a===void 0){i.set(u,c);continue}n.issues.push({code:"custom",message:`Array items must be unique: element at index ${c} duplicates the one at index ${a}`,input:o,path:[c],continue:!0})}}if(t.containsSchema){let i=t.minContains??1,c=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,u=0;for(let a of o)if(t.containsSchema.safeParse(a).success&&++u>=c)break;u<i&&n.issues.push({code:"custom",message:`Array must contain at least ${i} matching ${vd(i)}; found ${u}`,input:o,continue:!0}),t.maxContains!==void 0&&u>t.maxContains&&n.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${vd(t.maxContains)}`,input:o,continue:!0})}}}).pipe(e)}s(__,"checkArrayGuards");function xd(e,t){if(e!==!1)return e===void 0||e===!0?b.any():Q(e,t)}s(xd,"getTupleRest");var $_=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function kd(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return b.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return b.lazy(()=>{if(!t.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let i=m_(o,t),c=Q(i,t);return t.refs.set(o,c),t.processing.delete(o),c}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&o.length===1&&o[0]===null)return b.null();if(o.length===0)return b.never();if(o.length===1)return b.literal(o[0]);if(o.every(c=>typeof c=="string"))return b.enum(o);let i=o.map(c=>b.literal(c));return i.length<2?i[0]:b.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return b.literal(e.const);let r=e.type;if(Array.isArray(r)){let o=r.map(i=>{let c={...e,type:i};return kd(c,t)});return o.length===0?b.never():o.length===1?o[0]:b.union(o)}if(!r)return b.any();let n;switch(r){case"string":{let o=b.string();if(e.format){let i=e.format;i==="email"?o=o.check(b.email()):i==="uri"||i==="uri-reference"?o=o.check(b.url()):i==="uuid"||i==="guid"?o=o.check(b.uuid()):i==="date-time"?o=o.check(b.iso.datetime({offset:!0})):i==="date"?o=o.check(b.iso.date()):i==="time"?o=o.check(b.regex($_)):i==="duration"?o=o.check(b.iso.duration()):i==="hostname"?o=o.check(b.hostname()):i==="ipv4"?o=o.check(b.ipv4()):i==="ipv6"?o=o.check(b.ipv6()):i==="mac"?o=o.check(b.mac()):i==="cidr"?o=o.check(b.cidrv4()):i==="cidr-v6"?o=o.check(b.cidrv6()):i==="base64"?o=o.check(b.base64()):i==="base64url"?o=o.check(b.base64url()):i==="e164"?o=o.check(b.e164()):i==="credit_card"?o=o.check(b.creditCard()):i==="iban"?o=o.check(b.iban()):i==="jwt"?o=o.check(b.jwt()):i==="emoji"?o=o.check(b.emoji()):i==="nanoid"?o=o.check(b.nanoid()):i==="cuid"?o=o.check(b.cuid()):i==="cuid2"?o=o.check(b.cuid2()):i==="ulid"?o=o.check(b.ulid()):i==="xid"?o=o.check(b.xid()):i==="ksuid"&&(o=o.check(b.ksuid()))}typeof e.minLength=="number"&&(o=o.min(e.minLength)),typeof e.maxLength=="number"&&(o=o.max(e.maxLength)),e.pattern&&(o=o.regex(new RegExp(e.pattern))),n=o;break}case"number":case"integer":{let o=r==="integer"?b.number().int():b.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(o=o.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(o=o.max(e.maximum)),typeof e.exclusiveMinimum=="number"?o=o.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(o=o.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?o=o.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(o=o.lt(e.maximum)),typeof e.multipleOf=="number"&&(o=o.multipleOf(e.multipleOf)),n=o;break}case"boolean":{n=b.boolean();break}case"null":{n=b.null();break}case"object":{let o={},i=e.properties||{},c=new Set(e.required||[]),u=typeof e.additionalProperties=="object"?Q(e.additionalProperties,t):void 0;for(let[p,m]of Object.entries(i)){let h=Q(m,t);J(o,p,c.has(p)?h:h.optional())}if(e.patternProperties){let p=e.patternProperties,m=Object.keys(p),h=[];for(let _ of m){let w=Q(p[_],t),z=b.string().regex(new RegExp(_));h.push(b.looseRecord(z,w))}let g=[];if(Object.keys(o).length>0&&g.push(b.object(o).passthrough()),g.push(...h),g.length===0)n=b.object({}).passthrough();else if(g.length===1)n=g[0];else{let _=b.intersection(g[0],g[1]);for(let w=2;w<g.length;w++)_=b.intersection(_,g[w]);n=_}if(e.additionalProperties===!1){let _=Object.keys(o),w=m.map(x=>new RegExp(x)),z=n;n=n.check(x=>{if(!ue(x.value))return;let I=[];for(let E of Object.keys(x.value))_.includes(E)||w.some(L=>L.test(E))||I.push(E);I.length&&x.issues.push({code:"unrecognized_keys",keys:I,input:x.value,inst:z})})}}else{let p=b.object(o);e.additionalProperties===!1?n=p.strict():u?n=p.catchall(u):n=p.passthrough()}let a=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,f=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(a||l!==void 0||f!==void 0){let p;if(a){let m=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;p=Q(m,t)}n=h_(n,{keySchema:p,minProperties:l,maxProperties:f})}break}case"array":{let o=e.prefixItems,i=e.items;if(o&&Array.isArray(o)){let c=typeof e.minItems=="number"?e.minItems:0,u=o.map(p=>Q(p,t)),a=bd(u,c),l=Array.isArray(i)?void 0:xd(i,t),f=b.tuple(a);n=l?f.rest(l):f,typeof e.minItems=="number"&&(n=n.check(b.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(b.maxLength(e.maxItems)))}else if(Array.isArray(i)){let c=typeof e.minItems=="number"?e.minItems:0,u=i.map(p=>Q(p,t)),a=bd(u,c),l=xd(e.additionalItems,t),f=b.tuple(a);n=l?f.rest(l):f,typeof e.minItems=="number"&&(n=n.check(b.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(b.maxLength(e.maxItems)))}else if(i!==void 0){let c=Q(i,t),u=b.array(c);typeof e.minItems=="number"&&(u=u.min(e.minItems)),typeof e.maxItems=="number"&&(u=u.max(e.maxItems)),n=u}else n=b.array(b.any());(e.uniqueItems===!0||e.contains!==void 0)&&(n=__(n,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?Q(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${r}`)}return n}s(kd,"convertBaseSchema");function Q(e,t){if(typeof e=="boolean")return e?b.any():b.never();let r=kd(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let u=e.anyOf.map(l=>Q(l,t)),a=b.union(u);r=n?b.intersection(r,a):a}if(e.oneOf&&Array.isArray(e.oneOf)){let u=e.oneOf.map(l=>Q(l,t)),a=b.xor(u);r=n?b.intersection(r,a):a}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:b.any();else{let u=n?r:Q(e.allOf[0],t),a=n?0:1;for(let l=a;l<e.allOf.length;l++)u=b.intersection(u,Q(e.allOf[l],t));r=u}e.nullable===!0&&t.version==="openapi-3.0"&&(r=b.nullable(r)),e.readOnly===!0&&(r=b.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let o={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let u of i)u in e&&(o[u]=e[u]);let c=["contentEncoding","contentMediaType","contentSchema"];for(let u of c)u in e&&(o[u]=e[u]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Vr(e.propertyNames)&&(o.propertyNames=e.propertyNames);for(let u of["minProperties","maxProperties"])e[u]!==void 0&&(o[u]=e[u])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Vr(e.contains)&&(o.contains=e.contains);for(let u of["uniqueItems","minContains","maxContains"])e[u]!==void 0&&(o[u]=e[u])}for(let u of Object.keys(e))f_.has(u)||J(o,u,e[u]);return Object.keys(o).length>0&&t.registry.add(r,o),e.description&&(r=r.describe(e.description)),r}s(Q,"convertSchema");function zd(e,t){if(typeof e=="boolean")return e?b.any():b.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=p_(r,t?.defaultTarget),o=r.$defs||r.definitions||{},i={version:n,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??K};return Q(r,i)}s(zd,"fromJSONSchema");var Sd=Symbol("z.visit/resolving");function Fr(e,t){let r=typeof t=="function"?t:(c,u)=>{let a=t[c._zod.def.type];return a?a(c,u):c},n=new Map;function o(c){let u=n.get(c);if(u===Sd)return new hr({type:"lazy",getter:s(()=>n.get(c),"getter")});if(u!==void 0)return u;n.set(c,Sd);let a=i(c),l=r(a,a!==c);return n.set(c,l),l}s(o,"run");function i(c){let u=c._zod.def,a=u.type;switch(a){case"object":{let l=u.shape,f=Object.keys(l),p=!1,m={};for(let g of f){let _=o(l[g]);_!==l[g]&&(p=!0),m[g]=_}let h=u.catchall;return u.catchall&&(h=o(u.catchall),h!==u.catchall&&(p=!0)),p?C(c,{...u,shape:m,catchall:h}):c}case"array":{let l=o(u.element);return l===u.element?c:C(c,{...u,element:l})}case"tuple":{let l=u.items,f=!1,p=[];for(let h of l){let g=o(h);g!==h&&(f=!0),p.push(g)}let m=u.rest;return u.rest&&(m=o(u.rest),m!==u.rest&&(f=!0)),f?C(c,{...u,items:p,rest:m}):c}case"record":case"map":{let l=o(u.keyType),f=o(u.valueType);return l===u.keyType&&f===u.valueType?c:C(c,{...u,keyType:l,valueType:f})}case"set":{let l=o(u.valueType);return l===u.valueType?c:C(c,{...u,valueType:l})}case"union":{let l=u.options,f=!1,p=[];for(let m of l){let h=o(m);h!==m&&(f=!0),p.push(h)}return f?C(c,{...u,options:p}):c}case"intersection":{let l=o(u.left),f=o(u.right);return l===u.left&&f===u.right?c:C(c,{...u,left:l,right:f})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=o(u.innerType);return l===u.innerType?c:C(c,{...u,innerType:l})}case"pipe":{let l=o(u.in),f=o(u.out);return l===u.in&&f===u.out?c:C(c,{...u,in:l,out:f})}case"function":{let l=o(u.input),f=o(u.output);return l===u.input&&f===u.output?c:C(c,{...u,input:l,output:f})}case"lazy":{let l=u.getter,{_cachedInner:f,...p}=u;return C(c,{...p,getter:s(()=>o(l()),"getter")})}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":return c;default:return c}}return s(i,"mapInner"),o(e)}s(Fr,"visit");function Pd(e){return Fr(e,{object:s(t=>t.partial(),"object"),union:s(t=>{let r=t._zod.def;return r.discriminator===void 0?t:Lt(r.options)},"union")})}s(Pd,"deepPartial");function w_(e,t){if(!t?.length)return e;let r=e._zod.def;return C(e,fe(r,{checks:[...r.checks??[],...t]}),{parent:!0})}s(w_,"withChecks");function Id(e){return w_(e.out,e.checks)}s(Id,"outSide");function b_(e){return e.in._zod.traits.has("$ZodTransform")?Id(e):e.in}s(b_,"inSide");function Od(e){return Fr(e,{pipe:s(t=>b_(t._zod.def),"pipe"),default:s((t,r)=>r?Qe(t._zod.def.innerType):t,"default"),catch:s((t,r)=>r?t._zod.def.innerType:t,"catch")})}s(Od,"input");function Ad(e){return Fr(e,{pipe:s(t=>Id(t._zod.def),"pipe"),prefault:s((t,r)=>r?t._zod.def.innerType:t,"prefault")})}s(Ad,"output");var zl={};_e(zl,{bigint:()=>z_,boolean:()=>k_,date:()=>S_,number:()=>x_,string:()=>v_});function v_(e){return Wc(Tt,e)}s(v_,"string");function x_(e){return Qc(Dt,e)}s(x_,"number");function k_(e){return su(Rt,e)}s(k_,"boolean");function z_(e){return uu(jt,e)}s(z_,"bigint");function S_(e){return $u(Zr,e)}s(S_,"date");import p$ from"node:path";var h$=Jm(_m());import{AsyncLocalStorage as Sm}from"node:async_hooks";import{availableParallelism as g$}from"node:os";import{execFile as k$}from"node:child_process";import{promisify as z$}from"node:util";function Om(e){return{experimental_apiVersion:1,contract:e.contract,handlers:e.handlers,...e.experimental_signals===void 0?{}:{experimental_signals:e.experimental_signals},...e.dispose===void 0?{}:{dispose:e.dispose}}}s(Om,"experimental_defineHostEntry");function Q_(e){if(e.length===0)return!1;let t=e.replaceAll("\\","/"),r=/^[a-zA-Z]:\//u.exec(t),n=r?t.slice(r[0].length):t.slice(1);return!r&&!t.startsWith("/")?!1:n.split("/").every(o=>o!==""&&o!=="."&&o!=="..")}s(Q_,"isAbsoluteProviderSkillRootPath");function Am(e){if(e.length===0)return!1;let t=e.replaceAll("\\","/");return!t.startsWith("/")&&!/^[a-zA-Z]:\//u.test(t)&&t.split("/").every(r=>r!==""&&r!=="."&&r!=="..")}s(Am,"isRelativeProviderSkillRootPath");var e$=32,t$=/^[A-Za-z0-9][A-Za-z0-9._-]{0,62}:$/u,Dl=y.string().refine(e=>e===""||t$.test(e),"A root name prefix is a plugin-name-like token ending in ':'"),Rl=y.string().min(1).refine(Am,"A manifest marker is a relative path without dot segments"),r$=y.string().min(1).refine(Am,"Roots must be relative paths without dot segments"),n$=y.string().min(1).refine(Q_,"Absolute roots must be absolute paths without dot segments"),$m=y.union([y.string().min(1),y.object({path:y.string().min(1),recursive:y.boolean().optional(),ancestors:y.boolean().optional(),namePrefix:Dl.optional(),skipIfManifest:Rl.optional()}).strict()]),ev=y.object({user:y.array($m).optional(),project:y.array($m).optional()}).strict(),o$=y.object({path:y.string().min(1),recursive:y.boolean(),ancestors:y.boolean(),namePrefix:Dl,skipIfManifest:Rl.optional()}).strict();function i$(e){return new Set(e.map(t=>t.path)).size===e.length}s(i$,"uniqueByPath");function wm(e){return y.array(o$.extend({path:r$}).superRefine((t,r)=>{t.ancestors&&e!=="project"&&r.addIssue({code:"custom",message:"Only project roots may walk ancestors"})})).max(e$).refine(i$,"Roots must not repeat a path")}s(wm,"nativeRootSideSchema");var bm=y.object({user:wm("user"),project:wm("project")}).strict(),tv=Object.freeze({user:Object.freeze([]),project:Object.freeze([])}),s$=y.enum(["skills","skill","skill-file","commands","command-file"]),Zm=y.object({path:n$,origin:y.enum(["user","project"]),recursive:y.boolean(),ancestors:y.boolean(),namePrefix:Dl,shape:s$,fallbackName:y.string().min(1).optional(),skipIfManifest:Rl.optional()}).strict(),vm=Zm.superRefine((e,t)=>{e.skipIfManifest!==void 0&&e.shape!=="skills"&&t.addIssue({code:"custom",message:"Only a skills root carries a manifest marker"}),e.ancestors&&e.origin!=="project"&&t.addIssue({code:"custom",message:"Only project roots may walk ancestors"}),e.fallbackName!==void 0&&e.shape!=="skill-file"&&t.addIssue({code:"custom",message:"Only a skill-file root carries a fallback name"})}),xm=Zm.partial({recursive:!0,ancestors:!0,namePrefix:!0,shape:!0});function km(e,t){return{path:e.path,origin:e.origin,recursive:e.recursive??!1,ancestors:e.ancestors??!1,namePrefix:e.namePrefix??"",shape:e.shape??(t==="skills"?"skills":"commands"),...e.fallbackName===void 0?{}:{fallbackName:e.fallbackName},...t==="skills"&&e.skipIfManifest!==void 0?{skipIfManifest:e.skipIfManifest}:{}}}s(km,"normalizeProviderResolvedNativeRoot");var c$=new Set(["skills","skill","skill-file"]),u$=new Set(["commands","command-file"]),Yo=256,Nm=y.object({skills:y.array(vm.refine(e=>c$.has(e.shape),"A skills root needs a skill shape")).max(Yo),commands:y.array(vm.refine(e=>u$.has(e.shape),"A commands root needs a command shape")).max(Yo)}).strict(),rv=Object.freeze({skills:Object.freeze([]),commands:Object.freeze([])}),nv=y.object({skills:bm,commands:bm,resolved:Nm}).strict(),a$=Symbol.for("@get-bb/plugin-sdk/rpc-refusal"),ov=class extends Error{static{s(this,"experimental_PluginRpcRefusal")}[a$]=!0;code;issues;constructor(e){super(e.message),this.name="experimental_PluginRpcRefusal",this.code=e.code,this.issues=e.issues}};var l$=y.object({providerId:y.string().min(1),cwd:y.string().min(1).nullable()}).strict(),f$=y.object({skills:y.array(xm).optional(),commands:y.array(xm).optional()}).strict().transform(e=>({skills:(e.skills??[]).slice(0,Yo).map(t=>km(t,"skills")),commands:(e.commands??[]).slice(0,Yo).map(t=>km(t,"commands"))})).pipe(Nm);var iv={resolveNativeRoots:{input:l$,output:f$}};var uv=p$.join(".claude-plugin","plugin.json");var d$=y.enum(["managed","project","local","user"]),av=y.object({enabledPlugins:y.record(y.string(),y.boolean()).optional()}).passthrough(),m$=y.object({gitCommitSha:y.string().nullable().optional(),installPath:y.string().min(1),scope:d$}).passthrough(),lv=y.object({plugins:y.record(y.string(),y.array(m$))}).passthrough(),zm=y.union([y.string(),y.array(y.string())]),fv=y.object({name:y.string().min(1).optional(),defaultEnabled:y.boolean().optional(),skills:zm.optional(),commands:zm.optional()}).passthrough();var Pm={interactive:0,status:1,background:2};function y$(e){let t=Math.min(6,Math.max(4,e-2));return[t,t-1,t-2]}s(y$,"localProcessCapacities");var Im={local:y$(g$()),network:[4,3,2]},_$=2,Tl=15e3,$$=new Set(["fetch","pull","push","clone","ls-remote"]),w$=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--config-env"]);function b$(e){let t=0;for(;t<e.length&&e[t].startsWith("-");)t+=w$.has(e[t])?2:1;let r=e[t];if(r===void 0)return!1;if($$.has(r))return!0;let n=e.slice(t+1).find(o=>!o.startsWith("-"));return(r==="submodule"||r==="remote")&&n==="update"}s(b$,"isNetworkGitCommand");var v$=class{static{s(this,"VcsProcessScheduler")}priority=new Sm;admitted=new Sm;active={local:0,network:0};githubActive=0;queue=[];timer;acquire(e,t,r){let n=e==="gh"||b$(t)?"network":"local",o=r.slots??1;return!Number.isInteger(o)||o<1||o>Im[n][Pm.background]?Promise.reject(new Error("Invalid VCS process slot count")):r.signal?.aborted?Promise.reject(this.abortError(r.signal)):new Promise((i,c)=>{let u={command:e,pool:n,priority:r.priority??this.priority.getStore()??"status",slots:o,queuedAt:performance.now(),signal:r.signal,grant:i,onAbort:s(()=>{let a=this.queue.indexOf(u);a!==-1&&(this.queue.splice(a,1),c(this.abortError(r.signal)),this.drain())},"onAbort")};this.queue.push(u),r.signal?.addEventListener("abort",u.onAbort,{once:!0}),this.drain()})}abortError(e){return Object.assign(new Error("The operation was aborted",{cause:e?.reason}),{name:"AbortError",code:"ABORT_ERR"})}rank(e){return Math.max(0,Pm[e.priority]-Math.floor((performance.now()-e.queuedAt)/Tl))}drain(){clearTimeout(this.timer),this.queue.sort((t,r)=>this.rank(t)-this.rank(r)||t.queuedAt-r.queuedAt);let e=new Set;for(let t=0;t<this.queue.length;){let r=this.queue[t];if(e.has(r.pool)||r.command==="gh"&&this.githubActive+r.slots>_$){t+=1;continue}if(this.active[r.pool]+r.slots>Im[r.pool][this.rank(r)]){e.add(r.pool),t+=1;continue}this.queue.splice(t,1),r.signal?.removeEventListener("abort",r.onAbort),this.active[r.pool]+=r.slots,r.command==="gh"&&(this.githubActive+=r.slots);let n=!1;r.grant(()=>{n||(n=!0,this.active[r.pool]-=r.slots,r.command==="gh"&&(this.githubActive-=r.slots),this.drain())})}if(this.queue.length>0){let t=Math.min(...this.queue.map(r=>Tl-(performance.now()-r.queuedAt)%Tl));this.timer=setTimeout(()=>this.drain(),t)}}},x$=globalThis,mv=x$.__bbVcsProcessScheduler??=new v$;var yv=z$(k$);var jl=y.enum(["directory","grouped"]),Em=y.string().min(1).max(80),Cm=y.object({kind:y.string(),reference:y.string(),group:y.string(),person:y.string().optional()}),S$=y.object({predicate:y.string(),value:y.string(),label:Em.optional(),confidence:y.number().min(0).max(1),status:y.string(),id:y.string().optional(),entity:y.string().optional(),source:Cm.optional(),observed:y.string().optional(),recorded:y.string().optional(),category:y.string().optional(),visibility:y.object({scope:y.enum(["private","named","general"]),people:y.array(y.string()).optional(),until:y.string().optional(),jobs:y.boolean().optional()}).optional(),supersedes:y.string().optional(),sourcesCompared:y.array(y.string()).optional()}).passthrough(),ke=y.object({entity:y.string().optional(),name:y.string().optional(),facts:y.array(S$)}).passthrough(),Ll=y.object({hostId:y.string().min(1),entity:y.string().min(1).max(200)}),P$=Ll.extend({factId:y.string().min(1),value:y.string().trim().min(1).max(2e3),reason:y.string().trim().refine(e=>new TextEncoder().encode(e).length<=100,"Keep the source note within 100 bytes")}),Mr=y.object({id:y.string(),added:y.boolean()}).passthrough(),I$=y.object({type:y.literal("fact"),entity:y.string(),predicate:y.string(),value:y.string(),label:Em.optional(),source:Cm,observed:y.string(),confidence:y.literal(1),category:y.string(),visibility:y.object({scope:y.literal("private")}),supersedes:y.string()}),Tm={list:{input:y.null(),output:y.array(ke)},lookup:{input:y.object({query:y.string().min(1).max(200)}),output:y.array(ke)},known:{input:y.object({entity:y.string().min(1).max(200)}),output:ke},record:{input:y.object({record:I$}),output:Mr}},Pv={stations:{input:y.null(),output:y.array(y.object({id:y.string(),name:y.string(),status:y.string()}))},lookup:{input:y.object({hostId:y.string(),query:y.string().trim().max(200).default("")}),output:y.array(ke)},known:{input:Ll,output:ke},correct:{input:P$,output:Mr},undo:{input:Ll.extend({factId:y.string()}),output:Mr},getDefault:{input:y.null(),output:jl},setDefault:{input:y.object({view:jl}),output:jl}};var Z$=A$(O$),Dm="The people service did not complete the request.";async function Qo(e,t,r=Dm){try{let{stdout:n}=await Z$("/usr/local/orbit/bin/orbit-people",e,{signal:t,timeout:35e3,maxBuffer:1e6});return JSON.parse(n)}catch{throw new Error(r)}}s(Qo,"request");var Cv=Om({contract:Tm,handlers:{list:s(async(e,{signal:t})=>y.array(ke).parse(await Qo(["list"],t)),"list"),lookup:s(async({query:e},{signal:t})=>y.array(ke).parse(await Qo(["lookup",e],t)),"lookup"),known:s(async({entity:e},{signal:t})=>ke.parse(await Qo(["known",e],t)),"known"),record:s(async(e,{signal:t})=>Mr.parse(await Qo(["record",JSON.stringify(e)],t,`${Dm} Refresh before trying a correction again.`)),"record")}});export{Cv as default};
|
|
69
69
|
//# sourceMappingURL=host.js.map
|