@50heads/cli 2026.1006.1 → 2026.1006.2
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/CHANGELOG.md +4 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,10 @@ Add what changed under Unreleased as you go, written for the people using it. Th
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [2026.1006.2] - 2026-10-06
|
|
12
|
+
|
|
13
|
+
Maintenance release. No change to tools, resources or prompts.
|
|
14
|
+
|
|
11
15
|
## [2026.1006.1] - 2026-10-06
|
|
12
16
|
|
|
13
17
|
Maintenance release. No change to tools, resources or prompts.
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var zh=Object.defineProperty;var ze=(e,n)=>{for(var o in n)zh(e,o,{get:n[o],enumerable:!0})};import{readFile as FI}from"node:fs/promises";import{execFile as Th}from"node:child_process";import{mkdir as Eh,readFile as Dh,rm as Oh,writeFile as jh,chmod as Nh}from"node:fs/promises";import{homedir as Ch,platform as lp}from"node:os";import{dirname as Uh,join as dp}from"node:path";var gt="@50heads/mcp",yt="default";function ht(e,n,o){return new Promise(a=>{try{let t=Th(e,n,{timeout:1e4},(i,s)=>{a({ok:!i,stdout:String(s??"")})});o!==void 0&&t.stdin?.end(o)}catch{a({ok:!1,stdout:""})}})}function fr(){let e=process.env.XDG_CONFIG_HOME||dp(Ch(),".config");return dp(e,"50heads","credentials.json")}var Rh={name:"macOS Keychain",async read(){let e=await ht("security",["find-generic-password","-a",yt,"-s",gt,"-w"]);return e.ok&&e.stdout.trim()||null},async write(e){return(await ht("security",["add-generic-password","-U","-a",yt,"-s",gt,"-w",e])).ok},async remove(){await ht("security",["delete-generic-password","-a",yt,"-s",gt])}},Lh={name:"Secret Service",async read(){let e=await ht("secret-tool",["lookup","service",gt,"account",yt]);return e.ok&&e.stdout.trim()||null},async write(e){return(await ht("secret-tool",["store","--label=50heads MCP","service",gt,"account",yt],e)).ok},async remove(){await ht("secret-tool",["clear","service",gt,"account",yt])}},mr={name:"file",async read(){try{return await Dh(fr(),"utf8")}catch{return null}},async write(e){let n=fr();return await Eh(Uh(n),{recursive:!0,mode:448}),await jh(n,e,{mode:384}),await Nh(n,384).catch(()=>{}),!0},async remove(){await Oh(fr(),{force:!0})}};function Wo(){return process.env.FIFTYHEADS_CREDENTIALS_STORE==="file"?[mr]:lp()==="darwin"?[Rh,mr]:lp()==="linux"?[Lh,mr]:[mr]}async function vt(){for(let e of Wo()){let n=await e.read();if(n)try{let o=JSON.parse(n);if(o.accessToken&&o.tokenEndpoint)return o}catch{}}return null}async function gr(e){let n=JSON.stringify(e);for(let o of Wo())if(await o.write(n))return o.name;throw new Error("Could not save the sign-in anywhere.")}async function Ko(){for(let e of Wo())await e.remove()}var Jo="https://mcp.50heads.com/mcp",mp=["questions:read","questions:write","templates:read","account:read"],pp="urn:ietf:params:oauth:grant-type:device_code",ae=class extends Error{};async function yr(e){let n=await e.json().catch(()=>null);if(n===null)throw new ae(`The sign-in server answered ${e.status} without JSON.`);return n}async function fp(e,n=fetch,o="50heads"){let a=await n(new URL("/.well-known/oauth-authorization-server",e),{headers:{"user-agent":o,accept:"application/json"}});if(!a.ok)throw new ae(`Could not reach ${e} (HTTP ${a.status}).`);let t=await yr(a);if(t.issuer.replace(/\/$/,"")!==e.replace(/\/$/,""))throw new ae(`The sign-in server says it is ${t.issuer}, not ${e}. Stopping.`);return t}function qo(e){return new URLSearchParams(e)}async function Ho(e){let n=e.fetchImpl??fetch,o=e.sleep??(f=>new Promise(g=>setTimeout(g,f))),a=e.client.userAgent,t=e.client.resource??Jo,i=await fp(e.authUrl,n,a);if(!i.device_authorization_endpoint)throw new ae("Signing in from the terminal is not available yet. Make an API key in the dashboard and set FIFTYHEADS_API_KEY instead.");let s=mp.join(" "),u=await vt(),c=u?.issuer===i.issuer?u.clientId:"";if(!c){if(!i.registration_endpoint)throw new ae("The sign-in server does not accept new clients.");let f=await n(i.registration_endpoint,{method:"POST",headers:{"user-agent":a,"content-type":"application/json",accept:"application/json"},body:JSON.stringify({client_name:e.client.name,application_type:"native",grant_types:[pp,"refresh_token"],response_types:[],token_endpoint_auth_method:"none",redirect_uris:["http://127.0.0.1/callback"],scope:s,software_id:e.client.softwareId,software_version:e.client.version})}),g=await yr(f);if(!f.ok||!g.client_id)throw new ae(g.error_description??`Registration failed (HTTP ${f.status}).`);c=g.client_id}let l=await n(i.device_authorization_endpoint,{method:"POST",headers:{"user-agent":a,"content-type":"application/x-www-form-urlencoded",accept:"application/json"},body:qo({client_id:c,scope:s,resource:t})}),d=await yr(l);if(!l.ok||!d.device_code)throw new ae(d.error_description??"Could not start signing in.");e.prompt({userCode:d.user_code,verificationUri:d.verification_uri,verificationUriComplete:d.verification_uri_complete,expiresIn:d.expires_in});let p=Math.max(1,d.interval??5)*1e3,m=Date.now()+d.expires_in*1e3;for(;Date.now()<m;){await o(p);let f=await n(i.token_endpoint,{method:"POST",headers:{"user-agent":a,"content-type":"application/x-www-form-urlencoded",accept:"application/json"},body:qo({grant_type:pp,device_code:d.device_code,client_id:c,resource:t})}),g=await yr(f);if(f.ok&&g.access_token){let v={issuer:i.issuer,clientId:c,accessToken:g.access_token,refreshToken:g.refresh_token??null,expiresAt:Date.now()+(g.expires_in??3600)*1e3,scope:g.scope??s,tokenEndpoint:i.token_endpoint};return{credentials:v,store:await gr(v)}}switch(g.error){case"authorization_pending":continue;case"slow_down":p+=5e3;continue;case"access_denied":throw new ae("Sign-in was declined.");case"expired_token":throw new ae("The code expired. Run login again.");default:throw new ae(g.error_description??`Sign-in failed (${g.error??f.status}).`)}}throw new ae("The code expired. Run login again.")}async function Qo(e,n=fetch){let o=await vt();if(!o)return null;if(o.expiresAt-Date.now()>6e4)return o.accessToken;if(!o.refreshToken)return null;let a=await n(o.tokenEndpoint,{method:"POST",headers:{"user-agent":e.userAgent,"content-type":"application/x-www-form-urlencoded",accept:"application/json"},body:qo({grant_type:"refresh_token",refresh_token:o.refreshToken,client_id:o.clientId,resource:e.resource??Jo})}),t=await a.json().catch(()=>({}));return!a.ok||!t.access_token?null:(await gr({...o,accessToken:t.access_token,refreshToken:t.refresh_token??o.refreshToken,expiresAt:Date.now()+(t.expires_in??3600)*1e3,scope:t.scope??o.scope}),t.access_token)}import{spawn as Mh}from"node:child_process";import{platform as Yo}from"node:os";function Xo(e){if(process.env.FIFTYHEADS_NO_BROWSER)return;let n=Yo()==="darwin"?"open":Yo()==="win32"?"cmd":"xdg-open",o=Yo()==="win32"?["/c","start","",e]:[e];try{Mh(n,o,{stdio:"ignore",detached:!0}).on("error",()=>{}).unref()}catch{}}var Te="2026.1006.1",hr=`50heads-cli/${Te}`,O={ok:0,error:1,usage:2,auth:3,credits:4,invalid:5,notFound:6,unavailable:7,partial:8,timeout:124};var r={};ze(r,{$brand:()=>ma,$input:()=>Ru,$output:()=>Uu,INVALID:()=>re,NEVER:()=>pa,TimePrecision:()=>Ju,ZodAny:()=>Cl,ZodArray:()=>Ml,ZodBase64:()=>go,ZodBase64URL:()=>yo,ZodBigInt:()=>tn,ZodBigIntFormat:()=>bo,ZodBoolean:()=>en,ZodCIDRv4:()=>mo,ZodCIDRv6:()=>fo,ZodCUID:()=>oo,ZodCUID2:()=>ao,ZodCatch:()=>sd,ZodCodec:()=>tr,ZodCompileAsyncError:()=>_e,ZodCompileUnsupportedError:()=>j,ZodCreditCard:()=>Pl,ZodCustom:()=>nr,ZodCustomStringFormat:()=>pt,ZodDate:()=>Jn,ZodDefault:()=>td,ZodDiscriminatedUnion:()=>Fl,ZodE164:()=>ho,ZodEmail:()=>to,ZodEmoji:()=>ro,ZodEnum:()=>Qt,ZodError:()=>nx,ZodExactOptional:()=>ko,ZodFile:()=>Ql,ZodFirstPartyTypeKind:()=>_d,ZodFunction:()=>hd,ZodGUID:()=>no,ZodIBAN:()=>zl,ZodIPv4:()=>lo,ZodIPv6:()=>po,ZodISODate:()=>Ge,ZodISODateTime:()=>Be,ZodISODuration:()=>Ke,ZodISOTime:()=>We,ZodInstanceOf:()=>$d,ZodIntersection:()=>Vl,ZodIssueCode:()=>ox,ZodJWT:()=>vo,ZodKSUID:()=>co,ZodLazy:()=>fd,ZodLiteral:()=>Hl,ZodMAC:()=>Al,ZodMap:()=>ql,ZodNaN:()=>cd,ZodNanoID:()=>io,ZodNever:()=>Rl,ZodNonOptional:()=>Io,ZodNull:()=>jl,ZodNullable:()=>ed,ZodNumber:()=>Xt,ZodNumberFormat:()=>mt,ZodObject:()=>Qn,ZodOptional:()=>Xn,ZodPipe:()=>er,ZodPrefault:()=>rd,ZodPreprocess:()=>ld,ZodPromise:()=>yd,ZodReadonly:()=>dd,ZodRealError:()=>de,ZodRecord:()=>Ht,ZodSet:()=>Jl,ZodString:()=>Yt,ZodStringFormat:()=>M,ZodSuccess:()=>ad,ZodSymbol:()=>Dl,ZodTemplateLiteral:()=>md,ZodTransform:()=>Yl,ZodTuple:()=>Gl,ZodType:()=>E,ZodULID:()=>so,ZodURL:()=>qn,ZodUUID:()=>Se,ZodUndefined:()=>Ol,ZodUnion:()=>Yn,ZodUnknown:()=>Ul,ZodVoid:()=>Ll,ZodXID:()=>uo,ZodXor:()=>Zl,_ZodString:()=>eo,_default:()=>nd,_function:()=>Jg,any:()=>Sg,array:()=>Hn,base64:()=>ag,base64url:()=>sg,bigint:()=>_g,boolean:()=>El,catch:()=>ud,check:()=>Hg,cidrv4:()=>ig,cidrv6:()=>og,clone:()=>U,codec:()=>Gg,coerce:()=>kd,compile:()=>Fu,config:()=>G,core:()=>Ne,creditCard:()=>cg,cuid:()=>Hf,cuid2:()=>Qf,currencyCode:()=>gg,custom:()=>Qg,date:()=>Pg,decode:()=>$l,decodeAsync:()=>xl,deepPartial:()=>ly,describe:()=>Yg,discriminatedUnion:()=>jg,e164:()=>ug,email:()=>Mf,emoji:()=>qf,encode:()=>bl,encodeAsync:()=>_l,endsWith:()=>Lt,enum:()=>_o,exactOptional:()=>Xl,file:()=>Zg,flattenError:()=>hn,float32:()=>hg,float64:()=>vg,formatError:()=>vn,fromJSONSchema:()=>uy,function:()=>Jg,getDiscriminatedOption:()=>du,getErrorMap:()=>sx,globalRegistry:()=>Q,gt:()=>Ie,gte:()=>fe,guid:()=>Zf,hash:()=>yg,hex:()=>fg,hostname:()=>mg,httpUrl:()=>Kf,iban:()=>lg,includes:()=>Ut,input:()=>py,instanceof:()=>ey,int:()=>Yi,int32:()=>bg,int64:()=>xg,intersection:()=>Bl,invertCodec:()=>Wg,ipv4:()=>tg,ipv6:()=>rg,iso:()=>rr,json:()=>ny,jwt:()=>dg,keyof:()=>zg,ksuid:()=>eg,lazy:()=>gd,length:()=>st,literal:()=>Mg,locales:()=>Rn,looseObject:()=>Dg,looseRecord:()=>Cg,lowercase:()=>Nt,lt:()=>ke,lte:()=>me,mac:()=>ng,map:()=>Ug,maxLength:()=>at,maxSize:()=>Me,memoizer:()=>Cn,meta:()=>Xg,mime:()=>Zt,minLength:()=>je,minSize:()=>we,multipleOf:()=>Le,nan:()=>Bg,nanoid:()=>Jf,nativeEnum:()=>Lg,negative:()=>Zi,never:()=>$o,nonnegative:()=>Vi,nonoptional:()=>od,nonpositive:()=>Fi,normalize:()=>Ft,null:()=>Nl,nullable:()=>Kn,nullish:()=>Fg,number:()=>Tl,object:()=>Tg,optional:()=>lt,output:()=>my,overwrite:()=>xe,parse:()=>gl,parseAsync:()=>yl,partialRecord:()=>Ng,pipe:()=>Xi,positive:()=>Mi,prefault:()=>id,preprocess:()=>ry,prettifyError:()=>va,promise:()=>qg,properties:()=>Mt,property:()=>Bi,readonly:()=>pd,record:()=>Kl,refine:()=>vd,regex:()=>jt,regexes:()=>ve,registry:()=>gi,safeDecode:()=>Il,safeDecodeAsync:()=>Sl,safeEncode:()=>kl,safeEncodeAsync:()=>wl,safeParse:()=>hl,safeParseAsync:()=>vl,set:()=>Rg,setErrorMap:()=>ax,size:()=>ot,slugify:()=>Wt,startsWith:()=>Rt,strictObject:()=>Eg,string:()=>Wn,stringFormat:()=>pg,stringbool:()=>ty,success:()=>Vg,superRefine:()=>bd,symbol:()=>Ig,templateLiteral:()=>Kg,toJSONSchema:()=>qi,toLowerCase:()=>Bt,toUpperCase:()=>Gt,toZod:()=>un,transform:()=>xo,treeifyError:()=>ha,trim:()=>Vt,tuple:()=>Wl,uint32:()=>$g,uint64:()=>kg,ulid:()=>Yf,undefined:()=>wg,union:()=>nn,unknown:()=>ct,uppercase:()=>Ct,url:()=>Wf,util:()=>b,uuid:()=>Ff,uuidv4:()=>Vf,uuidv6:()=>Bf,uuidv7:()=>Gf,validate:()=>bn,validateAsync:()=>$n,void:()=>Ag,withParser:()=>yi,xid:()=>Xf,xor:()=>Og});var Ne={};ze(Ne,{$ZodAny:()=>ru,$ZodArray:()=>uu,$ZodAsyncError:()=>ce,$ZodBase64:()=>Gs,$ZodBase64URL:()=>Ws,$ZodBigInt:()=>ti,$ZodBigIntFormat:()=>Xs,$ZodBoolean:()=>Tn,$ZodCIDRv4:()=>Vs,$ZodCIDRv6:()=>Bs,$ZodCUID:()=>Es,$ZodCUID2:()=>Ds,$ZodCatch:()=>Au,$ZodCheck:()=>Z,$ZodCheckBigIntFormat:()=>is,$ZodCheckEndsWith:()=>ys,$ZodCheckGreaterThan:()=>Lr,$ZodCheckIncludes:()=>fs,$ZodCheckLengthEquals:()=>ls,$ZodCheckLessThan:()=>Rr,$ZodCheckLowerCase:()=>ps,$ZodCheckMaxLength:()=>us,$ZodCheckMaxSize:()=>os,$ZodCheckMimeType:()=>bs,$ZodCheckMinLength:()=>cs,$ZodCheckMinSize:()=>as,$ZodCheckMultipleOf:()=>ns,$ZodCheckNumberFormat:()=>rs,$ZodCheckOverwrite:()=>$s,$ZodCheckProperties:()=>vs,$ZodCheckProperty:()=>hs,$ZodCheckRegex:()=>ds,$ZodCheckSizeEquals:()=>ss,$ZodCheckStartsWith:()=>gs,$ZodCheckStringFormat:()=>zt,$ZodCheckUpperCase:()=>ms,$ZodCodec:()=>Dn,$ZodCreditCard:()=>qs,$ZodCustom:()=>ju,$ZodCustomStringFormat:()=>Qs,$ZodCyclicError:()=>ui,$ZodDate:()=>su,$ZodDefault:()=>ku,$ZodDiscriminatedUnion:()=>pu,$ZodE164:()=>Ks,$ZodEmail:()=>ws,$ZodEmoji:()=>zs,$ZodEncodeError:()=>Re,$ZodEnum:()=>hu,$ZodError:()=>ya,$ZodExactOptional:()=>_u,$ZodFile:()=>bu,$ZodFunction:()=>Du,$ZodGUID:()=>ks,$ZodIBAN:()=>Js,$ZodIPv4:()=>Ms,$ZodIPv6:()=>Zs,$ZodISODate:()=>Us,$ZodISODateTime:()=>Cs,$ZodISODuration:()=>Ls,$ZodISOTime:()=>Rs,$ZodIntersection:()=>mu,$ZodJWT:()=>Hs,$ZodKSUID:()=>Ns,$ZodLazy:()=>On,$ZodLiteral:()=>vu,$ZodMAC:()=>Fs,$ZodMap:()=>gu,$ZodNaN:()=>Pu,$ZodNanoID:()=>Ts,$ZodNever:()=>ou,$ZodNonOptional:()=>wu,$ZodNull:()=>nu,$ZodNullable:()=>xu,$ZodNumber:()=>ei,$ZodNumberFormat:()=>Ys,$ZodObject:()=>Jp,$ZodObjectJIT:()=>cu,$ZodOptional:()=>ri,$ZodPipe:()=>ii,$ZodPrefault:()=>Iu,$ZodPreprocess:()=>zu,$ZodPromise:()=>Ou,$ZodReadonly:()=>Tu,$ZodRealError:()=>le,$ZodRecord:()=>fu,$ZodRegistry:()=>fi,$ZodSet:()=>yu,$ZodString:()=>et,$ZodStringFormat:()=>R,$ZodSuccess:()=>Su,$ZodSymbol:()=>eu,$ZodTemplateLiteral:()=>Eu,$ZodTransform:()=>$u,$ZodTuple:()=>ni,$ZodType:()=>z,$ZodULID:()=>Os,$ZodURL:()=>Ps,$ZodUUID:()=>Is,$ZodUndefined:()=>tu,$ZodUnion:()=>En,$ZodUnknown:()=>iu,$ZodVoid:()=>au,$ZodXID:()=>js,$ZodXor:()=>lu,$brand:()=>ma,$constructor:()=>y,$input:()=>Ru,$output:()=>Uu,Doc:()=>Xe,INVALID:()=>re,JSONSchema:()=>Uf,JSONSchemaGenerator:()=>Ji,NEVER:()=>pa,TimePrecision:()=>Ju,URL_BAD_FORMAT:()=>Ss,URL_UNPARSEABLE:()=>wn,ZodCompileAsyncError:()=>_e,ZodCompileUnsupportedError:()=>j,_any:()=>pc,_array:()=>bc,_base64:()=>Ci,_base64url:()=>Ui,_bigint:()=>oc,_boolean:()=>rc,_catch:()=>B_,_check:()=>_f,_cidrv4:()=>ji,_cidrv6:()=>Ni,_coercedBigint:()=>ac,_coercedBoolean:()=>ic,_coercedDate:()=>hc,_coercedNumber:()=>Qu,_coercedString:()=>Gu,_creditCard:()=>Ku,_cuid:()=>Ai,_cuid2:()=>Pi,_custom:()=>_c,_date:()=>yc,_decode:()=>Ar,_decodeAsync:()=>zr,_default:()=>Z_,_discriminatedUnion:()=>z_,_e164:()=>Ri,_email:()=>bi,_emoji:()=>wi,_encode:()=>Sr,_encodeAsync:()=>Pr,_endsWith:()=>Lt,_enum:()=>N_,_file:()=>$c,_float32:()=>Xu,_float64:()=>ec,_gt:()=>Ie,_gte:()=>fe,_guid:()=>$i,_iban:()=>qu,_includes:()=>Ut,_int:()=>Yu,_int32:()=>tc,_int64:()=>sc,_intersection:()=>T_,_ipv4:()=>Di,_ipv6:()=>Oi,_isoDate:()=>Zn,_isoDateTime:()=>Mn,_isoDuration:()=>Vn,_isoTime:()=>Fn,_jwt:()=>Li,_ksuid:()=>Ei,_lazy:()=>q_,_length:()=>st,_literal:()=>U_,_lowercase:()=>Nt,_lt:()=>ke,_lte:()=>me,_mac:()=>Wu,_map:()=>O_,_max:()=>me,_maxLength:()=>at,_maxSize:()=>Me,_mime:()=>Zt,_min:()=>fe,_minLength:()=>je,_minSize:()=>we,_multipleOf:()=>Le,_nan:()=>vc,_nanoid:()=>Si,_nativeEnum:()=>C_,_negative:()=>Zi,_never:()=>fc,_nonnegative:()=>Vi,_nonoptional:()=>F_,_nonpositive:()=>Fi,_normalize:()=>Ft,_null:()=>dc,_nullable:()=>M_,_number:()=>Hu,_optional:()=>L_,_overwrite:()=>xe,_parse:()=>wt,_parseAsync:()=>St,_pipe:()=>G_,_positive:()=>Mi,_promise:()=>J_,_properties:()=>Mt,_property:()=>Bi,_readonly:()=>W_,_record:()=>D_,_refine:()=>xc,_regex:()=>jt,_safeDecode:()=>Er,_safeDecodeAsync:()=>Or,_safeEncode:()=>Tr,_safeEncodeAsync:()=>Dr,_safeParse:()=>At,_safeParseAsync:()=>Pt,_set:()=>j_,_size:()=>ot,_slugify:()=>Wt,_startsWith:()=>Rt,_string:()=>Bu,_stringFormat:()=>ut,_stringbool:()=>Sc,_success:()=>V_,_superRefine:()=>kc,_symbol:()=>cc,_templateLiteral:()=>K_,_toLowerCase:()=>Bt,_toUpperCase:()=>Gt,_transform:()=>R_,_trim:()=>Vt,_tuple:()=>E_,_uint32:()=>nc,_uint64:()=>uc,_ulid:()=>zi,_undefined:()=>lc,_union:()=>A_,_unknown:()=>mc,_uppercase:()=>Ct,_url:()=>Ln,_uuid:()=>_i,_uuidv4:()=>xi,_uuidv6:()=>ki,_uuidv7:()=>Ii,_void:()=>gc,_xid:()=>Ti,_xor:()=>P_,base64Charset:()=>Jr,base64urlCharset:()=>zn,canParseURL:()=>As,clone:()=>U,compile:()=>Fu,compileFn:()=>hi,config:()=>G,createStandardJSONSchemaMethod:()=>Kt,createToJSONSchemaMethod:()=>Pc,decode:()=>Ev,decodeAsync:()=>Ov,describe:()=>Ic,encode:()=>Tv,encodeAsync:()=>Dv,extractDefs:()=>Fe,finalize:()=>Ve,flattenError:()=>hn,formatError:()=>vn,getDiscriminatedOption:()=>du,globalConfig:()=>q,globalRegistry:()=>Q,handleUnrepresentable:()=>W,initializeContext:()=>Ze,isBackEdge:()=>li,isRecursiveSchema:()=>ci,isValidBase64:()=>Pn,isValidBase64URL:()=>Hr,isValidCIDRv6:()=>qr,isValidCreditCard:()=>Qr,isValidIBAN:()=>Yr,isValidIPv6:()=>An,isValidJWT:()=>Xr,locales:()=>Rn,memoizer:()=>Cn,mergeValues:()=>Tt,meta:()=>wc,parse:()=>Ir,parseAsync:()=>wr,parseURLObject:()=>Wp,prettifyError:()=>va,process:()=>L,processSchema:()=>L,regexes:()=>ve,registry:()=>gi,safeDecode:()=>Nv,safeDecodeAsync:()=>Uv,safeEncode:()=>jv,safeEncodeAsync:()=>Cv,safeParse:()=>wv,safeParseAsync:()=>Sv,standardProps:()=>Br,stripTabAndNewline:()=>Sn,toDotPath:()=>wp,toJSONSchema:()=>qi,toZod:()=>un,treeifyError:()=>ha,urlHostnameOk:()=>Wr,urlProtocolOk:()=>Kr,util:()=>b,validate:()=>bn,validateAsync:()=>$n,validateURL:()=>Gr,version:()=>_s,withParser:()=>yi});var b={};ze(b,{BIGINT_FORMAT_RANGES:()=>mn,CONSTANT_CATCH:()=>xr,Class:()=>na,NUMBER_FORMAT_RANGES:()=>pn,aborted:()=>ne,allowsEval:()=>oa,assert:()=>Gh,assertEqual:()=>Zh,assertIs:()=>Vh,assertNever:()=>Bh,assertNotEqual:()=>Fh,assignProp:()=>H,attachSchema:()=>_r,base64ToUint8Array:()=>bp,base64urlToUint8Array:()=>lv,cached:()=>xt,captureStackTrace:()=>br,cleanEnum:()=>cv,cleanRegex:()=>De,clone:()=>U,cloneDef:()=>qh,codePointLength:()=>Qe,constantCatch:()=>la,createTransparentProxy:()=>ev,defineLazy:()=>ra,defineLazyInternal:()=>D,derived:()=>fv,esc:()=>te,escapeRegex:()=>he,explicitlyAborted:()=>ua,extend:()=>rv,finalizeIssue:()=>ue,floatSafeRemainder:()=>cn,getElementAtPath:()=>Jh,getEnumValues:()=>$t,getLengthableOrigin:()=>gn,getParsedType:()=>Xh,getSizableOrigin:()=>fn,hexToUint8Array:()=>pv,hide:()=>yn,installLazyProp:()=>vv,isObject:()=>He,isPlainObject:()=>ye,issue:()=>It,joinValues:()=>h,jsonStringifyReplacer:()=>_t,members:()=>ca,merge:()=>ov,mergeDefs:()=>$e,normalizeParams:()=>x,nullish:()=>vr,numKeys:()=>Yh,objectClone:()=>Wh,omit:()=>nv,optionalKeys:()=>sa,own:()=>Ue,parsedType:()=>_,partial:()=>av,pick:()=>tv,prefixIssues:()=>se,primitiveTypes:()=>aa,promiseAllObject:()=>Hh,propertyKeyTypes:()=>dn,randomString:()=>Qh,rawShape:()=>kt,required:()=>sv,safeExtend:()=>iv,shallowClone:()=>ln,slugify:()=>ia,stringifyPrimitive:()=>$,toZod:()=>un,uint8ArrayToBase64:()=>$p,uint8ArrayToBase64url:()=>dv,uint8ArrayToHex:()=>mv,unwrapMessage:()=>bt});function Zh(e){return e}function Fh(e){return e}function un(){return e=>e}function Vh(e){}function Bh(e){throw new Error("Unexpected value in exhaustive check")}function Gh(e){}function $t(e){let n=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,t])=>n.indexOf(+a)===-1).map(([a,t])=>t)}function h(e,n="|"){return e.map(o=>$(o)).join(n)}function _t(e,n){return typeof n=="bigint"?n.toString():n}var ta=class{constructor(n){this._getter=n,this._value=void 0}get value(){let n=this._getter;return n!==void 0&&(this._value=n(),this._getter=void 0),this._value}};function xt(e){return new ta(e)}function vr(e){return e==null}function De(e){let n=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(n,o)}function cn(e,n){let o=e/n,a=Math.round(o),t=4*Number.EPSILON*Math.max(Math.abs(o),1);return Math.abs(o-a)<t?0:o-a}var gp=Symbol("evaluating");function ra(e,n,o){let a;Object.defineProperty(e,n,{get(){if(a!==gp)return a===void 0&&(a=gp,a=o()),a},set(t){Object.defineProperty(e,n,{value:t})},configurable:!0})}function Wh(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function H(e,n,o){Object.defineProperty(e,n,{value:o,writable:!0,enumerable:!0,configurable:!0})}function kt(e){let n=Object.getOwnPropertyDescriptor(e,"shape");return n?.get?n.get.raw:n?.value}function Ee(e){return kt(e._zod.def)??e._zod.def.shape}function yp(e,n,o){Object.defineProperty(e,n,{get(){let a=o();return H(this,n,a),a},enumerable:!0,configurable:!0})}function hp(e,n,o){n in e?H(e,n,o):e[n]=o}function Je(e,n,o,a){let t=Ee(n);for(let i of o){let s=Object.getOwnPropertyDescriptor(t,i);s.enumerable&&(s.get?yp(e,i,()=>{let u=n._zod.def.shape[i];return a?a(u,i):u}):hp(e,i,a?a(s.value,i):s.value))}}function Kh(e,n){for(let o of Reflect.ownKeys(n)){let a=Object.getOwnPropertyDescriptor(n,o);a.enumerable&&(a.get?yp(e,o,()=>n[o]):hp(e,o,a.value))}}function $e(...e){let n={};for(let o of e){let a=Object.getOwnPropertyDescriptors(o);Object.assign(n,a)}return Object.defineProperties({},n)}function qh(e){return $e(e._zod.def)}function Jh(e,n){return n?n.reduce((o,a)=>o?.[a],e):e}function Hh(e){let n=Object.keys(e),o=n.map(a=>e[a]);return Promise.all(o).then(a=>{let t={};for(let i=0;i<n.length;i++)t[n[i]]=a[i];return t})}function Qh(e=10){let n="abcdefghijklmnopqrstuvwxyz",o="";for(let a=0;a<e;a++)o+=n[Math.floor(Math.random()*n.length)];return o}function te(e){return JSON.stringify(e)}function ia(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var br="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function He(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var oa=xt(()=>{if(q.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ye(e){if(He(e)===!1)return!1;let n=e.constructor;if(n===void 0||typeof n!="function")return!0;let o=n.prototype;return!(He(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function ln(e){return ye(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Yh(e){let n=0;for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&n++;return n}var Xh=e=>{let n=typeof e;switch(n){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: ${n}`)}},dn=new Set(["string","number","symbol"]),aa=new Set(["string","number","bigint","boolean","symbol","undefined"]);function he(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function U(e,n,o){let a=new e._zod.constr(n??e._zod.def);return(!n||o?.parent)&&(a._zod.parent=e),a}function x(e){let n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function ev(e){let n;return new Proxy({},{get(o,a,t){return n??(n=e()),Reflect.get(n,a,t)},set(o,a,t,i){return n??(n=e()),Reflect.set(n,a,t,i)},has(o,a){return n??(n=e()),Reflect.has(n,a)},deleteProperty(o,a){return n??(n=e()),Reflect.deleteProperty(n,a)},ownKeys(o){return n??(n=e()),Reflect.ownKeys(n)},getOwnPropertyDescriptor(o,a){return n??(n=e()),Reflect.getOwnPropertyDescriptor(n,a)},defineProperty(o,a,t){return n??(n=e()),Reflect.defineProperty(n,a,t)}})}function $(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function sa(e){return Object.keys(e).filter(n=>e[n]._zod.optin!==void 0&&e[n]._zod.optout==="optional")}var pn={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]},mn={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function tv(e,n){let o=e._zod.def,a=o.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return Je(i,e,$r(e,n)),U(e,$e(o,{shape:i,checks:[]}))}function $r(e,n){let o=Ee(e),a=[];for(let t of Reflect.ownKeys(n)){if(!Object.getOwnPropertyDescriptor(o,t)?.enumerable)throw new Error(`Unrecognized key: "${String(t)}"`);n[t]&&a.push(t)}return a}function nv(e,n){let o=e._zod.def,a=o.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set($r(e,n)),s={};return Je(s,e,Reflect.ownKeys(Ee(e)).filter(u=>!i.has(u))),U(e,$e(o,{shape:s,checks:[]}))}function rv(e,n){if(!ye(n))throw new Error("Invalid input to extend: expected a plain object");let o=e._zod.def.checks;if(o&&o.length>0){let t=Ee(e);for(let i of Reflect.ownKeys(n))if(Object.getOwnPropertyDescriptor(t,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return U(e,$e(e._zod.def,{shape:vp(e,n)}))}function vp(e,n){let o={};return Je(o,e,Reflect.ownKeys(Ee(e))),Kh(o,n),o}function iv(e,n){if(!ye(n))throw new Error("Invalid input to safeExtend: expected a plain object");return U(e,$e(e._zod.def,{shape:vp(e,n)}))}function ov(e,n){if(!n?._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 o={};Je(o,e,Reflect.ownKeys(Ee(e))),Je(o,n,Reflect.ownKeys(Ee(n)));let a=$e(e._zod.def,{shape:o,get catchall(){return n._zod.def.catchall},checks:n._zod.def.checks??[]});return U(e,a)}function av(e,n,o,a="partial"){let i=n._zod.def.checks;if(i&&i.length>0)throw new Error(`.${a}() cannot be used on object schemas containing refinements`);let u=o?new Set($r(n,o)):void 0,c={};return Je(c,n,Reflect.ownKeys(Ee(n)),e&&((l,d)=>u&&!u.has(d)?l:new e({type:"optional",innerType:l}))),U(n,$e(n._zod.def,{shape:c,checks:[]}))}function sv(e,n,o){let a=o?new Set($r(n,o)):void 0,t={};return Je(t,n,Reflect.ownKeys(Ee(n)),(i,s)=>a&&!a.has(s)?i:new e({type:"nonoptional",innerType:i})),U(n,$e(n._zod.def,{shape:t}))}function ne(e,n=0){if(e.aborted===!0)return!0;for(let o=n;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function ua(e,n=0){if(e.aborted===!0)return!0;for(let o=n;o<e.issues.length;o++)if(e.issues[o]?.continue===!1)return!0;return!1}function se(e,n){return n.map(o=>{var a;return(a=o).path??(a.path=[]),o.path.unshift(e),o})}function bt(e){return typeof e=="string"?e:e?.message}function _r(e,n,o){var a;for(let t=n;t<e.length;t++)(a=e[t]).schema??(a.schema=o)}function ue(e,n,o){var a;let t=e.inst?._zod?.traits;t?.has("$ZodType")&&(t.has("$ZodCheck")?(a=e).schema??(a.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:bt(e.inst?._zod.def?.error?.(e))??bt(i?.(e))??bt(n?.error?.(e))??bt(o.customError?.(e))??bt(o.localeError?.(e))??"Invalid input",u={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(u[c]=e[c]);return u.path??(u.path=[]),u.message=s,n?.reportInput&&(u.input=e.input),u}function fn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var uv=/[\uD800-\uDBFF]/;function Qe(e){let n=e.length;if(!uv.test(e))return n;let o=n;for(let a=0;a<n-1;a++)(e.charCodeAt(a)&64512)===55296&&(e.charCodeAt(a+1)&64512)===56320&&(o--,a++);return o}function gn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function _(e){let n=typeof e;switch(n){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let o=e;if(o&&Object.getPrototypeOf(o)!==Object.prototype&&"constructor"in o&&o.constructor)return o.constructor.name}}return n}function It(...e){let[n,o,a]=e;return typeof n=="string"?{message:n,code:"custom",input:o,inst:a}:{...n}}function cv(e){return Object.entries(e).filter(([n,o])=>Number.isNaN(Number.parseInt(n,10))).map(n=>n[1])}function bp(e){let n=atob(e),o=new Uint8Array(n.length);for(let a=0;a<n.length;a++)o[a]=n.charCodeAt(a);return o}function $p(e){let n="";for(let o=0;o<e.length;o++)n+=String.fromCharCode(e[o]);return btoa(n)}function lv(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-n.length%4)%4);return bp(n+o)}function dv(e){return $p(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function pv(e){let n=e.replace(/^0x/,"");if(n.length%2!==0)throw new Error("Invalid hex string length");let o=new Uint8Array(n.length/2);for(let a=0;a<n.length;a+=2)o[a/2]=Number.parseInt(n.slice(a,a+2),16);return o}function mv(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}var na=class{constructor(...n){}};function ca(e,n){for(let o in n){let a=Object.getOwnPropertyDescriptor(n,o);a.get?Object.defineProperty(e,o,{...a,enumerable:!1}):gv(e,o,a.value)}}function Ue(e,n,o,a=!0){return Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:a,value:o}),o}function yn(e,n,o){return Ue(e,n,o,!1)}function fv(e,n){for(let o in e){let a=e[o];Object.defineProperty(n,o,{configurable:!0,enumerable:!0,get(){return Ue(this,o,a(this))},set(t){Ue(this,o,t)}})}return n}function gv(e,n,o){Object.defineProperty(e,n,{configurable:!0,get(){return this==null?o:Ue(this,n,o.bind(this))},set(a){Ue(this,n,a)}})}function yv(e,n){let o=Object.getPrototypeOf(e);return n in o?void 0:o}var ea,Ce=!1,hv={configurable:!0,get(){Ce=!0}};function D(e,n,o){let a=Object.getPrototypeOf(e._zod);if(n in a&&ea!==e._zod){ea=void 0;return}ea=e._zod,Object.defineProperty(a,n,{configurable:!0,get(){Object.defineProperty(this,n,hv);let t=Ce;Ce=!1;try{let i=o(this);return Ce?delete this[n]:Object.defineProperty(this,n,{configurable:!0,writable:!0,value:i}),Ce=Ce||t,i}catch(i){throw delete this[n],Ce=Ce||t,i}},set(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t})}})}function vv(e,n,o,a){let t=yv(e,n);t&&Object.defineProperty(t,n,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:a,value:void 0};return Object.defineProperty(this,n,i),i.value=o(this),Object.defineProperty(this,n,i),i.value},set(i){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:a,value:i})}})}var xr="~constantCatch";function la(e){let n=()=>e;return n[xr]=!0,n}var _p,pa=Object.freeze({status:"aborted"}),da={value:void 0,enumerable:!1},xp="captureStackTrace"in Error?Error:null;function bv(e){let n=xp;if(n){let o=n.stackTraceLimit;if(typeof o=="number"){try{n.stackTraceLimit=0}catch{return xp=null,new e}try{return new e}finally{n.stackTraceLimit=o}}}return new e}function y(e,n,o,a){let t={};function i(m){this.def=m,this.constr=p,this.traits=new Set}i.prototype=t;let s=o,u=s&&new WeakSet;function c(m,f){if(m._zod){if(m._zod.traits.has(e))return}else{da.value=new i(f);try{Object.defineProperty(m,"_zod",da)}finally{da.value=void 0}}if(m._zod.traits.add(e),n(m,f),u){let v=Object.getPrototypeOf(m),k=m._zod.constr.prototype,A=v;for(;A&&A!==k;)A=Object.getPrototypeOf(A);let w=A??v;u.has(w)||(u.add(w),ca(w,s))}let g=p.prototype;for(let v in g)Object.prototype.hasOwnProperty.call(g,v)&&(v in m||(m[v]=g[v].bind(m)))}let l=a?.Parent??Object;class d extends l{}Object.defineProperty(d,"name",{value:e});function p(m){let f=a?.Parent?bv(d):this;c(f,m);let g=f._zod.deferred;if(g){for(let k of g)k();f._zod.deferred=void 0}let v=globalThis.__zod_globalConfig?.postProcessor;return v&&v(f),f}return Object.defineProperty(p,"init",{value:c}),Object.defineProperty(p,Symbol.hasInstance,{value:m=>a?.Parent&&m instanceof a.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(p,"name",{value:e}),p}var ma=Symbol("zod_brand"),ce=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Re=class extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}};(_p=globalThis).__zod_globalConfig??(_p.__zod_globalConfig={});var q=globalThis.__zod_globalConfig;function G(e){return e&&Object.assign(q,e),q}function $v(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,_t,2)),e.message}function _v(e){this._zod.message=e}var xv={get:$v,set:_v,enumerable:!0,configurable:!0},ga={value:void 0,enumerable:!1},kp=new WeakSet([Object.prototype,Error.prototype]),Ip=(e,n)=>{e.name="$ZodError",ga.value=n,Object.defineProperty(e,"issues",ga),ga.value=void 0,Object.defineProperty(e,"message",xv);let o=Object.getPrototypeOf(e);kp.has(o)||(kp.add(o),Object.defineProperty(o,"toString",{configurable:!0,enumerable:!1,get(){let a=()=>this.message;return Object.defineProperty(this,"toString",{value:a,configurable:!0,writable:!0}),a},set(a){Object.defineProperty(this,"toString",{value:a,configurable:!0,writable:!0})}}))},ya=y("$ZodError",Ip),le=y("$ZodError",Ip,void 0,{Parent:Error});function kv(e,n,o){return Object.prototype.hasOwnProperty.call(e,n)||(n==="__proto__"?Object.defineProperty(e,n,{value:o(),writable:!0,enumerable:!0,configurable:!0}):e[n]=o()),e[n]}function hn(e,n=o=>o.message){let o={},a=[];for(let t of e.issues)t.path.length>0?kv(o,t.path[0],()=>[]).push(n(t)):a.push(n(t));return{formErrors:a,fieldErrors:o}}function vn(e,n=o=>o.message){let o={_errors:[]},a=(t,i=[])=>{for(let s of t.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(u=>a({issues:u},[...i,...s.path]));else if(s.code==="invalid_key")a({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")a({issues:s.issues},[...i,...s.path]);else{let u=[...i,...s.path];if(u.length===0)o._errors.push(n(s));else{let c=o,l=0;for(;l<u.length;){let d=u[l],p=l===u.length-1;if(d==="_errors"){p&&c._errors.push(n(s)),l++;continue}Object.prototype.hasOwnProperty.call(c,d)||Object.defineProperty(c,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=c[d];p&&m._errors.push(n(s)),c=m,l++}}}};return a(e),o}function ha(e,n=o=>o.message){let o={errors:[]},a=(t,i=[])=>{var s;for(let u of t.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(c=>a({issues:c},[...i,...u.path]));else if(u.code==="invalid_key")a({issues:u.issues},[...i,...u.path]);else if(u.code==="invalid_element")a({issues:u.issues},[...i,...u.path]);else{let c=[...i,...u.path];if(c.length===0){o.errors.push(n(u));continue}let l=o,d=0;for(;d<c.length;){let p=c[d],m=d===c.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=[]),(s=l.items)[p]??(s[p]={errors:[]}),l=l.items[p]),m&&l.errors.push(n(u)),d++}}};return a(e),o}function wp(e){let n=[],o=e.map(a=>typeof a=="object"?a.key:a);for(let a of o)typeof a=="number"?n.push(`[${a}]`):typeof a=="symbol"?n.push(`[${JSON.stringify(String(a))}]`):/[^\w$]/.test(a)?n.push(`[${JSON.stringify(a)}]`):(n.length&&n.push("."),n.push(a));return n.join("")}function va(e){let n=[],o=[...e.issues].sort((a,t)=>(a.path??[]).length-(t.path??[]).length);for(let a of o)n.push(`\u2716 ${a.message}`),a.path?.length&&n.push(` \u2192 at ${wp(a.path)}`);return n.join(`
|
|
2
|
+
var zh=Object.defineProperty;var ze=(e,n)=>{for(var o in n)zh(e,o,{get:n[o],enumerable:!0})};import{readFile as FI}from"node:fs/promises";import{execFile as Th}from"node:child_process";import{mkdir as Eh,readFile as Dh,rm as Oh,writeFile as jh,chmod as Nh}from"node:fs/promises";import{homedir as Ch,platform as lp}from"node:os";import{dirname as Uh,join as dp}from"node:path";var gt="@50heads/mcp",yt="default";function ht(e,n,o){return new Promise(a=>{try{let t=Th(e,n,{timeout:1e4},(i,s)=>{a({ok:!i,stdout:String(s??"")})});o!==void 0&&t.stdin?.end(o)}catch{a({ok:!1,stdout:""})}})}function fr(){let e=process.env.XDG_CONFIG_HOME||dp(Ch(),".config");return dp(e,"50heads","credentials.json")}var Rh={name:"macOS Keychain",async read(){let e=await ht("security",["find-generic-password","-a",yt,"-s",gt,"-w"]);return e.ok&&e.stdout.trim()||null},async write(e){return(await ht("security",["add-generic-password","-U","-a",yt,"-s",gt,"-w",e])).ok},async remove(){await ht("security",["delete-generic-password","-a",yt,"-s",gt])}},Lh={name:"Secret Service",async read(){let e=await ht("secret-tool",["lookup","service",gt,"account",yt]);return e.ok&&e.stdout.trim()||null},async write(e){return(await ht("secret-tool",["store","--label=50heads MCP","service",gt,"account",yt],e)).ok},async remove(){await ht("secret-tool",["clear","service",gt,"account",yt])}},mr={name:"file",async read(){try{return await Dh(fr(),"utf8")}catch{return null}},async write(e){let n=fr();return await Eh(Uh(n),{recursive:!0,mode:448}),await jh(n,e,{mode:384}),await Nh(n,384).catch(()=>{}),!0},async remove(){await Oh(fr(),{force:!0})}};function Wo(){return process.env.FIFTYHEADS_CREDENTIALS_STORE==="file"?[mr]:lp()==="darwin"?[Rh,mr]:lp()==="linux"?[Lh,mr]:[mr]}async function vt(){for(let e of Wo()){let n=await e.read();if(n)try{let o=JSON.parse(n);if(o.accessToken&&o.tokenEndpoint)return o}catch{}}return null}async function gr(e){let n=JSON.stringify(e);for(let o of Wo())if(await o.write(n))return o.name;throw new Error("Could not save the sign-in anywhere.")}async function Ko(){for(let e of Wo())await e.remove()}var Jo="https://mcp.50heads.com/mcp",mp=["questions:read","questions:write","templates:read","account:read"],pp="urn:ietf:params:oauth:grant-type:device_code",ae=class extends Error{};async function yr(e){let n=await e.json().catch(()=>null);if(n===null)throw new ae(`The sign-in server answered ${e.status} without JSON.`);return n}async function fp(e,n=fetch,o="50heads"){let a=await n(new URL("/.well-known/oauth-authorization-server",e),{headers:{"user-agent":o,accept:"application/json"}});if(!a.ok)throw new ae(`Could not reach ${e} (HTTP ${a.status}).`);let t=await yr(a);if(t.issuer.replace(/\/$/,"")!==e.replace(/\/$/,""))throw new ae(`The sign-in server says it is ${t.issuer}, not ${e}. Stopping.`);return t}function qo(e){return new URLSearchParams(e)}async function Ho(e){let n=e.fetchImpl??fetch,o=e.sleep??(f=>new Promise(g=>setTimeout(g,f))),a=e.client.userAgent,t=e.client.resource??Jo,i=await fp(e.authUrl,n,a);if(!i.device_authorization_endpoint)throw new ae("Signing in from the terminal is not available yet. Make an API key in the dashboard and set FIFTYHEADS_API_KEY instead.");let s=mp.join(" "),u=await vt(),c=u?.issuer===i.issuer?u.clientId:"";if(!c){if(!i.registration_endpoint)throw new ae("The sign-in server does not accept new clients.");let f=await n(i.registration_endpoint,{method:"POST",headers:{"user-agent":a,"content-type":"application/json",accept:"application/json"},body:JSON.stringify({client_name:e.client.name,application_type:"native",grant_types:[pp,"refresh_token"],response_types:[],token_endpoint_auth_method:"none",redirect_uris:["http://127.0.0.1/callback"],scope:s,software_id:e.client.softwareId,software_version:e.client.version})}),g=await yr(f);if(!f.ok||!g.client_id)throw new ae(g.error_description??`Registration failed (HTTP ${f.status}).`);c=g.client_id}let l=await n(i.device_authorization_endpoint,{method:"POST",headers:{"user-agent":a,"content-type":"application/x-www-form-urlencoded",accept:"application/json"},body:qo({client_id:c,scope:s,resource:t})}),d=await yr(l);if(!l.ok||!d.device_code)throw new ae(d.error_description??"Could not start signing in.");e.prompt({userCode:d.user_code,verificationUri:d.verification_uri,verificationUriComplete:d.verification_uri_complete,expiresIn:d.expires_in});let p=Math.max(1,d.interval??5)*1e3,m=Date.now()+d.expires_in*1e3;for(;Date.now()<m;){await o(p);let f=await n(i.token_endpoint,{method:"POST",headers:{"user-agent":a,"content-type":"application/x-www-form-urlencoded",accept:"application/json"},body:qo({grant_type:pp,device_code:d.device_code,client_id:c,resource:t})}),g=await yr(f);if(f.ok&&g.access_token){let v={issuer:i.issuer,clientId:c,accessToken:g.access_token,refreshToken:g.refresh_token??null,expiresAt:Date.now()+(g.expires_in??3600)*1e3,scope:g.scope??s,tokenEndpoint:i.token_endpoint};return{credentials:v,store:await gr(v)}}switch(g.error){case"authorization_pending":continue;case"slow_down":p+=5e3;continue;case"access_denied":throw new ae("Sign-in was declined.");case"expired_token":throw new ae("The code expired. Run login again.");default:throw new ae(g.error_description??`Sign-in failed (${g.error??f.status}).`)}}throw new ae("The code expired. Run login again.")}async function Qo(e,n=fetch){let o=await vt();if(!o)return null;if(o.expiresAt-Date.now()>6e4)return o.accessToken;if(!o.refreshToken)return null;let a=await n(o.tokenEndpoint,{method:"POST",headers:{"user-agent":e.userAgent,"content-type":"application/x-www-form-urlencoded",accept:"application/json"},body:qo({grant_type:"refresh_token",refresh_token:o.refreshToken,client_id:o.clientId,resource:e.resource??Jo})}),t=await a.json().catch(()=>({}));return!a.ok||!t.access_token?null:(await gr({...o,accessToken:t.access_token,refreshToken:t.refresh_token??o.refreshToken,expiresAt:Date.now()+(t.expires_in??3600)*1e3,scope:t.scope??o.scope}),t.access_token)}import{spawn as Mh}from"node:child_process";import{platform as Yo}from"node:os";function Xo(e){if(process.env.FIFTYHEADS_NO_BROWSER)return;let n=Yo()==="darwin"?"open":Yo()==="win32"?"cmd":"xdg-open",o=Yo()==="win32"?["/c","start","",e]:[e];try{Mh(n,o,{stdio:"ignore",detached:!0}).on("error",()=>{}).unref()}catch{}}var Te="2026.1006.2",hr=`50heads-cli/${Te}`,O={ok:0,error:1,usage:2,auth:3,credits:4,invalid:5,notFound:6,unavailable:7,partial:8,timeout:124};var r={};ze(r,{$brand:()=>ma,$input:()=>Ru,$output:()=>Uu,INVALID:()=>re,NEVER:()=>pa,TimePrecision:()=>Ju,ZodAny:()=>Cl,ZodArray:()=>Ml,ZodBase64:()=>go,ZodBase64URL:()=>yo,ZodBigInt:()=>tn,ZodBigIntFormat:()=>bo,ZodBoolean:()=>en,ZodCIDRv4:()=>mo,ZodCIDRv6:()=>fo,ZodCUID:()=>oo,ZodCUID2:()=>ao,ZodCatch:()=>sd,ZodCodec:()=>tr,ZodCompileAsyncError:()=>_e,ZodCompileUnsupportedError:()=>j,ZodCreditCard:()=>Pl,ZodCustom:()=>nr,ZodCustomStringFormat:()=>pt,ZodDate:()=>Jn,ZodDefault:()=>td,ZodDiscriminatedUnion:()=>Fl,ZodE164:()=>ho,ZodEmail:()=>to,ZodEmoji:()=>ro,ZodEnum:()=>Qt,ZodError:()=>nx,ZodExactOptional:()=>ko,ZodFile:()=>Ql,ZodFirstPartyTypeKind:()=>_d,ZodFunction:()=>hd,ZodGUID:()=>no,ZodIBAN:()=>zl,ZodIPv4:()=>lo,ZodIPv6:()=>po,ZodISODate:()=>Ge,ZodISODateTime:()=>Be,ZodISODuration:()=>Ke,ZodISOTime:()=>We,ZodInstanceOf:()=>$d,ZodIntersection:()=>Vl,ZodIssueCode:()=>ox,ZodJWT:()=>vo,ZodKSUID:()=>co,ZodLazy:()=>fd,ZodLiteral:()=>Hl,ZodMAC:()=>Al,ZodMap:()=>ql,ZodNaN:()=>cd,ZodNanoID:()=>io,ZodNever:()=>Rl,ZodNonOptional:()=>Io,ZodNull:()=>jl,ZodNullable:()=>ed,ZodNumber:()=>Xt,ZodNumberFormat:()=>mt,ZodObject:()=>Qn,ZodOptional:()=>Xn,ZodPipe:()=>er,ZodPrefault:()=>rd,ZodPreprocess:()=>ld,ZodPromise:()=>yd,ZodReadonly:()=>dd,ZodRealError:()=>de,ZodRecord:()=>Ht,ZodSet:()=>Jl,ZodString:()=>Yt,ZodStringFormat:()=>M,ZodSuccess:()=>ad,ZodSymbol:()=>Dl,ZodTemplateLiteral:()=>md,ZodTransform:()=>Yl,ZodTuple:()=>Gl,ZodType:()=>E,ZodULID:()=>so,ZodURL:()=>qn,ZodUUID:()=>Se,ZodUndefined:()=>Ol,ZodUnion:()=>Yn,ZodUnknown:()=>Ul,ZodVoid:()=>Ll,ZodXID:()=>uo,ZodXor:()=>Zl,_ZodString:()=>eo,_default:()=>nd,_function:()=>Jg,any:()=>Sg,array:()=>Hn,base64:()=>ag,base64url:()=>sg,bigint:()=>_g,boolean:()=>El,catch:()=>ud,check:()=>Hg,cidrv4:()=>ig,cidrv6:()=>og,clone:()=>U,codec:()=>Gg,coerce:()=>kd,compile:()=>Fu,config:()=>G,core:()=>Ne,creditCard:()=>cg,cuid:()=>Hf,cuid2:()=>Qf,currencyCode:()=>gg,custom:()=>Qg,date:()=>Pg,decode:()=>$l,decodeAsync:()=>xl,deepPartial:()=>ly,describe:()=>Yg,discriminatedUnion:()=>jg,e164:()=>ug,email:()=>Mf,emoji:()=>qf,encode:()=>bl,encodeAsync:()=>_l,endsWith:()=>Lt,enum:()=>_o,exactOptional:()=>Xl,file:()=>Zg,flattenError:()=>hn,float32:()=>hg,float64:()=>vg,formatError:()=>vn,fromJSONSchema:()=>uy,function:()=>Jg,getDiscriminatedOption:()=>du,getErrorMap:()=>sx,globalRegistry:()=>Q,gt:()=>Ie,gte:()=>fe,guid:()=>Zf,hash:()=>yg,hex:()=>fg,hostname:()=>mg,httpUrl:()=>Kf,iban:()=>lg,includes:()=>Ut,input:()=>py,instanceof:()=>ey,int:()=>Yi,int32:()=>bg,int64:()=>xg,intersection:()=>Bl,invertCodec:()=>Wg,ipv4:()=>tg,ipv6:()=>rg,iso:()=>rr,json:()=>ny,jwt:()=>dg,keyof:()=>zg,ksuid:()=>eg,lazy:()=>gd,length:()=>st,literal:()=>Mg,locales:()=>Rn,looseObject:()=>Dg,looseRecord:()=>Cg,lowercase:()=>Nt,lt:()=>ke,lte:()=>me,mac:()=>ng,map:()=>Ug,maxLength:()=>at,maxSize:()=>Me,memoizer:()=>Cn,meta:()=>Xg,mime:()=>Zt,minLength:()=>je,minSize:()=>we,multipleOf:()=>Le,nan:()=>Bg,nanoid:()=>Jf,nativeEnum:()=>Lg,negative:()=>Zi,never:()=>$o,nonnegative:()=>Vi,nonoptional:()=>od,nonpositive:()=>Fi,normalize:()=>Ft,null:()=>Nl,nullable:()=>Kn,nullish:()=>Fg,number:()=>Tl,object:()=>Tg,optional:()=>lt,output:()=>my,overwrite:()=>xe,parse:()=>gl,parseAsync:()=>yl,partialRecord:()=>Ng,pipe:()=>Xi,positive:()=>Mi,prefault:()=>id,preprocess:()=>ry,prettifyError:()=>va,promise:()=>qg,properties:()=>Mt,property:()=>Bi,readonly:()=>pd,record:()=>Kl,refine:()=>vd,regex:()=>jt,regexes:()=>ve,registry:()=>gi,safeDecode:()=>Il,safeDecodeAsync:()=>Sl,safeEncode:()=>kl,safeEncodeAsync:()=>wl,safeParse:()=>hl,safeParseAsync:()=>vl,set:()=>Rg,setErrorMap:()=>ax,size:()=>ot,slugify:()=>Wt,startsWith:()=>Rt,strictObject:()=>Eg,string:()=>Wn,stringFormat:()=>pg,stringbool:()=>ty,success:()=>Vg,superRefine:()=>bd,symbol:()=>Ig,templateLiteral:()=>Kg,toJSONSchema:()=>qi,toLowerCase:()=>Bt,toUpperCase:()=>Gt,toZod:()=>un,transform:()=>xo,treeifyError:()=>ha,trim:()=>Vt,tuple:()=>Wl,uint32:()=>$g,uint64:()=>kg,ulid:()=>Yf,undefined:()=>wg,union:()=>nn,unknown:()=>ct,uppercase:()=>Ct,url:()=>Wf,util:()=>b,uuid:()=>Ff,uuidv4:()=>Vf,uuidv6:()=>Bf,uuidv7:()=>Gf,validate:()=>bn,validateAsync:()=>$n,void:()=>Ag,withParser:()=>yi,xid:()=>Xf,xor:()=>Og});var Ne={};ze(Ne,{$ZodAny:()=>ru,$ZodArray:()=>uu,$ZodAsyncError:()=>ce,$ZodBase64:()=>Gs,$ZodBase64URL:()=>Ws,$ZodBigInt:()=>ti,$ZodBigIntFormat:()=>Xs,$ZodBoolean:()=>Tn,$ZodCIDRv4:()=>Vs,$ZodCIDRv6:()=>Bs,$ZodCUID:()=>Es,$ZodCUID2:()=>Ds,$ZodCatch:()=>Au,$ZodCheck:()=>Z,$ZodCheckBigIntFormat:()=>is,$ZodCheckEndsWith:()=>ys,$ZodCheckGreaterThan:()=>Lr,$ZodCheckIncludes:()=>fs,$ZodCheckLengthEquals:()=>ls,$ZodCheckLessThan:()=>Rr,$ZodCheckLowerCase:()=>ps,$ZodCheckMaxLength:()=>us,$ZodCheckMaxSize:()=>os,$ZodCheckMimeType:()=>bs,$ZodCheckMinLength:()=>cs,$ZodCheckMinSize:()=>as,$ZodCheckMultipleOf:()=>ns,$ZodCheckNumberFormat:()=>rs,$ZodCheckOverwrite:()=>$s,$ZodCheckProperties:()=>vs,$ZodCheckProperty:()=>hs,$ZodCheckRegex:()=>ds,$ZodCheckSizeEquals:()=>ss,$ZodCheckStartsWith:()=>gs,$ZodCheckStringFormat:()=>zt,$ZodCheckUpperCase:()=>ms,$ZodCodec:()=>Dn,$ZodCreditCard:()=>qs,$ZodCustom:()=>ju,$ZodCustomStringFormat:()=>Qs,$ZodCyclicError:()=>ui,$ZodDate:()=>su,$ZodDefault:()=>ku,$ZodDiscriminatedUnion:()=>pu,$ZodE164:()=>Ks,$ZodEmail:()=>ws,$ZodEmoji:()=>zs,$ZodEncodeError:()=>Re,$ZodEnum:()=>hu,$ZodError:()=>ya,$ZodExactOptional:()=>_u,$ZodFile:()=>bu,$ZodFunction:()=>Du,$ZodGUID:()=>ks,$ZodIBAN:()=>Js,$ZodIPv4:()=>Ms,$ZodIPv6:()=>Zs,$ZodISODate:()=>Us,$ZodISODateTime:()=>Cs,$ZodISODuration:()=>Ls,$ZodISOTime:()=>Rs,$ZodIntersection:()=>mu,$ZodJWT:()=>Hs,$ZodKSUID:()=>Ns,$ZodLazy:()=>On,$ZodLiteral:()=>vu,$ZodMAC:()=>Fs,$ZodMap:()=>gu,$ZodNaN:()=>Pu,$ZodNanoID:()=>Ts,$ZodNever:()=>ou,$ZodNonOptional:()=>wu,$ZodNull:()=>nu,$ZodNullable:()=>xu,$ZodNumber:()=>ei,$ZodNumberFormat:()=>Ys,$ZodObject:()=>Jp,$ZodObjectJIT:()=>cu,$ZodOptional:()=>ri,$ZodPipe:()=>ii,$ZodPrefault:()=>Iu,$ZodPreprocess:()=>zu,$ZodPromise:()=>Ou,$ZodReadonly:()=>Tu,$ZodRealError:()=>le,$ZodRecord:()=>fu,$ZodRegistry:()=>fi,$ZodSet:()=>yu,$ZodString:()=>et,$ZodStringFormat:()=>R,$ZodSuccess:()=>Su,$ZodSymbol:()=>eu,$ZodTemplateLiteral:()=>Eu,$ZodTransform:()=>$u,$ZodTuple:()=>ni,$ZodType:()=>z,$ZodULID:()=>Os,$ZodURL:()=>Ps,$ZodUUID:()=>Is,$ZodUndefined:()=>tu,$ZodUnion:()=>En,$ZodUnknown:()=>iu,$ZodVoid:()=>au,$ZodXID:()=>js,$ZodXor:()=>lu,$brand:()=>ma,$constructor:()=>y,$input:()=>Ru,$output:()=>Uu,Doc:()=>Xe,INVALID:()=>re,JSONSchema:()=>Uf,JSONSchemaGenerator:()=>Ji,NEVER:()=>pa,TimePrecision:()=>Ju,URL_BAD_FORMAT:()=>Ss,URL_UNPARSEABLE:()=>wn,ZodCompileAsyncError:()=>_e,ZodCompileUnsupportedError:()=>j,_any:()=>pc,_array:()=>bc,_base64:()=>Ci,_base64url:()=>Ui,_bigint:()=>oc,_boolean:()=>rc,_catch:()=>B_,_check:()=>_f,_cidrv4:()=>ji,_cidrv6:()=>Ni,_coercedBigint:()=>ac,_coercedBoolean:()=>ic,_coercedDate:()=>hc,_coercedNumber:()=>Qu,_coercedString:()=>Gu,_creditCard:()=>Ku,_cuid:()=>Ai,_cuid2:()=>Pi,_custom:()=>_c,_date:()=>yc,_decode:()=>Ar,_decodeAsync:()=>zr,_default:()=>Z_,_discriminatedUnion:()=>z_,_e164:()=>Ri,_email:()=>bi,_emoji:()=>wi,_encode:()=>Sr,_encodeAsync:()=>Pr,_endsWith:()=>Lt,_enum:()=>N_,_file:()=>$c,_float32:()=>Xu,_float64:()=>ec,_gt:()=>Ie,_gte:()=>fe,_guid:()=>$i,_iban:()=>qu,_includes:()=>Ut,_int:()=>Yu,_int32:()=>tc,_int64:()=>sc,_intersection:()=>T_,_ipv4:()=>Di,_ipv6:()=>Oi,_isoDate:()=>Zn,_isoDateTime:()=>Mn,_isoDuration:()=>Vn,_isoTime:()=>Fn,_jwt:()=>Li,_ksuid:()=>Ei,_lazy:()=>q_,_length:()=>st,_literal:()=>U_,_lowercase:()=>Nt,_lt:()=>ke,_lte:()=>me,_mac:()=>Wu,_map:()=>O_,_max:()=>me,_maxLength:()=>at,_maxSize:()=>Me,_mime:()=>Zt,_min:()=>fe,_minLength:()=>je,_minSize:()=>we,_multipleOf:()=>Le,_nan:()=>vc,_nanoid:()=>Si,_nativeEnum:()=>C_,_negative:()=>Zi,_never:()=>fc,_nonnegative:()=>Vi,_nonoptional:()=>F_,_nonpositive:()=>Fi,_normalize:()=>Ft,_null:()=>dc,_nullable:()=>M_,_number:()=>Hu,_optional:()=>L_,_overwrite:()=>xe,_parse:()=>wt,_parseAsync:()=>St,_pipe:()=>G_,_positive:()=>Mi,_promise:()=>J_,_properties:()=>Mt,_property:()=>Bi,_readonly:()=>W_,_record:()=>D_,_refine:()=>xc,_regex:()=>jt,_safeDecode:()=>Er,_safeDecodeAsync:()=>Or,_safeEncode:()=>Tr,_safeEncodeAsync:()=>Dr,_safeParse:()=>At,_safeParseAsync:()=>Pt,_set:()=>j_,_size:()=>ot,_slugify:()=>Wt,_startsWith:()=>Rt,_string:()=>Bu,_stringFormat:()=>ut,_stringbool:()=>Sc,_success:()=>V_,_superRefine:()=>kc,_symbol:()=>cc,_templateLiteral:()=>K_,_toLowerCase:()=>Bt,_toUpperCase:()=>Gt,_transform:()=>R_,_trim:()=>Vt,_tuple:()=>E_,_uint32:()=>nc,_uint64:()=>uc,_ulid:()=>zi,_undefined:()=>lc,_union:()=>A_,_unknown:()=>mc,_uppercase:()=>Ct,_url:()=>Ln,_uuid:()=>_i,_uuidv4:()=>xi,_uuidv6:()=>ki,_uuidv7:()=>Ii,_void:()=>gc,_xid:()=>Ti,_xor:()=>P_,base64Charset:()=>Jr,base64urlCharset:()=>zn,canParseURL:()=>As,clone:()=>U,compile:()=>Fu,compileFn:()=>hi,config:()=>G,createStandardJSONSchemaMethod:()=>Kt,createToJSONSchemaMethod:()=>Pc,decode:()=>Ev,decodeAsync:()=>Ov,describe:()=>Ic,encode:()=>Tv,encodeAsync:()=>Dv,extractDefs:()=>Fe,finalize:()=>Ve,flattenError:()=>hn,formatError:()=>vn,getDiscriminatedOption:()=>du,globalConfig:()=>q,globalRegistry:()=>Q,handleUnrepresentable:()=>W,initializeContext:()=>Ze,isBackEdge:()=>li,isRecursiveSchema:()=>ci,isValidBase64:()=>Pn,isValidBase64URL:()=>Hr,isValidCIDRv6:()=>qr,isValidCreditCard:()=>Qr,isValidIBAN:()=>Yr,isValidIPv6:()=>An,isValidJWT:()=>Xr,locales:()=>Rn,memoizer:()=>Cn,mergeValues:()=>Tt,meta:()=>wc,parse:()=>Ir,parseAsync:()=>wr,parseURLObject:()=>Wp,prettifyError:()=>va,process:()=>L,processSchema:()=>L,regexes:()=>ve,registry:()=>gi,safeDecode:()=>Nv,safeDecodeAsync:()=>Uv,safeEncode:()=>jv,safeEncodeAsync:()=>Cv,safeParse:()=>wv,safeParseAsync:()=>Sv,standardProps:()=>Br,stripTabAndNewline:()=>Sn,toDotPath:()=>wp,toJSONSchema:()=>qi,toZod:()=>un,treeifyError:()=>ha,urlHostnameOk:()=>Wr,urlProtocolOk:()=>Kr,util:()=>b,validate:()=>bn,validateAsync:()=>$n,validateURL:()=>Gr,version:()=>_s,withParser:()=>yi});var b={};ze(b,{BIGINT_FORMAT_RANGES:()=>mn,CONSTANT_CATCH:()=>xr,Class:()=>na,NUMBER_FORMAT_RANGES:()=>pn,aborted:()=>ne,allowsEval:()=>oa,assert:()=>Gh,assertEqual:()=>Zh,assertIs:()=>Vh,assertNever:()=>Bh,assertNotEqual:()=>Fh,assignProp:()=>H,attachSchema:()=>_r,base64ToUint8Array:()=>bp,base64urlToUint8Array:()=>lv,cached:()=>xt,captureStackTrace:()=>br,cleanEnum:()=>cv,cleanRegex:()=>De,clone:()=>U,cloneDef:()=>qh,codePointLength:()=>Qe,constantCatch:()=>la,createTransparentProxy:()=>ev,defineLazy:()=>ra,defineLazyInternal:()=>D,derived:()=>fv,esc:()=>te,escapeRegex:()=>he,explicitlyAborted:()=>ua,extend:()=>rv,finalizeIssue:()=>ue,floatSafeRemainder:()=>cn,getElementAtPath:()=>Jh,getEnumValues:()=>$t,getLengthableOrigin:()=>gn,getParsedType:()=>Xh,getSizableOrigin:()=>fn,hexToUint8Array:()=>pv,hide:()=>yn,installLazyProp:()=>vv,isObject:()=>He,isPlainObject:()=>ye,issue:()=>It,joinValues:()=>h,jsonStringifyReplacer:()=>_t,members:()=>ca,merge:()=>ov,mergeDefs:()=>$e,normalizeParams:()=>x,nullish:()=>vr,numKeys:()=>Yh,objectClone:()=>Wh,omit:()=>nv,optionalKeys:()=>sa,own:()=>Ue,parsedType:()=>_,partial:()=>av,pick:()=>tv,prefixIssues:()=>se,primitiveTypes:()=>aa,promiseAllObject:()=>Hh,propertyKeyTypes:()=>dn,randomString:()=>Qh,rawShape:()=>kt,required:()=>sv,safeExtend:()=>iv,shallowClone:()=>ln,slugify:()=>ia,stringifyPrimitive:()=>$,toZod:()=>un,uint8ArrayToBase64:()=>$p,uint8ArrayToBase64url:()=>dv,uint8ArrayToHex:()=>mv,unwrapMessage:()=>bt});function Zh(e){return e}function Fh(e){return e}function un(){return e=>e}function Vh(e){}function Bh(e){throw new Error("Unexpected value in exhaustive check")}function Gh(e){}function $t(e){let n=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,t])=>n.indexOf(+a)===-1).map(([a,t])=>t)}function h(e,n="|"){return e.map(o=>$(o)).join(n)}function _t(e,n){return typeof n=="bigint"?n.toString():n}var ta=class{constructor(n){this._getter=n,this._value=void 0}get value(){let n=this._getter;return n!==void 0&&(this._value=n(),this._getter=void 0),this._value}};function xt(e){return new ta(e)}function vr(e){return e==null}function De(e){let n=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(n,o)}function cn(e,n){let o=e/n,a=Math.round(o),t=4*Number.EPSILON*Math.max(Math.abs(o),1);return Math.abs(o-a)<t?0:o-a}var gp=Symbol("evaluating");function ra(e,n,o){let a;Object.defineProperty(e,n,{get(){if(a!==gp)return a===void 0&&(a=gp,a=o()),a},set(t){Object.defineProperty(e,n,{value:t})},configurable:!0})}function Wh(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function H(e,n,o){Object.defineProperty(e,n,{value:o,writable:!0,enumerable:!0,configurable:!0})}function kt(e){let n=Object.getOwnPropertyDescriptor(e,"shape");return n?.get?n.get.raw:n?.value}function Ee(e){return kt(e._zod.def)??e._zod.def.shape}function yp(e,n,o){Object.defineProperty(e,n,{get(){let a=o();return H(this,n,a),a},enumerable:!0,configurable:!0})}function hp(e,n,o){n in e?H(e,n,o):e[n]=o}function Je(e,n,o,a){let t=Ee(n);for(let i of o){let s=Object.getOwnPropertyDescriptor(t,i);s.enumerable&&(s.get?yp(e,i,()=>{let u=n._zod.def.shape[i];return a?a(u,i):u}):hp(e,i,a?a(s.value,i):s.value))}}function Kh(e,n){for(let o of Reflect.ownKeys(n)){let a=Object.getOwnPropertyDescriptor(n,o);a.enumerable&&(a.get?yp(e,o,()=>n[o]):hp(e,o,a.value))}}function $e(...e){let n={};for(let o of e){let a=Object.getOwnPropertyDescriptors(o);Object.assign(n,a)}return Object.defineProperties({},n)}function qh(e){return $e(e._zod.def)}function Jh(e,n){return n?n.reduce((o,a)=>o?.[a],e):e}function Hh(e){let n=Object.keys(e),o=n.map(a=>e[a]);return Promise.all(o).then(a=>{let t={};for(let i=0;i<n.length;i++)t[n[i]]=a[i];return t})}function Qh(e=10){let n="abcdefghijklmnopqrstuvwxyz",o="";for(let a=0;a<e;a++)o+=n[Math.floor(Math.random()*n.length)];return o}function te(e){return JSON.stringify(e)}function ia(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var br="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function He(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var oa=xt(()=>{if(q.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ye(e){if(He(e)===!1)return!1;let n=e.constructor;if(n===void 0||typeof n!="function")return!0;let o=n.prototype;return!(He(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function ln(e){return ye(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Yh(e){let n=0;for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&n++;return n}var Xh=e=>{let n=typeof e;switch(n){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: ${n}`)}},dn=new Set(["string","number","symbol"]),aa=new Set(["string","number","bigint","boolean","symbol","undefined"]);function he(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function U(e,n,o){let a=new e._zod.constr(n??e._zod.def);return(!n||o?.parent)&&(a._zod.parent=e),a}function x(e){let n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function ev(e){let n;return new Proxy({},{get(o,a,t){return n??(n=e()),Reflect.get(n,a,t)},set(o,a,t,i){return n??(n=e()),Reflect.set(n,a,t,i)},has(o,a){return n??(n=e()),Reflect.has(n,a)},deleteProperty(o,a){return n??(n=e()),Reflect.deleteProperty(n,a)},ownKeys(o){return n??(n=e()),Reflect.ownKeys(n)},getOwnPropertyDescriptor(o,a){return n??(n=e()),Reflect.getOwnPropertyDescriptor(n,a)},defineProperty(o,a,t){return n??(n=e()),Reflect.defineProperty(n,a,t)}})}function $(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function sa(e){return Object.keys(e).filter(n=>e[n]._zod.optin!==void 0&&e[n]._zod.optout==="optional")}var pn={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]},mn={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function tv(e,n){let o=e._zod.def,a=o.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return Je(i,e,$r(e,n)),U(e,$e(o,{shape:i,checks:[]}))}function $r(e,n){let o=Ee(e),a=[];for(let t of Reflect.ownKeys(n)){if(!Object.getOwnPropertyDescriptor(o,t)?.enumerable)throw new Error(`Unrecognized key: "${String(t)}"`);n[t]&&a.push(t)}return a}function nv(e,n){let o=e._zod.def,a=o.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set($r(e,n)),s={};return Je(s,e,Reflect.ownKeys(Ee(e)).filter(u=>!i.has(u))),U(e,$e(o,{shape:s,checks:[]}))}function rv(e,n){if(!ye(n))throw new Error("Invalid input to extend: expected a plain object");let o=e._zod.def.checks;if(o&&o.length>0){let t=Ee(e);for(let i of Reflect.ownKeys(n))if(Object.getOwnPropertyDescriptor(t,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return U(e,$e(e._zod.def,{shape:vp(e,n)}))}function vp(e,n){let o={};return Je(o,e,Reflect.ownKeys(Ee(e))),Kh(o,n),o}function iv(e,n){if(!ye(n))throw new Error("Invalid input to safeExtend: expected a plain object");return U(e,$e(e._zod.def,{shape:vp(e,n)}))}function ov(e,n){if(!n?._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 o={};Je(o,e,Reflect.ownKeys(Ee(e))),Je(o,n,Reflect.ownKeys(Ee(n)));let a=$e(e._zod.def,{shape:o,get catchall(){return n._zod.def.catchall},checks:n._zod.def.checks??[]});return U(e,a)}function av(e,n,o,a="partial"){let i=n._zod.def.checks;if(i&&i.length>0)throw new Error(`.${a}() cannot be used on object schemas containing refinements`);let u=o?new Set($r(n,o)):void 0,c={};return Je(c,n,Reflect.ownKeys(Ee(n)),e&&((l,d)=>u&&!u.has(d)?l:new e({type:"optional",innerType:l}))),U(n,$e(n._zod.def,{shape:c,checks:[]}))}function sv(e,n,o){let a=o?new Set($r(n,o)):void 0,t={};return Je(t,n,Reflect.ownKeys(Ee(n)),(i,s)=>a&&!a.has(s)?i:new e({type:"nonoptional",innerType:i})),U(n,$e(n._zod.def,{shape:t}))}function ne(e,n=0){if(e.aborted===!0)return!0;for(let o=n;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function ua(e,n=0){if(e.aborted===!0)return!0;for(let o=n;o<e.issues.length;o++)if(e.issues[o]?.continue===!1)return!0;return!1}function se(e,n){return n.map(o=>{var a;return(a=o).path??(a.path=[]),o.path.unshift(e),o})}function bt(e){return typeof e=="string"?e:e?.message}function _r(e,n,o){var a;for(let t=n;t<e.length;t++)(a=e[t]).schema??(a.schema=o)}function ue(e,n,o){var a;let t=e.inst?._zod?.traits;t?.has("$ZodType")&&(t.has("$ZodCheck")?(a=e).schema??(a.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:bt(e.inst?._zod.def?.error?.(e))??bt(i?.(e))??bt(n?.error?.(e))??bt(o.customError?.(e))??bt(o.localeError?.(e))??"Invalid input",u={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(u[c]=e[c]);return u.path??(u.path=[]),u.message=s,n?.reportInput&&(u.input=e.input),u}function fn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var uv=/[\uD800-\uDBFF]/;function Qe(e){let n=e.length;if(!uv.test(e))return n;let o=n;for(let a=0;a<n-1;a++)(e.charCodeAt(a)&64512)===55296&&(e.charCodeAt(a+1)&64512)===56320&&(o--,a++);return o}function gn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function _(e){let n=typeof e;switch(n){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let o=e;if(o&&Object.getPrototypeOf(o)!==Object.prototype&&"constructor"in o&&o.constructor)return o.constructor.name}}return n}function It(...e){let[n,o,a]=e;return typeof n=="string"?{message:n,code:"custom",input:o,inst:a}:{...n}}function cv(e){return Object.entries(e).filter(([n,o])=>Number.isNaN(Number.parseInt(n,10))).map(n=>n[1])}function bp(e){let n=atob(e),o=new Uint8Array(n.length);for(let a=0;a<n.length;a++)o[a]=n.charCodeAt(a);return o}function $p(e){let n="";for(let o=0;o<e.length;o++)n+=String.fromCharCode(e[o]);return btoa(n)}function lv(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-n.length%4)%4);return bp(n+o)}function dv(e){return $p(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function pv(e){let n=e.replace(/^0x/,"");if(n.length%2!==0)throw new Error("Invalid hex string length");let o=new Uint8Array(n.length/2);for(let a=0;a<n.length;a+=2)o[a/2]=Number.parseInt(n.slice(a,a+2),16);return o}function mv(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}var na=class{constructor(...n){}};function ca(e,n){for(let o in n){let a=Object.getOwnPropertyDescriptor(n,o);a.get?Object.defineProperty(e,o,{...a,enumerable:!1}):gv(e,o,a.value)}}function Ue(e,n,o,a=!0){return Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:a,value:o}),o}function yn(e,n,o){return Ue(e,n,o,!1)}function fv(e,n){for(let o in e){let a=e[o];Object.defineProperty(n,o,{configurable:!0,enumerable:!0,get(){return Ue(this,o,a(this))},set(t){Ue(this,o,t)}})}return n}function gv(e,n,o){Object.defineProperty(e,n,{configurable:!0,get(){return this==null?o:Ue(this,n,o.bind(this))},set(a){Ue(this,n,a)}})}function yv(e,n){let o=Object.getPrototypeOf(e);return n in o?void 0:o}var ea,Ce=!1,hv={configurable:!0,get(){Ce=!0}};function D(e,n,o){let a=Object.getPrototypeOf(e._zod);if(n in a&&ea!==e._zod){ea=void 0;return}ea=e._zod,Object.defineProperty(a,n,{configurable:!0,get(){Object.defineProperty(this,n,hv);let t=Ce;Ce=!1;try{let i=o(this);return Ce?delete this[n]:Object.defineProperty(this,n,{configurable:!0,writable:!0,value:i}),Ce=Ce||t,i}catch(i){throw delete this[n],Ce=Ce||t,i}},set(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t})}})}function vv(e,n,o,a){let t=yv(e,n);t&&Object.defineProperty(t,n,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:a,value:void 0};return Object.defineProperty(this,n,i),i.value=o(this),Object.defineProperty(this,n,i),i.value},set(i){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:a,value:i})}})}var xr="~constantCatch";function la(e){let n=()=>e;return n[xr]=!0,n}var _p,pa=Object.freeze({status:"aborted"}),da={value:void 0,enumerable:!1},xp="captureStackTrace"in Error?Error:null;function bv(e){let n=xp;if(n){let o=n.stackTraceLimit;if(typeof o=="number"){try{n.stackTraceLimit=0}catch{return xp=null,new e}try{return new e}finally{n.stackTraceLimit=o}}}return new e}function y(e,n,o,a){let t={};function i(m){this.def=m,this.constr=p,this.traits=new Set}i.prototype=t;let s=o,u=s&&new WeakSet;function c(m,f){if(m._zod){if(m._zod.traits.has(e))return}else{da.value=new i(f);try{Object.defineProperty(m,"_zod",da)}finally{da.value=void 0}}if(m._zod.traits.add(e),n(m,f),u){let v=Object.getPrototypeOf(m),k=m._zod.constr.prototype,A=v;for(;A&&A!==k;)A=Object.getPrototypeOf(A);let w=A??v;u.has(w)||(u.add(w),ca(w,s))}let g=p.prototype;for(let v in g)Object.prototype.hasOwnProperty.call(g,v)&&(v in m||(m[v]=g[v].bind(m)))}let l=a?.Parent??Object;class d extends l{}Object.defineProperty(d,"name",{value:e});function p(m){let f=a?.Parent?bv(d):this;c(f,m);let g=f._zod.deferred;if(g){for(let k of g)k();f._zod.deferred=void 0}let v=globalThis.__zod_globalConfig?.postProcessor;return v&&v(f),f}return Object.defineProperty(p,"init",{value:c}),Object.defineProperty(p,Symbol.hasInstance,{value:m=>a?.Parent&&m instanceof a.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(p,"name",{value:e}),p}var ma=Symbol("zod_brand"),ce=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Re=class extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}};(_p=globalThis).__zod_globalConfig??(_p.__zod_globalConfig={});var q=globalThis.__zod_globalConfig;function G(e){return e&&Object.assign(q,e),q}function $v(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,_t,2)),e.message}function _v(e){this._zod.message=e}var xv={get:$v,set:_v,enumerable:!0,configurable:!0},ga={value:void 0,enumerable:!1},kp=new WeakSet([Object.prototype,Error.prototype]),Ip=(e,n)=>{e.name="$ZodError",ga.value=n,Object.defineProperty(e,"issues",ga),ga.value=void 0,Object.defineProperty(e,"message",xv);let o=Object.getPrototypeOf(e);kp.has(o)||(kp.add(o),Object.defineProperty(o,"toString",{configurable:!0,enumerable:!1,get(){let a=()=>this.message;return Object.defineProperty(this,"toString",{value:a,configurable:!0,writable:!0}),a},set(a){Object.defineProperty(this,"toString",{value:a,configurable:!0,writable:!0})}}))},ya=y("$ZodError",Ip),le=y("$ZodError",Ip,void 0,{Parent:Error});function kv(e,n,o){return Object.prototype.hasOwnProperty.call(e,n)||(n==="__proto__"?Object.defineProperty(e,n,{value:o(),writable:!0,enumerable:!0,configurable:!0}):e[n]=o()),e[n]}function hn(e,n=o=>o.message){let o={},a=[];for(let t of e.issues)t.path.length>0?kv(o,t.path[0],()=>[]).push(n(t)):a.push(n(t));return{formErrors:a,fieldErrors:o}}function vn(e,n=o=>o.message){let o={_errors:[]},a=(t,i=[])=>{for(let s of t.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(u=>a({issues:u},[...i,...s.path]));else if(s.code==="invalid_key")a({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")a({issues:s.issues},[...i,...s.path]);else{let u=[...i,...s.path];if(u.length===0)o._errors.push(n(s));else{let c=o,l=0;for(;l<u.length;){let d=u[l],p=l===u.length-1;if(d==="_errors"){p&&c._errors.push(n(s)),l++;continue}Object.prototype.hasOwnProperty.call(c,d)||Object.defineProperty(c,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=c[d];p&&m._errors.push(n(s)),c=m,l++}}}};return a(e),o}function ha(e,n=o=>o.message){let o={errors:[]},a=(t,i=[])=>{var s;for(let u of t.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(c=>a({issues:c},[...i,...u.path]));else if(u.code==="invalid_key")a({issues:u.issues},[...i,...u.path]);else if(u.code==="invalid_element")a({issues:u.issues},[...i,...u.path]);else{let c=[...i,...u.path];if(c.length===0){o.errors.push(n(u));continue}let l=o,d=0;for(;d<c.length;){let p=c[d],m=d===c.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=[]),(s=l.items)[p]??(s[p]={errors:[]}),l=l.items[p]),m&&l.errors.push(n(u)),d++}}};return a(e),o}function wp(e){let n=[],o=e.map(a=>typeof a=="object"?a.key:a);for(let a of o)typeof a=="number"?n.push(`[${a}]`):typeof a=="symbol"?n.push(`[${JSON.stringify(String(a))}]`):/[^\w$]/.test(a)?n.push(`[${JSON.stringify(a)}]`):(n.length&&n.push("."),n.push(a));return n.join("")}function va(e){let n=[],o=[...e.issues].sort((a,t)=>(a.path??[]).length-(t.path??[]).length);for(let a of o)n.push(`\u2716 ${a.message}`),a.path?.length&&n.push(` \u2192 at ${wp(a.path)}`);return n.join(`
|
|
3
3
|
`)}function kr(e,n){return{callee:n?.callee??e,Err:n?.Err}}var wt=e=>{let n=(o,a,t,i)=>{let s=t?{...t,async:!1}:{async:!1},u=o._zod.run({value:a,issues:[]},s);if(u instanceof Promise)throw new ce;if(u.issues.length){let c=new(i?.Err??e)(u.issues.map(l=>ue(l,s,G())));throw br(c,i?.callee??n),c}return u.value};return n},Ir=wt(le),St=e=>{let n=async(o,a,t,i)=>{let s=t?{...t,async:!0}:{async:!0},u=o._zod.run({value:a,issues:[]},s);if(u instanceof Promise&&(u=await u),u.issues.length){let c=new(i?.Err??e)(u.issues.map(l=>ue(l,s,G())));throw br(c,i?.callee??n),c}return u.value};return n},wr=St(le),At=e=>(n,o,a)=>{let t=a?{...a,async:!1}:{async:!1},i=n._zod.run({value:o,issues:[]},t);if(i instanceof Promise)throw new ce;return i.issues.length?Sp(e,i.issues,t):{success:!0,data:i.value}},wv=At(le);function Sp(e,n,o){let a;return{success:!1,get error(){return a||(a=new e(n.map(t=>ue(t,o,G()))),n=void 0,o=void 0),a},set error(t){a=t,n=void 0,o=void 0}}}var Pt=e=>async(n,o,a)=>{let t=a?{...a,async:!0}:{async:!0},i=n._zod.run({value:o,issues:[]},t);return i instanceof Promise&&(i=await i),i.issues.length?Sp(e,i.issues,t):{success:!0,data:i.value}},Sv=Pt(le),Av=Symbol.for("zod.compile.invalid"),Pv=Symbol.for("zod.compile.fallback"),bn=((e,n,o)=>{let a=e._zod.bag.validator;if(a!==void 0){if(a(n)!==Av)return!0;if(a.definite===!0&&o===void 0)return!1}return zv(e,n,o)});function zv(e,n,o){let a=o?{...o,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},t=e._zod.bag.fallbackRun,i;if(t?(a[Pv]=!0,i=t({value:n,issues:[]},a)):i=e._zod.run({value:n,issues:[]},a),i instanceof Promise)throw new ce;return i.issues.length===0}var $n=async(e,n,o)=>{let a=o?{...o,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},t=e._zod.run({value:n,issues:[]},a);return t instanceof Promise&&(t=await t),t.issues.length===0},Sr=e=>{let n=wt(e),o=(a,t,i,s)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return n(a,t,u,kr(o,s))};return o},Tv=Sr(le),Ar=e=>{let n=wt(e),o=(a,t,i,s)=>n(a,t,i,kr(o,s));return o},Ev=Ar(le),Pr=e=>{let n=St(e),o=async(a,t,i,s)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return await n(a,t,u,kr(o,s))};return o},Dv=Pr(le),zr=e=>{let n=St(e),o=async(a,t,i,s)=>await n(a,t,i,kr(o,s));return o},Ov=zr(le),Tr=e=>(n,o,a)=>{let t=a?{...a,direction:"backward"}:{direction:"backward"};return At(e)(n,o,t)},jv=Tr(le),Er=e=>(n,o,a)=>At(e)(n,o,a),Nv=Er(le),Dr=e=>async(n,o,a)=>{let t=a?{...a,direction:"backward"}:{direction:"backward"};return Pt(e)(n,o,t)},Cv=Dr(le),Or=e=>async(n,o,a)=>Pt(e)(n,o,a),Uv=Or(le);var ve={};ze(ve,{anyString:()=>Ga,base64:()=>Ca,base64url:()=>Ua,bigint:()=>Ka,boolean:()=>qa,browserEmail:()=>Gv,cidrv4:()=>ja,cidrv6:()=>Na,creditCard:()=>jr,cuid:()=>$a,cuid2:()=>_a,currencyCode:()=>Za,date:()=>Fa,datetime:()=>Ba,domain:()=>La,duration:()=>Aa,e164:()=>Ma,email:()=>za,emoji:()=>Ta,extendedDuration:()=>Rv,guid:()=>Pa,hex:()=>Xa,hostname:()=>Ra,html5Email:()=>Fv,httpProtocol:()=>_n,iban:()=>Nr,idnEmail:()=>Bv,integer:()=>xn,ipv4:()=>Ea,ipv6:()=>Da,ksuid:()=>Ia,lowercase:()=>Qa,mac:()=>Oa,md5_base64:()=>Jv,md5_base64url:()=>Hv,md5_hex:()=>qv,nanoid:()=>wa,nanoidOfLength:()=>Sa,null:()=>Ja,number:()=>Oe,rfc5322Email:()=>Vv,sha1_base64:()=>Yv,sha1_base64url:()=>Xv,sha1_hex:()=>Qv,sha256_base64:()=>tb,sha256_base64url:()=>nb,sha256_hex:()=>eb,sha384_base64:()=>ib,sha384_base64url:()=>ob,sha384_hex:()=>rb,sha512_base64:()=>sb,sha512_base64url:()=>ub,sha512_hex:()=>ab,string:()=>Wa,time:()=>Va,ulid:()=>xa,undefined:()=>Ha,unicodeEmail:()=>Ap,uppercase:()=>Ya,uuid:()=>Ye,uuid4:()=>Lv,uuid6:()=>Mv,uuid7:()=>Zv,xid:()=>ka});var $a=/^[cC][0-9a-z]{6,}$/,_a=/^[0-9a-z]+$/,xa=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ka=/^[0-9a-vA-V]{20}$/,Ia=/^[A-Za-z0-9]{27}$/,wa=/^[a-zA-Z0-9_-]{21}$/;function Sa(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Aa=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Rv=/^[-+]?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)?)??$/,Pa=/^([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})$/,Ye=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)$/,Lv=Ye(4),Mv=Ye(6),Zv=Ye(7),za=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Fv=/^[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])?)*$/,Vv=/^(([^<>()\[\]\\.,;:\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,}))$/,Ap=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Bv=Ap,Gv=/^[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])?)*$/,Wv="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Ta(){return new RegExp(Wv,"u")}var Ea=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Da=/^(([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}|:))$/,Oa=e=>{let n=he(e??":");return new RegExp(`^(?:[0-9A-F]{2}${n}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${n}){5}[0-9a-f]{2}$`)},ja=/^((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])$/,Na=/^(([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])$/,Ca=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ua=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Ra=/^(?=.{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])?)*\.?$/,La=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,_n=/^https?$/,Ma=/^\+[1-9]\d{6,14}$/,jr=/^\d(?:[ -]?\d){11,18}$/,Za=/^(?: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)$/,Nr=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,Pp="(?:(?:\\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 Kv(e){return new RegExp(`^${e}$`)}var Fa=Kv(Pp);function ba(e){let n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${n}:[0-5]\\d(?:\\.\\d+)?`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Va(e){return new RegExp(`^${ba(e)}$`)}function Ba(e){let n=["Z"];e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${ba({precision:e.precision,seconds:!0})}(?:${n.join("|")})`,a=e.local?`${o}|${ba({precision:e.precision})}`:o;return new RegExp(`^${Pp}T(?:${a})$`)}var Ga=/^[\s\S]{0,}$/,Wa=e=>{let n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},Ka=/^-?\d+n?$/,xn=/^-?\d+$/,Oe=/^-?\d+(?:\.\d+)?$/,qa=/^(?:true|false)$/i,Ja=/^null$/i;var Ha=/^undefined$/i;var Qa=/^[^A-Z]*$/,Ya=/^[^a-z]*$/,Xa=/^[0-9a-fA-F]*$/;function kn(e,n){return new RegExp(`^[A-Za-z0-9+/]{${e}}${n}$`)}function In(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var qv=/^[0-9a-fA-F]{32}$/,Jv=kn(22,"=="),Hv=In(22),Qv=/^[0-9a-fA-F]{40}$/,Yv=kn(27,"="),Xv=In(27),eb=/^[0-9a-fA-F]{64}$/,tb=kn(43,"="),nb=In(43),rb=/^[0-9a-fA-F]{96}$/,ib=kn(64,""),ob=In(64),ab=/^[0-9a-fA-F]{128}$/,sb=kn(86,"=="),ub=In(86);var Z=y("$ZodCheck",(e,n)=>{var o;e._zod??(e._zod={}),e._zod.def=n,(o=e._zod).onattach??(o.onattach=[])}),es=e=>{let n=e.value;return!vr(n)&&n.size!==void 0},ts=e=>{let n=e.value;return!vr(n)&&n.length!==void 0},Cr={number:"number",bigint:"bigint",object:"date"},Rr=y("$ZodCheckLessThan",(e,n)=>{Z.init(e,n);let o=Cr[typeof n.value];e._zod.check=a=>{(n.inclusive?a.value<=n.value:a.value<n.value)||a.issues.push({origin:Cr[typeof a.value]??o,code:"too_big",maximum:typeof n.value=="object"?n.value.getTime():n.value,input:a.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Lr=y("$ZodCheckGreaterThan",(e,n)=>{Z.init(e,n);let o=Cr[typeof n.value];e._zod.check=a=>{(n.inclusive?a.value>=n.value:a.value>n.value)||a.issues.push({origin:Cr[typeof a.value]??o,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:a.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),ns=y("$ZodCheckMultipleOf",(e,n)=>{Z.init(e,n),e._zod.check=o=>{if(typeof o.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof o.value=="bigint"?n.value!==BigInt(0)&&o.value%n.value===BigInt(0):cn(o.value,n.value)===0)||o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:n.value,input:o.value,inst:e,continue:!n.abort})}}),rs=y("$ZodCheckNumberFormat",(e,n)=>{Z.init(e,n),n.format=n.format||"float64";let o=n.format?.includes("int"),a=o?"int":"number",[t,i]=pn[n.format];e._zod.check=s=>{let u=s.value;if(o){if(!Number.isInteger(u)){s.issues.push({expected:a,format:n.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?s.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!n.abort}):s.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!n.abort});return}}u<t&&s.issues.push({origin:"number",input:u,code:"too_small",minimum:t,inclusive:!0,inst:e,continue:!n.abort}),u>i&&s.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!n.abort})}}),is=y("$ZodCheckBigIntFormat",(e,n)=>{Z.init(e,n);let[o,a]=mn[n.format];e._zod.check=t=>{let i=t.value;i<o&&t.issues.push({origin:"bigint",input:i,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!n.abort}),i>a&&t.issues.push({origin:"bigint",input:i,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!n.abort})}}),os=y("$ZodCheckMaxSize",(e,n)=>{var o;Z.init(e,n),(o=e._zod.def).when??(o.when=es),e._zod.check=a=>{let t=a.value;t.size<=n.maximum||a.issues.push({origin:fn(t),code:"too_big",maximum:n.maximum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),as=y("$ZodCheckMinSize",(e,n)=>{var o;Z.init(e,n),(o=e._zod.def).when??(o.when=es),e._zod.check=a=>{let t=a.value;t.size>=n.minimum||a.issues.push({origin:fn(t),code:"too_small",minimum:n.minimum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),ss=y("$ZodCheckSizeEquals",(e,n)=>{var o;Z.init(e,n),(o=e._zod.def).when??(o.when=es),e._zod.check=a=>{let t=a.value,i=t.size;if(i===n.size)return;let s=i>n.size;a.issues.push({origin:fn(t),...s?{code:"too_big",maximum:n.size}:{code:"too_small",minimum:n.size},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!n.abort})}}),us=y("$ZodCheckMaxLength",(e,n)=>{var o;Z.init(e,n),(o=e._zod.def).when??(o.when=ts),e._zod.check=a=>{let t=a.value,i=t.length;if((typeof t=="string"&&i>n.maximum?Qe(t):i)<=n.maximum)return;let u=gn(t);a.issues.push({origin:u,code:"too_big",maximum:n.maximum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),cs=y("$ZodCheckMinLength",(e,n)=>{var o;Z.init(e,n),(o=e._zod.def).when??(o.when=ts),e._zod.check=a=>{let t=a.value,i=t.length;if((typeof t=="string"&&i>=n.minimum&&i<n.minimum*2?Qe(t):i)>=n.minimum)return;let u=gn(t);a.issues.push({origin:u,code:"too_small",minimum:n.minimum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),ls=y("$ZodCheckLengthEquals",(e,n)=>{var o;Z.init(e,n),(o=e._zod.def).when??(o.when=ts),e._zod.check=a=>{let t=a.value,i=t.length,s=typeof t=="string"&&i>=n.length&&i<=n.length*2?Qe(t):i;if(s===n.length)return;let u=gn(t),c=s>n.length;a.issues.push({origin:u,...c?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!n.abort})}}),zt=y("$ZodCheckStringFormat",(e,n)=>{var o,a;Z.init(e,n),n.pattern?(o=e._zod).check??(o.check=t=>{n.pattern.lastIndex=0,!n.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:n.format,input:t.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(a=e._zod).check??(a.check=()=>{})}),ds=y("$ZodCheckRegex",(e,n)=>{zt.init(e,n),e._zod.check=o=>{n.pattern.lastIndex=0,!n.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),ps=y("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=Qa),zt.init(e,n)}),ms=y("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=Ya),zt.init(e,n)}),fs=y("$ZodCheckIncludes",(e,n)=>{Z.init(e,n);let o=he(n.includes),a=new RegExp(typeof n.position=="number"?`^.{${n.position},}${o}`:o);n.pattern=a,e._zod.check=t=>{t.value.includes(n.includes,n.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:t.value,inst:e,continue:!n.abort})}}),gs=y("$ZodCheckStartsWith",(e,n)=>{Z.init(e,n);let o=new RegExp(`^${he(n.prefix)}.*`);n.pattern??(n.pattern=o),e._zod.check=a=>{a.value.startsWith(n.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:a.value,inst:e,continue:!n.abort})}}),ys=y("$ZodCheckEndsWith",(e,n)=>{Z.init(e,n);let o=new RegExp(`.*${he(n.suffix)}$`);n.pattern??(n.pattern=o),e._zod.check=a=>{a.value.endsWith(n.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:a.value,inst:e,continue:!n.abort})}});function Ur(e,n,o){e.issues.length&&n.issues.push(...se(o,e.issues))}var hs=y("$ZodCheckProperty",(e,n)=>{Z.init(e,n),e._zod.check=o=>{let a=n.schema._zod.run({value:o.value[n.property],issues:[]},{});if(a instanceof Promise)return a.then(t=>Ur(t,o,n.property));Ur(a,o,n.property)}}),vs=y("$ZodCheckProperties",(e,n)=>{Z.init(e,n),yn(e,Symbol.iterator,function*(){yield e});let o;e._zod.check=a=>{if(a.value==null){a.issues.push({expected:"object",code:"invalid_type",input:a.value,inst:e});return}o??(o=Reflect.ownKeys(n.shape).map(s=>[s,n.shape[s]]));let t=a.value,i;for(let[s,u]of o){let c=u._zod.run({value:t[s],issues:[]},{});c instanceof Promise?(i??(i=[]),i.push(c.then(l=>Ur(l,a,s)))):Ur(c,a,s)}if(i)return Promise.all(i).then(()=>{})}}),bs=y("$ZodCheckMimeType",(e,n)=>{Z.init(e,n);let o=new Set(n.mime);e._zod.check=a=>{o.has(a.value.type)||a.issues.push({code:"invalid_value",values:n.mime,input:a.value.type,inst:e,continue:!n.abort})}}),$s=y("$ZodCheckOverwrite",(e,n)=>{Z.init(e,n),e._zod.check=o=>{o.value=n.tx(o.value)}});var Xe=class{constructor(n=[],o={}){this.content=[],this.indent=0,this.args=n,this.closed=o}indented(n){this.indent+=1;try{n(this)}finally{this.indent-=1}}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}let a=n.split(`
|
|
4
4
|
`).filter(s=>s),t=Math.min(...a.map(s=>s.length-s.trimStart().length)),i=a.map(s=>s.slice(t)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let n=Function,o=this?.content??[""];return new n(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
5
5
|
${o.join(`
|
package/package.json
CHANGED