@reqvire-org/ads 0.3.16 → 0.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/check.mjs +13 -8
- package/dist/evidence.mjs +18 -0
- package/dist/investigations.mjs +70 -0
- package/dist/mcp/context.mjs +1 -1
- package/dist/mcp/mutations.mjs +34 -17
- package/dist/mcp/preview-widget.bundle.js +12 -12
- package/dist/mcp/resource-loader.js +3 -3
- package/dist/mcp/server.mjs +30 -8
- package/dist/scenario-selectors.mjs +140 -0
- package/dist/selector-match.mjs +94 -0
- package/dist/showcase/client.bundle.js +2 -2
- package/dist/skills/ads-break-ui/SKILL.md +3 -0
- package/dist/skills/ads-break-ui/references/evidence.md +73 -0
- package/dist/skills/ads-break-ui/references/scenarios.md +32 -0
- package/dist/skills/ads-designer/SKILL.md +3 -0
- package/dist/skills/ads-designer/references/evidence.md +73 -0
- package/dist/skills/ads-designer/references/scenarios.md +32 -0
- package/dist/skills/ads-import/SKILL.md +3 -0
- package/dist/skills/ads-import/references/evidence.md +73 -0
- package/dist/skills/ads-import/references/scenarios.md +32 -0
- package/dist/skills/ads-migrate/SKILL.md +3 -0
- package/dist/skills/ads-migrate/references/evidence.md +73 -0
- package/dist/skills/ads-migrate/references/scenarios.md +32 -0
- package/dist/skills/ads-motion/SKILL.md +3 -0
- package/dist/skills/ads-motion/references/evidence.md +73 -0
- package/dist/skills/ads-motion/references/scenarios.md +32 -0
- package/dist/verification/browser.mjs +22 -7
- package/dist/verification/playwright-reporter.cjs +23 -5
- package/dist/verification.mjs +31 -9
- package/docs/ARCHITECTURE.md +20 -3
- package/docs/BEHAVIORS.md +18 -0
- package/docs/CHANGELOG.md +13 -0
- package/docs/MCP.md +13 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var N_=Object.defineProperty;var Qe=(e,t)=>{for(var o in t)N_(e,o,{get:t[o],enumerable:!0})};var M_=Object.create,$a=Object.defineProperty,q_=Object.getOwnPropertyDescriptor,A_=Object.getOwnPropertyNames,j_=Object.getPrototypeOf,L_=Object.prototype.hasOwnProperty,Pf=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Tf=(e,t)=>{let o={};for(var r in e)$a(o,r,{get:e[r],enumerable:!0});return t&&$a(o,Symbol.toStringTag,{value:"Module"}),o},U_=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=A_(t),s=0,i=n.length,c;s<i;s++)c=n[s],!L_.call(e,c)&&c!==o&&$a(e,c,{get:(l=>t[l]).bind(null,c),enumerable:!(r=q_(t,c))||r.enumerable});return e},kf=(e,t,o)=>(o=e!=null?M_(j_(e)):{},U_(t||!e||!e.__esModule?$a(o,"default",{value:e,enumerable:!0}):o,e));var Z_=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]);function Ef(e){return typeof e=="string"&&Z_.has(e.replace(/#$/,""))}var d={};Qe(d,{$brand:()=>Yl,$input:()=>yp,$output:()=>_p,NEVER:()=>Un,TimePrecision:()=>Rp,ZodAny:()=>cm,ZodArray:()=>pm,ZodBase64:()=>rl,ZodBase64URL:()=>nl,ZodBigInt:()=>fr,ZodBigIntFormat:()=>al,ZodBoolean:()=>mr,ZodCIDRv4:()=>tl,ZodCIDRv6:()=>ol,ZodCUID:()=>Wc,ZodCUID2:()=>Gc,ZodCatch:()=>Im,ZodCodec:()=>fs,ZodCustom:()=>gs,ZodCustomStringFormat:()=>pr,ZodDate:()=>ds,ZodDefault:()=>Pm,ZodDiscriminatedUnion:()=>mm,ZodE164:()=>sl,ZodEmail:()=>Hc,ZodEmoji:()=>Jc,ZodEnum:()=>lr,ZodError:()=>Rb,ZodExactOptional:()=>Rm,ZodFile:()=>zm,ZodFirstPartyTypeKind:()=>Hm,ZodFunction:()=>Zm,ZodGUID:()=>as,ZodIPv4:()=>Xc,ZodIPv6:()=>el,ZodISODate:()=>jc,ZodISODateTime:()=>Ac,ZodISODuration:()=>Uc,ZodISOTime:()=>Lc,ZodIntersection:()=>fm,ZodIssueCode:()=>Fm,ZodJWT:()=>il,ZodKSUID:()=>Qc,ZodLazy:()=>Lm,ZodLiteral:()=>bm,ZodMAC:()=>nm,ZodMap:()=>_m,ZodNaN:()=>Nm,ZodNanoID:()=>Bc,ZodNever:()=>um,ZodNonOptional:()=>pl,ZodNull:()=>am,ZodNullable:()=>xm,ZodNumber:()=>hr,ZodNumberFormat:()=>no,ZodObject:()=>ps,ZodOptional:()=>dl,ZodPipe:()=>ms,ZodPrefault:()=>km,ZodPreprocess:()=>Mm,ZodPromise:()=>Um,ZodReadonly:()=>qm,ZodRealError:()=>be,ZodRecord:()=>cr,ZodSet:()=>ym,ZodString:()=>ur,ZodStringFormat:()=>V,ZodSuccess:()=>Cm,ZodSymbol:()=>sm,ZodTemplateLiteral:()=>jm,ZodTransform:()=>vm,ZodTuple:()=>gm,ZodType:()=>M,ZodULID:()=>Kc,ZodURL:()=>us,ZodUUID:()=>Ue,ZodUndefined:()=>im,ZodUnion:()=>hs,ZodUnknown:()=>lm,ZodVoid:()=>dm,ZodXID:()=>Yc,ZodXor:()=>hm,_ZodString:()=>Vc,_default:()=>Tm,_function:()=>dS,any:()=>cl,array:()=>f,base64:()=>$g,base64url:()=>Cg,bigint:()=>Dg,boolean:()=>R,catch:()=>Om,check:()=>pS,cidrv4:()=>kg,cidrv6:()=>Eg,clone:()=>he,codec:()=>aS,coerce:()=>Ss,config:()=>Y,core:()=>tt,cuid:()=>bg,cuid2:()=>zg,custom:()=>hS,date:()=>Wg,decode:()=>Yh,decodeAsync:()=>Xh,describe:()=>mS,discriminatedUnion:()=>Pt,e164:()=>Ig,email:()=>Fc,emoji:()=>_g,encode:()=>Kh,encodeAsync:()=>Qh,endsWith:()=>Xo,enum:()=>I,exactOptional:()=>wm,file:()=>rS,flattenError:()=>Wn,float32:()=>jg,float64:()=>Lg,formatError:()=>Gn,fromJSONSchema:()=>bS,function:()=>dS,getErrorMap:()=>Pb,globalRegistry:()=>re,gt:()=>je,gte:()=>fe,guid:()=>pg,hash:()=>Ag,hex:()=>qg,hostname:()=>Mg,httpUrl:()=>Sg,includes:()=>Yo,instanceof:()=>gS,int:()=>Zc,int32:()=>Ug,int64:()=>Vg,intersection:()=>Oe,invertCodec:()=>cS,ipv4:()=>xg,ipv6:()=>Tg,iso:()=>xe,json:()=>_S,jwt:()=>Og,keyof:()=>Gg,ksuid:()=>wg,lazy:()=>Tt,length:()=>oo,literal:()=>g,locales:()=>os,looseObject:()=>$,looseRecord:()=>Xg,lowercase:()=>Go,lt:()=>Ae,lte:()=>we,mac:()=>Pg,map:()=>eS,maxLength:()=>to,maxSize:()=>vt,meta:()=>fS,mime:()=>er,minLength:()=>et,minSize:()=>Le,multipleOf:()=>zt,nan:()=>iS,nanoid:()=>yg,nativeEnum:()=>oS,negative:()=>kc,never:()=>ll,nonnegative:()=>$c,nonoptional:()=>$m,nonpositive:()=>Ec,normalize:()=>tr,null:()=>Ze,nullable:()=>cs,nullish:()=>nS,number:()=>b,object:()=>p,optional:()=>k,overwrite:()=>Ie,parse:()=>Bh,parseAsync:()=>Wh,partialRecord:()=>Qg,pipe:()=>Dc,positive:()=>Tc,prefault:()=>Em,preprocess:()=>ot,prettifyError:()=>du,promise:()=>uS,property:()=>Cc,readonly:()=>Am,record:()=>v,refine:()=>Dm,regex:()=>Wo,regexes:()=>Re,registry:()=>ic,safeDecode:()=>tm,safeDecodeAsync:()=>rm,safeEncode:()=>em,safeEncodeAsync:()=>om,safeParse:()=>is,safeParseAsync:()=>Gh,set:()=>tS,setErrorMap:()=>xb,size:()=>eo,slugify:()=>sr,startsWith:()=>Qo,strictObject:()=>Kg,string:()=>a,stringFormat:()=>Ng,stringbool:()=>SS,success:()=>sS,superRefine:()=>Vm,symbol:()=>Fg,templateLiteral:()=>lS,toJSONSchema:()=>ro,toLowerCase:()=>rr,toUpperCase:()=>nr,transform:()=>ul,treeifyError:()=>uu,trim:()=>or,tuple:()=>Sm,uint32:()=>Zg,uint64:()=>Hg,ulid:()=>vg,undefined:()=>Jg,union:()=>x,unknown:()=>T,uppercase:()=>Ko,url:()=>dr,util:()=>O,uuid:()=>hg,uuidv4:()=>mg,uuidv6:()=>fg,uuidv7:()=>gg,void:()=>Bg,xid:()=>Rg,xor:()=>Yg});var tt={};Qe(tt,{$ZodAny:()=>Ud,$ZodArray:()=>Fd,$ZodAsyncError:()=>Ce,$ZodBase64:()=>$d,$ZodBase64URL:()=>Cd,$ZodBigInt:()=>ec,$ZodBigIntFormat:()=>qd,$ZodBoolean:()=>Xn,$ZodCIDRv4:()=>Td,$ZodCIDRv6:()=>kd,$ZodCUID:()=>fd,$ZodCUID2:()=>gd,$ZodCatch:()=>lp,$ZodCheck:()=>H,$ZodCheckBigIntFormat:()=>Fu,$ZodCheckEndsWith:()=>rd,$ZodCheckGreaterThan:()=>Wa,$ZodCheckIncludes:()=>td,$ZodCheckLengthEquals:()=>Yu,$ZodCheckLessThan:()=>Ba,$ZodCheckLowerCase:()=>Xu,$ZodCheckMaxLength:()=>Gu,$ZodCheckMaxSize:()=>Ju,$ZodCheckMimeType:()=>sd,$ZodCheckMinLength:()=>Ku,$ZodCheckMinSize:()=>Bu,$ZodCheckMultipleOf:()=>Vu,$ZodCheckNumberFormat:()=>Hu,$ZodCheckOverwrite:()=>id,$ZodCheckProperty:()=>nd,$ZodCheckRegex:()=>Qu,$ZodCheckSizeEquals:()=>Wu,$ZodCheckStartsWith:()=>od,$ZodCheckStringFormat:()=>Bo,$ZodCheckUpperCase:()=>ed,$ZodCodec:()=>ts,$ZodCustom:()=>Sp,$ZodCustomStringFormat:()=>Nd,$ZodDate:()=>Hd,$ZodDefault:()=>sp,$ZodDiscriminatedUnion:()=>Wd,$ZodE164:()=>Id,$ZodEmail:()=>dd,$ZodEmoji:()=>hd,$ZodEncodeError:()=>gt,$ZodEnum:()=>Xd,$ZodError:()=>Bn,$ZodExactOptional:()=>rp,$ZodFile:()=>tp,$ZodFunction:()=>mp,$ZodGUID:()=>ld,$ZodIPv4:()=>wd,$ZodIPv6:()=>xd,$ZodISODate:()=>zd,$ZodISODateTime:()=>bd,$ZodISODuration:()=>Rd,$ZodISOTime:()=>vd,$ZodIntersection:()=>Gd,$ZodJWT:()=>Od,$ZodKSUID:()=>yd,$ZodLazy:()=>gp,$ZodLiteral:()=>ep,$ZodMAC:()=>Pd,$ZodMap:()=>Yd,$ZodNaN:()=>up,$ZodNanoID:()=>md,$ZodNever:()=>Dd,$ZodNonOptional:()=>ap,$ZodNull:()=>Ld,$ZodNullable:()=>np,$ZodNumber:()=>Xa,$ZodNumberFormat:()=>Md,$ZodObject:()=>ig,$ZodObjectJIT:()=>Jd,$ZodOptional:()=>oc,$ZodPipe:()=>rc,$ZodPrefault:()=>ip,$ZodPreprocess:()=>dp,$ZodPromise:()=>fp,$ZodReadonly:()=>pp,$ZodRealError:()=>ye,$ZodRecord:()=>Kd,$ZodRegistry:()=>sc,$ZodSet:()=>Qd,$ZodString:()=>Xt,$ZodStringFormat:()=>D,$ZodSuccess:()=>cp,$ZodSymbol:()=>Ad,$ZodTemplateLiteral:()=>hp,$ZodTransform:()=>op,$ZodTuple:()=>tc,$ZodType:()=>N,$ZodULID:()=>Sd,$ZodURL:()=>pd,$ZodUUID:()=>ud,$ZodUndefined:()=>jd,$ZodUnion:()=>es,$ZodUnknown:()=>Zd,$ZodVoid:()=>Vd,$ZodXID:()=>_d,$ZodXor:()=>Bd,$brand:()=>Yl,$constructor:()=>h,$input:()=>yp,$output:()=>_p,Doc:()=>Qn,JSONSchema:()=>lg,JSONSchemaGenerator:()=>Mc,NEVER:()=>Un,TimePrecision:()=>Rp,_any:()=>Hp,_array:()=>Yp,_base64:()=>Rc,_base64url:()=>wc,_bigint:()=>Ap,_boolean:()=>Mp,_catch:()=>fb,_check:()=>cg,_cidrv4:()=>zc,_cidrv6:()=>vc,_coercedBigint:()=>jp,_coercedBoolean:()=>qp,_coercedDate:()=>Gp,_coercedNumber:()=>Ep,_coercedString:()=>zp,_cuid:()=>mc,_cuid2:()=>fc,_custom:()=>Xp,_date:()=>Wp,_decode:()=>ja,_decodeAsync:()=>Ua,_default:()=>pb,_discriminatedUnion:()=>eb,_e164:()=>xc,_email:()=>ac,_emoji:()=>pc,_encode:()=>Aa,_encodeAsync:()=>La,_endsWith:()=>Xo,_enum:()=>ib,_file:()=>Qp,_float32:()=>Cp,_float64:()=>Ip,_gt:()=>je,_gte:()=>fe,_guid:()=>rs,_includes:()=>Yo,_int:()=>$p,_int32:()=>Op,_int64:()=>Lp,_intersection:()=>tb,_ipv4:()=>yc,_ipv6:()=>bc,_isoDate:()=>xp,_isoDateTime:()=>wp,_isoDuration:()=>Tp,_isoTime:()=>Pp,_jwt:()=>Pc,_ksuid:()=>_c,_lazy:()=>yb,_length:()=>oo,_literal:()=>cb,_lowercase:()=>Go,_lt:()=>Ae,_lte:()=>we,_mac:()=>vp,_map:()=>nb,_max:()=>we,_maxLength:()=>to,_maxSize:()=>vt,_mime:()=>er,_min:()=>fe,_minLength:()=>et,_minSize:()=>Le,_multipleOf:()=>zt,_nan:()=>Kp,_nanoid:()=>hc,_nativeEnum:()=>ab,_negative:()=>kc,_never:()=>Jp,_nonnegative:()=>$c,_nonoptional:()=>hb,_nonpositive:()=>Ec,_normalize:()=>tr,_null:()=>Vp,_nullable:()=>db,_number:()=>kp,_optional:()=>ub,_overwrite:()=>Ie,_parse:()=>Vo,_parseAsync:()=>Ho,_pipe:()=>gb,_positive:()=>Tc,_promise:()=>bb,_property:()=>Cc,_readonly:()=>Sb,_record:()=>rb,_refine:()=>eh,_regex:()=>Wo,_safeDecode:()=>Da,_safeDecodeAsync:()=>Ha,_safeEncode:()=>Za,_safeEncodeAsync:()=>Va,_safeParse:()=>Fo,_safeParseAsync:()=>Jo,_set:()=>sb,_size:()=>eo,_slugify:()=>sr,_startsWith:()=>Qo,_string:()=>bp,_stringFormat:()=>ir,_stringbool:()=>nh,_success:()=>mb,_superRefine:()=>th,_symbol:()=>Zp,_templateLiteral:()=>_b,_toLowerCase:()=>rr,_toUpperCase:()=>nr,_transform:()=>lb,_trim:()=>or,_tuple:()=>ob,_uint32:()=>Np,_uint64:()=>Up,_ulid:()=>gc,_undefined:()=>Dp,_union:()=>Qy,_unknown:()=>Fp,_uppercase:()=>Ko,_url:()=>ns,_uuid:()=>cc,_uuidv4:()=>lc,_uuidv6:()=>uc,_uuidv7:()=>dc,_void:()=>Bp,_xid:()=>Sc,_xor:()=>Xy,clone:()=>he,config:()=>Y,createStandardJSONSchemaMethod:()=>ar,createToJSONSchemaMethod:()=>sh,decode:()=>fy,decodeAsync:()=>Sy,describe:()=>oh,encode:()=>my,encodeAsync:()=>gy,extractDefs:()=>wt,finalize:()=>xt,flattenError:()=>Wn,formatError:()=>Gn,globalConfig:()=>Kt,globalRegistry:()=>re,initializeContext:()=>Rt,isValidBase64:()=>Ed,isValidBase64URL:()=>og,isValidJWT:()=>rg,locales:()=>os,meta:()=>rh,parse:()=>Ma,parseAsync:()=>qa,prettifyError:()=>du,process:()=>Z,regexes:()=>Re,registry:()=>ic,safeDecode:()=>yy,safeDecodeAsync:()=>zy,safeEncode:()=>_y,safeEncodeAsync:()=>by,safeParse:()=>pu,safeParseAsync:()=>hu,toDotPath:()=>Mf,toJSONSchema:()=>ro,treeifyError:()=>uu,util:()=>O,version:()=>ad});var $f,Un=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 u=i.prototype,m=Object.keys(u);for(let S=0;S<m.length;S++){let _=m[S];_ in c||(c[_]=u[_].bind(c))}}let n=o?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function i(c){var l;let u=o?.Parent?new s:this;r(u,c),(l=u._zod).deferred??(l.deferred=[]);for(let m of u._zod.deferred)m();return u}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 Yl=Symbol("zod_brand"),Ce=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},gt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};($f=globalThis).__zod_globalConfig??($f.__zod_globalConfig={});var Kt=globalThis.__zod_globalConfig;function Y(e){return e&&Object.assign(Kt,e),Kt}var O={};Qe(O,{BIGINT_FORMAT_RANGES:()=>au,Class:()=>Xl,NUMBER_FORMAT_RANGES:()=>iu,aborted:()=>bt,allowsEval:()=>ou,assert:()=>J_,assertEqual:()=>D_,assertIs:()=>H_,assertNever:()=>F_,assertNotEqual:()=>V_,assignProp:()=>_t,base64ToUint8Array:()=>If,base64urlToUint8Array:()=>ly,cached:()=>Zo,captureStackTrace:()=>Oa,cleanEnum:()=>cy,cleanRegex:()=>Vn,clone:()=>he,cloneDef:()=>W_,createTransparentProxy:()=>ey,defineLazy:()=>A,esc:()=>Ia,escapeRegex:()=>ke,explicitlyAborted:()=>cu,extend:()=>ry,finalizeIssue:()=>me,floatSafeRemainder:()=>eu,getElementAtPath:()=>G_,getEnumValues:()=>Dn,getLengthableOrigin:()=>Jn,getParsedType:()=>X_,getSizableOrigin:()=>Fn,hexToUint8Array:()=>dy,isObject:()=>Yt,isPlainObject:()=>yt,issue:()=>Do,joinValues:()=>Ca,jsonStringifyReplacer:()=>Uo,merge:()=>sy,mergeDefs:()=>Xe,normalizeParams:()=>z,nullish:()=>St,numKeys:()=>Q_,objectClone:()=>B_,omit:()=>oy,optionalKeys:()=>su,parsedType:()=>lu,partial:()=>iy,pick:()=>ty,prefixIssues:()=>_e,primitiveTypes:()=>nu,promiseAllObject:()=>K_,propertyKeyTypes:()=>Hn,randomString:()=>Y_,required:()=>ay,safeExtend:()=>ny,shallowClone:()=>ru,slugify:()=>tu,stringifyPrimitive:()=>Na,uint8ArrayToBase64:()=>Of,uint8ArrayToBase64url:()=>uy,uint8ArrayToHex:()=>py,unwrapMessage:()=>Zn});function D_(e){return e}function V_(e){return e}function H_(e){}function F_(e){throw new Error("Unexpected value in exhaustive check")}function J_(e){}function Dn(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 Ca(e,t="|"){return e.map(o=>Na(o)).join(t)}function Uo(e,t){return typeof t=="bigint"?t.toString():t}function Zo(e){return{get value(){{let o=e();return Object.defineProperty(this,"value",{value:o}),o}throw new Error("cached value already set")}}}function St(e){return e==null}function Vn(e){let t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function eu(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 Cf=Symbol("evaluating");function A(e,t,o){let r;Object.defineProperty(e,t,{get(){if(r!==Cf)return r===void 0&&(r=Cf,r=o()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function B_(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function _t(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function Xe(...e){let t={};for(let o of e){let r=Object.getOwnPropertyDescriptors(o);Object.assign(t,r)}return Object.defineProperties({},t)}function W_(e){return Xe(e._zod.def)}function G_(e,t){return t?t.reduce((o,r)=>o?.[r],e):e}function K_(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 Y_(e=10){let t="abcdefghijklmnopqrstuvwxyz",o="";for(let r=0;r<e;r++)o+=t[Math.floor(Math.random()*t.length)];return o}function Ia(e){return JSON.stringify(e)}function tu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Oa="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ou=Zo(()=>{if(Kt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function yt(e){if(Yt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let o=t.prototype;return!(Yt(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function ru(e){return yt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Q_(e){let t=0;for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&t++;return t}var X_=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}`)}},Hn=new Set(["string","number","symbol"]),nu=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 ey(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 Na(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function su(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var iu={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]},au={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ty(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=Xe(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 _t(this,"shape",i),i},checks:[]});return he(e,s)}function oy(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=Xe(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 _t(this,"shape",i),i},checks:[]});return he(e,s)}function ry(e,t){if(!yt(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=Xe(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return _t(this,"shape",s),s}});return he(e,n)}function ny(e,t){if(!yt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let o=Xe(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return _t(this,"shape",r),r}});return he(e,o)}function sy(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=Xe(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return _t(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return he(e,o)}function iy(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=Xe(t._zod.def,{get shape(){let c=t._zod.def.shape,l={...c};if(o)for(let u in o){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);o[u]&&(l[u]=e?new e({type:"optional",innerType:c[u]}):c[u])}else for(let u in c)l[u]=e?new e({type:"optional",innerType:c[u]}):c[u];return _t(this,"shape",l),l},checks:[]});return he(t,i)}function ay(e,t,o){let r=Xe(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 _t(this,"shape",s),s}});return he(t,r)}function bt(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 cu(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 Zn(e){return typeof e=="string"?e:e?.message}function me(e,t,o){let r=e.message?e.message:Zn(e.inst?._zod.def?.error?.(e))??Zn(t?.error?.(e))??Zn(o.customError?.(e))??Zn(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 Fn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Jn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function lu(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 Do(...e){let[t,o,r]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:r}:{...t}}function cy(e){return Object.entries(e).filter(([t,o])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function If(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 Of(e){let t="";for(let o=0;o<e.length;o++)t+=String.fromCharCode(e[o]);return btoa(t)}function ly(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-t.length%4)%4);return If(t+o)}function uy(e){return Of(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function dy(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 py(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Xl=class{constructor(...t){}};var Nf=(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,Uo,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Bn=h("$ZodError",Nf),ye=h("$ZodError",Nf,{Parent:Error});function Wn(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 Gn(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,u=0;for(;u<c.length;){let m=c[u];u===c.length-1?(l[m]=l[m]||{_errors:[]},l[m]._errors.push(t(i))):l[m]=l[m]||{_errors:[]},l=l[m],u++}}}};return r(e),o}function uu(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(u=>r({issues:u},[...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 u=[...s,...l.path];if(u.length===0){o.errors.push(t(l));continue}let m=o,S=0;for(;S<u.length;){let _=u[S],y=S===u.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 Mf(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 du(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 ${Mf(r.path)}`);return t.join(`
|
|
2
|
-
`)}var Vo=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 Oa(c,n?.callee),c}return i.value},Ma=Vo(ye),Ho=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 Oa(c,n?.callee),c}return i.value},qa=Ho(ye),Fo=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??Bn)(s.issues.map(i=>me(i,n,Y())))}:{success:!0,data:s.value}},pu=Fo(ye),Jo=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}},hu=Jo(ye),Aa=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Vo(e)(t,o,n)},my=Aa(ye),ja=e=>(t,o,r)=>Vo(e)(t,o,r),fy=ja(ye),La=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Ho(e)(t,o,n)},gy=La(ye),Ua=e=>async(t,o,r)=>Ho(e)(t,o,r),Sy=Ua(ye),Za=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Fo(e)(t,o,n)},_y=Za(ye),Da=e=>(t,o,r)=>Fo(e)(t,o,r),yy=Da(ye),Va=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Jo(e)(t,o,n)},by=Va(ye),Ha=e=>async(t,o,r)=>Jo(e)(t,o,r),zy=Ha(ye);var Re={};Qe(Re,{base64:()=>Eu,base64url:()=>Fa,bigint:()=>qu,boolean:()=>ju,browserEmail:()=>Ey,cidrv4:()=>Tu,cidrv6:()=>ku,cuid:()=>mu,cuid2:()=>fu,date:()=>Iu,datetime:()=>Nu,domain:()=>Iy,duration:()=>bu,e164:()=>Cu,email:()=>vu,emoji:()=>Ru,extendedDuration:()=>vy,guid:()=>zu,hex:()=>Oy,hostname:()=>Cy,html5Email:()=>Py,httpProtocol:()=>$u,idnEmail:()=>ky,integer:()=>Au,ipv4:()=>wu,ipv6:()=>xu,ksuid:()=>_u,lowercase:()=>Zu,mac:()=>Pu,md5_base64:()=>My,md5_base64url:()=>qy,md5_hex:()=>Ny,nanoid:()=>yu,null:()=>Lu,number:()=>Ja,rfc5322Email:()=>Ty,sha1_base64:()=>jy,sha1_base64url:()=>Ly,sha1_hex:()=>Ay,sha256_base64:()=>Zy,sha256_base64url:()=>Dy,sha256_hex:()=>Uy,sha384_base64:()=>Hy,sha384_base64url:()=>Fy,sha384_hex:()=>Vy,sha512_base64:()=>By,sha512_base64url:()=>Wy,sha512_hex:()=>Jy,string:()=>Mu,time:()=>Ou,ulid:()=>gu,undefined:()=>Uu,unicodeEmail:()=>qf,uppercase:()=>Du,uuid:()=>Qt,uuid4:()=>Ry,uuid6:()=>wy,uuid7:()=>xy,xid:()=>Su});var mu=/^[cC][0-9a-z]{6,}$/,fu=/^[0-9a-z]+$/,gu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Su=/^[0-9a-vA-V]{20}$/,_u=/^[A-Za-z0-9]{27}$/,yu=/^[a-zA-Z0-9_-]{21}$/,bu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,vy=/^[-+]?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)?)??$/,zu=/^([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})$/,Qt=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)$/,Ry=Qt(4),wy=Qt(6),xy=Qt(7),vu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Py=/^[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])?)*$/,Ty=/^(([^<>()\[\]\\.,;:\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,}))$/,qf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ky=qf,Ey=/^[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])?)*$/,$y="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ru(){return new RegExp($y,"u")}var wu=/^(?:(?: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])$/,xu=/^(([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}|:))$/,Pu=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}$`)},Tu=/^((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])$/,ku=/^(([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])$/,Eu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Fa=/^[A-Za-z0-9_-]*$/,Cy=/^(?=.{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])?)*\.?$/,Iy=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,$u=/^https?$/,Cu=/^\+[1-9]\d{6,14}$/,Af="(?:(?:\\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])))",Iu=new RegExp(`^${Af}$`);function jf(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 Ou(e){return new RegExp(`^${jf(e)}$`)}function Nu(e){let t=jf({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(`^${Af}T(?:${r})$`)}var Mu=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},qu=/^-?\d+n?$/,Au=/^-?\d+$/,Ja=/^-?\d+(?:\.\d+)?$/,ju=/^(?:true|false)$/i,Lu=/^null$/i;var Uu=/^undefined$/i;var Zu=/^[^A-Z]*$/,Du=/^[^a-z]*$/,Oy=/^[0-9a-fA-F]*$/;function Kn(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Yn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Ny=/^[0-9a-fA-F]{32}$/,My=Kn(22,"=="),qy=Yn(22),Ay=/^[0-9a-fA-F]{40}$/,jy=Kn(27,"="),Ly=Yn(27),Uy=/^[0-9a-fA-F]{64}$/,Zy=Kn(43,"="),Dy=Yn(43),Vy=/^[0-9a-fA-F]{96}$/,Hy=Kn(64,""),Fy=Yn(64),Jy=/^[0-9a-fA-F]{128}$/,By=Kn(86,"=="),Wy=Yn(86);var H=h("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),Uf={number:"number",bigint:"bigint",object:"date"},Ba=h("$ZodCheckLessThan",(e,t)=>{H.init(e,t);let o=Uf[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})}}),Wa=h("$ZodCheckGreaterThan",(e,t)=>{H.init(e,t);let o=Uf[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})}}),Vu=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):eu(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})}}),Hu=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]=iu[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=Au)}),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})}}),Fu=h("$ZodCheckBigIntFormat",(e,t)=>{H.init(e,t);let[o,r]=au[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})}}),Ju=h("$ZodCheckMaxSize",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!St(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:Fn(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Bu=h("$ZodCheckMinSize",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!St(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:Fn(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Wu=h("$ZodCheckSizeEquals",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!St(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:Fn(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})}}),Gu=h("$ZodCheckMaxLength",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!St(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=Jn(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ku=h("$ZodCheckMinLength",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!St(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=Jn(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Yu=h("$ZodCheckLengthEquals",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!St(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=Jn(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})}}),Bo=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=()=>{})}),Qu=h("$ZodCheckRegex",(e,t)=>{Bo.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})}}),Xu=h("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Zu),Bo.init(e,t)}),ed=h("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Du),Bo.init(e,t)}),td=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})}}),od=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})}}),rd=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 Lf(e,t,o){e.issues.length&&t.issues.push(..._e(o,e.issues))}var nd=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=>Lf(n,o,t.property));Lf(r,o,t.property)}}),sd=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})}}),id=h("$ZodCheckOverwrite",(e,t)=>{H.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});var Qn=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 N_=Object.defineProperty;var Qe=(e,t)=>{for(var o in t)N_(e,o,{get:t[o],enumerable:!0})};var M_=Object.create,$a=Object.defineProperty,q_=Object.getOwnPropertyDescriptor,A_=Object.getOwnPropertyNames,j_=Object.getPrototypeOf,L_=Object.prototype.hasOwnProperty,Pf=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Tf=(e,t)=>{let o={};for(var r in e)$a(o,r,{get:e[r],enumerable:!0});return t&&$a(o,Symbol.toStringTag,{value:"Module"}),o},U_=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=A_(t),s=0,i=n.length,c;s<i;s++)c=n[s],!L_.call(e,c)&&c!==o&&$a(e,c,{get:(l=>t[l]).bind(null,c),enumerable:!(r=q_(t,c))||r.enumerable});return e},kf=(e,t,o)=>(o=e!=null?M_(j_(e)):{},U_(t||!e||!e.__esModule?$a(o,"default",{value:e,enumerable:!0}):o,e));var Z_=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]);function Ef(e){return typeof e=="string"&&Z_.has(e.replace(/#$/,""))}var d={};Qe(d,{$brand:()=>Yl,$input:()=>yp,$output:()=>_p,NEVER:()=>Zn,TimePrecision:()=>Rp,ZodAny:()=>cm,ZodArray:()=>pm,ZodBase64:()=>rl,ZodBase64URL:()=>nl,ZodBigInt:()=>fr,ZodBigIntFormat:()=>al,ZodBoolean:()=>mr,ZodCIDRv4:()=>tl,ZodCIDRv6:()=>ol,ZodCUID:()=>Wc,ZodCUID2:()=>Gc,ZodCatch:()=>Im,ZodCodec:()=>gs,ZodCustom:()=>Ss,ZodCustomStringFormat:()=>pr,ZodDate:()=>ps,ZodDefault:()=>Pm,ZodDiscriminatedUnion:()=>mm,ZodE164:()=>sl,ZodEmail:()=>Hc,ZodEmoji:()=>Jc,ZodEnum:()=>lr,ZodError:()=>Rb,ZodExactOptional:()=>Rm,ZodFile:()=>vm,ZodFirstPartyTypeKind:()=>Hm,ZodFunction:()=>Zm,ZodGUID:()=>cs,ZodIPv4:()=>Xc,ZodIPv6:()=>el,ZodISODate:()=>jc,ZodISODateTime:()=>Ac,ZodISODuration:()=>Uc,ZodISOTime:()=>Lc,ZodIntersection:()=>fm,ZodIssueCode:()=>Fm,ZodJWT:()=>il,ZodKSUID:()=>Qc,ZodLazy:()=>Lm,ZodLiteral:()=>bm,ZodMAC:()=>nm,ZodMap:()=>_m,ZodNaN:()=>Nm,ZodNanoID:()=>Bc,ZodNever:()=>um,ZodNonOptional:()=>pl,ZodNull:()=>am,ZodNullable:()=>xm,ZodNumber:()=>hr,ZodNumberFormat:()=>no,ZodObject:()=>hs,ZodOptional:()=>dl,ZodPipe:()=>fs,ZodPrefault:()=>km,ZodPreprocess:()=>Mm,ZodPromise:()=>Um,ZodReadonly:()=>qm,ZodRealError:()=>be,ZodRecord:()=>cr,ZodSet:()=>ym,ZodString:()=>ur,ZodStringFormat:()=>V,ZodSuccess:()=>Cm,ZodSymbol:()=>sm,ZodTemplateLiteral:()=>jm,ZodTransform:()=>zm,ZodTuple:()=>gm,ZodType:()=>M,ZodULID:()=>Kc,ZodURL:()=>ds,ZodUUID:()=>Ue,ZodUndefined:()=>im,ZodUnion:()=>ms,ZodUnknown:()=>lm,ZodVoid:()=>dm,ZodXID:()=>Yc,ZodXor:()=>hm,_ZodString:()=>Vc,_default:()=>Tm,_function:()=>dS,any:()=>cl,array:()=>f,base64:()=>$g,base64url:()=>Cg,bigint:()=>Dg,boolean:()=>R,catch:()=>Om,check:()=>pS,cidrv4:()=>kg,cidrv6:()=>Eg,clone:()=>he,codec:()=>aS,coerce:()=>_s,config:()=>Y,core:()=>tt,cuid:()=>bg,cuid2:()=>vg,custom:()=>hS,date:()=>Wg,decode:()=>Yh,decodeAsync:()=>Xh,describe:()=>mS,discriminatedUnion:()=>Pt,e164:()=>Ig,email:()=>Fc,emoji:()=>_g,encode:()=>Kh,encodeAsync:()=>Qh,endsWith:()=>Xo,enum:()=>I,exactOptional:()=>wm,file:()=>rS,flattenError:()=>Gn,float32:()=>jg,float64:()=>Lg,formatError:()=>Kn,fromJSONSchema:()=>bS,function:()=>dS,getErrorMap:()=>Pb,globalRegistry:()=>re,gt:()=>je,gte:()=>fe,guid:()=>pg,hash:()=>Ag,hex:()=>qg,hostname:()=>Mg,httpUrl:()=>Sg,includes:()=>Yo,instanceof:()=>gS,int:()=>Zc,int32:()=>Ug,int64:()=>Vg,intersection:()=>Oe,invertCodec:()=>cS,ipv4:()=>xg,ipv6:()=>Tg,iso:()=>xe,json:()=>_S,jwt:()=>Og,keyof:()=>Gg,ksuid:()=>wg,lazy:()=>Tt,length:()=>oo,literal:()=>g,locales:()=>rs,looseObject:()=>$,looseRecord:()=>Xg,lowercase:()=>Go,lt:()=>Ae,lte:()=>we,mac:()=>Pg,map:()=>eS,maxLength:()=>to,maxSize:()=>zt,meta:()=>fS,mime:()=>er,minLength:()=>et,minSize:()=>Le,multipleOf:()=>vt,nan:()=>iS,nanoid:()=>yg,nativeEnum:()=>oS,negative:()=>kc,never:()=>ll,nonnegative:()=>$c,nonoptional:()=>$m,nonpositive:()=>Ec,normalize:()=>tr,null:()=>Ze,nullable:()=>ls,nullish:()=>nS,number:()=>b,object:()=>p,optional:()=>k,overwrite:()=>Ie,parse:()=>Bh,parseAsync:()=>Wh,partialRecord:()=>Qg,pipe:()=>Dc,positive:()=>Tc,prefault:()=>Em,preprocess:()=>ot,prettifyError:()=>du,promise:()=>uS,property:()=>Cc,readonly:()=>Am,record:()=>z,refine:()=>Dm,regex:()=>Wo,regexes:()=>Re,registry:()=>ic,safeDecode:()=>tm,safeDecodeAsync:()=>rm,safeEncode:()=>em,safeEncodeAsync:()=>om,safeParse:()=>as,safeParseAsync:()=>Gh,set:()=>tS,setErrorMap:()=>xb,size:()=>eo,slugify:()=>sr,startsWith:()=>Qo,strictObject:()=>Kg,string:()=>a,stringFormat:()=>Ng,stringbool:()=>SS,success:()=>sS,superRefine:()=>Vm,symbol:()=>Fg,templateLiteral:()=>lS,toJSONSchema:()=>ro,toLowerCase:()=>rr,toUpperCase:()=>nr,transform:()=>ul,treeifyError:()=>uu,trim:()=>or,tuple:()=>Sm,uint32:()=>Zg,uint64:()=>Hg,ulid:()=>zg,undefined:()=>Jg,union:()=>x,unknown:()=>T,uppercase:()=>Ko,url:()=>dr,util:()=>O,uuid:()=>hg,uuidv4:()=>mg,uuidv6:()=>fg,uuidv7:()=>gg,void:()=>Bg,xid:()=>Rg,xor:()=>Yg});var tt={};Qe(tt,{$ZodAny:()=>Ud,$ZodArray:()=>Fd,$ZodAsyncError:()=>Ce,$ZodBase64:()=>$d,$ZodBase64URL:()=>Cd,$ZodBigInt:()=>ec,$ZodBigIntFormat:()=>qd,$ZodBoolean:()=>es,$ZodCIDRv4:()=>Td,$ZodCIDRv6:()=>kd,$ZodCUID:()=>fd,$ZodCUID2:()=>gd,$ZodCatch:()=>lp,$ZodCheck:()=>H,$ZodCheckBigIntFormat:()=>Fu,$ZodCheckEndsWith:()=>rd,$ZodCheckGreaterThan:()=>Wa,$ZodCheckIncludes:()=>td,$ZodCheckLengthEquals:()=>Yu,$ZodCheckLessThan:()=>Ba,$ZodCheckLowerCase:()=>Xu,$ZodCheckMaxLength:()=>Gu,$ZodCheckMaxSize:()=>Ju,$ZodCheckMimeType:()=>sd,$ZodCheckMinLength:()=>Ku,$ZodCheckMinSize:()=>Bu,$ZodCheckMultipleOf:()=>Vu,$ZodCheckNumberFormat:()=>Hu,$ZodCheckOverwrite:()=>id,$ZodCheckProperty:()=>nd,$ZodCheckRegex:()=>Qu,$ZodCheckSizeEquals:()=>Wu,$ZodCheckStartsWith:()=>od,$ZodCheckStringFormat:()=>Bo,$ZodCheckUpperCase:()=>ed,$ZodCodec:()=>os,$ZodCustom:()=>Sp,$ZodCustomStringFormat:()=>Nd,$ZodDate:()=>Hd,$ZodDefault:()=>sp,$ZodDiscriminatedUnion:()=>Wd,$ZodE164:()=>Id,$ZodEmail:()=>dd,$ZodEmoji:()=>hd,$ZodEncodeError:()=>gt,$ZodEnum:()=>Xd,$ZodError:()=>Wn,$ZodExactOptional:()=>rp,$ZodFile:()=>tp,$ZodFunction:()=>mp,$ZodGUID:()=>ld,$ZodIPv4:()=>wd,$ZodIPv6:()=>xd,$ZodISODate:()=>vd,$ZodISODateTime:()=>bd,$ZodISODuration:()=>Rd,$ZodISOTime:()=>zd,$ZodIntersection:()=>Gd,$ZodJWT:()=>Od,$ZodKSUID:()=>yd,$ZodLazy:()=>gp,$ZodLiteral:()=>ep,$ZodMAC:()=>Pd,$ZodMap:()=>Yd,$ZodNaN:()=>up,$ZodNanoID:()=>md,$ZodNever:()=>Dd,$ZodNonOptional:()=>ap,$ZodNull:()=>Ld,$ZodNullable:()=>np,$ZodNumber:()=>Xa,$ZodNumberFormat:()=>Md,$ZodObject:()=>ig,$ZodObjectJIT:()=>Jd,$ZodOptional:()=>oc,$ZodPipe:()=>rc,$ZodPrefault:()=>ip,$ZodPreprocess:()=>dp,$ZodPromise:()=>fp,$ZodReadonly:()=>pp,$ZodRealError:()=>ye,$ZodRecord:()=>Kd,$ZodRegistry:()=>sc,$ZodSet:()=>Qd,$ZodString:()=>Xt,$ZodStringFormat:()=>D,$ZodSuccess:()=>cp,$ZodSymbol:()=>Ad,$ZodTemplateLiteral:()=>hp,$ZodTransform:()=>op,$ZodTuple:()=>tc,$ZodType:()=>N,$ZodULID:()=>Sd,$ZodURL:()=>pd,$ZodUUID:()=>ud,$ZodUndefined:()=>jd,$ZodUnion:()=>ts,$ZodUnknown:()=>Zd,$ZodVoid:()=>Vd,$ZodXID:()=>_d,$ZodXor:()=>Bd,$brand:()=>Yl,$constructor:()=>h,$input:()=>yp,$output:()=>_p,Doc:()=>Xn,JSONSchema:()=>lg,JSONSchemaGenerator:()=>Mc,NEVER:()=>Zn,TimePrecision:()=>Rp,_any:()=>Hp,_array:()=>Yp,_base64:()=>Rc,_base64url:()=>wc,_bigint:()=>Ap,_boolean:()=>Mp,_catch:()=>fb,_check:()=>cg,_cidrv4:()=>vc,_cidrv6:()=>zc,_coercedBigint:()=>jp,_coercedBoolean:()=>qp,_coercedDate:()=>Gp,_coercedNumber:()=>Ep,_coercedString:()=>vp,_cuid:()=>mc,_cuid2:()=>fc,_custom:()=>Xp,_date:()=>Wp,_decode:()=>ja,_decodeAsync:()=>Ua,_default:()=>pb,_discriminatedUnion:()=>eb,_e164:()=>xc,_email:()=>ac,_emoji:()=>pc,_encode:()=>Aa,_encodeAsync:()=>La,_endsWith:()=>Xo,_enum:()=>ib,_file:()=>Qp,_float32:()=>Cp,_float64:()=>Ip,_gt:()=>je,_gte:()=>fe,_guid:()=>ns,_includes:()=>Yo,_int:()=>$p,_int32:()=>Op,_int64:()=>Lp,_intersection:()=>tb,_ipv4:()=>yc,_ipv6:()=>bc,_isoDate:()=>xp,_isoDateTime:()=>wp,_isoDuration:()=>Tp,_isoTime:()=>Pp,_jwt:()=>Pc,_ksuid:()=>_c,_lazy:()=>yb,_length:()=>oo,_literal:()=>cb,_lowercase:()=>Go,_lt:()=>Ae,_lte:()=>we,_mac:()=>zp,_map:()=>nb,_max:()=>we,_maxLength:()=>to,_maxSize:()=>zt,_mime:()=>er,_min:()=>fe,_minLength:()=>et,_minSize:()=>Le,_multipleOf:()=>vt,_nan:()=>Kp,_nanoid:()=>hc,_nativeEnum:()=>ab,_negative:()=>kc,_never:()=>Jp,_nonnegative:()=>$c,_nonoptional:()=>hb,_nonpositive:()=>Ec,_normalize:()=>tr,_null:()=>Vp,_nullable:()=>db,_number:()=>kp,_optional:()=>ub,_overwrite:()=>Ie,_parse:()=>Vo,_parseAsync:()=>Ho,_pipe:()=>gb,_positive:()=>Tc,_promise:()=>bb,_property:()=>Cc,_readonly:()=>Sb,_record:()=>rb,_refine:()=>eh,_regex:()=>Wo,_safeDecode:()=>Da,_safeDecodeAsync:()=>Ha,_safeEncode:()=>Za,_safeEncodeAsync:()=>Va,_safeParse:()=>Fo,_safeParseAsync:()=>Jo,_set:()=>sb,_size:()=>eo,_slugify:()=>sr,_startsWith:()=>Qo,_string:()=>bp,_stringFormat:()=>ir,_stringbool:()=>nh,_success:()=>mb,_superRefine:()=>th,_symbol:()=>Zp,_templateLiteral:()=>_b,_toLowerCase:()=>rr,_toUpperCase:()=>nr,_transform:()=>lb,_trim:()=>or,_tuple:()=>ob,_uint32:()=>Np,_uint64:()=>Up,_ulid:()=>gc,_undefined:()=>Dp,_union:()=>Qy,_unknown:()=>Fp,_uppercase:()=>Ko,_url:()=>ss,_uuid:()=>cc,_uuidv4:()=>lc,_uuidv6:()=>uc,_uuidv7:()=>dc,_void:()=>Bp,_xid:()=>Sc,_xor:()=>Xy,clone:()=>he,config:()=>Y,createStandardJSONSchemaMethod:()=>ar,createToJSONSchemaMethod:()=>sh,decode:()=>fy,decodeAsync:()=>Sy,describe:()=>oh,encode:()=>my,encodeAsync:()=>gy,extractDefs:()=>wt,finalize:()=>xt,flattenError:()=>Gn,formatError:()=>Kn,globalConfig:()=>Kt,globalRegistry:()=>re,initializeContext:()=>Rt,isValidBase64:()=>Ed,isValidBase64URL:()=>og,isValidJWT:()=>rg,locales:()=>rs,meta:()=>rh,parse:()=>Ma,parseAsync:()=>qa,prettifyError:()=>du,process:()=>Z,regexes:()=>Re,registry:()=>ic,safeDecode:()=>yy,safeDecodeAsync:()=>vy,safeEncode:()=>_y,safeEncodeAsync:()=>by,safeParse:()=>pu,safeParseAsync:()=>hu,toDotPath:()=>Mf,toJSONSchema:()=>ro,treeifyError:()=>uu,util:()=>O,version:()=>ad});var $f,Zn=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 u=i.prototype,m=Object.keys(u);for(let S=0;S<m.length;S++){let _=m[S];_ in c||(c[_]=u[_].bind(c))}}let n=o?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function i(c){var l;let u=o?.Parent?new s:this;r(u,c),(l=u._zod).deferred??(l.deferred=[]);for(let m of u._zod.deferred)m();return u}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 Yl=Symbol("zod_brand"),Ce=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},gt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};($f=globalThis).__zod_globalConfig??($f.__zod_globalConfig={});var Kt=globalThis.__zod_globalConfig;function Y(e){return e&&Object.assign(Kt,e),Kt}var O={};Qe(O,{BIGINT_FORMAT_RANGES:()=>au,Class:()=>Xl,NUMBER_FORMAT_RANGES:()=>iu,aborted:()=>bt,allowsEval:()=>ou,assert:()=>J_,assertEqual:()=>D_,assertIs:()=>H_,assertNever:()=>F_,assertNotEqual:()=>V_,assignProp:()=>_t,base64ToUint8Array:()=>If,base64urlToUint8Array:()=>ly,cached:()=>Zo,captureStackTrace:()=>Oa,cleanEnum:()=>cy,cleanRegex:()=>Hn,clone:()=>he,cloneDef:()=>W_,createTransparentProxy:()=>ey,defineLazy:()=>A,esc:()=>Ia,escapeRegex:()=>ke,explicitlyAborted:()=>cu,extend:()=>ry,finalizeIssue:()=>me,floatSafeRemainder:()=>eu,getElementAtPath:()=>G_,getEnumValues:()=>Vn,getLengthableOrigin:()=>Bn,getParsedType:()=>X_,getSizableOrigin:()=>Jn,hexToUint8Array:()=>dy,isObject:()=>Yt,isPlainObject:()=>yt,issue:()=>Do,joinValues:()=>Ca,jsonStringifyReplacer:()=>Uo,merge:()=>sy,mergeDefs:()=>Xe,normalizeParams:()=>v,nullish:()=>St,numKeys:()=>Q_,objectClone:()=>B_,omit:()=>oy,optionalKeys:()=>su,parsedType:()=>lu,partial:()=>iy,pick:()=>ty,prefixIssues:()=>_e,primitiveTypes:()=>nu,promiseAllObject:()=>K_,propertyKeyTypes:()=>Fn,randomString:()=>Y_,required:()=>ay,safeExtend:()=>ny,shallowClone:()=>ru,slugify:()=>tu,stringifyPrimitive:()=>Na,uint8ArrayToBase64:()=>Of,uint8ArrayToBase64url:()=>uy,uint8ArrayToHex:()=>py,unwrapMessage:()=>Dn});function D_(e){return e}function V_(e){return e}function H_(e){}function F_(e){throw new Error("Unexpected value in exhaustive check")}function J_(e){}function Vn(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 Ca(e,t="|"){return e.map(o=>Na(o)).join(t)}function Uo(e,t){return typeof t=="bigint"?t.toString():t}function Zo(e){return{get value(){{let o=e();return Object.defineProperty(this,"value",{value:o}),o}throw new Error("cached value already set")}}}function St(e){return e==null}function Hn(e){let t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function eu(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 Cf=Symbol("evaluating");function A(e,t,o){let r;Object.defineProperty(e,t,{get(){if(r!==Cf)return r===void 0&&(r=Cf,r=o()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function B_(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function _t(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function Xe(...e){let t={};for(let o of e){let r=Object.getOwnPropertyDescriptors(o);Object.assign(t,r)}return Object.defineProperties({},t)}function W_(e){return Xe(e._zod.def)}function G_(e,t){return t?t.reduce((o,r)=>o?.[r],e):e}function K_(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 Y_(e=10){let t="abcdefghijklmnopqrstuvwxyz",o="";for(let r=0;r<e;r++)o+=t[Math.floor(Math.random()*t.length)];return o}function Ia(e){return JSON.stringify(e)}function tu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Oa="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ou=Zo(()=>{if(Kt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function yt(e){if(Yt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let o=t.prototype;return!(Yt(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function ru(e){return yt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Q_(e){let t=0;for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&t++;return t}var X_=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}`)}},Fn=new Set(["string","number","symbol"]),nu=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 v(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 ey(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 Na(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function su(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var iu={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]},au={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ty(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=Xe(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 _t(this,"shape",i),i},checks:[]});return he(e,s)}function oy(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=Xe(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 _t(this,"shape",i),i},checks:[]});return he(e,s)}function ry(e,t){if(!yt(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=Xe(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return _t(this,"shape",s),s}});return he(e,n)}function ny(e,t){if(!yt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let o=Xe(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return _t(this,"shape",r),r}});return he(e,o)}function sy(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=Xe(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return _t(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return he(e,o)}function iy(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=Xe(t._zod.def,{get shape(){let c=t._zod.def.shape,l={...c};if(o)for(let u in o){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);o[u]&&(l[u]=e?new e({type:"optional",innerType:c[u]}):c[u])}else for(let u in c)l[u]=e?new e({type:"optional",innerType:c[u]}):c[u];return _t(this,"shape",l),l},checks:[]});return he(t,i)}function ay(e,t,o){let r=Xe(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 _t(this,"shape",s),s}});return he(t,r)}function bt(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 cu(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 Dn(e){return typeof e=="string"?e:e?.message}function me(e,t,o){let r=e.message?e.message:Dn(e.inst?._zod.def?.error?.(e))??Dn(t?.error?.(e))??Dn(o.customError?.(e))??Dn(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 Jn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Bn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function lu(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 Do(...e){let[t,o,r]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:r}:{...t}}function cy(e){return Object.entries(e).filter(([t,o])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function If(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 Of(e){let t="";for(let o=0;o<e.length;o++)t+=String.fromCharCode(e[o]);return btoa(t)}function ly(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-t.length%4)%4);return If(t+o)}function uy(e){return Of(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function dy(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 py(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Xl=class{constructor(...t){}};var Nf=(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,Uo,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Wn=h("$ZodError",Nf),ye=h("$ZodError",Nf,{Parent:Error});function Gn(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 Kn(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,u=0;for(;u<c.length;){let m=c[u];u===c.length-1?(l[m]=l[m]||{_errors:[]},l[m]._errors.push(t(i))):l[m]=l[m]||{_errors:[]},l=l[m],u++}}}};return r(e),o}function uu(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(u=>r({issues:u},[...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 u=[...s,...l.path];if(u.length===0){o.errors.push(t(l));continue}let m=o,S=0;for(;S<u.length;){let _=u[S],y=S===u.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 Mf(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 du(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 ${Mf(r.path)}`);return t.join(`
|
|
2
|
+
`)}var Vo=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 Oa(c,n?.callee),c}return i.value},Ma=Vo(ye),Ho=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 Oa(c,n?.callee),c}return i.value},qa=Ho(ye),Fo=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??Wn)(s.issues.map(i=>me(i,n,Y())))}:{success:!0,data:s.value}},pu=Fo(ye),Jo=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}},hu=Jo(ye),Aa=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Vo(e)(t,o,n)},my=Aa(ye),ja=e=>(t,o,r)=>Vo(e)(t,o,r),fy=ja(ye),La=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Ho(e)(t,o,n)},gy=La(ye),Ua=e=>async(t,o,r)=>Ho(e)(t,o,r),Sy=Ua(ye),Za=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Fo(e)(t,o,n)},_y=Za(ye),Da=e=>(t,o,r)=>Fo(e)(t,o,r),yy=Da(ye),Va=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Jo(e)(t,o,n)},by=Va(ye),Ha=e=>async(t,o,r)=>Jo(e)(t,o,r),vy=Ha(ye);var Re={};Qe(Re,{base64:()=>Eu,base64url:()=>Fa,bigint:()=>qu,boolean:()=>ju,browserEmail:()=>Ey,cidrv4:()=>Tu,cidrv6:()=>ku,cuid:()=>mu,cuid2:()=>fu,date:()=>Iu,datetime:()=>Nu,domain:()=>Iy,duration:()=>bu,e164:()=>Cu,email:()=>zu,emoji:()=>Ru,extendedDuration:()=>zy,guid:()=>vu,hex:()=>Oy,hostname:()=>Cy,html5Email:()=>Py,httpProtocol:()=>$u,idnEmail:()=>ky,integer:()=>Au,ipv4:()=>wu,ipv6:()=>xu,ksuid:()=>_u,lowercase:()=>Zu,mac:()=>Pu,md5_base64:()=>My,md5_base64url:()=>qy,md5_hex:()=>Ny,nanoid:()=>yu,null:()=>Lu,number:()=>Ja,rfc5322Email:()=>Ty,sha1_base64:()=>jy,sha1_base64url:()=>Ly,sha1_hex:()=>Ay,sha256_base64:()=>Zy,sha256_base64url:()=>Dy,sha256_hex:()=>Uy,sha384_base64:()=>Hy,sha384_base64url:()=>Fy,sha384_hex:()=>Vy,sha512_base64:()=>By,sha512_base64url:()=>Wy,sha512_hex:()=>Jy,string:()=>Mu,time:()=>Ou,ulid:()=>gu,undefined:()=>Uu,unicodeEmail:()=>qf,uppercase:()=>Du,uuid:()=>Qt,uuid4:()=>Ry,uuid6:()=>wy,uuid7:()=>xy,xid:()=>Su});var mu=/^[cC][0-9a-z]{6,}$/,fu=/^[0-9a-z]+$/,gu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Su=/^[0-9a-vA-V]{20}$/,_u=/^[A-Za-z0-9]{27}$/,yu=/^[a-zA-Z0-9_-]{21}$/,bu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zy=/^[-+]?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)?)??$/,vu=/^([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})$/,Qt=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)$/,Ry=Qt(4),wy=Qt(6),xy=Qt(7),zu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Py=/^[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])?)*$/,Ty=/^(([^<>()\[\]\\.,;:\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,}))$/,qf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ky=qf,Ey=/^[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])?)*$/,$y="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ru(){return new RegExp($y,"u")}var wu=/^(?:(?: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])$/,xu=/^(([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}|:))$/,Pu=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}$`)},Tu=/^((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])$/,ku=/^(([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])$/,Eu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Fa=/^[A-Za-z0-9_-]*$/,Cy=/^(?=.{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])?)*\.?$/,Iy=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,$u=/^https?$/,Cu=/^\+[1-9]\d{6,14}$/,Af="(?:(?:\\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])))",Iu=new RegExp(`^${Af}$`);function jf(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 Ou(e){return new RegExp(`^${jf(e)}$`)}function Nu(e){let t=jf({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(`^${Af}T(?:${r})$`)}var Mu=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},qu=/^-?\d+n?$/,Au=/^-?\d+$/,Ja=/^-?\d+(?:\.\d+)?$/,ju=/^(?:true|false)$/i,Lu=/^null$/i;var Uu=/^undefined$/i;var Zu=/^[^A-Z]*$/,Du=/^[^a-z]*$/,Oy=/^[0-9a-fA-F]*$/;function Yn(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Qn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Ny=/^[0-9a-fA-F]{32}$/,My=Yn(22,"=="),qy=Qn(22),Ay=/^[0-9a-fA-F]{40}$/,jy=Yn(27,"="),Ly=Qn(27),Uy=/^[0-9a-fA-F]{64}$/,Zy=Yn(43,"="),Dy=Qn(43),Vy=/^[0-9a-fA-F]{96}$/,Hy=Yn(64,""),Fy=Qn(64),Jy=/^[0-9a-fA-F]{128}$/,By=Yn(86,"=="),Wy=Qn(86);var H=h("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),Uf={number:"number",bigint:"bigint",object:"date"},Ba=h("$ZodCheckLessThan",(e,t)=>{H.init(e,t);let o=Uf[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})}}),Wa=h("$ZodCheckGreaterThan",(e,t)=>{H.init(e,t);let o=Uf[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})}}),Vu=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):eu(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})}}),Hu=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]=iu[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=Au)}),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})}}),Fu=h("$ZodCheckBigIntFormat",(e,t)=>{H.init(e,t);let[o,r]=au[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})}}),Ju=h("$ZodCheckMaxSize",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!St(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:Jn(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Bu=h("$ZodCheckMinSize",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!St(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:Jn(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Wu=h("$ZodCheckSizeEquals",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!St(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:Jn(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})}}),Gu=h("$ZodCheckMaxLength",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!St(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=Bn(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ku=h("$ZodCheckMinLength",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!St(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=Bn(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Yu=h("$ZodCheckLengthEquals",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!St(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=Bn(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})}}),Bo=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=()=>{})}),Qu=h("$ZodCheckRegex",(e,t)=>{Bo.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})}}),Xu=h("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Zu),Bo.init(e,t)}),ed=h("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Du),Bo.init(e,t)}),td=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})}}),od=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})}}),rd=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 Lf(e,t,o){e.issues.length&&t.issues.push(..._e(o,e.issues))}var nd=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=>Lf(n,o,t.property));Lf(r,o,t.property)}}),sd=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})}}),id=h("$ZodCheckOverwrite",(e,t)=>{H.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});var Xn=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 ad={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=ad;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 u=bt(i),m;for(let S of c){if(S._zod.def.when){if(cu(i)||!S._zod.def.when(i))continue}else if(u)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!==_&&(u||(u=bt(i,_)))});else{if(i.issues.length===_)continue;u||(u=bt(i,_))}}return m?m.then(()=>i):i},s=(i,c,l)=>{if(bt(i))return i.aborted=!0,i;let u=n(c,r,l);if(u instanceof Promise){if(l.async===!1)throw new Ce;return u.then(m=>e._zod.parse(m,l))}return e._zod.parse(u,l)};e._zod.run=(i,c)=>{if(c.skipChecks)return e._zod.parse(i,c);if(c.direction==="backward"){let u=e._zod.parse({value:i.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(m=>s(m,i,c)):s(u,i,c)}let l=e._zod.parse(i,c);if(l instanceof Promise){if(c.async===!1)throw new Ce;return l.then(u=>n(u,r,c))}return n(l,r,c)}}A(e,"~standard",()=>({validate:n=>{try{let s=pu(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return hu(e,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Xt=h("$ZodString",(e,t)=>{N.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Mu(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)=>{Bo.init(e,t),Xt.init(e,t)}),ld=h("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=zu),D.init(e,t)}),ud=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=Qt(r))}else t.pattern??(t.pattern=Qt());D.init(e,t)}),dd=h("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=vu),D.init(e,t)}),pd=h("$ZodURL",(e,t)=>{D.init(e,t),e._zod.check=o=>{try{let r=o.value.trim();if(!t.normalize&&t.protocol?.source===$u.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})}}}),hd=h("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ru()),D.init(e,t)}),md=h("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=yu),D.init(e,t)}),fd=h("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=mu),D.init(e,t)}),gd=h("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=fu),D.init(e,t)}),Sd=h("$ZodULID",(e,t)=>{t.pattern??(t.pattern=gu),D.init(e,t)}),_d=h("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Su),D.init(e,t)}),yd=h("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=_u),D.init(e,t)}),bd=h("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Nu(t)),D.init(e,t)}),zd=h("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Iu),D.init(e,t)}),vd=h("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ou(t)),D.init(e,t)}),Rd=h("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=bu),D.init(e,t)}),wd=h("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=wu),D.init(e,t),e._zod.bag.format="ipv4"}),xd=h("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=xu),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})}}}),Pd=h("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Pu(t.delimiter)),D.init(e,t),e._zod.bag.format="mac"}),Td=h("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Tu),D.init(e,t)}),kd=h("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ku),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 Ed(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var $d=h("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Eu),D.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=o=>{Ed(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function og(e){if(!Fa.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ed(o)}var Cd=h("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Fa),D.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=o=>{og(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),Id=h("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Cu),D.init(e,t)});function rg(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 Od=h("$ZodJWT",(e,t)=>{D.init(e,t),e._zod.check=o=>{rg(o.value,t.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),Nd=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})}}),Xa=h("$ZodNumber",(e,t)=>{N.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ja,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}}),Md=h("$ZodNumberFormat",(e,t)=>{Hu.init(e,t),Xa.init(e,t)}),Xn=h("$ZodBoolean",(e,t)=>{N.init(e,t),e._zod.pattern=ju,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}}),ec=h("$ZodBigInt",(e,t)=>{N.init(e,t),e._zod.pattern=qu,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}}),qd=h("$ZodBigIntFormat",(e,t)=>{Fu.init(e,t),ec.init(e,t)}),Ad=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}}),jd=h("$ZodUndefined",(e,t)=>{N.init(e,t),e._zod.pattern=Uu,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}}),Ld=h("$ZodNull",(e,t)=>{N.init(e,t),e._zod.pattern=Lu,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}}),Ud=h("$ZodAny",(e,t)=>{N.init(e,t),e._zod.parse=o=>o}),Zd=h("$ZodUnknown",(e,t)=>{N.init(e,t),e._zod.parse=o=>o}),Dd=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)}),Vd=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}}),Hd=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 Df(e,t,o){e.issues.length&&t.issues.push(..._e(o,e.issues)),t.value[o]=e.value}var Fd=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(u=>Df(u,o,i))):Df(l,o,i)}return s.length?Promise.all(s).then(()=>o):o}});function Qa(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 ng(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=su(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function sg(e,t,o,r,n,s){let i=[],c=n.keySet,l=n.catchall._zod,u=l.def.type,m=l.optin==="optional",S=l.optout==="optional";for(let _ in t){if(_==="__proto__"||c.has(_))continue;if(u==="never"){i.push(_);continue}let y=l.run({value:t[_],issues:[]},r);y instanceof Promise?e.push(y.then(P=>Qa(P,o,_,t,m,S))):Qa(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 ig=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=Zo(()=>ng(t));A(e._zod,"propValues",()=>{let c=t.shape,l={};for(let u in c){let m=c[u]._zod;if(m.values){l[u]??(l[u]=new Set);for(let S of m.values)l[u].add(S)}}return l});let n=Yt,s=t.catchall,i;e._zod.parse=(c,l)=>{i??(i=r.value);let u=c.value;if(!n(u))return c.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),c;c.value={};let m=[],S=i.shape;for(let _ of i.keys){let y=S[_],P=y._zod.optin==="optional",E=y._zod.optout==="optional",C=y._zod.run({value:u[_],issues:[]},l);C instanceof Promise?m.push(C.then(q=>Qa(q,c,_,u,P,E))):Qa(C,c,_,u,P,E)}return s?sg(m,u,c,l,r.value,e):m.length?Promise.all(m).then(()=>c):c}}),Jd=h("$ZodObjectJIT",(e,t)=>{ig.init(e,t);let o=e._zod.parse,r=Zo(()=>ng(t)),n=_=>{let y=new Qn(["shape","payload","ctx"]),P=r.value,E=L=>{let U=Ia(L);return`shape[${U}]._zod.run({ value: input[${U}], issues: [] }, ctx)`};y.write("const input = payload.value;");let C=Object.create(null),q=0;for(let L of P.keys)C[L]=`key_${q++}`;y.write("const newResult = {};");for(let L of P.keys){let U=C[L],B=Ia(L),F=_[L],ee=F?._zod?.optin==="optional",Ge=F?._zod?.optout==="optional";y.write(`const ${U} = ${E(L)};`),ee&&Ge?y.write(`
|
|
4
|
+
`))}};var ad={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=ad;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 u=bt(i),m;for(let S of c){if(S._zod.def.when){if(cu(i)||!S._zod.def.when(i))continue}else if(u)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!==_&&(u||(u=bt(i,_)))});else{if(i.issues.length===_)continue;u||(u=bt(i,_))}}return m?m.then(()=>i):i},s=(i,c,l)=>{if(bt(i))return i.aborted=!0,i;let u=n(c,r,l);if(u instanceof Promise){if(l.async===!1)throw new Ce;return u.then(m=>e._zod.parse(m,l))}return e._zod.parse(u,l)};e._zod.run=(i,c)=>{if(c.skipChecks)return e._zod.parse(i,c);if(c.direction==="backward"){let u=e._zod.parse({value:i.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(m=>s(m,i,c)):s(u,i,c)}let l=e._zod.parse(i,c);if(l instanceof Promise){if(c.async===!1)throw new Ce;return l.then(u=>n(u,r,c))}return n(l,r,c)}}A(e,"~standard",()=>({validate:n=>{try{let s=pu(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return hu(e,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Xt=h("$ZodString",(e,t)=>{N.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Mu(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)=>{Bo.init(e,t),Xt.init(e,t)}),ld=h("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=vu),D.init(e,t)}),ud=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=Qt(r))}else t.pattern??(t.pattern=Qt());D.init(e,t)}),dd=h("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=zu),D.init(e,t)}),pd=h("$ZodURL",(e,t)=>{D.init(e,t),e._zod.check=o=>{try{let r=o.value.trim();if(!t.normalize&&t.protocol?.source===$u.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})}}}),hd=h("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ru()),D.init(e,t)}),md=h("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=yu),D.init(e,t)}),fd=h("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=mu),D.init(e,t)}),gd=h("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=fu),D.init(e,t)}),Sd=h("$ZodULID",(e,t)=>{t.pattern??(t.pattern=gu),D.init(e,t)}),_d=h("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Su),D.init(e,t)}),yd=h("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=_u),D.init(e,t)}),bd=h("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Nu(t)),D.init(e,t)}),vd=h("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Iu),D.init(e,t)}),zd=h("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ou(t)),D.init(e,t)}),Rd=h("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=bu),D.init(e,t)}),wd=h("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=wu),D.init(e,t),e._zod.bag.format="ipv4"}),xd=h("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=xu),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})}}}),Pd=h("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Pu(t.delimiter)),D.init(e,t),e._zod.bag.format="mac"}),Td=h("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Tu),D.init(e,t)}),kd=h("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ku),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 Ed(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var $d=h("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Eu),D.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=o=>{Ed(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function og(e){if(!Fa.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ed(o)}var Cd=h("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Fa),D.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=o=>{og(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),Id=h("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Cu),D.init(e,t)});function rg(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 Od=h("$ZodJWT",(e,t)=>{D.init(e,t),e._zod.check=o=>{rg(o.value,t.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),Nd=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})}}),Xa=h("$ZodNumber",(e,t)=>{N.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ja,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}}),Md=h("$ZodNumberFormat",(e,t)=>{Hu.init(e,t),Xa.init(e,t)}),es=h("$ZodBoolean",(e,t)=>{N.init(e,t),e._zod.pattern=ju,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}}),ec=h("$ZodBigInt",(e,t)=>{N.init(e,t),e._zod.pattern=qu,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}}),qd=h("$ZodBigIntFormat",(e,t)=>{Fu.init(e,t),ec.init(e,t)}),Ad=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}}),jd=h("$ZodUndefined",(e,t)=>{N.init(e,t),e._zod.pattern=Uu,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}}),Ld=h("$ZodNull",(e,t)=>{N.init(e,t),e._zod.pattern=Lu,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}}),Ud=h("$ZodAny",(e,t)=>{N.init(e,t),e._zod.parse=o=>o}),Zd=h("$ZodUnknown",(e,t)=>{N.init(e,t),e._zod.parse=o=>o}),Dd=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)}),Vd=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}}),Hd=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 Df(e,t,o){e.issues.length&&t.issues.push(..._e(o,e.issues)),t.value[o]=e.value}var Fd=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(u=>Df(u,o,i))):Df(l,o,i)}return s.length?Promise.all(s).then(()=>o):o}});function Qa(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 ng(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=su(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function sg(e,t,o,r,n,s){let i=[],c=n.keySet,l=n.catchall._zod,u=l.def.type,m=l.optin==="optional",S=l.optout==="optional";for(let _ in t){if(_==="__proto__"||c.has(_))continue;if(u==="never"){i.push(_);continue}let y=l.run({value:t[_],issues:[]},r);y instanceof Promise?e.push(y.then(P=>Qa(P,o,_,t,m,S))):Qa(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 ig=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=Zo(()=>ng(t));A(e._zod,"propValues",()=>{let c=t.shape,l={};for(let u in c){let m=c[u]._zod;if(m.values){l[u]??(l[u]=new Set);for(let S of m.values)l[u].add(S)}}return l});let n=Yt,s=t.catchall,i;e._zod.parse=(c,l)=>{i??(i=r.value);let u=c.value;if(!n(u))return c.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),c;c.value={};let m=[],S=i.shape;for(let _ of i.keys){let y=S[_],P=y._zod.optin==="optional",E=y._zod.optout==="optional",C=y._zod.run({value:u[_],issues:[]},l);C instanceof Promise?m.push(C.then(q=>Qa(q,c,_,u,P,E))):Qa(C,c,_,u,P,E)}return s?sg(m,u,c,l,r.value,e):m.length?Promise.all(m).then(()=>c):c}}),Jd=h("$ZodObjectJIT",(e,t)=>{ig.init(e,t);let o=e._zod.parse,r=Zo(()=>ng(t)),n=_=>{let y=new Xn(["shape","payload","ctx"]),P=r.value,E=L=>{let U=Ia(L);return`shape[${U}]._zod.run({ value: input[${U}], issues: [] }, ctx)`};y.write("const input = payload.value;");let C=Object.create(null),q=0;for(let L of P.keys)C[L]=`key_${q++}`;y.write("const newResult = {};");for(let L of P.keys){let U=C[L],B=Ia(L),F=_[L],ee=F?._zod?.optin==="optional",Ge=F?._zod?.optout==="optional";y.write(`const ${U} = ${E(L)};`),ee&&Ge?y.write(`
|
|
5
5
|
if (${U}.issues.length) {
|
|
6
6
|
if (${B} in input) {
|
|
7
7
|
payload.issues = payload.issues.concat(${U}.issues.map(iss => ({
|
|
@@ -60,9 +60,9 @@ var N_=Object.defineProperty;var Qe=(e,t)=>{for(var o in t)N_(e,o,{get:t[o],enum
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
`)}y.write("payload.value = newResult;"),y.write("return payload;");let J=y.compile();return(L,U)=>J(_,L,U)},s,i=Yt,c=!Kt.jitless,u=c&&ou.value,m=t.catchall,S;e._zod.parse=(_,y)=>{S??(S=r.value);let P=_.value;return i(P)?c&&u&&y?.async===!1&&y.jitless!==!0?(s||(s=n(t.shape)),_=s(_,y),m?sg([],P,_,y,S,e):_):o(_,y):(_.issues.push({expected:"object",code:"invalid_type",input:P,inst:e}),_)}});function Vf(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=>!bt(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 es=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=>Vn(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=>Vf(c,r,e,n)):Vf(i,r,e,n)}});function Hf(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 Bd=h("$ZodXor",(e,t)=>{es.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=>Hf(c,r,e,n)):Hf(i,r,e,n)}}),Wd=h("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,es.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 u of l)n[c].add(u)}}return n});let r=Zo(()=>{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(!Yt(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)}}),Gd=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,u])=>Ff(o,l,u)):Ff(o,s,i)}});function cd(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(yt(e)&&yt(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=cd(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=cd(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 Ff(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}),bt(e))return e;let i=cd(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 tc=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=Jf(o,"optin"),l=Jf(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 u=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(_=>{u[m]=_})):u[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(P=>Bf(P,r,m))):Bf(y,r,m)}}return i.length?Promise.all(i).then(()=>Wf(u,r,o,s,l)):Wf(u,r,o,s,l)}});function Jf(e,t){for(let o=e.length-1;o>=0;o--)if(e[o]._zod[t]!=="optional")return o+1;return 0}function Bf(e,t,o){e.issues.length&&t.issues.push(..._e(o,e.issues)),t.value[o]=e.value}function Wf(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 Kd=h("$ZodRecord",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!yt(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 u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){c.add(typeof u=="number"?u.toString():u);let m=t.keyType._zod.run({value:u,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:u,path:[u],inst:e});continue}let S=m.value,_=t.valueType._zod.run({value:n[u],issues:[]},r);_ instanceof Promise?s.push(_.then(y=>{y.issues.length&&o.issues.push(..._e(u,y.issues)),o.value[S]=y.value})):(_.issues.length&&o.issues.push(..._e(u,_.issues)),o.value[S]=_.value)}let l;for(let u in n)c.has(u)||(l=l??[],l.push(u));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"&&Ja.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}}),Yd=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),u=t.valueType._zod.run({value:c,issues:[]},r);l instanceof Promise||u instanceof Promise?s.push(Promise.all([l,u]).then(([m,S])=>{Gf(m,S,o,i,n,e,r)})):Gf(l,u,o,i,n,e,r)}return s.length?Promise.all(s).then(()=>o):o}});function Gf(e,t,o,r,n,s,i){e.issues.length&&(Hn.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&&(Hn.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 Qd=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=>Kf(l,o))):Kf(c,o)}return s.length?Promise.all(s).then(()=>o):o}});function Kf(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Xd=h("$ZodEnum",(e,t)=>{N.init(e,t);let o=Dn(t.entries),r=new Set(o);e._zod.values=r,e._zod.pattern=new RegExp(`^(${o.filter(n=>Hn.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}}),ep=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}}),tp=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}}),op=h("$ZodTransform",(e,t)=>{N.init(e,t),e._zod.optin="optional",e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new gt(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 Yf(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var oc=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(`^(${Vn(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=>Yf(i,n)):Yf(s,n)}return o.value===void 0?o:t.innerType._zod.run(o,r)}}),rp=h("$ZodExactOptional",(e,t)=>{oc.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)}),np=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(`^(${Vn(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)}),sp=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=>Qf(s,t)):Qf(n,t)}});function Qf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ip=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))}),ap=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=>Xf(s,e)):Xf(n,e)}});function Xf(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 cp=h("$ZodSuccess",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new gt("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)}}),lp=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)}}),up=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)}),rc=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=>Ga(i,t.in,r)):Ga(s,t.in,r)}let n=t.in._zod.run(o,r);return n instanceof Promise?n.then(s=>Ga(s,t.out,r)):Ga(n,t.out,r)}});function Ga(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 ts=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=>Ka(i,t,r)):Ka(s,t,r)}else{let s=t.out._zod.run(o,r);return s instanceof Promise?s.then(i=>Ka(i,t,r)):Ka(s,t,r)}}});function Ka(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=>Ya(e,s,t.out,o)):Ya(e,n,t.out,o)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(s=>Ya(e,s,t.in,o)):Ya(e,n,t.in,o)}}function Ya(e,t,o,r){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},r)}var dp=h("$ZodPreprocess",(e,t)=>{rc.init(e,t)}),pp=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(eg):eg(n)}});function eg(e){return e.value=Object.freeze(e.value),e}var hp=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||nu.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)}),mp=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?Ma(e._def.input,r):r,s=Reflect.apply(o,this,n);return e._def.output?Ma(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 qa(e._def.input,r):r,s=await Reflect.apply(o,this,n);return e._def.output?await qa(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 tc({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)),fp=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))}),gp=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)}),Sp=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=>tg(s,o,r,e));tg(n,o,r,e)}});function tg(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(Do(n))}}var os={};Qe(os,{en:()=>nc});var Ky=()=>{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=lu(n.input),c=r[i]??i;return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${Na(n.values[0])}`:`Invalid option: expected one of ${Ca(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":""}: ${Ca(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 nc(){return{localeError:Ky()}}var ag,_p=Symbol("ZodOutput"),yp=Symbol("ZodInput"),sc=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 ic(){return new sc}(ag=globalThis).__zod_globalRegistry??(ag.__zod_globalRegistry=ic());var re=globalThis.__zod_globalRegistry;function bp(e,t){return new e({type:"string",...z(t)})}function zp(e,t){return new e({type:"string",coerce:!0,...z(t)})}function ac(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...z(t)})}function rs(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...z(t)})}function cc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...z(t)})}function lc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(t)})}function uc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(t)})}function dc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(t)})}function ns(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...z(t)})}function pc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...z(t)})}function hc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(t)})}function mc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...z(t)})}function fc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(t)})}function gc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...z(t)})}function Sc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...z(t)})}function _c(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(t)})}function yc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(t)})}function bc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(t)})}function vp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...z(t)})}function zc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(t)})}function vc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(t)})}function Rc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...z(t)})}function wc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...z(t)})}function xc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...z(t)})}function Pc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...z(t)})}var Rp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function wp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(t)})}function xp(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function Pp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function Tp(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function kp(e,t){return new e({type:"number",checks:[],...z(t)})}function Ep(e,t){return new e({type:"number",coerce:!0,checks:[],...z(t)})}function $p(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...z(t)})}function Cp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...z(t)})}function Ip(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...z(t)})}function Op(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...z(t)})}function Np(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...z(t)})}function Mp(e,t){return new e({type:"boolean",...z(t)})}function qp(e,t){return new e({type:"boolean",coerce:!0,...z(t)})}function Ap(e,t){return new e({type:"bigint",...z(t)})}function jp(e,t){return new e({type:"bigint",coerce:!0,...z(t)})}function Lp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...z(t)})}function Up(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...z(t)})}function Zp(e,t){return new e({type:"symbol",...z(t)})}function Dp(e,t){return new e({type:"undefined",...z(t)})}function Vp(e,t){return new e({type:"null",...z(t)})}function Hp(e){return new e({type:"any"})}function Fp(e){return new e({type:"unknown"})}function Jp(e,t){return new e({type:"never",...z(t)})}function Bp(e,t){return new e({type:"void",...z(t)})}function Wp(e,t){return new e({type:"date",...z(t)})}function Gp(e,t){return new e({type:"date",coerce:!0,...z(t)})}function Kp(e,t){return new e({type:"nan",...z(t)})}function Ae(e,t){return new Ba({check:"less_than",...z(t),value:e,inclusive:!1})}function we(e,t){return new Ba({check:"less_than",...z(t),value:e,inclusive:!0})}function je(e,t){return new Wa({check:"greater_than",...z(t),value:e,inclusive:!1})}function fe(e,t){return new Wa({check:"greater_than",...z(t),value:e,inclusive:!0})}function Tc(e){return je(0,e)}function kc(e){return Ae(0,e)}function Ec(e){return we(0,e)}function $c(e){return fe(0,e)}function zt(e,t){return new Vu({check:"multiple_of",...z(t),value:e})}function vt(e,t){return new Ju({check:"max_size",...z(t),maximum:e})}function Le(e,t){return new Bu({check:"min_size",...z(t),minimum:e})}function eo(e,t){return new Wu({check:"size_equals",...z(t),size:e})}function to(e,t){return new Gu({check:"max_length",...z(t),maximum:e})}function et(e,t){return new Ku({check:"min_length",...z(t),minimum:e})}function oo(e,t){return new Yu({check:"length_equals",...z(t),length:e})}function Wo(e,t){return new Qu({check:"string_format",format:"regex",...z(t),pattern:e})}function Go(e){return new Xu({check:"string_format",format:"lowercase",...z(e)})}function Ko(e){return new ed({check:"string_format",format:"uppercase",...z(e)})}function Yo(e,t){return new td({check:"string_format",format:"includes",...z(t),includes:e})}function Qo(e,t){return new od({check:"string_format",format:"starts_with",...z(t),prefix:e})}function Xo(e,t){return new rd({check:"string_format",format:"ends_with",...z(t),suffix:e})}function Cc(e,t,o){return new nd({check:"property",property:e,schema:t,...z(o)})}function er(e,t){return new sd({check:"mime_type",mime:e,...z(t)})}function Ie(e){return new id({check:"overwrite",tx:e})}function tr(e){return Ie(t=>t.normalize(e))}function or(){return Ie(e=>e.trim())}function rr(){return Ie(e=>e.toLowerCase())}function nr(){return Ie(e=>e.toUpperCase())}function sr(){return Ie(e=>tu(e))}function Yp(e,t,o){return new e({type:"array",element:t,...z(o)})}function Qy(e,t,o){return new e({type:"union",options:t,...z(o)})}function Xy(e,t,o){return new e({type:"union",options:t,inclusive:!1,...z(o)})}function eb(e,t,o,r){return new e({type:"union",options:o,discriminator:t,...z(r)})}function tb(e,t,o){return new e({type:"intersection",left:t,right:o})}function ob(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 rb(e,t,o,r){return new e({type:"record",keyType:t,valueType:o,...z(r)})}function nb(e,t,o,r){return new e({type:"map",keyType:t,valueType:o,...z(r)})}function sb(e,t,o){return new e({type:"set",valueType:t,...z(o)})}function ib(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 ab(e,t,o){return new e({type:"enum",entries:t,...z(o)})}function cb(e,t,o){return new e({type:"literal",values:Array.isArray(t)?t:[t],...z(o)})}function Qp(e,t){return new e({type:"file",...z(t)})}function lb(e,t){return new e({type:"transform",transform:t})}function ub(e,t){return new e({type:"optional",innerType:t})}function db(e,t){return new e({type:"nullable",innerType:t})}function pb(e,t,o){return new e({type:"default",innerType:t,get defaultValue(){return typeof o=="function"?o():ru(o)}})}function hb(e,t,o){return new e({type:"nonoptional",innerType:t,...z(o)})}function mb(e,t){return new e({type:"success",innerType:t})}function fb(e,t,o){return new e({type:"catch",innerType:t,catchValue:typeof o=="function"?o:()=>o})}function gb(e,t,o){return new e({type:"pipe",in:t,out:o})}function Sb(e,t){return new e({type:"readonly",innerType:t})}function _b(e,t,o){return new e({type:"template_literal",parts:t,...z(o)})}function yb(e,t){return new e({type:"lazy",getter:t})}function bb(e,t){return new e({type:"promise",innerType:t})}function Xp(e,t,o){let r=z(o);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function eh(e,t,o){return new e({type:"custom",check:"custom",fn:t,...z(o)})}function th(e,t){let o=cg(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Do(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(Do(s))}},e(r.value,r)),t);return o}function cg(e,t){let o=new H({check:"custom",...z(t)});return o._zod.check=e,o}function oh(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 rh(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 nh(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??ts,l=e.Boolean??Xn,u=e.String??Xt,m=new u({type:"string",error:o.error}),S=new l({type:"boolean",error:o.error}),_=new c({type:"pipe",in:m,out:S,transform:((y,P)=>{let E=y;return o.case!=="sensitive"&&(E=E.toLowerCase()),s.has(E)?!0:i.has(E)?!1:(P.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...i],input:P.value,inst:_,continue:!1}),{})}),reverseTransform:((y,P)=>y===!0?r[0]||"true":n[0]||"false"),error:o.error});return _}function ir(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 Rt(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,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),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 wt(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 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 u=`#/${c}/`,m=i[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:u+m}},s=i=>{if(i[1].schema.$ref)return;let c=i[1],{ref:l,defId:u}=n(i);c.def={...c.schema},u&&(c.defId=u);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
|
+
`)}y.write("payload.value = newResult;"),y.write("return payload;");let J=y.compile();return(L,U)=>J(_,L,U)},s,i=Yt,c=!Kt.jitless,u=c&&ou.value,m=t.catchall,S;e._zod.parse=(_,y)=>{S??(S=r.value);let P=_.value;return i(P)?c&&u&&y?.async===!1&&y.jitless!==!0?(s||(s=n(t.shape)),_=s(_,y),m?sg([],P,_,y,S,e):_):o(_,y):(_.issues.push({expected:"object",code:"invalid_type",input:P,inst:e}),_)}});function Vf(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=>!bt(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 ts=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=>Hn(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=>Vf(c,r,e,n)):Vf(i,r,e,n)}});function Hf(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 Bd=h("$ZodXor",(e,t)=>{ts.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=>Hf(c,r,e,n)):Hf(i,r,e,n)}}),Wd=h("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ts.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 u of l)n[c].add(u)}}return n});let r=Zo(()=>{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(!Yt(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)}}),Gd=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,u])=>Ff(o,l,u)):Ff(o,s,i)}});function cd(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(yt(e)&&yt(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=cd(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=cd(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 Ff(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}),bt(e))return e;let i=cd(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 tc=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=Jf(o,"optin"),l=Jf(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 u=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(_=>{u[m]=_})):u[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(P=>Bf(P,r,m))):Bf(y,r,m)}}return i.length?Promise.all(i).then(()=>Wf(u,r,o,s,l)):Wf(u,r,o,s,l)}});function Jf(e,t){for(let o=e.length-1;o>=0;o--)if(e[o]._zod[t]!=="optional")return o+1;return 0}function Bf(e,t,o){e.issues.length&&t.issues.push(..._e(o,e.issues)),t.value[o]=e.value}function Wf(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 Kd=h("$ZodRecord",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!yt(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 u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){c.add(typeof u=="number"?u.toString():u);let m=t.keyType._zod.run({value:u,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:u,path:[u],inst:e});continue}let S=m.value,_=t.valueType._zod.run({value:n[u],issues:[]},r);_ instanceof Promise?s.push(_.then(y=>{y.issues.length&&o.issues.push(..._e(u,y.issues)),o.value[S]=y.value})):(_.issues.length&&o.issues.push(..._e(u,_.issues)),o.value[S]=_.value)}let l;for(let u in n)c.has(u)||(l=l??[],l.push(u));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"&&Ja.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}}),Yd=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),u=t.valueType._zod.run({value:c,issues:[]},r);l instanceof Promise||u instanceof Promise?s.push(Promise.all([l,u]).then(([m,S])=>{Gf(m,S,o,i,n,e,r)})):Gf(l,u,o,i,n,e,r)}return s.length?Promise.all(s).then(()=>o):o}});function Gf(e,t,o,r,n,s,i){e.issues.length&&(Fn.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&&(Fn.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 Qd=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=>Kf(l,o))):Kf(c,o)}return s.length?Promise.all(s).then(()=>o):o}});function Kf(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Xd=h("$ZodEnum",(e,t)=>{N.init(e,t);let o=Vn(t.entries),r=new Set(o);e._zod.values=r,e._zod.pattern=new RegExp(`^(${o.filter(n=>Fn.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}}),ep=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}}),tp=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}}),op=h("$ZodTransform",(e,t)=>{N.init(e,t),e._zod.optin="optional",e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new gt(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 Yf(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var oc=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(`^(${Hn(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=>Yf(i,n)):Yf(s,n)}return o.value===void 0?o:t.innerType._zod.run(o,r)}}),rp=h("$ZodExactOptional",(e,t)=>{oc.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)}),np=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(`^(${Hn(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)}),sp=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=>Qf(s,t)):Qf(n,t)}});function Qf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ip=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))}),ap=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=>Xf(s,e)):Xf(n,e)}});function Xf(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 cp=h("$ZodSuccess",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new gt("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)}}),lp=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)}}),up=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)}),rc=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=>Ga(i,t.in,r)):Ga(s,t.in,r)}let n=t.in._zod.run(o,r);return n instanceof Promise?n.then(s=>Ga(s,t.out,r)):Ga(n,t.out,r)}});function Ga(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 os=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=>Ka(i,t,r)):Ka(s,t,r)}else{let s=t.out._zod.run(o,r);return s instanceof Promise?s.then(i=>Ka(i,t,r)):Ka(s,t,r)}}});function Ka(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=>Ya(e,s,t.out,o)):Ya(e,n,t.out,o)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(s=>Ya(e,s,t.in,o)):Ya(e,n,t.in,o)}}function Ya(e,t,o,r){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},r)}var dp=h("$ZodPreprocess",(e,t)=>{rc.init(e,t)}),pp=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(eg):eg(n)}});function eg(e){return e.value=Object.freeze(e.value),e}var hp=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||nu.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)}),mp=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?Ma(e._def.input,r):r,s=Reflect.apply(o,this,n);return e._def.output?Ma(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 qa(e._def.input,r):r,s=await Reflect.apply(o,this,n);return e._def.output?await qa(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 tc({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)),fp=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))}),gp=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)}),Sp=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=>tg(s,o,r,e));tg(n,o,r,e)}});function tg(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(Do(n))}}var rs={};Qe(rs,{en:()=>nc});var Ky=()=>{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=lu(n.input),c=r[i]??i;return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${Na(n.values[0])}`:`Invalid option: expected one of ${Ca(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":""}: ${Ca(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 nc(){return{localeError:Ky()}}var ag,_p=Symbol("ZodOutput"),yp=Symbol("ZodInput"),sc=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 ic(){return new sc}(ag=globalThis).__zod_globalRegistry??(ag.__zod_globalRegistry=ic());var re=globalThis.__zod_globalRegistry;function bp(e,t){return new e({type:"string",...v(t)})}function vp(e,t){return new e({type:"string",coerce:!0,...v(t)})}function ac(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...v(t)})}function ns(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...v(t)})}function cc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...v(t)})}function lc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...v(t)})}function uc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...v(t)})}function dc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...v(t)})}function ss(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...v(t)})}function pc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...v(t)})}function hc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...v(t)})}function mc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...v(t)})}function fc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...v(t)})}function gc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...v(t)})}function Sc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...v(t)})}function _c(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...v(t)})}function yc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...v(t)})}function bc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...v(t)})}function zp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...v(t)})}function vc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...v(t)})}function zc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...v(t)})}function Rc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...v(t)})}function wc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...v(t)})}function xc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...v(t)})}function Pc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...v(t)})}var Rp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function wp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...v(t)})}function xp(e,t){return new e({type:"string",format:"date",check:"string_format",...v(t)})}function Pp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...v(t)})}function Tp(e,t){return new e({type:"string",format:"duration",check:"string_format",...v(t)})}function kp(e,t){return new e({type:"number",checks:[],...v(t)})}function Ep(e,t){return new e({type:"number",coerce:!0,checks:[],...v(t)})}function $p(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...v(t)})}function Cp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...v(t)})}function Ip(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...v(t)})}function Op(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...v(t)})}function Np(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...v(t)})}function Mp(e,t){return new e({type:"boolean",...v(t)})}function qp(e,t){return new e({type:"boolean",coerce:!0,...v(t)})}function Ap(e,t){return new e({type:"bigint",...v(t)})}function jp(e,t){return new e({type:"bigint",coerce:!0,...v(t)})}function Lp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...v(t)})}function Up(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...v(t)})}function Zp(e,t){return new e({type:"symbol",...v(t)})}function Dp(e,t){return new e({type:"undefined",...v(t)})}function Vp(e,t){return new e({type:"null",...v(t)})}function Hp(e){return new e({type:"any"})}function Fp(e){return new e({type:"unknown"})}function Jp(e,t){return new e({type:"never",...v(t)})}function Bp(e,t){return new e({type:"void",...v(t)})}function Wp(e,t){return new e({type:"date",...v(t)})}function Gp(e,t){return new e({type:"date",coerce:!0,...v(t)})}function Kp(e,t){return new e({type:"nan",...v(t)})}function Ae(e,t){return new Ba({check:"less_than",...v(t),value:e,inclusive:!1})}function we(e,t){return new Ba({check:"less_than",...v(t),value:e,inclusive:!0})}function je(e,t){return new Wa({check:"greater_than",...v(t),value:e,inclusive:!1})}function fe(e,t){return new Wa({check:"greater_than",...v(t),value:e,inclusive:!0})}function Tc(e){return je(0,e)}function kc(e){return Ae(0,e)}function Ec(e){return we(0,e)}function $c(e){return fe(0,e)}function vt(e,t){return new Vu({check:"multiple_of",...v(t),value:e})}function zt(e,t){return new Ju({check:"max_size",...v(t),maximum:e})}function Le(e,t){return new Bu({check:"min_size",...v(t),minimum:e})}function eo(e,t){return new Wu({check:"size_equals",...v(t),size:e})}function to(e,t){return new Gu({check:"max_length",...v(t),maximum:e})}function et(e,t){return new Ku({check:"min_length",...v(t),minimum:e})}function oo(e,t){return new Yu({check:"length_equals",...v(t),length:e})}function Wo(e,t){return new Qu({check:"string_format",format:"regex",...v(t),pattern:e})}function Go(e){return new Xu({check:"string_format",format:"lowercase",...v(e)})}function Ko(e){return new ed({check:"string_format",format:"uppercase",...v(e)})}function Yo(e,t){return new td({check:"string_format",format:"includes",...v(t),includes:e})}function Qo(e,t){return new od({check:"string_format",format:"starts_with",...v(t),prefix:e})}function Xo(e,t){return new rd({check:"string_format",format:"ends_with",...v(t),suffix:e})}function Cc(e,t,o){return new nd({check:"property",property:e,schema:t,...v(o)})}function er(e,t){return new sd({check:"mime_type",mime:e,...v(t)})}function Ie(e){return new id({check:"overwrite",tx:e})}function tr(e){return Ie(t=>t.normalize(e))}function or(){return Ie(e=>e.trim())}function rr(){return Ie(e=>e.toLowerCase())}function nr(){return Ie(e=>e.toUpperCase())}function sr(){return Ie(e=>tu(e))}function Yp(e,t,o){return new e({type:"array",element:t,...v(o)})}function Qy(e,t,o){return new e({type:"union",options:t,...v(o)})}function Xy(e,t,o){return new e({type:"union",options:t,inclusive:!1,...v(o)})}function eb(e,t,o,r){return new e({type:"union",options:o,discriminator:t,...v(r)})}function tb(e,t,o){return new e({type:"intersection",left:t,right:o})}function ob(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,...v(s)})}function rb(e,t,o,r){return new e({type:"record",keyType:t,valueType:o,...v(r)})}function nb(e,t,o,r){return new e({type:"map",keyType:t,valueType:o,...v(r)})}function sb(e,t,o){return new e({type:"set",valueType:t,...v(o)})}function ib(e,t,o){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:r,...v(o)})}function ab(e,t,o){return new e({type:"enum",entries:t,...v(o)})}function cb(e,t,o){return new e({type:"literal",values:Array.isArray(t)?t:[t],...v(o)})}function Qp(e,t){return new e({type:"file",...v(t)})}function lb(e,t){return new e({type:"transform",transform:t})}function ub(e,t){return new e({type:"optional",innerType:t})}function db(e,t){return new e({type:"nullable",innerType:t})}function pb(e,t,o){return new e({type:"default",innerType:t,get defaultValue(){return typeof o=="function"?o():ru(o)}})}function hb(e,t,o){return new e({type:"nonoptional",innerType:t,...v(o)})}function mb(e,t){return new e({type:"success",innerType:t})}function fb(e,t,o){return new e({type:"catch",innerType:t,catchValue:typeof o=="function"?o:()=>o})}function gb(e,t,o){return new e({type:"pipe",in:t,out:o})}function Sb(e,t){return new e({type:"readonly",innerType:t})}function _b(e,t,o){return new e({type:"template_literal",parts:t,...v(o)})}function yb(e,t){return new e({type:"lazy",getter:t})}function bb(e,t){return new e({type:"promise",innerType:t})}function Xp(e,t,o){let r=v(o);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function eh(e,t,o){return new e({type:"custom",check:"custom",fn:t,...v(o)})}function th(e,t){let o=cg(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Do(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(Do(s))}},e(r.value,r)),t);return o}function cg(e,t){let o=new H({check:"custom",...v(t)});return o._zod.check=e,o}function oh(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 rh(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 nh(e,t){let o=v(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??os,l=e.Boolean??es,u=e.String??Xt,m=new u({type:"string",error:o.error}),S=new l({type:"boolean",error:o.error}),_=new c({type:"pipe",in:m,out:S,transform:((y,P)=>{let E=y;return o.case!=="sensitive"&&(E=E.toLowerCase()),s.has(E)?!0:i.has(E)?!1:(P.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...i],input:P.value,inst:_,continue:!1}),{})}),reverseTransform:((y,P)=>y===!0?r[0]||"true":n[0]||"false"),error:o.error});return _}function ir(e,t,o,r={}){let n=v(r),s={...v(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 Rt(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,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),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 wt(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 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 u=`#/${c}/`,m=i[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:u+m}},s=i=>{if(i[1].schema.$ref)return;let c=i[1],{ref:l,defId:u}=n(i);c.def={...c.schema},u&&(c.defId=u);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 u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){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 xt(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 u=l.def??l.schema,m={...u},S=l.ref;if(l.ref=null,S){r(S);let y=e.seen.get(S),P=y.schema;if(P.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(P)):Object.assign(u,P),Object.assign(u,m),c._zod.parent===S)for(let C in u)C==="$ref"||C==="allOf"||C in m||delete u[C];if(P.$ref&&y.def)for(let C in u)C==="$ref"||C==="allOf"||C in y.def&&JSON.stringify(u[C])===JSON.stringify(y.def[C])&&delete u[C]}let _=c._zod.parent;if(_&&_!==S){r(_);let y=e.seen.get(_);if(y?.schema.$ref&&(u.$ref=y.schema.$ref,y.def))for(let P in u)P==="$ref"||P==="allOf"||P in y.def&&JSON.stringify(u[P])===JSON.stringify(y.def[P])&&delete u[P]}e.override({zodSchema:c,jsonSchema:u,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:ar(t,"input",e.processors),output:ar(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 sh=(e,t={})=>o=>{let r=Rt({...o,processors:t});return Z(e,r),wt(r,e),xt(r,e)},ar=(e,t,o={})=>r=>{let{libraryOptions:n,target:s}=r??{},i=Rt({...n??{},target:s,io:t,processors:o});return Z(e,i),wt(i,e),xt(i,e)};var zb={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ih=(e,t,o,r)=>{let n=o;n.type="string";let{minimum:s,maximum:i,format:c,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),c&&(n.format=zb[c]??c,n.format===""&&delete n.format,c==="time"&&delete n.format),u&&(n.contentEncoding=u),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}))])}},ah=(e,t,o,r)=>{let n=o,{minimum:s,maximum:i,format:c,multipleOf:l,exclusiveMaximum:u,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 u=="number"&&u<=(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=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof i=="number"&&(n.maximum=i),typeof l=="number"&&(n.multipleOf=l)},ch=(e,t,o,r)=>{o.type="boolean"},lh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},uh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},dh=(e,t,o,r)=>{t.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},ph=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},hh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},mh=(e,t,o,r)=>{o.not={}},fh=(e,t,o,r)=>{},gh=(e,t,o,r)=>{},Sh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},_h=(e,t,o,r)=>{let n=e._zod.def,s=Dn(n.entries);s.every(i=>typeof i=="number")&&(o.type="number"),s.every(i=>typeof i=="string")&&(o.type="string"),o.enum=s},yh=(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},bh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},zh=(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},vh=(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(u=>({contentMediaType:u}))):Object.assign(n,s)},Rh=(e,t,o,r)=>{o.type="boolean"},wh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},xh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Ph=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Th=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},kh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Eh=(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"]})},$h=(e,t,o,r)=>{let n=o,s=e._zod.def;n.type="object",n.properties={};let i=s.shape;for(let u in i)n.properties[u]=Z(i[u],t,{...r,path:[...r.path,"properties",u]});let c=new Set(Object.keys(i)),l=new Set([...c].filter(u=>{let m=s.shape[u]._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)},Oc=(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},Ch=(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=u=>"allOf"in u&&Object.keys(u).length===1,l=[...c(s)?s.allOf:[s],...c(i)?i.allOf:[i]];o.allOf=l},Ih=(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)=>Z(_,t,{...r,path:[...r.path,i,y]})),u=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,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:l},u&&n.items.anyOf.push(u),n.minItems=l.length,u||(n.maxItems=l.length)):(n.items=l,u&&(n.additionalItems=u));let{minimum:m,maximum:S}=e._zod.bag;typeof m=="number"&&(n.minItems=m),typeof S=="number"&&(n.maxItems=S)},Oh=(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 u=i._zod.values;if(u){let m=[...u].filter(S=>typeof S=="string"||typeof S=="number");m.length>0&&(n.required=m)}},Nh=(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"}]},Mh=(e,t,o,r)=>{let n=e._zod.def;Z(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},qh=(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))},Ah=(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)))},jh=(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},Lh=(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},Uh=(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},Zh=(e,t,o,r)=>{let n=e._zod.def;Z(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Nc=(e,t,o,r)=>{let n=e._zod.def;Z(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Dh=(e,t,o,r)=>{let n=e._zod.innerType;Z(n,t,r);let s=t.seen.get(e);s.ref=n},Ic={string:ih,number:ah,boolean:ch,bigint:lh,symbol:uh,null:dh,undefined:ph,void:hh,never:mh,any:fh,unknown:gh,date:Sh,enum:_h,literal:yh,nan:bh,template_literal:zh,file:vh,success:Rh,custom:wh,function:xh,transform:Ph,map:Th,set:kh,array:Eh,object:$h,union:Oc,intersection:Ch,tuple:Ih,record:Oh,nullable:Nh,nonoptional:Mh,default:qh,prefault:Ah,catch:jh,pipe:Lh,readonly:Uh,promise:Zh,optional:Nc,lazy:Dh};function ro(e,t){if("_idmap"in e){let r=e,n=Rt({...t,processors:Ic}),s={};for(let l of r._idmap.entries()){let[u,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[u,m]=l;wt(n,m),i[u]=xt(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=Rt({...t,processors:Ic});return Z(e,o),wt(o,e),xt(o,e)}var Mc=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=Rt({processors:Ic,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)),wt(this.ctx,t);let r=xt(this.ctx,t),{"~standard":n,...s}=r;return s}};var lg={};var ss={};Qe(ss,{ZodAny:()=>cm,ZodArray:()=>pm,ZodBase64:()=>rl,ZodBase64URL:()=>nl,ZodBigInt:()=>fr,ZodBigIntFormat:()=>al,ZodBoolean:()=>mr,ZodCIDRv4:()=>tl,ZodCIDRv6:()=>ol,ZodCUID:()=>Wc,ZodCUID2:()=>Gc,ZodCatch:()=>Im,ZodCodec:()=>fs,ZodCustom:()=>gs,ZodCustomStringFormat:()=>pr,ZodDate:()=>ds,ZodDefault:()=>Pm,ZodDiscriminatedUnion:()=>mm,ZodE164:()=>sl,ZodEmail:()=>Hc,ZodEmoji:()=>Jc,ZodEnum:()=>lr,ZodExactOptional:()=>Rm,ZodFile:()=>zm,ZodFunction:()=>Zm,ZodGUID:()=>as,ZodIPv4:()=>Xc,ZodIPv6:()=>el,ZodIntersection:()=>fm,ZodJWT:()=>il,ZodKSUID:()=>Qc,ZodLazy:()=>Lm,ZodLiteral:()=>bm,ZodMAC:()=>nm,ZodMap:()=>_m,ZodNaN:()=>Nm,ZodNanoID:()=>Bc,ZodNever:()=>um,ZodNonOptional:()=>pl,ZodNull:()=>am,ZodNullable:()=>xm,ZodNumber:()=>hr,ZodNumberFormat:()=>no,ZodObject:()=>ps,ZodOptional:()=>dl,ZodPipe:()=>ms,ZodPrefault:()=>km,ZodPreprocess:()=>Mm,ZodPromise:()=>Um,ZodReadonly:()=>qm,ZodRecord:()=>cr,ZodSet:()=>ym,ZodString:()=>ur,ZodStringFormat:()=>V,ZodSuccess:()=>Cm,ZodSymbol:()=>sm,ZodTemplateLiteral:()=>jm,ZodTransform:()=>vm,ZodTuple:()=>gm,ZodType:()=>M,ZodULID:()=>Kc,ZodURL:()=>us,ZodUUID:()=>Ue,ZodUndefined:()=>im,ZodUnion:()=>hs,ZodUnknown:()=>lm,ZodVoid:()=>dm,ZodXID:()=>Yc,ZodXor:()=>hm,_ZodString:()=>Vc,_default:()=>Tm,_function:()=>dS,any:()=>cl,array:()=>f,base64:()=>$g,base64url:()=>Cg,bigint:()=>Dg,boolean:()=>R,catch:()=>Om,check:()=>pS,cidrv4:()=>kg,cidrv6:()=>Eg,codec:()=>aS,cuid:()=>bg,cuid2:()=>zg,custom:()=>hS,date:()=>Wg,describe:()=>mS,discriminatedUnion:()=>Pt,e164:()=>Ig,email:()=>Fc,emoji:()=>_g,enum:()=>I,exactOptional:()=>wm,file:()=>rS,float32:()=>jg,float64:()=>Lg,function:()=>dS,guid:()=>pg,hash:()=>Ag,hex:()=>qg,hostname:()=>Mg,httpUrl:()=>Sg,instanceof:()=>gS,int:()=>Zc,int32:()=>Ug,int64:()=>Vg,intersection:()=>Oe,invertCodec:()=>cS,ipv4:()=>xg,ipv6:()=>Tg,json:()=>_S,jwt:()=>Og,keyof:()=>Gg,ksuid:()=>wg,lazy:()=>Tt,literal:()=>g,looseObject:()=>$,looseRecord:()=>Xg,mac:()=>Pg,map:()=>eS,meta:()=>fS,nan:()=>iS,nanoid:()=>yg,nativeEnum:()=>oS,never:()=>ll,nonoptional:()=>$m,null:()=>Ze,nullable:()=>cs,nullish:()=>nS,number:()=>b,object:()=>p,optional:()=>k,partialRecord:()=>Qg,pipe:()=>Dc,prefault:()=>Em,preprocess:()=>ot,promise:()=>uS,readonly:()=>Am,record:()=>v,refine:()=>Dm,set:()=>tS,strictObject:()=>Kg,string:()=>a,stringFormat:()=>Ng,stringbool:()=>SS,success:()=>sS,superRefine:()=>Vm,symbol:()=>Fg,templateLiteral:()=>lS,transform:()=>ul,tuple:()=>Sm,uint32:()=>Zg,uint64:()=>Hg,ulid:()=>vg,undefined:()=>Jg,union:()=>x,unknown:()=>T,url:()=>dr,uuid:()=>hg,uuidv4:()=>mg,uuidv6:()=>fg,uuidv7:()=>gg,void:()=>Bg,xid:()=>Rg,xor:()=>Yg});var qc={};Qe(qc,{endsWith:()=>Xo,gt:()=>je,gte:()=>fe,includes:()=>Yo,length:()=>oo,lowercase:()=>Go,lt:()=>Ae,lte:()=>we,maxLength:()=>to,maxSize:()=>vt,mime:()=>er,minLength:()=>et,minSize:()=>Le,multipleOf:()=>zt,negative:()=>kc,nonnegative:()=>$c,nonpositive:()=>Ec,normalize:()=>tr,overwrite:()=>Ie,positive:()=>Tc,property:()=>Cc,regex:()=>Wo,size:()=>eo,slugify:()=>sr,startsWith:()=>Qo,toLowerCase:()=>rr,toUpperCase:()=>nr,trim:()=>or,uppercase:()=>Ko});var xe={};Qe(xe,{ZodISODate:()=>jc,ZodISODateTime:()=>Ac,ZodISODuration:()=>Uc,ZodISOTime:()=>Lc,date:()=>Hh,datetime:()=>Vh,duration:()=>Jh,time:()=>Fh});var Ac=h("ZodISODateTime",(e,t)=>{bd.init(e,t),V.init(e,t)});function Vh(e){return wp(Ac,e)}var jc=h("ZodISODate",(e,t)=>{zd.init(e,t),V.init(e,t)});function Hh(e){return xp(jc,e)}var Lc=h("ZodISOTime",(e,t)=>{vd.init(e,t),V.init(e,t)});function Fh(e){return Pp(Lc,e)}var Uc=h("ZodISODuration",(e,t)=>{Rd.init(e,t),V.init(e,t)});function Jh(e){return Tp(Uc,e)}var ug=(e,t)=>{Bn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>Gn(e,o)},flatten:{value:o=>Wn(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,Uo,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,Uo,2)}},isEmpty:{get(){return e.issues.length===0}}})},Rb=h("ZodError",ug),be=h("ZodError",ug,{Parent:Error});var Bh=Vo(be),Wh=Ho(be),is=Fo(be),Gh=Jo(be),Kh=Aa(be),Yh=ja(be),Qh=La(be),Xh=Ua(be),em=Za(be),tm=Da(be),om=Va(be),rm=Ha(be);var dg=new WeakMap;function ls(e,t,o){let r=Object.getPrototypeOf(e),n=dg.get(r);if(n||(n=new Set,dg.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:ar(e,"input"),output:ar(e,"output")}}),e.toJSONSchema=sh(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(o,r)=>Bh(e,o,r,{callee:e.parse}),e.safeParse=(o,r)=>is(e,o,r),e.parseAsync=async(o,r)=>Wh(e,o,r,{callee:e.parseAsync}),e.safeParseAsync=async(o,r)=>Gh(e,o,r),e.spa=e.safeParseAsync,e.encode=(o,r)=>Kh(e,o,r),e.decode=(o,r)=>Yh(e,o,r),e.encodeAsync=async(o,r)=>Qh(e,o,r),e.decodeAsync=async(o,r)=>Xh(e,o,r),e.safeEncode=(o,r)=>em(e,o,r),e.safeDecode=(o,r)=>tm(e,o,r),e.safeEncodeAsync=async(o,r)=>om(e,o,r),e.safeDecodeAsync=async(o,r)=>rm(e,o,r),ls(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(Dm(o,r))},superRefine(o,r){return this.check(Vm(o,r))},overwrite(o){return this.check(Ie(o))},optional(){return k(this)},exactOptional(){return wm(this)},nullable(){return cs(this)},nullish(){return k(cs(this))},nonoptional(o){return $m(this,o)},array(){return f(this)},or(o){return x([this,o])},and(o){return Oe(this,o)},transform(o){return Dc(this,ul(o))},default(o){return Tm(this,o)},prefault(o){return Em(this,o)},catch(o){return Om(this,o)},pipe(o){return Dc(this,o)},readonly(){return Am(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)),Vc=h("_ZodString",(e,t)=>{Xt.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ih(e,r,n,s);let o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,ls(e,"_ZodString",{regex(...r){return this.check(Wo(...r))},includes(...r){return this.check(Yo(...r))},startsWith(...r){return this.check(Qo(...r))},endsWith(...r){return this.check(Xo(...r))},min(...r){return this.check(et(...r))},max(...r){return this.check(to(...r))},length(...r){return this.check(oo(...r))},nonempty(...r){return this.check(et(1,...r))},lowercase(r){return this.check(Go(r))},uppercase(r){return this.check(Ko(r))},trim(){return this.check(or())},normalize(...r){return this.check(tr(...r))},toLowerCase(){return this.check(rr())},toUpperCase(){return this.check(nr())},slugify(){return this.check(sr())}})}),ur=h("ZodString",(e,t)=>{Xt.init(e,t),Vc.init(e,t),e.email=o=>e.check(ac(Hc,o)),e.url=o=>e.check(ns(us,o)),e.jwt=o=>e.check(Pc(il,o)),e.emoji=o=>e.check(pc(Jc,o)),e.guid=o=>e.check(rs(as,o)),e.uuid=o=>e.check(cc(Ue,o)),e.uuidv4=o=>e.check(lc(Ue,o)),e.uuidv6=o=>e.check(uc(Ue,o)),e.uuidv7=o=>e.check(dc(Ue,o)),e.nanoid=o=>e.check(hc(Bc,o)),e.guid=o=>e.check(rs(as,o)),e.cuid=o=>e.check(mc(Wc,o)),e.cuid2=o=>e.check(fc(Gc,o)),e.ulid=o=>e.check(gc(Kc,o)),e.base64=o=>e.check(Rc(rl,o)),e.base64url=o=>e.check(wc(nl,o)),e.xid=o=>e.check(Sc(Yc,o)),e.ksuid=o=>e.check(_c(Qc,o)),e.ipv4=o=>e.check(yc(Xc,o)),e.ipv6=o=>e.check(bc(el,o)),e.cidrv4=o=>e.check(zc(tl,o)),e.cidrv6=o=>e.check(vc(ol,o)),e.e164=o=>e.check(xc(sl,o)),e.datetime=o=>e.check(Vh(o)),e.date=o=>e.check(Hh(o)),e.time=o=>e.check(Fh(o)),e.duration=o=>e.check(Jh(o))});function a(e){return bp(ur,e)}var V=h("ZodStringFormat",(e,t)=>{D.init(e,t),Vc.init(e,t)}),Hc=h("ZodEmail",(e,t)=>{dd.init(e,t),V.init(e,t)});function Fc(e){return ac(Hc,e)}var as=h("ZodGUID",(e,t)=>{ld.init(e,t),V.init(e,t)});function pg(e){return rs(as,e)}var Ue=h("ZodUUID",(e,t)=>{ud.init(e,t),V.init(e,t)});function hg(e){return cc(Ue,e)}function mg(e){return lc(Ue,e)}function fg(e){return uc(Ue,e)}function gg(e){return dc(Ue,e)}var us=h("ZodURL",(e,t)=>{pd.init(e,t),V.init(e,t)});function dr(e){return ns(us,e)}function Sg(e){return ns(us,{protocol:Re.httpProtocol,hostname:Re.domain,...O.normalizeParams(e)})}var Jc=h("ZodEmoji",(e,t)=>{hd.init(e,t),V.init(e,t)});function _g(e){return pc(Jc,e)}var Bc=h("ZodNanoID",(e,t)=>{md.init(e,t),V.init(e,t)});function yg(e){return hc(Bc,e)}var Wc=h("ZodCUID",(e,t)=>{fd.init(e,t),V.init(e,t)});function bg(e){return mc(Wc,e)}var Gc=h("ZodCUID2",(e,t)=>{gd.init(e,t),V.init(e,t)});function zg(e){return fc(Gc,e)}var Kc=h("ZodULID",(e,t)=>{Sd.init(e,t),V.init(e,t)});function vg(e){return gc(Kc,e)}var Yc=h("ZodXID",(e,t)=>{_d.init(e,t),V.init(e,t)});function Rg(e){return Sc(Yc,e)}var Qc=h("ZodKSUID",(e,t)=>{yd.init(e,t),V.init(e,t)});function wg(e){return _c(Qc,e)}var Xc=h("ZodIPv4",(e,t)=>{wd.init(e,t),V.init(e,t)});function xg(e){return yc(Xc,e)}var nm=h("ZodMAC",(e,t)=>{Pd.init(e,t),V.init(e,t)});function Pg(e){return vp(nm,e)}var el=h("ZodIPv6",(e,t)=>{xd.init(e,t),V.init(e,t)});function Tg(e){return bc(el,e)}var tl=h("ZodCIDRv4",(e,t)=>{Td.init(e,t),V.init(e,t)});function kg(e){return zc(tl,e)}var ol=h("ZodCIDRv6",(e,t)=>{kd.init(e,t),V.init(e,t)});function Eg(e){return vc(ol,e)}var rl=h("ZodBase64",(e,t)=>{$d.init(e,t),V.init(e,t)});function $g(e){return Rc(rl,e)}var nl=h("ZodBase64URL",(e,t)=>{Cd.init(e,t),V.init(e,t)});function Cg(e){return wc(nl,e)}var sl=h("ZodE164",(e,t)=>{Id.init(e,t),V.init(e,t)});function Ig(e){return xc(sl,e)}var il=h("ZodJWT",(e,t)=>{Od.init(e,t),V.init(e,t)});function Og(e){return Pc(il,e)}var pr=h("ZodCustomStringFormat",(e,t)=>{Nd.init(e,t),V.init(e,t)});function Ng(e,t,o={}){return ir(pr,e,t,o)}function Mg(e){return ir(pr,"hostname",Re.hostname,e)}function qg(e){return ir(pr,"hex",Re.hex,e)}function Ag(e,t){let o=t?.enc??"hex",r=`${e}_${o}`,n=Re[r];if(!n)throw new Error(`Unrecognized hash format: ${r}`);return ir(pr,r,n,t)}var hr=h("ZodNumber",(e,t)=>{Xa.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ah(e,r,n,s),ls(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(Zc(r))},safe(r){return this.check(Zc(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(zt(r,n))},step(r,n){return this.check(zt(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 kp(hr,e)}var no=h("ZodNumberFormat",(e,t)=>{Md.init(e,t),hr.init(e,t)});function Zc(e){return $p(no,e)}function jg(e){return Cp(no,e)}function Lg(e){return Ip(no,e)}function Ug(e){return Op(no,e)}function Zg(e){return Np(no,e)}var mr=h("ZodBoolean",(e,t)=>{Xn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ch(e,o,r,n)});function R(e){return Mp(mr,e)}var fr=h("ZodBigInt",(e,t)=>{ec.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>lh(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(zt(r,n));let o=e._zod.bag;e.minValue=o.minimum??null,e.maxValue=o.maximum??null,e.format=o.format??null});function Dg(e){return Ap(fr,e)}var al=h("ZodBigIntFormat",(e,t)=>{qd.init(e,t),fr.init(e,t)});function Vg(e){return Lp(al,e)}function Hg(e){return Up(al,e)}var sm=h("ZodSymbol",(e,t)=>{Ad.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>uh(e,o,r,n)});function Fg(e){return Zp(sm,e)}var im=h("ZodUndefined",(e,t)=>{jd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ph(e,o,r,n)});function Jg(e){return Dp(im,e)}var am=h("ZodNull",(e,t)=>{Ld.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>dh(e,o,r,n)});function Ze(e){return Vp(am,e)}var cm=h("ZodAny",(e,t)=>{Ud.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>fh(e,o,r,n)});function cl(){return Hp(cm)}var lm=h("ZodUnknown",(e,t)=>{Zd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>gh(e,o,r,n)});function T(){return Fp(lm)}var um=h("ZodNever",(e,t)=>{Dd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>mh(e,o,r,n)});function ll(e){return Jp(um,e)}var dm=h("ZodVoid",(e,t)=>{Vd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>hh(e,o,r,n)});function Bg(e){return Bp(dm,e)}var ds=h("ZodDate",(e,t)=>{Hd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Sh(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 Wg(e){return Wp(ds,e)}var pm=h("ZodArray",(e,t)=>{Fd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Eh(e,o,r,n),e.element=t.element,ls(e,"ZodArray",{min(o,r){return this.check(et(o,r))},nonempty(o){return this.check(et(1,o))},max(o,r){return this.check(to(o,r))},length(o,r){return this.check(oo(o,r))},unwrap(){return this.element}})});function f(e,t){return Yp(pm,e,t)}function Gg(e){let t=e._zod.def.shape;return I(Object.keys(t))}var ps=h("ZodObject",(e,t)=>{Jd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>$h(e,o,r,n),O.defineLazy(e,"shape",()=>t.shape),ls(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:ll()})},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(dl,this,o[0])},required(...o){return O.required(pl,this,o[0])}})});function p(e,t){let o={type:"object",shape:e??{},...O.normalizeParams(t)};return new ps(o)}function Kg(e,t){return new ps({type:"object",shape:e,catchall:ll(),...O.normalizeParams(t)})}function $(e,t){return new ps({type:"object",shape:e,catchall:T(),...O.normalizeParams(t)})}var hs=h("ZodUnion",(e,t)=>{es.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Oc(e,o,r,n),e.options=t.options});function x(e,t){return new hs({type:"union",options:e,...O.normalizeParams(t)})}var hm=h("ZodXor",(e,t)=>{hs.init(e,t),Bd.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Oc(e,o,r,n),e.options=t.options});function Yg(e,t){return new hm({type:"union",options:e,inclusive:!1,...O.normalizeParams(t)})}var mm=h("ZodDiscriminatedUnion",(e,t)=>{hs.init(e,t),Wd.init(e,t)});function Pt(e,t,o){return new mm({type:"union",options:t,discriminator:e,...O.normalizeParams(o)})}var fm=h("ZodIntersection",(e,t)=>{Gd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ch(e,o,r,n)});function Oe(e,t){return new fm({type:"intersection",left:e,right:t})}var gm=h("ZodTuple",(e,t)=>{tc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ih(e,o,r,n),e.rest=o=>e.clone({...e._zod.def,rest:o})});function Sm(e,t,o){let r=t instanceof N,n=r?o:t,s=r?t:null;return new gm({type:"tuple",items:e,rest:s,...O.normalizeParams(n)})}var cr=h("ZodRecord",(e,t)=>{Kd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Oh(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function v(e,t,o){return!t||!t._zod?new cr({type:"record",keyType:a(),valueType:e,...O.normalizeParams(t)}):new cr({type:"record",keyType:e,valueType:t,...O.normalizeParams(o)})}function Qg(e,t,o){let r=he(e);return r._zod.values=void 0,new cr({type:"record",keyType:r,valueType:t,...O.normalizeParams(o)})}function Xg(e,t,o){return new cr({type:"record",keyType:e,valueType:t,mode:"loose",...O.normalizeParams(o)})}var _m=h("ZodMap",(e,t)=>{Yd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Th(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(vt(...o)),e.size=(...o)=>e.check(eo(...o))});function eS(e,t,o){return new _m({type:"map",keyType:e,valueType:t,...O.normalizeParams(o)})}var ym=h("ZodSet",(e,t)=>{Qd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>kh(e,o,r,n),e.min=(...o)=>e.check(Le(...o)),e.nonempty=o=>e.check(Le(1,o)),e.max=(...o)=>e.check(vt(...o)),e.size=(...o)=>e.check(eo(...o))});function tS(e,t){return new ym({type:"set",valueType:e,...O.normalizeParams(t)})}var lr=h("ZodEnum",(e,t)=>{Xd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>_h(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 lr({...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 lr({...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 lr({type:"enum",entries:o,...O.normalizeParams(t)})}function oS(e,t){return new lr({type:"enum",entries:e,...O.normalizeParams(t)})}var bm=h("ZodLiteral",(e,t)=>{ep.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>yh(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 bm({type:"literal",values:Array.isArray(e)?e:[e],...O.normalizeParams(t)})}var zm=h("ZodFile",(e,t)=>{tp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>vh(e,o,r,n),e.min=(o,r)=>e.check(Le(o,r)),e.max=(o,r)=>e.check(vt(o,r)),e.mime=(o,r)=>e.check(er(Array.isArray(o)?o:[o],r))});function rS(e){return Qp(zm,e)}var vm=h("ZodTransform",(e,t)=>{op.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ph(e,o,r,n),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new gt(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 ul(e){return new vm({type:"transform",transform:e})}var dl=h("ZodOptional",(e,t)=>{oc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Nc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function k(e){return new dl({type:"optional",innerType:e})}var Rm=h("ZodExactOptional",(e,t)=>{rp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Nc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function wm(e){return new Rm({type:"optional",innerType:e})}var xm=h("ZodNullable",(e,t)=>{np.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Nh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function cs(e){return new xm({type:"nullable",innerType:e})}function nS(e){return k(cs(e))}var Pm=h("ZodDefault",(e,t)=>{sp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>qh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Tm(e,t){return new Pm({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():O.shallowClone(t)}})}var km=h("ZodPrefault",(e,t)=>{ip.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ah(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Em(e,t){return new km({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():O.shallowClone(t)}})}var pl=h("ZodNonOptional",(e,t)=>{ap.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 $m(e,t){return new pl({type:"nonoptional",innerType:e,...O.normalizeParams(t)})}var Cm=h("ZodSuccess",(e,t)=>{cp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Rh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function sS(e){return new Cm({type:"success",innerType:e})}var Im=h("ZodCatch",(e,t)=>{lp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>jh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Om(e,t){return new Im({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Nm=h("ZodNaN",(e,t)=>{up.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>bh(e,o,r,n)});function iS(e){return Kp(Nm,e)}var ms=h("ZodPipe",(e,t)=>{rc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Lh(e,o,r,n),e.in=t.in,e.out=t.out});function Dc(e,t){return new ms({type:"pipe",in:e,out:t})}var fs=h("ZodCodec",(e,t)=>{ms.init(e,t),ts.init(e,t)});function aS(e,t,o){return new fs({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}function cS(e){let t=e._zod.def;return new fs({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Mm=h("ZodPreprocess",(e,t)=>{ms.init(e,t),dp.init(e,t)}),qm=h("ZodReadonly",(e,t)=>{pp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Uh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Am(e){return new qm({type:"readonly",innerType:e})}var jm=h("ZodTemplateLiteral",(e,t)=>{hp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>zh(e,o,r,n)});function lS(e,t){return new jm({type:"template_literal",parts:e,...O.normalizeParams(t)})}var Lm=h("ZodLazy",(e,t)=>{gp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Dh(e,o,r,n),e.unwrap=()=>e._zod.def.getter()});function Tt(e){return new Lm({type:"lazy",getter:e})}var Um=h("ZodPromise",(e,t)=>{fp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Zh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function uS(e){return new Um({type:"promise",innerType:e})}var Zm=h("ZodFunction",(e,t)=>{mp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>xh(e,o,r,n)});function dS(e){return new Zm({type:"function",input:Array.isArray(e?.input)?Sm(e?.input):e?.input??f(T()),output:e?.output??T()})}var gs=h("ZodCustom",(e,t)=>{Sp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>wh(e,o,r,n)});function pS(e){let t=new H({check:"custom"});return t._zod.check=e,t}function hS(e,t){return Xp(gs,e??(()=>!0),t)}function Dm(e,t={}){return eh(gs,e,t)}function Vm(e,t){return th(e,t)}var mS=oh,fS=rh;function gS(e,t={}){let o=new gs({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 SS=(...e)=>nh({Codec:fs,Boolean:mr,String:ur},...e);function _S(e){let t=Tt(()=>x([a(e),b(),R(),Ze(),f(t),v(a(),t)]));return t}function ot(e,t){return new Mm({type:"pipe",in:ul(e),out:t})}var Fm={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 xb(e){Y({customError:e})}function Pb(){return Y().customError}var Hm;Hm||(Hm={});var w={...ss,...qc,iso:xe},Tb=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 kb(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 Eb(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 yS(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=Eb(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 yS(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,u]of Object.entries(s)){let m=le(u,t);n[l]=i.has(l)?m:m.optional()}if(e.propertyNames){let l=le(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?le(e.additionalProperties,t):w.any();if(Object.keys(n).length===0){r=w.record(l,u);break}let m=w.object(n).passthrough(),S=w.looseRecord(l,u);r=w.intersection(m,S);break}if(e.patternProperties){let l=e.patternProperties,u=Object.keys(l),m=[];for(let _ of u){let y=le(l[_],t),P=w.string().regex(new RegExp(_));m.push(w.looseRecord(P,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=yS(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(u=>le(u,t)),l=w.union(c);o=r?w.intersection(o,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(u=>le(u,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 u=l;u<e.allOf.length;u++)c=w.intersection(c,le(e.allOf[u],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))Tb.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 bS(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=kb(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 Ss={};Qe(Ss,{bigint:()=>Ob,boolean:()=>Ib,date:()=>Nb,number:()=>Cb,string:()=>$b});function $b(e){return zp(ur,e)}function Cb(e){return Ep(hr,e)}function Ib(e){return qp(mr,e)}function Ob(e){return jp(fr,e)}function Nb(e){return Gp(ds,e)}Y(nc());var hl="2025-11-25";var ml=[hl,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],fl="io.modelcontextprotocol/related-task",so="io.modelcontextprotocol/protocolVersion",gr="io.modelcontextprotocol/clientInfo",Et="io.modelcontextprotocol/serverInfo",io="io.modelcontextprotocol/clientCapabilities",gl="io.modelcontextprotocol/subscriptionId",Sr="io.modelcontextprotocol/logLevel";var ao="2.0";var rt=Tt(()=>x([a(),b(),R(),Ze(),v(a(),rt),f(rt)])),W=v(a(),rt),Sl=f(rt),_r=x([a(),b().int()]),yr=a(),_s=p({ttl:b().optional()}),ys=p({taskId:a()}),br=$({progressToken:_r.optional(),[fl]:ys.optional()}),oe=p({_meta:br.optional()}),$t=oe.extend({task:_s.optional()}),G=p({method:a(),params:oe.loose().optional()}),ue=p({_meta:br.optional()}),ne=p({method:a(),params:ue.loose().optional()}),zr=$({get[Et](){return Ve.optional().catch(void 0)}}),K=$({_meta:zr.optional()}),Ne=x([a(),b().int()]),vr=p({jsonrpc:g(ao),id:Ne,...G.shape}).strict(),Rr=p({jsonrpc:g(ao),...ne.shape}).strict(),co=p({jsonrpc:g(ao),id:Ne,result:K}).strict(),lo=p({jsonrpc:g(ao),id:Ne.optional(),error:p({code:b().int(),message:a(),data:T().optional()})}).strict(),uo=x([vr,Rr,co,lo]),_l=x([co,lo]),Ct=K.strict(),bs=ue.extend({requestId:Ne.optional(),reason:a().optional()}),wr=ne.extend({method:g("notifications/cancelled"),params:bs}),zs=p({src:a(),mimeType:a().optional(),sizes:f(a()).optional(),theme:I(["light","dark"]).optional()}),nt=p({icons:f(zs).optional()}),De=p({name:a(),title:a().optional()}),Ve=De.extend({...De.shape,...nt.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),qb=Oe(p({applyDefaults:R().optional()}),W),Ab=ot(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Oe(p({form:qb.optional(),url:W.optional()}),W.optional())),yl=$({list:W.optional(),cancel:W.optional(),requests:$({sampling:$({createMessage:W.optional()}).optional(),elicitation:$({create:W.optional()}).optional()}).optional()}),bl=$({list:W.optional(),cancel:W.optional(),requests:$({tools:$({call:W.optional()}).optional()}).optional()}),vs=p({experimental:v(a(),W).optional(),sampling:p({context:W.optional(),tools:W.optional()}).optional(),elicitation:Ab.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:yl.optional(),extensions:v(a(),W).optional()}),Rs=oe.extend({protocolVersion:a(),capabilities:vs,clientInfo:Ve}),ws=G.extend({method:g("initialize"),params:Rs}),xr=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:bl.optional(),extensions:v(a(),W).optional()}),xs=K.extend({protocolVersion:a(),capabilities:xr,serverInfo:Ve,instructions:a().optional()}),Ps=ne.extend({method:g("notifications/initialized"),params:ue.optional()}),Ts=G.extend({method:g("server/discover"),params:oe.optional()}),Pr=K.extend({supportedVersions:f(a()),capabilities:xr,instructions:a().optional()}),Tr=G.extend({method:g("ping"),params:oe.optional()}),ks=p({progress:b(),total:k(b()),message:k(a())}),Es=p({...ue.shape,...ks.shape,progressToken:_r}),kr=ne.extend({method:g("notifications/progress"),params:Es}),$s=oe.extend({cursor:yr.optional()}),st=G.extend({params:$s.optional()}),it=K.extend({nextCursor:yr.optional()}),Er=p({uri:a(),mimeType:k(a()),_meta:v(a(),T()).optional()}),$r=Er.extend({text:a()}),Bm=a().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Cr=Er.extend({blob:Bm}),at=I(["user","assistant"]),He=p({audience:f(at).optional(),priority:b().min(0).max(1).optional(),lastModified:xe.datetime({offset:!0}).optional()}),Ir=p({...De.shape,...nt.shape,uri:a(),description:k(a()),mimeType:k(a()),size:k(b()),annotations:He.optional(),_meta:k($({}))}),Cs=p({...De.shape,...nt.shape,uriTemplate:a(),description:k(a()),mimeType:k(a()),annotations:He.optional(),_meta:k($({}))}),Is=st.extend({method:g("resources/list")}),Os=it.extend({resources:f(Ir)}),Ns=st.extend({method:g("resources/templates/list")}),Ms=it.extend({resourceTemplates:f(Cs)}),po=oe.extend({uri:a()}),qs=po,As=G.extend({method:g("resources/read"),params:qs}),js=K.extend({contents:f(x([$r,Cr]))}),Ls=ne.extend({method:g("notifications/resources/list_changed"),params:ue.optional()}),Us=po,Zs=G.extend({method:g("resources/subscribe"),params:Us}),Ds=po,Vs=G.extend({method:g("resources/unsubscribe"),params:Ds}),Or=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:f(a()).optional()}),Hs=oe.extend({notifications:Or}),Fs=G.extend({method:g("subscriptions/listen"),params:Hs}),Js=ue.extend({notifications:Or}),Bs=ne.extend({method:g("notifications/subscriptions/acknowledged"),params:Js}),Ws=zr.extend({[gl]:Ne}),Gs=K.extend({_meta:Ws}),Ks=ue.extend({uri:a()}),Ys=ne.extend({method:g("notifications/resources/updated"),params:Ks}),Qs=p({name:a(),description:k(a()),required:k(R())}),Xs=p({...De.shape,...nt.shape,description:k(a()),arguments:k(f(Qs)),_meta:k($({}))}),ei=st.extend({method:g("prompts/list")}),ti=it.extend({prompts:f(Xs)}),oi=oe.extend({name:a(),arguments:v(a(),a()).optional()}),ri=G.extend({method:g("prompts/get"),params:oi}),ho=p({type:g("text"),text:a(),annotations:He.optional(),_meta:v(a(),T()).optional()}),mo=p({type:g("image"),data:Bm,mimeType:a(),annotations:He.optional(),_meta:v(a(),T()).optional()}),fo=p({type:g("audio"),data:Bm,mimeType:a(),annotations:He.optional(),_meta:v(a(),T()).optional()}),ni=p({type:g("tool_use"),name:a(),id:a(),input:v(a(),T()),_meta:v(a(),T()).optional()}),go=p({type:g("resource"),resource:x([$r,Cr]),annotations:He.optional(),_meta:v(a(),T()).optional()}),So=Ir.extend({type:g("resource_link")}),Fe=x([ho,mo,fo,So,go]),si=p({role:at,content:Fe}),ii=K.extend({description:a().optional(),messages:f(si)}),ai=ne.extend({method:g("notifications/prompts/list_changed"),params:ue.optional()}),ci=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),li=p({taskSupport:I(["required","optional","forbidden"]).optional()}),It=p({...De.shape,...nt.shape,description:a().optional(),inputSchema:p({type:g("object"),properties:v(a(),rt).optional(),required:f(a()).optional()}).catchall(T()),outputSchema:$({$schema:a().optional()}).optional(),annotations:ci.optional(),execution:li.optional(),_meta:v(a(),T()).optional()}),ui=st.extend({method:g("tools/list")}),di=it.extend({tools:f(It)}),Ot=K.extend({content:f(Fe).default([]),structuredContent:T().optional(),isError:R().optional()}),zl=Ot.or(K.extend({toolResult:T()})),pi=$t.extend({name:a(),arguments:v(a(),T()).optional()}),hi=G.extend({method:g("tools/call"),params:pi}),mi=ne.extend({method:g("notifications/tools/list_changed"),params:ue.optional()}),vl=p({autoRefresh:R().default(!0),debounceMs:b().int().nonnegative().default(300)}),Nr=I(["debug","info","notice","warning","error","critical","alert","emergency"]),fi=oe.extend({level:Nr}),gi=G.extend({method:g("logging/setLevel"),params:fi}),Si=ue.extend({level:Nr,logger:a().optional(),data:T()}),_i=ne.extend({method:g("notifications/message"),params:Si}),yi=p({name:a().optional()}),bi=p({hints:f(yi).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),zi=p({mode:I(["auto","required","none"]).optional()}),vi=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()}),Ri=Pt("type",[ho,mo,fo]),kt=Pt("type",[ho,mo,fo,ni,vi]),wi=p({role:at,content:x([kt,f(kt)]),_meta:v(a(),T()).optional()}),xi=$t.extend({messages:f(wi),modelPreferences:bi.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:f(a()).optional(),metadata:W.optional(),tools:f(It).optional(),toolChoice:zi.optional()}),Pi=G.extend({method:g("sampling/createMessage"),params:xi}),Ti=K.extend({model:a(),stopReason:k(I(["endTurn","stopSequence","maxTokens"]).or(a())),role:at,content:Ri}),ki=K.extend({model:a(),stopReason:k(I(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:at,content:x([kt,f(kt)])}),Mr=p({type:g("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),_o=p({type:g("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:I(["email","uri","date","date-time"]).optional(),default:a().optional()}),yo=p({type:I(["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()}),Ar=p({type:g("string"),title:a().optional(),description:a().optional(),oneOf:f(p({const:a(),title:a()})),default:a().optional()}),jr=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),enumNames:f(a()).optional(),default:a().optional()}),Ei=x([qr,Ar]),Lr=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()}),Ur=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()}),$i=x([Lr,Ur]),Ci=x([jr,Ei,$i]),Zr=x([Ci,Mr,_o,yo]),bo=$t.extend({mode:g("form").optional(),message:a(),requestedSchema:p({type:g("object"),properties:v(a(),Zr),required:f(a()).optional()}).catchall(T())}),Ii=$t.extend({mode:g("url"),message:a(),elicitationId:a(),url:a().url()}),Oi=x([bo,Ii]),Ni=G.extend({method:g("elicitation/create"),params:Oi}),Mi=ue.extend({elicitationId:a()}),qi=ne.extend({method:g("notifications/elicitation/complete"),params:Mi}),Ai=K.extend({action:I(["accept","decline","cancel"]),content:ot(e=>e===null?void 0:e,v(a(),x([a(),b(),R(),f(a())])).optional())}),ji=p({type:g("ref/resource"),uri:a()}),Li=p({type:g("ref/prompt"),name:a()}),Ui=oe.extend({ref:x([Li,ji]),argument:p({name:a(),value:a()}),context:p({arguments:v(a(),a()).optional()}).optional()}),Zi=G.extend({method:g("completion/complete"),params:Ui}),Di=K.extend({completion:$({values:f(a()).max(100),total:k(b().int()),hasMore:k(R())})}),Vi=p({uri:a().startsWith("file://"),name:a().optional(),_meta:v(a(),T()).optional()}),Hi=G.extend({method:g("roots/list"),params:oe.optional()}),Fi=K.extend({roots:f(Vi)}),Ji=ne.extend({method:g("notifications/roots/list_changed"),params:ue.optional()}),Rl=$({ttl:b().optional(),pollInterval:b().optional()}),Bi=I(["working","input_required","completed","failed","cancelled"]),ct=p({taskId:a(),status:Bi,ttl:x([b(),Ze()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:k(b()),statusMessage:k(a())}),wl=K.extend({task:ct}),Wi=ue.merge(ct),xl=ne.extend({method:g("notifications/tasks/status"),params:Wi}),Pl=G.extend({method:g("tasks/get"),params:oe.extend({taskId:a()})}),Tl=K.merge(ct),kl=G.extend({method:g("tasks/result"),params:oe.extend({taskId:a()})}),El=K.loose(),$l=st.extend({method:g("tasks/list")}),Cl=it.extend({tasks:f(ct)}),Il=G.extend({method:g("tasks/cancel"),params:oe.extend({taskId:a()})}),Ol=K.merge(ct),Nl=x([Tr,ws,Ts,Zi,gi,ri,ei,Is,Ns,As,Zs,Vs,Fs,hi,ui]),Ml=x([wr,kr,Ps,Ji]),ql=x([Ct,Ti,ki,Ai,Fi]),Al=x([Tr,Pi,Ni,Hi]),jl=x([wr,kr,_i,Ys,Ls,mi,ai,Bs,qi]),Ll=x([Ct,xs,Pr,Di,ii,ti,Os,Ms,js,Ot,di,Gs]),te=dr().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Fm.custom,message:"URL must be parseable",fatal:!0}),Un}).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"}),Gi=$({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()}),Dr=$({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()}),Ki=$({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)}),Yi=p({...Ki.shape,...Dr.pick({code_challenge_methods_supported:!0}).shape}),Qi=p({access_token:a(),id_token:a().optional(),token_type:a(),expires_in:Ss.number().optional(),scope:a().optional(),refresh_token:a().optional(),issuer:a().optional().catch(void 0)}).strip(),Xi=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(),ea=p({error:a(),error_description:a().optional(),error_uri:a().optional()}),Jm=te.optional().or(g("").transform(()=>{})),ta=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:Jm,scope:a().optional(),contacts:f(a()).optional(),tos_uri:Jm,policy_uri:a().optional(),jwks_uri:te.optional(),jwks:cl().optional(),software_id:a().optional(),software_version:a().optional(),software_statement:a().optional()}).strip(),oa=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(),ra=ta.merge(oa),Ul=p({error:a(),error_description:a().optional()}).strip(),Zl=p({token:a(),token_type_hint:a().optional()}).strip();var Xm=Symbol.for("mcp.sdk.errorBrands");function zo(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,Xm,{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,Xm)){let o=t[Xm];if(o&&typeof o.has=="function"&&o.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var jb=class US 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",zo(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 US(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",zo(this,new.target)}},Lb=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 Ub="2026-07-28";function ZS(e){return e>=Ub}function DS(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 VS=["task","inputRequests","requestState"];function Zb(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||VS.some(t=>t in e)?e:{...e,content:[]}}function Db(){let e=Tt(()=>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=$({progressToken:o.optional(),"io.modelcontextprotocol/related-task":s.optional()}),c=p({_meta:i.optional()}),l=c.extend({task:n.optional()}),u=p({method:a(),params:c.loose().optional()}),m=p({_meta:i.optional()}),S=p({method:a(),params:m.loose().optional()}),_=$({_meta:i.optional()}),y=x([a(),b().int()]),P=_.strict(),E=m.extend({requestId:y.optional(),reason:a().optional()}),C=S.extend({method:g("notifications/cancelled"),params:E}),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=ot(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=$({list:t.optional(),cancel:t.optional(),requests:$({sampling:$({createMessage:t.optional()}).optional(),elicitation:$({create:t.optional()}).optional()}).optional()}),Ge=$({list:t.optional(),cancel:t.optional(),requests:$({tools:$({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()}),lt=c.extend({protocolVersion:a(),capabilities:de,clientInfo:U}),qt=u.extend({method:g("initialize"),params:lt}),Hr=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:Ge.optional(),extensions:v(a(),t).optional()}),Fr=_.extend({protocolVersion:a(),capabilities:Hr,serverInfo:U,instructions:a().optional()}),Ro=S.extend({method:g("notifications/initialized"),params:m.optional()}),ut=u.extend({method:g("ping"),params:c.optional()}),At=p({progress:b(),total:k(b()),message:k(a())}),Me=p({...m.shape,...At.shape,progressToken:o}),dt=S.extend({method:g("notifications/progress"),params:Me}),wo=c.extend({cursor:r.optional()}),Ke=u.extend({params:wo.optional()}),Ye=_.extend({nextCursor:r.optional()}),xo=p({uri:a(),mimeType:k(a()),_meta:v(a(),T()).optional()}),Po=xo.extend({text:a()}),jt=a().refine(ce=>{try{return atob(ce),!0}catch{return!1}},{message:"Invalid Base64 string"}),To=xo.extend({blob:jt}),qe=I(["user","assistant"]),Ee=p({audience:f(qe).optional(),priority:b().min(0).max(1).optional(),lastModified:xe.datetime({offset:!0}).optional()}),Lt=p({...L.shape,...J.shape,uri:a(),description:k(a()),mimeType:k(a()),size:k(b()),annotations:Ee.optional(),_meta:k($({}))}),Jr=p({...L.shape,...J.shape,uriTemplate:a(),description:k(a()),mimeType:k(a()),annotations:Ee.optional(),_meta:k($({}))}),Br=Ke.extend({method:g("resources/list")}),Wr=Ye.extend({resources:f(Lt)}),pt=Ke.extend({method:g("resources/templates/list")}),ko=Ye.extend({resourceTemplates:f(Jr)}),Ut=c.extend({uri:a()}),Gr=Ut,Kr=u.extend({method:g("resources/read"),params:Gr}),Yr=_.extend({contents:f(x([Po,To]))}),Qr=S.extend({method:g("notifications/resources/list_changed"),params:m.optional()}),Xr=Ut,en=u.extend({method:g("resources/subscribe"),params:Xr}),tn=Ut,on=u.extend({method:g("resources/unsubscribe"),params:tn}),rn=m.extend({uri:a()}),nn=S.extend({method:g("notifications/resources/updated"),params:rn}),sn=p({name:a(),description:k(a()),required:k(R())}),an=p({...L.shape,...J.shape,description:k(a()),arguments:k(f(sn)),_meta:k($({}))}),cn=Ke.extend({method:g("prompts/list")}),ln=Ye.extend({prompts:f(an)}),un=c.extend({name:a(),arguments:v(a(),a()).optional()}),dn=u.extend({method:g("prompts/get"),params:un}),Zt=p({type:g("text"),text:a(),annotations:Ee.optional(),_meta:v(a(),T()).optional()}),Dt=p({type:g("image"),data:jt,mimeType:a(),annotations:Ee.optional(),_meta:v(a(),T()).optional()}),Vt=p({type:g("audio"),data:jt,mimeType:a(),annotations:Ee.optional(),_meta:v(a(),T()).optional()}),pn=p({type:g("tool_use"),name:a(),id:a(),input:v(a(),T()),_meta:v(a(),T()).optional()}),ht=p({type:g("resource"),resource:x([Po,To]),annotations:Ee.optional(),_meta:v(a(),T()).optional()}),hn=Lt.extend({type:g("resource_link")}),Te=x([Zt,Dt,Vt,hn,ht]),Eo=p({role:qe,content:Te}),$o=_.extend({description:a().optional(),messages:f(Eo)}),Ht=S.extend({method:g("notifications/prompts/list_changed"),params:m.optional()}),mn=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),Co=p({taskSupport:I(["required","optional","forbidden"]).optional()}),Ft=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:mn.optional(),execution:Co.optional(),_meta:v(a(),T()).optional()}),Io=Ke.extend({method:g("tools/list")}),Oo=Ye.extend({tools:f(Ft)}),No=_.extend({content:f(Te),structuredContent:v(a(),T()).optional(),isError:R().optional()}),ae=l.extend({name:a(),arguments:v(a(),T()).optional()}),fn=u.extend({method:g("tools/call"),params:ae}),ma=S.extend({method:g("notifications/tools/list_changed"),params:m.optional()}),Mo=I(["debug","info","notice","warning","error","critical","alert","emergency"]),gn=c.extend({level:Mo}),Sn=u.extend({method:g("logging/setLevel"),params:gn}),_n=m.extend({level:Mo,logger:a().optional(),data:T()}),yn=S.extend({method:g("notifications/message"),params:_n}),bn=p({name:a().optional()}),zn=p({hints:f(bn).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),vn=p({mode:I(["auto","required","none"]).optional()}),fa=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()}),Rn=Pt("type",[Zt,Dt,Vt]),mt=Pt("type",[Zt,Dt,Vt,pn,fa]),wn=p({role:qe,content:x([mt,f(mt)]),_meta:v(a(),T()).optional()}),xn=l.extend({messages:f(wn),modelPreferences:zn.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:f(a()).optional(),metadata:t.optional(),tools:f(Ft).optional(),toolChoice:vn.optional()}),Pn=u.extend({method:g("sampling/createMessage"),params:xn}),Tn=_.extend({model:a(),stopReason:k(I(["endTurn","stopSequence","maxTokens"]).or(a())),role:qe,content:Rn}),kn=_.extend({model:a(),stopReason:k(I(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:qe,content:x([mt,f(mt)])}),En=p({type:g("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),$n=p({type:g("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:I(["email","uri","date","date-time"]).optional(),default:a().optional()}),Cn=p({type:I(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),In=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),default:a().optional()}),On=p({type:g("string"),title:a().optional(),description:a().optional(),oneOf:f(p({const:a(),title:a()})),default:a().optional()}),Nn=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),enumNames:f(a()).optional(),default:a().optional()}),Mn=x([In,On]),Jt=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()}),Bt=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()}),ga=x([Jt,Bt]),Sa=x([Nn,Mn,ga]),ze=x([Sa,En,$n,Cn]),ve=l.extend({mode:g("form").optional(),message:a(),requestedSchema:p({type:g("object"),properties:v(a(),ze),required:f(a()).optional()}).catchall(T())}),qn=l.extend({mode:g("url"),message:a(),elicitationId:a(),url:a().url()}),$e=x([ve,qn]),_a=u.extend({method:g("elicitation/create"),params:$e}),ya=m.extend({elicitationId:a()}),ba=S.extend({method:g("notifications/elicitation/complete"),params:ya}),za=_.extend({action:I(["accept","decline","cancel"]),content:ot(ce=>ce===null?void 0:ce,v(a(),x([a(),b(),R(),f(a())])).optional())}),va=p({type:g("ref/resource"),uri:a()}),Ra=p({type:g("ref/prompt"),name:a()}),wa=c.extend({ref:x([Ra,va]),argument:p({name:a(),value:a()}),context:p({arguments:v(a(),a()).optional()}).optional()}),An=u.extend({method:g("completion/complete"),params:wa}),xa=_.extend({completion:$({values:f(a()).max(100),total:k(b().int()),hasMore:k(R())})}),Pa=p({uri:a().startsWith("file://"),name:a().optional(),_meta:v(a(),T()).optional()}),qo=u.extend({method:g("roots/list"),params:c.optional()}),jn=_.extend({roots:f(Pa)}),Ta=S.extend({method:g("notifications/roots/list_changed"),params:m.optional()}),ka=$({ttl:b().optional(),pollInterval:b().optional()}),Ln=I(["working","input_required","completed","failed","cancelled"]),ft=p({taskId:a(),status:Ln,ttl:x([b(),Ze()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:k(b()),statusMessage:k(a())}),Se=_.extend({task:ft}),Ea=m.merge(ft),Wt=S.extend({method:g("notifications/tasks/status"),params:Ea}),Ao=u.extend({method:g("tasks/get"),params:c.extend({taskId:a()})}),jo=_.merge(ft),Lo=u.extend({method:g("tasks/result"),params:c.extend({taskId:a()})}),Kl=_.loose(),pe=Ke.extend({method:g("tasks/list")}),Q=Ye.extend({tasks:f(ft)}),Gt=u.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:u,NotificationsParamsSchema:m,NotificationSchema:S,ResultSchema:_,RequestIdSchema:y,EmptyResultSchema:P,CancelledNotificationParamsSchema:E,CancelledNotificationSchema:C,IconSchema:q,IconsSchema:J,BaseMetadataSchema:L,ImplementationSchema:U,ClientTasksCapabilitySchema:ee,ServerTasksCapabilitySchema:Ge,ClientCapabilitiesSchema:de,InitializeRequestParamsSchema:lt,InitializeRequestSchema:qt,ServerCapabilitiesSchema:Hr,InitializeResultSchema:Fr,InitializedNotificationSchema:Ro,PingRequestSchema:ut,ProgressSchema:At,ProgressNotificationParamsSchema:Me,ProgressNotificationSchema:dt,PaginatedRequestParamsSchema:wo,PaginatedRequestSchema:Ke,PaginatedResultSchema:Ye,ResourceContentsSchema:xo,TextResourceContentsSchema:Po,BlobResourceContentsSchema:To,RoleSchema:qe,AnnotationsSchema:Ee,ResourceSchema:Lt,ResourceTemplateSchema:Jr,ListResourcesRequestSchema:Br,ListResourcesResultSchema:Wr,ListResourceTemplatesRequestSchema:pt,ListResourceTemplatesResultSchema:ko,ResourceRequestParamsSchema:Ut,ReadResourceRequestParamsSchema:Gr,ReadResourceRequestSchema:Kr,ReadResourceResultSchema:Yr,ResourceListChangedNotificationSchema:Qr,SubscribeRequestParamsSchema:Xr,SubscribeRequestSchema:en,UnsubscribeRequestParamsSchema:tn,UnsubscribeRequestSchema:on,ResourceUpdatedNotificationParamsSchema:rn,ResourceUpdatedNotificationSchema:nn,PromptArgumentSchema:sn,PromptSchema:an,ListPromptsRequestSchema:cn,ListPromptsResultSchema:ln,GetPromptRequestParamsSchema:un,GetPromptRequestSchema:dn,TextContentSchema:Zt,ImageContentSchema:Dt,AudioContentSchema:Vt,ToolUseContentSchema:pn,EmbeddedResourceSchema:ht,ResourceLinkSchema:hn,ContentBlockSchema:Te,PromptMessageSchema:Eo,GetPromptResultSchema:$o,PromptListChangedNotificationSchema:Ht,ToolAnnotationsSchema:mn,ToolExecutionSchema:Co,ToolSchema:Ft,ListToolsRequestSchema:Io,ListToolsResultSchema:Oo,CallToolResultSchema:No,CallToolRequestParamsSchema:ae,CallToolRequestSchema:fn,ToolListChangedNotificationSchema:ma,LoggingLevelSchema:Mo,SetLevelRequestParamsSchema:gn,SetLevelRequestSchema:Sn,LoggingMessageNotificationParamsSchema:_n,LoggingMessageNotificationSchema:yn,ModelHintSchema:bn,ModelPreferencesSchema:zn,ToolChoiceSchema:vn,ToolResultContentSchema:fa,SamplingContentSchema:Rn,SamplingMessageContentBlockSchema:mt,SamplingMessageSchema:wn,CreateMessageRequestParamsSchema:xn,CreateMessageRequestSchema:Pn,CreateMessageResultSchema:Tn,CreateMessageResultWithToolsSchema:kn,BooleanSchemaSchema:En,StringSchemaSchema:$n,NumberSchemaSchema:Cn,UntitledSingleSelectEnumSchemaSchema:In,TitledSingleSelectEnumSchemaSchema:On,LegacyTitledEnumSchemaSchema:Nn,SingleSelectEnumSchemaSchema:Mn,UntitledMultiSelectEnumSchemaSchema:Jt,TitledMultiSelectEnumSchemaSchema:Bt,MultiSelectEnumSchemaSchema:ga,EnumSchemaSchema:Sa,PrimitiveSchemaDefinitionSchema:ze,ElicitRequestFormParamsSchema:ve,ElicitRequestURLParamsSchema:qn,ElicitRequestParamsSchema:$e,ElicitRequestSchema:_a,ElicitationCompleteNotificationParamsSchema:ya,ElicitationCompleteNotificationSchema:ba,ElicitResultSchema:za,ResourceTemplateReferenceSchema:va,PromptReferenceSchema:Ra,CompleteRequestParamsSchema:wa,CompleteRequestSchema:An,CompleteResultSchema:xa,RootSchema:Pa,ListRootsRequestSchema:qo,ListRootsResultSchema:jn,RootsListChangedNotificationSchema:Ta,TaskCreationParamsSchema:ka,TaskStatusSchema:Ln,TaskSchema:ft,CreateTaskResultSchema:Se,TaskStatusNotificationParamsSchema:Ea,TaskStatusNotificationSchema:Wt,GetTaskRequestSchema:Ao,GetTaskResultSchema:jo,GetTaskPayloadRequestSchema:Lo,GetTaskPayloadResultSchema:Kl,ListTasksRequestSchema:pe,ListTasksResultSchema:Q,CancelTaskRequestSchema:Gt,CancelTaskResultSchema:_.merge(ft),ClientRequestSchema:x([ut,qt,An,Sn,dn,cn,Br,pt,Kr,en,on,fn,Io,Ao,Lo,pe,Gt]),ClientNotificationSchema:x([C,dt,Ro,Ta,Wt]),ClientResultSchema:x([P,Tn,kn,za,jn,jo,Q,Se]),ServerRequestSchema:x([ut,Pn,_a,qo,Ao,Lo,pe,Gt]),ServerNotificationSchema:x([C,dt,yn,nn,Qr,ma,Ht,Wt,ba]),ServerResultSchema:x([P,Fr,xa,$o,ln,Wr,ko,Yr,No,Oo,jo,Q,Se]),CallToolResultWireSchema:T().superRefine((ce,O_)=>{if(!(typeof ce!="object"||ce===null||Array.isArray(ce)||ce.content!==void 0)){for(let xf of VS)if(xf in ce){O_.addIssue({code:"custom",message:`content is required when the body carries '${xf}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(Zb).pipe(No)}}var Vb;function HS(){return Vb??=Db()}function FS(e){return e.type!=="object"}var Hb=new Set(["const","enum","default","examples"]),Fb=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function $S(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Jb(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if($S(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let o=Ef(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&&$S(n.$id))return n;let i={},c=!1;for(let[l,u]of Object.entries(n))s?i[l]=r(u,!1):(l==="$ref"||l==="$dynamicRef")&&typeof u=="string"?i[l]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u:l==="$recursiveRef"&&u==="#"&&o?c=!0:Hb.has(l)?i[l]=u:Fb.has(l)?i[l]=r(u,!0):i[l]=r(u,!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 JS={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},BS={"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},Bb={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},Dl;function sf(){if(Dl)return Dl;let e=HS();return Dl={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}},Dl}function WS(e){return Object.prototype.hasOwnProperty.call(JS,e)}function GS(e){return Object.prototype.hasOwnProperty.call(BS,e)}function Wb(e){return Object.prototype.hasOwnProperty.call(Bb,e)}function Gb(e){return Wb(e)?sf().resultSchemas[e]:void 0}function Kb(e){return WS(e)?sf().requestSchemas[e]:void 0}function Yb(e){return GS(e)?sf().notificationSchemas[e]:void 0}var nw=Object.keys(JS),sw=Object.keys(BS);function ef(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Vl(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 CS={ok:!1,reason:"not-in-era"};function IS(e){return ef(e)&&ef(e.outputSchema)&&FS(e.outputSchema)}var af={era:"2025-11-25",hasRequestMethod:WS,hasNotificationMethod:GS,validateRequest:(e,t)=>Vl(Kb(e),t),validateResult:(e,t)=>Vl(Gb(e),t),validateNotification:(e,t)=>Vl(Yb(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>CS,validateInputResponse:()=>CS,samplingResultVariant:((e,t)=>{let o=HS();return Vl(e?o.CreateMessageResultWithToolsSchema:o.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let o=DS(e),r=o.structuredContent;if(r===void 0)return o;let n=typeof r!="object"||r===null||Array.isArray(r),s=t!==void 0&&FS(t);return!n&&!s?o:{...o,structuredContent:{result:r}}},decodeResult(e,t){if(ef(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=>IS(r))?t:{...t,tools:o.map(r=>IS(r)?{...r,outputSchema:Jb(r.outputSchema)}:r)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function Qb(){let e=Tt(()=>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=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:b().optional()}),u=p({taskId:a()}),m=$({progressToken:o.optional(),"io.modelcontextprotocol/related-task":u.optional()}),S=p({_meta:m.optional()}),_=S.extend({task:l.optional()}),y=p({_meta:m.optional()}),P=p({method:a(),params:y.loose().optional()}),E=p({src:a(),mimeType:a().optional(),sizes:f(a()).optional(),theme:I(["light","dark"]).optional()}),C=p({icons:f(E).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=ot(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=$({list:t.optional(),cancel:t.optional(),requests:$({sampling:$({createMessage:t.optional()}).optional(),elicitation:$({create:t.optional()}).optional()}).optional()}),F=$({list:t.optional(),cancel:t.optional(),requests:$({tools:$({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()}),Ge=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:k(b()),message:k(a())}),lt=p({...y.shape,...de.shape,progressToken:o}),qt=P.extend({method:g("notifications/progress"),params:lt}),Hr=y.extend({level:i,logger:a().optional(),data:T()}),Fr=P.extend({method:g("notifications/message"),params:Hr}),Ro=p({uri:a(),mimeType:k(a()),_meta:v(a(),T()).optional()}),ut=Ro.extend({text:a()}),At=Ro.extend({blob:c}),Me=p({audience:f(s).optional(),priority:b().min(0).max(1).optional(),lastModified:xe.datetime({offset:!0}).optional()}),dt=p({...q.shape,...C.shape,uri:a(),description:k(a()),mimeType:k(a()),size:k(b()),annotations:Me.optional(),_meta:k($({}))}),wo=p({...q.shape,...C.shape,uriTemplate:a(),description:k(a()),mimeType:k(a()),annotations:Me.optional(),_meta:k($({}))}),Ke=P.extend({method:g("notifications/resources/list_changed"),params:y.optional()}),Ye=y.extend({uri:a()}),xo=P.extend({method:g("notifications/resources/updated"),params:Ye}),Po=p({name:a(),description:k(a()),required:k(R())}),jt=p({...q.shape,...C.shape,description:k(a()),arguments:k(f(Po)),_meta:k($({}))}),To=P.extend({method:g("notifications/prompts/list_changed"),params:y.optional()}),qe=p({type:g("text"),text:a(),annotations:Me.optional(),_meta:v(a(),T()).optional()}),Ee=p({type:g("image"),data:c,mimeType:a(),annotations:Me.optional(),_meta:v(a(),T()).optional()}),Lt=p({type:g("audio"),data:c,mimeType:a(),annotations:Me.optional(),_meta:v(a(),T()).optional()}),Jr=p({type:g("tool_use"),name:a(),id:a(),input:v(a(),T()),_meta:v(a(),T()).optional()}),Br=p({type:g("resource"),resource:x([ut,At]),annotations:Me.optional(),_meta:v(a(),T()).optional()}),Wr=dt.extend({type:g("resource_link")}),pt=x([qe,Ee,Lt,Wr,Br]),ko=p({role:s,content:pt}),Ut=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),Gr=P.extend({method:g("notifications/tools/list_changed"),params:y.optional()}),Kr=p({name:a().optional()}),Yr=p({hints:f(Kr).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),Qr=p({mode:I(["auto","required","none"]).optional()}),Xr=p({type:g("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),en=p({type:g("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().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:b().optional(),maximum:b().optional(),default:b().optional()}),on=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),default:a().optional()}),rn=p({type:g("string"),title:a().optional(),description:a().optional(),oneOf:f(p({const:a(),title:a()})),default:a().optional()}),nn=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),enumNames:f(a()).optional(),default:a().optional()}),sn=x([on,rn]),an=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()}),cn=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()}),ln=x([an,cn]),un=x([nn,sn,ln]),dn=x([un,Xr,en,tn]),Zt=_.extend({mode:g("form").optional(),message:a(),requestedSchema:p({type:g("object"),properties:v(a(),dn),required:f(a()).optional()}).catchall(T())}),Dt=p({type:g("ref/resource"),uri:a()}),Vt=p({type:g("ref/prompt"),name:a()}),pn=p({uri:a().startsWith("file://"),name:a().optional(),_meta:v(a(),T()).optional()}),ht=ee.shape,hn=p({experimental:ht.experimental,sampling:ht.sampling,elicitation:ht.elicitation,roots:ht.roots,extensions:ht.extensions}),Te=Ge.shape,Eo=p({experimental:Te.experimental,logging:Te.logging,completions:Te.completions,prompts:Te.prompts,resources:Te.resources,tools:Te.tools,extensions:Te.extensions}),$o=$({progressToken:o.optional(),[so]:a(),[gr]:J.optional(),[io]:hn,[Sr]:i.optional()}),Ht=p({...q.shape,...C.shape,description:a().optional(),inputSchema:$({$schema:a().optional(),type:g("object")}),outputSchema:$({$schema:a().optional()}).optional(),annotations:Ut.optional(),_meta:v(a(),T()).optional()}),mn=p({type:g("tool_result"),toolUseId:a(),content:f(pt),structuredContent:T().optional(),isError:R().optional(),_meta:v(a(),T()).optional()}),Co=x([qe,Ee,Lt,Jr,mn]),Ft=p({role:s,content:x([Co,f(Co)]),_meta:v(a(),T()).optional()}),Io=a(),Oo=$({[Et]:J.optional().catch(void 0)}),No=Oo.optional();function ae(Q){return $({_meta:No,resultType:Io.default("complete"),...Q})}let fn=ae({}),ma=ae({nextCursor:r.optional()}),Mo=ae({content:f(pt),structuredContent:T().optional(),isError:R().optional()}),gn=ae({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),tools:f(Ht),nextCursor:r.optional()}),Sn=ae({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),prompts:f(jt),nextCursor:r.optional()}),_n=ae({description:a().optional(),messages:f(ko)}),yn=ae({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resources:f(dt),nextCursor:r.optional()}),bn=ae({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resourceTemplates:f(wo),nextCursor:r.optional()}),zn=ae({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),contents:f(x([ut,At]))}),vn=ae({completion:p({values:f(a()).max(100),total:b().int().optional(),hasMore:R().optional()}).loose()}),fa=ae({ttlMs:b().int().min(0),cacheScope:I(["public","private"])}),Rn=ae({ttlMs:b().int().min(0).catch(0),cacheScope:I(["public","private"]).catch("private"),supportedVersions:f(a()),capabilities:Eo,instructions:a().optional()}),mt=p({messages:f(Ft),modelPreferences:Yr.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:f(a()).optional(),metadata:t.optional(),tools:f(Ht).optional(),toolChoice:Qr.optional()}),wn=p({method:g("sampling/createMessage"),params:mt}),xn=p({method:g("roots/list"),params:p({_meta:v(a(),T()).optional()}).optional()}),Pn=p({...Ft.shape,model:a(),stopReason:a().optional()}),Tn=p({roots:f(pn)}),kn=p({action:I(["accept","decline","cancel"]),content:v(a(),x([a(),b(),R(),f(a())])).optional()}),En=p({mode:g("url"),message:a(),url:a().url()}),$n=x([Zt,En]),Cn=p({method:g("elicitation/create"),params:$n}),In=x([wn,xn,Cn]),On=x([Pn,Tn,kn]),Nn=v(a(),In),Mn=v(a(),On),Jt=ae({inputRequests:Nn.optional(),requestState:a().optional()}),Bt={inputResponses:Mn.optional(),requestState:a().optional()},ga=p({_meta:$o,...Bt}),Sa=$({progressToken:o.optional()});function ze(Q,Gt){return p({method:g(Q),params:p({_meta:$o,...Gt})})}function ve(Q,Gt){return p({method:g(Q),params:p({_meta:Sa.optional(),...Gt}).optional()})}let qn={name:a(),arguments:v(a(),T()).optional(),...Bt},$e={cursor:r.optional()},_a=ze("tools/call",qn),ya=ze("tools/list",$e),ba=ze("prompts/list",$e),za=ze("prompts/get",{name:a(),arguments:v(a(),a()).optional(),...Bt}),va=ze("resources/list",$e),Ra=ze("resources/templates/list",$e),wa=ze("resources/read",{uri:a(),...Bt}),An={ref:x([Vt,Dt]),argument:p({name:a(),value:a()}),context:p({arguments:v(a(),a()).optional()}).optional()},xa=ze("completion/complete",An),Pa=ze("server/discover",{}),qo=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:f(a()).optional()}),jn={notifications:qo},Ta=ze("subscriptions/listen",jn),ka=Oo.extend({"io.modelcontextprotocol/subscriptionId":n}),Ln=$({_meta:ka,resultType:Io.default("complete")}),ft={"tools/call":ve("tools/call",qn),"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",An),"server/discover":ve("server/discover",{}),"subscriptions/listen":ve("subscriptions/listen",jn)};function Se(Q){return $({_meta:No,...Q})}let Ea={"tools/call":Se({content:f(pt),structuredContent:T().optional(),isError:R().optional()}),"tools/list":Se({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),tools:f(Ht),nextCursor:r.optional()}),"prompts/get":Se({description:a().optional(),messages:f(ko)}),"prompts/list":Se({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),prompts:f(jt),nextCursor:r.optional()}),"resources/list":Se({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resources:f(dt),nextCursor:r.optional()}),"resources/templates/list":Se({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resourceTemplates:f(wo),nextCursor:r.optional()}),"resources/read":Se({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),contents:f(x([ut,At]))}),"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:I(["public","private"]).catch("private"),supportedVersions:f(a()),capabilities:Eo,instructions:a().optional()}),"subscriptions/listen":Se({})},Wt=$({"io.modelcontextprotocol/subscriptionId":n.optional()}),Ao=p({method:g("notifications/subscriptions/acknowledged"),params:p({_meta:Wt.optional(),notifications:qo})}),jo=p({_meta:Wt.optional(),requestId:n,reason:a().optional()}),Lo=p({method:g("notifications/cancelled"),params:jo}),Kl={"notifications/cancelled":Lo,"notifications/progress":qt,"notifications/message":Fr,"notifications/resources/updated":xo,"notifications/resources/list_changed":Ke,"notifications/tools/list_changed":Gr,"notifications/prompts/list_changed":To,"notifications/subscriptions/acknowledged":Ao},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:u,RequestMetaSchema:m,BaseRequestParamsSchema:S,TaskAugmentedRequestParamsSchema:_,NotificationsParamsSchema:y,NotificationSchema:P,IconSchema:E,IconsSchema:C,BaseMetadataSchema:q,ImplementationSchema:J,ClientTasksCapabilitySchema:B,ServerTasksCapabilitySchema:F,ClientCapabilitiesSchema:ee,ServerCapabilitiesSchema:Ge,ProgressSchema:de,ProgressNotificationParamsSchema:lt,ProgressNotificationSchema:qt,LoggingMessageNotificationParamsSchema:Hr,LoggingMessageNotificationSchema:Fr,ResourceContentsSchema:Ro,TextResourceContentsSchema:ut,BlobResourceContentsSchema:At,AnnotationsSchema:Me,ResourceSchema:dt,ResourceTemplateSchema:wo,ResourceListChangedNotificationSchema:Ke,ResourceUpdatedNotificationParamsSchema:Ye,ResourceUpdatedNotificationSchema:xo,PromptArgumentSchema:Po,PromptSchema:jt,PromptListChangedNotificationSchema:To,TextContentSchema:qe,ImageContentSchema:Ee,AudioContentSchema:Lt,ToolUseContentSchema:Jr,EmbeddedResourceSchema:Br,ResourceLinkSchema:Wr,ContentBlockSchema:pt,PromptMessageSchema:ko,ToolAnnotationsSchema:Ut,ToolListChangedNotificationSchema:Gr,ModelHintSchema:Kr,ModelPreferencesSchema:Yr,ToolChoiceSchema:Qr,BooleanSchemaSchema:Xr,StringSchemaSchema:en,NumberSchemaSchema:tn,UntitledSingleSelectEnumSchemaSchema:on,TitledSingleSelectEnumSchemaSchema:rn,LegacyTitledEnumSchemaSchema:nn,SingleSelectEnumSchemaSchema:sn,UntitledMultiSelectEnumSchemaSchema:an,TitledMultiSelectEnumSchemaSchema:cn,MultiSelectEnumSchemaSchema:ln,EnumSchemaSchema:un,PrimitiveSchemaDefinitionSchema:dn,ElicitRequestFormParamsSchema:Zt,ResourceTemplateReferenceSchema:Dt,PromptReferenceSchema:Vt,RootSchema:pn,ClientCapabilities2026Schema:hn,ServerCapabilities2026Schema:Eo,RequestMetaEnvelopeSchema:$o,ToolSchema:Ht,ToolResultContentSchema:mn,SamplingMessageContentBlockSchema:Co,SamplingMessageSchema:Ft,ResultTypeSchema:Io,ResultMetaSchema:Oo,ResultSchema:fn,PaginatedResultSchema:ma,CallToolResultSchema:Mo,ListToolsResultSchema:gn,ListPromptsResultSchema:Sn,GetPromptResultSchema:_n,ListResourcesResultSchema:yn,ListResourceTemplatesResultSchema:bn,ReadResourceResultSchema:zn,CompleteResultSchema:vn,CacheableResultSchema:fa,DiscoverResultSchema:Rn,CreateMessageRequestParamsSchema:mt,CreateMessageRequestSchema:wn,ListRootsRequestSchema:xn,CreateMessageResultSchema:Pn,ListRootsResultSchema:Tn,ElicitResultSchema:kn,ElicitRequestURLParamsSchema:En,ElicitRequestParamsSchema:$n,ElicitRequestSchema:Cn,InputRequestSchema:In,InputResponseSchema:On,InputRequestsSchema:Nn,InputResponsesSchema:Mn,InputRequiredResultSchema:Jt,InputResponseRequestParamsSchema:ga,CallToolRequestSchema:_a,ListToolsRequestSchema:ya,ListPromptsRequestSchema:ba,GetPromptRequestSchema:za,ListResourcesRequestSchema:va,ListResourceTemplatesRequestSchema:Ra,ReadResourceRequestSchema:wa,CompleteRequestSchema:xa,DiscoverRequestSchema:Pa,SubscriptionFilterSchema:qo,SubscriptionsListenRequestSchema:Ta,SubscriptionsListenResultMetaSchema:ka,SubscriptionsListenResultSchema:Ln,dispatchRequestSchemas:ft,dispatchResultSchemas:Ea,NotificationMetaSchema:Wt,SubscriptionsAcknowledgedNotificationSchema:Ao,CancelledNotificationParamsSchema:jo,CancelledNotificationSchema:Lo,notificationSchemas2026:Kl,JSONRPCResultResponseSchema:pe(fn),CallToolResultResponseSchema:pe(x([Mo,Jt])),ListToolsResultResponseSchema:pe(gn),ListPromptsResultResponseSchema:pe(Sn),GetPromptResultResponseSchema:pe(x([_n,Jt])),ListResourcesResultResponseSchema:pe(yn),ListResourceTemplatesResultResponseSchema:pe(bn),ReadResourceResultResponseSchema:pe(x([zn,Jt])),CompleteResultResponseSchema:pe(vn),DiscoverResultResponseSchema:pe(Rn),SubscriptionsListenResultResponseSchema:pe(Ln)}}var Xb;function Nt(){return Xb??=Qb()}var ez=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function tz(e){return ez.includes(e)}var cf=Symbol("modelcontextprotocol.resultCacheHintFallback");function oz(e){return e[cf]}function KS(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function YS(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 QS 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",zo(this,new.target)}static fromError(t,o,r){if(t===j.UrlElicitationRequired&&r){let n=r;if(n.elicitations)return new e_(n.elicitations,o)}if(t===j.UnsupportedProtocolVersion&&r){let n=r;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new t_({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 XS(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 o_({requiredCapabilities:n.requiredCapabilities},o)}return new QS(t,o,r)}},XS=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}},e_=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??[]}},t_=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}},o_=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}},rz=0,nz="private",sz=["tools/call","prompts/get","resources/read"];function iz(e,t){let o=t.resultType;if(o===void 0)return{...t,resultType:"complete"};if(o==="complete"||sz.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 az(e,t){let o=oz(t);if(t.resultType!=="complete"||!tz(e))return o===void 0?t:pz(t);let r=t,n=KS(r.ttlMs)?r.ttlMs:uz(o),s=YS(r.cacheScope)?r.cacheScope:dz(o),i={...r,ttlMs:n,cacheScope:s};return delete i[cf],i}function cz(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function lz(e,t){if(t===void 0)return e;let o=e._meta;return o===void 0?{...e,_meta:{[Et]:t}}:!cz(o)||o[Et]!==void 0?e:{...e,_meta:{...o,[Et]:t}}}function uz(e){return e!==void 0&&KS(e.ttlMs)?e.ttlMs:rz}function dz(e){return e!==void 0&&YS(e.cacheScope)?e.cacheScope:nz}function pz(e){let t={...e};return delete t[cf],t}var hz=["elicitation/create","sampling/createMessage","roots/list"],Hl;function r_(){if(Hl)return Hl;let e=Nt();return Hl={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:$({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Hl}function n_(e){return hz.includes(e)}function Wm(e){return n_(e)?r_().request[e]:void 0}function mz(e){return n_(e)?r_().response[e]:void 0}var lf={"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},s_={"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 i_(e){return Object.prototype.hasOwnProperty.call(lf,e)}function a_(e){return Object.prototype.hasOwnProperty.call(s_,e)}function fz(e){return Object.prototype.hasOwnProperty.call(lf,e)}function gz(e){return i_(e)?Nt().dispatchRequestSchemas[e]:void 0}function Sz(e){return fz(e)?Nt().dispatchResultSchemas[e]:void 0}function _z(e){return a_(e)?Nt().notificationSchemas2026[e]:void 0}var iw=Object.keys(lf),aw=Object.keys(s_);function ia(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function na(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 yz={ok:!1,reason:"not-in-era"},bz=[so,io];function zz(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=>ia(c)&&"execution"in c)&&(n().tools=s.map(c=>{if(!ia(c)||!("execution"in c))return c;let l={...c};return delete l.execution,l}));let i=t.capabilities;if(ia(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return o}var uf={era:"2026-07-28",hasRequestMethod:i_,hasNotificationMethod:a_,hasInputRequestMethod:e=>Wm(e)!==void 0,validateRequest:(e,t)=>na(gz(e),t),validateResult:(e,t)=>na(Sz(e),t),validateNotification:(e,t)=>na(_z(e),t),validateInputRequest:(e,t)=>na(Wm(e),t),validateInputResponse:(e,t)=>na(mz(e),t),samplingResultVariant:()=>yz,outboundEnvelope(e){return{[so]:e.protocolVersion,[gr]:e.clientInfo,[io]:e.clientCapabilities,...e.logLevel!==void 0&&{[Sr]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let r of bz)r in e||t.push({key:r,problem:"missing"});let o=Nt().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=>DS(e),inputRequestSchema:Wm,decodeResult(e,t){if(!ia(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=ia(i)?i:{},l=t.requestState,u=t._meta===void 0?void 0:Nt().ResultMetaSchema.safeParse(t._meta),m=u?.success?u.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=vz(),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 lz(az(e,iz(e,zz(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=Nt().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("; ")}`}},Fl;function vz(){if(Fl)return Fl;let e=Nt();return Fl={"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},Fl}var df="2026-07-28";function ca(e){return e!==void 0&&ZS(e)?uf:af}function OS(e){return e.revision!==void 0?ca(e.revision).era:e.era==="modern"?uf.era:af.era}function Gm(e){return c_.some(t=>t.hasRequestMethod(e))}function Km(e){return c_.some(t=>t.hasNotificationMethod(e))}function NS(e){return e==="tasks/get"||e==="tasks/cancel"}var c_=[af,uf],Rz=Tf({AnnotationsSchema:()=>He,AudioContentSchema:()=>fo,BaseMetadataSchema:()=>De,BaseRequestParamsSchema:()=>oe,BlobResourceContentsSchema:()=>Cr,BooleanSchemaSchema:()=>Mr,CallToolRequestParamsSchema:()=>pi,CallToolRequestSchema:()=>hi,CallToolResultSchema:()=>Ot,CancelTaskRequestSchema:()=>Il,CancelTaskResultSchema:()=>Ol,CancelledNotificationParamsSchema:()=>bs,CancelledNotificationSchema:()=>wr,ClientCapabilitiesSchema:()=>vs,ClientNotificationSchema:()=>Ml,ClientRequestSchema:()=>Nl,ClientResultSchema:()=>ql,ClientTasksCapabilitySchema:()=>yl,CompatibilityCallToolResultSchema:()=>zl,CompleteRequestParamsSchema:()=>Ui,CompleteRequestSchema:()=>Zi,CompleteResultSchema:()=>Di,ContentBlockSchema:()=>Fe,CreateMessageRequestParamsSchema:()=>xi,CreateMessageRequestSchema:()=>Pi,CreateMessageResultSchema:()=>Ti,CreateMessageResultWithToolsSchema:()=>ki,CreateTaskResultSchema:()=>wl,CursorSchema:()=>yr,DiscoverRequestSchema:()=>Ts,DiscoverResultSchema:()=>Pr,ElicitRequestFormParamsSchema:()=>bo,ElicitRequestParamsSchema:()=>Oi,ElicitRequestSchema:()=>Ni,ElicitRequestURLParamsSchema:()=>Ii,ElicitResultSchema:()=>Ai,ElicitationCompleteNotificationParamsSchema:()=>Mi,ElicitationCompleteNotificationSchema:()=>qi,EmbeddedResourceSchema:()=>go,EmptyResultSchema:()=>Ct,EnumSchemaSchema:()=>Ci,GetPromptRequestParamsSchema:()=>oi,GetPromptRequestSchema:()=>ri,GetPromptResultSchema:()=>ii,GetTaskPayloadRequestSchema:()=>kl,GetTaskPayloadResultSchema:()=>El,GetTaskRequestSchema:()=>Pl,GetTaskResultSchema:()=>Tl,IconSchema:()=>zs,IconsSchema:()=>nt,ImageContentSchema:()=>mo,ImplementationSchema:()=>Ve,InitializeRequestParamsSchema:()=>Rs,InitializeRequestSchema:()=>ws,InitializeResultSchema:()=>xs,InitializedNotificationSchema:()=>Ps,JSONArraySchema:()=>Sl,JSONObjectSchema:()=>W,JSONRPCErrorResponseSchema:()=>lo,JSONRPCMessageSchema:()=>uo,JSONRPCNotificationSchema:()=>Rr,JSONRPCRequestSchema:()=>vr,JSONRPCResponseSchema:()=>_l,JSONRPCResultResponseSchema:()=>co,JSONValueSchema:()=>rt,LegacyTitledEnumSchemaSchema:()=>jr,ListChangedOptionsBaseSchema:()=>vl,ListPromptsRequestSchema:()=>ei,ListPromptsResultSchema:()=>ti,ListResourceTemplatesRequestSchema:()=>Ns,ListResourceTemplatesResultSchema:()=>Ms,ListResourcesRequestSchema:()=>Is,ListResourcesResultSchema:()=>Os,ListRootsRequestSchema:()=>Hi,ListRootsResultSchema:()=>Fi,ListTasksRequestSchema:()=>$l,ListTasksResultSchema:()=>Cl,ListToolsRequestSchema:()=>ui,ListToolsResultSchema:()=>di,LoggingLevelSchema:()=>Nr,LoggingMessageNotificationParamsSchema:()=>Si,LoggingMessageNotificationSchema:()=>_i,ModelHintSchema:()=>yi,ModelPreferencesSchema:()=>bi,MultiSelectEnumSchemaSchema:()=>$i,NotificationSchema:()=>ne,NotificationsParamsSchema:()=>ue,NumberSchemaSchema:()=>yo,PaginatedRequestParamsSchema:()=>$s,PaginatedRequestSchema:()=>st,PaginatedResultSchema:()=>it,PingRequestSchema:()=>Tr,PrimitiveSchemaDefinitionSchema:()=>Zr,ProgressNotificationParamsSchema:()=>Es,ProgressNotificationSchema:()=>kr,ProgressSchema:()=>ks,ProgressTokenSchema:()=>_r,PromptArgumentSchema:()=>Qs,PromptListChangedNotificationSchema:()=>ai,PromptMessageSchema:()=>si,PromptReferenceSchema:()=>Li,PromptSchema:()=>Xs,ReadResourceRequestParamsSchema:()=>qs,ReadResourceRequestSchema:()=>As,ReadResourceResultSchema:()=>js,RelatedTaskMetadataSchema:()=>ys,RequestIdSchema:()=>Ne,RequestMetaSchema:()=>br,RequestSchema:()=>G,ResourceContentsSchema:()=>Er,ResourceLinkSchema:()=>So,ResourceListChangedNotificationSchema:()=>Ls,ResourceRequestParamsSchema:()=>po,ResourceSchema:()=>Ir,ResourceTemplateReferenceSchema:()=>ji,ResourceTemplateSchema:()=>Cs,ResourceUpdatedNotificationParamsSchema:()=>Ks,ResourceUpdatedNotificationSchema:()=>Ys,ResultMetaObjectSchema:()=>zr,ResultSchema:()=>K,RoleSchema:()=>at,RootSchema:()=>Vi,RootsListChangedNotificationSchema:()=>Ji,SamplingContentSchema:()=>Ri,SamplingMessageContentBlockSchema:()=>kt,SamplingMessageSchema:()=>wi,ServerCapabilitiesSchema:()=>xr,ServerNotificationSchema:()=>jl,ServerRequestSchema:()=>Al,ServerResultSchema:()=>Ll,ServerTasksCapabilitySchema:()=>bl,SetLevelRequestParamsSchema:()=>fi,SetLevelRequestSchema:()=>gi,SingleSelectEnumSchemaSchema:()=>Ei,StringSchemaSchema:()=>_o,SubscribeRequestParamsSchema:()=>Us,SubscribeRequestSchema:()=>Zs,SubscriptionFilterSchema:()=>Or,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Js,SubscriptionsAcknowledgedNotificationSchema:()=>Bs,SubscriptionsListenRequestParamsSchema:()=>Hs,SubscriptionsListenRequestSchema:()=>Fs,SubscriptionsListenResultMetaSchema:()=>Ws,SubscriptionsListenResultSchema:()=>Gs,TaskAugmentedRequestParamsSchema:()=>$t,TaskCreationParamsSchema:()=>Rl,TaskMetadataSchema:()=>_s,TaskSchema:()=>ct,TaskStatusNotificationParamsSchema:()=>Wi,TaskStatusNotificationSchema:()=>xl,TaskStatusSchema:()=>Bi,TextContentSchema:()=>ho,TextResourceContentsSchema:()=>$r,TitledMultiSelectEnumSchemaSchema:()=>Ur,TitledSingleSelectEnumSchemaSchema:()=>Ar,ToolAnnotationsSchema:()=>ci,ToolChoiceSchema:()=>zi,ToolExecutionSchema:()=>li,ToolListChangedNotificationSchema:()=>mi,ToolResultContentSchema:()=>vi,ToolSchema:()=>It,ToolUseContentSchema:()=>ni,UnsubscribeRequestParamsSchema:()=>Ds,UnsubscribeRequestSchema:()=>Vs,UntitledMultiSelectEnumSchemaSchema:()=>Lr,UntitledSingleSelectEnumSchemaSchema:()=>qr});var l_=e=>vr.safeParse(e).success,u_=e=>Rr.safeParse(e).success,tf=e=>co.safeParse(e).success,d_=e=>lo.safeParse(e).success;var aa=-32020,cw=[{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:[aa,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:[aa],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:[aa],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."}],lw={[j.ParseError]:400,[j.InvalidRequest]:400,[j.MethodNotFound]:404,[j.UnsupportedProtocolVersion]:400,[j.MissingRequiredClientCapability]:400,[aa]:400};function pf(e,t){return is(e,t)}function sa(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function of(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 MS=!1,rf="draft-2020-12";function wz(e,t="input"){let o=e["~standard"],r;if(o.jsonSchema)r=o.jsonSchema[t]({target:rf});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().");MS||(MS=!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=ro(e,{target:rf,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:p_(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 p_(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"||p_(r)))}return!1}function xz(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function Ym(e,t){let o=await e["~standard"].validate(t);return o.issues&&o.issues.length>0?{success:!1,error:o.issues.map(r=>xz(r)).join(", ")}:{success:!0,data:o.value}}function Pz(e){let t=ro(e,{target:rf,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var Tz=/\\\.\\d\{(\d+)\}/;function kz(e){let t=Tz.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 Ez(e,t){let o;switch(e){case"email":o=[Fc()];break;case"uri":o=[dr()];break;case"date":o=[xe.date()];break;case"date-time":o=kz(t);break}return new Set(o.map(r=>Pz(r)).filter(r=>r!==void 0))}function $z(e,t,o){return o!=="zod"?!0:Ez(e,t).has(t)}function la(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Cz(e){try{return wz(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 Iz=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function hf(e){return Iz.has(e)||e.startsWith("x-")}var Oz=new Set(["$schema",...Object.keys(bo.shape.requestedSchema.shape)]),qS={string:sa([_o,qr,Ar,jr]),number:sa([yo]),integer:sa([yo]),boolean:sa([Mr]),array:sa([Lr,Ur])},Nz=new Set(_o.shape.format.unwrap().options);function Mz(e,t,o,r){if(!la(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(qS,e.type)?qS[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,c]of Object.entries(e))n.has(i)||hf(i)?s[i]=c:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?Nz.has(e.format)?(typeof c!="string"||!$z(e.format,c,o))&&r.push(`${t}.${i}`):s[i]=c:r.push(`${t}.${i}`);return s}function qz(e,t){let o={},r=[];for(let[n,s]of Object.entries(e))n==="properties"&&la(s)?o[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,Mz(c,`properties.${i}`,t,r)])):Oz.has(n)?o[n]=s:hf(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 Az(e,t){if(!la(e.properties))return t;let o=Object.entries(e.properties).filter(([,r])=>!pf(Zr,r).success).map(([r])=>`properties.${r}`);return o.length>0?o.join(", "):t}function nf(e,t,o=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((r,n)=>nf(r,t[n],`${o}[${n}]`)):!la(e)||!la(t)?[]:Object.entries(e).flatMap(([r,n])=>{let s=o?`${o}.${r}`:r;return Object.prototype.hasOwnProperty.call(t,r)?nf(n,t[r],s):hf(r)?[]:[s]})}function jz(e){if(!of(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,o=qz(Cz(e.requestedSchema),t),r=pf(bo.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): ${Az(o,r.error.message)}`);let n=nf(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 Lz(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 uw=Object.assign(Lz,{elicit(e){try{return{method:"elicitation/create",params:jz(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 Uz=["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"],Zz={IdJagTokenExchangeResponseSchema:Xi,OAuthClientInformationFullSchema:ra,OAuthClientInformationSchema:oa,OAuthClientMetadataSchema:ta,OAuthClientRegistrationErrorSchema:Ul,OAuthErrorResponseSchema:ea,OAuthMetadataSchema:Dr,OAuthProtectedResourceMetadataSchema:Gi,OAuthTokenRevocationRequestSchema:Zl,OAuthTokensSchema:Qi,OpenIdProviderDiscoveryMetadataSchema:Yi,OpenIdProviderMetadataSchema:Ki},h_={},m_={};function f_(e,t){let o=e.slice(0,-6);h_[o]=t,m_[o]=r=>t.safeParse(r).success}for(let e of Uz)f_(e,Rz[e]);for(let[e,t]of Object.entries(Zz))f_(e,t);var Dz=Object.freeze(h_),Vz=Object.freeze(m_);function Hz(e){switch(e){case"initialize":case"notifications/initialized":return ca(void 0);case"server/discover":return ca(df);default:return}}var g_=6e4,Fz=[so,gr,io,Sr],Jz=["inputResponses","requestState"];function AS(e,t){let o=e.params;if(!Qm(o))return{message:e,lifted:{}};let r=o._meta,n=Qm(r)?Fz.filter(l=>l in r):[],s=t==="request"?Jz.filter(l=>l in o):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...o};if(n.length>0&&Qm(r)){let l={},u={...r};for(let m of n)l[m]=r[m],delete u[m];i.envelope=l,Object.keys(u).length>0?c._meta=u: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 jS(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 S_(e){return()=>e}var Bz=S_(void 0),Wz,mf=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{Wz=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??ml,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),tf(n)||d_(n)?this._onresponse(n):l_(n)?this._onrequest(n,s):u_(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}=AS(e,"notification"),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=OS(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(Km(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}=AS(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=(E,C,q)=>{let J={jsonrpc:"2.0",id:o.id,error:{code:E,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 E=OS(t.classification);if(E!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${o.method}': classified as ${E} but this instance serves ${n.era}`));let C=t.classification.revision??E;i(j.UnsupportedProtocolVersion,`Unsupported protocol version: ${C}`,{supported:this._supportedProtocolVersions,requested:C});return}}if(Gm(o.method)&&!n.hasRequestMethod(o.method)&&!(NS(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 u=(E,C)=>this._notificationViaCodec(this._resolveOutboundCodec(E.method),E,{...C,relatedRequestId:o.id}),m=(E,C,q)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(E.method),E,C,{...q,relatedRequestId:o.id}),S=new AbortController;this._requestHandlerAbortControllers.set(o.id,S);let _=r.inputResponses===void 0?void 0:Gz(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?Bz:S_(r.requestState),signal:S.signal,send:((E,C,q)=>{let J=this._resolveOutboundCodec(E.method);if(this._assertOutboundRequestInEra(J,E.method),of(C))return m(E,C,q);let L=jS(J,E.method);if(L===void 0)throw new TypeError(`'${E.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return m(E,L,C)}),notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},P=this.buildContext(y,t);Promise.resolve().then(()=>c(o,P)).then(async E=>{if(S.signal.aborted)return;let C;try{C=n.encodeResult(o.method,E,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 E=>{if(S.signal.aborted)return;let C=Number.isSafeInteger(E.code)?E.code:j.InternalError,q={jsonrpc:"2.0",id:o.id,error:{code:n.encodeErrorCode(C),message:E.message??"Internal error",...E.data!==void 0&&{data:E.data}}};await s?.send(q)}).catch(E=>this._onerror(new Error(`Failed to send response: ${E}`))).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),tf(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(of(t))return NS(e.method)||this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,o);this._assertOutboundRequestInEra(r,e.method);let n=jS(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 ca(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Hz(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Gm(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(),u,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 P=e.era===df&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,E=this._requestMessageId++;m=E;let C={...t,jsonrpc:"2.0",id:E};r?.onprogress&&(this._progressHandlers.set(E,r.onprogress),C.params={...t.params,_meta:{...t.params?._meta,progressToken:E}});let q=this._envelopeOutbound(C),J=!1,L=F=>{J||(this._progressHandlers.delete(E),P===void 0?t.method!=="initialize"&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:E,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(E,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(Kz(ee));let de={codec:e,request:t,resultSchema:o,options:r,flowStartedAt:l,retry:(lt,qt)=>this._requestWithSchemaViaCodec(e,lt===void 0?{method:t.method}:{method:t.method,params:lt},o,qt)};return S(this._resolveNonCompleteResult(ee,de))}let Ge=ee.result;Ym(o,Ge).then(de=>{de.success?S(de.data):_(new X(se.InvalidResult,`Invalid result for ${t.method}: ${de.error}`))},_)}),u=()=>L(r?.signal?.reason),r?.signal?.addEventListener("abort",u,{once:!0});let U=r?.timeout??g_,B=()=>L(new X(se.RequestTimeout,"Request timed out",{timeout:U}));this._setupTimeout(E,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(E),_(F)})}).finally(()=>{u&&r?.signal?.removeEventListener("abort",u),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(Km(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(!Gm(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 Ym(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(!Km(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 Ym(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 Qm(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function LS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Gz(e){let t={},o=[];if(!LS(e))return{accepted:t,droppedKeys:o};for(let[r,n]of Object.entries(e)){if(!LS(n)||"method"in n||"result"in n){o.push(r);continue}t[r]=n}return{accepted:t,droppedKeys:o}}function Kz(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var Yz=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 u=l.indexOf(";"),m=u!==-1?l.slice(0,u).trim():l.trim();if(!r.test(m))throw new TypeError("invalid media type");var S=new i(m.toLowerCase());if(u!==-1){var _,y,P;for(t.lastIndex=u;y=t.exec(l);){if(y.index!==u)throw new TypeError("invalid parameter format");u+=y[0].length,_=y[1].toLowerCase(),P=y[2],P.charCodeAt(0)===34&&(P=P.slice(1,-1),P.indexOf("\\")!==-1&&(P=P.replace(o,"$1"))),S.parameters[_]=P}if(u!==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}})),dw=kf(Yz(),1);var Qz=10*1024*1024;var vw=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 Xz=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,ev=[0,31,28,31,30,31,30,31,31,30,31,30,31],tv=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,ov=/^(?=.{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,rv=/^(?:[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,nv=/^(?:(?:[^\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,sv=/^(?:(?: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,iv=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,av=/^(?:\/(?:[^~/]|~0|~1)*)*$/,cv=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,lv=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,uv=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))},dv=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,pv=/^((([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,hv=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 Rw={date:__,time:y_.bind(void 0,!1),"date-time":gv,duration:hv,uri:yv,"uri-reference":Je(rv),"uri-template":Je(nv),url:Je(sv),email:uv,hostname:Je(ov),ipv4:Je(dv),ipv6:Je(pv),regex:zv,uuid:Je(iv),"json-pointer":Je(av),"json-pointer-uri-fragment":Je(cv),"relative-json-pointer":Je(lv)};function mv(e){return e%4===0&&(e%100!==0||e%400===0)}function __(e){let t=e.match(Xz);if(!t)return!1;let o=+t[1],r=+t[2],n=+t[3];return r>=1&&r<=12&&n>=1&&n<=(r==2&&mv(o)?29:ev[r])}function y_(e,t){let o=t.match(tv);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 fv=/t|\s/i;function gv(e){let t=e.split(fv);return t.length==2&&__(t[0])&&y_(!0,t[1])}var Sv=/\/|:/,_v=/^(?:[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 yv(e){return Sv.test(e)&&_v.test(e)}var bv=/[^\\]\\Z/;function zv(e){if(bv.test(e))return!1;try{return new RegExp(e,"u"),!0}catch{return!1}}var Rv;Rv=globalThis.crypto;var ua=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,zo(this,new.target)}},Sx=class extends ua{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}},_x=class extends ua{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}},yx=class extends ua{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}},bx=class extends ua{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}},zx=class extends ua{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 vx=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",zo(this,new.target)}};var Rx=Symbol.for("mcp.authSeamEscape");var wx=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,zo(this,new.target)}};var ff=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}},gf=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)}},b_=new Set;function z_(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";b_.has(i)||(b_.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,u)=>c({method:s,params:l},wv(u)):l=>c({method:s,params:l})]}function wv(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 xv="2026-01-26";var Pv="ui/notifications/tool-input-partial";var Sf=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=uo.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},Tv=d.union([d.literal("light"),d.literal("dark")]).describe("Color theme preference for the host environment."),da=d.union([d.literal("inline"),d.literal("fullscreen"),d.literal("pip")]).describe("Display mode for UI presentation."),kv=d.union([d.literal("--color-background-primary"),d.literal("--color-background-secondary"),d.literal("--color-background-tertiary"),d.literal("--color-background-inverse"),d.literal("--color-background-ghost"),d.literal("--color-background-info"),d.literal("--color-background-danger"),d.literal("--color-background-success"),d.literal("--color-background-warning"),d.literal("--color-background-disabled"),d.literal("--color-text-primary"),d.literal("--color-text-secondary"),d.literal("--color-text-tertiary"),d.literal("--color-text-inverse"),d.literal("--color-text-ghost"),d.literal("--color-text-info"),d.literal("--color-text-danger"),d.literal("--color-text-success"),d.literal("--color-text-warning"),d.literal("--color-text-disabled"),d.literal("--color-border-primary"),d.literal("--color-border-secondary"),d.literal("--color-border-tertiary"),d.literal("--color-border-inverse"),d.literal("--color-border-ghost"),d.literal("--color-border-info"),d.literal("--color-border-danger"),d.literal("--color-border-success"),d.literal("--color-border-warning"),d.literal("--color-border-disabled"),d.literal("--color-ring-primary"),d.literal("--color-ring-secondary"),d.literal("--color-ring-inverse"),d.literal("--color-ring-info"),d.literal("--color-ring-danger"),d.literal("--color-ring-success"),d.literal("--color-ring-warning"),d.literal("--font-sans"),d.literal("--font-mono"),d.literal("--font-weight-normal"),d.literal("--font-weight-medium"),d.literal("--font-weight-semibold"),d.literal("--font-weight-bold"),d.literal("--font-text-xs-size"),d.literal("--font-text-sm-size"),d.literal("--font-text-md-size"),d.literal("--font-text-lg-size"),d.literal("--font-heading-xs-size"),d.literal("--font-heading-sm-size"),d.literal("--font-heading-md-size"),d.literal("--font-heading-lg-size"),d.literal("--font-heading-xl-size"),d.literal("--font-heading-2xl-size"),d.literal("--font-heading-3xl-size"),d.literal("--font-text-xs-line-height"),d.literal("--font-text-sm-line-height"),d.literal("--font-text-md-line-height"),d.literal("--font-text-lg-line-height"),d.literal("--font-heading-xs-line-height"),d.literal("--font-heading-sm-line-height"),d.literal("--font-heading-md-line-height"),d.literal("--font-heading-lg-line-height"),d.literal("--font-heading-xl-line-height"),d.literal("--font-heading-2xl-line-height"),d.literal("--font-heading-3xl-line-height"),d.literal("--border-radius-xs"),d.literal("--border-radius-sm"),d.literal("--border-radius-md"),d.literal("--border-radius-lg"),d.literal("--border-radius-xl"),d.literal("--border-radius-full"),d.literal("--border-width-regular"),d.literal("--shadow-hairline"),d.literal("--shadow-sm"),d.literal("--shadow-md"),d.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),Ev=d.record(kv.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 u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){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 xt(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 u=l.def??l.schema,m={...u},S=l.ref;if(l.ref=null,S){r(S);let y=e.seen.get(S),P=y.schema;if(P.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(P)):Object.assign(u,P),Object.assign(u,m),c._zod.parent===S)for(let C in u)C==="$ref"||C==="allOf"||C in m||delete u[C];if(P.$ref&&y.def)for(let C in u)C==="$ref"||C==="allOf"||C in y.def&&JSON.stringify(u[C])===JSON.stringify(y.def[C])&&delete u[C]}let _=c._zod.parent;if(_&&_!==S){r(_);let y=e.seen.get(_);if(y?.schema.$ref&&(u.$ref=y.schema.$ref,y.def))for(let P in u)P==="$ref"||P==="allOf"||P in y.def&&JSON.stringify(u[P])===JSON.stringify(y.def[P])&&delete u[P]}e.override({zodSchema:c,jsonSchema:u,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:ar(t,"input",e.processors),output:ar(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 sh=(e,t={})=>o=>{let r=Rt({...o,processors:t});return Z(e,r),wt(r,e),xt(r,e)},ar=(e,t,o={})=>r=>{let{libraryOptions:n,target:s}=r??{},i=Rt({...n??{},target:s,io:t,processors:o});return Z(e,i),wt(i,e),xt(i,e)};var vb={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ih=(e,t,o,r)=>{let n=o;n.type="string";let{minimum:s,maximum:i,format:c,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),c&&(n.format=vb[c]??c,n.format===""&&delete n.format,c==="time"&&delete n.format),u&&(n.contentEncoding=u),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}))])}},ah=(e,t,o,r)=>{let n=o,{minimum:s,maximum:i,format:c,multipleOf:l,exclusiveMaximum:u,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 u=="number"&&u<=(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=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof i=="number"&&(n.maximum=i),typeof l=="number"&&(n.multipleOf=l)},ch=(e,t,o,r)=>{o.type="boolean"},lh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},uh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},dh=(e,t,o,r)=>{t.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},ph=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},hh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},mh=(e,t,o,r)=>{o.not={}},fh=(e,t,o,r)=>{},gh=(e,t,o,r)=>{},Sh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},_h=(e,t,o,r)=>{let n=e._zod.def,s=Vn(n.entries);s.every(i=>typeof i=="number")&&(o.type="number"),s.every(i=>typeof i=="string")&&(o.type="string"),o.enum=s},yh=(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},bh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},vh=(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},zh=(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(u=>({contentMediaType:u}))):Object.assign(n,s)},Rh=(e,t,o,r)=>{o.type="boolean"},wh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},xh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Ph=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Th=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},kh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Eh=(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"]})},$h=(e,t,o,r)=>{let n=o,s=e._zod.def;n.type="object",n.properties={};let i=s.shape;for(let u in i)n.properties[u]=Z(i[u],t,{...r,path:[...r.path,"properties",u]});let c=new Set(Object.keys(i)),l=new Set([...c].filter(u=>{let m=s.shape[u]._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)},Oc=(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},Ch=(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=u=>"allOf"in u&&Object.keys(u).length===1,l=[...c(s)?s.allOf:[s],...c(i)?i.allOf:[i]];o.allOf=l},Ih=(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)=>Z(_,t,{...r,path:[...r.path,i,y]})),u=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,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:l},u&&n.items.anyOf.push(u),n.minItems=l.length,u||(n.maxItems=l.length)):(n.items=l,u&&(n.additionalItems=u));let{minimum:m,maximum:S}=e._zod.bag;typeof m=="number"&&(n.minItems=m),typeof S=="number"&&(n.maxItems=S)},Oh=(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 u=i._zod.values;if(u){let m=[...u].filter(S=>typeof S=="string"||typeof S=="number");m.length>0&&(n.required=m)}},Nh=(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"}]},Mh=(e,t,o,r)=>{let n=e._zod.def;Z(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},qh=(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))},Ah=(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)))},jh=(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},Lh=(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},Uh=(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},Zh=(e,t,o,r)=>{let n=e._zod.def;Z(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Nc=(e,t,o,r)=>{let n=e._zod.def;Z(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Dh=(e,t,o,r)=>{let n=e._zod.innerType;Z(n,t,r);let s=t.seen.get(e);s.ref=n},Ic={string:ih,number:ah,boolean:ch,bigint:lh,symbol:uh,null:dh,undefined:ph,void:hh,never:mh,any:fh,unknown:gh,date:Sh,enum:_h,literal:yh,nan:bh,template_literal:vh,file:zh,success:Rh,custom:wh,function:xh,transform:Ph,map:Th,set:kh,array:Eh,object:$h,union:Oc,intersection:Ch,tuple:Ih,record:Oh,nullable:Nh,nonoptional:Mh,default:qh,prefault:Ah,catch:jh,pipe:Lh,readonly:Uh,promise:Zh,optional:Nc,lazy:Dh};function ro(e,t){if("_idmap"in e){let r=e,n=Rt({...t,processors:Ic}),s={};for(let l of r._idmap.entries()){let[u,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[u,m]=l;wt(n,m),i[u]=xt(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=Rt({...t,processors:Ic});return Z(e,o),wt(o,e),xt(o,e)}var Mc=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=Rt({processors:Ic,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)),wt(this.ctx,t);let r=xt(this.ctx,t),{"~standard":n,...s}=r;return s}};var lg={};var is={};Qe(is,{ZodAny:()=>cm,ZodArray:()=>pm,ZodBase64:()=>rl,ZodBase64URL:()=>nl,ZodBigInt:()=>fr,ZodBigIntFormat:()=>al,ZodBoolean:()=>mr,ZodCIDRv4:()=>tl,ZodCIDRv6:()=>ol,ZodCUID:()=>Wc,ZodCUID2:()=>Gc,ZodCatch:()=>Im,ZodCodec:()=>gs,ZodCustom:()=>Ss,ZodCustomStringFormat:()=>pr,ZodDate:()=>ps,ZodDefault:()=>Pm,ZodDiscriminatedUnion:()=>mm,ZodE164:()=>sl,ZodEmail:()=>Hc,ZodEmoji:()=>Jc,ZodEnum:()=>lr,ZodExactOptional:()=>Rm,ZodFile:()=>vm,ZodFunction:()=>Zm,ZodGUID:()=>cs,ZodIPv4:()=>Xc,ZodIPv6:()=>el,ZodIntersection:()=>fm,ZodJWT:()=>il,ZodKSUID:()=>Qc,ZodLazy:()=>Lm,ZodLiteral:()=>bm,ZodMAC:()=>nm,ZodMap:()=>_m,ZodNaN:()=>Nm,ZodNanoID:()=>Bc,ZodNever:()=>um,ZodNonOptional:()=>pl,ZodNull:()=>am,ZodNullable:()=>xm,ZodNumber:()=>hr,ZodNumberFormat:()=>no,ZodObject:()=>hs,ZodOptional:()=>dl,ZodPipe:()=>fs,ZodPrefault:()=>km,ZodPreprocess:()=>Mm,ZodPromise:()=>Um,ZodReadonly:()=>qm,ZodRecord:()=>cr,ZodSet:()=>ym,ZodString:()=>ur,ZodStringFormat:()=>V,ZodSuccess:()=>Cm,ZodSymbol:()=>sm,ZodTemplateLiteral:()=>jm,ZodTransform:()=>zm,ZodTuple:()=>gm,ZodType:()=>M,ZodULID:()=>Kc,ZodURL:()=>ds,ZodUUID:()=>Ue,ZodUndefined:()=>im,ZodUnion:()=>ms,ZodUnknown:()=>lm,ZodVoid:()=>dm,ZodXID:()=>Yc,ZodXor:()=>hm,_ZodString:()=>Vc,_default:()=>Tm,_function:()=>dS,any:()=>cl,array:()=>f,base64:()=>$g,base64url:()=>Cg,bigint:()=>Dg,boolean:()=>R,catch:()=>Om,check:()=>pS,cidrv4:()=>kg,cidrv6:()=>Eg,codec:()=>aS,cuid:()=>bg,cuid2:()=>vg,custom:()=>hS,date:()=>Wg,describe:()=>mS,discriminatedUnion:()=>Pt,e164:()=>Ig,email:()=>Fc,emoji:()=>_g,enum:()=>I,exactOptional:()=>wm,file:()=>rS,float32:()=>jg,float64:()=>Lg,function:()=>dS,guid:()=>pg,hash:()=>Ag,hex:()=>qg,hostname:()=>Mg,httpUrl:()=>Sg,instanceof:()=>gS,int:()=>Zc,int32:()=>Ug,int64:()=>Vg,intersection:()=>Oe,invertCodec:()=>cS,ipv4:()=>xg,ipv6:()=>Tg,json:()=>_S,jwt:()=>Og,keyof:()=>Gg,ksuid:()=>wg,lazy:()=>Tt,literal:()=>g,looseObject:()=>$,looseRecord:()=>Xg,mac:()=>Pg,map:()=>eS,meta:()=>fS,nan:()=>iS,nanoid:()=>yg,nativeEnum:()=>oS,never:()=>ll,nonoptional:()=>$m,null:()=>Ze,nullable:()=>ls,nullish:()=>nS,number:()=>b,object:()=>p,optional:()=>k,partialRecord:()=>Qg,pipe:()=>Dc,prefault:()=>Em,preprocess:()=>ot,promise:()=>uS,readonly:()=>Am,record:()=>z,refine:()=>Dm,set:()=>tS,strictObject:()=>Kg,string:()=>a,stringFormat:()=>Ng,stringbool:()=>SS,success:()=>sS,superRefine:()=>Vm,symbol:()=>Fg,templateLiteral:()=>lS,transform:()=>ul,tuple:()=>Sm,uint32:()=>Zg,uint64:()=>Hg,ulid:()=>zg,undefined:()=>Jg,union:()=>x,unknown:()=>T,url:()=>dr,uuid:()=>hg,uuidv4:()=>mg,uuidv6:()=>fg,uuidv7:()=>gg,void:()=>Bg,xid:()=>Rg,xor:()=>Yg});var qc={};Qe(qc,{endsWith:()=>Xo,gt:()=>je,gte:()=>fe,includes:()=>Yo,length:()=>oo,lowercase:()=>Go,lt:()=>Ae,lte:()=>we,maxLength:()=>to,maxSize:()=>zt,mime:()=>er,minLength:()=>et,minSize:()=>Le,multipleOf:()=>vt,negative:()=>kc,nonnegative:()=>$c,nonpositive:()=>Ec,normalize:()=>tr,overwrite:()=>Ie,positive:()=>Tc,property:()=>Cc,regex:()=>Wo,size:()=>eo,slugify:()=>sr,startsWith:()=>Qo,toLowerCase:()=>rr,toUpperCase:()=>nr,trim:()=>or,uppercase:()=>Ko});var xe={};Qe(xe,{ZodISODate:()=>jc,ZodISODateTime:()=>Ac,ZodISODuration:()=>Uc,ZodISOTime:()=>Lc,date:()=>Hh,datetime:()=>Vh,duration:()=>Jh,time:()=>Fh});var Ac=h("ZodISODateTime",(e,t)=>{bd.init(e,t),V.init(e,t)});function Vh(e){return wp(Ac,e)}var jc=h("ZodISODate",(e,t)=>{vd.init(e,t),V.init(e,t)});function Hh(e){return xp(jc,e)}var Lc=h("ZodISOTime",(e,t)=>{zd.init(e,t),V.init(e,t)});function Fh(e){return Pp(Lc,e)}var Uc=h("ZodISODuration",(e,t)=>{Rd.init(e,t),V.init(e,t)});function Jh(e){return Tp(Uc,e)}var ug=(e,t)=>{Wn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>Kn(e,o)},flatten:{value:o=>Gn(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,Uo,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,Uo,2)}},isEmpty:{get(){return e.issues.length===0}}})},Rb=h("ZodError",ug),be=h("ZodError",ug,{Parent:Error});var Bh=Vo(be),Wh=Ho(be),as=Fo(be),Gh=Jo(be),Kh=Aa(be),Yh=ja(be),Qh=La(be),Xh=Ua(be),em=Za(be),tm=Da(be),om=Va(be),rm=Ha(be);var dg=new WeakMap;function us(e,t,o){let r=Object.getPrototypeOf(e),n=dg.get(r);if(n||(n=new Set,dg.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:ar(e,"input"),output:ar(e,"output")}}),e.toJSONSchema=sh(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(o,r)=>Bh(e,o,r,{callee:e.parse}),e.safeParse=(o,r)=>as(e,o,r),e.parseAsync=async(o,r)=>Wh(e,o,r,{callee:e.parseAsync}),e.safeParseAsync=async(o,r)=>Gh(e,o,r),e.spa=e.safeParseAsync,e.encode=(o,r)=>Kh(e,o,r),e.decode=(o,r)=>Yh(e,o,r),e.encodeAsync=async(o,r)=>Qh(e,o,r),e.decodeAsync=async(o,r)=>Xh(e,o,r),e.safeEncode=(o,r)=>em(e,o,r),e.safeDecode=(o,r)=>tm(e,o,r),e.safeEncodeAsync=async(o,r)=>om(e,o,r),e.safeDecodeAsync=async(o,r)=>rm(e,o,r),us(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(Dm(o,r))},superRefine(o,r){return this.check(Vm(o,r))},overwrite(o){return this.check(Ie(o))},optional(){return k(this)},exactOptional(){return wm(this)},nullable(){return ls(this)},nullish(){return k(ls(this))},nonoptional(o){return $m(this,o)},array(){return f(this)},or(o){return x([this,o])},and(o){return Oe(this,o)},transform(o){return Dc(this,ul(o))},default(o){return Tm(this,o)},prefault(o){return Em(this,o)},catch(o){return Om(this,o)},pipe(o){return Dc(this,o)},readonly(){return Am(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)),Vc=h("_ZodString",(e,t)=>{Xt.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ih(e,r,n,s);let o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,us(e,"_ZodString",{regex(...r){return this.check(Wo(...r))},includes(...r){return this.check(Yo(...r))},startsWith(...r){return this.check(Qo(...r))},endsWith(...r){return this.check(Xo(...r))},min(...r){return this.check(et(...r))},max(...r){return this.check(to(...r))},length(...r){return this.check(oo(...r))},nonempty(...r){return this.check(et(1,...r))},lowercase(r){return this.check(Go(r))},uppercase(r){return this.check(Ko(r))},trim(){return this.check(or())},normalize(...r){return this.check(tr(...r))},toLowerCase(){return this.check(rr())},toUpperCase(){return this.check(nr())},slugify(){return this.check(sr())}})}),ur=h("ZodString",(e,t)=>{Xt.init(e,t),Vc.init(e,t),e.email=o=>e.check(ac(Hc,o)),e.url=o=>e.check(ss(ds,o)),e.jwt=o=>e.check(Pc(il,o)),e.emoji=o=>e.check(pc(Jc,o)),e.guid=o=>e.check(ns(cs,o)),e.uuid=o=>e.check(cc(Ue,o)),e.uuidv4=o=>e.check(lc(Ue,o)),e.uuidv6=o=>e.check(uc(Ue,o)),e.uuidv7=o=>e.check(dc(Ue,o)),e.nanoid=o=>e.check(hc(Bc,o)),e.guid=o=>e.check(ns(cs,o)),e.cuid=o=>e.check(mc(Wc,o)),e.cuid2=o=>e.check(fc(Gc,o)),e.ulid=o=>e.check(gc(Kc,o)),e.base64=o=>e.check(Rc(rl,o)),e.base64url=o=>e.check(wc(nl,o)),e.xid=o=>e.check(Sc(Yc,o)),e.ksuid=o=>e.check(_c(Qc,o)),e.ipv4=o=>e.check(yc(Xc,o)),e.ipv6=o=>e.check(bc(el,o)),e.cidrv4=o=>e.check(vc(tl,o)),e.cidrv6=o=>e.check(zc(ol,o)),e.e164=o=>e.check(xc(sl,o)),e.datetime=o=>e.check(Vh(o)),e.date=o=>e.check(Hh(o)),e.time=o=>e.check(Fh(o)),e.duration=o=>e.check(Jh(o))});function a(e){return bp(ur,e)}var V=h("ZodStringFormat",(e,t)=>{D.init(e,t),Vc.init(e,t)}),Hc=h("ZodEmail",(e,t)=>{dd.init(e,t),V.init(e,t)});function Fc(e){return ac(Hc,e)}var cs=h("ZodGUID",(e,t)=>{ld.init(e,t),V.init(e,t)});function pg(e){return ns(cs,e)}var Ue=h("ZodUUID",(e,t)=>{ud.init(e,t),V.init(e,t)});function hg(e){return cc(Ue,e)}function mg(e){return lc(Ue,e)}function fg(e){return uc(Ue,e)}function gg(e){return dc(Ue,e)}var ds=h("ZodURL",(e,t)=>{pd.init(e,t),V.init(e,t)});function dr(e){return ss(ds,e)}function Sg(e){return ss(ds,{protocol:Re.httpProtocol,hostname:Re.domain,...O.normalizeParams(e)})}var Jc=h("ZodEmoji",(e,t)=>{hd.init(e,t),V.init(e,t)});function _g(e){return pc(Jc,e)}var Bc=h("ZodNanoID",(e,t)=>{md.init(e,t),V.init(e,t)});function yg(e){return hc(Bc,e)}var Wc=h("ZodCUID",(e,t)=>{fd.init(e,t),V.init(e,t)});function bg(e){return mc(Wc,e)}var Gc=h("ZodCUID2",(e,t)=>{gd.init(e,t),V.init(e,t)});function vg(e){return fc(Gc,e)}var Kc=h("ZodULID",(e,t)=>{Sd.init(e,t),V.init(e,t)});function zg(e){return gc(Kc,e)}var Yc=h("ZodXID",(e,t)=>{_d.init(e,t),V.init(e,t)});function Rg(e){return Sc(Yc,e)}var Qc=h("ZodKSUID",(e,t)=>{yd.init(e,t),V.init(e,t)});function wg(e){return _c(Qc,e)}var Xc=h("ZodIPv4",(e,t)=>{wd.init(e,t),V.init(e,t)});function xg(e){return yc(Xc,e)}var nm=h("ZodMAC",(e,t)=>{Pd.init(e,t),V.init(e,t)});function Pg(e){return zp(nm,e)}var el=h("ZodIPv6",(e,t)=>{xd.init(e,t),V.init(e,t)});function Tg(e){return bc(el,e)}var tl=h("ZodCIDRv4",(e,t)=>{Td.init(e,t),V.init(e,t)});function kg(e){return vc(tl,e)}var ol=h("ZodCIDRv6",(e,t)=>{kd.init(e,t),V.init(e,t)});function Eg(e){return zc(ol,e)}var rl=h("ZodBase64",(e,t)=>{$d.init(e,t),V.init(e,t)});function $g(e){return Rc(rl,e)}var nl=h("ZodBase64URL",(e,t)=>{Cd.init(e,t),V.init(e,t)});function Cg(e){return wc(nl,e)}var sl=h("ZodE164",(e,t)=>{Id.init(e,t),V.init(e,t)});function Ig(e){return xc(sl,e)}var il=h("ZodJWT",(e,t)=>{Od.init(e,t),V.init(e,t)});function Og(e){return Pc(il,e)}var pr=h("ZodCustomStringFormat",(e,t)=>{Nd.init(e,t),V.init(e,t)});function Ng(e,t,o={}){return ir(pr,e,t,o)}function Mg(e){return ir(pr,"hostname",Re.hostname,e)}function qg(e){return ir(pr,"hex",Re.hex,e)}function Ag(e,t){let o=t?.enc??"hex",r=`${e}_${o}`,n=Re[r];if(!n)throw new Error(`Unrecognized hash format: ${r}`);return ir(pr,r,n,t)}var hr=h("ZodNumber",(e,t)=>{Xa.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ah(e,r,n,s),us(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(Zc(r))},safe(r){return this.check(Zc(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(vt(r,n))},step(r,n){return this.check(vt(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 kp(hr,e)}var no=h("ZodNumberFormat",(e,t)=>{Md.init(e,t),hr.init(e,t)});function Zc(e){return $p(no,e)}function jg(e){return Cp(no,e)}function Lg(e){return Ip(no,e)}function Ug(e){return Op(no,e)}function Zg(e){return Np(no,e)}var mr=h("ZodBoolean",(e,t)=>{es.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ch(e,o,r,n)});function R(e){return Mp(mr,e)}var fr=h("ZodBigInt",(e,t)=>{ec.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>lh(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(vt(r,n));let o=e._zod.bag;e.minValue=o.minimum??null,e.maxValue=o.maximum??null,e.format=o.format??null});function Dg(e){return Ap(fr,e)}var al=h("ZodBigIntFormat",(e,t)=>{qd.init(e,t),fr.init(e,t)});function Vg(e){return Lp(al,e)}function Hg(e){return Up(al,e)}var sm=h("ZodSymbol",(e,t)=>{Ad.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>uh(e,o,r,n)});function Fg(e){return Zp(sm,e)}var im=h("ZodUndefined",(e,t)=>{jd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ph(e,o,r,n)});function Jg(e){return Dp(im,e)}var am=h("ZodNull",(e,t)=>{Ld.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>dh(e,o,r,n)});function Ze(e){return Vp(am,e)}var cm=h("ZodAny",(e,t)=>{Ud.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>fh(e,o,r,n)});function cl(){return Hp(cm)}var lm=h("ZodUnknown",(e,t)=>{Zd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>gh(e,o,r,n)});function T(){return Fp(lm)}var um=h("ZodNever",(e,t)=>{Dd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>mh(e,o,r,n)});function ll(e){return Jp(um,e)}var dm=h("ZodVoid",(e,t)=>{Vd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>hh(e,o,r,n)});function Bg(e){return Bp(dm,e)}var ps=h("ZodDate",(e,t)=>{Hd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Sh(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 Wg(e){return Wp(ps,e)}var pm=h("ZodArray",(e,t)=>{Fd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Eh(e,o,r,n),e.element=t.element,us(e,"ZodArray",{min(o,r){return this.check(et(o,r))},nonempty(o){return this.check(et(1,o))},max(o,r){return this.check(to(o,r))},length(o,r){return this.check(oo(o,r))},unwrap(){return this.element}})});function f(e,t){return Yp(pm,e,t)}function Gg(e){let t=e._zod.def.shape;return I(Object.keys(t))}var hs=h("ZodObject",(e,t)=>{Jd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>$h(e,o,r,n),O.defineLazy(e,"shape",()=>t.shape),us(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:ll()})},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(dl,this,o[0])},required(...o){return O.required(pl,this,o[0])}})});function p(e,t){let o={type:"object",shape:e??{},...O.normalizeParams(t)};return new hs(o)}function Kg(e,t){return new hs({type:"object",shape:e,catchall:ll(),...O.normalizeParams(t)})}function $(e,t){return new hs({type:"object",shape:e,catchall:T(),...O.normalizeParams(t)})}var ms=h("ZodUnion",(e,t)=>{ts.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Oc(e,o,r,n),e.options=t.options});function x(e,t){return new ms({type:"union",options:e,...O.normalizeParams(t)})}var hm=h("ZodXor",(e,t)=>{ms.init(e,t),Bd.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Oc(e,o,r,n),e.options=t.options});function Yg(e,t){return new hm({type:"union",options:e,inclusive:!1,...O.normalizeParams(t)})}var mm=h("ZodDiscriminatedUnion",(e,t)=>{ms.init(e,t),Wd.init(e,t)});function Pt(e,t,o){return new mm({type:"union",options:t,discriminator:e,...O.normalizeParams(o)})}var fm=h("ZodIntersection",(e,t)=>{Gd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ch(e,o,r,n)});function Oe(e,t){return new fm({type:"intersection",left:e,right:t})}var gm=h("ZodTuple",(e,t)=>{tc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ih(e,o,r,n),e.rest=o=>e.clone({...e._zod.def,rest:o})});function Sm(e,t,o){let r=t instanceof N,n=r?o:t,s=r?t:null;return new gm({type:"tuple",items:e,rest:s,...O.normalizeParams(n)})}var cr=h("ZodRecord",(e,t)=>{Kd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Oh(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function z(e,t,o){return!t||!t._zod?new cr({type:"record",keyType:a(),valueType:e,...O.normalizeParams(t)}):new cr({type:"record",keyType:e,valueType:t,...O.normalizeParams(o)})}function Qg(e,t,o){let r=he(e);return r._zod.values=void 0,new cr({type:"record",keyType:r,valueType:t,...O.normalizeParams(o)})}function Xg(e,t,o){return new cr({type:"record",keyType:e,valueType:t,mode:"loose",...O.normalizeParams(o)})}var _m=h("ZodMap",(e,t)=>{Yd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Th(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(zt(...o)),e.size=(...o)=>e.check(eo(...o))});function eS(e,t,o){return new _m({type:"map",keyType:e,valueType:t,...O.normalizeParams(o)})}var ym=h("ZodSet",(e,t)=>{Qd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>kh(e,o,r,n),e.min=(...o)=>e.check(Le(...o)),e.nonempty=o=>e.check(Le(1,o)),e.max=(...o)=>e.check(zt(...o)),e.size=(...o)=>e.check(eo(...o))});function tS(e,t){return new ym({type:"set",valueType:e,...O.normalizeParams(t)})}var lr=h("ZodEnum",(e,t)=>{Xd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>_h(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 lr({...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 lr({...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 lr({type:"enum",entries:o,...O.normalizeParams(t)})}function oS(e,t){return new lr({type:"enum",entries:e,...O.normalizeParams(t)})}var bm=h("ZodLiteral",(e,t)=>{ep.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>yh(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 bm({type:"literal",values:Array.isArray(e)?e:[e],...O.normalizeParams(t)})}var vm=h("ZodFile",(e,t)=>{tp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>zh(e,o,r,n),e.min=(o,r)=>e.check(Le(o,r)),e.max=(o,r)=>e.check(zt(o,r)),e.mime=(o,r)=>e.check(er(Array.isArray(o)?o:[o],r))});function rS(e){return Qp(vm,e)}var zm=h("ZodTransform",(e,t)=>{op.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ph(e,o,r,n),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new gt(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 ul(e){return new zm({type:"transform",transform:e})}var dl=h("ZodOptional",(e,t)=>{oc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Nc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function k(e){return new dl({type:"optional",innerType:e})}var Rm=h("ZodExactOptional",(e,t)=>{rp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Nc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function wm(e){return new Rm({type:"optional",innerType:e})}var xm=h("ZodNullable",(e,t)=>{np.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Nh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function ls(e){return new xm({type:"nullable",innerType:e})}function nS(e){return k(ls(e))}var Pm=h("ZodDefault",(e,t)=>{sp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>qh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Tm(e,t){return new Pm({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():O.shallowClone(t)}})}var km=h("ZodPrefault",(e,t)=>{ip.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ah(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Em(e,t){return new km({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():O.shallowClone(t)}})}var pl=h("ZodNonOptional",(e,t)=>{ap.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 $m(e,t){return new pl({type:"nonoptional",innerType:e,...O.normalizeParams(t)})}var Cm=h("ZodSuccess",(e,t)=>{cp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Rh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function sS(e){return new Cm({type:"success",innerType:e})}var Im=h("ZodCatch",(e,t)=>{lp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>jh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Om(e,t){return new Im({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Nm=h("ZodNaN",(e,t)=>{up.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>bh(e,o,r,n)});function iS(e){return Kp(Nm,e)}var fs=h("ZodPipe",(e,t)=>{rc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Lh(e,o,r,n),e.in=t.in,e.out=t.out});function Dc(e,t){return new fs({type:"pipe",in:e,out:t})}var gs=h("ZodCodec",(e,t)=>{fs.init(e,t),os.init(e,t)});function aS(e,t,o){return new gs({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}function cS(e){let t=e._zod.def;return new gs({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Mm=h("ZodPreprocess",(e,t)=>{fs.init(e,t),dp.init(e,t)}),qm=h("ZodReadonly",(e,t)=>{pp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Uh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Am(e){return new qm({type:"readonly",innerType:e})}var jm=h("ZodTemplateLiteral",(e,t)=>{hp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>vh(e,o,r,n)});function lS(e,t){return new jm({type:"template_literal",parts:e,...O.normalizeParams(t)})}var Lm=h("ZodLazy",(e,t)=>{gp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Dh(e,o,r,n),e.unwrap=()=>e._zod.def.getter()});function Tt(e){return new Lm({type:"lazy",getter:e})}var Um=h("ZodPromise",(e,t)=>{fp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Zh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function uS(e){return new Um({type:"promise",innerType:e})}var Zm=h("ZodFunction",(e,t)=>{mp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>xh(e,o,r,n)});function dS(e){return new Zm({type:"function",input:Array.isArray(e?.input)?Sm(e?.input):e?.input??f(T()),output:e?.output??T()})}var Ss=h("ZodCustom",(e,t)=>{Sp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>wh(e,o,r,n)});function pS(e){let t=new H({check:"custom"});return t._zod.check=e,t}function hS(e,t){return Xp(Ss,e??(()=>!0),t)}function Dm(e,t={}){return eh(Ss,e,t)}function Vm(e,t){return th(e,t)}var mS=oh,fS=rh;function gS(e,t={}){let o=new Ss({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 SS=(...e)=>nh({Codec:gs,Boolean:mr,String:ur},...e);function _S(e){let t=Tt(()=>x([a(e),b(),R(),Ze(),f(t),z(a(),t)]));return t}function ot(e,t){return new Mm({type:"pipe",in:ul(e),out:t})}var Fm={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 xb(e){Y({customError:e})}function Pb(){return Y().customError}var Hm;Hm||(Hm={});var w={...is,...qc,iso:xe},Tb=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 kb(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 Eb(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 yS(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=Eb(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 yS(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,u]of Object.entries(s)){let m=le(u,t);n[l]=i.has(l)?m:m.optional()}if(e.propertyNames){let l=le(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?le(e.additionalProperties,t):w.any();if(Object.keys(n).length===0){r=w.record(l,u);break}let m=w.object(n).passthrough(),S=w.looseRecord(l,u);r=w.intersection(m,S);break}if(e.patternProperties){let l=e.patternProperties,u=Object.keys(l),m=[];for(let _ of u){let y=le(l[_],t),P=w.string().regex(new RegExp(_));m.push(w.looseRecord(P,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=yS(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(u=>le(u,t)),l=w.union(c);o=r?w.intersection(o,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(u=>le(u,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 u=l;u<e.allOf.length;u++)c=w.intersection(c,le(e.allOf[u],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))Tb.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 bS(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=kb(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 _s={};Qe(_s,{bigint:()=>Ob,boolean:()=>Ib,date:()=>Nb,number:()=>Cb,string:()=>$b});function $b(e){return vp(ur,e)}function Cb(e){return Ep(hr,e)}function Ib(e){return qp(mr,e)}function Ob(e){return jp(fr,e)}function Nb(e){return Gp(ps,e)}Y(nc());var hl="2025-11-25";var ml=[hl,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],fl="io.modelcontextprotocol/related-task",so="io.modelcontextprotocol/protocolVersion",gr="io.modelcontextprotocol/clientInfo",Et="io.modelcontextprotocol/serverInfo",io="io.modelcontextprotocol/clientCapabilities",gl="io.modelcontextprotocol/subscriptionId",Sr="io.modelcontextprotocol/logLevel";var ao="2.0";var rt=Tt(()=>x([a(),b(),R(),Ze(),z(a(),rt),f(rt)])),W=z(a(),rt),Sl=f(rt),_r=x([a(),b().int()]),yr=a(),ys=p({ttl:b().optional()}),bs=p({taskId:a()}),br=$({progressToken:_r.optional(),[fl]:bs.optional()}),oe=p({_meta:br.optional()}),$t=oe.extend({task:ys.optional()}),G=p({method:a(),params:oe.loose().optional()}),ue=p({_meta:br.optional()}),ne=p({method:a(),params:ue.loose().optional()}),vr=$({get[Et](){return Ve.optional().catch(void 0)}}),K=$({_meta:vr.optional()}),Ne=x([a(),b().int()]),zr=p({jsonrpc:g(ao),id:Ne,...G.shape}).strict(),Rr=p({jsonrpc:g(ao),...ne.shape}).strict(),co=p({jsonrpc:g(ao),id:Ne,result:K}).strict(),lo=p({jsonrpc:g(ao),id:Ne.optional(),error:p({code:b().int(),message:a(),data:T().optional()})}).strict(),uo=x([zr,Rr,co,lo]),_l=x([co,lo]),Ct=K.strict(),vs=ue.extend({requestId:Ne.optional(),reason:a().optional()}),wr=ne.extend({method:g("notifications/cancelled"),params:vs}),zs=p({src:a(),mimeType:a().optional(),sizes:f(a()).optional(),theme:I(["light","dark"]).optional()}),nt=p({icons:f(zs).optional()}),De=p({name:a(),title:a().optional()}),Ve=De.extend({...De.shape,...nt.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),qb=Oe(p({applyDefaults:R().optional()}),W),Ab=ot(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Oe(p({form:qb.optional(),url:W.optional()}),W.optional())),yl=$({list:W.optional(),cancel:W.optional(),requests:$({sampling:$({createMessage:W.optional()}).optional(),elicitation:$({create:W.optional()}).optional()}).optional()}),bl=$({list:W.optional(),cancel:W.optional(),requests:$({tools:$({call:W.optional()}).optional()}).optional()}),Rs=p({experimental:z(a(),W).optional(),sampling:p({context:W.optional(),tools:W.optional()}).optional(),elicitation:Ab.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:yl.optional(),extensions:z(a(),W).optional()}),ws=oe.extend({protocolVersion:a(),capabilities:Rs,clientInfo:Ve}),xs=G.extend({method:g("initialize"),params:ws}),xr=p({experimental:z(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:bl.optional(),extensions:z(a(),W).optional()}),Ps=K.extend({protocolVersion:a(),capabilities:xr,serverInfo:Ve,instructions:a().optional()}),Ts=ne.extend({method:g("notifications/initialized"),params:ue.optional()}),ks=G.extend({method:g("server/discover"),params:oe.optional()}),Pr=K.extend({supportedVersions:f(a()),capabilities:xr,instructions:a().optional()}),Tr=G.extend({method:g("ping"),params:oe.optional()}),Es=p({progress:b(),total:k(b()),message:k(a())}),$s=p({...ue.shape,...Es.shape,progressToken:_r}),kr=ne.extend({method:g("notifications/progress"),params:$s}),Cs=oe.extend({cursor:yr.optional()}),st=G.extend({params:Cs.optional()}),it=K.extend({nextCursor:yr.optional()}),Er=p({uri:a(),mimeType:k(a()),_meta:z(a(),T()).optional()}),$r=Er.extend({text:a()}),Bm=a().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Cr=Er.extend({blob:Bm}),at=I(["user","assistant"]),He=p({audience:f(at).optional(),priority:b().min(0).max(1).optional(),lastModified:xe.datetime({offset:!0}).optional()}),Ir=p({...De.shape,...nt.shape,uri:a(),description:k(a()),mimeType:k(a()),size:k(b()),annotations:He.optional(),_meta:k($({}))}),Is=p({...De.shape,...nt.shape,uriTemplate:a(),description:k(a()),mimeType:k(a()),annotations:He.optional(),_meta:k($({}))}),Os=st.extend({method:g("resources/list")}),Ns=it.extend({resources:f(Ir)}),Ms=st.extend({method:g("resources/templates/list")}),qs=it.extend({resourceTemplates:f(Is)}),po=oe.extend({uri:a()}),As=po,js=G.extend({method:g("resources/read"),params:As}),Ls=K.extend({contents:f(x([$r,Cr]))}),Us=ne.extend({method:g("notifications/resources/list_changed"),params:ue.optional()}),Zs=po,Ds=G.extend({method:g("resources/subscribe"),params:Zs}),Vs=po,Hs=G.extend({method:g("resources/unsubscribe"),params:Vs}),Or=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:f(a()).optional()}),Fs=oe.extend({notifications:Or}),Js=G.extend({method:g("subscriptions/listen"),params:Fs}),Bs=ue.extend({notifications:Or}),Ws=ne.extend({method:g("notifications/subscriptions/acknowledged"),params:Bs}),Gs=vr.extend({[gl]:Ne}),Ks=K.extend({_meta:Gs}),Ys=ue.extend({uri:a()}),Qs=ne.extend({method:g("notifications/resources/updated"),params:Ys}),Xs=p({name:a(),description:k(a()),required:k(R())}),ei=p({...De.shape,...nt.shape,description:k(a()),arguments:k(f(Xs)),_meta:k($({}))}),ti=st.extend({method:g("prompts/list")}),oi=it.extend({prompts:f(ei)}),ri=oe.extend({name:a(),arguments:z(a(),a()).optional()}),ni=G.extend({method:g("prompts/get"),params:ri}),ho=p({type:g("text"),text:a(),annotations:He.optional(),_meta:z(a(),T()).optional()}),mo=p({type:g("image"),data:Bm,mimeType:a(),annotations:He.optional(),_meta:z(a(),T()).optional()}),fo=p({type:g("audio"),data:Bm,mimeType:a(),annotations:He.optional(),_meta:z(a(),T()).optional()}),si=p({type:g("tool_use"),name:a(),id:a(),input:z(a(),T()),_meta:z(a(),T()).optional()}),go=p({type:g("resource"),resource:x([$r,Cr]),annotations:He.optional(),_meta:z(a(),T()).optional()}),So=Ir.extend({type:g("resource_link")}),Fe=x([ho,mo,fo,So,go]),ii=p({role:at,content:Fe}),ai=K.extend({description:a().optional(),messages:f(ii)}),ci=ne.extend({method:g("notifications/prompts/list_changed"),params:ue.optional()}),li=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),ui=p({taskSupport:I(["required","optional","forbidden"]).optional()}),It=p({...De.shape,...nt.shape,description:a().optional(),inputSchema:p({type:g("object"),properties:z(a(),rt).optional(),required:f(a()).optional()}).catchall(T()),outputSchema:$({$schema:a().optional()}).optional(),annotations:li.optional(),execution:ui.optional(),_meta:z(a(),T()).optional()}),di=st.extend({method:g("tools/list")}),pi=it.extend({tools:f(It)}),Ot=K.extend({content:f(Fe).default([]),structuredContent:T().optional(),isError:R().optional()}),vl=Ot.or(K.extend({toolResult:T()})),hi=$t.extend({name:a(),arguments:z(a(),T()).optional()}),mi=G.extend({method:g("tools/call"),params:hi}),fi=ne.extend({method:g("notifications/tools/list_changed"),params:ue.optional()}),zl=p({autoRefresh:R().default(!0),debounceMs:b().int().nonnegative().default(300)}),Nr=I(["debug","info","notice","warning","error","critical","alert","emergency"]),gi=oe.extend({level:Nr}),Si=G.extend({method:g("logging/setLevel"),params:gi}),_i=ue.extend({level:Nr,logger:a().optional(),data:T()}),yi=ne.extend({method:g("notifications/message"),params:_i}),bi=p({name:a().optional()}),vi=p({hints:f(bi).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),zi=p({mode:I(["auto","required","none"]).optional()}),Ri=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:z(a(),T()).optional()}),wi=Pt("type",[ho,mo,fo]),kt=Pt("type",[ho,mo,fo,si,Ri]),xi=p({role:at,content:x([kt,f(kt)]),_meta:z(a(),T()).optional()}),Pi=$t.extend({messages:f(xi),modelPreferences:vi.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:f(a()).optional(),metadata:W.optional(),tools:f(It).optional(),toolChoice:zi.optional()}),Ti=G.extend({method:g("sampling/createMessage"),params:Pi}),ki=K.extend({model:a(),stopReason:k(I(["endTurn","stopSequence","maxTokens"]).or(a())),role:at,content:wi}),Ei=K.extend({model:a(),stopReason:k(I(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:at,content:x([kt,f(kt)])}),Mr=p({type:g("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),_o=p({type:g("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:I(["email","uri","date","date-time"]).optional(),default:a().optional()}),yo=p({type:I(["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()}),Ar=p({type:g("string"),title:a().optional(),description:a().optional(),oneOf:f(p({const:a(),title:a()})),default:a().optional()}),jr=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),enumNames:f(a()).optional(),default:a().optional()}),$i=x([qr,Ar]),Lr=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()}),Ur=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()}),Ci=x([Lr,Ur]),Ii=x([jr,$i,Ci]),Zr=x([Ii,Mr,_o,yo]),bo=$t.extend({mode:g("form").optional(),message:a(),requestedSchema:p({type:g("object"),properties:z(a(),Zr),required:f(a()).optional()}).catchall(T())}),Oi=$t.extend({mode:g("url"),message:a(),elicitationId:a(),url:a().url()}),Ni=x([bo,Oi]),Mi=G.extend({method:g("elicitation/create"),params:Ni}),qi=ue.extend({elicitationId:a()}),Ai=ne.extend({method:g("notifications/elicitation/complete"),params:qi}),ji=K.extend({action:I(["accept","decline","cancel"]),content:ot(e=>e===null?void 0:e,z(a(),x([a(),b(),R(),f(a())])).optional())}),Li=p({type:g("ref/resource"),uri:a()}),Ui=p({type:g("ref/prompt"),name:a()}),Zi=oe.extend({ref:x([Ui,Li]),argument:p({name:a(),value:a()}),context:p({arguments:z(a(),a()).optional()}).optional()}),Di=G.extend({method:g("completion/complete"),params:Zi}),Vi=K.extend({completion:$({values:f(a()).max(100),total:k(b().int()),hasMore:k(R())})}),Hi=p({uri:a().startsWith("file://"),name:a().optional(),_meta:z(a(),T()).optional()}),Fi=G.extend({method:g("roots/list"),params:oe.optional()}),Ji=K.extend({roots:f(Hi)}),Bi=ne.extend({method:g("notifications/roots/list_changed"),params:ue.optional()}),Rl=$({ttl:b().optional(),pollInterval:b().optional()}),Wi=I(["working","input_required","completed","failed","cancelled"]),ct=p({taskId:a(),status:Wi,ttl:x([b(),Ze()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:k(b()),statusMessage:k(a())}),wl=K.extend({task:ct}),Gi=ue.merge(ct),xl=ne.extend({method:g("notifications/tasks/status"),params:Gi}),Pl=G.extend({method:g("tasks/get"),params:oe.extend({taskId:a()})}),Tl=K.merge(ct),kl=G.extend({method:g("tasks/result"),params:oe.extend({taskId:a()})}),El=K.loose(),$l=st.extend({method:g("tasks/list")}),Cl=it.extend({tasks:f(ct)}),Il=G.extend({method:g("tasks/cancel"),params:oe.extend({taskId:a()})}),Ol=K.merge(ct),Nl=x([Tr,xs,ks,Di,Si,ni,ti,Os,Ms,js,Ds,Hs,Js,mi,di]),Ml=x([wr,kr,Ts,Bi]),ql=x([Ct,ki,Ei,ji,Ji]),Al=x([Tr,Ti,Mi,Fi]),jl=x([wr,kr,yi,Qs,Us,fi,ci,Ws,Ai]),Ll=x([Ct,Ps,Pr,Vi,ai,oi,Ns,qs,Ls,Ot,pi,Ks]),te=dr().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Fm.custom,message:"URL must be parseable",fatal:!0}),Zn}).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"}),Ki=$({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()}),Dr=$({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()}),Yi=$({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)}),Qi=p({...Yi.shape,...Dr.pick({code_challenge_methods_supported:!0}).shape}),Xi=p({access_token:a(),id_token:a().optional(),token_type:a(),expires_in:_s.number().optional(),scope:a().optional(),refresh_token:a().optional(),issuer:a().optional().catch(void 0)}).strip(),ea=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(),ta=p({error:a(),error_description:a().optional(),error_uri:a().optional()}),Jm=te.optional().or(g("").transform(()=>{})),oa=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:Jm,scope:a().optional(),contacts:f(a()).optional(),tos_uri:Jm,policy_uri:a().optional(),jwks_uri:te.optional(),jwks:cl().optional(),software_id:a().optional(),software_version:a().optional(),software_statement:a().optional()}).strip(),ra=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(),na=oa.merge(ra),Ul=p({error:a(),error_description:a().optional()}).strip(),Zl=p({token:a(),token_type_hint:a().optional()}).strip();var Xm=Symbol.for("mcp.sdk.errorBrands");function vo(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,Xm,{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,Xm)){let o=t[Xm];if(o&&typeof o.has=="function"&&o.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var jb=class US 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",vo(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 US(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",vo(this,new.target)}},Lb=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 Ub="2026-07-28";function ZS(e){return e>=Ub}function DS(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 VS=["task","inputRequests","requestState"];function Zb(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||VS.some(t=>t in e)?e:{...e,content:[]}}function Db(){let e=Tt(()=>x([a(),b(),R(),Ze(),z(a(),e),f(e)])),t=z(a(),e),o=x([a(),b().int()]),r=a(),n=p({ttl:b().optional()}),s=p({taskId:a()}),i=$({progressToken:o.optional(),"io.modelcontextprotocol/related-task":s.optional()}),c=p({_meta:i.optional()}),l=c.extend({task:n.optional()}),u=p({method:a(),params:c.loose().optional()}),m=p({_meta:i.optional()}),S=p({method:a(),params:m.loose().optional()}),_=$({_meta:i.optional()}),y=x([a(),b().int()]),P=_.strict(),E=m.extend({requestId:y.optional(),reason:a().optional()}),C=S.extend({method:g("notifications/cancelled"),params:E}),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=ot(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=$({list:t.optional(),cancel:t.optional(),requests:$({sampling:$({createMessage:t.optional()}).optional(),elicitation:$({create:t.optional()}).optional()}).optional()}),Ge=$({list:t.optional(),cancel:t.optional(),requests:$({tools:$({call:t.optional()}).optional()}).optional()}),de=p({experimental:z(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:z(a(),t).optional()}),lt=c.extend({protocolVersion:a(),capabilities:de,clientInfo:U}),qt=u.extend({method:g("initialize"),params:lt}),Fr=p({experimental:z(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:Ge.optional(),extensions:z(a(),t).optional()}),Jr=_.extend({protocolVersion:a(),capabilities:Fr,serverInfo:U,instructions:a().optional()}),Ro=S.extend({method:g("notifications/initialized"),params:m.optional()}),ut=u.extend({method:g("ping"),params:c.optional()}),At=p({progress:b(),total:k(b()),message:k(a())}),Me=p({...m.shape,...At.shape,progressToken:o}),dt=S.extend({method:g("notifications/progress"),params:Me}),wo=c.extend({cursor:r.optional()}),Ke=u.extend({params:wo.optional()}),Ye=_.extend({nextCursor:r.optional()}),xo=p({uri:a(),mimeType:k(a()),_meta:z(a(),T()).optional()}),Po=xo.extend({text:a()}),jt=a().refine(ce=>{try{return atob(ce),!0}catch{return!1}},{message:"Invalid Base64 string"}),To=xo.extend({blob:jt}),qe=I(["user","assistant"]),Ee=p({audience:f(qe).optional(),priority:b().min(0).max(1).optional(),lastModified:xe.datetime({offset:!0}).optional()}),Lt=p({...L.shape,...J.shape,uri:a(),description:k(a()),mimeType:k(a()),size:k(b()),annotations:Ee.optional(),_meta:k($({}))}),Br=p({...L.shape,...J.shape,uriTemplate:a(),description:k(a()),mimeType:k(a()),annotations:Ee.optional(),_meta:k($({}))}),Wr=Ke.extend({method:g("resources/list")}),Gr=Ye.extend({resources:f(Lt)}),pt=Ke.extend({method:g("resources/templates/list")}),ko=Ye.extend({resourceTemplates:f(Br)}),Ut=c.extend({uri:a()}),Kr=Ut,Yr=u.extend({method:g("resources/read"),params:Kr}),Qr=_.extend({contents:f(x([Po,To]))}),Xr=S.extend({method:g("notifications/resources/list_changed"),params:m.optional()}),en=Ut,tn=u.extend({method:g("resources/subscribe"),params:en}),on=Ut,rn=u.extend({method:g("resources/unsubscribe"),params:on}),nn=m.extend({uri:a()}),sn=S.extend({method:g("notifications/resources/updated"),params:nn}),an=p({name:a(),description:k(a()),required:k(R())}),cn=p({...L.shape,...J.shape,description:k(a()),arguments:k(f(an)),_meta:k($({}))}),ln=Ke.extend({method:g("prompts/list")}),un=Ye.extend({prompts:f(cn)}),dn=c.extend({name:a(),arguments:z(a(),a()).optional()}),pn=u.extend({method:g("prompts/get"),params:dn}),Zt=p({type:g("text"),text:a(),annotations:Ee.optional(),_meta:z(a(),T()).optional()}),Dt=p({type:g("image"),data:jt,mimeType:a(),annotations:Ee.optional(),_meta:z(a(),T()).optional()}),Vt=p({type:g("audio"),data:jt,mimeType:a(),annotations:Ee.optional(),_meta:z(a(),T()).optional()}),hn=p({type:g("tool_use"),name:a(),id:a(),input:z(a(),T()),_meta:z(a(),T()).optional()}),ht=p({type:g("resource"),resource:x([Po,To]),annotations:Ee.optional(),_meta:z(a(),T()).optional()}),mn=Lt.extend({type:g("resource_link")}),Te=x([Zt,Dt,Vt,mn,ht]),Eo=p({role:qe,content:Te}),$o=_.extend({description:a().optional(),messages:f(Eo)}),Ht=S.extend({method:g("notifications/prompts/list_changed"),params:m.optional()}),fn=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),Co=p({taskSupport:I(["required","optional","forbidden"]).optional()}),Ft=p({...L.shape,...J.shape,description:a().optional(),inputSchema:p({type:g("object"),properties:z(a(),e).optional(),required:f(a()).optional()}).catchall(T()),outputSchema:p({type:g("object"),properties:z(a(),e).optional(),required:f(a()).optional()}).catchall(T()).optional(),annotations:fn.optional(),execution:Co.optional(),_meta:z(a(),T()).optional()}),Io=Ke.extend({method:g("tools/list")}),Oo=Ye.extend({tools:f(Ft)}),No=_.extend({content:f(Te),structuredContent:z(a(),T()).optional(),isError:R().optional()}),ae=l.extend({name:a(),arguments:z(a(),T()).optional()}),gn=u.extend({method:g("tools/call"),params:ae}),ma=S.extend({method:g("notifications/tools/list_changed"),params:m.optional()}),Mo=I(["debug","info","notice","warning","error","critical","alert","emergency"]),Sn=c.extend({level:Mo}),_n=u.extend({method:g("logging/setLevel"),params:Sn}),yn=m.extend({level:Mo,logger:a().optional(),data:T()}),bn=S.extend({method:g("notifications/message"),params:yn}),vn=p({name:a().optional()}),zn=p({hints:f(vn).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),Rn=p({mode:I(["auto","required","none"]).optional()}),fa=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:z(a(),T()).optional()}),wn=Pt("type",[Zt,Dt,Vt]),mt=Pt("type",[Zt,Dt,Vt,hn,fa]),xn=p({role:qe,content:x([mt,f(mt)]),_meta:z(a(),T()).optional()}),Pn=l.extend({messages:f(xn),modelPreferences:zn.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:f(a()).optional(),metadata:t.optional(),tools:f(Ft).optional(),toolChoice:Rn.optional()}),Tn=u.extend({method:g("sampling/createMessage"),params:Pn}),kn=_.extend({model:a(),stopReason:k(I(["endTurn","stopSequence","maxTokens"]).or(a())),role:qe,content:wn}),En=_.extend({model:a(),stopReason:k(I(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:qe,content:x([mt,f(mt)])}),$n=p({type:g("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),Cn=p({type:g("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:I(["email","uri","date","date-time"]).optional(),default:a().optional()}),In=p({type:I(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),On=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),default:a().optional()}),Nn=p({type:g("string"),title:a().optional(),description:a().optional(),oneOf:f(p({const:a(),title:a()})),default:a().optional()}),Mn=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),enumNames:f(a()).optional(),default:a().optional()}),qn=x([On,Nn]),Jt=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()}),Bt=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()}),ga=x([Jt,Bt]),Sa=x([Mn,qn,ga]),ve=x([Sa,$n,Cn,In]),ze=l.extend({mode:g("form").optional(),message:a(),requestedSchema:p({type:g("object"),properties:z(a(),ve),required:f(a()).optional()}).catchall(T())}),An=l.extend({mode:g("url"),message:a(),elicitationId:a(),url:a().url()}),$e=x([ze,An]),_a=u.extend({method:g("elicitation/create"),params:$e}),ya=m.extend({elicitationId:a()}),ba=S.extend({method:g("notifications/elicitation/complete"),params:ya}),va=_.extend({action:I(["accept","decline","cancel"]),content:ot(ce=>ce===null?void 0:ce,z(a(),x([a(),b(),R(),f(a())])).optional())}),za=p({type:g("ref/resource"),uri:a()}),Ra=p({type:g("ref/prompt"),name:a()}),wa=c.extend({ref:x([Ra,za]),argument:p({name:a(),value:a()}),context:p({arguments:z(a(),a()).optional()}).optional()}),jn=u.extend({method:g("completion/complete"),params:wa}),xa=_.extend({completion:$({values:f(a()).max(100),total:k(b().int()),hasMore:k(R())})}),Pa=p({uri:a().startsWith("file://"),name:a().optional(),_meta:z(a(),T()).optional()}),qo=u.extend({method:g("roots/list"),params:c.optional()}),Ln=_.extend({roots:f(Pa)}),Ta=S.extend({method:g("notifications/roots/list_changed"),params:m.optional()}),ka=$({ttl:b().optional(),pollInterval:b().optional()}),Un=I(["working","input_required","completed","failed","cancelled"]),ft=p({taskId:a(),status:Un,ttl:x([b(),Ze()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:k(b()),statusMessage:k(a())}),Se=_.extend({task:ft}),Ea=m.merge(ft),Wt=S.extend({method:g("notifications/tasks/status"),params:Ea}),Ao=u.extend({method:g("tasks/get"),params:c.extend({taskId:a()})}),jo=_.merge(ft),Lo=u.extend({method:g("tasks/result"),params:c.extend({taskId:a()})}),Kl=_.loose(),pe=Ke.extend({method:g("tasks/list")}),Q=Ye.extend({tasks:f(ft)}),Gt=u.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:u,NotificationsParamsSchema:m,NotificationSchema:S,ResultSchema:_,RequestIdSchema:y,EmptyResultSchema:P,CancelledNotificationParamsSchema:E,CancelledNotificationSchema:C,IconSchema:q,IconsSchema:J,BaseMetadataSchema:L,ImplementationSchema:U,ClientTasksCapabilitySchema:ee,ServerTasksCapabilitySchema:Ge,ClientCapabilitiesSchema:de,InitializeRequestParamsSchema:lt,InitializeRequestSchema:qt,ServerCapabilitiesSchema:Fr,InitializeResultSchema:Jr,InitializedNotificationSchema:Ro,PingRequestSchema:ut,ProgressSchema:At,ProgressNotificationParamsSchema:Me,ProgressNotificationSchema:dt,PaginatedRequestParamsSchema:wo,PaginatedRequestSchema:Ke,PaginatedResultSchema:Ye,ResourceContentsSchema:xo,TextResourceContentsSchema:Po,BlobResourceContentsSchema:To,RoleSchema:qe,AnnotationsSchema:Ee,ResourceSchema:Lt,ResourceTemplateSchema:Br,ListResourcesRequestSchema:Wr,ListResourcesResultSchema:Gr,ListResourceTemplatesRequestSchema:pt,ListResourceTemplatesResultSchema:ko,ResourceRequestParamsSchema:Ut,ReadResourceRequestParamsSchema:Kr,ReadResourceRequestSchema:Yr,ReadResourceResultSchema:Qr,ResourceListChangedNotificationSchema:Xr,SubscribeRequestParamsSchema:en,SubscribeRequestSchema:tn,UnsubscribeRequestParamsSchema:on,UnsubscribeRequestSchema:rn,ResourceUpdatedNotificationParamsSchema:nn,ResourceUpdatedNotificationSchema:sn,PromptArgumentSchema:an,PromptSchema:cn,ListPromptsRequestSchema:ln,ListPromptsResultSchema:un,GetPromptRequestParamsSchema:dn,GetPromptRequestSchema:pn,TextContentSchema:Zt,ImageContentSchema:Dt,AudioContentSchema:Vt,ToolUseContentSchema:hn,EmbeddedResourceSchema:ht,ResourceLinkSchema:mn,ContentBlockSchema:Te,PromptMessageSchema:Eo,GetPromptResultSchema:$o,PromptListChangedNotificationSchema:Ht,ToolAnnotationsSchema:fn,ToolExecutionSchema:Co,ToolSchema:Ft,ListToolsRequestSchema:Io,ListToolsResultSchema:Oo,CallToolResultSchema:No,CallToolRequestParamsSchema:ae,CallToolRequestSchema:gn,ToolListChangedNotificationSchema:ma,LoggingLevelSchema:Mo,SetLevelRequestParamsSchema:Sn,SetLevelRequestSchema:_n,LoggingMessageNotificationParamsSchema:yn,LoggingMessageNotificationSchema:bn,ModelHintSchema:vn,ModelPreferencesSchema:zn,ToolChoiceSchema:Rn,ToolResultContentSchema:fa,SamplingContentSchema:wn,SamplingMessageContentBlockSchema:mt,SamplingMessageSchema:xn,CreateMessageRequestParamsSchema:Pn,CreateMessageRequestSchema:Tn,CreateMessageResultSchema:kn,CreateMessageResultWithToolsSchema:En,BooleanSchemaSchema:$n,StringSchemaSchema:Cn,NumberSchemaSchema:In,UntitledSingleSelectEnumSchemaSchema:On,TitledSingleSelectEnumSchemaSchema:Nn,LegacyTitledEnumSchemaSchema:Mn,SingleSelectEnumSchemaSchema:qn,UntitledMultiSelectEnumSchemaSchema:Jt,TitledMultiSelectEnumSchemaSchema:Bt,MultiSelectEnumSchemaSchema:ga,EnumSchemaSchema:Sa,PrimitiveSchemaDefinitionSchema:ve,ElicitRequestFormParamsSchema:ze,ElicitRequestURLParamsSchema:An,ElicitRequestParamsSchema:$e,ElicitRequestSchema:_a,ElicitationCompleteNotificationParamsSchema:ya,ElicitationCompleteNotificationSchema:ba,ElicitResultSchema:va,ResourceTemplateReferenceSchema:za,PromptReferenceSchema:Ra,CompleteRequestParamsSchema:wa,CompleteRequestSchema:jn,CompleteResultSchema:xa,RootSchema:Pa,ListRootsRequestSchema:qo,ListRootsResultSchema:Ln,RootsListChangedNotificationSchema:Ta,TaskCreationParamsSchema:ka,TaskStatusSchema:Un,TaskSchema:ft,CreateTaskResultSchema:Se,TaskStatusNotificationParamsSchema:Ea,TaskStatusNotificationSchema:Wt,GetTaskRequestSchema:Ao,GetTaskResultSchema:jo,GetTaskPayloadRequestSchema:Lo,GetTaskPayloadResultSchema:Kl,ListTasksRequestSchema:pe,ListTasksResultSchema:Q,CancelTaskRequestSchema:Gt,CancelTaskResultSchema:_.merge(ft),ClientRequestSchema:x([ut,qt,jn,_n,pn,ln,Wr,pt,Yr,tn,rn,gn,Io,Ao,Lo,pe,Gt]),ClientNotificationSchema:x([C,dt,Ro,Ta,Wt]),ClientResultSchema:x([P,kn,En,va,Ln,jo,Q,Se]),ServerRequestSchema:x([ut,Tn,_a,qo,Ao,Lo,pe,Gt]),ServerNotificationSchema:x([C,dt,bn,sn,Xr,ma,Ht,Wt,ba]),ServerResultSchema:x([P,Jr,xa,$o,un,Gr,ko,Qr,No,Oo,jo,Q,Se]),CallToolResultWireSchema:T().superRefine((ce,O_)=>{if(!(typeof ce!="object"||ce===null||Array.isArray(ce)||ce.content!==void 0)){for(let xf of VS)if(xf in ce){O_.addIssue({code:"custom",message:`content is required when the body carries '${xf}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(Zb).pipe(No)}}var Vb;function HS(){return Vb??=Db()}function FS(e){return e.type!=="object"}var Hb=new Set(["const","enum","default","examples"]),Fb=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function $S(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Jb(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if($S(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let o=Ef(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&&$S(n.$id))return n;let i={},c=!1;for(let[l,u]of Object.entries(n))s?i[l]=r(u,!1):(l==="$ref"||l==="$dynamicRef")&&typeof u=="string"?i[l]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u:l==="$recursiveRef"&&u==="#"&&o?c=!0:Hb.has(l)?i[l]=u:Fb.has(l)?i[l]=r(u,!0):i[l]=r(u,!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 JS={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},BS={"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},Bb={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},Dl;function sf(){if(Dl)return Dl;let e=HS();return Dl={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}},Dl}function WS(e){return Object.prototype.hasOwnProperty.call(JS,e)}function GS(e){return Object.prototype.hasOwnProperty.call(BS,e)}function Wb(e){return Object.prototype.hasOwnProperty.call(Bb,e)}function Gb(e){return Wb(e)?sf().resultSchemas[e]:void 0}function Kb(e){return WS(e)?sf().requestSchemas[e]:void 0}function Yb(e){return GS(e)?sf().notificationSchemas[e]:void 0}var nw=Object.keys(JS),sw=Object.keys(BS);function ef(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Vl(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 CS={ok:!1,reason:"not-in-era"};function IS(e){return ef(e)&&ef(e.outputSchema)&&FS(e.outputSchema)}var af={era:"2025-11-25",hasRequestMethod:WS,hasNotificationMethod:GS,validateRequest:(e,t)=>Vl(Kb(e),t),validateResult:(e,t)=>Vl(Gb(e),t),validateNotification:(e,t)=>Vl(Yb(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>CS,validateInputResponse:()=>CS,samplingResultVariant:((e,t)=>{let o=HS();return Vl(e?o.CreateMessageResultWithToolsSchema:o.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let o=DS(e),r=o.structuredContent;if(r===void 0)return o;let n=typeof r!="object"||r===null||Array.isArray(r),s=t!==void 0&&FS(t);return!n&&!s?o:{...o,structuredContent:{result:r}}},decodeResult(e,t){if(ef(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=>IS(r))?t:{...t,tools:o.map(r=>IS(r)?{...r,outputSchema:Jb(r.outputSchema)}:r)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function Qb(){let e=Tt(()=>x([a(),b(),R(),Ze(),z(a(),e),f(e)])),t=z(a(),e),o=x([a(),b().int()]),r=a(),n=x([a(),b().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:b().optional()}),u=p({taskId:a()}),m=$({progressToken:o.optional(),"io.modelcontextprotocol/related-task":u.optional()}),S=p({_meta:m.optional()}),_=S.extend({task:l.optional()}),y=p({_meta:m.optional()}),P=p({method:a(),params:y.loose().optional()}),E=p({src:a(),mimeType:a().optional(),sizes:f(a()).optional(),theme:I(["light","dark"]).optional()}),C=p({icons:f(E).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=ot(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=$({list:t.optional(),cancel:t.optional(),requests:$({sampling:$({createMessage:t.optional()}).optional(),elicitation:$({create:t.optional()}).optional()}).optional()}),F=$({list:t.optional(),cancel:t.optional(),requests:$({tools:$({call:t.optional()}).optional()}).optional()}),ee=p({experimental:z(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:z(a(),t).optional()}),Ge=p({experimental:z(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:z(a(),t).optional()}),de=p({progress:b(),total:k(b()),message:k(a())}),lt=p({...y.shape,...de.shape,progressToken:o}),qt=P.extend({method:g("notifications/progress"),params:lt}),Fr=y.extend({level:i,logger:a().optional(),data:T()}),Jr=P.extend({method:g("notifications/message"),params:Fr}),Ro=p({uri:a(),mimeType:k(a()),_meta:z(a(),T()).optional()}),ut=Ro.extend({text:a()}),At=Ro.extend({blob:c}),Me=p({audience:f(s).optional(),priority:b().min(0).max(1).optional(),lastModified:xe.datetime({offset:!0}).optional()}),dt=p({...q.shape,...C.shape,uri:a(),description:k(a()),mimeType:k(a()),size:k(b()),annotations:Me.optional(),_meta:k($({}))}),wo=p({...q.shape,...C.shape,uriTemplate:a(),description:k(a()),mimeType:k(a()),annotations:Me.optional(),_meta:k($({}))}),Ke=P.extend({method:g("notifications/resources/list_changed"),params:y.optional()}),Ye=y.extend({uri:a()}),xo=P.extend({method:g("notifications/resources/updated"),params:Ye}),Po=p({name:a(),description:k(a()),required:k(R())}),jt=p({...q.shape,...C.shape,description:k(a()),arguments:k(f(Po)),_meta:k($({}))}),To=P.extend({method:g("notifications/prompts/list_changed"),params:y.optional()}),qe=p({type:g("text"),text:a(),annotations:Me.optional(),_meta:z(a(),T()).optional()}),Ee=p({type:g("image"),data:c,mimeType:a(),annotations:Me.optional(),_meta:z(a(),T()).optional()}),Lt=p({type:g("audio"),data:c,mimeType:a(),annotations:Me.optional(),_meta:z(a(),T()).optional()}),Br=p({type:g("tool_use"),name:a(),id:a(),input:z(a(),T()),_meta:z(a(),T()).optional()}),Wr=p({type:g("resource"),resource:x([ut,At]),annotations:Me.optional(),_meta:z(a(),T()).optional()}),Gr=dt.extend({type:g("resource_link")}),pt=x([qe,Ee,Lt,Gr,Wr]),ko=p({role:s,content:pt}),Ut=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),Kr=P.extend({method:g("notifications/tools/list_changed"),params:y.optional()}),Yr=p({name:a().optional()}),Qr=p({hints:f(Yr).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),Xr=p({mode:I(["auto","required","none"]).optional()}),en=p({type:g("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),tn=p({type:g("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:I(["email","uri","date","date-time"]).optional(),default:a().optional()}),on=p({type:I(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),rn=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),default:a().optional()}),nn=p({type:g("string"),title:a().optional(),description:a().optional(),oneOf:f(p({const:a(),title:a()})),default:a().optional()}),sn=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),enumNames:f(a()).optional(),default:a().optional()}),an=x([rn,nn]),cn=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()}),ln=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()}),un=x([cn,ln]),dn=x([sn,an,un]),pn=x([dn,en,tn,on]),Zt=_.extend({mode:g("form").optional(),message:a(),requestedSchema:p({type:g("object"),properties:z(a(),pn),required:f(a()).optional()}).catchall(T())}),Dt=p({type:g("ref/resource"),uri:a()}),Vt=p({type:g("ref/prompt"),name:a()}),hn=p({uri:a().startsWith("file://"),name:a().optional(),_meta:z(a(),T()).optional()}),ht=ee.shape,mn=p({experimental:ht.experimental,sampling:ht.sampling,elicitation:ht.elicitation,roots:ht.roots,extensions:ht.extensions}),Te=Ge.shape,Eo=p({experimental:Te.experimental,logging:Te.logging,completions:Te.completions,prompts:Te.prompts,resources:Te.resources,tools:Te.tools,extensions:Te.extensions}),$o=$({progressToken:o.optional(),[so]:a(),[gr]:J.optional(),[io]:mn,[Sr]:i.optional()}),Ht=p({...q.shape,...C.shape,description:a().optional(),inputSchema:$({$schema:a().optional(),type:g("object")}),outputSchema:$({$schema:a().optional()}).optional(),annotations:Ut.optional(),_meta:z(a(),T()).optional()}),fn=p({type:g("tool_result"),toolUseId:a(),content:f(pt),structuredContent:T().optional(),isError:R().optional(),_meta:z(a(),T()).optional()}),Co=x([qe,Ee,Lt,Br,fn]),Ft=p({role:s,content:x([Co,f(Co)]),_meta:z(a(),T()).optional()}),Io=a(),Oo=$({[Et]:J.optional().catch(void 0)}),No=Oo.optional();function ae(Q){return $({_meta:No,resultType:Io.default("complete"),...Q})}let gn=ae({}),ma=ae({nextCursor:r.optional()}),Mo=ae({content:f(pt),structuredContent:T().optional(),isError:R().optional()}),Sn=ae({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),tools:f(Ht),nextCursor:r.optional()}),_n=ae({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),prompts:f(jt),nextCursor:r.optional()}),yn=ae({description:a().optional(),messages:f(ko)}),bn=ae({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resources:f(dt),nextCursor:r.optional()}),vn=ae({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resourceTemplates:f(wo),nextCursor:r.optional()}),zn=ae({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),contents:f(x([ut,At]))}),Rn=ae({completion:p({values:f(a()).max(100),total:b().int().optional(),hasMore:R().optional()}).loose()}),fa=ae({ttlMs:b().int().min(0),cacheScope:I(["public","private"])}),wn=ae({ttlMs:b().int().min(0).catch(0),cacheScope:I(["public","private"]).catch("private"),supportedVersions:f(a()),capabilities:Eo,instructions:a().optional()}),mt=p({messages:f(Ft),modelPreferences:Qr.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:f(a()).optional(),metadata:t.optional(),tools:f(Ht).optional(),toolChoice:Xr.optional()}),xn=p({method:g("sampling/createMessage"),params:mt}),Pn=p({method:g("roots/list"),params:p({_meta:z(a(),T()).optional()}).optional()}),Tn=p({...Ft.shape,model:a(),stopReason:a().optional()}),kn=p({roots:f(hn)}),En=p({action:I(["accept","decline","cancel"]),content:z(a(),x([a(),b(),R(),f(a())])).optional()}),$n=p({mode:g("url"),message:a(),url:a().url()}),Cn=x([Zt,$n]),In=p({method:g("elicitation/create"),params:Cn}),On=x([xn,Pn,In]),Nn=x([Tn,kn,En]),Mn=z(a(),On),qn=z(a(),Nn),Jt=ae({inputRequests:Mn.optional(),requestState:a().optional()}),Bt={inputResponses:qn.optional(),requestState:a().optional()},ga=p({_meta:$o,...Bt}),Sa=$({progressToken:o.optional()});function ve(Q,Gt){return p({method:g(Q),params:p({_meta:$o,...Gt})})}function ze(Q,Gt){return p({method:g(Q),params:p({_meta:Sa.optional(),...Gt}).optional()})}let An={name:a(),arguments:z(a(),T()).optional(),...Bt},$e={cursor:r.optional()},_a=ve("tools/call",An),ya=ve("tools/list",$e),ba=ve("prompts/list",$e),va=ve("prompts/get",{name:a(),arguments:z(a(),a()).optional(),...Bt}),za=ve("resources/list",$e),Ra=ve("resources/templates/list",$e),wa=ve("resources/read",{uri:a(),...Bt}),jn={ref:x([Vt,Dt]),argument:p({name:a(),value:a()}),context:p({arguments:z(a(),a()).optional()}).optional()},xa=ve("completion/complete",jn),Pa=ve("server/discover",{}),qo=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:f(a()).optional()}),Ln={notifications:qo},Ta=ve("subscriptions/listen",Ln),ka=Oo.extend({"io.modelcontextprotocol/subscriptionId":n}),Un=$({_meta:ka,resultType:Io.default("complete")}),ft={"tools/call":ze("tools/call",An),"tools/list":ze("tools/list",$e),"prompts/get":ze("prompts/get",{name:a(),arguments:z(a(),a()).optional()}),"prompts/list":ze("prompts/list",$e),"resources/list":ze("resources/list",$e),"resources/templates/list":ze("resources/templates/list",$e),"resources/read":ze("resources/read",{uri:a()}),"completion/complete":ze("completion/complete",jn),"server/discover":ze("server/discover",{}),"subscriptions/listen":ze("subscriptions/listen",Ln)};function Se(Q){return $({_meta:No,...Q})}let Ea={"tools/call":Se({content:f(pt),structuredContent:T().optional(),isError:R().optional()}),"tools/list":Se({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),tools:f(Ht),nextCursor:r.optional()}),"prompts/get":Se({description:a().optional(),messages:f(ko)}),"prompts/list":Se({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),prompts:f(jt),nextCursor:r.optional()}),"resources/list":Se({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resources:f(dt),nextCursor:r.optional()}),"resources/templates/list":Se({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resourceTemplates:f(wo),nextCursor:r.optional()}),"resources/read":Se({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),contents:f(x([ut,At]))}),"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:I(["public","private"]).catch("private"),supportedVersions:f(a()),capabilities:Eo,instructions:a().optional()}),"subscriptions/listen":Se({})},Wt=$({"io.modelcontextprotocol/subscriptionId":n.optional()}),Ao=p({method:g("notifications/subscriptions/acknowledged"),params:p({_meta:Wt.optional(),notifications:qo})}),jo=p({_meta:Wt.optional(),requestId:n,reason:a().optional()}),Lo=p({method:g("notifications/cancelled"),params:jo}),Kl={"notifications/cancelled":Lo,"notifications/progress":qt,"notifications/message":Jr,"notifications/resources/updated":xo,"notifications/resources/list_changed":Ke,"notifications/tools/list_changed":Kr,"notifications/prompts/list_changed":To,"notifications/subscriptions/acknowledged":Ao},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:u,RequestMetaSchema:m,BaseRequestParamsSchema:S,TaskAugmentedRequestParamsSchema:_,NotificationsParamsSchema:y,NotificationSchema:P,IconSchema:E,IconsSchema:C,BaseMetadataSchema:q,ImplementationSchema:J,ClientTasksCapabilitySchema:B,ServerTasksCapabilitySchema:F,ClientCapabilitiesSchema:ee,ServerCapabilitiesSchema:Ge,ProgressSchema:de,ProgressNotificationParamsSchema:lt,ProgressNotificationSchema:qt,LoggingMessageNotificationParamsSchema:Fr,LoggingMessageNotificationSchema:Jr,ResourceContentsSchema:Ro,TextResourceContentsSchema:ut,BlobResourceContentsSchema:At,AnnotationsSchema:Me,ResourceSchema:dt,ResourceTemplateSchema:wo,ResourceListChangedNotificationSchema:Ke,ResourceUpdatedNotificationParamsSchema:Ye,ResourceUpdatedNotificationSchema:xo,PromptArgumentSchema:Po,PromptSchema:jt,PromptListChangedNotificationSchema:To,TextContentSchema:qe,ImageContentSchema:Ee,AudioContentSchema:Lt,ToolUseContentSchema:Br,EmbeddedResourceSchema:Wr,ResourceLinkSchema:Gr,ContentBlockSchema:pt,PromptMessageSchema:ko,ToolAnnotationsSchema:Ut,ToolListChangedNotificationSchema:Kr,ModelHintSchema:Yr,ModelPreferencesSchema:Qr,ToolChoiceSchema:Xr,BooleanSchemaSchema:en,StringSchemaSchema:tn,NumberSchemaSchema:on,UntitledSingleSelectEnumSchemaSchema:rn,TitledSingleSelectEnumSchemaSchema:nn,LegacyTitledEnumSchemaSchema:sn,SingleSelectEnumSchemaSchema:an,UntitledMultiSelectEnumSchemaSchema:cn,TitledMultiSelectEnumSchemaSchema:ln,MultiSelectEnumSchemaSchema:un,EnumSchemaSchema:dn,PrimitiveSchemaDefinitionSchema:pn,ElicitRequestFormParamsSchema:Zt,ResourceTemplateReferenceSchema:Dt,PromptReferenceSchema:Vt,RootSchema:hn,ClientCapabilities2026Schema:mn,ServerCapabilities2026Schema:Eo,RequestMetaEnvelopeSchema:$o,ToolSchema:Ht,ToolResultContentSchema:fn,SamplingMessageContentBlockSchema:Co,SamplingMessageSchema:Ft,ResultTypeSchema:Io,ResultMetaSchema:Oo,ResultSchema:gn,PaginatedResultSchema:ma,CallToolResultSchema:Mo,ListToolsResultSchema:Sn,ListPromptsResultSchema:_n,GetPromptResultSchema:yn,ListResourcesResultSchema:bn,ListResourceTemplatesResultSchema:vn,ReadResourceResultSchema:zn,CompleteResultSchema:Rn,CacheableResultSchema:fa,DiscoverResultSchema:wn,CreateMessageRequestParamsSchema:mt,CreateMessageRequestSchema:xn,ListRootsRequestSchema:Pn,CreateMessageResultSchema:Tn,ListRootsResultSchema:kn,ElicitResultSchema:En,ElicitRequestURLParamsSchema:$n,ElicitRequestParamsSchema:Cn,ElicitRequestSchema:In,InputRequestSchema:On,InputResponseSchema:Nn,InputRequestsSchema:Mn,InputResponsesSchema:qn,InputRequiredResultSchema:Jt,InputResponseRequestParamsSchema:ga,CallToolRequestSchema:_a,ListToolsRequestSchema:ya,ListPromptsRequestSchema:ba,GetPromptRequestSchema:va,ListResourcesRequestSchema:za,ListResourceTemplatesRequestSchema:Ra,ReadResourceRequestSchema:wa,CompleteRequestSchema:xa,DiscoverRequestSchema:Pa,SubscriptionFilterSchema:qo,SubscriptionsListenRequestSchema:Ta,SubscriptionsListenResultMetaSchema:ka,SubscriptionsListenResultSchema:Un,dispatchRequestSchemas:ft,dispatchResultSchemas:Ea,NotificationMetaSchema:Wt,SubscriptionsAcknowledgedNotificationSchema:Ao,CancelledNotificationParamsSchema:jo,CancelledNotificationSchema:Lo,notificationSchemas2026:Kl,JSONRPCResultResponseSchema:pe(gn),CallToolResultResponseSchema:pe(x([Mo,Jt])),ListToolsResultResponseSchema:pe(Sn),ListPromptsResultResponseSchema:pe(_n),GetPromptResultResponseSchema:pe(x([yn,Jt])),ListResourcesResultResponseSchema:pe(bn),ListResourceTemplatesResultResponseSchema:pe(vn),ReadResourceResultResponseSchema:pe(x([zn,Jt])),CompleteResultResponseSchema:pe(Rn),DiscoverResultResponseSchema:pe(wn),SubscriptionsListenResultResponseSchema:pe(Un)}}var Xb;function Nt(){return Xb??=Qb()}var ev=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function tv(e){return ev.includes(e)}var cf=Symbol("modelcontextprotocol.resultCacheHintFallback");function ov(e){return e[cf]}function KS(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function YS(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 QS 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",vo(this,new.target)}static fromError(t,o,r){if(t===j.UrlElicitationRequired&&r){let n=r;if(n.elicitations)return new e_(n.elicitations,o)}if(t===j.UnsupportedProtocolVersion&&r){let n=r;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new t_({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 XS(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 o_({requiredCapabilities:n.requiredCapabilities},o)}return new QS(t,o,r)}},XS=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}},e_=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??[]}},t_=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}},o_=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}},rv=0,nv="private",sv=["tools/call","prompts/get","resources/read"];function iv(e,t){let o=t.resultType;if(o===void 0)return{...t,resultType:"complete"};if(o==="complete"||sv.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 av(e,t){let o=ov(t);if(t.resultType!=="complete"||!tv(e))return o===void 0?t:pv(t);let r=t,n=KS(r.ttlMs)?r.ttlMs:uv(o),s=YS(r.cacheScope)?r.cacheScope:dv(o),i={...r,ttlMs:n,cacheScope:s};return delete i[cf],i}function cv(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function lv(e,t){if(t===void 0)return e;let o=e._meta;return o===void 0?{...e,_meta:{[Et]:t}}:!cv(o)||o[Et]!==void 0?e:{...e,_meta:{...o,[Et]:t}}}function uv(e){return e!==void 0&&KS(e.ttlMs)?e.ttlMs:rv}function dv(e){return e!==void 0&&YS(e.cacheScope)?e.cacheScope:nv}function pv(e){let t={...e};return delete t[cf],t}var hv=["elicitation/create","sampling/createMessage","roots/list"],Hl;function r_(){if(Hl)return Hl;let e=Nt();return Hl={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:$({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Hl}function n_(e){return hv.includes(e)}function Wm(e){return n_(e)?r_().request[e]:void 0}function mv(e){return n_(e)?r_().response[e]:void 0}var lf={"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},s_={"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 i_(e){return Object.prototype.hasOwnProperty.call(lf,e)}function a_(e){return Object.prototype.hasOwnProperty.call(s_,e)}function fv(e){return Object.prototype.hasOwnProperty.call(lf,e)}function gv(e){return i_(e)?Nt().dispatchRequestSchemas[e]:void 0}function Sv(e){return fv(e)?Nt().dispatchResultSchemas[e]:void 0}function _v(e){return a_(e)?Nt().notificationSchemas2026[e]:void 0}var iw=Object.keys(lf),aw=Object.keys(s_);function aa(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function sa(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 yv={ok:!1,reason:"not-in-era"},bv=[so,io];function vv(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=>aa(c)&&"execution"in c)&&(n().tools=s.map(c=>{if(!aa(c)||!("execution"in c))return c;let l={...c};return delete l.execution,l}));let i=t.capabilities;if(aa(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return o}var uf={era:"2026-07-28",hasRequestMethod:i_,hasNotificationMethod:a_,hasInputRequestMethod:e=>Wm(e)!==void 0,validateRequest:(e,t)=>sa(gv(e),t),validateResult:(e,t)=>sa(Sv(e),t),validateNotification:(e,t)=>sa(_v(e),t),validateInputRequest:(e,t)=>sa(Wm(e),t),validateInputResponse:(e,t)=>sa(mv(e),t),samplingResultVariant:()=>yv,outboundEnvelope(e){return{[so]:e.protocolVersion,[gr]:e.clientInfo,[io]:e.clientCapabilities,...e.logLevel!==void 0&&{[Sr]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let r of bv)r in e||t.push({key:r,problem:"missing"});let o=Nt().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=>DS(e),inputRequestSchema:Wm,decodeResult(e,t){if(!aa(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=aa(i)?i:{},l=t.requestState,u=t._meta===void 0?void 0:Nt().ResultMetaSchema.safeParse(t._meta),m=u?.success?u.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=zv(),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 lv(av(e,iv(e,vv(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=Nt().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("; ")}`}},Fl;function zv(){if(Fl)return Fl;let e=Nt();return Fl={"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},Fl}var df="2026-07-28";function la(e){return e!==void 0&&ZS(e)?uf:af}function OS(e){return e.revision!==void 0?la(e.revision).era:e.era==="modern"?uf.era:af.era}function Gm(e){return c_.some(t=>t.hasRequestMethod(e))}function Km(e){return c_.some(t=>t.hasNotificationMethod(e))}function NS(e){return e==="tasks/get"||e==="tasks/cancel"}var c_=[af,uf],Rv=Tf({AnnotationsSchema:()=>He,AudioContentSchema:()=>fo,BaseMetadataSchema:()=>De,BaseRequestParamsSchema:()=>oe,BlobResourceContentsSchema:()=>Cr,BooleanSchemaSchema:()=>Mr,CallToolRequestParamsSchema:()=>hi,CallToolRequestSchema:()=>mi,CallToolResultSchema:()=>Ot,CancelTaskRequestSchema:()=>Il,CancelTaskResultSchema:()=>Ol,CancelledNotificationParamsSchema:()=>vs,CancelledNotificationSchema:()=>wr,ClientCapabilitiesSchema:()=>Rs,ClientNotificationSchema:()=>Ml,ClientRequestSchema:()=>Nl,ClientResultSchema:()=>ql,ClientTasksCapabilitySchema:()=>yl,CompatibilityCallToolResultSchema:()=>vl,CompleteRequestParamsSchema:()=>Zi,CompleteRequestSchema:()=>Di,CompleteResultSchema:()=>Vi,ContentBlockSchema:()=>Fe,CreateMessageRequestParamsSchema:()=>Pi,CreateMessageRequestSchema:()=>Ti,CreateMessageResultSchema:()=>ki,CreateMessageResultWithToolsSchema:()=>Ei,CreateTaskResultSchema:()=>wl,CursorSchema:()=>yr,DiscoverRequestSchema:()=>ks,DiscoverResultSchema:()=>Pr,ElicitRequestFormParamsSchema:()=>bo,ElicitRequestParamsSchema:()=>Ni,ElicitRequestSchema:()=>Mi,ElicitRequestURLParamsSchema:()=>Oi,ElicitResultSchema:()=>ji,ElicitationCompleteNotificationParamsSchema:()=>qi,ElicitationCompleteNotificationSchema:()=>Ai,EmbeddedResourceSchema:()=>go,EmptyResultSchema:()=>Ct,EnumSchemaSchema:()=>Ii,GetPromptRequestParamsSchema:()=>ri,GetPromptRequestSchema:()=>ni,GetPromptResultSchema:()=>ai,GetTaskPayloadRequestSchema:()=>kl,GetTaskPayloadResultSchema:()=>El,GetTaskRequestSchema:()=>Pl,GetTaskResultSchema:()=>Tl,IconSchema:()=>zs,IconsSchema:()=>nt,ImageContentSchema:()=>mo,ImplementationSchema:()=>Ve,InitializeRequestParamsSchema:()=>ws,InitializeRequestSchema:()=>xs,InitializeResultSchema:()=>Ps,InitializedNotificationSchema:()=>Ts,JSONArraySchema:()=>Sl,JSONObjectSchema:()=>W,JSONRPCErrorResponseSchema:()=>lo,JSONRPCMessageSchema:()=>uo,JSONRPCNotificationSchema:()=>Rr,JSONRPCRequestSchema:()=>zr,JSONRPCResponseSchema:()=>_l,JSONRPCResultResponseSchema:()=>co,JSONValueSchema:()=>rt,LegacyTitledEnumSchemaSchema:()=>jr,ListChangedOptionsBaseSchema:()=>zl,ListPromptsRequestSchema:()=>ti,ListPromptsResultSchema:()=>oi,ListResourceTemplatesRequestSchema:()=>Ms,ListResourceTemplatesResultSchema:()=>qs,ListResourcesRequestSchema:()=>Os,ListResourcesResultSchema:()=>Ns,ListRootsRequestSchema:()=>Fi,ListRootsResultSchema:()=>Ji,ListTasksRequestSchema:()=>$l,ListTasksResultSchema:()=>Cl,ListToolsRequestSchema:()=>di,ListToolsResultSchema:()=>pi,LoggingLevelSchema:()=>Nr,LoggingMessageNotificationParamsSchema:()=>_i,LoggingMessageNotificationSchema:()=>yi,ModelHintSchema:()=>bi,ModelPreferencesSchema:()=>vi,MultiSelectEnumSchemaSchema:()=>Ci,NotificationSchema:()=>ne,NotificationsParamsSchema:()=>ue,NumberSchemaSchema:()=>yo,PaginatedRequestParamsSchema:()=>Cs,PaginatedRequestSchema:()=>st,PaginatedResultSchema:()=>it,PingRequestSchema:()=>Tr,PrimitiveSchemaDefinitionSchema:()=>Zr,ProgressNotificationParamsSchema:()=>$s,ProgressNotificationSchema:()=>kr,ProgressSchema:()=>Es,ProgressTokenSchema:()=>_r,PromptArgumentSchema:()=>Xs,PromptListChangedNotificationSchema:()=>ci,PromptMessageSchema:()=>ii,PromptReferenceSchema:()=>Ui,PromptSchema:()=>ei,ReadResourceRequestParamsSchema:()=>As,ReadResourceRequestSchema:()=>js,ReadResourceResultSchema:()=>Ls,RelatedTaskMetadataSchema:()=>bs,RequestIdSchema:()=>Ne,RequestMetaSchema:()=>br,RequestSchema:()=>G,ResourceContentsSchema:()=>Er,ResourceLinkSchema:()=>So,ResourceListChangedNotificationSchema:()=>Us,ResourceRequestParamsSchema:()=>po,ResourceSchema:()=>Ir,ResourceTemplateReferenceSchema:()=>Li,ResourceTemplateSchema:()=>Is,ResourceUpdatedNotificationParamsSchema:()=>Ys,ResourceUpdatedNotificationSchema:()=>Qs,ResultMetaObjectSchema:()=>vr,ResultSchema:()=>K,RoleSchema:()=>at,RootSchema:()=>Hi,RootsListChangedNotificationSchema:()=>Bi,SamplingContentSchema:()=>wi,SamplingMessageContentBlockSchema:()=>kt,SamplingMessageSchema:()=>xi,ServerCapabilitiesSchema:()=>xr,ServerNotificationSchema:()=>jl,ServerRequestSchema:()=>Al,ServerResultSchema:()=>Ll,ServerTasksCapabilitySchema:()=>bl,SetLevelRequestParamsSchema:()=>gi,SetLevelRequestSchema:()=>Si,SingleSelectEnumSchemaSchema:()=>$i,StringSchemaSchema:()=>_o,SubscribeRequestParamsSchema:()=>Zs,SubscribeRequestSchema:()=>Ds,SubscriptionFilterSchema:()=>Or,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Bs,SubscriptionsAcknowledgedNotificationSchema:()=>Ws,SubscriptionsListenRequestParamsSchema:()=>Fs,SubscriptionsListenRequestSchema:()=>Js,SubscriptionsListenResultMetaSchema:()=>Gs,SubscriptionsListenResultSchema:()=>Ks,TaskAugmentedRequestParamsSchema:()=>$t,TaskCreationParamsSchema:()=>Rl,TaskMetadataSchema:()=>ys,TaskSchema:()=>ct,TaskStatusNotificationParamsSchema:()=>Gi,TaskStatusNotificationSchema:()=>xl,TaskStatusSchema:()=>Wi,TextContentSchema:()=>ho,TextResourceContentsSchema:()=>$r,TitledMultiSelectEnumSchemaSchema:()=>Ur,TitledSingleSelectEnumSchemaSchema:()=>Ar,ToolAnnotationsSchema:()=>li,ToolChoiceSchema:()=>zi,ToolExecutionSchema:()=>ui,ToolListChangedNotificationSchema:()=>fi,ToolResultContentSchema:()=>Ri,ToolSchema:()=>It,ToolUseContentSchema:()=>si,UnsubscribeRequestParamsSchema:()=>Vs,UnsubscribeRequestSchema:()=>Hs,UntitledMultiSelectEnumSchemaSchema:()=>Lr,UntitledSingleSelectEnumSchemaSchema:()=>qr});var l_=e=>zr.safeParse(e).success,u_=e=>Rr.safeParse(e).success,tf=e=>co.safeParse(e).success,d_=e=>lo.safeParse(e).success;var ca=-32020,cw=[{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:[ca,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:[ca],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:[ca],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."}],lw={[j.ParseError]:400,[j.InvalidRequest]:400,[j.MethodNotFound]:404,[j.UnsupportedProtocolVersion]:400,[j.MissingRequiredClientCapability]:400,[ca]:400};function pf(e,t){return as(e,t)}function ia(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function of(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 MS=!1,rf="draft-2020-12";function wv(e,t="input"){let o=e["~standard"],r;if(o.jsonSchema)r=o.jsonSchema[t]({target:rf});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().");MS||(MS=!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=ro(e,{target:rf,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:p_(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 p_(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"||p_(r)))}return!1}function xv(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function Ym(e,t){let o=await e["~standard"].validate(t);return o.issues&&o.issues.length>0?{success:!1,error:o.issues.map(r=>xv(r)).join(", ")}:{success:!0,data:o.value}}function Pv(e){let t=ro(e,{target:rf,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var Tv=/\\\.\\d\{(\d+)\}/;function kv(e){let t=Tv.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 Ev(e,t){let o;switch(e){case"email":o=[Fc()];break;case"uri":o=[dr()];break;case"date":o=[xe.date()];break;case"date-time":o=kv(t);break}return new Set(o.map(r=>Pv(r)).filter(r=>r!==void 0))}function $v(e,t,o){return o!=="zod"?!0:Ev(e,t).has(t)}function ua(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Cv(e){try{return wv(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 Iv=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function hf(e){return Iv.has(e)||e.startsWith("x-")}var Ov=new Set(["$schema",...Object.keys(bo.shape.requestedSchema.shape)]),qS={string:ia([_o,qr,Ar,jr]),number:ia([yo]),integer:ia([yo]),boolean:ia([Mr]),array:ia([Lr,Ur])},Nv=new Set(_o.shape.format.unwrap().options);function Mv(e,t,o,r){if(!ua(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(qS,e.type)?qS[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,c]of Object.entries(e))n.has(i)||hf(i)?s[i]=c:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?Nv.has(e.format)?(typeof c!="string"||!$v(e.format,c,o))&&r.push(`${t}.${i}`):s[i]=c:r.push(`${t}.${i}`);return s}function qv(e,t){let o={},r=[];for(let[n,s]of Object.entries(e))n==="properties"&&ua(s)?o[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,Mv(c,`properties.${i}`,t,r)])):Ov.has(n)?o[n]=s:hf(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 Av(e,t){if(!ua(e.properties))return t;let o=Object.entries(e.properties).filter(([,r])=>!pf(Zr,r).success).map(([r])=>`properties.${r}`);return o.length>0?o.join(", "):t}function nf(e,t,o=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((r,n)=>nf(r,t[n],`${o}[${n}]`)):!ua(e)||!ua(t)?[]:Object.entries(e).flatMap(([r,n])=>{let s=o?`${o}.${r}`:r;return Object.prototype.hasOwnProperty.call(t,r)?nf(n,t[r],s):hf(r)?[]:[s]})}function jv(e){if(!of(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,o=qv(Cv(e.requestedSchema),t),r=pf(bo.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): ${Av(o,r.error.message)}`);let n=nf(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 Lv(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 uw=Object.assign(Lv,{elicit(e){try{return{method:"elicitation/create",params:jv(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 Uv=["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"],Zv={IdJagTokenExchangeResponseSchema:ea,OAuthClientInformationFullSchema:na,OAuthClientInformationSchema:ra,OAuthClientMetadataSchema:oa,OAuthClientRegistrationErrorSchema:Ul,OAuthErrorResponseSchema:ta,OAuthMetadataSchema:Dr,OAuthProtectedResourceMetadataSchema:Ki,OAuthTokenRevocationRequestSchema:Zl,OAuthTokensSchema:Xi,OpenIdProviderDiscoveryMetadataSchema:Qi,OpenIdProviderMetadataSchema:Yi},h_={},m_={};function f_(e,t){let o=e.slice(0,-6);h_[o]=t,m_[o]=r=>t.safeParse(r).success}for(let e of Uv)f_(e,Rv[e]);for(let[e,t]of Object.entries(Zv))f_(e,t);var Dv=Object.freeze(h_),Vv=Object.freeze(m_);function Hv(e){switch(e){case"initialize":case"notifications/initialized":return la(void 0);case"server/discover":return la(df);default:return}}var g_=6e4,Fv=[so,gr,io,Sr],Jv=["inputResponses","requestState"];function AS(e,t){let o=e.params;if(!Qm(o))return{message:e,lifted:{}};let r=o._meta,n=Qm(r)?Fv.filter(l=>l in r):[],s=t==="request"?Jv.filter(l=>l in o):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...o};if(n.length>0&&Qm(r)){let l={},u={...r};for(let m of n)l[m]=r[m],delete u[m];i.envelope=l,Object.keys(u).length>0?c._meta=u: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 jS(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 S_(e){return()=>e}var Bv=S_(void 0),Wv,mf=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{Wv=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??ml,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),tf(n)||d_(n)?this._onresponse(n):l_(n)?this._onrequest(n,s):u_(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}=AS(e,"notification"),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=OS(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(Km(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}=AS(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=(E,C,q)=>{let J={jsonrpc:"2.0",id:o.id,error:{code:E,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 E=OS(t.classification);if(E!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${o.method}': classified as ${E} but this instance serves ${n.era}`));let C=t.classification.revision??E;i(j.UnsupportedProtocolVersion,`Unsupported protocol version: ${C}`,{supported:this._supportedProtocolVersions,requested:C});return}}if(Gm(o.method)&&!n.hasRequestMethod(o.method)&&!(NS(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 u=(E,C)=>this._notificationViaCodec(this._resolveOutboundCodec(E.method),E,{...C,relatedRequestId:o.id}),m=(E,C,q)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(E.method),E,C,{...q,relatedRequestId:o.id}),S=new AbortController;this._requestHandlerAbortControllers.set(o.id,S);let _=r.inputResponses===void 0?void 0:Gv(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?Bv:S_(r.requestState),signal:S.signal,send:((E,C,q)=>{let J=this._resolveOutboundCodec(E.method);if(this._assertOutboundRequestInEra(J,E.method),of(C))return m(E,C,q);let L=jS(J,E.method);if(L===void 0)throw new TypeError(`'${E.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return m(E,L,C)}),notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},P=this.buildContext(y,t);Promise.resolve().then(()=>c(o,P)).then(async E=>{if(S.signal.aborted)return;let C;try{C=n.encodeResult(o.method,E,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 E=>{if(S.signal.aborted)return;let C=Number.isSafeInteger(E.code)?E.code:j.InternalError,q={jsonrpc:"2.0",id:o.id,error:{code:n.encodeErrorCode(C),message:E.message??"Internal error",...E.data!==void 0&&{data:E.data}}};await s?.send(q)}).catch(E=>this._onerror(new Error(`Failed to send response: ${E}`))).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),tf(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(of(t))return NS(e.method)||this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,o);this._assertOutboundRequestInEra(r,e.method);let n=jS(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 la(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Hv(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Gm(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(),u,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 P=e.era===df&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,E=this._requestMessageId++;m=E;let C={...t,jsonrpc:"2.0",id:E};r?.onprogress&&(this._progressHandlers.set(E,r.onprogress),C.params={...t.params,_meta:{...t.params?._meta,progressToken:E}});let q=this._envelopeOutbound(C),J=!1,L=F=>{J||(this._progressHandlers.delete(E),P===void 0?t.method!=="initialize"&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:E,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(E,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(Kv(ee));let de={codec:e,request:t,resultSchema:o,options:r,flowStartedAt:l,retry:(lt,qt)=>this._requestWithSchemaViaCodec(e,lt===void 0?{method:t.method}:{method:t.method,params:lt},o,qt)};return S(this._resolveNonCompleteResult(ee,de))}let Ge=ee.result;Ym(o,Ge).then(de=>{de.success?S(de.data):_(new X(se.InvalidResult,`Invalid result for ${t.method}: ${de.error}`))},_)}),u=()=>L(r?.signal?.reason),r?.signal?.addEventListener("abort",u,{once:!0});let U=r?.timeout??g_,B=()=>L(new X(se.RequestTimeout,"Request timed out",{timeout:U}));this._setupTimeout(E,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(E),_(F)})}).finally(()=>{u&&r?.signal?.removeEventListener("abort",u),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(Km(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(!Gm(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 Ym(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(!Km(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 Ym(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 Qm(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function LS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Gv(e){let t={},o=[];if(!LS(e))return{accepted:t,droppedKeys:o};for(let[r,n]of Object.entries(e)){if(!LS(n)||"method"in n||"result"in n){o.push(r);continue}t[r]=n}return{accepted:t,droppedKeys:o}}function Kv(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var Yv=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 u=l.indexOf(";"),m=u!==-1?l.slice(0,u).trim():l.trim();if(!r.test(m))throw new TypeError("invalid media type");var S=new i(m.toLowerCase());if(u!==-1){var _,y,P;for(t.lastIndex=u;y=t.exec(l);){if(y.index!==u)throw new TypeError("invalid parameter format");u+=y[0].length,_=y[1].toLowerCase(),P=y[2],P.charCodeAt(0)===34&&(P=P.slice(1,-1),P.indexOf("\\")!==-1&&(P=P.replace(o,"$1"))),S.parameters[_]=P}if(u!==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}})),dw=kf(Yv(),1);var Qv=10*1024*1024;var zw=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 Xv=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,ez=[0,31,28,31,30,31,30,31,31,30,31,30,31],tz=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,oz=/^(?=.{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,rz=/^(?:[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,nz=/^(?:(?:[^\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,sz=/^(?:(?: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,iz=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,az=/^(?:\/(?:[^~/]|~0|~1)*)*$/,cz=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,lz=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,uz=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))},dz=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,pz=/^((([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,hz=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 Rw={date:__,time:y_.bind(void 0,!1),"date-time":gz,duration:hz,uri:yz,"uri-reference":Je(rz),"uri-template":Je(nz),url:Je(sz),email:uz,hostname:Je(oz),ipv4:Je(dz),ipv6:Je(pz),regex:vz,uuid:Je(iz),"json-pointer":Je(az),"json-pointer-uri-fragment":Je(cz),"relative-json-pointer":Je(lz)};function mz(e){return e%4===0&&(e%100!==0||e%400===0)}function __(e){let t=e.match(Xv);if(!t)return!1;let o=+t[1],r=+t[2],n=+t[3];return r>=1&&r<=12&&n>=1&&n<=(r==2&&mz(o)?29:ez[r])}function y_(e,t){let o=t.match(tz);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 fz=/t|\s/i;function gz(e){let t=e.split(fz);return t.length==2&&__(t[0])&&y_(!0,t[1])}var Sz=/\/|:/,_z=/^(?:[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 yz(e){return Sz.test(e)&&_z.test(e)}var bz=/[^\\]\\Z/;function vz(e){if(bz.test(e))return!1;try{return new RegExp(e,"u"),!0}catch{return!1}}var Rz;Rz=globalThis.crypto;var da=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,vo(this,new.target)}},Sx=class extends da{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}},_x=class extends da{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}},yx=class extends da{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}},bx=class extends da{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}},vx=class extends da{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 zx=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",vo(this,new.target)}};var Rx=Symbol.for("mcp.authSeamEscape");var wx=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,vo(this,new.target)}};var ff=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}},gf=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)}},b_=new Set;function v_(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";b_.has(i)||(b_.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,u)=>c({method:s,params:l},wz(u)):l=>c({method:s,params:l})]}function wz(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 xz="2026-01-26";var Pz="ui/notifications/tool-input-partial";var Sf=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=uo.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!==Pz&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},Tz=d.union([d.literal("light"),d.literal("dark")]).describe("Color theme preference for the host environment."),pa=d.union([d.literal("inline"),d.literal("fullscreen"),d.literal("pip")]).describe("Display mode for UI presentation."),kz=d.union([d.literal("--color-background-primary"),d.literal("--color-background-secondary"),d.literal("--color-background-tertiary"),d.literal("--color-background-inverse"),d.literal("--color-background-ghost"),d.literal("--color-background-info"),d.literal("--color-background-danger"),d.literal("--color-background-success"),d.literal("--color-background-warning"),d.literal("--color-background-disabled"),d.literal("--color-text-primary"),d.literal("--color-text-secondary"),d.literal("--color-text-tertiary"),d.literal("--color-text-inverse"),d.literal("--color-text-ghost"),d.literal("--color-text-info"),d.literal("--color-text-danger"),d.literal("--color-text-success"),d.literal("--color-text-warning"),d.literal("--color-text-disabled"),d.literal("--color-border-primary"),d.literal("--color-border-secondary"),d.literal("--color-border-tertiary"),d.literal("--color-border-inverse"),d.literal("--color-border-ghost"),d.literal("--color-border-info"),d.literal("--color-border-danger"),d.literal("--color-border-success"),d.literal("--color-border-warning"),d.literal("--color-border-disabled"),d.literal("--color-ring-primary"),d.literal("--color-ring-secondary"),d.literal("--color-ring-inverse"),d.literal("--color-ring-info"),d.literal("--color-ring-danger"),d.literal("--color-ring-success"),d.literal("--color-ring-warning"),d.literal("--font-sans"),d.literal("--font-mono"),d.literal("--font-weight-normal"),d.literal("--font-weight-medium"),d.literal("--font-weight-semibold"),d.literal("--font-weight-bold"),d.literal("--font-text-xs-size"),d.literal("--font-text-sm-size"),d.literal("--font-text-md-size"),d.literal("--font-text-lg-size"),d.literal("--font-heading-xs-size"),d.literal("--font-heading-sm-size"),d.literal("--font-heading-md-size"),d.literal("--font-heading-lg-size"),d.literal("--font-heading-xl-size"),d.literal("--font-heading-2xl-size"),d.literal("--font-heading-3xl-size"),d.literal("--font-text-xs-line-height"),d.literal("--font-text-sm-line-height"),d.literal("--font-text-md-line-height"),d.literal("--font-text-lg-line-height"),d.literal("--font-heading-xs-line-height"),d.literal("--font-heading-sm-line-height"),d.literal("--font-heading-md-line-height"),d.literal("--font-heading-lg-line-height"),d.literal("--font-heading-xl-line-height"),d.literal("--font-heading-2xl-line-height"),d.literal("--font-heading-3xl-line-height"),d.literal("--border-radius-xs"),d.literal("--border-radius-sm"),d.literal("--border-radius-md"),d.literal("--border-radius-lg"),d.literal("--border-radius-xl"),d.literal("--border-radius-full"),d.literal("--border-width-regular"),d.literal("--shadow-hairline"),d.literal("--shadow-sm"),d.literal("--shadow-md"),d.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),Ez=d.record(kz.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.`),Zx=d.object({method:d.literal("ui/open-link"),params:d.object({url:d.string().describe("URL to open in the host's browser")})}),$
|
|
83
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Zx=d.object({method:d.literal("ui/open-link"),params:d.object({url:d.string().describe("URL to open in the host's browser")})}),$z=d.object({isError:d.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),Cz=d.object({isError:d.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),Iz=d.object({isError:d.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),Dx=d.object({method:d.literal("ui/notifications/sandbox-proxy-ready"),params:d.object({})}),_f=d.object({connectDomains:d.array(d.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:d.array(d.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:d.array(d.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:d.array(d.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'`)")}),yf=d.object({camera:d.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:d.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:d.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:d.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),Vx=d.object({method:d.literal("ui/notifications/size-changed"),params:d.object({width:d.number().optional().describe("New width in pixels."),height:d.number().optional().describe("New height in pixels.")})}),
|
|
86
|
+
- Empty or omitted \u2192 no network connections (secure default)`),resourceDomains:d.array(d.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:d.array(d.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:d.array(d.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'`)")}),yf=d.object({camera:d.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:d.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:d.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:d.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),Vx=d.object({method:d.literal("ui/notifications/size-changed"),params:d.object({width:d.number().optional().describe("New width in pixels."),height:d.number().optional().describe("New height in pixels.")})}),Oz=d.object({method:d.literal("ui/notifications/tool-input"),params:d.object({arguments:d.record(d.string(),d.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),Nz=d.object({method:d.literal("ui/notifications/tool-input-partial"),params:d.object({arguments:d.record(d.string(),d.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),Mz=d.object({method:d.literal("ui/notifications/tool-cancelled"),params:d.object({reason:d.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),qz=d.object({fonts:d.string().optional()}),Az=d.object({variables:Ez.optional().describe("CSS variables for theming the app."),css:qz.optional().describe("CSS blocks that apps can inject.")}),jz=d.object({method:d.literal("ui/resource-teardown"),params:d.object({})}),Lz=d.record(d.string(),d.unknown()),z_=d.object({text:d.object({}).optional().describe("Host supports text content blocks."),image:d.object({}).optional().describe("Host supports image content blocks."),audio:d.object({}).optional().describe("Host supports audio content blocks."),resource:d.object({}).optional().describe("Host supports resource content blocks."),resourceLink:d.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:d.object({}).optional().describe("Host supports structured content.")}),Hx=d.object({method:d.literal("ui/notifications/request-teardown"),params:d.object({}).optional()}),Uz=d.object({experimental:d.record(d.string(),d.record(d.string(),d.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),openLinks:d.object({}).optional().describe("Host supports opening external URLs."),downloadFile:d.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:d.object({listChanged:d.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:d.object({listChanged:d.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:d.object({}).optional().describe("Host accepts log messages."),sandbox:d.object({permissions:yf.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:_f.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:z_.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:z_.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:d.object({tools:d.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.")}),Zz=d.object({experimental:d.record(d.string(),d.record(d.string(),d.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),tools:d.object({listChanged:d.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:d.array(pa).optional().describe("Display modes the app supports.")}),Fx=d.object({method:d.literal("ui/notifications/initialized"),params:d.object({}).optional()}),Jx=d.object({csp:_f.optional().describe("Content Security Policy configuration for UI resources."),permissions:yf.optional().describe("Sandbox permissions requested by the UI resource."),domain:d.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,13 +97,13 @@ 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`)}),Bx=d.object({method:d.literal("ui/request-display-mode"),params:d.object({mode:
|
|
100
|
+
- omitted: host decides border`)}),Bx=d.object({method:d.literal("ui/request-display-mode"),params:d.object({mode:pa.describe("The display mode being requested.")})}),Dz=d.object({mode:pa.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),Vz=d.union([d.literal("model"),d.literal("app")]).describe("Tool visibility scope - who can access the tool."),Wx=d.object({resourceUri:d.string().optional(),visibility:d.array(Vz).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:d.never().optional(),permissions:d.never().optional()}),Gx=d.object({mimeTypes:d.array(d.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),Kx=d.object({method:d.literal("ui/download-file"),params:d.object({contents:d.array(d.union([go,So])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),Yx=d.object({method:d.literal("ui/message"),params:d.object({role:d.literal("user").describe('Message role, currently only "user" is supported.'),content:d.array(Fe).describe("Message content blocks (text, image, etc.).")})}),Qx=d.object({method:d.literal("ui/notifications/sandbox-resource-ready"),params:d.object({html:d.string().describe("HTML content to load into the inner iframe."),sandbox:d.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:_f.optional().describe("CSP configuration from resource metadata."),permissions:yf.optional().describe("Sandbox permissions from resource metadata.")})}),
|
|
103
|
-
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:d.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:d.string().optional().describe("User's timezone in IANA format."),userAgent:d.string().optional().describe("Host application identifier."),platform:d.union([d.literal("web"),d.literal("desktop"),d.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:d.object({touch:d.boolean().optional().describe("Whether the device supports touch input."),hover:d.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:d.object({top:d.number().describe("Top safe area inset in pixels."),right:d.number().describe("Right safe area inset in pixels."),bottom:d.number().describe("Bottom safe area inset in pixels."),left:d.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),Fv=d.object({method:d.literal("ui/notifications/host-context-changed"),params:x_.describe("Partial context update containing only changed fields.")}),Xx=d.object({method:d.literal("ui/update-model-context"),params:d.object({content:d.array(Fe).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:d.record(d.string(),d.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),eP=d.object({method:d.literal("ui/initialize"),params:d.object({appInfo:Ve.describe("App identification (name and version)."),appCapabilities:Zv.describe("Features and capabilities this app provides."),protocolVersion:d.string().describe("Protocol version this app supports.")})}),Jv=d.object({protocolVersion:d.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Ve.describe("Host application identification and version."),hostCapabilities:Uv.describe("Features and capabilities provided by the host."),hostContext:x_.describe("Rich context about the host environment.")}).passthrough(),Bv={target:"draft-2020-12"};async function R_(e,t){let o=e["~standard"];if(o.jsonSchema)return o.jsonSchema[t](Bv);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 w_(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 Wv(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 Jl=class e extends mf{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new ff;_methods=new gf;setRequestHandler=(...t)=>{let[o,...r]=z_("request",t)??t;this._methods.claim(o,"setRequestHandler"),super.setRequestHandler.call(this,o,...r)};setNotificationHandler=(...t)=>{let[o,...r]=z_("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:Ov,toolinputpartial:Nv,toolresult:Hv,toolcancelled:Mv,hostcontextchanged:Fv};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&&d.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=Wv(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,u)=>{if(!c.enabled)throw Error(`Tool ${t} is disabled`);let m;if(i){let S=c.inputSchema,_=S?await w_(S,l??{},`Invalid input for tool ${t}: `):l??{};m=await r(_,u)}else m=await r(u);return c.outputSchema&&!m.isError&&(m.structuredContent=await w_(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 R_(n.inputSchema,"input"):{type:"object",properties:{}}};return n.outputSchema&&(s.outputSchema=await R_(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:jv.shape.params,result:Lv},(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},Iv,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},Ct,o)}openLink(t,o){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:t},$v,o)}sendOpenLink=this.openLink;downloadFile(t,o){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:t},Cv,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},Dv,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 u=Math.ceil(window.innerWidth);(u!==o||l!==r)&&(o=u,r=l,this.sendSizeChanged({width:u,height:l}))}))};n();let s=new ResizeObserver(n);return s.observe(document.documentElement),s.observe(document.body),()=>s.disconnect()}async connect(t=new Sf(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:xv}},Jv,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 Bl=class{constructor(t){this.read=t,this.records=new Map,this.bytes=new Map,this.urls=new Map,this.styles=new Map,this.styleReady=new Map,this.revisions=new Set,this.importing=Promise.resolve(),this.generation=0,this.closed=!1,globalThis.__dsPreviewImport=o=>this.importModule(o)}register(t){if(t.schemaVersion!==1||!Array.isArray(t.scenarios)||!t.assets||typeof t.revision!="string")throw new Error("Unsupported preview manifest. Rebuild previews with the installed ADS version.");if(this.revisions.add(t.revision),this.revisions.size>20)throw Object.assign(new Error("Reopen the preview to release modules retained across 20 build revisions."),{code:"ADS_PREVIEW_REOPEN"});for(let[o,r]of Object.entries(t.assets)){if(!/^ads:\/\/assets\/[a-f0-9]{64}\.[a-z0-9]+$/.test(o)||!/^sha256:[a-f0-9]{64}$/.test(r.digest)||!["imports","dynamicImports","styles","references"].every(n=>Array.isArray(r[n])&&r[n].every(s=>Object.hasOwn(t.assets,s))))throw new Error("Invalid preview dependency graph.");if(this.records.has(o)&&this.records.get(o).digest!==r.digest)throw new Error("An immutable preview resource changed its content.");this.records.set(o,r)}}async resource(t){if(!this.bytes.has(t)){let o=(async()=>{let r=this.records.get(t);if(!r)throw new Error(`Unknown preview dependency: ${t}`);let n;try{n=await this.read(t)}catch(u){throw new Error(`Preview resource read failed for ${t}: ${u.message}`,{cause:u})}if(this.closed)throw new Error("The preview App was closed.");let s=n.contents.find(u=>u.uri===t);if(!s)throw new Error(`Missing preview dependency: ${t}`);let i=typeof s.text=="string"?new TextEncoder().encode(s.text):Uint8Array.from(atob(s.blob),u=>u.charCodeAt(0)),c=await crypto.subtle.digest("SHA-256",i),l="sha256:"+[...new Uint8Array(c)].map(u=>u.toString(16).padStart(2,"0")).join("");if(i.length!==r.size||l!==r.digest)throw new Error("Preview resource integrity check failed. Rebuild and reopen the preview.");return i})();this.bytes.set(t,o),o.catch(()=>this.bytes.delete(t))}return this.bytes.get(t)}closure(t){let o=[],r=new Set,n=s=>{if(r.has(s))return;r.add(s);let i=this.records.get(s);if(!i)throw new Error(`Missing preview dependency metadata: ${s}`);for(let c of[...i.imports,...i.styles,...i.references])n(c);o.push(s)};return n(t),o}async materialize(t){let o=this.closure(t);await Promise.all(o.map(n=>this.resource(n)));let r={};for(let n of o){if(this.closed)throw new Error("The preview App was closed.");if(this.urls.has(n))continue;let s=this.records.get(n),i=await this.resource(n);if(s.kind==="module"||s.mimeType==="text/css"){let l=new TextDecoder().decode(i);for(let u of s.references){let m=this.urls.get(u);if(!m)throw new Error("Unsupported cyclic asset reference.");l=l.replaceAll(u,m)}i=l}let c=URL.createObjectURL(new Blob([i],{type:s.mimeType}));this.urls.set(n,c),s.kind==="module"&&(r[n]=c)}if(Object.keys(r).length){let n=document.createElement("script");n.type="importmap",n.textContent=JSON.stringify({imports:r}),document.head.append(n)}return o}async importModule(t){let o=this.importing.then(()=>this.materialize(t));this.importing=o.catch(()=>{});let r=await o;for(let n of r){if(this.records.get(n).mimeType!=="text/css")continue;if(this.styles.has(n)){await this.styleReady.get(n);continue}let i=document.createElement("link");i.rel="stylesheet",i.href=this.urls.get(n),this.styles.set(n,i);let c=new Promise((l,u)=>{i.onload=l,i.onerror=()=>u(new Error("The host CSP blocked a preview stylesheet."))});this.styleReady.set(n,c),document.head.append(i);try{await c}catch(l){throw i.remove(),this.styles.delete(n),this.styleReady.delete(n),l}}try{return await import(t)}catch(n){throw new Error(`Preview module import failed for ${t}: ${n.message}. Inspect the App resource bridge, browser network/CSP diagnostics and current build.`,{cause:n})}}async mount(t,o,r){let n=++this.generation;this.register(t);let s=t.scenarios.find(l=>l.id===o);if(!s)throw new Error("The selected scenario is no longer registered.");let i=await this.importModule(s.module);if(n!==this.generation||(await this.unmount?.(),n!==this.generation||this.closed))return!1;r.replaceChildren();let c=new Set(this.closure(s.module));for(let[l,u]of this.styles)c.has(l)||(u.remove(),this.styles.delete(l),this.styleReady.delete(l));for(let l of this.closure(s.module))this.styles.has(l)&&document.head.append(this.styles.get(l));if(typeof i.mount!="function")throw new Error("The compiled scenario has no mount adapter.");if(this.unmount=i.mount(r),typeof this.unmount!="function")throw new Error("The scenario mount adapter must return an unmount callback.");return!0}async dispose(){if(!this.closed){this.closed=!0,++this.generation,await this.unmount?.();for(let t of this.styles.values())t.remove();for(let t of this.urls.values())URL.revokeObjectURL(t);this.styles.clear(),this.styleReady.clear(),this.urls.clear(),this.bytes.clear(),this.records.clear(),delete globalThis.__dsPreviewImport}}};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 T_(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 k_(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(u=>`${u.token}:${u.property}`));for(let u of c)l.has(`${u.dataset.adsToken}:${u.dataset.adsProperty}`)||s.push(`Undeclared rendered token sample ${u.dataset.adsToken}:${u.dataset.adsProperty}.`);for(let u of t){if(!r.CSS.supports(u.property,u.probe)){s.push(`${u.token}: the fixture probe is invalid for ${u.property}.`);continue}let m=r.getComputedStyle(n).getPropertyValue(u.token).trim();if(!m||!r.CSS.supports(u.property,m)){s.push(`${u.token}: its current value is invalid for the fixture's ${u.property} binding.`);continue}let S=c.filter(y=>y.dataset.adsToken===u.token&&y.dataset.adsProperty===u.property);if(!S.length){s.push(`${u.token} needs a rendered ${u.property} sample, not only a name/value label.`);continue}let _=!1;for(let y of S){let P=[];for(let q=y.parentElement;q&&q!==e;q=q.parentElement)q.tagName==="DETAILS"&&!q.open&&(q.open=!0,P.push(q));let E=n.getAttribute("style"),C=y.getAttribute("style");try{y.style.setProperty("transition","none","important");let q=r.getComputedStyle(y).getPropertyValue(u.property),J=T_(y,r);n.style.setProperty(u.token,u.probe,"important");let L=r.getComputedStyle(y).getPropertyValue(u.property);_=!!(L&&L!==q&&(J||T_(y,r)))}finally{E===null?n.removeAttribute("style"):n.setAttribute("style",E),C===null?y.removeAttribute("style"):y.setAttribute("style",C);for(let q of P)q.open=!1}if(_)break}_?i.push(u):s.push(`${u.token} has no visible ${u.property} sample that responds to its value. Hardcoded copies do not satisfy coverage.`)}return{ok:!s.length,verified:i,diagnostics:s}}var We=new Jl({name:"ADS resource preview",version:"1.0.0"},{},{autoResize:!0}),E_=document.getElementById("root"),bf=document.getElementById("ads-preview-status"),vf=async e=>{if(!We.getHostCapabilities()?.serverResources)throw new Error("This host does not forward MCP resource reads. Open the same preview in the ADS showcase.");try{return await We.readServerResource({uri:e},{timeout:15e3})}catch(t){throw t.code===-32601||t.message==="Method not found"?new Error("This host does not forward MCP resource reads. Open the same preview in the ADS showcase."):t}},Gl=new Bl(vf),Vr,ha,$_,Rf,zf=!1,vo=0,pa={},Be="";function Mt(e,t=!1){bf.textContent=e,bf.hidden=!e,bf.setAttribute("role",t?"alert":"status")}async function Wl(e,t={}){try{We.getHostCapabilities()?.logging&&await We.sendLog({level:e==="error"?"error":"info",logger:"ads-preview",data:{state:e,id:Vr,...t}})}catch{}}function C_(e){pa={...pa,...e,styles:{...pa.styles,...e.styles}},["light","dark"].includes(pa.theme)&&(document.documentElement.dataset.theme=pa.theme)}async function I_(){return JSON.parse((await vf("ads://preview/manifest")).contents.find(e=>typeof e.text=="string").text)}async function wf(e,t){if(e===Vr&&t&&t===ha){Mt(Be,!!Be),await Wl(Be?"error":"ready",Be?{message:Be}:{revision:ha});return}let o=++vo;++Gl.generation,Vr=e,document.documentElement.dataset.adsScenario=e,document.documentElement.dataset.adsPreviewState="loading",Be="",Mt(""),await Wl("loading");try{let r=await I_();if(t&&r.revision!==t)throw new Error("Preview changed while opening. Select it again to use the current build.");if(o!==vo||!await Gl.mount(r,e,E_)||o!==vo||(ha=r.revision,$_=r.session,await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i))),await document.fonts.ready,o!==vo))return;let s=r.scenarios.find(i=>i.id===e);if(s?.kind==="tokens"){let i=k_(E_,s.samples);if(!i.ok)throw Be=`Token preview verification failed:
|
|
102
|
+
- "app": Tool callable by the app from this server only`),csp:d.never().optional(),permissions:d.never().optional()}),Gx=d.object({mimeTypes:d.array(d.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),Kx=d.object({method:d.literal("ui/download-file"),params:d.object({contents:d.array(d.union([go,So])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),Yx=d.object({method:d.literal("ui/message"),params:d.object({role:d.literal("user").describe('Message role, currently only "user" is supported.'),content:d.array(Fe).describe("Message content blocks (text, image, etc.).")})}),Qx=d.object({method:d.literal("ui/notifications/sandbox-resource-ready"),params:d.object({html:d.string().describe("HTML content to load into the inner iframe."),sandbox:d.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:_f.optional().describe("CSP configuration from resource metadata."),permissions:yf.optional().describe("Sandbox permissions from resource metadata.")})}),Hz=d.object({method:d.literal("ui/notifications/tool-result"),params:Ot.describe("Standard MCP tool execution result.")}),x_=d.object({toolInfo:d.object({id:Ne.optional().describe("JSON-RPC id of the tools/call request."),tool:It.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:Tz.optional().describe("Current color theme preference."),styles:Az.optional().describe("Style configuration for theming the app."),displayMode:pa.optional().describe("How the UI is currently displayed."),availableDisplayModes:d.array(pa).optional().describe("Display modes the host supports."),containerDimensions:d.union([d.object({height:d.number().describe("Fixed container height in pixels.")}),d.object({maxHeight:d.union([d.number(),d.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(d.union([d.object({width:d.number().describe("Fixed container width in pixels.")}),d.object({maxWidth:d.union([d.number(),d.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:d.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:d.string().optional().describe("User's timezone in IANA format."),userAgent:d.string().optional().describe("Host application identifier."),platform:d.union([d.literal("web"),d.literal("desktop"),d.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:d.object({touch:d.boolean().optional().describe("Whether the device supports touch input."),hover:d.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:d.object({top:d.number().describe("Top safe area inset in pixels."),right:d.number().describe("Right safe area inset in pixels."),bottom:d.number().describe("Bottom safe area inset in pixels."),left:d.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),Fz=d.object({method:d.literal("ui/notifications/host-context-changed"),params:x_.describe("Partial context update containing only changed fields.")}),Xx=d.object({method:d.literal("ui/update-model-context"),params:d.object({content:d.array(Fe).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:d.record(d.string(),d.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),eP=d.object({method:d.literal("ui/initialize"),params:d.object({appInfo:Ve.describe("App identification (name and version)."),appCapabilities:Zz.describe("Features and capabilities this app provides."),protocolVersion:d.string().describe("Protocol version this app supports.")})}),Jz=d.object({protocolVersion:d.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Ve.describe("Host application identification and version."),hostCapabilities:Uz.describe("Features and capabilities provided by the host."),hostContext:x_.describe("Rich context about the host environment.")}).passthrough(),Bz={target:"draft-2020-12"};async function R_(e,t){let o=e["~standard"];if(o.jsonSchema)return o.jsonSchema[t](Bz);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 w_(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 Wz(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 Jl=class e extends mf{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new ff;_methods=new gf;setRequestHandler=(...t)=>{let[o,...r]=v_("request",t)??t;this._methods.claim(o,"setRequestHandler"),super.setRequestHandler.call(this,o,...r)};setNotificationHandler=(...t)=>{let[o,...r]=v_("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:Oz,toolinputpartial:Nz,toolresult:Hz,toolcancelled:Mz,hostcontextchanged:Fz};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&&d.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=Wz(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,u)=>{if(!c.enabled)throw Error(`Tool ${t} is disabled`);let m;if(i){let S=c.inputSchema,_=S?await w_(S,l??{},`Invalid input for tool ${t}: `):l??{};m=await r(_,u)}else m=await r(u);return c.outputSchema&&!m.isError&&(m.structuredContent=await w_(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 R_(n.inputSchema,"input"):{type:"object",properties:{}}};return n.outputSchema&&(s.outputSchema=await R_(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:jz.shape.params,result:Lz},(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},Iz,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},Ct,o)}openLink(t,o){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:t},$z,o)}sendOpenLink=this.openLink;downloadFile(t,o){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:t},Cz,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},Dz,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 u=Math.ceil(window.innerWidth);(u!==o||l!==r)&&(o=u,r=l,this.sendSizeChanged({width:u,height:l}))}))};n();let s=new ResizeObserver(n);return s.observe(document.documentElement),s.observe(document.body),()=>s.disconnect()}async connect(t=new Sf(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:xz}},Jz,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 Bl=class{constructor(t){this.read=t,this.records=new Map,this.bytes=new Map,this.urls=new Map,this.styles=new Map,this.styleReady=new Map,this.revisions=new Set,this.importing=Promise.resolve(),this.generation=0,this.closed=!1,globalThis.__dsPreviewImport=o=>this.importModule(o)}register(t){if(t.schemaVersion!==1||!Array.isArray(t.scenarios)||!t.assets||typeof t.revision!="string")throw new Error("Unsupported preview manifest. Rebuild previews with the installed ADS version.");if(this.revisions.add(t.revision),this.revisions.size>20)throw Object.assign(new Error("Reopen the preview to release modules retained across 20 build revisions."),{code:"ADS_PREVIEW_REOPEN"});for(let[o,r]of Object.entries(t.assets)){if(!/^ads:\/\/assets\/[a-f0-9]{64}\.[a-z0-9]+$/.test(o)||!/^sha256:[a-f0-9]{64}$/.test(r.digest)||!["imports","dynamicImports","styles","references"].every(n=>Array.isArray(r[n])&&r[n].every(s=>Object.hasOwn(t.assets,s))))throw new Error("Invalid preview dependency graph.");if(this.records.has(o)&&this.records.get(o).digest!==r.digest)throw new Error("An immutable preview resource changed its content.");this.records.set(o,r)}}async resource(t){if(!this.bytes.has(t)){let o=(async()=>{let r=this.records.get(t);if(!r)throw new Error(`Unknown preview dependency: ${t}`);let n;try{n=await this.read(t)}catch(u){throw Object.assign(new Error(`Preview resource read failed for ${t}: ${u.message}`,{cause:u}),{code:"ADS_RESOURCE_READ",category:"transport",resourceUri:t})}if(this.closed)throw new Error("The preview App was closed.");let s=n.contents.find(u=>u.uri===t);if(!s)throw Object.assign(new Error(`Missing preview dependency: ${t}`),{code:"ADS_RESOURCE_CONTENT",category:"build",resourceUri:t});let i=typeof s.text=="string"?new TextEncoder().encode(s.text):Uint8Array.from(atob(s.blob),u=>u.charCodeAt(0)),c=await crypto.subtle.digest("SHA-256",i),l="sha256:"+[...new Uint8Array(c)].map(u=>u.toString(16).padStart(2,"0")).join("");if(i.length!==r.size||l!==r.digest)throw Object.assign(new Error("Preview resource integrity check failed. Rebuild and reopen the preview."),{code:"ADS_RESOURCE_INTEGRITY",category:"build",resourceUri:t});return i})();this.bytes.set(t,o),o.catch(()=>this.bytes.delete(t))}return this.bytes.get(t)}closure(t){let o=[],r=new Set,n=s=>{if(r.has(s))return;r.add(s);let i=this.records.get(s);if(!i)throw new Error(`Missing preview dependency metadata: ${s}`);for(let c of[...i.imports,...i.styles,...i.references])n(c);o.push(s)};return n(t),o}async materialize(t){let o=this.closure(t);await Promise.all(o.map(n=>this.resource(n)));let r={};for(let n of o){if(this.closed)throw new Error("The preview App was closed.");if(this.urls.has(n))continue;let s=this.records.get(n),i=await this.resource(n);if(s.kind==="module"||s.mimeType==="text/css"){let l=new TextDecoder().decode(i);for(let u of s.references){let m=this.urls.get(u);if(!m)throw new Error("Unsupported cyclic asset reference.");l=l.replaceAll(u,m)}i=l}let c=URL.createObjectURL(new Blob([i],{type:s.mimeType}));this.urls.set(n,c),s.kind==="module"&&(r[n]=c)}if(Object.keys(r).length){let n=document.createElement("script");n.type="importmap",n.textContent=JSON.stringify({imports:r}),document.head.append(n)}return o}async importModule(t){let o=this.importing.then(()=>this.materialize(t));this.importing=o.catch(()=>{});let r=await o;for(let n of r){if(this.records.get(n).mimeType!=="text/css")continue;if(this.styles.has(n)){await this.styleReady.get(n);continue}let i=document.createElement("link");i.rel="stylesheet",i.href=this.urls.get(n),this.styles.set(n,i);let c=new Promise((l,u)=>{i.onload=l,i.onerror=()=>u(new Error("The host CSP blocked a preview stylesheet."))});this.styleReady.set(n,c),document.head.append(i);try{await c}catch(l){throw i.remove(),this.styles.delete(n),this.styleReady.delete(n),l}}try{return await import(t)}catch(n){throw new Error(`Preview module import failed for ${t}: ${n.message}. Inspect the App resource bridge, browser network/CSP diagnostics and current build.`,{cause:n})}}async mount(t,o,r){let n=++this.generation;this.register(t);let s=t.scenarios.find(l=>l.id===o);if(!s)throw new Error("The selected scenario is no longer registered.");let i=await this.importModule(s.module);if(n!==this.generation||(await this.unmount?.(),n!==this.generation||this.closed))return!1;r.replaceChildren();let c=new Set(this.closure(s.module));for(let[l,u]of this.styles)c.has(l)||(u.remove(),this.styles.delete(l),this.styleReady.delete(l));for(let l of this.closure(s.module))this.styles.has(l)&&document.head.append(this.styles.get(l));if(typeof i.mount!="function")throw new Error("The compiled scenario has no mount adapter.");if(this.unmount=i.mount(r),typeof this.unmount!="function")throw new Error("The scenario mount adapter must return an unmount callback.");return!0}async dispose(){if(!this.closed){this.closed=!0,++this.generation,await this.unmount?.();for(let t of this.styles.values())t.remove();for(let t of this.urls.values())URL.revokeObjectURL(t);this.styles.clear(),this.styleReady.clear(),this.urls.clear(),this.bytes.clear(),this.records.clear(),delete globalThis.__dsPreviewImport}}};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 T_(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 k_(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(u=>`${u.token}:${u.property}`));for(let u of c)l.has(`${u.dataset.adsToken}:${u.dataset.adsProperty}`)||s.push(`Undeclared rendered token sample ${u.dataset.adsToken}:${u.dataset.adsProperty}.`);for(let u of t){if(!r.CSS.supports(u.property,u.probe)){s.push(`${u.token}: the fixture probe is invalid for ${u.property}.`);continue}let m=r.getComputedStyle(n).getPropertyValue(u.token).trim();if(!m||!r.CSS.supports(u.property,m)){s.push(`${u.token}: its current value is invalid for the fixture's ${u.property} binding.`);continue}let S=c.filter(y=>y.dataset.adsToken===u.token&&y.dataset.adsProperty===u.property);if(!S.length){s.push(`${u.token} needs a rendered ${u.property} sample, not only a name/value label.`);continue}let _=!1;for(let y of S){let P=[];for(let q=y.parentElement;q&&q!==e;q=q.parentElement)q.tagName==="DETAILS"&&!q.open&&(q.open=!0,P.push(q));let E=n.getAttribute("style"),C=y.getAttribute("style");try{y.style.setProperty("transition","none","important");let q=r.getComputedStyle(y).getPropertyValue(u.property),J=T_(y,r);n.style.setProperty(u.token,u.probe,"important");let L=r.getComputedStyle(y).getPropertyValue(u.property);_=!!(L&&L!==q&&(J||T_(y,r)))}finally{E===null?n.removeAttribute("style"):n.setAttribute("style",E),C===null?y.removeAttribute("style"):y.setAttribute("style",C);for(let q of P)q.open=!1}if(_)break}_?i.push(u):s.push(`${u.token} has no visible ${u.property} sample that responds to its value. Hardcoded copies do not satisfy coverage.`)}return{ok:!s.length,verified:i,diagnostics:s}}var We=new Jl({name:"ADS resource preview",version:"1.0.0"},{},{autoResize:!0}),E_=document.getElementById("root"),bf=document.getElementById("ads-preview-status"),zf=async e=>{if(!We.getHostCapabilities()?.serverResources)throw new Error("This host does not forward MCP resource reads. Open the same preview in the ADS showcase.");try{return await We.readServerResource({uri:e},{timeout:15e3})}catch(t){throw t.code===-32601||t.message==="Method not found"?new Error("This host does not forward MCP resource reads. Open the same preview in the ADS showcase."):t}},Gl=new Bl(zf),Hr,Vr,$_,Rf,vf=!1,zo=0,ha={},Be="";function Mt(e,t=!1){bf.textContent=e,bf.hidden=!e,bf.setAttribute("role",t?"alert":"status")}async function Wl(e,t={}){try{We.getHostCapabilities()?.logging&&await We.sendLog({level:e==="error"?"error":"info",logger:"ads-preview",data:{state:e,id:Hr,...t}})}catch{}}function C_(e){ha={...ha,...e,styles:{...ha.styles,...e.styles}},["light","dark"].includes(ha.theme)&&(document.documentElement.dataset.theme=ha.theme)}async function I_(){let e;try{e=await zf("ads://preview/manifest")}catch(t){throw Object.assign(new Error(t.message,{cause:t}),{code:"ADS_MANIFEST_READ",category:"transport"})}return JSON.parse(e.contents.find(t=>typeof t.text=="string").text)}async function wf(e,t){if(e===Hr&&t&&t===Vr){Mt(Be,!!Be),await Wl(Be?"error":"ready",Be?{message:Be}:{revision:Vr});return}let o=++zo;++Gl.generation,Hr=e,document.documentElement.dataset.adsScenario=e,document.documentElement.dataset.adsPreviewState="loading";for(let r of["adsPreviewErrorCategory","adsPreviewErrorCode","adsPreviewResourceUri"])delete document.documentElement.dataset[r];Be="",Mt(""),await Wl("loading");try{let r=await I_();if(t&&r.revision!==t)throw new Error("Preview changed while opening. Select it again to use the current build.");if(o!==zo||!await Gl.mount(r,e,E_)||o!==zo||(Vr=r.revision,$_=r.session,await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i))),await document.fonts.ready,o!==zo))return;let s=r.scenarios.find(i=>i.id===e);if(s?.kind==="tokens"){let i=k_(E_,s.samples);if(!i.ok)throw Be=`Token preview verification failed:
|
|
104
104
|
${i.diagnostics.slice(0,20).join(`
|
|
105
|
-
`)}`,new Error(Be)}o===
|
|
106
|
-
${o}`:"Rebuilding. This is the previous preview.",!!o)}else{let o=await I_();o.revision!==
|
|
105
|
+
`)}`,Object.assign(new Error(Be),{code:"ADS_TOKEN_SAMPLE",category:"assertion"})}o===zo&&(document.documentElement.dataset.adsPreviewRevision=Vr,document.documentElement.dataset.adsPreviewState="ready",Mt(""),await Wl("ready",{revision:Vr}))}catch(r){o===zo&&(document.documentElement.dataset.adsPreviewState="error",document.documentElement.dataset.adsPreviewErrorCategory=r.category??"runner",document.documentElement.dataset.adsPreviewErrorCode=r.code??"ADS_PREVIEW_STARTUP",r.resourceUri&&(document.documentElement.dataset.adsPreviewResourceUri=r.resourceUri),Mt(r.message,!0),await Wl("error",{message:r.message,...r.code?{code:r.code}:{}}))}}async function Gz(){if(!(!Hr||vf||document.visibilityState==="hidden")){vf=!0;try{let t=JSON.parse((await zf("ads://project/build")).contents.find(o=>typeof o.text=="string").text).previews.find(o=>o.id===Hr);if(!t||!t.current){let o=t?.diagnostics?.[0]?.message;Mt(o?`Build failed. Showing the previous preview.
|
|
106
|
+
${o}`:"Rebuilding. This is the previous preview.",!!o)}else{let o=await I_();o.revision!==Vr||o.session!==$_?await wf(Hr):Mt(Be,!!Be)}}catch(e){Mt(`Preview freshness unavailable: ${e.message}`,!0)}finally{vf=!1}}}We.ontoolresult=e=>{let t=e.structuredContent;t?.scenario?.id&&wf(t.scenario.id,t.manifestRevision)};We.onhostcontextchanged=C_;We.onteardown=async()=>(++zo,clearInterval(Rf),await Gl.dispose(),{});try{if(await We.connect(),C_(We.getHostContext()??{}),!We.getHostCapabilities()?.serverResources)throw new Error("This host does not forward MCP resource reads. Open the same preview in the ADS showcase.");Rf=setInterval(()=>{Gz()},2e3);let e=document.getElementById("ads-preview-selection");e&&wf(JSON.parse(e.textContent).id)}catch(e){Mt(e.message,!0)}window.addEventListener("pagehide",()=>{clearInterval(Rf),Gl.dispose()},{once:!0});
|
|
107
107
|
/*! Bundled license information:
|
|
108
108
|
|
|
109
109
|
@modelcontextprotocol/client/dist/src-WCy6ifGf.mjs:
|