@reqvire-org/ads 0.2.9 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +2 -2
  2. package/dist/bootstrap-ds/ADS.md +19 -8
  3. package/dist/bootstrap-ds/README.md +13 -11
  4. package/dist/bootstrap-ds/design-system/index.ts +1 -1
  5. package/dist/bootstrap-ds/design-system/patterns/token-preview/Scenario.tsx +4 -0
  6. package/dist/bootstrap-ds/design-system/patterns/token-preview/TokenPreview.tsx +31 -0
  7. package/dist/bootstrap-ds/design-system/patterns/token-preview/fixture.ts +8 -0
  8. package/dist/bootstrap-ds/design-system/tokens/Foundation.fixture.ts +44 -43
  9. package/dist/bootstrap-ds/design-system/tokens/Foundation.scenario.tsx +3 -13
  10. package/dist/bootstrap-ds/ds.config.json +10 -0
  11. package/dist/check.mjs +2 -9
  12. package/dist/init.mjs +22 -5
  13. package/dist/mcp/apps.mjs +2 -2
  14. package/dist/mcp/context.mjs +1 -1
  15. package/dist/mcp/preview-widget.bundle.js +40 -38
  16. package/dist/mcp/project-widget.bundle.js +42 -38
  17. package/dist/mcp/prompts.mjs +1 -1
  18. package/dist/mcp/server.mjs +5 -5
  19. package/dist/preview-resources.mjs +1 -1
  20. package/dist/scenarios.mjs +16 -5
  21. package/dist/skills/README.md +1 -1
  22. package/dist/skills/ads-assimilate/SKILL.md +28 -12
  23. package/dist/skills/ads-assimilate/references/cli.md +2 -2
  24. package/dist/skills/ads-break-ui/SKILL.md +28 -12
  25. package/dist/skills/ads-break-ui/references/verification.md +4 -0
  26. package/dist/skills/ads-designer/SKILL.md +30 -14
  27. package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +19 -8
  28. package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +13 -11
  29. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/index.ts +1 -1
  30. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/token-preview/Scenario.tsx +4 -0
  31. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/token-preview/TokenPreview.tsx +31 -0
  32. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/token-preview/fixture.ts +8 -0
  33. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Foundation.fixture.ts +44 -43
  34. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Foundation.scenario.tsx +3 -13
  35. package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +10 -0
  36. package/dist/skills/ads-designer/references/cli.md +2 -2
  37. package/dist/skills/ads-import/SKILL.md +28 -12
  38. package/dist/skills/ads-import/references/cli.md +2 -2
  39. package/dist/skills/ads-motion/SKILL.md +28 -12
  40. package/dist/token-policy.mjs +12 -0
  41. package/dist/token-samples.mjs +8 -0
  42. package/dist/units.mjs +34 -10
  43. package/docs/ADS.md +23 -9
  44. package/docs/ARCHITECTURE.md +12 -0
  45. package/docs/CHANGELOG.md +16 -1
  46. package/docs/GUIDE.md +16 -13
  47. package/docs/MCP.md +44 -2
  48. package/package.json +5 -5
@@ -1,68 +1,68 @@
1
- var S_=Object.defineProperty;var Ke=(e,t)=>{for(var o in t)S_(e,o,{get:t[o],enumerable:!0})};var __=Object.create,wa=Object.defineProperty,b_=Object.getOwnPropertyDescriptor,y_=Object.getOwnPropertyNames,z_=Object.getPrototypeOf,v_=Object.prototype.hasOwnProperty,pf=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hf=(e,t)=>{let o={};for(var r in e)wa(o,r,{get:e[r],enumerable:!0});return t&&wa(o,Symbol.toStringTag,{value:"Module"}),o},R_=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=y_(t),s=0,i=n.length,c;s<i;s++)c=n[s],!v_.call(e,c)&&c!==o&&wa(e,c,{get:(l=>t[l]).bind(null,c),enumerable:!(r=b_(t,c))||r.enumerable});return e},mf=(e,t,o)=>(o=e!=null?__(z_(e)):{},R_(t||!e||!e.__esModule?wa(o,"default",{value:e,enumerable:!0}):o,e));var w_=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]);function ff(e){return typeof e=="string"&&w_.has(e.replace(/#$/,""))}var u={};Ke(u,{$brand:()=>Dl,$input:()=>up,$output:()=>lp,NEVER:()=>qn,TimePrecision:()=>mp,ZodAny:()=>Xh,ZodArray:()=>rm,ZodBase64:()=>Yc,ZodBase64URL:()=>Qc,ZodBigInt:()=>dr,ZodBigIntFormat:()=>tl,ZodBoolean:()=>ur,ZodCIDRv4:()=>Gc,ZodCIDRv6:()=>Kc,ZodCUID:()=>Dc,ZodCUID2:()=>Vc,ZodCatch:()=>Rm,ZodCodec:()=>ds,ZodCustom:()=>ps,ZodCustomStringFormat:()=>cr,ZodDate:()=>as,ZodDefault:()=>Sm,ZodDiscriminatedUnion:()=>sm,ZodE164:()=>Xc,ZodEmail:()=>jc,ZodEmoji:()=>Uc,ZodEnum:()=>sr,ZodError:()=>iy,ZodExactOptional:()=>mm,ZodFile:()=>pm,ZodFirstPartyTypeKind:()=>Mm,ZodFunction:()=>Im,ZodGUID:()=>rs,ZodIPv4:()=>Bc,ZodIPv6:()=>Wc,ZodISODate:()=>Ic,ZodISODateTime:()=>Cc,ZodISODuration:()=>Nc,ZodISOTime:()=>Oc,ZodIntersection:()=>im,ZodIssueCode:()=>qm,ZodJWT:()=>el,ZodKSUID:()=>Jc,ZodLazy:()=>$m,ZodLiteral:()=>dm,ZodMAC:()=>Gh,ZodMap:()=>lm,ZodNaN:()=>xm,ZodNanoID:()=>Zc,ZodNever:()=>tm,ZodNonOptional:()=>il,ZodNull:()=>Qh,ZodNullable:()=>gm,ZodNumber:()=>lr,ZodNumberFormat:()=>to,ZodObject:()=>cs,ZodOptional:()=>sl,ZodPipe:()=>us,ZodPrefault:()=>bm,ZodPreprocess:()=>Pm,ZodPromise:()=>Cm,ZodReadonly:()=>Tm,ZodRealError:()=>ye,ZodRecord:()=>nr,ZodSet:()=>um,ZodString:()=>ir,ZodStringFormat:()=>D,ZodSuccess:()=>vm,ZodSymbol:()=>Kh,ZodTemplateLiteral:()=>Em,ZodTransform:()=>hm,ZodTuple:()=>am,ZodType:()=>M,ZodULID:()=>Hc,ZodURL:()=>is,ZodUUID:()=>Ue,ZodUndefined:()=>Yh,ZodUnion:()=>ls,ZodUnknown:()=>em,ZodVoid:()=>om,ZodXID:()=>Fc,ZodXor:()=>nm,_ZodString:()=>Ac,_default:()=>_m,_function:()=>Yg,any:()=>ol,array:()=>f,base64:()=>gg,base64url:()=>Sg,bigint:()=>kg,boolean:()=>R,catch:()=>wm,check:()=>Qg,cidrv4:()=>mg,cidrv6:()=>fg,clone:()=>he,codec:()=>Bg,coerce:()=>hs,config:()=>Y,core:()=>Xe,cuid:()=>ig,cuid2:()=>ag,custom:()=>Xg,date:()=>Ng,decode:()=>Dh,decodeAsync:()=>Hh,describe:()=>eS,discriminatedUnion:()=>wt,e164:()=>_g,email:()=>Lc,emoji:()=>ng,encode:()=>Zh,encodeAsync:()=>Vh,endsWith:()=>Go,enum:()=>C,exactOptional:()=>fm,file:()=>Vg,flattenError:()=>Hn,float32:()=>wg,float64:()=>xg,formatError:()=>Fn,fromJSONSchema:()=>iS,function:()=>Yg,getErrorMap:()=>ly,globalRegistry:()=>re,gt:()=>je,gte:()=>fe,guid:()=>Qf,hash:()=>Rg,hex:()=>vg,hostname:()=>zg,httpUrl:()=>rg,includes:()=>Bo,instanceof:()=>oS,int:()=>Mc,int32:()=>Pg,int64:()=>Eg,intersection:()=>Oe,invertCodec:()=>Wg,ipv4:()=>dg,ipv6:()=>hg,iso:()=>xe,json:()=>nS,jwt:()=>bg,keyof:()=>Mg,ksuid:()=>ug,lazy:()=>xt,length:()=>Xt,literal:()=>g,locales:()=>Qn,looseObject:()=>E,looseRecord:()=>Lg,lowercase:()=>Fo,lt:()=>Ae,lte:()=>we,mac:()=>pg,map:()=>Ug,maxLength:()=>Qt,maxSize:()=>yt,meta:()=>tS,mime:()=>Ko,minLength:()=>Qe,minSize:()=>Le,multipleOf:()=>bt,nan:()=>Jg,nanoid:()=>sg,nativeEnum:()=>Dg,negative:()=>vc,never:()=>rl,nonnegative:()=>wc,nonoptional:()=>zm,nonpositive:()=>Rc,normalize:()=>Yo,null:()=>Ze,nullable:()=>ns,nullish:()=>Hg,number:()=>b,object:()=>p,optional:()=>T,overwrite:()=>Ie,parse:()=>jh,parseAsync:()=>Lh,partialRecord:()=>jg,pipe:()=>qc,positive:()=>zc,prefault:()=>ym,preprocess:()=>et,prettifyError:()=>ou,promise:()=>Kg,property:()=>xc,readonly:()=>km,record:()=>v,refine:()=>Om,regex:()=>Ho,regexes:()=>Re,registry:()=>ec,safeDecode:()=>Jh,safeDecodeAsync:()=>Wh,safeEncode:()=>Fh,safeEncodeAsync:()=>Bh,safeParse:()=>os,safeParseAsync:()=>Uh,set:()=>Zg,setErrorMap:()=>cy,size:()=>Yt,slugify:()=>tr,startsWith:()=>Wo,strictObject:()=>qg,string:()=>a,stringFormat:()=>yg,stringbool:()=>rS,success:()=>Fg,superRefine:()=>Nm,symbol:()=>Cg,templateLiteral:()=>Gg,toJSONSchema:()=>eo,toLowerCase:()=>Xo,toUpperCase:()=>er,transform:()=>nl,treeifyError:()=>tu,trim:()=>Qo,tuple:()=>cm,uint32:()=>Tg,uint64:()=>$g,ulid:()=>cg,undefined:()=>Ig,union:()=>x,unknown:()=>P,uppercase:()=>Jo,url:()=>ar,util:()=>O,uuid:()=>Xf,uuidv4:()=>eg,uuidv6:()=>tg,uuidv7:()=>og,void:()=>Og,xid:()=>lg,xor:()=>Ag});var Xe={};Ke(Xe,{$ZodAny:()=>Cd,$ZodArray:()=>qd,$ZodAsyncError:()=>Ce,$ZodBase64:()=>zd,$ZodBase64URL:()=>vd,$ZodBigInt:()=>Wa,$ZodBigIntFormat:()=>Td,$ZodBoolean:()=>Gn,$ZodCIDRv4:()=>_d,$ZodCIDRv6:()=>bd,$ZodCUID:()=>id,$ZodCUID2:()=>ad,$ZodCatch:()=>ep,$ZodCheck:()=>H,$ZodCheckBigIntFormat:()=>qu,$ZodCheckEndsWith:()=>Wu,$ZodCheckGreaterThan:()=>Da,$ZodCheckIncludes:()=>Ju,$ZodCheckLengthEquals:()=>Du,$ZodCheckLessThan:()=>Za,$ZodCheckLowerCase:()=>Hu,$ZodCheckMaxLength:()=>Uu,$ZodCheckMaxSize:()=>Au,$ZodCheckMimeType:()=>Ku,$ZodCheckMinLength:()=>Zu,$ZodCheckMinSize:()=>ju,$ZodCheckMultipleOf:()=>Nu,$ZodCheckNumberFormat:()=>Mu,$ZodCheckOverwrite:()=>Yu,$ZodCheckProperty:()=>Gu,$ZodCheckRegex:()=>Vu,$ZodCheckSizeEquals:()=>Lu,$ZodCheckStartsWith:()=>Bu,$ZodCheckStringFormat:()=>Vo,$ZodCheckUpperCase:()=>Fu,$ZodCodec:()=>Yn,$ZodCustom:()=>cp,$ZodCustomStringFormat:()=>xd,$ZodDate:()=>Md,$ZodDefault:()=>Kd,$ZodDiscriminatedUnion:()=>Ld,$ZodE164:()=>Rd,$ZodEmail:()=>od,$ZodEmoji:()=>nd,$ZodEncodeError:()=>mt,$ZodEnum:()=>Hd,$ZodError:()=>Vn,$ZodExactOptional:()=>Wd,$ZodFile:()=>Jd,$ZodFunction:()=>sp,$ZodGUID:()=>ed,$ZodIPv4:()=>fd,$ZodIPv6:()=>gd,$ZodISODate:()=>pd,$ZodISODateTime:()=>dd,$ZodISODuration:()=>md,$ZodISOTime:()=>hd,$ZodIntersection:()=>Ud,$ZodJWT:()=>wd,$ZodKSUID:()=>ud,$ZodLazy:()=>ap,$ZodLiteral:()=>Fd,$ZodMAC:()=>Sd,$ZodMap:()=>Dd,$ZodNaN:()=>tp,$ZodNanoID:()=>sd,$ZodNever:()=>Od,$ZodNonOptional:()=>Qd,$ZodNull:()=>$d,$ZodNullable:()=>Gd,$ZodNumber:()=>Ba,$ZodNumberFormat:()=>Pd,$ZodObject:()=>Jf,$ZodObjectJIT:()=>Ad,$ZodOptional:()=>Ka,$ZodPipe:()=>Ya,$ZodPrefault:()=>Yd,$ZodPreprocess:()=>op,$ZodPromise:()=>ip,$ZodReadonly:()=>rp,$ZodRealError:()=>be,$ZodRecord:()=>Zd,$ZodRegistry:()=>Xa,$ZodSet:()=>Vd,$ZodString:()=>Kt,$ZodStringFormat:()=>Z,$ZodSuccess:()=>Xd,$ZodSymbol:()=>kd,$ZodTemplateLiteral:()=>np,$ZodTransform:()=>Bd,$ZodTuple:()=>Ga,$ZodType:()=>N,$ZodULID:()=>cd,$ZodURL:()=>rd,$ZodUUID:()=>td,$ZodUndefined:()=>Ed,$ZodUnion:()=>Kn,$ZodUnknown:()=>Id,$ZodVoid:()=>Nd,$ZodXID:()=>ld,$ZodXor:()=>jd,$brand:()=>Dl,$constructor:()=>h,$input:()=>up,$output:()=>lp,Doc:()=>Wn,JSONSchema:()=>Gf,JSONSchemaGenerator:()=>Ec,NEVER:()=>qn,TimePrecision:()=>mp,_any:()=>Mp,_array:()=>Dp,_base64:()=>Sc,_base64url:()=>_c,_bigint:()=>kp,_boolean:()=>Pp,_catch:()=>Qb,_check:()=>Wf,_cidrv4:()=>fc,_cidrv6:()=>gc,_coercedBigint:()=>Ep,_coercedBoolean:()=>Tp,_coercedDate:()=>Up,_coercedNumber:()=>yp,_coercedString:()=>pp,_cuid:()=>cc,_cuid2:()=>lc,_custom:()=>Hp,_date:()=>Lp,_decode:()=>Ia,_decodeAsync:()=>Na,_default:()=>Gb,_discriminatedUnion:()=>Ab,_e164:()=>bc,_email:()=>tc,_emoji:()=>ic,_encode:()=>Ca,_encodeAsync:()=>Oa,_endsWith:()=>Go,_enum:()=>Vb,_file:()=>Vp,_float32:()=>vp,_float64:()=>Rp,_gt:()=>je,_gte:()=>fe,_guid:()=>Xn,_includes:()=>Bo,_int:()=>zp,_int32:()=>wp,_int64:()=>$p,_intersection:()=>jb,_ipv4:()=>hc,_ipv6:()=>mc,_isoDate:()=>gp,_isoDateTime:()=>fp,_isoDuration:()=>_p,_isoTime:()=>Sp,_jwt:()=>yc,_ksuid:()=>pc,_lazy:()=>oy,_length:()=>Xt,_literal:()=>Fb,_lowercase:()=>Fo,_lt:()=>Ae,_lte:()=>we,_mac:()=>hp,_map:()=>Zb,_max:()=>we,_maxLength:()=>Qt,_maxSize:()=>yt,_mime:()=>Ko,_min:()=>fe,_minLength:()=>Qe,_minSize:()=>Le,_multipleOf:()=>bt,_nan:()=>Zp,_nanoid:()=>ac,_nativeEnum:()=>Hb,_negative:()=>vc,_never:()=>Ap,_nonnegative:()=>wc,_nonoptional:()=>Kb,_nonpositive:()=>Rc,_normalize:()=>Yo,_null:()=>Np,_nullable:()=>Wb,_number:()=>bp,_optional:()=>Bb,_overwrite:()=>Ie,_parse:()=>Lo,_parseAsync:()=>Uo,_pipe:()=>Xb,_positive:()=>zc,_promise:()=>ry,_property:()=>xc,_readonly:()=>ey,_record:()=>Ub,_refine:()=>Fp,_regex:()=>Ho,_safeDecode:()=>qa,_safeDecodeAsync:()=>ja,_safeEncode:()=>Ma,_safeEncodeAsync:()=>Aa,_safeParse:()=>Zo,_safeParseAsync:()=>Do,_set:()=>Db,_size:()=>Yt,_slugify:()=>tr,_startsWith:()=>Wo,_string:()=>dp,_stringFormat:()=>or,_stringbool:()=>Gp,_success:()=>Yb,_superRefine:()=>Jp,_symbol:()=>Ip,_templateLiteral:()=>ty,_toLowerCase:()=>Xo,_toUpperCase:()=>er,_transform:()=>Jb,_trim:()=>Qo,_tuple:()=>Lb,_uint32:()=>xp,_uint64:()=>Cp,_ulid:()=>uc,_undefined:()=>Op,_union:()=>Mb,_unknown:()=>qp,_uppercase:()=>Jo,_url:()=>es,_uuid:()=>oc,_uuidv4:()=>rc,_uuidv6:()=>nc,_uuidv7:()=>sc,_void:()=>jp,_xid:()=>dc,_xor:()=>qb,clone:()=>he,config:()=>Y,createStandardJSONSchemaMethod:()=>rr,createToJSONSchemaMethod:()=>Kp,decode:()=>Q_,decodeAsync:()=>eb,describe:()=>Bp,encode:()=>Y_,encodeAsync:()=>X_,extractDefs:()=>vt,finalize:()=>Rt,flattenError:()=>Hn,formatError:()=>Fn,globalConfig:()=>Bt,globalRegistry:()=>re,initializeContext:()=>zt,isValidBase64:()=>yd,isValidBase64URL:()=>Df,isValidJWT:()=>Vf,locales:()=>Qn,meta:()=>Wp,parse:()=>Ea,parseAsync:()=>$a,prettifyError:()=>ou,process:()=>L,regexes:()=>Re,registry:()=>ec,safeDecode:()=>ob,safeDecodeAsync:()=>nb,safeEncode:()=>tb,safeEncodeAsync:()=>rb,safeParse:()=>ru,safeParseAsync:()=>nu,toDotPath:()=>zf,toJSONSchema:()=>eo,treeifyError:()=>tu,util:()=>O,version:()=>Qu});var gf,qn=Object.freeze({status:"aborted"});function h(e,t,o){function r(c,l){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:l,constr:i,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,l);let d=i.prototype,m=Object.keys(d);for(let S=0;S<m.length;S++){let _=m[S];_ in c||(c[_]=d[_].bind(c))}}let n=o?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function i(c){var l;let d=o?.Parent?new s:this;r(d,c),(l=d._zod).deferred??(l.deferred=[]);for(let m of d._zod.deferred)m();return d}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:c=>o?.Parent&&c instanceof o.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}var Dl=Symbol("zod_brand"),Ce=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},mt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(gf=globalThis).__zod_globalConfig??(gf.__zod_globalConfig={});var Bt=globalThis.__zod_globalConfig;function Y(e){return e&&Object.assign(Bt,e),Bt}var O={};Ke(O,{BIGINT_FORMAT_RANGES:()=>Ql,Class:()=>Hl,NUMBER_FORMAT_RANGES:()=>Yl,aborted:()=>_t,allowsEval:()=>Bl,assert:()=>E_,assertEqual:()=>x_,assertIs:()=>T_,assertNever:()=>k_,assertNotEqual:()=>P_,assignProp:()=>gt,base64ToUint8Array:()=>_f,base64urlToUint8Array:()=>J_,cached:()=>Ao,captureStackTrace:()=>Ta,cleanEnum:()=>F_,cleanRegex:()=>Ln,clone:()=>he,cloneDef:()=>C_,createTransparentProxy:()=>A_,defineLazy:()=>q,esc:()=>Pa,escapeRegex:()=>ke,explicitlyAborted:()=>Xl,extend:()=>U_,finalizeIssue:()=>me,floatSafeRemainder:()=>Fl,getElementAtPath:()=>I_,getEnumValues:()=>jn,getLengthableOrigin:()=>Dn,getParsedType:()=>q_,getSizableOrigin:()=>Zn,hexToUint8Array:()=>W_,isObject:()=>Wt,isPlainObject:()=>St,issue:()=>jo,joinValues:()=>xa,jsonStringifyReplacer:()=>qo,merge:()=>D_,mergeDefs:()=>Ye,normalizeParams:()=>z,nullish:()=>ft,numKeys:()=>M_,objectClone:()=>$_,omit:()=>L_,optionalKeys:()=>Kl,parsedType:()=>eu,partial:()=>V_,pick:()=>j_,prefixIssues:()=>_e,primitiveTypes:()=>Gl,promiseAllObject:()=>O_,propertyKeyTypes:()=>Un,randomString:()=>N_,required:()=>H_,safeExtend:()=>Z_,shallowClone:()=>Wl,slugify:()=>Jl,stringifyPrimitive:()=>ka,uint8ArrayToBase64:()=>bf,uint8ArrayToBase64url:()=>B_,uint8ArrayToHex:()=>G_,unwrapMessage:()=>An});function x_(e){return e}function P_(e){return e}function T_(e){}function k_(e){throw new Error("Unexpected value in exhaustive check")}function E_(e){}function jn(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,n])=>t.indexOf(+r)===-1).map(([r,n])=>n)}function xa(e,t="|"){return e.map(o=>ka(o)).join(t)}function qo(e,t){return typeof t=="bigint"?t.toString():t}function Ao(e){return{get value(){{let o=e();return Object.defineProperty(this,"value",{value:o}),o}throw new Error("cached value already set")}}}function ft(e){return e==null}function Ln(e){let t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function Fl(e,t){let o=e/t,r=Math.round(o),n=Number.EPSILON*Math.max(Math.abs(o),1);return Math.abs(o-r)<n?0:o-r}var Sf=Symbol("evaluating");function q(e,t,o){let r;Object.defineProperty(e,t,{get(){if(r!==Sf)return r===void 0&&(r=Sf,r=o()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function $_(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function gt(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function Ye(...e){let t={};for(let o of e){let r=Object.getOwnPropertyDescriptors(o);Object.assign(t,r)}return Object.defineProperties({},t)}function C_(e){return Ye(e._zod.def)}function I_(e,t){return t?t.reduce((o,r)=>o?.[r],e):e}function O_(e){let t=Object.keys(e),o=t.map(r=>e[r]);return Promise.all(o).then(r=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=r[s];return n})}function N_(e=10){let t="abcdefghijklmnopqrstuvwxyz",o="";for(let r=0;r<e;r++)o+=t[Math.floor(Math.random()*t.length)];return o}function Pa(e){return JSON.stringify(e)}function Jl(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ta="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Wt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Bl=Ao(()=>{if(Bt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function St(e){if(Wt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let o=t.prototype;return!(Wt(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function Wl(e){return St(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function M_(e){let t=0;for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&t++;return t}var q_=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}`)}},Un=new Set(["string","number","symbol"]),Gl=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function he(e,t,o){let r=new e._zod.constr(t??e._zod.def);return(!t||o?.parent)&&(r._zod.parent=e),r}function z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};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:()=>t.error}:t}function A_(e){let t;return new Proxy({},{get(o,r,n){return t??(t=e()),Reflect.get(t,r,n)},set(o,r,n,s){return t??(t=e()),Reflect.set(t,r,n,s)},has(o,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(o,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(o){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(o,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(o,r,n){return t??(t=e()),Reflect.defineProperty(t,r,n)}})}function ka(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Kl(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Yl={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]},Ql={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function j_(e,t){let o=e._zod.def,r=o.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=Ye(e._zod.def,{get shape(){let i={};for(let c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(i[c]=o.shape[c])}return gt(this,"shape",i),i},checks:[]});return he(e,s)}function L_(e,t){let o=e._zod.def,r=o.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=Ye(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete i[c]}return gt(this,"shape",i),i},checks:[]});return he(e,s)}function U_(e,t){if(!St(t))throw new Error("Invalid input to extend: expected a plain object");let o=e._zod.def.checks;if(o&&o.length>0){let s=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Ye(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return gt(this,"shape",s),s}});return he(e,n)}function Z_(e,t){if(!St(t))throw new Error("Invalid input to safeExtend: expected a plain object");let o=Ye(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return gt(this,"shape",r),r}});return he(e,o)}function D_(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let o=Ye(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return gt(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return he(e,o)}function V_(e,t,o){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=Ye(t._zod.def,{get shape(){let c=t._zod.def.shape,l={...c};if(o)for(let d in o){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);o[d]&&(l[d]=e?new e({type:"optional",innerType:c[d]}):c[d])}else for(let d in c)l[d]=e?new e({type:"optional",innerType:c[d]}):c[d];return gt(this,"shape",l),l},checks:[]});return he(t,i)}function H_(e,t,o){let r=Ye(t._zod.def,{get shape(){let n=t._zod.def.shape,s={...n};if(o)for(let i in o){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);o[i]&&(s[i]=new e({type:"nonoptional",innerType:n[i]}))}else for(let i in n)s[i]=new e({type:"nonoptional",innerType:n[i]});return gt(this,"shape",s),s}});return he(t,r)}function _t(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function Xl(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue===!1)return!0;return!1}function _e(e,t){return t.map(o=>{var r;return(r=o).path??(r.path=[]),o.path.unshift(e),o})}function An(e){return typeof e=="string"?e:e?.message}function me(e,t,o){let r=e.message?e.message:An(e.inst?._zod.def?.error?.(e))??An(t?.error?.(e))??An(o.customError?.(e))??An(o.localeError?.(e))??"Invalid input",{inst:n,continue:s,input:i,...c}=e;return c.path??(c.path=[]),c.message=r,t?.reportInput&&(c.input=i),c}function Zn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Dn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function eu(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 o=e;if(o&&Object.getPrototypeOf(o)!==Object.prototype&&"constructor"in o&&o.constructor)return o.constructor.name}}return t}function jo(...e){let[t,o,r]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:r}:{...t}}function F_(e){return Object.entries(e).filter(([t,o])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function _f(e){let t=atob(e),o=new Uint8Array(t.length);for(let r=0;r<t.length;r++)o[r]=t.charCodeAt(r);return o}function bf(e){let t="";for(let o=0;o<e.length;o++)t+=String.fromCharCode(e[o]);return btoa(t)}function J_(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-t.length%4)%4);return _f(t+o)}function B_(e){return bf(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function W_(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let o=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)o[r/2]=Number.parseInt(t.slice(r,r+2),16);return o}function G_(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Hl=class{constructor(...t){}};var yf=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,qo,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Vn=h("$ZodError",yf),be=h("$ZodError",yf,{Parent:Error});function Hn(e,t=o=>o.message){let o={},r=[];for(let n of e.issues)n.path.length>0?(o[n.path[0]]=o[n.path[0]]||[],o[n.path[0]].push(t(n))):r.push(t(n));return{formErrors:r,fieldErrors:o}}function Fn(e,t=o=>o.message){let o={_errors:[]},r=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(c=>r({issues:c},[...s,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...s,...i.path]);else{let c=[...s,...i.path];if(c.length===0)o._errors.push(t(i));else{let l=o,d=0;for(;d<c.length;){let m=c[d];d===c.length-1?(l[m]=l[m]||{_errors:[]},l[m]._errors.push(t(i))):l[m]=l[m]||{_errors:[]},l=l[m],d++}}}};return r(e),o}function tu(e,t=o=>o.message){let o={errors:[]},r=(n,s=[])=>{var i,c;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(d=>r({issues:d},[...s,...l.path]));else if(l.code==="invalid_key")r({issues:l.issues},[...s,...l.path]);else if(l.code==="invalid_element")r({issues:l.issues},[...s,...l.path]);else{let d=[...s,...l.path];if(d.length===0){o.errors.push(t(l));continue}let m=o,S=0;for(;S<d.length;){let _=d[S],y=S===d.length-1;typeof _=="string"?(m.properties??(m.properties={}),(i=m.properties)[_]??(i[_]={errors:[]}),m=m.properties[_]):(m.items??(m.items=[]),(c=m.items)[_]??(c[_]={errors:[]}),m=m.items[_]),y&&m.errors.push(t(l)),S++}}};return r(e),o}function zf(e){let t=[],o=e.map(r=>typeof r=="object"?r.key:r);for(let r of o)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function ou(e){let t=[],o=[...e.issues].sort((r,n)=>(r.path??[]).length-(n.path??[]).length);for(let r of o)t.push(`\u2716 ${r.message}`),r.path?.length&&t.push(` \u2192 at ${zf(r.path)}`);return t.join(`
2
- `)}var Lo=e=>(t,o,r,n)=>{let s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:o,issues:[]},s);if(i instanceof Promise)throw new Ce;if(i.issues.length){let c=new(n?.Err??e)(i.issues.map(l=>me(l,s,Y())));throw Ta(c,n?.callee),c}return i.value},Ea=Lo(be),Uo=e=>async(t,o,r,n)=>{let s=r?{...r,async:!0}:{async:!0},i=t._zod.run({value:o,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let c=new(n?.Err??e)(i.issues.map(l=>me(l,s,Y())));throw Ta(c,n?.callee),c}return i.value},$a=Uo(be),Zo=e=>(t,o,r)=>{let n=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:o,issues:[]},n);if(s instanceof Promise)throw new Ce;return s.issues.length?{success:!1,error:new(e??Vn)(s.issues.map(i=>me(i,n,Y())))}:{success:!0,data:s.value}},ru=Zo(be),Do=e=>async(t,o,r)=>{let n=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:o,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>me(i,n,Y())))}:{success:!0,data:s.value}},nu=Do(be),Ca=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Lo(e)(t,o,n)},Y_=Ca(be),Ia=e=>(t,o,r)=>Lo(e)(t,o,r),Q_=Ia(be),Oa=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Uo(e)(t,o,n)},X_=Oa(be),Na=e=>async(t,o,r)=>Uo(e)(t,o,r),eb=Na(be),Ma=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Zo(e)(t,o,n)},tb=Ma(be),qa=e=>(t,o,r)=>Zo(e)(t,o,r),ob=qa(be),Aa=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Do(e)(t,o,n)},rb=Aa(be),ja=e=>async(t,o,r)=>Do(e)(t,o,r),nb=ja(be);var Re={};Ke(Re,{base64:()=>yu,base64url:()=>La,bigint:()=>Tu,boolean:()=>Eu,browserEmail:()=>pb,cidrv4:()=>_u,cidrv6:()=>bu,cuid:()=>su,cuid2:()=>iu,date:()=>Ru,datetime:()=>xu,domain:()=>fb,duration:()=>du,e164:()=>vu,email:()=>hu,emoji:()=>mu,extendedDuration:()=>sb,guid:()=>pu,hex:()=>gb,hostname:()=>mb,html5Email:()=>lb,httpProtocol:()=>zu,idnEmail:()=>db,integer:()=>ku,ipv4:()=>fu,ipv6:()=>gu,ksuid:()=>lu,lowercase:()=>Iu,mac:()=>Su,md5_base64:()=>_b,md5_base64url:()=>bb,md5_hex:()=>Sb,nanoid:()=>uu,null:()=>$u,number:()=>Ua,rfc5322Email:()=>ub,sha1_base64:()=>zb,sha1_base64url:()=>vb,sha1_hex:()=>yb,sha256_base64:()=>wb,sha256_base64url:()=>xb,sha256_hex:()=>Rb,sha384_base64:()=>Tb,sha384_base64url:()=>kb,sha384_hex:()=>Pb,sha512_base64:()=>$b,sha512_base64url:()=>Cb,sha512_hex:()=>Eb,string:()=>Pu,time:()=>wu,ulid:()=>au,undefined:()=>Cu,unicodeEmail:()=>vf,uppercase:()=>Ou,uuid:()=>Gt,uuid4:()=>ib,uuid6:()=>ab,uuid7:()=>cb,xid:()=>cu});var su=/^[cC][0-9a-z]{6,}$/,iu=/^[0-9a-z]+$/,au=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,cu=/^[0-9a-vA-V]{20}$/,lu=/^[A-Za-z0-9]{27}$/,uu=/^[a-zA-Z0-9_-]{21}$/,du=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sb=/^[-+]?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)?)??$/,pu=/^([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})$/,Gt=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)$/,ib=Gt(4),ab=Gt(6),cb=Gt(7),hu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lb=/^[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])?)*$/,ub=/^(([^<>()\[\]\\.,;:\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,}))$/,vf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,db=vf,pb=/^[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])?)*$/,hb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function mu(){return new RegExp(hb,"u")}var fu=/^(?:(?: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])$/,gu=/^(([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}|:))$/,Su=e=>{let t=ke(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},_u=/^((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])$/,bu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,La=/^[A-Za-z0-9_-]*$/,mb=/^(?=.{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])?)*\.?$/,fb=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,zu=/^https?$/,vu=/^\+[1-9]\d{6,14}$/,Rf="(?:(?:\\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])))",Ru=new RegExp(`^${Rf}$`);function wf(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}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function wu(e){return new RegExp(`^${wf(e)}$`)}function xu(e){let t=wf({precision:e.precision}),o=["Z"];e.local&&o.push(""),e.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${o.join("|")})`;return new RegExp(`^${Rf}T(?:${r})$`)}var Pu=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Tu=/^-?\d+n?$/,ku=/^-?\d+$/,Ua=/^-?\d+(?:\.\d+)?$/,Eu=/^(?:true|false)$/i,$u=/^null$/i;var Cu=/^undefined$/i;var Iu=/^[^A-Z]*$/,Ou=/^[^a-z]*$/,gb=/^[0-9a-fA-F]*$/;function Jn(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Bn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Sb=/^[0-9a-fA-F]{32}$/,_b=Jn(22,"=="),bb=Bn(22),yb=/^[0-9a-fA-F]{40}$/,zb=Jn(27,"="),vb=Bn(27),Rb=/^[0-9a-fA-F]{64}$/,wb=Jn(43,"="),xb=Bn(43),Pb=/^[0-9a-fA-F]{96}$/,Tb=Jn(64,""),kb=Bn(64),Eb=/^[0-9a-fA-F]{128}$/,$b=Jn(86,"=="),Cb=Bn(86);var H=h("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),Pf={number:"number",bigint:"bigint",object:"date"},Za=h("$ZodCheckLessThan",(e,t)=>{H.init(e,t);let o=Pf[typeof t.value];e._zod.onattach.push(r=>{let n=r._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:o,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Da=h("$ZodCheckGreaterThan",(e,t)=>{H.init(e,t);let o=Pf[typeof t.value];e._zod.onattach.push(r=>{let n=r._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:o,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Nu=h("$ZodCheckMultipleOf",(e,t)=>{H.init(e,t),e._zod.onattach.push(o=>{var r;(r=o._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=o=>{if(typeof o.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof o.value=="bigint"?o.value%t.value===BigInt(0):Fl(o.value,t.value)===0)||o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:t.value,input:o.value,inst:e,continue:!t.abort})}}),Mu=h("$ZodCheckNumberFormat",(e,t)=>{H.init(e,t),t.format=t.format||"float64";let o=t.format?.includes("int"),r=o?"int":"number",[n,s]=Yl[t.format];e._zod.onattach.push(i=>{let c=i._zod.bag;c.format=t.format,c.minimum=n,c.maximum=s,o&&(c.pattern=ku)}),e._zod.check=i=>{let c=i.value;if(o){if(!Number.isInteger(c)){i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?i.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):i.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<n&&i.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>s&&i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),qu=h("$ZodCheckBigIntFormat",(e,t)=>{H.init(e,t);let[o,r]=Ql[t.format];e._zod.onattach.push(n=>{let s=n._zod.bag;s.format=t.format,s.minimum=o,s.maximum=r}),e._zod.check=n=>{let s=n.value;s<o&&n.issues.push({origin:"bigint",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>r&&n.issues.push({origin:"bigint",input:s,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Au=h("$ZodCheckMaxSize",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!ft(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:Zn(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ju=h("$ZodCheckMinSize",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!ft(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:Zn(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Lu=h("$ZodCheckSizeEquals",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!ft(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=r=>{let n=r.value,s=n.size;if(s===t.size)return;let i=s>t.size;r.issues.push({origin:Zn(n),...i?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Uu=h("$ZodCheckMaxLength",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!ft(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let i=Dn(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Zu=h("$ZodCheckMinLength",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!ft(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let i=Dn(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Du=h("$ZodCheckLengthEquals",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!ft(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=r=>{let n=r.value,s=n.length;if(s===t.length)return;let i=Dn(n),c=s>t.length;r.issues.push({origin:i,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Vo=h("$ZodCheckStringFormat",(e,t)=>{var o,r;H.init(e,t),e._zod.onattach.push(n=>{let s=n._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(o=e._zod).check??(o.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Vu=h("$ZodCheckRegex",(e,t)=>{Vo.init(e,t),e._zod.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Hu=h("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Iu),Vo.init(e,t)}),Fu=h("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ou),Vo.init(e,t)}),Ju=h("$ZodCheckIncludes",(e,t)=>{H.init(e,t);let o=ke(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${o}`:o);t.pattern=r,e._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Bu=h("$ZodCheckStartsWith",(e,t)=>{H.init(e,t);let o=new RegExp(`^${ke(t.prefix)}.*`);t.pattern??(t.pattern=o),e._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(o)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Wu=h("$ZodCheckEndsWith",(e,t)=>{H.init(e,t);let o=new RegExp(`.*${ke(t.suffix)}$`);t.pattern??(t.pattern=o),e._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(o)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function xf(e,t,o){e.issues.length&&t.issues.push(..._e(o,e.issues))}var Gu=h("$ZodCheckProperty",(e,t)=>{H.init(e,t),e._zod.check=o=>{let r=t.schema._zod.run({value:o.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(n=>xf(n,o,t.property));xf(r,o,t.property)}}),Ku=h("$ZodCheckMimeType",(e,t)=>{H.init(e,t);let o=new Set(t.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=t.mime}),e._zod.check=r=>{o.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),Yu=h("$ZodCheckOverwrite",(e,t)=>{H.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});var Wn=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(`
1
+ var y_=Object.defineProperty;var Ke=(e,t)=>{for(var o in t)y_(e,o,{get:t[o],enumerable:!0})};var z_=Object.create,wa=Object.defineProperty,v_=Object.getOwnPropertyDescriptor,R_=Object.getOwnPropertyNames,w_=Object.getPrototypeOf,x_=Object.prototype.hasOwnProperty,pf=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hf=(e,t)=>{let o={};for(var r in e)wa(o,r,{get:e[r],enumerable:!0});return t&&wa(o,Symbol.toStringTag,{value:"Module"}),o},P_=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=R_(t),s=0,i=n.length,c;s<i;s++)c=n[s],!x_.call(e,c)&&c!==o&&wa(e,c,{get:(l=>t[l]).bind(null,c),enumerable:!(r=v_(t,c))||r.enumerable});return e},mf=(e,t,o)=>(o=e!=null?z_(w_(e)):{},P_(t||!e||!e.__esModule?wa(o,"default",{value:e,enumerable:!0}):o,e));var T_=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]);function ff(e){return typeof e=="string"&&T_.has(e.replace(/#$/,""))}var u={};Ke(u,{$brand:()=>Dl,$input:()=>up,$output:()=>lp,NEVER:()=>qn,TimePrecision:()=>mp,ZodAny:()=>Xh,ZodArray:()=>rm,ZodBase64:()=>Yc,ZodBase64URL:()=>Qc,ZodBigInt:()=>pr,ZodBigIntFormat:()=>tl,ZodBoolean:()=>dr,ZodCIDRv4:()=>Gc,ZodCIDRv6:()=>Kc,ZodCUID:()=>Dc,ZodCUID2:()=>Vc,ZodCatch:()=>Rm,ZodCodec:()=>ds,ZodCustom:()=>ps,ZodCustomStringFormat:()=>lr,ZodDate:()=>as,ZodDefault:()=>Sm,ZodDiscriminatedUnion:()=>sm,ZodE164:()=>Xc,ZodEmail:()=>jc,ZodEmoji:()=>Uc,ZodEnum:()=>ir,ZodError:()=>ly,ZodExactOptional:()=>mm,ZodFile:()=>pm,ZodFirstPartyTypeKind:()=>Mm,ZodFunction:()=>Im,ZodGUID:()=>rs,ZodIPv4:()=>Bc,ZodIPv6:()=>Wc,ZodISODate:()=>Ic,ZodISODateTime:()=>Cc,ZodISODuration:()=>Nc,ZodISOTime:()=>Oc,ZodIntersection:()=>im,ZodIssueCode:()=>qm,ZodJWT:()=>el,ZodKSUID:()=>Jc,ZodLazy:()=>Em,ZodLiteral:()=>dm,ZodMAC:()=>Gh,ZodMap:()=>lm,ZodNaN:()=>xm,ZodNanoID:()=>Zc,ZodNever:()=>tm,ZodNonOptional:()=>il,ZodNull:()=>Qh,ZodNullable:()=>gm,ZodNumber:()=>ur,ZodNumberFormat:()=>oo,ZodObject:()=>cs,ZodOptional:()=>sl,ZodPipe:()=>us,ZodPrefault:()=>bm,ZodPreprocess:()=>Pm,ZodPromise:()=>Cm,ZodReadonly:()=>Tm,ZodRealError:()=>ye,ZodRecord:()=>sr,ZodSet:()=>um,ZodString:()=>ar,ZodStringFormat:()=>V,ZodSuccess:()=>vm,ZodSymbol:()=>Kh,ZodTemplateLiteral:()=>$m,ZodTransform:()=>hm,ZodTuple:()=>am,ZodType:()=>M,ZodULID:()=>Hc,ZodURL:()=>is,ZodUUID:()=>Ue,ZodUndefined:()=>Yh,ZodUnion:()=>ls,ZodUnknown:()=>em,ZodVoid:()=>om,ZodXID:()=>Fc,ZodXor:()=>nm,_ZodString:()=>Ac,_default:()=>_m,_function:()=>Yg,any:()=>ol,array:()=>f,base64:()=>gg,base64url:()=>Sg,bigint:()=>kg,boolean:()=>R,catch:()=>wm,check:()=>Qg,cidrv4:()=>mg,cidrv6:()=>fg,clone:()=>he,codec:()=>Bg,coerce:()=>hs,config:()=>Y,core:()=>Xe,cuid:()=>ig,cuid2:()=>ag,custom:()=>Xg,date:()=>Ng,decode:()=>Dh,decodeAsync:()=>Hh,describe:()=>eS,discriminatedUnion:()=>wt,e164:()=>_g,email:()=>Lc,emoji:()=>ng,encode:()=>Zh,encodeAsync:()=>Vh,endsWith:()=>Ko,enum:()=>I,exactOptional:()=>fm,file:()=>Vg,flattenError:()=>Hn,float32:()=>wg,float64:()=>xg,formatError:()=>Fn,fromJSONSchema:()=>iS,function:()=>Yg,getErrorMap:()=>py,globalRegistry:()=>re,gt:()=>je,gte:()=>fe,guid:()=>Qf,hash:()=>Rg,hex:()=>vg,hostname:()=>zg,httpUrl:()=>rg,includes:()=>Wo,instanceof:()=>oS,int:()=>Mc,int32:()=>Pg,int64:()=>$g,intersection:()=>Oe,invertCodec:()=>Wg,ipv4:()=>dg,ipv6:()=>hg,iso:()=>xe,json:()=>nS,jwt:()=>bg,keyof:()=>Mg,ksuid:()=>ug,lazy:()=>xt,length:()=>eo,literal:()=>g,locales:()=>Qn,looseObject:()=>E,looseRecord:()=>Lg,lowercase:()=>Jo,lt:()=>Ae,lte:()=>we,mac:()=>pg,map:()=>Ug,maxLength:()=>Xt,maxSize:()=>yt,meta:()=>tS,mime:()=>Yo,minLength:()=>Qe,minSize:()=>Le,multipleOf:()=>bt,nan:()=>Jg,nanoid:()=>sg,nativeEnum:()=>Dg,negative:()=>vc,never:()=>rl,nonnegative:()=>wc,nonoptional:()=>zm,nonpositive:()=>Rc,normalize:()=>Qo,null:()=>Ze,nullable:()=>ns,nullish:()=>Hg,number:()=>y,object:()=>p,optional:()=>k,overwrite:()=>Ie,parse:()=>jh,parseAsync:()=>Lh,partialRecord:()=>jg,pipe:()=>qc,positive:()=>zc,prefault:()=>ym,preprocess:()=>et,prettifyError:()=>ou,promise:()=>Kg,property:()=>xc,readonly:()=>km,record:()=>v,refine:()=>Om,regex:()=>Fo,regexes:()=>Re,registry:()=>ec,safeDecode:()=>Jh,safeDecodeAsync:()=>Wh,safeEncode:()=>Fh,safeEncodeAsync:()=>Bh,safeParse:()=>os,safeParseAsync:()=>Uh,set:()=>Zg,setErrorMap:()=>dy,size:()=>Qt,slugify:()=>or,startsWith:()=>Go,strictObject:()=>qg,string:()=>a,stringFormat:()=>yg,stringbool:()=>rS,success:()=>Fg,superRefine:()=>Nm,symbol:()=>Cg,templateLiteral:()=>Gg,toJSONSchema:()=>to,toLowerCase:()=>er,toUpperCase:()=>tr,transform:()=>nl,treeifyError:()=>tu,trim:()=>Xo,tuple:()=>cm,uint32:()=>Tg,uint64:()=>Eg,ulid:()=>cg,undefined:()=>Ig,union:()=>x,unknown:()=>T,uppercase:()=>Bo,url:()=>cr,util:()=>O,uuid:()=>Xf,uuidv4:()=>eg,uuidv6:()=>tg,uuidv7:()=>og,void:()=>Og,xid:()=>lg,xor:()=>Ag});var Xe={};Ke(Xe,{$ZodAny:()=>Cd,$ZodArray:()=>qd,$ZodAsyncError:()=>Ce,$ZodBase64:()=>zd,$ZodBase64URL:()=>vd,$ZodBigInt:()=>Wa,$ZodBigIntFormat:()=>Td,$ZodBoolean:()=>Gn,$ZodCIDRv4:()=>_d,$ZodCIDRv6:()=>bd,$ZodCUID:()=>id,$ZodCUID2:()=>ad,$ZodCatch:()=>ep,$ZodCheck:()=>H,$ZodCheckBigIntFormat:()=>qu,$ZodCheckEndsWith:()=>Wu,$ZodCheckGreaterThan:()=>Da,$ZodCheckIncludes:()=>Ju,$ZodCheckLengthEquals:()=>Du,$ZodCheckLessThan:()=>Za,$ZodCheckLowerCase:()=>Hu,$ZodCheckMaxLength:()=>Uu,$ZodCheckMaxSize:()=>Au,$ZodCheckMimeType:()=>Ku,$ZodCheckMinLength:()=>Zu,$ZodCheckMinSize:()=>ju,$ZodCheckMultipleOf:()=>Nu,$ZodCheckNumberFormat:()=>Mu,$ZodCheckOverwrite:()=>Yu,$ZodCheckProperty:()=>Gu,$ZodCheckRegex:()=>Vu,$ZodCheckSizeEquals:()=>Lu,$ZodCheckStartsWith:()=>Bu,$ZodCheckStringFormat:()=>Ho,$ZodCheckUpperCase:()=>Fu,$ZodCodec:()=>Yn,$ZodCustom:()=>cp,$ZodCustomStringFormat:()=>xd,$ZodDate:()=>Md,$ZodDefault:()=>Kd,$ZodDiscriminatedUnion:()=>Ld,$ZodE164:()=>Rd,$ZodEmail:()=>od,$ZodEmoji:()=>nd,$ZodEncodeError:()=>mt,$ZodEnum:()=>Hd,$ZodError:()=>Vn,$ZodExactOptional:()=>Wd,$ZodFile:()=>Jd,$ZodFunction:()=>sp,$ZodGUID:()=>ed,$ZodIPv4:()=>fd,$ZodIPv6:()=>gd,$ZodISODate:()=>pd,$ZodISODateTime:()=>dd,$ZodISODuration:()=>md,$ZodISOTime:()=>hd,$ZodIntersection:()=>Ud,$ZodJWT:()=>wd,$ZodKSUID:()=>ud,$ZodLazy:()=>ap,$ZodLiteral:()=>Fd,$ZodMAC:()=>Sd,$ZodMap:()=>Dd,$ZodNaN:()=>tp,$ZodNanoID:()=>sd,$ZodNever:()=>Od,$ZodNonOptional:()=>Qd,$ZodNull:()=>Ed,$ZodNullable:()=>Gd,$ZodNumber:()=>Ba,$ZodNumberFormat:()=>Pd,$ZodObject:()=>Jf,$ZodObjectJIT:()=>Ad,$ZodOptional:()=>Ka,$ZodPipe:()=>Ya,$ZodPrefault:()=>Yd,$ZodPreprocess:()=>op,$ZodPromise:()=>ip,$ZodReadonly:()=>rp,$ZodRealError:()=>be,$ZodRecord:()=>Zd,$ZodRegistry:()=>Xa,$ZodSet:()=>Vd,$ZodString:()=>Yt,$ZodStringFormat:()=>D,$ZodSuccess:()=>Xd,$ZodSymbol:()=>kd,$ZodTemplateLiteral:()=>np,$ZodTransform:()=>Bd,$ZodTuple:()=>Ga,$ZodType:()=>N,$ZodULID:()=>cd,$ZodURL:()=>rd,$ZodUUID:()=>td,$ZodUndefined:()=>$d,$ZodUnion:()=>Kn,$ZodUnknown:()=>Id,$ZodVoid:()=>Nd,$ZodXID:()=>ld,$ZodXor:()=>jd,$brand:()=>Dl,$constructor:()=>h,$input:()=>up,$output:()=>lp,Doc:()=>Wn,JSONSchema:()=>Gf,JSONSchemaGenerator:()=>$c,NEVER:()=>qn,TimePrecision:()=>mp,_any:()=>Mp,_array:()=>Dp,_base64:()=>Sc,_base64url:()=>_c,_bigint:()=>kp,_boolean:()=>Pp,_catch:()=>ty,_check:()=>Wf,_cidrv4:()=>fc,_cidrv6:()=>gc,_coercedBigint:()=>$p,_coercedBoolean:()=>Tp,_coercedDate:()=>Up,_coercedNumber:()=>yp,_coercedString:()=>pp,_cuid:()=>cc,_cuid2:()=>lc,_custom:()=>Hp,_date:()=>Lp,_decode:()=>Ia,_decodeAsync:()=>Na,_default:()=>Qb,_discriminatedUnion:()=>Ub,_e164:()=>bc,_email:()=>tc,_emoji:()=>ic,_encode:()=>Ca,_encodeAsync:()=>Oa,_endsWith:()=>Ko,_enum:()=>Jb,_file:()=>Vp,_float32:()=>vp,_float64:()=>Rp,_gt:()=>je,_gte:()=>fe,_guid:()=>Xn,_includes:()=>Wo,_int:()=>zp,_int32:()=>wp,_int64:()=>Ep,_intersection:()=>Zb,_ipv4:()=>hc,_ipv6:()=>mc,_isoDate:()=>gp,_isoDateTime:()=>fp,_isoDuration:()=>_p,_isoTime:()=>Sp,_jwt:()=>yc,_ksuid:()=>pc,_lazy:()=>sy,_length:()=>eo,_literal:()=>Wb,_lowercase:()=>Jo,_lt:()=>Ae,_lte:()=>we,_mac:()=>hp,_map:()=>Hb,_max:()=>we,_maxLength:()=>Xt,_maxSize:()=>yt,_mime:()=>Yo,_min:()=>fe,_minLength:()=>Qe,_minSize:()=>Le,_multipleOf:()=>bt,_nan:()=>Zp,_nanoid:()=>ac,_nativeEnum:()=>Bb,_negative:()=>vc,_never:()=>Ap,_nonnegative:()=>wc,_nonoptional:()=>Xb,_nonpositive:()=>Rc,_normalize:()=>Qo,_null:()=>Np,_nullable:()=>Yb,_number:()=>bp,_optional:()=>Kb,_overwrite:()=>Ie,_parse:()=>Uo,_parseAsync:()=>Zo,_pipe:()=>oy,_positive:()=>zc,_promise:()=>iy,_property:()=>xc,_readonly:()=>ry,_record:()=>Vb,_refine:()=>Fp,_regex:()=>Fo,_safeDecode:()=>qa,_safeDecodeAsync:()=>ja,_safeEncode:()=>Ma,_safeEncodeAsync:()=>Aa,_safeParse:()=>Do,_safeParseAsync:()=>Vo,_set:()=>Fb,_size:()=>Qt,_slugify:()=>or,_startsWith:()=>Go,_string:()=>dp,_stringFormat:()=>rr,_stringbool:()=>Gp,_success:()=>ey,_superRefine:()=>Jp,_symbol:()=>Ip,_templateLiteral:()=>ny,_toLowerCase:()=>er,_toUpperCase:()=>tr,_transform:()=>Gb,_trim:()=>Xo,_tuple:()=>Db,_uint32:()=>xp,_uint64:()=>Cp,_ulid:()=>uc,_undefined:()=>Op,_union:()=>jb,_unknown:()=>qp,_uppercase:()=>Bo,_url:()=>es,_uuid:()=>oc,_uuidv4:()=>rc,_uuidv6:()=>nc,_uuidv7:()=>sc,_void:()=>jp,_xid:()=>dc,_xor:()=>Lb,clone:()=>he,config:()=>Y,createStandardJSONSchemaMethod:()=>nr,createToJSONSchemaMethod:()=>Kp,decode:()=>tb,decodeAsync:()=>rb,describe:()=>Bp,encode:()=>eb,encodeAsync:()=>ob,extractDefs:()=>vt,finalize:()=>Rt,flattenError:()=>Hn,formatError:()=>Fn,globalConfig:()=>Wt,globalRegistry:()=>re,initializeContext:()=>zt,isValidBase64:()=>yd,isValidBase64URL:()=>Df,isValidJWT:()=>Vf,locales:()=>Qn,meta:()=>Wp,parse:()=>$a,parseAsync:()=>Ea,prettifyError:()=>ou,process:()=>Z,regexes:()=>Re,registry:()=>ec,safeDecode:()=>sb,safeDecodeAsync:()=>ab,safeEncode:()=>nb,safeEncodeAsync:()=>ib,safeParse:()=>ru,safeParseAsync:()=>nu,toDotPath:()=>zf,toJSONSchema:()=>to,treeifyError:()=>tu,util:()=>O,version:()=>Qu});var gf,qn=Object.freeze({status:"aborted"});function h(e,t,o){function r(c,l){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:l,constr:i,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,l);let d=i.prototype,m=Object.keys(d);for(let S=0;S<m.length;S++){let _=m[S];_ in c||(c[_]=d[_].bind(c))}}let n=o?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function i(c){var l;let d=o?.Parent?new s:this;r(d,c),(l=d._zod).deferred??(l.deferred=[]);for(let m of d._zod.deferred)m();return d}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:c=>o?.Parent&&c instanceof o.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}var Dl=Symbol("zod_brand"),Ce=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},mt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(gf=globalThis).__zod_globalConfig??(gf.__zod_globalConfig={});var Wt=globalThis.__zod_globalConfig;function Y(e){return e&&Object.assign(Wt,e),Wt}var O={};Ke(O,{BIGINT_FORMAT_RANGES:()=>Ql,Class:()=>Hl,NUMBER_FORMAT_RANGES:()=>Yl,aborted:()=>_t,allowsEval:()=>Bl,assert:()=>I_,assertEqual:()=>k_,assertIs:()=>E_,assertNever:()=>C_,assertNotEqual:()=>$_,assignProp:()=>gt,base64ToUint8Array:()=>_f,base64urlToUint8Array:()=>G_,cached:()=>jo,captureStackTrace:()=>Ta,cleanEnum:()=>W_,cleanRegex:()=>Ln,clone:()=>he,cloneDef:()=>N_,createTransparentProxy:()=>U_,defineLazy:()=>A,esc:()=>Pa,escapeRegex:()=>ke,explicitlyAborted:()=>Xl,extend:()=>V_,finalizeIssue:()=>me,floatSafeRemainder:()=>Fl,getElementAtPath:()=>M_,getEnumValues:()=>jn,getLengthableOrigin:()=>Dn,getParsedType:()=>L_,getSizableOrigin:()=>Zn,hexToUint8Array:()=>Y_,isObject:()=>Gt,isPlainObject:()=>St,issue:()=>Lo,joinValues:()=>xa,jsonStringifyReplacer:()=>Ao,merge:()=>F_,mergeDefs:()=>Ye,normalizeParams:()=>z,nullish:()=>ft,numKeys:()=>j_,objectClone:()=>O_,omit:()=>D_,optionalKeys:()=>Kl,parsedType:()=>eu,partial:()=>J_,pick:()=>Z_,prefixIssues:()=>_e,primitiveTypes:()=>Gl,promiseAllObject:()=>q_,propertyKeyTypes:()=>Un,randomString:()=>A_,required:()=>B_,safeExtend:()=>H_,shallowClone:()=>Wl,slugify:()=>Jl,stringifyPrimitive:()=>ka,uint8ArrayToBase64:()=>bf,uint8ArrayToBase64url:()=>K_,uint8ArrayToHex:()=>Q_,unwrapMessage:()=>An});function k_(e){return e}function $_(e){return e}function E_(e){}function C_(e){throw new Error("Unexpected value in exhaustive check")}function I_(e){}function jn(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,n])=>t.indexOf(+r)===-1).map(([r,n])=>n)}function xa(e,t="|"){return e.map(o=>ka(o)).join(t)}function Ao(e,t){return typeof t=="bigint"?t.toString():t}function jo(e){return{get value(){{let o=e();return Object.defineProperty(this,"value",{value:o}),o}throw new Error("cached value already set")}}}function ft(e){return e==null}function Ln(e){let t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function Fl(e,t){let o=e/t,r=Math.round(o),n=Number.EPSILON*Math.max(Math.abs(o),1);return Math.abs(o-r)<n?0:o-r}var Sf=Symbol("evaluating");function A(e,t,o){let r;Object.defineProperty(e,t,{get(){if(r!==Sf)return r===void 0&&(r=Sf,r=o()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function O_(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function gt(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function Ye(...e){let t={};for(let o of e){let r=Object.getOwnPropertyDescriptors(o);Object.assign(t,r)}return Object.defineProperties({},t)}function N_(e){return Ye(e._zod.def)}function M_(e,t){return t?t.reduce((o,r)=>o?.[r],e):e}function q_(e){let t=Object.keys(e),o=t.map(r=>e[r]);return Promise.all(o).then(r=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=r[s];return n})}function A_(e=10){let t="abcdefghijklmnopqrstuvwxyz",o="";for(let r=0;r<e;r++)o+=t[Math.floor(Math.random()*t.length)];return o}function Pa(e){return JSON.stringify(e)}function Jl(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ta="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Gt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Bl=jo(()=>{if(Wt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function St(e){if(Gt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let o=t.prototype;return!(Gt(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function Wl(e){return St(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function j_(e){let t=0;for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&t++;return t}var L_=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}`)}},Un=new Set(["string","number","symbol"]),Gl=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function he(e,t,o){let r=new e._zod.constr(t??e._zod.def);return(!t||o?.parent)&&(r._zod.parent=e),r}function z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};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:()=>t.error}:t}function U_(e){let t;return new Proxy({},{get(o,r,n){return t??(t=e()),Reflect.get(t,r,n)},set(o,r,n,s){return t??(t=e()),Reflect.set(t,r,n,s)},has(o,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(o,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(o){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(o,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(o,r,n){return t??(t=e()),Reflect.defineProperty(t,r,n)}})}function ka(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Kl(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Yl={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]},Ql={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Z_(e,t){let o=e._zod.def,r=o.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=Ye(e._zod.def,{get shape(){let i={};for(let c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(i[c]=o.shape[c])}return gt(this,"shape",i),i},checks:[]});return he(e,s)}function D_(e,t){let o=e._zod.def,r=o.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=Ye(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete i[c]}return gt(this,"shape",i),i},checks:[]});return he(e,s)}function V_(e,t){if(!St(t))throw new Error("Invalid input to extend: expected a plain object");let o=e._zod.def.checks;if(o&&o.length>0){let s=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Ye(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return gt(this,"shape",s),s}});return he(e,n)}function H_(e,t){if(!St(t))throw new Error("Invalid input to safeExtend: expected a plain object");let o=Ye(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return gt(this,"shape",r),r}});return he(e,o)}function F_(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let o=Ye(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return gt(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return he(e,o)}function J_(e,t,o){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=Ye(t._zod.def,{get shape(){let c=t._zod.def.shape,l={...c};if(o)for(let d in o){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);o[d]&&(l[d]=e?new e({type:"optional",innerType:c[d]}):c[d])}else for(let d in c)l[d]=e?new e({type:"optional",innerType:c[d]}):c[d];return gt(this,"shape",l),l},checks:[]});return he(t,i)}function B_(e,t,o){let r=Ye(t._zod.def,{get shape(){let n=t._zod.def.shape,s={...n};if(o)for(let i in o){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);o[i]&&(s[i]=new e({type:"nonoptional",innerType:n[i]}))}else for(let i in n)s[i]=new e({type:"nonoptional",innerType:n[i]});return gt(this,"shape",s),s}});return he(t,r)}function _t(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function Xl(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue===!1)return!0;return!1}function _e(e,t){return t.map(o=>{var r;return(r=o).path??(r.path=[]),o.path.unshift(e),o})}function An(e){return typeof e=="string"?e:e?.message}function me(e,t,o){let r=e.message?e.message:An(e.inst?._zod.def?.error?.(e))??An(t?.error?.(e))??An(o.customError?.(e))??An(o.localeError?.(e))??"Invalid input",{inst:n,continue:s,input:i,...c}=e;return c.path??(c.path=[]),c.message=r,t?.reportInput&&(c.input=i),c}function Zn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Dn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function eu(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 o=e;if(o&&Object.getPrototypeOf(o)!==Object.prototype&&"constructor"in o&&o.constructor)return o.constructor.name}}return t}function Lo(...e){let[t,o,r]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:r}:{...t}}function W_(e){return Object.entries(e).filter(([t,o])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function _f(e){let t=atob(e),o=new Uint8Array(t.length);for(let r=0;r<t.length;r++)o[r]=t.charCodeAt(r);return o}function bf(e){let t="";for(let o=0;o<e.length;o++)t+=String.fromCharCode(e[o]);return btoa(t)}function G_(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-t.length%4)%4);return _f(t+o)}function K_(e){return bf(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Y_(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let o=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)o[r/2]=Number.parseInt(t.slice(r,r+2),16);return o}function Q_(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Hl=class{constructor(...t){}};var yf=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ao,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Vn=h("$ZodError",yf),be=h("$ZodError",yf,{Parent:Error});function Hn(e,t=o=>o.message){let o={},r=[];for(let n of e.issues)n.path.length>0?(o[n.path[0]]=o[n.path[0]]||[],o[n.path[0]].push(t(n))):r.push(t(n));return{formErrors:r,fieldErrors:o}}function Fn(e,t=o=>o.message){let o={_errors:[]},r=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(c=>r({issues:c},[...s,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...s,...i.path]);else{let c=[...s,...i.path];if(c.length===0)o._errors.push(t(i));else{let l=o,d=0;for(;d<c.length;){let m=c[d];d===c.length-1?(l[m]=l[m]||{_errors:[]},l[m]._errors.push(t(i))):l[m]=l[m]||{_errors:[]},l=l[m],d++}}}};return r(e),o}function tu(e,t=o=>o.message){let o={errors:[]},r=(n,s=[])=>{var i,c;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(d=>r({issues:d},[...s,...l.path]));else if(l.code==="invalid_key")r({issues:l.issues},[...s,...l.path]);else if(l.code==="invalid_element")r({issues:l.issues},[...s,...l.path]);else{let d=[...s,...l.path];if(d.length===0){o.errors.push(t(l));continue}let m=o,S=0;for(;S<d.length;){let _=d[S],b=S===d.length-1;typeof _=="string"?(m.properties??(m.properties={}),(i=m.properties)[_]??(i[_]={errors:[]}),m=m.properties[_]):(m.items??(m.items=[]),(c=m.items)[_]??(c[_]={errors:[]}),m=m.items[_]),b&&m.errors.push(t(l)),S++}}};return r(e),o}function zf(e){let t=[],o=e.map(r=>typeof r=="object"?r.key:r);for(let r of o)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function ou(e){let t=[],o=[...e.issues].sort((r,n)=>(r.path??[]).length-(n.path??[]).length);for(let r of o)t.push(`\u2716 ${r.message}`),r.path?.length&&t.push(` \u2192 at ${zf(r.path)}`);return t.join(`
2
+ `)}var Uo=e=>(t,o,r,n)=>{let s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:o,issues:[]},s);if(i instanceof Promise)throw new Ce;if(i.issues.length){let c=new(n?.Err??e)(i.issues.map(l=>me(l,s,Y())));throw Ta(c,n?.callee),c}return i.value},$a=Uo(be),Zo=e=>async(t,o,r,n)=>{let s=r?{...r,async:!0}:{async:!0},i=t._zod.run({value:o,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let c=new(n?.Err??e)(i.issues.map(l=>me(l,s,Y())));throw Ta(c,n?.callee),c}return i.value},Ea=Zo(be),Do=e=>(t,o,r)=>{let n=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:o,issues:[]},n);if(s instanceof Promise)throw new Ce;return s.issues.length?{success:!1,error:new(e??Vn)(s.issues.map(i=>me(i,n,Y())))}:{success:!0,data:s.value}},ru=Do(be),Vo=e=>async(t,o,r)=>{let n=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:o,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>me(i,n,Y())))}:{success:!0,data:s.value}},nu=Vo(be),Ca=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Uo(e)(t,o,n)},eb=Ca(be),Ia=e=>(t,o,r)=>Uo(e)(t,o,r),tb=Ia(be),Oa=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Zo(e)(t,o,n)},ob=Oa(be),Na=e=>async(t,o,r)=>Zo(e)(t,o,r),rb=Na(be),Ma=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Do(e)(t,o,n)},nb=Ma(be),qa=e=>(t,o,r)=>Do(e)(t,o,r),sb=qa(be),Aa=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Vo(e)(t,o,n)},ib=Aa(be),ja=e=>async(t,o,r)=>Vo(e)(t,o,r),ab=ja(be);var Re={};Ke(Re,{base64:()=>yu,base64url:()=>La,bigint:()=>Tu,boolean:()=>$u,browserEmail:()=>fb,cidrv4:()=>_u,cidrv6:()=>bu,cuid:()=>su,cuid2:()=>iu,date:()=>Ru,datetime:()=>xu,domain:()=>_b,duration:()=>du,e164:()=>vu,email:()=>hu,emoji:()=>mu,extendedDuration:()=>cb,guid:()=>pu,hex:()=>bb,hostname:()=>Sb,html5Email:()=>pb,httpProtocol:()=>zu,idnEmail:()=>mb,integer:()=>ku,ipv4:()=>fu,ipv6:()=>gu,ksuid:()=>lu,lowercase:()=>Iu,mac:()=>Su,md5_base64:()=>zb,md5_base64url:()=>vb,md5_hex:()=>yb,nanoid:()=>uu,null:()=>Eu,number:()=>Ua,rfc5322Email:()=>hb,sha1_base64:()=>wb,sha1_base64url:()=>xb,sha1_hex:()=>Rb,sha256_base64:()=>Tb,sha256_base64url:()=>kb,sha256_hex:()=>Pb,sha384_base64:()=>Eb,sha384_base64url:()=>Cb,sha384_hex:()=>$b,sha512_base64:()=>Ob,sha512_base64url:()=>Nb,sha512_hex:()=>Ib,string:()=>Pu,time:()=>wu,ulid:()=>au,undefined:()=>Cu,unicodeEmail:()=>vf,uppercase:()=>Ou,uuid:()=>Kt,uuid4:()=>lb,uuid6:()=>ub,uuid7:()=>db,xid:()=>cu});var su=/^[cC][0-9a-z]{6,}$/,iu=/^[0-9a-z]+$/,au=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,cu=/^[0-9a-vA-V]{20}$/,lu=/^[A-Za-z0-9]{27}$/,uu=/^[a-zA-Z0-9_-]{21}$/,du=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cb=/^[-+]?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)?)??$/,pu=/^([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})$/,Kt=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)$/,lb=Kt(4),ub=Kt(6),db=Kt(7),hu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,pb=/^[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])?)*$/,hb=/^(([^<>()\[\]\\.,;:\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,}))$/,vf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,mb=vf,fb=/^[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])?)*$/,gb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function mu(){return new RegExp(gb,"u")}var fu=/^(?:(?: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])$/,gu=/^(([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}|:))$/,Su=e=>{let t=ke(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},_u=/^((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])$/,bu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,La=/^[A-Za-z0-9_-]*$/,Sb=/^(?=.{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])?)*\.?$/,_b=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,zu=/^https?$/,vu=/^\+[1-9]\d{6,14}$/,Rf="(?:(?:\\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])))",Ru=new RegExp(`^${Rf}$`);function wf(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}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function wu(e){return new RegExp(`^${wf(e)}$`)}function xu(e){let t=wf({precision:e.precision}),o=["Z"];e.local&&o.push(""),e.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${o.join("|")})`;return new RegExp(`^${Rf}T(?:${r})$`)}var Pu=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Tu=/^-?\d+n?$/,ku=/^-?\d+$/,Ua=/^-?\d+(?:\.\d+)?$/,$u=/^(?:true|false)$/i,Eu=/^null$/i;var Cu=/^undefined$/i;var Iu=/^[^A-Z]*$/,Ou=/^[^a-z]*$/,bb=/^[0-9a-fA-F]*$/;function Jn(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Bn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var yb=/^[0-9a-fA-F]{32}$/,zb=Jn(22,"=="),vb=Bn(22),Rb=/^[0-9a-fA-F]{40}$/,wb=Jn(27,"="),xb=Bn(27),Pb=/^[0-9a-fA-F]{64}$/,Tb=Jn(43,"="),kb=Bn(43),$b=/^[0-9a-fA-F]{96}$/,Eb=Jn(64,""),Cb=Bn(64),Ib=/^[0-9a-fA-F]{128}$/,Ob=Jn(86,"=="),Nb=Bn(86);var H=h("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),Pf={number:"number",bigint:"bigint",object:"date"},Za=h("$ZodCheckLessThan",(e,t)=>{H.init(e,t);let o=Pf[typeof t.value];e._zod.onattach.push(r=>{let n=r._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:o,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Da=h("$ZodCheckGreaterThan",(e,t)=>{H.init(e,t);let o=Pf[typeof t.value];e._zod.onattach.push(r=>{let n=r._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:o,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Nu=h("$ZodCheckMultipleOf",(e,t)=>{H.init(e,t),e._zod.onattach.push(o=>{var r;(r=o._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=o=>{if(typeof o.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof o.value=="bigint"?o.value%t.value===BigInt(0):Fl(o.value,t.value)===0)||o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:t.value,input:o.value,inst:e,continue:!t.abort})}}),Mu=h("$ZodCheckNumberFormat",(e,t)=>{H.init(e,t),t.format=t.format||"float64";let o=t.format?.includes("int"),r=o?"int":"number",[n,s]=Yl[t.format];e._zod.onattach.push(i=>{let c=i._zod.bag;c.format=t.format,c.minimum=n,c.maximum=s,o&&(c.pattern=ku)}),e._zod.check=i=>{let c=i.value;if(o){if(!Number.isInteger(c)){i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?i.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):i.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<n&&i.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>s&&i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),qu=h("$ZodCheckBigIntFormat",(e,t)=>{H.init(e,t);let[o,r]=Ql[t.format];e._zod.onattach.push(n=>{let s=n._zod.bag;s.format=t.format,s.minimum=o,s.maximum=r}),e._zod.check=n=>{let s=n.value;s<o&&n.issues.push({origin:"bigint",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>r&&n.issues.push({origin:"bigint",input:s,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Au=h("$ZodCheckMaxSize",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!ft(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:Zn(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ju=h("$ZodCheckMinSize",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!ft(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:Zn(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Lu=h("$ZodCheckSizeEquals",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!ft(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=r=>{let n=r.value,s=n.size;if(s===t.size)return;let i=s>t.size;r.issues.push({origin:Zn(n),...i?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Uu=h("$ZodCheckMaxLength",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!ft(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let i=Dn(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Zu=h("$ZodCheckMinLength",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!ft(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let i=Dn(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Du=h("$ZodCheckLengthEquals",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!ft(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=r=>{let n=r.value,s=n.length;if(s===t.length)return;let i=Dn(n),c=s>t.length;r.issues.push({origin:i,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ho=h("$ZodCheckStringFormat",(e,t)=>{var o,r;H.init(e,t),e._zod.onattach.push(n=>{let s=n._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(o=e._zod).check??(o.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Vu=h("$ZodCheckRegex",(e,t)=>{Ho.init(e,t),e._zod.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Hu=h("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Iu),Ho.init(e,t)}),Fu=h("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ou),Ho.init(e,t)}),Ju=h("$ZodCheckIncludes",(e,t)=>{H.init(e,t);let o=ke(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${o}`:o);t.pattern=r,e._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Bu=h("$ZodCheckStartsWith",(e,t)=>{H.init(e,t);let o=new RegExp(`^${ke(t.prefix)}.*`);t.pattern??(t.pattern=o),e._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(o)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Wu=h("$ZodCheckEndsWith",(e,t)=>{H.init(e,t);let o=new RegExp(`.*${ke(t.suffix)}$`);t.pattern??(t.pattern=o),e._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(o)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function xf(e,t,o){e.issues.length&&t.issues.push(..._e(o,e.issues))}var Gu=h("$ZodCheckProperty",(e,t)=>{H.init(e,t),e._zod.check=o=>{let r=t.schema._zod.run({value:o.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(n=>xf(n,o,t.property));xf(r,o,t.property)}}),Ku=h("$ZodCheckMimeType",(e,t)=>{H.init(e,t);let o=new Set(t.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=t.mime}),e._zod.check=r=>{o.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),Yu=h("$ZodCheckOverwrite",(e,t)=>{H.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});var Wn=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(`
3
3
  `).filter(i=>i),n=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(n)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let t=Function,o=this?.args,n=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...o,n.join(`
4
- `))}};var Qu={major:4,minor:4,patch:3};var N=h("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Qu;let r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(let n of r)for(let s of n._zod.onattach)s(e);if(r.length===0)(o=e._zod).deferred??(o.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(i,c,l)=>{let d=_t(i),m;for(let S of c){if(S._zod.def.when){if(Xl(i)||!S._zod.def.when(i))continue}else if(d)continue;let _=i.issues.length,y=S._zod.check(i);if(y instanceof Promise&&l?.async===!1)throw new Ce;if(m||y instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await y,i.issues.length!==_&&(d||(d=_t(i,_)))});else{if(i.issues.length===_)continue;d||(d=_t(i,_))}}return m?m.then(()=>i):i},s=(i,c,l)=>{if(_t(i))return i.aborted=!0,i;let d=n(c,r,l);if(d instanceof Promise){if(l.async===!1)throw new Ce;return d.then(m=>e._zod.parse(m,l))}return e._zod.parse(d,l)};e._zod.run=(i,c)=>{if(c.skipChecks)return e._zod.parse(i,c);if(c.direction==="backward"){let d=e._zod.parse({value:i.value,issues:[]},{...c,skipChecks:!0});return d instanceof Promise?d.then(m=>s(m,i,c)):s(d,i,c)}let l=e._zod.parse(i,c);if(l instanceof Promise){if(c.async===!1)throw new Ce;return l.then(d=>n(d,r,c))}return n(l,r,c)}}q(e,"~standard",()=>({validate:n=>{try{let s=ru(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return nu(e,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Kt=h("$ZodString",(e,t)=>{N.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Pu(e._zod.bag),e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),Z=h("$ZodStringFormat",(e,t)=>{Vo.init(e,t),Kt.init(e,t)}),ed=h("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=pu),Z.init(e,t)}),td=h("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Gt(r))}else t.pattern??(t.pattern=Gt());Z.init(e,t)}),od=h("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=hu),Z.init(e,t)}),rd=h("$ZodURL",(e,t)=>{Z.init(e,t),e._zod.check=o=>{try{let r=o.value.trim();if(!t.normalize&&t.protocol?.source===zu.source&&!/^https?:\/\//i.test(r)){o.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:o.value,inst:e,continue:!t.abort});return}let n=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:o.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:o.value,inst:e,continue:!t.abort})),t.normalize?o.value=n.href:o.value=r;return}catch{o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!t.abort})}}}),nd=h("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=mu()),Z.init(e,t)}),sd=h("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=uu),Z.init(e,t)}),id=h("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=su),Z.init(e,t)}),ad=h("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=iu),Z.init(e,t)}),cd=h("$ZodULID",(e,t)=>{t.pattern??(t.pattern=au),Z.init(e,t)}),ld=h("$ZodXID",(e,t)=>{t.pattern??(t.pattern=cu),Z.init(e,t)}),ud=h("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=lu),Z.init(e,t)}),dd=h("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=xu(t)),Z.init(e,t)}),pd=h("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ru),Z.init(e,t)}),hd=h("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=wu(t)),Z.init(e,t)}),md=h("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=du),Z.init(e,t)}),fd=h("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=fu),Z.init(e,t),e._zod.bag.format="ipv4"}),gd=h("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=gu),Z.init(e,t),e._zod.bag.format="ipv6",e._zod.check=o=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!t.abort})}}}),Sd=h("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Su(t.delimiter)),Z.init(e,t),e._zod.bag.format="mac"}),_d=h("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=_u),Z.init(e,t)}),bd=h("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=bu),Z.init(e,t),e._zod.check=o=>{let r=o.value.split("/");try{if(r.length!==2)throw new Error;let[n,s]=r;if(!s)throw new Error;let i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${n}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!t.abort})}}});function yd(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var zd=h("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yu),Z.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=o=>{yd(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function Df(e){if(!La.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return yd(o)}var vd=h("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=La),Z.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=o=>{Df(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),Rd=h("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vu),Z.init(e,t)});function Vf(e,t=null){try{let o=e.split(".");if(o.length!==3)return!1;let[r]=o;if(!r)return!1;let n=JSON.parse(atob(r));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var wd=h("$ZodJWT",(e,t)=>{Z.init(e,t),e._zod.check=o=>{Vf(o.value,t.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),xd=h("$ZodCustomStringFormat",(e,t)=>{Z.init(e,t),e._zod.check=o=>{t.fn(o.value)||o.issues.push({code:"invalid_format",format:t.format,input:o.value,inst:e,continue:!t.abort})}}),Ba=h("$ZodNumber",(e,t)=>{N.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ua,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=Number(o.value)}catch{}let n=o.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return o;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return o.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),o}}),Pd=h("$ZodNumberFormat",(e,t)=>{Mu.init(e,t),Ba.init(e,t)}),Gn=h("$ZodBoolean",(e,t)=>{N.init(e,t),e._zod.pattern=Eu,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=!!o.value}catch{}let n=o.value;return typeof n=="boolean"||o.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),o}}),Wa=h("$ZodBigInt",(e,t)=>{N.init(e,t),e._zod.pattern=Tu,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=BigInt(o.value)}catch{}return typeof o.value=="bigint"||o.issues.push({expected:"bigint",code:"invalid_type",input:o.value,inst:e}),o}}),Td=h("$ZodBigIntFormat",(e,t)=>{qu.init(e,t),Wa.init(e,t)}),kd=h("$ZodSymbol",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;return typeof n=="symbol"||o.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),o}}),Ed=h("$ZodUndefined",(e,t)=>{N.init(e,t),e._zod.pattern=Cu,e._zod.values=new Set([void 0]),e._zod.parse=(o,r)=>{let n=o.value;return typeof n>"u"||o.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),o}}),$d=h("$ZodNull",(e,t)=>{N.init(e,t),e._zod.pattern=$u,e._zod.values=new Set([null]),e._zod.parse=(o,r)=>{let n=o.value;return n===null||o.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),o}}),Cd=h("$ZodAny",(e,t)=>{N.init(e,t),e._zod.parse=o=>o}),Id=h("$ZodUnknown",(e,t)=>{N.init(e,t),e._zod.parse=o=>o}),Od=h("$ZodNever",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)}),Nd=h("$ZodVoid",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;return typeof n>"u"||o.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),o}}),Md=h("$ZodDate",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=new Date(o.value)}catch{}let n=o.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||o.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:e}),o}});function kf(e,t,o){e.issues.length&&t.issues.push(..._e(o,e.issues)),t.value[o]=e.value}var qd=h("$ZodArray",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!Array.isArray(n))return o.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),o;o.value=Array(n.length);let s=[];for(let i=0;i<n.length;i++){let c=n[i],l=t.element._zod.run({value:c,issues:[]},r);l instanceof Promise?s.push(l.then(d=>kf(d,o,i))):kf(l,o,i)}return s.length?Promise.all(s).then(()=>o):o}});function Ja(e,t,o,r,n,s){let i=o in r;if(e.issues.length){if(n&&s&&!i)return;t.issues.push(..._e(o,e.issues))}if(!i&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[o]});return}e.value===void 0?i&&(t.value[o]=void 0):t.value[o]=e.value}function Hf(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);let o=Kl(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function Ff(e,t,o,r,n,s){let i=[],c=n.keySet,l=n.catchall._zod,d=l.def.type,m=l.optin==="optional",S=l.optout==="optional";for(let _ in t){if(_==="__proto__"||c.has(_))continue;if(d==="never"){i.push(_);continue}let y=l.run({value:t[_],issues:[]},r);y instanceof Promise?e.push(y.then(k=>Ja(k,o,_,t,m,S))):Ja(y,o,_,t,m,S)}return i.length&&o.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>o):o}var Jf=h("$ZodObject",(e,t)=>{if(N.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:()=>{let l={...c};return Object.defineProperty(t,"shape",{value:l}),l}})}let r=Ao(()=>Hf(t));q(e._zod,"propValues",()=>{let c=t.shape,l={};for(let d in c){let m=c[d]._zod;if(m.values){l[d]??(l[d]=new Set);for(let S of m.values)l[d].add(S)}}return l});let n=Wt,s=t.catchall,i;e._zod.parse=(c,l)=>{i??(i=r.value);let d=c.value;if(!n(d))return c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c;c.value={};let m=[],S=i.shape;for(let _ of i.keys){let y=S[_],k=y._zod.optin==="optional",$=y._zod.optout==="optional",I=y._zod.run({value:d[_],issues:[]},l);I instanceof Promise?m.push(I.then(V=>Ja(V,c,_,d,k,$))):Ja(I,c,_,d,k,$)}return s?Ff(m,d,c,l,r.value,e):m.length?Promise.all(m).then(()=>c):c}}),Ad=h("$ZodObjectJIT",(e,t)=>{Jf.init(e,t);let o=e._zod.parse,r=Ao(()=>Hf(t)),n=_=>{let y=new Wn(["shape","payload","ctx"]),k=r.value,$=U=>{let j=Pa(U);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};y.write("const input = payload.value;");let I=Object.create(null),V=0;for(let U of k.keys)I[U]=`key_${V++}`;y.write("const newResult = {};");for(let U of k.keys){let j=I[U],J=Pa(U),F=_[U],ee=F?._zod?.optin==="optional",Be=F?._zod?.optout==="optional";y.write(`const ${j} = ${$(U)};`),ee&&Be?y.write(`
5
- if (${j}.issues.length) {
6
- if (${J} in input) {
7
- payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
4
+ `))}};var Qu={major:4,minor:4,patch:3};var N=h("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Qu;let r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(let n of r)for(let s of n._zod.onattach)s(e);if(r.length===0)(o=e._zod).deferred??(o.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(i,c,l)=>{let d=_t(i),m;for(let S of c){if(S._zod.def.when){if(Xl(i)||!S._zod.def.when(i))continue}else if(d)continue;let _=i.issues.length,b=S._zod.check(i);if(b instanceof Promise&&l?.async===!1)throw new Ce;if(m||b instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await b,i.issues.length!==_&&(d||(d=_t(i,_)))});else{if(i.issues.length===_)continue;d||(d=_t(i,_))}}return m?m.then(()=>i):i},s=(i,c,l)=>{if(_t(i))return i.aborted=!0,i;let d=n(c,r,l);if(d instanceof Promise){if(l.async===!1)throw new Ce;return d.then(m=>e._zod.parse(m,l))}return e._zod.parse(d,l)};e._zod.run=(i,c)=>{if(c.skipChecks)return e._zod.parse(i,c);if(c.direction==="backward"){let d=e._zod.parse({value:i.value,issues:[]},{...c,skipChecks:!0});return d instanceof Promise?d.then(m=>s(m,i,c)):s(d,i,c)}let l=e._zod.parse(i,c);if(l instanceof Promise){if(c.async===!1)throw new Ce;return l.then(d=>n(d,r,c))}return n(l,r,c)}}A(e,"~standard",()=>({validate:n=>{try{let s=ru(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return nu(e,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Yt=h("$ZodString",(e,t)=>{N.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Pu(e._zod.bag),e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),D=h("$ZodStringFormat",(e,t)=>{Ho.init(e,t),Yt.init(e,t)}),ed=h("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=pu),D.init(e,t)}),td=h("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Kt(r))}else t.pattern??(t.pattern=Kt());D.init(e,t)}),od=h("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=hu),D.init(e,t)}),rd=h("$ZodURL",(e,t)=>{D.init(e,t),e._zod.check=o=>{try{let r=o.value.trim();if(!t.normalize&&t.protocol?.source===zu.source&&!/^https?:\/\//i.test(r)){o.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:o.value,inst:e,continue:!t.abort});return}let n=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:o.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:o.value,inst:e,continue:!t.abort})),t.normalize?o.value=n.href:o.value=r;return}catch{o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!t.abort})}}}),nd=h("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=mu()),D.init(e,t)}),sd=h("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=uu),D.init(e,t)}),id=h("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=su),D.init(e,t)}),ad=h("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=iu),D.init(e,t)}),cd=h("$ZodULID",(e,t)=>{t.pattern??(t.pattern=au),D.init(e,t)}),ld=h("$ZodXID",(e,t)=>{t.pattern??(t.pattern=cu),D.init(e,t)}),ud=h("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=lu),D.init(e,t)}),dd=h("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=xu(t)),D.init(e,t)}),pd=h("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ru),D.init(e,t)}),hd=h("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=wu(t)),D.init(e,t)}),md=h("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=du),D.init(e,t)}),fd=h("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=fu),D.init(e,t),e._zod.bag.format="ipv4"}),gd=h("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=gu),D.init(e,t),e._zod.bag.format="ipv6",e._zod.check=o=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!t.abort})}}}),Sd=h("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Su(t.delimiter)),D.init(e,t),e._zod.bag.format="mac"}),_d=h("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=_u),D.init(e,t)}),bd=h("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=bu),D.init(e,t),e._zod.check=o=>{let r=o.value.split("/");try{if(r.length!==2)throw new Error;let[n,s]=r;if(!s)throw new Error;let i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${n}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!t.abort})}}});function yd(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var zd=h("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yu),D.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=o=>{yd(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function Df(e){if(!La.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return yd(o)}var vd=h("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=La),D.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=o=>{Df(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),Rd=h("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vu),D.init(e,t)});function Vf(e,t=null){try{let o=e.split(".");if(o.length!==3)return!1;let[r]=o;if(!r)return!1;let n=JSON.parse(atob(r));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var wd=h("$ZodJWT",(e,t)=>{D.init(e,t),e._zod.check=o=>{Vf(o.value,t.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),xd=h("$ZodCustomStringFormat",(e,t)=>{D.init(e,t),e._zod.check=o=>{t.fn(o.value)||o.issues.push({code:"invalid_format",format:t.format,input:o.value,inst:e,continue:!t.abort})}}),Ba=h("$ZodNumber",(e,t)=>{N.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ua,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=Number(o.value)}catch{}let n=o.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return o;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return o.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),o}}),Pd=h("$ZodNumberFormat",(e,t)=>{Mu.init(e,t),Ba.init(e,t)}),Gn=h("$ZodBoolean",(e,t)=>{N.init(e,t),e._zod.pattern=$u,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=!!o.value}catch{}let n=o.value;return typeof n=="boolean"||o.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),o}}),Wa=h("$ZodBigInt",(e,t)=>{N.init(e,t),e._zod.pattern=Tu,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=BigInt(o.value)}catch{}return typeof o.value=="bigint"||o.issues.push({expected:"bigint",code:"invalid_type",input:o.value,inst:e}),o}}),Td=h("$ZodBigIntFormat",(e,t)=>{qu.init(e,t),Wa.init(e,t)}),kd=h("$ZodSymbol",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;return typeof n=="symbol"||o.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),o}}),$d=h("$ZodUndefined",(e,t)=>{N.init(e,t),e._zod.pattern=Cu,e._zod.values=new Set([void 0]),e._zod.parse=(o,r)=>{let n=o.value;return typeof n>"u"||o.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),o}}),Ed=h("$ZodNull",(e,t)=>{N.init(e,t),e._zod.pattern=Eu,e._zod.values=new Set([null]),e._zod.parse=(o,r)=>{let n=o.value;return n===null||o.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),o}}),Cd=h("$ZodAny",(e,t)=>{N.init(e,t),e._zod.parse=o=>o}),Id=h("$ZodUnknown",(e,t)=>{N.init(e,t),e._zod.parse=o=>o}),Od=h("$ZodNever",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)}),Nd=h("$ZodVoid",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;return typeof n>"u"||o.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),o}}),Md=h("$ZodDate",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=new Date(o.value)}catch{}let n=o.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||o.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:e}),o}});function kf(e,t,o){e.issues.length&&t.issues.push(..._e(o,e.issues)),t.value[o]=e.value}var qd=h("$ZodArray",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!Array.isArray(n))return o.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),o;o.value=Array(n.length);let s=[];for(let i=0;i<n.length;i++){let c=n[i],l=t.element._zod.run({value:c,issues:[]},r);l instanceof Promise?s.push(l.then(d=>kf(d,o,i))):kf(l,o,i)}return s.length?Promise.all(s).then(()=>o):o}});function Ja(e,t,o,r,n,s){let i=o in r;if(e.issues.length){if(n&&s&&!i)return;t.issues.push(..._e(o,e.issues))}if(!i&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[o]});return}e.value===void 0?i&&(t.value[o]=void 0):t.value[o]=e.value}function Hf(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);let o=Kl(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function Ff(e,t,o,r,n,s){let i=[],c=n.keySet,l=n.catchall._zod,d=l.def.type,m=l.optin==="optional",S=l.optout==="optional";for(let _ in t){if(_==="__proto__"||c.has(_))continue;if(d==="never"){i.push(_);continue}let b=l.run({value:t[_],issues:[]},r);b instanceof Promise?e.push(b.then(P=>Ja(P,o,_,t,m,S))):Ja(b,o,_,t,m,S)}return i.length&&o.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>o):o}var Jf=h("$ZodObject",(e,t)=>{if(N.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:()=>{let l={...c};return Object.defineProperty(t,"shape",{value:l}),l}})}let r=jo(()=>Hf(t));A(e._zod,"propValues",()=>{let c=t.shape,l={};for(let d in c){let m=c[d]._zod;if(m.values){l[d]??(l[d]=new Set);for(let S of m.values)l[d].add(S)}}return l});let n=Gt,s=t.catchall,i;e._zod.parse=(c,l)=>{i??(i=r.value);let d=c.value;if(!n(d))return c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c;c.value={};let m=[],S=i.shape;for(let _ of i.keys){let b=S[_],P=b._zod.optin==="optional",$=b._zod.optout==="optional",C=b._zod.run({value:d[_],issues:[]},l);C instanceof Promise?m.push(C.then(q=>Ja(q,c,_,d,P,$))):Ja(C,c,_,d,P,$)}return s?Ff(m,d,c,l,r.value,e):m.length?Promise.all(m).then(()=>c):c}}),Ad=h("$ZodObjectJIT",(e,t)=>{Jf.init(e,t);let o=e._zod.parse,r=jo(()=>Hf(t)),n=_=>{let b=new Wn(["shape","payload","ctx"]),P=r.value,$=L=>{let U=Pa(L);return`shape[${U}]._zod.run({ value: input[${U}], issues: [] }, ctx)`};b.write("const input = payload.value;");let C=Object.create(null),q=0;for(let L of P.keys)C[L]=`key_${q++}`;b.write("const newResult = {};");for(let L of P.keys){let U=C[L],B=Pa(L),F=_[L],ee=F?._zod?.optin==="optional",Be=F?._zod?.optout==="optional";b.write(`const ${U} = ${$(L)};`),ee&&Be?b.write(`
5
+ if (${U}.issues.length) {
6
+ if (${B} in input) {
7
+ payload.issues = payload.issues.concat(${U}.issues.map(iss => ({
8
8
  ...iss,
9
- path: iss.path ? [${J}, ...iss.path] : [${J}]
9
+ path: iss.path ? [${B}, ...iss.path] : [${B}]
10
10
  })));
11
11
  }
12
12
  }
13
13
 
14
- if (${j}.value === undefined) {
15
- if (${J} in input) {
16
- newResult[${J}] = undefined;
14
+ if (${U}.value === undefined) {
15
+ if (${B} in input) {
16
+ newResult[${B}] = undefined;
17
17
  }
18
18
  } else {
19
- newResult[${J}] = ${j}.value;
19
+ newResult[${B}] = ${U}.value;
20
20
  }
21
21
 
22
- `):ee?y.write(`
23
- if (${j}.issues.length) {
24
- payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
22
+ `):ee?b.write(`
23
+ if (${U}.issues.length) {
24
+ payload.issues = payload.issues.concat(${U}.issues.map(iss => ({
25
25
  ...iss,
26
- path: iss.path ? [${J}, ...iss.path] : [${J}]
26
+ path: iss.path ? [${B}, ...iss.path] : [${B}]
27
27
  })));
28
28
  }
29
29
 
30
- if (${j}.value === undefined) {
31
- if (${J} in input) {
32
- newResult[${J}] = undefined;
30
+ if (${U}.value === undefined) {
31
+ if (${B} in input) {
32
+ newResult[${B}] = undefined;
33
33
  }
34
34
  } else {
35
- newResult[${J}] = ${j}.value;
35
+ newResult[${B}] = ${U}.value;
36
36
  }
37
37
 
38
- `):y.write(`
39
- const ${j}_present = ${J} in input;
40
- if (${j}.issues.length) {
41
- payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
38
+ `):b.write(`
39
+ const ${U}_present = ${B} in input;
40
+ if (${U}.issues.length) {
41
+ payload.issues = payload.issues.concat(${U}.issues.map(iss => ({
42
42
  ...iss,
43
- path: iss.path ? [${J}, ...iss.path] : [${J}]
43
+ path: iss.path ? [${B}, ...iss.path] : [${B}]
44
44
  })));
45
45
  }
46
- if (!${j}_present && !${j}.issues.length) {
46
+ if (!${U}_present && !${U}.issues.length) {
47
47
  payload.issues.push({
48
48
  code: "invalid_type",
49
49
  expected: "nonoptional",
50
50
  input: undefined,
51
- path: [${J}]
51
+ path: [${B}]
52
52
  });
53
53
  }
54
54
 
55
- if (${j}_present) {
56
- if (${j}.value === undefined) {
57
- newResult[${J}] = undefined;
55
+ if (${U}_present) {
56
+ if (${U}.value === undefined) {
57
+ newResult[${B}] = undefined;
58
58
  } else {
59
- newResult[${J}] = ${j}.value;
59
+ newResult[${B}] = ${U}.value;
60
60
  }
61
61
  }
62
62
 
63
- `)}y.write("payload.value = newResult;"),y.write("return payload;");let K=y.compile();return(U,j)=>K(_,U,j)},s,i=Wt,c=!Bt.jitless,d=c&&Bl.value,m=t.catchall,S;e._zod.parse=(_,y)=>{S??(S=r.value);let k=_.value;return i(k)?c&&d&&y?.async===!1&&y.jitless!==!0?(s||(s=n(t.shape)),_=s(_,y),m?Ff([],k,_,y,S,e):_):o(_,y):(_.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),_)}});function Ef(e,t,o,r){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let n=e.filter(s=>!_t(s));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(s=>s.issues.map(i=>me(i,r,Y())))}),t)}var Kn=h("$ZodUnion",(e,t)=>{N.init(e,t),q(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),q(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),q(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),q(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>Ln(n.source)).join("|")})$`)}});let o=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,n)=>{if(o)return o(r,n);let s=!1,i=[];for(let c of t.options){let l=c._zod.run({value:r.value,issues:[]},n);if(l instanceof Promise)i.push(l),s=!0;else{if(l.issues.length===0)return l;i.push(l)}}return s?Promise.all(i).then(c=>Ef(c,r,e,n)):Ef(i,r,e,n)}});function $f(e,t,o,r){let n=e.filter(s=>s.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(s=>s.issues.map(i=>me(i,r,Y())))}):t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:[],inclusive:!1}),t)}var jd=h("$ZodXor",(e,t)=>{Kn.init(e,t),t.inclusive=!1;let o=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,n)=>{if(o)return o(r,n);let s=!1,i=[];for(let c of t.options){let l=c._zod.run({value:r.value,issues:[]},n);l instanceof Promise?(i.push(l),s=!0):i.push(l)}return s?Promise.all(i).then(c=>$f(c,r,e,n)):$f(i,r,e,n)}}),Ld=h("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Kn.init(e,t);let o=e._zod.parse;q(e._zod,"propValues",()=>{let n={};for(let s of t.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[c,l]of Object.entries(i)){n[c]||(n[c]=new Set);for(let d of l)n[c].add(d)}}return n});let r=Ao(()=>{let n=t.options,s=new Map;for(let i of n){let c=i._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let l of c){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,i)}}return s});e._zod.parse=(n,s)=>{let i=n.value;if(!Wt(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let c=r.value.get(i?.[t.discriminator]);return c?c._zod.run(n,s):t.unionFallback||s.direction==="backward"?o(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:i,path:[t.discriminator],inst:e}),n)}}),Ud=h("$ZodIntersection",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value,s=t.left._zod.run({value:n,issues:[]},r),i=t.right._zod.run({value:n,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([l,d])=>Cf(o,l,d)):Cf(o,s,i)}});function Xu(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(St(e)&&St(t)){let o=Object.keys(t),r=Object.keys(e).filter(s=>o.indexOf(s)!==-1),n={...e,...t};for(let s of r){let i=Xu(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let o=[];for(let r=0;r<e.length;r++){let n=e[r],s=t[r],i=Xu(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};o.push(i.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function Cf(e,t,o){let r=new Map,n;for(let c of t.issues)if(c.code==="unrecognized_keys"){n??(n=c);for(let l of c.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(c);for(let c of o.issues)if(c.code==="unrecognized_keys")for(let l of c.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(c);let s=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&n&&e.issues.push({...n,keys:s}),_t(e))return e;let i=Xu(t.value,o.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}var Ga=h("$ZodTuple",(e,t)=>{N.init(e,t);let o=t.items;e._zod.parse=(r,n)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let i=[],c=If(o,"optin"),l=If(o,"optout");if(!t.rest){if(s.length<c)return r.issues.push({code:"too_small",minimum:c,inclusive:!0,input:s,inst:e,origin:"array"}),r;s.length>o.length&&r.issues.push({code:"too_big",maximum:o.length,inclusive:!0,input:s,inst:e,origin:"array"})}let d=new Array(o.length);for(let m=0;m<o.length;m++){let S=o[m]._zod.run({value:s[m],issues:[]},n);S instanceof Promise?i.push(S.then(_=>{d[m]=_})):d[m]=S}if(t.rest){let m=o.length-1,S=s.slice(o.length);for(let _ of S){m++;let y=t.rest._zod.run({value:_,issues:[]},n);y instanceof Promise?i.push(y.then(k=>Of(k,r,m))):Of(y,r,m)}}return i.length?Promise.all(i).then(()=>Nf(d,r,o,s,l)):Nf(d,r,o,s,l)}});function If(e,t){for(let o=e.length-1;o>=0;o--)if(e[o]._zod[t]!=="optional")return o+1;return 0}function Of(e,t,o){e.issues.length&&t.issues.push(..._e(o,e.issues)),t.value[o]=e.value}function Nf(e,t,o,r,n){for(let s=0;s<o.length;s++){let i=e[s],c=s<r.length;if(i.issues.length){if(!c&&s>=n){t.value.length=s;break}t.issues.push(..._e(s,i.issues))}t.value[s]=i.value}for(let s=t.value.length-1;s>=r.length&&(o[s]._zod.optout==="optional"&&t.value[s]===void 0);s--)t.value.length=s;return t}var Zd=h("$ZodRecord",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!St(n))return o.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),o;let s=[],i=t.keyType._zod.values;if(i){o.value={};let c=new Set;for(let d of i)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){c.add(typeof d=="number"?d.toString():d);let m=t.keyType._zod.run({value:d,issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(m.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(y=>me(y,r,Y())),input:d,path:[d],inst:e});continue}let S=m.value,_=t.valueType._zod.run({value:n[d],issues:[]},r);_ instanceof Promise?s.push(_.then(y=>{y.issues.length&&o.issues.push(..._e(d,y.issues)),o.value[S]=y.value})):(_.issues.length&&o.issues.push(..._e(d,_.issues)),o.value[S]=_.value)}let l;for(let d in n)c.has(d)||(l=l??[],l.push(d));l&&l.length>0&&o.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:l})}else{o.value={};for(let c of Reflect.ownKeys(n)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,c))continue;let l=t.keyType._zod.run({value:c,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&Ua.test(c)&&l.issues.length){let S=t.keyType._zod.run({value:Number(c),issues:[]},r);if(S instanceof Promise)throw new Error("Async schemas not supported in object keys currently");S.issues.length===0&&(l=S)}if(l.issues.length){t.mode==="loose"?o.value[c]=n[c]:o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(S=>me(S,r,Y())),input:c,path:[c],inst:e});continue}let m=t.valueType._zod.run({value:n[c],issues:[]},r);m instanceof Promise?s.push(m.then(S=>{S.issues.length&&o.issues.push(..._e(c,S.issues)),o.value[l.value]=S.value})):(m.issues.length&&o.issues.push(..._e(c,m.issues)),o.value[l.value]=m.value)}}return s.length?Promise.all(s).then(()=>o):o}}),Dd=h("$ZodMap",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!(n instanceof Map))return o.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),o;let s=[];o.value=new Map;for(let[i,c]of n){let l=t.keyType._zod.run({value:i,issues:[]},r),d=t.valueType._zod.run({value:c,issues:[]},r);l instanceof Promise||d instanceof Promise?s.push(Promise.all([l,d]).then(([m,S])=>{Mf(m,S,o,i,n,e,r)})):Mf(l,d,o,i,n,e,r)}return s.length?Promise.all(s).then(()=>o):o}});function Mf(e,t,o,r,n,s,i){e.issues.length&&(Un.has(typeof r)?o.issues.push(..._e(r,e.issues)):o.issues.push({code:"invalid_key",origin:"map",input:n,inst:s,issues:e.issues.map(c=>me(c,i,Y()))})),t.issues.length&&(Un.has(typeof r)?o.issues.push(..._e(r,t.issues)):o.issues.push({origin:"map",code:"invalid_element",input:n,inst:s,key:r,issues:t.issues.map(c=>me(c,i,Y()))})),o.value.set(e.value,t.value)}var Vd=h("$ZodSet",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!(n instanceof Set))return o.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),o;let s=[];o.value=new Set;for(let i of n){let c=t.valueType._zod.run({value:i,issues:[]},r);c instanceof Promise?s.push(c.then(l=>qf(l,o))):qf(c,o)}return s.length?Promise.all(s).then(()=>o):o}});function qf(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Hd=h("$ZodEnum",(e,t)=>{N.init(e,t);let o=jn(t.entries),r=new Set(o);e._zod.values=r,e._zod.pattern=new RegExp(`^(${o.filter(n=>Un.has(typeof n)).map(n=>typeof n=="string"?ke(n):n.toString()).join("|")})$`),e._zod.parse=(n,s)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:o,input:i,inst:e}),n}}),Fd=h("$ZodLiteral",(e,t)=>{if(N.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let o=new Set(t.values);e._zod.values=o,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?ke(r):r?ke(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let s=r.value;return o.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),Jd=h("$ZodFile",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;return n instanceof File||o.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),o}}),Bd=h("$ZodTransform",(e,t)=>{N.init(e,t),e._zod.optin="optional",e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new mt(e.constructor.name);let n=t.transform(o.value,o);if(r.async)return(n instanceof Promise?n:Promise.resolve(n)).then(i=>(o.value=i,o.fallback=!0,o));if(n instanceof Promise)throw new Ce;return o.value=n,o.fallback=!0,o}});function Af(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Ka=h("$ZodOptional",(e,t)=>{N.init(e,t),e._zod.optin="optional",e._zod.optout="optional",q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Ln(o.source)})?$`):void 0}),e._zod.parse=(o,r)=>{if(t.innerType._zod.optin==="optional"){let n=o.value,s=t.innerType._zod.run(o,r);return s instanceof Promise?s.then(i=>Af(i,n)):Af(s,n)}return o.value===void 0?o:t.innerType._zod.run(o,r)}}),Wd=h("$ZodExactOptional",(e,t)=>{Ka.init(e,t),q(e._zod,"values",()=>t.innerType._zod.values),q(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(o,r)=>t.innerType._zod.run(o,r)}),Gd=h("$ZodNullable",(e,t)=>{N.init(e,t),q(e._zod,"optin",()=>t.innerType._zod.optin),q(e._zod,"optout",()=>t.innerType._zod.optout),q(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Ln(o.source)}|null)$`):void 0}),q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,r)=>o.value===null?o:t.innerType._zod.run(o,r)}),Kd=h("$ZodDefault",(e,t)=>{N.init(e,t),e._zod.optin="optional",q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);if(o.value===void 0)return o.value=t.defaultValue,o;let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(s=>jf(s,t)):jf(n,t)}});function jf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Yd=h("$ZodPrefault",(e,t)=>{N.init(e,t),e._zod.optin="optional",q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>(r.direction==="backward"||o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,r))}),Qd=h("$ZodNonOptional",(e,t)=>{N.init(e,t),q(e._zod,"values",()=>{let o=t.innerType._zod.values;return o?new Set([...o].filter(r=>r!==void 0)):void 0}),e._zod.parse=(o,r)=>{let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(s=>Lf(s,e)):Lf(n,e)}});function Lf(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Xd=h("$ZodSuccess",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new mt("ZodSuccess");let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(s=>(o.value=s.issues.length===0,o)):(o.value=n.issues.length===0,o)}}),ep=h("$ZodCatch",(e,t)=>{N.init(e,t),e._zod.optin="optional",q(e._zod,"optout",()=>t.innerType._zod.optout),q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(s=>(o.value=s.value,s.issues.length&&(o.value=t.catchValue({...o,error:{issues:s.issues.map(i=>me(i,r,Y()))},input:o.value}),o.issues=[],o.fallback=!0),o)):(o.value=n.value,n.issues.length&&(o.value=t.catchValue({...o,error:{issues:n.issues.map(s=>me(s,r,Y()))},input:o.value}),o.issues=[],o.fallback=!0),o)}}),tp=h("$ZodNaN",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>((typeof o.value!="number"||!Number.isNaN(o.value))&&o.issues.push({input:o.value,inst:e,expected:"nan",code:"invalid_type"}),o)}),Ya=h("$ZodPipe",(e,t)=>{N.init(e,t),q(e._zod,"values",()=>t.in._zod.values),q(e._zod,"optin",()=>t.in._zod.optin),q(e._zod,"optout",()=>t.out._zod.optout),q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,r)=>{if(r.direction==="backward"){let s=t.out._zod.run(o,r);return s instanceof Promise?s.then(i=>Va(i,t.in,r)):Va(s,t.in,r)}let n=t.in._zod.run(o,r);return n instanceof Promise?n.then(s=>Va(s,t.out,r)):Va(n,t.out,r)}});function Va(e,t,o){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},o)}var Yn=h("$ZodCodec",(e,t)=>{N.init(e,t),q(e._zod,"values",()=>t.in._zod.values),q(e._zod,"optin",()=>t.in._zod.optin),q(e._zod,"optout",()=>t.out._zod.optout),q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,r)=>{if((r.direction||"forward")==="forward"){let s=t.in._zod.run(o,r);return s instanceof Promise?s.then(i=>Ha(i,t,r)):Ha(s,t,r)}else{let s=t.out._zod.run(o,r);return s instanceof Promise?s.then(i=>Ha(i,t,r)):Ha(s,t,r)}}});function Ha(e,t,o){if(e.issues.length)return e.aborted=!0,e;if((o.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(s=>Fa(e,s,t.out,o)):Fa(e,n,t.out,o)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(s=>Fa(e,s,t.in,o)):Fa(e,n,t.in,o)}}function Fa(e,t,o,r){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},r)}var op=h("$ZodPreprocess",(e,t)=>{Ya.init(e,t)}),rp=h("$ZodReadonly",(e,t)=>{N.init(e,t),q(e._zod,"propValues",()=>t.innerType._zod.propValues),q(e._zod,"values",()=>t.innerType._zod.values),q(e._zod,"optin",()=>t.innerType?._zod?.optin),q(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(Uf):Uf(n)}});function Uf(e){return e.value=Object.freeze(e.value),e}var np=h("$ZodTemplateLiteral",(e,t)=>{N.init(e,t);let o=[];for(let r of t.parts)if(typeof r=="object"&&r!==null){if(!r._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);let n=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${r._zod.traits}`);let s=n.startsWith("^")?1:0,i=n.endsWith("$")?n.length-1:n.length;o.push(n.slice(s,i))}else if(r===null||Gl.has(typeof r))o.push(ke(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${o.join("")}$`),e._zod.parse=(r,n)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),sp=h("$ZodFunction",(e,t)=>(N.init(e,t),e._def=t,e._zod.def=t,e.implement=o=>{if(typeof o!="function")throw new Error("implement() must be called with a function");return function(...r){let n=e._def.input?Ea(e._def.input,r):r,s=Reflect.apply(o,this,n);return e._def.output?Ea(e._def.output,s):s}},e.implementAsync=o=>{if(typeof o!="function")throw new Error("implementAsync() must be called with a function");return async function(...r){let n=e._def.input?await $a(e._def.input,r):r,s=await Reflect.apply(o,this,n);return e._def.output?await $a(e._def.output,s):s}},e._zod.parse=(o,r)=>typeof o.value!="function"?(o.issues.push({code:"invalid_type",expected:"function",input:o.value,inst:e}),o):(e._def.output&&e._def.output._zod.def.type==="promise"?o.value=e.implementAsync(o.value):o.value=e.implement(o.value),o),e.input=(...o)=>{let r=e.constructor;return Array.isArray(o[0])?new r({type:"function",input:new Ga({type:"tuple",items:o[0],rest:o[1]}),output:e._def.output}):new r({type:"function",input:o[0],output:e._def.output})},e.output=o=>{let r=e.constructor;return new r({type:"function",input:e._def.input,output:o})},e)),ip=h("$ZodPromise",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>Promise.resolve(o.value).then(n=>t.innerType._zod.run({value:n,issues:[]},r))}),ap=h("$ZodLazy",(e,t)=>{N.init(e,t),q(e._zod,"innerType",()=>{let o=t;return o._cachedInner||(o._cachedInner=t.getter()),o._cachedInner}),q(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),q(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),q(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),q(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(o,r)=>e._zod.innerType._zod.run(o,r)}),cp=h("$ZodCustom",(e,t)=>{H.init(e,t),N.init(e,t),e._zod.parse=(o,r)=>o,e._zod.check=o=>{let r=o.value,n=t.fn(r);if(n instanceof Promise)return n.then(s=>Zf(s,o,r,e));Zf(n,o,r,e)}});function Zf(e,t,o,r){if(!e){let n={code:"custom",input:o,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(n.params=r._zod.def.params),t.issues.push(jo(n))}}var Qn={};Ke(Qn,{en:()=>Qa});var Ob=()=>{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(n){return e[n]??null}let o={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",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,i=eu(n.input),c=r[i]??i;return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${ka(n.values[0])}`:`Invalid option: expected one of ${xa(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",i=t(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${s}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",i=t(n.origin);return i?`Too small: expected ${n.origin} to have ${s}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${o[s.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${xa(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Qa(){return{localeError:Ob()}}var Bf,lp=Symbol("ZodOutput"),up=Symbol("ZodInput"),Xa=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){let r=o[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let o=this._map.get(t);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(t),this}get(t){let o=t._zod.parent;if(o){let r={...this.get(o)??{}};delete r.id;let n={...r,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function ec(){return new Xa}(Bf=globalThis).__zod_globalRegistry??(Bf.__zod_globalRegistry=ec());var re=globalThis.__zod_globalRegistry;function dp(e,t){return new e({type:"string",...z(t)})}function pp(e,t){return new e({type:"string",coerce:!0,...z(t)})}function tc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...z(t)})}function Xn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...z(t)})}function oc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...z(t)})}function rc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(t)})}function nc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(t)})}function sc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(t)})}function es(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...z(t)})}function ic(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...z(t)})}function ac(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(t)})}function cc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...z(t)})}function lc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(t)})}function uc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...z(t)})}function dc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...z(t)})}function pc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(t)})}function hc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(t)})}function mc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(t)})}function hp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...z(t)})}function fc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(t)})}function gc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(t)})}function Sc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...z(t)})}function _c(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...z(t)})}function bc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...z(t)})}function yc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...z(t)})}var mp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function fp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(t)})}function gp(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function Sp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function _p(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function bp(e,t){return new e({type:"number",checks:[],...z(t)})}function yp(e,t){return new e({type:"number",coerce:!0,checks:[],...z(t)})}function zp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...z(t)})}function vp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...z(t)})}function Rp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...z(t)})}function wp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...z(t)})}function xp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...z(t)})}function Pp(e,t){return new e({type:"boolean",...z(t)})}function Tp(e,t){return new e({type:"boolean",coerce:!0,...z(t)})}function kp(e,t){return new e({type:"bigint",...z(t)})}function Ep(e,t){return new e({type:"bigint",coerce:!0,...z(t)})}function $p(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...z(t)})}function Cp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...z(t)})}function Ip(e,t){return new e({type:"symbol",...z(t)})}function Op(e,t){return new e({type:"undefined",...z(t)})}function Np(e,t){return new e({type:"null",...z(t)})}function Mp(e){return new e({type:"any"})}function qp(e){return new e({type:"unknown"})}function Ap(e,t){return new e({type:"never",...z(t)})}function jp(e,t){return new e({type:"void",...z(t)})}function Lp(e,t){return new e({type:"date",...z(t)})}function Up(e,t){return new e({type:"date",coerce:!0,...z(t)})}function Zp(e,t){return new e({type:"nan",...z(t)})}function Ae(e,t){return new Za({check:"less_than",...z(t),value:e,inclusive:!1})}function we(e,t){return new Za({check:"less_than",...z(t),value:e,inclusive:!0})}function je(e,t){return new Da({check:"greater_than",...z(t),value:e,inclusive:!1})}function fe(e,t){return new Da({check:"greater_than",...z(t),value:e,inclusive:!0})}function zc(e){return je(0,e)}function vc(e){return Ae(0,e)}function Rc(e){return we(0,e)}function wc(e){return fe(0,e)}function bt(e,t){return new Nu({check:"multiple_of",...z(t),value:e})}function yt(e,t){return new Au({check:"max_size",...z(t),maximum:e})}function Le(e,t){return new ju({check:"min_size",...z(t),minimum:e})}function Yt(e,t){return new Lu({check:"size_equals",...z(t),size:e})}function Qt(e,t){return new Uu({check:"max_length",...z(t),maximum:e})}function Qe(e,t){return new Zu({check:"min_length",...z(t),minimum:e})}function Xt(e,t){return new Du({check:"length_equals",...z(t),length:e})}function Ho(e,t){return new Vu({check:"string_format",format:"regex",...z(t),pattern:e})}function Fo(e){return new Hu({check:"string_format",format:"lowercase",...z(e)})}function Jo(e){return new Fu({check:"string_format",format:"uppercase",...z(e)})}function Bo(e,t){return new Ju({check:"string_format",format:"includes",...z(t),includes:e})}function Wo(e,t){return new Bu({check:"string_format",format:"starts_with",...z(t),prefix:e})}function Go(e,t){return new Wu({check:"string_format",format:"ends_with",...z(t),suffix:e})}function xc(e,t,o){return new Gu({check:"property",property:e,schema:t,...z(o)})}function Ko(e,t){return new Ku({check:"mime_type",mime:e,...z(t)})}function Ie(e){return new Yu({check:"overwrite",tx:e})}function Yo(e){return Ie(t=>t.normalize(e))}function Qo(){return Ie(e=>e.trim())}function Xo(){return Ie(e=>e.toLowerCase())}function er(){return Ie(e=>e.toUpperCase())}function tr(){return Ie(e=>Jl(e))}function Dp(e,t,o){return new e({type:"array",element:t,...z(o)})}function Mb(e,t,o){return new e({type:"union",options:t,...z(o)})}function qb(e,t,o){return new e({type:"union",options:t,inclusive:!1,...z(o)})}function Ab(e,t,o,r){return new e({type:"union",options:o,discriminator:t,...z(r)})}function jb(e,t,o){return new e({type:"intersection",left:t,right:o})}function Lb(e,t,o,r){let n=o instanceof N,s=n?r:o,i=n?o:null;return new e({type:"tuple",items:t,rest:i,...z(s)})}function Ub(e,t,o,r){return new e({type:"record",keyType:t,valueType:o,...z(r)})}function Zb(e,t,o,r){return new e({type:"map",keyType:t,valueType:o,...z(r)})}function Db(e,t,o){return new e({type:"set",valueType:t,...z(o)})}function Vb(e,t,o){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:r,...z(o)})}function Hb(e,t,o){return new e({type:"enum",entries:t,...z(o)})}function Fb(e,t,o){return new e({type:"literal",values:Array.isArray(t)?t:[t],...z(o)})}function Vp(e,t){return new e({type:"file",...z(t)})}function Jb(e,t){return new e({type:"transform",transform:t})}function Bb(e,t){return new e({type:"optional",innerType:t})}function Wb(e,t){return new e({type:"nullable",innerType:t})}function Gb(e,t,o){return new e({type:"default",innerType:t,get defaultValue(){return typeof o=="function"?o():Wl(o)}})}function Kb(e,t,o){return new e({type:"nonoptional",innerType:t,...z(o)})}function Yb(e,t){return new e({type:"success",innerType:t})}function Qb(e,t,o){return new e({type:"catch",innerType:t,catchValue:typeof o=="function"?o:()=>o})}function Xb(e,t,o){return new e({type:"pipe",in:t,out:o})}function ey(e,t){return new e({type:"readonly",innerType:t})}function ty(e,t,o){return new e({type:"template_literal",parts:t,...z(o)})}function oy(e,t){return new e({type:"lazy",getter:t})}function ry(e,t){return new e({type:"promise",innerType:t})}function Hp(e,t,o){let r=z(o);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function Fp(e,t,o){return new e({type:"custom",check:"custom",fn:t,...z(o)})}function Jp(e,t){let o=Wf(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(jo(n,r.value,o._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=o),s.continue??(s.continue=!o._zod.def.abort),r.issues.push(jo(s))}},e(r.value,r)),t);return o}function Wf(e,t){let o=new H({check:"custom",...z(t)});return o._zod.check=e,o}function Bp(e){let t=new H({check:"describe"});return t._zod.onattach=[o=>{let r=re.get(o)??{};re.add(o,{...r,description:e})}],t._zod.check=()=>{},t}function Wp(e){let t=new H({check:"meta"});return t._zod.onattach=[o=>{let r=re.get(o)??{};re.add(o,{...r,...e})}],t._zod.check=()=>{},t}function Gp(e,t){let o=z(t),r=o.truthy??["true","1","yes","on","y","enabled"],n=o.falsy??["false","0","no","off","n","disabled"];o.case!=="sensitive"&&(r=r.map(y=>typeof y=="string"?y.toLowerCase():y),n=n.map(y=>typeof y=="string"?y.toLowerCase():y));let s=new Set(r),i=new Set(n),c=e.Codec??Yn,l=e.Boolean??Gn,d=e.String??Kt,m=new d({type:"string",error:o.error}),S=new l({type:"boolean",error:o.error}),_=new c({type:"pipe",in:m,out:S,transform:((y,k)=>{let $=y;return o.case!=="sensitive"&&($=$.toLowerCase()),s.has($)?!0:i.has($)?!1:(k.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...i],input:k.value,inst:_,continue:!1}),{})}),reverseTransform:((y,k)=>y===!0?r[0]||"true":n[0]||"false"),error:o.error});return _}function or(e,t,o,r={}){let n=z(r),s={...z(r),check:"string_format",type:"string",format:t,fn:typeof o=="function"?o:c=>o.test(c),...n};return o instanceof RegExp&&(s.pattern=o),new e(s)}function zt(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??re,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function L(e,t,o={path:[],schemaPath:[]}){var r;let n=e._zod.def,s=t.seen.get(e);if(s)return s.count++,o.schemaPath.includes(e)&&(s.cycle=o.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:o.path};t.seen.set(e,i);let c=e._zod.toJSONSchema?.();if(c)i.schema=c;else{let m={...o,schemaPath:[...o.schemaPath,e],path:o.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,m);else{let _=i.schema,y=t.processors[n.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);y(e,t,_,m)}let S=e._zod.parent;S&&(i.ref||(i.ref=S),L(S,t,m),t.seen.get(S).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(i.schema,l),t.io==="input"&&ge(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function vt(e,t){let o=e.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let i of e.seen.entries()){let c=e.metadataRegistry.get(i[0])?.id;if(c){let l=r.get(c);if(l&&l!==i[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,i[0])}}let n=i=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let S=e.external.registry.get(i[0])?.id,_=e.external.uri??(k=>k);if(S)return{ref:_(S)};let y=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=y,{defId:y,ref:`${_("__shared")}#/${c}/${y}`}}if(i[1]===o)return{ref:"#"};let d=`#/${c}/`,m=i[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:d+m}},s=i=>{if(i[1].schema.$ref)return;let c=i[1],{ref:l,defId:d}=n(i);c.def={...c.schema},d&&(c.defId=d);let m=c.schema;for(let S in m)delete m[S];m.$ref=l};if(e.cycles==="throw")for(let i of e.seen.entries()){let c=i[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
63
+ `)}b.write("payload.value = newResult;"),b.write("return payload;");let J=b.compile();return(L,U)=>J(_,L,U)},s,i=Gt,c=!Wt.jitless,d=c&&Bl.value,m=t.catchall,S;e._zod.parse=(_,b)=>{S??(S=r.value);let P=_.value;return i(P)?c&&d&&b?.async===!1&&b.jitless!==!0?(s||(s=n(t.shape)),_=s(_,b),m?Ff([],P,_,b,S,e):_):o(_,b):(_.issues.push({expected:"object",code:"invalid_type",input:P,inst:e}),_)}});function $f(e,t,o,r){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let n=e.filter(s=>!_t(s));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(s=>s.issues.map(i=>me(i,r,Y())))}),t)}var Kn=h("$ZodUnion",(e,t)=>{N.init(e,t),A(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),A(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),A(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),A(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>Ln(n.source)).join("|")})$`)}});let o=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,n)=>{if(o)return o(r,n);let s=!1,i=[];for(let c of t.options){let l=c._zod.run({value:r.value,issues:[]},n);if(l instanceof Promise)i.push(l),s=!0;else{if(l.issues.length===0)return l;i.push(l)}}return s?Promise.all(i).then(c=>$f(c,r,e,n)):$f(i,r,e,n)}});function Ef(e,t,o,r){let n=e.filter(s=>s.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(s=>s.issues.map(i=>me(i,r,Y())))}):t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:[],inclusive:!1}),t)}var jd=h("$ZodXor",(e,t)=>{Kn.init(e,t),t.inclusive=!1;let o=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,n)=>{if(o)return o(r,n);let s=!1,i=[];for(let c of t.options){let l=c._zod.run({value:r.value,issues:[]},n);l instanceof Promise?(i.push(l),s=!0):i.push(l)}return s?Promise.all(i).then(c=>Ef(c,r,e,n)):Ef(i,r,e,n)}}),Ld=h("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Kn.init(e,t);let o=e._zod.parse;A(e._zod,"propValues",()=>{let n={};for(let s of t.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[c,l]of Object.entries(i)){n[c]||(n[c]=new Set);for(let d of l)n[c].add(d)}}return n});let r=jo(()=>{let n=t.options,s=new Map;for(let i of n){let c=i._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let l of c){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,i)}}return s});e._zod.parse=(n,s)=>{let i=n.value;if(!Gt(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let c=r.value.get(i?.[t.discriminator]);return c?c._zod.run(n,s):t.unionFallback||s.direction==="backward"?o(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:i,path:[t.discriminator],inst:e}),n)}}),Ud=h("$ZodIntersection",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value,s=t.left._zod.run({value:n,issues:[]},r),i=t.right._zod.run({value:n,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([l,d])=>Cf(o,l,d)):Cf(o,s,i)}});function Xu(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(St(e)&&St(t)){let o=Object.keys(t),r=Object.keys(e).filter(s=>o.indexOf(s)!==-1),n={...e,...t};for(let s of r){let i=Xu(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let o=[];for(let r=0;r<e.length;r++){let n=e[r],s=t[r],i=Xu(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};o.push(i.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function Cf(e,t,o){let r=new Map,n;for(let c of t.issues)if(c.code==="unrecognized_keys"){n??(n=c);for(let l of c.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(c);for(let c of o.issues)if(c.code==="unrecognized_keys")for(let l of c.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(c);let s=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&n&&e.issues.push({...n,keys:s}),_t(e))return e;let i=Xu(t.value,o.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}var Ga=h("$ZodTuple",(e,t)=>{N.init(e,t);let o=t.items;e._zod.parse=(r,n)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let i=[],c=If(o,"optin"),l=If(o,"optout");if(!t.rest){if(s.length<c)return r.issues.push({code:"too_small",minimum:c,inclusive:!0,input:s,inst:e,origin:"array"}),r;s.length>o.length&&r.issues.push({code:"too_big",maximum:o.length,inclusive:!0,input:s,inst:e,origin:"array"})}let d=new Array(o.length);for(let m=0;m<o.length;m++){let S=o[m]._zod.run({value:s[m],issues:[]},n);S instanceof Promise?i.push(S.then(_=>{d[m]=_})):d[m]=S}if(t.rest){let m=o.length-1,S=s.slice(o.length);for(let _ of S){m++;let b=t.rest._zod.run({value:_,issues:[]},n);b instanceof Promise?i.push(b.then(P=>Of(P,r,m))):Of(b,r,m)}}return i.length?Promise.all(i).then(()=>Nf(d,r,o,s,l)):Nf(d,r,o,s,l)}});function If(e,t){for(let o=e.length-1;o>=0;o--)if(e[o]._zod[t]!=="optional")return o+1;return 0}function Of(e,t,o){e.issues.length&&t.issues.push(..._e(o,e.issues)),t.value[o]=e.value}function Nf(e,t,o,r,n){for(let s=0;s<o.length;s++){let i=e[s],c=s<r.length;if(i.issues.length){if(!c&&s>=n){t.value.length=s;break}t.issues.push(..._e(s,i.issues))}t.value[s]=i.value}for(let s=t.value.length-1;s>=r.length&&(o[s]._zod.optout==="optional"&&t.value[s]===void 0);s--)t.value.length=s;return t}var Zd=h("$ZodRecord",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!St(n))return o.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),o;let s=[],i=t.keyType._zod.values;if(i){o.value={};let c=new Set;for(let d of i)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){c.add(typeof d=="number"?d.toString():d);let m=t.keyType._zod.run({value:d,issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(m.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(b=>me(b,r,Y())),input:d,path:[d],inst:e});continue}let S=m.value,_=t.valueType._zod.run({value:n[d],issues:[]},r);_ instanceof Promise?s.push(_.then(b=>{b.issues.length&&o.issues.push(..._e(d,b.issues)),o.value[S]=b.value})):(_.issues.length&&o.issues.push(..._e(d,_.issues)),o.value[S]=_.value)}let l;for(let d in n)c.has(d)||(l=l??[],l.push(d));l&&l.length>0&&o.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:l})}else{o.value={};for(let c of Reflect.ownKeys(n)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,c))continue;let l=t.keyType._zod.run({value:c,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&Ua.test(c)&&l.issues.length){let S=t.keyType._zod.run({value:Number(c),issues:[]},r);if(S instanceof Promise)throw new Error("Async schemas not supported in object keys currently");S.issues.length===0&&(l=S)}if(l.issues.length){t.mode==="loose"?o.value[c]=n[c]:o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(S=>me(S,r,Y())),input:c,path:[c],inst:e});continue}let m=t.valueType._zod.run({value:n[c],issues:[]},r);m instanceof Promise?s.push(m.then(S=>{S.issues.length&&o.issues.push(..._e(c,S.issues)),o.value[l.value]=S.value})):(m.issues.length&&o.issues.push(..._e(c,m.issues)),o.value[l.value]=m.value)}}return s.length?Promise.all(s).then(()=>o):o}}),Dd=h("$ZodMap",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!(n instanceof Map))return o.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),o;let s=[];o.value=new Map;for(let[i,c]of n){let l=t.keyType._zod.run({value:i,issues:[]},r),d=t.valueType._zod.run({value:c,issues:[]},r);l instanceof Promise||d instanceof Promise?s.push(Promise.all([l,d]).then(([m,S])=>{Mf(m,S,o,i,n,e,r)})):Mf(l,d,o,i,n,e,r)}return s.length?Promise.all(s).then(()=>o):o}});function Mf(e,t,o,r,n,s,i){e.issues.length&&(Un.has(typeof r)?o.issues.push(..._e(r,e.issues)):o.issues.push({code:"invalid_key",origin:"map",input:n,inst:s,issues:e.issues.map(c=>me(c,i,Y()))})),t.issues.length&&(Un.has(typeof r)?o.issues.push(..._e(r,t.issues)):o.issues.push({origin:"map",code:"invalid_element",input:n,inst:s,key:r,issues:t.issues.map(c=>me(c,i,Y()))})),o.value.set(e.value,t.value)}var Vd=h("$ZodSet",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!(n instanceof Set))return o.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),o;let s=[];o.value=new Set;for(let i of n){let c=t.valueType._zod.run({value:i,issues:[]},r);c instanceof Promise?s.push(c.then(l=>qf(l,o))):qf(c,o)}return s.length?Promise.all(s).then(()=>o):o}});function qf(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Hd=h("$ZodEnum",(e,t)=>{N.init(e,t);let o=jn(t.entries),r=new Set(o);e._zod.values=r,e._zod.pattern=new RegExp(`^(${o.filter(n=>Un.has(typeof n)).map(n=>typeof n=="string"?ke(n):n.toString()).join("|")})$`),e._zod.parse=(n,s)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:o,input:i,inst:e}),n}}),Fd=h("$ZodLiteral",(e,t)=>{if(N.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let o=new Set(t.values);e._zod.values=o,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?ke(r):r?ke(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let s=r.value;return o.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),Jd=h("$ZodFile",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;return n instanceof File||o.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),o}}),Bd=h("$ZodTransform",(e,t)=>{N.init(e,t),e._zod.optin="optional",e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new mt(e.constructor.name);let n=t.transform(o.value,o);if(r.async)return(n instanceof Promise?n:Promise.resolve(n)).then(i=>(o.value=i,o.fallback=!0,o));if(n instanceof Promise)throw new Ce;return o.value=n,o.fallback=!0,o}});function Af(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Ka=h("$ZodOptional",(e,t)=>{N.init(e,t),e._zod.optin="optional",e._zod.optout="optional",A(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),A(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Ln(o.source)})?$`):void 0}),e._zod.parse=(o,r)=>{if(t.innerType._zod.optin==="optional"){let n=o.value,s=t.innerType._zod.run(o,r);return s instanceof Promise?s.then(i=>Af(i,n)):Af(s,n)}return o.value===void 0?o:t.innerType._zod.run(o,r)}}),Wd=h("$ZodExactOptional",(e,t)=>{Ka.init(e,t),A(e._zod,"values",()=>t.innerType._zod.values),A(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(o,r)=>t.innerType._zod.run(o,r)}),Gd=h("$ZodNullable",(e,t)=>{N.init(e,t),A(e._zod,"optin",()=>t.innerType._zod.optin),A(e._zod,"optout",()=>t.innerType._zod.optout),A(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Ln(o.source)}|null)$`):void 0}),A(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,r)=>o.value===null?o:t.innerType._zod.run(o,r)}),Kd=h("$ZodDefault",(e,t)=>{N.init(e,t),e._zod.optin="optional",A(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);if(o.value===void 0)return o.value=t.defaultValue,o;let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(s=>jf(s,t)):jf(n,t)}});function jf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Yd=h("$ZodPrefault",(e,t)=>{N.init(e,t),e._zod.optin="optional",A(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>(r.direction==="backward"||o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,r))}),Qd=h("$ZodNonOptional",(e,t)=>{N.init(e,t),A(e._zod,"values",()=>{let o=t.innerType._zod.values;return o?new Set([...o].filter(r=>r!==void 0)):void 0}),e._zod.parse=(o,r)=>{let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(s=>Lf(s,e)):Lf(n,e)}});function Lf(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Xd=h("$ZodSuccess",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new mt("ZodSuccess");let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(s=>(o.value=s.issues.length===0,o)):(o.value=n.issues.length===0,o)}}),ep=h("$ZodCatch",(e,t)=>{N.init(e,t),e._zod.optin="optional",A(e._zod,"optout",()=>t.innerType._zod.optout),A(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(s=>(o.value=s.value,s.issues.length&&(o.value=t.catchValue({...o,error:{issues:s.issues.map(i=>me(i,r,Y()))},input:o.value}),o.issues=[],o.fallback=!0),o)):(o.value=n.value,n.issues.length&&(o.value=t.catchValue({...o,error:{issues:n.issues.map(s=>me(s,r,Y()))},input:o.value}),o.issues=[],o.fallback=!0),o)}}),tp=h("$ZodNaN",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>((typeof o.value!="number"||!Number.isNaN(o.value))&&o.issues.push({input:o.value,inst:e,expected:"nan",code:"invalid_type"}),o)}),Ya=h("$ZodPipe",(e,t)=>{N.init(e,t),A(e._zod,"values",()=>t.in._zod.values),A(e._zod,"optin",()=>t.in._zod.optin),A(e._zod,"optout",()=>t.out._zod.optout),A(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,r)=>{if(r.direction==="backward"){let s=t.out._zod.run(o,r);return s instanceof Promise?s.then(i=>Va(i,t.in,r)):Va(s,t.in,r)}let n=t.in._zod.run(o,r);return n instanceof Promise?n.then(s=>Va(s,t.out,r)):Va(n,t.out,r)}});function Va(e,t,o){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},o)}var Yn=h("$ZodCodec",(e,t)=>{N.init(e,t),A(e._zod,"values",()=>t.in._zod.values),A(e._zod,"optin",()=>t.in._zod.optin),A(e._zod,"optout",()=>t.out._zod.optout),A(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,r)=>{if((r.direction||"forward")==="forward"){let s=t.in._zod.run(o,r);return s instanceof Promise?s.then(i=>Ha(i,t,r)):Ha(s,t,r)}else{let s=t.out._zod.run(o,r);return s instanceof Promise?s.then(i=>Ha(i,t,r)):Ha(s,t,r)}}});function Ha(e,t,o){if(e.issues.length)return e.aborted=!0,e;if((o.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(s=>Fa(e,s,t.out,o)):Fa(e,n,t.out,o)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(s=>Fa(e,s,t.in,o)):Fa(e,n,t.in,o)}}function Fa(e,t,o,r){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},r)}var op=h("$ZodPreprocess",(e,t)=>{Ya.init(e,t)}),rp=h("$ZodReadonly",(e,t)=>{N.init(e,t),A(e._zod,"propValues",()=>t.innerType._zod.propValues),A(e._zod,"values",()=>t.innerType._zod.values),A(e._zod,"optin",()=>t.innerType?._zod?.optin),A(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(Uf):Uf(n)}});function Uf(e){return e.value=Object.freeze(e.value),e}var np=h("$ZodTemplateLiteral",(e,t)=>{N.init(e,t);let o=[];for(let r of t.parts)if(typeof r=="object"&&r!==null){if(!r._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);let n=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${r._zod.traits}`);let s=n.startsWith("^")?1:0,i=n.endsWith("$")?n.length-1:n.length;o.push(n.slice(s,i))}else if(r===null||Gl.has(typeof r))o.push(ke(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${o.join("")}$`),e._zod.parse=(r,n)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),sp=h("$ZodFunction",(e,t)=>(N.init(e,t),e._def=t,e._zod.def=t,e.implement=o=>{if(typeof o!="function")throw new Error("implement() must be called with a function");return function(...r){let n=e._def.input?$a(e._def.input,r):r,s=Reflect.apply(o,this,n);return e._def.output?$a(e._def.output,s):s}},e.implementAsync=o=>{if(typeof o!="function")throw new Error("implementAsync() must be called with a function");return async function(...r){let n=e._def.input?await Ea(e._def.input,r):r,s=await Reflect.apply(o,this,n);return e._def.output?await Ea(e._def.output,s):s}},e._zod.parse=(o,r)=>typeof o.value!="function"?(o.issues.push({code:"invalid_type",expected:"function",input:o.value,inst:e}),o):(e._def.output&&e._def.output._zod.def.type==="promise"?o.value=e.implementAsync(o.value):o.value=e.implement(o.value),o),e.input=(...o)=>{let r=e.constructor;return Array.isArray(o[0])?new r({type:"function",input:new Ga({type:"tuple",items:o[0],rest:o[1]}),output:e._def.output}):new r({type:"function",input:o[0],output:e._def.output})},e.output=o=>{let r=e.constructor;return new r({type:"function",input:e._def.input,output:o})},e)),ip=h("$ZodPromise",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>Promise.resolve(o.value).then(n=>t.innerType._zod.run({value:n,issues:[]},r))}),ap=h("$ZodLazy",(e,t)=>{N.init(e,t),A(e._zod,"innerType",()=>{let o=t;return o._cachedInner||(o._cachedInner=t.getter()),o._cachedInner}),A(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),A(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),A(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),A(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(o,r)=>e._zod.innerType._zod.run(o,r)}),cp=h("$ZodCustom",(e,t)=>{H.init(e,t),N.init(e,t),e._zod.parse=(o,r)=>o,e._zod.check=o=>{let r=o.value,n=t.fn(r);if(n instanceof Promise)return n.then(s=>Zf(s,o,r,e));Zf(n,o,r,e)}});function Zf(e,t,o,r){if(!e){let n={code:"custom",input:o,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(n.params=r._zod.def.params),t.issues.push(Lo(n))}}var Qn={};Ke(Qn,{en:()=>Qa});var qb=()=>{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(n){return e[n]??null}let o={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",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,i=eu(n.input),c=r[i]??i;return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${ka(n.values[0])}`:`Invalid option: expected one of ${xa(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",i=t(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${s}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",i=t(n.origin);return i?`Too small: expected ${n.origin} to have ${s}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${o[s.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${xa(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Qa(){return{localeError:qb()}}var Bf,lp=Symbol("ZodOutput"),up=Symbol("ZodInput"),Xa=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){let r=o[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let o=this._map.get(t);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(t),this}get(t){let o=t._zod.parent;if(o){let r={...this.get(o)??{}};delete r.id;let n={...r,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function ec(){return new Xa}(Bf=globalThis).__zod_globalRegistry??(Bf.__zod_globalRegistry=ec());var re=globalThis.__zod_globalRegistry;function dp(e,t){return new e({type:"string",...z(t)})}function pp(e,t){return new e({type:"string",coerce:!0,...z(t)})}function tc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...z(t)})}function Xn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...z(t)})}function oc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...z(t)})}function rc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(t)})}function nc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(t)})}function sc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(t)})}function es(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...z(t)})}function ic(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...z(t)})}function ac(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(t)})}function cc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...z(t)})}function lc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(t)})}function uc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...z(t)})}function dc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...z(t)})}function pc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(t)})}function hc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(t)})}function mc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(t)})}function hp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...z(t)})}function fc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(t)})}function gc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(t)})}function Sc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...z(t)})}function _c(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...z(t)})}function bc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...z(t)})}function yc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...z(t)})}var mp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function fp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(t)})}function gp(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function Sp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function _p(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function bp(e,t){return new e({type:"number",checks:[],...z(t)})}function yp(e,t){return new e({type:"number",coerce:!0,checks:[],...z(t)})}function zp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...z(t)})}function vp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...z(t)})}function Rp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...z(t)})}function wp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...z(t)})}function xp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...z(t)})}function Pp(e,t){return new e({type:"boolean",...z(t)})}function Tp(e,t){return new e({type:"boolean",coerce:!0,...z(t)})}function kp(e,t){return new e({type:"bigint",...z(t)})}function $p(e,t){return new e({type:"bigint",coerce:!0,...z(t)})}function Ep(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...z(t)})}function Cp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...z(t)})}function Ip(e,t){return new e({type:"symbol",...z(t)})}function Op(e,t){return new e({type:"undefined",...z(t)})}function Np(e,t){return new e({type:"null",...z(t)})}function Mp(e){return new e({type:"any"})}function qp(e){return new e({type:"unknown"})}function Ap(e,t){return new e({type:"never",...z(t)})}function jp(e,t){return new e({type:"void",...z(t)})}function Lp(e,t){return new e({type:"date",...z(t)})}function Up(e,t){return new e({type:"date",coerce:!0,...z(t)})}function Zp(e,t){return new e({type:"nan",...z(t)})}function Ae(e,t){return new Za({check:"less_than",...z(t),value:e,inclusive:!1})}function we(e,t){return new Za({check:"less_than",...z(t),value:e,inclusive:!0})}function je(e,t){return new Da({check:"greater_than",...z(t),value:e,inclusive:!1})}function fe(e,t){return new Da({check:"greater_than",...z(t),value:e,inclusive:!0})}function zc(e){return je(0,e)}function vc(e){return Ae(0,e)}function Rc(e){return we(0,e)}function wc(e){return fe(0,e)}function bt(e,t){return new Nu({check:"multiple_of",...z(t),value:e})}function yt(e,t){return new Au({check:"max_size",...z(t),maximum:e})}function Le(e,t){return new ju({check:"min_size",...z(t),minimum:e})}function Qt(e,t){return new Lu({check:"size_equals",...z(t),size:e})}function Xt(e,t){return new Uu({check:"max_length",...z(t),maximum:e})}function Qe(e,t){return new Zu({check:"min_length",...z(t),minimum:e})}function eo(e,t){return new Du({check:"length_equals",...z(t),length:e})}function Fo(e,t){return new Vu({check:"string_format",format:"regex",...z(t),pattern:e})}function Jo(e){return new Hu({check:"string_format",format:"lowercase",...z(e)})}function Bo(e){return new Fu({check:"string_format",format:"uppercase",...z(e)})}function Wo(e,t){return new Ju({check:"string_format",format:"includes",...z(t),includes:e})}function Go(e,t){return new Bu({check:"string_format",format:"starts_with",...z(t),prefix:e})}function Ko(e,t){return new Wu({check:"string_format",format:"ends_with",...z(t),suffix:e})}function xc(e,t,o){return new Gu({check:"property",property:e,schema:t,...z(o)})}function Yo(e,t){return new Ku({check:"mime_type",mime:e,...z(t)})}function Ie(e){return new Yu({check:"overwrite",tx:e})}function Qo(e){return Ie(t=>t.normalize(e))}function Xo(){return Ie(e=>e.trim())}function er(){return Ie(e=>e.toLowerCase())}function tr(){return Ie(e=>e.toUpperCase())}function or(){return Ie(e=>Jl(e))}function Dp(e,t,o){return new e({type:"array",element:t,...z(o)})}function jb(e,t,o){return new e({type:"union",options:t,...z(o)})}function Lb(e,t,o){return new e({type:"union",options:t,inclusive:!1,...z(o)})}function Ub(e,t,o,r){return new e({type:"union",options:o,discriminator:t,...z(r)})}function Zb(e,t,o){return new e({type:"intersection",left:t,right:o})}function Db(e,t,o,r){let n=o instanceof N,s=n?r:o,i=n?o:null;return new e({type:"tuple",items:t,rest:i,...z(s)})}function Vb(e,t,o,r){return new e({type:"record",keyType:t,valueType:o,...z(r)})}function Hb(e,t,o,r){return new e({type:"map",keyType:t,valueType:o,...z(r)})}function Fb(e,t,o){return new e({type:"set",valueType:t,...z(o)})}function Jb(e,t,o){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:r,...z(o)})}function Bb(e,t,o){return new e({type:"enum",entries:t,...z(o)})}function Wb(e,t,o){return new e({type:"literal",values:Array.isArray(t)?t:[t],...z(o)})}function Vp(e,t){return new e({type:"file",...z(t)})}function Gb(e,t){return new e({type:"transform",transform:t})}function Kb(e,t){return new e({type:"optional",innerType:t})}function Yb(e,t){return new e({type:"nullable",innerType:t})}function Qb(e,t,o){return new e({type:"default",innerType:t,get defaultValue(){return typeof o=="function"?o():Wl(o)}})}function Xb(e,t,o){return new e({type:"nonoptional",innerType:t,...z(o)})}function ey(e,t){return new e({type:"success",innerType:t})}function ty(e,t,o){return new e({type:"catch",innerType:t,catchValue:typeof o=="function"?o:()=>o})}function oy(e,t,o){return new e({type:"pipe",in:t,out:o})}function ry(e,t){return new e({type:"readonly",innerType:t})}function ny(e,t,o){return new e({type:"template_literal",parts:t,...z(o)})}function sy(e,t){return new e({type:"lazy",getter:t})}function iy(e,t){return new e({type:"promise",innerType:t})}function Hp(e,t,o){let r=z(o);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function Fp(e,t,o){return new e({type:"custom",check:"custom",fn:t,...z(o)})}function Jp(e,t){let o=Wf(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Lo(n,r.value,o._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=o),s.continue??(s.continue=!o._zod.def.abort),r.issues.push(Lo(s))}},e(r.value,r)),t);return o}function Wf(e,t){let o=new H({check:"custom",...z(t)});return o._zod.check=e,o}function Bp(e){let t=new H({check:"describe"});return t._zod.onattach=[o=>{let r=re.get(o)??{};re.add(o,{...r,description:e})}],t._zod.check=()=>{},t}function Wp(e){let t=new H({check:"meta"});return t._zod.onattach=[o=>{let r=re.get(o)??{};re.add(o,{...r,...e})}],t._zod.check=()=>{},t}function Gp(e,t){let o=z(t),r=o.truthy??["true","1","yes","on","y","enabled"],n=o.falsy??["false","0","no","off","n","disabled"];o.case!=="sensitive"&&(r=r.map(b=>typeof b=="string"?b.toLowerCase():b),n=n.map(b=>typeof b=="string"?b.toLowerCase():b));let s=new Set(r),i=new Set(n),c=e.Codec??Yn,l=e.Boolean??Gn,d=e.String??Yt,m=new d({type:"string",error:o.error}),S=new l({type:"boolean",error:o.error}),_=new c({type:"pipe",in:m,out:S,transform:((b,P)=>{let $=b;return o.case!=="sensitive"&&($=$.toLowerCase()),s.has($)?!0:i.has($)?!1:(P.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...i],input:P.value,inst:_,continue:!1}),{})}),reverseTransform:((b,P)=>b===!0?r[0]||"true":n[0]||"false"),error:o.error});return _}function rr(e,t,o,r={}){let n=z(r),s={...z(r),check:"string_format",type:"string",format:t,fn:typeof o=="function"?o:c=>o.test(c),...n};return o instanceof RegExp&&(s.pattern=o),new e(s)}function zt(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??re,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Z(e,t,o={path:[],schemaPath:[]}){var r;let n=e._zod.def,s=t.seen.get(e);if(s)return s.count++,o.schemaPath.includes(e)&&(s.cycle=o.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:o.path};t.seen.set(e,i);let c=e._zod.toJSONSchema?.();if(c)i.schema=c;else{let m={...o,schemaPath:[...o.schemaPath,e],path:o.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,m);else{let _=i.schema,b=t.processors[n.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);b(e,t,_,m)}let S=e._zod.parent;S&&(i.ref||(i.ref=S),Z(S,t,m),t.seen.get(S).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(i.schema,l),t.io==="input"&&ge(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function vt(e,t){let o=e.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let i of e.seen.entries()){let c=e.metadataRegistry.get(i[0])?.id;if(c){let l=r.get(c);if(l&&l!==i[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,i[0])}}let n=i=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let S=e.external.registry.get(i[0])?.id,_=e.external.uri??(P=>P);if(S)return{ref:_(S)};let b=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=b,{defId:b,ref:`${_("__shared")}#/${c}/${b}`}}if(i[1]===o)return{ref:"#"};let d=`#/${c}/`,m=i[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:d+m}},s=i=>{if(i[1].schema.$ref)return;let c=i[1],{ref:l,defId:d}=n(i);c.def={...c.schema},d&&(c.defId=d);let m=c.schema;for(let S in m)delete m[S];m.$ref=l};if(e.cycles==="throw")for(let i of e.seen.entries()){let c=i[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
64
64
 
65
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let c=i[1];if(t===i[0]){s(i);continue}if(e.external){let d=e.external.registry.get(i[0])?.id;if(t!==i[0]&&d){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(c.cycle){s(i);continue}if(c.count>1&&e.reused==="ref"){s(i);continue}}}function Rt(e,t){let o=e.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=c=>{let l=e.seen.get(c);if(l.ref===null)return;let d=l.def??l.schema,m={...d},S=l.ref;if(l.ref=null,S){r(S);let y=e.seen.get(S),k=y.schema;if(k.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(k)):Object.assign(d,k),Object.assign(d,m),c._zod.parent===S)for(let I in d)I==="$ref"||I==="allOf"||I in m||delete d[I];if(k.$ref&&y.def)for(let I in d)I==="$ref"||I==="allOf"||I in y.def&&JSON.stringify(d[I])===JSON.stringify(y.def[I])&&delete d[I]}let _=c._zod.parent;if(_&&_!==S){r(_);let y=e.seen.get(_);if(y?.schema.$ref&&(d.$ref=y.schema.$ref,y.def))for(let k in d)k==="$ref"||k==="allOf"||k in y.def&&JSON.stringify(d[k])===JSON.stringify(y.def[k])&&delete d[k]}e.override({zodSchema:c,jsonSchema:d,path:l.path??[]})};for(let c of[...e.seen.entries()].reverse())r(c[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}Object.assign(n,o.def??o.schema);let s=e.metadataRegistry.get(t)?.id;s!==void 0&&n.id===s&&delete n.id;let i=e.external?.defs??{};for(let c of e.seen.entries()){let l=c[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,i[l.defId]=l.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:rr(t,"input",e.processors),output:rr(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function ge(e,t){let o=t??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return ge(r.element,o);if(r.type==="set")return ge(r.valueType,o);if(r.type==="lazy")return ge(r.getter(),o);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return ge(r.innerType,o);if(r.type==="intersection")return ge(r.left,o)||ge(r.right,o);if(r.type==="record"||r.type==="map")return ge(r.keyType,o)||ge(r.valueType,o);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ge(r.in,o)||ge(r.out,o);if(r.type==="object"){for(let n in r.shape)if(ge(r.shape[n],o))return!0;return!1}if(r.type==="union"){for(let n of r.options)if(ge(n,o))return!0;return!1}if(r.type==="tuple"){for(let n of r.items)if(ge(n,o))return!0;return!!(r.rest&&ge(r.rest,o))}return!1}var Kp=(e,t={})=>o=>{let r=zt({...o,processors:t});return L(e,r),vt(r,e),Rt(r,e)},rr=(e,t,o={})=>r=>{let{libraryOptions:n,target:s}=r??{},i=zt({...n??{},target:s,io:t,processors:o});return L(e,i),vt(i,e),Rt(i,e)};var ny={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Yp=(e,t,o,r)=>{let n=o;n.type="string";let{minimum:s,maximum:i,format:c,patterns:l,contentEncoding:d}=e._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),c&&(n.format=ny[c]??c,n.format===""&&delete n.format,c==="time"&&delete n.format),d&&(n.contentEncoding=d),l&&l.size>0){let m=[...l];m.length===1?n.pattern=m[0].source:m.length>1&&(n.allOf=[...m.map(S=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))])}},Qp=(e,t,o,r)=>{let n=o,{minimum:s,maximum:i,format:c,multipleOf:l,exclusiveMaximum:d,exclusiveMinimum:m}=e._zod.bag;typeof c=="string"&&c.includes("int")?n.type="integer":n.type="number";let S=typeof m=="number"&&m>=(s??Number.NEGATIVE_INFINITY),_=typeof d=="number"&&d<=(i??Number.POSITIVE_INFINITY),y=t.target==="draft-04"||t.target==="openapi-3.0";S?y?(n.minimum=m,n.exclusiveMinimum=!0):n.exclusiveMinimum=m:typeof s=="number"&&(n.minimum=s),_?y?(n.maximum=d,n.exclusiveMaximum=!0):n.exclusiveMaximum=d:typeof i=="number"&&(n.maximum=i),typeof l=="number"&&(n.multipleOf=l)},Xp=(e,t,o,r)=>{o.type="boolean"},eh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},th=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},oh=(e,t,o,r)=>{t.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},rh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},nh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},sh=(e,t,o,r)=>{o.not={}},ih=(e,t,o,r)=>{},ah=(e,t,o,r)=>{},ch=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},lh=(e,t,o,r)=>{let n=e._zod.def,s=jn(n.entries);s.every(i=>typeof i=="number")&&(o.type="number"),s.every(i=>typeof i=="string")&&(o.type="string"),o.enum=s},uh=(e,t,o,r)=>{let n=e._zod.def,s=[];for(let i of n.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];o.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?o.enum=[i]:o.const=i}else s.every(i=>typeof i=="number")&&(o.type="number"),s.every(i=>typeof i=="string")&&(o.type="string"),s.every(i=>typeof i=="boolean")&&(o.type="boolean"),s.every(i=>i===null)&&(o.type="null"),o.enum=s},dh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},ph=(e,t,o,r)=>{let n=o,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},hh=(e,t,o,r)=>{let n=o,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:c,mime:l}=e._zod.bag;i!==void 0&&(s.minLength=i),c!==void 0&&(s.maxLength=c),l?l.length===1?(s.contentMediaType=l[0],Object.assign(n,s)):(Object.assign(n,s),n.anyOf=l.map(d=>({contentMediaType:d}))):Object.assign(n,s)},mh=(e,t,o,r)=>{o.type="boolean"},fh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},gh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Sh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},_h=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},bh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},yh=(e,t,o,r)=>{let n=o,s=e._zod.def,{minimum:i,maximum:c}=e._zod.bag;typeof i=="number"&&(n.minItems=i),typeof c=="number"&&(n.maxItems=c),n.type="array",n.items=L(s.element,t,{...r,path:[...r.path,"items"]})},zh=(e,t,o,r)=>{let n=o,s=e._zod.def;n.type="object",n.properties={};let i=s.shape;for(let d in i)n.properties[d]=L(i[d],t,{...r,path:[...r.path,"properties",d]});let c=new Set(Object.keys(i)),l=new Set([...c].filter(d=>{let m=s.shape[d]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));l.size>0&&(n.required=Array.from(l)),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=L(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Tc=(e,t,o,r)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((c,l)=>L(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",l]}));s?o.oneOf=i:o.anyOf=i},vh=(e,t,o,r)=>{let n=e._zod.def,s=L(n.left,t,{...r,path:[...r.path,"allOf",0]}),i=L(n.right,t,{...r,path:[...r.path,"allOf",1]}),c=d=>"allOf"in d&&Object.keys(d).length===1,l=[...c(s)?s.allOf:[s],...c(i)?i.allOf:[i]];o.allOf=l},Rh=(e,t,o,r)=>{let n=o,s=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=s.items.map((_,y)=>L(_,t,{...r,path:[...r.path,i,y]})),d=s.rest?L(s.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=l,d&&(n.items=d)):t.target==="openapi-3.0"?(n.items={anyOf:l},d&&n.items.anyOf.push(d),n.minItems=l.length,d||(n.maxItems=l.length)):(n.items=l,d&&(n.additionalItems=d));let{minimum:m,maximum:S}=e._zod.bag;typeof m=="number"&&(n.minItems=m),typeof S=="number"&&(n.maxItems=S)},wh=(e,t,o,r)=>{let n=o,s=e._zod.def;n.type="object";let i=s.keyType,l=i._zod.bag?.patterns;if(s.mode==="loose"&&l&&l.size>0){let m=L(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});n.patternProperties={};for(let S of l)n.patternProperties[S.source]=m}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=L(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=L(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let d=i._zod.values;if(d){let m=[...d].filter(S=>typeof S=="string"||typeof S=="number");m.length>0&&(n.required=m)}},xh=(e,t,o,r)=>{let n=e._zod.def,s=L(n.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=n.innerType,o.nullable=!0):o.anyOf=[s,{type:"null"}]},Ph=(e,t,o,r)=>{let n=e._zod.def;L(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Th=(e,t,o,r)=>{let n=e._zod.def;L(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType,o.default=JSON.parse(JSON.stringify(n.defaultValue))},kh=(e,t,o,r)=>{let n=e._zod.def;L(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType,t.io==="input"&&(o._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Eh=(e,t,o,r)=>{let n=e._zod.def;L(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}o.default=i},$h=(e,t,o,r)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?n.out:n.in:n.out;L(i,t,r);let c=t.seen.get(e);c.ref=i},Ch=(e,t,o,r)=>{let n=e._zod.def;L(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType,o.readOnly=!0},Ih=(e,t,o,r)=>{let n=e._zod.def;L(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},kc=(e,t,o,r)=>{let n=e._zod.def;L(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Oh=(e,t,o,r)=>{let n=e._zod.innerType;L(n,t,r);let s=t.seen.get(e);s.ref=n},Pc={string:Yp,number:Qp,boolean:Xp,bigint:eh,symbol:th,null:oh,undefined:rh,void:nh,never:sh,any:ih,unknown:ah,date:ch,enum:lh,literal:uh,nan:dh,template_literal:ph,file:hh,success:mh,custom:fh,function:gh,transform:Sh,map:_h,set:bh,array:yh,object:zh,union:Tc,intersection:vh,tuple:Rh,record:wh,nullable:xh,nonoptional:Ph,default:Th,prefault:kh,catch:Eh,pipe:$h,readonly:Ch,promise:Ih,optional:kc,lazy:Oh};function eo(e,t){if("_idmap"in e){let r=e,n=zt({...t,processors:Pc}),s={};for(let l of r._idmap.entries()){let[d,m]=l;L(m,n)}let i={},c={registry:r,uri:t?.uri,defs:s};n.external=c;for(let l of r._idmap.entries()){let[d,m]=l;vt(n,m),i[d]=Rt(n,m)}if(Object.keys(s).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[l]:s}}return{schemas:i}}let o=zt({...t,processors:Pc});return L(e,o),vt(o,e),Rt(o,e)}var Ec=class{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 o=t?.target??"draft-2020-12";o==="draft-4"&&(o="draft-04"),o==="draft-7"&&(o="draft-07"),this.ctx=zt({processors:Pc,target:o,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,o={path:[],schemaPath:[]}){return L(t,this.ctx,o)}emit(t,o){o&&(o.cycles&&(this.ctx.cycles=o.cycles),o.reused&&(this.ctx.reused=o.reused),o.external&&(this.ctx.external=o.external)),vt(this.ctx,t);let r=Rt(this.ctx,t),{"~standard":n,...s}=r;return s}};var Gf={};var ts={};Ke(ts,{ZodAny:()=>Xh,ZodArray:()=>rm,ZodBase64:()=>Yc,ZodBase64URL:()=>Qc,ZodBigInt:()=>dr,ZodBigIntFormat:()=>tl,ZodBoolean:()=>ur,ZodCIDRv4:()=>Gc,ZodCIDRv6:()=>Kc,ZodCUID:()=>Dc,ZodCUID2:()=>Vc,ZodCatch:()=>Rm,ZodCodec:()=>ds,ZodCustom:()=>ps,ZodCustomStringFormat:()=>cr,ZodDate:()=>as,ZodDefault:()=>Sm,ZodDiscriminatedUnion:()=>sm,ZodE164:()=>Xc,ZodEmail:()=>jc,ZodEmoji:()=>Uc,ZodEnum:()=>sr,ZodExactOptional:()=>mm,ZodFile:()=>pm,ZodFunction:()=>Im,ZodGUID:()=>rs,ZodIPv4:()=>Bc,ZodIPv6:()=>Wc,ZodIntersection:()=>im,ZodJWT:()=>el,ZodKSUID:()=>Jc,ZodLazy:()=>$m,ZodLiteral:()=>dm,ZodMAC:()=>Gh,ZodMap:()=>lm,ZodNaN:()=>xm,ZodNanoID:()=>Zc,ZodNever:()=>tm,ZodNonOptional:()=>il,ZodNull:()=>Qh,ZodNullable:()=>gm,ZodNumber:()=>lr,ZodNumberFormat:()=>to,ZodObject:()=>cs,ZodOptional:()=>sl,ZodPipe:()=>us,ZodPrefault:()=>bm,ZodPreprocess:()=>Pm,ZodPromise:()=>Cm,ZodReadonly:()=>Tm,ZodRecord:()=>nr,ZodSet:()=>um,ZodString:()=>ir,ZodStringFormat:()=>D,ZodSuccess:()=>vm,ZodSymbol:()=>Kh,ZodTemplateLiteral:()=>Em,ZodTransform:()=>hm,ZodTuple:()=>am,ZodType:()=>M,ZodULID:()=>Hc,ZodURL:()=>is,ZodUUID:()=>Ue,ZodUndefined:()=>Yh,ZodUnion:()=>ls,ZodUnknown:()=>em,ZodVoid:()=>om,ZodXID:()=>Fc,ZodXor:()=>nm,_ZodString:()=>Ac,_default:()=>_m,_function:()=>Yg,any:()=>ol,array:()=>f,base64:()=>gg,base64url:()=>Sg,bigint:()=>kg,boolean:()=>R,catch:()=>wm,check:()=>Qg,cidrv4:()=>mg,cidrv6:()=>fg,codec:()=>Bg,cuid:()=>ig,cuid2:()=>ag,custom:()=>Xg,date:()=>Ng,describe:()=>eS,discriminatedUnion:()=>wt,e164:()=>_g,email:()=>Lc,emoji:()=>ng,enum:()=>C,exactOptional:()=>fm,file:()=>Vg,float32:()=>wg,float64:()=>xg,function:()=>Yg,guid:()=>Qf,hash:()=>Rg,hex:()=>vg,hostname:()=>zg,httpUrl:()=>rg,instanceof:()=>oS,int:()=>Mc,int32:()=>Pg,int64:()=>Eg,intersection:()=>Oe,invertCodec:()=>Wg,ipv4:()=>dg,ipv6:()=>hg,json:()=>nS,jwt:()=>bg,keyof:()=>Mg,ksuid:()=>ug,lazy:()=>xt,literal:()=>g,looseObject:()=>E,looseRecord:()=>Lg,mac:()=>pg,map:()=>Ug,meta:()=>tS,nan:()=>Jg,nanoid:()=>sg,nativeEnum:()=>Dg,never:()=>rl,nonoptional:()=>zm,null:()=>Ze,nullable:()=>ns,nullish:()=>Hg,number:()=>b,object:()=>p,optional:()=>T,partialRecord:()=>jg,pipe:()=>qc,prefault:()=>ym,preprocess:()=>et,promise:()=>Kg,readonly:()=>km,record:()=>v,refine:()=>Om,set:()=>Zg,strictObject:()=>qg,string:()=>a,stringFormat:()=>yg,stringbool:()=>rS,success:()=>Fg,superRefine:()=>Nm,symbol:()=>Cg,templateLiteral:()=>Gg,transform:()=>nl,tuple:()=>cm,uint32:()=>Tg,uint64:()=>$g,ulid:()=>cg,undefined:()=>Ig,union:()=>x,unknown:()=>P,url:()=>ar,uuid:()=>Xf,uuidv4:()=>eg,uuidv6:()=>tg,uuidv7:()=>og,void:()=>Og,xid:()=>lg,xor:()=>Ag});var $c={};Ke($c,{endsWith:()=>Go,gt:()=>je,gte:()=>fe,includes:()=>Bo,length:()=>Xt,lowercase:()=>Fo,lt:()=>Ae,lte:()=>we,maxLength:()=>Qt,maxSize:()=>yt,mime:()=>Ko,minLength:()=>Qe,minSize:()=>Le,multipleOf:()=>bt,negative:()=>vc,nonnegative:()=>wc,nonpositive:()=>Rc,normalize:()=>Yo,overwrite:()=>Ie,positive:()=>zc,property:()=>xc,regex:()=>Ho,size:()=>Yt,slugify:()=>tr,startsWith:()=>Wo,toLowerCase:()=>Xo,toUpperCase:()=>er,trim:()=>Qo,uppercase:()=>Jo});var xe={};Ke(xe,{ZodISODate:()=>Ic,ZodISODateTime:()=>Cc,ZodISODuration:()=>Nc,ZodISOTime:()=>Oc,date:()=>Mh,datetime:()=>Nh,duration:()=>Ah,time:()=>qh});var Cc=h("ZodISODateTime",(e,t)=>{dd.init(e,t),D.init(e,t)});function Nh(e){return fp(Cc,e)}var Ic=h("ZodISODate",(e,t)=>{pd.init(e,t),D.init(e,t)});function Mh(e){return gp(Ic,e)}var Oc=h("ZodISOTime",(e,t)=>{hd.init(e,t),D.init(e,t)});function qh(e){return Sp(Oc,e)}var Nc=h("ZodISODuration",(e,t)=>{md.init(e,t),D.init(e,t)});function Ah(e){return _p(Nc,e)}var Kf=(e,t)=>{Vn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>Fn(e,o)},flatten:{value:o=>Hn(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,qo,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,qo,2)}},isEmpty:{get(){return e.issues.length===0}}})},iy=h("ZodError",Kf),ye=h("ZodError",Kf,{Parent:Error});var jh=Lo(ye),Lh=Uo(ye),os=Zo(ye),Uh=Do(ye),Zh=Ca(ye),Dh=Ia(ye),Vh=Oa(ye),Hh=Na(ye),Fh=Ma(ye),Jh=qa(ye),Bh=Aa(ye),Wh=ja(ye);var Yf=new WeakMap;function ss(e,t,o){let r=Object.getPrototypeOf(e),n=Yf.get(r);if(n||(n=new Set,Yf.set(r,n)),!n.has(t)){n.add(t);for(let s in o){let i=o[s];Object.defineProperty(r,s,{configurable:!0,enumerable:!1,get(){let c=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}}var M=h("ZodType",(e,t)=>(N.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:rr(e,"input"),output:rr(e,"output")}}),e.toJSONSchema=Kp(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(o,r)=>jh(e,o,r,{callee:e.parse}),e.safeParse=(o,r)=>os(e,o,r),e.parseAsync=async(o,r)=>Lh(e,o,r,{callee:e.parseAsync}),e.safeParseAsync=async(o,r)=>Uh(e,o,r),e.spa=e.safeParseAsync,e.encode=(o,r)=>Zh(e,o,r),e.decode=(o,r)=>Dh(e,o,r),e.encodeAsync=async(o,r)=>Vh(e,o,r),e.decodeAsync=async(o,r)=>Hh(e,o,r),e.safeEncode=(o,r)=>Fh(e,o,r),e.safeDecode=(o,r)=>Jh(e,o,r),e.safeEncodeAsync=async(o,r)=>Bh(e,o,r),e.safeDecodeAsync=async(o,r)=>Wh(e,o,r),ss(e,"ZodType",{check(...o){let r=this.def;return this.clone(O.mergeDefs(r,{checks:[...r.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...o){return this.check(...o)},clone(o,r){return he(this,o,r)},brand(){return this},register(o,r){return o.add(this,r),this},refine(o,r){return this.check(Om(o,r))},superRefine(o,r){return this.check(Nm(o,r))},overwrite(o){return this.check(Ie(o))},optional(){return T(this)},exactOptional(){return fm(this)},nullable(){return ns(this)},nullish(){return T(ns(this))},nonoptional(o){return zm(this,o)},array(){return f(this)},or(o){return x([this,o])},and(o){return Oe(this,o)},transform(o){return qc(this,nl(o))},default(o){return _m(this,o)},prefault(o){return ym(this,o)},catch(o){return wm(this,o)},pipe(o){return qc(this,o)},readonly(){return km(this)},describe(o){let r=this.clone();return re.add(r,{description:o}),r},meta(...o){if(o.length===0)return re.get(this);let r=this.clone();return re.add(r,o[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(o){return o(this)}}),Object.defineProperty(e,"description",{get(){return re.get(e)?.description},configurable:!0}),e)),Ac=h("_ZodString",(e,t)=>{Kt.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Yp(e,r,n,s);let o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,ss(e,"_ZodString",{regex(...r){return this.check(Ho(...r))},includes(...r){return this.check(Bo(...r))},startsWith(...r){return this.check(Wo(...r))},endsWith(...r){return this.check(Go(...r))},min(...r){return this.check(Qe(...r))},max(...r){return this.check(Qt(...r))},length(...r){return this.check(Xt(...r))},nonempty(...r){return this.check(Qe(1,...r))},lowercase(r){return this.check(Fo(r))},uppercase(r){return this.check(Jo(r))},trim(){return this.check(Qo())},normalize(...r){return this.check(Yo(...r))},toLowerCase(){return this.check(Xo())},toUpperCase(){return this.check(er())},slugify(){return this.check(tr())}})}),ir=h("ZodString",(e,t)=>{Kt.init(e,t),Ac.init(e,t),e.email=o=>e.check(tc(jc,o)),e.url=o=>e.check(es(is,o)),e.jwt=o=>e.check(yc(el,o)),e.emoji=o=>e.check(ic(Uc,o)),e.guid=o=>e.check(Xn(rs,o)),e.uuid=o=>e.check(oc(Ue,o)),e.uuidv4=o=>e.check(rc(Ue,o)),e.uuidv6=o=>e.check(nc(Ue,o)),e.uuidv7=o=>e.check(sc(Ue,o)),e.nanoid=o=>e.check(ac(Zc,o)),e.guid=o=>e.check(Xn(rs,o)),e.cuid=o=>e.check(cc(Dc,o)),e.cuid2=o=>e.check(lc(Vc,o)),e.ulid=o=>e.check(uc(Hc,o)),e.base64=o=>e.check(Sc(Yc,o)),e.base64url=o=>e.check(_c(Qc,o)),e.xid=o=>e.check(dc(Fc,o)),e.ksuid=o=>e.check(pc(Jc,o)),e.ipv4=o=>e.check(hc(Bc,o)),e.ipv6=o=>e.check(mc(Wc,o)),e.cidrv4=o=>e.check(fc(Gc,o)),e.cidrv6=o=>e.check(gc(Kc,o)),e.e164=o=>e.check(bc(Xc,o)),e.datetime=o=>e.check(Nh(o)),e.date=o=>e.check(Mh(o)),e.time=o=>e.check(qh(o)),e.duration=o=>e.check(Ah(o))});function a(e){return dp(ir,e)}var D=h("ZodStringFormat",(e,t)=>{Z.init(e,t),Ac.init(e,t)}),jc=h("ZodEmail",(e,t)=>{od.init(e,t),D.init(e,t)});function Lc(e){return tc(jc,e)}var rs=h("ZodGUID",(e,t)=>{ed.init(e,t),D.init(e,t)});function Qf(e){return Xn(rs,e)}var Ue=h("ZodUUID",(e,t)=>{td.init(e,t),D.init(e,t)});function Xf(e){return oc(Ue,e)}function eg(e){return rc(Ue,e)}function tg(e){return nc(Ue,e)}function og(e){return sc(Ue,e)}var is=h("ZodURL",(e,t)=>{rd.init(e,t),D.init(e,t)});function ar(e){return es(is,e)}function rg(e){return es(is,{protocol:Re.httpProtocol,hostname:Re.domain,...O.normalizeParams(e)})}var Uc=h("ZodEmoji",(e,t)=>{nd.init(e,t),D.init(e,t)});function ng(e){return ic(Uc,e)}var Zc=h("ZodNanoID",(e,t)=>{sd.init(e,t),D.init(e,t)});function sg(e){return ac(Zc,e)}var Dc=h("ZodCUID",(e,t)=>{id.init(e,t),D.init(e,t)});function ig(e){return cc(Dc,e)}var Vc=h("ZodCUID2",(e,t)=>{ad.init(e,t),D.init(e,t)});function ag(e){return lc(Vc,e)}var Hc=h("ZodULID",(e,t)=>{cd.init(e,t),D.init(e,t)});function cg(e){return uc(Hc,e)}var Fc=h("ZodXID",(e,t)=>{ld.init(e,t),D.init(e,t)});function lg(e){return dc(Fc,e)}var Jc=h("ZodKSUID",(e,t)=>{ud.init(e,t),D.init(e,t)});function ug(e){return pc(Jc,e)}var Bc=h("ZodIPv4",(e,t)=>{fd.init(e,t),D.init(e,t)});function dg(e){return hc(Bc,e)}var Gh=h("ZodMAC",(e,t)=>{Sd.init(e,t),D.init(e,t)});function pg(e){return hp(Gh,e)}var Wc=h("ZodIPv6",(e,t)=>{gd.init(e,t),D.init(e,t)});function hg(e){return mc(Wc,e)}var Gc=h("ZodCIDRv4",(e,t)=>{_d.init(e,t),D.init(e,t)});function mg(e){return fc(Gc,e)}var Kc=h("ZodCIDRv6",(e,t)=>{bd.init(e,t),D.init(e,t)});function fg(e){return gc(Kc,e)}var Yc=h("ZodBase64",(e,t)=>{zd.init(e,t),D.init(e,t)});function gg(e){return Sc(Yc,e)}var Qc=h("ZodBase64URL",(e,t)=>{vd.init(e,t),D.init(e,t)});function Sg(e){return _c(Qc,e)}var Xc=h("ZodE164",(e,t)=>{Rd.init(e,t),D.init(e,t)});function _g(e){return bc(Xc,e)}var el=h("ZodJWT",(e,t)=>{wd.init(e,t),D.init(e,t)});function bg(e){return yc(el,e)}var cr=h("ZodCustomStringFormat",(e,t)=>{xd.init(e,t),D.init(e,t)});function yg(e,t,o={}){return or(cr,e,t,o)}function zg(e){return or(cr,"hostname",Re.hostname,e)}function vg(e){return or(cr,"hex",Re.hex,e)}function Rg(e,t){let o=t?.enc??"hex",r=`${e}_${o}`,n=Re[r];if(!n)throw new Error(`Unrecognized hash format: ${r}`);return or(cr,r,n,t)}var lr=h("ZodNumber",(e,t)=>{Ba.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Qp(e,r,n,s),ss(e,"ZodNumber",{gt(r,n){return this.check(je(r,n))},gte(r,n){return this.check(fe(r,n))},min(r,n){return this.check(fe(r,n))},lt(r,n){return this.check(Ae(r,n))},lte(r,n){return this.check(we(r,n))},max(r,n){return this.check(we(r,n))},int(r){return this.check(Mc(r))},safe(r){return this.check(Mc(r))},positive(r){return this.check(je(0,r))},nonnegative(r){return this.check(fe(0,r))},negative(r){return this.check(Ae(0,r))},nonpositive(r){return this.check(we(0,r))},multipleOf(r,n){return this.check(bt(r,n))},step(r,n){return this.check(bt(r,n))},finite(){return this}});let o=e._zod.bag;e.minValue=Math.max(o.minimum??Number.NEGATIVE_INFINITY,o.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(o.maximum??Number.POSITIVE_INFINITY,o.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(o.format??"").includes("int")||Number.isSafeInteger(o.multipleOf??.5),e.isFinite=!0,e.format=o.format??null});function b(e){return bp(lr,e)}var to=h("ZodNumberFormat",(e,t)=>{Pd.init(e,t),lr.init(e,t)});function Mc(e){return zp(to,e)}function wg(e){return vp(to,e)}function xg(e){return Rp(to,e)}function Pg(e){return wp(to,e)}function Tg(e){return xp(to,e)}var ur=h("ZodBoolean",(e,t)=>{Gn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Xp(e,o,r,n)});function R(e){return Pp(ur,e)}var dr=h("ZodBigInt",(e,t)=>{Wa.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>eh(e,r,n,s),e.gte=(r,n)=>e.check(fe(r,n)),e.min=(r,n)=>e.check(fe(r,n)),e.gt=(r,n)=>e.check(je(r,n)),e.gte=(r,n)=>e.check(fe(r,n)),e.min=(r,n)=>e.check(fe(r,n)),e.lt=(r,n)=>e.check(Ae(r,n)),e.lte=(r,n)=>e.check(we(r,n)),e.max=(r,n)=>e.check(we(r,n)),e.positive=r=>e.check(je(BigInt(0),r)),e.negative=r=>e.check(Ae(BigInt(0),r)),e.nonpositive=r=>e.check(we(BigInt(0),r)),e.nonnegative=r=>e.check(fe(BigInt(0),r)),e.multipleOf=(r,n)=>e.check(bt(r,n));let o=e._zod.bag;e.minValue=o.minimum??null,e.maxValue=o.maximum??null,e.format=o.format??null});function kg(e){return kp(dr,e)}var tl=h("ZodBigIntFormat",(e,t)=>{Td.init(e,t),dr.init(e,t)});function Eg(e){return $p(tl,e)}function $g(e){return Cp(tl,e)}var Kh=h("ZodSymbol",(e,t)=>{kd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>th(e,o,r,n)});function Cg(e){return Ip(Kh,e)}var Yh=h("ZodUndefined",(e,t)=>{Ed.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>rh(e,o,r,n)});function Ig(e){return Op(Yh,e)}var Qh=h("ZodNull",(e,t)=>{$d.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>oh(e,o,r,n)});function Ze(e){return Np(Qh,e)}var Xh=h("ZodAny",(e,t)=>{Cd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ih(e,o,r,n)});function ol(){return Mp(Xh)}var em=h("ZodUnknown",(e,t)=>{Id.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ah(e,o,r,n)});function P(){return qp(em)}var tm=h("ZodNever",(e,t)=>{Od.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>sh(e,o,r,n)});function rl(e){return Ap(tm,e)}var om=h("ZodVoid",(e,t)=>{Nd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>nh(e,o,r,n)});function Og(e){return jp(om,e)}var as=h("ZodDate",(e,t)=>{Md.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ch(e,r,n,s),e.min=(r,n)=>e.check(fe(r,n)),e.max=(r,n)=>e.check(we(r,n));let o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});function Ng(e){return Lp(as,e)}var rm=h("ZodArray",(e,t)=>{qd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>yh(e,o,r,n),e.element=t.element,ss(e,"ZodArray",{min(o,r){return this.check(Qe(o,r))},nonempty(o){return this.check(Qe(1,o))},max(o,r){return this.check(Qt(o,r))},length(o,r){return this.check(Xt(o,r))},unwrap(){return this.element}})});function f(e,t){return Dp(rm,e,t)}function Mg(e){let t=e._zod.def.shape;return C(Object.keys(t))}var cs=h("ZodObject",(e,t)=>{Ad.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>zh(e,o,r,n),O.defineLazy(e,"shape",()=>t.shape),ss(e,"ZodObject",{keyof(){return C(Object.keys(this._zod.def.shape))},catchall(o){return this.clone({...this._zod.def,catchall:o})},passthrough(){return this.clone({...this._zod.def,catchall:P()})},loose(){return this.clone({...this._zod.def,catchall:P()})},strict(){return this.clone({...this._zod.def,catchall:rl()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(o){return O.extend(this,o)},safeExtend(o){return O.safeExtend(this,o)},merge(o){return O.merge(this,o)},pick(o){return O.pick(this,o)},omit(o){return O.omit(this,o)},partial(...o){return O.partial(sl,this,o[0])},required(...o){return O.required(il,this,o[0])}})});function p(e,t){let o={type:"object",shape:e??{},...O.normalizeParams(t)};return new cs(o)}function qg(e,t){return new cs({type:"object",shape:e,catchall:rl(),...O.normalizeParams(t)})}function E(e,t){return new cs({type:"object",shape:e,catchall:P(),...O.normalizeParams(t)})}var ls=h("ZodUnion",(e,t)=>{Kn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Tc(e,o,r,n),e.options=t.options});function x(e,t){return new ls({type:"union",options:e,...O.normalizeParams(t)})}var nm=h("ZodXor",(e,t)=>{ls.init(e,t),jd.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Tc(e,o,r,n),e.options=t.options});function Ag(e,t){return new nm({type:"union",options:e,inclusive:!1,...O.normalizeParams(t)})}var sm=h("ZodDiscriminatedUnion",(e,t)=>{ls.init(e,t),Ld.init(e,t)});function wt(e,t,o){return new sm({type:"union",options:t,discriminator:e,...O.normalizeParams(o)})}var im=h("ZodIntersection",(e,t)=>{Ud.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>vh(e,o,r,n)});function Oe(e,t){return new im({type:"intersection",left:e,right:t})}var am=h("ZodTuple",(e,t)=>{Ga.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Rh(e,o,r,n),e.rest=o=>e.clone({...e._zod.def,rest:o})});function cm(e,t,o){let r=t instanceof N,n=r?o:t,s=r?t:null;return new am({type:"tuple",items:e,rest:s,...O.normalizeParams(n)})}var nr=h("ZodRecord",(e,t)=>{Zd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>wh(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function v(e,t,o){return!t||!t._zod?new nr({type:"record",keyType:a(),valueType:e,...O.normalizeParams(t)}):new nr({type:"record",keyType:e,valueType:t,...O.normalizeParams(o)})}function jg(e,t,o){let r=he(e);return r._zod.values=void 0,new nr({type:"record",keyType:r,valueType:t,...O.normalizeParams(o)})}function Lg(e,t,o){return new nr({type:"record",keyType:e,valueType:t,mode:"loose",...O.normalizeParams(o)})}var lm=h("ZodMap",(e,t)=>{Dd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>_h(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...o)=>e.check(Le(...o)),e.nonempty=o=>e.check(Le(1,o)),e.max=(...o)=>e.check(yt(...o)),e.size=(...o)=>e.check(Yt(...o))});function Ug(e,t,o){return new lm({type:"map",keyType:e,valueType:t,...O.normalizeParams(o)})}var um=h("ZodSet",(e,t)=>{Vd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>bh(e,o,r,n),e.min=(...o)=>e.check(Le(...o)),e.nonempty=o=>e.check(Le(1,o)),e.max=(...o)=>e.check(yt(...o)),e.size=(...o)=>e.check(Yt(...o))});function Zg(e,t){return new um({type:"set",valueType:e,...O.normalizeParams(t)})}var sr=h("ZodEnum",(e,t)=>{Hd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>lh(e,r,n,s),e.enum=t.entries,e.options=Object.values(t.entries);let o=new Set(Object.keys(t.entries));e.extract=(r,n)=>{let s={};for(let i of r)if(o.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new sr({...t,checks:[],...O.normalizeParams(n),entries:s})},e.exclude=(r,n)=>{let s={...t.entries};for(let i of r)if(o.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new sr({...t,checks:[],...O.normalizeParams(n),entries:s})}});function C(e,t){let o=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new sr({type:"enum",entries:o,...O.normalizeParams(t)})}function Dg(e,t){return new sr({type:"enum",entries:e,...O.normalizeParams(t)})}var dm=h("ZodLiteral",(e,t)=>{Fd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>uh(e,o,r,n),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 g(e,t){return new dm({type:"literal",values:Array.isArray(e)?e:[e],...O.normalizeParams(t)})}var pm=h("ZodFile",(e,t)=>{Jd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>hh(e,o,r,n),e.min=(o,r)=>e.check(Le(o,r)),e.max=(o,r)=>e.check(yt(o,r)),e.mime=(o,r)=>e.check(Ko(Array.isArray(o)?o:[o],r))});function Vg(e){return Vp(pm,e)}var hm=h("ZodTransform",(e,t)=>{Bd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Sh(e,o,r,n),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new mt(e.constructor.name);o.addIssue=s=>{if(typeof s=="string")o.issues.push(O.issue(s,o.value,t));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=e),o.issues.push(O.issue(i))}};let n=t.transform(o.value,o);return n instanceof Promise?n.then(s=>(o.value=s,o.fallback=!0,o)):(o.value=n,o.fallback=!0,o)}});function nl(e){return new hm({type:"transform",transform:e})}var sl=h("ZodOptional",(e,t)=>{Ka.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>kc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function T(e){return new sl({type:"optional",innerType:e})}var mm=h("ZodExactOptional",(e,t)=>{Wd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>kc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function fm(e){return new mm({type:"optional",innerType:e})}var gm=h("ZodNullable",(e,t)=>{Gd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>xh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function ns(e){return new gm({type:"nullable",innerType:e})}function Hg(e){return T(ns(e))}var Sm=h("ZodDefault",(e,t)=>{Kd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Th(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function _m(e,t){return new Sm({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():O.shallowClone(t)}})}var bm=h("ZodPrefault",(e,t)=>{Yd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>kh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function ym(e,t){return new bm({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():O.shallowClone(t)}})}var il=h("ZodNonOptional",(e,t)=>{Qd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ph(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function zm(e,t){return new il({type:"nonoptional",innerType:e,...O.normalizeParams(t)})}var vm=h("ZodSuccess",(e,t)=>{Xd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>mh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Fg(e){return new vm({type:"success",innerType:e})}var Rm=h("ZodCatch",(e,t)=>{ep.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Eh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function wm(e,t){return new Rm({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var xm=h("ZodNaN",(e,t)=>{tp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>dh(e,o,r,n)});function Jg(e){return Zp(xm,e)}var us=h("ZodPipe",(e,t)=>{Ya.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>$h(e,o,r,n),e.in=t.in,e.out=t.out});function qc(e,t){return new us({type:"pipe",in:e,out:t})}var ds=h("ZodCodec",(e,t)=>{us.init(e,t),Yn.init(e,t)});function Bg(e,t,o){return new ds({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}function Wg(e){let t=e._zod.def;return new ds({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Pm=h("ZodPreprocess",(e,t)=>{us.init(e,t),op.init(e,t)}),Tm=h("ZodReadonly",(e,t)=>{rp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ch(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function km(e){return new Tm({type:"readonly",innerType:e})}var Em=h("ZodTemplateLiteral",(e,t)=>{np.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ph(e,o,r,n)});function Gg(e,t){return new Em({type:"template_literal",parts:e,...O.normalizeParams(t)})}var $m=h("ZodLazy",(e,t)=>{ap.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Oh(e,o,r,n),e.unwrap=()=>e._zod.def.getter()});function xt(e){return new $m({type:"lazy",getter:e})}var Cm=h("ZodPromise",(e,t)=>{ip.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ih(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Kg(e){return new Cm({type:"promise",innerType:e})}var Im=h("ZodFunction",(e,t)=>{sp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>gh(e,o,r,n)});function Yg(e){return new Im({type:"function",input:Array.isArray(e?.input)?cm(e?.input):e?.input??f(P()),output:e?.output??P()})}var ps=h("ZodCustom",(e,t)=>{cp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>fh(e,o,r,n)});function Qg(e){let t=new H({check:"custom"});return t._zod.check=e,t}function Xg(e,t){return Hp(ps,e??(()=>!0),t)}function Om(e,t={}){return Fp(ps,e,t)}function Nm(e,t){return Jp(e,t)}var eS=Bp,tS=Wp;function oS(e,t={}){let o=new ps({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...O.normalizeParams(t)});return o._zod.bag.Class=e,o._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:o,path:[...o._zod.def.path??[]]})},o}var rS=(...e)=>Gp({Codec:ds,Boolean:ur,String:ir},...e);function nS(e){let t=xt(()=>x([a(e),b(),R(),Ze(),f(t),v(a(),t)]));return t}function et(e,t){return new Pm({type:"pipe",in:nl(e),out:t})}var qm={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 cy(e){Y({customError:e})}function ly(){return Y().customError}var Mm;Mm||(Mm={});var w={...ts,...$c,iso:xe},uy=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 dy(e,t){let o=e.$schema;return o==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":o==="http://json-schema.org/draft-07/schema#"?"draft-7":o==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function py(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let o=e.slice(1).split("/").filter(Boolean);if(o.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(o[0]===r){let n=o[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function sS(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return w.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 n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return w.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let s=py(n,t),i=le(s,t);return t.refs.set(n,i),t.processing.delete(n),i}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return w.null();if(n.length===0)return w.never();if(n.length===1)return w.literal(n[0]);if(n.every(i=>typeof i=="string"))return w.enum(n);let s=n.map(i=>w.literal(i));return s.length<2?s[0]:w.union([s[0],s[1],...s.slice(2)])}if(e.const!==void 0)return w.literal(e.const);let o=e.type;if(Array.isArray(o)){let n=o.map(s=>{let i={...e,type:s};return sS(i,t)});return n.length===0?w.never():n.length===1?n[0]:w.union(n)}if(!o)return w.any();let r;switch(o){case"string":{let n=w.string();if(e.format){let s=e.format;s==="email"?n=n.check(w.email()):s==="uri"||s==="uri-reference"?n=n.check(w.url()):s==="uuid"||s==="guid"?n=n.check(w.uuid()):s==="date-time"?n=n.check(w.iso.datetime()):s==="date"?n=n.check(w.iso.date()):s==="time"?n=n.check(w.iso.time()):s==="duration"?n=n.check(w.iso.duration()):s==="ipv4"?n=n.check(w.ipv4()):s==="ipv6"?n=n.check(w.ipv6()):s==="mac"?n=n.check(w.mac()):s==="cidr"?n=n.check(w.cidrv4()):s==="cidr-v6"?n=n.check(w.cidrv6()):s==="base64"?n=n.check(w.base64()):s==="base64url"?n=n.check(w.base64url()):s==="e164"?n=n.check(w.e164()):s==="jwt"?n=n.check(w.jwt()):s==="emoji"?n=n.check(w.emoji()):s==="nanoid"?n=n.check(w.nanoid()):s==="cuid"?n=n.check(w.cuid()):s==="cuid2"?n=n.check(w.cuid2()):s==="ulid"?n=n.check(w.ulid()):s==="xid"?n=n.check(w.xid()):s==="ksuid"&&(n=n.check(w.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),r=n;break}case"number":case"integer":{let n=o==="integer"?w.number().int():w.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),r=n;break}case"boolean":{r=w.boolean();break}case"null":{r=w.null();break}case"object":{let n={},s=e.properties||{},i=new Set(e.required||[]);for(let[l,d]of Object.entries(s)){let m=le(d,t);n[l]=i.has(l)?m:m.optional()}if(e.propertyNames){let l=le(e.propertyNames,t),d=e.additionalProperties&&typeof e.additionalProperties=="object"?le(e.additionalProperties,t):w.any();if(Object.keys(n).length===0){r=w.record(l,d);break}let m=w.object(n).passthrough(),S=w.looseRecord(l,d);r=w.intersection(m,S);break}if(e.patternProperties){let l=e.patternProperties,d=Object.keys(l),m=[];for(let _ of d){let y=le(l[_],t),k=w.string().regex(new RegExp(_));m.push(w.looseRecord(k,y))}let S=[];if(Object.keys(n).length>0&&S.push(w.object(n).passthrough()),S.push(...m),S.length===0)r=w.object({}).passthrough();else if(S.length===1)r=S[0];else{let _=w.intersection(S[0],S[1]);for(let y=2;y<S.length;y++)_=w.intersection(_,S[y]);r=_}break}let c=w.object(n);e.additionalProperties===!1?r=c.strict():typeof e.additionalProperties=="object"?r=c.catchall(le(e.additionalProperties,t)):r=c.passthrough();break}case"array":{let n=e.prefixItems,s=e.items;if(n&&Array.isArray(n)){let i=n.map(l=>le(l,t)),c=s&&typeof s=="object"&&!Array.isArray(s)?le(s,t):void 0;c?r=w.tuple(i).rest(c):r=w.tuple(i),typeof e.minItems=="number"&&(r=r.check(w.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(w.maxLength(e.maxItems)))}else if(Array.isArray(s)){let i=s.map(l=>le(l,t)),c=e.additionalItems&&typeof e.additionalItems=="object"?le(e.additionalItems,t):void 0;c?r=w.tuple(i).rest(c):r=w.tuple(i),typeof e.minItems=="number"&&(r=r.check(w.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(w.maxLength(e.maxItems)))}else if(s!==void 0){let i=le(s,t),c=w.array(i);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),r=c}else r=w.array(w.any());break}default:throw new Error(`Unsupported type: ${o}`)}return r}function le(e,t){if(typeof e=="boolean")return e?w.any():w.never();let o=sS(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(d=>le(d,t)),l=w.union(c);o=r?w.intersection(o,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(d=>le(d,t)),l=w.xor(c);o=r?w.intersection(o,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)o=r?o:w.any();else{let c=r?o:le(e.allOf[0],t),l=r?0:1;for(let d=l;d<e.allOf.length;d++)c=w.intersection(c,le(e.allOf[d],t));o=c}e.nullable===!0&&t.version==="openapi-3.0"&&(o=w.nullable(o)),e.readOnly===!0&&(o=w.readonly(o)),e.default!==void 0&&(o=o.default(e.default));let n={},s=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of s)c in e&&(n[c]=e[c]);let i=["contentEncoding","contentMediaType","contentSchema"];for(let c of i)c in e&&(n[c]=e[c]);for(let c of Object.keys(e))uy.has(c)||(n[c]=e[c]);return Object.keys(n).length>0&&t.registry.add(o,n),e.description&&(o=o.describe(e.description)),o}function iS(e,t){if(typeof e=="boolean")return e?w.any():w.never();let o;try{o=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=dy(o,t?.defaultTarget),n=o.$defs||o.definitions||{},s={version:r,defs:n,refs:new Map,processing:new Set,rootSchema:o,registry:t?.registry??re};return le(o,s)}var hs={};Ke(hs,{bigint:()=>gy,boolean:()=>fy,date:()=>Sy,number:()=>my,string:()=>hy});function hy(e){return pp(ir,e)}function my(e){return yp(lr,e)}function fy(e){return Tp(ur,e)}function gy(e){return Ep(dr,e)}function Sy(e){return Up(as,e)}Y(Qa());var al="2025-11-25";var cl=[al,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ll="io.modelcontextprotocol/related-task",oo="io.modelcontextprotocol/protocolVersion",pr="io.modelcontextprotocol/clientInfo",Tt="io.modelcontextprotocol/serverInfo",ro="io.modelcontextprotocol/clientCapabilities",ul="io.modelcontextprotocol/subscriptionId",hr="io.modelcontextprotocol/logLevel";var no="2.0";var tt=xt(()=>x([a(),b(),R(),Ze(),v(a(),tt),f(tt)])),B=v(a(),tt),dl=f(tt),mr=x([a(),b().int()]),fr=a(),ms=p({ttl:b().optional()}),fs=p({taskId:a()}),gr=E({progressToken:mr.optional(),[ll]:fs.optional()}),oe=p({_meta:gr.optional()}),kt=oe.extend({task:ms.optional()}),W=p({method:a(),params:oe.loose().optional()}),ue=p({_meta:gr.optional()}),ne=p({method:a(),params:ue.loose().optional()}),Sr=E({get[Tt](){return Ve.optional().catch(void 0)}}),G=E({_meta:Sr.optional()}),Ne=x([a(),b().int()]),_r=p({jsonrpc:g(no),id:Ne,...W.shape}).strict(),br=p({jsonrpc:g(no),...ne.shape}).strict(),so=p({jsonrpc:g(no),id:Ne,result:G}).strict(),io=p({jsonrpc:g(no),id:Ne.optional(),error:p({code:b().int(),message:a(),data:P().optional()})}).strict(),ao=x([_r,br,so,io]),pl=x([so,io]),Et=G.strict(),gs=ue.extend({requestId:Ne.optional(),reason:a().optional()}),yr=ne.extend({method:g("notifications/cancelled"),params:gs}),Ss=p({src:a(),mimeType:a().optional(),sizes:f(a()).optional(),theme:C(["light","dark"]).optional()}),ot=p({icons:f(Ss).optional()}),De=p({name:a(),title:a().optional()}),Ve=De.extend({...De.shape,...ot.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),by=Oe(p({applyDefaults:R().optional()}),B),yy=et(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Oe(p({form:by.optional(),url:B.optional()}),B.optional())),hl=E({list:B.optional(),cancel:B.optional(),requests:E({sampling:E({createMessage:B.optional()}).optional(),elicitation:E({create:B.optional()}).optional()}).optional()}),ml=E({list:B.optional(),cancel:B.optional(),requests:E({tools:E({call:B.optional()}).optional()}).optional()}),_s=p({experimental:v(a(),B).optional(),sampling:p({context:B.optional(),tools:B.optional()}).optional(),elicitation:yy.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:hl.optional(),extensions:v(a(),B).optional()}),bs=oe.extend({protocolVersion:a(),capabilities:_s,clientInfo:Ve}),ys=W.extend({method:g("initialize"),params:bs}),zr=p({experimental:v(a(),B).optional(),logging:B.optional(),completions:B.optional(),prompts:p({listChanged:R().optional()}).optional(),resources:p({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:p({listChanged:R().optional()}).optional(),tasks:ml.optional(),extensions:v(a(),B).optional()}),zs=G.extend({protocolVersion:a(),capabilities:zr,serverInfo:Ve,instructions:a().optional()}),vs=ne.extend({method:g("notifications/initialized"),params:ue.optional()}),Rs=W.extend({method:g("server/discover"),params:oe.optional()}),vr=G.extend({supportedVersions:f(a()),capabilities:zr,instructions:a().optional()}),Rr=W.extend({method:g("ping"),params:oe.optional()}),ws=p({progress:b(),total:T(b()),message:T(a())}),xs=p({...ue.shape,...ws.shape,progressToken:mr}),wr=ne.extend({method:g("notifications/progress"),params:xs}),Ps=oe.extend({cursor:fr.optional()}),rt=W.extend({params:Ps.optional()}),nt=G.extend({nextCursor:fr.optional()}),xr=p({uri:a(),mimeType:T(a()),_meta:v(a(),P()).optional()}),Pr=xr.extend({text:a()}),jm=a().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Tr=xr.extend({blob:jm}),st=C(["user","assistant"]),He=p({audience:f(st).optional(),priority:b().min(0).max(1).optional(),lastModified:xe.datetime({offset:!0}).optional()}),kr=p({...De.shape,...ot.shape,uri:a(),description:T(a()),mimeType:T(a()),size:T(b()),annotations:He.optional(),_meta:T(E({}))}),Ts=p({...De.shape,...ot.shape,uriTemplate:a(),description:T(a()),mimeType:T(a()),annotations:He.optional(),_meta:T(E({}))}),ks=rt.extend({method:g("resources/list")}),Es=nt.extend({resources:f(kr)}),$s=rt.extend({method:g("resources/templates/list")}),Cs=nt.extend({resourceTemplates:f(Ts)}),co=oe.extend({uri:a()}),Is=co,Os=W.extend({method:g("resources/read"),params:Is}),Ns=G.extend({contents:f(x([Pr,Tr]))}),Ms=ne.extend({method:g("notifications/resources/list_changed"),params:ue.optional()}),qs=co,As=W.extend({method:g("resources/subscribe"),params:qs}),js=co,Ls=W.extend({method:g("resources/unsubscribe"),params:js}),Er=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:f(a()).optional()}),Us=oe.extend({notifications:Er}),Zs=W.extend({method:g("subscriptions/listen"),params:Us}),Ds=ue.extend({notifications:Er}),Vs=ne.extend({method:g("notifications/subscriptions/acknowledged"),params:Ds}),Hs=Sr.extend({[ul]:Ne}),Fs=G.extend({_meta:Hs}),Js=ue.extend({uri:a()}),Bs=ne.extend({method:g("notifications/resources/updated"),params:Js}),Ws=p({name:a(),description:T(a()),required:T(R())}),Gs=p({...De.shape,...ot.shape,description:T(a()),arguments:T(f(Ws)),_meta:T(E({}))}),Ks=rt.extend({method:g("prompts/list")}),Ys=nt.extend({prompts:f(Gs)}),Qs=oe.extend({name:a(),arguments:v(a(),a()).optional()}),Xs=W.extend({method:g("prompts/get"),params:Qs}),lo=p({type:g("text"),text:a(),annotations:He.optional(),_meta:v(a(),P()).optional()}),uo=p({type:g("image"),data:jm,mimeType:a(),annotations:He.optional(),_meta:v(a(),P()).optional()}),po=p({type:g("audio"),data:jm,mimeType:a(),annotations:He.optional(),_meta:v(a(),P()).optional()}),ei=p({type:g("tool_use"),name:a(),id:a(),input:v(a(),P()),_meta:v(a(),P()).optional()}),ho=p({type:g("resource"),resource:x([Pr,Tr]),annotations:He.optional(),_meta:v(a(),P()).optional()}),mo=kr.extend({type:g("resource_link")}),Fe=x([lo,uo,po,mo,ho]),ti=p({role:st,content:Fe}),oi=G.extend({description:a().optional(),messages:f(ti)}),ri=ne.extend({method:g("notifications/prompts/list_changed"),params:ue.optional()}),ni=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),si=p({taskSupport:C(["required","optional","forbidden"]).optional()}),$t=p({...De.shape,...ot.shape,description:a().optional(),inputSchema:p({type:g("object"),properties:v(a(),tt).optional(),required:f(a()).optional()}).catchall(P()),outputSchema:E({$schema:a().optional()}).optional(),annotations:ni.optional(),execution:si.optional(),_meta:v(a(),P()).optional()}),ii=rt.extend({method:g("tools/list")}),ai=nt.extend({tools:f($t)}),Ct=G.extend({content:f(Fe).default([]),structuredContent:P().optional(),isError:R().optional()}),fl=Ct.or(G.extend({toolResult:P()})),ci=kt.extend({name:a(),arguments:v(a(),P()).optional()}),li=W.extend({method:g("tools/call"),params:ci}),ui=ne.extend({method:g("notifications/tools/list_changed"),params:ue.optional()}),gl=p({autoRefresh:R().default(!0),debounceMs:b().int().nonnegative().default(300)}),$r=C(["debug","info","notice","warning","error","critical","alert","emergency"]),di=oe.extend({level:$r}),pi=W.extend({method:g("logging/setLevel"),params:di}),hi=ue.extend({level:$r,logger:a().optional(),data:P()}),mi=ne.extend({method:g("notifications/message"),params:hi}),fi=p({name:a().optional()}),gi=p({hints:f(fi).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),Si=p({mode:C(["auto","required","none"]).optional()}),_i=p({type:g("tool_result"),toolUseId:a().describe("The unique identifier for the corresponding tool call."),content:f(Fe),structuredContent:P().optional(),isError:R().optional(),_meta:v(a(),P()).optional()}),bi=wt("type",[lo,uo,po]),Pt=wt("type",[lo,uo,po,ei,_i]),yi=p({role:st,content:x([Pt,f(Pt)]),_meta:v(a(),P()).optional()}),zi=kt.extend({messages:f(yi),modelPreferences:gi.optional(),systemPrompt:a().optional(),includeContext:C(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:f(a()).optional(),metadata:B.optional(),tools:f($t).optional(),toolChoice:Si.optional()}),vi=W.extend({method:g("sampling/createMessage"),params:zi}),Ri=G.extend({model:a(),stopReason:T(C(["endTurn","stopSequence","maxTokens"]).or(a())),role:st,content:bi}),wi=G.extend({model:a(),stopReason:T(C(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:st,content:x([Pt,f(Pt)])}),Cr=p({type:g("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),fo=p({type:g("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:C(["email","uri","date","date-time"]).optional(),default:a().optional()}),go=p({type:C(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),Ir=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),default:a().optional()}),Or=p({type:g("string"),title:a().optional(),description:a().optional(),oneOf:f(p({const:a(),title:a()})),default:a().optional()}),Nr=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),enumNames:f(a()).optional(),default:a().optional()}),xi=x([Ir,Or]),Mr=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({type:g("string"),enum:f(a())}),default:f(a()).optional()}),qr=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({anyOf:f(p({const:a(),title:a()}))}),default:f(a()).optional()}),Pi=x([Mr,qr]),Ti=x([Nr,xi,Pi]),Ar=x([Ti,Cr,fo,go]),So=kt.extend({mode:g("form").optional(),message:a(),requestedSchema:p({type:g("object"),properties:v(a(),Ar),required:f(a()).optional()}).catchall(P())}),ki=kt.extend({mode:g("url"),message:a(),elicitationId:a(),url:a().url()}),Ei=x([So,ki]),$i=W.extend({method:g("elicitation/create"),params:Ei}),Ci=ue.extend({elicitationId:a()}),Ii=ne.extend({method:g("notifications/elicitation/complete"),params:Ci}),Oi=G.extend({action:C(["accept","decline","cancel"]),content:et(e=>e===null?void 0:e,v(a(),x([a(),b(),R(),f(a())])).optional())}),Ni=p({type:g("ref/resource"),uri:a()}),Mi=p({type:g("ref/prompt"),name:a()}),qi=oe.extend({ref:x([Mi,Ni]),argument:p({name:a(),value:a()}),context:p({arguments:v(a(),a()).optional()}).optional()}),Ai=W.extend({method:g("completion/complete"),params:qi}),ji=G.extend({completion:E({values:f(a()).max(100),total:T(b().int()),hasMore:T(R())})}),Li=p({uri:a().startsWith("file://"),name:a().optional(),_meta:v(a(),P()).optional()}),Ui=W.extend({method:g("roots/list"),params:oe.optional()}),Zi=G.extend({roots:f(Li)}),Di=ne.extend({method:g("notifications/roots/list_changed"),params:ue.optional()}),Sl=E({ttl:b().optional(),pollInterval:b().optional()}),Vi=C(["working","input_required","completed","failed","cancelled"]),it=p({taskId:a(),status:Vi,ttl:x([b(),Ze()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:T(b()),statusMessage:T(a())}),_l=G.extend({task:it}),Hi=ue.merge(it),bl=ne.extend({method:g("notifications/tasks/status"),params:Hi}),yl=W.extend({method:g("tasks/get"),params:oe.extend({taskId:a()})}),zl=G.merge(it),vl=W.extend({method:g("tasks/result"),params:oe.extend({taskId:a()})}),Rl=G.loose(),wl=rt.extend({method:g("tasks/list")}),xl=nt.extend({tasks:f(it)}),Pl=W.extend({method:g("tasks/cancel"),params:oe.extend({taskId:a()})}),Tl=G.merge(it),kl=x([Rr,ys,Rs,Ai,pi,Xs,Ks,ks,$s,Os,As,Ls,Zs,li,ii]),El=x([yr,wr,vs,Di]),$l=x([Et,Ri,wi,Oi,Zi]),Cl=x([Rr,vi,$i,Ui]),Il=x([yr,wr,mi,Bs,Ms,ui,ri,Vs,Ii]),Ol=x([Et,zs,vr,ji,oi,Ys,Es,Cs,Ns,Ct,ai,Fs]),te=ar().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:qm.custom,message:"URL must be parseable",fatal:!0}),qn}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Fi=E({resource:a().url(),authorization_servers:f(te).optional(),jwks_uri:a().url().optional(),scopes_supported:f(a()).optional(),bearer_methods_supported:f(a()).optional(),resource_signing_alg_values_supported:f(a()).optional(),resource_name:a().optional(),resource_documentation:a().optional(),resource_policy_uri:a().url().optional(),resource_tos_uri:a().url().optional(),tls_client_certificate_bound_access_tokens:R().optional(),authorization_details_types_supported:f(a()).optional(),dpop_signing_alg_values_supported:f(a()).optional(),dpop_bound_access_tokens_required:R().optional()}),jr=E({issuer:a(),authorization_endpoint:te,token_endpoint:te,registration_endpoint:te.optional(),scopes_supported:f(a()).optional(),response_types_supported:f(a()),response_modes_supported:f(a()).optional(),grant_types_supported:f(a()).optional(),token_endpoint_auth_methods_supported:f(a()).optional(),token_endpoint_auth_signing_alg_values_supported:f(a()).optional(),service_documentation:te.optional(),revocation_endpoint:te.optional(),revocation_endpoint_auth_methods_supported:f(a()).optional(),revocation_endpoint_auth_signing_alg_values_supported:f(a()).optional(),introspection_endpoint:a().optional(),introspection_endpoint_auth_methods_supported:f(a()).optional(),introspection_endpoint_auth_signing_alg_values_supported:f(a()).optional(),code_challenge_methods_supported:f(a()).optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0),dpop_signing_alg_values_supported:f(a()).optional()}),Ji=E({issuer:a(),authorization_endpoint:te,token_endpoint:te,userinfo_endpoint:te.optional(),jwks_uri:te,registration_endpoint:te.optional(),scopes_supported:f(a()).optional(),response_types_supported:f(a()),response_modes_supported:f(a()).optional(),grant_types_supported:f(a()).optional(),acr_values_supported:f(a()).optional(),subject_types_supported:f(a()),id_token_signing_alg_values_supported:f(a()),id_token_encryption_alg_values_supported:f(a()).optional(),id_token_encryption_enc_values_supported:f(a()).optional(),userinfo_signing_alg_values_supported:f(a()).optional(),userinfo_encryption_alg_values_supported:f(a()).optional(),userinfo_encryption_enc_values_supported:f(a()).optional(),request_object_signing_alg_values_supported:f(a()).optional(),request_object_encryption_alg_values_supported:f(a()).optional(),request_object_encryption_enc_values_supported:f(a()).optional(),token_endpoint_auth_methods_supported:f(a()).optional(),token_endpoint_auth_signing_alg_values_supported:f(a()).optional(),display_values_supported:f(a()).optional(),claim_types_supported:f(a()).optional(),claims_supported:f(a()).optional(),service_documentation:a().optional(),claims_locales_supported:f(a()).optional(),ui_locales_supported:f(a()).optional(),claims_parameter_supported:R().optional(),request_parameter_supported:R().optional(),request_uri_parameter_supported:R().optional(),require_request_uri_registration:R().optional(),op_policy_uri:te.optional(),op_tos_uri:te.optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0)}),Bi=p({...Ji.shape,...jr.pick({code_challenge_methods_supported:!0}).shape}),Wi=p({access_token:a(),id_token:a().optional(),token_type:a(),expires_in:hs.number().optional(),scope:a().optional(),refresh_token:a().optional(),issuer:a().optional().catch(void 0)}).strip(),Gi=p({issued_token_type:g("urn:ietf:params:oauth:token-type:id-jag"),access_token:a(),token_type:a().optional(),expires_in:b().optional(),scope:a().optional()}).strip(),Ki=p({error:a(),error_description:a().optional(),error_uri:a().optional()}),Am=te.optional().or(g("").transform(()=>{})),Yi=p({redirect_uris:f(te),token_endpoint_auth_method:a().optional(),grant_types:f(a()).optional(),response_types:f(a()).optional(),application_type:a().optional(),client_name:a().optional(),client_uri:te.optional(),logo_uri:Am,scope:a().optional(),contacts:f(a()).optional(),tos_uri:Am,policy_uri:a().optional(),jwks_uri:te.optional(),jwks:ol().optional(),software_id:a().optional(),software_version:a().optional(),software_statement:a().optional()}).strip(),Qi=p({client_id:a(),client_secret:a().optional(),client_id_issued_at:b().optional(),client_secret_expires_at:b().optional(),issuer:a().optional().catch(void 0)}).strip(),Xi=Yi.merge(Qi),Nl=p({error:a(),error_description:a().optional()}).strip(),Ml=p({token:a(),token_type_hint:a().optional()}).strip();var Hm=Symbol.for("mcp.sdk.errorBrands");function _o(e,t){let o=new Set,r=t;for(;typeof r=="function";){let n=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,"mcpBrand")&&typeof n=="string"&&o.add(n),r=Object.getPrototypeOf(r)}o.size!==0&&Object.defineProperty(e,Hm,{value:o,enumerable:!1,configurable:!0})}function Pe(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,Hm)){let o=t[Hm];if(o&&typeof o.has=="function"&&o.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var zy=class PS extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return Pe(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Pe(this,t)}constructor(t,o,r){super(o),this.code=t,this.errorUri=r,this.name="OAuthError",_o(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}static fromResponse(t){return new PS(t.error,t.error_description??t.error,t.error_uri)}},se=(function(e){return e.NotConnected="NOT_CONNECTED",e.AlreadyConnected="ALREADY_CONNECTED",e.NotInitialized="NOT_INITIALIZED",e.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",e.RequestTimeout="REQUEST_TIMEOUT",e.ConnectionClosed="CONNECTION_CLOSED",e.SendFailed="SEND_FAILED",e.InvalidResult="INVALID_RESULT",e.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",e.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",e.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",e.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",e.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",e.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",e.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",e.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",e.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",e.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",e.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",e})({}),X=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return Pe(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Pe(this,e)}constructor(e,t,o,r){super(t,r),this.code=e,this.data=o,this.name="SdkError",_o(this,new.target)}},vy=class extends X{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,o,r){super(e,t,o,r),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};var Ry="2026-07-28";function TS(e){return e>=Ry}function kS(e){let t=e.structuredContent;return t===void 0||!(typeof t!="object"||t===null||Array.isArray(t))||(e.content?.some(o=>o.type==="text")??!1)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var ES=["task","inputRequests","requestState"];function wy(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||ES.some(t=>t in e)?e:{...e,content:[]}}function xy(){let e=xt(()=>x([a(),b(),R(),Ze(),v(a(),e),f(e)])),t=v(a(),e),o=x([a(),b().int()]),r=a(),n=p({ttl:b().optional()}),s=p({taskId:a()}),i=E({progressToken:o.optional(),"io.modelcontextprotocol/related-task":s.optional()}),c=p({_meta:i.optional()}),l=c.extend({task:n.optional()}),d=p({method:a(),params:c.loose().optional()}),m=p({_meta:i.optional()}),S=p({method:a(),params:m.loose().optional()}),_=E({_meta:i.optional()}),y=x([a(),b().int()]),k=_.strict(),$=m.extend({requestId:y.optional(),reason:a().optional()}),I=S.extend({method:g("notifications/cancelled"),params:$}),V=p({src:a(),mimeType:a().optional(),sizes:f(a()).optional(),theme:C(["light","dark"]).optional()}),K=p({icons:f(V).optional()}),U=p({name:a(),title:a().optional()}),j=U.extend({...U.shape,...K.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),J=Oe(p({applyDefaults:R().optional()}),t),F=et(ce=>ce&&typeof ce=="object"&&!Array.isArray(ce)&&Object.keys(ce).length===0?{form:{}}:ce,Oe(p({form:J.optional(),url:t.optional()}),t.optional())),ee=E({list:t.optional(),cancel:t.optional(),requests:E({sampling:E({createMessage:t.optional()}).optional(),elicitation:E({create:t.optional()}).optional()}).optional()}),Be=E({list:t.optional(),cancel:t.optional(),requests:E({tools:E({call:t.optional()}).optional()}).optional()}),de=p({experimental:v(a(),t).optional(),sampling:p({context:t.optional(),tools:t.optional()}).optional(),elicitation:F.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:ee.optional(),extensions:v(a(),t).optional()}),at=c.extend({protocolVersion:a(),capabilities:de,clientInfo:j}),Ot=d.extend({method:g("initialize"),params:at}),Ur=p({experimental:v(a(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:p({listChanged:R().optional()}).optional(),resources:p({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:p({listChanged:R().optional()}).optional(),tasks:Be.optional(),extensions:v(a(),t).optional()}),Zr=_.extend({protocolVersion:a(),capabilities:Ur,serverInfo:j,instructions:a().optional()}),bo=S.extend({method:g("notifications/initialized"),params:m.optional()}),ct=d.extend({method:g("ping"),params:c.optional()}),Nt=p({progress:b(),total:T(b()),message:T(a())}),Me=p({...m.shape,...Nt.shape,progressToken:o}),lt=S.extend({method:g("notifications/progress"),params:Me}),yo=c.extend({cursor:r.optional()}),We=d.extend({params:yo.optional()}),Ge=_.extend({nextCursor:r.optional()}),zo=p({uri:a(),mimeType:T(a()),_meta:v(a(),P()).optional()}),vo=zo.extend({text:a()}),Mt=a().refine(ce=>{try{return atob(ce),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ro=zo.extend({blob:Mt}),qe=C(["user","assistant"]),Ee=p({audience:f(qe).optional(),priority:b().min(0).max(1).optional(),lastModified:xe.datetime({offset:!0}).optional()}),qt=p({...U.shape,...K.shape,uri:a(),description:T(a()),mimeType:T(a()),size:T(b()),annotations:Ee.optional(),_meta:T(E({}))}),Dr=p({...U.shape,...K.shape,uriTemplate:a(),description:T(a()),mimeType:T(a()),annotations:Ee.optional(),_meta:T(E({}))}),Vr=We.extend({method:g("resources/list")}),Hr=Ge.extend({resources:f(qt)}),ut=We.extend({method:g("resources/templates/list")}),wo=Ge.extend({resourceTemplates:f(Dr)}),At=c.extend({uri:a()}),Fr=At,Jr=d.extend({method:g("resources/read"),params:Fr}),Br=_.extend({contents:f(x([vo,Ro]))}),Wr=S.extend({method:g("notifications/resources/list_changed"),params:m.optional()}),Gr=At,Kr=d.extend({method:g("resources/subscribe"),params:Gr}),Yr=At,Qr=d.extend({method:g("resources/unsubscribe"),params:Yr}),Xr=m.extend({uri:a()}),en=S.extend({method:g("notifications/resources/updated"),params:Xr}),tn=p({name:a(),description:T(a()),required:T(R())}),on=p({...U.shape,...K.shape,description:T(a()),arguments:T(f(tn)),_meta:T(E({}))}),rn=We.extend({method:g("prompts/list")}),nn=Ge.extend({prompts:f(on)}),sn=c.extend({name:a(),arguments:v(a(),a()).optional()}),an=d.extend({method:g("prompts/get"),params:sn}),jt=p({type:g("text"),text:a(),annotations:Ee.optional(),_meta:v(a(),P()).optional()}),Lt=p({type:g("image"),data:Mt,mimeType:a(),annotations:Ee.optional(),_meta:v(a(),P()).optional()}),Ut=p({type:g("audio"),data:Mt,mimeType:a(),annotations:Ee.optional(),_meta:v(a(),P()).optional()}),cn=p({type:g("tool_use"),name:a(),id:a(),input:v(a(),P()),_meta:v(a(),P()).optional()}),dt=p({type:g("resource"),resource:x([vo,Ro]),annotations:Ee.optional(),_meta:v(a(),P()).optional()}),ln=qt.extend({type:g("resource_link")}),Te=x([jt,Lt,Ut,ln,dt]),xo=p({role:qe,content:Te}),Po=_.extend({description:a().optional(),messages:f(xo)}),Zt=S.extend({method:g("notifications/prompts/list_changed"),params:m.optional()}),un=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),To=p({taskSupport:C(["required","optional","forbidden"]).optional()}),Dt=p({...U.shape,...K.shape,description:a().optional(),inputSchema:p({type:g("object"),properties:v(a(),e).optional(),required:f(a()).optional()}).catchall(P()),outputSchema:p({type:g("object"),properties:v(a(),e).optional(),required:f(a()).optional()}).catchall(P()).optional(),annotations:un.optional(),execution:To.optional(),_meta:v(a(),P()).optional()}),ko=We.extend({method:g("tools/list")}),Eo=Ge.extend({tools:f(Dt)}),$o=_.extend({content:f(Te),structuredContent:v(a(),P()).optional(),isError:R().optional()}),ae=l.extend({name:a(),arguments:v(a(),P()).optional()}),dn=d.extend({method:g("tools/call"),params:ae}),ca=S.extend({method:g("notifications/tools/list_changed"),params:m.optional()}),Co=C(["debug","info","notice","warning","error","critical","alert","emergency"]),pn=c.extend({level:Co}),hn=d.extend({method:g("logging/setLevel"),params:pn}),mn=m.extend({level:Co,logger:a().optional(),data:P()}),fn=S.extend({method:g("notifications/message"),params:mn}),gn=p({name:a().optional()}),Sn=p({hints:f(gn).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),_n=p({mode:C(["auto","required","none"]).optional()}),la=p({type:g("tool_result"),toolUseId:a().describe("The unique identifier for the corresponding tool call."),content:f(Te),structuredContent:p({}).loose().optional(),isError:R().optional(),_meta:v(a(),P()).optional()}),bn=wt("type",[jt,Lt,Ut]),pt=wt("type",[jt,Lt,Ut,cn,la]),yn=p({role:qe,content:x([pt,f(pt)]),_meta:v(a(),P()).optional()}),zn=l.extend({messages:f(yn),modelPreferences:Sn.optional(),systemPrompt:a().optional(),includeContext:C(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:f(a()).optional(),metadata:t.optional(),tools:f(Dt).optional(),toolChoice:_n.optional()}),vn=d.extend({method:g("sampling/createMessage"),params:zn}),Rn=_.extend({model:a(),stopReason:T(C(["endTurn","stopSequence","maxTokens"]).or(a())),role:qe,content:bn}),wn=_.extend({model:a(),stopReason:T(C(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:qe,content:x([pt,f(pt)])}),xn=p({type:g("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),Pn=p({type:g("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:C(["email","uri","date","date-time"]).optional(),default:a().optional()}),Tn=p({type:C(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),kn=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),default:a().optional()}),En=p({type:g("string"),title:a().optional(),description:a().optional(),oneOf:f(p({const:a(),title:a()})),default:a().optional()}),$n=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),enumNames:f(a()).optional(),default:a().optional()}),Cn=x([kn,En]),Vt=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({type:g("string"),enum:f(a())}),default:f(a()).optional()}),Ht=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({anyOf:f(p({const:a(),title:a()}))}),default:f(a()).optional()}),ua=x([Vt,Ht]),da=x([$n,Cn,ua]),ze=x([da,xn,Pn,Tn]),ve=l.extend({mode:g("form").optional(),message:a(),requestedSchema:p({type:g("object"),properties:v(a(),ze),required:f(a()).optional()}).catchall(P())}),In=l.extend({mode:g("url"),message:a(),elicitationId:a(),url:a().url()}),$e=x([ve,In]),pa=d.extend({method:g("elicitation/create"),params:$e}),ha=m.extend({elicitationId:a()}),ma=S.extend({method:g("notifications/elicitation/complete"),params:ha}),fa=_.extend({action:C(["accept","decline","cancel"]),content:et(ce=>ce===null?void 0:ce,v(a(),x([a(),b(),R(),f(a())])).optional())}),ga=p({type:g("ref/resource"),uri:a()}),Sa=p({type:g("ref/prompt"),name:a()}),_a=c.extend({ref:x([Sa,ga]),argument:p({name:a(),value:a()}),context:p({arguments:v(a(),a()).optional()}).optional()}),On=d.extend({method:g("completion/complete"),params:_a}),ba=_.extend({completion:E({values:f(a()).max(100),total:T(b().int()),hasMore:T(R())})}),ya=p({uri:a().startsWith("file://"),name:a().optional(),_meta:v(a(),P()).optional()}),Io=d.extend({method:g("roots/list"),params:c.optional()}),Nn=_.extend({roots:f(ya)}),za=S.extend({method:g("notifications/roots/list_changed"),params:m.optional()}),va=E({ttl:b().optional(),pollInterval:b().optional()}),Mn=C(["working","input_required","completed","failed","cancelled"]),ht=p({taskId:a(),status:Mn,ttl:x([b(),Ze()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:T(b()),statusMessage:T(a())}),Se=_.extend({task:ht}),Ra=m.merge(ht),Ft=S.extend({method:g("notifications/tasks/status"),params:Ra}),Oo=d.extend({method:g("tasks/get"),params:c.extend({taskId:a()})}),No=_.merge(ht),Mo=d.extend({method:g("tasks/result"),params:c.extend({taskId:a()})}),Zl=_.loose(),pe=We.extend({method:g("tasks/list")}),Q=Ge.extend({tasks:f(ht)}),Jt=d.extend({method:g("tasks/cancel"),params:c.extend({taskId:a()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:r,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:i,BaseRequestParamsSchema:c,TaskAugmentedRequestParamsSchema:l,RequestSchema:d,NotificationsParamsSchema:m,NotificationSchema:S,ResultSchema:_,RequestIdSchema:y,EmptyResultSchema:k,CancelledNotificationParamsSchema:$,CancelledNotificationSchema:I,IconSchema:V,IconsSchema:K,BaseMetadataSchema:U,ImplementationSchema:j,ClientTasksCapabilitySchema:ee,ServerTasksCapabilitySchema:Be,ClientCapabilitiesSchema:de,InitializeRequestParamsSchema:at,InitializeRequestSchema:Ot,ServerCapabilitiesSchema:Ur,InitializeResultSchema:Zr,InitializedNotificationSchema:bo,PingRequestSchema:ct,ProgressSchema:Nt,ProgressNotificationParamsSchema:Me,ProgressNotificationSchema:lt,PaginatedRequestParamsSchema:yo,PaginatedRequestSchema:We,PaginatedResultSchema:Ge,ResourceContentsSchema:zo,TextResourceContentsSchema:vo,BlobResourceContentsSchema:Ro,RoleSchema:qe,AnnotationsSchema:Ee,ResourceSchema:qt,ResourceTemplateSchema:Dr,ListResourcesRequestSchema:Vr,ListResourcesResultSchema:Hr,ListResourceTemplatesRequestSchema:ut,ListResourceTemplatesResultSchema:wo,ResourceRequestParamsSchema:At,ReadResourceRequestParamsSchema:Fr,ReadResourceRequestSchema:Jr,ReadResourceResultSchema:Br,ResourceListChangedNotificationSchema:Wr,SubscribeRequestParamsSchema:Gr,SubscribeRequestSchema:Kr,UnsubscribeRequestParamsSchema:Yr,UnsubscribeRequestSchema:Qr,ResourceUpdatedNotificationParamsSchema:Xr,ResourceUpdatedNotificationSchema:en,PromptArgumentSchema:tn,PromptSchema:on,ListPromptsRequestSchema:rn,ListPromptsResultSchema:nn,GetPromptRequestParamsSchema:sn,GetPromptRequestSchema:an,TextContentSchema:jt,ImageContentSchema:Lt,AudioContentSchema:Ut,ToolUseContentSchema:cn,EmbeddedResourceSchema:dt,ResourceLinkSchema:ln,ContentBlockSchema:Te,PromptMessageSchema:xo,GetPromptResultSchema:Po,PromptListChangedNotificationSchema:Zt,ToolAnnotationsSchema:un,ToolExecutionSchema:To,ToolSchema:Dt,ListToolsRequestSchema:ko,ListToolsResultSchema:Eo,CallToolResultSchema:$o,CallToolRequestParamsSchema:ae,CallToolRequestSchema:dn,ToolListChangedNotificationSchema:ca,LoggingLevelSchema:Co,SetLevelRequestParamsSchema:pn,SetLevelRequestSchema:hn,LoggingMessageNotificationParamsSchema:mn,LoggingMessageNotificationSchema:fn,ModelHintSchema:gn,ModelPreferencesSchema:Sn,ToolChoiceSchema:_n,ToolResultContentSchema:la,SamplingContentSchema:bn,SamplingMessageContentBlockSchema:pt,SamplingMessageSchema:yn,CreateMessageRequestParamsSchema:zn,CreateMessageRequestSchema:vn,CreateMessageResultSchema:Rn,CreateMessageResultWithToolsSchema:wn,BooleanSchemaSchema:xn,StringSchemaSchema:Pn,NumberSchemaSchema:Tn,UntitledSingleSelectEnumSchemaSchema:kn,TitledSingleSelectEnumSchemaSchema:En,LegacyTitledEnumSchemaSchema:$n,SingleSelectEnumSchemaSchema:Cn,UntitledMultiSelectEnumSchemaSchema:Vt,TitledMultiSelectEnumSchemaSchema:Ht,MultiSelectEnumSchemaSchema:ua,EnumSchemaSchema:da,PrimitiveSchemaDefinitionSchema:ze,ElicitRequestFormParamsSchema:ve,ElicitRequestURLParamsSchema:In,ElicitRequestParamsSchema:$e,ElicitRequestSchema:pa,ElicitationCompleteNotificationParamsSchema:ha,ElicitationCompleteNotificationSchema:ma,ElicitResultSchema:fa,ResourceTemplateReferenceSchema:ga,PromptReferenceSchema:Sa,CompleteRequestParamsSchema:_a,CompleteRequestSchema:On,CompleteResultSchema:ba,RootSchema:ya,ListRootsRequestSchema:Io,ListRootsResultSchema:Nn,RootsListChangedNotificationSchema:za,TaskCreationParamsSchema:va,TaskStatusSchema:Mn,TaskSchema:ht,CreateTaskResultSchema:Se,TaskStatusNotificationParamsSchema:Ra,TaskStatusNotificationSchema:Ft,GetTaskRequestSchema:Oo,GetTaskResultSchema:No,GetTaskPayloadRequestSchema:Mo,GetTaskPayloadResultSchema:Zl,ListTasksRequestSchema:pe,ListTasksResultSchema:Q,CancelTaskRequestSchema:Jt,CancelTaskResultSchema:_.merge(ht),ClientRequestSchema:x([ct,Ot,On,hn,an,rn,Vr,ut,Jr,Kr,Qr,dn,ko,Oo,Mo,pe,Jt]),ClientNotificationSchema:x([I,lt,bo,za,Ft]),ClientResultSchema:x([k,Rn,wn,fa,Nn,No,Q,Se]),ServerRequestSchema:x([ct,vn,pa,Io,Oo,Mo,pe,Jt]),ServerNotificationSchema:x([I,lt,fn,en,Wr,ca,Zt,Ft,ma]),ServerResultSchema:x([k,Zr,ba,Po,nn,Hr,wo,Br,$o,Eo,No,Q,Se]),CallToolResultWireSchema:P().superRefine((ce,g_)=>{if(!(typeof ce!="object"||ce===null||Array.isArray(ce)||ce.content!==void 0)){for(let df of ES)if(df in ce){g_.addIssue({code:"custom",message:`content is required when the body carries '${df}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(wy).pipe($o)}}var Py;function $S(){return Py??=xy()}function CS(e){return e.type!=="object"}var Ty=new Set(["const","enum","default","examples"]),ky=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function gS(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Ey(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(gS(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let o=ff(e.$schema)&&e.$recursiveAnchor!==!0,r=(n,s)=>{if(Array.isArray(n))return n.map(l=>r(l,!1));if(n===null||typeof n!="object"||!s&&gS(n.$id))return n;let i={},c=!1;for(let[l,d]of Object.entries(n))s?i[l]=r(d,!1):(l==="$ref"||l==="$dynamicRef")&&typeof d=="string"?i[l]=d==="#"?"#/properties/result":d.startsWith("#/")?`#/properties/result${d.slice(1)}`:d:l==="$recursiveRef"&&d==="#"&&o?c=!0:Ty.has(l)?i[l]=d:ky.has(l)?i[l]=r(d,!0):i[l]=r(d,!1);return c&&("$ref"in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:"#/properties/result"}]:i.$ref="#/properties/result"),i};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:r(e,!1)},required:["result"]}}var IS={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},OS={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},$y={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},ql;function Km(){if(ql)return ql;let e=$S();return ql={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},ql}function NS(e){return Object.prototype.hasOwnProperty.call(IS,e)}function MS(e){return Object.prototype.hasOwnProperty.call(OS,e)}function Cy(e){return Object.prototype.hasOwnProperty.call($y,e)}function Iy(e){return Cy(e)?Km().resultSchemas[e]:void 0}function Oy(e){return NS(e)?Km().requestSchemas[e]:void 0}function Ny(e){return MS(e)?Km().notificationSchemas[e]:void 0}var ZR=Object.keys(IS),DR=Object.keys(OS);function Fm(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Al(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let o=e.safeParse(t);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}var SS={ok:!1,reason:"not-in-era"};function _S(e){return Fm(e)&&Fm(e.outputSchema)&&CS(e.outputSchema)}var Ym={era:"2025-11-25",hasRequestMethod:NS,hasNotificationMethod:MS,validateRequest:(e,t)=>Al(Oy(e),t),validateResult:(e,t)=>Al(Iy(e),t),validateNotification:(e,t)=>Al(Ny(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>SS,validateInputResponse:()=>SS,samplingResultVariant:((e,t)=>{let o=$S();return Al(e?o.CreateMessageResultWithToolsSchema:o.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let o=kS(e),r=o.structuredContent;if(r===void 0)return o;let n=typeof r!="object"||r===null||Array.isArray(r),s=t!==void 0&&CS(t);return!n&&!s?o:{...o,structuredContent:{result:r}}},decodeResult(e,t){if(Fm(t)&&"resultType"in t){let o={...t};return delete o.resultType,{kind:"complete",result:o}}return{kind:"complete",result:t}},encodeResult(e,t){if(e!=="tools/list")return t;let o=t.tools;return!Array.isArray(o)||!o.some(r=>_S(r))?t:{...t,tools:o.map(r=>_S(r)?{...r,outputSchema:Ey(r.outputSchema)}:r)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function My(){let e=xt(()=>x([a(),b(),R(),Ze(),v(a(),e),f(e)])),t=v(a(),e),o=x([a(),b().int()]),r=a(),n=x([a(),b().int()]),s=C(["user","assistant"]),i=C(["debug","info","notice","warning","error","critical","alert","emergency"]),c=a().refine(Q=>{try{return atob(Q),!0}catch{return!1}},{message:"Invalid Base64 string"}),l=p({ttl:b().optional()}),d=p({taskId:a()}),m=E({progressToken:o.optional(),"io.modelcontextprotocol/related-task":d.optional()}),S=p({_meta:m.optional()}),_=S.extend({task:l.optional()}),y=p({_meta:m.optional()}),k=p({method:a(),params:y.loose().optional()}),$=p({src:a(),mimeType:a().optional(),sizes:f(a()).optional(),theme:C(["light","dark"]).optional()}),I=p({icons:f($).optional()}),V=p({name:a(),title:a().optional()}),K=V.extend({...V.shape,...I.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),U=Oe(p({applyDefaults:R().optional()}),t),j=et(Q=>Q&&typeof Q=="object"&&!Array.isArray(Q)&&Object.keys(Q).length===0?{form:{}}:Q,Oe(p({form:U.optional(),url:t.optional()}),t.optional())),J=E({list:t.optional(),cancel:t.optional(),requests:E({sampling:E({createMessage:t.optional()}).optional(),elicitation:E({create:t.optional()}).optional()}).optional()}),F=E({list:t.optional(),cancel:t.optional(),requests:E({tools:E({call:t.optional()}).optional()}).optional()}),ee=p({experimental:v(a(),t).optional(),sampling:p({context:t.optional(),tools:t.optional()}).optional(),elicitation:j.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:J.optional(),extensions:v(a(),t).optional()}),Be=p({experimental:v(a(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:p({listChanged:R().optional()}).optional(),resources:p({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:p({listChanged:R().optional()}).optional(),tasks:F.optional(),extensions:v(a(),t).optional()}),de=p({progress:b(),total:T(b()),message:T(a())}),at=p({...y.shape,...de.shape,progressToken:o}),Ot=k.extend({method:g("notifications/progress"),params:at}),Ur=y.extend({level:i,logger:a().optional(),data:P()}),Zr=k.extend({method:g("notifications/message"),params:Ur}),bo=p({uri:a(),mimeType:T(a()),_meta:v(a(),P()).optional()}),ct=bo.extend({text:a()}),Nt=bo.extend({blob:c}),Me=p({audience:f(s).optional(),priority:b().min(0).max(1).optional(),lastModified:xe.datetime({offset:!0}).optional()}),lt=p({...V.shape,...I.shape,uri:a(),description:T(a()),mimeType:T(a()),size:T(b()),annotations:Me.optional(),_meta:T(E({}))}),yo=p({...V.shape,...I.shape,uriTemplate:a(),description:T(a()),mimeType:T(a()),annotations:Me.optional(),_meta:T(E({}))}),We=k.extend({method:g("notifications/resources/list_changed"),params:y.optional()}),Ge=y.extend({uri:a()}),zo=k.extend({method:g("notifications/resources/updated"),params:Ge}),vo=p({name:a(),description:T(a()),required:T(R())}),Mt=p({...V.shape,...I.shape,description:T(a()),arguments:T(f(vo)),_meta:T(E({}))}),Ro=k.extend({method:g("notifications/prompts/list_changed"),params:y.optional()}),qe=p({type:g("text"),text:a(),annotations:Me.optional(),_meta:v(a(),P()).optional()}),Ee=p({type:g("image"),data:c,mimeType:a(),annotations:Me.optional(),_meta:v(a(),P()).optional()}),qt=p({type:g("audio"),data:c,mimeType:a(),annotations:Me.optional(),_meta:v(a(),P()).optional()}),Dr=p({type:g("tool_use"),name:a(),id:a(),input:v(a(),P()),_meta:v(a(),P()).optional()}),Vr=p({type:g("resource"),resource:x([ct,Nt]),annotations:Me.optional(),_meta:v(a(),P()).optional()}),Hr=lt.extend({type:g("resource_link")}),ut=x([qe,Ee,qt,Hr,Vr]),wo=p({role:s,content:ut}),At=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),Fr=k.extend({method:g("notifications/tools/list_changed"),params:y.optional()}),Jr=p({name:a().optional()}),Br=p({hints:f(Jr).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),Wr=p({mode:C(["auto","required","none"]).optional()}),Gr=p({type:g("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),Kr=p({type:g("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:C(["email","uri","date","date-time"]).optional(),default:a().optional()}),Yr=p({type:C(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),Qr=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),default:a().optional()}),Xr=p({type:g("string"),title:a().optional(),description:a().optional(),oneOf:f(p({const:a(),title:a()})),default:a().optional()}),en=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),enumNames:f(a()).optional(),default:a().optional()}),tn=x([Qr,Xr]),on=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({type:g("string"),enum:f(a())}),default:f(a()).optional()}),rn=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({anyOf:f(p({const:a(),title:a()}))}),default:f(a()).optional()}),nn=x([on,rn]),sn=x([en,tn,nn]),an=x([sn,Gr,Kr,Yr]),jt=_.extend({mode:g("form").optional(),message:a(),requestedSchema:p({type:g("object"),properties:v(a(),an),required:f(a()).optional()}).catchall(P())}),Lt=p({type:g("ref/resource"),uri:a()}),Ut=p({type:g("ref/prompt"),name:a()}),cn=p({uri:a().startsWith("file://"),name:a().optional(),_meta:v(a(),P()).optional()}),dt=ee.shape,ln=p({experimental:dt.experimental,sampling:dt.sampling,elicitation:dt.elicitation,roots:dt.roots,extensions:dt.extensions}),Te=Be.shape,xo=p({experimental:Te.experimental,logging:Te.logging,completions:Te.completions,prompts:Te.prompts,resources:Te.resources,tools:Te.tools,extensions:Te.extensions}),Po=E({progressToken:o.optional(),[oo]:a(),[pr]:K.optional(),[ro]:ln,[hr]:i.optional()}),Zt=p({...V.shape,...I.shape,description:a().optional(),inputSchema:E({$schema:a().optional(),type:g("object")}),outputSchema:E({$schema:a().optional()}).optional(),annotations:At.optional(),_meta:v(a(),P()).optional()}),un=p({type:g("tool_result"),toolUseId:a(),content:f(ut),structuredContent:P().optional(),isError:R().optional(),_meta:v(a(),P()).optional()}),To=x([qe,Ee,qt,Dr,un]),Dt=p({role:s,content:x([To,f(To)]),_meta:v(a(),P()).optional()}),ko=a(),Eo=E({[Tt]:K.optional().catch(void 0)}),$o=Eo.optional();function ae(Q){return E({_meta:$o,resultType:ko.default("complete"),...Q})}let dn=ae({}),ca=ae({nextCursor:r.optional()}),Co=ae({content:f(ut),structuredContent:P().optional(),isError:R().optional()}),pn=ae({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),tools:f(Zt),nextCursor:r.optional()}),hn=ae({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),prompts:f(Mt),nextCursor:r.optional()}),mn=ae({description:a().optional(),messages:f(wo)}),fn=ae({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),resources:f(lt),nextCursor:r.optional()}),gn=ae({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),resourceTemplates:f(yo),nextCursor:r.optional()}),Sn=ae({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),contents:f(x([ct,Nt]))}),_n=ae({completion:p({values:f(a()).max(100),total:b().int().optional(),hasMore:R().optional()}).loose()}),la=ae({ttlMs:b().int().min(0),cacheScope:C(["public","private"])}),bn=ae({ttlMs:b().int().min(0).catch(0),cacheScope:C(["public","private"]).catch("private"),supportedVersions:f(a()),capabilities:xo,instructions:a().optional()}),pt=p({messages:f(Dt),modelPreferences:Br.optional(),systemPrompt:a().optional(),includeContext:C(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:f(a()).optional(),metadata:t.optional(),tools:f(Zt).optional(),toolChoice:Wr.optional()}),yn=p({method:g("sampling/createMessage"),params:pt}),zn=p({method:g("roots/list"),params:p({_meta:v(a(),P()).optional()}).optional()}),vn=p({...Dt.shape,model:a(),stopReason:a().optional()}),Rn=p({roots:f(cn)}),wn=p({action:C(["accept","decline","cancel"]),content:v(a(),x([a(),b(),R(),f(a())])).optional()}),xn=p({mode:g("url"),message:a(),url:a().url()}),Pn=x([jt,xn]),Tn=p({method:g("elicitation/create"),params:Pn}),kn=x([yn,zn,Tn]),En=x([vn,Rn,wn]),$n=v(a(),kn),Cn=v(a(),En),Vt=ae({inputRequests:$n.optional(),requestState:a().optional()}),Ht={inputResponses:Cn.optional(),requestState:a().optional()},ua=p({_meta:Po,...Ht}),da=E({progressToken:o.optional()});function ze(Q,Jt){return p({method:g(Q),params:p({_meta:Po,...Jt})})}function ve(Q,Jt){return p({method:g(Q),params:p({_meta:da.optional(),...Jt}).optional()})}let In={name:a(),arguments:v(a(),P()).optional(),...Ht},$e={cursor:r.optional()},pa=ze("tools/call",In),ha=ze("tools/list",$e),ma=ze("prompts/list",$e),fa=ze("prompts/get",{name:a(),arguments:v(a(),a()).optional(),...Ht}),ga=ze("resources/list",$e),Sa=ze("resources/templates/list",$e),_a=ze("resources/read",{uri:a(),...Ht}),On={ref:x([Ut,Lt]),argument:p({name:a(),value:a()}),context:p({arguments:v(a(),a()).optional()}).optional()},ba=ze("completion/complete",On),ya=ze("server/discover",{}),Io=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:f(a()).optional()}),Nn={notifications:Io},za=ze("subscriptions/listen",Nn),va=Eo.extend({"io.modelcontextprotocol/subscriptionId":n}),Mn=E({_meta:va,resultType:ko.default("complete")}),ht={"tools/call":ve("tools/call",In),"tools/list":ve("tools/list",$e),"prompts/get":ve("prompts/get",{name:a(),arguments:v(a(),a()).optional()}),"prompts/list":ve("prompts/list",$e),"resources/list":ve("resources/list",$e),"resources/templates/list":ve("resources/templates/list",$e),"resources/read":ve("resources/read",{uri:a()}),"completion/complete":ve("completion/complete",On),"server/discover":ve("server/discover",{}),"subscriptions/listen":ve("subscriptions/listen",Nn)};function Se(Q){return E({_meta:$o,...Q})}let Ra={"tools/call":Se({content:f(ut),structuredContent:P().optional(),isError:R().optional()}),"tools/list":Se({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),tools:f(Zt),nextCursor:r.optional()}),"prompts/get":Se({description:a().optional(),messages:f(wo)}),"prompts/list":Se({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),prompts:f(Mt),nextCursor:r.optional()}),"resources/list":Se({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),resources:f(lt),nextCursor:r.optional()}),"resources/templates/list":Se({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),resourceTemplates:f(yo),nextCursor:r.optional()}),"resources/read":Se({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),contents:f(x([ct,Nt]))}),"completion/complete":Se({completion:p({values:f(a()).max(100),total:b().int().optional(),hasMore:R().optional()}).loose()}),"server/discover":Se({ttlMs:b().int().min(0).catch(0),cacheScope:C(["public","private"]).catch("private"),supportedVersions:f(a()),capabilities:xo,instructions:a().optional()}),"subscriptions/listen":Se({})},Ft=E({"io.modelcontextprotocol/subscriptionId":n.optional()}),Oo=p({method:g("notifications/subscriptions/acknowledged"),params:p({_meta:Ft.optional(),notifications:Io})}),No=p({_meta:Ft.optional(),requestId:n,reason:a().optional()}),Mo=p({method:g("notifications/cancelled"),params:No}),Zl={"notifications/cancelled":Mo,"notifications/progress":Ot,"notifications/message":Zr,"notifications/resources/updated":zo,"notifications/resources/list_changed":We,"notifications/tools/list_changed":Fr,"notifications/prompts/list_changed":Ro,"notifications/subscriptions/acknowledged":Oo},pe=Q=>p({jsonrpc:g("2.0"),id:x([a(),b().int()]),result:Q}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:r,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:l,RelatedTaskMetadataSchema:d,RequestMetaSchema:m,BaseRequestParamsSchema:S,TaskAugmentedRequestParamsSchema:_,NotificationsParamsSchema:y,NotificationSchema:k,IconSchema:$,IconsSchema:I,BaseMetadataSchema:V,ImplementationSchema:K,ClientTasksCapabilitySchema:J,ServerTasksCapabilitySchema:F,ClientCapabilitiesSchema:ee,ServerCapabilitiesSchema:Be,ProgressSchema:de,ProgressNotificationParamsSchema:at,ProgressNotificationSchema:Ot,LoggingMessageNotificationParamsSchema:Ur,LoggingMessageNotificationSchema:Zr,ResourceContentsSchema:bo,TextResourceContentsSchema:ct,BlobResourceContentsSchema:Nt,AnnotationsSchema:Me,ResourceSchema:lt,ResourceTemplateSchema:yo,ResourceListChangedNotificationSchema:We,ResourceUpdatedNotificationParamsSchema:Ge,ResourceUpdatedNotificationSchema:zo,PromptArgumentSchema:vo,PromptSchema:Mt,PromptListChangedNotificationSchema:Ro,TextContentSchema:qe,ImageContentSchema:Ee,AudioContentSchema:qt,ToolUseContentSchema:Dr,EmbeddedResourceSchema:Vr,ResourceLinkSchema:Hr,ContentBlockSchema:ut,PromptMessageSchema:wo,ToolAnnotationsSchema:At,ToolListChangedNotificationSchema:Fr,ModelHintSchema:Jr,ModelPreferencesSchema:Br,ToolChoiceSchema:Wr,BooleanSchemaSchema:Gr,StringSchemaSchema:Kr,NumberSchemaSchema:Yr,UntitledSingleSelectEnumSchemaSchema:Qr,TitledSingleSelectEnumSchemaSchema:Xr,LegacyTitledEnumSchemaSchema:en,SingleSelectEnumSchemaSchema:tn,UntitledMultiSelectEnumSchemaSchema:on,TitledMultiSelectEnumSchemaSchema:rn,MultiSelectEnumSchemaSchema:nn,EnumSchemaSchema:sn,PrimitiveSchemaDefinitionSchema:an,ElicitRequestFormParamsSchema:jt,ResourceTemplateReferenceSchema:Lt,PromptReferenceSchema:Ut,RootSchema:cn,ClientCapabilities2026Schema:ln,ServerCapabilities2026Schema:xo,RequestMetaEnvelopeSchema:Po,ToolSchema:Zt,ToolResultContentSchema:un,SamplingMessageContentBlockSchema:To,SamplingMessageSchema:Dt,ResultTypeSchema:ko,ResultMetaSchema:Eo,ResultSchema:dn,PaginatedResultSchema:ca,CallToolResultSchema:Co,ListToolsResultSchema:pn,ListPromptsResultSchema:hn,GetPromptResultSchema:mn,ListResourcesResultSchema:fn,ListResourceTemplatesResultSchema:gn,ReadResourceResultSchema:Sn,CompleteResultSchema:_n,CacheableResultSchema:la,DiscoverResultSchema:bn,CreateMessageRequestParamsSchema:pt,CreateMessageRequestSchema:yn,ListRootsRequestSchema:zn,CreateMessageResultSchema:vn,ListRootsResultSchema:Rn,ElicitResultSchema:wn,ElicitRequestURLParamsSchema:xn,ElicitRequestParamsSchema:Pn,ElicitRequestSchema:Tn,InputRequestSchema:kn,InputResponseSchema:En,InputRequestsSchema:$n,InputResponsesSchema:Cn,InputRequiredResultSchema:Vt,InputResponseRequestParamsSchema:ua,CallToolRequestSchema:pa,ListToolsRequestSchema:ha,ListPromptsRequestSchema:ma,GetPromptRequestSchema:fa,ListResourcesRequestSchema:ga,ListResourceTemplatesRequestSchema:Sa,ReadResourceRequestSchema:_a,CompleteRequestSchema:ba,DiscoverRequestSchema:ya,SubscriptionFilterSchema:Io,SubscriptionsListenRequestSchema:za,SubscriptionsListenResultMetaSchema:va,SubscriptionsListenResultSchema:Mn,dispatchRequestSchemas:ht,dispatchResultSchemas:Ra,NotificationMetaSchema:Ft,SubscriptionsAcknowledgedNotificationSchema:Oo,CancelledNotificationParamsSchema:No,CancelledNotificationSchema:Mo,notificationSchemas2026:Zl,JSONRPCResultResponseSchema:pe(dn),CallToolResultResponseSchema:pe(x([Co,Vt])),ListToolsResultResponseSchema:pe(pn),ListPromptsResultResponseSchema:pe(hn),GetPromptResultResponseSchema:pe(x([mn,Vt])),ListResourcesResultResponseSchema:pe(fn),ListResourceTemplatesResultResponseSchema:pe(gn),ReadResourceResultResponseSchema:pe(x([Sn,Vt])),CompleteResultResponseSchema:pe(_n),DiscoverResultResponseSchema:pe(bn),SubscriptionsListenResultResponseSchema:pe(Mn)}}var qy;function It(){return qy??=My()}var Ay=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function jy(e){return Ay.includes(e)}var Qm=Symbol("modelcontextprotocol.resultCacheHintFallback");function Ly(e){return e[Qm]}function qS(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function AS(e){return e==="public"||e==="private"}var A=(function(e){return e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.ResourceNotFound=-32002]="ResourceNotFound",e[e.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",e[e.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired",e})({}),ie=class jS extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return Pe(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Pe(this,t)}constructor(t,o,r){super(o),this.code=t,this.data=r,this.name="ProtocolError",_o(this,new.target)}static fromError(t,o,r){if(t===A.UrlElicitationRequired&&r){let n=r;if(n.elicitations)return new US(n.elicitations,o)}if(t===A.UnsupportedProtocolVersion&&r){let n=r;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new ZS({supported:n.supported,requested:n.requested},o)}if(t===A.InvalidParams||t===A.ResourceNotFound){let n=r;if(typeof n?.uri=="string"&&(t===A.ResourceNotFound||Object.keys(n).length===1))return new LS(n.uri,o)}if(t===A.MissingRequiredClientCapability&&r){let n=r;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities=="object"&&!Array.isArray(n.requiredCapabilities))return new DS({requiredCapabilities:n.requiredCapabilities},o)}return new jS(t,o,r)}},LS=class extends ie{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(A.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},US=class extends ie{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(A.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},ZS=class extends ie{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(A.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},DS=class extends ie{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(A.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Uy=0,Zy="private",Dy=["tools/call","prompts/get","resources/read"];function Vy(e,t){let o=t.resultType;if(o===void 0)return{...t,resultType:"complete"};if(o==="complete"||Dy.includes(e))return t;throw new ie(A.InternalError,`Handler for ${e} returned resultType '${String(o)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function Hy(e,t){let o=Ly(t);if(t.resultType!=="complete"||!jy(e))return o===void 0?t:Gy(t);let r=t,n=qS(r.ttlMs)?r.ttlMs:By(o),s=AS(r.cacheScope)?r.cacheScope:Wy(o),i={...r,ttlMs:n,cacheScope:s};return delete i[Qm],i}function Fy(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Jy(e,t){if(t===void 0)return e;let o=e._meta;return o===void 0?{...e,_meta:{[Tt]:t}}:!Fy(o)||o[Tt]!==void 0?e:{...e,_meta:{...o,[Tt]:t}}}function By(e){return e!==void 0&&qS(e.ttlMs)?e.ttlMs:Uy}function Wy(e){return e!==void 0&&AS(e.cacheScope)?e.cacheScope:Zy}function Gy(e){let t={...e};return delete t[Qm],t}var Ky=["elicitation/create","sampling/createMessage","roots/list"],jl;function VS(){if(jl)return jl;let e=It();return jl={request:{"elicitation/create":p({method:g("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":p({method:g("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":p({method:g("roots/list"),params:E({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},jl}function HS(e){return Ky.includes(e)}function Lm(e){return HS(e)?VS().request[e]:void 0}function Yy(e){return HS(e)?VS().response[e]:void 0}var Xm={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},FS={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function JS(e){return Object.prototype.hasOwnProperty.call(Xm,e)}function BS(e){return Object.prototype.hasOwnProperty.call(FS,e)}function Qy(e){return Object.prototype.hasOwnProperty.call(Xm,e)}function Xy(e){return JS(e)?It().dispatchRequestSchemas[e]:void 0}function ez(e){return Qy(e)?It().dispatchResultSchemas[e]:void 0}function tz(e){return BS(e)?It().notificationSchemas2026[e]:void 0}var VR=Object.keys(Xm),HR=Object.keys(FS);function oa(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ea(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let o=e.safeParse(t);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}var oz={ok:!1,reason:"not-in-era"},rz=[oo,ro];function nz(e,t){let o=t,r=!1,n=()=>(r||(o={...o},r=!0),o),s=t.tools;e==="tools/list"&&Array.isArray(s)&&s.some(c=>oa(c)&&"execution"in c)&&(n().tools=s.map(c=>{if(!oa(c)||!("execution"in c))return c;let l={...c};return delete l.execution,l}));let i=t.capabilities;if(oa(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return o}var ef={era:"2026-07-28",hasRequestMethod:JS,hasNotificationMethod:BS,hasInputRequestMethod:e=>Lm(e)!==void 0,validateRequest:(e,t)=>ea(Xy(e),t),validateResult:(e,t)=>ea(ez(e),t),validateNotification:(e,t)=>ea(tz(e),t),validateInputRequest:(e,t)=>ea(Lm(e),t),validateInputResponse:(e,t)=>ea(Yy(e),t),samplingResultVariant:()=>oz,outboundEnvelope(e){return{[oo]:e.protocolVersion,[pr]:e.clientInfo,[ro]:e.clientCapabilities,...e.logLevel!==void 0&&{[hr]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let r of rz)r in e||t.push({key:r,problem:"missing"});let o=It().RequestMetaEnvelopeSchema.safeParse(e);if(!o.success)for(let r of o.error.issues){let n=r.path.map(String),s=n.length>0?n.join("."):"_meta";n.length===1&&t.some(i=>i.key===s&&i.problem==="missing")||t.push({key:s,problem:r.message})}return t},projectCallToolResult:e=>kS(e),inputRequestSchema:Lm,decodeResult(e,t){if(!oa(t))return{kind:"invalid",error:new X(se.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let o=t.resultType;if(o===void 0)return{kind:"invalid",error:new X(se.InvalidResult,`Invalid result for ${e}: missing required resultType \u2014 servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if(typeof o!="string")return{kind:"invalid",error:new X(se.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:o})};if(o==="input_required"){let i=t.inputRequests,c=oa(i)?i:{},l=t.requestState,d=t._meta===void 0?void 0:It().ResultMetaSchema.safeParse(t._meta),m=d?.success?d.data:void 0;return Object.keys(c).length===0&&typeof l!="string"?{kind:"invalid",error:new X(se.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:c,...typeof l=="string"&&{requestState:l},...m!==void 0&&{_meta:m}}}if(o!=="complete")return{kind:"invalid",error:new X(se.UnsupportedResultType,`Unsupported result type '${o}' for ${e}`,{resultType:o,method:e})};let r=sz(),n=Object.hasOwn(r,e)?r[e]:void 0;if(n!==void 0){let i=n.safeParse(t);if(!i.success)return{kind:"invalid",error:new X(se.InvalidResult,`Invalid result for ${e}: ${i.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,o){return Jy(Hy(e,Vy(e,nz(e,t))),o)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=It().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(o=>o.message).join("; ")}`}},Ll;function sz(){if(Ll)return Ll;let e=It();return Ll={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},Ll}var tf="2026-07-28";function na(e){return e!==void 0&&TS(e)?ef:Ym}function bS(e){return e.revision!==void 0?na(e.revision).era:e.era==="modern"?ef.era:Ym.era}function Um(e){return WS.some(t=>t.hasRequestMethod(e))}function Zm(e){return WS.some(t=>t.hasNotificationMethod(e))}function yS(e){return e==="tasks/get"||e==="tasks/cancel"}var WS=[Ym,ef],iz=hf({AnnotationsSchema:()=>He,AudioContentSchema:()=>po,BaseMetadataSchema:()=>De,BaseRequestParamsSchema:()=>oe,BlobResourceContentsSchema:()=>Tr,BooleanSchemaSchema:()=>Cr,CallToolRequestParamsSchema:()=>ci,CallToolRequestSchema:()=>li,CallToolResultSchema:()=>Ct,CancelTaskRequestSchema:()=>Pl,CancelTaskResultSchema:()=>Tl,CancelledNotificationParamsSchema:()=>gs,CancelledNotificationSchema:()=>yr,ClientCapabilitiesSchema:()=>_s,ClientNotificationSchema:()=>El,ClientRequestSchema:()=>kl,ClientResultSchema:()=>$l,ClientTasksCapabilitySchema:()=>hl,CompatibilityCallToolResultSchema:()=>fl,CompleteRequestParamsSchema:()=>qi,CompleteRequestSchema:()=>Ai,CompleteResultSchema:()=>ji,ContentBlockSchema:()=>Fe,CreateMessageRequestParamsSchema:()=>zi,CreateMessageRequestSchema:()=>vi,CreateMessageResultSchema:()=>Ri,CreateMessageResultWithToolsSchema:()=>wi,CreateTaskResultSchema:()=>_l,CursorSchema:()=>fr,DiscoverRequestSchema:()=>Rs,DiscoverResultSchema:()=>vr,ElicitRequestFormParamsSchema:()=>So,ElicitRequestParamsSchema:()=>Ei,ElicitRequestSchema:()=>$i,ElicitRequestURLParamsSchema:()=>ki,ElicitResultSchema:()=>Oi,ElicitationCompleteNotificationParamsSchema:()=>Ci,ElicitationCompleteNotificationSchema:()=>Ii,EmbeddedResourceSchema:()=>ho,EmptyResultSchema:()=>Et,EnumSchemaSchema:()=>Ti,GetPromptRequestParamsSchema:()=>Qs,GetPromptRequestSchema:()=>Xs,GetPromptResultSchema:()=>oi,GetTaskPayloadRequestSchema:()=>vl,GetTaskPayloadResultSchema:()=>Rl,GetTaskRequestSchema:()=>yl,GetTaskResultSchema:()=>zl,IconSchema:()=>Ss,IconsSchema:()=>ot,ImageContentSchema:()=>uo,ImplementationSchema:()=>Ve,InitializeRequestParamsSchema:()=>bs,InitializeRequestSchema:()=>ys,InitializeResultSchema:()=>zs,InitializedNotificationSchema:()=>vs,JSONArraySchema:()=>dl,JSONObjectSchema:()=>B,JSONRPCErrorResponseSchema:()=>io,JSONRPCMessageSchema:()=>ao,JSONRPCNotificationSchema:()=>br,JSONRPCRequestSchema:()=>_r,JSONRPCResponseSchema:()=>pl,JSONRPCResultResponseSchema:()=>so,JSONValueSchema:()=>tt,LegacyTitledEnumSchemaSchema:()=>Nr,ListChangedOptionsBaseSchema:()=>gl,ListPromptsRequestSchema:()=>Ks,ListPromptsResultSchema:()=>Ys,ListResourceTemplatesRequestSchema:()=>$s,ListResourceTemplatesResultSchema:()=>Cs,ListResourcesRequestSchema:()=>ks,ListResourcesResultSchema:()=>Es,ListRootsRequestSchema:()=>Ui,ListRootsResultSchema:()=>Zi,ListTasksRequestSchema:()=>wl,ListTasksResultSchema:()=>xl,ListToolsRequestSchema:()=>ii,ListToolsResultSchema:()=>ai,LoggingLevelSchema:()=>$r,LoggingMessageNotificationParamsSchema:()=>hi,LoggingMessageNotificationSchema:()=>mi,ModelHintSchema:()=>fi,ModelPreferencesSchema:()=>gi,MultiSelectEnumSchemaSchema:()=>Pi,NotificationSchema:()=>ne,NotificationsParamsSchema:()=>ue,NumberSchemaSchema:()=>go,PaginatedRequestParamsSchema:()=>Ps,PaginatedRequestSchema:()=>rt,PaginatedResultSchema:()=>nt,PingRequestSchema:()=>Rr,PrimitiveSchemaDefinitionSchema:()=>Ar,ProgressNotificationParamsSchema:()=>xs,ProgressNotificationSchema:()=>wr,ProgressSchema:()=>ws,ProgressTokenSchema:()=>mr,PromptArgumentSchema:()=>Ws,PromptListChangedNotificationSchema:()=>ri,PromptMessageSchema:()=>ti,PromptReferenceSchema:()=>Mi,PromptSchema:()=>Gs,ReadResourceRequestParamsSchema:()=>Is,ReadResourceRequestSchema:()=>Os,ReadResourceResultSchema:()=>Ns,RelatedTaskMetadataSchema:()=>fs,RequestIdSchema:()=>Ne,RequestMetaSchema:()=>gr,RequestSchema:()=>W,ResourceContentsSchema:()=>xr,ResourceLinkSchema:()=>mo,ResourceListChangedNotificationSchema:()=>Ms,ResourceRequestParamsSchema:()=>co,ResourceSchema:()=>kr,ResourceTemplateReferenceSchema:()=>Ni,ResourceTemplateSchema:()=>Ts,ResourceUpdatedNotificationParamsSchema:()=>Js,ResourceUpdatedNotificationSchema:()=>Bs,ResultMetaObjectSchema:()=>Sr,ResultSchema:()=>G,RoleSchema:()=>st,RootSchema:()=>Li,RootsListChangedNotificationSchema:()=>Di,SamplingContentSchema:()=>bi,SamplingMessageContentBlockSchema:()=>Pt,SamplingMessageSchema:()=>yi,ServerCapabilitiesSchema:()=>zr,ServerNotificationSchema:()=>Il,ServerRequestSchema:()=>Cl,ServerResultSchema:()=>Ol,ServerTasksCapabilitySchema:()=>ml,SetLevelRequestParamsSchema:()=>di,SetLevelRequestSchema:()=>pi,SingleSelectEnumSchemaSchema:()=>xi,StringSchemaSchema:()=>fo,SubscribeRequestParamsSchema:()=>qs,SubscribeRequestSchema:()=>As,SubscriptionFilterSchema:()=>Er,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Ds,SubscriptionsAcknowledgedNotificationSchema:()=>Vs,SubscriptionsListenRequestParamsSchema:()=>Us,SubscriptionsListenRequestSchema:()=>Zs,SubscriptionsListenResultMetaSchema:()=>Hs,SubscriptionsListenResultSchema:()=>Fs,TaskAugmentedRequestParamsSchema:()=>kt,TaskCreationParamsSchema:()=>Sl,TaskMetadataSchema:()=>ms,TaskSchema:()=>it,TaskStatusNotificationParamsSchema:()=>Hi,TaskStatusNotificationSchema:()=>bl,TaskStatusSchema:()=>Vi,TextContentSchema:()=>lo,TextResourceContentsSchema:()=>Pr,TitledMultiSelectEnumSchemaSchema:()=>qr,TitledSingleSelectEnumSchemaSchema:()=>Or,ToolAnnotationsSchema:()=>ni,ToolChoiceSchema:()=>Si,ToolExecutionSchema:()=>si,ToolListChangedNotificationSchema:()=>ui,ToolResultContentSchema:()=>_i,ToolSchema:()=>$t,ToolUseContentSchema:()=>ei,UnsubscribeRequestParamsSchema:()=>js,UnsubscribeRequestSchema:()=>Ls,UntitledMultiSelectEnumSchemaSchema:()=>Mr,UntitledSingleSelectEnumSchemaSchema:()=>Ir});var GS=e=>_r.safeParse(e).success,KS=e=>br.safeParse(e).success,Jm=e=>so.safeParse(e).success,YS=e=>io.safeParse(e).success;var ra=-32020,FR=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32e3],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[A.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[ra,A.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[A.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope \u2014 and a missing envelope on a request whose protocol-version header names a modern revision \u2014 is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[A.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision\u2019s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[A.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[ra],conformance:["http-header-validation"],rationale:"SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half \u2014 including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[A.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced \u2014 pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[ra],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool\u2019s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],JR={[A.ParseError]:400,[A.InvalidRequest]:400,[A.MethodNotFound]:404,[A.UnsupportedProtocolVersion]:400,[A.MissingRequiredClientCapability]:400,[ra]:400};function of(e,t){return os(e,t)}function ta(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function Bm(e){if(e==null)return!1;let t=typeof e;return t!=="object"&&t!=="function"||!("~standard"in e)?!1:typeof e["~standard"]?.validate=="function"}var zS=!1,Wm="draft-2020-12";function az(e,t="input"){let o=e["~standard"],r;if(o.jsonSchema)r=o.jsonSchema[t]({target:Wm});else if(o.vendor==="zod"){if(!("_zod"in e))throw new Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");zS||(zS=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=eo(e,{target:Wm,io:t})}else throw new Error(`Schema library "${o.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output")return r.type!==void 0?r:QS(r)?{type:"object",...r}:r;if(r.type!==void 0&&r.type!=="object")throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...r}}function QS(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(let t of["oneOf","anyOf","allOf"]){let o=e[t];if(Array.isArray(o)&&o.length>0)return o.every(r=>r!==null&&typeof r=="object"&&(r.type==="object"||QS(r)))}return!1}function cz(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function Dm(e,t){let o=await e["~standard"].validate(t);return o.issues&&o.issues.length>0?{success:!1,error:o.issues.map(r=>cz(r)).join(", ")}:{success:!0,data:o.value}}function lz(e){let t=eo(e,{target:Wm,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var uz=/\\\.\\d\{(\d+)\}/;function dz(e){let t=uz.exec(e),o=[void 0,-1,0];return t&&o.push(Number(t[1])),[!1,!0].flatMap(r=>[!1,!0].flatMap(n=>o.map(s=>xe.datetime({local:r,offset:n,precision:s}))))}function pz(e,t){let o;switch(e){case"email":o=[Lc()];break;case"uri":o=[ar()];break;case"date":o=[xe.date()];break;case"date-time":o=dz(t);break}return new Set(o.map(r=>lz(r)).filter(r=>r!==void 0))}function hz(e,t,o){return o!=="zod"?!0:pz(e,t).has(t)}function sa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function mz(e){try{return az(e,"input")}catch(t){let o=t instanceof Error?t.message:String(t);throw new ie(A.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${o}`)}}var fz=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function rf(e){return fz.has(e)||e.startsWith("x-")}var gz=new Set(["$schema",...Object.keys(So.shape.requestedSchema.shape)]),vS={string:ta([fo,Ir,Or,Nr]),number:ta([go]),integer:ta([go]),boolean:ta([Cr]),array:ta([Mr,qr])},Sz=new Set(fo.shape.format.unwrap().options);function _z(e,t,o,r){if(!sa(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(vS,e.type)?vS[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,c]of Object.entries(e))n.has(i)||rf(i)?s[i]=c:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?Sz.has(e.format)?(typeof c!="string"||!hz(e.format,c,o))&&r.push(`${t}.${i}`):s[i]=c:r.push(`${t}.${i}`);return s}function bz(e,t){let o={},r=[];for(let[n,s]of Object.entries(e))n==="properties"&&sa(s)?o[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,_z(c,`properties.${i}`,t,r)])):gz.has(n)?o[n]=s:rf(n)||r.push(n);if(r.length>0)throw new ie(A.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(", ")}`);return o}function yz(e,t){if(!sa(e.properties))return t;let o=Object.entries(e.properties).filter(([,r])=>!of(Ar,r).success).map(([r])=>`properties.${r}`);return o.length>0?o.join(", "):t}function Gm(e,t,o=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((r,n)=>Gm(r,t[n],`${o}[${n}]`)):!sa(e)||!sa(t)?[]:Object.entries(e).flatMap(([r,n])=>{let s=o?`${o}.${r}`:r;return Object.prototype.hasOwnProperty.call(t,r)?Gm(n,t[r],s):rf(r)?[]:[s]})}function zz(e){if(!Bm(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,o=bz(mz(e.requestedSchema),t),r=of(So.shape.requestedSchema,o);if(!r.success)throw new ie(A.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${yz(o,r.error.message)}`);let n=Gm(o,r.data);if(n.length>0)throw new ie(A.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(r.data.required??[]).filter(i=>!Object.prototype.hasOwnProperty.call(r.data.properties,i));if(s.length>0)throw new ie(A.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:r.data}}function vz(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,o=typeof e.requestState=="string";if(!t&&!o)throw new TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}var BR=Object.assign(vz,{elicit(e){try{return{method:"elicitation/create",params:zz(e)}}catch(t){throw t instanceof ie?new TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});var Rz=["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"],wz={IdJagTokenExchangeResponseSchema:Gi,OAuthClientInformationFullSchema:Xi,OAuthClientInformationSchema:Qi,OAuthClientMetadataSchema:Yi,OAuthClientRegistrationErrorSchema:Nl,OAuthErrorResponseSchema:Ki,OAuthMetadataSchema:jr,OAuthProtectedResourceMetadataSchema:Fi,OAuthTokenRevocationRequestSchema:Ml,OAuthTokensSchema:Wi,OpenIdProviderDiscoveryMetadataSchema:Bi,OpenIdProviderMetadataSchema:Ji},XS={},e_={};function t_(e,t){let o=e.slice(0,-6);XS[o]=t,e_[o]=r=>t.safeParse(r).success}for(let e of Rz)t_(e,iz[e]);for(let[e,t]of Object.entries(wz))t_(e,t);var xz=Object.freeze(XS),Pz=Object.freeze(e_);function Tz(e){switch(e){case"initialize":case"notifications/initialized":return na(void 0);case"server/discover":return na(tf);default:return}}var o_=6e4,kz=[oo,pr,ro,hr],Ez=["inputResponses","requestState"];function RS(e,t){let o=e.params;if(!Vm(o))return{message:e,lifted:{}};let r=o._meta,n=Vm(r)?kz.filter(l=>l in r):[],s=t==="request"?Ez.filter(l=>l in o):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...o};if(n.length>0&&Vm(r)){let l={},d={...r};for(let m of n)l[m]=r[m],delete d[m];i.envelope=l,Object.keys(d).length>0?c._meta=d:delete c._meta}for(let l of s)l==="inputResponses"&&(i.inputResponses=c[l]),l==="requestState"&&(i.requestState=c[l]),delete c[l];return{message:{...e,params:c},lifted:i}}function wS(e,t){let o=e.validateResult(t,void 0);if(!(!o.ok&&o.reason==="not-in-era"))return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(r){let n=e.validateResult(t,r);return n.ok?{value:n.value}:{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function r_(e){return()=>e}var $z=r_(void 0),Cz,nf=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{Cz=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??cl,this.setNotificationHandler("notifications/cancelled",t=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",t=>{this._onprogress(t)}),this.setRequestHandler("ping",t=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let o=e.params??{};return{...e,params:{...o,_meta:{...t,...o._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new X(se.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,o,r,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:o,resetTimeoutOnProgress:n,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let o=Date.now()-t.startTime;if(t.maxTotalTimeout&&o>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new X(se.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:o});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let o=this.transport?.onerror;this._transport.onerror=n=>{o?.(n),this._onerror(n)};let r=this._transport?.onmessage;this._transport.onmessage=(n,s)=>{r?.(n,s),Jm(n)||YS(n)?this._onresponse(n):GS(n)?this._onrequest(n,s):KS(n)?this._onnotification(n,s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(n)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let r of this._timeoutInfo.values())clearTimeout(r.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let o=new X(se.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let r of e.values())r(o);for(let r of t.values())r.abort(o)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:o}=RS(e,"notification"),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=bS(t.classification);if(i!==r.era){this._onerror(new Error(`Era mismatch on inbound notification '${o.method}': classified as ${i} but this instance serves ${r.era}`));return}}if(Zm(o.method)&&!r.hasNotificationMethod(o.method))return;let n=this._notificationHandlers.get(o.method),s=this.fallbackNotificationHandler;n===void 0&&s===void 0||Promise.resolve().then(()=>n===void 0?s(o):n(o,r)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,t){let{message:o,lifted:r}=RS(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(new Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let s=this._transport,i=($,I,V)=>{let K={jsonrpc:"2.0",id:o.id,error:{code:$,message:I,...V!==void 0&&{data:V}}};s?.send(K).catch(U=>this._onerror(new Error(`Failed to send an error response: ${U}`)))};if(t?.classification!==void 0){let $=bS(t.classification);if($!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${o.method}': classified as ${$} but this instance serves ${n.era}`));let I=t.classification.revision??$;i(A.UnsupportedProtocolVersion,`Unsupported protocol version: ${I}`,{supported:this._supportedProtocolVersions,requested:I});return}}if(Um(o.method)&&!n.hasRequestMethod(o.method)&&!(yS(o.method)&&this._customSchemaRequestMethods.has(o.method))){i(A.MethodNotFound,"Method not found");return}let c=this._requestHandlers.get(o.method)??this.fallbackRequestHandler;if(c===void 0){i(A.MethodNotFound,"Method not found");return}let l=n.checkInboundEnvelope(r);if(l!==void 0){i(A.InvalidParams,l);return}let d=($,I)=>this._notificationViaCodec(this._resolveOutboundCodec($.method),$,{...I,relatedRequestId:o.id}),m=($,I,V)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec($.method),$,I,{...V,relatedRequestId:o.id}),S=new AbortController;this._requestHandlerAbortControllers.set(o.id,S);let _=r.inputResponses===void 0?void 0:Iz(r.inputResponses),y={sessionId:s?.sessionId,mcpReq:{id:o.id,method:o.method,_meta:o.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},..._!==void 0&&{inputResponses:_.accepted},..._!==void 0&&_.droppedKeys.length>0&&{droppedInputResponseKeys:_.droppedKeys},requestState:r.requestState===void 0?$z:r_(r.requestState),signal:S.signal,send:(($,I,V)=>{let K=this._resolveOutboundCodec($.method);if(this._assertOutboundRequestInEra(K,$.method),Bm(I))return m($,I,V);let U=wS(K,$.method);if(U===void 0)throw new TypeError(`'${$.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return m($,U,I)}),notify:d},http:t?.authInfo?{authInfo:t.authInfo}:void 0},k=this.buildContext(y,t);Promise.resolve().then(()=>c(o,k)).then(async $=>{if(S.signal.aborted)return;let I;try{I=n.encodeResult(o.method,$,this._outboundServerInfo())}catch(K){this._onerror(new Error(`Failed to encode result for ${o.method}: ${K}`)),i(A.InternalError,"Internal error");return}let V={result:I,jsonrpc:"2.0",id:o.id};await s?.send(V)},async $=>{if(S.signal.aborted)return;let I=Number.isSafeInteger($.code)?$.code:A.InternalError,V={jsonrpc:"2.0",id:o.id,error:{code:n.encodeErrorCode(I),message:$.message??"Internal error",...$.data!==void 0&&{data:$.data}}};await s?.send(V)}).catch($=>this._onerror(new Error(`Failed to send response: ${$}`))).finally(()=>{this._requestHandlerAbortControllers.get(o.id)===S&&this._requestHandlerAbortControllers.delete(o.id)})}_onprogress(e){let{progressToken:t,...o}=e.params,r=Number(t),n=this._progressHandlers.get(r);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&s&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(c){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),s(c);return}n(o)}_onresponse(e){let t=Number(e.id),o=this._responseHandlers.get(t);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Jm(e)?o(e):o(ie.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,o){let r=this._resolveOutboundCodec(e.method);if(Bm(t))return yS(e.method)||this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,o);this._assertOutboundRequestInEra(r,e.method);let n=wS(r,e.method);if(n===void 0)throw new TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,n,t)}_negotiatedWireCodec(){return na(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Tz(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Um(t)&&!e.hasRequestMethod(t))throw new X(se.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,o){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,o)}_requestWithSchemaViaCodec(e,t,o,r){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c}=r??{},l=Date.now(),d,m;return new Promise((S,_)=>{let y=F=>{_(F)};if(!this._transport){y(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(F){y(F);return}if(r?.signal?.aborted){let F=r.signal.reason;throw F instanceof X?F:new X(se.RequestTimeout,String(F))}let k=e.era===tf&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,$=this._requestMessageId++;m=$;let I={...t,jsonrpc:"2.0",id:$};r?.onprogress&&(this._progressHandlers.set($,r.onprogress),I.params={...t.params,_meta:{...t.params?._meta,progressToken:$}});let V=this._envelopeOutbound(I),K=!1,U=F=>{K||(this._progressHandlers.delete($),k===void 0?t.method!=="initialize"&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:$,reason:String(F)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(ee=>this._onerror(new Error(`Failed to send cancellation: ${ee}`))):k.abort(),_(F instanceof X?F:new X(se.RequestTimeout,String(F))))};this._responseHandlers.set($,F=>{if(r?.signal?.aborted)return;if(K=!0,F instanceof Error)return _(F);let ee;try{ee=e.decodeResult(t.method,F.result)}catch(de){return _(de instanceof Error?de:new Error(String(de)))}if(ee.kind==="invalid")return _(ee.error);if(ee.kind==="input_required"){if(r?.allowInputRequired===!0)return S(Oz(ee));let de={codec:e,request:t,resultSchema:o,options:r,flowStartedAt:l,retry:(at,Ot)=>this._requestWithSchemaViaCodec(e,at===void 0?{method:t.method}:{method:t.method,params:at},o,Ot)};return S(this._resolveNonCompleteResult(ee,de))}let Be=ee.result;Dm(o,Be).then(de=>{de.success?S(de.data):_(new X(se.InvalidResult,`Invalid result for ${t.method}: ${de.error}`))},_)}),d=()=>U(r?.signal?.reason),r?.signal?.addEventListener("abort",d,{once:!0});let j=r?.timeout??o_,J=()=>U(new X(se.RequestTimeout,"Request timed out",{timeout:j}));this._setupTimeout($,j,r?.maxTotalTimeout,J,r?.resetTimeoutOnProgress??!1),this._transport.send(V,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c,requestSignal:k?.signal}).catch(F=>{this._progressHandlers.delete($),_(F)})}).finally(()=>{d&&r?.signal?.removeEventListener("abort",d),m!==void 0&&(this._responseHandlers.delete(m),this._cleanupTimeout(m))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,o){if(!this._transport)throw new X(se.NotConnected,"Not connected");if(Zm(t.method)&&!e.hasNotificationMethod(t.method))throw new X(se.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&o?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,o).catch(n=>this._onerror(n))});return}await this._transport.send(r,o)}setRequestHandler(e,t,o){this.assertRequestHandlerCapability(e);let r;if(typeof t=="function"){if(!Um(e))throw new TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,s)=>{let i=this._negotiatedWireCodec(),c=i.validateRequest(e,n);if(!c.ok&&c.reason==="not-in-era"&&(c=i.validateInputRequest(e,n)),!c.ok)throw c.reason==="not-in-era"?new ie(A.InternalError,`No wire schema for ${e} in the resolved era`):new Error(c.message);return Promise.resolve(t(c.value,s))}}else if(o)r=async(n,s)=>{let i=await Dm(t.params,{...n.params});if(!i.success)throw new ie(A.InvalidParams,`Invalid params for ${e}: ${i.error}`);return o(i.data,s)};else throw new TypeError("setRequestHandler: handler is required");typeof t=="function"?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,o){if(typeof t=="function"){if(!Zm(e))throw new TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(r,n)=>{let s=n.validateNotification(e,r);if(!s.ok)throw s.reason==="not-in-era"?new ie(A.InternalError,`No wire schema for ${e} in the resolved era`):new Error(s.message);return Promise.resolve(t(s.value))});return}if(!o)throw new TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async r=>{let n=await Dm(t.params,{...r.params});if(!n.success)throw new ie(A.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await o(n.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Vm(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function xS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Iz(e){let t={},o=[];if(!xS(e))return{accepted:t,droppedKeys:o};for(let[r,n]of Object.entries(e)){if(!xS(n)||"method"in n||"result"in n){o.push(r);continue}t[r]=n}return{accepted:t,droppedKeys:o}}function Oz(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var Nz=pf((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,o=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(c){if(!c)throw new TypeError("argument string is required");var l=typeof c=="object"?s(c):c;if(typeof l!="string")throw new TypeError("argument string is required to be a string");var d=l.indexOf(";"),m=d!==-1?l.slice(0,d).trim():l.trim();if(!r.test(m))throw new TypeError("invalid media type");var S=new i(m.toLowerCase());if(d!==-1){var _,y,k;for(t.lastIndex=d;y=t.exec(l);){if(y.index!==d)throw new TypeError("invalid parameter format");d+=y[0].length,_=y[1].toLowerCase(),k=y[2],k.charCodeAt(0)===34&&(k=k.slice(1,-1),k.indexOf("\\")!==-1&&(k=k.replace(o,"$1"))),S.parameters[_]=k}if(d!==l.length)throw new TypeError("invalid parameter format")}return S}function s(c){var l;if(typeof c.getHeader=="function"?l=c.getHeader("content-type"):typeof c.headers=="object"&&(l=c.headers&&c.headers["content-type"]),typeof l!="string")throw new TypeError("content-type header is missing from object");return l}function i(c){this.parameters=Object.create(null),this.type=c}})),WR=mf(Nz(),1);var Mz=10*1024*1024;var sw=typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker");var qz=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Az=[0,31,28,31,30,31,30,31,31,30,31,30,31],jz=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,Lz=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,Uz=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Zz=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Dz=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Vz=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Hz=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Fz=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Jz=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Bz=e=>{if(e[0]==='"')return!1;let[t,o,...r]=e.split("@");return!t||!o||r.length!==0||t.length>64||o.length>253||t[0]==="."||t.endsWith(".")||t.includes("..")||!/^[a-z0-9.-]+$/i.test(o)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:o.split(".").every(n=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(n))},Wz=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Gz=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,Kz=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function Je(e){return e.test.bind(e)}var iw={date:n_,time:s_.bind(void 0,!1),"date-time":Xz,duration:Kz,uri:ov,"uri-reference":Je(Uz),"uri-template":Je(Zz),url:Je(Dz),email:Bz,hostname:Je(Lz),ipv4:Je(Wz),ipv6:Je(Gz),regex:nv,uuid:Je(Vz),"json-pointer":Je(Hz),"json-pointer-uri-fragment":Je(Fz),"relative-json-pointer":Je(Jz)};function Yz(e){return e%4===0&&(e%100!==0||e%400===0)}function n_(e){let t=e.match(qz);if(!t)return!1;let o=+t[1],r=+t[2],n=+t[3];return r>=1&&r<=12&&n>=1&&n<=(r==2&&Yz(o)?29:Az[r])}function s_(e,t){let o=t.match(jz);if(!o)return!1;let r=+o[1],n=+o[2],s=+o[3],i=!!o[5];return(r<=23&&n<=59&&s<=59||r==23&&n==59&&s==60)&&(!e||i)}var Qz=/t|\s/i;function Xz(e){let t=e.split(Qz);return t.length==2&&n_(t[0])&&s_(!0,t[1])}var ev=/\/|:/,tv=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function ov(e){return ev.test(e)&&tv.test(e)}var rv=/[^\\]\\Z/;function nv(e){if(rv.test(e))return!1;try{return new RegExp(e,"u"),!0}catch{return!1}}var iv;iv=globalThis.crypto;var ia=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](e){return Pe(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Pe(this,e)}constructor(e){super(e),this.name=new.target.name,_o(this,new.target)}},ex=class extends ia{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.IssuerMismatchError"})}kind;expected;received;constructor(e,t,o){super(`Issuer mismatch in ${e==="metadata"?"authorization server metadata (RFC 8414 \xA73.3)":"authorization response (RFC 9207)"}: expected ${JSON.stringify(t)}, received ${JSON.stringify(o)}`),this.kind=e,this.expected=t,this.received=o}},tx=class extends ia{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.RegistrationRejectedError"})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},ox=class extends ia{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsecureTokenEndpointError"})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / *.localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},rx=class extends ia{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.AuthorizationServerMismatchError"})}constructor(e,t){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(e)} but this call resolved ${JSON.stringify(t)}; refusing to present them to a different authorization server`),this.recordedIssuer=e,this.currentIssuer=t}},nx=class extends ia{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsufficientScopeError"})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:""}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}};var sx=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](e){return Pe(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Pe(this,e)}constructor(e){super(e??"Unauthorized"),this.name="UnauthorizedError",_o(this,new.target)}};var ix=Symbol.for("mcp.authSeamEscape");var ax=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](e){return Pe(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Pe(this,e)}constructor(e,t,o){super(`SSE error: ${t}`),this.code=e,this.event=o,_o(this,new.target)}};var sf=class{_eventSlots=new Map;setHandler(t,o){let r=this._ensureEventSlot(t);r.onHandler&&o&&console.warn(`[MCP Apps] on${String(t)} handler replaced. Use addEventListener("${String(t)}", \u2026) to add multiple listeners without replacing.`),r.onHandler=o}getHandler(t){return this._eventSlots.get(t)?.onHandler}addEventListener(t,o){this._ensureEventSlot(t).listeners.push(o)}removeEventListener(t,o){let r=this._eventSlots.get(t);if(!r)return;let n=r.listeners.indexOf(o);n!==-1&&r.listeners.splice(n,1)}dispatch(t,o){let r=this._eventSlots.get(t);if(r){r.onHandler?.(o);for(let n of[...r.listeners])n(o)}}_ensureEventSlot(t){let o=this._eventSlots.get(t);return o||(o={listeners:[]},this._eventSlots.set(t,o)),o}},af=class{_methods=new Set;claim(t,o){if(this._methods.has(t))throw Error(`Handler for "${t}" already registered (via ${o}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(t)}replace(t){this._methods.add(t)}release(t){this._methods.delete(t)}has(t){return this._methods.has(t)}},i_=new Set;function a_(e,t){let[o,r]=t,n=o?.shape;if(typeof n?.method?.value!="string")return;let s=n.method.value,i=e==="request"?"setRequestHandler":"setNotificationHandler";i_.has(i)||(i_.add(i),console.warn(`[ext-apps] ${i}(Schema, handler) is deprecated; use ${i}("${s}", { params: Schema.shape.params }, handler).`));let c=r;return[s,{params:n.params},e==="request"?(l,d)=>c({method:s,params:l},av(d)):l=>c({method:s,params:l})]}function av(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var cv="2026-01-26";var lv="ui/notifications/tool-input-partial";var cf=class{eventTarget;eventSource;messageListener;constructor(t=window.parent,o){this.eventTarget=t,this.eventSource=o,this.messageListener=r=>{if(o&&r.source!==this.eventSource){console.debug("Ignoring message from unknown source",r);return}let n=ao.safeParse(r.data);n.success?(console.debug("Parsed message",n.data),this.onmessage?.(n.data)):r.data?.jsonrpc!=="2.0"?console.debug("Ignoring non-JSON-RPC message",n.error.message,r):(console.error("Failed to parse message",n.error.message,r),this.onerror?.(Error("Invalid JSON-RPC message received: "+n.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(t,o){t.method!==lv&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},uv=u.union([u.literal("light"),u.literal("dark")]).describe("Color theme preference for the host environment."),aa=u.union([u.literal("inline"),u.literal("fullscreen"),u.literal("pip")]).describe("Display mode for UI presentation."),dv=u.union([u.literal("--color-background-primary"),u.literal("--color-background-secondary"),u.literal("--color-background-tertiary"),u.literal("--color-background-inverse"),u.literal("--color-background-ghost"),u.literal("--color-background-info"),u.literal("--color-background-danger"),u.literal("--color-background-success"),u.literal("--color-background-warning"),u.literal("--color-background-disabled"),u.literal("--color-text-primary"),u.literal("--color-text-secondary"),u.literal("--color-text-tertiary"),u.literal("--color-text-inverse"),u.literal("--color-text-ghost"),u.literal("--color-text-info"),u.literal("--color-text-danger"),u.literal("--color-text-success"),u.literal("--color-text-warning"),u.literal("--color-text-disabled"),u.literal("--color-border-primary"),u.literal("--color-border-secondary"),u.literal("--color-border-tertiary"),u.literal("--color-border-inverse"),u.literal("--color-border-ghost"),u.literal("--color-border-info"),u.literal("--color-border-danger"),u.literal("--color-border-success"),u.literal("--color-border-warning"),u.literal("--color-border-disabled"),u.literal("--color-ring-primary"),u.literal("--color-ring-secondary"),u.literal("--color-ring-inverse"),u.literal("--color-ring-info"),u.literal("--color-ring-danger"),u.literal("--color-ring-success"),u.literal("--color-ring-warning"),u.literal("--font-sans"),u.literal("--font-mono"),u.literal("--font-weight-normal"),u.literal("--font-weight-medium"),u.literal("--font-weight-semibold"),u.literal("--font-weight-bold"),u.literal("--font-text-xs-size"),u.literal("--font-text-sm-size"),u.literal("--font-text-md-size"),u.literal("--font-text-lg-size"),u.literal("--font-heading-xs-size"),u.literal("--font-heading-sm-size"),u.literal("--font-heading-md-size"),u.literal("--font-heading-lg-size"),u.literal("--font-heading-xl-size"),u.literal("--font-heading-2xl-size"),u.literal("--font-heading-3xl-size"),u.literal("--font-text-xs-line-height"),u.literal("--font-text-sm-line-height"),u.literal("--font-text-md-line-height"),u.literal("--font-text-lg-line-height"),u.literal("--font-heading-xs-line-height"),u.literal("--font-heading-sm-line-height"),u.literal("--font-heading-md-line-height"),u.literal("--font-heading-lg-line-height"),u.literal("--font-heading-xl-line-height"),u.literal("--font-heading-2xl-line-height"),u.literal("--font-heading-3xl-line-height"),u.literal("--border-radius-xs"),u.literal("--border-radius-sm"),u.literal("--border-radius-md"),u.literal("--border-radius-lg"),u.literal("--border-radius-xl"),u.literal("--border-radius-full"),u.literal("--border-width-regular"),u.literal("--shadow-hairline"),u.literal("--shadow-sm"),u.literal("--shadow-md"),u.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),pv=u.record(dv.describe(`Style variables for theming MCP apps.
65
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let c=i[1];if(t===i[0]){s(i);continue}if(e.external){let d=e.external.registry.get(i[0])?.id;if(t!==i[0]&&d){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(c.cycle){s(i);continue}if(c.count>1&&e.reused==="ref"){s(i);continue}}}function Rt(e,t){let o=e.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=c=>{let l=e.seen.get(c);if(l.ref===null)return;let d=l.def??l.schema,m={...d},S=l.ref;if(l.ref=null,S){r(S);let b=e.seen.get(S),P=b.schema;if(P.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(P)):Object.assign(d,P),Object.assign(d,m),c._zod.parent===S)for(let C in d)C==="$ref"||C==="allOf"||C in m||delete d[C];if(P.$ref&&b.def)for(let C in d)C==="$ref"||C==="allOf"||C in b.def&&JSON.stringify(d[C])===JSON.stringify(b.def[C])&&delete d[C]}let _=c._zod.parent;if(_&&_!==S){r(_);let b=e.seen.get(_);if(b?.schema.$ref&&(d.$ref=b.schema.$ref,b.def))for(let P in d)P==="$ref"||P==="allOf"||P in b.def&&JSON.stringify(d[P])===JSON.stringify(b.def[P])&&delete d[P]}e.override({zodSchema:c,jsonSchema:d,path:l.path??[]})};for(let c of[...e.seen.entries()].reverse())r(c[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}Object.assign(n,o.def??o.schema);let s=e.metadataRegistry.get(t)?.id;s!==void 0&&n.id===s&&delete n.id;let i=e.external?.defs??{};for(let c of e.seen.entries()){let l=c[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,i[l.defId]=l.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:nr(t,"input",e.processors),output:nr(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function ge(e,t){let o=t??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return ge(r.element,o);if(r.type==="set")return ge(r.valueType,o);if(r.type==="lazy")return ge(r.getter(),o);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return ge(r.innerType,o);if(r.type==="intersection")return ge(r.left,o)||ge(r.right,o);if(r.type==="record"||r.type==="map")return ge(r.keyType,o)||ge(r.valueType,o);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ge(r.in,o)||ge(r.out,o);if(r.type==="object"){for(let n in r.shape)if(ge(r.shape[n],o))return!0;return!1}if(r.type==="union"){for(let n of r.options)if(ge(n,o))return!0;return!1}if(r.type==="tuple"){for(let n of r.items)if(ge(n,o))return!0;return!!(r.rest&&ge(r.rest,o))}return!1}var Kp=(e,t={})=>o=>{let r=zt({...o,processors:t});return Z(e,r),vt(r,e),Rt(r,e)},nr=(e,t,o={})=>r=>{let{libraryOptions:n,target:s}=r??{},i=zt({...n??{},target:s,io:t,processors:o});return Z(e,i),vt(i,e),Rt(i,e)};var ay={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Yp=(e,t,o,r)=>{let n=o;n.type="string";let{minimum:s,maximum:i,format:c,patterns:l,contentEncoding:d}=e._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),c&&(n.format=ay[c]??c,n.format===""&&delete n.format,c==="time"&&delete n.format),d&&(n.contentEncoding=d),l&&l.size>0){let m=[...l];m.length===1?n.pattern=m[0].source:m.length>1&&(n.allOf=[...m.map(S=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))])}},Qp=(e,t,o,r)=>{let n=o,{minimum:s,maximum:i,format:c,multipleOf:l,exclusiveMaximum:d,exclusiveMinimum:m}=e._zod.bag;typeof c=="string"&&c.includes("int")?n.type="integer":n.type="number";let S=typeof m=="number"&&m>=(s??Number.NEGATIVE_INFINITY),_=typeof d=="number"&&d<=(i??Number.POSITIVE_INFINITY),b=t.target==="draft-04"||t.target==="openapi-3.0";S?b?(n.minimum=m,n.exclusiveMinimum=!0):n.exclusiveMinimum=m:typeof s=="number"&&(n.minimum=s),_?b?(n.maximum=d,n.exclusiveMaximum=!0):n.exclusiveMaximum=d:typeof i=="number"&&(n.maximum=i),typeof l=="number"&&(n.multipleOf=l)},Xp=(e,t,o,r)=>{o.type="boolean"},eh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},th=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},oh=(e,t,o,r)=>{t.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},rh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},nh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},sh=(e,t,o,r)=>{o.not={}},ih=(e,t,o,r)=>{},ah=(e,t,o,r)=>{},ch=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},lh=(e,t,o,r)=>{let n=e._zod.def,s=jn(n.entries);s.every(i=>typeof i=="number")&&(o.type="number"),s.every(i=>typeof i=="string")&&(o.type="string"),o.enum=s},uh=(e,t,o,r)=>{let n=e._zod.def,s=[];for(let i of n.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];o.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?o.enum=[i]:o.const=i}else s.every(i=>typeof i=="number")&&(o.type="number"),s.every(i=>typeof i=="string")&&(o.type="string"),s.every(i=>typeof i=="boolean")&&(o.type="boolean"),s.every(i=>i===null)&&(o.type="null"),o.enum=s},dh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},ph=(e,t,o,r)=>{let n=o,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},hh=(e,t,o,r)=>{let n=o,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:c,mime:l}=e._zod.bag;i!==void 0&&(s.minLength=i),c!==void 0&&(s.maxLength=c),l?l.length===1?(s.contentMediaType=l[0],Object.assign(n,s)):(Object.assign(n,s),n.anyOf=l.map(d=>({contentMediaType:d}))):Object.assign(n,s)},mh=(e,t,o,r)=>{o.type="boolean"},fh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},gh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Sh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},_h=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},bh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},yh=(e,t,o,r)=>{let n=o,s=e._zod.def,{minimum:i,maximum:c}=e._zod.bag;typeof i=="number"&&(n.minItems=i),typeof c=="number"&&(n.maxItems=c),n.type="array",n.items=Z(s.element,t,{...r,path:[...r.path,"items"]})},zh=(e,t,o,r)=>{let n=o,s=e._zod.def;n.type="object",n.properties={};let i=s.shape;for(let d in i)n.properties[d]=Z(i[d],t,{...r,path:[...r.path,"properties",d]});let c=new Set(Object.keys(i)),l=new Set([...c].filter(d=>{let m=s.shape[d]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));l.size>0&&(n.required=Array.from(l)),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=Z(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Tc=(e,t,o,r)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((c,l)=>Z(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",l]}));s?o.oneOf=i:o.anyOf=i},vh=(e,t,o,r)=>{let n=e._zod.def,s=Z(n.left,t,{...r,path:[...r.path,"allOf",0]}),i=Z(n.right,t,{...r,path:[...r.path,"allOf",1]}),c=d=>"allOf"in d&&Object.keys(d).length===1,l=[...c(s)?s.allOf:[s],...c(i)?i.allOf:[i]];o.allOf=l},Rh=(e,t,o,r)=>{let n=o,s=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=s.items.map((_,b)=>Z(_,t,{...r,path:[...r.path,i,b]})),d=s.rest?Z(s.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=l,d&&(n.items=d)):t.target==="openapi-3.0"?(n.items={anyOf:l},d&&n.items.anyOf.push(d),n.minItems=l.length,d||(n.maxItems=l.length)):(n.items=l,d&&(n.additionalItems=d));let{minimum:m,maximum:S}=e._zod.bag;typeof m=="number"&&(n.minItems=m),typeof S=="number"&&(n.maxItems=S)},wh=(e,t,o,r)=>{let n=o,s=e._zod.def;n.type="object";let i=s.keyType,l=i._zod.bag?.patterns;if(s.mode==="loose"&&l&&l.size>0){let m=Z(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});n.patternProperties={};for(let S of l)n.patternProperties[S.source]=m}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=Z(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=Z(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let d=i._zod.values;if(d){let m=[...d].filter(S=>typeof S=="string"||typeof S=="number");m.length>0&&(n.required=m)}},xh=(e,t,o,r)=>{let n=e._zod.def,s=Z(n.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=n.innerType,o.nullable=!0):o.anyOf=[s,{type:"null"}]},Ph=(e,t,o,r)=>{let n=e._zod.def;Z(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Th=(e,t,o,r)=>{let n=e._zod.def;Z(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType,o.default=JSON.parse(JSON.stringify(n.defaultValue))},kh=(e,t,o,r)=>{let n=e._zod.def;Z(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType,t.io==="input"&&(o._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},$h=(e,t,o,r)=>{let n=e._zod.def;Z(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}o.default=i},Eh=(e,t,o,r)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?n.out:n.in:n.out;Z(i,t,r);let c=t.seen.get(e);c.ref=i},Ch=(e,t,o,r)=>{let n=e._zod.def;Z(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType,o.readOnly=!0},Ih=(e,t,o,r)=>{let n=e._zod.def;Z(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},kc=(e,t,o,r)=>{let n=e._zod.def;Z(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Oh=(e,t,o,r)=>{let n=e._zod.innerType;Z(n,t,r);let s=t.seen.get(e);s.ref=n},Pc={string:Yp,number:Qp,boolean:Xp,bigint:eh,symbol:th,null:oh,undefined:rh,void:nh,never:sh,any:ih,unknown:ah,date:ch,enum:lh,literal:uh,nan:dh,template_literal:ph,file:hh,success:mh,custom:fh,function:gh,transform:Sh,map:_h,set:bh,array:yh,object:zh,union:Tc,intersection:vh,tuple:Rh,record:wh,nullable:xh,nonoptional:Ph,default:Th,prefault:kh,catch:$h,pipe:Eh,readonly:Ch,promise:Ih,optional:kc,lazy:Oh};function to(e,t){if("_idmap"in e){let r=e,n=zt({...t,processors:Pc}),s={};for(let l of r._idmap.entries()){let[d,m]=l;Z(m,n)}let i={},c={registry:r,uri:t?.uri,defs:s};n.external=c;for(let l of r._idmap.entries()){let[d,m]=l;vt(n,m),i[d]=Rt(n,m)}if(Object.keys(s).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[l]:s}}return{schemas:i}}let o=zt({...t,processors:Pc});return Z(e,o),vt(o,e),Rt(o,e)}var $c=class{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 o=t?.target??"draft-2020-12";o==="draft-4"&&(o="draft-04"),o==="draft-7"&&(o="draft-07"),this.ctx=zt({processors:Pc,target:o,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,o={path:[],schemaPath:[]}){return Z(t,this.ctx,o)}emit(t,o){o&&(o.cycles&&(this.ctx.cycles=o.cycles),o.reused&&(this.ctx.reused=o.reused),o.external&&(this.ctx.external=o.external)),vt(this.ctx,t);let r=Rt(this.ctx,t),{"~standard":n,...s}=r;return s}};var Gf={};var ts={};Ke(ts,{ZodAny:()=>Xh,ZodArray:()=>rm,ZodBase64:()=>Yc,ZodBase64URL:()=>Qc,ZodBigInt:()=>pr,ZodBigIntFormat:()=>tl,ZodBoolean:()=>dr,ZodCIDRv4:()=>Gc,ZodCIDRv6:()=>Kc,ZodCUID:()=>Dc,ZodCUID2:()=>Vc,ZodCatch:()=>Rm,ZodCodec:()=>ds,ZodCustom:()=>ps,ZodCustomStringFormat:()=>lr,ZodDate:()=>as,ZodDefault:()=>Sm,ZodDiscriminatedUnion:()=>sm,ZodE164:()=>Xc,ZodEmail:()=>jc,ZodEmoji:()=>Uc,ZodEnum:()=>ir,ZodExactOptional:()=>mm,ZodFile:()=>pm,ZodFunction:()=>Im,ZodGUID:()=>rs,ZodIPv4:()=>Bc,ZodIPv6:()=>Wc,ZodIntersection:()=>im,ZodJWT:()=>el,ZodKSUID:()=>Jc,ZodLazy:()=>Em,ZodLiteral:()=>dm,ZodMAC:()=>Gh,ZodMap:()=>lm,ZodNaN:()=>xm,ZodNanoID:()=>Zc,ZodNever:()=>tm,ZodNonOptional:()=>il,ZodNull:()=>Qh,ZodNullable:()=>gm,ZodNumber:()=>ur,ZodNumberFormat:()=>oo,ZodObject:()=>cs,ZodOptional:()=>sl,ZodPipe:()=>us,ZodPrefault:()=>bm,ZodPreprocess:()=>Pm,ZodPromise:()=>Cm,ZodReadonly:()=>Tm,ZodRecord:()=>sr,ZodSet:()=>um,ZodString:()=>ar,ZodStringFormat:()=>V,ZodSuccess:()=>vm,ZodSymbol:()=>Kh,ZodTemplateLiteral:()=>$m,ZodTransform:()=>hm,ZodTuple:()=>am,ZodType:()=>M,ZodULID:()=>Hc,ZodURL:()=>is,ZodUUID:()=>Ue,ZodUndefined:()=>Yh,ZodUnion:()=>ls,ZodUnknown:()=>em,ZodVoid:()=>om,ZodXID:()=>Fc,ZodXor:()=>nm,_ZodString:()=>Ac,_default:()=>_m,_function:()=>Yg,any:()=>ol,array:()=>f,base64:()=>gg,base64url:()=>Sg,bigint:()=>kg,boolean:()=>R,catch:()=>wm,check:()=>Qg,cidrv4:()=>mg,cidrv6:()=>fg,codec:()=>Bg,cuid:()=>ig,cuid2:()=>ag,custom:()=>Xg,date:()=>Ng,describe:()=>eS,discriminatedUnion:()=>wt,e164:()=>_g,email:()=>Lc,emoji:()=>ng,enum:()=>I,exactOptional:()=>fm,file:()=>Vg,float32:()=>wg,float64:()=>xg,function:()=>Yg,guid:()=>Qf,hash:()=>Rg,hex:()=>vg,hostname:()=>zg,httpUrl:()=>rg,instanceof:()=>oS,int:()=>Mc,int32:()=>Pg,int64:()=>$g,intersection:()=>Oe,invertCodec:()=>Wg,ipv4:()=>dg,ipv6:()=>hg,json:()=>nS,jwt:()=>bg,keyof:()=>Mg,ksuid:()=>ug,lazy:()=>xt,literal:()=>g,looseObject:()=>E,looseRecord:()=>Lg,mac:()=>pg,map:()=>Ug,meta:()=>tS,nan:()=>Jg,nanoid:()=>sg,nativeEnum:()=>Dg,never:()=>rl,nonoptional:()=>zm,null:()=>Ze,nullable:()=>ns,nullish:()=>Hg,number:()=>y,object:()=>p,optional:()=>k,partialRecord:()=>jg,pipe:()=>qc,prefault:()=>ym,preprocess:()=>et,promise:()=>Kg,readonly:()=>km,record:()=>v,refine:()=>Om,set:()=>Zg,strictObject:()=>qg,string:()=>a,stringFormat:()=>yg,stringbool:()=>rS,success:()=>Fg,superRefine:()=>Nm,symbol:()=>Cg,templateLiteral:()=>Gg,transform:()=>nl,tuple:()=>cm,uint32:()=>Tg,uint64:()=>Eg,ulid:()=>cg,undefined:()=>Ig,union:()=>x,unknown:()=>T,url:()=>cr,uuid:()=>Xf,uuidv4:()=>eg,uuidv6:()=>tg,uuidv7:()=>og,void:()=>Og,xid:()=>lg,xor:()=>Ag});var Ec={};Ke(Ec,{endsWith:()=>Ko,gt:()=>je,gte:()=>fe,includes:()=>Wo,length:()=>eo,lowercase:()=>Jo,lt:()=>Ae,lte:()=>we,maxLength:()=>Xt,maxSize:()=>yt,mime:()=>Yo,minLength:()=>Qe,minSize:()=>Le,multipleOf:()=>bt,negative:()=>vc,nonnegative:()=>wc,nonpositive:()=>Rc,normalize:()=>Qo,overwrite:()=>Ie,positive:()=>zc,property:()=>xc,regex:()=>Fo,size:()=>Qt,slugify:()=>or,startsWith:()=>Go,toLowerCase:()=>er,toUpperCase:()=>tr,trim:()=>Xo,uppercase:()=>Bo});var xe={};Ke(xe,{ZodISODate:()=>Ic,ZodISODateTime:()=>Cc,ZodISODuration:()=>Nc,ZodISOTime:()=>Oc,date:()=>Mh,datetime:()=>Nh,duration:()=>Ah,time:()=>qh});var Cc=h("ZodISODateTime",(e,t)=>{dd.init(e,t),V.init(e,t)});function Nh(e){return fp(Cc,e)}var Ic=h("ZodISODate",(e,t)=>{pd.init(e,t),V.init(e,t)});function Mh(e){return gp(Ic,e)}var Oc=h("ZodISOTime",(e,t)=>{hd.init(e,t),V.init(e,t)});function qh(e){return Sp(Oc,e)}var Nc=h("ZodISODuration",(e,t)=>{md.init(e,t),V.init(e,t)});function Ah(e){return _p(Nc,e)}var Kf=(e,t)=>{Vn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>Fn(e,o)},flatten:{value:o=>Hn(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,Ao,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,Ao,2)}},isEmpty:{get(){return e.issues.length===0}}})},ly=h("ZodError",Kf),ye=h("ZodError",Kf,{Parent:Error});var jh=Uo(ye),Lh=Zo(ye),os=Do(ye),Uh=Vo(ye),Zh=Ca(ye),Dh=Ia(ye),Vh=Oa(ye),Hh=Na(ye),Fh=Ma(ye),Jh=qa(ye),Bh=Aa(ye),Wh=ja(ye);var Yf=new WeakMap;function ss(e,t,o){let r=Object.getPrototypeOf(e),n=Yf.get(r);if(n||(n=new Set,Yf.set(r,n)),!n.has(t)){n.add(t);for(let s in o){let i=o[s];Object.defineProperty(r,s,{configurable:!0,enumerable:!1,get(){let c=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}}var M=h("ZodType",(e,t)=>(N.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:nr(e,"input"),output:nr(e,"output")}}),e.toJSONSchema=Kp(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(o,r)=>jh(e,o,r,{callee:e.parse}),e.safeParse=(o,r)=>os(e,o,r),e.parseAsync=async(o,r)=>Lh(e,o,r,{callee:e.parseAsync}),e.safeParseAsync=async(o,r)=>Uh(e,o,r),e.spa=e.safeParseAsync,e.encode=(o,r)=>Zh(e,o,r),e.decode=(o,r)=>Dh(e,o,r),e.encodeAsync=async(o,r)=>Vh(e,o,r),e.decodeAsync=async(o,r)=>Hh(e,o,r),e.safeEncode=(o,r)=>Fh(e,o,r),e.safeDecode=(o,r)=>Jh(e,o,r),e.safeEncodeAsync=async(o,r)=>Bh(e,o,r),e.safeDecodeAsync=async(o,r)=>Wh(e,o,r),ss(e,"ZodType",{check(...o){let r=this.def;return this.clone(O.mergeDefs(r,{checks:[...r.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...o){return this.check(...o)},clone(o,r){return he(this,o,r)},brand(){return this},register(o,r){return o.add(this,r),this},refine(o,r){return this.check(Om(o,r))},superRefine(o,r){return this.check(Nm(o,r))},overwrite(o){return this.check(Ie(o))},optional(){return k(this)},exactOptional(){return fm(this)},nullable(){return ns(this)},nullish(){return k(ns(this))},nonoptional(o){return zm(this,o)},array(){return f(this)},or(o){return x([this,o])},and(o){return Oe(this,o)},transform(o){return qc(this,nl(o))},default(o){return _m(this,o)},prefault(o){return ym(this,o)},catch(o){return wm(this,o)},pipe(o){return qc(this,o)},readonly(){return km(this)},describe(o){let r=this.clone();return re.add(r,{description:o}),r},meta(...o){if(o.length===0)return re.get(this);let r=this.clone();return re.add(r,o[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(o){return o(this)}}),Object.defineProperty(e,"description",{get(){return re.get(e)?.description},configurable:!0}),e)),Ac=h("_ZodString",(e,t)=>{Yt.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Yp(e,r,n,s);let o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,ss(e,"_ZodString",{regex(...r){return this.check(Fo(...r))},includes(...r){return this.check(Wo(...r))},startsWith(...r){return this.check(Go(...r))},endsWith(...r){return this.check(Ko(...r))},min(...r){return this.check(Qe(...r))},max(...r){return this.check(Xt(...r))},length(...r){return this.check(eo(...r))},nonempty(...r){return this.check(Qe(1,...r))},lowercase(r){return this.check(Jo(r))},uppercase(r){return this.check(Bo(r))},trim(){return this.check(Xo())},normalize(...r){return this.check(Qo(...r))},toLowerCase(){return this.check(er())},toUpperCase(){return this.check(tr())},slugify(){return this.check(or())}})}),ar=h("ZodString",(e,t)=>{Yt.init(e,t),Ac.init(e,t),e.email=o=>e.check(tc(jc,o)),e.url=o=>e.check(es(is,o)),e.jwt=o=>e.check(yc(el,o)),e.emoji=o=>e.check(ic(Uc,o)),e.guid=o=>e.check(Xn(rs,o)),e.uuid=o=>e.check(oc(Ue,o)),e.uuidv4=o=>e.check(rc(Ue,o)),e.uuidv6=o=>e.check(nc(Ue,o)),e.uuidv7=o=>e.check(sc(Ue,o)),e.nanoid=o=>e.check(ac(Zc,o)),e.guid=o=>e.check(Xn(rs,o)),e.cuid=o=>e.check(cc(Dc,o)),e.cuid2=o=>e.check(lc(Vc,o)),e.ulid=o=>e.check(uc(Hc,o)),e.base64=o=>e.check(Sc(Yc,o)),e.base64url=o=>e.check(_c(Qc,o)),e.xid=o=>e.check(dc(Fc,o)),e.ksuid=o=>e.check(pc(Jc,o)),e.ipv4=o=>e.check(hc(Bc,o)),e.ipv6=o=>e.check(mc(Wc,o)),e.cidrv4=o=>e.check(fc(Gc,o)),e.cidrv6=o=>e.check(gc(Kc,o)),e.e164=o=>e.check(bc(Xc,o)),e.datetime=o=>e.check(Nh(o)),e.date=o=>e.check(Mh(o)),e.time=o=>e.check(qh(o)),e.duration=o=>e.check(Ah(o))});function a(e){return dp(ar,e)}var V=h("ZodStringFormat",(e,t)=>{D.init(e,t),Ac.init(e,t)}),jc=h("ZodEmail",(e,t)=>{od.init(e,t),V.init(e,t)});function Lc(e){return tc(jc,e)}var rs=h("ZodGUID",(e,t)=>{ed.init(e,t),V.init(e,t)});function Qf(e){return Xn(rs,e)}var Ue=h("ZodUUID",(e,t)=>{td.init(e,t),V.init(e,t)});function Xf(e){return oc(Ue,e)}function eg(e){return rc(Ue,e)}function tg(e){return nc(Ue,e)}function og(e){return sc(Ue,e)}var is=h("ZodURL",(e,t)=>{rd.init(e,t),V.init(e,t)});function cr(e){return es(is,e)}function rg(e){return es(is,{protocol:Re.httpProtocol,hostname:Re.domain,...O.normalizeParams(e)})}var Uc=h("ZodEmoji",(e,t)=>{nd.init(e,t),V.init(e,t)});function ng(e){return ic(Uc,e)}var Zc=h("ZodNanoID",(e,t)=>{sd.init(e,t),V.init(e,t)});function sg(e){return ac(Zc,e)}var Dc=h("ZodCUID",(e,t)=>{id.init(e,t),V.init(e,t)});function ig(e){return cc(Dc,e)}var Vc=h("ZodCUID2",(e,t)=>{ad.init(e,t),V.init(e,t)});function ag(e){return lc(Vc,e)}var Hc=h("ZodULID",(e,t)=>{cd.init(e,t),V.init(e,t)});function cg(e){return uc(Hc,e)}var Fc=h("ZodXID",(e,t)=>{ld.init(e,t),V.init(e,t)});function lg(e){return dc(Fc,e)}var Jc=h("ZodKSUID",(e,t)=>{ud.init(e,t),V.init(e,t)});function ug(e){return pc(Jc,e)}var Bc=h("ZodIPv4",(e,t)=>{fd.init(e,t),V.init(e,t)});function dg(e){return hc(Bc,e)}var Gh=h("ZodMAC",(e,t)=>{Sd.init(e,t),V.init(e,t)});function pg(e){return hp(Gh,e)}var Wc=h("ZodIPv6",(e,t)=>{gd.init(e,t),V.init(e,t)});function hg(e){return mc(Wc,e)}var Gc=h("ZodCIDRv4",(e,t)=>{_d.init(e,t),V.init(e,t)});function mg(e){return fc(Gc,e)}var Kc=h("ZodCIDRv6",(e,t)=>{bd.init(e,t),V.init(e,t)});function fg(e){return gc(Kc,e)}var Yc=h("ZodBase64",(e,t)=>{zd.init(e,t),V.init(e,t)});function gg(e){return Sc(Yc,e)}var Qc=h("ZodBase64URL",(e,t)=>{vd.init(e,t),V.init(e,t)});function Sg(e){return _c(Qc,e)}var Xc=h("ZodE164",(e,t)=>{Rd.init(e,t),V.init(e,t)});function _g(e){return bc(Xc,e)}var el=h("ZodJWT",(e,t)=>{wd.init(e,t),V.init(e,t)});function bg(e){return yc(el,e)}var lr=h("ZodCustomStringFormat",(e,t)=>{xd.init(e,t),V.init(e,t)});function yg(e,t,o={}){return rr(lr,e,t,o)}function zg(e){return rr(lr,"hostname",Re.hostname,e)}function vg(e){return rr(lr,"hex",Re.hex,e)}function Rg(e,t){let o=t?.enc??"hex",r=`${e}_${o}`,n=Re[r];if(!n)throw new Error(`Unrecognized hash format: ${r}`);return rr(lr,r,n,t)}var ur=h("ZodNumber",(e,t)=>{Ba.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Qp(e,r,n,s),ss(e,"ZodNumber",{gt(r,n){return this.check(je(r,n))},gte(r,n){return this.check(fe(r,n))},min(r,n){return this.check(fe(r,n))},lt(r,n){return this.check(Ae(r,n))},lte(r,n){return this.check(we(r,n))},max(r,n){return this.check(we(r,n))},int(r){return this.check(Mc(r))},safe(r){return this.check(Mc(r))},positive(r){return this.check(je(0,r))},nonnegative(r){return this.check(fe(0,r))},negative(r){return this.check(Ae(0,r))},nonpositive(r){return this.check(we(0,r))},multipleOf(r,n){return this.check(bt(r,n))},step(r,n){return this.check(bt(r,n))},finite(){return this}});let o=e._zod.bag;e.minValue=Math.max(o.minimum??Number.NEGATIVE_INFINITY,o.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(o.maximum??Number.POSITIVE_INFINITY,o.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(o.format??"").includes("int")||Number.isSafeInteger(o.multipleOf??.5),e.isFinite=!0,e.format=o.format??null});function y(e){return bp(ur,e)}var oo=h("ZodNumberFormat",(e,t)=>{Pd.init(e,t),ur.init(e,t)});function Mc(e){return zp(oo,e)}function wg(e){return vp(oo,e)}function xg(e){return Rp(oo,e)}function Pg(e){return wp(oo,e)}function Tg(e){return xp(oo,e)}var dr=h("ZodBoolean",(e,t)=>{Gn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Xp(e,o,r,n)});function R(e){return Pp(dr,e)}var pr=h("ZodBigInt",(e,t)=>{Wa.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>eh(e,r,n,s),e.gte=(r,n)=>e.check(fe(r,n)),e.min=(r,n)=>e.check(fe(r,n)),e.gt=(r,n)=>e.check(je(r,n)),e.gte=(r,n)=>e.check(fe(r,n)),e.min=(r,n)=>e.check(fe(r,n)),e.lt=(r,n)=>e.check(Ae(r,n)),e.lte=(r,n)=>e.check(we(r,n)),e.max=(r,n)=>e.check(we(r,n)),e.positive=r=>e.check(je(BigInt(0),r)),e.negative=r=>e.check(Ae(BigInt(0),r)),e.nonpositive=r=>e.check(we(BigInt(0),r)),e.nonnegative=r=>e.check(fe(BigInt(0),r)),e.multipleOf=(r,n)=>e.check(bt(r,n));let o=e._zod.bag;e.minValue=o.minimum??null,e.maxValue=o.maximum??null,e.format=o.format??null});function kg(e){return kp(pr,e)}var tl=h("ZodBigIntFormat",(e,t)=>{Td.init(e,t),pr.init(e,t)});function $g(e){return Ep(tl,e)}function Eg(e){return Cp(tl,e)}var Kh=h("ZodSymbol",(e,t)=>{kd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>th(e,o,r,n)});function Cg(e){return Ip(Kh,e)}var Yh=h("ZodUndefined",(e,t)=>{$d.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>rh(e,o,r,n)});function Ig(e){return Op(Yh,e)}var Qh=h("ZodNull",(e,t)=>{Ed.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>oh(e,o,r,n)});function Ze(e){return Np(Qh,e)}var Xh=h("ZodAny",(e,t)=>{Cd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ih(e,o,r,n)});function ol(){return Mp(Xh)}var em=h("ZodUnknown",(e,t)=>{Id.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ah(e,o,r,n)});function T(){return qp(em)}var tm=h("ZodNever",(e,t)=>{Od.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>sh(e,o,r,n)});function rl(e){return Ap(tm,e)}var om=h("ZodVoid",(e,t)=>{Nd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>nh(e,o,r,n)});function Og(e){return jp(om,e)}var as=h("ZodDate",(e,t)=>{Md.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ch(e,r,n,s),e.min=(r,n)=>e.check(fe(r,n)),e.max=(r,n)=>e.check(we(r,n));let o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});function Ng(e){return Lp(as,e)}var rm=h("ZodArray",(e,t)=>{qd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>yh(e,o,r,n),e.element=t.element,ss(e,"ZodArray",{min(o,r){return this.check(Qe(o,r))},nonempty(o){return this.check(Qe(1,o))},max(o,r){return this.check(Xt(o,r))},length(o,r){return this.check(eo(o,r))},unwrap(){return this.element}})});function f(e,t){return Dp(rm,e,t)}function Mg(e){let t=e._zod.def.shape;return I(Object.keys(t))}var cs=h("ZodObject",(e,t)=>{Ad.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>zh(e,o,r,n),O.defineLazy(e,"shape",()=>t.shape),ss(e,"ZodObject",{keyof(){return I(Object.keys(this._zod.def.shape))},catchall(o){return this.clone({...this._zod.def,catchall:o})},passthrough(){return this.clone({...this._zod.def,catchall:T()})},loose(){return this.clone({...this._zod.def,catchall:T()})},strict(){return this.clone({...this._zod.def,catchall:rl()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(o){return O.extend(this,o)},safeExtend(o){return O.safeExtend(this,o)},merge(o){return O.merge(this,o)},pick(o){return O.pick(this,o)},omit(o){return O.omit(this,o)},partial(...o){return O.partial(sl,this,o[0])},required(...o){return O.required(il,this,o[0])}})});function p(e,t){let o={type:"object",shape:e??{},...O.normalizeParams(t)};return new cs(o)}function qg(e,t){return new cs({type:"object",shape:e,catchall:rl(),...O.normalizeParams(t)})}function E(e,t){return new cs({type:"object",shape:e,catchall:T(),...O.normalizeParams(t)})}var ls=h("ZodUnion",(e,t)=>{Kn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Tc(e,o,r,n),e.options=t.options});function x(e,t){return new ls({type:"union",options:e,...O.normalizeParams(t)})}var nm=h("ZodXor",(e,t)=>{ls.init(e,t),jd.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Tc(e,o,r,n),e.options=t.options});function Ag(e,t){return new nm({type:"union",options:e,inclusive:!1,...O.normalizeParams(t)})}var sm=h("ZodDiscriminatedUnion",(e,t)=>{ls.init(e,t),Ld.init(e,t)});function wt(e,t,o){return new sm({type:"union",options:t,discriminator:e,...O.normalizeParams(o)})}var im=h("ZodIntersection",(e,t)=>{Ud.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>vh(e,o,r,n)});function Oe(e,t){return new im({type:"intersection",left:e,right:t})}var am=h("ZodTuple",(e,t)=>{Ga.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Rh(e,o,r,n),e.rest=o=>e.clone({...e._zod.def,rest:o})});function cm(e,t,o){let r=t instanceof N,n=r?o:t,s=r?t:null;return new am({type:"tuple",items:e,rest:s,...O.normalizeParams(n)})}var sr=h("ZodRecord",(e,t)=>{Zd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>wh(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function v(e,t,o){return!t||!t._zod?new sr({type:"record",keyType:a(),valueType:e,...O.normalizeParams(t)}):new sr({type:"record",keyType:e,valueType:t,...O.normalizeParams(o)})}function jg(e,t,o){let r=he(e);return r._zod.values=void 0,new sr({type:"record",keyType:r,valueType:t,...O.normalizeParams(o)})}function Lg(e,t,o){return new sr({type:"record",keyType:e,valueType:t,mode:"loose",...O.normalizeParams(o)})}var lm=h("ZodMap",(e,t)=>{Dd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>_h(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...o)=>e.check(Le(...o)),e.nonempty=o=>e.check(Le(1,o)),e.max=(...o)=>e.check(yt(...o)),e.size=(...o)=>e.check(Qt(...o))});function Ug(e,t,o){return new lm({type:"map",keyType:e,valueType:t,...O.normalizeParams(o)})}var um=h("ZodSet",(e,t)=>{Vd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>bh(e,o,r,n),e.min=(...o)=>e.check(Le(...o)),e.nonempty=o=>e.check(Le(1,o)),e.max=(...o)=>e.check(yt(...o)),e.size=(...o)=>e.check(Qt(...o))});function Zg(e,t){return new um({type:"set",valueType:e,...O.normalizeParams(t)})}var ir=h("ZodEnum",(e,t)=>{Hd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>lh(e,r,n,s),e.enum=t.entries,e.options=Object.values(t.entries);let o=new Set(Object.keys(t.entries));e.extract=(r,n)=>{let s={};for(let i of r)if(o.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new ir({...t,checks:[],...O.normalizeParams(n),entries:s})},e.exclude=(r,n)=>{let s={...t.entries};for(let i of r)if(o.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new ir({...t,checks:[],...O.normalizeParams(n),entries:s})}});function I(e,t){let o=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ir({type:"enum",entries:o,...O.normalizeParams(t)})}function Dg(e,t){return new ir({type:"enum",entries:e,...O.normalizeParams(t)})}var dm=h("ZodLiteral",(e,t)=>{Fd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>uh(e,o,r,n),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 g(e,t){return new dm({type:"literal",values:Array.isArray(e)?e:[e],...O.normalizeParams(t)})}var pm=h("ZodFile",(e,t)=>{Jd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>hh(e,o,r,n),e.min=(o,r)=>e.check(Le(o,r)),e.max=(o,r)=>e.check(yt(o,r)),e.mime=(o,r)=>e.check(Yo(Array.isArray(o)?o:[o],r))});function Vg(e){return Vp(pm,e)}var hm=h("ZodTransform",(e,t)=>{Bd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Sh(e,o,r,n),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new mt(e.constructor.name);o.addIssue=s=>{if(typeof s=="string")o.issues.push(O.issue(s,o.value,t));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=e),o.issues.push(O.issue(i))}};let n=t.transform(o.value,o);return n instanceof Promise?n.then(s=>(o.value=s,o.fallback=!0,o)):(o.value=n,o.fallback=!0,o)}});function nl(e){return new hm({type:"transform",transform:e})}var sl=h("ZodOptional",(e,t)=>{Ka.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>kc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function k(e){return new sl({type:"optional",innerType:e})}var mm=h("ZodExactOptional",(e,t)=>{Wd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>kc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function fm(e){return new mm({type:"optional",innerType:e})}var gm=h("ZodNullable",(e,t)=>{Gd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>xh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function ns(e){return new gm({type:"nullable",innerType:e})}function Hg(e){return k(ns(e))}var Sm=h("ZodDefault",(e,t)=>{Kd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Th(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function _m(e,t){return new Sm({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():O.shallowClone(t)}})}var bm=h("ZodPrefault",(e,t)=>{Yd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>kh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function ym(e,t){return new bm({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():O.shallowClone(t)}})}var il=h("ZodNonOptional",(e,t)=>{Qd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ph(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function zm(e,t){return new il({type:"nonoptional",innerType:e,...O.normalizeParams(t)})}var vm=h("ZodSuccess",(e,t)=>{Xd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>mh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Fg(e){return new vm({type:"success",innerType:e})}var Rm=h("ZodCatch",(e,t)=>{ep.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>$h(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function wm(e,t){return new Rm({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var xm=h("ZodNaN",(e,t)=>{tp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>dh(e,o,r,n)});function Jg(e){return Zp(xm,e)}var us=h("ZodPipe",(e,t)=>{Ya.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Eh(e,o,r,n),e.in=t.in,e.out=t.out});function qc(e,t){return new us({type:"pipe",in:e,out:t})}var ds=h("ZodCodec",(e,t)=>{us.init(e,t),Yn.init(e,t)});function Bg(e,t,o){return new ds({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}function Wg(e){let t=e._zod.def;return new ds({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Pm=h("ZodPreprocess",(e,t)=>{us.init(e,t),op.init(e,t)}),Tm=h("ZodReadonly",(e,t)=>{rp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ch(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function km(e){return new Tm({type:"readonly",innerType:e})}var $m=h("ZodTemplateLiteral",(e,t)=>{np.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ph(e,o,r,n)});function Gg(e,t){return new $m({type:"template_literal",parts:e,...O.normalizeParams(t)})}var Em=h("ZodLazy",(e,t)=>{ap.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Oh(e,o,r,n),e.unwrap=()=>e._zod.def.getter()});function xt(e){return new Em({type:"lazy",getter:e})}var Cm=h("ZodPromise",(e,t)=>{ip.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ih(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Kg(e){return new Cm({type:"promise",innerType:e})}var Im=h("ZodFunction",(e,t)=>{sp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>gh(e,o,r,n)});function Yg(e){return new Im({type:"function",input:Array.isArray(e?.input)?cm(e?.input):e?.input??f(T()),output:e?.output??T()})}var ps=h("ZodCustom",(e,t)=>{cp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>fh(e,o,r,n)});function Qg(e){let t=new H({check:"custom"});return t._zod.check=e,t}function Xg(e,t){return Hp(ps,e??(()=>!0),t)}function Om(e,t={}){return Fp(ps,e,t)}function Nm(e,t){return Jp(e,t)}var eS=Bp,tS=Wp;function oS(e,t={}){let o=new ps({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...O.normalizeParams(t)});return o._zod.bag.Class=e,o._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:o,path:[...o._zod.def.path??[]]})},o}var rS=(...e)=>Gp({Codec:ds,Boolean:dr,String:ar},...e);function nS(e){let t=xt(()=>x([a(e),y(),R(),Ze(),f(t),v(a(),t)]));return t}function et(e,t){return new Pm({type:"pipe",in:nl(e),out:t})}var qm={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 dy(e){Y({customError:e})}function py(){return Y().customError}var Mm;Mm||(Mm={});var w={...ts,...Ec,iso:xe},hy=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 my(e,t){let o=e.$schema;return o==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":o==="http://json-schema.org/draft-07/schema#"?"draft-7":o==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function fy(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let o=e.slice(1).split("/").filter(Boolean);if(o.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(o[0]===r){let n=o[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function sS(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return w.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 n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return w.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let s=fy(n,t),i=le(s,t);return t.refs.set(n,i),t.processing.delete(n),i}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return w.null();if(n.length===0)return w.never();if(n.length===1)return w.literal(n[0]);if(n.every(i=>typeof i=="string"))return w.enum(n);let s=n.map(i=>w.literal(i));return s.length<2?s[0]:w.union([s[0],s[1],...s.slice(2)])}if(e.const!==void 0)return w.literal(e.const);let o=e.type;if(Array.isArray(o)){let n=o.map(s=>{let i={...e,type:s};return sS(i,t)});return n.length===0?w.never():n.length===1?n[0]:w.union(n)}if(!o)return w.any();let r;switch(o){case"string":{let n=w.string();if(e.format){let s=e.format;s==="email"?n=n.check(w.email()):s==="uri"||s==="uri-reference"?n=n.check(w.url()):s==="uuid"||s==="guid"?n=n.check(w.uuid()):s==="date-time"?n=n.check(w.iso.datetime()):s==="date"?n=n.check(w.iso.date()):s==="time"?n=n.check(w.iso.time()):s==="duration"?n=n.check(w.iso.duration()):s==="ipv4"?n=n.check(w.ipv4()):s==="ipv6"?n=n.check(w.ipv6()):s==="mac"?n=n.check(w.mac()):s==="cidr"?n=n.check(w.cidrv4()):s==="cidr-v6"?n=n.check(w.cidrv6()):s==="base64"?n=n.check(w.base64()):s==="base64url"?n=n.check(w.base64url()):s==="e164"?n=n.check(w.e164()):s==="jwt"?n=n.check(w.jwt()):s==="emoji"?n=n.check(w.emoji()):s==="nanoid"?n=n.check(w.nanoid()):s==="cuid"?n=n.check(w.cuid()):s==="cuid2"?n=n.check(w.cuid2()):s==="ulid"?n=n.check(w.ulid()):s==="xid"?n=n.check(w.xid()):s==="ksuid"&&(n=n.check(w.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),r=n;break}case"number":case"integer":{let n=o==="integer"?w.number().int():w.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),r=n;break}case"boolean":{r=w.boolean();break}case"null":{r=w.null();break}case"object":{let n={},s=e.properties||{},i=new Set(e.required||[]);for(let[l,d]of Object.entries(s)){let m=le(d,t);n[l]=i.has(l)?m:m.optional()}if(e.propertyNames){let l=le(e.propertyNames,t),d=e.additionalProperties&&typeof e.additionalProperties=="object"?le(e.additionalProperties,t):w.any();if(Object.keys(n).length===0){r=w.record(l,d);break}let m=w.object(n).passthrough(),S=w.looseRecord(l,d);r=w.intersection(m,S);break}if(e.patternProperties){let l=e.patternProperties,d=Object.keys(l),m=[];for(let _ of d){let b=le(l[_],t),P=w.string().regex(new RegExp(_));m.push(w.looseRecord(P,b))}let S=[];if(Object.keys(n).length>0&&S.push(w.object(n).passthrough()),S.push(...m),S.length===0)r=w.object({}).passthrough();else if(S.length===1)r=S[0];else{let _=w.intersection(S[0],S[1]);for(let b=2;b<S.length;b++)_=w.intersection(_,S[b]);r=_}break}let c=w.object(n);e.additionalProperties===!1?r=c.strict():typeof e.additionalProperties=="object"?r=c.catchall(le(e.additionalProperties,t)):r=c.passthrough();break}case"array":{let n=e.prefixItems,s=e.items;if(n&&Array.isArray(n)){let i=n.map(l=>le(l,t)),c=s&&typeof s=="object"&&!Array.isArray(s)?le(s,t):void 0;c?r=w.tuple(i).rest(c):r=w.tuple(i),typeof e.minItems=="number"&&(r=r.check(w.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(w.maxLength(e.maxItems)))}else if(Array.isArray(s)){let i=s.map(l=>le(l,t)),c=e.additionalItems&&typeof e.additionalItems=="object"?le(e.additionalItems,t):void 0;c?r=w.tuple(i).rest(c):r=w.tuple(i),typeof e.minItems=="number"&&(r=r.check(w.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(w.maxLength(e.maxItems)))}else if(s!==void 0){let i=le(s,t),c=w.array(i);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),r=c}else r=w.array(w.any());break}default:throw new Error(`Unsupported type: ${o}`)}return r}function le(e,t){if(typeof e=="boolean")return e?w.any():w.never();let o=sS(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(d=>le(d,t)),l=w.union(c);o=r?w.intersection(o,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(d=>le(d,t)),l=w.xor(c);o=r?w.intersection(o,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)o=r?o:w.any();else{let c=r?o:le(e.allOf[0],t),l=r?0:1;for(let d=l;d<e.allOf.length;d++)c=w.intersection(c,le(e.allOf[d],t));o=c}e.nullable===!0&&t.version==="openapi-3.0"&&(o=w.nullable(o)),e.readOnly===!0&&(o=w.readonly(o)),e.default!==void 0&&(o=o.default(e.default));let n={},s=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of s)c in e&&(n[c]=e[c]);let i=["contentEncoding","contentMediaType","contentSchema"];for(let c of i)c in e&&(n[c]=e[c]);for(let c of Object.keys(e))hy.has(c)||(n[c]=e[c]);return Object.keys(n).length>0&&t.registry.add(o,n),e.description&&(o=o.describe(e.description)),o}function iS(e,t){if(typeof e=="boolean")return e?w.any():w.never();let o;try{o=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=my(o,t?.defaultTarget),n=o.$defs||o.definitions||{},s={version:r,defs:n,refs:new Map,processing:new Set,rootSchema:o,registry:t?.registry??re};return le(o,s)}var hs={};Ke(hs,{bigint:()=>by,boolean:()=>_y,date:()=>yy,number:()=>Sy,string:()=>gy});function gy(e){return pp(ar,e)}function Sy(e){return yp(ur,e)}function _y(e){return Tp(dr,e)}function by(e){return $p(pr,e)}function yy(e){return Up(as,e)}Y(Qa());var al="2025-11-25";var cl=[al,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ll="io.modelcontextprotocol/related-task",ro="io.modelcontextprotocol/protocolVersion",hr="io.modelcontextprotocol/clientInfo",Tt="io.modelcontextprotocol/serverInfo",no="io.modelcontextprotocol/clientCapabilities",ul="io.modelcontextprotocol/subscriptionId",mr="io.modelcontextprotocol/logLevel";var so="2.0";var tt=xt(()=>x([a(),y(),R(),Ze(),v(a(),tt),f(tt)])),W=v(a(),tt),dl=f(tt),fr=x([a(),y().int()]),gr=a(),ms=p({ttl:y().optional()}),fs=p({taskId:a()}),Sr=E({progressToken:fr.optional(),[ll]:fs.optional()}),oe=p({_meta:Sr.optional()}),kt=oe.extend({task:ms.optional()}),G=p({method:a(),params:oe.loose().optional()}),ue=p({_meta:Sr.optional()}),ne=p({method:a(),params:ue.loose().optional()}),_r=E({get[Tt](){return Ve.optional().catch(void 0)}}),K=E({_meta:_r.optional()}),Ne=x([a(),y().int()]),br=p({jsonrpc:g(so),id:Ne,...G.shape}).strict(),yr=p({jsonrpc:g(so),...ne.shape}).strict(),io=p({jsonrpc:g(so),id:Ne,result:K}).strict(),ao=p({jsonrpc:g(so),id:Ne.optional(),error:p({code:y().int(),message:a(),data:T().optional()})}).strict(),co=x([br,yr,io,ao]),pl=x([io,ao]),$t=K.strict(),gs=ue.extend({requestId:Ne.optional(),reason:a().optional()}),zr=ne.extend({method:g("notifications/cancelled"),params:gs}),Ss=p({src:a(),mimeType:a().optional(),sizes:f(a()).optional(),theme:I(["light","dark"]).optional()}),ot=p({icons:f(Ss).optional()}),De=p({name:a(),title:a().optional()}),Ve=De.extend({...De.shape,...ot.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),vy=Oe(p({applyDefaults:R().optional()}),W),Ry=et(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Oe(p({form:vy.optional(),url:W.optional()}),W.optional())),hl=E({list:W.optional(),cancel:W.optional(),requests:E({sampling:E({createMessage:W.optional()}).optional(),elicitation:E({create:W.optional()}).optional()}).optional()}),ml=E({list:W.optional(),cancel:W.optional(),requests:E({tools:E({call:W.optional()}).optional()}).optional()}),_s=p({experimental:v(a(),W).optional(),sampling:p({context:W.optional(),tools:W.optional()}).optional(),elicitation:Ry.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:hl.optional(),extensions:v(a(),W).optional()}),bs=oe.extend({protocolVersion:a(),capabilities:_s,clientInfo:Ve}),ys=G.extend({method:g("initialize"),params:bs}),vr=p({experimental:v(a(),W).optional(),logging:W.optional(),completions:W.optional(),prompts:p({listChanged:R().optional()}).optional(),resources:p({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:p({listChanged:R().optional()}).optional(),tasks:ml.optional(),extensions:v(a(),W).optional()}),zs=K.extend({protocolVersion:a(),capabilities:vr,serverInfo:Ve,instructions:a().optional()}),vs=ne.extend({method:g("notifications/initialized"),params:ue.optional()}),Rs=G.extend({method:g("server/discover"),params:oe.optional()}),Rr=K.extend({supportedVersions:f(a()),capabilities:vr,instructions:a().optional()}),wr=G.extend({method:g("ping"),params:oe.optional()}),ws=p({progress:y(),total:k(y()),message:k(a())}),xs=p({...ue.shape,...ws.shape,progressToken:fr}),xr=ne.extend({method:g("notifications/progress"),params:xs}),Ps=oe.extend({cursor:gr.optional()}),rt=G.extend({params:Ps.optional()}),nt=K.extend({nextCursor:gr.optional()}),Pr=p({uri:a(),mimeType:k(a()),_meta:v(a(),T()).optional()}),Tr=Pr.extend({text:a()}),jm=a().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),kr=Pr.extend({blob:jm}),st=I(["user","assistant"]),He=p({audience:f(st).optional(),priority:y().min(0).max(1).optional(),lastModified:xe.datetime({offset:!0}).optional()}),$r=p({...De.shape,...ot.shape,uri:a(),description:k(a()),mimeType:k(a()),size:k(y()),annotations:He.optional(),_meta:k(E({}))}),Ts=p({...De.shape,...ot.shape,uriTemplate:a(),description:k(a()),mimeType:k(a()),annotations:He.optional(),_meta:k(E({}))}),ks=rt.extend({method:g("resources/list")}),$s=nt.extend({resources:f($r)}),Es=rt.extend({method:g("resources/templates/list")}),Cs=nt.extend({resourceTemplates:f(Ts)}),lo=oe.extend({uri:a()}),Is=lo,Os=G.extend({method:g("resources/read"),params:Is}),Ns=K.extend({contents:f(x([Tr,kr]))}),Ms=ne.extend({method:g("notifications/resources/list_changed"),params:ue.optional()}),qs=lo,As=G.extend({method:g("resources/subscribe"),params:qs}),js=lo,Ls=G.extend({method:g("resources/unsubscribe"),params:js}),Er=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:f(a()).optional()}),Us=oe.extend({notifications:Er}),Zs=G.extend({method:g("subscriptions/listen"),params:Us}),Ds=ue.extend({notifications:Er}),Vs=ne.extend({method:g("notifications/subscriptions/acknowledged"),params:Ds}),Hs=_r.extend({[ul]:Ne}),Fs=K.extend({_meta:Hs}),Js=ue.extend({uri:a()}),Bs=ne.extend({method:g("notifications/resources/updated"),params:Js}),Ws=p({name:a(),description:k(a()),required:k(R())}),Gs=p({...De.shape,...ot.shape,description:k(a()),arguments:k(f(Ws)),_meta:k(E({}))}),Ks=rt.extend({method:g("prompts/list")}),Ys=nt.extend({prompts:f(Gs)}),Qs=oe.extend({name:a(),arguments:v(a(),a()).optional()}),Xs=G.extend({method:g("prompts/get"),params:Qs}),uo=p({type:g("text"),text:a(),annotations:He.optional(),_meta:v(a(),T()).optional()}),po=p({type:g("image"),data:jm,mimeType:a(),annotations:He.optional(),_meta:v(a(),T()).optional()}),ho=p({type:g("audio"),data:jm,mimeType:a(),annotations:He.optional(),_meta:v(a(),T()).optional()}),ei=p({type:g("tool_use"),name:a(),id:a(),input:v(a(),T()),_meta:v(a(),T()).optional()}),mo=p({type:g("resource"),resource:x([Tr,kr]),annotations:He.optional(),_meta:v(a(),T()).optional()}),fo=$r.extend({type:g("resource_link")}),Fe=x([uo,po,ho,fo,mo]),ti=p({role:st,content:Fe}),oi=K.extend({description:a().optional(),messages:f(ti)}),ri=ne.extend({method:g("notifications/prompts/list_changed"),params:ue.optional()}),ni=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),si=p({taskSupport:I(["required","optional","forbidden"]).optional()}),Et=p({...De.shape,...ot.shape,description:a().optional(),inputSchema:p({type:g("object"),properties:v(a(),tt).optional(),required:f(a()).optional()}).catchall(T()),outputSchema:E({$schema:a().optional()}).optional(),annotations:ni.optional(),execution:si.optional(),_meta:v(a(),T()).optional()}),ii=rt.extend({method:g("tools/list")}),ai=nt.extend({tools:f(Et)}),Ct=K.extend({content:f(Fe).default([]),structuredContent:T().optional(),isError:R().optional()}),fl=Ct.or(K.extend({toolResult:T()})),ci=kt.extend({name:a(),arguments:v(a(),T()).optional()}),li=G.extend({method:g("tools/call"),params:ci}),ui=ne.extend({method:g("notifications/tools/list_changed"),params:ue.optional()}),gl=p({autoRefresh:R().default(!0),debounceMs:y().int().nonnegative().default(300)}),Cr=I(["debug","info","notice","warning","error","critical","alert","emergency"]),di=oe.extend({level:Cr}),pi=G.extend({method:g("logging/setLevel"),params:di}),hi=ue.extend({level:Cr,logger:a().optional(),data:T()}),mi=ne.extend({method:g("notifications/message"),params:hi}),fi=p({name:a().optional()}),gi=p({hints:f(fi).optional(),costPriority:y().min(0).max(1).optional(),speedPriority:y().min(0).max(1).optional(),intelligencePriority:y().min(0).max(1).optional()}),Si=p({mode:I(["auto","required","none"]).optional()}),_i=p({type:g("tool_result"),toolUseId:a().describe("The unique identifier for the corresponding tool call."),content:f(Fe),structuredContent:T().optional(),isError:R().optional(),_meta:v(a(),T()).optional()}),bi=wt("type",[uo,po,ho]),Pt=wt("type",[uo,po,ho,ei,_i]),yi=p({role:st,content:x([Pt,f(Pt)]),_meta:v(a(),T()).optional()}),zi=kt.extend({messages:f(yi),modelPreferences:gi.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:y().optional(),maxTokens:y().int(),stopSequences:f(a()).optional(),metadata:W.optional(),tools:f(Et).optional(),toolChoice:Si.optional()}),vi=G.extend({method:g("sampling/createMessage"),params:zi}),Ri=K.extend({model:a(),stopReason:k(I(["endTurn","stopSequence","maxTokens"]).or(a())),role:st,content:bi}),wi=K.extend({model:a(),stopReason:k(I(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:st,content:x([Pt,f(Pt)])}),Ir=p({type:g("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),go=p({type:g("string"),title:a().optional(),description:a().optional(),minLength:y().optional(),maxLength:y().optional(),format:I(["email","uri","date","date-time"]).optional(),default:a().optional()}),So=p({type:I(["number","integer"]),title:a().optional(),description:a().optional(),minimum:y().optional(),maximum:y().optional(),default:y().optional()}),Or=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),default:a().optional()}),Nr=p({type:g("string"),title:a().optional(),description:a().optional(),oneOf:f(p({const:a(),title:a()})),default:a().optional()}),Mr=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),enumNames:f(a()).optional(),default:a().optional()}),xi=x([Or,Nr]),qr=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:y().optional(),maxItems:y().optional(),items:p({type:g("string"),enum:f(a())}),default:f(a()).optional()}),Ar=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:y().optional(),maxItems:y().optional(),items:p({anyOf:f(p({const:a(),title:a()}))}),default:f(a()).optional()}),Pi=x([qr,Ar]),Ti=x([Mr,xi,Pi]),jr=x([Ti,Ir,go,So]),_o=kt.extend({mode:g("form").optional(),message:a(),requestedSchema:p({type:g("object"),properties:v(a(),jr),required:f(a()).optional()}).catchall(T())}),ki=kt.extend({mode:g("url"),message:a(),elicitationId:a(),url:a().url()}),$i=x([_o,ki]),Ei=G.extend({method:g("elicitation/create"),params:$i}),Ci=ue.extend({elicitationId:a()}),Ii=ne.extend({method:g("notifications/elicitation/complete"),params:Ci}),Oi=K.extend({action:I(["accept","decline","cancel"]),content:et(e=>e===null?void 0:e,v(a(),x([a(),y(),R(),f(a())])).optional())}),Ni=p({type:g("ref/resource"),uri:a()}),Mi=p({type:g("ref/prompt"),name:a()}),qi=oe.extend({ref:x([Mi,Ni]),argument:p({name:a(),value:a()}),context:p({arguments:v(a(),a()).optional()}).optional()}),Ai=G.extend({method:g("completion/complete"),params:qi}),ji=K.extend({completion:E({values:f(a()).max(100),total:k(y().int()),hasMore:k(R())})}),Li=p({uri:a().startsWith("file://"),name:a().optional(),_meta:v(a(),T()).optional()}),Ui=G.extend({method:g("roots/list"),params:oe.optional()}),Zi=K.extend({roots:f(Li)}),Di=ne.extend({method:g("notifications/roots/list_changed"),params:ue.optional()}),Sl=E({ttl:y().optional(),pollInterval:y().optional()}),Vi=I(["working","input_required","completed","failed","cancelled"]),it=p({taskId:a(),status:Vi,ttl:x([y(),Ze()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:k(y()),statusMessage:k(a())}),_l=K.extend({task:it}),Hi=ue.merge(it),bl=ne.extend({method:g("notifications/tasks/status"),params:Hi}),yl=G.extend({method:g("tasks/get"),params:oe.extend({taskId:a()})}),zl=K.merge(it),vl=G.extend({method:g("tasks/result"),params:oe.extend({taskId:a()})}),Rl=K.loose(),wl=rt.extend({method:g("tasks/list")}),xl=nt.extend({tasks:f(it)}),Pl=G.extend({method:g("tasks/cancel"),params:oe.extend({taskId:a()})}),Tl=K.merge(it),kl=x([wr,ys,Rs,Ai,pi,Xs,Ks,ks,Es,Os,As,Ls,Zs,li,ii]),$l=x([zr,xr,vs,Di]),El=x([$t,Ri,wi,Oi,Zi]),Cl=x([wr,vi,Ei,Ui]),Il=x([zr,xr,mi,Bs,Ms,ui,ri,Vs,Ii]),Ol=x([$t,zs,Rr,ji,oi,Ys,$s,Cs,Ns,Ct,ai,Fs]),te=cr().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:qm.custom,message:"URL must be parseable",fatal:!0}),qn}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Fi=E({resource:a().url(),authorization_servers:f(te).optional(),jwks_uri:a().url().optional(),scopes_supported:f(a()).optional(),bearer_methods_supported:f(a()).optional(),resource_signing_alg_values_supported:f(a()).optional(),resource_name:a().optional(),resource_documentation:a().optional(),resource_policy_uri:a().url().optional(),resource_tos_uri:a().url().optional(),tls_client_certificate_bound_access_tokens:R().optional(),authorization_details_types_supported:f(a()).optional(),dpop_signing_alg_values_supported:f(a()).optional(),dpop_bound_access_tokens_required:R().optional()}),Lr=E({issuer:a(),authorization_endpoint:te,token_endpoint:te,registration_endpoint:te.optional(),scopes_supported:f(a()).optional(),response_types_supported:f(a()),response_modes_supported:f(a()).optional(),grant_types_supported:f(a()).optional(),token_endpoint_auth_methods_supported:f(a()).optional(),token_endpoint_auth_signing_alg_values_supported:f(a()).optional(),service_documentation:te.optional(),revocation_endpoint:te.optional(),revocation_endpoint_auth_methods_supported:f(a()).optional(),revocation_endpoint_auth_signing_alg_values_supported:f(a()).optional(),introspection_endpoint:a().optional(),introspection_endpoint_auth_methods_supported:f(a()).optional(),introspection_endpoint_auth_signing_alg_values_supported:f(a()).optional(),code_challenge_methods_supported:f(a()).optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0),dpop_signing_alg_values_supported:f(a()).optional()}),Ji=E({issuer:a(),authorization_endpoint:te,token_endpoint:te,userinfo_endpoint:te.optional(),jwks_uri:te,registration_endpoint:te.optional(),scopes_supported:f(a()).optional(),response_types_supported:f(a()),response_modes_supported:f(a()).optional(),grant_types_supported:f(a()).optional(),acr_values_supported:f(a()).optional(),subject_types_supported:f(a()),id_token_signing_alg_values_supported:f(a()),id_token_encryption_alg_values_supported:f(a()).optional(),id_token_encryption_enc_values_supported:f(a()).optional(),userinfo_signing_alg_values_supported:f(a()).optional(),userinfo_encryption_alg_values_supported:f(a()).optional(),userinfo_encryption_enc_values_supported:f(a()).optional(),request_object_signing_alg_values_supported:f(a()).optional(),request_object_encryption_alg_values_supported:f(a()).optional(),request_object_encryption_enc_values_supported:f(a()).optional(),token_endpoint_auth_methods_supported:f(a()).optional(),token_endpoint_auth_signing_alg_values_supported:f(a()).optional(),display_values_supported:f(a()).optional(),claim_types_supported:f(a()).optional(),claims_supported:f(a()).optional(),service_documentation:a().optional(),claims_locales_supported:f(a()).optional(),ui_locales_supported:f(a()).optional(),claims_parameter_supported:R().optional(),request_parameter_supported:R().optional(),request_uri_parameter_supported:R().optional(),require_request_uri_registration:R().optional(),op_policy_uri:te.optional(),op_tos_uri:te.optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0)}),Bi=p({...Ji.shape,...Lr.pick({code_challenge_methods_supported:!0}).shape}),Wi=p({access_token:a(),id_token:a().optional(),token_type:a(),expires_in:hs.number().optional(),scope:a().optional(),refresh_token:a().optional(),issuer:a().optional().catch(void 0)}).strip(),Gi=p({issued_token_type:g("urn:ietf:params:oauth:token-type:id-jag"),access_token:a(),token_type:a().optional(),expires_in:y().optional(),scope:a().optional()}).strip(),Ki=p({error:a(),error_description:a().optional(),error_uri:a().optional()}),Am=te.optional().or(g("").transform(()=>{})),Yi=p({redirect_uris:f(te),token_endpoint_auth_method:a().optional(),grant_types:f(a()).optional(),response_types:f(a()).optional(),application_type:a().optional(),client_name:a().optional(),client_uri:te.optional(),logo_uri:Am,scope:a().optional(),contacts:f(a()).optional(),tos_uri:Am,policy_uri:a().optional(),jwks_uri:te.optional(),jwks:ol().optional(),software_id:a().optional(),software_version:a().optional(),software_statement:a().optional()}).strip(),Qi=p({client_id:a(),client_secret:a().optional(),client_id_issued_at:y().optional(),client_secret_expires_at:y().optional(),issuer:a().optional().catch(void 0)}).strip(),Xi=Yi.merge(Qi),Nl=p({error:a(),error_description:a().optional()}).strip(),Ml=p({token:a(),token_type_hint:a().optional()}).strip();var Hm=Symbol.for("mcp.sdk.errorBrands");function bo(e,t){let o=new Set,r=t;for(;typeof r=="function";){let n=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,"mcpBrand")&&typeof n=="string"&&o.add(n),r=Object.getPrototypeOf(r)}o.size!==0&&Object.defineProperty(e,Hm,{value:o,enumerable:!1,configurable:!0})}function Pe(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,Hm)){let o=t[Hm];if(o&&typeof o.has=="function"&&o.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var wy=class PS extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return Pe(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Pe(this,t)}constructor(t,o,r){super(o),this.code=t,this.errorUri=r,this.name="OAuthError",bo(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}static fromResponse(t){return new PS(t.error,t.error_description??t.error,t.error_uri)}},se=(function(e){return e.NotConnected="NOT_CONNECTED",e.AlreadyConnected="ALREADY_CONNECTED",e.NotInitialized="NOT_INITIALIZED",e.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",e.RequestTimeout="REQUEST_TIMEOUT",e.ConnectionClosed="CONNECTION_CLOSED",e.SendFailed="SEND_FAILED",e.InvalidResult="INVALID_RESULT",e.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",e.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",e.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",e.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",e.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",e.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",e.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",e.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",e.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",e.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",e.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",e})({}),X=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return Pe(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Pe(this,e)}constructor(e,t,o,r){super(t,r),this.code=e,this.data=o,this.name="SdkError",bo(this,new.target)}},xy=class extends X{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,o,r){super(e,t,o,r),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};var Py="2026-07-28";function TS(e){return e>=Py}function kS(e){let t=e.structuredContent;return t===void 0||!(typeof t!="object"||t===null||Array.isArray(t))||(e.content?.some(o=>o.type==="text")??!1)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var $S=["task","inputRequests","requestState"];function Ty(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||$S.some(t=>t in e)?e:{...e,content:[]}}function ky(){let e=xt(()=>x([a(),y(),R(),Ze(),v(a(),e),f(e)])),t=v(a(),e),o=x([a(),y().int()]),r=a(),n=p({ttl:y().optional()}),s=p({taskId:a()}),i=E({progressToken:o.optional(),"io.modelcontextprotocol/related-task":s.optional()}),c=p({_meta:i.optional()}),l=c.extend({task:n.optional()}),d=p({method:a(),params:c.loose().optional()}),m=p({_meta:i.optional()}),S=p({method:a(),params:m.loose().optional()}),_=E({_meta:i.optional()}),b=x([a(),y().int()]),P=_.strict(),$=m.extend({requestId:b.optional(),reason:a().optional()}),C=S.extend({method:g("notifications/cancelled"),params:$}),q=p({src:a(),mimeType:a().optional(),sizes:f(a()).optional(),theme:I(["light","dark"]).optional()}),J=p({icons:f(q).optional()}),L=p({name:a(),title:a().optional()}),U=L.extend({...L.shape,...J.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),B=Oe(p({applyDefaults:R().optional()}),t),F=et(ce=>ce&&typeof ce=="object"&&!Array.isArray(ce)&&Object.keys(ce).length===0?{form:{}}:ce,Oe(p({form:B.optional(),url:t.optional()}),t.optional())),ee=E({list:t.optional(),cancel:t.optional(),requests:E({sampling:E({createMessage:t.optional()}).optional(),elicitation:E({create:t.optional()}).optional()}).optional()}),Be=E({list:t.optional(),cancel:t.optional(),requests:E({tools:E({call:t.optional()}).optional()}).optional()}),de=p({experimental:v(a(),t).optional(),sampling:p({context:t.optional(),tools:t.optional()}).optional(),elicitation:F.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:ee.optional(),extensions:v(a(),t).optional()}),at=c.extend({protocolVersion:a(),capabilities:de,clientInfo:U}),Nt=d.extend({method:g("initialize"),params:at}),Ur=p({experimental:v(a(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:p({listChanged:R().optional()}).optional(),resources:p({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:p({listChanged:R().optional()}).optional(),tasks:Be.optional(),extensions:v(a(),t).optional()}),Zr=_.extend({protocolVersion:a(),capabilities:Ur,serverInfo:U,instructions:a().optional()}),yo=S.extend({method:g("notifications/initialized"),params:m.optional()}),ct=d.extend({method:g("ping"),params:c.optional()}),Mt=p({progress:y(),total:k(y()),message:k(a())}),Me=p({...m.shape,...Mt.shape,progressToken:o}),lt=S.extend({method:g("notifications/progress"),params:Me}),zo=c.extend({cursor:r.optional()}),We=d.extend({params:zo.optional()}),Ge=_.extend({nextCursor:r.optional()}),vo=p({uri:a(),mimeType:k(a()),_meta:v(a(),T()).optional()}),Ro=vo.extend({text:a()}),qt=a().refine(ce=>{try{return atob(ce),!0}catch{return!1}},{message:"Invalid Base64 string"}),wo=vo.extend({blob:qt}),qe=I(["user","assistant"]),$e=p({audience:f(qe).optional(),priority:y().min(0).max(1).optional(),lastModified:xe.datetime({offset:!0}).optional()}),At=p({...L.shape,...J.shape,uri:a(),description:k(a()),mimeType:k(a()),size:k(y()),annotations:$e.optional(),_meta:k(E({}))}),Dr=p({...L.shape,...J.shape,uriTemplate:a(),description:k(a()),mimeType:k(a()),annotations:$e.optional(),_meta:k(E({}))}),Vr=We.extend({method:g("resources/list")}),Hr=Ge.extend({resources:f(At)}),ut=We.extend({method:g("resources/templates/list")}),xo=Ge.extend({resourceTemplates:f(Dr)}),jt=c.extend({uri:a()}),Fr=jt,Jr=d.extend({method:g("resources/read"),params:Fr}),Br=_.extend({contents:f(x([Ro,wo]))}),Wr=S.extend({method:g("notifications/resources/list_changed"),params:m.optional()}),Gr=jt,Kr=d.extend({method:g("resources/subscribe"),params:Gr}),Yr=jt,Qr=d.extend({method:g("resources/unsubscribe"),params:Yr}),Xr=m.extend({uri:a()}),en=S.extend({method:g("notifications/resources/updated"),params:Xr}),tn=p({name:a(),description:k(a()),required:k(R())}),on=p({...L.shape,...J.shape,description:k(a()),arguments:k(f(tn)),_meta:k(E({}))}),rn=We.extend({method:g("prompts/list")}),nn=Ge.extend({prompts:f(on)}),sn=c.extend({name:a(),arguments:v(a(),a()).optional()}),an=d.extend({method:g("prompts/get"),params:sn}),Lt=p({type:g("text"),text:a(),annotations:$e.optional(),_meta:v(a(),T()).optional()}),Ut=p({type:g("image"),data:qt,mimeType:a(),annotations:$e.optional(),_meta:v(a(),T()).optional()}),Zt=p({type:g("audio"),data:qt,mimeType:a(),annotations:$e.optional(),_meta:v(a(),T()).optional()}),cn=p({type:g("tool_use"),name:a(),id:a(),input:v(a(),T()),_meta:v(a(),T()).optional()}),dt=p({type:g("resource"),resource:x([Ro,wo]),annotations:$e.optional(),_meta:v(a(),T()).optional()}),ln=At.extend({type:g("resource_link")}),Te=x([Lt,Ut,Zt,ln,dt]),Po=p({role:qe,content:Te}),To=_.extend({description:a().optional(),messages:f(Po)}),Dt=S.extend({method:g("notifications/prompts/list_changed"),params:m.optional()}),un=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),ko=p({taskSupport:I(["required","optional","forbidden"]).optional()}),Vt=p({...L.shape,...J.shape,description:a().optional(),inputSchema:p({type:g("object"),properties:v(a(),e).optional(),required:f(a()).optional()}).catchall(T()),outputSchema:p({type:g("object"),properties:v(a(),e).optional(),required:f(a()).optional()}).catchall(T()).optional(),annotations:un.optional(),execution:ko.optional(),_meta:v(a(),T()).optional()}),$o=We.extend({method:g("tools/list")}),Eo=Ge.extend({tools:f(Vt)}),Co=_.extend({content:f(Te),structuredContent:v(a(),T()).optional(),isError:R().optional()}),ae=l.extend({name:a(),arguments:v(a(),T()).optional()}),dn=d.extend({method:g("tools/call"),params:ae}),ca=S.extend({method:g("notifications/tools/list_changed"),params:m.optional()}),Io=I(["debug","info","notice","warning","error","critical","alert","emergency"]),pn=c.extend({level:Io}),hn=d.extend({method:g("logging/setLevel"),params:pn}),mn=m.extend({level:Io,logger:a().optional(),data:T()}),fn=S.extend({method:g("notifications/message"),params:mn}),gn=p({name:a().optional()}),Sn=p({hints:f(gn).optional(),costPriority:y().min(0).max(1).optional(),speedPriority:y().min(0).max(1).optional(),intelligencePriority:y().min(0).max(1).optional()}),_n=p({mode:I(["auto","required","none"]).optional()}),la=p({type:g("tool_result"),toolUseId:a().describe("The unique identifier for the corresponding tool call."),content:f(Te),structuredContent:p({}).loose().optional(),isError:R().optional(),_meta:v(a(),T()).optional()}),bn=wt("type",[Lt,Ut,Zt]),pt=wt("type",[Lt,Ut,Zt,cn,la]),yn=p({role:qe,content:x([pt,f(pt)]),_meta:v(a(),T()).optional()}),zn=l.extend({messages:f(yn),modelPreferences:Sn.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:y().optional(),maxTokens:y().int(),stopSequences:f(a()).optional(),metadata:t.optional(),tools:f(Vt).optional(),toolChoice:_n.optional()}),vn=d.extend({method:g("sampling/createMessage"),params:zn}),Rn=_.extend({model:a(),stopReason:k(I(["endTurn","stopSequence","maxTokens"]).or(a())),role:qe,content:bn}),wn=_.extend({model:a(),stopReason:k(I(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:qe,content:x([pt,f(pt)])}),xn=p({type:g("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),Pn=p({type:g("string"),title:a().optional(),description:a().optional(),minLength:y().optional(),maxLength:y().optional(),format:I(["email","uri","date","date-time"]).optional(),default:a().optional()}),Tn=p({type:I(["number","integer"]),title:a().optional(),description:a().optional(),minimum:y().optional(),maximum:y().optional(),default:y().optional()}),kn=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),default:a().optional()}),$n=p({type:g("string"),title:a().optional(),description:a().optional(),oneOf:f(p({const:a(),title:a()})),default:a().optional()}),En=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),enumNames:f(a()).optional(),default:a().optional()}),Cn=x([kn,$n]),Ht=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:y().optional(),maxItems:y().optional(),items:p({type:g("string"),enum:f(a())}),default:f(a()).optional()}),Ft=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:y().optional(),maxItems:y().optional(),items:p({anyOf:f(p({const:a(),title:a()}))}),default:f(a()).optional()}),ua=x([Ht,Ft]),da=x([En,Cn,ua]),ze=x([da,xn,Pn,Tn]),ve=l.extend({mode:g("form").optional(),message:a(),requestedSchema:p({type:g("object"),properties:v(a(),ze),required:f(a()).optional()}).catchall(T())}),In=l.extend({mode:g("url"),message:a(),elicitationId:a(),url:a().url()}),Ee=x([ve,In]),pa=d.extend({method:g("elicitation/create"),params:Ee}),ha=m.extend({elicitationId:a()}),ma=S.extend({method:g("notifications/elicitation/complete"),params:ha}),fa=_.extend({action:I(["accept","decline","cancel"]),content:et(ce=>ce===null?void 0:ce,v(a(),x([a(),y(),R(),f(a())])).optional())}),ga=p({type:g("ref/resource"),uri:a()}),Sa=p({type:g("ref/prompt"),name:a()}),_a=c.extend({ref:x([Sa,ga]),argument:p({name:a(),value:a()}),context:p({arguments:v(a(),a()).optional()}).optional()}),On=d.extend({method:g("completion/complete"),params:_a}),ba=_.extend({completion:E({values:f(a()).max(100),total:k(y().int()),hasMore:k(R())})}),ya=p({uri:a().startsWith("file://"),name:a().optional(),_meta:v(a(),T()).optional()}),Oo=d.extend({method:g("roots/list"),params:c.optional()}),Nn=_.extend({roots:f(ya)}),za=S.extend({method:g("notifications/roots/list_changed"),params:m.optional()}),va=E({ttl:y().optional(),pollInterval:y().optional()}),Mn=I(["working","input_required","completed","failed","cancelled"]),ht=p({taskId:a(),status:Mn,ttl:x([y(),Ze()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:k(y()),statusMessage:k(a())}),Se=_.extend({task:ht}),Ra=m.merge(ht),Jt=S.extend({method:g("notifications/tasks/status"),params:Ra}),No=d.extend({method:g("tasks/get"),params:c.extend({taskId:a()})}),Mo=_.merge(ht),qo=d.extend({method:g("tasks/result"),params:c.extend({taskId:a()})}),Zl=_.loose(),pe=We.extend({method:g("tasks/list")}),Q=Ge.extend({tasks:f(ht)}),Bt=d.extend({method:g("tasks/cancel"),params:c.extend({taskId:a()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:r,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:i,BaseRequestParamsSchema:c,TaskAugmentedRequestParamsSchema:l,RequestSchema:d,NotificationsParamsSchema:m,NotificationSchema:S,ResultSchema:_,RequestIdSchema:b,EmptyResultSchema:P,CancelledNotificationParamsSchema:$,CancelledNotificationSchema:C,IconSchema:q,IconsSchema:J,BaseMetadataSchema:L,ImplementationSchema:U,ClientTasksCapabilitySchema:ee,ServerTasksCapabilitySchema:Be,ClientCapabilitiesSchema:de,InitializeRequestParamsSchema:at,InitializeRequestSchema:Nt,ServerCapabilitiesSchema:Ur,InitializeResultSchema:Zr,InitializedNotificationSchema:yo,PingRequestSchema:ct,ProgressSchema:Mt,ProgressNotificationParamsSchema:Me,ProgressNotificationSchema:lt,PaginatedRequestParamsSchema:zo,PaginatedRequestSchema:We,PaginatedResultSchema:Ge,ResourceContentsSchema:vo,TextResourceContentsSchema:Ro,BlobResourceContentsSchema:wo,RoleSchema:qe,AnnotationsSchema:$e,ResourceSchema:At,ResourceTemplateSchema:Dr,ListResourcesRequestSchema:Vr,ListResourcesResultSchema:Hr,ListResourceTemplatesRequestSchema:ut,ListResourceTemplatesResultSchema:xo,ResourceRequestParamsSchema:jt,ReadResourceRequestParamsSchema:Fr,ReadResourceRequestSchema:Jr,ReadResourceResultSchema:Br,ResourceListChangedNotificationSchema:Wr,SubscribeRequestParamsSchema:Gr,SubscribeRequestSchema:Kr,UnsubscribeRequestParamsSchema:Yr,UnsubscribeRequestSchema:Qr,ResourceUpdatedNotificationParamsSchema:Xr,ResourceUpdatedNotificationSchema:en,PromptArgumentSchema:tn,PromptSchema:on,ListPromptsRequestSchema:rn,ListPromptsResultSchema:nn,GetPromptRequestParamsSchema:sn,GetPromptRequestSchema:an,TextContentSchema:Lt,ImageContentSchema:Ut,AudioContentSchema:Zt,ToolUseContentSchema:cn,EmbeddedResourceSchema:dt,ResourceLinkSchema:ln,ContentBlockSchema:Te,PromptMessageSchema:Po,GetPromptResultSchema:To,PromptListChangedNotificationSchema:Dt,ToolAnnotationsSchema:un,ToolExecutionSchema:ko,ToolSchema:Vt,ListToolsRequestSchema:$o,ListToolsResultSchema:Eo,CallToolResultSchema:Co,CallToolRequestParamsSchema:ae,CallToolRequestSchema:dn,ToolListChangedNotificationSchema:ca,LoggingLevelSchema:Io,SetLevelRequestParamsSchema:pn,SetLevelRequestSchema:hn,LoggingMessageNotificationParamsSchema:mn,LoggingMessageNotificationSchema:fn,ModelHintSchema:gn,ModelPreferencesSchema:Sn,ToolChoiceSchema:_n,ToolResultContentSchema:la,SamplingContentSchema:bn,SamplingMessageContentBlockSchema:pt,SamplingMessageSchema:yn,CreateMessageRequestParamsSchema:zn,CreateMessageRequestSchema:vn,CreateMessageResultSchema:Rn,CreateMessageResultWithToolsSchema:wn,BooleanSchemaSchema:xn,StringSchemaSchema:Pn,NumberSchemaSchema:Tn,UntitledSingleSelectEnumSchemaSchema:kn,TitledSingleSelectEnumSchemaSchema:$n,LegacyTitledEnumSchemaSchema:En,SingleSelectEnumSchemaSchema:Cn,UntitledMultiSelectEnumSchemaSchema:Ht,TitledMultiSelectEnumSchemaSchema:Ft,MultiSelectEnumSchemaSchema:ua,EnumSchemaSchema:da,PrimitiveSchemaDefinitionSchema:ze,ElicitRequestFormParamsSchema:ve,ElicitRequestURLParamsSchema:In,ElicitRequestParamsSchema:Ee,ElicitRequestSchema:pa,ElicitationCompleteNotificationParamsSchema:ha,ElicitationCompleteNotificationSchema:ma,ElicitResultSchema:fa,ResourceTemplateReferenceSchema:ga,PromptReferenceSchema:Sa,CompleteRequestParamsSchema:_a,CompleteRequestSchema:On,CompleteResultSchema:ba,RootSchema:ya,ListRootsRequestSchema:Oo,ListRootsResultSchema:Nn,RootsListChangedNotificationSchema:za,TaskCreationParamsSchema:va,TaskStatusSchema:Mn,TaskSchema:ht,CreateTaskResultSchema:Se,TaskStatusNotificationParamsSchema:Ra,TaskStatusNotificationSchema:Jt,GetTaskRequestSchema:No,GetTaskResultSchema:Mo,GetTaskPayloadRequestSchema:qo,GetTaskPayloadResultSchema:Zl,ListTasksRequestSchema:pe,ListTasksResultSchema:Q,CancelTaskRequestSchema:Bt,CancelTaskResultSchema:_.merge(ht),ClientRequestSchema:x([ct,Nt,On,hn,an,rn,Vr,ut,Jr,Kr,Qr,dn,$o,No,qo,pe,Bt]),ClientNotificationSchema:x([C,lt,yo,za,Jt]),ClientResultSchema:x([P,Rn,wn,fa,Nn,Mo,Q,Se]),ServerRequestSchema:x([ct,vn,pa,Oo,No,qo,pe,Bt]),ServerNotificationSchema:x([C,lt,fn,en,Wr,ca,Dt,Jt,ma]),ServerResultSchema:x([P,Zr,ba,To,nn,Hr,xo,Br,Co,Eo,Mo,Q,Se]),CallToolResultWireSchema:T().superRefine((ce,b_)=>{if(!(typeof ce!="object"||ce===null||Array.isArray(ce)||ce.content!==void 0)){for(let df of $S)if(df in ce){b_.addIssue({code:"custom",message:`content is required when the body carries '${df}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(Ty).pipe(Co)}}var $y;function ES(){return $y??=ky()}function CS(e){return e.type!=="object"}var Ey=new Set(["const","enum","default","examples"]),Cy=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function gS(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Iy(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(gS(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let o=ff(e.$schema)&&e.$recursiveAnchor!==!0,r=(n,s)=>{if(Array.isArray(n))return n.map(l=>r(l,!1));if(n===null||typeof n!="object"||!s&&gS(n.$id))return n;let i={},c=!1;for(let[l,d]of Object.entries(n))s?i[l]=r(d,!1):(l==="$ref"||l==="$dynamicRef")&&typeof d=="string"?i[l]=d==="#"?"#/properties/result":d.startsWith("#/")?`#/properties/result${d.slice(1)}`:d:l==="$recursiveRef"&&d==="#"&&o?c=!0:Ey.has(l)?i[l]=d:Cy.has(l)?i[l]=r(d,!0):i[l]=r(d,!1);return c&&("$ref"in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:"#/properties/result"}]:i.$ref="#/properties/result"),i};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:r(e,!1)},required:["result"]}}var IS={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},OS={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Oy={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},ql;function Km(){if(ql)return ql;let e=ES();return ql={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},ql}function NS(e){return Object.prototype.hasOwnProperty.call(IS,e)}function MS(e){return Object.prototype.hasOwnProperty.call(OS,e)}function Ny(e){return Object.prototype.hasOwnProperty.call(Oy,e)}function My(e){return Ny(e)?Km().resultSchemas[e]:void 0}function qy(e){return NS(e)?Km().requestSchemas[e]:void 0}function Ay(e){return MS(e)?Km().notificationSchemas[e]:void 0}var HR=Object.keys(IS),FR=Object.keys(OS);function Fm(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Al(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let o=e.safeParse(t);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}var SS={ok:!1,reason:"not-in-era"};function _S(e){return Fm(e)&&Fm(e.outputSchema)&&CS(e.outputSchema)}var Ym={era:"2025-11-25",hasRequestMethod:NS,hasNotificationMethod:MS,validateRequest:(e,t)=>Al(qy(e),t),validateResult:(e,t)=>Al(My(e),t),validateNotification:(e,t)=>Al(Ay(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>SS,validateInputResponse:()=>SS,samplingResultVariant:((e,t)=>{let o=ES();return Al(e?o.CreateMessageResultWithToolsSchema:o.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let o=kS(e),r=o.structuredContent;if(r===void 0)return o;let n=typeof r!="object"||r===null||Array.isArray(r),s=t!==void 0&&CS(t);return!n&&!s?o:{...o,structuredContent:{result:r}}},decodeResult(e,t){if(Fm(t)&&"resultType"in t){let o={...t};return delete o.resultType,{kind:"complete",result:o}}return{kind:"complete",result:t}},encodeResult(e,t){if(e!=="tools/list")return t;let o=t.tools;return!Array.isArray(o)||!o.some(r=>_S(r))?t:{...t,tools:o.map(r=>_S(r)?{...r,outputSchema:Iy(r.outputSchema)}:r)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function jy(){let e=xt(()=>x([a(),y(),R(),Ze(),v(a(),e),f(e)])),t=v(a(),e),o=x([a(),y().int()]),r=a(),n=x([a(),y().int()]),s=I(["user","assistant"]),i=I(["debug","info","notice","warning","error","critical","alert","emergency"]),c=a().refine(Q=>{try{return atob(Q),!0}catch{return!1}},{message:"Invalid Base64 string"}),l=p({ttl:y().optional()}),d=p({taskId:a()}),m=E({progressToken:o.optional(),"io.modelcontextprotocol/related-task":d.optional()}),S=p({_meta:m.optional()}),_=S.extend({task:l.optional()}),b=p({_meta:m.optional()}),P=p({method:a(),params:b.loose().optional()}),$=p({src:a(),mimeType:a().optional(),sizes:f(a()).optional(),theme:I(["light","dark"]).optional()}),C=p({icons:f($).optional()}),q=p({name:a(),title:a().optional()}),J=q.extend({...q.shape,...C.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),L=Oe(p({applyDefaults:R().optional()}),t),U=et(Q=>Q&&typeof Q=="object"&&!Array.isArray(Q)&&Object.keys(Q).length===0?{form:{}}:Q,Oe(p({form:L.optional(),url:t.optional()}),t.optional())),B=E({list:t.optional(),cancel:t.optional(),requests:E({sampling:E({createMessage:t.optional()}).optional(),elicitation:E({create:t.optional()}).optional()}).optional()}),F=E({list:t.optional(),cancel:t.optional(),requests:E({tools:E({call:t.optional()}).optional()}).optional()}),ee=p({experimental:v(a(),t).optional(),sampling:p({context:t.optional(),tools:t.optional()}).optional(),elicitation:U.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:B.optional(),extensions:v(a(),t).optional()}),Be=p({experimental:v(a(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:p({listChanged:R().optional()}).optional(),resources:p({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:p({listChanged:R().optional()}).optional(),tasks:F.optional(),extensions:v(a(),t).optional()}),de=p({progress:y(),total:k(y()),message:k(a())}),at=p({...b.shape,...de.shape,progressToken:o}),Nt=P.extend({method:g("notifications/progress"),params:at}),Ur=b.extend({level:i,logger:a().optional(),data:T()}),Zr=P.extend({method:g("notifications/message"),params:Ur}),yo=p({uri:a(),mimeType:k(a()),_meta:v(a(),T()).optional()}),ct=yo.extend({text:a()}),Mt=yo.extend({blob:c}),Me=p({audience:f(s).optional(),priority:y().min(0).max(1).optional(),lastModified:xe.datetime({offset:!0}).optional()}),lt=p({...q.shape,...C.shape,uri:a(),description:k(a()),mimeType:k(a()),size:k(y()),annotations:Me.optional(),_meta:k(E({}))}),zo=p({...q.shape,...C.shape,uriTemplate:a(),description:k(a()),mimeType:k(a()),annotations:Me.optional(),_meta:k(E({}))}),We=P.extend({method:g("notifications/resources/list_changed"),params:b.optional()}),Ge=b.extend({uri:a()}),vo=P.extend({method:g("notifications/resources/updated"),params:Ge}),Ro=p({name:a(),description:k(a()),required:k(R())}),qt=p({...q.shape,...C.shape,description:k(a()),arguments:k(f(Ro)),_meta:k(E({}))}),wo=P.extend({method:g("notifications/prompts/list_changed"),params:b.optional()}),qe=p({type:g("text"),text:a(),annotations:Me.optional(),_meta:v(a(),T()).optional()}),$e=p({type:g("image"),data:c,mimeType:a(),annotations:Me.optional(),_meta:v(a(),T()).optional()}),At=p({type:g("audio"),data:c,mimeType:a(),annotations:Me.optional(),_meta:v(a(),T()).optional()}),Dr=p({type:g("tool_use"),name:a(),id:a(),input:v(a(),T()),_meta:v(a(),T()).optional()}),Vr=p({type:g("resource"),resource:x([ct,Mt]),annotations:Me.optional(),_meta:v(a(),T()).optional()}),Hr=lt.extend({type:g("resource_link")}),ut=x([qe,$e,At,Hr,Vr]),xo=p({role:s,content:ut}),jt=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),Fr=P.extend({method:g("notifications/tools/list_changed"),params:b.optional()}),Jr=p({name:a().optional()}),Br=p({hints:f(Jr).optional(),costPriority:y().min(0).max(1).optional(),speedPriority:y().min(0).max(1).optional(),intelligencePriority:y().min(0).max(1).optional()}),Wr=p({mode:I(["auto","required","none"]).optional()}),Gr=p({type:g("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),Kr=p({type:g("string"),title:a().optional(),description:a().optional(),minLength:y().optional(),maxLength:y().optional(),format:I(["email","uri","date","date-time"]).optional(),default:a().optional()}),Yr=p({type:I(["number","integer"]),title:a().optional(),description:a().optional(),minimum:y().optional(),maximum:y().optional(),default:y().optional()}),Qr=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),default:a().optional()}),Xr=p({type:g("string"),title:a().optional(),description:a().optional(),oneOf:f(p({const:a(),title:a()})),default:a().optional()}),en=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),enumNames:f(a()).optional(),default:a().optional()}),tn=x([Qr,Xr]),on=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:y().optional(),maxItems:y().optional(),items:p({type:g("string"),enum:f(a())}),default:f(a()).optional()}),rn=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:y().optional(),maxItems:y().optional(),items:p({anyOf:f(p({const:a(),title:a()}))}),default:f(a()).optional()}),nn=x([on,rn]),sn=x([en,tn,nn]),an=x([sn,Gr,Kr,Yr]),Lt=_.extend({mode:g("form").optional(),message:a(),requestedSchema:p({type:g("object"),properties:v(a(),an),required:f(a()).optional()}).catchall(T())}),Ut=p({type:g("ref/resource"),uri:a()}),Zt=p({type:g("ref/prompt"),name:a()}),cn=p({uri:a().startsWith("file://"),name:a().optional(),_meta:v(a(),T()).optional()}),dt=ee.shape,ln=p({experimental:dt.experimental,sampling:dt.sampling,elicitation:dt.elicitation,roots:dt.roots,extensions:dt.extensions}),Te=Be.shape,Po=p({experimental:Te.experimental,logging:Te.logging,completions:Te.completions,prompts:Te.prompts,resources:Te.resources,tools:Te.tools,extensions:Te.extensions}),To=E({progressToken:o.optional(),[ro]:a(),[hr]:J.optional(),[no]:ln,[mr]:i.optional()}),Dt=p({...q.shape,...C.shape,description:a().optional(),inputSchema:E({$schema:a().optional(),type:g("object")}),outputSchema:E({$schema:a().optional()}).optional(),annotations:jt.optional(),_meta:v(a(),T()).optional()}),un=p({type:g("tool_result"),toolUseId:a(),content:f(ut),structuredContent:T().optional(),isError:R().optional(),_meta:v(a(),T()).optional()}),ko=x([qe,$e,At,Dr,un]),Vt=p({role:s,content:x([ko,f(ko)]),_meta:v(a(),T()).optional()}),$o=a(),Eo=E({[Tt]:J.optional().catch(void 0)}),Co=Eo.optional();function ae(Q){return E({_meta:Co,resultType:$o.default("complete"),...Q})}let dn=ae({}),ca=ae({nextCursor:r.optional()}),Io=ae({content:f(ut),structuredContent:T().optional(),isError:R().optional()}),pn=ae({ttlMs:y().int().min(0),cacheScope:I(["public","private"]),tools:f(Dt),nextCursor:r.optional()}),hn=ae({ttlMs:y().int().min(0),cacheScope:I(["public","private"]),prompts:f(qt),nextCursor:r.optional()}),mn=ae({description:a().optional(),messages:f(xo)}),fn=ae({ttlMs:y().int().min(0),cacheScope:I(["public","private"]),resources:f(lt),nextCursor:r.optional()}),gn=ae({ttlMs:y().int().min(0),cacheScope:I(["public","private"]),resourceTemplates:f(zo),nextCursor:r.optional()}),Sn=ae({ttlMs:y().int().min(0),cacheScope:I(["public","private"]),contents:f(x([ct,Mt]))}),_n=ae({completion:p({values:f(a()).max(100),total:y().int().optional(),hasMore:R().optional()}).loose()}),la=ae({ttlMs:y().int().min(0),cacheScope:I(["public","private"])}),bn=ae({ttlMs:y().int().min(0).catch(0),cacheScope:I(["public","private"]).catch("private"),supportedVersions:f(a()),capabilities:Po,instructions:a().optional()}),pt=p({messages:f(Vt),modelPreferences:Br.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:y().optional(),maxTokens:y().int(),stopSequences:f(a()).optional(),metadata:t.optional(),tools:f(Dt).optional(),toolChoice:Wr.optional()}),yn=p({method:g("sampling/createMessage"),params:pt}),zn=p({method:g("roots/list"),params:p({_meta:v(a(),T()).optional()}).optional()}),vn=p({...Vt.shape,model:a(),stopReason:a().optional()}),Rn=p({roots:f(cn)}),wn=p({action:I(["accept","decline","cancel"]),content:v(a(),x([a(),y(),R(),f(a())])).optional()}),xn=p({mode:g("url"),message:a(),url:a().url()}),Pn=x([Lt,xn]),Tn=p({method:g("elicitation/create"),params:Pn}),kn=x([yn,zn,Tn]),$n=x([vn,Rn,wn]),En=v(a(),kn),Cn=v(a(),$n),Ht=ae({inputRequests:En.optional(),requestState:a().optional()}),Ft={inputResponses:Cn.optional(),requestState:a().optional()},ua=p({_meta:To,...Ft}),da=E({progressToken:o.optional()});function ze(Q,Bt){return p({method:g(Q),params:p({_meta:To,...Bt})})}function ve(Q,Bt){return p({method:g(Q),params:p({_meta:da.optional(),...Bt}).optional()})}let In={name:a(),arguments:v(a(),T()).optional(),...Ft},Ee={cursor:r.optional()},pa=ze("tools/call",In),ha=ze("tools/list",Ee),ma=ze("prompts/list",Ee),fa=ze("prompts/get",{name:a(),arguments:v(a(),a()).optional(),...Ft}),ga=ze("resources/list",Ee),Sa=ze("resources/templates/list",Ee),_a=ze("resources/read",{uri:a(),...Ft}),On={ref:x([Zt,Ut]),argument:p({name:a(),value:a()}),context:p({arguments:v(a(),a()).optional()}).optional()},ba=ze("completion/complete",On),ya=ze("server/discover",{}),Oo=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:f(a()).optional()}),Nn={notifications:Oo},za=ze("subscriptions/listen",Nn),va=Eo.extend({"io.modelcontextprotocol/subscriptionId":n}),Mn=E({_meta:va,resultType:$o.default("complete")}),ht={"tools/call":ve("tools/call",In),"tools/list":ve("tools/list",Ee),"prompts/get":ve("prompts/get",{name:a(),arguments:v(a(),a()).optional()}),"prompts/list":ve("prompts/list",Ee),"resources/list":ve("resources/list",Ee),"resources/templates/list":ve("resources/templates/list",Ee),"resources/read":ve("resources/read",{uri:a()}),"completion/complete":ve("completion/complete",On),"server/discover":ve("server/discover",{}),"subscriptions/listen":ve("subscriptions/listen",Nn)};function Se(Q){return E({_meta:Co,...Q})}let Ra={"tools/call":Se({content:f(ut),structuredContent:T().optional(),isError:R().optional()}),"tools/list":Se({ttlMs:y().int().min(0),cacheScope:I(["public","private"]),tools:f(Dt),nextCursor:r.optional()}),"prompts/get":Se({description:a().optional(),messages:f(xo)}),"prompts/list":Se({ttlMs:y().int().min(0),cacheScope:I(["public","private"]),prompts:f(qt),nextCursor:r.optional()}),"resources/list":Se({ttlMs:y().int().min(0),cacheScope:I(["public","private"]),resources:f(lt),nextCursor:r.optional()}),"resources/templates/list":Se({ttlMs:y().int().min(0),cacheScope:I(["public","private"]),resourceTemplates:f(zo),nextCursor:r.optional()}),"resources/read":Se({ttlMs:y().int().min(0),cacheScope:I(["public","private"]),contents:f(x([ct,Mt]))}),"completion/complete":Se({completion:p({values:f(a()).max(100),total:y().int().optional(),hasMore:R().optional()}).loose()}),"server/discover":Se({ttlMs:y().int().min(0).catch(0),cacheScope:I(["public","private"]).catch("private"),supportedVersions:f(a()),capabilities:Po,instructions:a().optional()}),"subscriptions/listen":Se({})},Jt=E({"io.modelcontextprotocol/subscriptionId":n.optional()}),No=p({method:g("notifications/subscriptions/acknowledged"),params:p({_meta:Jt.optional(),notifications:Oo})}),Mo=p({_meta:Jt.optional(),requestId:n,reason:a().optional()}),qo=p({method:g("notifications/cancelled"),params:Mo}),Zl={"notifications/cancelled":qo,"notifications/progress":Nt,"notifications/message":Zr,"notifications/resources/updated":vo,"notifications/resources/list_changed":We,"notifications/tools/list_changed":Fr,"notifications/prompts/list_changed":wo,"notifications/subscriptions/acknowledged":No},pe=Q=>p({jsonrpc:g("2.0"),id:x([a(),y().int()]),result:Q}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:r,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:l,RelatedTaskMetadataSchema:d,RequestMetaSchema:m,BaseRequestParamsSchema:S,TaskAugmentedRequestParamsSchema:_,NotificationsParamsSchema:b,NotificationSchema:P,IconSchema:$,IconsSchema:C,BaseMetadataSchema:q,ImplementationSchema:J,ClientTasksCapabilitySchema:B,ServerTasksCapabilitySchema:F,ClientCapabilitiesSchema:ee,ServerCapabilitiesSchema:Be,ProgressSchema:de,ProgressNotificationParamsSchema:at,ProgressNotificationSchema:Nt,LoggingMessageNotificationParamsSchema:Ur,LoggingMessageNotificationSchema:Zr,ResourceContentsSchema:yo,TextResourceContentsSchema:ct,BlobResourceContentsSchema:Mt,AnnotationsSchema:Me,ResourceSchema:lt,ResourceTemplateSchema:zo,ResourceListChangedNotificationSchema:We,ResourceUpdatedNotificationParamsSchema:Ge,ResourceUpdatedNotificationSchema:vo,PromptArgumentSchema:Ro,PromptSchema:qt,PromptListChangedNotificationSchema:wo,TextContentSchema:qe,ImageContentSchema:$e,AudioContentSchema:At,ToolUseContentSchema:Dr,EmbeddedResourceSchema:Vr,ResourceLinkSchema:Hr,ContentBlockSchema:ut,PromptMessageSchema:xo,ToolAnnotationsSchema:jt,ToolListChangedNotificationSchema:Fr,ModelHintSchema:Jr,ModelPreferencesSchema:Br,ToolChoiceSchema:Wr,BooleanSchemaSchema:Gr,StringSchemaSchema:Kr,NumberSchemaSchema:Yr,UntitledSingleSelectEnumSchemaSchema:Qr,TitledSingleSelectEnumSchemaSchema:Xr,LegacyTitledEnumSchemaSchema:en,SingleSelectEnumSchemaSchema:tn,UntitledMultiSelectEnumSchemaSchema:on,TitledMultiSelectEnumSchemaSchema:rn,MultiSelectEnumSchemaSchema:nn,EnumSchemaSchema:sn,PrimitiveSchemaDefinitionSchema:an,ElicitRequestFormParamsSchema:Lt,ResourceTemplateReferenceSchema:Ut,PromptReferenceSchema:Zt,RootSchema:cn,ClientCapabilities2026Schema:ln,ServerCapabilities2026Schema:Po,RequestMetaEnvelopeSchema:To,ToolSchema:Dt,ToolResultContentSchema:un,SamplingMessageContentBlockSchema:ko,SamplingMessageSchema:Vt,ResultTypeSchema:$o,ResultMetaSchema:Eo,ResultSchema:dn,PaginatedResultSchema:ca,CallToolResultSchema:Io,ListToolsResultSchema:pn,ListPromptsResultSchema:hn,GetPromptResultSchema:mn,ListResourcesResultSchema:fn,ListResourceTemplatesResultSchema:gn,ReadResourceResultSchema:Sn,CompleteResultSchema:_n,CacheableResultSchema:la,DiscoverResultSchema:bn,CreateMessageRequestParamsSchema:pt,CreateMessageRequestSchema:yn,ListRootsRequestSchema:zn,CreateMessageResultSchema:vn,ListRootsResultSchema:Rn,ElicitResultSchema:wn,ElicitRequestURLParamsSchema:xn,ElicitRequestParamsSchema:Pn,ElicitRequestSchema:Tn,InputRequestSchema:kn,InputResponseSchema:$n,InputRequestsSchema:En,InputResponsesSchema:Cn,InputRequiredResultSchema:Ht,InputResponseRequestParamsSchema:ua,CallToolRequestSchema:pa,ListToolsRequestSchema:ha,ListPromptsRequestSchema:ma,GetPromptRequestSchema:fa,ListResourcesRequestSchema:ga,ListResourceTemplatesRequestSchema:Sa,ReadResourceRequestSchema:_a,CompleteRequestSchema:ba,DiscoverRequestSchema:ya,SubscriptionFilterSchema:Oo,SubscriptionsListenRequestSchema:za,SubscriptionsListenResultMetaSchema:va,SubscriptionsListenResultSchema:Mn,dispatchRequestSchemas:ht,dispatchResultSchemas:Ra,NotificationMetaSchema:Jt,SubscriptionsAcknowledgedNotificationSchema:No,CancelledNotificationParamsSchema:Mo,CancelledNotificationSchema:qo,notificationSchemas2026:Zl,JSONRPCResultResponseSchema:pe(dn),CallToolResultResponseSchema:pe(x([Io,Ht])),ListToolsResultResponseSchema:pe(pn),ListPromptsResultResponseSchema:pe(hn),GetPromptResultResponseSchema:pe(x([mn,Ht])),ListResourcesResultResponseSchema:pe(fn),ListResourceTemplatesResultResponseSchema:pe(gn),ReadResourceResultResponseSchema:pe(x([Sn,Ht])),CompleteResultResponseSchema:pe(_n),DiscoverResultResponseSchema:pe(bn),SubscriptionsListenResultResponseSchema:pe(Mn)}}var Ly;function It(){return Ly??=jy()}var Uy=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Zy(e){return Uy.includes(e)}var Qm=Symbol("modelcontextprotocol.resultCacheHintFallback");function Dy(e){return e[Qm]}function qS(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function AS(e){return e==="public"||e==="private"}var j=(function(e){return e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.ResourceNotFound=-32002]="ResourceNotFound",e[e.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",e[e.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired",e})({}),ie=class jS extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return Pe(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Pe(this,t)}constructor(t,o,r){super(o),this.code=t,this.data=r,this.name="ProtocolError",bo(this,new.target)}static fromError(t,o,r){if(t===j.UrlElicitationRequired&&r){let n=r;if(n.elicitations)return new US(n.elicitations,o)}if(t===j.UnsupportedProtocolVersion&&r){let n=r;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new ZS({supported:n.supported,requested:n.requested},o)}if(t===j.InvalidParams||t===j.ResourceNotFound){let n=r;if(typeof n?.uri=="string"&&(t===j.ResourceNotFound||Object.keys(n).length===1))return new LS(n.uri,o)}if(t===j.MissingRequiredClientCapability&&r){let n=r;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities=="object"&&!Array.isArray(n.requiredCapabilities))return new DS({requiredCapabilities:n.requiredCapabilities},o)}return new jS(t,o,r)}},LS=class extends ie{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(j.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},US=class extends ie{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(j.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},ZS=class extends ie{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(j.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},DS=class extends ie{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(j.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Vy=0,Hy="private",Fy=["tools/call","prompts/get","resources/read"];function Jy(e,t){let o=t.resultType;if(o===void 0)return{...t,resultType:"complete"};if(o==="complete"||Fy.includes(e))return t;throw new ie(j.InternalError,`Handler for ${e} returned resultType '${String(o)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function By(e,t){let o=Dy(t);if(t.resultType!=="complete"||!Zy(e))return o===void 0?t:Qy(t);let r=t,n=qS(r.ttlMs)?r.ttlMs:Ky(o),s=AS(r.cacheScope)?r.cacheScope:Yy(o),i={...r,ttlMs:n,cacheScope:s};return delete i[Qm],i}function Wy(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Gy(e,t){if(t===void 0)return e;let o=e._meta;return o===void 0?{...e,_meta:{[Tt]:t}}:!Wy(o)||o[Tt]!==void 0?e:{...e,_meta:{...o,[Tt]:t}}}function Ky(e){return e!==void 0&&qS(e.ttlMs)?e.ttlMs:Vy}function Yy(e){return e!==void 0&&AS(e.cacheScope)?e.cacheScope:Hy}function Qy(e){let t={...e};return delete t[Qm],t}var Xy=["elicitation/create","sampling/createMessage","roots/list"],jl;function VS(){if(jl)return jl;let e=It();return jl={request:{"elicitation/create":p({method:g("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":p({method:g("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":p({method:g("roots/list"),params:E({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},jl}function HS(e){return Xy.includes(e)}function Lm(e){return HS(e)?VS().request[e]:void 0}function ez(e){return HS(e)?VS().response[e]:void 0}var Xm={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},FS={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function JS(e){return Object.prototype.hasOwnProperty.call(Xm,e)}function BS(e){return Object.prototype.hasOwnProperty.call(FS,e)}function tz(e){return Object.prototype.hasOwnProperty.call(Xm,e)}function oz(e){return JS(e)?It().dispatchRequestSchemas[e]:void 0}function rz(e){return tz(e)?It().dispatchResultSchemas[e]:void 0}function nz(e){return BS(e)?It().notificationSchemas2026[e]:void 0}var JR=Object.keys(Xm),BR=Object.keys(FS);function oa(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ea(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let o=e.safeParse(t);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}var sz={ok:!1,reason:"not-in-era"},iz=[ro,no];function az(e,t){let o=t,r=!1,n=()=>(r||(o={...o},r=!0),o),s=t.tools;e==="tools/list"&&Array.isArray(s)&&s.some(c=>oa(c)&&"execution"in c)&&(n().tools=s.map(c=>{if(!oa(c)||!("execution"in c))return c;let l={...c};return delete l.execution,l}));let i=t.capabilities;if(oa(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return o}var ef={era:"2026-07-28",hasRequestMethod:JS,hasNotificationMethod:BS,hasInputRequestMethod:e=>Lm(e)!==void 0,validateRequest:(e,t)=>ea(oz(e),t),validateResult:(e,t)=>ea(rz(e),t),validateNotification:(e,t)=>ea(nz(e),t),validateInputRequest:(e,t)=>ea(Lm(e),t),validateInputResponse:(e,t)=>ea(ez(e),t),samplingResultVariant:()=>sz,outboundEnvelope(e){return{[ro]:e.protocolVersion,[hr]:e.clientInfo,[no]:e.clientCapabilities,...e.logLevel!==void 0&&{[mr]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let r of iz)r in e||t.push({key:r,problem:"missing"});let o=It().RequestMetaEnvelopeSchema.safeParse(e);if(!o.success)for(let r of o.error.issues){let n=r.path.map(String),s=n.length>0?n.join("."):"_meta";n.length===1&&t.some(i=>i.key===s&&i.problem==="missing")||t.push({key:s,problem:r.message})}return t},projectCallToolResult:e=>kS(e),inputRequestSchema:Lm,decodeResult(e,t){if(!oa(t))return{kind:"invalid",error:new X(se.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let o=t.resultType;if(o===void 0)return{kind:"invalid",error:new X(se.InvalidResult,`Invalid result for ${e}: missing required resultType \u2014 servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if(typeof o!="string")return{kind:"invalid",error:new X(se.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:o})};if(o==="input_required"){let i=t.inputRequests,c=oa(i)?i:{},l=t.requestState,d=t._meta===void 0?void 0:It().ResultMetaSchema.safeParse(t._meta),m=d?.success?d.data:void 0;return Object.keys(c).length===0&&typeof l!="string"?{kind:"invalid",error:new X(se.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:c,...typeof l=="string"&&{requestState:l},...m!==void 0&&{_meta:m}}}if(o!=="complete")return{kind:"invalid",error:new X(se.UnsupportedResultType,`Unsupported result type '${o}' for ${e}`,{resultType:o,method:e})};let r=cz(),n=Object.hasOwn(r,e)?r[e]:void 0;if(n!==void 0){let i=n.safeParse(t);if(!i.success)return{kind:"invalid",error:new X(se.InvalidResult,`Invalid result for ${e}: ${i.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,o){return Gy(By(e,Jy(e,az(e,t))),o)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=It().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(o=>o.message).join("; ")}`}},Ll;function cz(){if(Ll)return Ll;let e=It();return Ll={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},Ll}var tf="2026-07-28";function na(e){return e!==void 0&&TS(e)?ef:Ym}function bS(e){return e.revision!==void 0?na(e.revision).era:e.era==="modern"?ef.era:Ym.era}function Um(e){return WS.some(t=>t.hasRequestMethod(e))}function Zm(e){return WS.some(t=>t.hasNotificationMethod(e))}function yS(e){return e==="tasks/get"||e==="tasks/cancel"}var WS=[Ym,ef],lz=hf({AnnotationsSchema:()=>He,AudioContentSchema:()=>ho,BaseMetadataSchema:()=>De,BaseRequestParamsSchema:()=>oe,BlobResourceContentsSchema:()=>kr,BooleanSchemaSchema:()=>Ir,CallToolRequestParamsSchema:()=>ci,CallToolRequestSchema:()=>li,CallToolResultSchema:()=>Ct,CancelTaskRequestSchema:()=>Pl,CancelTaskResultSchema:()=>Tl,CancelledNotificationParamsSchema:()=>gs,CancelledNotificationSchema:()=>zr,ClientCapabilitiesSchema:()=>_s,ClientNotificationSchema:()=>$l,ClientRequestSchema:()=>kl,ClientResultSchema:()=>El,ClientTasksCapabilitySchema:()=>hl,CompatibilityCallToolResultSchema:()=>fl,CompleteRequestParamsSchema:()=>qi,CompleteRequestSchema:()=>Ai,CompleteResultSchema:()=>ji,ContentBlockSchema:()=>Fe,CreateMessageRequestParamsSchema:()=>zi,CreateMessageRequestSchema:()=>vi,CreateMessageResultSchema:()=>Ri,CreateMessageResultWithToolsSchema:()=>wi,CreateTaskResultSchema:()=>_l,CursorSchema:()=>gr,DiscoverRequestSchema:()=>Rs,DiscoverResultSchema:()=>Rr,ElicitRequestFormParamsSchema:()=>_o,ElicitRequestParamsSchema:()=>$i,ElicitRequestSchema:()=>Ei,ElicitRequestURLParamsSchema:()=>ki,ElicitResultSchema:()=>Oi,ElicitationCompleteNotificationParamsSchema:()=>Ci,ElicitationCompleteNotificationSchema:()=>Ii,EmbeddedResourceSchema:()=>mo,EmptyResultSchema:()=>$t,EnumSchemaSchema:()=>Ti,GetPromptRequestParamsSchema:()=>Qs,GetPromptRequestSchema:()=>Xs,GetPromptResultSchema:()=>oi,GetTaskPayloadRequestSchema:()=>vl,GetTaskPayloadResultSchema:()=>Rl,GetTaskRequestSchema:()=>yl,GetTaskResultSchema:()=>zl,IconSchema:()=>Ss,IconsSchema:()=>ot,ImageContentSchema:()=>po,ImplementationSchema:()=>Ve,InitializeRequestParamsSchema:()=>bs,InitializeRequestSchema:()=>ys,InitializeResultSchema:()=>zs,InitializedNotificationSchema:()=>vs,JSONArraySchema:()=>dl,JSONObjectSchema:()=>W,JSONRPCErrorResponseSchema:()=>ao,JSONRPCMessageSchema:()=>co,JSONRPCNotificationSchema:()=>yr,JSONRPCRequestSchema:()=>br,JSONRPCResponseSchema:()=>pl,JSONRPCResultResponseSchema:()=>io,JSONValueSchema:()=>tt,LegacyTitledEnumSchemaSchema:()=>Mr,ListChangedOptionsBaseSchema:()=>gl,ListPromptsRequestSchema:()=>Ks,ListPromptsResultSchema:()=>Ys,ListResourceTemplatesRequestSchema:()=>Es,ListResourceTemplatesResultSchema:()=>Cs,ListResourcesRequestSchema:()=>ks,ListResourcesResultSchema:()=>$s,ListRootsRequestSchema:()=>Ui,ListRootsResultSchema:()=>Zi,ListTasksRequestSchema:()=>wl,ListTasksResultSchema:()=>xl,ListToolsRequestSchema:()=>ii,ListToolsResultSchema:()=>ai,LoggingLevelSchema:()=>Cr,LoggingMessageNotificationParamsSchema:()=>hi,LoggingMessageNotificationSchema:()=>mi,ModelHintSchema:()=>fi,ModelPreferencesSchema:()=>gi,MultiSelectEnumSchemaSchema:()=>Pi,NotificationSchema:()=>ne,NotificationsParamsSchema:()=>ue,NumberSchemaSchema:()=>So,PaginatedRequestParamsSchema:()=>Ps,PaginatedRequestSchema:()=>rt,PaginatedResultSchema:()=>nt,PingRequestSchema:()=>wr,PrimitiveSchemaDefinitionSchema:()=>jr,ProgressNotificationParamsSchema:()=>xs,ProgressNotificationSchema:()=>xr,ProgressSchema:()=>ws,ProgressTokenSchema:()=>fr,PromptArgumentSchema:()=>Ws,PromptListChangedNotificationSchema:()=>ri,PromptMessageSchema:()=>ti,PromptReferenceSchema:()=>Mi,PromptSchema:()=>Gs,ReadResourceRequestParamsSchema:()=>Is,ReadResourceRequestSchema:()=>Os,ReadResourceResultSchema:()=>Ns,RelatedTaskMetadataSchema:()=>fs,RequestIdSchema:()=>Ne,RequestMetaSchema:()=>Sr,RequestSchema:()=>G,ResourceContentsSchema:()=>Pr,ResourceLinkSchema:()=>fo,ResourceListChangedNotificationSchema:()=>Ms,ResourceRequestParamsSchema:()=>lo,ResourceSchema:()=>$r,ResourceTemplateReferenceSchema:()=>Ni,ResourceTemplateSchema:()=>Ts,ResourceUpdatedNotificationParamsSchema:()=>Js,ResourceUpdatedNotificationSchema:()=>Bs,ResultMetaObjectSchema:()=>_r,ResultSchema:()=>K,RoleSchema:()=>st,RootSchema:()=>Li,RootsListChangedNotificationSchema:()=>Di,SamplingContentSchema:()=>bi,SamplingMessageContentBlockSchema:()=>Pt,SamplingMessageSchema:()=>yi,ServerCapabilitiesSchema:()=>vr,ServerNotificationSchema:()=>Il,ServerRequestSchema:()=>Cl,ServerResultSchema:()=>Ol,ServerTasksCapabilitySchema:()=>ml,SetLevelRequestParamsSchema:()=>di,SetLevelRequestSchema:()=>pi,SingleSelectEnumSchemaSchema:()=>xi,StringSchemaSchema:()=>go,SubscribeRequestParamsSchema:()=>qs,SubscribeRequestSchema:()=>As,SubscriptionFilterSchema:()=>Er,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Ds,SubscriptionsAcknowledgedNotificationSchema:()=>Vs,SubscriptionsListenRequestParamsSchema:()=>Us,SubscriptionsListenRequestSchema:()=>Zs,SubscriptionsListenResultMetaSchema:()=>Hs,SubscriptionsListenResultSchema:()=>Fs,TaskAugmentedRequestParamsSchema:()=>kt,TaskCreationParamsSchema:()=>Sl,TaskMetadataSchema:()=>ms,TaskSchema:()=>it,TaskStatusNotificationParamsSchema:()=>Hi,TaskStatusNotificationSchema:()=>bl,TaskStatusSchema:()=>Vi,TextContentSchema:()=>uo,TextResourceContentsSchema:()=>Tr,TitledMultiSelectEnumSchemaSchema:()=>Ar,TitledSingleSelectEnumSchemaSchema:()=>Nr,ToolAnnotationsSchema:()=>ni,ToolChoiceSchema:()=>Si,ToolExecutionSchema:()=>si,ToolListChangedNotificationSchema:()=>ui,ToolResultContentSchema:()=>_i,ToolSchema:()=>Et,ToolUseContentSchema:()=>ei,UnsubscribeRequestParamsSchema:()=>js,UnsubscribeRequestSchema:()=>Ls,UntitledMultiSelectEnumSchemaSchema:()=>qr,UntitledSingleSelectEnumSchemaSchema:()=>Or});var GS=e=>br.safeParse(e).success,KS=e=>yr.safeParse(e).success,Jm=e=>io.safeParse(e).success,YS=e=>ao.safeParse(e).success;var ra=-32020,WR=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32e3],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[j.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[ra,j.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[j.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope \u2014 and a missing envelope on a request whose protocol-version header names a modern revision \u2014 is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[j.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision\u2019s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[j.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[ra],conformance:["http-header-validation"],rationale:"SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half \u2014 including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[j.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced \u2014 pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[ra],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool\u2019s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],GR={[j.ParseError]:400,[j.InvalidRequest]:400,[j.MethodNotFound]:404,[j.UnsupportedProtocolVersion]:400,[j.MissingRequiredClientCapability]:400,[ra]:400};function of(e,t){return os(e,t)}function ta(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function Bm(e){if(e==null)return!1;let t=typeof e;return t!=="object"&&t!=="function"||!("~standard"in e)?!1:typeof e["~standard"]?.validate=="function"}var zS=!1,Wm="draft-2020-12";function uz(e,t="input"){let o=e["~standard"],r;if(o.jsonSchema)r=o.jsonSchema[t]({target:Wm});else if(o.vendor==="zod"){if(!("_zod"in e))throw new Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");zS||(zS=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=to(e,{target:Wm,io:t})}else throw new Error(`Schema library "${o.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output")return r.type!==void 0?r:QS(r)?{type:"object",...r}:r;if(r.type!==void 0&&r.type!=="object")throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...r}}function QS(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(let t of["oneOf","anyOf","allOf"]){let o=e[t];if(Array.isArray(o)&&o.length>0)return o.every(r=>r!==null&&typeof r=="object"&&(r.type==="object"||QS(r)))}return!1}function dz(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function Dm(e,t){let o=await e["~standard"].validate(t);return o.issues&&o.issues.length>0?{success:!1,error:o.issues.map(r=>dz(r)).join(", ")}:{success:!0,data:o.value}}function pz(e){let t=to(e,{target:Wm,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var hz=/\\\.\\d\{(\d+)\}/;function mz(e){let t=hz.exec(e),o=[void 0,-1,0];return t&&o.push(Number(t[1])),[!1,!0].flatMap(r=>[!1,!0].flatMap(n=>o.map(s=>xe.datetime({local:r,offset:n,precision:s}))))}function fz(e,t){let o;switch(e){case"email":o=[Lc()];break;case"uri":o=[cr()];break;case"date":o=[xe.date()];break;case"date-time":o=mz(t);break}return new Set(o.map(r=>pz(r)).filter(r=>r!==void 0))}function gz(e,t,o){return o!=="zod"?!0:fz(e,t).has(t)}function sa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Sz(e){try{return uz(e,"input")}catch(t){let o=t instanceof Error?t.message:String(t);throw new ie(j.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${o}`)}}var _z=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function rf(e){return _z.has(e)||e.startsWith("x-")}var bz=new Set(["$schema",...Object.keys(_o.shape.requestedSchema.shape)]),vS={string:ta([go,Or,Nr,Mr]),number:ta([So]),integer:ta([So]),boolean:ta([Ir]),array:ta([qr,Ar])},yz=new Set(go.shape.format.unwrap().options);function zz(e,t,o,r){if(!sa(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(vS,e.type)?vS[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,c]of Object.entries(e))n.has(i)||rf(i)?s[i]=c:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?yz.has(e.format)?(typeof c!="string"||!gz(e.format,c,o))&&r.push(`${t}.${i}`):s[i]=c:r.push(`${t}.${i}`);return s}function vz(e,t){let o={},r=[];for(let[n,s]of Object.entries(e))n==="properties"&&sa(s)?o[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,zz(c,`properties.${i}`,t,r)])):bz.has(n)?o[n]=s:rf(n)||r.push(n);if(r.length>0)throw new ie(j.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(", ")}`);return o}function Rz(e,t){if(!sa(e.properties))return t;let o=Object.entries(e.properties).filter(([,r])=>!of(jr,r).success).map(([r])=>`properties.${r}`);return o.length>0?o.join(", "):t}function Gm(e,t,o=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((r,n)=>Gm(r,t[n],`${o}[${n}]`)):!sa(e)||!sa(t)?[]:Object.entries(e).flatMap(([r,n])=>{let s=o?`${o}.${r}`:r;return Object.prototype.hasOwnProperty.call(t,r)?Gm(n,t[r],s):rf(r)?[]:[s]})}function wz(e){if(!Bm(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,o=vz(Sz(e.requestedSchema),t),r=of(_o.shape.requestedSchema,o);if(!r.success)throw new ie(j.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Rz(o,r.error.message)}`);let n=Gm(o,r.data);if(n.length>0)throw new ie(j.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(r.data.required??[]).filter(i=>!Object.prototype.hasOwnProperty.call(r.data.properties,i));if(s.length>0)throw new ie(j.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:r.data}}function xz(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,o=typeof e.requestState=="string";if(!t&&!o)throw new TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}var KR=Object.assign(xz,{elicit(e){try{return{method:"elicitation/create",params:wz(e)}}catch(t){throw t instanceof ie?new TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});var Pz=["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"],Tz={IdJagTokenExchangeResponseSchema:Gi,OAuthClientInformationFullSchema:Xi,OAuthClientInformationSchema:Qi,OAuthClientMetadataSchema:Yi,OAuthClientRegistrationErrorSchema:Nl,OAuthErrorResponseSchema:Ki,OAuthMetadataSchema:Lr,OAuthProtectedResourceMetadataSchema:Fi,OAuthTokenRevocationRequestSchema:Ml,OAuthTokensSchema:Wi,OpenIdProviderDiscoveryMetadataSchema:Bi,OpenIdProviderMetadataSchema:Ji},XS={},e_={};function t_(e,t){let o=e.slice(0,-6);XS[o]=t,e_[o]=r=>t.safeParse(r).success}for(let e of Pz)t_(e,lz[e]);for(let[e,t]of Object.entries(Tz))t_(e,t);var kz=Object.freeze(XS),$z=Object.freeze(e_);function Ez(e){switch(e){case"initialize":case"notifications/initialized":return na(void 0);case"server/discover":return na(tf);default:return}}var o_=6e4,Cz=[ro,hr,no,mr],Iz=["inputResponses","requestState"];function RS(e,t){let o=e.params;if(!Vm(o))return{message:e,lifted:{}};let r=o._meta,n=Vm(r)?Cz.filter(l=>l in r):[],s=t==="request"?Iz.filter(l=>l in o):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...o};if(n.length>0&&Vm(r)){let l={},d={...r};for(let m of n)l[m]=r[m],delete d[m];i.envelope=l,Object.keys(d).length>0?c._meta=d:delete c._meta}for(let l of s)l==="inputResponses"&&(i.inputResponses=c[l]),l==="requestState"&&(i.requestState=c[l]),delete c[l];return{message:{...e,params:c},lifted:i}}function wS(e,t){let o=e.validateResult(t,void 0);if(!(!o.ok&&o.reason==="not-in-era"))return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(r){let n=e.validateResult(t,r);return n.ok?{value:n.value}:{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function r_(e){return()=>e}var Oz=r_(void 0),Nz,nf=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{Nz=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??cl,this.setNotificationHandler("notifications/cancelled",t=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",t=>{this._onprogress(t)}),this.setRequestHandler("ping",t=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let o=e.params??{};return{...e,params:{...o,_meta:{...t,...o._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new X(se.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,o,r,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:o,resetTimeoutOnProgress:n,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let o=Date.now()-t.startTime;if(t.maxTotalTimeout&&o>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new X(se.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:o});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let o=this.transport?.onerror;this._transport.onerror=n=>{o?.(n),this._onerror(n)};let r=this._transport?.onmessage;this._transport.onmessage=(n,s)=>{r?.(n,s),Jm(n)||YS(n)?this._onresponse(n):GS(n)?this._onrequest(n,s):KS(n)?this._onnotification(n,s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(n)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let r of this._timeoutInfo.values())clearTimeout(r.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let o=new X(se.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let r of e.values())r(o);for(let r of t.values())r.abort(o)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:o}=RS(e,"notification"),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=bS(t.classification);if(i!==r.era){this._onerror(new Error(`Era mismatch on inbound notification '${o.method}': classified as ${i} but this instance serves ${r.era}`));return}}if(Zm(o.method)&&!r.hasNotificationMethod(o.method))return;let n=this._notificationHandlers.get(o.method),s=this.fallbackNotificationHandler;n===void 0&&s===void 0||Promise.resolve().then(()=>n===void 0?s(o):n(o,r)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,t){let{message:o,lifted:r}=RS(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(new Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let s=this._transport,i=($,C,q)=>{let J={jsonrpc:"2.0",id:o.id,error:{code:$,message:C,...q!==void 0&&{data:q}}};s?.send(J).catch(L=>this._onerror(new Error(`Failed to send an error response: ${L}`)))};if(t?.classification!==void 0){let $=bS(t.classification);if($!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${o.method}': classified as ${$} but this instance serves ${n.era}`));let C=t.classification.revision??$;i(j.UnsupportedProtocolVersion,`Unsupported protocol version: ${C}`,{supported:this._supportedProtocolVersions,requested:C});return}}if(Um(o.method)&&!n.hasRequestMethod(o.method)&&!(yS(o.method)&&this._customSchemaRequestMethods.has(o.method))){i(j.MethodNotFound,"Method not found");return}let c=this._requestHandlers.get(o.method)??this.fallbackRequestHandler;if(c===void 0){i(j.MethodNotFound,"Method not found");return}let l=n.checkInboundEnvelope(r);if(l!==void 0){i(j.InvalidParams,l);return}let d=($,C)=>this._notificationViaCodec(this._resolveOutboundCodec($.method),$,{...C,relatedRequestId:o.id}),m=($,C,q)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec($.method),$,C,{...q,relatedRequestId:o.id}),S=new AbortController;this._requestHandlerAbortControllers.set(o.id,S);let _=r.inputResponses===void 0?void 0:Mz(r.inputResponses),b={sessionId:s?.sessionId,mcpReq:{id:o.id,method:o.method,_meta:o.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},..._!==void 0&&{inputResponses:_.accepted},..._!==void 0&&_.droppedKeys.length>0&&{droppedInputResponseKeys:_.droppedKeys},requestState:r.requestState===void 0?Oz:r_(r.requestState),signal:S.signal,send:(($,C,q)=>{let J=this._resolveOutboundCodec($.method);if(this._assertOutboundRequestInEra(J,$.method),Bm(C))return m($,C,q);let L=wS(J,$.method);if(L===void 0)throw new TypeError(`'${$.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return m($,L,C)}),notify:d},http:t?.authInfo?{authInfo:t.authInfo}:void 0},P=this.buildContext(b,t);Promise.resolve().then(()=>c(o,P)).then(async $=>{if(S.signal.aborted)return;let C;try{C=n.encodeResult(o.method,$,this._outboundServerInfo())}catch(J){this._onerror(new Error(`Failed to encode result for ${o.method}: ${J}`)),i(j.InternalError,"Internal error");return}let q={result:C,jsonrpc:"2.0",id:o.id};await s?.send(q)},async $=>{if(S.signal.aborted)return;let C=Number.isSafeInteger($.code)?$.code:j.InternalError,q={jsonrpc:"2.0",id:o.id,error:{code:n.encodeErrorCode(C),message:$.message??"Internal error",...$.data!==void 0&&{data:$.data}}};await s?.send(q)}).catch($=>this._onerror(new Error(`Failed to send response: ${$}`))).finally(()=>{this._requestHandlerAbortControllers.get(o.id)===S&&this._requestHandlerAbortControllers.delete(o.id)})}_onprogress(e){let{progressToken:t,...o}=e.params,r=Number(t),n=this._progressHandlers.get(r);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&s&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(c){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),s(c);return}n(o)}_onresponse(e){let t=Number(e.id),o=this._responseHandlers.get(t);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Jm(e)?o(e):o(ie.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,o){let r=this._resolveOutboundCodec(e.method);if(Bm(t))return yS(e.method)||this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,o);this._assertOutboundRequestInEra(r,e.method);let n=wS(r,e.method);if(n===void 0)throw new TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,n,t)}_negotiatedWireCodec(){return na(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Ez(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Um(t)&&!e.hasRequestMethod(t))throw new X(se.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,o){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,o)}_requestWithSchemaViaCodec(e,t,o,r){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c}=r??{},l=Date.now(),d,m;return new Promise((S,_)=>{let b=F=>{_(F)};if(!this._transport){b(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(F){b(F);return}if(r?.signal?.aborted){let F=r.signal.reason;throw F instanceof X?F:new X(se.RequestTimeout,String(F))}let P=e.era===tf&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,$=this._requestMessageId++;m=$;let C={...t,jsonrpc:"2.0",id:$};r?.onprogress&&(this._progressHandlers.set($,r.onprogress),C.params={...t.params,_meta:{...t.params?._meta,progressToken:$}});let q=this._envelopeOutbound(C),J=!1,L=F=>{J||(this._progressHandlers.delete($),P===void 0?t.method!=="initialize"&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:$,reason:String(F)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(ee=>this._onerror(new Error(`Failed to send cancellation: ${ee}`))):P.abort(),_(F instanceof X?F:new X(se.RequestTimeout,String(F))))};this._responseHandlers.set($,F=>{if(r?.signal?.aborted)return;if(J=!0,F instanceof Error)return _(F);let ee;try{ee=e.decodeResult(t.method,F.result)}catch(de){return _(de instanceof Error?de:new Error(String(de)))}if(ee.kind==="invalid")return _(ee.error);if(ee.kind==="input_required"){if(r?.allowInputRequired===!0)return S(qz(ee));let de={codec:e,request:t,resultSchema:o,options:r,flowStartedAt:l,retry:(at,Nt)=>this._requestWithSchemaViaCodec(e,at===void 0?{method:t.method}:{method:t.method,params:at},o,Nt)};return S(this._resolveNonCompleteResult(ee,de))}let Be=ee.result;Dm(o,Be).then(de=>{de.success?S(de.data):_(new X(se.InvalidResult,`Invalid result for ${t.method}: ${de.error}`))},_)}),d=()=>L(r?.signal?.reason),r?.signal?.addEventListener("abort",d,{once:!0});let U=r?.timeout??o_,B=()=>L(new X(se.RequestTimeout,"Request timed out",{timeout:U}));this._setupTimeout($,U,r?.maxTotalTimeout,B,r?.resetTimeoutOnProgress??!1),this._transport.send(q,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c,requestSignal:P?.signal}).catch(F=>{this._progressHandlers.delete($),_(F)})}).finally(()=>{d&&r?.signal?.removeEventListener("abort",d),m!==void 0&&(this._responseHandlers.delete(m),this._cleanupTimeout(m))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,o){if(!this._transport)throw new X(se.NotConnected,"Not connected");if(Zm(t.method)&&!e.hasNotificationMethod(t.method))throw new X(se.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&o?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,o).catch(n=>this._onerror(n))});return}await this._transport.send(r,o)}setRequestHandler(e,t,o){this.assertRequestHandlerCapability(e);let r;if(typeof t=="function"){if(!Um(e))throw new TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,s)=>{let i=this._negotiatedWireCodec(),c=i.validateRequest(e,n);if(!c.ok&&c.reason==="not-in-era"&&(c=i.validateInputRequest(e,n)),!c.ok)throw c.reason==="not-in-era"?new ie(j.InternalError,`No wire schema for ${e} in the resolved era`):new Error(c.message);return Promise.resolve(t(c.value,s))}}else if(o)r=async(n,s)=>{let i=await Dm(t.params,{...n.params});if(!i.success)throw new ie(j.InvalidParams,`Invalid params for ${e}: ${i.error}`);return o(i.data,s)};else throw new TypeError("setRequestHandler: handler is required");typeof t=="function"?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,o){if(typeof t=="function"){if(!Zm(e))throw new TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(r,n)=>{let s=n.validateNotification(e,r);if(!s.ok)throw s.reason==="not-in-era"?new ie(j.InternalError,`No wire schema for ${e} in the resolved era`):new Error(s.message);return Promise.resolve(t(s.value))});return}if(!o)throw new TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async r=>{let n=await Dm(t.params,{...r.params});if(!n.success)throw new ie(j.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await o(n.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Vm(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function xS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Mz(e){let t={},o=[];if(!xS(e))return{accepted:t,droppedKeys:o};for(let[r,n]of Object.entries(e)){if(!xS(n)||"method"in n||"result"in n){o.push(r);continue}t[r]=n}return{accepted:t,droppedKeys:o}}function qz(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var Az=pf((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,o=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(c){if(!c)throw new TypeError("argument string is required");var l=typeof c=="object"?s(c):c;if(typeof l!="string")throw new TypeError("argument string is required to be a string");var d=l.indexOf(";"),m=d!==-1?l.slice(0,d).trim():l.trim();if(!r.test(m))throw new TypeError("invalid media type");var S=new i(m.toLowerCase());if(d!==-1){var _,b,P;for(t.lastIndex=d;b=t.exec(l);){if(b.index!==d)throw new TypeError("invalid parameter format");d+=b[0].length,_=b[1].toLowerCase(),P=b[2],P.charCodeAt(0)===34&&(P=P.slice(1,-1),P.indexOf("\\")!==-1&&(P=P.replace(o,"$1"))),S.parameters[_]=P}if(d!==l.length)throw new TypeError("invalid parameter format")}return S}function s(c){var l;if(typeof c.getHeader=="function"?l=c.getHeader("content-type"):typeof c.headers=="object"&&(l=c.headers&&c.headers["content-type"]),typeof l!="string")throw new TypeError("content-type header is missing from object");return l}function i(c){this.parameters=Object.create(null),this.type=c}})),YR=mf(Az(),1);var jz=10*1024*1024;var cw=typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker");var Lz=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Uz=[0,31,28,31,30,31,30,31,31,30,31,30,31],Zz=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,Dz=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,Vz=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Hz=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Fz=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Jz=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Bz=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Wz=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Gz=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Kz=e=>{if(e[0]==='"')return!1;let[t,o,...r]=e.split("@");return!t||!o||r.length!==0||t.length>64||o.length>253||t[0]==="."||t.endsWith(".")||t.includes("..")||!/^[a-z0-9.-]+$/i.test(o)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:o.split(".").every(n=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(n))},Yz=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Qz=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,Xz=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function Je(e){return e.test.bind(e)}var lw={date:n_,time:s_.bind(void 0,!1),"date-time":ov,duration:Xz,uri:sv,"uri-reference":Je(Vz),"uri-template":Je(Hz),url:Je(Fz),email:Kz,hostname:Je(Dz),ipv4:Je(Yz),ipv6:Je(Qz),regex:av,uuid:Je(Jz),"json-pointer":Je(Bz),"json-pointer-uri-fragment":Je(Wz),"relative-json-pointer":Je(Gz)};function ev(e){return e%4===0&&(e%100!==0||e%400===0)}function n_(e){let t=e.match(Lz);if(!t)return!1;let o=+t[1],r=+t[2],n=+t[3];return r>=1&&r<=12&&n>=1&&n<=(r==2&&ev(o)?29:Uz[r])}function s_(e,t){let o=t.match(Zz);if(!o)return!1;let r=+o[1],n=+o[2],s=+o[3],i=!!o[5];return(r<=23&&n<=59&&s<=59||r==23&&n==59&&s==60)&&(!e||i)}var tv=/t|\s/i;function ov(e){let t=e.split(tv);return t.length==2&&n_(t[0])&&s_(!0,t[1])}var rv=/\/|:/,nv=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function sv(e){return rv.test(e)&&nv.test(e)}var iv=/[^\\]\\Z/;function av(e){if(iv.test(e))return!1;try{return new RegExp(e,"u"),!0}catch{return!1}}var lv;lv=globalThis.crypto;var ia=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](e){return Pe(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Pe(this,e)}constructor(e){super(e),this.name=new.target.name,bo(this,new.target)}},rx=class extends ia{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.IssuerMismatchError"})}kind;expected;received;constructor(e,t,o){super(`Issuer mismatch in ${e==="metadata"?"authorization server metadata (RFC 8414 \xA73.3)":"authorization response (RFC 9207)"}: expected ${JSON.stringify(t)}, received ${JSON.stringify(o)}`),this.kind=e,this.expected=t,this.received=o}},nx=class extends ia{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.RegistrationRejectedError"})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},sx=class extends ia{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsecureTokenEndpointError"})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / *.localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},ix=class extends ia{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.AuthorizationServerMismatchError"})}constructor(e,t){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(e)} but this call resolved ${JSON.stringify(t)}; refusing to present them to a different authorization server`),this.recordedIssuer=e,this.currentIssuer=t}},ax=class extends ia{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsufficientScopeError"})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:""}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}};var cx=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](e){return Pe(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Pe(this,e)}constructor(e){super(e??"Unauthorized"),this.name="UnauthorizedError",bo(this,new.target)}};var lx=Symbol.for("mcp.authSeamEscape");var ux=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](e){return Pe(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Pe(this,e)}constructor(e,t,o){super(`SSE error: ${t}`),this.code=e,this.event=o,bo(this,new.target)}};var sf=class{_eventSlots=new Map;setHandler(t,o){let r=this._ensureEventSlot(t);r.onHandler&&o&&console.warn(`[MCP Apps] on${String(t)} handler replaced. Use addEventListener("${String(t)}", \u2026) to add multiple listeners without replacing.`),r.onHandler=o}getHandler(t){return this._eventSlots.get(t)?.onHandler}addEventListener(t,o){this._ensureEventSlot(t).listeners.push(o)}removeEventListener(t,o){let r=this._eventSlots.get(t);if(!r)return;let n=r.listeners.indexOf(o);n!==-1&&r.listeners.splice(n,1)}dispatch(t,o){let r=this._eventSlots.get(t);if(r){r.onHandler?.(o);for(let n of[...r.listeners])n(o)}}_ensureEventSlot(t){let o=this._eventSlots.get(t);return o||(o={listeners:[]},this._eventSlots.set(t,o)),o}},af=class{_methods=new Set;claim(t,o){if(this._methods.has(t))throw Error(`Handler for "${t}" already registered (via ${o}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(t)}replace(t){this._methods.add(t)}release(t){this._methods.delete(t)}has(t){return this._methods.has(t)}},i_=new Set;function a_(e,t){let[o,r]=t,n=o?.shape;if(typeof n?.method?.value!="string")return;let s=n.method.value,i=e==="request"?"setRequestHandler":"setNotificationHandler";i_.has(i)||(i_.add(i),console.warn(`[ext-apps] ${i}(Schema, handler) is deprecated; use ${i}("${s}", { params: Schema.shape.params }, handler).`));let c=r;return[s,{params:n.params},e==="request"?(l,d)=>c({method:s,params:l},uv(d)):l=>c({method:s,params:l})]}function uv(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var dv="2026-01-26";var pv="ui/notifications/tool-input-partial";var cf=class{eventTarget;eventSource;messageListener;constructor(t=window.parent,o){this.eventTarget=t,this.eventSource=o,this.messageListener=r=>{if(o&&r.source!==this.eventSource){console.debug("Ignoring message from unknown source",r);return}let n=co.safeParse(r.data);n.success?(console.debug("Parsed message",n.data),this.onmessage?.(n.data)):r.data?.jsonrpc!=="2.0"?console.debug("Ignoring non-JSON-RPC message",n.error.message,r):(console.error("Failed to parse message",n.error.message,r),this.onerror?.(Error("Invalid JSON-RPC message received: "+n.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(t,o){t.method!==pv&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},hv=u.union([u.literal("light"),u.literal("dark")]).describe("Color theme preference for the host environment."),aa=u.union([u.literal("inline"),u.literal("fullscreen"),u.literal("pip")]).describe("Display mode for UI presentation."),mv=u.union([u.literal("--color-background-primary"),u.literal("--color-background-secondary"),u.literal("--color-background-tertiary"),u.literal("--color-background-inverse"),u.literal("--color-background-ghost"),u.literal("--color-background-info"),u.literal("--color-background-danger"),u.literal("--color-background-success"),u.literal("--color-background-warning"),u.literal("--color-background-disabled"),u.literal("--color-text-primary"),u.literal("--color-text-secondary"),u.literal("--color-text-tertiary"),u.literal("--color-text-inverse"),u.literal("--color-text-ghost"),u.literal("--color-text-info"),u.literal("--color-text-danger"),u.literal("--color-text-success"),u.literal("--color-text-warning"),u.literal("--color-text-disabled"),u.literal("--color-border-primary"),u.literal("--color-border-secondary"),u.literal("--color-border-tertiary"),u.literal("--color-border-inverse"),u.literal("--color-border-ghost"),u.literal("--color-border-info"),u.literal("--color-border-danger"),u.literal("--color-border-success"),u.literal("--color-border-warning"),u.literal("--color-border-disabled"),u.literal("--color-ring-primary"),u.literal("--color-ring-secondary"),u.literal("--color-ring-inverse"),u.literal("--color-ring-info"),u.literal("--color-ring-danger"),u.literal("--color-ring-success"),u.literal("--color-ring-warning"),u.literal("--font-sans"),u.literal("--font-mono"),u.literal("--font-weight-normal"),u.literal("--font-weight-medium"),u.literal("--font-weight-semibold"),u.literal("--font-weight-bold"),u.literal("--font-text-xs-size"),u.literal("--font-text-sm-size"),u.literal("--font-text-md-size"),u.literal("--font-text-lg-size"),u.literal("--font-heading-xs-size"),u.literal("--font-heading-sm-size"),u.literal("--font-heading-md-size"),u.literal("--font-heading-lg-size"),u.literal("--font-heading-xl-size"),u.literal("--font-heading-2xl-size"),u.literal("--font-heading-3xl-size"),u.literal("--font-text-xs-line-height"),u.literal("--font-text-sm-line-height"),u.literal("--font-text-md-line-height"),u.literal("--font-text-lg-line-height"),u.literal("--font-heading-xs-line-height"),u.literal("--font-heading-sm-line-height"),u.literal("--font-heading-md-line-height"),u.literal("--font-heading-lg-line-height"),u.literal("--font-heading-xl-line-height"),u.literal("--font-heading-2xl-line-height"),u.literal("--font-heading-3xl-line-height"),u.literal("--border-radius-xs"),u.literal("--border-radius-sm"),u.literal("--border-radius-md"),u.literal("--border-radius-lg"),u.literal("--border-radius-xl"),u.literal("--border-radius-full"),u.literal("--border-width-regular"),u.literal("--shadow-hairline"),u.literal("--shadow-sm"),u.literal("--shadow-md"),u.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),fv=u.record(mv.describe(`Style variables for theming MCP apps.
66
66
 
67
67
  Individual style keys are optional - hosts may provide any subset of these values.
68
68
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
@@ -80,10 +80,10 @@ Individual style keys are optional - hosts may provide any subset of these value
80
80
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
81
81
 
82
82
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
83
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),wx=u.object({method:u.literal("ui/open-link"),params:u.object({url:u.string().describe("URL to open in the host's browser")})}),hv=u.object({isError:u.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),mv=u.object({isError:u.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),fv=u.object({isError:u.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),xx=u.object({method:u.literal("ui/notifications/sandbox-proxy-ready"),params:u.object({})}),lf=u.object({connectDomains:u.array(u.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
83
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Tx=u.object({method:u.literal("ui/open-link"),params:u.object({url:u.string().describe("URL to open in the host's browser")})}),gv=u.object({isError:u.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),Sv=u.object({isError:u.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),_v=u.object({isError:u.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),kx=u.object({method:u.literal("ui/notifications/sandbox-proxy-ready"),params:u.object({})}),lf=u.object({connectDomains:u.array(u.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
84
84
 
85
85
  - Maps to CSP \`connect-src\` directive
86
- - Empty or omitted \u2192 no network connections (secure default)`),resourceDomains:u.array(u.string()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted \u2192 no network resources (secure default)"),frameDomains:u.array(u.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted \u2192 no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:u.array(u.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted \u2192 only same origin allowed (`base-uri 'self'`)")}),uf=u.object({camera:u.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:u.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:u.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:u.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),Px=u.object({method:u.literal("ui/notifications/size-changed"),params:u.object({width:u.number().optional().describe("New width in pixels."),height:u.number().optional().describe("New height in pixels.")})}),gv=u.object({method:u.literal("ui/notifications/tool-input"),params:u.object({arguments:u.record(u.string(),u.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),Sv=u.object({method:u.literal("ui/notifications/tool-input-partial"),params:u.object({arguments:u.record(u.string(),u.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),_v=u.object({method:u.literal("ui/notifications/tool-cancelled"),params:u.object({reason:u.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),bv=u.object({fonts:u.string().optional()}),yv=u.object({variables:pv.optional().describe("CSS variables for theming the app."),css:bv.optional().describe("CSS blocks that apps can inject.")}),zv=u.object({method:u.literal("ui/resource-teardown"),params:u.object({})}),vv=u.record(u.string(),u.unknown()),c_=u.object({text:u.object({}).optional().describe("Host supports text content blocks."),image:u.object({}).optional().describe("Host supports image content blocks."),audio:u.object({}).optional().describe("Host supports audio content blocks."),resource:u.object({}).optional().describe("Host supports resource content blocks."),resourceLink:u.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:u.object({}).optional().describe("Host supports structured content.")}),Tx=u.object({method:u.literal("ui/notifications/request-teardown"),params:u.object({}).optional()}),Rv=u.object({experimental:u.record(u.string(),u.record(u.string(),u.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),openLinks:u.object({}).optional().describe("Host supports opening external URLs."),downloadFile:u.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:u.object({listChanged:u.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:u.object({listChanged:u.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:u.object({}).optional().describe("Host accepts log messages."),sandbox:u.object({permissions:uf.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:lf.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:c_.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:c_.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:u.object({tools:u.object({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),wv=u.object({experimental:u.record(u.string(),u.record(u.string(),u.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),tools:u.object({listChanged:u.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:u.array(aa).optional().describe("Display modes the app supports.")}),kx=u.object({method:u.literal("ui/notifications/initialized"),params:u.object({}).optional()}),Ex=u.object({csp:lf.optional().describe("Content Security Policy configuration for UI resources."),permissions:uf.optional().describe("Sandbox permissions requested by the UI resource."),domain:u.string().optional().describe(`Dedicated origin for view sandbox.
86
+ - Empty or omitted \u2192 no network connections (secure default)`),resourceDomains:u.array(u.string()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted \u2192 no network resources (secure default)"),frameDomains:u.array(u.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted \u2192 no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:u.array(u.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted \u2192 only same origin allowed (`base-uri 'self'`)")}),uf=u.object({camera:u.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:u.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:u.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:u.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),$x=u.object({method:u.literal("ui/notifications/size-changed"),params:u.object({width:u.number().optional().describe("New width in pixels."),height:u.number().optional().describe("New height in pixels.")})}),bv=u.object({method:u.literal("ui/notifications/tool-input"),params:u.object({arguments:u.record(u.string(),u.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),yv=u.object({method:u.literal("ui/notifications/tool-input-partial"),params:u.object({arguments:u.record(u.string(),u.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),zv=u.object({method:u.literal("ui/notifications/tool-cancelled"),params:u.object({reason:u.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),vv=u.object({fonts:u.string().optional()}),Rv=u.object({variables:fv.optional().describe("CSS variables for theming the app."),css:vv.optional().describe("CSS blocks that apps can inject.")}),wv=u.object({method:u.literal("ui/resource-teardown"),params:u.object({})}),xv=u.record(u.string(),u.unknown()),c_=u.object({text:u.object({}).optional().describe("Host supports text content blocks."),image:u.object({}).optional().describe("Host supports image content blocks."),audio:u.object({}).optional().describe("Host supports audio content blocks."),resource:u.object({}).optional().describe("Host supports resource content blocks."),resourceLink:u.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:u.object({}).optional().describe("Host supports structured content.")}),Ex=u.object({method:u.literal("ui/notifications/request-teardown"),params:u.object({}).optional()}),Pv=u.object({experimental:u.record(u.string(),u.record(u.string(),u.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),openLinks:u.object({}).optional().describe("Host supports opening external URLs."),downloadFile:u.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:u.object({listChanged:u.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:u.object({listChanged:u.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:u.object({}).optional().describe("Host accepts log messages."),sandbox:u.object({permissions:uf.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:lf.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:c_.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:c_.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:u.object({tools:u.object({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),Tv=u.object({experimental:u.record(u.string(),u.record(u.string(),u.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),tools:u.object({listChanged:u.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:u.array(aa).optional().describe("Display modes the app supports.")}),Cx=u.object({method:u.literal("ui/notifications/initialized"),params:u.object({}).optional()}),Ix=u.object({csp:lf.optional().describe("Content Security Policy configuration for UI resources."),permissions:uf.optional().describe("Sandbox permissions requested by the UI resource."),domain:u.string().optional().describe(`Dedicated origin for view sandbox.
87
87
 
88
88
  Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
89
89
 
@@ -97,11 +97,15 @@ Boolean requesting whether a visible border and background is provided by the ho
97
97
 
98
98
  - \`true\`: request visible border + background
99
99
  - \`false\`: request no visible border + background
100
- - omitted: host decides border`)}),$x=u.object({method:u.literal("ui/request-display-mode"),params:u.object({mode:aa.describe("The display mode being requested.")})}),xv=u.object({mode:aa.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),Pv=u.union([u.literal("model"),u.literal("app")]).describe("Tool visibility scope - who can access the tool."),Cx=u.object({resourceUri:u.string().optional(),visibility:u.array(Pv).optional().describe(`Who can access this tool. Default: ["model", "app"]
100
+ - omitted: host decides border`)}),Ox=u.object({method:u.literal("ui/request-display-mode"),params:u.object({mode:aa.describe("The display mode being requested.")})}),kv=u.object({mode:aa.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),$v=u.union([u.literal("model"),u.literal("app")]).describe("Tool visibility scope - who can access the tool."),Nx=u.object({resourceUri:u.string().optional(),visibility:u.array($v).optional().describe(`Who can access this tool. Default: ["model", "app"]
101
101
  - "model": Tool visible to and callable by the agent
102
- - "app": Tool callable by the app from this server only`),csp:u.never().optional(),permissions:u.never().optional()}),Ix=u.object({mimeTypes:u.array(u.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),Ox=u.object({method:u.literal("ui/download-file"),params:u.object({contents:u.array(u.union([ho,mo])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),Nx=u.object({method:u.literal("ui/message"),params:u.object({role:u.literal("user").describe('Message role, currently only "user" is supported.'),content:u.array(Fe).describe("Message content blocks (text, image, etc.).")})}),Mx=u.object({method:u.literal("ui/notifications/sandbox-resource-ready"),params:u.object({html:u.string().describe("HTML content to load into the inner iframe."),sandbox:u.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:lf.optional().describe("CSP configuration from resource metadata."),permissions:uf.optional().describe("Sandbox permissions from resource metadata.")})}),Tv=u.object({method:u.literal("ui/notifications/tool-result"),params:Ct.describe("Standard MCP tool execution result.")}),d_=u.object({toolInfo:u.object({id:Ne.optional().describe("JSON-RPC id of the tools/call request."),tool:$t.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:uv.optional().describe("Current color theme preference."),styles:yv.optional().describe("Style configuration for theming the app."),displayMode:aa.optional().describe("How the UI is currently displayed."),availableDisplayModes:u.array(aa).optional().describe("Display modes the host supports."),containerDimensions:u.union([u.object({height:u.number().describe("Fixed container height in pixels.")}),u.object({maxHeight:u.union([u.number(),u.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(u.union([u.object({width:u.number().describe("Fixed container width in pixels.")}),u.object({maxWidth:u.union([u.number(),u.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
103
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:u.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:u.string().optional().describe("User's timezone in IANA format."),userAgent:u.string().optional().describe("Host application identifier."),platform:u.union([u.literal("web"),u.literal("desktop"),u.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:u.object({touch:u.boolean().optional().describe("Whether the device supports touch input."),hover:u.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:u.object({top:u.number().describe("Top safe area inset in pixels."),right:u.number().describe("Right safe area inset in pixels."),bottom:u.number().describe("Bottom safe area inset in pixels."),left:u.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),kv=u.object({method:u.literal("ui/notifications/host-context-changed"),params:d_.describe("Partial context update containing only changed fields.")}),qx=u.object({method:u.literal("ui/update-model-context"),params:u.object({content:u.array(Fe).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:u.record(u.string(),u.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),Ax=u.object({method:u.literal("ui/initialize"),params:u.object({appInfo:Ve.describe("App identification (name and version)."),appCapabilities:wv.describe("Features and capabilities this app provides."),protocolVersion:u.string().describe("Protocol version this app supports.")})}),Ev=u.object({protocolVersion:u.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Ve.describe("Host application identification and version."),hostCapabilities:Rv.describe("Features and capabilities provided by the host."),hostContext:d_.describe("Rich context about the host environment.")}).passthrough(),$v={target:"draft-2020-12"};async function l_(e,t){let o=e["~standard"];if(o.jsonSchema)return o.jsonSchema[t]($v);throw Error(`Schema (vendor: ${o.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function u_(e,t,o=""){let r=await e["~standard"].validate(t);if(r.issues){let n=r.issues.map(s=>{let i=s.path?.map(c=>typeof c=="object"?c.key:c).join(".");return i?`${i}: ${s.message}`:s.message}).join("; ");throw Error(o+n)}return r.value}function Cv(e,t){let o={...e,...t};return t.experimental!==void 0&&(o.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(o.tools={...e.tools,...t.tools}),o}var Ul=class e extends nf{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new sf;_methods=new af;setRequestHandler=(...t)=>{let[o,...r]=a_("request",t)??t;this._methods.claim(o,"setRequestHandler"),super.setRequestHandler.call(this,o,...r)};setNotificationHandler=(...t)=>{let[o,...r]=a_("notification",t)??t;this._methods.claim(o,"setNotificationHandler"),super.setNotificationHandler.call(this,o,...r)};removeRequestHandler=t=>{this._methods.release(t),super.removeRequestHandler(t)};removeNotificationHandler=t=>{this._methods.release(t),super.removeNotificationHandler(t)};replaceRequestHandler=(t,...o)=>{this._methods.replace(t),super.setRequestHandler.call(this,t,...o)};_assertInitialized(t){if(this._initializedSent)return;let o=`[ext-apps] App.${t}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(o);console.warn(`${o}. This will throw in a future release.`)}eventSchemas={toolinput:gv,toolinputpartial:Sv,toolresult:Tv,toolcancelled:_v,hostcontextchanged:kv};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let o=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(o);console.warn(o)}setEventHandler(t,o){o&&this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.setHandler(t,o)}addEventListener(t,o){this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.addEventListener(t,o)}removeEventListener(t,o){this._events.removeEventListener(t,o)}_ensureEventSlot(t){if(this._registeredEvents.has(t))return;let o=this.eventSchemas[t];if(!o)throw Error(`Unknown event: ${String(t)}`);this.setNotificationHandler(o.shape.method.value,{params:o.shape.params},r=>{let n=r;t==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...n}),this._events.dispatch(t,n)}),this._registeredEvents.add(t)}getEventHandler(t){return this._events.getHandler(t)}warnIfRequestHandlerReplaced(t,o,r){o&&r&&console.warn(`[MCP Apps] ${t} handler replaced. Previous handler will no longer be called.`)}constructor(t,o={},r={autoResize:!0}){super(r),this._appInfo=t,this._appCapabilities=o,this.options=r,this._methods.replace("notifications/cancelled"),this._methods.replace("notifications/progress"),!r.allowUnsafeEval&&u.config({jitless:!0}),this.replaceRequestHandler("ping",n=>(console.log("Received ping:",n.params),{})),this.setEventHandler("hostcontextchanged",void 0)}buildContext(t){return t}registerAppCapabilities(t){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._appCapabilities=Cv(this._appCapabilities,t)}registerTool(t,o,r){if(this._registeredTools[t])throw Error(`Tool ${t} is already registered`);let n=this,s=()=>{n._initializedSent&&n._appCapabilities.tools?.listChanged&&n.sendToolListChanged()},i=o.inputSchema!==void 0,c={title:o.title,description:o.description,inputSchema:o.inputSchema,outputSchema:o.outputSchema,annotations:o.annotations,_meta:o._meta,enabled:!0,enable(){this.enabled=!0,s()},disable(){this.enabled=!1,s()},update(l){Object.assign(this,l),s()},remove(){n._registeredTools[t]===c&&(delete n._registeredTools[t],s())},handler:async(l,d)=>{if(!c.enabled)throw Error(`Tool ${t} is disabled`);let m;if(i){let S=c.inputSchema,_=S?await u_(S,l??{},`Invalid input for tool ${t}: `):l??{};m=await r(_,d)}else m=await r(d);return c.outputSchema&&!m.isError&&(m.structuredContent=await u_(c.outputSchema,m.structuredContent,`Invalid output for tool ${t}: `)),m}};return this._registeredTools[t]=c,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),s(),c}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(t,o)=>{let r=this._registeredTools[t.name];if(!r)throw Error(`Tool ${t.name} not found`);return r.handler(t.arguments,o)},this.onlisttools=async(t,o)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([r,n])=>n.enabled).map(async([r,n])=>{let s={name:r,title:n.title,description:n.description,inputSchema:n.inputSchema?await l_(n.inputSchema,"input"):{type:"object",properties:{}}};return n.outputSchema&&(s.outputSchema=await l_(n.outputSchema,"output")),n.annotations&&(s.annotations=n.annotations),n._meta&&(s._meta=n._meta),s}))}))}async sendToolListChanged(t={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:t})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(t){this.setEventHandler("toolinput",t)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(t){this.setEventHandler("toolinputpartial",t)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(t){this.setEventHandler("toolresult",t)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(t){this.setEventHandler("toolcancelled",t)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(t){this.setEventHandler("hostcontextchanged",t)}_onteardown;get onteardown(){return this._onteardown}set onteardown(t){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,t),this._onteardown=t,this.replaceRequestHandler("ui/resource-teardown",{params:zv.shape.params,result:vv},(o,r)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(o,r)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(t){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,t),this._oncalltool=t,this.replaceRequestHandler("tools/call",(o,r)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(o.params,r)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(t){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,t),this._onlisttools=t,this.replaceRequestHandler("tools/list",(o,r)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(o.params,r)})}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${t})`);break}}assertRequestHandlerCapability(t){switch(t){case"tools/call":case"tools/list":if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${t})`);return;default:return}}assertNotificationCapability(t){}async callServerTool(t,o){if(this._assertInitialized("callServerTool"),typeof t=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${t}"). Did you mean: callServerTool({ name: "${t}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:t},{onprogress:()=>{},resetTimeoutOnProgress:!0,...o})}async readServerResource(t,o){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:t},o)}async listServerResources(t,o){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:t},o)}async createSamplingMessage(t,o){return this._assertInitialized("createSamplingMessage"),await this.request({method:"sampling/createMessage",params:t},o)}sendMessage(t,o){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:t},fv,o)}sendLog(t){return this.notification({method:"notifications/message",params:t})}updateModelContext(t,o){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:t},Et,o)}openLink(t,o){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:t},hv,o)}sendOpenLink=this.openLink;downloadFile(t,o){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:t},mv,o)}requestTeardown(t={}){return this.notification({method:"ui/notifications/request-teardown",params:t})}requestDisplayMode(t,o){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:t},xv,o)}sendSizeChanged(t){return this.notification({method:"ui/notifications/size-changed",params:t})}setupSizeChangedNotifications(){let t=!1,o=0,r=0,n=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let i=document.documentElement,c=i.style.height;i.style.height="max-content";let l=Math.ceil(i.getBoundingClientRect().height);i.style.height=c;let d=Math.ceil(window.innerWidth);(d!==o||l!==r)&&(o=d,r=l,this.sendSizeChanged({width:d,height:l}))}))};n();let s=new ResizeObserver(n);return s.observe(document.documentElement),s.observe(document.body),()=>s.disconnect()}async connect(t=new cf(window.parent,window.parent),o){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1;try{await super.connect(t);let r=await this.request({method:"ui/initialize",params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:cv}},Ev,o);if(r===void 0)throw Error(`Server sent invalid initialize result: ${r}`);this._hostCapabilities=r.hostCapabilities,this._hostInfo=r.hostInfo,this._hostContext=r.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(r){throw this.close(),r}}};var Lr=new Ul({name:"ADS preview",version:"1.0.0"},{},{autoResize:!0}),p_=document.getElementById("ads-preview-seed"),m_;function h_(e,t){let o=document.createElement(e);return o.textContent=t,o}function f_(e){(e==="light"||e==="dark")&&(document.documentElement.dataset.theme=e)}Lr.onhostcontextchanged=e=>f_(e.theme);if(p_){let r=function(i){let c="";if(!i||i.state==="unreported")c="Preview freshness is unverified. Check the build status before reviewing.";else if(i.state==="error"){let l=i.diagnostics?.[0];c=`Build failed. Showing ${e.revision===null?"an earlier preview":`build ${e.revision}`}.`,l&&(c+=`
104
- ${l.file??""}${l.line?`:${l.line}`:""}${l.file?": ":""}${l.message}`)}else["building","idle"].includes(i.state)?c="Rebuilding. This view is the previous preview.":(i.revision!==e.revision||i.session!==e.session)&&(c=`Build ${i.revision} is ready. Reopen this preview to load it.`);t.textContent=c,t.hidden=!c};Iv=r;let e=JSON.parse(p_.textContent),t=h_("aside","");t.id="ads-preview-build",t.setAttribute("role","status"),t.setAttribute("aria-live","polite");let o=h_("style","#ads-preview-build{position:fixed;inset:12px 12px auto;z-index:2147483647;padding:10px 14px;border:1px solid GrayText;border-radius:6px;background:Canvas;color:CanvasText;font:13px system-ui;white-space:pre-wrap;overflow-wrap:anywhere;max-height:30vh;overflow:auto}#ads-preview-build[hidden]{display:none}");document.head.append(o),document.body.append(t),r(e);let n=!1,s;Lr.onteardown=async()=>(clearInterval(s),{}),window.addEventListener("pagehide",()=>clearInterval(s),{once:!0}),m_=()=>{if(!Lr.getHostCapabilities()?.serverResources)return;async function i(){if(!(n||document.visibilityState==="hidden")){n=!0;try{let c=await Lr.readServerResource({uri:"ads://project/build"},{timeout:5e3}),l=JSON.parse(c.contents.find(d=>"text"in d).text);r(l.previews.find(d=>d.id===e.id))}catch{t.textContent="Build status unavailable. Reopen the preview to verify it.",t.hidden=!1}finally{n=!1}}}i(),s=setInterval(()=>{i()},2e3)}}var Iv;try{await Lr.connect(),m_?.(),f_(Lr.getHostContext()?.theme)}catch{}
102
+ - "app": Tool callable by the app from this server only`),csp:u.never().optional(),permissions:u.never().optional()}),Mx=u.object({mimeTypes:u.array(u.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),qx=u.object({method:u.literal("ui/download-file"),params:u.object({contents:u.array(u.union([mo,fo])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),Ax=u.object({method:u.literal("ui/message"),params:u.object({role:u.literal("user").describe('Message role, currently only "user" is supported.'),content:u.array(Fe).describe("Message content blocks (text, image, etc.).")})}),jx=u.object({method:u.literal("ui/notifications/sandbox-resource-ready"),params:u.object({html:u.string().describe("HTML content to load into the inner iframe."),sandbox:u.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:lf.optional().describe("CSP configuration from resource metadata."),permissions:uf.optional().describe("Sandbox permissions from resource metadata.")})}),Ev=u.object({method:u.literal("ui/notifications/tool-result"),params:Ct.describe("Standard MCP tool execution result.")}),d_=u.object({toolInfo:u.object({id:Ne.optional().describe("JSON-RPC id of the tools/call request."),tool:Et.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:hv.optional().describe("Current color theme preference."),styles:Rv.optional().describe("Style configuration for theming the app."),displayMode:aa.optional().describe("How the UI is currently displayed."),availableDisplayModes:u.array(aa).optional().describe("Display modes the host supports."),containerDimensions:u.union([u.object({height:u.number().describe("Fixed container height in pixels.")}),u.object({maxHeight:u.union([u.number(),u.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(u.union([u.object({width:u.number().describe("Fixed container width in pixels.")}),u.object({maxWidth:u.union([u.number(),u.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
103
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:u.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:u.string().optional().describe("User's timezone in IANA format."),userAgent:u.string().optional().describe("Host application identifier."),platform:u.union([u.literal("web"),u.literal("desktop"),u.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:u.object({touch:u.boolean().optional().describe("Whether the device supports touch input."),hover:u.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:u.object({top:u.number().describe("Top safe area inset in pixels."),right:u.number().describe("Right safe area inset in pixels."),bottom:u.number().describe("Bottom safe area inset in pixels."),left:u.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),Cv=u.object({method:u.literal("ui/notifications/host-context-changed"),params:d_.describe("Partial context update containing only changed fields.")}),Lx=u.object({method:u.literal("ui/update-model-context"),params:u.object({content:u.array(Fe).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:u.record(u.string(),u.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),Ux=u.object({method:u.literal("ui/initialize"),params:u.object({appInfo:Ve.describe("App identification (name and version)."),appCapabilities:Tv.describe("Features and capabilities this app provides."),protocolVersion:u.string().describe("Protocol version this app supports.")})}),Iv=u.object({protocolVersion:u.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Ve.describe("Host application identification and version."),hostCapabilities:Pv.describe("Features and capabilities provided by the host."),hostContext:d_.describe("Rich context about the host environment.")}).passthrough(),Ov={target:"draft-2020-12"};async function l_(e,t){let o=e["~standard"];if(o.jsonSchema)return o.jsonSchema[t](Ov);throw Error(`Schema (vendor: ${o.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function u_(e,t,o=""){let r=await e["~standard"].validate(t);if(r.issues){let n=r.issues.map(s=>{let i=s.path?.map(c=>typeof c=="object"?c.key:c).join(".");return i?`${i}: ${s.message}`:s.message}).join("; ");throw Error(o+n)}return r.value}function Nv(e,t){let o={...e,...t};return t.experimental!==void 0&&(o.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(o.tools={...e.tools,...t.tools}),o}var Ul=class e extends nf{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new sf;_methods=new af;setRequestHandler=(...t)=>{let[o,...r]=a_("request",t)??t;this._methods.claim(o,"setRequestHandler"),super.setRequestHandler.call(this,o,...r)};setNotificationHandler=(...t)=>{let[o,...r]=a_("notification",t)??t;this._methods.claim(o,"setNotificationHandler"),super.setNotificationHandler.call(this,o,...r)};removeRequestHandler=t=>{this._methods.release(t),super.removeRequestHandler(t)};removeNotificationHandler=t=>{this._methods.release(t),super.removeNotificationHandler(t)};replaceRequestHandler=(t,...o)=>{this._methods.replace(t),super.setRequestHandler.call(this,t,...o)};_assertInitialized(t){if(this._initializedSent)return;let o=`[ext-apps] App.${t}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(o);console.warn(`${o}. This will throw in a future release.`)}eventSchemas={toolinput:bv,toolinputpartial:yv,toolresult:Ev,toolcancelled:zv,hostcontextchanged:Cv};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let o=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(o);console.warn(o)}setEventHandler(t,o){o&&this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.setHandler(t,o)}addEventListener(t,o){this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.addEventListener(t,o)}removeEventListener(t,o){this._events.removeEventListener(t,o)}_ensureEventSlot(t){if(this._registeredEvents.has(t))return;let o=this.eventSchemas[t];if(!o)throw Error(`Unknown event: ${String(t)}`);this.setNotificationHandler(o.shape.method.value,{params:o.shape.params},r=>{let n=r;t==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...n}),this._events.dispatch(t,n)}),this._registeredEvents.add(t)}getEventHandler(t){return this._events.getHandler(t)}warnIfRequestHandlerReplaced(t,o,r){o&&r&&console.warn(`[MCP Apps] ${t} handler replaced. Previous handler will no longer be called.`)}constructor(t,o={},r={autoResize:!0}){super(r),this._appInfo=t,this._appCapabilities=o,this.options=r,this._methods.replace("notifications/cancelled"),this._methods.replace("notifications/progress"),!r.allowUnsafeEval&&u.config({jitless:!0}),this.replaceRequestHandler("ping",n=>(console.log("Received ping:",n.params),{})),this.setEventHandler("hostcontextchanged",void 0)}buildContext(t){return t}registerAppCapabilities(t){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._appCapabilities=Nv(this._appCapabilities,t)}registerTool(t,o,r){if(this._registeredTools[t])throw Error(`Tool ${t} is already registered`);let n=this,s=()=>{n._initializedSent&&n._appCapabilities.tools?.listChanged&&n.sendToolListChanged()},i=o.inputSchema!==void 0,c={title:o.title,description:o.description,inputSchema:o.inputSchema,outputSchema:o.outputSchema,annotations:o.annotations,_meta:o._meta,enabled:!0,enable(){this.enabled=!0,s()},disable(){this.enabled=!1,s()},update(l){Object.assign(this,l),s()},remove(){n._registeredTools[t]===c&&(delete n._registeredTools[t],s())},handler:async(l,d)=>{if(!c.enabled)throw Error(`Tool ${t} is disabled`);let m;if(i){let S=c.inputSchema,_=S?await u_(S,l??{},`Invalid input for tool ${t}: `):l??{};m=await r(_,d)}else m=await r(d);return c.outputSchema&&!m.isError&&(m.structuredContent=await u_(c.outputSchema,m.structuredContent,`Invalid output for tool ${t}: `)),m}};return this._registeredTools[t]=c,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),s(),c}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(t,o)=>{let r=this._registeredTools[t.name];if(!r)throw Error(`Tool ${t.name} not found`);return r.handler(t.arguments,o)},this.onlisttools=async(t,o)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([r,n])=>n.enabled).map(async([r,n])=>{let s={name:r,title:n.title,description:n.description,inputSchema:n.inputSchema?await l_(n.inputSchema,"input"):{type:"object",properties:{}}};return n.outputSchema&&(s.outputSchema=await l_(n.outputSchema,"output")),n.annotations&&(s.annotations=n.annotations),n._meta&&(s._meta=n._meta),s}))}))}async sendToolListChanged(t={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:t})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(t){this.setEventHandler("toolinput",t)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(t){this.setEventHandler("toolinputpartial",t)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(t){this.setEventHandler("toolresult",t)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(t){this.setEventHandler("toolcancelled",t)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(t){this.setEventHandler("hostcontextchanged",t)}_onteardown;get onteardown(){return this._onteardown}set onteardown(t){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,t),this._onteardown=t,this.replaceRequestHandler("ui/resource-teardown",{params:wv.shape.params,result:xv},(o,r)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(o,r)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(t){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,t),this._oncalltool=t,this.replaceRequestHandler("tools/call",(o,r)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(o.params,r)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(t){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,t),this._onlisttools=t,this.replaceRequestHandler("tools/list",(o,r)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(o.params,r)})}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${t})`);break}}assertRequestHandlerCapability(t){switch(t){case"tools/call":case"tools/list":if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${t})`);return;default:return}}assertNotificationCapability(t){}async callServerTool(t,o){if(this._assertInitialized("callServerTool"),typeof t=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${t}"). Did you mean: callServerTool({ name: "${t}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:t},{onprogress:()=>{},resetTimeoutOnProgress:!0,...o})}async readServerResource(t,o){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:t},o)}async listServerResources(t,o){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:t},o)}async createSamplingMessage(t,o){return this._assertInitialized("createSamplingMessage"),await this.request({method:"sampling/createMessage",params:t},o)}sendMessage(t,o){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:t},_v,o)}sendLog(t){return this.notification({method:"notifications/message",params:t})}updateModelContext(t,o){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:t},$t,o)}openLink(t,o){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:t},gv,o)}sendOpenLink=this.openLink;downloadFile(t,o){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:t},Sv,o)}requestTeardown(t={}){return this.notification({method:"ui/notifications/request-teardown",params:t})}requestDisplayMode(t,o){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:t},kv,o)}sendSizeChanged(t){return this.notification({method:"ui/notifications/size-changed",params:t})}setupSizeChangedNotifications(){let t=!1,o=0,r=0,n=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let i=document.documentElement,c=i.style.height;i.style.height="max-content";let l=Math.ceil(i.getBoundingClientRect().height);i.style.height=c;let d=Math.ceil(window.innerWidth);(d!==o||l!==r)&&(o=d,r=l,this.sendSizeChanged({width:d,height:l}))}))};n();let s=new ResizeObserver(n);return s.observe(document.documentElement),s.observe(document.body),()=>s.disconnect()}async connect(t=new cf(window.parent,window.parent),o){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1;try{await super.connect(t);let r=await this.request({method:"ui/initialize",params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:dv}},Iv,o);if(r===void 0)throw Error(`Server sent invalid initialize result: ${r}`);this._hostCapabilities=r.hostCapabilities,this._hostInfo=r.hostInfo,this._hostContext=r.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(r){throw this.close(),r}}};function p_(e){return Array.isArray(e)&&e.length>0&&e.every(t=>t&&typeof t=="object"&&typeof t.token=="string"&&/^--[\w-]+$/.test(t.token)&&typeof t.property=="string"&&/^-?[a-z][a-z0-9-]*$/.test(t.property)&&typeof t.probe=="string"&&t.probe.trim().length>0)&&new Set(e.map(t=>`${t.token}:${t.property}`)).size===e.length}function h_(e,t){let o=t.getComputedStyle(e),r=e.getBoundingClientRect();if(o.display==="none"||o.visibility!=="visible"||!e.getClientRects().length||!(r.width||r.height))return!1;for(let n=e;n;n=n.parentElement)if(Number(t.getComputedStyle(n).opacity)===0)return!1;return!0}function m_(e,t){if(!p_(t))return{ok:!1,diagnostics:["Token preview needs explicit { token, property, probe } samples from the project fixture. Rebuild with the current compiler."]};let o=e.ownerDocument,r=o.defaultView,n=o.documentElement,s=[],i=[],c=[...e.querySelectorAll("[data-ads-token], [data-ads-property]")],l=new Set(t.map(d=>`${d.token}:${d.property}`));for(let d of c)l.has(`${d.dataset.adsToken}:${d.dataset.adsProperty}`)||s.push(`Undeclared rendered token sample ${d.dataset.adsToken}:${d.dataset.adsProperty}.`);for(let d of t){if(!r.CSS.supports(d.property,d.probe)){s.push(`${d.token}: the fixture probe is invalid for ${d.property}.`);continue}let m=r.getComputedStyle(n).getPropertyValue(d.token).trim();if(!m||!r.CSS.supports(d.property,m)){s.push(`${d.token}: its current value is invalid for the fixture's ${d.property} binding.`);continue}let S=c.filter(b=>b.dataset.adsToken===d.token&&b.dataset.adsProperty===d.property);if(!S.length){s.push(`${d.token} needs a rendered ${d.property} sample, not only a name/value label.`);continue}let _=!1;for(let b of S){let P=[];for(let q=b.parentElement;q&&q!==e;q=q.parentElement)q.tagName==="DETAILS"&&!q.open&&(q.open=!0,P.push(q));let $=n.getAttribute("style"),C=b.getAttribute("style");try{b.style.setProperty("transition","none","important");let q=r.getComputedStyle(b).getPropertyValue(d.property),J=h_(b,r);n.style.setProperty(d.token,d.probe,"important");let L=r.getComputedStyle(b).getPropertyValue(d.property);_=!!(L&&L!==q&&(J||h_(b,r)))}finally{$===null?n.removeAttribute("style"):n.setAttribute("style",$),C===null?b.removeAttribute("style"):b.setAttribute("style",C);for(let q of P)q.open=!1}if(_)break}_?i.push(d):s.push(`${d.token} has no visible ${d.property} sample that responds to its value. Hardcoded copies do not satisfy coverage.`)}return{ok:!s.length,verified:i,diagnostics:s}}var Ot=new Ul({name:"ADS preview",version:"1.0.0"},{},{autoResize:!0}),f_=document.getElementById("ads-preview-seed"),S_;function g_(e,t){let o=document.createElement(e);return o.textContent=t,o}function __(e){(e==="light"||e==="dark")&&(document.documentElement.dataset.theme=e)}Ot.onhostcontextchanged=e=>__(e.theme);if(f_){let n=function(c){let l="";if(!c||c.state==="unreported")l="Preview freshness is unverified. Check the build status before reviewing.";else if(c.state==="error"){let d=c.diagnostics?.[0];l=`Build failed. Showing ${e.revision===null?"an earlier preview":`build ${e.revision}`}.`,d&&(l+=`
104
+ ${d.file??""}${d.line?`:${d.line}`:""}${d.file?": ":""}${d.message}`)}else["building","idle"].includes(c.state)?l="Rebuilding. This view is the previous preview.":(c.revision!==e.revision||c.session!==e.session)&&(l=`Build ${c.revision} is ready. Reopen this preview to load it.`);t.textContent=[l,r].filter(Boolean).join(`
105
+ `),t.hidden=!t.textContent};Mv=n;let e=JSON.parse(f_.textContent),t=g_("aside","");t.id="ads-preview-build",t.setAttribute("role","status"),t.setAttribute("aria-live","polite");let o=g_("style","#ads-preview-build{position:fixed;inset:12px 12px auto;z-index:2147483647;padding:10px 14px;border:1px solid GrayText;border-radius:6px;background:Canvas;color:CanvasText;font:13px system-ui;white-space:pre-wrap;overflow-wrap:anywhere;max-height:30vh;overflow:auto}#ads-preview-build[hidden]{display:none}");document.head.append(o),document.body.append(t);let r="";n(e),e.kind==="tokens"&&(async()=>{await new Promise(l=>requestAnimationFrame(()=>requestAnimationFrame(l))),await document.fonts.ready;let c=m_(document.body,e.samples);if(!c.ok){r=`Token preview verification failed:
106
+ ${c.diagnostics.slice(0,20).join(`
107
+ `)}`,t.setAttribute("role","alert"),n(e);try{Ot.getHostCapabilities()?.logging&&await Ot.sendLog({level:"error",logger:"ads-preview",data:{state:"error",id:e.id,message:r}})}catch{}}})();let s=!1,i;Ot.onteardown=async()=>(clearInterval(i),{}),window.addEventListener("pagehide",()=>clearInterval(i),{once:!0}),S_=()=>{if(!Ot.getHostCapabilities()?.serverResources)return;async function c(){if(!(s||document.visibilityState==="hidden")){s=!0;try{let l=await Ot.readServerResource({uri:"ads://project/build"},{timeout:5e3}),d=JSON.parse(l.contents.find(m=>"text"in m).text);n(d.previews.find(m=>m.id===e.id))}catch{t.textContent=["Build status unavailable. Reopen the preview to verify it.",r].filter(Boolean).join(`
108
+ `),t.hidden=!1}finally{s=!1}}}c(),i=setInterval(()=>{c()},2e3)}}var Mv;try{await Ot.connect(),S_?.(),__(Ot.getHostContext()?.theme)}catch{}
105
109
  /*! Bundled license information:
106
110
 
107
111
  @modelcontextprotocol/client/dist/src-WCy6ifGf.mjs: