@reqvire-org/ads 0.3.28 → 0.3.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atomic-composition.mjs +2 -1
- package/dist/behaviors.mjs +2 -2
- package/dist/boundaries.mjs +6 -3
- package/dist/check.mjs +3 -0
- package/dist/cli.mjs +13 -0
- package/dist/config.mjs +5 -3
- package/dist/mcp/build-status.mjs +17 -4
- package/dist/mcp/context.mjs +2 -1
- package/dist/mcp/execution-results.mjs +4 -3
- package/dist/mcp/mutations.mjs +5 -43
- package/dist/mcp/preview-watch.mjs +23 -3
- package/dist/mcp/preview-widget.bundle.js +16 -15
- package/dist/mcp/resource-loader.js +40 -12
- package/dist/mcp/server.mjs +74 -36
- package/dist/oxlint.mjs +6 -1
- package/dist/preview-builder.mjs +10 -4
- package/dist/preview-resources.mjs +11 -4
- package/dist/preview-scope.mjs +6 -0
- package/dist/preview-workers.mjs +184 -0
- package/dist/scenario-inspector.mjs +34 -0
- package/dist/scenario-trace.mjs +3 -2
- package/dist/scenarios-compiler.mjs +200 -25
- package/dist/showcase/client.bundle.js +22 -21
- package/dist/showcase/index.html +2 -2
- package/dist/showcase/style.css +2 -1
- package/dist/skills/ads-break-ui/SKILL.md +3 -0
- package/dist/skills/ads-break-ui/references/runtimes.md +31 -0
- package/dist/skills/ads-break-ui/references/validation.md +53 -0
- package/dist/skills/ads-designer/SKILL.md +3 -0
- package/dist/skills/ads-designer/references/runtimes.md +31 -0
- package/dist/skills/ads-designer/references/validation.md +53 -0
- package/dist/skills/ads-import/SKILL.md +3 -0
- package/dist/skills/ads-import/references/runtimes.md +31 -0
- package/dist/skills/ads-import/references/validation.md +53 -0
- package/dist/skills/ads-motion/SKILL.md +3 -0
- package/dist/skills/ads-motion/references/runtimes.md +31 -0
- package/dist/skills/ads-motion/references/validation.md +53 -0
- package/dist/skills/ads-port/SKILL.md +3 -0
- package/dist/skills/ads-port/references/runtimes.md +31 -0
- package/dist/skills/ads-port/references/validation.md +53 -0
- package/dist/source-symbols.mjs +11 -0
- package/dist/source-values.mjs +10 -3
- package/dist/test-boundaries.mjs +95 -0
- package/dist/ui-framework.mjs +2 -1
- package/dist/units.mjs +12 -1
- package/dist/validation-checks.mjs +50 -0
- package/dist/validation.mjs +172 -0
- package/dist/verification/browser.mjs +3 -1
- package/dist/verification.mjs +1 -0
- package/docs/ARCHITECTURE.md +72 -17
- package/docs/CHANGELOG.md +37 -0
- package/docs/MCP.md +68 -9
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var M_=Object.defineProperty;var Xe=(e,t)=>{for(var o in t)M_(e,o,{get:t[o],enumerable:!0})};var A_=Object.create,Ia=Object.defineProperty,q_=Object.getOwnPropertyDescriptor,j_=Object.getOwnPropertyNames,L_=Object.getPrototypeOf,U_=Object.prototype.hasOwnProperty,Tf=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),kf=(e,t)=>{let o={};for(var r in e)Ia(o,r,{get:e[r],enumerable:!0});return t&&Ia(o,Symbol.toStringTag,{value:"Module"}),o},Z_=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=j_(t),s=0,i=n.length,c;s<i;s++)c=n[s],!U_.call(e,c)&&c!==o&&Ia(e,c,{get:(l=>t[l]).bind(null,c),enumerable:!(r=q_(t,c))||r.enumerable});return e},Ef=(e,t,o)=>(o=e!=null?A_(L_(e)):{},Z_(t||!e||!e.__esModule?Ia(o,"default",{value:e,enumerable:!0}):o,e));var D_=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]);function $f(e){return typeof e=="string"&&D_.has(e.replace(/#$/,""))}var d={};Xe(d,{$brand:()=>Ql,$input:()=>bp,$output:()=>yp,NEVER:()=>Dn,TimePrecision:()=>Rp,ZodAny:()=>lm,ZodArray:()=>hm,ZodBase64:()=>sl,ZodBase64URL:()=>il,ZodBigInt:()=>gr,ZodBigIntFormat:()=>ll,ZodBoolean:()=>fr,ZodCIDRv4:()=>rl,ZodCIDRv6:()=>nl,ZodCUID:()=>Kc,ZodCUID2:()=>Yc,ZodCatch:()=>Om,ZodCodec:()=>Ss,ZodCustom:()=>_s,ZodCustomStringFormat:()=>hr,ZodDate:()=>hs,ZodDefault:()=>Tm,ZodDiscriminatedUnion:()=>fm,ZodE164:()=>al,ZodEmail:()=>Jc,ZodEmoji:()=>Gc,ZodEnum:()=>ur,ZodError:()=>Rb,ZodExactOptional:()=>Rm,ZodFile:()=>zm,ZodFirstPartyTypeKind:()=>Fm,ZodFunction:()=>Dm,ZodGUID:()=>ls,ZodIPv4:()=>tl,ZodIPv6:()=>ol,ZodISODate:()=>Uc,ZodISODateTime:()=>Lc,ZodISODuration:()=>Dc,ZodISOTime:()=>Zc,ZodIntersection:()=>gm,ZodIssueCode:()=>Jm,ZodJWT:()=>cl,ZodKSUID:()=>el,ZodLazy:()=>Um,ZodLiteral:()=>vm,ZodMAC:()=>sm,ZodMap:()=>ym,ZodNaN:()=>Mm,ZodNanoID:()=>Wc,ZodNever:()=>dm,ZodNonOptional:()=>ml,ZodNull:()=>cm,ZodNullable:()=>Pm,ZodNumber:()=>mr,ZodNumberFormat:()=>no,ZodObject:()=>ms,ZodOptional:()=>hl,ZodPipe:()=>gs,ZodPrefault:()=>Em,ZodPreprocess:()=>Am,ZodPromise:()=>Zm,ZodReadonly:()=>qm,ZodRealError:()=>ve,ZodRecord:()=>lr,ZodSet:()=>bm,ZodString:()=>dr,ZodStringFormat:()=>J,ZodSuccess:()=>Im,ZodSymbol:()=>im,ZodTemplateLiteral:()=>Lm,ZodTransform:()=>wm,ZodTuple:()=>Sm,ZodType:()=>q,ZodULID:()=>Qc,ZodURL:()=>ps,ZodUUID:()=>De,ZodUndefined:()=>am,ZodUnion:()=>fs,ZodUnknown:()=>um,ZodVoid:()=>pm,ZodXID:()=>Xc,ZodXor:()=>mm,_ZodString:()=>Fc,_default:()=>km,_function:()=>pS,any:()=>ul,array:()=>g,base64:()=>Cg,base64url:()=>Ig,bigint:()=>Vg,boolean:()=>R,catch:()=>Nm,check:()=>hS,cidrv4:()=>Eg,cidrv6:()=>$g,clone:()=>me,codec:()=>cS,coerce:()=>ys,config:()=>Q,core:()=>ot,cuid:()=>vg,cuid2:()=>zg,custom:()=>mS,date:()=>Wg,decode:()=>Qh,decodeAsync:()=>em,describe:()=>fS,discriminatedUnion:()=>Pt,e164:()=>Og,email:()=>Bc,emoji:()=>yg,encode:()=>Yh,encodeAsync:()=>Xh,endsWith:()=>er,enum:()=>I,exactOptional:()=>xm,file:()=>nS,flattenError:()=>Kn,float32:()=>Lg,float64:()=>Ug,formatError:()=>Yn,fromJSONSchema:()=>vS,function:()=>pS,getErrorMap:()=>Tb,globalRegistry:()=>ne,gt:()=>Ue,gte:()=>ge,guid:()=>hg,hash:()=>jg,hex:()=>qg,hostname:()=>Ag,httpUrl:()=>_g,includes:()=>Qo,instanceof:()=>SS,int:()=>Vc,int32:()=>Zg,int64:()=>Hg,intersection:()=>Me,invertCodec:()=>lS,ipv4:()=>Pg,ipv6:()=>kg,iso:()=>Pe,json:()=>yS,jwt:()=>Ng,keyof:()=>Kg,ksuid:()=>xg,lazy:()=>Tt,length:()=>oo,literal:()=>S,locales:()=>ns,looseObject:()=>C,looseRecord:()=>eS,lowercase:()=>Ko,lt:()=>Le,lte:()=>xe,mac:()=>Tg,map:()=>tS,maxLength:()=>to,maxSize:()=>zt,meta:()=>gS,mime:()=>tr,minLength:()=>tt,minSize:()=>Ze,multipleOf:()=>vt,nan:()=>aS,nanoid:()=>bg,nativeEnum:()=>rS,negative:()=>$c,never:()=>dl,nonnegative:()=>Ic,nonoptional:()=>Cm,nonpositive:()=>Cc,normalize:()=>or,null:()=>Ve,nullable:()=>us,nullish:()=>sS,number:()=>b,object:()=>p,optional:()=>$,overwrite:()=>Ne,parse:()=>Gh,parseAsync:()=>Wh,partialRecord:()=>Xg,pipe:()=>Hc,positive:()=>Ec,prefault:()=>$m,preprocess:()=>rt,prettifyError:()=>pu,promise:()=>dS,property:()=>Oc,readonly:()=>jm,record:()=>w,refine:()=>Vm,regex:()=>Wo,regexes:()=>Re,registry:()=>cc,safeDecode:()=>om,safeDecodeAsync:()=>nm,safeEncode:()=>tm,safeEncodeAsync:()=>rm,safeParse:()=>cs,safeParseAsync:()=>Kh,set:()=>oS,setErrorMap:()=>Pb,size:()=>eo,slugify:()=>ir,startsWith:()=>Xo,strictObject:()=>Yg,string:()=>a,stringFormat:()=>Mg,stringbool:()=>_S,success:()=>iS,superRefine:()=>Hm,symbol:()=>Jg,templateLiteral:()=>uS,toJSONSchema:()=>ro,toLowerCase:()=>nr,toUpperCase:()=>sr,transform:()=>pl,treeifyError:()=>du,trim:()=>rr,tuple:()=>_m,uint32:()=>Dg,uint64:()=>Fg,ulid:()=>wg,undefined:()=>Bg,union:()=>P,unknown:()=>E,uppercase:()=>Yo,url:()=>pr,util:()=>N,uuid:()=>mg,uuidv4:()=>fg,uuidv6:()=>gg,uuidv7:()=>Sg,void:()=>Gg,xid:()=>Rg,xor:()=>Qg});var ot={};Xe(ot,{$ZodAny:()=>Zd,$ZodArray:()=>Jd,$ZodAsyncError:()=>Oe,$ZodBase64:()=>Cd,$ZodBase64URL:()=>Id,$ZodBigInt:()=>oc,$ZodBigIntFormat:()=>qd,$ZodBoolean:()=>ts,$ZodCIDRv4:()=>kd,$ZodCIDRv6:()=>Ed,$ZodCUID:()=>gd,$ZodCUID2:()=>Sd,$ZodCatch:()=>up,$ZodCheck:()=>B,$ZodCheckBigIntFormat:()=>Ju,$ZodCheckEndsWith:()=>nd,$ZodCheckGreaterThan:()=>Ka,$ZodCheckIncludes:()=>od,$ZodCheckLengthEquals:()=>Qu,$ZodCheckLessThan:()=>Wa,$ZodCheckLowerCase:()=>ed,$ZodCheckMaxLength:()=>Ku,$ZodCheckMaxSize:()=>Bu,$ZodCheckMimeType:()=>id,$ZodCheckMinLength:()=>Yu,$ZodCheckMinSize:()=>Gu,$ZodCheckMultipleOf:()=>Hu,$ZodCheckNumberFormat:()=>Fu,$ZodCheckOverwrite:()=>ad,$ZodCheckProperty:()=>sd,$ZodCheckRegex:()=>Xu,$ZodCheckSizeEquals:()=>Wu,$ZodCheckStartsWith:()=>rd,$ZodCheckStringFormat:()=>Go,$ZodCheckUpperCase:()=>td,$ZodCodec:()=>rs,$ZodCustom:()=>_p,$ZodCustomStringFormat:()=>Md,$ZodDate:()=>Fd,$ZodDefault:()=>ip,$ZodDiscriminatedUnion:()=>Wd,$ZodE164:()=>Od,$ZodEmail:()=>pd,$ZodEmoji:()=>md,$ZodEncodeError:()=>gt,$ZodEnum:()=>ep,$ZodError:()=>Wn,$ZodExactOptional:()=>np,$ZodFile:()=>op,$ZodFunction:()=>fp,$ZodGUID:()=>ud,$ZodIPv4:()=>xd,$ZodIPv6:()=>Pd,$ZodISODate:()=>zd,$ZodISODateTime:()=>vd,$ZodISODuration:()=>Rd,$ZodISOTime:()=>wd,$ZodIntersection:()=>Kd,$ZodJWT:()=>Nd,$ZodKSUID:()=>bd,$ZodLazy:()=>Sp,$ZodLiteral:()=>tp,$ZodMAC:()=>Td,$ZodMap:()=>Qd,$ZodNaN:()=>dp,$ZodNanoID:()=>fd,$ZodNever:()=>Vd,$ZodNonOptional:()=>cp,$ZodNull:()=>Ud,$ZodNullable:()=>sp,$ZodNumber:()=>tc,$ZodNumberFormat:()=>Ad,$ZodObject:()=>ag,$ZodObjectJIT:()=>Bd,$ZodOptional:()=>nc,$ZodPipe:()=>sc,$ZodPrefault:()=>ap,$ZodPreprocess:()=>pp,$ZodPromise:()=>gp,$ZodReadonly:()=>hp,$ZodRealError:()=>be,$ZodRecord:()=>Yd,$ZodRegistry:()=>ac,$ZodSet:()=>Xd,$ZodString:()=>Xt,$ZodStringFormat:()=>F,$ZodSuccess:()=>lp,$ZodSymbol:()=>jd,$ZodTemplateLiteral:()=>mp,$ZodTransform:()=>rp,$ZodTuple:()=>rc,$ZodType:()=>M,$ZodULID:()=>_d,$ZodURL:()=>hd,$ZodUUID:()=>dd,$ZodUndefined:()=>Ld,$ZodUnion:()=>os,$ZodUnknown:()=>Dd,$ZodVoid:()=>Hd,$ZodXID:()=>yd,$ZodXor:()=>Gd,$brand:()=>Ql,$constructor:()=>m,$input:()=>bp,$output:()=>yp,Doc:()=>es,JSONSchema:()=>ug,JSONSchemaGenerator:()=>qc,NEVER:()=>Dn,TimePrecision:()=>Rp,_any:()=>Fp,_array:()=>Qp,_base64:()=>xc,_base64url:()=>Pc,_bigint:()=>jp,_boolean:()=>Ap,_catch:()=>gb,_check:()=>lg,_cidrv4:()=>wc,_cidrv6:()=>Rc,_coercedBigint:()=>Lp,_coercedBoolean:()=>qp,_coercedDate:()=>Kp,_coercedNumber:()=>$p,_coercedString:()=>zp,_cuid:()=>gc,_cuid2:()=>Sc,_custom:()=>eh,_date:()=>Wp,_decode:()=>Ua,_decodeAsync:()=>Da,_default:()=>hb,_discriminatedUnion:()=>tb,_e164:()=>Tc,_email:()=>lc,_emoji:()=>mc,_encode:()=>La,_encodeAsync:()=>Za,_endsWith:()=>er,_enum:()=>ab,_file:()=>Xp,_float32:()=>Ip,_float64:()=>Op,_gt:()=>Ue,_gte:()=>ge,_guid:()=>ss,_includes:()=>Qo,_int:()=>Cp,_int32:()=>Np,_int64:()=>Up,_intersection:()=>ob,_ipv4:()=>vc,_ipv6:()=>zc,_isoDate:()=>Pp,_isoDateTime:()=>xp,_isoDuration:()=>kp,_isoTime:()=>Tp,_jwt:()=>kc,_ksuid:()=>bc,_lazy:()=>bb,_length:()=>oo,_literal:()=>lb,_lowercase:()=>Ko,_lt:()=>Le,_lte:()=>xe,_mac:()=>wp,_map:()=>sb,_max:()=>xe,_maxLength:()=>to,_maxSize:()=>zt,_mime:()=>tr,_min:()=>ge,_minLength:()=>tt,_minSize:()=>Ze,_multipleOf:()=>vt,_nan:()=>Yp,_nanoid:()=>fc,_nativeEnum:()=>cb,_negative:()=>$c,_never:()=>Bp,_nonnegative:()=>Ic,_nonoptional:()=>mb,_nonpositive:()=>Cc,_normalize:()=>or,_null:()=>Hp,_nullable:()=>pb,_number:()=>Ep,_optional:()=>db,_overwrite:()=>Ne,_parse:()=>Ho,_parseAsync:()=>Fo,_pipe:()=>Sb,_positive:()=>Ec,_promise:()=>vb,_property:()=>Oc,_readonly:()=>_b,_record:()=>nb,_refine:()=>th,_regex:()=>Wo,_safeDecode:()=>Ha,_safeDecodeAsync:()=>Ja,_safeEncode:()=>Va,_safeEncodeAsync:()=>Fa,_safeParse:()=>Jo,_safeParseAsync:()=>Bo,_set:()=>ib,_size:()=>eo,_slugify:()=>ir,_startsWith:()=>Xo,_string:()=>vp,_stringFormat:()=>ar,_stringbool:()=>sh,_success:()=>fb,_superRefine:()=>oh,_symbol:()=>Dp,_templateLiteral:()=>yb,_toLowerCase:()=>nr,_toUpperCase:()=>sr,_transform:()=>ub,_trim:()=>rr,_tuple:()=>rb,_uint32:()=>Mp,_uint64:()=>Zp,_ulid:()=>_c,_undefined:()=>Vp,_union:()=>Xy,_unknown:()=>Jp,_uppercase:()=>Yo,_url:()=>is,_uuid:()=>uc,_uuidv4:()=>dc,_uuidv6:()=>pc,_uuidv7:()=>hc,_void:()=>Gp,_xid:()=>yc,_xor:()=>eb,clone:()=>me,config:()=>Q,createStandardJSONSchemaMethod:()=>cr,createToJSONSchemaMethod:()=>ih,decode:()=>gy,decodeAsync:()=>_y,describe:()=>rh,encode:()=>fy,encodeAsync:()=>Sy,extractDefs:()=>Rt,finalize:()=>xt,flattenError:()=>Kn,formatError:()=>Yn,globalConfig:()=>Kt,globalRegistry:()=>ne,initializeContext:()=>wt,isValidBase64:()=>$d,isValidBase64URL:()=>rg,isValidJWT:()=>ng,locales:()=>ns,meta:()=>nh,parse:()=>qa,parseAsync:()=>ja,prettifyError:()=>pu,process:()=>H,regexes:()=>Re,registry:()=>cc,safeDecode:()=>by,safeDecodeAsync:()=>zy,safeEncode:()=>yy,safeEncodeAsync:()=>vy,safeParse:()=>hu,safeParseAsync:()=>mu,toDotPath:()=>Af,toJSONSchema:()=>ro,treeifyError:()=>du,util:()=>N,version:()=>cd});var Cf,Dn=Object.freeze({status:"aborted"});function m(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,h=Object.keys(u);for(let f=0;f<h.length;f++){let y=h[f];y in c||(c[y]=u[y].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 h of u._zod.deferred)h();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 Ql=Symbol("zod_brand"),Oe=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"}};(Cf=globalThis).__zod_globalConfig??(Cf.__zod_globalConfig={});var Kt=globalThis.__zod_globalConfig;function Q(e){return e&&Object.assign(Kt,e),Kt}var N={};Xe(N,{BIGINT_FORMAT_RANGES:()=>cu,Class:()=>eu,NUMBER_FORMAT_RANGES:()=>au,aborted:()=>bt,allowsEval:()=>ru,assert:()=>B_,assertEqual:()=>V_,assertIs:()=>F_,assertNever:()=>J_,assertNotEqual:()=>H_,assignProp:()=>_t,base64ToUint8Array:()=>Of,base64urlToUint8Array:()=>uy,cached:()=>Do,captureStackTrace:()=>Ma,cleanEnum:()=>ly,cleanRegex:()=>Fn,clone:()=>me,cloneDef:()=>W_,createTransparentProxy:()=>ty,defineLazy:()=>L,esc:()=>Na,escapeRegex:()=>$e,explicitlyAborted:()=>lu,extend:()=>ny,finalizeIssue:()=>fe,floatSafeRemainder:()=>tu,getElementAtPath:()=>K_,getEnumValues:()=>Hn,getLengthableOrigin:()=>Gn,getParsedType:()=>ey,getSizableOrigin:()=>Bn,hexToUint8Array:()=>py,isObject:()=>Yt,isPlainObject:()=>yt,issue:()=>Vo,joinValues:()=>Oa,jsonStringifyReplacer:()=>Zo,merge:()=>iy,mergeDefs:()=>et,normalizeParams:()=>v,nullish:()=>St,numKeys:()=>X_,objectClone:()=>G_,omit:()=>ry,optionalKeys:()=>iu,parsedType:()=>uu,partial:()=>ay,pick:()=>oy,prefixIssues:()=>ye,primitiveTypes:()=>su,promiseAllObject:()=>Y_,propertyKeyTypes:()=>Jn,randomString:()=>Q_,required:()=>cy,safeExtend:()=>sy,shallowClone:()=>nu,slugify:()=>ou,stringifyPrimitive:()=>Aa,uint8ArrayToBase64:()=>Nf,uint8ArrayToBase64url:()=>dy,uint8ArrayToHex:()=>hy,unwrapMessage:()=>Vn});function V_(e){return e}function H_(e){return e}function F_(e){}function J_(e){throw new Error("Unexpected value in exhaustive check")}function B_(e){}function Hn(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 Oa(e,t="|"){return e.map(o=>Aa(o)).join(t)}function Zo(e,t){return typeof t=="bigint"?t.toString():t}function Do(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 Fn(e){let t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function tu(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 If=Symbol("evaluating");function L(e,t,o){let r;Object.defineProperty(e,t,{get(){if(r!==If)return r===void 0&&(r=If,r=o()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function G_(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 et(...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 et(e._zod.def)}function K_(e,t){return t?t.reduce((o,r)=>o?.[r],e):e}function Y_(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 Q_(e=10){let t="abcdefghijklmnopqrstuvwxyz",o="";for(let r=0;r<e;r++)o+=t[Math.floor(Math.random()*t.length)];return o}function Na(e){return JSON.stringify(e)}function ou(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ma="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ru=Do(()=>{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 nu(e){return yt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function X_(e){let t=0;for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&t++;return t}var ey=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}`)}},Jn=new Set(["string","number","symbol"]),su=new Set(["string","number","bigint","boolean","symbol","undefined"]);function $e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function me(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 ty(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 Aa(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function iu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var au={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]},cu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function oy(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=et(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 me(e,s)}function ry(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=et(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 me(e,s)}function ny(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=et(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return _t(this,"shape",s),s}});return me(e,n)}function sy(e,t){if(!yt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let o=et(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return _t(this,"shape",r),r}});return me(e,o)}function iy(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=et(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 me(e,o)}function ay(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=et(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 me(t,i)}function cy(e,t,o){let r=et(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 me(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 lu(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 ye(e,t){return t.map(o=>{var r;return(r=o).path??(r.path=[]),o.path.unshift(e),o})}function Vn(e){return typeof e=="string"?e:e?.message}function fe(e,t,o){let r=e.message?e.message:Vn(e.inst?._zod.def?.error?.(e))??Vn(t?.error?.(e))??Vn(o.customError?.(e))??Vn(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 Bn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Gn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function uu(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 Vo(...e){let[t,o,r]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:r}:{...t}}function ly(e){return Object.entries(e).filter(([t,o])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Of(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 Nf(e){let t="";for(let o=0;o<e.length;o++)t+=String.fromCharCode(e[o]);return btoa(t)}function uy(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-t.length%4)%4);return Of(t+o)}function dy(e){return Nf(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function py(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 hy(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var eu=class{constructor(...t){}};var Mf=(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,Zo,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Wn=m("$ZodError",Mf),be=m("$ZodError",Mf,{Parent:Error});function Kn(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 Yn(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 h=c[u];u===c.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(i))):l[h]=l[h]||{_errors:[]},l=l[h],u++}}}};return r(e),o}function du(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 h=o,f=0;for(;f<u.length;){let y=u[f],_=f===u.length-1;typeof y=="string"?(h.properties??(h.properties={}),(i=h.properties)[y]??(i[y]={errors:[]}),h=h.properties[y]):(h.items??(h.items=[]),(c=h.items)[y]??(c[y]={errors:[]}),h=h.items[y]),_&&h.errors.push(t(l)),f++}}};return r(e),o}function Af(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 pu(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 ${Af(r.path)}`);return t.join(`
|
|
2
|
-
`)}var Ho=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 Oe;if(i.issues.length){let c=new(n?.Err??e)(i.issues.map(l=>fe(l,s,Q())));throw Ma(c,n?.callee),c}return i.value},qa=Ho(be),Fo=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=>fe(l,s,Q())));throw Ma(c,n?.callee),c}return i.value},ja=Fo(be),Jo=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 Oe;return s.issues.length?{success:!1,error:new(e??Wn)(s.issues.map(i=>fe(i,n,Q())))}:{success:!0,data:s.value}},hu=Jo(be),Bo=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=>fe(i,n,Q())))}:{success:!0,data:s.value}},mu=Bo(be),La=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Ho(e)(t,o,n)},fy=La(be),Ua=e=>(t,o,r)=>Ho(e)(t,o,r),gy=Ua(be),Za=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Fo(e)(t,o,n)},Sy=Za(be),Da=e=>async(t,o,r)=>Fo(e)(t,o,r),_y=Da(be),Va=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Jo(e)(t,o,n)},yy=Va(be),Ha=e=>(t,o,r)=>Jo(e)(t,o,r),by=Ha(be),Fa=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Bo(e)(t,o,n)},vy=Fa(be),Ja=e=>async(t,o,r)=>Bo(e)(t,o,r),zy=Ja(be);var Re={};Xe(Re,{base64:()=>$u,base64url:()=>Ba,bigint:()=>qu,boolean:()=>Lu,browserEmail:()=>$y,cidrv4:()=>ku,cidrv6:()=>Eu,cuid:()=>fu,cuid2:()=>gu,date:()=>Ou,datetime:()=>Mu,domain:()=>Oy,duration:()=>vu,e164:()=>Iu,email:()=>wu,emoji:()=>Ru,extendedDuration:()=>wy,guid:()=>zu,hex:()=>Ny,hostname:()=>Iy,html5Email:()=>Ty,httpProtocol:()=>Cu,idnEmail:()=>Ey,integer:()=>ju,ipv4:()=>xu,ipv6:()=>Pu,ksuid:()=>yu,lowercase:()=>Du,mac:()=>Tu,md5_base64:()=>Ay,md5_base64url:()=>qy,md5_hex:()=>My,nanoid:()=>bu,null:()=>Uu,number:()=>Ga,rfc5322Email:()=>ky,sha1_base64:()=>Ly,sha1_base64url:()=>Uy,sha1_hex:()=>jy,sha256_base64:()=>Dy,sha256_base64url:()=>Vy,sha256_hex:()=>Zy,sha384_base64:()=>Fy,sha384_base64url:()=>Jy,sha384_hex:()=>Hy,sha512_base64:()=>Gy,sha512_base64url:()=>Wy,sha512_hex:()=>By,string:()=>Au,time:()=>Nu,ulid:()=>Su,undefined:()=>Zu,unicodeEmail:()=>qf,uppercase:()=>Vu,uuid:()=>Qt,uuid4:()=>Ry,uuid6:()=>xy,uuid7:()=>Py,xid:()=>_u});var fu=/^[cC][0-9a-z]{6,}$/,gu=/^[0-9a-z]+$/,Su=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,_u=/^[0-9a-vA-V]{20}$/,yu=/^[A-Za-z0-9]{27}$/,bu=/^[a-zA-Z0-9_-]{21}$/,vu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,wy=/^[-+]?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),xy=Qt(6),Py=Qt(7),wu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ty=/^[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])?)*$/,ky=/^(([^<>()\[\]\\.,;:\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,Ey=qf,$y=/^[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])?)*$/,Cy="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ru(){return new RegExp(Cy,"u")}var xu=/^(?:(?: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])$/,Pu=/^(([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}|:))$/,Tu=e=>{let t=$e(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},ku=/^((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])$/,Eu=/^(([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])$/,$u=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ba=/^[A-Za-z0-9_-]*$/,Iy=/^(?=.{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])?)*\.?$/,Oy=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Cu=/^https?$/,Iu=/^\+[1-9]\d{6,14}$/,jf="(?:(?:\\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])))",Ou=new RegExp(`^${jf}$`);function Lf(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 Nu(e){return new RegExp(`^${Lf(e)}$`)}function Mu(e){let t=Lf({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(`^${jf}T(?:${r})$`)}var Au=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},qu=/^-?\d+n?$/,ju=/^-?\d+$/,Ga=/^-?\d+(?:\.\d+)?$/,Lu=/^(?:true|false)$/i,Uu=/^null$/i;var Zu=/^undefined$/i;var Du=/^[^A-Z]*$/,Vu=/^[^a-z]*$/,Ny=/^[0-9a-fA-F]*$/;function Qn(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Xn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var My=/^[0-9a-fA-F]{32}$/,Ay=Qn(22,"=="),qy=Xn(22),jy=/^[0-9a-fA-F]{40}$/,Ly=Qn(27,"="),Uy=Xn(27),Zy=/^[0-9a-fA-F]{64}$/,Dy=Qn(43,"="),Vy=Xn(43),Hy=/^[0-9a-fA-F]{96}$/,Fy=Qn(64,""),Jy=Xn(64),By=/^[0-9a-fA-F]{128}$/,Gy=Qn(86,"=="),Wy=Xn(86);var B=m("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),Zf={number:"number",bigint:"bigint",object:"date"},Wa=m("$ZodCheckLessThan",(e,t)=>{B.init(e,t);let o=Zf[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})}}),Ka=m("$ZodCheckGreaterThan",(e,t)=>{B.init(e,t);let o=Zf[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})}}),Hu=m("$ZodCheckMultipleOf",(e,t)=>{B.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):tu(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})}}),Fu=m("$ZodCheckNumberFormat",(e,t)=>{B.init(e,t),t.format=t.format||"float64";let o=t.format?.includes("int"),r=o?"int":"number",[n,s]=au[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=ju)}),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})}}),Ju=m("$ZodCheckBigIntFormat",(e,t)=>{B.init(e,t);let[o,r]=cu[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})}}),Bu=m("$ZodCheckMaxSize",(e,t)=>{var o;B.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:Bn(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Gu=m("$ZodCheckMinSize",(e,t)=>{var o;B.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:Bn(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Wu=m("$ZodCheckSizeEquals",(e,t)=>{var o;B.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:Bn(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})}}),Ku=m("$ZodCheckMaxLength",(e,t)=>{var o;B.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=Gn(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Yu=m("$ZodCheckMinLength",(e,t)=>{var o;B.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=Gn(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Qu=m("$ZodCheckLengthEquals",(e,t)=>{var o;B.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=Gn(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})}}),Go=m("$ZodCheckStringFormat",(e,t)=>{var o,r;B.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=()=>{})}),Xu=m("$ZodCheckRegex",(e,t)=>{Go.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})}}),ed=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Du),Go.init(e,t)}),td=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Vu),Go.init(e,t)}),od=m("$ZodCheckIncludes",(e,t)=>{B.init(e,t);let o=$e(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})}}),rd=m("$ZodCheckStartsWith",(e,t)=>{B.init(e,t);let o=new RegExp(`^${$e(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})}}),nd=m("$ZodCheckEndsWith",(e,t)=>{B.init(e,t);let o=new RegExp(`.*${$e(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 Uf(e,t,o){e.issues.length&&t.issues.push(...ye(o,e.issues))}var sd=m("$ZodCheckProperty",(e,t)=>{B.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=>Uf(n,o,t.property));Uf(r,o,t.property)}}),id=m("$ZodCheckMimeType",(e,t)=>{B.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})}}),ad=m("$ZodCheckOverwrite",(e,t)=>{B.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});var es=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 Z_=Object.defineProperty;var Xe=(e,t)=>{for(var o in t)Z_(e,o,{get:t[o],enumerable:!0})};var D_=Object.create,Ma=Object.defineProperty,V_=Object.getOwnPropertyDescriptor,H_=Object.getOwnPropertyNames,F_=Object.getPrototypeOf,J_=Object.prototype.hasOwnProperty,Cf=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),If=(e,t)=>{let o={};for(var r in e)Ma(o,r,{get:e[r],enumerable:!0});return t&&Ma(o,Symbol.toStringTag,{value:"Module"}),o},B_=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=H_(t),s=0,i=n.length,c;s<i;s++)c=n[s],!J_.call(e,c)&&c!==o&&Ma(e,c,{get:(l=>t[l]).bind(null,c),enumerable:!(r=V_(t,c))||r.enumerable});return e},Of=(e,t,o)=>(o=e!=null?D_(F_(e)):{},B_(t||!e||!e.__esModule?Ma(o,"default",{value:e,enumerable:!0}):o,e));var G_=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]);function Nf(e){return typeof e=="string"&&G_.has(e.replace(/#$/,""))}var d={};Xe(d,{$brand:()=>eu,$input:()=>zp,$output:()=>vp,NEVER:()=>Vn,TimePrecision:()=>Pp,ZodAny:()=>dm,ZodArray:()=>fm,ZodBase64:()=>cl,ZodBase64URL:()=>ll,ZodBigInt:()=>yr,ZodBigIntFormat:()=>pl,ZodBoolean:()=>_r,ZodCIDRv4:()=>il,ZodCIDRv6:()=>al,ZodCUID:()=>Xc,ZodCUID2:()=>el,ZodCatch:()=>Mm,ZodCodec:()=>_s,ZodCustom:()=>ys,ZodCustomStringFormat:()=>gr,ZodDate:()=>ms,ZodDefault:()=>Em,ZodDiscriminatedUnion:()=>Sm,ZodE164:()=>ul,ZodEmail:()=>Wc,ZodEmoji:()=>Yc,ZodEnum:()=>hr,ZodError:()=>$b,ZodExactOptional:()=>Pm,ZodFile:()=>Rm,ZodFirstPartyTypeKind:()=>Bm,ZodFunction:()=>Hm,ZodGUID:()=>us,ZodIPv4:()=>nl,ZodIPv6:()=>sl,ZodISODate:()=>Vc,ZodISODateTime:()=>Dc,ZodISODuration:()=>Fc,ZodISOTime:()=>Hc,ZodIntersection:()=>_m,ZodIssueCode:()=>Gm,ZodJWT:()=>dl,ZodKSUID:()=>rl,ZodLazy:()=>Dm,ZodLiteral:()=>wm,ZodMAC:()=>am,ZodMap:()=>vm,ZodNaN:()=>qm,ZodNanoID:()=>Qc,ZodNever:()=>hm,ZodNonOptional:()=>Sl,ZodNull:()=>um,ZodNullable:()=>km,ZodNumber:()=>Sr,ZodNumberFormat:()=>so,ZodObject:()=>fs,ZodOptional:()=>gl,ZodPipe:()=>Ss,ZodPrefault:()=>Cm,ZodPreprocess:()=>jm,ZodPromise:()=>Vm,ZodReadonly:()=>Lm,ZodRealError:()=>ve,ZodRecord:()=>pr,ZodSet:()=>zm,ZodString:()=>mr,ZodStringFormat:()=>J,ZodSuccess:()=>Nm,ZodSymbol:()=>cm,ZodTemplateLiteral:()=>Zm,ZodTransform:()=>xm,ZodTuple:()=>ym,ZodType:()=>q,ZodULID:()=>tl,ZodURL:()=>hs,ZodUUID:()=>He,ZodUndefined:()=>lm,ZodUnion:()=>gs,ZodUnknown:()=>pm,ZodVoid:()=>mm,ZodXID:()=>ol,ZodXor:()=>gm,_ZodString:()=>Gc,_default:()=>$m,_function:()=>gS,any:()=>hl,array:()=>g,base64:()=>Mg,base64url:()=>Ag,bigint:()=>Bg,boolean:()=>R,catch:()=>Am,check:()=>SS,cidrv4:()=>Og,cidrv6:()=>Ng,clone:()=>me,codec:()=>pS,coerce:()=>bs,config:()=>Q,core:()=>ot,cuid:()=>xg,cuid2:()=>Pg,custom:()=>_S,date:()=>Xg,decode:()=>em,decodeAsync:()=>om,describe:()=>yS,discriminatedUnion:()=>kt,e164:()=>qg,email:()=>Kc,emoji:()=>wg,encode:()=>Xh,encodeAsync:()=>tm,endsWith:()=>rr,enum:()=>I,exactOptional:()=>Tm,file:()=>cS,flattenError:()=>Yn,float32:()=>Vg,float64:()=>Hg,formatError:()=>Qn,fromJSONSchema:()=>xS,function:()=>gS,getErrorMap:()=>Ob,globalRegistry:()=>ne,gt:()=>De,gte:()=>ge,guid:()=>Sg,hash:()=>Dg,hex:()=>Zg,hostname:()=>Ug,httpUrl:()=>zg,includes:()=>tr,instanceof:()=>vS,int:()=>Jc,int32:()=>Fg,int64:()=>Gg,intersection:()=>qe,invertCodec:()=>hS,ipv4:()=>$g,ipv6:()=>Ig,iso:()=>Pe,json:()=>wS,jwt:()=>jg,keyof:()=>eS,ksuid:()=>Eg,lazy:()=>Et,length:()=>ro,literal:()=>S,locales:()=>ss,looseObject:()=>C,looseRecord:()=>nS,lowercase:()=>Xo,lt:()=>Ze,lte:()=>xe,mac:()=>Cg,map:()=>sS,maxLength:()=>oo,maxSize:()=>Rt,meta:()=>bS,mime:()=>nr,minLength:()=>tt,minSize:()=>Ve,multipleOf:()=>wt,nan:()=>dS,nanoid:()=>Rg,nativeEnum:()=>aS,negative:()=>Oc,never:()=>ml,nonnegative:()=>Mc,nonoptional:()=>Om,nonpositive:()=>Nc,normalize:()=>sr,null:()=>Fe,nullable:()=>ds,nullish:()=>lS,number:()=>b,object:()=>p,optional:()=>$,overwrite:()=>Ae,parse:()=>Kh,parseAsync:()=>Yh,partialRecord:()=>rS,pipe:()=>Bc,positive:()=>Ic,prefault:()=>Im,preprocess:()=>rt,prettifyError:()=>mu,promise:()=>fS,property:()=>Ac,readonly:()=>Um,record:()=>w,refine:()=>Fm,regex:()=>Qo,regexes:()=>Re,registry:()=>dc,safeDecode:()=>nm,safeDecodeAsync:()=>im,safeEncode:()=>rm,safeEncodeAsync:()=>sm,safeParse:()=>ls,safeParseAsync:()=>Qh,set:()=>iS,setErrorMap:()=>Ib,size:()=>to,slugify:()=>lr,startsWith:()=>or,strictObject:()=>tS,string:()=>a,stringFormat:()=>Lg,stringbool:()=>zS,success:()=>uS,superRefine:()=>Jm,symbol:()=>Kg,templateLiteral:()=>mS,toJSONSchema:()=>no,toLowerCase:()=>ar,toUpperCase:()=>cr,transform:()=>fl,treeifyError:()=>hu,trim:()=>ir,tuple:()=>bm,uint32:()=>Jg,uint64:()=>Wg,ulid:()=>Tg,undefined:()=>Yg,union:()=>P,unknown:()=>E,uppercase:()=>er,url:()=>fr,util:()=>N,uuid:()=>_g,uuidv4:()=>yg,uuidv6:()=>bg,uuidv7:()=>vg,void:()=>Qg,xid:()=>kg,xor:()=>oS});var ot={};Xe(ot,{$ZodAny:()=>Vd,$ZodArray:()=>Gd,$ZodAsyncError:()=>Me,$ZodBase64:()=>Od,$ZodBase64URL:()=>Nd,$ZodBigInt:()=>sc,$ZodBigIntFormat:()=>Ld,$ZodBoolean:()=>os,$ZodCIDRv4:()=>$d,$ZodCIDRv6:()=>Cd,$ZodCUID:()=>_d,$ZodCUID2:()=>yd,$ZodCatch:()=>pp,$ZodCheck:()=>B,$ZodCheckBigIntFormat:()=>Gu,$ZodCheckEndsWith:()=>id,$ZodCheckGreaterThan:()=>Xa,$ZodCheckIncludes:()=>nd,$ZodCheckLengthEquals:()=>ed,$ZodCheckLessThan:()=>Qa,$ZodCheckLowerCase:()=>od,$ZodCheckMaxLength:()=>Qu,$ZodCheckMaxSize:()=>Wu,$ZodCheckMimeType:()=>cd,$ZodCheckMinLength:()=>Xu,$ZodCheckMinSize:()=>Ku,$ZodCheckMultipleOf:()=>Ju,$ZodCheckNumberFormat:()=>Bu,$ZodCheckOverwrite:()=>ld,$ZodCheckProperty:()=>ad,$ZodCheckRegex:()=>td,$ZodCheckSizeEquals:()=>Yu,$ZodCheckStartsWith:()=>sd,$ZodCheckStringFormat:()=>Yo,$ZodCheckUpperCase:()=>rd,$ZodCodec:()=>ns,$ZodCustom:()=>bp,$ZodCustomStringFormat:()=>qd,$ZodDate:()=>Bd,$ZodDefault:()=>cp,$ZodDiscriminatedUnion:()=>Yd,$ZodE164:()=>Md,$ZodEmail:()=>md,$ZodEmoji:()=>gd,$ZodEncodeError:()=>_t,$ZodEnum:()=>op,$ZodError:()=>Kn,$ZodExactOptional:()=>ip,$ZodFile:()=>np,$ZodFunction:()=>Sp,$ZodGUID:()=>pd,$ZodIPv4:()=>Td,$ZodIPv6:()=>kd,$ZodISODate:()=>Rd,$ZodISODateTime:()=>wd,$ZodISODuration:()=>Pd,$ZodISOTime:()=>xd,$ZodIntersection:()=>Qd,$ZodJWT:()=>Ad,$ZodKSUID:()=>zd,$ZodLazy:()=>yp,$ZodLiteral:()=>rp,$ZodMAC:()=>Ed,$ZodMap:()=>ep,$ZodNaN:()=>hp,$ZodNanoID:()=>Sd,$ZodNever:()=>Fd,$ZodNonOptional:()=>up,$ZodNull:()=>Dd,$ZodNullable:()=>ap,$ZodNumber:()=>nc,$ZodNumberFormat:()=>jd,$ZodObject:()=>dg,$ZodObjectJIT:()=>Wd,$ZodOptional:()=>ac,$ZodPipe:()=>cc,$ZodPrefault:()=>lp,$ZodPreprocess:()=>mp,$ZodPromise:()=>_p,$ZodReadonly:()=>fp,$ZodRealError:()=>be,$ZodRecord:()=>Xd,$ZodRegistry:()=>uc,$ZodSet:()=>tp,$ZodString:()=>eo,$ZodStringFormat:()=>F,$ZodSuccess:()=>dp,$ZodSymbol:()=>Ud,$ZodTemplateLiteral:()=>gp,$ZodTransform:()=>sp,$ZodTuple:()=>ic,$ZodType:()=>M,$ZodULID:()=>bd,$ZodURL:()=>fd,$ZodUUID:()=>hd,$ZodUndefined:()=>Zd,$ZodUnion:()=>rs,$ZodUnknown:()=>Hd,$ZodVoid:()=>Jd,$ZodXID:()=>vd,$ZodXor:()=>Kd,$brand:()=>eu,$constructor:()=>m,$input:()=>zp,$output:()=>vp,Doc:()=>ts,JSONSchema:()=>mg,JSONSchemaGenerator:()=>Uc,NEVER:()=>Vn,TimePrecision:()=>Pp,_any:()=>Bp,_array:()=>eh,_base64:()=>kc,_base64url:()=>Ec,_bigint:()=>Up,_boolean:()=>jp,_catch:()=>zb,_check:()=>hg,_cidrv4:()=>Pc,_cidrv6:()=>Tc,_coercedBigint:()=>Zp,_coercedBoolean:()=>Lp,_coercedDate:()=>Qp,_coercedNumber:()=>Ip,_coercedString:()=>Rp,_cuid:()=>yc,_cuid2:()=>bc,_custom:()=>oh,_date:()=>Yp,_decode:()=>Va,_decodeAsync:()=>Fa,_default:()=>yb,_discriminatedUnion:()=>ab,_e164:()=>$c,_email:()=>pc,_emoji:()=>Sc,_encode:()=>Da,_encodeAsync:()=>Ha,_endsWith:()=>rr,_enum:()=>hb,_file:()=>th,_float32:()=>Np,_float64:()=>Mp,_gt:()=>De,_gte:()=>ge,_guid:()=>is,_includes:()=>tr,_int:()=>Op,_int32:()=>Ap,_int64:()=>Dp,_intersection:()=>cb,_ipv4:()=>Rc,_ipv6:()=>xc,_isoDate:()=>kp,_isoDateTime:()=>Tp,_isoDuration:()=>$p,_isoTime:()=>Ep,_jwt:()=>Cc,_ksuid:()=>wc,_lazy:()=>Pb,_length:()=>ro,_literal:()=>fb,_lowercase:()=>Xo,_lt:()=>Ze,_lte:()=>xe,_mac:()=>xp,_map:()=>db,_max:()=>xe,_maxLength:()=>oo,_maxSize:()=>Rt,_mime:()=>nr,_min:()=>ge,_minLength:()=>tt,_minSize:()=>Ve,_multipleOf:()=>wt,_nan:()=>Xp,_nanoid:()=>_c,_nativeEnum:()=>mb,_negative:()=>Oc,_never:()=>Wp,_nonnegative:()=>Mc,_nonoptional:()=>bb,_nonpositive:()=>Nc,_normalize:()=>sr,_null:()=>Jp,_nullable:()=>_b,_number:()=>Cp,_optional:()=>Sb,_overwrite:()=>Ae,_parse:()=>Bo,_parseAsync:()=>Go,_pipe:()=>wb,_positive:()=>Ic,_promise:()=>Tb,_property:()=>Ac,_readonly:()=>Rb,_record:()=>ub,_refine:()=>rh,_regex:()=>Qo,_safeDecode:()=>Ba,_safeDecodeAsync:()=>Wa,_safeEncode:()=>Ja,_safeEncodeAsync:()=>Ga,_safeParse:()=>Wo,_safeParseAsync:()=>Ko,_set:()=>pb,_size:()=>to,_slugify:()=>lr,_startsWith:()=>or,_string:()=>wp,_stringFormat:()=>ur,_stringbool:()=>ah,_success:()=>vb,_superRefine:()=>nh,_symbol:()=>Hp,_templateLiteral:()=>xb,_toLowerCase:()=>ar,_toUpperCase:()=>cr,_transform:()=>gb,_trim:()=>ir,_tuple:()=>lb,_uint32:()=>qp,_uint64:()=>Vp,_ulid:()=>vc,_undefined:()=>Fp,_union:()=>sb,_unknown:()=>Gp,_uppercase:()=>er,_url:()=>as,_uuid:()=>hc,_uuidv4:()=>mc,_uuidv6:()=>fc,_uuidv7:()=>gc,_void:()=>Kp,_xid:()=>zc,_xor:()=>ib,clone:()=>me,config:()=>Q,createStandardJSONSchemaMethod:()=>dr,createToJSONSchemaMethod:()=>ch,decode:()=>zy,decodeAsync:()=>Ry,describe:()=>sh,encode:()=>vy,encodeAsync:()=>wy,extractDefs:()=>Pt,finalize:()=>Tt,flattenError:()=>Yn,formatError:()=>Qn,globalConfig:()=>Yt,globalRegistry:()=>ne,initializeContext:()=>xt,isValidBase64:()=>Id,isValidBase64URL:()=>ag,isValidJWT:()=>cg,locales:()=>ss,meta:()=>ih,parse:()=>Ua,parseAsync:()=>Za,prettifyError:()=>mu,process:()=>H,regexes:()=>Re,registry:()=>dc,safeDecode:()=>Py,safeDecodeAsync:()=>ky,safeEncode:()=>xy,safeEncodeAsync:()=>Ty,safeParse:()=>fu,safeParseAsync:()=>gu,toDotPath:()=>Uf,toJSONSchema:()=>no,treeifyError:()=>hu,util:()=>N,version:()=>ud});var Mf,Vn=Object.freeze({status:"aborted"});function m(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,h=Object.keys(u);for(let f=0;f<h.length;f++){let y=h[f];y in c||(c[y]=u[y].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 h of u._zod.deferred)h();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 eu=Symbol("zod_brand"),Me=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},_t=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Mf=globalThis).__zod_globalConfig??(Mf.__zod_globalConfig={});var Yt=globalThis.__zod_globalConfig;function Q(e){return e&&Object.assign(Yt,e),Yt}var N={};Xe(N,{BIGINT_FORMAT_RANGES:()=>uu,Class:()=>ou,NUMBER_FORMAT_RANGES:()=>lu,aborted:()=>zt,allowsEval:()=>su,assert:()=>X_,assertEqual:()=>W_,assertIs:()=>Y_,assertNever:()=>Q_,assertNotEqual:()=>K_,assignProp:()=>bt,base64ToUint8Array:()=>qf,base64urlToUint8Array:()=>gy,cached:()=>Fo,captureStackTrace:()=>ja,cleanEnum:()=>fy,cleanRegex:()=>Jn,clone:()=>me,cloneDef:()=>ty,createTransparentProxy:()=>ay,defineLazy:()=>L,esc:()=>qa,escapeRegex:()=>$e,explicitlyAborted:()=>du,extend:()=>uy,finalizeIssue:()=>fe,floatSafeRemainder:()=>ru,getElementAtPath:()=>oy,getEnumValues:()=>Fn,getLengthableOrigin:()=>Wn,getParsedType:()=>iy,getSizableOrigin:()=>Gn,hexToUint8Array:()=>_y,isObject:()=>Qt,isPlainObject:()=>vt,issue:()=>Jo,joinValues:()=>Aa,jsonStringifyReplacer:()=>Ho,merge:()=>py,mergeDefs:()=>et,normalizeParams:()=>z,nullish:()=>yt,numKeys:()=>sy,objectClone:()=>ey,omit:()=>ly,optionalKeys:()=>cu,parsedType:()=>pu,partial:()=>hy,pick:()=>cy,prefixIssues:()=>ye,primitiveTypes:()=>au,promiseAllObject:()=>ry,propertyKeyTypes:()=>Bn,randomString:()=>ny,required:()=>my,safeExtend:()=>dy,shallowClone:()=>iu,slugify:()=>nu,stringifyPrimitive:()=>La,uint8ArrayToBase64:()=>jf,uint8ArrayToBase64url:()=>Sy,uint8ArrayToHex:()=>yy,unwrapMessage:()=>Hn});function W_(e){return e}function K_(e){return e}function Y_(e){}function Q_(e){throw new Error("Unexpected value in exhaustive check")}function X_(e){}function Fn(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 Aa(e,t="|"){return e.map(o=>La(o)).join(t)}function Ho(e,t){return typeof t=="bigint"?t.toString():t}function Fo(e){return{get value(){{let o=e();return Object.defineProperty(this,"value",{value:o}),o}throw new Error("cached value already set")}}}function yt(e){return e==null}function Jn(e){let t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function ru(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 Af=Symbol("evaluating");function L(e,t,o){let r;Object.defineProperty(e,t,{get(){if(r!==Af)return r===void 0&&(r=Af,r=o()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ey(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function bt(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function et(...e){let t={};for(let o of e){let r=Object.getOwnPropertyDescriptors(o);Object.assign(t,r)}return Object.defineProperties({},t)}function ty(e){return et(e._zod.def)}function oy(e,t){return t?t.reduce((o,r)=>o?.[r],e):e}function ry(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 ny(e=10){let t="abcdefghijklmnopqrstuvwxyz",o="";for(let r=0;r<e;r++)o+=t[Math.floor(Math.random()*t.length)];return o}function qa(e){return JSON.stringify(e)}function nu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ja="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var su=Fo(()=>{if(Yt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function vt(e){if(Qt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let o=t.prototype;return!(Qt(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function iu(e){return vt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function sy(e){let t=0;for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&t++;return t}var iy=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}`)}},Bn=new Set(["string","number","symbol"]),au=new Set(["string","number","bigint","boolean","symbol","undefined"]);function $e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function me(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 ay(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 La(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function cu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var lu={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]},uu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function cy(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=et(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 bt(this,"shape",i),i},checks:[]});return me(e,s)}function ly(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=et(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 bt(this,"shape",i),i},checks:[]});return me(e,s)}function uy(e,t){if(!vt(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=et(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return bt(this,"shape",s),s}});return me(e,n)}function dy(e,t){if(!vt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let o=et(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return bt(this,"shape",r),r}});return me(e,o)}function py(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=et(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return bt(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return me(e,o)}function hy(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=et(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 bt(this,"shape",l),l},checks:[]});return me(t,i)}function my(e,t,o){let r=et(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 bt(this,"shape",s),s}});return me(t,r)}function zt(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 du(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 ye(e,t){return t.map(o=>{var r;return(r=o).path??(r.path=[]),o.path.unshift(e),o})}function Hn(e){return typeof e=="string"?e:e?.message}function fe(e,t,o){let r=e.message?e.message:Hn(e.inst?._zod.def?.error?.(e))??Hn(t?.error?.(e))??Hn(o.customError?.(e))??Hn(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 Gn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Wn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function pu(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let o=e;if(o&&Object.getPrototypeOf(o)!==Object.prototype&&"constructor"in o&&o.constructor)return o.constructor.name}}return t}function Jo(...e){let[t,o,r]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:r}:{...t}}function fy(e){return Object.entries(e).filter(([t,o])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function qf(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 jf(e){let t="";for(let o=0;o<e.length;o++)t+=String.fromCharCode(e[o]);return btoa(t)}function gy(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-t.length%4)%4);return qf(t+o)}function Sy(e){return jf(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function _y(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let o=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)o[r/2]=Number.parseInt(t.slice(r,r+2),16);return o}function yy(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var ou=class{constructor(...t){}};var Lf=(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,Ho,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Kn=m("$ZodError",Lf),be=m("$ZodError",Lf,{Parent:Error});function Yn(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 Qn(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 h=c[u];u===c.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(i))):l[h]=l[h]||{_errors:[]},l=l[h],u++}}}};return r(e),o}function hu(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 h=o,f=0;for(;f<u.length;){let y=u[f],_=f===u.length-1;typeof y=="string"?(h.properties??(h.properties={}),(i=h.properties)[y]??(i[y]={errors:[]}),h=h.properties[y]):(h.items??(h.items=[]),(c=h.items)[y]??(c[y]={errors:[]}),h=h.items[y]),_&&h.errors.push(t(l)),f++}}};return r(e),o}function Uf(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 mu(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 ${Uf(r.path)}`);return t.join(`
|
|
2
|
+
`)}var Bo=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 Me;if(i.issues.length){let c=new(n?.Err??e)(i.issues.map(l=>fe(l,s,Q())));throw ja(c,n?.callee),c}return i.value},Ua=Bo(be),Go=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=>fe(l,s,Q())));throw ja(c,n?.callee),c}return i.value},Za=Go(be),Wo=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 Me;return s.issues.length?{success:!1,error:new(e??Kn)(s.issues.map(i=>fe(i,n,Q())))}:{success:!0,data:s.value}},fu=Wo(be),Ko=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=>fe(i,n,Q())))}:{success:!0,data:s.value}},gu=Ko(be),Da=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Bo(e)(t,o,n)},vy=Da(be),Va=e=>(t,o,r)=>Bo(e)(t,o,r),zy=Va(be),Ha=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Go(e)(t,o,n)},wy=Ha(be),Fa=e=>async(t,o,r)=>Go(e)(t,o,r),Ry=Fa(be),Ja=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Wo(e)(t,o,n)},xy=Ja(be),Ba=e=>(t,o,r)=>Wo(e)(t,o,r),Py=Ba(be),Ga=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Ko(e)(t,o,n)},Ty=Ga(be),Wa=e=>async(t,o,r)=>Ko(e)(t,o,r),ky=Wa(be);var Re={};Xe(Re,{base64:()=>Iu,base64url:()=>Ka,bigint:()=>Lu,boolean:()=>Zu,browserEmail:()=>Ay,cidrv4:()=>$u,cidrv6:()=>Cu,cuid:()=>Su,cuid2:()=>_u,date:()=>Mu,datetime:()=>qu,domain:()=>Ly,duration:()=>wu,e164:()=>Nu,email:()=>xu,emoji:()=>Pu,extendedDuration:()=>Ey,guid:()=>Ru,hex:()=>Uy,hostname:()=>jy,html5Email:()=>Oy,httpProtocol:()=>Ou,idnEmail:()=>My,integer:()=>Uu,ipv4:()=>Tu,ipv6:()=>ku,ksuid:()=>vu,lowercase:()=>Hu,mac:()=>Eu,md5_base64:()=>Dy,md5_base64url:()=>Vy,md5_hex:()=>Zy,nanoid:()=>zu,null:()=>Du,number:()=>Ya,rfc5322Email:()=>Ny,sha1_base64:()=>Fy,sha1_base64url:()=>Jy,sha1_hex:()=>Hy,sha256_base64:()=>Gy,sha256_base64url:()=>Wy,sha256_hex:()=>By,sha384_base64:()=>Yy,sha384_base64url:()=>Qy,sha384_hex:()=>Ky,sha512_base64:()=>eb,sha512_base64url:()=>tb,sha512_hex:()=>Xy,string:()=>ju,time:()=>Au,ulid:()=>yu,undefined:()=>Vu,unicodeEmail:()=>Zf,uppercase:()=>Fu,uuid:()=>Xt,uuid4:()=>$y,uuid6:()=>Cy,uuid7:()=>Iy,xid:()=>bu});var Su=/^[cC][0-9a-z]{6,}$/,_u=/^[0-9a-z]+$/,yu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,bu=/^[0-9a-vA-V]{20}$/,vu=/^[A-Za-z0-9]{27}$/,zu=/^[a-zA-Z0-9_-]{21}$/,wu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ey=/^[-+]?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)?)??$/,Ru=/^([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})$/,Xt=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)$/,$y=Xt(4),Cy=Xt(6),Iy=Xt(7),xu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Oy=/^[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])?)*$/,Ny=/^(([^<>()\[\]\\.,;:\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,}))$/,Zf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,My=Zf,Ay=/^[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])?)*$/,qy="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Pu(){return new RegExp(qy,"u")}var 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])$/,ku=/^(([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}|:))$/,Eu=e=>{let t=$e(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},$u=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Cu=/^(([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])$/,Iu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ka=/^[A-Za-z0-9_-]*$/,jy=/^(?=.{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])?)*\.?$/,Ly=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ou=/^https?$/,Nu=/^\+[1-9]\d{6,14}$/,Df="(?:(?:\\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])))",Mu=new RegExp(`^${Df}$`);function Vf(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 Au(e){return new RegExp(`^${Vf(e)}$`)}function qu(e){let t=Vf({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(`^${Df}T(?:${r})$`)}var ju=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Lu=/^-?\d+n?$/,Uu=/^-?\d+$/,Ya=/^-?\d+(?:\.\d+)?$/,Zu=/^(?:true|false)$/i,Du=/^null$/i;var Vu=/^undefined$/i;var Hu=/^[^A-Z]*$/,Fu=/^[^a-z]*$/,Uy=/^[0-9a-fA-F]*$/;function Xn(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function es(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Zy=/^[0-9a-fA-F]{32}$/,Dy=Xn(22,"=="),Vy=es(22),Hy=/^[0-9a-fA-F]{40}$/,Fy=Xn(27,"="),Jy=es(27),By=/^[0-9a-fA-F]{64}$/,Gy=Xn(43,"="),Wy=es(43),Ky=/^[0-9a-fA-F]{96}$/,Yy=Xn(64,""),Qy=es(64),Xy=/^[0-9a-fA-F]{128}$/,eb=Xn(86,"=="),tb=es(86);var B=m("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),Ff={number:"number",bigint:"bigint",object:"date"},Qa=m("$ZodCheckLessThan",(e,t)=>{B.init(e,t);let o=Ff[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})}}),Xa=m("$ZodCheckGreaterThan",(e,t)=>{B.init(e,t);let o=Ff[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})}}),Ju=m("$ZodCheckMultipleOf",(e,t)=>{B.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):ru(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})}}),Bu=m("$ZodCheckNumberFormat",(e,t)=>{B.init(e,t),t.format=t.format||"float64";let o=t.format?.includes("int"),r=o?"int":"number",[n,s]=lu[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=Uu)}),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})}}),Gu=m("$ZodCheckBigIntFormat",(e,t)=>{B.init(e,t);let[o,r]=uu[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})}}),Wu=m("$ZodCheckMaxSize",(e,t)=>{var o;B.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!yt(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:Gn(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ku=m("$ZodCheckMinSize",(e,t)=>{var o;B.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!yt(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:Gn(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Yu=m("$ZodCheckSizeEquals",(e,t)=>{var o;B.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!yt(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:Gn(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})}}),Qu=m("$ZodCheckMaxLength",(e,t)=>{var o;B.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!yt(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=Wn(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Xu=m("$ZodCheckMinLength",(e,t)=>{var o;B.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!yt(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=Wn(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ed=m("$ZodCheckLengthEquals",(e,t)=>{var o;B.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!yt(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=Wn(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})}}),Yo=m("$ZodCheckStringFormat",(e,t)=>{var o,r;B.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=()=>{})}),td=m("$ZodCheckRegex",(e,t)=>{Yo.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})}}),od=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Hu),Yo.init(e,t)}),rd=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Fu),Yo.init(e,t)}),nd=m("$ZodCheckIncludes",(e,t)=>{B.init(e,t);let o=$e(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})}}),sd=m("$ZodCheckStartsWith",(e,t)=>{B.init(e,t);let o=new RegExp(`^${$e(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})}}),id=m("$ZodCheckEndsWith",(e,t)=>{B.init(e,t);let o=new RegExp(`.*${$e(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 Hf(e,t,o){e.issues.length&&t.issues.push(...ye(o,e.issues))}var ad=m("$ZodCheckProperty",(e,t)=>{B.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=>Hf(n,o,t.property));Hf(r,o,t.property)}}),cd=m("$ZodCheckMimeType",(e,t)=>{B.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})}}),ld=m("$ZodCheckOverwrite",(e,t)=>{B.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});var ts=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 cd={major:4,minor:4,patch:3};var M=m("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=cd;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),h;for(let f of c){if(f._zod.def.when){if(lu(i)||!f._zod.def.when(i))continue}else if(u)continue;let y=i.issues.length,_=f._zod.check(i);if(_ instanceof Promise&&l?.async===!1)throw new Oe;if(h||_ instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await _,i.issues.length!==y&&(u||(u=bt(i,y)))});else{if(i.issues.length===y)continue;u||(u=bt(i,y))}}return h?h.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 Oe;return u.then(h=>e._zod.parse(h,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(h=>s(h,i,c)):s(u,i,c)}let l=e._zod.parse(i,c);if(l instanceof Promise){if(c.async===!1)throw new Oe;return l.then(u=>n(u,r,c))}return n(l,r,c)}}L(e,"~standard",()=>({validate:n=>{try{let s=hu(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return mu(e,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Xt=m("$ZodString",(e,t)=>{M.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Au(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}}),F=m("$ZodStringFormat",(e,t)=>{Go.init(e,t),Xt.init(e,t)}),ud=m("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=zu),F.init(e,t)}),dd=m("$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());F.init(e,t)}),pd=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=wu),F.init(e,t)}),hd=m("$ZodURL",(e,t)=>{F.init(e,t),e._zod.check=o=>{try{let r=o.value.trim();if(!t.normalize&&t.protocol?.source===Cu.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})}}}),md=m("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ru()),F.init(e,t)}),fd=m("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=bu),F.init(e,t)}),gd=m("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=fu),F.init(e,t)}),Sd=m("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=gu),F.init(e,t)}),_d=m("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Su),F.init(e,t)}),yd=m("$ZodXID",(e,t)=>{t.pattern??(t.pattern=_u),F.init(e,t)}),bd=m("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=yu),F.init(e,t)}),vd=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Mu(t)),F.init(e,t)}),zd=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ou),F.init(e,t)}),wd=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Nu(t)),F.init(e,t)}),Rd=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=vu),F.init(e,t)}),xd=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=xu),F.init(e,t),e._zod.bag.format="ipv4"}),Pd=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Pu),F.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})}}}),Td=m("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Tu(t.delimiter)),F.init(e,t),e._zod.bag.format="mac"}),kd=m("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ku),F.init(e,t)}),Ed=m("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Eu),F.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 $d(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Cd=m("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=$u),F.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=o=>{$d(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function rg(e){if(!Ba.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return $d(o)}var Id=m("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ba),F.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=o=>{rg(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),Od=m("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Iu),F.init(e,t)});function ng(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 Nd=m("$ZodJWT",(e,t)=>{F.init(e,t),e._zod.check=o=>{ng(o.value,t.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),Md=m("$ZodCustomStringFormat",(e,t)=>{F.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})}}),tc=m("$ZodNumber",(e,t)=>{M.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ga,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}}),Ad=m("$ZodNumberFormat",(e,t)=>{Fu.init(e,t),tc.init(e,t)}),ts=m("$ZodBoolean",(e,t)=>{M.init(e,t),e._zod.pattern=Lu,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}}),oc=m("$ZodBigInt",(e,t)=>{M.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=m("$ZodBigIntFormat",(e,t)=>{Ju.init(e,t),oc.init(e,t)}),jd=m("$ZodSymbol",(e,t)=>{M.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}}),Ld=m("$ZodUndefined",(e,t)=>{M.init(e,t),e._zod.pattern=Zu,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}}),Ud=m("$ZodNull",(e,t)=>{M.init(e,t),e._zod.pattern=Uu,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}}),Zd=m("$ZodAny",(e,t)=>{M.init(e,t),e._zod.parse=o=>o}),Dd=m("$ZodUnknown",(e,t)=>{M.init(e,t),e._zod.parse=o=>o}),Vd=m("$ZodNever",(e,t)=>{M.init(e,t),e._zod.parse=(o,r)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)}),Hd=m("$ZodVoid",(e,t)=>{M.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}}),Fd=m("$ZodDate",(e,t)=>{M.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 Vf(e,t,o){e.issues.length&&t.issues.push(...ye(o,e.issues)),t.value[o]=e.value}var Jd=m("$ZodArray",(e,t)=>{M.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=>Vf(u,o,i))):Vf(l,o,i)}return s.length?Promise.all(s).then(()=>o):o}});function ec(e,t,o,r,n,s){let i=o in r;if(e.issues.length){if(n&&s&&!i)return;t.issues.push(...ye(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 sg(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=iu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function ig(e,t,o,r,n,s){let i=[],c=n.keySet,l=n.catchall._zod,u=l.def.type,h=l.optin==="optional",f=l.optout==="optional";for(let y in t){if(y==="__proto__"||c.has(y))continue;if(u==="never"){i.push(y);continue}let _=l.run({value:t[y],issues:[]},r);_ instanceof Promise?e.push(_.then(z=>ec(z,o,y,t,h,f))):ec(_,o,y,t,h,f)}return i.length&&o.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>o):o}var ag=m("$ZodObject",(e,t)=>{if(M.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=Do(()=>sg(t));L(e._zod,"propValues",()=>{let c=t.shape,l={};for(let u in c){let h=c[u]._zod;if(h.values){l[u]??(l[u]=new Set);for(let f of h.values)l[u].add(f)}}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 h=[],f=i.shape;for(let y of i.keys){let _=f[y],z=_._zod.optin==="optional",k=_._zod.optout==="optional",T=_._zod.run({value:u[y],issues:[]},l);T instanceof Promise?h.push(T.then(O=>ec(O,c,y,u,z,k))):ec(T,c,y,u,z,k)}return s?ig(h,u,c,l,r.value,e):h.length?Promise.all(h).then(()=>c):c}}),Bd=m("$ZodObjectJIT",(e,t)=>{ag.init(e,t);let o=e._zod.parse,r=Do(()=>sg(t)),n=y=>{let _=new es(["shape","payload","ctx"]),z=r.value,k=A=>{let Z=Na(A);return`shape[${Z}]._zod.run({ value: input[${Z}], issues: [] }, ctx)`};_.write("const input = payload.value;");let T=Object.create(null),O=0;for(let A of z.keys)T[A]=`key_${O++}`;_.write("const newResult = {};");for(let A of z.keys){let Z=T[A],V=Na(A),D=y[A],G=D?._zod?.optin==="optional",pe=D?._zod?.optout==="optional";_.write(`const ${Z} = ${k(A)};`),G&&pe?_.write(`
|
|
4
|
+
`))}};var ud={major:4,minor:4,patch:3};var M=m("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ud;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=zt(i),h;for(let f of c){if(f._zod.def.when){if(du(i)||!f._zod.def.when(i))continue}else if(u)continue;let y=i.issues.length,_=f._zod.check(i);if(_ instanceof Promise&&l?.async===!1)throw new Me;if(h||_ instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await _,i.issues.length!==y&&(u||(u=zt(i,y)))});else{if(i.issues.length===y)continue;u||(u=zt(i,y))}}return h?h.then(()=>i):i},s=(i,c,l)=>{if(zt(i))return i.aborted=!0,i;let u=n(c,r,l);if(u instanceof Promise){if(l.async===!1)throw new Me;return u.then(h=>e._zod.parse(h,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(h=>s(h,i,c)):s(u,i,c)}let l=e._zod.parse(i,c);if(l instanceof Promise){if(c.async===!1)throw new Me;return l.then(u=>n(u,r,c))}return n(l,r,c)}}L(e,"~standard",()=>({validate:n=>{try{let s=fu(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return gu(e,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),eo=m("$ZodString",(e,t)=>{M.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ju(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}}),F=m("$ZodStringFormat",(e,t)=>{Yo.init(e,t),eo.init(e,t)}),pd=m("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ru),F.init(e,t)}),hd=m("$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=Xt(r))}else t.pattern??(t.pattern=Xt());F.init(e,t)}),md=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=xu),F.init(e,t)}),fd=m("$ZodURL",(e,t)=>{F.init(e,t),e._zod.check=o=>{try{let r=o.value.trim();if(!t.normalize&&t.protocol?.source===Ou.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})}}}),gd=m("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Pu()),F.init(e,t)}),Sd=m("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=zu),F.init(e,t)}),_d=m("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Su),F.init(e,t)}),yd=m("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=_u),F.init(e,t)}),bd=m("$ZodULID",(e,t)=>{t.pattern??(t.pattern=yu),F.init(e,t)}),vd=m("$ZodXID",(e,t)=>{t.pattern??(t.pattern=bu),F.init(e,t)}),zd=m("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=vu),F.init(e,t)}),wd=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=qu(t)),F.init(e,t)}),Rd=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Mu),F.init(e,t)}),xd=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Au(t)),F.init(e,t)}),Pd=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=wu),F.init(e,t)}),Td=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Tu),F.init(e,t),e._zod.bag.format="ipv4"}),kd=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ku),F.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})}}}),Ed=m("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Eu(t.delimiter)),F.init(e,t),e._zod.bag.format="mac"}),$d=m("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=$u),F.init(e,t)}),Cd=m("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Cu),F.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 Id(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Od=m("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Iu),F.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=o=>{Id(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function ag(e){if(!Ka.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return Id(o)}var Nd=m("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ka),F.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=o=>{ag(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),Md=m("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Nu),F.init(e,t)});function cg(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 Ad=m("$ZodJWT",(e,t)=>{F.init(e,t),e._zod.check=o=>{cg(o.value,t.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),qd=m("$ZodCustomStringFormat",(e,t)=>{F.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})}}),nc=m("$ZodNumber",(e,t)=>{M.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ya,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}}),jd=m("$ZodNumberFormat",(e,t)=>{Bu.init(e,t),nc.init(e,t)}),os=m("$ZodBoolean",(e,t)=>{M.init(e,t),e._zod.pattern=Zu,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}}),sc=m("$ZodBigInt",(e,t)=>{M.init(e,t),e._zod.pattern=Lu,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}}),Ld=m("$ZodBigIntFormat",(e,t)=>{Gu.init(e,t),sc.init(e,t)}),Ud=m("$ZodSymbol",(e,t)=>{M.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}}),Zd=m("$ZodUndefined",(e,t)=>{M.init(e,t),e._zod.pattern=Vu,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}}),Dd=m("$ZodNull",(e,t)=>{M.init(e,t),e._zod.pattern=Du,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}}),Vd=m("$ZodAny",(e,t)=>{M.init(e,t),e._zod.parse=o=>o}),Hd=m("$ZodUnknown",(e,t)=>{M.init(e,t),e._zod.parse=o=>o}),Fd=m("$ZodNever",(e,t)=>{M.init(e,t),e._zod.parse=(o,r)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)}),Jd=m("$ZodVoid",(e,t)=>{M.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}}),Bd=m("$ZodDate",(e,t)=>{M.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 Bf(e,t,o){e.issues.length&&t.issues.push(...ye(o,e.issues)),t.value[o]=e.value}var Gd=m("$ZodArray",(e,t)=>{M.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=>Bf(u,o,i))):Bf(l,o,i)}return s.length?Promise.all(s).then(()=>o):o}});function rc(e,t,o,r,n,s){let i=o in r;if(e.issues.length){if(n&&s&&!i)return;t.issues.push(...ye(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 lg(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=cu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function ug(e,t,o,r,n,s){let i=[],c=n.keySet,l=n.catchall._zod,u=l.def.type,h=l.optin==="optional",f=l.optout==="optional";for(let y in t){if(y==="__proto__"||c.has(y))continue;if(u==="never"){i.push(y);continue}let _=l.run({value:t[y],issues:[]},r);_ instanceof Promise?e.push(_.then(v=>rc(v,o,y,t,h,f))):rc(_,o,y,t,h,f)}return i.length&&o.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>o):o}var dg=m("$ZodObject",(e,t)=>{if(M.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=Fo(()=>lg(t));L(e._zod,"propValues",()=>{let c=t.shape,l={};for(let u in c){let h=c[u]._zod;if(h.values){l[u]??(l[u]=new Set);for(let f of h.values)l[u].add(f)}}return l});let n=Qt,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 h=[],f=i.shape;for(let y of i.keys){let _=f[y],v=_._zod.optin==="optional",k=_._zod.optout==="optional",T=_._zod.run({value:u[y],issues:[]},l);T instanceof Promise?h.push(T.then(O=>rc(O,c,y,u,v,k))):rc(T,c,y,u,v,k)}return s?ug(h,u,c,l,r.value,e):h.length?Promise.all(h).then(()=>c):c}}),Wd=m("$ZodObjectJIT",(e,t)=>{dg.init(e,t);let o=e._zod.parse,r=Fo(()=>lg(t)),n=y=>{let _=new ts(["shape","payload","ctx"]),v=r.value,k=A=>{let Z=qa(A);return`shape[${Z}]._zod.run({ value: input[${Z}], issues: [] }, ctx)`};_.write("const input = payload.value;");let T=Object.create(null),O=0;for(let A of v.keys)T[A]=`key_${O++}`;_.write("const newResult = {};");for(let A of v.keys){let Z=T[A],V=qa(A),D=y[A],G=D?._zod?.optin==="optional",pe=D?._zod?.optout==="optional";_.write(`const ${Z} = ${k(A)};`),G&&pe?_.write(`
|
|
5
5
|
if (${Z}.issues.length) {
|
|
6
6
|
if (${V} in input) {
|
|
7
7
|
payload.issues = payload.issues.concat(${Z}.issues.map(iss => ({
|
|
@@ -60,9 +60,9 @@ var M_=Object.defineProperty;var Xe=(e,t)=>{for(var o in t)M_(e,o,{get:t[o],enum
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
`)}_.write("payload.value = newResult;"),_.write("return payload;");let j=_.compile();return(A,Z)=>j(y,A,Z)},s,i=Yt,c=!Kt.jitless,u=c&&ru.value,h=t.catchall,f;e._zod.parse=(y,_)=>{f??(f=r.value);let z=y.value;return i(z)?c&&u&&_?.async===!1&&_.jitless!==!0?(s||(s=n(t.shape)),y=s(y,_),h?ig([],z,y,_,f,e):y):o(y,_):(y.issues.push({expected:"object",code:"invalid_type",input:z,inst:e}),y)}});function Hf(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=>fe(i,r,Q())))}),t)}var os=m("$ZodUnion",(e,t)=>{M.init(e,t),L(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),L(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),L(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),L(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=>Fn(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=>Hf(c,r,e,n)):Hf(i,r,e,n)}});function Ff(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=>fe(i,r,Q())))}):t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:[],inclusive:!1}),t)}var Gd=m("$ZodXor",(e,t)=>{os.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=>Ff(c,r,e,n)):Ff(i,r,e,n)}}),Wd=m("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,os.init(e,t);let o=e._zod.parse;L(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=Do(()=>{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)}}),Kd=m("$ZodIntersection",(e,t)=>{M.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])=>Jf(o,l,u)):Jf(o,s,i)}});function ld(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=ld(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=ld(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 Jf(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=ld(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 rc=m("$ZodTuple",(e,t)=>{M.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=Bf(o,"optin"),l=Bf(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 h=0;h<o.length;h++){let f=o[h]._zod.run({value:s[h],issues:[]},n);f instanceof Promise?i.push(f.then(y=>{u[h]=y})):u[h]=f}if(t.rest){let h=o.length-1,f=s.slice(o.length);for(let y of f){h++;let _=t.rest._zod.run({value:y,issues:[]},n);_ instanceof Promise?i.push(_.then(z=>Gf(z,r,h))):Gf(_,r,h)}}return i.length?Promise.all(i).then(()=>Wf(u,r,o,s,l)):Wf(u,r,o,s,l)}});function Bf(e,t){for(let o=e.length-1;o>=0;o--)if(e[o]._zod[t]!=="optional")return o+1;return 0}function Gf(e,t,o){e.issues.length&&t.issues.push(...ye(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(...ye(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 Yd=m("$ZodRecord",(e,t)=>{M.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 h=t.keyType._zod.run({value:u,issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(_=>fe(_,r,Q())),input:u,path:[u],inst:e});continue}let f=h.value,y=t.valueType._zod.run({value:n[u],issues:[]},r);y instanceof Promise?s.push(y.then(_=>{_.issues.length&&o.issues.push(...ye(u,_.issues)),o.value[f]=_.value})):(y.issues.length&&o.issues.push(...ye(u,y.issues)),o.value[f]=y.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"&&Ga.test(c)&&l.issues.length){let f=t.keyType._zod.run({value:Number(c),issues:[]},r);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(l=f)}if(l.issues.length){t.mode==="loose"?o.value[c]=n[c]:o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>fe(f,r,Q())),input:c,path:[c],inst:e});continue}let h=t.valueType._zod.run({value:n[c],issues:[]},r);h instanceof Promise?s.push(h.then(f=>{f.issues.length&&o.issues.push(...ye(c,f.issues)),o.value[l.value]=f.value})):(h.issues.length&&o.issues.push(...ye(c,h.issues)),o.value[l.value]=h.value)}}return s.length?Promise.all(s).then(()=>o):o}}),Qd=m("$ZodMap",(e,t)=>{M.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(([h,f])=>{Kf(h,f,o,i,n,e,r)})):Kf(l,u,o,i,n,e,r)}return s.length?Promise.all(s).then(()=>o):o}});function Kf(e,t,o,r,n,s,i){e.issues.length&&(Jn.has(typeof r)?o.issues.push(...ye(r,e.issues)):o.issues.push({code:"invalid_key",origin:"map",input:n,inst:s,issues:e.issues.map(c=>fe(c,i,Q()))})),t.issues.length&&(Jn.has(typeof r)?o.issues.push(...ye(r,t.issues)):o.issues.push({origin:"map",code:"invalid_element",input:n,inst:s,key:r,issues:t.issues.map(c=>fe(c,i,Q()))})),o.value.set(e.value,t.value)}var Xd=m("$ZodSet",(e,t)=>{M.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=>Yf(l,o))):Yf(c,o)}return s.length?Promise.all(s).then(()=>o):o}});function Yf(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var ep=m("$ZodEnum",(e,t)=>{M.init(e,t);let o=Hn(t.entries),r=new Set(o);e._zod.values=r,e._zod.pattern=new RegExp(`^(${o.filter(n=>Jn.has(typeof n)).map(n=>typeof n=="string"?$e(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}}),tp=m("$ZodLiteral",(e,t)=>{if(M.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"?$e(r):r?$e(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}}),op=m("$ZodFile",(e,t)=>{M.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}}),rp=m("$ZodTransform",(e,t)=>{M.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 Oe;return o.value=n,o.fallback=!0,o}});function Qf(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var nc=m("$ZodOptional",(e,t)=>{M.init(e,t),e._zod.optin="optional",e._zod.optout="optional",L(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),L(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Fn(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=>Qf(i,n)):Qf(s,n)}return o.value===void 0?o:t.innerType._zod.run(o,r)}}),np=m("$ZodExactOptional",(e,t)=>{nc.init(e,t),L(e._zod,"values",()=>t.innerType._zod.values),L(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(o,r)=>t.innerType._zod.run(o,r)}),sp=m("$ZodNullable",(e,t)=>{M.init(e,t),L(e._zod,"optin",()=>t.innerType._zod.optin),L(e._zod,"optout",()=>t.innerType._zod.optout),L(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Fn(o.source)}|null)$`):void 0}),L(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)}),ip=m("$ZodDefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",L(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=>Xf(s,t)):Xf(n,t)}});function Xf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ap=m("$ZodPrefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",L(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))}),cp=m("$ZodNonOptional",(e,t)=>{M.init(e,t),L(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=>eg(s,e)):eg(n,e)}});function eg(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 lp=m("$ZodSuccess",(e,t)=>{M.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)}}),up=m("$ZodCatch",(e,t)=>{M.init(e,t),e._zod.optin="optional",L(e._zod,"optout",()=>t.innerType._zod.optout),L(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=>fe(i,r,Q()))},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=>fe(s,r,Q()))},input:o.value}),o.issues=[],o.fallback=!0),o)}}),dp=m("$ZodNaN",(e,t)=>{M.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)}),sc=m("$ZodPipe",(e,t)=>{M.init(e,t),L(e._zod,"values",()=>t.in._zod.values),L(e._zod,"optin",()=>t.in._zod.optin),L(e._zod,"optout",()=>t.out._zod.optout),L(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=>Ya(i,t.in,r)):Ya(s,t.in,r)}let n=t.in._zod.run(o,r);return n instanceof Promise?n.then(s=>Ya(s,t.out,r)):Ya(n,t.out,r)}});function Ya(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 rs=m("$ZodCodec",(e,t)=>{M.init(e,t),L(e._zod,"values",()=>t.in._zod.values),L(e._zod,"optin",()=>t.in._zod.optin),L(e._zod,"optout",()=>t.out._zod.optout),L(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=>Qa(i,t,r)):Qa(s,t,r)}else{let s=t.out._zod.run(o,r);return s instanceof Promise?s.then(i=>Qa(i,t,r)):Qa(s,t,r)}}});function Qa(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=>Xa(e,s,t.out,o)):Xa(e,n,t.out,o)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(s=>Xa(e,s,t.in,o)):Xa(e,n,t.in,o)}}function Xa(e,t,o,r){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},r)}var pp=m("$ZodPreprocess",(e,t)=>{sc.init(e,t)}),hp=m("$ZodReadonly",(e,t)=>{M.init(e,t),L(e._zod,"propValues",()=>t.innerType._zod.propValues),L(e._zod,"values",()=>t.innerType._zod.values),L(e._zod,"optin",()=>t.innerType?._zod?.optin),L(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(tg):tg(n)}});function tg(e){return e.value=Object.freeze(e.value),e}var mp=m("$ZodTemplateLiteral",(e,t)=>{M.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||su.has(typeof r))o.push($e(`${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)}),fp=m("$ZodFunction",(e,t)=>(M.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?qa(e._def.input,r):r,s=Reflect.apply(o,this,n);return e._def.output?qa(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 ja(e._def.input,r):r,s=await Reflect.apply(o,this,n);return e._def.output?await ja(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 rc({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)),gp=m("$ZodPromise",(e,t)=>{M.init(e,t),e._zod.parse=(o,r)=>Promise.resolve(o.value).then(n=>t.innerType._zod.run({value:n,issues:[]},r))}),Sp=m("$ZodLazy",(e,t)=>{M.init(e,t),L(e._zod,"innerType",()=>{let o=t;return o._cachedInner||(o._cachedInner=t.getter()),o._cachedInner}),L(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),L(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),L(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),L(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(o,r)=>e._zod.innerType._zod.run(o,r)}),_p=m("$ZodCustom",(e,t)=>{B.init(e,t),M.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=>og(s,o,r,e));og(n,o,r,e)}});function og(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(Vo(n))}}var ns={};Xe(ns,{en:()=>ic});var Yy=()=>{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=uu(n.input),c=r[i]??i;return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${Aa(n.values[0])}`:`Invalid option: expected one of ${Oa(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":""}: ${Oa(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 ic(){return{localeError:Yy()}}var cg,yp=Symbol("ZodOutput"),bp=Symbol("ZodInput"),ac=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 cc(){return new ac}(cg=globalThis).__zod_globalRegistry??(cg.__zod_globalRegistry=cc());var ne=globalThis.__zod_globalRegistry;function vp(e,t){return new e({type:"string",...v(t)})}function zp(e,t){return new e({type:"string",coerce:!0,...v(t)})}function lc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...v(t)})}function ss(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...v(t)})}function uc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...v(t)})}function dc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...v(t)})}function pc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...v(t)})}function hc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...v(t)})}function is(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...v(t)})}function mc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...v(t)})}function fc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...v(t)})}function gc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...v(t)})}function Sc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...v(t)})}function _c(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...v(t)})}function yc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...v(t)})}function bc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...v(t)})}function vc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...v(t)})}function zc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...v(t)})}function wp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...v(t)})}function wc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...v(t)})}function Rc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...v(t)})}function xc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...v(t)})}function Pc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...v(t)})}function Tc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...v(t)})}function kc(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 xp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...v(t)})}function Pp(e,t){return new e({type:"string",format:"date",check:"string_format",...v(t)})}function Tp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...v(t)})}function kp(e,t){return new e({type:"string",format:"duration",check:"string_format",...v(t)})}function Ep(e,t){return new e({type:"number",checks:[],...v(t)})}function $p(e,t){return new e({type:"number",coerce:!0,checks:[],...v(t)})}function Cp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...v(t)})}function Ip(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...v(t)})}function Op(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...v(t)})}function Np(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...v(t)})}function Mp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...v(t)})}function Ap(e,t){return new e({type:"boolean",...v(t)})}function qp(e,t){return new e({type:"boolean",coerce:!0,...v(t)})}function jp(e,t){return new e({type:"bigint",...v(t)})}function Lp(e,t){return new e({type:"bigint",coerce:!0,...v(t)})}function Up(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...v(t)})}function Zp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...v(t)})}function Dp(e,t){return new e({type:"symbol",...v(t)})}function Vp(e,t){return new e({type:"undefined",...v(t)})}function Hp(e,t){return new e({type:"null",...v(t)})}function Fp(e){return new e({type:"any"})}function Jp(e){return new e({type:"unknown"})}function Bp(e,t){return new e({type:"never",...v(t)})}function Gp(e,t){return new e({type:"void",...v(t)})}function Wp(e,t){return new e({type:"date",...v(t)})}function Kp(e,t){return new e({type:"date",coerce:!0,...v(t)})}function Yp(e,t){return new e({type:"nan",...v(t)})}function Le(e,t){return new Wa({check:"less_than",...v(t),value:e,inclusive:!1})}function xe(e,t){return new Wa({check:"less_than",...v(t),value:e,inclusive:!0})}function Ue(e,t){return new Ka({check:"greater_than",...v(t),value:e,inclusive:!1})}function ge(e,t){return new Ka({check:"greater_than",...v(t),value:e,inclusive:!0})}function Ec(e){return Ue(0,e)}function $c(e){return Le(0,e)}function Cc(e){return xe(0,e)}function Ic(e){return ge(0,e)}function vt(e,t){return new Hu({check:"multiple_of",...v(t),value:e})}function zt(e,t){return new Bu({check:"max_size",...v(t),maximum:e})}function Ze(e,t){return new Gu({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 Ku({check:"max_length",...v(t),maximum:e})}function tt(e,t){return new Yu({check:"min_length",...v(t),minimum:e})}function oo(e,t){return new Qu({check:"length_equals",...v(t),length:e})}function Wo(e,t){return new Xu({check:"string_format",format:"regex",...v(t),pattern:e})}function Ko(e){return new ed({check:"string_format",format:"lowercase",...v(e)})}function Yo(e){return new td({check:"string_format",format:"uppercase",...v(e)})}function Qo(e,t){return new od({check:"string_format",format:"includes",...v(t),includes:e})}function Xo(e,t){return new rd({check:"string_format",format:"starts_with",...v(t),prefix:e})}function er(e,t){return new nd({check:"string_format",format:"ends_with",...v(t),suffix:e})}function Oc(e,t,o){return new sd({check:"property",property:e,schema:t,...v(o)})}function tr(e,t){return new id({check:"mime_type",mime:e,...v(t)})}function Ne(e){return new ad({check:"overwrite",tx:e})}function or(e){return Ne(t=>t.normalize(e))}function rr(){return Ne(e=>e.trim())}function nr(){return Ne(e=>e.toLowerCase())}function sr(){return Ne(e=>e.toUpperCase())}function ir(){return Ne(e=>ou(e))}function Qp(e,t,o){return new e({type:"array",element:t,...v(o)})}function Xy(e,t,o){return new e({type:"union",options:t,...v(o)})}function eb(e,t,o){return new e({type:"union",options:t,inclusive:!1,...v(o)})}function tb(e,t,o,r){return new e({type:"union",options:o,discriminator:t,...v(r)})}function ob(e,t,o){return new e({type:"intersection",left:t,right:o})}function rb(e,t,o,r){let n=o instanceof M,s=n?r:o,i=n?o:null;return new e({type:"tuple",items:t,rest:i,...v(s)})}function nb(e,t,o,r){return new e({type:"record",keyType:t,valueType:o,...v(r)})}function sb(e,t,o,r){return new e({type:"map",keyType:t,valueType:o,...v(r)})}function ib(e,t,o){return new e({type:"set",valueType:t,...v(o)})}function ab(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 cb(e,t,o){return new e({type:"enum",entries:t,...v(o)})}function lb(e,t,o){return new e({type:"literal",values:Array.isArray(t)?t:[t],...v(o)})}function Xp(e,t){return new e({type:"file",...v(t)})}function ub(e,t){return new e({type:"transform",transform:t})}function db(e,t){return new e({type:"optional",innerType:t})}function pb(e,t){return new e({type:"nullable",innerType:t})}function hb(e,t,o){return new e({type:"default",innerType:t,get defaultValue(){return typeof o=="function"?o():nu(o)}})}function mb(e,t,o){return new e({type:"nonoptional",innerType:t,...v(o)})}function fb(e,t){return new e({type:"success",innerType:t})}function gb(e,t,o){return new e({type:"catch",innerType:t,catchValue:typeof o=="function"?o:()=>o})}function Sb(e,t,o){return new e({type:"pipe",in:t,out:o})}function _b(e,t){return new e({type:"readonly",innerType:t})}function yb(e,t,o){return new e({type:"template_literal",parts:t,...v(o)})}function bb(e,t){return new e({type:"lazy",getter:t})}function vb(e,t){return new e({type:"promise",innerType:t})}function eh(e,t,o){let r=v(o);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function th(e,t,o){return new e({type:"custom",check:"custom",fn:t,...v(o)})}function oh(e,t){let o=lg(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Vo(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(Vo(s))}},e(r.value,r)),t);return o}function lg(e,t){let o=new B({check:"custom",...v(t)});return o._zod.check=e,o}function rh(e){let t=new B({check:"describe"});return t._zod.onattach=[o=>{let r=ne.get(o)??{};ne.add(o,{...r,description:e})}],t._zod.check=()=>{},t}function nh(e){let t=new B({check:"meta"});return t._zod.onattach=[o=>{let r=ne.get(o)??{};ne.add(o,{...r,...e})}],t._zod.check=()=>{},t}function sh(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(_=>typeof _=="string"?_.toLowerCase():_),n=n.map(_=>typeof _=="string"?_.toLowerCase():_));let s=new Set(r),i=new Set(n),c=e.Codec??rs,l=e.Boolean??ts,u=e.String??Xt,h=new u({type:"string",error:o.error}),f=new l({type:"boolean",error:o.error}),y=new c({type:"pipe",in:h,out:f,transform:((_,z)=>{let k=_;return o.case!=="sensitive"&&(k=k.toLowerCase()),s.has(k)?!0:i.has(k)?!1:(z.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...i],input:z.value,inst:y,continue:!1}),{})}),reverseTransform:((_,z)=>_===!0?r[0]||"true":n[0]||"false"),error:o.error});return y}function ar(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 wt(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??ne,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 H(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 h={...o,schemaPath:[...o.schemaPath,e],path:o.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,h);else{let y=i.schema,_=t.processors[n.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);_(e,t,y,h)}let f=e._zod.parent;f&&(i.ref||(i.ref=f),H(f,t,h),t.seen.get(f).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(i.schema,l),t.io==="input"&&Se(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 Rt(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 f=e.external.registry.get(i[0])?.id,y=e.external.uri??(z=>z);if(f)return{ref:y(f)};let _=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=_,{defId:_,ref:`${y("__shared")}#/${c}/${_}`}}if(i[1]===o)return{ref:"#"};let u=`#/${c}/`,h=i[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:u+h}},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 h=c.schema;for(let f in h)delete h[f];h.$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
|
+
`)}_.write("payload.value = newResult;"),_.write("return payload;");let j=_.compile();return(A,Z)=>j(y,A,Z)},s,i=Qt,c=!Yt.jitless,u=c&&su.value,h=t.catchall,f;e._zod.parse=(y,_)=>{f??(f=r.value);let v=y.value;return i(v)?c&&u&&_?.async===!1&&_.jitless!==!0?(s||(s=n(t.shape)),y=s(y,_),h?ug([],v,y,_,f,e):y):o(y,_):(y.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),y)}});function Gf(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=>!zt(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=>fe(i,r,Q())))}),t)}var rs=m("$ZodUnion",(e,t)=>{M.init(e,t),L(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),L(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),L(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),L(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=>Jn(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=>Gf(c,r,e,n)):Gf(i,r,e,n)}});function Wf(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=>fe(i,r,Q())))}):t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:[],inclusive:!1}),t)}var Kd=m("$ZodXor",(e,t)=>{rs.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=>Wf(c,r,e,n)):Wf(i,r,e,n)}}),Yd=m("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,rs.init(e,t);let o=e._zod.parse;L(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=Fo(()=>{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(!Qt(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)}}),Qd=m("$ZodIntersection",(e,t)=>{M.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])=>Kf(o,l,u)):Kf(o,s,i)}});function dd(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(vt(e)&&vt(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=dd(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=dd(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 Kf(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}),zt(e))return e;let i=dd(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 ic=m("$ZodTuple",(e,t)=>{M.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=Yf(o,"optin"),l=Yf(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 h=0;h<o.length;h++){let f=o[h]._zod.run({value:s[h],issues:[]},n);f instanceof Promise?i.push(f.then(y=>{u[h]=y})):u[h]=f}if(t.rest){let h=o.length-1,f=s.slice(o.length);for(let y of f){h++;let _=t.rest._zod.run({value:y,issues:[]},n);_ instanceof Promise?i.push(_.then(v=>Qf(v,r,h))):Qf(_,r,h)}}return i.length?Promise.all(i).then(()=>Xf(u,r,o,s,l)):Xf(u,r,o,s,l)}});function Yf(e,t){for(let o=e.length-1;o>=0;o--)if(e[o]._zod[t]!=="optional")return o+1;return 0}function Qf(e,t,o){e.issues.length&&t.issues.push(...ye(o,e.issues)),t.value[o]=e.value}function Xf(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(...ye(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 Xd=m("$ZodRecord",(e,t)=>{M.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!vt(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 h=t.keyType._zod.run({value:u,issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(_=>fe(_,r,Q())),input:u,path:[u],inst:e});continue}let f=h.value,y=t.valueType._zod.run({value:n[u],issues:[]},r);y instanceof Promise?s.push(y.then(_=>{_.issues.length&&o.issues.push(...ye(u,_.issues)),o.value[f]=_.value})):(y.issues.length&&o.issues.push(...ye(u,y.issues)),o.value[f]=y.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"&&Ya.test(c)&&l.issues.length){let f=t.keyType._zod.run({value:Number(c),issues:[]},r);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(l=f)}if(l.issues.length){t.mode==="loose"?o.value[c]=n[c]:o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>fe(f,r,Q())),input:c,path:[c],inst:e});continue}let h=t.valueType._zod.run({value:n[c],issues:[]},r);h instanceof Promise?s.push(h.then(f=>{f.issues.length&&o.issues.push(...ye(c,f.issues)),o.value[l.value]=f.value})):(h.issues.length&&o.issues.push(...ye(c,h.issues)),o.value[l.value]=h.value)}}return s.length?Promise.all(s).then(()=>o):o}}),ep=m("$ZodMap",(e,t)=>{M.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(([h,f])=>{eg(h,f,o,i,n,e,r)})):eg(l,u,o,i,n,e,r)}return s.length?Promise.all(s).then(()=>o):o}});function eg(e,t,o,r,n,s,i){e.issues.length&&(Bn.has(typeof r)?o.issues.push(...ye(r,e.issues)):o.issues.push({code:"invalid_key",origin:"map",input:n,inst:s,issues:e.issues.map(c=>fe(c,i,Q()))})),t.issues.length&&(Bn.has(typeof r)?o.issues.push(...ye(r,t.issues)):o.issues.push({origin:"map",code:"invalid_element",input:n,inst:s,key:r,issues:t.issues.map(c=>fe(c,i,Q()))})),o.value.set(e.value,t.value)}var tp=m("$ZodSet",(e,t)=>{M.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=>tg(l,o))):tg(c,o)}return s.length?Promise.all(s).then(()=>o):o}});function tg(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var op=m("$ZodEnum",(e,t)=>{M.init(e,t);let o=Fn(t.entries),r=new Set(o);e._zod.values=r,e._zod.pattern=new RegExp(`^(${o.filter(n=>Bn.has(typeof n)).map(n=>typeof n=="string"?$e(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}}),rp=m("$ZodLiteral",(e,t)=>{if(M.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"?$e(r):r?$e(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}}),np=m("$ZodFile",(e,t)=>{M.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}}),sp=m("$ZodTransform",(e,t)=>{M.init(e,t),e._zod.optin="optional",e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new _t(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 Me;return o.value=n,o.fallback=!0,o}});function og(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var ac=m("$ZodOptional",(e,t)=>{M.init(e,t),e._zod.optin="optional",e._zod.optout="optional",L(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),L(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Jn(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=>og(i,n)):og(s,n)}return o.value===void 0?o:t.innerType._zod.run(o,r)}}),ip=m("$ZodExactOptional",(e,t)=>{ac.init(e,t),L(e._zod,"values",()=>t.innerType._zod.values),L(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(o,r)=>t.innerType._zod.run(o,r)}),ap=m("$ZodNullable",(e,t)=>{M.init(e,t),L(e._zod,"optin",()=>t.innerType._zod.optin),L(e._zod,"optout",()=>t.innerType._zod.optout),L(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Jn(o.source)}|null)$`):void 0}),L(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)}),cp=m("$ZodDefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",L(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=>rg(s,t)):rg(n,t)}});function rg(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var lp=m("$ZodPrefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",L(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))}),up=m("$ZodNonOptional",(e,t)=>{M.init(e,t),L(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=>ng(s,e)):ng(n,e)}});function ng(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 dp=m("$ZodSuccess",(e,t)=>{M.init(e,t),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new _t("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)}}),pp=m("$ZodCatch",(e,t)=>{M.init(e,t),e._zod.optin="optional",L(e._zod,"optout",()=>t.innerType._zod.optout),L(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=>fe(i,r,Q()))},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=>fe(s,r,Q()))},input:o.value}),o.issues=[],o.fallback=!0),o)}}),hp=m("$ZodNaN",(e,t)=>{M.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)}),cc=m("$ZodPipe",(e,t)=>{M.init(e,t),L(e._zod,"values",()=>t.in._zod.values),L(e._zod,"optin",()=>t.in._zod.optin),L(e._zod,"optout",()=>t.out._zod.optout),L(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=>ec(i,t.in,r)):ec(s,t.in,r)}let n=t.in._zod.run(o,r);return n instanceof Promise?n.then(s=>ec(s,t.out,r)):ec(n,t.out,r)}});function ec(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 ns=m("$ZodCodec",(e,t)=>{M.init(e,t),L(e._zod,"values",()=>t.in._zod.values),L(e._zod,"optin",()=>t.in._zod.optin),L(e._zod,"optout",()=>t.out._zod.optout),L(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=>tc(i,t,r)):tc(s,t,r)}else{let s=t.out._zod.run(o,r);return s instanceof Promise?s.then(i=>tc(i,t,r)):tc(s,t,r)}}});function tc(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=>oc(e,s,t.out,o)):oc(e,n,t.out,o)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(s=>oc(e,s,t.in,o)):oc(e,n,t.in,o)}}function oc(e,t,o,r){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},r)}var mp=m("$ZodPreprocess",(e,t)=>{cc.init(e,t)}),fp=m("$ZodReadonly",(e,t)=>{M.init(e,t),L(e._zod,"propValues",()=>t.innerType._zod.propValues),L(e._zod,"values",()=>t.innerType._zod.values),L(e._zod,"optin",()=>t.innerType?._zod?.optin),L(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(sg):sg(n)}});function sg(e){return e.value=Object.freeze(e.value),e}var gp=m("$ZodTemplateLiteral",(e,t)=>{M.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||au.has(typeof r))o.push($e(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${o.join("")}$`),e._zod.parse=(r,n)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),Sp=m("$ZodFunction",(e,t)=>(M.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?Ua(e._def.input,r):r,s=Reflect.apply(o,this,n);return e._def.output?Ua(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 Za(e._def.input,r):r,s=await Reflect.apply(o,this,n);return e._def.output?await Za(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 ic({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)),_p=m("$ZodPromise",(e,t)=>{M.init(e,t),e._zod.parse=(o,r)=>Promise.resolve(o.value).then(n=>t.innerType._zod.run({value:n,issues:[]},r))}),yp=m("$ZodLazy",(e,t)=>{M.init(e,t),L(e._zod,"innerType",()=>{let o=t;return o._cachedInner||(o._cachedInner=t.getter()),o._cachedInner}),L(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),L(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),L(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),L(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(o,r)=>e._zod.innerType._zod.run(o,r)}),bp=m("$ZodCustom",(e,t)=>{B.init(e,t),M.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=>ig(s,o,r,e));ig(n,o,r,e)}});function ig(e,t,o,r){if(!e){let n={code:"custom",input:o,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(n.params=r._zod.def.params),t.issues.push(Jo(n))}}var ss={};Xe(ss,{en:()=>lc});var rb=()=>{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=pu(n.input),c=r[i]??i;return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${La(n.values[0])}`:`Invalid option: expected one of ${Aa(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":""}: ${Aa(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 lc(){return{localeError:rb()}}var pg,vp=Symbol("ZodOutput"),zp=Symbol("ZodInput"),uc=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 dc(){return new uc}(pg=globalThis).__zod_globalRegistry??(pg.__zod_globalRegistry=dc());var ne=globalThis.__zod_globalRegistry;function wp(e,t){return new e({type:"string",...z(t)})}function Rp(e,t){return new e({type:"string",coerce:!0,...z(t)})}function pc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...z(t)})}function is(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...z(t)})}function hc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...z(t)})}function mc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(t)})}function fc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(t)})}function gc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(t)})}function as(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...z(t)})}function Sc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...z(t)})}function _c(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(t)})}function yc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...z(t)})}function bc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(t)})}function vc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...z(t)})}function zc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...z(t)})}function wc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(t)})}function Rc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(t)})}function xc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(t)})}function xp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...z(t)})}function Pc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(t)})}function Tc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(t)})}function kc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...z(t)})}function Ec(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...z(t)})}function $c(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...z(t)})}function Cc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...z(t)})}var Pp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Tp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(t)})}function kp(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function Ep(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function $p(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function Cp(e,t){return new e({type:"number",checks:[],...z(t)})}function Ip(e,t){return new e({type:"number",coerce:!0,checks:[],...z(t)})}function Op(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...z(t)})}function Np(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...z(t)})}function Mp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...z(t)})}function Ap(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...z(t)})}function qp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...z(t)})}function jp(e,t){return new e({type:"boolean",...z(t)})}function Lp(e,t){return new e({type:"boolean",coerce:!0,...z(t)})}function Up(e,t){return new e({type:"bigint",...z(t)})}function Zp(e,t){return new e({type:"bigint",coerce:!0,...z(t)})}function Dp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...z(t)})}function Vp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...z(t)})}function Hp(e,t){return new e({type:"symbol",...z(t)})}function Fp(e,t){return new e({type:"undefined",...z(t)})}function Jp(e,t){return new e({type:"null",...z(t)})}function Bp(e){return new e({type:"any"})}function Gp(e){return new e({type:"unknown"})}function Wp(e,t){return new e({type:"never",...z(t)})}function Kp(e,t){return new e({type:"void",...z(t)})}function Yp(e,t){return new e({type:"date",...z(t)})}function Qp(e,t){return new e({type:"date",coerce:!0,...z(t)})}function Xp(e,t){return new e({type:"nan",...z(t)})}function Ze(e,t){return new Qa({check:"less_than",...z(t),value:e,inclusive:!1})}function xe(e,t){return new Qa({check:"less_than",...z(t),value:e,inclusive:!0})}function De(e,t){return new Xa({check:"greater_than",...z(t),value:e,inclusive:!1})}function ge(e,t){return new Xa({check:"greater_than",...z(t),value:e,inclusive:!0})}function Ic(e){return De(0,e)}function Oc(e){return Ze(0,e)}function Nc(e){return xe(0,e)}function Mc(e){return ge(0,e)}function wt(e,t){return new Ju({check:"multiple_of",...z(t),value:e})}function Rt(e,t){return new Wu({check:"max_size",...z(t),maximum:e})}function Ve(e,t){return new Ku({check:"min_size",...z(t),minimum:e})}function to(e,t){return new Yu({check:"size_equals",...z(t),size:e})}function oo(e,t){return new Qu({check:"max_length",...z(t),maximum:e})}function tt(e,t){return new Xu({check:"min_length",...z(t),minimum:e})}function ro(e,t){return new ed({check:"length_equals",...z(t),length:e})}function Qo(e,t){return new td({check:"string_format",format:"regex",...z(t),pattern:e})}function Xo(e){return new od({check:"string_format",format:"lowercase",...z(e)})}function er(e){return new rd({check:"string_format",format:"uppercase",...z(e)})}function tr(e,t){return new nd({check:"string_format",format:"includes",...z(t),includes:e})}function or(e,t){return new sd({check:"string_format",format:"starts_with",...z(t),prefix:e})}function rr(e,t){return new id({check:"string_format",format:"ends_with",...z(t),suffix:e})}function Ac(e,t,o){return new ad({check:"property",property:e,schema:t,...z(o)})}function nr(e,t){return new cd({check:"mime_type",mime:e,...z(t)})}function Ae(e){return new ld({check:"overwrite",tx:e})}function sr(e){return Ae(t=>t.normalize(e))}function ir(){return Ae(e=>e.trim())}function ar(){return Ae(e=>e.toLowerCase())}function cr(){return Ae(e=>e.toUpperCase())}function lr(){return Ae(e=>nu(e))}function eh(e,t,o){return new e({type:"array",element:t,...z(o)})}function sb(e,t,o){return new e({type:"union",options:t,...z(o)})}function ib(e,t,o){return new e({type:"union",options:t,inclusive:!1,...z(o)})}function ab(e,t,o,r){return new e({type:"union",options:o,discriminator:t,...z(r)})}function cb(e,t,o){return new e({type:"intersection",left:t,right:o})}function lb(e,t,o,r){let n=o instanceof M,s=n?r:o,i=n?o:null;return new e({type:"tuple",items:t,rest:i,...z(s)})}function ub(e,t,o,r){return new e({type:"record",keyType:t,valueType:o,...z(r)})}function db(e,t,o,r){return new e({type:"map",keyType:t,valueType:o,...z(r)})}function pb(e,t,o){return new e({type:"set",valueType:t,...z(o)})}function hb(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 mb(e,t,o){return new e({type:"enum",entries:t,...z(o)})}function fb(e,t,o){return new e({type:"literal",values:Array.isArray(t)?t:[t],...z(o)})}function th(e,t){return new e({type:"file",...z(t)})}function gb(e,t){return new e({type:"transform",transform:t})}function Sb(e,t){return new e({type:"optional",innerType:t})}function _b(e,t){return new e({type:"nullable",innerType:t})}function yb(e,t,o){return new e({type:"default",innerType:t,get defaultValue(){return typeof o=="function"?o():iu(o)}})}function bb(e,t,o){return new e({type:"nonoptional",innerType:t,...z(o)})}function vb(e,t){return new e({type:"success",innerType:t})}function zb(e,t,o){return new e({type:"catch",innerType:t,catchValue:typeof o=="function"?o:()=>o})}function wb(e,t,o){return new e({type:"pipe",in:t,out:o})}function Rb(e,t){return new e({type:"readonly",innerType:t})}function xb(e,t,o){return new e({type:"template_literal",parts:t,...z(o)})}function Pb(e,t){return new e({type:"lazy",getter:t})}function Tb(e,t){return new e({type:"promise",innerType:t})}function oh(e,t,o){let r=z(o);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function rh(e,t,o){return new e({type:"custom",check:"custom",fn:t,...z(o)})}function nh(e,t){let o=hg(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Jo(n,r.value,o._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=o),s.continue??(s.continue=!o._zod.def.abort),r.issues.push(Jo(s))}},e(r.value,r)),t);return o}function hg(e,t){let o=new B({check:"custom",...z(t)});return o._zod.check=e,o}function sh(e){let t=new B({check:"describe"});return t._zod.onattach=[o=>{let r=ne.get(o)??{};ne.add(o,{...r,description:e})}],t._zod.check=()=>{},t}function ih(e){let t=new B({check:"meta"});return t._zod.onattach=[o=>{let r=ne.get(o)??{};ne.add(o,{...r,...e})}],t._zod.check=()=>{},t}function ah(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(_=>typeof _=="string"?_.toLowerCase():_),n=n.map(_=>typeof _=="string"?_.toLowerCase():_));let s=new Set(r),i=new Set(n),c=e.Codec??ns,l=e.Boolean??os,u=e.String??eo,h=new u({type:"string",error:o.error}),f=new l({type:"boolean",error:o.error}),y=new c({type:"pipe",in:h,out:f,transform:((_,v)=>{let k=_;return o.case!=="sensitive"&&(k=k.toLowerCase()),s.has(k)?!0:i.has(k)?!1:(v.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...i],input:v.value,inst:y,continue:!1}),{})}),reverseTransform:((_,v)=>_===!0?r[0]||"true":n[0]||"false"),error:o.error});return y}function ur(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 xt(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??ne,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 H(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 h={...o,schemaPath:[...o.schemaPath,e],path:o.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,h);else{let y=i.schema,_=t.processors[n.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);_(e,t,y,h)}let f=e._zod.parent;f&&(i.ref||(i.ref=f),H(f,t,h),t.seen.get(f).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(i.schema,l),t.io==="input"&&Se(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 Pt(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 f=e.external.registry.get(i[0])?.id,y=e.external.uri??(v=>v);if(f)return{ref:y(f)};let _=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=_,{defId:_,ref:`${y("__shared")}#/${c}/${_}`}}if(i[1]===o)return{ref:"#"};let u=`#/${c}/`,h=i[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:u+h}},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 h=c.schema;for(let f in h)delete h[f];h.$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,h={...u},f=l.ref;if(l.ref=null,f){r(f);let _=e.seen.get(f),z=_.schema;if(z.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(z)):Object.assign(u,z),Object.assign(u,h),c._zod.parent===f)for(let T in u)T==="$ref"||T==="allOf"||T in h||delete u[T];if(z.$ref&&_.def)for(let T in u)T==="$ref"||T==="allOf"||T in _.def&&JSON.stringify(u[T])===JSON.stringify(_.def[T])&&delete u[T]}let y=c._zod.parent;if(y&&y!==f){r(y);let _=e.seen.get(y);if(_?.schema.$ref&&(u.$ref=_.schema.$ref,_.def))for(let z in u)z==="$ref"||z==="allOf"||z in _.def&&JSON.stringify(u[z])===JSON.stringify(_.def[z])&&delete u[z]}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:cr(t,"input",e.processors),output:cr(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function Se(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 Se(r.element,o);if(r.type==="set")return Se(r.valueType,o);if(r.type==="lazy")return Se(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 Se(r.innerType,o);if(r.type==="intersection")return Se(r.left,o)||Se(r.right,o);if(r.type==="record"||r.type==="map")return Se(r.keyType,o)||Se(r.valueType,o);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Se(r.in,o)||Se(r.out,o);if(r.type==="object"){for(let n in r.shape)if(Se(r.shape[n],o))return!0;return!1}if(r.type==="union"){for(let n of r.options)if(Se(n,o))return!0;return!1}if(r.type==="tuple"){for(let n of r.items)if(Se(n,o))return!0;return!!(r.rest&&Se(r.rest,o))}return!1}var ih=(e,t={})=>o=>{let r=wt({...o,processors:t});return H(e,r),Rt(r,e),xt(r,e)},cr=(e,t,o={})=>r=>{let{libraryOptions:n,target:s}=r??{},i=wt({...n??{},target:s,io:t,processors:o});return H(e,i),Rt(i,e),xt(i,e)};var zb={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ah=(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 h=[...l];h.length===1?n.pattern=h[0].source:h.length>1&&(n.allOf=[...h.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},ch=(e,t,o,r)=>{let n=o,{minimum:s,maximum:i,format:c,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:h}=e._zod.bag;typeof c=="string"&&c.includes("int")?n.type="integer":n.type="number";let f=typeof h=="number"&&h>=(s??Number.NEGATIVE_INFINITY),y=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),_=t.target==="draft-04"||t.target==="openapi-3.0";f?_?(n.minimum=h,n.exclusiveMinimum=!0):n.exclusiveMinimum=h: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)},lh=(e,t,o,r)=>{o.type="boolean"},uh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},dh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},ph=(e,t,o,r)=>{t.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},hh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},mh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},fh=(e,t,o,r)=>{o.not={}},gh=(e,t,o,r)=>{},Sh=(e,t,o,r)=>{},_h=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},yh=(e,t,o,r)=>{let n=e._zod.def,s=Hn(n.entries);s.every(i=>typeof i=="number")&&(o.type="number"),s.every(i=>typeof i=="string")&&(o.type="string"),o.enum=s},bh=(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},vh=(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},wh=(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"},xh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Ph=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Th=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},kh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Eh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},$h=(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=H(s.element,t,{...r,path:[...r.path,"items"]})},Ch=(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]=H(i[u],t,{...r,path:[...r.path,"properties",u]});let c=new Set(Object.keys(i)),l=new Set([...c].filter(u=>{let h=s.shape[u]._zod;return t.io==="input"?h.optin===void 0:h.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=H(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Mc=(e,t,o,r)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((c,l)=>H(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",l]}));s?o.oneOf=i:o.anyOf=i},Ih=(e,t,o,r)=>{let n=e._zod.def,s=H(n.left,t,{...r,path:[...r.path,"allOf",0]}),i=H(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},Oh=(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,_)=>H(y,t,{...r,path:[...r.path,i,_]})),u=s.rest?H(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:h,maximum:f}=e._zod.bag;typeof h=="number"&&(n.minItems=h),typeof f=="number"&&(n.maxItems=f)},Nh=(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 h=H(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});n.patternProperties={};for(let f of l)n.patternProperties[f.source]=h}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=H(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=H(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let u=i._zod.values;if(u){let h=[...u].filter(f=>typeof f=="string"||typeof f=="number");h.length>0&&(n.required=h)}},Mh=(e,t,o,r)=>{let n=e._zod.def,s=H(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"}]},Ah=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},qh=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType,o.default=JSON.parse(JSON.stringify(n.defaultValue))},jh=(e,t,o,r)=>{let n=e._zod.def;H(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)))},Lh=(e,t,o,r)=>{let n=e._zod.def;H(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},Uh=(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;H(i,t,r);let c=t.seen.get(e);c.ref=i},Zh=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType,o.readOnly=!0},Dh=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Ac=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Vh=(e,t,o,r)=>{let n=e._zod.innerType;H(n,t,r);let s=t.seen.get(e);s.ref=n},Nc={string:ah,number:ch,boolean:lh,bigint:uh,symbol:dh,null:ph,undefined:hh,void:mh,never:fh,any:gh,unknown:Sh,date:_h,enum:yh,literal:bh,nan:vh,template_literal:zh,file:wh,success:Rh,custom:xh,function:Ph,transform:Th,map:kh,set:Eh,array:$h,object:Ch,union:Mc,intersection:Ih,tuple:Oh,record:Nh,nullable:Mh,nonoptional:Ah,default:qh,prefault:jh,catch:Lh,pipe:Uh,readonly:Zh,promise:Dh,optional:Ac,lazy:Vh};function ro(e,t){if("_idmap"in e){let r=e,n=wt({...t,processors:Nc}),s={};for(let l of r._idmap.entries()){let[u,h]=l;H(h,n)}let i={},c={registry:r,uri:t?.uri,defs:s};n.external=c;for(let l of r._idmap.entries()){let[u,h]=l;Rt(n,h),i[u]=xt(n,h)}if(Object.keys(s).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[l]:s}}return{schemas:i}}let o=wt({...t,processors:Nc});return H(e,o),Rt(o,e),xt(o,e)}var qc=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=wt({processors:Nc,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 H(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)),Rt(this.ctx,t);let r=xt(this.ctx,t),{"~standard":n,...s}=r;return s}};var ug={};var as={};Xe(as,{ZodAny:()=>lm,ZodArray:()=>hm,ZodBase64:()=>sl,ZodBase64URL:()=>il,ZodBigInt:()=>gr,ZodBigIntFormat:()=>ll,ZodBoolean:()=>fr,ZodCIDRv4:()=>rl,ZodCIDRv6:()=>nl,ZodCUID:()=>Kc,ZodCUID2:()=>Yc,ZodCatch:()=>Om,ZodCodec:()=>Ss,ZodCustom:()=>_s,ZodCustomStringFormat:()=>hr,ZodDate:()=>hs,ZodDefault:()=>Tm,ZodDiscriminatedUnion:()=>fm,ZodE164:()=>al,ZodEmail:()=>Jc,ZodEmoji:()=>Gc,ZodEnum:()=>ur,ZodExactOptional:()=>Rm,ZodFile:()=>zm,ZodFunction:()=>Dm,ZodGUID:()=>ls,ZodIPv4:()=>tl,ZodIPv6:()=>ol,ZodIntersection:()=>gm,ZodJWT:()=>cl,ZodKSUID:()=>el,ZodLazy:()=>Um,ZodLiteral:()=>vm,ZodMAC:()=>sm,ZodMap:()=>ym,ZodNaN:()=>Mm,ZodNanoID:()=>Wc,ZodNever:()=>dm,ZodNonOptional:()=>ml,ZodNull:()=>cm,ZodNullable:()=>Pm,ZodNumber:()=>mr,ZodNumberFormat:()=>no,ZodObject:()=>ms,ZodOptional:()=>hl,ZodPipe:()=>gs,ZodPrefault:()=>Em,ZodPreprocess:()=>Am,ZodPromise:()=>Zm,ZodReadonly:()=>qm,ZodRecord:()=>lr,ZodSet:()=>bm,ZodString:()=>dr,ZodStringFormat:()=>J,ZodSuccess:()=>Im,ZodSymbol:()=>im,ZodTemplateLiteral:()=>Lm,ZodTransform:()=>wm,ZodTuple:()=>Sm,ZodType:()=>q,ZodULID:()=>Qc,ZodURL:()=>ps,ZodUUID:()=>De,ZodUndefined:()=>am,ZodUnion:()=>fs,ZodUnknown:()=>um,ZodVoid:()=>pm,ZodXID:()=>Xc,ZodXor:()=>mm,_ZodString:()=>Fc,_default:()=>km,_function:()=>pS,any:()=>ul,array:()=>g,base64:()=>Cg,base64url:()=>Ig,bigint:()=>Vg,boolean:()=>R,catch:()=>Nm,check:()=>hS,cidrv4:()=>Eg,cidrv6:()=>$g,codec:()=>cS,cuid:()=>vg,cuid2:()=>zg,custom:()=>mS,date:()=>Wg,describe:()=>fS,discriminatedUnion:()=>Pt,e164:()=>Og,email:()=>Bc,emoji:()=>yg,enum:()=>I,exactOptional:()=>xm,file:()=>nS,float32:()=>Lg,float64:()=>Ug,function:()=>pS,guid:()=>hg,hash:()=>jg,hex:()=>qg,hostname:()=>Ag,httpUrl:()=>_g,instanceof:()=>SS,int:()=>Vc,int32:()=>Zg,int64:()=>Hg,intersection:()=>Me,invertCodec:()=>lS,ipv4:()=>Pg,ipv6:()=>kg,json:()=>yS,jwt:()=>Ng,keyof:()=>Kg,ksuid:()=>xg,lazy:()=>Tt,literal:()=>S,looseObject:()=>C,looseRecord:()=>eS,mac:()=>Tg,map:()=>tS,meta:()=>gS,nan:()=>aS,nanoid:()=>bg,nativeEnum:()=>rS,never:()=>dl,nonoptional:()=>Cm,null:()=>Ve,nullable:()=>us,nullish:()=>sS,number:()=>b,object:()=>p,optional:()=>$,partialRecord:()=>Xg,pipe:()=>Hc,prefault:()=>$m,preprocess:()=>rt,promise:()=>dS,readonly:()=>jm,record:()=>w,refine:()=>Vm,set:()=>oS,strictObject:()=>Yg,string:()=>a,stringFormat:()=>Mg,stringbool:()=>_S,success:()=>iS,superRefine:()=>Hm,symbol:()=>Jg,templateLiteral:()=>uS,transform:()=>pl,tuple:()=>_m,uint32:()=>Dg,uint64:()=>Fg,ulid:()=>wg,undefined:()=>Bg,union:()=>P,unknown:()=>E,url:()=>pr,uuid:()=>mg,uuidv4:()=>fg,uuidv6:()=>gg,uuidv7:()=>Sg,void:()=>Gg,xid:()=>Rg,xor:()=>Qg});var jc={};Xe(jc,{endsWith:()=>er,gt:()=>Ue,gte:()=>ge,includes:()=>Qo,length:()=>oo,lowercase:()=>Ko,lt:()=>Le,lte:()=>xe,maxLength:()=>to,maxSize:()=>zt,mime:()=>tr,minLength:()=>tt,minSize:()=>Ze,multipleOf:()=>vt,negative:()=>$c,nonnegative:()=>Ic,nonpositive:()=>Cc,normalize:()=>or,overwrite:()=>Ne,positive:()=>Ec,property:()=>Oc,regex:()=>Wo,size:()=>eo,slugify:()=>ir,startsWith:()=>Xo,toLowerCase:()=>nr,toUpperCase:()=>sr,trim:()=>rr,uppercase:()=>Yo});var Pe={};Xe(Pe,{ZodISODate:()=>Uc,ZodISODateTime:()=>Lc,ZodISODuration:()=>Dc,ZodISOTime:()=>Zc,date:()=>Fh,datetime:()=>Hh,duration:()=>Bh,time:()=>Jh});var Lc=m("ZodISODateTime",(e,t)=>{vd.init(e,t),J.init(e,t)});function Hh(e){return xp(Lc,e)}var Uc=m("ZodISODate",(e,t)=>{zd.init(e,t),J.init(e,t)});function Fh(e){return Pp(Uc,e)}var Zc=m("ZodISOTime",(e,t)=>{wd.init(e,t),J.init(e,t)});function Jh(e){return Tp(Zc,e)}var Dc=m("ZodISODuration",(e,t)=>{Rd.init(e,t),J.init(e,t)});function Bh(e){return kp(Dc,e)}var dg=(e,t)=>{Wn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>Yn(e,o)},flatten:{value:o=>Kn(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,Zo,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,Zo,2)}},isEmpty:{get(){return e.issues.length===0}}})},Rb=m("ZodError",dg),ve=m("ZodError",dg,{Parent:Error});var Gh=Ho(ve),Wh=Fo(ve),cs=Jo(ve),Kh=Bo(ve),Yh=La(ve),Qh=Ua(ve),Xh=Za(ve),em=Da(ve),tm=Va(ve),om=Ha(ve),rm=Fa(ve),nm=Ja(ve);var pg=new WeakMap;function ds(e,t,o){let r=Object.getPrototypeOf(e),n=pg.get(r);if(n||(n=new Set,pg.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 q=m("ZodType",(e,t)=>(M.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:cr(e,"input"),output:cr(e,"output")}}),e.toJSONSchema=ih(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(o,r)=>Gh(e,o,r,{callee:e.parse}),e.safeParse=(o,r)=>cs(e,o,r),e.parseAsync=async(o,r)=>Wh(e,o,r,{callee:e.parseAsync}),e.safeParseAsync=async(o,r)=>Kh(e,o,r),e.spa=e.safeParseAsync,e.encode=(o,r)=>Yh(e,o,r),e.decode=(o,r)=>Qh(e,o,r),e.encodeAsync=async(o,r)=>Xh(e,o,r),e.decodeAsync=async(o,r)=>em(e,o,r),e.safeEncode=(o,r)=>tm(e,o,r),e.safeDecode=(o,r)=>om(e,o,r),e.safeEncodeAsync=async(o,r)=>rm(e,o,r),e.safeDecodeAsync=async(o,r)=>nm(e,o,r),ds(e,"ZodType",{check(...o){let r=this.def;return this.clone(N.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 me(this,o,r)},brand(){return this},register(o,r){return o.add(this,r),this},refine(o,r){return this.check(Vm(o,r))},superRefine(o,r){return this.check(Hm(o,r))},overwrite(o){return this.check(Ne(o))},optional(){return $(this)},exactOptional(){return xm(this)},nullable(){return us(this)},nullish(){return $(us(this))},nonoptional(o){return Cm(this,o)},array(){return g(this)},or(o){return P([this,o])},and(o){return Me(this,o)},transform(o){return Hc(this,pl(o))},default(o){return km(this,o)},prefault(o){return $m(this,o)},catch(o){return Nm(this,o)},pipe(o){return Hc(this,o)},readonly(){return jm(this)},describe(o){let r=this.clone();return ne.add(r,{description:o}),r},meta(...o){if(o.length===0)return ne.get(this);let r=this.clone();return ne.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 ne.get(e)?.description},configurable:!0}),e)),Fc=m("_ZodString",(e,t)=>{Xt.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ah(e,r,n,s);let o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,ds(e,"_ZodString",{regex(...r){return this.check(Wo(...r))},includes(...r){return this.check(Qo(...r))},startsWith(...r){return this.check(Xo(...r))},endsWith(...r){return this.check(er(...r))},min(...r){return this.check(tt(...r))},max(...r){return this.check(to(...r))},length(...r){return this.check(oo(...r))},nonempty(...r){return this.check(tt(1,...r))},lowercase(r){return this.check(Ko(r))},uppercase(r){return this.check(Yo(r))},trim(){return this.check(rr())},normalize(...r){return this.check(or(...r))},toLowerCase(){return this.check(nr())},toUpperCase(){return this.check(sr())},slugify(){return this.check(ir())}})}),dr=m("ZodString",(e,t)=>{Xt.init(e,t),Fc.init(e,t),e.email=o=>e.check(lc(Jc,o)),e.url=o=>e.check(is(ps,o)),e.jwt=o=>e.check(kc(cl,o)),e.emoji=o=>e.check(mc(Gc,o)),e.guid=o=>e.check(ss(ls,o)),e.uuid=o=>e.check(uc(De,o)),e.uuidv4=o=>e.check(dc(De,o)),e.uuidv6=o=>e.check(pc(De,o)),e.uuidv7=o=>e.check(hc(De,o)),e.nanoid=o=>e.check(fc(Wc,o)),e.guid=o=>e.check(ss(ls,o)),e.cuid=o=>e.check(gc(Kc,o)),e.cuid2=o=>e.check(Sc(Yc,o)),e.ulid=o=>e.check(_c(Qc,o)),e.base64=o=>e.check(xc(sl,o)),e.base64url=o=>e.check(Pc(il,o)),e.xid=o=>e.check(yc(Xc,o)),e.ksuid=o=>e.check(bc(el,o)),e.ipv4=o=>e.check(vc(tl,o)),e.ipv6=o=>e.check(zc(ol,o)),e.cidrv4=o=>e.check(wc(rl,o)),e.cidrv6=o=>e.check(Rc(nl,o)),e.e164=o=>e.check(Tc(al,o)),e.datetime=o=>e.check(Hh(o)),e.date=o=>e.check(Fh(o)),e.time=o=>e.check(Jh(o)),e.duration=o=>e.check(Bh(o))});function a(e){return vp(dr,e)}var J=m("ZodStringFormat",(e,t)=>{F.init(e,t),Fc.init(e,t)}),Jc=m("ZodEmail",(e,t)=>{pd.init(e,t),J.init(e,t)});function Bc(e){return lc(Jc,e)}var ls=m("ZodGUID",(e,t)=>{ud.init(e,t),J.init(e,t)});function hg(e){return ss(ls,e)}var De=m("ZodUUID",(e,t)=>{dd.init(e,t),J.init(e,t)});function mg(e){return uc(De,e)}function fg(e){return dc(De,e)}function gg(e){return pc(De,e)}function Sg(e){return hc(De,e)}var ps=m("ZodURL",(e,t)=>{hd.init(e,t),J.init(e,t)});function pr(e){return is(ps,e)}function _g(e){return is(ps,{protocol:Re.httpProtocol,hostname:Re.domain,...N.normalizeParams(e)})}var Gc=m("ZodEmoji",(e,t)=>{md.init(e,t),J.init(e,t)});function yg(e){return mc(Gc,e)}var Wc=m("ZodNanoID",(e,t)=>{fd.init(e,t),J.init(e,t)});function bg(e){return fc(Wc,e)}var Kc=m("ZodCUID",(e,t)=>{gd.init(e,t),J.init(e,t)});function vg(e){return gc(Kc,e)}var Yc=m("ZodCUID2",(e,t)=>{Sd.init(e,t),J.init(e,t)});function zg(e){return Sc(Yc,e)}var Qc=m("ZodULID",(e,t)=>{_d.init(e,t),J.init(e,t)});function wg(e){return _c(Qc,e)}var Xc=m("ZodXID",(e,t)=>{yd.init(e,t),J.init(e,t)});function Rg(e){return yc(Xc,e)}var el=m("ZodKSUID",(e,t)=>{bd.init(e,t),J.init(e,t)});function xg(e){return bc(el,e)}var tl=m("ZodIPv4",(e,t)=>{xd.init(e,t),J.init(e,t)});function Pg(e){return vc(tl,e)}var sm=m("ZodMAC",(e,t)=>{Td.init(e,t),J.init(e,t)});function Tg(e){return wp(sm,e)}var ol=m("ZodIPv6",(e,t)=>{Pd.init(e,t),J.init(e,t)});function kg(e){return zc(ol,e)}var rl=m("ZodCIDRv4",(e,t)=>{kd.init(e,t),J.init(e,t)});function Eg(e){return wc(rl,e)}var nl=m("ZodCIDRv6",(e,t)=>{Ed.init(e,t),J.init(e,t)});function $g(e){return Rc(nl,e)}var sl=m("ZodBase64",(e,t)=>{Cd.init(e,t),J.init(e,t)});function Cg(e){return xc(sl,e)}var il=m("ZodBase64URL",(e,t)=>{Id.init(e,t),J.init(e,t)});function Ig(e){return Pc(il,e)}var al=m("ZodE164",(e,t)=>{Od.init(e,t),J.init(e,t)});function Og(e){return Tc(al,e)}var cl=m("ZodJWT",(e,t)=>{Nd.init(e,t),J.init(e,t)});function Ng(e){return kc(cl,e)}var hr=m("ZodCustomStringFormat",(e,t)=>{Md.init(e,t),J.init(e,t)});function Mg(e,t,o={}){return ar(hr,e,t,o)}function Ag(e){return ar(hr,"hostname",Re.hostname,e)}function qg(e){return ar(hr,"hex",Re.hex,e)}function jg(e,t){let o=t?.enc??"hex",r=`${e}_${o}`,n=Re[r];if(!n)throw new Error(`Unrecognized hash format: ${r}`);return ar(hr,r,n,t)}var mr=m("ZodNumber",(e,t)=>{tc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ch(e,r,n,s),ds(e,"ZodNumber",{gt(r,n){return this.check(Ue(r,n))},gte(r,n){return this.check(ge(r,n))},min(r,n){return this.check(ge(r,n))},lt(r,n){return this.check(Le(r,n))},lte(r,n){return this.check(xe(r,n))},max(r,n){return this.check(xe(r,n))},int(r){return this.check(Vc(r))},safe(r){return this.check(Vc(r))},positive(r){return this.check(Ue(0,r))},nonnegative(r){return this.check(ge(0,r))},negative(r){return this.check(Le(0,r))},nonpositive(r){return this.check(xe(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 Ep(mr,e)}var no=m("ZodNumberFormat",(e,t)=>{Ad.init(e,t),mr.init(e,t)});function Vc(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)}function Dg(e){return Mp(no,e)}var fr=m("ZodBoolean",(e,t)=>{ts.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>lh(e,o,r,n)});function R(e){return Ap(fr,e)}var gr=m("ZodBigInt",(e,t)=>{oc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,s)=>uh(e,r,n,s),e.gte=(r,n)=>e.check(ge(r,n)),e.min=(r,n)=>e.check(ge(r,n)),e.gt=(r,n)=>e.check(Ue(r,n)),e.gte=(r,n)=>e.check(ge(r,n)),e.min=(r,n)=>e.check(ge(r,n)),e.lt=(r,n)=>e.check(Le(r,n)),e.lte=(r,n)=>e.check(xe(r,n)),e.max=(r,n)=>e.check(xe(r,n)),e.positive=r=>e.check(Ue(BigInt(0),r)),e.negative=r=>e.check(Le(BigInt(0),r)),e.nonpositive=r=>e.check(xe(BigInt(0),r)),e.nonnegative=r=>e.check(ge(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 Vg(e){return jp(gr,e)}var ll=m("ZodBigIntFormat",(e,t)=>{qd.init(e,t),gr.init(e,t)});function Hg(e){return Up(ll,e)}function Fg(e){return Zp(ll,e)}var im=m("ZodSymbol",(e,t)=>{jd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>dh(e,o,r,n)});function Jg(e){return Dp(im,e)}var am=m("ZodUndefined",(e,t)=>{Ld.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>hh(e,o,r,n)});function Bg(e){return Vp(am,e)}var cm=m("ZodNull",(e,t)=>{Ud.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ph(e,o,r,n)});function Ve(e){return Hp(cm,e)}var lm=m("ZodAny",(e,t)=>{Zd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>gh(e,o,r,n)});function ul(){return Fp(lm)}var um=m("ZodUnknown",(e,t)=>{Dd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Sh(e,o,r,n)});function E(){return Jp(um)}var dm=m("ZodNever",(e,t)=>{Vd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>fh(e,o,r,n)});function dl(e){return Bp(dm,e)}var pm=m("ZodVoid",(e,t)=>{Hd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>mh(e,o,r,n)});function Gg(e){return Gp(pm,e)}var hs=m("ZodDate",(e,t)=>{Fd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,s)=>_h(e,r,n,s),e.min=(r,n)=>e.check(ge(r,n)),e.max=(r,n)=>e.check(xe(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(hs,e)}var hm=m("ZodArray",(e,t)=>{Jd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>$h(e,o,r,n),e.element=t.element,ds(e,"ZodArray",{min(o,r){return this.check(tt(o,r))},nonempty(o){return this.check(tt(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 g(e,t){return Qp(hm,e,t)}function Kg(e){let t=e._zod.def.shape;return I(Object.keys(t))}var ms=m("ZodObject",(e,t)=>{Bd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ch(e,o,r,n),N.defineLazy(e,"shape",()=>t.shape),ds(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:E()})},loose(){return this.clone({...this._zod.def,catchall:E()})},strict(){return this.clone({...this._zod.def,catchall:dl()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(o){return N.extend(this,o)},safeExtend(o){return N.safeExtend(this,o)},merge(o){return N.merge(this,o)},pick(o){return N.pick(this,o)},omit(o){return N.omit(this,o)},partial(...o){return N.partial(hl,this,o[0])},required(...o){return N.required(ml,this,o[0])}})});function p(e,t){let o={type:"object",shape:e??{},...N.normalizeParams(t)};return new ms(o)}function Yg(e,t){return new ms({type:"object",shape:e,catchall:dl(),...N.normalizeParams(t)})}function C(e,t){return new ms({type:"object",shape:e,catchall:E(),...N.normalizeParams(t)})}var fs=m("ZodUnion",(e,t)=>{os.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Mc(e,o,r,n),e.options=t.options});function P(e,t){return new fs({type:"union",options:e,...N.normalizeParams(t)})}var mm=m("ZodXor",(e,t)=>{fs.init(e,t),Gd.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Mc(e,o,r,n),e.options=t.options});function Qg(e,t){return new mm({type:"union",options:e,inclusive:!1,...N.normalizeParams(t)})}var fm=m("ZodDiscriminatedUnion",(e,t)=>{fs.init(e,t),Wd.init(e,t)});function Pt(e,t,o){return new fm({type:"union",options:t,discriminator:e,...N.normalizeParams(o)})}var gm=m("ZodIntersection",(e,t)=>{Kd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ih(e,o,r,n)});function Me(e,t){return new gm({type:"intersection",left:e,right:t})}var Sm=m("ZodTuple",(e,t)=>{rc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Oh(e,o,r,n),e.rest=o=>e.clone({...e._zod.def,rest:o})});function _m(e,t,o){let r=t instanceof M,n=r?o:t,s=r?t:null;return new Sm({type:"tuple",items:e,rest:s,...N.normalizeParams(n)})}var lr=m("ZodRecord",(e,t)=>{Yd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Nh(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function w(e,t,o){return!t||!t._zod?new lr({type:"record",keyType:a(),valueType:e,...N.normalizeParams(t)}):new lr({type:"record",keyType:e,valueType:t,...N.normalizeParams(o)})}function Xg(e,t,o){let r=me(e);return r._zod.values=void 0,new lr({type:"record",keyType:r,valueType:t,...N.normalizeParams(o)})}function eS(e,t,o){return new lr({type:"record",keyType:e,valueType:t,mode:"loose",...N.normalizeParams(o)})}var ym=m("ZodMap",(e,t)=>{Qd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>kh(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...o)=>e.check(Ze(...o)),e.nonempty=o=>e.check(Ze(1,o)),e.max=(...o)=>e.check(zt(...o)),e.size=(...o)=>e.check(eo(...o))});function tS(e,t,o){return new ym({type:"map",keyType:e,valueType:t,...N.normalizeParams(o)})}var bm=m("ZodSet",(e,t)=>{Xd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Eh(e,o,r,n),e.min=(...o)=>e.check(Ze(...o)),e.nonempty=o=>e.check(Ze(1,o)),e.max=(...o)=>e.check(zt(...o)),e.size=(...o)=>e.check(eo(...o))});function oS(e,t){return new bm({type:"set",valueType:e,...N.normalizeParams(t)})}var ur=m("ZodEnum",(e,t)=>{ep.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,s)=>yh(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 ur({...t,checks:[],...N.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 ur({...t,checks:[],...N.normalizeParams(n),entries:s})}});function I(e,t){let o=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ur({type:"enum",entries:o,...N.normalizeParams(t)})}function rS(e,t){return new ur({type:"enum",entries:e,...N.normalizeParams(t)})}var vm=m("ZodLiteral",(e,t)=>{tp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>bh(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 S(e,t){return new vm({type:"literal",values:Array.isArray(e)?e:[e],...N.normalizeParams(t)})}var zm=m("ZodFile",(e,t)=>{op.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>wh(e,o,r,n),e.min=(o,r)=>e.check(Ze(o,r)),e.max=(o,r)=>e.check(zt(o,r)),e.mime=(o,r)=>e.check(tr(Array.isArray(o)?o:[o],r))});function nS(e){return Xp(zm,e)}var wm=m("ZodTransform",(e,t)=>{rp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Th(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(N.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(N.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 pl(e){return new wm({type:"transform",transform:e})}var hl=m("ZodOptional",(e,t)=>{nc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ac(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function $(e){return new hl({type:"optional",innerType:e})}var Rm=m("ZodExactOptional",(e,t)=>{np.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ac(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function xm(e){return new Rm({type:"optional",innerType:e})}var Pm=m("ZodNullable",(e,t)=>{sp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Mh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function us(e){return new Pm({type:"nullable",innerType:e})}function sS(e){return $(us(e))}var Tm=m("ZodDefault",(e,t)=>{ip.init(e,t),q.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 km(e,t){return new Tm({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():N.shallowClone(t)}})}var Em=m("ZodPrefault",(e,t)=>{ap.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>jh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function $m(e,t){return new Em({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():N.shallowClone(t)}})}var ml=m("ZodNonOptional",(e,t)=>{cp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ah(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Cm(e,t){return new ml({type:"nonoptional",innerType:e,...N.normalizeParams(t)})}var Im=m("ZodSuccess",(e,t)=>{lp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Rh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function iS(e){return new Im({type:"success",innerType:e})}var Om=m("ZodCatch",(e,t)=>{up.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Lh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Nm(e,t){return new Om({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Mm=m("ZodNaN",(e,t)=>{dp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>vh(e,o,r,n)});function aS(e){return Yp(Mm,e)}var gs=m("ZodPipe",(e,t)=>{sc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Uh(e,o,r,n),e.in=t.in,e.out=t.out});function Hc(e,t){return new gs({type:"pipe",in:e,out:t})}var Ss=m("ZodCodec",(e,t)=>{gs.init(e,t),rs.init(e,t)});function cS(e,t,o){return new Ss({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}function lS(e){let t=e._zod.def;return new Ss({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Am=m("ZodPreprocess",(e,t)=>{gs.init(e,t),pp.init(e,t)}),qm=m("ZodReadonly",(e,t)=>{hp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Zh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function jm(e){return new qm({type:"readonly",innerType:e})}var Lm=m("ZodTemplateLiteral",(e,t)=>{mp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>zh(e,o,r,n)});function uS(e,t){return new Lm({type:"template_literal",parts:e,...N.normalizeParams(t)})}var Um=m("ZodLazy",(e,t)=>{Sp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Vh(e,o,r,n),e.unwrap=()=>e._zod.def.getter()});function Tt(e){return new Um({type:"lazy",getter:e})}var Zm=m("ZodPromise",(e,t)=>{gp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Dh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function dS(e){return new Zm({type:"promise",innerType:e})}var Dm=m("ZodFunction",(e,t)=>{fp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ph(e,o,r,n)});function pS(e){return new Dm({type:"function",input:Array.isArray(e?.input)?_m(e?.input):e?.input??g(E()),output:e?.output??E()})}var _s=m("ZodCustom",(e,t)=>{_p.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>xh(e,o,r,n)});function hS(e){let t=new B({check:"custom"});return t._zod.check=e,t}function mS(e,t){return eh(_s,e??(()=>!0),t)}function Vm(e,t={}){return th(_s,e,t)}function Hm(e,t){return oh(e,t)}var fS=rh,gS=nh;function SS(e,t={}){let o=new _s({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...N.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 _S=(...e)=>sh({Codec:Ss,Boolean:fr,String:dr},...e);function yS(e){let t=Tt(()=>P([a(e),b(),R(),Ve(),g(t),w(a(),t)]));return t}function rt(e,t){return new Am({type:"pipe",in:pl(e),out:t})}var Jm={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 Pb(e){Q({customError:e})}function Tb(){return Q().customError}var Fm;Fm||(Fm={});var x={...as,...jc,iso:Pe},kb=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 Eb(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 $b(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 bS(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return x.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 x.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=$b(n,t),i=ue(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 x.null();if(n.length===0)return x.never();if(n.length===1)return x.literal(n[0]);if(n.every(i=>typeof i=="string"))return x.enum(n);let s=n.map(i=>x.literal(i));return s.length<2?s[0]:x.union([s[0],s[1],...s.slice(2)])}if(e.const!==void 0)return x.literal(e.const);let o=e.type;if(Array.isArray(o)){let n=o.map(s=>{let i={...e,type:s};return bS(i,t)});return n.length===0?x.never():n.length===1?n[0]:x.union(n)}if(!o)return x.any();let r;switch(o){case"string":{let n=x.string();if(e.format){let s=e.format;s==="email"?n=n.check(x.email()):s==="uri"||s==="uri-reference"?n=n.check(x.url()):s==="uuid"||s==="guid"?n=n.check(x.uuid()):s==="date-time"?n=n.check(x.iso.datetime()):s==="date"?n=n.check(x.iso.date()):s==="time"?n=n.check(x.iso.time()):s==="duration"?n=n.check(x.iso.duration()):s==="ipv4"?n=n.check(x.ipv4()):s==="ipv6"?n=n.check(x.ipv6()):s==="mac"?n=n.check(x.mac()):s==="cidr"?n=n.check(x.cidrv4()):s==="cidr-v6"?n=n.check(x.cidrv6()):s==="base64"?n=n.check(x.base64()):s==="base64url"?n=n.check(x.base64url()):s==="e164"?n=n.check(x.e164()):s==="jwt"?n=n.check(x.jwt()):s==="emoji"?n=n.check(x.emoji()):s==="nanoid"?n=n.check(x.nanoid()):s==="cuid"?n=n.check(x.cuid()):s==="cuid2"?n=n.check(x.cuid2()):s==="ulid"?n=n.check(x.ulid()):s==="xid"?n=n.check(x.xid()):s==="ksuid"&&(n=n.check(x.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"?x.number().int():x.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=x.boolean();break}case"null":{r=x.null();break}case"object":{let n={},s=e.properties||{},i=new Set(e.required||[]);for(let[l,u]of Object.entries(s)){let h=ue(u,t);n[l]=i.has(l)?h:h.optional()}if(e.propertyNames){let l=ue(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?ue(e.additionalProperties,t):x.any();if(Object.keys(n).length===0){r=x.record(l,u);break}let h=x.object(n).passthrough(),f=x.looseRecord(l,u);r=x.intersection(h,f);break}if(e.patternProperties){let l=e.patternProperties,u=Object.keys(l),h=[];for(let y of u){let _=ue(l[y],t),z=x.string().regex(new RegExp(y));h.push(x.looseRecord(z,_))}let f=[];if(Object.keys(n).length>0&&f.push(x.object(n).passthrough()),f.push(...h),f.length===0)r=x.object({}).passthrough();else if(f.length===1)r=f[0];else{let y=x.intersection(f[0],f[1]);for(let _=2;_<f.length;_++)y=x.intersection(y,f[_]);r=y}break}let c=x.object(n);e.additionalProperties===!1?r=c.strict():typeof e.additionalProperties=="object"?r=c.catchall(ue(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=>ue(l,t)),c=s&&typeof s=="object"&&!Array.isArray(s)?ue(s,t):void 0;c?r=x.tuple(i).rest(c):r=x.tuple(i),typeof e.minItems=="number"&&(r=r.check(x.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(x.maxLength(e.maxItems)))}else if(Array.isArray(s)){let i=s.map(l=>ue(l,t)),c=e.additionalItems&&typeof e.additionalItems=="object"?ue(e.additionalItems,t):void 0;c?r=x.tuple(i).rest(c):r=x.tuple(i),typeof e.minItems=="number"&&(r=r.check(x.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(x.maxLength(e.maxItems)))}else if(s!==void 0){let i=ue(s,t),c=x.array(i);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),r=c}else r=x.array(x.any());break}default:throw new Error(`Unsupported type: ${o}`)}return r}function ue(e,t){if(typeof e=="boolean")return e?x.any():x.never();let o=bS(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=>ue(u,t)),l=x.union(c);o=r?x.intersection(o,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(u=>ue(u,t)),l=x.xor(c);o=r?x.intersection(o,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)o=r?o:x.any();else{let c=r?o:ue(e.allOf[0],t),l=r?0:1;for(let u=l;u<e.allOf.length;u++)c=x.intersection(c,ue(e.allOf[u],t));o=c}e.nullable===!0&&t.version==="openapi-3.0"&&(o=x.nullable(o)),e.readOnly===!0&&(o=x.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))kb.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 vS(e,t){if(typeof e=="boolean")return e?x.any():x.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=Eb(o,t?.defaultTarget),n=o.$defs||o.definitions||{},s={version:r,defs:n,refs:new Map,processing:new Set,rootSchema:o,registry:t?.registry??ne};return ue(o,s)}var ys={};Xe(ys,{bigint:()=>Nb,boolean:()=>Ob,date:()=>Mb,number:()=>Ib,string:()=>Cb});function Cb(e){return zp(dr,e)}function Ib(e){return $p(mr,e)}function Ob(e){return qp(fr,e)}function Nb(e){return Lp(gr,e)}function Mb(e){return Kp(hs,e)}Q(ic());var fl="2025-11-25";var gl=[fl,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Sl="io.modelcontextprotocol/related-task",so="io.modelcontextprotocol/protocolVersion",Sr="io.modelcontextprotocol/clientInfo",Et="io.modelcontextprotocol/serverInfo",io="io.modelcontextprotocol/clientCapabilities",_l="io.modelcontextprotocol/subscriptionId",_r="io.modelcontextprotocol/logLevel";var ao="2.0";var nt=Tt(()=>P([a(),b(),R(),Ve(),w(a(),nt),g(nt)])),W=w(a(),nt),yl=g(nt),yr=P([a(),b().int()]),br=a(),bs=p({ttl:b().optional()}),vs=p({taskId:a()}),vr=C({progressToken:yr.optional(),[Sl]:vs.optional()}),re=p({_meta:vr.optional()}),$t=re.extend({task:bs.optional()}),K=p({method:a(),params:re.loose().optional()}),de=p({_meta:vr.optional()}),se=p({method:a(),params:de.loose().optional()}),zr=C({get[Et](){return Fe.optional().catch(void 0)}}),Y=C({_meta:zr.optional()}),Ae=P([a(),b().int()]),wr=p({jsonrpc:S(ao),id:Ae,...K.shape}).strict(),Rr=p({jsonrpc:S(ao),...se.shape}).strict(),co=p({jsonrpc:S(ao),id:Ae,result:Y}).strict(),lo=p({jsonrpc:S(ao),id:Ae.optional(),error:p({code:b().int(),message:a(),data:E().optional()})}).strict(),uo=P([wr,Rr,co,lo]),bl=P([co,lo]),Ct=Y.strict(),zs=de.extend({requestId:Ae.optional(),reason:a().optional()}),xr=se.extend({method:S("notifications/cancelled"),params:zs}),ws=p({src:a(),mimeType:a().optional(),sizes:g(a()).optional(),theme:I(["light","dark"]).optional()}),st=p({icons:g(ws).optional()}),He=p({name:a(),title:a().optional()}),Fe=He.extend({...He.shape,...st.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),qb=Me(p({applyDefaults:R().optional()}),W),jb=rt(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Me(p({form:qb.optional(),url:W.optional()}),W.optional())),vl=C({list:W.optional(),cancel:W.optional(),requests:C({sampling:C({createMessage:W.optional()}).optional(),elicitation:C({create:W.optional()}).optional()}).optional()}),zl=C({list:W.optional(),cancel:W.optional(),requests:C({tools:C({call:W.optional()}).optional()}).optional()}),Rs=p({experimental:w(a(),W).optional(),sampling:p({context:W.optional(),tools:W.optional()}).optional(),elicitation:jb.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:vl.optional(),extensions:w(a(),W).optional()}),xs=re.extend({protocolVersion:a(),capabilities:Rs,clientInfo:Fe}),Ps=K.extend({method:S("initialize"),params:xs}),Pr=p({experimental:w(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:zl.optional(),extensions:w(a(),W).optional()}),Ts=Y.extend({protocolVersion:a(),capabilities:Pr,serverInfo:Fe,instructions:a().optional()}),ks=se.extend({method:S("notifications/initialized"),params:de.optional()}),Es=K.extend({method:S("server/discover"),params:re.optional()}),Tr=Y.extend({supportedVersions:g(a()),capabilities:Pr,instructions:a().optional()}),kr=K.extend({method:S("ping"),params:re.optional()}),$s=p({progress:b(),total:$(b()),message:$(a())}),Cs=p({...de.shape,...$s.shape,progressToken:yr}),Er=se.extend({method:S("notifications/progress"),params:Cs}),Is=re.extend({cursor:br.optional()}),it=K.extend({params:Is.optional()}),at=Y.extend({nextCursor:br.optional()}),$r=p({uri:a(),mimeType:$(a()),_meta:w(a(),E()).optional()}),Cr=$r.extend({text:a()}),Gm=a().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ir=$r.extend({blob:Gm}),ct=I(["user","assistant"]),Je=p({audience:g(ct).optional(),priority:b().min(0).max(1).optional(),lastModified:Pe.datetime({offset:!0}).optional()}),Or=p({...He.shape,...st.shape,uri:a(),description:$(a()),mimeType:$(a()),size:$(b()),annotations:Je.optional(),_meta:$(C({}))}),Os=p({...He.shape,...st.shape,uriTemplate:a(),description:$(a()),mimeType:$(a()),annotations:Je.optional(),_meta:$(C({}))}),Ns=it.extend({method:S("resources/list")}),Ms=at.extend({resources:g(Or)}),As=it.extend({method:S("resources/templates/list")}),qs=at.extend({resourceTemplates:g(Os)}),po=re.extend({uri:a()}),js=po,Ls=K.extend({method:S("resources/read"),params:js}),Us=Y.extend({contents:g(P([Cr,Ir]))}),Zs=se.extend({method:S("notifications/resources/list_changed"),params:de.optional()}),Ds=po,Vs=K.extend({method:S("resources/subscribe"),params:Ds}),Hs=po,Fs=K.extend({method:S("resources/unsubscribe"),params:Hs}),Nr=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:g(a()).optional()}),Js=re.extend({notifications:Nr}),Bs=K.extend({method:S("subscriptions/listen"),params:Js}),Gs=de.extend({notifications:Nr}),Ws=se.extend({method:S("notifications/subscriptions/acknowledged"),params:Gs}),Ks=zr.extend({[_l]:Ae}),Ys=Y.extend({_meta:Ks}),Qs=de.extend({uri:a()}),Xs=se.extend({method:S("notifications/resources/updated"),params:Qs}),ei=p({name:a(),description:$(a()),required:$(R())}),ti=p({...He.shape,...st.shape,description:$(a()),arguments:$(g(ei)),_meta:$(C({}))}),oi=it.extend({method:S("prompts/list")}),ri=at.extend({prompts:g(ti)}),ni=re.extend({name:a(),arguments:w(a(),a()).optional()}),si=K.extend({method:S("prompts/get"),params:ni}),ho=p({type:S("text"),text:a(),annotations:Je.optional(),_meta:w(a(),E()).optional()}),mo=p({type:S("image"),data:Gm,mimeType:a(),annotations:Je.optional(),_meta:w(a(),E()).optional()}),fo=p({type:S("audio"),data:Gm,mimeType:a(),annotations:Je.optional(),_meta:w(a(),E()).optional()}),ii=p({type:S("tool_use"),name:a(),id:a(),input:w(a(),E()),_meta:w(a(),E()).optional()}),go=p({type:S("resource"),resource:P([Cr,Ir]),annotations:Je.optional(),_meta:w(a(),E()).optional()}),So=Or.extend({type:S("resource_link")}),Be=P([ho,mo,fo,So,go]),ai=p({role:ct,content:Be}),ci=Y.extend({description:a().optional(),messages:g(ai)}),li=se.extend({method:S("notifications/prompts/list_changed"),params:de.optional()}),ui=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),di=p({taskSupport:I(["required","optional","forbidden"]).optional()}),It=p({...He.shape,...st.shape,description:a().optional(),inputSchema:p({type:S("object"),properties:w(a(),nt).optional(),required:g(a()).optional()}).catchall(E()),outputSchema:C({$schema:a().optional()}).optional(),annotations:ui.optional(),execution:di.optional(),_meta:w(a(),E()).optional()}),pi=it.extend({method:S("tools/list")}),hi=at.extend({tools:g(It)}),Ot=Y.extend({content:g(Be).default([]),structuredContent:E().optional(),isError:R().optional()}),wl=Ot.or(Y.extend({toolResult:E()})),mi=$t.extend({name:a(),arguments:w(a(),E()).optional()}),fi=K.extend({method:S("tools/call"),params:mi}),gi=se.extend({method:S("notifications/tools/list_changed"),params:de.optional()}),Rl=p({autoRefresh:R().default(!0),debounceMs:b().int().nonnegative().default(300)}),Mr=I(["debug","info","notice","warning","error","critical","alert","emergency"]),Si=re.extend({level:Mr}),_i=K.extend({method:S("logging/setLevel"),params:Si}),yi=de.extend({level:Mr,logger:a().optional(),data:E()}),bi=se.extend({method:S("notifications/message"),params:yi}),vi=p({name:a().optional()}),zi=p({hints:g(vi).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),wi=p({mode:I(["auto","required","none"]).optional()}),Ri=p({type:S("tool_result"),toolUseId:a().describe("The unique identifier for the corresponding tool call."),content:g(Be),structuredContent:E().optional(),isError:R().optional(),_meta:w(a(),E()).optional()}),xi=Pt("type",[ho,mo,fo]),kt=Pt("type",[ho,mo,fo,ii,Ri]),Pi=p({role:ct,content:P([kt,g(kt)]),_meta:w(a(),E()).optional()}),Ti=$t.extend({messages:g(Pi),modelPreferences:zi.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:g(a()).optional(),metadata:W.optional(),tools:g(It).optional(),toolChoice:wi.optional()}),ki=K.extend({method:S("sampling/createMessage"),params:Ti}),Ei=Y.extend({model:a(),stopReason:$(I(["endTurn","stopSequence","maxTokens"]).or(a())),role:ct,content:xi}),$i=Y.extend({model:a(),stopReason:$(I(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:ct,content:P([kt,g(kt)])}),Ar=p({type:S("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),_o=p({type:S("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:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),default:a().optional()}),jr=p({type:S("string"),title:a().optional(),description:a().optional(),oneOf:g(p({const:a(),title:a()})),default:a().optional()}),Lr=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),enumNames:g(a()).optional(),default:a().optional()}),Ci=P([qr,jr]),Ur=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({type:S("string"),enum:g(a())}),default:g(a()).optional()}),Zr=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({anyOf:g(p({const:a(),title:a()}))}),default:g(a()).optional()}),Ii=P([Ur,Zr]),Oi=P([Lr,Ci,Ii]),Dr=P([Oi,Ar,_o,yo]),bo=$t.extend({mode:S("form").optional(),message:a(),requestedSchema:p({type:S("object"),properties:w(a(),Dr),required:g(a()).optional()}).catchall(E())}),Ni=$t.extend({mode:S("url"),message:a(),elicitationId:a(),url:a().url()}),Mi=P([bo,Ni]),Ai=K.extend({method:S("elicitation/create"),params:Mi}),qi=de.extend({elicitationId:a()}),ji=se.extend({method:S("notifications/elicitation/complete"),params:qi}),Li=Y.extend({action:I(["accept","decline","cancel"]),content:rt(e=>e===null?void 0:e,w(a(),P([a(),b(),R(),g(a())])).optional())}),Ui=p({type:S("ref/resource"),uri:a()}),Zi=p({type:S("ref/prompt"),name:a()}),Di=re.extend({ref:P([Zi,Ui]),argument:p({name:a(),value:a()}),context:p({arguments:w(a(),a()).optional()}).optional()}),Vi=K.extend({method:S("completion/complete"),params:Di}),Hi=Y.extend({completion:C({values:g(a()).max(100),total:$(b().int()),hasMore:$(R())})}),Fi=p({uri:a().startsWith("file://"),name:a().optional(),_meta:w(a(),E()).optional()}),Ji=K.extend({method:S("roots/list"),params:re.optional()}),Bi=Y.extend({roots:g(Fi)}),Gi=se.extend({method:S("notifications/roots/list_changed"),params:de.optional()}),xl=C({ttl:b().optional(),pollInterval:b().optional()}),Wi=I(["working","input_required","completed","failed","cancelled"]),lt=p({taskId:a(),status:Wi,ttl:P([b(),Ve()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:$(b()),statusMessage:$(a())}),Pl=Y.extend({task:lt}),Ki=de.merge(lt),Tl=se.extend({method:S("notifications/tasks/status"),params:Ki}),kl=K.extend({method:S("tasks/get"),params:re.extend({taskId:a()})}),El=Y.merge(lt),$l=K.extend({method:S("tasks/result"),params:re.extend({taskId:a()})}),Cl=Y.loose(),Il=it.extend({method:S("tasks/list")}),Ol=at.extend({tasks:g(lt)}),Nl=K.extend({method:S("tasks/cancel"),params:re.extend({taskId:a()})}),Ml=Y.merge(lt),Al=P([kr,Ps,Es,Vi,_i,si,oi,Ns,As,Ls,Vs,Fs,Bs,fi,pi]),ql=P([xr,Er,ks,Gi]),jl=P([Ct,Ei,$i,Li,Bi]),Ll=P([kr,ki,Ai,Ji]),Ul=P([xr,Er,bi,Xs,Zs,gi,li,Ws,ji]),Zl=P([Ct,Ts,Tr,Hi,ci,ri,Ms,qs,Us,Ot,hi,Ys]),oe=pr().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Jm.custom,message:"URL must be parseable",fatal:!0}),Dn}).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"}),Yi=C({resource:a().url(),authorization_servers:g(oe).optional(),jwks_uri:a().url().optional(),scopes_supported:g(a()).optional(),bearer_methods_supported:g(a()).optional(),resource_signing_alg_values_supported:g(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:g(a()).optional(),dpop_signing_alg_values_supported:g(a()).optional(),dpop_bound_access_tokens_required:R().optional()}),Vr=C({issuer:a(),authorization_endpoint:oe,token_endpoint:oe,registration_endpoint:oe.optional(),scopes_supported:g(a()).optional(),response_types_supported:g(a()),response_modes_supported:g(a()).optional(),grant_types_supported:g(a()).optional(),token_endpoint_auth_methods_supported:g(a()).optional(),token_endpoint_auth_signing_alg_values_supported:g(a()).optional(),service_documentation:oe.optional(),revocation_endpoint:oe.optional(),revocation_endpoint_auth_methods_supported:g(a()).optional(),revocation_endpoint_auth_signing_alg_values_supported:g(a()).optional(),introspection_endpoint:a().optional(),introspection_endpoint_auth_methods_supported:g(a()).optional(),introspection_endpoint_auth_signing_alg_values_supported:g(a()).optional(),code_challenge_methods_supported:g(a()).optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0),dpop_signing_alg_values_supported:g(a()).optional()}),Qi=C({issuer:a(),authorization_endpoint:oe,token_endpoint:oe,userinfo_endpoint:oe.optional(),jwks_uri:oe,registration_endpoint:oe.optional(),scopes_supported:g(a()).optional(),response_types_supported:g(a()),response_modes_supported:g(a()).optional(),grant_types_supported:g(a()).optional(),acr_values_supported:g(a()).optional(),subject_types_supported:g(a()),id_token_signing_alg_values_supported:g(a()),id_token_encryption_alg_values_supported:g(a()).optional(),id_token_encryption_enc_values_supported:g(a()).optional(),userinfo_signing_alg_values_supported:g(a()).optional(),userinfo_encryption_alg_values_supported:g(a()).optional(),userinfo_encryption_enc_values_supported:g(a()).optional(),request_object_signing_alg_values_supported:g(a()).optional(),request_object_encryption_alg_values_supported:g(a()).optional(),request_object_encryption_enc_values_supported:g(a()).optional(),token_endpoint_auth_methods_supported:g(a()).optional(),token_endpoint_auth_signing_alg_values_supported:g(a()).optional(),display_values_supported:g(a()).optional(),claim_types_supported:g(a()).optional(),claims_supported:g(a()).optional(),service_documentation:a().optional(),claims_locales_supported:g(a()).optional(),ui_locales_supported:g(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:oe.optional(),op_tos_uri:oe.optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0)}),Xi=p({...Qi.shape,...Vr.pick({code_challenge_methods_supported:!0}).shape}),ea=p({access_token:a(),id_token:a().optional(),token_type:a(),expires_in:ys.number().optional(),scope:a().optional(),refresh_token:a().optional(),issuer:a().optional().catch(void 0)}).strip(),ta=p({issued_token_type:S("urn:ietf:params:oauth:token-type:id-jag"),access_token:a(),token_type:a().optional(),expires_in:b().optional(),scope:a().optional()}).strip(),oa=p({error:a(),error_description:a().optional(),error_uri:a().optional()}),Bm=oe.optional().or(S("").transform(()=>{})),ra=p({redirect_uris:g(oe),token_endpoint_auth_method:a().optional(),grant_types:g(a()).optional(),response_types:g(a()).optional(),application_type:a().optional(),client_name:a().optional(),client_uri:oe.optional(),logo_uri:Bm,scope:a().optional(),contacts:g(a()).optional(),tos_uri:Bm,policy_uri:a().optional(),jwks_uri:oe.optional(),jwks:ul().optional(),software_id:a().optional(),software_version:a().optional(),software_statement:a().optional()}).strip(),na=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(),sa=ra.merge(na),Dl=p({error:a(),error_description:a().optional()}).strip(),Vl=p({token:a(),token_type_hint:a().optional()}).strip();var ef=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,ef,{value:o,enumerable:!1,configurable:!0})}function Te(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,ef)){let o=t[ef];if(o&&typeof o.has=="function"&&o.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var Lb=class ZS extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return Te(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 Te(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 ZS(t.error,t.error_description??t.error,t.error_uri)}},ie=(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})({}),ee=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return Te(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 Te(this,e)}constructor(e,t,o,r){super(t,r),this.code=e,this.data=o,this.name="SdkError",vo(this,new.target)}},Ub=class extends ee{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 Zb="2026-07-28";function DS(e){return e>=Zb}function VS(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 HS=["task","inputRequests","requestState"];function Db(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||HS.some(t=>t in e)?e:{...e,content:[]}}function Vb(){let e=Tt(()=>P([a(),b(),R(),Ve(),w(a(),e),g(e)])),t=w(a(),e),o=P([a(),b().int()]),r=a(),n=p({ttl:b().optional()}),s=p({taskId:a()}),i=C({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()}),h=p({_meta:i.optional()}),f=p({method:a(),params:h.loose().optional()}),y=C({_meta:i.optional()}),_=P([a(),b().int()]),z=y.strict(),k=h.extend({requestId:_.optional(),reason:a().optional()}),T=f.extend({method:S("notifications/cancelled"),params:k}),O=p({src:a(),mimeType:a().optional(),sizes:g(a()).optional(),theme:I(["light","dark"]).optional()}),j=p({icons:g(O).optional()}),A=p({name:a(),title:a().optional()}),Z=A.extend({...A.shape,...j.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),V=Me(p({applyDefaults:R().optional()}),t),D=rt(le=>le&&typeof le=="object"&&!Array.isArray(le)&&Object.keys(le).length===0?{form:{}}:le,Me(p({form:V.optional(),url:t.optional()}),t.optional())),G=C({list:t.optional(),cancel:t.optional(),requests:C({sampling:C({createMessage:t.optional()}).optional(),elicitation:C({create:t.optional()}).optional()}).optional()}),pe=C({list:t.optional(),cancel:t.optional(),requests:C({tools:C({call:t.optional()}).optional()}).optional()}),te=p({experimental:w(a(),t).optional(),sampling:p({context:t.optional(),tools:t.optional()}).optional(),elicitation:D.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:G.optional(),extensions:w(a(),t).optional()}),ke=c.extend({protocolVersion:a(),capabilities:te,clientInfo:Z}),At=u.extend({method:S("initialize"),params:ke}),Jr=p({experimental:w(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:pe.optional(),extensions:w(a(),t).optional()}),Br=y.extend({protocolVersion:a(),capabilities:Jr,serverInfo:Z,instructions:a().optional()}),Ro=f.extend({method:S("notifications/initialized"),params:h.optional()}),ut=u.extend({method:S("ping"),params:c.optional()}),qt=p({progress:b(),total:$(b()),message:$(a())}),qe=p({...h.shape,...qt.shape,progressToken:o}),dt=f.extend({method:S("notifications/progress"),params:qe}),xo=c.extend({cursor:r.optional()}),Ye=u.extend({params:xo.optional()}),Qe=y.extend({nextCursor:r.optional()}),Po=p({uri:a(),mimeType:$(a()),_meta:w(a(),E()).optional()}),To=Po.extend({text:a()}),jt=a().refine(le=>{try{return atob(le),!0}catch{return!1}},{message:"Invalid Base64 string"}),ko=Po.extend({blob:jt}),je=I(["user","assistant"]),Ce=p({audience:g(je).optional(),priority:b().min(0).max(1).optional(),lastModified:Pe.datetime({offset:!0}).optional()}),Lt=p({...A.shape,...j.shape,uri:a(),description:$(a()),mimeType:$(a()),size:$(b()),annotations:Ce.optional(),_meta:$(C({}))}),Gr=p({...A.shape,...j.shape,uriTemplate:a(),description:$(a()),mimeType:$(a()),annotations:Ce.optional(),_meta:$(C({}))}),Wr=Ye.extend({method:S("resources/list")}),Kr=Qe.extend({resources:g(Lt)}),pt=Ye.extend({method:S("resources/templates/list")}),Eo=Qe.extend({resourceTemplates:g(Gr)}),Ut=c.extend({uri:a()}),Yr=Ut,Qr=u.extend({method:S("resources/read"),params:Yr}),Xr=y.extend({contents:g(P([To,ko]))}),en=f.extend({method:S("notifications/resources/list_changed"),params:h.optional()}),tn=Ut,on=u.extend({method:S("resources/subscribe"),params:tn}),rn=Ut,nn=u.extend({method:S("resources/unsubscribe"),params:rn}),sn=h.extend({uri:a()}),an=f.extend({method:S("notifications/resources/updated"),params:sn}),cn=p({name:a(),description:$(a()),required:$(R())}),ln=p({...A.shape,...j.shape,description:$(a()),arguments:$(g(cn)),_meta:$(C({}))}),un=Ye.extend({method:S("prompts/list")}),dn=Qe.extend({prompts:g(ln)}),pn=c.extend({name:a(),arguments:w(a(),a()).optional()}),hn=u.extend({method:S("prompts/get"),params:pn}),Zt=p({type:S("text"),text:a(),annotations:Ce.optional(),_meta:w(a(),E()).optional()}),Dt=p({type:S("image"),data:jt,mimeType:a(),annotations:Ce.optional(),_meta:w(a(),E()).optional()}),Vt=p({type:S("audio"),data:jt,mimeType:a(),annotations:Ce.optional(),_meta:w(a(),E()).optional()}),mn=p({type:S("tool_use"),name:a(),id:a(),input:w(a(),E()),_meta:w(a(),E()).optional()}),ht=p({type:S("resource"),resource:P([To,ko]),annotations:Ce.optional(),_meta:w(a(),E()).optional()}),fn=Lt.extend({type:S("resource_link")}),Ee=P([Zt,Dt,Vt,fn,ht]),$o=p({role:je,content:Ee}),Co=y.extend({description:a().optional(),messages:g($o)}),Ht=f.extend({method:S("notifications/prompts/list_changed"),params:h.optional()}),gn=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),Io=p({taskSupport:I(["required","optional","forbidden"]).optional()}),Ft=p({...A.shape,...j.shape,description:a().optional(),inputSchema:p({type:S("object"),properties:w(a(),e).optional(),required:g(a()).optional()}).catchall(E()),outputSchema:p({type:S("object"),properties:w(a(),e).optional(),required:g(a()).optional()}).catchall(E()).optional(),annotations:gn.optional(),execution:Io.optional(),_meta:w(a(),E()).optional()}),Oo=Ye.extend({method:S("tools/list")}),No=Qe.extend({tools:g(Ft)}),Mo=y.extend({content:g(Ee),structuredContent:w(a(),E()).optional(),isError:R().optional()}),ce=l.extend({name:a(),arguments:w(a(),E()).optional()}),Sn=u.extend({method:S("tools/call"),params:ce}),ga=f.extend({method:S("notifications/tools/list_changed"),params:h.optional()}),Ao=I(["debug","info","notice","warning","error","critical","alert","emergency"]),_n=c.extend({level:Ao}),yn=u.extend({method:S("logging/setLevel"),params:_n}),bn=h.extend({level:Ao,logger:a().optional(),data:E()}),vn=f.extend({method:S("notifications/message"),params:bn}),zn=p({name:a().optional()}),wn=p({hints:g(zn).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()}),Sa=p({type:S("tool_result"),toolUseId:a().describe("The unique identifier for the corresponding tool call."),content:g(Ee),structuredContent:p({}).loose().optional(),isError:R().optional(),_meta:w(a(),E()).optional()}),xn=Pt("type",[Zt,Dt,Vt]),mt=Pt("type",[Zt,Dt,Vt,mn,Sa]),Pn=p({role:je,content:P([mt,g(mt)]),_meta:w(a(),E()).optional()}),Tn=l.extend({messages:g(Pn),modelPreferences:wn.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:g(a()).optional(),metadata:t.optional(),tools:g(Ft).optional(),toolChoice:Rn.optional()}),kn=u.extend({method:S("sampling/createMessage"),params:Tn}),En=y.extend({model:a(),stopReason:$(I(["endTurn","stopSequence","maxTokens"]).or(a())),role:je,content:xn}),$n=y.extend({model:a(),stopReason:$(I(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:je,content:P([mt,g(mt)])}),Cn=p({type:S("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),In=p({type:S("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()}),Nn=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),default:a().optional()}),Mn=p({type:S("string"),title:a().optional(),description:a().optional(),oneOf:g(p({const:a(),title:a()})),default:a().optional()}),An=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),enumNames:g(a()).optional(),default:a().optional()}),qn=P([Nn,Mn]),Jt=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({type:S("string"),enum:g(a())}),default:g(a()).optional()}),Bt=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({anyOf:g(p({const:a(),title:a()}))}),default:g(a()).optional()}),_a=P([Jt,Bt]),ya=P([An,qn,_a]),ze=P([ya,Cn,In,On]),we=l.extend({mode:S("form").optional(),message:a(),requestedSchema:p({type:S("object"),properties:w(a(),ze),required:g(a()).optional()}).catchall(E())}),jn=l.extend({mode:S("url"),message:a(),elicitationId:a(),url:a().url()}),Ie=P([we,jn]),ba=u.extend({method:S("elicitation/create"),params:Ie}),va=h.extend({elicitationId:a()}),za=f.extend({method:S("notifications/elicitation/complete"),params:va}),wa=y.extend({action:I(["accept","decline","cancel"]),content:rt(le=>le===null?void 0:le,w(a(),P([a(),b(),R(),g(a())])).optional())}),Ra=p({type:S("ref/resource"),uri:a()}),xa=p({type:S("ref/prompt"),name:a()}),Pa=c.extend({ref:P([xa,Ra]),argument:p({name:a(),value:a()}),context:p({arguments:w(a(),a()).optional()}).optional()}),Ln=u.extend({method:S("completion/complete"),params:Pa}),Ta=y.extend({completion:C({values:g(a()).max(100),total:$(b().int()),hasMore:$(R())})}),ka=p({uri:a().startsWith("file://"),name:a().optional(),_meta:w(a(),E()).optional()}),qo=u.extend({method:S("roots/list"),params:c.optional()}),Un=y.extend({roots:g(ka)}),Ea=f.extend({method:S("notifications/roots/list_changed"),params:h.optional()}),$a=C({ttl:b().optional(),pollInterval:b().optional()}),Zn=I(["working","input_required","completed","failed","cancelled"]),ft=p({taskId:a(),status:Zn,ttl:P([b(),Ve()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:$(b()),statusMessage:$(a())}),_e=y.extend({task:ft}),Ca=h.merge(ft),Gt=f.extend({method:S("notifications/tasks/status"),params:Ca}),jo=u.extend({method:S("tasks/get"),params:c.extend({taskId:a()})}),Lo=y.merge(ft),Uo=u.extend({method:S("tasks/result"),params:c.extend({taskId:a()})}),Yl=y.loose(),he=Ye.extend({method:S("tasks/list")}),X=Qe.extend({tasks:g(ft)}),Wt=u.extend({method:S("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:h,NotificationSchema:f,ResultSchema:y,RequestIdSchema:_,EmptyResultSchema:z,CancelledNotificationParamsSchema:k,CancelledNotificationSchema:T,IconSchema:O,IconsSchema:j,BaseMetadataSchema:A,ImplementationSchema:Z,ClientTasksCapabilitySchema:G,ServerTasksCapabilitySchema:pe,ClientCapabilitiesSchema:te,InitializeRequestParamsSchema:ke,InitializeRequestSchema:At,ServerCapabilitiesSchema:Jr,InitializeResultSchema:Br,InitializedNotificationSchema:Ro,PingRequestSchema:ut,ProgressSchema:qt,ProgressNotificationParamsSchema:qe,ProgressNotificationSchema:dt,PaginatedRequestParamsSchema:xo,PaginatedRequestSchema:Ye,PaginatedResultSchema:Qe,ResourceContentsSchema:Po,TextResourceContentsSchema:To,BlobResourceContentsSchema:ko,RoleSchema:je,AnnotationsSchema:Ce,ResourceSchema:Lt,ResourceTemplateSchema:Gr,ListResourcesRequestSchema:Wr,ListResourcesResultSchema:Kr,ListResourceTemplatesRequestSchema:pt,ListResourceTemplatesResultSchema:Eo,ResourceRequestParamsSchema:Ut,ReadResourceRequestParamsSchema:Yr,ReadResourceRequestSchema:Qr,ReadResourceResultSchema:Xr,ResourceListChangedNotificationSchema:en,SubscribeRequestParamsSchema:tn,SubscribeRequestSchema:on,UnsubscribeRequestParamsSchema:rn,UnsubscribeRequestSchema:nn,ResourceUpdatedNotificationParamsSchema:sn,ResourceUpdatedNotificationSchema:an,PromptArgumentSchema:cn,PromptSchema:ln,ListPromptsRequestSchema:un,ListPromptsResultSchema:dn,GetPromptRequestParamsSchema:pn,GetPromptRequestSchema:hn,TextContentSchema:Zt,ImageContentSchema:Dt,AudioContentSchema:Vt,ToolUseContentSchema:mn,EmbeddedResourceSchema:ht,ResourceLinkSchema:fn,ContentBlockSchema:Ee,PromptMessageSchema:$o,GetPromptResultSchema:Co,PromptListChangedNotificationSchema:Ht,ToolAnnotationsSchema:gn,ToolExecutionSchema:Io,ToolSchema:Ft,ListToolsRequestSchema:Oo,ListToolsResultSchema:No,CallToolResultSchema:Mo,CallToolRequestParamsSchema:ce,CallToolRequestSchema:Sn,ToolListChangedNotificationSchema:ga,LoggingLevelSchema:Ao,SetLevelRequestParamsSchema:_n,SetLevelRequestSchema:yn,LoggingMessageNotificationParamsSchema:bn,LoggingMessageNotificationSchema:vn,ModelHintSchema:zn,ModelPreferencesSchema:wn,ToolChoiceSchema:Rn,ToolResultContentSchema:Sa,SamplingContentSchema:xn,SamplingMessageContentBlockSchema:mt,SamplingMessageSchema:Pn,CreateMessageRequestParamsSchema:Tn,CreateMessageRequestSchema:kn,CreateMessageResultSchema:En,CreateMessageResultWithToolsSchema:$n,BooleanSchemaSchema:Cn,StringSchemaSchema:In,NumberSchemaSchema:On,UntitledSingleSelectEnumSchemaSchema:Nn,TitledSingleSelectEnumSchemaSchema:Mn,LegacyTitledEnumSchemaSchema:An,SingleSelectEnumSchemaSchema:qn,UntitledMultiSelectEnumSchemaSchema:Jt,TitledMultiSelectEnumSchemaSchema:Bt,MultiSelectEnumSchemaSchema:_a,EnumSchemaSchema:ya,PrimitiveSchemaDefinitionSchema:ze,ElicitRequestFormParamsSchema:we,ElicitRequestURLParamsSchema:jn,ElicitRequestParamsSchema:Ie,ElicitRequestSchema:ba,ElicitationCompleteNotificationParamsSchema:va,ElicitationCompleteNotificationSchema:za,ElicitResultSchema:wa,ResourceTemplateReferenceSchema:Ra,PromptReferenceSchema:xa,CompleteRequestParamsSchema:Pa,CompleteRequestSchema:Ln,CompleteResultSchema:Ta,RootSchema:ka,ListRootsRequestSchema:qo,ListRootsResultSchema:Un,RootsListChangedNotificationSchema:Ea,TaskCreationParamsSchema:$a,TaskStatusSchema:Zn,TaskSchema:ft,CreateTaskResultSchema:_e,TaskStatusNotificationParamsSchema:Ca,TaskStatusNotificationSchema:Gt,GetTaskRequestSchema:jo,GetTaskResultSchema:Lo,GetTaskPayloadRequestSchema:Uo,GetTaskPayloadResultSchema:Yl,ListTasksRequestSchema:he,ListTasksResultSchema:X,CancelTaskRequestSchema:Wt,CancelTaskResultSchema:y.merge(ft),ClientRequestSchema:P([ut,At,Ln,yn,hn,un,Wr,pt,Qr,on,nn,Sn,Oo,jo,Uo,he,Wt]),ClientNotificationSchema:P([T,dt,Ro,Ea,Gt]),ClientResultSchema:P([z,En,$n,wa,Un,Lo,X,_e]),ServerRequestSchema:P([ut,kn,ba,qo,jo,Uo,he,Wt]),ServerNotificationSchema:P([T,dt,vn,an,en,ga,Ht,Gt,za]),ServerResultSchema:P([z,Br,Ta,Co,dn,Kr,Eo,Xr,Mo,No,Lo,X,_e]),CallToolResultWireSchema:E().superRefine((le,N_)=>{if(!(typeof le!="object"||le===null||Array.isArray(le)||le.content!==void 0)){for(let Pf of HS)if(Pf in le){N_.addIssue({code:"custom",message:`content is required when the body carries '${Pf}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(Db).pipe(Mo)}}var Hb;function FS(){return Hb??=Vb()}function JS(e){return e.type!=="object"}var Fb=new Set(["const","enum","default","examples"]),Jb=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function CS(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Bb(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(CS(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let o=$f(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&&CS(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:Fb.has(l)?i[l]=u:Jb.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 BS={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},GS={"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},Gb={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},Hl;function af(){if(Hl)return Hl;let e=FS();return Hl={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}},Hl}function WS(e){return Object.prototype.hasOwnProperty.call(BS,e)}function KS(e){return Object.prototype.hasOwnProperty.call(GS,e)}function Wb(e){return Object.prototype.hasOwnProperty.call(Gb,e)}function Kb(e){return Wb(e)?af().resultSchemas[e]:void 0}function Yb(e){return WS(e)?af().requestSchemas[e]:void 0}function Qb(e){return KS(e)?af().notificationSchemas[e]:void 0}var sR=Object.keys(BS),iR=Object.keys(GS);function tf(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Fl(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 IS={ok:!1,reason:"not-in-era"};function OS(e){return tf(e)&&tf(e.outputSchema)&&JS(e.outputSchema)}var cf={era:"2025-11-25",hasRequestMethod:WS,hasNotificationMethod:KS,validateRequest:(e,t)=>Fl(Yb(e),t),validateResult:(e,t)=>Fl(Kb(e),t),validateNotification:(e,t)=>Fl(Qb(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>IS,validateInputResponse:()=>IS,samplingResultVariant:((e,t)=>{let o=FS();return Fl(e?o.CreateMessageResultWithToolsSchema:o.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let o=VS(e),r=o.structuredContent;if(r===void 0)return o;let n=typeof r!="object"||r===null||Array.isArray(r),s=t!==void 0&&JS(t);return!n&&!s?o:{...o,structuredContent:{result:r}}},decodeResult(e,t){if(tf(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=>OS(r))?t:{...t,tools:o.map(r=>OS(r)?{...r,outputSchema:Bb(r.outputSchema)}:r)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function Xb(){let e=Tt(()=>P([a(),b(),R(),Ve(),w(a(),e),g(e)])),t=w(a(),e),o=P([a(),b().int()]),r=a(),n=P([a(),b().int()]),s=I(["user","assistant"]),i=I(["debug","info","notice","warning","error","critical","alert","emergency"]),c=a().refine(X=>{try{return atob(X),!0}catch{return!1}},{message:"Invalid Base64 string"}),l=p({ttl:b().optional()}),u=p({taskId:a()}),h=C({progressToken:o.optional(),"io.modelcontextprotocol/related-task":u.optional()}),f=p({_meta:h.optional()}),y=f.extend({task:l.optional()}),_=p({_meta:h.optional()}),z=p({method:a(),params:_.loose().optional()}),k=p({src:a(),mimeType:a().optional(),sizes:g(a()).optional(),theme:I(["light","dark"]).optional()}),T=p({icons:g(k).optional()}),O=p({name:a(),title:a().optional()}),j=O.extend({...O.shape,...T.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),A=Me(p({applyDefaults:R().optional()}),t),Z=rt(X=>X&&typeof X=="object"&&!Array.isArray(X)&&Object.keys(X).length===0?{form:{}}:X,Me(p({form:A.optional(),url:t.optional()}),t.optional())),V=C({list:t.optional(),cancel:t.optional(),requests:C({sampling:C({createMessage:t.optional()}).optional(),elicitation:C({create:t.optional()}).optional()}).optional()}),D=C({list:t.optional(),cancel:t.optional(),requests:C({tools:C({call:t.optional()}).optional()}).optional()}),G=p({experimental:w(a(),t).optional(),sampling:p({context:t.optional(),tools:t.optional()}).optional(),elicitation:Z.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:V.optional(),extensions:w(a(),t).optional()}),pe=p({experimental:w(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:D.optional(),extensions:w(a(),t).optional()}),te=p({progress:b(),total:$(b()),message:$(a())}),ke=p({..._.shape,...te.shape,progressToken:o}),At=z.extend({method:S("notifications/progress"),params:ke}),Jr=_.extend({level:i,logger:a().optional(),data:E()}),Br=z.extend({method:S("notifications/message"),params:Jr}),Ro=p({uri:a(),mimeType:$(a()),_meta:w(a(),E()).optional()}),ut=Ro.extend({text:a()}),qt=Ro.extend({blob:c}),qe=p({audience:g(s).optional(),priority:b().min(0).max(1).optional(),lastModified:Pe.datetime({offset:!0}).optional()}),dt=p({...O.shape,...T.shape,uri:a(),description:$(a()),mimeType:$(a()),size:$(b()),annotations:qe.optional(),_meta:$(C({}))}),xo=p({...O.shape,...T.shape,uriTemplate:a(),description:$(a()),mimeType:$(a()),annotations:qe.optional(),_meta:$(C({}))}),Ye=z.extend({method:S("notifications/resources/list_changed"),params:_.optional()}),Qe=_.extend({uri:a()}),Po=z.extend({method:S("notifications/resources/updated"),params:Qe}),To=p({name:a(),description:$(a()),required:$(R())}),jt=p({...O.shape,...T.shape,description:$(a()),arguments:$(g(To)),_meta:$(C({}))}),ko=z.extend({method:S("notifications/prompts/list_changed"),params:_.optional()}),je=p({type:S("text"),text:a(),annotations:qe.optional(),_meta:w(a(),E()).optional()}),Ce=p({type:S("image"),data:c,mimeType:a(),annotations:qe.optional(),_meta:w(a(),E()).optional()}),Lt=p({type:S("audio"),data:c,mimeType:a(),annotations:qe.optional(),_meta:w(a(),E()).optional()}),Gr=p({type:S("tool_use"),name:a(),id:a(),input:w(a(),E()),_meta:w(a(),E()).optional()}),Wr=p({type:S("resource"),resource:P([ut,qt]),annotations:qe.optional(),_meta:w(a(),E()).optional()}),Kr=dt.extend({type:S("resource_link")}),pt=P([je,Ce,Lt,Kr,Wr]),Eo=p({role:s,content:pt}),Ut=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),Yr=z.extend({method:S("notifications/tools/list_changed"),params:_.optional()}),Qr=p({name:a().optional()}),Xr=p({hints:g(Qr).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),en=p({mode:I(["auto","required","none"]).optional()}),tn=p({type:S("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),on=p({type:S("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:I(["email","uri","date","date-time"]).optional(),default:a().optional()}),rn=p({type:I(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),nn=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),default:a().optional()}),sn=p({type:S("string"),title:a().optional(),description:a().optional(),oneOf:g(p({const:a(),title:a()})),default:a().optional()}),an=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),enumNames:g(a()).optional(),default:a().optional()}),cn=P([nn,sn]),ln=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({type:S("string"),enum:g(a())}),default:g(a()).optional()}),un=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({anyOf:g(p({const:a(),title:a()}))}),default:g(a()).optional()}),dn=P([ln,un]),pn=P([an,cn,dn]),hn=P([pn,tn,on,rn]),Zt=y.extend({mode:S("form").optional(),message:a(),requestedSchema:p({type:S("object"),properties:w(a(),hn),required:g(a()).optional()}).catchall(E())}),Dt=p({type:S("ref/resource"),uri:a()}),Vt=p({type:S("ref/prompt"),name:a()}),mn=p({uri:a().startsWith("file://"),name:a().optional(),_meta:w(a(),E()).optional()}),ht=G.shape,fn=p({experimental:ht.experimental,sampling:ht.sampling,elicitation:ht.elicitation,roots:ht.roots,extensions:ht.extensions}),Ee=pe.shape,$o=p({experimental:Ee.experimental,logging:Ee.logging,completions:Ee.completions,prompts:Ee.prompts,resources:Ee.resources,tools:Ee.tools,extensions:Ee.extensions}),Co=C({progressToken:o.optional(),[so]:a(),[Sr]:j.optional(),[io]:fn,[_r]:i.optional()}),Ht=p({...O.shape,...T.shape,description:a().optional(),inputSchema:C({$schema:a().optional(),type:S("object")}),outputSchema:C({$schema:a().optional()}).optional(),annotations:Ut.optional(),_meta:w(a(),E()).optional()}),gn=p({type:S("tool_result"),toolUseId:a(),content:g(pt),structuredContent:E().optional(),isError:R().optional(),_meta:w(a(),E()).optional()}),Io=P([je,Ce,Lt,Gr,gn]),Ft=p({role:s,content:P([Io,g(Io)]),_meta:w(a(),E()).optional()}),Oo=a(),No=C({[Et]:j.optional().catch(void 0)}),Mo=No.optional();function ce(X){return C({_meta:Mo,resultType:Oo.default("complete"),...X})}let Sn=ce({}),ga=ce({nextCursor:r.optional()}),Ao=ce({content:g(pt),structuredContent:E().optional(),isError:R().optional()}),_n=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),tools:g(Ht),nextCursor:r.optional()}),yn=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),prompts:g(jt),nextCursor:r.optional()}),bn=ce({description:a().optional(),messages:g(Eo)}),vn=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resources:g(dt),nextCursor:r.optional()}),zn=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resourceTemplates:g(xo),nextCursor:r.optional()}),wn=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),contents:g(P([ut,qt]))}),Rn=ce({completion:p({values:g(a()).max(100),total:b().int().optional(),hasMore:R().optional()}).loose()}),Sa=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"])}),xn=ce({ttlMs:b().int().min(0).catch(0),cacheScope:I(["public","private"]).catch("private"),supportedVersions:g(a()),capabilities:$o,instructions:a().optional()}),mt=p({messages:g(Ft),modelPreferences:Xr.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:g(a()).optional(),metadata:t.optional(),tools:g(Ht).optional(),toolChoice:en.optional()}),Pn=p({method:S("sampling/createMessage"),params:mt}),Tn=p({method:S("roots/list"),params:p({_meta:w(a(),E()).optional()}).optional()}),kn=p({...Ft.shape,model:a(),stopReason:a().optional()}),En=p({roots:g(mn)}),$n=p({action:I(["accept","decline","cancel"]),content:w(a(),P([a(),b(),R(),g(a())])).optional()}),Cn=p({mode:S("url"),message:a(),url:a().url()}),In=P([Zt,Cn]),On=p({method:S("elicitation/create"),params:In}),Nn=P([Pn,Tn,On]),Mn=P([kn,En,$n]),An=w(a(),Nn),qn=w(a(),Mn),Jt=ce({inputRequests:An.optional(),requestState:a().optional()}),Bt={inputResponses:qn.optional(),requestState:a().optional()},_a=p({_meta:Co,...Bt}),ya=C({progressToken:o.optional()});function ze(X,Wt){return p({method:S(X),params:p({_meta:Co,...Wt})})}function we(X,Wt){return p({method:S(X),params:p({_meta:ya.optional(),...Wt}).optional()})}let jn={name:a(),arguments:w(a(),E()).optional(),...Bt},Ie={cursor:r.optional()},ba=ze("tools/call",jn),va=ze("tools/list",Ie),za=ze("prompts/list",Ie),wa=ze("prompts/get",{name:a(),arguments:w(a(),a()).optional(),...Bt}),Ra=ze("resources/list",Ie),xa=ze("resources/templates/list",Ie),Pa=ze("resources/read",{uri:a(),...Bt}),Ln={ref:P([Vt,Dt]),argument:p({name:a(),value:a()}),context:p({arguments:w(a(),a()).optional()}).optional()},Ta=ze("completion/complete",Ln),ka=ze("server/discover",{}),qo=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:g(a()).optional()}),Un={notifications:qo},Ea=ze("subscriptions/listen",Un),$a=No.extend({"io.modelcontextprotocol/subscriptionId":n}),Zn=C({_meta:$a,resultType:Oo.default("complete")}),ft={"tools/call":we("tools/call",jn),"tools/list":we("tools/list",Ie),"prompts/get":we("prompts/get",{name:a(),arguments:w(a(),a()).optional()}),"prompts/list":we("prompts/list",Ie),"resources/list":we("resources/list",Ie),"resources/templates/list":we("resources/templates/list",Ie),"resources/read":we("resources/read",{uri:a()}),"completion/complete":we("completion/complete",Ln),"server/discover":we("server/discover",{}),"subscriptions/listen":we("subscriptions/listen",Un)};function _e(X){return C({_meta:Mo,...X})}let Ca={"tools/call":_e({content:g(pt),structuredContent:E().optional(),isError:R().optional()}),"tools/list":_e({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),tools:g(Ht),nextCursor:r.optional()}),"prompts/get":_e({description:a().optional(),messages:g(Eo)}),"prompts/list":_e({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),prompts:g(jt),nextCursor:r.optional()}),"resources/list":_e({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resources:g(dt),nextCursor:r.optional()}),"resources/templates/list":_e({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resourceTemplates:g(xo),nextCursor:r.optional()}),"resources/read":_e({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),contents:g(P([ut,qt]))}),"completion/complete":_e({completion:p({values:g(a()).max(100),total:b().int().optional(),hasMore:R().optional()}).loose()}),"server/discover":_e({ttlMs:b().int().min(0).catch(0),cacheScope:I(["public","private"]).catch("private"),supportedVersions:g(a()),capabilities:$o,instructions:a().optional()}),"subscriptions/listen":_e({})},Gt=C({"io.modelcontextprotocol/subscriptionId":n.optional()}),jo=p({method:S("notifications/subscriptions/acknowledged"),params:p({_meta:Gt.optional(),notifications:qo})}),Lo=p({_meta:Gt.optional(),requestId:n,reason:a().optional()}),Uo=p({method:S("notifications/cancelled"),params:Lo}),Yl={"notifications/cancelled":Uo,"notifications/progress":At,"notifications/message":Br,"notifications/resources/updated":Po,"notifications/resources/list_changed":Ye,"notifications/tools/list_changed":Yr,"notifications/prompts/list_changed":ko,"notifications/subscriptions/acknowledged":jo},he=X=>p({jsonrpc:S("2.0"),id:P([a(),b().int()]),result:X}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:r,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:l,RelatedTaskMetadataSchema:u,RequestMetaSchema:h,BaseRequestParamsSchema:f,TaskAugmentedRequestParamsSchema:y,NotificationsParamsSchema:_,NotificationSchema:z,IconSchema:k,IconsSchema:T,BaseMetadataSchema:O,ImplementationSchema:j,ClientTasksCapabilitySchema:V,ServerTasksCapabilitySchema:D,ClientCapabilitiesSchema:G,ServerCapabilitiesSchema:pe,ProgressSchema:te,ProgressNotificationParamsSchema:ke,ProgressNotificationSchema:At,LoggingMessageNotificationParamsSchema:Jr,LoggingMessageNotificationSchema:Br,ResourceContentsSchema:Ro,TextResourceContentsSchema:ut,BlobResourceContentsSchema:qt,AnnotationsSchema:qe,ResourceSchema:dt,ResourceTemplateSchema:xo,ResourceListChangedNotificationSchema:Ye,ResourceUpdatedNotificationParamsSchema:Qe,ResourceUpdatedNotificationSchema:Po,PromptArgumentSchema:To,PromptSchema:jt,PromptListChangedNotificationSchema:ko,TextContentSchema:je,ImageContentSchema:Ce,AudioContentSchema:Lt,ToolUseContentSchema:Gr,EmbeddedResourceSchema:Wr,ResourceLinkSchema:Kr,ContentBlockSchema:pt,PromptMessageSchema:Eo,ToolAnnotationsSchema:Ut,ToolListChangedNotificationSchema:Yr,ModelHintSchema:Qr,ModelPreferencesSchema:Xr,ToolChoiceSchema:en,BooleanSchemaSchema:tn,StringSchemaSchema:on,NumberSchemaSchema:rn,UntitledSingleSelectEnumSchemaSchema:nn,TitledSingleSelectEnumSchemaSchema:sn,LegacyTitledEnumSchemaSchema:an,SingleSelectEnumSchemaSchema:cn,UntitledMultiSelectEnumSchemaSchema:ln,TitledMultiSelectEnumSchemaSchema:un,MultiSelectEnumSchemaSchema:dn,EnumSchemaSchema:pn,PrimitiveSchemaDefinitionSchema:hn,ElicitRequestFormParamsSchema:Zt,ResourceTemplateReferenceSchema:Dt,PromptReferenceSchema:Vt,RootSchema:mn,ClientCapabilities2026Schema:fn,ServerCapabilities2026Schema:$o,RequestMetaEnvelopeSchema:Co,ToolSchema:Ht,ToolResultContentSchema:gn,SamplingMessageContentBlockSchema:Io,SamplingMessageSchema:Ft,ResultTypeSchema:Oo,ResultMetaSchema:No,ResultSchema:Sn,PaginatedResultSchema:ga,CallToolResultSchema:Ao,ListToolsResultSchema:_n,ListPromptsResultSchema:yn,GetPromptResultSchema:bn,ListResourcesResultSchema:vn,ListResourceTemplatesResultSchema:zn,ReadResourceResultSchema:wn,CompleteResultSchema:Rn,CacheableResultSchema:Sa,DiscoverResultSchema:xn,CreateMessageRequestParamsSchema:mt,CreateMessageRequestSchema:Pn,ListRootsRequestSchema:Tn,CreateMessageResultSchema:kn,ListRootsResultSchema:En,ElicitResultSchema:$n,ElicitRequestURLParamsSchema:Cn,ElicitRequestParamsSchema:In,ElicitRequestSchema:On,InputRequestSchema:Nn,InputResponseSchema:Mn,InputRequestsSchema:An,InputResponsesSchema:qn,InputRequiredResultSchema:Jt,InputResponseRequestParamsSchema:_a,CallToolRequestSchema:ba,ListToolsRequestSchema:va,ListPromptsRequestSchema:za,GetPromptRequestSchema:wa,ListResourcesRequestSchema:Ra,ListResourceTemplatesRequestSchema:xa,ReadResourceRequestSchema:Pa,CompleteRequestSchema:Ta,DiscoverRequestSchema:ka,SubscriptionFilterSchema:qo,SubscriptionsListenRequestSchema:Ea,SubscriptionsListenResultMetaSchema:$a,SubscriptionsListenResultSchema:Zn,dispatchRequestSchemas:ft,dispatchResultSchemas:Ca,NotificationMetaSchema:Gt,SubscriptionsAcknowledgedNotificationSchema:jo,CancelledNotificationParamsSchema:Lo,CancelledNotificationSchema:Uo,notificationSchemas2026:Yl,JSONRPCResultResponseSchema:he(Sn),CallToolResultResponseSchema:he(P([Ao,Jt])),ListToolsResultResponseSchema:he(_n),ListPromptsResultResponseSchema:he(yn),GetPromptResultResponseSchema:he(P([bn,Jt])),ListResourcesResultResponseSchema:he(vn),ListResourceTemplatesResultResponseSchema:he(zn),ReadResourceResultResponseSchema:he(P([wn,Jt])),CompleteResultResponseSchema:he(Rn),DiscoverResultResponseSchema:he(xn),SubscriptionsListenResultResponseSchema:he(Zn)}}var ev;function Nt(){return ev??=Xb()}var tv=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function ov(e){return tv.includes(e)}var lf=Symbol("modelcontextprotocol.resultCacheHintFallback");function rv(e){return e[lf]}function YS(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function QS(e){return e==="public"||e==="private"}var U=(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})({}),ae=class XS extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return Te(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 Te(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===U.UrlElicitationRequired&&r){let n=r;if(n.elicitations)return new t_(n.elicitations,o)}if(t===U.UnsupportedProtocolVersion&&r){let n=r;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new o_({supported:n.supported,requested:n.requested},o)}if(t===U.InvalidParams||t===U.ResourceNotFound){let n=r;if(typeof n?.uri=="string"&&(t===U.ResourceNotFound||Object.keys(n).length===1))return new e_(n.uri,o)}if(t===U.MissingRequiredClientCapability&&r){let n=r;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities=="object"&&!Array.isArray(n.requiredCapabilities))return new r_({requiredCapabilities:n.requiredCapabilities},o)}return new XS(t,o,r)}},e_=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(U.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},t_=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(U.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},o_=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(U.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},r_=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(U.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},nv=0,sv="private",iv=["tools/call","prompts/get","resources/read"];function av(e,t){let o=t.resultType;if(o===void 0)return{...t,resultType:"complete"};if(o==="complete"||iv.includes(e))return t;throw new ae(U.InternalError,`Handler for ${e} returned resultType '${String(o)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function cv(e,t){let o=rv(t);if(t.resultType!=="complete"||!ov(e))return o===void 0?t:hv(t);let r=t,n=YS(r.ttlMs)?r.ttlMs:dv(o),s=QS(r.cacheScope)?r.cacheScope:pv(o),i={...r,ttlMs:n,cacheScope:s};return delete i[lf],i}function lv(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function uv(e,t){if(t===void 0)return e;let o=e._meta;return o===void 0?{...e,_meta:{[Et]:t}}:!lv(o)||o[Et]!==void 0?e:{...e,_meta:{...o,[Et]:t}}}function dv(e){return e!==void 0&&YS(e.ttlMs)?e.ttlMs:nv}function pv(e){return e!==void 0&&QS(e.cacheScope)?e.cacheScope:sv}function hv(e){let t={...e};return delete t[lf],t}var mv=["elicitation/create","sampling/createMessage","roots/list"],Jl;function n_(){if(Jl)return Jl;let e=Nt();return Jl={request:{"elicitation/create":p({method:S("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":p({method:S("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":p({method:S("roots/list"),params:C({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Jl}function s_(e){return mv.includes(e)}function Wm(e){return s_(e)?n_().request[e]:void 0}function fv(e){return s_(e)?n_().response[e]:void 0}var uf={"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},i_={"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 a_(e){return Object.prototype.hasOwnProperty.call(uf,e)}function c_(e){return Object.prototype.hasOwnProperty.call(i_,e)}function gv(e){return Object.prototype.hasOwnProperty.call(uf,e)}function Sv(e){return a_(e)?Nt().dispatchRequestSchemas[e]:void 0}function _v(e){return gv(e)?Nt().dispatchResultSchemas[e]:void 0}function yv(e){return c_(e)?Nt().notificationSchemas2026[e]:void 0}var aR=Object.keys(uf),cR=Object.keys(i_);function ca(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ia(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 bv={ok:!1,reason:"not-in-era"},vv=[so,io];function zv(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=>ca(c)&&"execution"in c)&&(n().tools=s.map(c=>{if(!ca(c)||!("execution"in c))return c;let l={...c};return delete l.execution,l}));let i=t.capabilities;if(ca(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return o}var df={era:"2026-07-28",hasRequestMethod:a_,hasNotificationMethod:c_,hasInputRequestMethod:e=>Wm(e)!==void 0,validateRequest:(e,t)=>ia(Sv(e),t),validateResult:(e,t)=>ia(_v(e),t),validateNotification:(e,t)=>ia(yv(e),t),validateInputRequest:(e,t)=>ia(Wm(e),t),validateInputResponse:(e,t)=>ia(fv(e),t),samplingResultVariant:()=>bv,outboundEnvelope(e){return{[so]:e.protocolVersion,[Sr]:e.clientInfo,[io]:e.clientCapabilities,...e.logLevel!==void 0&&{[_r]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let r of vv)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=>VS(e),inputRequestSchema:Wm,decodeResult(e,t){if(!ca(t))return{kind:"invalid",error:new ee(ie.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let o=t.resultType;if(o===void 0)return{kind:"invalid",error:new ee(ie.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 ee(ie.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:o})};if(o==="input_required"){let i=t.inputRequests,c=ca(i)?i:{},l=t.requestState,u=t._meta===void 0?void 0:Nt().ResultMetaSchema.safeParse(t._meta),h=u?.success?u.data:void 0;return Object.keys(c).length===0&&typeof l!="string"?{kind:"invalid",error:new ee(ie.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},...h!==void 0&&{_meta:h}}}if(o!=="complete")return{kind:"invalid",error:new ee(ie.UnsupportedResultType,`Unsupported result type '${o}' for ${e}`,{resultType:o,method:e})};let r=wv(),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 ee(ie.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 uv(cv(e,av(e,zv(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("; ")}`}},Bl;function wv(){if(Bl)return Bl;let e=Nt();return Bl={"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},Bl}var pf="2026-07-28";function ua(e){return e!==void 0&&DS(e)?df:cf}function NS(e){return e.revision!==void 0?ua(e.revision).era:e.era==="modern"?df.era:cf.era}function Km(e){return l_.some(t=>t.hasRequestMethod(e))}function Ym(e){return l_.some(t=>t.hasNotificationMethod(e))}function MS(e){return e==="tasks/get"||e==="tasks/cancel"}var l_=[cf,df],Rv=kf({AnnotationsSchema:()=>Je,AudioContentSchema:()=>fo,BaseMetadataSchema:()=>He,BaseRequestParamsSchema:()=>re,BlobResourceContentsSchema:()=>Ir,BooleanSchemaSchema:()=>Ar,CallToolRequestParamsSchema:()=>mi,CallToolRequestSchema:()=>fi,CallToolResultSchema:()=>Ot,CancelTaskRequestSchema:()=>Nl,CancelTaskResultSchema:()=>Ml,CancelledNotificationParamsSchema:()=>zs,CancelledNotificationSchema:()=>xr,ClientCapabilitiesSchema:()=>Rs,ClientNotificationSchema:()=>ql,ClientRequestSchema:()=>Al,ClientResultSchema:()=>jl,ClientTasksCapabilitySchema:()=>vl,CompatibilityCallToolResultSchema:()=>wl,CompleteRequestParamsSchema:()=>Di,CompleteRequestSchema:()=>Vi,CompleteResultSchema:()=>Hi,ContentBlockSchema:()=>Be,CreateMessageRequestParamsSchema:()=>Ti,CreateMessageRequestSchema:()=>ki,CreateMessageResultSchema:()=>Ei,CreateMessageResultWithToolsSchema:()=>$i,CreateTaskResultSchema:()=>Pl,CursorSchema:()=>br,DiscoverRequestSchema:()=>Es,DiscoverResultSchema:()=>Tr,ElicitRequestFormParamsSchema:()=>bo,ElicitRequestParamsSchema:()=>Mi,ElicitRequestSchema:()=>Ai,ElicitRequestURLParamsSchema:()=>Ni,ElicitResultSchema:()=>Li,ElicitationCompleteNotificationParamsSchema:()=>qi,ElicitationCompleteNotificationSchema:()=>ji,EmbeddedResourceSchema:()=>go,EmptyResultSchema:()=>Ct,EnumSchemaSchema:()=>Oi,GetPromptRequestParamsSchema:()=>ni,GetPromptRequestSchema:()=>si,GetPromptResultSchema:()=>ci,GetTaskPayloadRequestSchema:()=>$l,GetTaskPayloadResultSchema:()=>Cl,GetTaskRequestSchema:()=>kl,GetTaskResultSchema:()=>El,IconSchema:()=>ws,IconsSchema:()=>st,ImageContentSchema:()=>mo,ImplementationSchema:()=>Fe,InitializeRequestParamsSchema:()=>xs,InitializeRequestSchema:()=>Ps,InitializeResultSchema:()=>Ts,InitializedNotificationSchema:()=>ks,JSONArraySchema:()=>yl,JSONObjectSchema:()=>W,JSONRPCErrorResponseSchema:()=>lo,JSONRPCMessageSchema:()=>uo,JSONRPCNotificationSchema:()=>Rr,JSONRPCRequestSchema:()=>wr,JSONRPCResponseSchema:()=>bl,JSONRPCResultResponseSchema:()=>co,JSONValueSchema:()=>nt,LegacyTitledEnumSchemaSchema:()=>Lr,ListChangedOptionsBaseSchema:()=>Rl,ListPromptsRequestSchema:()=>oi,ListPromptsResultSchema:()=>ri,ListResourceTemplatesRequestSchema:()=>As,ListResourceTemplatesResultSchema:()=>qs,ListResourcesRequestSchema:()=>Ns,ListResourcesResultSchema:()=>Ms,ListRootsRequestSchema:()=>Ji,ListRootsResultSchema:()=>Bi,ListTasksRequestSchema:()=>Il,ListTasksResultSchema:()=>Ol,ListToolsRequestSchema:()=>pi,ListToolsResultSchema:()=>hi,LoggingLevelSchema:()=>Mr,LoggingMessageNotificationParamsSchema:()=>yi,LoggingMessageNotificationSchema:()=>bi,ModelHintSchema:()=>vi,ModelPreferencesSchema:()=>zi,MultiSelectEnumSchemaSchema:()=>Ii,NotificationSchema:()=>se,NotificationsParamsSchema:()=>de,NumberSchemaSchema:()=>yo,PaginatedRequestParamsSchema:()=>Is,PaginatedRequestSchema:()=>it,PaginatedResultSchema:()=>at,PingRequestSchema:()=>kr,PrimitiveSchemaDefinitionSchema:()=>Dr,ProgressNotificationParamsSchema:()=>Cs,ProgressNotificationSchema:()=>Er,ProgressSchema:()=>$s,ProgressTokenSchema:()=>yr,PromptArgumentSchema:()=>ei,PromptListChangedNotificationSchema:()=>li,PromptMessageSchema:()=>ai,PromptReferenceSchema:()=>Zi,PromptSchema:()=>ti,ReadResourceRequestParamsSchema:()=>js,ReadResourceRequestSchema:()=>Ls,ReadResourceResultSchema:()=>Us,RelatedTaskMetadataSchema:()=>vs,RequestIdSchema:()=>Ae,RequestMetaSchema:()=>vr,RequestSchema:()=>K,ResourceContentsSchema:()=>$r,ResourceLinkSchema:()=>So,ResourceListChangedNotificationSchema:()=>Zs,ResourceRequestParamsSchema:()=>po,ResourceSchema:()=>Or,ResourceTemplateReferenceSchema:()=>Ui,ResourceTemplateSchema:()=>Os,ResourceUpdatedNotificationParamsSchema:()=>Qs,ResourceUpdatedNotificationSchema:()=>Xs,ResultMetaObjectSchema:()=>zr,ResultSchema:()=>Y,RoleSchema:()=>ct,RootSchema:()=>Fi,RootsListChangedNotificationSchema:()=>Gi,SamplingContentSchema:()=>xi,SamplingMessageContentBlockSchema:()=>kt,SamplingMessageSchema:()=>Pi,ServerCapabilitiesSchema:()=>Pr,ServerNotificationSchema:()=>Ul,ServerRequestSchema:()=>Ll,ServerResultSchema:()=>Zl,ServerTasksCapabilitySchema:()=>zl,SetLevelRequestParamsSchema:()=>Si,SetLevelRequestSchema:()=>_i,SingleSelectEnumSchemaSchema:()=>Ci,StringSchemaSchema:()=>_o,SubscribeRequestParamsSchema:()=>Ds,SubscribeRequestSchema:()=>Vs,SubscriptionFilterSchema:()=>Nr,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Gs,SubscriptionsAcknowledgedNotificationSchema:()=>Ws,SubscriptionsListenRequestParamsSchema:()=>Js,SubscriptionsListenRequestSchema:()=>Bs,SubscriptionsListenResultMetaSchema:()=>Ks,SubscriptionsListenResultSchema:()=>Ys,TaskAugmentedRequestParamsSchema:()=>$t,TaskCreationParamsSchema:()=>xl,TaskMetadataSchema:()=>bs,TaskSchema:()=>lt,TaskStatusNotificationParamsSchema:()=>Ki,TaskStatusNotificationSchema:()=>Tl,TaskStatusSchema:()=>Wi,TextContentSchema:()=>ho,TextResourceContentsSchema:()=>Cr,TitledMultiSelectEnumSchemaSchema:()=>Zr,TitledSingleSelectEnumSchemaSchema:()=>jr,ToolAnnotationsSchema:()=>ui,ToolChoiceSchema:()=>wi,ToolExecutionSchema:()=>di,ToolListChangedNotificationSchema:()=>gi,ToolResultContentSchema:()=>Ri,ToolSchema:()=>It,ToolUseContentSchema:()=>ii,UnsubscribeRequestParamsSchema:()=>Hs,UnsubscribeRequestSchema:()=>Fs,UntitledMultiSelectEnumSchemaSchema:()=>Ur,UntitledSingleSelectEnumSchemaSchema:()=>qr});var u_=e=>wr.safeParse(e).success,d_=e=>Rr.safeParse(e).success,of=e=>co.safeParse(e).success,p_=e=>lo.safeParse(e).success;var la=-32020,lR=[{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:[U.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:[la,U.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:[U.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:[U.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:[U.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:[la],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:[U.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:[la],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."}],uR={[U.ParseError]:400,[U.InvalidRequest]:400,[U.MethodNotFound]:404,[U.UnsupportedProtocolVersion]:400,[U.MissingRequiredClientCapability]:400,[la]:400};function hf(e,t){return cs(e,t)}function aa(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function rf(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 AS=!1,nf="draft-2020-12";function xv(e,t="input"){let o=e["~standard"],r;if(o.jsonSchema)r=o.jsonSchema[t]({target:nf});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().");AS||(AS=!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:nf,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:h_(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 h_(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"||h_(r)))}return!1}function Pv(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function Qm(e,t){let o=await e["~standard"].validate(t);return o.issues&&o.issues.length>0?{success:!1,error:o.issues.map(r=>Pv(r)).join(", ")}:{success:!0,data:o.value}}function Tv(e){let t=ro(e,{target:nf,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var kv=/\\\.\\d\{(\d+)\}/;function Ev(e){let t=kv.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=>Pe.datetime({local:r,offset:n,precision:s}))))}function $v(e,t){let o;switch(e){case"email":o=[Bc()];break;case"uri":o=[pr()];break;case"date":o=[Pe.date()];break;case"date-time":o=Ev(t);break}return new Set(o.map(r=>Tv(r)).filter(r=>r!==void 0))}function Cv(e,t,o){return o!=="zod"?!0:$v(e,t).has(t)}function da(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Iv(e){try{return xv(e,"input")}catch(t){let o=t instanceof Error?t.message:String(t);throw new ae(U.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${o}`)}}var Ov=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function mf(e){return Ov.has(e)||e.startsWith("x-")}var Nv=new Set(["$schema",...Object.keys(bo.shape.requestedSchema.shape)]),qS={string:aa([_o,qr,jr,Lr]),number:aa([yo]),integer:aa([yo]),boolean:aa([Ar]),array:aa([Ur,Zr])},Mv=new Set(_o.shape.format.unwrap().options);function Av(e,t,o,r){if(!da(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)||mf(i)?s[i]=c:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?Mv.has(e.format)?(typeof c!="string"||!Cv(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"&&da(s)?o[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,Av(c,`properties.${i}`,t,r)])):Nv.has(n)?o[n]=s:mf(n)||r.push(n);if(r.length>0)throw new ae(U.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(", ")}`);return o}function jv(e,t){if(!da(e.properties))return t;let o=Object.entries(e.properties).filter(([,r])=>!hf(Dr,r).success).map(([r])=>`properties.${r}`);return o.length>0?o.join(", "):t}function sf(e,t,o=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((r,n)=>sf(r,t[n],`${o}[${n}]`)):!da(e)||!da(t)?[]:Object.entries(e).flatMap(([r,n])=>{let s=o?`${o}.${r}`:r;return Object.prototype.hasOwnProperty.call(t,r)?sf(n,t[r],s):mf(r)?[]:[s]})}function Lv(e){if(!rf(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,o=qv(Iv(e.requestedSchema),t),r=hf(bo.shape.requestedSchema,o);if(!r.success)throw new ae(U.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${jv(o,r.error.message)}`);let n=sf(o,r.data);if(n.length>0)throw new ae(U.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 ae(U.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:r.data}}function Uv(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 dR=Object.assign(Uv,{elicit(e){try{return{method:"elicitation/create",params:Lv(e)}}catch(t){throw t instanceof ae?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 Zv=["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"],Dv={IdJagTokenExchangeResponseSchema:ta,OAuthClientInformationFullSchema:sa,OAuthClientInformationSchema:na,OAuthClientMetadataSchema:ra,OAuthClientRegistrationErrorSchema:Dl,OAuthErrorResponseSchema:oa,OAuthMetadataSchema:Vr,OAuthProtectedResourceMetadataSchema:Yi,OAuthTokenRevocationRequestSchema:Vl,OAuthTokensSchema:ea,OpenIdProviderDiscoveryMetadataSchema:Xi,OpenIdProviderMetadataSchema:Qi},m_={},f_={};function g_(e,t){let o=e.slice(0,-6);m_[o]=t,f_[o]=r=>t.safeParse(r).success}for(let e of Zv)g_(e,Rv[e]);for(let[e,t]of Object.entries(Dv))g_(e,t);var Vv=Object.freeze(m_),Hv=Object.freeze(f_);function Fv(e){switch(e){case"initialize":case"notifications/initialized":return ua(void 0);case"server/discover":return ua(pf);default:return}}var S_=6e4,Jv=[so,Sr,io,_r],Bv=["inputResponses","requestState"];function jS(e,t){let o=e.params;if(!Xm(o))return{message:e,lifted:{}};let r=o._meta,n=Xm(r)?Jv.filter(l=>l in r):[],s=t==="request"?Bv.filter(l=>l in o):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...o};if(n.length>0&&Xm(r)){let l={},u={...r};for(let h of n)l[h]=r[h],delete u[h];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 LS(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 __(e){return()=>e}var Gv=__(void 0),Wv,ff=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??gl,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 ee(ie.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 ee(ie.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),of(n)||p_(n)?this._onresponse(n):u_(n)?this._onrequest(n,s):d_(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 ee(ie.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}=jS(e,"notification"),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=NS(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(Ym(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}=jS(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=(k,T,O)=>{let j={jsonrpc:"2.0",id:o.id,error:{code:k,message:T,...O!==void 0&&{data:O}}};s?.send(j).catch(A=>this._onerror(new Error(`Failed to send an error response: ${A}`)))};if(t?.classification!==void 0){let k=NS(t.classification);if(k!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${o.method}': classified as ${k} but this instance serves ${n.era}`));let T=t.classification.revision??k;i(U.UnsupportedProtocolVersion,`Unsupported protocol version: ${T}`,{supported:this._supportedProtocolVersions,requested:T});return}}if(Km(o.method)&&!n.hasRequestMethod(o.method)&&!(MS(o.method)&&this._customSchemaRequestMethods.has(o.method))){i(U.MethodNotFound,"Method not found");return}let c=this._requestHandlers.get(o.method)??this.fallbackRequestHandler;if(c===void 0){i(U.MethodNotFound,"Method not found");return}let l=n.checkInboundEnvelope(r);if(l!==void 0){i(U.InvalidParams,l);return}let u=(k,T)=>this._notificationViaCodec(this._resolveOutboundCodec(k.method),k,{...T,relatedRequestId:o.id}),h=(k,T,O)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(k.method),k,T,{...O,relatedRequestId:o.id}),f=new AbortController;this._requestHandlerAbortControllers.set(o.id,f);let y=r.inputResponses===void 0?void 0:Kv(r.inputResponses),_={sessionId:s?.sessionId,mcpReq:{id:o.id,method:o.method,_meta:o.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...y!==void 0&&{inputResponses:y.accepted},...y!==void 0&&y.droppedKeys.length>0&&{droppedInputResponseKeys:y.droppedKeys},requestState:r.requestState===void 0?Gv:__(r.requestState),signal:f.signal,send:((k,T,O)=>{let j=this._resolveOutboundCodec(k.method);if(this._assertOutboundRequestInEra(j,k.method),rf(T))return h(k,T,O);let A=LS(j,k.method);if(A===void 0)throw new TypeError(`'${k.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return h(k,A,T)}),notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},z=this.buildContext(_,t);Promise.resolve().then(()=>c(o,z)).then(async k=>{if(f.signal.aborted)return;let T;try{T=n.encodeResult(o.method,k,this._outboundServerInfo())}catch(j){this._onerror(new Error(`Failed to encode result for ${o.method}: ${j}`)),i(U.InternalError,"Internal error");return}let O={result:T,jsonrpc:"2.0",id:o.id};await s?.send(O)},async k=>{if(f.signal.aborted)return;let T=Number.isSafeInteger(k.code)?k.code:U.InternalError,O={jsonrpc:"2.0",id:o.id,error:{code:n.encodeErrorCode(T),message:k.message??"Internal error",...k.data!==void 0&&{data:k.data}}};await s?.send(O)}).catch(k=>this._onerror(new Error(`Failed to send response: ${k}`))).finally(()=>{this._requestHandlerAbortControllers.get(o.id)===f&&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),of(e)?o(e):o(ae.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(rf(t))return MS(e.method)||this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,o);this._assertOutboundRequestInEra(r,e.method);let n=LS(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 ua(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Fv(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Km(t)&&!e.hasRequestMethod(t))throw new ee(ie.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,h;return new Promise((f,y)=>{let _=D=>{y(D)};if(!this._transport){_(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(D){_(D);return}if(r?.signal?.aborted){let D=r.signal.reason;throw D instanceof ee?D:new ee(ie.RequestTimeout,String(D))}let z=e.era===pf&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,k=this._requestMessageId++;h=k;let T={...t,jsonrpc:"2.0",id:k};r?.onprogress&&(this._progressHandlers.set(k,r.onprogress),T.params={...t.params,_meta:{...t.params?._meta,progressToken:k}});let O=this._envelopeOutbound(T),j=!1,A=D=>{j||(this._progressHandlers.delete(k),z===void 0?t.method!=="initialize"&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:k,reason:String(D)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(G=>this._onerror(new Error(`Failed to send cancellation: ${G}`))):z.abort(),y(D instanceof ee?D:new ee(ie.RequestTimeout,String(D))))};this._responseHandlers.set(k,D=>{if(r?.signal?.aborted)return;if(j=!0,D instanceof Error)return y(D);let G;try{G=e.decodeResult(t.method,D.result)}catch(te){return y(te instanceof Error?te:new Error(String(te)))}if(G.kind==="invalid")return y(G.error);if(G.kind==="input_required"){if(r?.allowInputRequired===!0)return f(Yv(G));let te={codec:e,request:t,resultSchema:o,options:r,flowStartedAt:l,retry:(ke,At)=>this._requestWithSchemaViaCodec(e,ke===void 0?{method:t.method}:{method:t.method,params:ke},o,At)};return f(this._resolveNonCompleteResult(G,te))}let pe=G.result;Qm(o,pe).then(te=>{te.success?f(te.data):y(new ee(ie.InvalidResult,`Invalid result for ${t.method}: ${te.error}`))},y)}),u=()=>A(r?.signal?.reason),r?.signal?.addEventListener("abort",u,{once:!0});let Z=r?.timeout??S_,V=()=>A(new ee(ie.RequestTimeout,"Request timed out",{timeout:Z}));this._setupTimeout(k,Z,r?.maxTotalTimeout,V,r?.resetTimeoutOnProgress??!1),this._transport.send(O,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c,requestSignal:z?.signal}).catch(D=>{this._progressHandlers.delete(k),y(D)})}).finally(()=>{u&&r?.signal?.removeEventListener("abort",u),h!==void 0&&(this._responseHandlers.delete(h),this._cleanupTimeout(h))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,o){if(!this._transport)throw new ee(ie.NotConnected,"Not connected");if(Ym(t.method)&&!e.hasNotificationMethod(t.method))throw new ee(ie.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(!Km(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 ae(U.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 Qm(t.params,{...n.params});if(!i.success)throw new ae(U.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(!Ym(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 ae(U.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 Qm(t.params,{...r.params});if(!n.success)throw new ae(U.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await o(n.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Xm(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function US(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Kv(e){let t={},o=[];if(!US(e))return{accepted:t,droppedKeys:o};for(let[r,n]of Object.entries(e)){if(!US(n)||"method"in n||"result"in n){o.push(r);continue}t[r]=n}return{accepted:t,droppedKeys:o}}function Yv(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var Qv=Tf((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(";"),h=u!==-1?l.slice(0,u).trim():l.trim();if(!r.test(h))throw new TypeError("invalid media type");var f=new i(h.toLowerCase());if(u!==-1){var y,_,z;for(t.lastIndex=u;_=t.exec(l);){if(_.index!==u)throw new TypeError("invalid parameter format");u+=_[0].length,y=_[1].toLowerCase(),z=_[2],z.charCodeAt(0)===34&&(z=z.slice(1,-1),z.indexOf("\\")!==-1&&(z=z.replace(o,"$1"))),f.parameters[y]=z}if(u!==l.length)throw new TypeError("invalid parameter format")}return f}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}})),pR=Ef(Qv(),1);var Xv=10*1024*1024;var wR=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 ez=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,tz=[0,31,28,31,30,31,30,31,31,30,31,30,31],oz=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,rz=/^(?=.{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,nz=/^(?:[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,sz=/^(?:(?:[^\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,iz=/^(?:(?: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,az=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,cz=/^(?:\/(?:[^~/]|~0|~1)*)*$/,lz=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,uz=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,dz=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))},pz=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,hz=/^((([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,mz=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 Ge(e){return e.test.bind(e)}var RR={date:y_,time:b_.bind(void 0,!1),"date-time":Sz,duration:mz,uri:bz,"uri-reference":Ge(nz),"uri-template":Ge(sz),url:Ge(iz),email:dz,hostname:Ge(rz),ipv4:Ge(pz),ipv6:Ge(hz),regex:zz,uuid:Ge(az),"json-pointer":Ge(cz),"json-pointer-uri-fragment":Ge(lz),"relative-json-pointer":Ge(uz)};function fz(e){return e%4===0&&(e%100!==0||e%400===0)}function y_(e){let t=e.match(ez);if(!t)return!1;let o=+t[1],r=+t[2],n=+t[3];return r>=1&&r<=12&&n>=1&&n<=(r==2&&fz(o)?29:tz[r])}function b_(e,t){let o=t.match(oz);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 gz=/t|\s/i;function Sz(e){let t=e.split(gz);return t.length==2&&y_(t[0])&&b_(!0,t[1])}var _z=/\/|:/,yz=/^(?:[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 bz(e){return _z.test(e)&&yz.test(e)}var vz=/[^\\]\\Z/;function zz(e){if(vz.test(e))return!1;try{return new RegExp(e,"u"),!0}catch{return!1}}var Rz;Rz=globalThis.crypto;var pa=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](e){return Te(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 Te(this,e)}constructor(e){super(e),this.name=new.target.name,vo(this,new.target)}},_x=class extends pa{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}},yx=class extends pa{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}},bx=class extends pa{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}},vx=class extends pa{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 pa{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 wx=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](e){return Te(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 Te(this,e)}constructor(e){super(e??"Unauthorized"),this.name="UnauthorizedError",vo(this,new.target)}};var Rx=Symbol.for("mcp.authSeamEscape");var xx=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](e){return Te(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 Te(this,e)}constructor(e,t,o){super(`SSE error: ${t}`),this.code=e,this.event=o,vo(this,new.target)}};var gf=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}},Sf=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)}},v_=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";v_.has(i)||(v_.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},xz(u)):l=>c({method:s,params:l})]}function xz(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 Pz="2026-01-26";var Tz="ui/notifications/tool-input-partial";var _f=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!==Tz&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},kz=d.union([d.literal("light"),d.literal("dark")]).describe("Color theme preference for the host environment."),ha=d.union([d.literal("inline"),d.literal("fullscreen"),d.literal("pip")]).describe("Display mode for UI presentation."),Ez=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."),$z=d.record(Ez.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 Tt(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,h={...u},f=l.ref;if(l.ref=null,f){r(f);let _=e.seen.get(f),v=_.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(v)):Object.assign(u,v),Object.assign(u,h),c._zod.parent===f)for(let T in u)T==="$ref"||T==="allOf"||T in h||delete u[T];if(v.$ref&&_.def)for(let T in u)T==="$ref"||T==="allOf"||T in _.def&&JSON.stringify(u[T])===JSON.stringify(_.def[T])&&delete u[T]}let y=c._zod.parent;if(y&&y!==f){r(y);let _=e.seen.get(y);if(_?.schema.$ref&&(u.$ref=_.schema.$ref,_.def))for(let v in u)v==="$ref"||v==="allOf"||v in _.def&&JSON.stringify(u[v])===JSON.stringify(_.def[v])&&delete u[v]}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:dr(t,"input",e.processors),output:dr(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function Se(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 Se(r.element,o);if(r.type==="set")return Se(r.valueType,o);if(r.type==="lazy")return Se(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 Se(r.innerType,o);if(r.type==="intersection")return Se(r.left,o)||Se(r.right,o);if(r.type==="record"||r.type==="map")return Se(r.keyType,o)||Se(r.valueType,o);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Se(r.in,o)||Se(r.out,o);if(r.type==="object"){for(let n in r.shape)if(Se(r.shape[n],o))return!0;return!1}if(r.type==="union"){for(let n of r.options)if(Se(n,o))return!0;return!1}if(r.type==="tuple"){for(let n of r.items)if(Se(n,o))return!0;return!!(r.rest&&Se(r.rest,o))}return!1}var ch=(e,t={})=>o=>{let r=xt({...o,processors:t});return H(e,r),Pt(r,e),Tt(r,e)},dr=(e,t,o={})=>r=>{let{libraryOptions:n,target:s}=r??{},i=xt({...n??{},target:s,io:t,processors:o});return H(e,i),Pt(i,e),Tt(i,e)};var kb={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},lh=(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=kb[c]??c,n.format===""&&delete n.format,c==="time"&&delete n.format),u&&(n.contentEncoding=u),l&&l.size>0){let h=[...l];h.length===1?n.pattern=h[0].source:h.length>1&&(n.allOf=[...h.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},uh=(e,t,o,r)=>{let n=o,{minimum:s,maximum:i,format:c,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:h}=e._zod.bag;typeof c=="string"&&c.includes("int")?n.type="integer":n.type="number";let f=typeof h=="number"&&h>=(s??Number.NEGATIVE_INFINITY),y=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),_=t.target==="draft-04"||t.target==="openapi-3.0";f?_?(n.minimum=h,n.exclusiveMinimum=!0):n.exclusiveMinimum=h: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)},dh=(e,t,o,r)=>{o.type="boolean"},ph=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},hh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},mh=(e,t,o,r)=>{t.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},fh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},gh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Sh=(e,t,o,r)=>{o.not={}},_h=(e,t,o,r)=>{},yh=(e,t,o,r)=>{},bh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},vh=(e,t,o,r)=>{let n=e._zod.def,s=Fn(n.entries);s.every(i=>typeof i=="number")&&(o.type="number"),s.every(i=>typeof i=="string")&&(o.type="string"),o.enum=s},zh=(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},wh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Rh=(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},xh=(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)},Ph=(e,t,o,r)=>{o.type="boolean"},Th=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},kh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Eh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},$h=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Ch=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Ih=(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=H(s.element,t,{...r,path:[...r.path,"items"]})},Oh=(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]=H(i[u],t,{...r,path:[...r.path,"properties",u]});let c=new Set(Object.keys(i)),l=new Set([...c].filter(u=>{let h=s.shape[u]._zod;return t.io==="input"?h.optin===void 0:h.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=H(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},jc=(e,t,o,r)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((c,l)=>H(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",l]}));s?o.oneOf=i:o.anyOf=i},Nh=(e,t,o,r)=>{let n=e._zod.def,s=H(n.left,t,{...r,path:[...r.path,"allOf",0]}),i=H(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},Mh=(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,_)=>H(y,t,{...r,path:[...r.path,i,_]})),u=s.rest?H(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:h,maximum:f}=e._zod.bag;typeof h=="number"&&(n.minItems=h),typeof f=="number"&&(n.maxItems=f)},Ah=(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 h=H(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});n.patternProperties={};for(let f of l)n.patternProperties[f.source]=h}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=H(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=H(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let u=i._zod.values;if(u){let h=[...u].filter(f=>typeof f=="string"||typeof f=="number");h.length>0&&(n.required=h)}},qh=(e,t,o,r)=>{let n=e._zod.def,s=H(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"}]},jh=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Lh=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType,o.default=JSON.parse(JSON.stringify(n.defaultValue))},Uh=(e,t,o,r)=>{let n=e._zod.def;H(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)))},Zh=(e,t,o,r)=>{let n=e._zod.def;H(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},Dh=(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;H(i,t,r);let c=t.seen.get(e);c.ref=i},Vh=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType,o.readOnly=!0},Hh=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Lc=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Fh=(e,t,o,r)=>{let n=e._zod.innerType;H(n,t,r);let s=t.seen.get(e);s.ref=n},qc={string:lh,number:uh,boolean:dh,bigint:ph,symbol:hh,null:mh,undefined:fh,void:gh,never:Sh,any:_h,unknown:yh,date:bh,enum:vh,literal:zh,nan:wh,template_literal:Rh,file:xh,success:Ph,custom:Th,function:kh,transform:Eh,map:$h,set:Ch,array:Ih,object:Oh,union:jc,intersection:Nh,tuple:Mh,record:Ah,nullable:qh,nonoptional:jh,default:Lh,prefault:Uh,catch:Zh,pipe:Dh,readonly:Vh,promise:Hh,optional:Lc,lazy:Fh};function no(e,t){if("_idmap"in e){let r=e,n=xt({...t,processors:qc}),s={};for(let l of r._idmap.entries()){let[u,h]=l;H(h,n)}let i={},c={registry:r,uri:t?.uri,defs:s};n.external=c;for(let l of r._idmap.entries()){let[u,h]=l;Pt(n,h),i[u]=Tt(n,h)}if(Object.keys(s).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[l]:s}}return{schemas:i}}let o=xt({...t,processors:qc});return H(e,o),Pt(o,e),Tt(o,e)}var Uc=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=xt({processors:qc,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 H(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)),Pt(this.ctx,t);let r=Tt(this.ctx,t),{"~standard":n,...s}=r;return s}};var mg={};var cs={};Xe(cs,{ZodAny:()=>dm,ZodArray:()=>fm,ZodBase64:()=>cl,ZodBase64URL:()=>ll,ZodBigInt:()=>yr,ZodBigIntFormat:()=>pl,ZodBoolean:()=>_r,ZodCIDRv4:()=>il,ZodCIDRv6:()=>al,ZodCUID:()=>Xc,ZodCUID2:()=>el,ZodCatch:()=>Mm,ZodCodec:()=>_s,ZodCustom:()=>ys,ZodCustomStringFormat:()=>gr,ZodDate:()=>ms,ZodDefault:()=>Em,ZodDiscriminatedUnion:()=>Sm,ZodE164:()=>ul,ZodEmail:()=>Wc,ZodEmoji:()=>Yc,ZodEnum:()=>hr,ZodExactOptional:()=>Pm,ZodFile:()=>Rm,ZodFunction:()=>Hm,ZodGUID:()=>us,ZodIPv4:()=>nl,ZodIPv6:()=>sl,ZodIntersection:()=>_m,ZodJWT:()=>dl,ZodKSUID:()=>rl,ZodLazy:()=>Dm,ZodLiteral:()=>wm,ZodMAC:()=>am,ZodMap:()=>vm,ZodNaN:()=>qm,ZodNanoID:()=>Qc,ZodNever:()=>hm,ZodNonOptional:()=>Sl,ZodNull:()=>um,ZodNullable:()=>km,ZodNumber:()=>Sr,ZodNumberFormat:()=>so,ZodObject:()=>fs,ZodOptional:()=>gl,ZodPipe:()=>Ss,ZodPrefault:()=>Cm,ZodPreprocess:()=>jm,ZodPromise:()=>Vm,ZodReadonly:()=>Lm,ZodRecord:()=>pr,ZodSet:()=>zm,ZodString:()=>mr,ZodStringFormat:()=>J,ZodSuccess:()=>Nm,ZodSymbol:()=>cm,ZodTemplateLiteral:()=>Zm,ZodTransform:()=>xm,ZodTuple:()=>ym,ZodType:()=>q,ZodULID:()=>tl,ZodURL:()=>hs,ZodUUID:()=>He,ZodUndefined:()=>lm,ZodUnion:()=>gs,ZodUnknown:()=>pm,ZodVoid:()=>mm,ZodXID:()=>ol,ZodXor:()=>gm,_ZodString:()=>Gc,_default:()=>$m,_function:()=>gS,any:()=>hl,array:()=>g,base64:()=>Mg,base64url:()=>Ag,bigint:()=>Bg,boolean:()=>R,catch:()=>Am,check:()=>SS,cidrv4:()=>Og,cidrv6:()=>Ng,codec:()=>pS,cuid:()=>xg,cuid2:()=>Pg,custom:()=>_S,date:()=>Xg,describe:()=>yS,discriminatedUnion:()=>kt,e164:()=>qg,email:()=>Kc,emoji:()=>wg,enum:()=>I,exactOptional:()=>Tm,file:()=>cS,float32:()=>Vg,float64:()=>Hg,function:()=>gS,guid:()=>Sg,hash:()=>Dg,hex:()=>Zg,hostname:()=>Ug,httpUrl:()=>zg,instanceof:()=>vS,int:()=>Jc,int32:()=>Fg,int64:()=>Gg,intersection:()=>qe,invertCodec:()=>hS,ipv4:()=>$g,ipv6:()=>Ig,json:()=>wS,jwt:()=>jg,keyof:()=>eS,ksuid:()=>Eg,lazy:()=>Et,literal:()=>S,looseObject:()=>C,looseRecord:()=>nS,mac:()=>Cg,map:()=>sS,meta:()=>bS,nan:()=>dS,nanoid:()=>Rg,nativeEnum:()=>aS,never:()=>ml,nonoptional:()=>Om,null:()=>Fe,nullable:()=>ds,nullish:()=>lS,number:()=>b,object:()=>p,optional:()=>$,partialRecord:()=>rS,pipe:()=>Bc,prefault:()=>Im,preprocess:()=>rt,promise:()=>fS,readonly:()=>Um,record:()=>w,refine:()=>Fm,set:()=>iS,strictObject:()=>tS,string:()=>a,stringFormat:()=>Lg,stringbool:()=>zS,success:()=>uS,superRefine:()=>Jm,symbol:()=>Kg,templateLiteral:()=>mS,transform:()=>fl,tuple:()=>bm,uint32:()=>Jg,uint64:()=>Wg,ulid:()=>Tg,undefined:()=>Yg,union:()=>P,unknown:()=>E,url:()=>fr,uuid:()=>_g,uuidv4:()=>yg,uuidv6:()=>bg,uuidv7:()=>vg,void:()=>Qg,xid:()=>kg,xor:()=>oS});var Zc={};Xe(Zc,{endsWith:()=>rr,gt:()=>De,gte:()=>ge,includes:()=>tr,length:()=>ro,lowercase:()=>Xo,lt:()=>Ze,lte:()=>xe,maxLength:()=>oo,maxSize:()=>Rt,mime:()=>nr,minLength:()=>tt,minSize:()=>Ve,multipleOf:()=>wt,negative:()=>Oc,nonnegative:()=>Mc,nonpositive:()=>Nc,normalize:()=>sr,overwrite:()=>Ae,positive:()=>Ic,property:()=>Ac,regex:()=>Qo,size:()=>to,slugify:()=>lr,startsWith:()=>or,toLowerCase:()=>ar,toUpperCase:()=>cr,trim:()=>ir,uppercase:()=>er});var Pe={};Xe(Pe,{ZodISODate:()=>Vc,ZodISODateTime:()=>Dc,ZodISODuration:()=>Fc,ZodISOTime:()=>Hc,date:()=>Bh,datetime:()=>Jh,duration:()=>Wh,time:()=>Gh});var Dc=m("ZodISODateTime",(e,t)=>{wd.init(e,t),J.init(e,t)});function Jh(e){return Tp(Dc,e)}var Vc=m("ZodISODate",(e,t)=>{Rd.init(e,t),J.init(e,t)});function Bh(e){return kp(Vc,e)}var Hc=m("ZodISOTime",(e,t)=>{xd.init(e,t),J.init(e,t)});function Gh(e){return Ep(Hc,e)}var Fc=m("ZodISODuration",(e,t)=>{Pd.init(e,t),J.init(e,t)});function Wh(e){return $p(Fc,e)}var fg=(e,t)=>{Kn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>Qn(e,o)},flatten:{value:o=>Yn(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,Ho,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,Ho,2)}},isEmpty:{get(){return e.issues.length===0}}})},$b=m("ZodError",fg),ve=m("ZodError",fg,{Parent:Error});var Kh=Bo(ve),Yh=Go(ve),ls=Wo(ve),Qh=Ko(ve),Xh=Da(ve),em=Va(ve),tm=Ha(ve),om=Fa(ve),rm=Ja(ve),nm=Ba(ve),sm=Ga(ve),im=Wa(ve);var gg=new WeakMap;function ps(e,t,o){let r=Object.getPrototypeOf(e),n=gg.get(r);if(n||(n=new Set,gg.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 q=m("ZodType",(e,t)=>(M.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:dr(e,"input"),output:dr(e,"output")}}),e.toJSONSchema=ch(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(o,r)=>Kh(e,o,r,{callee:e.parse}),e.safeParse=(o,r)=>ls(e,o,r),e.parseAsync=async(o,r)=>Yh(e,o,r,{callee:e.parseAsync}),e.safeParseAsync=async(o,r)=>Qh(e,o,r),e.spa=e.safeParseAsync,e.encode=(o,r)=>Xh(e,o,r),e.decode=(o,r)=>em(e,o,r),e.encodeAsync=async(o,r)=>tm(e,o,r),e.decodeAsync=async(o,r)=>om(e,o,r),e.safeEncode=(o,r)=>rm(e,o,r),e.safeDecode=(o,r)=>nm(e,o,r),e.safeEncodeAsync=async(o,r)=>sm(e,o,r),e.safeDecodeAsync=async(o,r)=>im(e,o,r),ps(e,"ZodType",{check(...o){let r=this.def;return this.clone(N.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 me(this,o,r)},brand(){return this},register(o,r){return o.add(this,r),this},refine(o,r){return this.check(Fm(o,r))},superRefine(o,r){return this.check(Jm(o,r))},overwrite(o){return this.check(Ae(o))},optional(){return $(this)},exactOptional(){return Tm(this)},nullable(){return ds(this)},nullish(){return $(ds(this))},nonoptional(o){return Om(this,o)},array(){return g(this)},or(o){return P([this,o])},and(o){return qe(this,o)},transform(o){return Bc(this,fl(o))},default(o){return $m(this,o)},prefault(o){return Im(this,o)},catch(o){return Am(this,o)},pipe(o){return Bc(this,o)},readonly(){return Um(this)},describe(o){let r=this.clone();return ne.add(r,{description:o}),r},meta(...o){if(o.length===0)return ne.get(this);let r=this.clone();return ne.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 ne.get(e)?.description},configurable:!0}),e)),Gc=m("_ZodString",(e,t)=>{eo.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,s)=>lh(e,r,n,s);let o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,ps(e,"_ZodString",{regex(...r){return this.check(Qo(...r))},includes(...r){return this.check(tr(...r))},startsWith(...r){return this.check(or(...r))},endsWith(...r){return this.check(rr(...r))},min(...r){return this.check(tt(...r))},max(...r){return this.check(oo(...r))},length(...r){return this.check(ro(...r))},nonempty(...r){return this.check(tt(1,...r))},lowercase(r){return this.check(Xo(r))},uppercase(r){return this.check(er(r))},trim(){return this.check(ir())},normalize(...r){return this.check(sr(...r))},toLowerCase(){return this.check(ar())},toUpperCase(){return this.check(cr())},slugify(){return this.check(lr())}})}),mr=m("ZodString",(e,t)=>{eo.init(e,t),Gc.init(e,t),e.email=o=>e.check(pc(Wc,o)),e.url=o=>e.check(as(hs,o)),e.jwt=o=>e.check(Cc(dl,o)),e.emoji=o=>e.check(Sc(Yc,o)),e.guid=o=>e.check(is(us,o)),e.uuid=o=>e.check(hc(He,o)),e.uuidv4=o=>e.check(mc(He,o)),e.uuidv6=o=>e.check(fc(He,o)),e.uuidv7=o=>e.check(gc(He,o)),e.nanoid=o=>e.check(_c(Qc,o)),e.guid=o=>e.check(is(us,o)),e.cuid=o=>e.check(yc(Xc,o)),e.cuid2=o=>e.check(bc(el,o)),e.ulid=o=>e.check(vc(tl,o)),e.base64=o=>e.check(kc(cl,o)),e.base64url=o=>e.check(Ec(ll,o)),e.xid=o=>e.check(zc(ol,o)),e.ksuid=o=>e.check(wc(rl,o)),e.ipv4=o=>e.check(Rc(nl,o)),e.ipv6=o=>e.check(xc(sl,o)),e.cidrv4=o=>e.check(Pc(il,o)),e.cidrv6=o=>e.check(Tc(al,o)),e.e164=o=>e.check($c(ul,o)),e.datetime=o=>e.check(Jh(o)),e.date=o=>e.check(Bh(o)),e.time=o=>e.check(Gh(o)),e.duration=o=>e.check(Wh(o))});function a(e){return wp(mr,e)}var J=m("ZodStringFormat",(e,t)=>{F.init(e,t),Gc.init(e,t)}),Wc=m("ZodEmail",(e,t)=>{md.init(e,t),J.init(e,t)});function Kc(e){return pc(Wc,e)}var us=m("ZodGUID",(e,t)=>{pd.init(e,t),J.init(e,t)});function Sg(e){return is(us,e)}var He=m("ZodUUID",(e,t)=>{hd.init(e,t),J.init(e,t)});function _g(e){return hc(He,e)}function yg(e){return mc(He,e)}function bg(e){return fc(He,e)}function vg(e){return gc(He,e)}var hs=m("ZodURL",(e,t)=>{fd.init(e,t),J.init(e,t)});function fr(e){return as(hs,e)}function zg(e){return as(hs,{protocol:Re.httpProtocol,hostname:Re.domain,...N.normalizeParams(e)})}var Yc=m("ZodEmoji",(e,t)=>{gd.init(e,t),J.init(e,t)});function wg(e){return Sc(Yc,e)}var Qc=m("ZodNanoID",(e,t)=>{Sd.init(e,t),J.init(e,t)});function Rg(e){return _c(Qc,e)}var Xc=m("ZodCUID",(e,t)=>{_d.init(e,t),J.init(e,t)});function xg(e){return yc(Xc,e)}var el=m("ZodCUID2",(e,t)=>{yd.init(e,t),J.init(e,t)});function Pg(e){return bc(el,e)}var tl=m("ZodULID",(e,t)=>{bd.init(e,t),J.init(e,t)});function Tg(e){return vc(tl,e)}var ol=m("ZodXID",(e,t)=>{vd.init(e,t),J.init(e,t)});function kg(e){return zc(ol,e)}var rl=m("ZodKSUID",(e,t)=>{zd.init(e,t),J.init(e,t)});function Eg(e){return wc(rl,e)}var nl=m("ZodIPv4",(e,t)=>{Td.init(e,t),J.init(e,t)});function $g(e){return Rc(nl,e)}var am=m("ZodMAC",(e,t)=>{Ed.init(e,t),J.init(e,t)});function Cg(e){return xp(am,e)}var sl=m("ZodIPv6",(e,t)=>{kd.init(e,t),J.init(e,t)});function Ig(e){return xc(sl,e)}var il=m("ZodCIDRv4",(e,t)=>{$d.init(e,t),J.init(e,t)});function Og(e){return Pc(il,e)}var al=m("ZodCIDRv6",(e,t)=>{Cd.init(e,t),J.init(e,t)});function Ng(e){return Tc(al,e)}var cl=m("ZodBase64",(e,t)=>{Od.init(e,t),J.init(e,t)});function Mg(e){return kc(cl,e)}var ll=m("ZodBase64URL",(e,t)=>{Nd.init(e,t),J.init(e,t)});function Ag(e){return Ec(ll,e)}var ul=m("ZodE164",(e,t)=>{Md.init(e,t),J.init(e,t)});function qg(e){return $c(ul,e)}var dl=m("ZodJWT",(e,t)=>{Ad.init(e,t),J.init(e,t)});function jg(e){return Cc(dl,e)}var gr=m("ZodCustomStringFormat",(e,t)=>{qd.init(e,t),J.init(e,t)});function Lg(e,t,o={}){return ur(gr,e,t,o)}function Ug(e){return ur(gr,"hostname",Re.hostname,e)}function Zg(e){return ur(gr,"hex",Re.hex,e)}function Dg(e,t){let o=t?.enc??"hex",r=`${e}_${o}`,n=Re[r];if(!n)throw new Error(`Unrecognized hash format: ${r}`);return ur(gr,r,n,t)}var Sr=m("ZodNumber",(e,t)=>{nc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,s)=>uh(e,r,n,s),ps(e,"ZodNumber",{gt(r,n){return this.check(De(r,n))},gte(r,n){return this.check(ge(r,n))},min(r,n){return this.check(ge(r,n))},lt(r,n){return this.check(Ze(r,n))},lte(r,n){return this.check(xe(r,n))},max(r,n){return this.check(xe(r,n))},int(r){return this.check(Jc(r))},safe(r){return this.check(Jc(r))},positive(r){return this.check(De(0,r))},nonnegative(r){return this.check(ge(0,r))},negative(r){return this.check(Ze(0,r))},nonpositive(r){return this.check(xe(0,r))},multipleOf(r,n){return this.check(wt(r,n))},step(r,n){return this.check(wt(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 Cp(Sr,e)}var so=m("ZodNumberFormat",(e,t)=>{jd.init(e,t),Sr.init(e,t)});function Jc(e){return Op(so,e)}function Vg(e){return Np(so,e)}function Hg(e){return Mp(so,e)}function Fg(e){return Ap(so,e)}function Jg(e){return qp(so,e)}var _r=m("ZodBoolean",(e,t)=>{os.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>dh(e,o,r,n)});function R(e){return jp(_r,e)}var yr=m("ZodBigInt",(e,t)=>{sc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ph(e,r,n,s),e.gte=(r,n)=>e.check(ge(r,n)),e.min=(r,n)=>e.check(ge(r,n)),e.gt=(r,n)=>e.check(De(r,n)),e.gte=(r,n)=>e.check(ge(r,n)),e.min=(r,n)=>e.check(ge(r,n)),e.lt=(r,n)=>e.check(Ze(r,n)),e.lte=(r,n)=>e.check(xe(r,n)),e.max=(r,n)=>e.check(xe(r,n)),e.positive=r=>e.check(De(BigInt(0),r)),e.negative=r=>e.check(Ze(BigInt(0),r)),e.nonpositive=r=>e.check(xe(BigInt(0),r)),e.nonnegative=r=>e.check(ge(BigInt(0),r)),e.multipleOf=(r,n)=>e.check(wt(r,n));let o=e._zod.bag;e.minValue=o.minimum??null,e.maxValue=o.maximum??null,e.format=o.format??null});function Bg(e){return Up(yr,e)}var pl=m("ZodBigIntFormat",(e,t)=>{Ld.init(e,t),yr.init(e,t)});function Gg(e){return Dp(pl,e)}function Wg(e){return Vp(pl,e)}var cm=m("ZodSymbol",(e,t)=>{Ud.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>hh(e,o,r,n)});function Kg(e){return Hp(cm,e)}var lm=m("ZodUndefined",(e,t)=>{Zd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>fh(e,o,r,n)});function Yg(e){return Fp(lm,e)}var um=m("ZodNull",(e,t)=>{Dd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>mh(e,o,r,n)});function Fe(e){return Jp(um,e)}var dm=m("ZodAny",(e,t)=>{Vd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>_h(e,o,r,n)});function hl(){return Bp(dm)}var pm=m("ZodUnknown",(e,t)=>{Hd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>yh(e,o,r,n)});function E(){return Gp(pm)}var hm=m("ZodNever",(e,t)=>{Fd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Sh(e,o,r,n)});function ml(e){return Wp(hm,e)}var mm=m("ZodVoid",(e,t)=>{Jd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>gh(e,o,r,n)});function Qg(e){return Kp(mm,e)}var ms=m("ZodDate",(e,t)=>{Bd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,s)=>bh(e,r,n,s),e.min=(r,n)=>e.check(ge(r,n)),e.max=(r,n)=>e.check(xe(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 Xg(e){return Yp(ms,e)}var fm=m("ZodArray",(e,t)=>{Gd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ih(e,o,r,n),e.element=t.element,ps(e,"ZodArray",{min(o,r){return this.check(tt(o,r))},nonempty(o){return this.check(tt(1,o))},max(o,r){return this.check(oo(o,r))},length(o,r){return this.check(ro(o,r))},unwrap(){return this.element}})});function g(e,t){return eh(fm,e,t)}function eS(e){let t=e._zod.def.shape;return I(Object.keys(t))}var fs=m("ZodObject",(e,t)=>{Wd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Oh(e,o,r,n),N.defineLazy(e,"shape",()=>t.shape),ps(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:E()})},loose(){return this.clone({...this._zod.def,catchall:E()})},strict(){return this.clone({...this._zod.def,catchall:ml()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(o){return N.extend(this,o)},safeExtend(o){return N.safeExtend(this,o)},merge(o){return N.merge(this,o)},pick(o){return N.pick(this,o)},omit(o){return N.omit(this,o)},partial(...o){return N.partial(gl,this,o[0])},required(...o){return N.required(Sl,this,o[0])}})});function p(e,t){let o={type:"object",shape:e??{},...N.normalizeParams(t)};return new fs(o)}function tS(e,t){return new fs({type:"object",shape:e,catchall:ml(),...N.normalizeParams(t)})}function C(e,t){return new fs({type:"object",shape:e,catchall:E(),...N.normalizeParams(t)})}var gs=m("ZodUnion",(e,t)=>{rs.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>jc(e,o,r,n),e.options=t.options});function P(e,t){return new gs({type:"union",options:e,...N.normalizeParams(t)})}var gm=m("ZodXor",(e,t)=>{gs.init(e,t),Kd.init(e,t),e._zod.processJSONSchema=(o,r,n)=>jc(e,o,r,n),e.options=t.options});function oS(e,t){return new gm({type:"union",options:e,inclusive:!1,...N.normalizeParams(t)})}var Sm=m("ZodDiscriminatedUnion",(e,t)=>{gs.init(e,t),Yd.init(e,t)});function kt(e,t,o){return new Sm({type:"union",options:t,discriminator:e,...N.normalizeParams(o)})}var _m=m("ZodIntersection",(e,t)=>{Qd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Nh(e,o,r,n)});function qe(e,t){return new _m({type:"intersection",left:e,right:t})}var ym=m("ZodTuple",(e,t)=>{ic.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Mh(e,o,r,n),e.rest=o=>e.clone({...e._zod.def,rest:o})});function bm(e,t,o){let r=t instanceof M,n=r?o:t,s=r?t:null;return new ym({type:"tuple",items:e,rest:s,...N.normalizeParams(n)})}var pr=m("ZodRecord",(e,t)=>{Xd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ah(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function w(e,t,o){return!t||!t._zod?new pr({type:"record",keyType:a(),valueType:e,...N.normalizeParams(t)}):new pr({type:"record",keyType:e,valueType:t,...N.normalizeParams(o)})}function rS(e,t,o){let r=me(e);return r._zod.values=void 0,new pr({type:"record",keyType:r,valueType:t,...N.normalizeParams(o)})}function nS(e,t,o){return new pr({type:"record",keyType:e,valueType:t,mode:"loose",...N.normalizeParams(o)})}var vm=m("ZodMap",(e,t)=>{ep.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>$h(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...o)=>e.check(Ve(...o)),e.nonempty=o=>e.check(Ve(1,o)),e.max=(...o)=>e.check(Rt(...o)),e.size=(...o)=>e.check(to(...o))});function sS(e,t,o){return new vm({type:"map",keyType:e,valueType:t,...N.normalizeParams(o)})}var zm=m("ZodSet",(e,t)=>{tp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ch(e,o,r,n),e.min=(...o)=>e.check(Ve(...o)),e.nonempty=o=>e.check(Ve(1,o)),e.max=(...o)=>e.check(Rt(...o)),e.size=(...o)=>e.check(to(...o))});function iS(e,t){return new zm({type:"set",valueType:e,...N.normalizeParams(t)})}var hr=m("ZodEnum",(e,t)=>{op.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,s)=>vh(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 hr({...t,checks:[],...N.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 hr({...t,checks:[],...N.normalizeParams(n),entries:s})}});function I(e,t){let o=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new hr({type:"enum",entries:o,...N.normalizeParams(t)})}function aS(e,t){return new hr({type:"enum",entries:e,...N.normalizeParams(t)})}var wm=m("ZodLiteral",(e,t)=>{rp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>zh(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 S(e,t){return new wm({type:"literal",values:Array.isArray(e)?e:[e],...N.normalizeParams(t)})}var Rm=m("ZodFile",(e,t)=>{np.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>xh(e,o,r,n),e.min=(o,r)=>e.check(Ve(o,r)),e.max=(o,r)=>e.check(Rt(o,r)),e.mime=(o,r)=>e.check(nr(Array.isArray(o)?o:[o],r))});function cS(e){return th(Rm,e)}var xm=m("ZodTransform",(e,t)=>{sp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Eh(e,o,r,n),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new _t(e.constructor.name);o.addIssue=s=>{if(typeof s=="string")o.issues.push(N.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(N.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 fl(e){return new xm({type:"transform",transform:e})}var gl=m("ZodOptional",(e,t)=>{ac.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Lc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function $(e){return new gl({type:"optional",innerType:e})}var Pm=m("ZodExactOptional",(e,t)=>{ip.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Lc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Tm(e){return new Pm({type:"optional",innerType:e})}var km=m("ZodNullable",(e,t)=>{ap.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>qh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function ds(e){return new km({type:"nullable",innerType:e})}function lS(e){return $(ds(e))}var Em=m("ZodDefault",(e,t)=>{cp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Lh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function $m(e,t){return new Em({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():N.shallowClone(t)}})}var Cm=m("ZodPrefault",(e,t)=>{lp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Uh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Im(e,t){return new Cm({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():N.shallowClone(t)}})}var Sl=m("ZodNonOptional",(e,t)=>{up.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>jh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Om(e,t){return new Sl({type:"nonoptional",innerType:e,...N.normalizeParams(t)})}var Nm=m("ZodSuccess",(e,t)=>{dp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ph(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function uS(e){return new Nm({type:"success",innerType:e})}var Mm=m("ZodCatch",(e,t)=>{pp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Zh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Am(e,t){return new Mm({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var qm=m("ZodNaN",(e,t)=>{hp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>wh(e,o,r,n)});function dS(e){return Xp(qm,e)}var Ss=m("ZodPipe",(e,t)=>{cc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Dh(e,o,r,n),e.in=t.in,e.out=t.out});function Bc(e,t){return new Ss({type:"pipe",in:e,out:t})}var _s=m("ZodCodec",(e,t)=>{Ss.init(e,t),ns.init(e,t)});function pS(e,t,o){return new _s({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}function hS(e){let t=e._zod.def;return new _s({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var jm=m("ZodPreprocess",(e,t)=>{Ss.init(e,t),mp.init(e,t)}),Lm=m("ZodReadonly",(e,t)=>{fp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Vh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Um(e){return new Lm({type:"readonly",innerType:e})}var Zm=m("ZodTemplateLiteral",(e,t)=>{gp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Rh(e,o,r,n)});function mS(e,t){return new Zm({type:"template_literal",parts:e,...N.normalizeParams(t)})}var Dm=m("ZodLazy",(e,t)=>{yp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Fh(e,o,r,n),e.unwrap=()=>e._zod.def.getter()});function Et(e){return new Dm({type:"lazy",getter:e})}var Vm=m("ZodPromise",(e,t)=>{_p.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Hh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function fS(e){return new Vm({type:"promise",innerType:e})}var Hm=m("ZodFunction",(e,t)=>{Sp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>kh(e,o,r,n)});function gS(e){return new Hm({type:"function",input:Array.isArray(e?.input)?bm(e?.input):e?.input??g(E()),output:e?.output??E()})}var ys=m("ZodCustom",(e,t)=>{bp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Th(e,o,r,n)});function SS(e){let t=new B({check:"custom"});return t._zod.check=e,t}function _S(e,t){return oh(ys,e??(()=>!0),t)}function Fm(e,t={}){return rh(ys,e,t)}function Jm(e,t){return nh(e,t)}var yS=sh,bS=ih;function vS(e,t={}){let o=new ys({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...N.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 zS=(...e)=>ah({Codec:_s,Boolean:_r,String:mr},...e);function wS(e){let t=Et(()=>P([a(e),b(),R(),Fe(),g(t),w(a(),t)]));return t}function rt(e,t){return new jm({type:"pipe",in:fl(e),out:t})}var Gm={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 Ib(e){Q({customError:e})}function Ob(){return Q().customError}var Bm;Bm||(Bm={});var x={...cs,...Zc,iso:Pe},Nb=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 Mb(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 Ab(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 RS(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return x.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 x.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=Ab(n,t),i=ue(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 x.null();if(n.length===0)return x.never();if(n.length===1)return x.literal(n[0]);if(n.every(i=>typeof i=="string"))return x.enum(n);let s=n.map(i=>x.literal(i));return s.length<2?s[0]:x.union([s[0],s[1],...s.slice(2)])}if(e.const!==void 0)return x.literal(e.const);let o=e.type;if(Array.isArray(o)){let n=o.map(s=>{let i={...e,type:s};return RS(i,t)});return n.length===0?x.never():n.length===1?n[0]:x.union(n)}if(!o)return x.any();let r;switch(o){case"string":{let n=x.string();if(e.format){let s=e.format;s==="email"?n=n.check(x.email()):s==="uri"||s==="uri-reference"?n=n.check(x.url()):s==="uuid"||s==="guid"?n=n.check(x.uuid()):s==="date-time"?n=n.check(x.iso.datetime()):s==="date"?n=n.check(x.iso.date()):s==="time"?n=n.check(x.iso.time()):s==="duration"?n=n.check(x.iso.duration()):s==="ipv4"?n=n.check(x.ipv4()):s==="ipv6"?n=n.check(x.ipv6()):s==="mac"?n=n.check(x.mac()):s==="cidr"?n=n.check(x.cidrv4()):s==="cidr-v6"?n=n.check(x.cidrv6()):s==="base64"?n=n.check(x.base64()):s==="base64url"?n=n.check(x.base64url()):s==="e164"?n=n.check(x.e164()):s==="jwt"?n=n.check(x.jwt()):s==="emoji"?n=n.check(x.emoji()):s==="nanoid"?n=n.check(x.nanoid()):s==="cuid"?n=n.check(x.cuid()):s==="cuid2"?n=n.check(x.cuid2()):s==="ulid"?n=n.check(x.ulid()):s==="xid"?n=n.check(x.xid()):s==="ksuid"&&(n=n.check(x.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"?x.number().int():x.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=x.boolean();break}case"null":{r=x.null();break}case"object":{let n={},s=e.properties||{},i=new Set(e.required||[]);for(let[l,u]of Object.entries(s)){let h=ue(u,t);n[l]=i.has(l)?h:h.optional()}if(e.propertyNames){let l=ue(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?ue(e.additionalProperties,t):x.any();if(Object.keys(n).length===0){r=x.record(l,u);break}let h=x.object(n).passthrough(),f=x.looseRecord(l,u);r=x.intersection(h,f);break}if(e.patternProperties){let l=e.patternProperties,u=Object.keys(l),h=[];for(let y of u){let _=ue(l[y],t),v=x.string().regex(new RegExp(y));h.push(x.looseRecord(v,_))}let f=[];if(Object.keys(n).length>0&&f.push(x.object(n).passthrough()),f.push(...h),f.length===0)r=x.object({}).passthrough();else if(f.length===1)r=f[0];else{let y=x.intersection(f[0],f[1]);for(let _=2;_<f.length;_++)y=x.intersection(y,f[_]);r=y}break}let c=x.object(n);e.additionalProperties===!1?r=c.strict():typeof e.additionalProperties=="object"?r=c.catchall(ue(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=>ue(l,t)),c=s&&typeof s=="object"&&!Array.isArray(s)?ue(s,t):void 0;c?r=x.tuple(i).rest(c):r=x.tuple(i),typeof e.minItems=="number"&&(r=r.check(x.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(x.maxLength(e.maxItems)))}else if(Array.isArray(s)){let i=s.map(l=>ue(l,t)),c=e.additionalItems&&typeof e.additionalItems=="object"?ue(e.additionalItems,t):void 0;c?r=x.tuple(i).rest(c):r=x.tuple(i),typeof e.minItems=="number"&&(r=r.check(x.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(x.maxLength(e.maxItems)))}else if(s!==void 0){let i=ue(s,t),c=x.array(i);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),r=c}else r=x.array(x.any());break}default:throw new Error(`Unsupported type: ${o}`)}return r}function ue(e,t){if(typeof e=="boolean")return e?x.any():x.never();let o=RS(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=>ue(u,t)),l=x.union(c);o=r?x.intersection(o,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(u=>ue(u,t)),l=x.xor(c);o=r?x.intersection(o,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)o=r?o:x.any();else{let c=r?o:ue(e.allOf[0],t),l=r?0:1;for(let u=l;u<e.allOf.length;u++)c=x.intersection(c,ue(e.allOf[u],t));o=c}e.nullable===!0&&t.version==="openapi-3.0"&&(o=x.nullable(o)),e.readOnly===!0&&(o=x.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))Nb.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 xS(e,t){if(typeof e=="boolean")return e?x.any():x.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=Mb(o,t?.defaultTarget),n=o.$defs||o.definitions||{},s={version:r,defs:n,refs:new Map,processing:new Set,rootSchema:o,registry:t?.registry??ne};return ue(o,s)}var bs={};Xe(bs,{bigint:()=>Ub,boolean:()=>Lb,date:()=>Zb,number:()=>jb,string:()=>qb});function qb(e){return Rp(mr,e)}function jb(e){return Ip(Sr,e)}function Lb(e){return Lp(_r,e)}function Ub(e){return Zp(yr,e)}function Zb(e){return Qp(ms,e)}Q(lc());var _l="2025-11-25";var yl=[_l,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],bl="io.modelcontextprotocol/related-task",io="io.modelcontextprotocol/protocolVersion",br="io.modelcontextprotocol/clientInfo",Ct="io.modelcontextprotocol/serverInfo",ao="io.modelcontextprotocol/clientCapabilities",vl="io.modelcontextprotocol/subscriptionId",vr="io.modelcontextprotocol/logLevel";var co="2.0";var nt=Et(()=>P([a(),b(),R(),Fe(),w(a(),nt),g(nt)])),W=w(a(),nt),zl=g(nt),zr=P([a(),b().int()]),wr=a(),vs=p({ttl:b().optional()}),zs=p({taskId:a()}),Rr=C({progressToken:zr.optional(),[bl]:zs.optional()}),re=p({_meta:Rr.optional()}),It=re.extend({task:vs.optional()}),K=p({method:a(),params:re.loose().optional()}),de=p({_meta:Rr.optional()}),se=p({method:a(),params:de.loose().optional()}),xr=C({get[Ct](){return Be.optional().catch(void 0)}}),Y=C({_meta:xr.optional()}),je=P([a(),b().int()]),Pr=p({jsonrpc:S(co),id:je,...K.shape}).strict(),Tr=p({jsonrpc:S(co),...se.shape}).strict(),lo=p({jsonrpc:S(co),id:je,result:Y}).strict(),uo=p({jsonrpc:S(co),id:je.optional(),error:p({code:b().int(),message:a(),data:E().optional()})}).strict(),po=P([Pr,Tr,lo,uo]),wl=P([lo,uo]),Ot=Y.strict(),ws=de.extend({requestId:je.optional(),reason:a().optional()}),kr=se.extend({method:S("notifications/cancelled"),params:ws}),Rs=p({src:a(),mimeType:a().optional(),sizes:g(a()).optional(),theme:I(["light","dark"]).optional()}),st=p({icons:g(Rs).optional()}),Je=p({name:a(),title:a().optional()}),Be=Je.extend({...Je.shape,...st.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),Vb=qe(p({applyDefaults:R().optional()}),W),Hb=rt(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,qe(p({form:Vb.optional(),url:W.optional()}),W.optional())),Rl=C({list:W.optional(),cancel:W.optional(),requests:C({sampling:C({createMessage:W.optional()}).optional(),elicitation:C({create:W.optional()}).optional()}).optional()}),xl=C({list:W.optional(),cancel:W.optional(),requests:C({tools:C({call:W.optional()}).optional()}).optional()}),xs=p({experimental:w(a(),W).optional(),sampling:p({context:W.optional(),tools:W.optional()}).optional(),elicitation:Hb.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:Rl.optional(),extensions:w(a(),W).optional()}),Ps=re.extend({protocolVersion:a(),capabilities:xs,clientInfo:Be}),Ts=K.extend({method:S("initialize"),params:Ps}),Er=p({experimental:w(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:xl.optional(),extensions:w(a(),W).optional()}),ks=Y.extend({protocolVersion:a(),capabilities:Er,serverInfo:Be,instructions:a().optional()}),Es=se.extend({method:S("notifications/initialized"),params:de.optional()}),$s=K.extend({method:S("server/discover"),params:re.optional()}),$r=Y.extend({supportedVersions:g(a()),capabilities:Er,instructions:a().optional()}),Cr=K.extend({method:S("ping"),params:re.optional()}),Cs=p({progress:b(),total:$(b()),message:$(a())}),Is=p({...de.shape,...Cs.shape,progressToken:zr}),Ir=se.extend({method:S("notifications/progress"),params:Is}),Os=re.extend({cursor:wr.optional()}),it=K.extend({params:Os.optional()}),at=Y.extend({nextCursor:wr.optional()}),Or=p({uri:a(),mimeType:$(a()),_meta:w(a(),E()).optional()}),Nr=Or.extend({text:a()}),Km=a().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Mr=Or.extend({blob:Km}),ct=I(["user","assistant"]),Ge=p({audience:g(ct).optional(),priority:b().min(0).max(1).optional(),lastModified:Pe.datetime({offset:!0}).optional()}),Ar=p({...Je.shape,...st.shape,uri:a(),description:$(a()),mimeType:$(a()),size:$(b()),annotations:Ge.optional(),_meta:$(C({}))}),Ns=p({...Je.shape,...st.shape,uriTemplate:a(),description:$(a()),mimeType:$(a()),annotations:Ge.optional(),_meta:$(C({}))}),Ms=it.extend({method:S("resources/list")}),As=at.extend({resources:g(Ar)}),qs=it.extend({method:S("resources/templates/list")}),js=at.extend({resourceTemplates:g(Ns)}),ho=re.extend({uri:a()}),Ls=ho,Us=K.extend({method:S("resources/read"),params:Ls}),Zs=Y.extend({contents:g(P([Nr,Mr]))}),Ds=se.extend({method:S("notifications/resources/list_changed"),params:de.optional()}),Vs=ho,Hs=K.extend({method:S("resources/subscribe"),params:Vs}),Fs=ho,Js=K.extend({method:S("resources/unsubscribe"),params:Fs}),qr=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:g(a()).optional()}),Bs=re.extend({notifications:qr}),Gs=K.extend({method:S("subscriptions/listen"),params:Bs}),Ws=de.extend({notifications:qr}),Ks=se.extend({method:S("notifications/subscriptions/acknowledged"),params:Ws}),Ys=xr.extend({[vl]:je}),Qs=Y.extend({_meta:Ys}),Xs=de.extend({uri:a()}),ei=se.extend({method:S("notifications/resources/updated"),params:Xs}),ti=p({name:a(),description:$(a()),required:$(R())}),oi=p({...Je.shape,...st.shape,description:$(a()),arguments:$(g(ti)),_meta:$(C({}))}),ri=it.extend({method:S("prompts/list")}),ni=at.extend({prompts:g(oi)}),si=re.extend({name:a(),arguments:w(a(),a()).optional()}),ii=K.extend({method:S("prompts/get"),params:si}),mo=p({type:S("text"),text:a(),annotations:Ge.optional(),_meta:w(a(),E()).optional()}),fo=p({type:S("image"),data:Km,mimeType:a(),annotations:Ge.optional(),_meta:w(a(),E()).optional()}),go=p({type:S("audio"),data:Km,mimeType:a(),annotations:Ge.optional(),_meta:w(a(),E()).optional()}),ai=p({type:S("tool_use"),name:a(),id:a(),input:w(a(),E()),_meta:w(a(),E()).optional()}),So=p({type:S("resource"),resource:P([Nr,Mr]),annotations:Ge.optional(),_meta:w(a(),E()).optional()}),_o=Ar.extend({type:S("resource_link")}),We=P([mo,fo,go,_o,So]),ci=p({role:ct,content:We}),li=Y.extend({description:a().optional(),messages:g(ci)}),ui=se.extend({method:S("notifications/prompts/list_changed"),params:de.optional()}),di=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),pi=p({taskSupport:I(["required","optional","forbidden"]).optional()}),Nt=p({...Je.shape,...st.shape,description:a().optional(),inputSchema:p({type:S("object"),properties:w(a(),nt).optional(),required:g(a()).optional()}).catchall(E()),outputSchema:C({$schema:a().optional()}).optional(),annotations:di.optional(),execution:pi.optional(),_meta:w(a(),E()).optional()}),hi=it.extend({method:S("tools/list")}),mi=at.extend({tools:g(Nt)}),Mt=Y.extend({content:g(We).default([]),structuredContent:E().optional(),isError:R().optional()}),Pl=Mt.or(Y.extend({toolResult:E()})),fi=It.extend({name:a(),arguments:w(a(),E()).optional()}),gi=K.extend({method:S("tools/call"),params:fi}),Si=se.extend({method:S("notifications/tools/list_changed"),params:de.optional()}),Tl=p({autoRefresh:R().default(!0),debounceMs:b().int().nonnegative().default(300)}),jr=I(["debug","info","notice","warning","error","critical","alert","emergency"]),_i=re.extend({level:jr}),yi=K.extend({method:S("logging/setLevel"),params:_i}),bi=de.extend({level:jr,logger:a().optional(),data:E()}),vi=se.extend({method:S("notifications/message"),params:bi}),zi=p({name:a().optional()}),wi=p({hints:g(zi).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),Ri=p({mode:I(["auto","required","none"]).optional()}),xi=p({type:S("tool_result"),toolUseId:a().describe("The unique identifier for the corresponding tool call."),content:g(We),structuredContent:E().optional(),isError:R().optional(),_meta:w(a(),E()).optional()}),Pi=kt("type",[mo,fo,go]),$t=kt("type",[mo,fo,go,ai,xi]),Ti=p({role:ct,content:P([$t,g($t)]),_meta:w(a(),E()).optional()}),ki=It.extend({messages:g(Ti),modelPreferences:wi.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:g(a()).optional(),metadata:W.optional(),tools:g(Nt).optional(),toolChoice:Ri.optional()}),Ei=K.extend({method:S("sampling/createMessage"),params:ki}),$i=Y.extend({model:a(),stopReason:$(I(["endTurn","stopSequence","maxTokens"]).or(a())),role:ct,content:Pi}),Ci=Y.extend({model:a(),stopReason:$(I(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:ct,content:P([$t,g($t)])}),Lr=p({type:S("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),yo=p({type:S("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:I(["email","uri","date","date-time"]).optional(),default:a().optional()}),bo=p({type:I(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),Ur=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),default:a().optional()}),Zr=p({type:S("string"),title:a().optional(),description:a().optional(),oneOf:g(p({const:a(),title:a()})),default:a().optional()}),Dr=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),enumNames:g(a()).optional(),default:a().optional()}),Ii=P([Ur,Zr]),Vr=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({type:S("string"),enum:g(a())}),default:g(a()).optional()}),Hr=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({anyOf:g(p({const:a(),title:a()}))}),default:g(a()).optional()}),Oi=P([Vr,Hr]),Ni=P([Dr,Ii,Oi]),Fr=P([Ni,Lr,yo,bo]),vo=It.extend({mode:S("form").optional(),message:a(),requestedSchema:p({type:S("object"),properties:w(a(),Fr),required:g(a()).optional()}).catchall(E())}),Mi=It.extend({mode:S("url"),message:a(),elicitationId:a(),url:a().url()}),Ai=P([vo,Mi]),qi=K.extend({method:S("elicitation/create"),params:Ai}),ji=de.extend({elicitationId:a()}),Li=se.extend({method:S("notifications/elicitation/complete"),params:ji}),Ui=Y.extend({action:I(["accept","decline","cancel"]),content:rt(e=>e===null?void 0:e,w(a(),P([a(),b(),R(),g(a())])).optional())}),Zi=p({type:S("ref/resource"),uri:a()}),Di=p({type:S("ref/prompt"),name:a()}),Vi=re.extend({ref:P([Di,Zi]),argument:p({name:a(),value:a()}),context:p({arguments:w(a(),a()).optional()}).optional()}),Hi=K.extend({method:S("completion/complete"),params:Vi}),Fi=Y.extend({completion:C({values:g(a()).max(100),total:$(b().int()),hasMore:$(R())})}),Ji=p({uri:a().startsWith("file://"),name:a().optional(),_meta:w(a(),E()).optional()}),Bi=K.extend({method:S("roots/list"),params:re.optional()}),Gi=Y.extend({roots:g(Ji)}),Wi=se.extend({method:S("notifications/roots/list_changed"),params:de.optional()}),kl=C({ttl:b().optional(),pollInterval:b().optional()}),Ki=I(["working","input_required","completed","failed","cancelled"]),lt=p({taskId:a(),status:Ki,ttl:P([b(),Fe()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:$(b()),statusMessage:$(a())}),El=Y.extend({task:lt}),Yi=de.merge(lt),$l=se.extend({method:S("notifications/tasks/status"),params:Yi}),Cl=K.extend({method:S("tasks/get"),params:re.extend({taskId:a()})}),Il=Y.merge(lt),Ol=K.extend({method:S("tasks/result"),params:re.extend({taskId:a()})}),Nl=Y.loose(),Ml=it.extend({method:S("tasks/list")}),Al=at.extend({tasks:g(lt)}),ql=K.extend({method:S("tasks/cancel"),params:re.extend({taskId:a()})}),jl=Y.merge(lt),Ll=P([Cr,Ts,$s,Hi,yi,ii,ri,Ms,qs,Us,Hs,Js,Gs,gi,hi]),Ul=P([kr,Ir,Es,Wi]),Zl=P([Ot,$i,Ci,Ui,Gi]),Dl=P([Cr,Ei,qi,Bi]),Vl=P([kr,Ir,vi,ei,Ds,Si,ui,Ks,Li]),Hl=P([Ot,ks,$r,Fi,li,ni,As,js,Zs,Mt,mi,Qs]),oe=fr().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Gm.custom,message:"URL must be parseable",fatal:!0}),Vn}).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"}),Qi=C({resource:a().url(),authorization_servers:g(oe).optional(),jwks_uri:a().url().optional(),scopes_supported:g(a()).optional(),bearer_methods_supported:g(a()).optional(),resource_signing_alg_values_supported:g(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:g(a()).optional(),dpop_signing_alg_values_supported:g(a()).optional(),dpop_bound_access_tokens_required:R().optional()}),Jr=C({issuer:a(),authorization_endpoint:oe,token_endpoint:oe,registration_endpoint:oe.optional(),scopes_supported:g(a()).optional(),response_types_supported:g(a()),response_modes_supported:g(a()).optional(),grant_types_supported:g(a()).optional(),token_endpoint_auth_methods_supported:g(a()).optional(),token_endpoint_auth_signing_alg_values_supported:g(a()).optional(),service_documentation:oe.optional(),revocation_endpoint:oe.optional(),revocation_endpoint_auth_methods_supported:g(a()).optional(),revocation_endpoint_auth_signing_alg_values_supported:g(a()).optional(),introspection_endpoint:a().optional(),introspection_endpoint_auth_methods_supported:g(a()).optional(),introspection_endpoint_auth_signing_alg_values_supported:g(a()).optional(),code_challenge_methods_supported:g(a()).optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0),dpop_signing_alg_values_supported:g(a()).optional()}),Xi=C({issuer:a(),authorization_endpoint:oe,token_endpoint:oe,userinfo_endpoint:oe.optional(),jwks_uri:oe,registration_endpoint:oe.optional(),scopes_supported:g(a()).optional(),response_types_supported:g(a()),response_modes_supported:g(a()).optional(),grant_types_supported:g(a()).optional(),acr_values_supported:g(a()).optional(),subject_types_supported:g(a()),id_token_signing_alg_values_supported:g(a()),id_token_encryption_alg_values_supported:g(a()).optional(),id_token_encryption_enc_values_supported:g(a()).optional(),userinfo_signing_alg_values_supported:g(a()).optional(),userinfo_encryption_alg_values_supported:g(a()).optional(),userinfo_encryption_enc_values_supported:g(a()).optional(),request_object_signing_alg_values_supported:g(a()).optional(),request_object_encryption_alg_values_supported:g(a()).optional(),request_object_encryption_enc_values_supported:g(a()).optional(),token_endpoint_auth_methods_supported:g(a()).optional(),token_endpoint_auth_signing_alg_values_supported:g(a()).optional(),display_values_supported:g(a()).optional(),claim_types_supported:g(a()).optional(),claims_supported:g(a()).optional(),service_documentation:a().optional(),claims_locales_supported:g(a()).optional(),ui_locales_supported:g(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:oe.optional(),op_tos_uri:oe.optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0)}),ea=p({...Xi.shape,...Jr.pick({code_challenge_methods_supported:!0}).shape}),ta=p({access_token:a(),id_token:a().optional(),token_type:a(),expires_in:bs.number().optional(),scope:a().optional(),refresh_token:a().optional(),issuer:a().optional().catch(void 0)}).strip(),oa=p({issued_token_type:S("urn:ietf:params:oauth:token-type:id-jag"),access_token:a(),token_type:a().optional(),expires_in:b().optional(),scope:a().optional()}).strip(),ra=p({error:a(),error_description:a().optional(),error_uri:a().optional()}),Wm=oe.optional().or(S("").transform(()=>{})),na=p({redirect_uris:g(oe),token_endpoint_auth_method:a().optional(),grant_types:g(a()).optional(),response_types:g(a()).optional(),application_type:a().optional(),client_name:a().optional(),client_uri:oe.optional(),logo_uri:Wm,scope:a().optional(),contacts:g(a()).optional(),tos_uri:Wm,policy_uri:a().optional(),jwks_uri:oe.optional(),jwks:hl().optional(),software_id:a().optional(),software_version:a().optional(),software_statement:a().optional()}).strip(),sa=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(),ia=na.merge(sa),Fl=p({error:a(),error_description:a().optional()}).strip(),Jl=p({token:a(),token_type_hint:a().optional()}).strip();var of=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,of,{value:o,enumerable:!1,configurable:!0})}function Te(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,of)){let o=t[of];if(o&&typeof o.has=="function"&&o.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var Fb=class FS extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return Te(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 Te(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 FS(t.error,t.error_description??t.error,t.error_uri)}},ie=(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})({}),ee=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return Te(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 Te(this,e)}constructor(e,t,o,r){super(t,r),this.code=e,this.data=o,this.name="SdkError",zo(this,new.target)}},Jb=class extends ee{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 Bb="2026-07-28";function JS(e){return e>=Bb}function BS(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 GS=["task","inputRequests","requestState"];function Gb(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||GS.some(t=>t in e)?e:{...e,content:[]}}function Wb(){let e=Et(()=>P([a(),b(),R(),Fe(),w(a(),e),g(e)])),t=w(a(),e),o=P([a(),b().int()]),r=a(),n=p({ttl:b().optional()}),s=p({taskId:a()}),i=C({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()}),h=p({_meta:i.optional()}),f=p({method:a(),params:h.loose().optional()}),y=C({_meta:i.optional()}),_=P([a(),b().int()]),v=y.strict(),k=h.extend({requestId:_.optional(),reason:a().optional()}),T=f.extend({method:S("notifications/cancelled"),params:k}),O=p({src:a(),mimeType:a().optional(),sizes:g(a()).optional(),theme:I(["light","dark"]).optional()}),j=p({icons:g(O).optional()}),A=p({name:a(),title:a().optional()}),Z=A.extend({...A.shape,...j.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),V=qe(p({applyDefaults:R().optional()}),t),D=rt(le=>le&&typeof le=="object"&&!Array.isArray(le)&&Object.keys(le).length===0?{form:{}}:le,qe(p({form:V.optional(),url:t.optional()}),t.optional())),G=C({list:t.optional(),cancel:t.optional(),requests:C({sampling:C({createMessage:t.optional()}).optional(),elicitation:C({create:t.optional()}).optional()}).optional()}),pe=C({list:t.optional(),cancel:t.optional(),requests:C({tools:C({call:t.optional()}).optional()}).optional()}),te=p({experimental:w(a(),t).optional(),sampling:p({context:t.optional(),tools:t.optional()}).optional(),elicitation:D.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:G.optional(),extensions:w(a(),t).optional()}),ke=c.extend({protocolVersion:a(),capabilities:te,clientInfo:Z}),qt=u.extend({method:S("initialize"),params:ke}),Br=p({experimental:w(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:pe.optional(),extensions:w(a(),t).optional()}),Gr=y.extend({protocolVersion:a(),capabilities:Br,serverInfo:Z,instructions:a().optional()}),To=f.extend({method:S("notifications/initialized"),params:h.optional()}),pt=u.extend({method:S("ping"),params:c.optional()}),jt=p({progress:b(),total:$(b()),message:$(a())}),Le=p({...h.shape,...jt.shape,progressToken:o}),ht=f.extend({method:S("notifications/progress"),params:Le}),ko=c.extend({cursor:r.optional()}),Ye=u.extend({params:ko.optional()}),Qe=y.extend({nextCursor:r.optional()}),Eo=p({uri:a(),mimeType:$(a()),_meta:w(a(),E()).optional()}),$o=Eo.extend({text:a()}),Lt=a().refine(le=>{try{return atob(le),!0}catch{return!1}},{message:"Invalid Base64 string"}),Co=Eo.extend({blob:Lt}),Ue=I(["user","assistant"]),Oe=p({audience:g(Ue).optional(),priority:b().min(0).max(1).optional(),lastModified:Pe.datetime({offset:!0}).optional()}),Ut=p({...A.shape,...j.shape,uri:a(),description:$(a()),mimeType:$(a()),size:$(b()),annotations:Oe.optional(),_meta:$(C({}))}),Wr=p({...A.shape,...j.shape,uriTemplate:a(),description:$(a()),mimeType:$(a()),annotations:Oe.optional(),_meta:$(C({}))}),Kr=Ye.extend({method:S("resources/list")}),Yr=Qe.extend({resources:g(Ut)}),mt=Ye.extend({method:S("resources/templates/list")}),Io=Qe.extend({resourceTemplates:g(Wr)}),Zt=c.extend({uri:a()}),Qr=Zt,Xr=u.extend({method:S("resources/read"),params:Qr}),en=y.extend({contents:g(P([$o,Co]))}),tn=f.extend({method:S("notifications/resources/list_changed"),params:h.optional()}),on=Zt,rn=u.extend({method:S("resources/subscribe"),params:on}),nn=Zt,sn=u.extend({method:S("resources/unsubscribe"),params:nn}),an=h.extend({uri:a()}),cn=f.extend({method:S("notifications/resources/updated"),params:an}),ln=p({name:a(),description:$(a()),required:$(R())}),un=p({...A.shape,...j.shape,description:$(a()),arguments:$(g(ln)),_meta:$(C({}))}),dn=Ye.extend({method:S("prompts/list")}),pn=Qe.extend({prompts:g(un)}),hn=c.extend({name:a(),arguments:w(a(),a()).optional()}),mn=u.extend({method:S("prompts/get"),params:hn}),Dt=p({type:S("text"),text:a(),annotations:Oe.optional(),_meta:w(a(),E()).optional()}),Vt=p({type:S("image"),data:Lt,mimeType:a(),annotations:Oe.optional(),_meta:w(a(),E()).optional()}),Ht=p({type:S("audio"),data:Lt,mimeType:a(),annotations:Oe.optional(),_meta:w(a(),E()).optional()}),fn=p({type:S("tool_use"),name:a(),id:a(),input:w(a(),E()),_meta:w(a(),E()).optional()}),ft=p({type:S("resource"),resource:P([$o,Co]),annotations:Oe.optional(),_meta:w(a(),E()).optional()}),gn=Ut.extend({type:S("resource_link")}),Ee=P([Dt,Vt,Ht,gn,ft]),Oo=p({role:Ue,content:Ee}),No=y.extend({description:a().optional(),messages:g(Oo)}),Ft=f.extend({method:S("notifications/prompts/list_changed"),params:h.optional()}),Sn=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),Mo=p({taskSupport:I(["required","optional","forbidden"]).optional()}),Jt=p({...A.shape,...j.shape,description:a().optional(),inputSchema:p({type:S("object"),properties:w(a(),e).optional(),required:g(a()).optional()}).catchall(E()),outputSchema:p({type:S("object"),properties:w(a(),e).optional(),required:g(a()).optional()}).catchall(E()).optional(),annotations:Sn.optional(),execution:Mo.optional(),_meta:w(a(),E()).optional()}),Ao=Ye.extend({method:S("tools/list")}),qo=Qe.extend({tools:g(Jt)}),jo=y.extend({content:g(Ee),structuredContent:w(a(),E()).optional(),isError:R().optional()}),ce=l.extend({name:a(),arguments:w(a(),E()).optional()}),_n=u.extend({method:S("tools/call"),params:ce}),ya=f.extend({method:S("notifications/tools/list_changed"),params:h.optional()}),Lo=I(["debug","info","notice","warning","error","critical","alert","emergency"]),yn=c.extend({level:Lo}),bn=u.extend({method:S("logging/setLevel"),params:yn}),vn=h.extend({level:Lo,logger:a().optional(),data:E()}),zn=f.extend({method:S("notifications/message"),params:vn}),wn=p({name:a().optional()}),Rn=p({hints:g(wn).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),xn=p({mode:I(["auto","required","none"]).optional()}),ba=p({type:S("tool_result"),toolUseId:a().describe("The unique identifier for the corresponding tool call."),content:g(Ee),structuredContent:p({}).loose().optional(),isError:R().optional(),_meta:w(a(),E()).optional()}),Pn=kt("type",[Dt,Vt,Ht]),gt=kt("type",[Dt,Vt,Ht,fn,ba]),Tn=p({role:Ue,content:P([gt,g(gt)]),_meta:w(a(),E()).optional()}),kn=l.extend({messages:g(Tn),modelPreferences:Rn.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:g(a()).optional(),metadata:t.optional(),tools:g(Jt).optional(),toolChoice:xn.optional()}),En=u.extend({method:S("sampling/createMessage"),params:kn}),$n=y.extend({model:a(),stopReason:$(I(["endTurn","stopSequence","maxTokens"]).or(a())),role:Ue,content:Pn}),Cn=y.extend({model:a(),stopReason:$(I(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:Ue,content:P([gt,g(gt)])}),In=p({type:S("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),On=p({type:S("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:I(["email","uri","date","date-time"]).optional(),default:a().optional()}),Nn=p({type:I(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),Mn=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),default:a().optional()}),An=p({type:S("string"),title:a().optional(),description:a().optional(),oneOf:g(p({const:a(),title:a()})),default:a().optional()}),qn=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),enumNames:g(a()).optional(),default:a().optional()}),jn=P([Mn,An]),Bt=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({type:S("string"),enum:g(a())}),default:g(a()).optional()}),Gt=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({anyOf:g(p({const:a(),title:a()}))}),default:g(a()).optional()}),va=P([Bt,Gt]),za=P([qn,jn,va]),ze=P([za,In,On,Nn]),we=l.extend({mode:S("form").optional(),message:a(),requestedSchema:p({type:S("object"),properties:w(a(),ze),required:g(a()).optional()}).catchall(E())}),Ln=l.extend({mode:S("url"),message:a(),elicitationId:a(),url:a().url()}),Ne=P([we,Ln]),wa=u.extend({method:S("elicitation/create"),params:Ne}),Ra=h.extend({elicitationId:a()}),xa=f.extend({method:S("notifications/elicitation/complete"),params:Ra}),Pa=y.extend({action:I(["accept","decline","cancel"]),content:rt(le=>le===null?void 0:le,w(a(),P([a(),b(),R(),g(a())])).optional())}),Ta=p({type:S("ref/resource"),uri:a()}),ka=p({type:S("ref/prompt"),name:a()}),Ea=c.extend({ref:P([ka,Ta]),argument:p({name:a(),value:a()}),context:p({arguments:w(a(),a()).optional()}).optional()}),Un=u.extend({method:S("completion/complete"),params:Ea}),$a=y.extend({completion:C({values:g(a()).max(100),total:$(b().int()),hasMore:$(R())})}),Ca=p({uri:a().startsWith("file://"),name:a().optional(),_meta:w(a(),E()).optional()}),Uo=u.extend({method:S("roots/list"),params:c.optional()}),Zn=y.extend({roots:g(Ca)}),Ia=f.extend({method:S("notifications/roots/list_changed"),params:h.optional()}),Oa=C({ttl:b().optional(),pollInterval:b().optional()}),Dn=I(["working","input_required","completed","failed","cancelled"]),St=p({taskId:a(),status:Dn,ttl:P([b(),Fe()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:$(b()),statusMessage:$(a())}),_e=y.extend({task:St}),Na=h.merge(St),Wt=f.extend({method:S("notifications/tasks/status"),params:Na}),Zo=u.extend({method:S("tasks/get"),params:c.extend({taskId:a()})}),Do=y.merge(St),Vo=u.extend({method:S("tasks/result"),params:c.extend({taskId:a()})}),Xl=y.loose(),he=Ye.extend({method:S("tasks/list")}),X=Qe.extend({tasks:g(St)}),Kt=u.extend({method:S("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:h,NotificationSchema:f,ResultSchema:y,RequestIdSchema:_,EmptyResultSchema:v,CancelledNotificationParamsSchema:k,CancelledNotificationSchema:T,IconSchema:O,IconsSchema:j,BaseMetadataSchema:A,ImplementationSchema:Z,ClientTasksCapabilitySchema:G,ServerTasksCapabilitySchema:pe,ClientCapabilitiesSchema:te,InitializeRequestParamsSchema:ke,InitializeRequestSchema:qt,ServerCapabilitiesSchema:Br,InitializeResultSchema:Gr,InitializedNotificationSchema:To,PingRequestSchema:pt,ProgressSchema:jt,ProgressNotificationParamsSchema:Le,ProgressNotificationSchema:ht,PaginatedRequestParamsSchema:ko,PaginatedRequestSchema:Ye,PaginatedResultSchema:Qe,ResourceContentsSchema:Eo,TextResourceContentsSchema:$o,BlobResourceContentsSchema:Co,RoleSchema:Ue,AnnotationsSchema:Oe,ResourceSchema:Ut,ResourceTemplateSchema:Wr,ListResourcesRequestSchema:Kr,ListResourcesResultSchema:Yr,ListResourceTemplatesRequestSchema:mt,ListResourceTemplatesResultSchema:Io,ResourceRequestParamsSchema:Zt,ReadResourceRequestParamsSchema:Qr,ReadResourceRequestSchema:Xr,ReadResourceResultSchema:en,ResourceListChangedNotificationSchema:tn,SubscribeRequestParamsSchema:on,SubscribeRequestSchema:rn,UnsubscribeRequestParamsSchema:nn,UnsubscribeRequestSchema:sn,ResourceUpdatedNotificationParamsSchema:an,ResourceUpdatedNotificationSchema:cn,PromptArgumentSchema:ln,PromptSchema:un,ListPromptsRequestSchema:dn,ListPromptsResultSchema:pn,GetPromptRequestParamsSchema:hn,GetPromptRequestSchema:mn,TextContentSchema:Dt,ImageContentSchema:Vt,AudioContentSchema:Ht,ToolUseContentSchema:fn,EmbeddedResourceSchema:ft,ResourceLinkSchema:gn,ContentBlockSchema:Ee,PromptMessageSchema:Oo,GetPromptResultSchema:No,PromptListChangedNotificationSchema:Ft,ToolAnnotationsSchema:Sn,ToolExecutionSchema:Mo,ToolSchema:Jt,ListToolsRequestSchema:Ao,ListToolsResultSchema:qo,CallToolResultSchema:jo,CallToolRequestParamsSchema:ce,CallToolRequestSchema:_n,ToolListChangedNotificationSchema:ya,LoggingLevelSchema:Lo,SetLevelRequestParamsSchema:yn,SetLevelRequestSchema:bn,LoggingMessageNotificationParamsSchema:vn,LoggingMessageNotificationSchema:zn,ModelHintSchema:wn,ModelPreferencesSchema:Rn,ToolChoiceSchema:xn,ToolResultContentSchema:ba,SamplingContentSchema:Pn,SamplingMessageContentBlockSchema:gt,SamplingMessageSchema:Tn,CreateMessageRequestParamsSchema:kn,CreateMessageRequestSchema:En,CreateMessageResultSchema:$n,CreateMessageResultWithToolsSchema:Cn,BooleanSchemaSchema:In,StringSchemaSchema:On,NumberSchemaSchema:Nn,UntitledSingleSelectEnumSchemaSchema:Mn,TitledSingleSelectEnumSchemaSchema:An,LegacyTitledEnumSchemaSchema:qn,SingleSelectEnumSchemaSchema:jn,UntitledMultiSelectEnumSchemaSchema:Bt,TitledMultiSelectEnumSchemaSchema:Gt,MultiSelectEnumSchemaSchema:va,EnumSchemaSchema:za,PrimitiveSchemaDefinitionSchema:ze,ElicitRequestFormParamsSchema:we,ElicitRequestURLParamsSchema:Ln,ElicitRequestParamsSchema:Ne,ElicitRequestSchema:wa,ElicitationCompleteNotificationParamsSchema:Ra,ElicitationCompleteNotificationSchema:xa,ElicitResultSchema:Pa,ResourceTemplateReferenceSchema:Ta,PromptReferenceSchema:ka,CompleteRequestParamsSchema:Ea,CompleteRequestSchema:Un,CompleteResultSchema:$a,RootSchema:Ca,ListRootsRequestSchema:Uo,ListRootsResultSchema:Zn,RootsListChangedNotificationSchema:Ia,TaskCreationParamsSchema:Oa,TaskStatusSchema:Dn,TaskSchema:St,CreateTaskResultSchema:_e,TaskStatusNotificationParamsSchema:Na,TaskStatusNotificationSchema:Wt,GetTaskRequestSchema:Zo,GetTaskResultSchema:Do,GetTaskPayloadRequestSchema:Vo,GetTaskPayloadResultSchema:Xl,ListTasksRequestSchema:he,ListTasksResultSchema:X,CancelTaskRequestSchema:Kt,CancelTaskResultSchema:y.merge(St),ClientRequestSchema:P([pt,qt,Un,bn,mn,dn,Kr,mt,Xr,rn,sn,_n,Ao,Zo,Vo,he,Kt]),ClientNotificationSchema:P([T,ht,To,Ia,Wt]),ClientResultSchema:P([v,$n,Cn,Pa,Zn,Do,X,_e]),ServerRequestSchema:P([pt,En,wa,Uo,Zo,Vo,he,Kt]),ServerNotificationSchema:P([T,ht,zn,cn,tn,ya,Ft,Wt,xa]),ServerResultSchema:P([v,Gr,$a,No,pn,Yr,Io,en,jo,qo,Do,X,_e]),CallToolResultWireSchema:E().superRefine((le,U_)=>{if(!(typeof le!="object"||le===null||Array.isArray(le)||le.content!==void 0)){for(let $f of GS)if($f in le){U_.addIssue({code:"custom",message:`content is required when the body carries '${$f}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(Gb).pipe(jo)}}var Kb;function WS(){return Kb??=Wb()}function KS(e){return e.type!=="object"}var Yb=new Set(["const","enum","default","examples"]),Qb=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function MS(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Xb(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(MS(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let o=Nf(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&&MS(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:Yb.has(l)?i[l]=u:Qb.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 YS={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},QS={"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},ev={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},Bl;function lf(){if(Bl)return Bl;let e=WS();return Bl={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}},Bl}function XS(e){return Object.prototype.hasOwnProperty.call(YS,e)}function e_(e){return Object.prototype.hasOwnProperty.call(QS,e)}function tv(e){return Object.prototype.hasOwnProperty.call(ev,e)}function ov(e){return tv(e)?lf().resultSchemas[e]:void 0}function rv(e){return XS(e)?lf().requestSchemas[e]:void 0}function nv(e){return e_(e)?lf().notificationSchemas[e]:void 0}var dR=Object.keys(YS),pR=Object.keys(QS);function rf(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Gl(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 AS={ok:!1,reason:"not-in-era"};function qS(e){return rf(e)&&rf(e.outputSchema)&&KS(e.outputSchema)}var uf={era:"2025-11-25",hasRequestMethod:XS,hasNotificationMethod:e_,validateRequest:(e,t)=>Gl(rv(e),t),validateResult:(e,t)=>Gl(ov(e),t),validateNotification:(e,t)=>Gl(nv(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>AS,validateInputResponse:()=>AS,samplingResultVariant:((e,t)=>{let o=WS();return Gl(e?o.CreateMessageResultWithToolsSchema:o.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let o=BS(e),r=o.structuredContent;if(r===void 0)return o;let n=typeof r!="object"||r===null||Array.isArray(r),s=t!==void 0&&KS(t);return!n&&!s?o:{...o,structuredContent:{result:r}}},decodeResult(e,t){if(rf(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=>qS(r))?t:{...t,tools:o.map(r=>qS(r)?{...r,outputSchema:Xb(r.outputSchema)}:r)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function sv(){let e=Et(()=>P([a(),b(),R(),Fe(),w(a(),e),g(e)])),t=w(a(),e),o=P([a(),b().int()]),r=a(),n=P([a(),b().int()]),s=I(["user","assistant"]),i=I(["debug","info","notice","warning","error","critical","alert","emergency"]),c=a().refine(X=>{try{return atob(X),!0}catch{return!1}},{message:"Invalid Base64 string"}),l=p({ttl:b().optional()}),u=p({taskId:a()}),h=C({progressToken:o.optional(),"io.modelcontextprotocol/related-task":u.optional()}),f=p({_meta:h.optional()}),y=f.extend({task:l.optional()}),_=p({_meta:h.optional()}),v=p({method:a(),params:_.loose().optional()}),k=p({src:a(),mimeType:a().optional(),sizes:g(a()).optional(),theme:I(["light","dark"]).optional()}),T=p({icons:g(k).optional()}),O=p({name:a(),title:a().optional()}),j=O.extend({...O.shape,...T.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),A=qe(p({applyDefaults:R().optional()}),t),Z=rt(X=>X&&typeof X=="object"&&!Array.isArray(X)&&Object.keys(X).length===0?{form:{}}:X,qe(p({form:A.optional(),url:t.optional()}),t.optional())),V=C({list:t.optional(),cancel:t.optional(),requests:C({sampling:C({createMessage:t.optional()}).optional(),elicitation:C({create:t.optional()}).optional()}).optional()}),D=C({list:t.optional(),cancel:t.optional(),requests:C({tools:C({call:t.optional()}).optional()}).optional()}),G=p({experimental:w(a(),t).optional(),sampling:p({context:t.optional(),tools:t.optional()}).optional(),elicitation:Z.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:V.optional(),extensions:w(a(),t).optional()}),pe=p({experimental:w(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:D.optional(),extensions:w(a(),t).optional()}),te=p({progress:b(),total:$(b()),message:$(a())}),ke=p({..._.shape,...te.shape,progressToken:o}),qt=v.extend({method:S("notifications/progress"),params:ke}),Br=_.extend({level:i,logger:a().optional(),data:E()}),Gr=v.extend({method:S("notifications/message"),params:Br}),To=p({uri:a(),mimeType:$(a()),_meta:w(a(),E()).optional()}),pt=To.extend({text:a()}),jt=To.extend({blob:c}),Le=p({audience:g(s).optional(),priority:b().min(0).max(1).optional(),lastModified:Pe.datetime({offset:!0}).optional()}),ht=p({...O.shape,...T.shape,uri:a(),description:$(a()),mimeType:$(a()),size:$(b()),annotations:Le.optional(),_meta:$(C({}))}),ko=p({...O.shape,...T.shape,uriTemplate:a(),description:$(a()),mimeType:$(a()),annotations:Le.optional(),_meta:$(C({}))}),Ye=v.extend({method:S("notifications/resources/list_changed"),params:_.optional()}),Qe=_.extend({uri:a()}),Eo=v.extend({method:S("notifications/resources/updated"),params:Qe}),$o=p({name:a(),description:$(a()),required:$(R())}),Lt=p({...O.shape,...T.shape,description:$(a()),arguments:$(g($o)),_meta:$(C({}))}),Co=v.extend({method:S("notifications/prompts/list_changed"),params:_.optional()}),Ue=p({type:S("text"),text:a(),annotations:Le.optional(),_meta:w(a(),E()).optional()}),Oe=p({type:S("image"),data:c,mimeType:a(),annotations:Le.optional(),_meta:w(a(),E()).optional()}),Ut=p({type:S("audio"),data:c,mimeType:a(),annotations:Le.optional(),_meta:w(a(),E()).optional()}),Wr=p({type:S("tool_use"),name:a(),id:a(),input:w(a(),E()),_meta:w(a(),E()).optional()}),Kr=p({type:S("resource"),resource:P([pt,jt]),annotations:Le.optional(),_meta:w(a(),E()).optional()}),Yr=ht.extend({type:S("resource_link")}),mt=P([Ue,Oe,Ut,Yr,Kr]),Io=p({role:s,content:mt}),Zt=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),Qr=v.extend({method:S("notifications/tools/list_changed"),params:_.optional()}),Xr=p({name:a().optional()}),en=p({hints:g(Xr).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),tn=p({mode:I(["auto","required","none"]).optional()}),on=p({type:S("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),rn=p({type:S("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:I(["email","uri","date","date-time"]).optional(),default:a().optional()}),nn=p({type:I(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),sn=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),default:a().optional()}),an=p({type:S("string"),title:a().optional(),description:a().optional(),oneOf:g(p({const:a(),title:a()})),default:a().optional()}),cn=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),enumNames:g(a()).optional(),default:a().optional()}),ln=P([sn,an]),un=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({type:S("string"),enum:g(a())}),default:g(a()).optional()}),dn=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({anyOf:g(p({const:a(),title:a()}))}),default:g(a()).optional()}),pn=P([un,dn]),hn=P([cn,ln,pn]),mn=P([hn,on,rn,nn]),Dt=y.extend({mode:S("form").optional(),message:a(),requestedSchema:p({type:S("object"),properties:w(a(),mn),required:g(a()).optional()}).catchall(E())}),Vt=p({type:S("ref/resource"),uri:a()}),Ht=p({type:S("ref/prompt"),name:a()}),fn=p({uri:a().startsWith("file://"),name:a().optional(),_meta:w(a(),E()).optional()}),ft=G.shape,gn=p({experimental:ft.experimental,sampling:ft.sampling,elicitation:ft.elicitation,roots:ft.roots,extensions:ft.extensions}),Ee=pe.shape,Oo=p({experimental:Ee.experimental,logging:Ee.logging,completions:Ee.completions,prompts:Ee.prompts,resources:Ee.resources,tools:Ee.tools,extensions:Ee.extensions}),No=C({progressToken:o.optional(),[io]:a(),[br]:j.optional(),[ao]:gn,[vr]:i.optional()}),Ft=p({...O.shape,...T.shape,description:a().optional(),inputSchema:C({$schema:a().optional(),type:S("object")}),outputSchema:C({$schema:a().optional()}).optional(),annotations:Zt.optional(),_meta:w(a(),E()).optional()}),Sn=p({type:S("tool_result"),toolUseId:a(),content:g(mt),structuredContent:E().optional(),isError:R().optional(),_meta:w(a(),E()).optional()}),Mo=P([Ue,Oe,Ut,Wr,Sn]),Jt=p({role:s,content:P([Mo,g(Mo)]),_meta:w(a(),E()).optional()}),Ao=a(),qo=C({[Ct]:j.optional().catch(void 0)}),jo=qo.optional();function ce(X){return C({_meta:jo,resultType:Ao.default("complete"),...X})}let _n=ce({}),ya=ce({nextCursor:r.optional()}),Lo=ce({content:g(mt),structuredContent:E().optional(),isError:R().optional()}),yn=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),tools:g(Ft),nextCursor:r.optional()}),bn=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),prompts:g(Lt),nextCursor:r.optional()}),vn=ce({description:a().optional(),messages:g(Io)}),zn=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resources:g(ht),nextCursor:r.optional()}),wn=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resourceTemplates:g(ko),nextCursor:r.optional()}),Rn=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),contents:g(P([pt,jt]))}),xn=ce({completion:p({values:g(a()).max(100),total:b().int().optional(),hasMore:R().optional()}).loose()}),ba=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"])}),Pn=ce({ttlMs:b().int().min(0).catch(0),cacheScope:I(["public","private"]).catch("private"),supportedVersions:g(a()),capabilities:Oo,instructions:a().optional()}),gt=p({messages:g(Jt),modelPreferences:en.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:g(a()).optional(),metadata:t.optional(),tools:g(Ft).optional(),toolChoice:tn.optional()}),Tn=p({method:S("sampling/createMessage"),params:gt}),kn=p({method:S("roots/list"),params:p({_meta:w(a(),E()).optional()}).optional()}),En=p({...Jt.shape,model:a(),stopReason:a().optional()}),$n=p({roots:g(fn)}),Cn=p({action:I(["accept","decline","cancel"]),content:w(a(),P([a(),b(),R(),g(a())])).optional()}),In=p({mode:S("url"),message:a(),url:a().url()}),On=P([Dt,In]),Nn=p({method:S("elicitation/create"),params:On}),Mn=P([Tn,kn,Nn]),An=P([En,$n,Cn]),qn=w(a(),Mn),jn=w(a(),An),Bt=ce({inputRequests:qn.optional(),requestState:a().optional()}),Gt={inputResponses:jn.optional(),requestState:a().optional()},va=p({_meta:No,...Gt}),za=C({progressToken:o.optional()});function ze(X,Kt){return p({method:S(X),params:p({_meta:No,...Kt})})}function we(X,Kt){return p({method:S(X),params:p({_meta:za.optional(),...Kt}).optional()})}let Ln={name:a(),arguments:w(a(),E()).optional(),...Gt},Ne={cursor:r.optional()},wa=ze("tools/call",Ln),Ra=ze("tools/list",Ne),xa=ze("prompts/list",Ne),Pa=ze("prompts/get",{name:a(),arguments:w(a(),a()).optional(),...Gt}),Ta=ze("resources/list",Ne),ka=ze("resources/templates/list",Ne),Ea=ze("resources/read",{uri:a(),...Gt}),Un={ref:P([Ht,Vt]),argument:p({name:a(),value:a()}),context:p({arguments:w(a(),a()).optional()}).optional()},$a=ze("completion/complete",Un),Ca=ze("server/discover",{}),Uo=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:g(a()).optional()}),Zn={notifications:Uo},Ia=ze("subscriptions/listen",Zn),Oa=qo.extend({"io.modelcontextprotocol/subscriptionId":n}),Dn=C({_meta:Oa,resultType:Ao.default("complete")}),St={"tools/call":we("tools/call",Ln),"tools/list":we("tools/list",Ne),"prompts/get":we("prompts/get",{name:a(),arguments:w(a(),a()).optional()}),"prompts/list":we("prompts/list",Ne),"resources/list":we("resources/list",Ne),"resources/templates/list":we("resources/templates/list",Ne),"resources/read":we("resources/read",{uri:a()}),"completion/complete":we("completion/complete",Un),"server/discover":we("server/discover",{}),"subscriptions/listen":we("subscriptions/listen",Zn)};function _e(X){return C({_meta:jo,...X})}let Na={"tools/call":_e({content:g(mt),structuredContent:E().optional(),isError:R().optional()}),"tools/list":_e({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),tools:g(Ft),nextCursor:r.optional()}),"prompts/get":_e({description:a().optional(),messages:g(Io)}),"prompts/list":_e({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),prompts:g(Lt),nextCursor:r.optional()}),"resources/list":_e({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resources:g(ht),nextCursor:r.optional()}),"resources/templates/list":_e({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resourceTemplates:g(ko),nextCursor:r.optional()}),"resources/read":_e({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),contents:g(P([pt,jt]))}),"completion/complete":_e({completion:p({values:g(a()).max(100),total:b().int().optional(),hasMore:R().optional()}).loose()}),"server/discover":_e({ttlMs:b().int().min(0).catch(0),cacheScope:I(["public","private"]).catch("private"),supportedVersions:g(a()),capabilities:Oo,instructions:a().optional()}),"subscriptions/listen":_e({})},Wt=C({"io.modelcontextprotocol/subscriptionId":n.optional()}),Zo=p({method:S("notifications/subscriptions/acknowledged"),params:p({_meta:Wt.optional(),notifications:Uo})}),Do=p({_meta:Wt.optional(),requestId:n,reason:a().optional()}),Vo=p({method:S("notifications/cancelled"),params:Do}),Xl={"notifications/cancelled":Vo,"notifications/progress":qt,"notifications/message":Gr,"notifications/resources/updated":Eo,"notifications/resources/list_changed":Ye,"notifications/tools/list_changed":Qr,"notifications/prompts/list_changed":Co,"notifications/subscriptions/acknowledged":Zo},he=X=>p({jsonrpc:S("2.0"),id:P([a(),b().int()]),result:X}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:r,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:l,RelatedTaskMetadataSchema:u,RequestMetaSchema:h,BaseRequestParamsSchema:f,TaskAugmentedRequestParamsSchema:y,NotificationsParamsSchema:_,NotificationSchema:v,IconSchema:k,IconsSchema:T,BaseMetadataSchema:O,ImplementationSchema:j,ClientTasksCapabilitySchema:V,ServerTasksCapabilitySchema:D,ClientCapabilitiesSchema:G,ServerCapabilitiesSchema:pe,ProgressSchema:te,ProgressNotificationParamsSchema:ke,ProgressNotificationSchema:qt,LoggingMessageNotificationParamsSchema:Br,LoggingMessageNotificationSchema:Gr,ResourceContentsSchema:To,TextResourceContentsSchema:pt,BlobResourceContentsSchema:jt,AnnotationsSchema:Le,ResourceSchema:ht,ResourceTemplateSchema:ko,ResourceListChangedNotificationSchema:Ye,ResourceUpdatedNotificationParamsSchema:Qe,ResourceUpdatedNotificationSchema:Eo,PromptArgumentSchema:$o,PromptSchema:Lt,PromptListChangedNotificationSchema:Co,TextContentSchema:Ue,ImageContentSchema:Oe,AudioContentSchema:Ut,ToolUseContentSchema:Wr,EmbeddedResourceSchema:Kr,ResourceLinkSchema:Yr,ContentBlockSchema:mt,PromptMessageSchema:Io,ToolAnnotationsSchema:Zt,ToolListChangedNotificationSchema:Qr,ModelHintSchema:Xr,ModelPreferencesSchema:en,ToolChoiceSchema:tn,BooleanSchemaSchema:on,StringSchemaSchema:rn,NumberSchemaSchema:nn,UntitledSingleSelectEnumSchemaSchema:sn,TitledSingleSelectEnumSchemaSchema:an,LegacyTitledEnumSchemaSchema:cn,SingleSelectEnumSchemaSchema:ln,UntitledMultiSelectEnumSchemaSchema:un,TitledMultiSelectEnumSchemaSchema:dn,MultiSelectEnumSchemaSchema:pn,EnumSchemaSchema:hn,PrimitiveSchemaDefinitionSchema:mn,ElicitRequestFormParamsSchema:Dt,ResourceTemplateReferenceSchema:Vt,PromptReferenceSchema:Ht,RootSchema:fn,ClientCapabilities2026Schema:gn,ServerCapabilities2026Schema:Oo,RequestMetaEnvelopeSchema:No,ToolSchema:Ft,ToolResultContentSchema:Sn,SamplingMessageContentBlockSchema:Mo,SamplingMessageSchema:Jt,ResultTypeSchema:Ao,ResultMetaSchema:qo,ResultSchema:_n,PaginatedResultSchema:ya,CallToolResultSchema:Lo,ListToolsResultSchema:yn,ListPromptsResultSchema:bn,GetPromptResultSchema:vn,ListResourcesResultSchema:zn,ListResourceTemplatesResultSchema:wn,ReadResourceResultSchema:Rn,CompleteResultSchema:xn,CacheableResultSchema:ba,DiscoverResultSchema:Pn,CreateMessageRequestParamsSchema:gt,CreateMessageRequestSchema:Tn,ListRootsRequestSchema:kn,CreateMessageResultSchema:En,ListRootsResultSchema:$n,ElicitResultSchema:Cn,ElicitRequestURLParamsSchema:In,ElicitRequestParamsSchema:On,ElicitRequestSchema:Nn,InputRequestSchema:Mn,InputResponseSchema:An,InputRequestsSchema:qn,InputResponsesSchema:jn,InputRequiredResultSchema:Bt,InputResponseRequestParamsSchema:va,CallToolRequestSchema:wa,ListToolsRequestSchema:Ra,ListPromptsRequestSchema:xa,GetPromptRequestSchema:Pa,ListResourcesRequestSchema:Ta,ListResourceTemplatesRequestSchema:ka,ReadResourceRequestSchema:Ea,CompleteRequestSchema:$a,DiscoverRequestSchema:Ca,SubscriptionFilterSchema:Uo,SubscriptionsListenRequestSchema:Ia,SubscriptionsListenResultMetaSchema:Oa,SubscriptionsListenResultSchema:Dn,dispatchRequestSchemas:St,dispatchResultSchemas:Na,NotificationMetaSchema:Wt,SubscriptionsAcknowledgedNotificationSchema:Zo,CancelledNotificationParamsSchema:Do,CancelledNotificationSchema:Vo,notificationSchemas2026:Xl,JSONRPCResultResponseSchema:he(_n),CallToolResultResponseSchema:he(P([Lo,Bt])),ListToolsResultResponseSchema:he(yn),ListPromptsResultResponseSchema:he(bn),GetPromptResultResponseSchema:he(P([vn,Bt])),ListResourcesResultResponseSchema:he(zn),ListResourceTemplatesResultResponseSchema:he(wn),ReadResourceResultResponseSchema:he(P([Rn,Bt])),CompleteResultResponseSchema:he(xn),DiscoverResultResponseSchema:he(Pn),SubscriptionsListenResultResponseSchema:he(Dn)}}var iv;function At(){return iv??=sv()}var av=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function cv(e){return av.includes(e)}var df=Symbol("modelcontextprotocol.resultCacheHintFallback");function lv(e){return e[df]}function t_(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function o_(e){return e==="public"||e==="private"}var U=(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})({}),ae=class r_ extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return Te(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 Te(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===U.UrlElicitationRequired&&r){let n=r;if(n.elicitations)return new s_(n.elicitations,o)}if(t===U.UnsupportedProtocolVersion&&r){let n=r;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new i_({supported:n.supported,requested:n.requested},o)}if(t===U.InvalidParams||t===U.ResourceNotFound){let n=r;if(typeof n?.uri=="string"&&(t===U.ResourceNotFound||Object.keys(n).length===1))return new n_(n.uri,o)}if(t===U.MissingRequiredClientCapability&&r){let n=r;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities=="object"&&!Array.isArray(n.requiredCapabilities))return new a_({requiredCapabilities:n.requiredCapabilities},o)}return new r_(t,o,r)}},n_=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(U.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},s_=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(U.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},i_=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(U.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},a_=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(U.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},uv=0,dv="private",pv=["tools/call","prompts/get","resources/read"];function hv(e,t){let o=t.resultType;if(o===void 0)return{...t,resultType:"complete"};if(o==="complete"||pv.includes(e))return t;throw new ae(U.InternalError,`Handler for ${e} returned resultType '${String(o)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function mv(e,t){let o=lv(t);if(t.resultType!=="complete"||!cv(e))return o===void 0?t:yv(t);let r=t,n=t_(r.ttlMs)?r.ttlMs:Sv(o),s=o_(r.cacheScope)?r.cacheScope:_v(o),i={...r,ttlMs:n,cacheScope:s};return delete i[df],i}function fv(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function gv(e,t){if(t===void 0)return e;let o=e._meta;return o===void 0?{...e,_meta:{[Ct]:t}}:!fv(o)||o[Ct]!==void 0?e:{...e,_meta:{...o,[Ct]:t}}}function Sv(e){return e!==void 0&&t_(e.ttlMs)?e.ttlMs:uv}function _v(e){return e!==void 0&&o_(e.cacheScope)?e.cacheScope:dv}function yv(e){let t={...e};return delete t[df],t}var bv=["elicitation/create","sampling/createMessage","roots/list"],Wl;function c_(){if(Wl)return Wl;let e=At();return Wl={request:{"elicitation/create":p({method:S("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":p({method:S("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":p({method:S("roots/list"),params:C({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Wl}function l_(e){return bv.includes(e)}function Ym(e){return l_(e)?c_().request[e]:void 0}function vv(e){return l_(e)?c_().response[e]:void 0}var pf={"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},u_={"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 d_(e){return Object.prototype.hasOwnProperty.call(pf,e)}function p_(e){return Object.prototype.hasOwnProperty.call(u_,e)}function zv(e){return Object.prototype.hasOwnProperty.call(pf,e)}function wv(e){return d_(e)?At().dispatchRequestSchemas[e]:void 0}function Rv(e){return zv(e)?At().dispatchResultSchemas[e]:void 0}function xv(e){return p_(e)?At().notificationSchemas2026[e]:void 0}var hR=Object.keys(pf),mR=Object.keys(u_);function la(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function aa(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 Pv={ok:!1,reason:"not-in-era"},Tv=[io,ao];function kv(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=>la(c)&&"execution"in c)&&(n().tools=s.map(c=>{if(!la(c)||!("execution"in c))return c;let l={...c};return delete l.execution,l}));let i=t.capabilities;if(la(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return o}var hf={era:"2026-07-28",hasRequestMethod:d_,hasNotificationMethod:p_,hasInputRequestMethod:e=>Ym(e)!==void 0,validateRequest:(e,t)=>aa(wv(e),t),validateResult:(e,t)=>aa(Rv(e),t),validateNotification:(e,t)=>aa(xv(e),t),validateInputRequest:(e,t)=>aa(Ym(e),t),validateInputResponse:(e,t)=>aa(vv(e),t),samplingResultVariant:()=>Pv,outboundEnvelope(e){return{[io]:e.protocolVersion,[br]:e.clientInfo,[ao]:e.clientCapabilities,...e.logLevel!==void 0&&{[vr]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let r of Tv)r in e||t.push({key:r,problem:"missing"});let o=At().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=>BS(e),inputRequestSchema:Ym,decodeResult(e,t){if(!la(t))return{kind:"invalid",error:new ee(ie.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let o=t.resultType;if(o===void 0)return{kind:"invalid",error:new ee(ie.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 ee(ie.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:o})};if(o==="input_required"){let i=t.inputRequests,c=la(i)?i:{},l=t.requestState,u=t._meta===void 0?void 0:At().ResultMetaSchema.safeParse(t._meta),h=u?.success?u.data:void 0;return Object.keys(c).length===0&&typeof l!="string"?{kind:"invalid",error:new ee(ie.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},...h!==void 0&&{_meta:h}}}if(o!=="complete")return{kind:"invalid",error:new ee(ie.UnsupportedResultType,`Unsupported result type '${o}' for ${e}`,{resultType:o,method:e})};let r=Ev(),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 ee(ie.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 gv(mv(e,hv(e,kv(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=At().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("; ")}`}},Kl;function Ev(){if(Kl)return Kl;let e=At();return Kl={"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},Kl}var mf="2026-07-28";function da(e){return e!==void 0&&JS(e)?hf:uf}function jS(e){return e.revision!==void 0?da(e.revision).era:e.era==="modern"?hf.era:uf.era}function Qm(e){return h_.some(t=>t.hasRequestMethod(e))}function Xm(e){return h_.some(t=>t.hasNotificationMethod(e))}function LS(e){return e==="tasks/get"||e==="tasks/cancel"}var h_=[uf,hf],$v=If({AnnotationsSchema:()=>Ge,AudioContentSchema:()=>go,BaseMetadataSchema:()=>Je,BaseRequestParamsSchema:()=>re,BlobResourceContentsSchema:()=>Mr,BooleanSchemaSchema:()=>Lr,CallToolRequestParamsSchema:()=>fi,CallToolRequestSchema:()=>gi,CallToolResultSchema:()=>Mt,CancelTaskRequestSchema:()=>ql,CancelTaskResultSchema:()=>jl,CancelledNotificationParamsSchema:()=>ws,CancelledNotificationSchema:()=>kr,ClientCapabilitiesSchema:()=>xs,ClientNotificationSchema:()=>Ul,ClientRequestSchema:()=>Ll,ClientResultSchema:()=>Zl,ClientTasksCapabilitySchema:()=>Rl,CompatibilityCallToolResultSchema:()=>Pl,CompleteRequestParamsSchema:()=>Vi,CompleteRequestSchema:()=>Hi,CompleteResultSchema:()=>Fi,ContentBlockSchema:()=>We,CreateMessageRequestParamsSchema:()=>ki,CreateMessageRequestSchema:()=>Ei,CreateMessageResultSchema:()=>$i,CreateMessageResultWithToolsSchema:()=>Ci,CreateTaskResultSchema:()=>El,CursorSchema:()=>wr,DiscoverRequestSchema:()=>$s,DiscoverResultSchema:()=>$r,ElicitRequestFormParamsSchema:()=>vo,ElicitRequestParamsSchema:()=>Ai,ElicitRequestSchema:()=>qi,ElicitRequestURLParamsSchema:()=>Mi,ElicitResultSchema:()=>Ui,ElicitationCompleteNotificationParamsSchema:()=>ji,ElicitationCompleteNotificationSchema:()=>Li,EmbeddedResourceSchema:()=>So,EmptyResultSchema:()=>Ot,EnumSchemaSchema:()=>Ni,GetPromptRequestParamsSchema:()=>si,GetPromptRequestSchema:()=>ii,GetPromptResultSchema:()=>li,GetTaskPayloadRequestSchema:()=>Ol,GetTaskPayloadResultSchema:()=>Nl,GetTaskRequestSchema:()=>Cl,GetTaskResultSchema:()=>Il,IconSchema:()=>Rs,IconsSchema:()=>st,ImageContentSchema:()=>fo,ImplementationSchema:()=>Be,InitializeRequestParamsSchema:()=>Ps,InitializeRequestSchema:()=>Ts,InitializeResultSchema:()=>ks,InitializedNotificationSchema:()=>Es,JSONArraySchema:()=>zl,JSONObjectSchema:()=>W,JSONRPCErrorResponseSchema:()=>uo,JSONRPCMessageSchema:()=>po,JSONRPCNotificationSchema:()=>Tr,JSONRPCRequestSchema:()=>Pr,JSONRPCResponseSchema:()=>wl,JSONRPCResultResponseSchema:()=>lo,JSONValueSchema:()=>nt,LegacyTitledEnumSchemaSchema:()=>Dr,ListChangedOptionsBaseSchema:()=>Tl,ListPromptsRequestSchema:()=>ri,ListPromptsResultSchema:()=>ni,ListResourceTemplatesRequestSchema:()=>qs,ListResourceTemplatesResultSchema:()=>js,ListResourcesRequestSchema:()=>Ms,ListResourcesResultSchema:()=>As,ListRootsRequestSchema:()=>Bi,ListRootsResultSchema:()=>Gi,ListTasksRequestSchema:()=>Ml,ListTasksResultSchema:()=>Al,ListToolsRequestSchema:()=>hi,ListToolsResultSchema:()=>mi,LoggingLevelSchema:()=>jr,LoggingMessageNotificationParamsSchema:()=>bi,LoggingMessageNotificationSchema:()=>vi,ModelHintSchema:()=>zi,ModelPreferencesSchema:()=>wi,MultiSelectEnumSchemaSchema:()=>Oi,NotificationSchema:()=>se,NotificationsParamsSchema:()=>de,NumberSchemaSchema:()=>bo,PaginatedRequestParamsSchema:()=>Os,PaginatedRequestSchema:()=>it,PaginatedResultSchema:()=>at,PingRequestSchema:()=>Cr,PrimitiveSchemaDefinitionSchema:()=>Fr,ProgressNotificationParamsSchema:()=>Is,ProgressNotificationSchema:()=>Ir,ProgressSchema:()=>Cs,ProgressTokenSchema:()=>zr,PromptArgumentSchema:()=>ti,PromptListChangedNotificationSchema:()=>ui,PromptMessageSchema:()=>ci,PromptReferenceSchema:()=>Di,PromptSchema:()=>oi,ReadResourceRequestParamsSchema:()=>Ls,ReadResourceRequestSchema:()=>Us,ReadResourceResultSchema:()=>Zs,RelatedTaskMetadataSchema:()=>zs,RequestIdSchema:()=>je,RequestMetaSchema:()=>Rr,RequestSchema:()=>K,ResourceContentsSchema:()=>Or,ResourceLinkSchema:()=>_o,ResourceListChangedNotificationSchema:()=>Ds,ResourceRequestParamsSchema:()=>ho,ResourceSchema:()=>Ar,ResourceTemplateReferenceSchema:()=>Zi,ResourceTemplateSchema:()=>Ns,ResourceUpdatedNotificationParamsSchema:()=>Xs,ResourceUpdatedNotificationSchema:()=>ei,ResultMetaObjectSchema:()=>xr,ResultSchema:()=>Y,RoleSchema:()=>ct,RootSchema:()=>Ji,RootsListChangedNotificationSchema:()=>Wi,SamplingContentSchema:()=>Pi,SamplingMessageContentBlockSchema:()=>$t,SamplingMessageSchema:()=>Ti,ServerCapabilitiesSchema:()=>Er,ServerNotificationSchema:()=>Vl,ServerRequestSchema:()=>Dl,ServerResultSchema:()=>Hl,ServerTasksCapabilitySchema:()=>xl,SetLevelRequestParamsSchema:()=>_i,SetLevelRequestSchema:()=>yi,SingleSelectEnumSchemaSchema:()=>Ii,StringSchemaSchema:()=>yo,SubscribeRequestParamsSchema:()=>Vs,SubscribeRequestSchema:()=>Hs,SubscriptionFilterSchema:()=>qr,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Ws,SubscriptionsAcknowledgedNotificationSchema:()=>Ks,SubscriptionsListenRequestParamsSchema:()=>Bs,SubscriptionsListenRequestSchema:()=>Gs,SubscriptionsListenResultMetaSchema:()=>Ys,SubscriptionsListenResultSchema:()=>Qs,TaskAugmentedRequestParamsSchema:()=>It,TaskCreationParamsSchema:()=>kl,TaskMetadataSchema:()=>vs,TaskSchema:()=>lt,TaskStatusNotificationParamsSchema:()=>Yi,TaskStatusNotificationSchema:()=>$l,TaskStatusSchema:()=>Ki,TextContentSchema:()=>mo,TextResourceContentsSchema:()=>Nr,TitledMultiSelectEnumSchemaSchema:()=>Hr,TitledSingleSelectEnumSchemaSchema:()=>Zr,ToolAnnotationsSchema:()=>di,ToolChoiceSchema:()=>Ri,ToolExecutionSchema:()=>pi,ToolListChangedNotificationSchema:()=>Si,ToolResultContentSchema:()=>xi,ToolSchema:()=>Nt,ToolUseContentSchema:()=>ai,UnsubscribeRequestParamsSchema:()=>Fs,UnsubscribeRequestSchema:()=>Js,UntitledMultiSelectEnumSchemaSchema:()=>Vr,UntitledSingleSelectEnumSchemaSchema:()=>Ur});var m_=e=>Pr.safeParse(e).success,f_=e=>Tr.safeParse(e).success,nf=e=>lo.safeParse(e).success,g_=e=>uo.safeParse(e).success;var ua=-32020,fR=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32e3],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[U.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:[ua,U.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:[U.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:[U.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:[U.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:[ua],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:[U.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:[ua],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool\u2019s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],gR={[U.ParseError]:400,[U.InvalidRequest]:400,[U.MethodNotFound]:404,[U.UnsupportedProtocolVersion]:400,[U.MissingRequiredClientCapability]:400,[ua]:400};function ff(e,t){return ls(e,t)}function ca(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function sf(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 US=!1,af="draft-2020-12";function Cv(e,t="input"){let o=e["~standard"],r;if(o.jsonSchema)r=o.jsonSchema[t]({target:af});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().");US||(US=!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=no(e,{target:af,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:S_(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 S_(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"||S_(r)))}return!1}function Iv(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function ef(e,t){let o=await e["~standard"].validate(t);return o.issues&&o.issues.length>0?{success:!1,error:o.issues.map(r=>Iv(r)).join(", ")}:{success:!0,data:o.value}}function Ov(e){let t=no(e,{target:af,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var Nv=/\\\.\\d\{(\d+)\}/;function Mv(e){let t=Nv.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=>Pe.datetime({local:r,offset:n,precision:s}))))}function Av(e,t){let o;switch(e){case"email":o=[Kc()];break;case"uri":o=[fr()];break;case"date":o=[Pe.date()];break;case"date-time":o=Mv(t);break}return new Set(o.map(r=>Ov(r)).filter(r=>r!==void 0))}function qv(e,t,o){return o!=="zod"?!0:Av(e,t).has(t)}function pa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function jv(e){try{return Cv(e,"input")}catch(t){let o=t instanceof Error?t.message:String(t);throw new ae(U.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${o}`)}}var Lv=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function gf(e){return Lv.has(e)||e.startsWith("x-")}var Uv=new Set(["$schema",...Object.keys(vo.shape.requestedSchema.shape)]),ZS={string:ca([yo,Ur,Zr,Dr]),number:ca([bo]),integer:ca([bo]),boolean:ca([Lr]),array:ca([Vr,Hr])},Zv=new Set(yo.shape.format.unwrap().options);function Dv(e,t,o,r){if(!pa(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(ZS,e.type)?ZS[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,c]of Object.entries(e))n.has(i)||gf(i)?s[i]=c:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?Zv.has(e.format)?(typeof c!="string"||!qv(e.format,c,o))&&r.push(`${t}.${i}`):s[i]=c:r.push(`${t}.${i}`);return s}function Vv(e,t){let o={},r=[];for(let[n,s]of Object.entries(e))n==="properties"&&pa(s)?o[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,Dv(c,`properties.${i}`,t,r)])):Uv.has(n)?o[n]=s:gf(n)||r.push(n);if(r.length>0)throw new ae(U.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(", ")}`);return o}function Hv(e,t){if(!pa(e.properties))return t;let o=Object.entries(e.properties).filter(([,r])=>!ff(Fr,r).success).map(([r])=>`properties.${r}`);return o.length>0?o.join(", "):t}function cf(e,t,o=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((r,n)=>cf(r,t[n],`${o}[${n}]`)):!pa(e)||!pa(t)?[]:Object.entries(e).flatMap(([r,n])=>{let s=o?`${o}.${r}`:r;return Object.prototype.hasOwnProperty.call(t,r)?cf(n,t[r],s):gf(r)?[]:[s]})}function Fv(e){if(!sf(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,o=Vv(jv(e.requestedSchema),t),r=ff(vo.shape.requestedSchema,o);if(!r.success)throw new ae(U.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Hv(o,r.error.message)}`);let n=cf(o,r.data);if(n.length>0)throw new ae(U.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 ae(U.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:r.data}}function Jv(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 SR=Object.assign(Jv,{elicit(e){try{return{method:"elicitation/create",params:Fv(e)}}catch(t){throw t instanceof ae?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 Bv=["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"],Gv={IdJagTokenExchangeResponseSchema:oa,OAuthClientInformationFullSchema:ia,OAuthClientInformationSchema:sa,OAuthClientMetadataSchema:na,OAuthClientRegistrationErrorSchema:Fl,OAuthErrorResponseSchema:ra,OAuthMetadataSchema:Jr,OAuthProtectedResourceMetadataSchema:Qi,OAuthTokenRevocationRequestSchema:Jl,OAuthTokensSchema:ta,OpenIdProviderDiscoveryMetadataSchema:ea,OpenIdProviderMetadataSchema:Xi},__={},y_={};function b_(e,t){let o=e.slice(0,-6);__[o]=t,y_[o]=r=>t.safeParse(r).success}for(let e of Bv)b_(e,$v[e]);for(let[e,t]of Object.entries(Gv))b_(e,t);var Wv=Object.freeze(__),Kv=Object.freeze(y_);function Yv(e){switch(e){case"initialize":case"notifications/initialized":return da(void 0);case"server/discover":return da(mf);default:return}}var v_=6e4,Qv=[io,br,ao,vr],Xv=["inputResponses","requestState"];function DS(e,t){let o=e.params;if(!tf(o))return{message:e,lifted:{}};let r=o._meta,n=tf(r)?Qv.filter(l=>l in r):[],s=t==="request"?Xv.filter(l=>l in o):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...o};if(n.length>0&&tf(r)){let l={},u={...r};for(let h of n)l[h]=r[h],delete u[h];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 VS(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 z_(e){return()=>e}var ez=z_(void 0),tz,Sf=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{tz=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??yl,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 ee(ie.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 ee(ie.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),nf(n)||g_(n)?this._onresponse(n):m_(n)?this._onrequest(n,s):f_(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 ee(ie.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}=DS(e,"notification"),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=jS(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(Xm(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}=DS(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=(k,T,O)=>{let j={jsonrpc:"2.0",id:o.id,error:{code:k,message:T,...O!==void 0&&{data:O}}};s?.send(j).catch(A=>this._onerror(new Error(`Failed to send an error response: ${A}`)))};if(t?.classification!==void 0){let k=jS(t.classification);if(k!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${o.method}': classified as ${k} but this instance serves ${n.era}`));let T=t.classification.revision??k;i(U.UnsupportedProtocolVersion,`Unsupported protocol version: ${T}`,{supported:this._supportedProtocolVersions,requested:T});return}}if(Qm(o.method)&&!n.hasRequestMethod(o.method)&&!(LS(o.method)&&this._customSchemaRequestMethods.has(o.method))){i(U.MethodNotFound,"Method not found");return}let c=this._requestHandlers.get(o.method)??this.fallbackRequestHandler;if(c===void 0){i(U.MethodNotFound,"Method not found");return}let l=n.checkInboundEnvelope(r);if(l!==void 0){i(U.InvalidParams,l);return}let u=(k,T)=>this._notificationViaCodec(this._resolveOutboundCodec(k.method),k,{...T,relatedRequestId:o.id}),h=(k,T,O)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(k.method),k,T,{...O,relatedRequestId:o.id}),f=new AbortController;this._requestHandlerAbortControllers.set(o.id,f);let y=r.inputResponses===void 0?void 0:oz(r.inputResponses),_={sessionId:s?.sessionId,mcpReq:{id:o.id,method:o.method,_meta:o.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...y!==void 0&&{inputResponses:y.accepted},...y!==void 0&&y.droppedKeys.length>0&&{droppedInputResponseKeys:y.droppedKeys},requestState:r.requestState===void 0?ez:z_(r.requestState),signal:f.signal,send:((k,T,O)=>{let j=this._resolveOutboundCodec(k.method);if(this._assertOutboundRequestInEra(j,k.method),sf(T))return h(k,T,O);let A=VS(j,k.method);if(A===void 0)throw new TypeError(`'${k.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return h(k,A,T)}),notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},v=this.buildContext(_,t);Promise.resolve().then(()=>c(o,v)).then(async k=>{if(f.signal.aborted)return;let T;try{T=n.encodeResult(o.method,k,this._outboundServerInfo())}catch(j){this._onerror(new Error(`Failed to encode result for ${o.method}: ${j}`)),i(U.InternalError,"Internal error");return}let O={result:T,jsonrpc:"2.0",id:o.id};await s?.send(O)},async k=>{if(f.signal.aborted)return;let T=Number.isSafeInteger(k.code)?k.code:U.InternalError,O={jsonrpc:"2.0",id:o.id,error:{code:n.encodeErrorCode(T),message:k.message??"Internal error",...k.data!==void 0&&{data:k.data}}};await s?.send(O)}).catch(k=>this._onerror(new Error(`Failed to send response: ${k}`))).finally(()=>{this._requestHandlerAbortControllers.get(o.id)===f&&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),nf(e)?o(e):o(ae.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(sf(t))return LS(e.method)||this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,o);this._assertOutboundRequestInEra(r,e.method);let n=VS(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 da(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Yv(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Qm(t)&&!e.hasRequestMethod(t))throw new ee(ie.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,h;return new Promise((f,y)=>{let _=D=>{y(D)};if(!this._transport){_(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(D){_(D);return}if(r?.signal?.aborted){let D=r.signal.reason;throw D instanceof ee?D:new ee(ie.RequestTimeout,String(D))}let v=e.era===mf&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,k=this._requestMessageId++;h=k;let T={...t,jsonrpc:"2.0",id:k};r?.onprogress&&(this._progressHandlers.set(k,r.onprogress),T.params={...t.params,_meta:{...t.params?._meta,progressToken:k}});let O=this._envelopeOutbound(T),j=!1,A=D=>{j||(this._progressHandlers.delete(k),v===void 0?t.method!=="initialize"&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:k,reason:String(D)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(G=>this._onerror(new Error(`Failed to send cancellation: ${G}`))):v.abort(),y(D instanceof ee?D:new ee(ie.RequestTimeout,String(D))))};this._responseHandlers.set(k,D=>{if(r?.signal?.aborted)return;if(j=!0,D instanceof Error)return y(D);let G;try{G=e.decodeResult(t.method,D.result)}catch(te){return y(te instanceof Error?te:new Error(String(te)))}if(G.kind==="invalid")return y(G.error);if(G.kind==="input_required"){if(r?.allowInputRequired===!0)return f(rz(G));let te={codec:e,request:t,resultSchema:o,options:r,flowStartedAt:l,retry:(ke,qt)=>this._requestWithSchemaViaCodec(e,ke===void 0?{method:t.method}:{method:t.method,params:ke},o,qt)};return f(this._resolveNonCompleteResult(G,te))}let pe=G.result;ef(o,pe).then(te=>{te.success?f(te.data):y(new ee(ie.InvalidResult,`Invalid result for ${t.method}: ${te.error}`))},y)}),u=()=>A(r?.signal?.reason),r?.signal?.addEventListener("abort",u,{once:!0});let Z=r?.timeout??v_,V=()=>A(new ee(ie.RequestTimeout,"Request timed out",{timeout:Z}));this._setupTimeout(k,Z,r?.maxTotalTimeout,V,r?.resetTimeoutOnProgress??!1),this._transport.send(O,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c,requestSignal:v?.signal}).catch(D=>{this._progressHandlers.delete(k),y(D)})}).finally(()=>{u&&r?.signal?.removeEventListener("abort",u),h!==void 0&&(this._responseHandlers.delete(h),this._cleanupTimeout(h))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,o){if(!this._transport)throw new ee(ie.NotConnected,"Not connected");if(Xm(t.method)&&!e.hasNotificationMethod(t.method))throw new ee(ie.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(!Qm(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 ae(U.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 ef(t.params,{...n.params});if(!i.success)throw new ae(U.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(!Xm(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 ae(U.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 ef(t.params,{...r.params});if(!n.success)throw new ae(U.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await o(n.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function tf(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function HS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function oz(e){let t={},o=[];if(!HS(e))return{accepted:t,droppedKeys:o};for(let[r,n]of Object.entries(e)){if(!HS(n)||"method"in n||"result"in n){o.push(r);continue}t[r]=n}return{accepted:t,droppedKeys:o}}function rz(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var nz=Cf((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(";"),h=u!==-1?l.slice(0,u).trim():l.trim();if(!r.test(h))throw new TypeError("invalid media type");var f=new i(h.toLowerCase());if(u!==-1){var y,_,v;for(t.lastIndex=u;_=t.exec(l);){if(_.index!==u)throw new TypeError("invalid parameter format");u+=_[0].length,y=_[1].toLowerCase(),v=_[2],v.charCodeAt(0)===34&&(v=v.slice(1,-1),v.indexOf("\\")!==-1&&(v=v.replace(o,"$1"))),f.parameters[y]=v}if(u!==l.length)throw new TypeError("invalid parameter format")}return f}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}})),_R=Of(nz(),1);var sz=10*1024*1024;var ER=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 iz=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,az=[0,31,28,31,30,31,30,31,31,30,31,30,31],cz=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,lz=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,uz=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,dz=/^(?:(?:[^\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,pz=/^(?:(?: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,hz=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,mz=/^(?:\/(?:[^~/]|~0|~1)*)*$/,fz=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,gz=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Sz=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))},_z=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,yz=/^((([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,bz=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 Ke(e){return e.test.bind(e)}var $R={date:w_,time:R_.bind(void 0,!1),"date-time":wz,duration:bz,uri:Pz,"uri-reference":Ke(uz),"uri-template":Ke(dz),url:Ke(pz),email:Sz,hostname:Ke(lz),ipv4:Ke(_z),ipv6:Ke(yz),regex:kz,uuid:Ke(hz),"json-pointer":Ke(mz),"json-pointer-uri-fragment":Ke(fz),"relative-json-pointer":Ke(gz)};function vz(e){return e%4===0&&(e%100!==0||e%400===0)}function w_(e){let t=e.match(iz);if(!t)return!1;let o=+t[1],r=+t[2],n=+t[3];return r>=1&&r<=12&&n>=1&&n<=(r==2&&vz(o)?29:az[r])}function R_(e,t){let o=t.match(cz);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 zz=/t|\s/i;function wz(e){let t=e.split(zz);return t.length==2&&w_(t[0])&&R_(!0,t[1])}var Rz=/\/|:/,xz=/^(?:[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 Pz(e){return Rz.test(e)&&xz.test(e)}var Tz=/[^\\]\\Z/;function kz(e){if(Tz.test(e))return!1;try{return new RegExp(e,"u"),!0}catch{return!1}}var $z;$z=globalThis.crypto;var ha=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](e){return Te(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 Te(this,e)}constructor(e){super(e),this.name=new.target.name,zo(this,new.target)}},Rx=class extends ha{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}},xx=class extends ha{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}},Px=class extends ha{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}},Tx=class extends ha{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}},kx=class extends ha{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 Ex=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](e){return Te(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 Te(this,e)}constructor(e){super(e??"Unauthorized"),this.name="UnauthorizedError",zo(this,new.target)}};var $x=Symbol.for("mcp.authSeamEscape");var Cx=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](e){return Te(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 Te(this,e)}constructor(e,t,o){super(`SSE error: ${t}`),this.code=e,this.event=o,zo(this,new.target)}};var _f=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}},yf=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)}},x_=new Set;function P_(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";x_.has(i)||(x_.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},Cz(u)):l=>c({method:s,params:l})]}function Cz(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 Iz="2026-01-26";var Oz="ui/notifications/tool-input-partial";var bf=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=po.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!==Oz&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},Nz=d.union([d.literal("light"),d.literal("dark")]).describe("Color theme preference for the host environment."),ma=d.union([d.literal("inline"),d.literal("fullscreen"),d.literal("pip")]).describe("Display mode for UI presentation."),Mz=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."),Az=d.record(Mz.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.`),
|
|
83
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Gx=d.object({method:d.literal("ui/open-link"),params:d.object({url:d.string().describe("URL to open in the host's browser")})}),qz=d.object({isError:d.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),jz=d.object({isError:d.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),Lz=d.object({isError:d.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),Wx=d.object({method:d.literal("ui/notifications/sandbox-proxy-ready"),params:d.object({})}),vf=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'`)")}),
|
|
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'`)")}),zf=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.")}),Kx=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.")})}),Uz=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.")})}),Zz=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).")})}),Dz=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").')})}),Vz=d.object({fonts:d.string().optional()}),Hz=d.object({variables:Az.optional().describe("CSS variables for theming the app."),css:Vz.optional().describe("CSS blocks that apps can inject.")}),Fz=d.object({method:d.literal("ui/resource-teardown"),params:d.object({})}),Jz=d.record(d.string(),d.unknown()),T_=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.")}),Yx=d.object({method:d.literal("ui/notifications/request-teardown"),params:d.object({}).optional()}),Bz=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:zf.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:vf.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:T_.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:T_.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.")}),Gz=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(ma).optional().describe("Display modes the app supports.")}),Qx=d.object({method:d.literal("ui/notifications/initialized"),params:d.object({}).optional()}),Xx=d.object({csp:vf.optional().describe("Content Security Policy configuration for UI resources."),permissions:zf.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,15 +97,16 @@ 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`)}),
|
|
100
|
+
- omitted: host decides border`)}),eP=d.object({method:d.literal("ui/request-display-mode"),params:d.object({mode:ma.describe("The display mode being requested.")})}),Wz=d.object({mode:ma.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),Kz=d.union([d.literal("model"),d.literal("app")]).describe("Tool visibility scope - who can access the tool."),tP=d.object({resourceUri:d.string().optional(),visibility:d.array(Kz).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()}),
|
|
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(),Jz=d.object({method:d.literal("ui/notifications/host-context-changed"),params:P_.describe("Partial context update containing only changed fields.")}),eP=d.object({method:d.literal("ui/update-model-context"),params:d.object({content:d.array(Be).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.")})}),tP=d.object({method:d.literal("ui/initialize"),params:d.object({appInfo:Fe.describe("App identification (name and version)."),appCapabilities:Dz.describe("Features and capabilities this app provides."),protocolVersion:d.string().describe("Protocol version this app supports.")})}),Bz=d.object({protocolVersion:d.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Fe.describe("Host application identification and version."),hostCapabilities:Zz.describe("Features and capabilities provided by the host."),hostContext:P_.describe("Rich context about the host environment.")}).passthrough(),Gz={target:"draft-2020-12"};async function R_(e,t){let o=e["~standard"];if(o.jsonSchema)return o.jsonSchema[t](Gz);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 x_(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 Gl=class e extends ff{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new gf;_methods=new Sf;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:Nz,toolinputpartial:Mz,toolresult:Fz,toolcancelled:Az,hostcontextchanged:Jz};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 h;if(i){let f=c.inputSchema,y=f?await x_(f,l??{},`Invalid input for tool ${t}: `):l??{};h=await r(y,u)}else h=await r(u);return c.outputSchema&&!h.isError&&(h.structuredContent=await x_(c.outputSchema,h.structuredContent,`Invalid output for tool ${t}: `)),h}};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:Lz.shape.params,result:Uz},(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},Oz,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},Cz,o)}sendOpenLink=this.openLink;downloadFile(t,o){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:t},Iz,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},Vz,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 _f(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:Pz}},Bz,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 Wl=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 h=this.urls.get(u);if(!h)throw new Error("Unsupported cyclic asset reference.");l=l.replaceAll(u,h)}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(h=>h.id===o);if(!s)throw new Error("The selected scenario is no longer registered.");let i=JSON.stringify(this.closure(s.module).map(h=>[h,this.records.get(h)]));if(this.mounted?.id===o&&this.mounted.container===r&&this.mounted.signature===i)return!0;let c=await this.importModule(s.module);if(n!==this.generation)return!1;let l=this.unmount;if(this.unmount=void 0,this.mounted=void 0,await l?.(),n!==this.generation||this.closed)return!1;r.replaceChildren();let u=new Set(this.closure(s.module));for(let[h,f]of this.styles)u.has(h)||(f.remove(),this.styles.delete(h),this.styleReady.delete(h));for(let h of this.closure(s.module))this.styles.has(h)&&document.head.append(this.styles.get(h));if(typeof c.mount!="function")throw new Error("The compiled scenario has no mount adapter.");if(this.unmount=c.mount(r),typeof this.unmount!="function")throw new Error("The scenario mount adapter must return an unmount callback.");return this.mounted={id:o,container:r,signature:i},!0}async dispose(){if(!this.closed){this.closed=!0,++this.generation,await this.unmount?.(),this.mounted=void 0;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 T_(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 k_(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 E_(e,t){if(!T_(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 h=r.getComputedStyle(n).getPropertyValue(u.token).trim();if(!h||!r.CSS.supports(u.property,h)){s.push(`${u.token}: its current value is invalid for the fixture's ${u.property} binding.`);continue}let f=c.filter(_=>_.dataset.adsToken===u.token&&_.dataset.adsProperty===u.property);if(!f.length){s.push(`${u.token} needs a rendered ${u.property} sample, not only a name/value label.`);continue}let y=!1;for(let _ of f){let z=[];for(let O=_.parentElement;O&&O!==e;O=O.parentElement)O.tagName==="DETAILS"&&!O.open&&(O.open=!0,z.push(O));let k=n.getAttribute("style"),T=_.getAttribute("style");try{/^(?:-[a-z]+-)?transition(?:-|$)/.test(u.property)||_.style.setProperty("transition","none","important");let O=r.getComputedStyle(_).getPropertyValue(u.property),j=k_(_,r);n.style.setProperty(u.token,u.probe,"important");let A=r.getComputedStyle(_).getPropertyValue(u.property);y=!!(A&&A!==O&&(j||k_(_,r)))}finally{k===null?n.removeAttribute("style"):n.setAttribute("style",k),T===null?_.removeAttribute("style"):_.setAttribute("style",T);for(let O of z)O.open=!1}if(y)break}y?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}}function $_({container:e=document.getElementById("root"),bindings:t=[],auditResources:o=!1}={}){let r=[],n=[],s=[];if(!e||!Array.isArray(t)||t.length>100)return{ok:!1,diagnostics:["Invalid bounded paint-audit descriptor."],verified:n};let i=e.ownerDocument,c=i.defaultView,l=["color","fill","stroke","stop-color","background-color","border-top-color","border-right-color","border-bottom-color","border-left-color"];function u(f,y,_,z=new Set){if(f=f.trim(),["none","currentColor"].includes(f))return!0;let k=/^var\(\s*(--[\w-]+)\s*\)$/.exec(f);if(k){let j=k[1];if(!_.tokens.includes(j)||z.has(j))return!1;let A=c.getComputedStyle(y).getPropertyValue(j).trim();return!!A&&c.CSS.supports("color",A)}let T=/^light-dark\(\s*(var\(\s*--[\w-]+\s*\)|currentColor)\s*,\s*(var\(\s*--[\w-]+\s*\)|currentColor)\s*\)$/.exec(f);if(T)return c.CSS.supports("color",f)&&u(T[1],y,_,z)&&u(T[2],y,_,z);let O=/^url\(\s*(["']?)#([^\s"'()#\\\p{Cc}]+)\1\s*\)$/u.exec(f);if(O&&c.CSS.supports("fill",f)){let j=[...i.querySelectorAll("[id]")].filter(A=>A.id===O[2]);return j.length===1&&["linearGradient","radialGradient","pattern"].includes(j[0].localName)&&y.contains(j[0])}return!1}for(let f of t){if(!f||typeof f.scope!="string"||!Array.isArray(f.tokens)||typeof f.prefix!="string"||typeof f.suffix!="string"){r.push("Invalid paint binding metadata; rebuild previews.");continue}let y;try{y=[...e.querySelectorAll(f.scope)]}catch{r.push(`${f.owner}: invalid binding scope.`);continue}y.length>20&&s.push(`${f.owner}: only the first 20 instances were audited; use a focused scenario for complete evidence.`);for(let _ of y.slice(0,20)){let z=[_,..._.querySelectorAll("*")];if(z.length>1e3){s.push(`${f.owner}: instance exceeds 1000 elements; paint effects are not established.`);continue}let k=[..._.style].filter(T=>T.startsWith(f.prefix)&&T.endsWith(f.suffix));k.length>100&&s.push(`${f.owner}: only the first 100 binding keys were audited.`);for(let T of k.slice(0,100)){let O=_.style.getPropertyValue(T).trim(),j=T.slice(f.prefix.length,f.suffix?-f.suffix.length:void 0);if(!/^[A-Za-z0-9_-]+$/.test(j)||!u(O,_,f)){r.push(`${f.owner}: invalid or inaccessible paint ${T}: ${O}. Use an accessible token, instance-local SVG paint server, none or currentColor.`);continue}let A=_.getAttribute("style"),Z=z.map(V=>V.getAttribute("style"));try{for(let G of z)G.style.setProperty("transition","none","important");let V=z.map(G=>l.map(pe=>c.getComputedStyle(G).getPropertyValue(pe)));_.style.setProperty(T,"rgb(17, 103, 211)","important");let D=z.some((G,pe)=>l.some((te,ke)=>c.getComputedStyle(G).getPropertyValue(te)!==V[pe][ke]));D||(_.style.setProperty(T,"rgb(211, 67, 23)","important"),D=z.some((G,pe)=>l.some((te,ke)=>c.getComputedStyle(G).getPropertyValue(te)!==V[pe][ke]))),D?n.push({owner:f.owner,binding:f.name,variable:T}):s.push(`${f.owner}: ${T} has no observed paint effect in its current instance. A written variable alone is not rendering evidence; check the relevant selected/visible consumer.`)}finally{z.forEach((V,D)=>{Z[D]===null?V.removeAttribute("style"):V.setAttribute("style",Z[D])}),A===null?_.removeAttribute("style"):_.setAttribute("style",A)}}for(let T of z)for(let O of["fill","stroke","stop-color"]){let j=T.getAttribute(O);if(!j)continue;let A=/^var\(\s*(--[\w-]+)\s*\)$/.exec(j);A&&A[1].startsWith(f.prefix)&&A[1].endsWith(f.suffix)&&!k.includes(A[1])&&r.push(`${f.owner}: ${A[1]} is consumed without a value in this instance.`),j.startsWith("url(")&&!u(j,_,f)&&r.push(`${f.owner}: missing, duplicated or out-of-instance local paint resource ${j}.`)}}}let h=o?[...e.querySelectorAll("[fill], [stroke], [style]")]:[];h.length>1e3&&s.push("Only the first 1000 potential SVG paint consumers were audited.");for(let f of h.slice(0,1e3))for(let y of["fill","stroke"]){let _=f.getAttribute(y)??f.style.getPropertyValue(y);if(!_?.startsWith("url("))continue;let z=/^url\(\s*(["']?)#([^\s"'()#\\\p{Cc}]+)\1\s*\)$/u.exec(_)?.[2],k=z?[...i.querySelectorAll("[id]")].filter(O=>O.id===z):[],T=f.ownerSVGElement??(f.localName==="svg"?f:null);(k.length!==1||!T?.contains(k[0])||!["linearGradient","radialGradient","pattern"].includes(k[0]?.localName))&&r.push(`Invalid, missing, duplicated or nonlocal SVG paint resource ${_}. Keep IDs isolated per rendered instance.`)}return{ok:!r.length,complete:!s.length,verified:n,diagnostics:r.slice(0,40),limits:s.slice(0,20),scope:"observed App instances and current input; repeat after updates"}}var Ke=new Gl({name:"ADS resource preview",version:"1.0.0"},{},{autoResize:!0}),zo=document.getElementById("root"),vf=document.getElementById("ads-preview-status"),wf=async e=>{if(!Ke.getHostCapabilities()?.serverResources)throw new Error("This host does not forward MCP resource reads. Open the same preview in the ADS showcase.");try{return await Ke.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}},Kl=new Wl(wf),Fr,Hr,C_,Rf,zf=!1,wo=0,ma={},We="";function Mt(e,t=!1){vf.textContent=e,vf.hidden=!e,vf.setAttribute("role",t?"alert":"status")}async function fa(e,t={}){try{Ke.getHostCapabilities()?.logging&&await Ke.sendLog({level:e==="error"?"error":"info",logger:"ads-preview",data:{state:e,id:Fr,...t}})}catch{}}function I_(e){ma={...ma,...e,styles:{...ma.styles,...e.styles}},["light","dark"].includes(ma.theme)&&(document.documentElement.dataset.theme=ma.theme)}async function O_(){let e;try{e=await wf("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 xf(e,t){if(e===Fr&&t&&t===Hr){Mt(We,!!We),await fa(We?"error":"ready",We?{message:We}:{revision:Hr});return}let o=++wo;++Kl.generation,Fr=e,document.documentElement.dataset.adsScenario=e,document.documentElement.dataset.adsPreviewState="loading";for(let r of["adsPreviewErrorCategory","adsPreviewErrorCode","adsPreviewResourceUri"])delete document.documentElement.dataset[r];We="",Mt(""),await fa("loading");try{let r=await O_();if(t&&r.revision!==t)throw new Error("Preview changed while opening. Select it again to use the current build.");if(o!==wo||!await Kl.mount(r,e,zo)||o!==wo||(Hr=r.revision,C_=r.session,await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i))),await document.fonts.ready,o!==wo))return;let s=r.scenarios.find(i=>i.id===e);if(zo.dataset.adsPaintBindings=JSON.stringify(s?.paintBindings??[]),zo.dataset.adsPaintAudit=String(!!s?.paintAudit),zo.dataset.adsPaintAuditComplete="not-requested",s?.paintBindings?.length||s?.paintAudit){let i=$_({container:zo,bindings:s.paintBindings??[],auditResources:!!s.paintAudit});if(!i.ok)throw Object.assign(new Error(`Paint binding verification failed:
|
|
104
|
-
${
|
|
105
|
-
`)}`),{code:"ADS_PAINT_BINDING",category:"assertion"});
|
|
106
|
-
${
|
|
107
|
-
`)}`,Object.assign(new Error(
|
|
108
|
-
${o}
|
|
102
|
+
- "app": Tool callable by the app from this server only`),csp:d.never().optional(),permissions:d.never().optional()}),oP=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.')}),rP=d.object({method:d.literal("ui/download-file"),params:d.object({contents:d.array(d.union([So,_o])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),nP=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(We).describe("Message content blocks (text, image, etc.).")})}),sP=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:vf.optional().describe("CSP configuration from resource metadata."),permissions:zf.optional().describe("Sandbox permissions from resource metadata.")})}),Yz=d.object({method:d.literal("ui/notifications/tool-result"),params:Mt.describe("Standard MCP tool execution result.")}),$_=d.object({toolInfo:d.object({id:je.optional().describe("JSON-RPC id of the tools/call request."),tool:Nt.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:Nz.optional().describe("Current color theme preference."),styles:Hz.optional().describe("Style configuration for theming the app."),displayMode:ma.optional().describe("How the UI is currently displayed."),availableDisplayModes:d.array(ma).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(),Qz=d.object({method:d.literal("ui/notifications/host-context-changed"),params:$_.describe("Partial context update containing only changed fields.")}),iP=d.object({method:d.literal("ui/update-model-context"),params:d.object({content:d.array(We).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.")})}),aP=d.object({method:d.literal("ui/initialize"),params:d.object({appInfo:Be.describe("App identification (name and version)."),appCapabilities:Gz.describe("Features and capabilities this app provides."),protocolVersion:d.string().describe("Protocol version this app supports.")})}),Xz=d.object({protocolVersion:d.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Be.describe("Host application identification and version."),hostCapabilities:Bz.describe("Features and capabilities provided by the host."),hostContext:$_.describe("Rich context about the host environment.")}).passthrough(),ew={target:"draft-2020-12"};async function k_(e,t){let o=e["~standard"];if(o.jsonSchema)return o.jsonSchema[t](ew);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 E_(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 tw(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 Yl=class e extends Sf{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new _f;_methods=new yf;setRequestHandler=(...t)=>{let[o,...r]=P_("request",t)??t;this._methods.claim(o,"setRequestHandler"),super.setRequestHandler.call(this,o,...r)};setNotificationHandler=(...t)=>{let[o,...r]=P_("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:Uz,toolinputpartial:Zz,toolresult:Yz,toolcancelled:Dz,hostcontextchanged:Qz};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=tw(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 h;if(i){let f=c.inputSchema,y=f?await E_(f,l??{},`Invalid input for tool ${t}: `):l??{};h=await r(y,u)}else h=await r(u);return c.outputSchema&&!h.isError&&(h.structuredContent=await E_(c.outputSchema,h.structuredContent,`Invalid output for tool ${t}: `)),h}};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 k_(n.inputSchema,"input"):{type:"object",properties:{}}};return n.outputSchema&&(s.outputSchema=await k_(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:Fz.shape.params,result:Jz},(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},Lz,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},Ot,o)}openLink(t,o){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:t},qz,o)}sendOpenLink=this.openLink;downloadFile(t,o){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:t},jz,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},Wz,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 bf(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:Iz}},Xz,o);if(r===void 0)throw Error(`Server sent invalid initialize result: ${r}`);this._hostCapabilities=r.hostCapabilities,this._hostInfo=r.hostInfo,this._hostContext=r.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(r){throw this.close(),r}}};function C_(e,t){let o=[],r=new Set;function n(s){if(r.has(s))return;r.add(s);let i=e.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}function I_(e,t){if(!e||e.revision===t.revision)return[];let o=(r,n)=>{let s=new Map(Object.entries(r.assets));return JSON.stringify(C_(s,n.module).map(i=>[i,s.get(i)]))};return t.scenarios.filter(r=>{let n=e.scenarios.find(s=>s.id===r.id);return!n||o(e,n)!==o(t,r)}).map(r=>r.id)}var Ql=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.prefetchGeneration=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){return C_(this.records,t)}async prefetch(t,o){if(this.closed)return;this.register(t);let r=++this.prefetchGeneration,n=new Set,s=[],i=0;for(let h of o){let f=t.scenarios.find(v=>v.id===h);if(!f)continue;let y=this.closure(f.module).filter(v=>!this.bytes.has(v)&&!n.has(v)),_=y.reduce((v,k)=>v+this.records.get(k).size,0);if(!(i+_>16*1024*1024||n.size+y.length>256)){i+=_,s.push(h);for(let v of y)n.add(v)}}let c=[...n],l=0,u=async()=>{for(;!this.closed&&r===this.prefetchGeneration&&l<c.length;)await this.resource(c[l++])};return await Promise.all(Array.from({length:Math.min(3,c.length)},u)),{scenarios:s,resources:c.length}}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 h=this.urls.get(u);if(!h)throw new Error("Unsupported cyclic asset reference.");l=l.replaceAll(u,h)}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(h=>h.id===o);if(!s)throw new Error("The selected scenario is no longer registered.");let i=JSON.stringify(this.closure(s.module).map(h=>[h,this.records.get(h)]));if(this.mounted?.id===o&&this.mounted.container===r&&this.mounted.signature===i)return!0;let c=await this.importModule(s.module);if(n!==this.generation)return!1;let l=this.unmount;if(this.unmount=void 0,this.mounted=void 0,await l?.(),n!==this.generation||this.closed)return!1;r.replaceChildren();let u=new Set(this.closure(s.module));for(let[h,f]of this.styles)u.has(h)||(f.remove(),this.styles.delete(h),this.styleReady.delete(h));for(let h of this.closure(s.module))this.styles.has(h)&&document.head.append(this.styles.get(h));if(typeof c.mount!="function")throw new Error("The compiled scenario has no mount adapter.");if(this.unmount=c.mount(r),typeof this.unmount!="function")throw new Error("The scenario mount adapter must return an unmount callback.");return this.mounted={id:o,container:r,signature:i},!0}async dispose(){if(!this.closed){this.closed=!0,++this.generation,++this.prefetchGeneration,await this.unmount?.(),this.mounted=void 0;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 O_(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 N_(e,t){let o=t.getComputedStyle(e),r=e.getBoundingClientRect();if(o.display==="none"||o.visibility!=="visible"||!e.getClientRects().length||!(r.width||r.height))return!1;for(let n=e;n;n=n.parentElement)if(Number(t.getComputedStyle(n).opacity)===0)return!1;return!0}function M_(e,t){if(!O_(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 h=r.getComputedStyle(n).getPropertyValue(u.token).trim();if(!h||!r.CSS.supports(u.property,h)){s.push(`${u.token}: its current value is invalid for the fixture's ${u.property} binding.`);continue}let f=c.filter(_=>_.dataset.adsToken===u.token&&_.dataset.adsProperty===u.property);if(!f.length){s.push(`${u.token} needs a rendered ${u.property} sample, not only a name/value label.`);continue}let y=!1;for(let _ of f){let v=[];for(let O=_.parentElement;O&&O!==e;O=O.parentElement)O.tagName==="DETAILS"&&!O.open&&(O.open=!0,v.push(O));let k=n.getAttribute("style"),T=_.getAttribute("style");try{/^(?:-[a-z]+-)?transition(?:-|$)/.test(u.property)||_.style.setProperty("transition","none","important");let O=r.getComputedStyle(_).getPropertyValue(u.property),j=N_(_,r);n.style.setProperty(u.token,u.probe,"important");let A=r.getComputedStyle(_).getPropertyValue(u.property);y=!!(A&&A!==O&&(j||N_(_,r)))}finally{k===null?n.removeAttribute("style"):n.setAttribute("style",k),T===null?_.removeAttribute("style"):_.setAttribute("style",T);for(let O of v)O.open=!1}if(y)break}y?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}}function A_({container:e=document.getElementById("root"),bindings:t=[],auditResources:o=!1}={}){let r=[],n=[],s=[];if(!e||!Array.isArray(t)||t.length>100)return{ok:!1,diagnostics:["Invalid bounded paint-audit descriptor."],verified:n};let i=e.ownerDocument,c=i.defaultView,l=["color","fill","stroke","stop-color","background-color","border-top-color","border-right-color","border-bottom-color","border-left-color"];function u(f,y,_,v=new Set){if(f=f.trim(),["none","currentColor"].includes(f))return!0;let k=/^var\(\s*(--[\w-]+)\s*\)$/.exec(f);if(k){let j=k[1];if(!_.tokens.includes(j)||v.has(j))return!1;let A=c.getComputedStyle(y).getPropertyValue(j).trim();return!!A&&c.CSS.supports("color",A)}let T=/^light-dark\(\s*(var\(\s*--[\w-]+\s*\)|currentColor)\s*,\s*(var\(\s*--[\w-]+\s*\)|currentColor)\s*\)$/.exec(f);if(T)return c.CSS.supports("color",f)&&u(T[1],y,_,v)&&u(T[2],y,_,v);let O=/^url\(\s*(["']?)#([^\s"'()#\\\p{Cc}]+)\1\s*\)$/u.exec(f);if(O&&c.CSS.supports("fill",f)){let j=[...i.querySelectorAll("[id]")].filter(A=>A.id===O[2]);return j.length===1&&["linearGradient","radialGradient","pattern"].includes(j[0].localName)&&y.contains(j[0])}return!1}for(let f of t){if(!f||typeof f.scope!="string"||!Array.isArray(f.tokens)||typeof f.prefix!="string"||typeof f.suffix!="string"){r.push("Invalid paint binding metadata; rebuild previews.");continue}let y;try{y=[...e.querySelectorAll(f.scope)]}catch{r.push(`${f.owner}: invalid binding scope.`);continue}y.length>20&&s.push(`${f.owner}: only the first 20 instances were audited; use a focused scenario for complete evidence.`);for(let _ of y.slice(0,20)){let v=[_,..._.querySelectorAll("*")];if(v.length>1e3){s.push(`${f.owner}: instance exceeds 1000 elements; paint effects are not established.`);continue}let k=[..._.style].filter(T=>T.startsWith(f.prefix)&&T.endsWith(f.suffix));k.length>100&&s.push(`${f.owner}: only the first 100 binding keys were audited.`);for(let T of k.slice(0,100)){let O=_.style.getPropertyValue(T).trim(),j=T.slice(f.prefix.length,f.suffix?-f.suffix.length:void 0);if(!/^[A-Za-z0-9_-]+$/.test(j)||!u(O,_,f)){r.push(`${f.owner}: invalid or inaccessible paint ${T}: ${O}. Use an accessible token, instance-local SVG paint server, none or currentColor.`);continue}let A=_.getAttribute("style"),Z=v.map(V=>V.getAttribute("style"));try{for(let G of v)G.style.setProperty("transition","none","important");let V=v.map(G=>l.map(pe=>c.getComputedStyle(G).getPropertyValue(pe)));_.style.setProperty(T,"rgb(17, 103, 211)","important");let D=v.some((G,pe)=>l.some((te,ke)=>c.getComputedStyle(G).getPropertyValue(te)!==V[pe][ke]));D||(_.style.setProperty(T,"rgb(211, 67, 23)","important"),D=v.some((G,pe)=>l.some((te,ke)=>c.getComputedStyle(G).getPropertyValue(te)!==V[pe][ke]))),D?n.push({owner:f.owner,binding:f.name,variable:T}):s.push(`${f.owner}: ${T} has no observed paint effect in its current instance. A written variable alone is not rendering evidence; check the relevant selected/visible consumer.`)}finally{v.forEach((V,D)=>{Z[D]===null?V.removeAttribute("style"):V.setAttribute("style",Z[D])}),A===null?_.removeAttribute("style"):_.setAttribute("style",A)}}for(let T of v)for(let O of["fill","stroke","stop-color"]){let j=T.getAttribute(O);if(!j)continue;let A=/^var\(\s*(--[\w-]+)\s*\)$/.exec(j);A&&A[1].startsWith(f.prefix)&&A[1].endsWith(f.suffix)&&!k.includes(A[1])&&r.push(`${f.owner}: ${A[1]} is consumed without a value in this instance.`),j.startsWith("url(")&&!u(j,_,f)&&r.push(`${f.owner}: missing, duplicated or out-of-instance local paint resource ${j}.`)}}}let h=o?[...e.querySelectorAll("[fill], [stroke], [style]")]:[];h.length>1e3&&s.push("Only the first 1000 potential SVG paint consumers were audited.");for(let f of h.slice(0,1e3))for(let y of["fill","stroke"]){let _=f.getAttribute(y)??f.style.getPropertyValue(y);if(!_?.startsWith("url("))continue;let v=/^url\(\s*(["']?)#([^\s"'()#\\\p{Cc}]+)\1\s*\)$/u.exec(_)?.[2],k=v?[...i.querySelectorAll("[id]")].filter(O=>O.id===v):[],T=f.ownerSVGElement??(f.localName==="svg"?f:null);(k.length!==1||!T?.contains(k[0])||!["linearGradient","radialGradient","pattern"].includes(k[0]?.localName))&&r.push(`Invalid, missing, duplicated or nonlocal SVG paint resource ${_}. Keep IDs isolated per rendered instance.`)}return{ok:!r.length,complete:!s.length,verified:n,diagnostics:r.slice(0,40),limits:s.slice(0,20),scope:"observed App instances and current input; repeat after updates"}}var Ie=new Yl({name:"ADS resource preview",version:"1.0.0"},{},{autoResize:!0}),wo=document.getElementById("root"),wf=document.getElementById("ads-preview-status"),kf=async e=>{if(!Ie.getHostCapabilities()?.serverResources)throw new Error("This host does not forward MCP resource reads. Open the same preview in the ADS showcase.");try{return await Ie.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}},_a=new Ql(kf),ut,xo,Pf,Ef,Rf=!1,Ro=0,fa={},Ce="",ga=!1,xf,q_;function j_(e){if(Ie.getHostVersion()?.name!=="ADS showcase")return;let t=q_;q_=e;let o=I_(t,e).filter(r=>r!==ut);o.length&&_a.prefetch(e,o).then(r=>Po("prefetched",{revision:e.revision,...r})).catch(r=>console.warn("ADS preview prefetch",r.message))}function dt(e,t=!1){wf.textContent=e,wf.hidden=!e||Ie.getHostVersion()?.name==="ADS showcase",wf.setAttribute("role",t?"alert":"status")}async function Po(e,t={}){try{Ie.getHostCapabilities()?.logging&&await Ie.sendLog({level:e==="error"?"error":"info",logger:"ads-preview",data:{state:e,id:ut,...t}})}catch{}}function L_(e){fa={...fa,...e,styles:{...fa.styles,...e.styles}},["light","dark"].includes(fa.theme)&&(document.documentElement.dataset.theme=fa.theme)}async function Tf(e="ads://preview/manifest"){let t;try{t=await kf(e)}catch(o){throw Object.assign(new Error(o.message,{cause:o}),{code:"ADS_MANIFEST_READ",category:"transport"})}return JSON.parse(t.contents.find(o=>typeof o.text=="string").text)}async function Sa(e,t,o=!1,r="",n=!1){let s=o||n;if(!r&&e===ut&&t&&t===xo&&s===ga){dt(Ce||(s?"Checking changes\u2026":""),!!Ce),await Po(Ce?"error":s?"checking":"ready",Ce?{message:Ce}:{revision:xo});return}let i=++Ro;++_a.generation,ut=e,document.documentElement.dataset.adsScenario=e,document.documentElement.dataset.adsPreviewState="loading";for(let c of["adsPreviewErrorCategory","adsPreviewErrorCode","adsPreviewResourceUri"])delete document.documentElement.dataset[c];Ce="",dt(""),await Po(r?"reverting":"loading");try{let c=await Tf(o?"ads://preview/live":"ads://preview/manifest");if(t&&c.revision!==t)throw new Error("Preview changed while opening. Select it again to use the current build.");if(i!==Ro||!await _a.mount(c,e,wo)||i!==Ro||(xo=c.revision,Pf=c.session,ga=s,await new Promise(h=>requestAnimationFrame(()=>requestAnimationFrame(h))),await document.fonts.ready,i!==Ro))return;let u=c.scenarios.find(h=>h.id===e);if(wo.dataset.adsPaintBindings=JSON.stringify(u?.paintBindings??[]),wo.dataset.adsPaintAudit=String(!!u?.paintAudit),wo.dataset.adsPaintAuditComplete="not-requested",u?.paintBindings?.length||u?.paintAudit){let h=A_({container:wo,bindings:u.paintBindings??[],auditResources:!!u.paintAudit});if(!h.ok)throw Object.assign(new Error(`Paint binding verification failed:
|
|
104
|
+
${h.diagnostics.join(`
|
|
105
|
+
`)}`),{code:"ADS_PAINT_BINDING",category:"assertion"});wo.dataset.adsPaintAuditComplete=String(h.complete),h.complete||await Po("audit-limited",{limits:h.limits})}if(u?.kind==="tokens"){let h=M_(wo,u.samples);if(!h.ok)throw Ce=`Token preview verification failed:
|
|
106
|
+
${h.diagnostics.slice(0,20).join(`
|
|
107
|
+
`)}`,Object.assign(new Error(Ce),{code:"ADS_TOKEN_SAMPLE",category:"assertion"})}i===Ro&&(document.documentElement.dataset.adsPreviewRevision=xo,document.documentElement.dataset.adsPreviewState=r?"error":s?"checking":"ready",dt(r||(s?"Checking changes\u2026":""),!!r),await Po(r?"error":s?"checking":"ready",{revision:xo,...r?{message:r}:{}}),!s&&!r&&j_(c))}catch(c){i===Ro&&(document.documentElement.dataset.adsPreviewState="error",document.documentElement.dataset.adsPreviewErrorCategory=c.category??"runner",document.documentElement.dataset.adsPreviewErrorCode=c.code??"ADS_PREVIEW_STARTUP",c.resourceUri&&(document.documentElement.dataset.adsPreviewResourceUri=c.resourceUri),dt(c.message,!0),await Po("error",{message:c.message,...c.code?{code:c.code}:{}}))}}async function ow(){if(!(!ut||Rf||document.visibilityState==="hidden")){Rf=!0;try{let e=JSON.parse((await kf("ads://project/build")).contents.find(o=>typeof o.text=="string").text);xf=void 0;let t=e.previews.find(o=>o.id===ut);if(t?.live&&!t.current)t.live.revision!==xo||e.session!==Pf||!ga?await Sa(ut,t.live.revision,!0):dt(Ce||"Checking changes\u2026",!!Ce);else if(!t||!t.current){let o=t?.diagnostics?.[0]?.message;if(o&&ga){let r=await Tf();await Sa(ut,r.revision,!1,`Build failed. Showing the previous preview.
|
|
108
|
+
${o}`)}dt(o?`Build failed. Showing the previous preview.
|
|
109
|
+
${o}`:"Rebuilding. This is the previous preview.",!!o)}else{let o=await Tf();o.revision!==xo||o.session!==Pf||ga?await Sa(ut,o.revision):(dt(Ce,!!Ce),j_(o))}}catch(e){let t=`Preview freshness unavailable: ${e.message}`;dt(t,!0),xf!==t&&(xf=t,await Po("error",{message:t}))}finally{Rf=!1}}}Ie.ontoolresult=e=>{let t=e.structuredContent;t?.scenario?.id&&Sa(t.scenario.id,t.manifestRevision,t.manifestUri==="ads://preview/live","",t.build?.current===!1)};Ie.onhostcontextchanged=L_;Ie.onteardown=async()=>(++Ro,clearInterval(Ef),await _a.dispose(),{});try{if(await Ie.connect(),L_(Ie.getHostContext()??{}),!Ie.getHostCapabilities()?.serverResources)throw new Error("This host does not forward MCP resource reads. Open the same preview in the ADS showcase.");Ef=setInterval(()=>{ow()},150);let e=document.getElementById("ads-preview-selection");e&&Sa(JSON.parse(e.textContent).id)}catch(e){dt(e.message,!0)}window.addEventListener("pagehide",()=>{clearInterval(Ef),_a.dispose()},{once:!0});
|
|
109
110
|
/*! Bundled license information:
|
|
110
111
|
|
|
111
112
|
@modelcontextprotocol/client/dist/src-WCy6ifGf.mjs:
|