runpane 2.4.130 → 2.4.131

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +13 -0
  2. package/dist/agentTasks.d.ts +8 -0
  3. package/dist/agentTasks.d.ts.map +1 -0
  4. package/dist/agentTasks.js +123 -0
  5. package/dist/agentTasks.js.map +1 -0
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +30 -0
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands.d.ts +7 -0
  10. package/dist/commands.d.ts.map +1 -1
  11. package/dist/commands.js +73 -10
  12. package/dist/commands.js.map +1 -1
  13. package/dist/daemonActions.d.ts +16 -0
  14. package/dist/daemonActions.d.ts.map +1 -0
  15. package/dist/daemonActions.js +98 -0
  16. package/dist/daemonActions.js.map +1 -0
  17. package/dist/docs-index.json +1 -0
  18. package/dist/docs.d.ts +18 -0
  19. package/dist/docs.d.ts.map +1 -0
  20. package/dist/docs.js +123 -0
  21. package/dist/docs.js.map +1 -0
  22. package/dist/generated/contract.d.ts +1337 -12
  23. package/dist/generated/contract.d.ts.map +1 -1
  24. package/dist/generated/contract.js +3763 -1121
  25. package/dist/generated/contract.js.map +1 -1
  26. package/dist/links.d.ts +13 -0
  27. package/dist/links.d.ts.map +1 -0
  28. package/dist/links.js +57 -0
  29. package/dist/links.js.map +1 -0
  30. package/dist/localControl.d.ts +220 -1
  31. package/dist/localControl.d.ts.map +1 -1
  32. package/dist/localControl.js +34 -16
  33. package/dist/localControl.js.map +1 -1
  34. package/dist/mcp.d.ts +12 -0
  35. package/dist/mcp.d.ts.map +1 -0
  36. package/dist/mcp.js +189 -0
  37. package/dist/mcp.js.map +1 -0
  38. package/dist/mcpSdk.d.ts +3 -0
  39. package/dist/mcpSdk.d.ts.map +1 -0
  40. package/dist/mcpSdk.js +74 -0
  41. package/dist/mcpSdk.js.LEGAL.txt +8 -0
  42. package/dist/mcpTools.d.ts +78 -0
  43. package/dist/mcpTools.d.ts.map +1 -0
  44. package/dist/mcpTools.js +195 -0
  45. package/dist/mcpTools.js.map +1 -0
  46. package/package.json +5 -2
package/dist/mcpSdk.js ADDED
@@ -0,0 +1,74 @@
1
+ "use strict";var rg=Object.create;var Fn=Object.defineProperty;var og=Object.getOwnPropertyDescriptor;var ng=Object.getOwnPropertyNames;var sg=Object.getPrototypeOf,ag=Object.prototype.hasOwnProperty;var Hn=(e,t)=>{for(var r in t)Fn(e,r,{get:t[r],enumerable:!0})},ml=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ng(t))!ag.call(e,n)&&n!==r&&Fn(e,n,{get:()=>t[n],enumerable:!(o=og(t,n))||o.enumerable});return e};var ig=(e,t,r)=>(r=e!=null?rg(sg(e)):{},ml(t||!e||!e.__esModule?Fn(r,"default",{value:e,enumerable:!0}):r,e)),cg=e=>ml(Fn({},"__esModule",{value:!0}),e);var lb={};Hn(lb,{ProtocolError:()=>ee,ProtocolErrorCode:()=>H,Server:()=>Ti,serveStdio:()=>eg});module.exports=cg(lb);var ug=Object.create,Jn=Object.defineProperty,lg=Object.getOwnPropertyDescriptor,dg=Object.getOwnPropertyNames,pg=Object.getPrototypeOf,mg=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hl=(e,t)=>{let r={};for(var o in e)Jn(r,o,{get:e[o],enumerable:!0});return t&&Jn(r,Symbol.toStringTag,{value:"Module"}),r},hg=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=dg(t),s=0,a=n.length,i;s<a;s++)i=n[s],!mg.call(e,i)&&i!==r&&Jn(e,i,{get:(c=>t[c]).bind(null,i),enumerable:!(o=lg(t,i))||o.enumerable});return e},Bn=(e,t,r)=>(r=e!=null?ug(pg(e)):{},hg(t||!e||!e.__esModule?Jn(r,"default",{value:e,enumerable:!0}):r,e));var fg=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),fl=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),gg=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),_g=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function gl(e){return typeof e=="string"&&fl.has(e.replace(/#$/,""))}function _l(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(fg.has(r))return"2020-12";if(fl.has(r))return"2019-09";if(gg.has(r)||_g.has(r))return"draft-7";throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var Sl,Ci=Object.freeze({status:"aborted"});function M(e,t,r){function o(i,c){if(i._zod||Object.defineProperty(i,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),i._zod.traits.has(e))return;i._zod.traits.add(e),t(i,c);let u=a.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){let _=d[p];_ in i||(i[_]=u[_].bind(i))}}let n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function a(i){var c;let u=r?.Parent?new s:this;o(u,i),(c=u._zod).deferred??(c.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:i=>r?.Parent&&i instanceof r.Parent?!0:i?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var Sg=Symbol("zod_brand"),ut=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},wr=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Sl=globalThis).__zod_globalConfig??(Sl.__zod_globalConfig={});var Er=globalThis.__zod_globalConfig;function Ke(e){return e&&Object.assign(Er,e),Er}var _e={};Hn(_e,{BIGINT_FORMAT_RANGES:()=>zl,Class:()=>Oi,NUMBER_FORMAT_RANGES:()=>Mi,aborted:()=>It,allowsEval:()=>qi,assert:()=>Rg,assertEqual:()=>vg,assertIs:()=>bg,assertNever:()=>zg,assertNotEqual:()=>yg,assignProp:()=>kt,base64ToUint8Array:()=>$l,base64urlToUint8Array:()=>Dg,cached:()=>Tr,captureStackTrace:()=>Wn,cleanEnum:()=>Lg,cleanRegex:()=>Io,clone:()=>et,cloneDef:()=>wg,createTransparentProxy:()=>Ig,defineLazy:()=>ge,esc:()=>Gn,escapeRegex:()=>ft,explicitlyAborted:()=>Li,extend:()=>jg,finalizeIssue:()=>tt,floatSafeRemainder:()=>Ni,getElementAtPath:()=>Eg,getEnumValues:()=>ko,getLengthableOrigin:()=>Oo,getParsedType:()=>Cg,getSizableOrigin:()=>Rl,hexToUint8Array:()=>Ug,isObject:()=>or,isPlainObject:()=>Ct,issue:()=>kr,joinValues:()=>Kn,jsonStringifyReplacer:()=>Pr,merge:()=>xg,mergeDefs:()=>ht,normalizeParams:()=>re,nullish:()=>Co,numKeys:()=>kg,objectClone:()=>$g,omit:()=>Ng,optionalKeys:()=>Ai,parsedType:()=>Di,partial:()=>Ag,pick:()=>Og,prefixIssues:()=>gt,primitiveTypes:()=>bl,promiseAllObject:()=>Pg,propertyKeyTypes:()=>xi,randomString:()=>Tg,required:()=>Mg,safeExtend:()=>qg,shallowClone:()=>yl,slugify:()=>ji,stringifyPrimitive:()=>Yn,uint8ArrayToBase64:()=>wl,uint8ArrayToBase64url:()=>Zg,uint8ArrayToHex:()=>Vg,unwrapMessage:()=>To});function vg(e){return e}function yg(e){return e}function bg(e){}function zg(e){throw new Error("Unexpected value in exhaustive check")}function Rg(e){}function ko(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function Kn(e,t="|"){return e.map(r=>Yn(r)).join(t)}function Pr(e,t){return typeof t=="bigint"?t.toString():t}function Tr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Co(e){return e==null}function Io(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ni(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var vl=Symbol("evaluating");function ge(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==vl)return o===void 0&&(o=vl,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function $g(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function kt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ht(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function wg(e){return ht(e._zod.def)}function Eg(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function Pg(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=o[s];return n})}function Tg(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function Gn(e){return JSON.stringify(e)}function ji(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Wn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function or(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var qi=Tr(()=>{if(Er.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ct(e){if(or(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(or(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function yl(e){return Ct(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function kg(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var Cg=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}`)}},xi=new Set(["string","number","symbol"]),bl=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ft(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function et(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function re(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 Ig(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,s){return t??(t=e()),Reflect.set(t,o,n,s)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function Yn(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Ai(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Mi={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]},zl={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Og(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=ht(e._zod.def,{get shape(){let a={};for(let i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(a[i]=r.shape[i])}return kt(this,"shape",a),a},checks:[]});return et(e,s)}function Ng(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=ht(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete a[i]}return kt(this,"shape",a),a},checks:[]});return et(e,s)}function jg(e,t){if(!Ct(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let s=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=ht(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return kt(this,"shape",s),s}});return et(e,n)}function qg(e,t){if(!Ct(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=ht(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return kt(this,"shape",o),o}});return et(e,r)}function xg(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=ht(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return kt(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return et(e,r)}function Ag(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=ht(t._zod.def,{get shape(){let i=t._zod.def.shape,c={...i};if(r)for(let u in r){if(!(u in i))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:i[u]}):i[u])}else for(let u in i)c[u]=e?new e({type:"optional",innerType:i[u]}):i[u];return kt(this,"shape",c),c},checks:[]});return et(t,a)}function Mg(e,t,r){let o=ht(t._zod.def,{get shape(){let n=t._zod.def.shape,s={...n};if(r)for(let a in r){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(s[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)s[a]=new e({type:"nonoptional",innerType:n[a]});return kt(this,"shape",s),s}});return et(t,o)}function It(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Li(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function gt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function To(e){return typeof e=="string"?e:e?.message}function tt(e,t,r){let o=e.message?e.message:To(e.inst?._zod.def?.error?.(e))??To(t?.error?.(e))??To(r.customError?.(e))??To(r.localeError?.(e))??"Invalid input",{inst:n,continue:s,input:a,...i}=e;return i.path??(i.path=[]),i.message=o,t?.reportInput&&(i.input=a),i}function Rl(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Oo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Di(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function kr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function Lg(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function $l(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function wl(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Dg(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return $l(t+r)}function Zg(e){return wl(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ug(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function Vg(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Oi=class{constructor(...t){}};var El=(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,Pr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xn=M("$ZodError",El),Zi=M("$ZodError",El,{Parent:Error});function Ui(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Vi(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(i=>o({issues:i},[...s,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...s,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...s,...a.path]);else{let i=[...s,...a.path];if(i.length===0)r._errors.push(t(a));else{let c=r,u=0;for(;u<i.length;){let d=i[u];u===i.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(t(a))):c[d]=c[d]||{_errors:[]},c=c[d],u++}}}};return o(e),r}var Qn=e=>(t,r,o,n)=>{let s=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new ut;if(a.issues.length){let i=new(n?.Err??e)(a.issues.map(c=>tt(c,s,Ke())));throw Wn(i,n?.callee),i}return a.value};var es=e=>async(t,r,o,n)=>{let s=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let i=new(n?.Err??e)(a.issues.map(c=>tt(c,s,Ke())));throw Wn(i,n?.callee),i}return a.value};var No=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new ut;return s.issues.length?{success:!1,error:new(e??Xn)(s.issues.map(a=>tt(a,n,Ke())))}:{success:!0,data:s.value}},Pl=No(Zi),jo=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>tt(a,n,Ke())))}:{success:!0,data:s.value}},Tl=jo(Zi),kl=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Qn(e)(t,r,n)};var Cl=e=>(t,r,o)=>Qn(e)(t,r,o);var Il=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return es(e)(t,r,n)};var Ol=e=>async(t,r,o)=>es(e)(t,r,o);var Nl=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return No(e)(t,r,n)};var jl=e=>(t,r,o)=>No(e)(t,r,o);var ql=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return jo(e)(t,r,n)};var xl=e=>async(t,r,o)=>jo(e)(t,r,o);var Al=/^[cC][0-9a-z]{6,}$/,Ml=/^[0-9a-z]+$/,Ll=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Dl=/^[0-9a-vA-V]{20}$/,Zl=/^[A-Za-z0-9]{27}$/,Ul=/^[a-zA-Z0-9_-]{21}$/,Vl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Fl=/^([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})$/,Fi=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)$/;var Hl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Hg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Jl(){return new RegExp(Hg,"u")}var Bl=/^(?:(?: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])$/,Kl=/^(([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}|:))$/;var Gl=/^((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])$/,Wl=/^(([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])$/,Yl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Hi=/^[A-Za-z0-9_-]*$/;var Xl=/^https?$/,Ql=/^\+[1-9]\d{6,14}$/,ed="(?:(?:\\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])))",td=new RegExp(`^${ed}$`);function rd(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 od(e){return new RegExp(`^${rd(e)}$`)}function nd(e){let t=rd({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${ed}T(?:${o})$`)}var sd=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ad=/^-?\d+n?$/,id=/^-?\d+$/,Ji=/^-?\d+(?:\.\d+)?$/,cd=/^(?:true|false)$/i,ud=/^null$/i;var ld=/^[^A-Z]*$/,dd=/^[^a-z]*$/;var Me=M("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),pd={number:"number",bigint:"bigint",object:"date"},Bi=M("$ZodCheckLessThan",(e,t)=>{Me.init(e,t);let r=pd[typeof t.value];e._zod.onattach.push(o=>{let n=o._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=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ki=M("$ZodCheckGreaterThan",(e,t)=>{Me.init(e,t);let r=pd[typeof t.value];e._zod.onattach.push(o=>{let n=o._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=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),md=M("$ZodCheckMultipleOf",(e,t)=>{Me.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Ni(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),hd=M("$ZodCheckNumberFormat",(e,t)=>{Me.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Mi[t.format];e._zod.onattach.push(a=>{let i=a._zod.bag;i.format=t.format,i.minimum=n,i.maximum=s,r&&(i.pattern=id)}),e._zod.check=a=>{let i=a.value;if(r){if(!Number.isInteger(i)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:i,inst:e});return}if(!Number.isSafeInteger(i)){i>0?a.issues.push({input:i,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:i,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}i<n&&a.issues.push({origin:"number",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>s&&a.issues.push({origin:"number",input:i,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var fd=M("$ZodCheckMaxLength",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Co(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=Oo(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),gd=M("$ZodCheckMinLength",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Co(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=Oo(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),_d=M("$ZodCheckLengthEquals",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Co(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,s=n.length;if(s===t.length)return;let a=Oo(n),i=s>t.length;o.issues.push({origin:a,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),xo=M("$ZodCheckStringFormat",(e,t)=>{var r,o;Me.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?(r=e._zod).check??(r.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})}):(o=e._zod).check??(o.check=()=>{})}),Sd=M("$ZodCheckRegex",(e,t)=>{xo.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),vd=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ld),xo.init(e,t)}),yd=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=dd),xo.init(e,t)}),bd=M("$ZodCheckIncludes",(e,t)=>{Me.init(e,t);let r=ft(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),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})}}),zd=M("$ZodCheckStartsWith",(e,t)=>{Me.init(e,t);let r=new RegExp(`^${ft(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Rd=M("$ZodCheckEndsWith",(e,t)=>{Me.init(e,t);let r=new RegExp(`.*${ft(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var $d=M("$ZodCheckOverwrite",(e,t)=>{Me.init(e,t),e._zod.check=r=>{r.value=t.tx(r.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 o=t.split(`
2
+ `).filter(a=>a),n=Math.min(...o.map(a=>a.length-a.trimStart().length)),s=o.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of s)this.content.push(a)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...r,n.join(`
3
+ `))}};var Ed={major:4,minor:4,patch:3};var Se=M("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ed;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let s of n._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,i,c)=>{let u=It(a),d;for(let p of i){if(p._zod.def.when){if(Li(a)||!p._zod.def.when(a))continue}else if(u)continue;let _=a.issues.length,$=p._zod.check(a);if($ instanceof Promise&&c?.async===!1)throw new ut;if(d||$ instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await $,a.issues.length!==_&&(u||(u=It(a,_)))});else{if(a.issues.length===_)continue;u||(u=It(a,_))}}return d?d.then(()=>a):a},s=(a,i,c)=>{if(It(a))return a.aborted=!0,a;let u=n(i,o,c);if(u instanceof Promise){if(c.async===!1)throw new ut;return u.then(d=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(a,i)=>{if(i.skipChecks)return e._zod.parse(a,i);if(i.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...i,skipChecks:!0});return u instanceof Promise?u.then(d=>s(d,a,i)):s(u,a,i)}let c=e._zod.parse(a,i);if(c instanceof Promise){if(i.async===!1)throw new ut;return c.then(u=>n(u,o,i))}return n(c,o,i)}}ge(e,"~standard",()=>({validate:n=>{try{let s=Pl(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Tl(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),ns=M("$ZodString",(e,t)=>{Se.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??sd(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Re=M("$ZodStringFormat",(e,t)=>{xo.init(e,t),ns.init(e,t)}),qd=M("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Fl),Re.init(e,t)}),xd=M("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Fi(o))}else t.pattern??(t.pattern=Fi());Re.init(e,t)}),Ad=M("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Hl),Re.init(e,t)}),Md=M("$ZodURL",(e,t)=>{Re.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===Xl.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Ld=M("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Jl()),Re.init(e,t)}),Dd=M("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ul),Re.init(e,t)}),Zd=M("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Al),Re.init(e,t)}),Ud=M("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ml),Re.init(e,t)}),Vd=M("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ll),Re.init(e,t)}),Fd=M("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Dl),Re.init(e,t)}),Hd=M("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Zl),Re.init(e,t)}),Jd=M("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=nd(t)),Re.init(e,t)}),Bd=M("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=td),Re.init(e,t)}),Kd=M("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=od(t)),Re.init(e,t)}),Gd=M("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Vl),Re.init(e,t)}),Wd=M("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Bl),Re.init(e,t),e._zod.bag.format="ipv4"}),Yd=M("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Kl),Re.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}});var Xd=M("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Gl),Re.init(e,t)}),Qd=M("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Wl),Re.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,s]=o;if(!s)throw new Error;let a=Number(s);if(`${a}`!==s)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function ep(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var tp=M("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Yl),Re.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{ep(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Jg(e){if(!Hi.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return ep(r)}var rp=M("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Hi),Re.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Jg(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),op=M("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ql),Re.init(e,t)});function Bg(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var np=M("$ZodJWT",(e,t)=>{Re.init(e,t),e._zod.check=r=>{Bg(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Wi=M("$ZodNumber",(e,t)=>{Se.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ji,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),sp=M("$ZodNumberFormat",(e,t)=>{hd.init(e,t),Wi.init(e,t)}),ap=M("$ZodBoolean",(e,t)=>{Se.init(e,t),e._zod.pattern=cd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),ip=M("$ZodBigInt",(e,t)=>{Se.init(e,t),e._zod.pattern=ad,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var cp=M("$ZodNull",(e,t)=>{Se.init(e,t),e._zod.pattern=ud,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),up=M("$ZodAny",(e,t)=>{Se.init(e,t),e._zod.parse=r=>r}),lp=M("$ZodUnknown",(e,t)=>{Se.init(e,t),e._zod.parse=r=>r}),dp=M("$ZodNever",(e,t)=>{Se.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});var pp=M("$ZodDate",(e,t)=>{Se.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Pd(e,t,r){e.issues.length&&t.issues.push(...gt(r,e.issues)),t.value[r]=e.value}var mp=M("$ZodArray",(e,t)=>{Se.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let s=[];for(let a=0;a<n.length;a++){let i=n[a],c=t.element._zod.run({value:i,issues:[]},o);c instanceof Promise?s.push(c.then(u=>Pd(u,r,a))):Pd(c,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function os(e,t,r,o,n,s){let a=r in o;if(e.issues.length){if(n&&s&&!a)return;t.issues.push(...gt(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function hp(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=Ai(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function fp(e,t,r,o,n,s){let a=[],i=n.keySet,c=n.catchall._zod,u=c.def.type,d=c.optin==="optional",p=c.optout==="optional";for(let _ in t){if(_==="__proto__"||i.has(_))continue;if(u==="never"){a.push(_);continue}let $=c.run({value:t[_],issues:[]},o);$ instanceof Promise?e.push($.then(S=>os(S,r,_,t,d,p))):os($,r,_,t,d,p)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}var Kg=M("$ZodObject",(e,t)=>{if(Se.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let i=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...i};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=Tr(()=>hp(t));ge(e._zod,"propValues",()=>{let i=t.shape,c={};for(let u in i){let d=i[u]._zod;if(d.values){c[u]??(c[u]=new Set);for(let p of d.values)c[u].add(p)}}return c});let n=or,s=t.catchall,a;e._zod.parse=(i,c)=>{a??(a=o.value);let u=i.value;if(!n(u))return i.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),i;i.value={};let d=[],p=a.shape;for(let _ of a.keys){let $=p[_],S=$._zod.optin==="optional",b=$._zod.optout==="optional",f=$._zod.run({value:u[_],issues:[]},c);f instanceof Promise?d.push(f.then(m=>os(m,i,_,u,S,b))):os(f,i,_,u,S,b)}return s?fp(d,u,i,c,o.value,e):d.length?Promise.all(d).then(()=>i):i}}),gp=M("$ZodObjectJIT",(e,t)=>{Kg.init(e,t);let r=e._zod.parse,o=Tr(()=>hp(t)),n=_=>{let $=new ts(["shape","payload","ctx"]),S=o.value,b=h=>{let v=Gn(h);return`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`};$.write("const input = payload.value;");let f=Object.create(null),m=0;for(let h of S.keys)f[h]=`key_${m++}`;$.write("const newResult = {};");for(let h of S.keys){let v=f[h],E=Gn(h),y=_[h],g=y?._zod?.optin==="optional",R=y?._zod?.optout==="optional";$.write(`const ${v} = ${b(h)};`),g&&R?$.write(`
4
+ if (${v}.issues.length) {
5
+ if (${E} in input) {
6
+ payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
7
+ ...iss,
8
+ path: iss.path ? [${E}, ...iss.path] : [${E}]
9
+ })));
10
+ }
11
+ }
12
+
13
+ if (${v}.value === undefined) {
14
+ if (${E} in input) {
15
+ newResult[${E}] = undefined;
16
+ }
17
+ } else {
18
+ newResult[${E}] = ${v}.value;
19
+ }
20
+
21
+ `):g?$.write(`
22
+ if (${v}.issues.length) {
23
+ payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
24
+ ...iss,
25
+ path: iss.path ? [${E}, ...iss.path] : [${E}]
26
+ })));
27
+ }
28
+
29
+ if (${v}.value === undefined) {
30
+ if (${E} in input) {
31
+ newResult[${E}] = undefined;
32
+ }
33
+ } else {
34
+ newResult[${E}] = ${v}.value;
35
+ }
36
+
37
+ `):$.write(`
38
+ const ${v}_present = ${E} in input;
39
+ if (${v}.issues.length) {
40
+ payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
41
+ ...iss,
42
+ path: iss.path ? [${E}, ...iss.path] : [${E}]
43
+ })));
44
+ }
45
+ if (!${v}_present && !${v}.issues.length) {
46
+ payload.issues.push({
47
+ code: "invalid_type",
48
+ expected: "nonoptional",
49
+ input: undefined,
50
+ path: [${E}]
51
+ });
52
+ }
53
+
54
+ if (${v}_present) {
55
+ if (${v}.value === undefined) {
56
+ newResult[${E}] = undefined;
57
+ } else {
58
+ newResult[${E}] = ${v}.value;
59
+ }
60
+ }
61
+
62
+ `)}$.write("payload.value = newResult;"),$.write("return payload;");let z=$.compile();return(h,v)=>z(_,h,v)},s,a=or,i=!Er.jitless,u=i&&qi.value,d=t.catchall,p;e._zod.parse=(_,$)=>{p??(p=o.value);let S=_.value;return a(S)?i&&u&&$?.async===!1&&$.jitless!==!0?(s||(s=n(t.shape)),_=s(_,$),d?fp([],S,_,$,p,e):_):r(_,$):(_.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),_)}});function Td(e,t,r,o){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let n=e.filter(s=>!It(s));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(a=>tt(a,o,Ke())))}),t)}var Yi=M("$ZodUnion",(e,t)=>{Se.init(e,t),ge(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ge(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ge(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ge(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>Io(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let s=!1,a=[];for(let i of t.options){let c=i._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)a.push(c),s=!0;else{if(c.issues.length===0)return c;a.push(c)}}return s?Promise.all(a).then(i=>Td(i,o,e,n)):Td(a,o,e,n)}});var _p=M("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Yi.init(e,t);let r=e._zod.parse;ge(e._zod,"propValues",()=>{let n={};for(let s of t.options){let a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[i,c]of Object.entries(a)){n[i]||(n[i]=new Set);for(let u of c)n[i].add(u)}}return n});let o=Tr(()=>{let n=t.options,s=new Map;for(let a of n){let i=a._zod.propValues?.[t.discriminator];if(!i||i.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let c of i){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,a)}}return s});e._zod.parse=(n,s)=>{let a=n.value;if(!or(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let i=o.value.get(a?.[t.discriminator]);return i?i._zod.run(n,s):t.unionFallback||s.direction==="backward"?r(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n)}}),Sp=M("$ZodIntersection",(e,t)=>{Se.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,s=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([c,u])=>kd(r,c,u)):kd(r,s,a)}});function Gi(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(Ct(e)&&Ct(t)){let r=Object.keys(t),o=Object.keys(e).filter(s=>r.indexOf(s)!==-1),n={...e,...t};for(let s of o){let a=Gi(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};n[s]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],s=t[o],a=Gi(n,s);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function kd(e,t,r){let o=new Map,n;for(let i of t.issues)if(i.code==="unrecognized_keys"){n??(n=i);for(let c of i.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else e.issues.push(i);for(let i of r.issues)if(i.code==="unrecognized_keys")for(let c of i.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else e.issues.push(i);let s=[...o].filter(([,i])=>i.l&&i.r).map(([i])=>i);if(s.length&&n&&e.issues.push({...n,keys:s}),It(e))return e;let a=Gi(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var vp=M("$ZodRecord",(e,t)=>{Se.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Ct(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let s=[],a=t.keyType._zod.values;if(a){r.value={};let i=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){i.add(typeof u=="number"?u.toString():u);let d=t.keyType._zod.run({value:u,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map($=>tt($,o,Ke())),input:u,path:[u],inst:e});continue}let p=d.value,_=t.valueType._zod.run({value:n[u],issues:[]},o);_ instanceof Promise?s.push(_.then($=>{$.issues.length&&r.issues.push(...gt(u,$.issues)),r.value[p]=$.value})):(_.issues.length&&r.issues.push(...gt(u,_.issues)),r.value[p]=_.value)}let c;for(let u in n)i.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:c})}else{r.value={};for(let i of Reflect.ownKeys(n)){if(i==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,i))continue;let c=t.keyType._zod.run({value:i,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof i=="string"&&Ji.test(i)&&c.issues.length){let p=t.keyType._zod.run({value:Number(i),issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){t.mode==="loose"?r.value[i]=n[i]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>tt(p,o,Ke())),input:i,path:[i],inst:e});continue}let d=t.valueType._zod.run({value:n[i],issues:[]},o);d instanceof Promise?s.push(d.then(p=>{p.issues.length&&r.issues.push(...gt(i,p.issues)),r.value[c.value]=p.value})):(d.issues.length&&r.issues.push(...gt(i,d.issues)),r.value[c.value]=d.value)}}return s.length?Promise.all(s).then(()=>r):r}});var yp=M("$ZodEnum",(e,t)=>{Se.init(e,t);let r=ko(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>xi.has(typeof n)).map(n=>typeof n=="string"?ft(n):n.toString()).join("|")})$`),e._zod.parse=(n,s)=>{let a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),bp=M("$ZodLiteral",(e,t)=>{if(Se.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?ft(o):o?ft(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var zp=M("$ZodTransform",(e,t)=>{Se.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new wr(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new ut;return r.value=n,r.fallback=!0,r}});function Cd(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Xi=M("$ZodOptional",(e,t)=>{Se.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ge(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ge(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Io(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,s=t.innerType._zod.run(r,o);return s instanceof Promise?s.then(a=>Cd(a,n)):Cd(s,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),Rp=M("$ZodExactOptional",(e,t)=>{Xi.init(e,t),ge(e._zod,"values",()=>t.innerType._zod.values),ge(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),$p=M("$ZodNullable",(e,t)=>{Se.init(e,t),ge(e._zod,"optin",()=>t.innerType._zod.optin),ge(e._zod,"optout",()=>t.innerType._zod.optout),ge(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Io(r.source)}|null)$`):void 0}),ge(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),wp=M("$ZodDefault",(e,t)=>{Se.init(e,t),e._zod.optin="optional",ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>Id(s,t)):Id(n,t)}});function Id(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Ep=M("$ZodPrefault",(e,t)=>{Se.init(e,t),e._zod.optin="optional",ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),Pp=M("$ZodNonOptional",(e,t)=>{Se.init(e,t),ge(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>Od(s,e)):Od(n,e)}});function Od(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 Tp=M("$ZodCatch",(e,t)=>{Se.init(e,t),e._zod.optin="optional",ge(e._zod,"optout",()=>t.innerType._zod.optout),ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(a=>tt(a,o,Ke()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(s=>tt(s,o,Ke()))},input:r.value}),r.issues=[],r.fallback=!0),r)}});var Qi=M("$ZodPipe",(e,t)=>{Se.init(e,t),ge(e._zod,"values",()=>t.in._zod.values),ge(e._zod,"optin",()=>t.in._zod.optin),ge(e._zod,"optout",()=>t.out._zod.optout),ge(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=t.out._zod.run(r,o);return s instanceof Promise?s.then(a=>rs(a,t.in,o)):rs(s,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(s=>rs(s,t.out,o)):rs(n,t.out,o)}});function rs(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var kp=M("$ZodPreprocess",(e,t)=>{Qi.init(e,t)}),Cp=M("$ZodReadonly",(e,t)=>{Se.init(e,t),ge(e._zod,"propValues",()=>t.innerType._zod.propValues),ge(e._zod,"values",()=>t.innerType._zod.values),ge(e._zod,"optin",()=>t.innerType?._zod?.optin),ge(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Nd):Nd(n)}});function Nd(e){return e.value=Object.freeze(e.value),e}var Ip=M("$ZodLazy",(e,t)=>{Se.init(e,t),ge(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),ge(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),ge(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),ge(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),ge(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Op=M("$ZodCustom",(e,t)=>{Me.init(e,t),Se.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(s=>jd(s,r,o,e));jd(n,r,o,e)}});function jd(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(kr(n))}}var Gg=()=>{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 r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=o[n.expected]??n.expected,a=Di(n.input),i=o[a]??a;return`Invalid input: expected ${s}, received ${i}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${Yn(n.values[0])}`:`Invalid option: expected one of ${Kn(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${s}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${s}${n.minimum.toString()} ${a.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 ${r[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":""}: ${Kn(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(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Np(){return{localeError:Gg()}}var jp,Wg=Symbol("ZodOutput"),Yg=Symbol("ZodInput"),ec=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...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 qp(){return new ec}(jp=globalThis).__zod_globalRegistry??(jp.__zod_globalRegistry=qp());var Ot=globalThis.__zod_globalRegistry;function xp(e,t){return new e({type:"string",...re(t)})}function Ap(e,t){return new e({type:"string",coerce:!0,...re(t)})}function tc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...re(t)})}function rc(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...re(t)})}function Mp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...re(t)})}function Lp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...re(t)})}function Dp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...re(t)})}function Zp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...re(t)})}function oc(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...re(t)})}function Up(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...re(t)})}function Vp(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...re(t)})}function Fp(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...re(t)})}function Hp(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...re(t)})}function Jp(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...re(t)})}function Bp(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...re(t)})}function Kp(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...re(t)})}function Gp(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...re(t)})}function Wp(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...re(t)})}function Yp(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...re(t)})}function Xp(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...re(t)})}function Qp(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...re(t)})}function em(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...re(t)})}function tm(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...re(t)})}function rm(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...re(t)})}function om(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...re(t)})}function nm(e,t){return new e({type:"string",format:"date",check:"string_format",...re(t)})}function sm(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...re(t)})}function am(e,t){return new e({type:"string",format:"duration",check:"string_format",...re(t)})}function im(e,t){return new e({type:"number",checks:[],...re(t)})}function cm(e,t){return new e({type:"number",coerce:!0,checks:[],...re(t)})}function um(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...re(t)})}function lm(e,t){return new e({type:"boolean",...re(t)})}function dm(e,t){return new e({type:"boolean",coerce:!0,...re(t)})}function pm(e,t){return new e({type:"bigint",coerce:!0,...re(t)})}function mm(e,t){return new e({type:"null",...re(t)})}function hm(e){return new e({type:"any"})}function fm(e){return new e({type:"unknown"})}function gm(e,t){return new e({type:"never",...re(t)})}function _m(e,t){return new e({type:"date",coerce:!0,...re(t)})}function Cr(e,t){return new Bi({check:"less_than",...re(t),value:e,inclusive:!1})}function _t(e,t){return new Bi({check:"less_than",...re(t),value:e,inclusive:!0})}function Ir(e,t){return new Ki({check:"greater_than",...re(t),value:e,inclusive:!1})}function st(e,t){return new Ki({check:"greater_than",...re(t),value:e,inclusive:!0})}function Ao(e,t){return new md({check:"multiple_of",...re(t),value:e})}function ss(e,t){return new fd({check:"max_length",...re(t),maximum:e})}function Or(e,t){return new gd({check:"min_length",...re(t),minimum:e})}function as(e,t){return new _d({check:"length_equals",...re(t),length:e})}function nc(e,t){return new Sd({check:"string_format",format:"regex",...re(t),pattern:e})}function sc(e){return new vd({check:"string_format",format:"lowercase",...re(e)})}function ac(e){return new yd({check:"string_format",format:"uppercase",...re(e)})}function ic(e,t){return new bd({check:"string_format",format:"includes",...re(t),includes:e})}function cc(e,t){return new zd({check:"string_format",format:"starts_with",...re(t),prefix:e})}function uc(e,t){return new Rd({check:"string_format",format:"ends_with",...re(t),suffix:e})}function Nt(e){return new $d({check:"overwrite",tx:e})}function lc(e){return Nt(t=>t.normalize(e))}function dc(){return Nt(e=>e.trim())}function pc(){return Nt(e=>e.toLowerCase())}function mc(){return Nt(e=>e.toUpperCase())}function hc(){return Nt(e=>ji(e))}function Sm(e,t,r){return new e({type:"array",element:t,...re(r)})}function vm(e,t,r){return new e({type:"custom",check:"custom",fn:t,...re(r)})}function ym(e,t){let r=Xg(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(kr(n,o.value,r._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=o.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),o.issues.push(kr(s))}},e(o.value,o)),t);return r}function Xg(e,t){let r=new Me({check:"custom",...re(t)});return r._zod.check=e,r}function Lo(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??Ot,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 ye(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let i=e._zod.toJSONSchema?.();if(i)a.schema=i;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,d);else{let _=a.schema,$=t.processors[n.type];if(!$)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);$(e,t,_,d)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),ye(p,t,d),t.seen.get(p).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(a.schema,c),t.io==="input"&&He(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Do(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let i=e.metadataRegistry.get(a[0])?.id;if(i){let c=o.get(i);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${i}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(i,a[0])}}let n=a=>{let i=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,_=e.external.uri??(S=>S);if(p)return{ref:_(p)};let $=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=$,{defId:$,ref:`${_("__shared")}#/${i}/${$}`}}if(a[1]===r)return{ref:"#"};let u=`#/${i}/`,d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},s=a=>{if(a[1].schema.$ref)return;let i=a[1],{ref:c,defId:u}=n(a);i.def={...i.schema},u&&(i.defId=u);let d=i.schema;for(let p in d)delete d[p];d.$ref=c};if(e.cycles==="throw")for(let a of e.seen.entries()){let i=a[1];if(i.cycle)throw new Error(`Cycle detected: #/${i.cycle?.join("/")}/<root>
63
+
64
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let i=a[1];if(t===a[0]){s(a);continue}if(e.external){let u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){s(a);continue}}if(e.metadataRegistry.get(a[0])?.id){s(a);continue}if(i.cycle){s(a);continue}if(i.count>1&&e.reused==="ref"){s(a);continue}}}function Zo(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=i=>{let c=e.seen.get(i);if(c.ref===null)return;let u=c.def??c.schema,d={...u},p=c.ref;if(c.ref=null,p){o(p);let $=e.seen.get(p),S=$.schema;if(S.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(S)):Object.assign(u,S),Object.assign(u,d),i._zod.parent===p)for(let f in u)f==="$ref"||f==="allOf"||f in d||delete u[f];if(S.$ref&&$.def)for(let f in u)f==="$ref"||f==="allOf"||f in $.def&&JSON.stringify(u[f])===JSON.stringify($.def[f])&&delete u[f]}let _=i._zod.parent;if(_&&_!==p){o(_);let $=e.seen.get(_);if($?.schema.$ref&&(u.$ref=$.schema.$ref,$.def))for(let S in u)S==="$ref"||S==="allOf"||S in $.def&&JSON.stringify(u[S])===JSON.stringify($.def[S])&&delete u[S]}e.override({zodSchema:i,jsonSchema:u,path:c.path??[]})};for(let i of[...e.seen.entries()].reverse())o(i[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 i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(i)}Object.assign(n,r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;s!==void 0&&n.id===s&&delete n.id;let a=e.external?.defs??{};for(let i of e.seen.entries()){let c=i[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,a[c.defId]=c.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let i=JSON.parse(JSON.stringify(n));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:Mo(t,"input",e.processors),output:Mo(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function He(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return He(o.element,r);if(o.type==="set")return He(o.valueType,r);if(o.type==="lazy")return He(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return He(o.innerType,r);if(o.type==="intersection")return He(o.left,r)||He(o.right,r);if(o.type==="record"||o.type==="map")return He(o.keyType,r)||He(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:He(o.in,r)||He(o.out,r);if(o.type==="object"){for(let n in o.shape)if(He(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(He(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(He(n,r))return!0;return!!(o.rest&&He(o.rest,r))}return!1}var bm=(e,t={})=>r=>{let o=Lo({...r,processors:t});return ye(e,o),Do(o,e),Zo(o,e)},Mo=(e,t,r={})=>o=>{let{libraryOptions:n,target:s}=o??{},a=Lo({...n??{},target:s,io:t,processors:r});return ye(e,a),Do(a,e),Zo(a,e)};var Qg={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},fc=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:a,format:i,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof a=="number"&&(n.maxLength=a),i&&(n.format=Qg[i]??i,n.format===""&&delete n.format,i==="time"&&delete n.format),u&&(n.contentEncoding=u),c&&c.size>0){let d=[...c];d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},gc=(e,t,r,o)=>{let n=r,{minimum:s,maximum:a,format:i,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof i=="string"&&i.includes("int")?n.type="integer":n.type="number";let p=typeof d=="number"&&d>=(s??Number.NEGATIVE_INFINITY),_=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),$=t.target==="draft-04"||t.target==="openapi-3.0";p?$?(n.minimum=d,n.exclusiveMinimum=!0):n.exclusiveMinimum=d:typeof s=="number"&&(n.minimum=s),_?$?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof a=="number"&&(n.maximum=a),typeof c=="number"&&(n.multipleOf=c)},_c=(e,t,r,o)=>{r.type="boolean"},Sc=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Rm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},vc=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},$m=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},wm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},yc=(e,t,r,o)=>{r.not={}},bc=(e,t,r,o)=>{},zc=(e,t,r,o)=>{},Rc=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},$c=(e,t,r,o)=>{let n=e._zod.def,s=ko(n.entries);s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),r.enum=s},wc=(e,t,r,o)=>{let n=e._zod.def,s=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){let a=s[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),s.every(a=>typeof a=="boolean")&&(r.type="boolean"),s.every(a=>a===null)&&(r.type="null"),r.enum=s},Em=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Pm=(e,t,r,o)=>{let n=r,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},Tm=(e,t,r,o)=>{let n=r,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:i,mime:c}=e._zod.bag;a!==void 0&&(s.minLength=a),i!==void 0&&(s.maxLength=i),c?c.length===1?(s.contentMediaType=c[0],Object.assign(n,s)):(Object.assign(n,s),n.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(n,s)},km=(e,t,r,o)=>{r.type="boolean"},Ec=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Cm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Pc=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Im=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Om=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Tc=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:a,maximum:i}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof i=="number"&&(n.maxItems=i),n.type="array",n.items=ye(s.element,t,{...o,path:[...o.path,"items"]})},kc=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object",n.properties={};let a=s.shape;for(let u in a)n.properties[u]=ye(a[u],t,{...o,path:[...o.path,"properties",u]});let i=new Set(Object.keys(a)),c=new Set([...i].filter(u=>{let d=s.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(n.required=Array.from(c)),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=ye(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Cc=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,a=n.options.map((i,c)=>ye(i,t,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=a:r.anyOf=a},Ic=(e,t,r,o)=>{let n=e._zod.def,s=ye(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=ye(n.right,t,{...o,path:[...o.path,"allOf",1]}),i=u=>"allOf"in u&&Object.keys(u).length===1,c=[...i(s)?s.allOf:[s],...i(a)?a.allOf:[a]];r.allOf=c},Nm=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",i=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((_,$)=>ye(_,t,{...o,path:[...o.path,a,$]})),u=s.rest?ye(s.rest,t,{...o,path:[...o.path,i,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=c,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:c},u&&n.items.anyOf.push(u),n.minItems=c.length,u||(n.maxItems=c.length)):(n.items=c,u&&(n.additionalItems=u));let{minimum:d,maximum:p}=e._zod.bag;typeof d=="number"&&(n.minItems=d),typeof p=="number"&&(n.maxItems=p)},Oc=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let a=s.keyType,c=a._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let d=ye(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let p of c)n.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=ye(s.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=ye(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let u=a._zod.values;if(u){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(n.required=d)}},Nc=(e,t,r,o)=>{let n=e._zod.def,s=ye(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},jc=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},qc=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},xc=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Ac=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Mc=(e,t,r,o)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?s?n.out:n.in:n.out;ye(a,t,o);let i=t.seen.get(e);i.ref=a},Lc=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0},jm=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},is=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Dc=(e,t,r,o)=>{let n=e._zod.innerType;ye(n,t,o);let s=t.seen.get(e);s.ref=n},zm={string:fc,number:gc,boolean:_c,bigint:Sc,symbol:Rm,null:vc,undefined:$m,void:wm,never:yc,any:bc,unknown:zc,date:Rc,enum:$c,literal:wc,nan:Em,template_literal:Pm,file:Tm,success:km,custom:Ec,function:Cm,transform:Pc,map:Im,set:Om,array:Tc,object:kc,union:Cc,intersection:Ic,tuple:Nm,record:Oc,nullable:Nc,nonoptional:jc,default:qc,prefault:xc,catch:Ac,pipe:Mc,readonly:Lc,promise:jm,optional:is,lazy:Dc};function cs(e,t){if("_idmap"in e){let o=e,n=Lo({...t,processors:zm}),s={};for(let c of o._idmap.entries()){let[u,d]=c;ye(d,n)}let a={},i={registry:o,uri:t?.uri,defs:s};n.external=i;for(let c of o._idmap.entries()){let[u,d]=c;Do(n,d),a[u]=Zo(n,d)}if(Object.keys(s).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:s}}return{schemas:a}}let r=Lo({...t,processors:zm});return ye(e,r),Do(r,e),Zo(r,e)}var lt={};Hn(lt,{ZodISODate:()=>xm,ZodISODateTime:()=>qm,ZodISODuration:()=>Mm,ZodISOTime:()=>Am,date:()=>Uc,datetime:()=>Zc,duration:()=>Fc,time:()=>Vc});var qm=M("ZodISODateTime",(e,t)=>{Jd.init(e,t),we.init(e,t)});function Zc(e){return om(qm,e)}var xm=M("ZodISODate",(e,t)=>{Bd.init(e,t),we.init(e,t)});function Uc(e){return nm(xm,e)}var Am=M("ZodISOTime",(e,t)=>{Kd.init(e,t),we.init(e,t)});function Vc(e){return sm(Am,e)}var Mm=M("ZodISODuration",(e,t)=>{Gd.init(e,t),we.init(e,t)});function Fc(e){return am(Mm,e)}var i_=(e,t)=>{Xn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Vi(e,r)},flatten:{value:r=>Ui(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Pr,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Pr,2)}},isEmpty:{get(){return e.issues.length===0}}})};var Ye=M("ZodError",i_,{Parent:Error});var Dm=Qn(Ye),Zm=es(Ye),us=No(Ye),Um=jo(Ye),Vm=kl(Ye),Fm=Cl(Ye),Hm=Il(Ye),Jm=Ol(Ye),Bm=Nl(Ye),Km=jl(Ye),Gm=ql(Ye),Wm=xl(Ye);var Ym=new WeakMap;function Uo(e,t,r){let o=Object.getPrototypeOf(e),n=Ym.get(o);if(n||(n=new Set,Ym.set(o,n)),!n.has(t)){n.add(t);for(let s in r){let a=r[s];Object.defineProperty(o,s,{configurable:!0,enumerable:!1,get(){let i=a.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:i}),i},set(i){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:i})}})}}}var ve=M("ZodType",(e,t)=>(Se.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Mo(e,"input"),output:Mo(e,"output")}}),e.toJSONSchema=bm(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>Dm(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>us(e,r,o),e.parseAsync=async(r,o)=>Zm(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Um(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Vm(e,r,o),e.decode=(r,o)=>Fm(e,r,o),e.encodeAsync=async(r,o)=>Hm(e,r,o),e.decodeAsync=async(r,o)=>Jm(e,r,o),e.safeEncode=(r,o)=>Bm(e,r,o),e.safeDecode=(r,o)=>Km(e,r,o),e.safeEncodeAsync=async(r,o)=>Gm(e,r,o),e.safeDecodeAsync=async(r,o)=>Wm(e,r,o),Uo(e,"ZodType",{check(...r){let o=this.def;return this.clone(_e.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return et(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(W_(r,o))},superRefine(r,o){return this.check(Y_(r,o))},overwrite(r){return this.check(Nt(r))},optional(){return X(this)},exactOptional(){return x_(this)},nullable(){return th(this)},nullish(){return X(th(this))},nonoptional(r){return U_(this,r)},array(){return O(this)},or(r){return Y([this,r])},and(r){return St(this,r)},transform(r){return rh(this,ph(r))},default(r){return L_(this,r)},prefault(r){return Z_(this,r)},catch(r){return F_(this,r)},pipe(r){return rh(this,r)},readonly(){return B_(this)},describe(r){let o=this.clone();return Ot.add(o,{description:r}),o},meta(...r){if(r.length===0)return Ot.get(this);let o=this.clone();return Ot.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Ot.get(e)?.description},configurable:!0}),e)),oh=M("_ZodString",(e,t)=>{ns.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(o,n,s)=>fc(e,o,n,s);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Uo(e,"_ZodString",{regex(...o){return this.check(nc(...o))},includes(...o){return this.check(ic(...o))},startsWith(...o){return this.check(cc(...o))},endsWith(...o){return this.check(uc(...o))},min(...o){return this.check(Or(...o))},max(...o){return this.check(ss(...o))},length(...o){return this.check(as(...o))},nonempty(...o){return this.check(Or(1,...o))},lowercase(o){return this.check(sc(o))},uppercase(o){return this.check(ac(o))},trim(){return this.check(dc())},normalize(...o){return this.check(lc(...o))},toLowerCase(){return this.check(pc())},toUpperCase(){return this.check(mc())},slugify(){return this.check(hc())}})}),Jc=M("ZodString",(e,t)=>{ns.init(e,t),oh.init(e,t),e.email=r=>e.check(tc(nh,r)),e.url=r=>e.check(oc(ah,r)),e.jwt=r=>e.check(rm(R_,r)),e.emoji=r=>e.check(Up(u_,r)),e.guid=r=>e.check(rc(Xm,r)),e.uuid=r=>e.check(Mp(ls,r)),e.uuidv4=r=>e.check(Lp(ls,r)),e.uuidv6=r=>e.check(Dp(ls,r)),e.uuidv7=r=>e.check(Zp(ls,r)),e.nanoid=r=>e.check(Vp(l_,r)),e.guid=r=>e.check(rc(Xm,r)),e.cuid=r=>e.check(Fp(d_,r)),e.cuid2=r=>e.check(Hp(p_,r)),e.ulid=r=>e.check(Jp(m_,r)),e.base64=r=>e.check(Qp(y_,r)),e.base64url=r=>e.check(em(b_,r)),e.xid=r=>e.check(Bp(h_,r)),e.ksuid=r=>e.check(Kp(f_,r)),e.ipv4=r=>e.check(Gp(g_,r)),e.ipv6=r=>e.check(Wp(__,r)),e.cidrv4=r=>e.check(Yp(S_,r)),e.cidrv6=r=>e.check(Xp(v_,r)),e.e164=r=>e.check(tm(z_,r)),e.datetime=r=>e.check(Zc(r)),e.date=r=>e.check(Uc(r)),e.time=r=>e.check(Vc(r)),e.duration=r=>e.check(Fc(r))});function l(e){return xp(Jc,e)}var we=M("ZodStringFormat",(e,t)=>{Re.init(e,t),oh.init(e,t)}),nh=M("ZodEmail",(e,t)=>{Ad.init(e,t),we.init(e,t)});function sh(e){return tc(nh,e)}var Xm=M("ZodGUID",(e,t)=>{qd.init(e,t),we.init(e,t)});var ls=M("ZodUUID",(e,t)=>{xd.init(e,t),we.init(e,t)});var ah=M("ZodURL",(e,t)=>{Md.init(e,t),we.init(e,t)});function ds(e){return oc(ah,e)}var u_=M("ZodEmoji",(e,t)=>{Ld.init(e,t),we.init(e,t)});var l_=M("ZodNanoID",(e,t)=>{Dd.init(e,t),we.init(e,t)});var d_=M("ZodCUID",(e,t)=>{Zd.init(e,t),we.init(e,t)});var p_=M("ZodCUID2",(e,t)=>{Ud.init(e,t),we.init(e,t)});var m_=M("ZodULID",(e,t)=>{Vd.init(e,t),we.init(e,t)});var h_=M("ZodXID",(e,t)=>{Fd.init(e,t),we.init(e,t)});var f_=M("ZodKSUID",(e,t)=>{Hd.init(e,t),we.init(e,t)});var g_=M("ZodIPv4",(e,t)=>{Wd.init(e,t),we.init(e,t)});var __=M("ZodIPv6",(e,t)=>{Yd.init(e,t),we.init(e,t)});var S_=M("ZodCIDRv4",(e,t)=>{Xd.init(e,t),we.init(e,t)});var v_=M("ZodCIDRv6",(e,t)=>{Qd.init(e,t),we.init(e,t)});var y_=M("ZodBase64",(e,t)=>{tp.init(e,t),we.init(e,t)});var b_=M("ZodBase64URL",(e,t)=>{rp.init(e,t),we.init(e,t)});var z_=M("ZodE164",(e,t)=>{op.init(e,t),we.init(e,t)});var R_=M("ZodJWT",(e,t)=>{np.init(e,t),we.init(e,t)});var ps=M("ZodNumber",(e,t)=>{Wi.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(o,n,s)=>gc(e,o,n,s),Uo(e,"ZodNumber",{gt(o,n){return this.check(Ir(o,n))},gte(o,n){return this.check(st(o,n))},min(o,n){return this.check(st(o,n))},lt(o,n){return this.check(Cr(o,n))},lte(o,n){return this.check(_t(o,n))},max(o,n){return this.check(_t(o,n))},int(o){return this.check(Qm(o))},safe(o){return this.check(Qm(o))},positive(o){return this.check(Ir(0,o))},nonnegative(o){return this.check(st(0,o))},negative(o){return this.check(Cr(0,o))},nonpositive(o){return this.check(_t(0,o))},multipleOf(o,n){return this.check(Ao(o,n))},step(o,n){return this.check(Ao(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function F(e){return im(ps,e)}var $_=M("ZodNumberFormat",(e,t)=>{sp.init(e,t),ps.init(e,t)});function Qm(e){return um($_,e)}var Bc=M("ZodBoolean",(e,t)=>{ap.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_c(e,r,o,n)});function W(e){return lm(Bc,e)}var ih=M("ZodBigInt",(e,t)=>{ip.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Sc(e,o,n,s),e.gte=(o,n)=>e.check(st(o,n)),e.min=(o,n)=>e.check(st(o,n)),e.gt=(o,n)=>e.check(Ir(o,n)),e.gte=(o,n)=>e.check(st(o,n)),e.min=(o,n)=>e.check(st(o,n)),e.lt=(o,n)=>e.check(Cr(o,n)),e.lte=(o,n)=>e.check(_t(o,n)),e.max=(o,n)=>e.check(_t(o,n)),e.positive=o=>e.check(Ir(BigInt(0),o)),e.negative=o=>e.check(Cr(BigInt(0),o)),e.nonpositive=o=>e.check(_t(BigInt(0),o)),e.nonnegative=o=>e.check(st(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(Ao(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});var w_=M("ZodNull",(e,t)=>{cp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vc(e,r,o,n)});function nr(e){return mm(w_,e)}var E_=M("ZodAny",(e,t)=>{up.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bc(e,r,o,n)});function ch(){return hm(E_)}var P_=M("ZodUnknown",(e,t)=>{lp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zc(e,r,o,n)});function Q(){return fm(P_)}var T_=M("ZodNever",(e,t)=>{dp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yc(e,r,o,n)});function k_(e){return gm(T_,e)}var uh=M("ZodDate",(e,t)=>{pp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Rc(e,o,n,s),e.min=(o,n)=>e.check(st(o,n)),e.max=(o,n)=>e.check(_t(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});var C_=M("ZodArray",(e,t)=>{mp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tc(e,r,o,n),e.element=t.element,Uo(e,"ZodArray",{min(r,o){return this.check(Or(r,o))},nonempty(r){return this.check(Or(1,r))},max(r,o){return this.check(ss(r,o))},length(r,o){return this.check(as(r,o))},unwrap(){return this.element}})});function O(e,t){return Sm(C_,e,t)}var lh=M("ZodObject",(e,t)=>{gp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>kc(e,r,o,n),_e.defineLazy(e,"shape",()=>t.shape),Uo(e,"ZodObject",{keyof(){return ie(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Q()})},loose(){return this.clone({...this._zod.def,catchall:Q()})},strict(){return this.clone({...this._zod.def,catchall:k_()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return _e.extend(this,r)},safeExtend(r){return _e.safeExtend(this,r)},merge(r){return _e.merge(this,r)},pick(r){return _e.pick(this,r)},omit(r){return _e.omit(this,r)},partial(...r){return _e.partial(mh,this,r[0])},required(...r){return _e.required(hh,this,r[0])}})});function P(e,t){let r={type:"object",shape:e??{},..._e.normalizeParams(t)};return new lh(r)}function oe(e,t){return new lh({type:"object",shape:e,catchall:Q(),..._e.normalizeParams(t)})}var dh=M("ZodUnion",(e,t)=>{Yi.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cc(e,r,o,n),e.options=t.options});function Y(e,t){return new dh({type:"union",options:e,..._e.normalizeParams(t)})}var I_=M("ZodDiscriminatedUnion",(e,t)=>{dh.init(e,t),_p.init(e,t)});function jr(e,t,r){return new I_({type:"union",options:t,discriminator:e,..._e.normalizeParams(r)})}var O_=M("ZodIntersection",(e,t)=>{Sp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ic(e,r,o,n)});function St(e,t){return new O_({type:"intersection",left:e,right:t})}var eh=M("ZodRecord",(e,t)=>{vp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Oc(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function K(e,t,r){return!t||!t._zod?new eh({type:"record",keyType:l(),valueType:e,..._e.normalizeParams(t)}):new eh({type:"record",keyType:e,valueType:t,..._e.normalizeParams(r)})}var Hc=M("ZodEnum",(e,t)=>{yp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(o,n,s)=>$c(e,o,n,s),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let s={};for(let a of o)if(r.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Hc({...t,checks:[],..._e.normalizeParams(n),entries:s})},e.exclude=(o,n)=>{let s={...t.entries};for(let a of o)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new Hc({...t,checks:[],..._e.normalizeParams(n),entries:s})}});function ie(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Hc({type:"enum",entries:r,..._e.normalizeParams(t)})}var N_=M("ZodLiteral",(e,t)=>{bp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wc(e,r,o,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 j(e,t){return new N_({type:"literal",values:Array.isArray(e)?e:[e],..._e.normalizeParams(t)})}var j_=M("ZodTransform",(e,t)=>{zp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pc(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new wr(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(_e.issue(s,r.value,t));else{let a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(_e.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function ph(e){return new j_({type:"transform",transform:e})}var mh=M("ZodOptional",(e,t)=>{Xi.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>is(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function X(e){return new mh({type:"optional",innerType:e})}var q_=M("ZodExactOptional",(e,t)=>{Rp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>is(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function x_(e){return new q_({type:"optional",innerType:e})}var A_=M("ZodNullable",(e,t)=>{$p.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nc(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function th(e){return new A_({type:"nullable",innerType:e})}var M_=M("ZodDefault",(e,t)=>{wp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qc(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function L_(e,t){return new M_({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():_e.shallowClone(t)}})}var D_=M("ZodPrefault",(e,t)=>{Ep.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xc(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Z_(e,t){return new D_({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():_e.shallowClone(t)}})}var hh=M("ZodNonOptional",(e,t)=>{Pp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jc(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function U_(e,t){return new hh({type:"nonoptional",innerType:e,..._e.normalizeParams(t)})}var V_=M("ZodCatch",(e,t)=>{Tp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ac(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function F_(e,t){return new V_({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var fh=M("ZodPipe",(e,t)=>{Qi.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mc(e,r,o,n),e.in=t.in,e.out=t.out});function rh(e,t){return new fh({type:"pipe",in:e,out:t})}var H_=M("ZodPreprocess",(e,t)=>{fh.init(e,t),kp.init(e,t)}),J_=M("ZodReadonly",(e,t)=>{Cp.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lc(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function B_(e){return new J_({type:"readonly",innerType:e})}var K_=M("ZodLazy",(e,t)=>{Ip.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dc(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Vo(e){return new K_({type:"lazy",getter:e})}var G_=M("ZodCustom",(e,t)=>{Op.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ec(e,r,o,n)});function W_(e,t={}){return vm(G_,e,t)}function Y_(e,t){return ym(e,t)}function sr(e,t){return new H_({type:"pipe",in:ph(e),out:t})}var _h={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"};var gh;gh||(gh={});var ms={};Hn(ms,{bigint:()=>tS,boolean:()=>eS,date:()=>rS,number:()=>Q_,string:()=>X_});function X_(e){return Ap(Jc,e)}function Q_(e){return cm(ps,e)}function eS(e){return dm(Bc,e)}function tS(e){return pm(ih,e)}function rS(e){return _m(uh,e)}Ke(Np());var ir="2025-11-25";var hs=[ir,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],fs="io.modelcontextprotocol/related-task",yt="io.modelcontextprotocol/protocolVersion",qr="io.modelcontextprotocol/clientInfo",dt="io.modelcontextprotocol/serverInfo",bt="io.modelcontextprotocol/clientCapabilities",cr="io.modelcontextprotocol/subscriptionId",qt="io.modelcontextprotocol/logLevel";var ur="2.0";var jt=Vo(()=>Y([l(),F(),W(),nr(),K(l(),jt),O(jt)])),Pe=K(l(),jt),Gc=O(jt),Fo=Y([l(),F().int()]),Ho=l(),gs=P({ttl:F().optional()}),_s=P({taskId:l()}),Jo=oe({progressToken:Fo.optional(),[fs]:_s.optional()}),Ae=P({_meta:Jo.optional()}),lr=Ae.extend({task:gs.optional()}),Te=P({method:l(),params:Ae.loose().optional()}),Ue=P({_meta:Jo.optional()}),Ve=P({method:l(),params:Ue.loose().optional()}),Bo=oe({get[dt](){return Mr.optional().catch(void 0)}}),ke=oe({_meta:Bo.optional()}),xt=Y([l(),F().int()]),Ko=P({jsonrpc:j(ur),id:xt,...Te.shape}).strict(),Go=P({jsonrpc:j(ur),...Ve.shape}).strict(),xr=P({jsonrpc:j(ur),id:xt,result:ke}).strict(),Ar=P({jsonrpc:j(ur),id:xt.optional(),error:P({code:F().int(),message:l(),data:Q().optional()})}).strict(),Wo=Y([Ko,Go,xr,Ar]),Wc=Y([xr,Ar]),Yo=ke.strict(),Ss=Ue.extend({requestId:xt.optional(),reason:l().optional()}),Xo=Ve.extend({method:j("notifications/cancelled"),params:Ss}),vs=P({src:l(),mimeType:l().optional(),sizes:O(l()).optional(),theme:ie(["light","dark"]).optional()}),At=P({icons:O(vs).optional()}),vt=P({name:l(),title:l().optional()}),Mr=vt.extend({...vt.shape,...At.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),nS=St(P({applyDefaults:W().optional()}),Pe),sS=sr(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,St(P({form:nS.optional(),url:Pe.optional()}),Pe.optional())),ys=oe({list:Pe.optional(),cancel:Pe.optional(),requests:oe({sampling:oe({createMessage:Pe.optional()}).optional(),elicitation:oe({create:Pe.optional()}).optional()}).optional()}),bs=oe({list:Pe.optional(),cancel:Pe.optional(),requests:oe({tools:oe({call:Pe.optional()}).optional()}).optional()}),zs=P({experimental:K(l(),Pe).optional(),sampling:P({context:Pe.optional(),tools:Pe.optional()}).optional(),elicitation:sS.optional(),roots:P({listChanged:W().optional()}).optional(),tasks:ys.optional(),extensions:K(l(),Pe).optional()}),Rs=Ae.extend({protocolVersion:l(),capabilities:zs,clientInfo:Mr}),$s=Te.extend({method:j("initialize"),params:Rs}),Qo=P({experimental:K(l(),Pe).optional(),logging:Pe.optional(),completions:Pe.optional(),prompts:P({listChanged:W().optional()}).optional(),resources:P({subscribe:W().optional(),listChanged:W().optional()}).optional(),tools:P({listChanged:W().optional()}).optional(),tasks:bs.optional(),extensions:K(l(),Pe).optional()}),ws=ke.extend({protocolVersion:l(),capabilities:Qo,serverInfo:Mr,instructions:l().optional()}),Es=Ve.extend({method:j("notifications/initialized"),params:Ue.optional()}),Ps=Te.extend({method:j("server/discover"),params:Ae.optional()}),Ts=ke.extend({supportedVersions:O(l()),capabilities:Qo,instructions:l().optional()}),en=Te.extend({method:j("ping"),params:Ae.optional()}),ks=P({progress:F(),total:X(F()),message:X(l())}),Cs=P({...Ue.shape,...ks.shape,progressToken:Fo}),tn=Ve.extend({method:j("notifications/progress"),params:Cs}),Is=Ae.extend({cursor:Ho.optional()}),Mt=Te.extend({params:Is.optional()}),Lt=ke.extend({nextCursor:Ho.optional()}),rn=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),on=rn.extend({text:l()}),Yc=l().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),nn=rn.extend({blob:Yc}),Dt=ie(["user","assistant"]),zt=P({audience:O(Dt).optional(),priority:F().min(0).max(1).optional(),lastModified:lt.datetime({offset:!0}).optional()}),sn=P({...vt.shape,...At.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(F()),annotations:zt.optional(),_meta:X(oe({}))}),Os=P({...vt.shape,...At.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:zt.optional(),_meta:X(oe({}))}),Ns=Mt.extend({method:j("resources/list")}),js=Lt.extend({resources:O(sn)}),qs=Mt.extend({method:j("resources/templates/list")}),xs=Lt.extend({resourceTemplates:O(Os)}),Lr=Ae.extend({uri:l()}),As=Lr,Ms=Te.extend({method:j("resources/read"),params:As}),Ls=ke.extend({contents:O(Y([on,nn]))}),Ds=Ve.extend({method:j("notifications/resources/list_changed"),params:Ue.optional()}),Zs=Lr,Us=Te.extend({method:j("resources/subscribe"),params:Zs}),Vs=Lr,Fs=Te.extend({method:j("resources/unsubscribe"),params:Vs}),an=P({toolsListChanged:W().optional(),promptsListChanged:W().optional(),resourcesListChanged:W().optional(),resourceSubscriptions:O(l()).optional()}),Hs=Ae.extend({notifications:an}),Js=Te.extend({method:j("subscriptions/listen"),params:Hs}),Bs=Ue.extend({notifications:an}),Ks=Ve.extend({method:j("notifications/subscriptions/acknowledged"),params:Bs}),Gs=Bo.extend({[cr]:xt}),Ws=ke.extend({_meta:Gs}),Ys=Ue.extend({uri:l()}),Xs=Ve.extend({method:j("notifications/resources/updated"),params:Ys}),Qs=P({name:l(),description:X(l()),required:X(W())}),ea=P({...vt.shape,...At.shape,description:X(l()),arguments:X(O(Qs)),_meta:X(oe({}))}),ta=Mt.extend({method:j("prompts/list")}),ra=Lt.extend({prompts:O(ea)}),oa=Ae.extend({name:l(),arguments:K(l(),l()).optional()}),na=Te.extend({method:j("prompts/get"),params:oa}),Dr=P({type:j("text"),text:l(),annotations:zt.optional(),_meta:K(l(),Q()).optional()}),Zr=P({type:j("image"),data:Yc,mimeType:l(),annotations:zt.optional(),_meta:K(l(),Q()).optional()}),Ur=P({type:j("audio"),data:Yc,mimeType:l(),annotations:zt.optional(),_meta:K(l(),Q()).optional()}),sa=P({type:j("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),aa=P({type:j("resource"),resource:Y([on,nn]),annotations:zt.optional(),_meta:K(l(),Q()).optional()}),ia=sn.extend({type:j("resource_link")}),Vr=Y([Dr,Zr,Ur,ia,aa]),ca=P({role:Dt,content:Vr}),ua=ke.extend({description:l().optional(),messages:O(ca)}),la=Ve.extend({method:j("notifications/prompts/list_changed"),params:Ue.optional()}),da=P({title:l().optional(),readOnlyHint:W().optional(),destructiveHint:W().optional(),idempotentHint:W().optional(),openWorldHint:W().optional()}),pa=P({taskSupport:ie(["required","optional","forbidden"]).optional()}),cn=P({...vt.shape,...At.shape,description:l().optional(),inputSchema:P({type:j("object"),properties:K(l(),jt).optional(),required:O(l()).optional()}).catchall(Q()),outputSchema:oe({$schema:l().optional()}).optional(),annotations:da.optional(),execution:pa.optional(),_meta:K(l(),Q()).optional()}),ma=Mt.extend({method:j("tools/list")}),ha=Lt.extend({tools:O(cn)}),un=ke.extend({content:O(Vr).default([]),structuredContent:Q().optional(),isError:W().optional()}),Xc=un.or(ke.extend({toolResult:Q()})),fa=lr.extend({name:l(),arguments:K(l(),Q()).optional()}),ga=Te.extend({method:j("tools/call"),params:fa}),_a=Ve.extend({method:j("notifications/tools/list_changed"),params:Ue.optional()}),Qc=P({autoRefresh:W().default(!0),debounceMs:F().int().nonnegative().default(300)}),Zt=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),Sa=Ae.extend({level:Zt}),va=Te.extend({method:j("logging/setLevel"),params:Sa}),ya=Ue.extend({level:Zt,logger:l().optional(),data:Q()}),ba=Ve.extend({method:j("notifications/message"),params:ya}),za=P({name:l().optional()}),Ra=P({hints:O(za).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),$a=P({mode:ie(["auto","required","none"]).optional()}),wa=P({type:j("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:O(Vr),structuredContent:Q().optional(),isError:W().optional(),_meta:K(l(),Q()).optional()}),Ea=jr("type",[Dr,Zr,Ur]),ar=jr("type",[Dr,Zr,Ur,sa,wa]),Pa=P({role:Dt,content:Y([ar,O(ar)]),_meta:K(l(),Q()).optional()}),Ta=lr.extend({messages:O(Pa),modelPreferences:Ra.optional(),systemPrompt:l().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:O(l()).optional(),metadata:Pe.optional(),tools:O(cn).optional(),toolChoice:$a.optional()}),ka=Te.extend({method:j("sampling/createMessage"),params:Ta}),Ca=ke.extend({model:l(),stopReason:X(ie(["endTurn","stopSequence","maxTokens"]).or(l())),role:Dt,content:Ea}),Ia=ke.extend({model:l(),stopReason:X(ie(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:Dt,content:Y([ar,O(ar)])}),ln=P({type:j("boolean"),title:l().optional(),description:l().optional(),default:W().optional()}),Fr=P({type:j("string"),title:l().optional(),description:l().optional(),minLength:F().optional(),maxLength:F().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:l().optional()}),Hr=P({type:ie(["number","integer"]),title:l().optional(),description:l().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),dn=P({type:j("string"),title:l().optional(),description:l().optional(),enum:O(l()),default:l().optional()}),pn=P({type:j("string"),title:l().optional(),description:l().optional(),oneOf:O(P({const:l(),title:l()})),default:l().optional()}),mn=P({type:j("string"),title:l().optional(),description:l().optional(),enum:O(l()),enumNames:O(l()).optional(),default:l().optional()}),Oa=Y([dn,pn]),hn=P({type:j("array"),title:l().optional(),description:l().optional(),minItems:F().optional(),maxItems:F().optional(),items:P({type:j("string"),enum:O(l())}),default:O(l()).optional()}),fn=P({type:j("array"),title:l().optional(),description:l().optional(),minItems:F().optional(),maxItems:F().optional(),items:P({anyOf:O(P({const:l(),title:l()}))}),default:O(l()).optional()}),Na=Y([hn,fn]),ja=Y([mn,Oa,Na]),gn=Y([ja,ln,Fr,Hr]),Jr=lr.extend({mode:j("form").optional(),message:l(),requestedSchema:P({type:j("object"),properties:K(l(),gn),required:O(l()).optional()}).catchall(Q())}),qa=lr.extend({mode:j("url"),message:l(),elicitationId:l(),url:l().url()}),xa=Y([Jr,qa]),Aa=Te.extend({method:j("elicitation/create"),params:xa}),Ma=Ue.extend({elicitationId:l()}),La=Ve.extend({method:j("notifications/elicitation/complete"),params:Ma}),Da=ke.extend({action:ie(["accept","decline","cancel"]),content:sr(e=>e===null?void 0:e,K(l(),Y([l(),F(),W(),O(l())])).optional())}),Za=P({type:j("ref/resource"),uri:l()}),Ua=P({type:j("ref/prompt"),name:l()}),Va=Ae.extend({ref:Y([Ua,Za]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),Fa=Te.extend({method:j("completion/complete"),params:Va}),Ha=ke.extend({completion:oe({values:O(l()).max(100),total:X(F().int()),hasMore:X(W())})}),Ja=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),Ba=Te.extend({method:j("roots/list"),params:Ae.optional()}),Ka=ke.extend({roots:O(Ja)}),Ga=Ve.extend({method:j("notifications/roots/list_changed"),params:Ue.optional()}),eu=oe({ttl:F().optional(),pollInterval:F().optional()}),Wa=ie(["working","input_required","completed","failed","cancelled"]),Ut=P({taskId:l(),status:Wa,ttl:Y([F(),nr()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(F()),statusMessage:X(l())}),tu=ke.extend({task:Ut}),Ya=Ue.merge(Ut),ru=Ve.extend({method:j("notifications/tasks/status"),params:Ya}),ou=Te.extend({method:j("tasks/get"),params:Ae.extend({taskId:l()})}),nu=ke.merge(Ut),su=Te.extend({method:j("tasks/result"),params:Ae.extend({taskId:l()})}),au=ke.loose(),iu=Mt.extend({method:j("tasks/list")}),cu=Lt.extend({tasks:O(Ut)}),uu=Te.extend({method:j("tasks/cancel"),params:Ae.extend({taskId:l()})}),lu=ke.merge(Ut),du=Y([en,$s,Ps,Fa,va,na,ta,Ns,qs,Ms,Us,Fs,Js,ga,ma]),pu=Y([Xo,tn,Es,Ga]),mu=Y([Yo,Ca,Ia,Da,Ka]),hu=Y([en,ka,Aa,Ba]),fu=Y([Xo,tn,ba,Xs,Ds,_a,la,Ks,La]),gu=Y([Yo,ws,Ts,Ha,ua,ra,js,xs,Ls,un,ha,Ws]),xe=ds().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:_h.custom,message:"URL must be parseable",fatal:!0}),Ci}).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"}),_u=oe({resource:l().url(),authorization_servers:O(xe).optional(),jwks_uri:l().url().optional(),scopes_supported:O(l()).optional(),bearer_methods_supported:O(l()).optional(),resource_signing_alg_values_supported:O(l()).optional(),resource_name:l().optional(),resource_documentation:l().optional(),resource_policy_uri:l().url().optional(),resource_tos_uri:l().url().optional(),tls_client_certificate_bound_access_tokens:W().optional(),authorization_details_types_supported:O(l()).optional(),dpop_signing_alg_values_supported:O(l()).optional(),dpop_bound_access_tokens_required:W().optional()}),Xa=oe({issuer:l(),authorization_endpoint:xe,token_endpoint:xe,registration_endpoint:xe.optional(),scopes_supported:O(l()).optional(),response_types_supported:O(l()),response_modes_supported:O(l()).optional(),grant_types_supported:O(l()).optional(),token_endpoint_auth_methods_supported:O(l()).optional(),token_endpoint_auth_signing_alg_values_supported:O(l()).optional(),service_documentation:xe.optional(),revocation_endpoint:xe.optional(),revocation_endpoint_auth_methods_supported:O(l()).optional(),revocation_endpoint_auth_signing_alg_values_supported:O(l()).optional(),introspection_endpoint:l().optional(),introspection_endpoint_auth_methods_supported:O(l()).optional(),introspection_endpoint_auth_signing_alg_values_supported:O(l()).optional(),code_challenge_methods_supported:O(l()).optional(),client_id_metadata_document_supported:W().optional(),authorization_response_iss_parameter_supported:W().optional().catch(void 0)}),Qa=oe({issuer:l(),authorization_endpoint:xe,token_endpoint:xe,userinfo_endpoint:xe.optional(),jwks_uri:xe,registration_endpoint:xe.optional(),scopes_supported:O(l()).optional(),response_types_supported:O(l()),response_modes_supported:O(l()).optional(),grant_types_supported:O(l()).optional(),acr_values_supported:O(l()).optional(),subject_types_supported:O(l()),id_token_signing_alg_values_supported:O(l()),id_token_encryption_alg_values_supported:O(l()).optional(),id_token_encryption_enc_values_supported:O(l()).optional(),userinfo_signing_alg_values_supported:O(l()).optional(),userinfo_encryption_alg_values_supported:O(l()).optional(),userinfo_encryption_enc_values_supported:O(l()).optional(),request_object_signing_alg_values_supported:O(l()).optional(),request_object_encryption_alg_values_supported:O(l()).optional(),request_object_encryption_enc_values_supported:O(l()).optional(),token_endpoint_auth_methods_supported:O(l()).optional(),token_endpoint_auth_signing_alg_values_supported:O(l()).optional(),display_values_supported:O(l()).optional(),claim_types_supported:O(l()).optional(),claims_supported:O(l()).optional(),service_documentation:l().optional(),claims_locales_supported:O(l()).optional(),ui_locales_supported:O(l()).optional(),claims_parameter_supported:W().optional(),request_parameter_supported:W().optional(),request_uri_parameter_supported:W().optional(),require_request_uri_registration:W().optional(),op_policy_uri:xe.optional(),op_tos_uri:xe.optional(),client_id_metadata_document_supported:W().optional(),authorization_response_iss_parameter_supported:W().optional().catch(void 0)}),Su=P({...Qa.shape,...Xa.pick({code_challenge_methods_supported:!0}).shape}),vu=P({access_token:l(),id_token:l().optional(),token_type:l(),expires_in:ms.number().optional(),scope:l().optional(),refresh_token:l().optional()}).strip(),yu=P({issued_token_type:j("urn:ietf:params:oauth:token-type:id-jag"),access_token:l(),token_type:l().optional(),expires_in:F().optional(),scope:l().optional()}).strip(),bu=P({error:l(),error_description:l().optional(),error_uri:l().optional()}),Kc=xe.optional().or(j("").transform(()=>{})),ei=P({redirect_uris:O(xe),token_endpoint_auth_method:l().optional(),grant_types:O(l()).optional(),response_types:O(l()).optional(),application_type:l().optional(),client_name:l().optional(),client_uri:xe.optional(),logo_uri:Kc,scope:l().optional(),contacts:O(l()).optional(),tos_uri:Kc,policy_uri:l().optional(),jwks_uri:xe.optional(),jwks:ch().optional(),software_id:l().optional(),software_version:l().optional(),software_statement:l().optional()}).strip(),ti=P({client_id:l(),client_secret:l().optional(),client_id_issued_at:F().optional(),client_secret_expires_at:F().optional()}).strip(),zu=ei.merge(ti),Ru=P({error:l(),error_description:l().optional()}).strip(),$u=P({token:l(),token_type_hint:l().optional()}).strip();var Tu=Symbol.for("mcp.sdk.errorBrands");function Ou(e,t){let r=new Set,o=t;for(;typeof o=="function";){let n=o.mcpBrand;Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&typeof n=="string"&&r.add(n),o=Object.getPrototypeOf(o)}r.size!==0&&Object.defineProperty(e,Tu,{value:r,enumerable:!1,configurable:!0})}function Kr(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,Tu)){let r=t[Tu];if(r&&typeof r.has=="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var aS=class Lh extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return Kr(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 Kr(this,t)}constructor(t,r,o){super(r),this.code=t,this.errorUri=o,this.name="OAuthError",Ou(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 Lh(t.error,t.error_description??t.error,t.error_uri)}},me=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}({}),ce=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return Kr(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 Kr(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="SdkError",Ou(this,new.target)}},iS=class extends ce{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r){super(e,t,r),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};function Ph(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function cS(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function Dh(e){switch(e.method){case"elicitation/create":return e.params?.mode==="url"?{elicitation:{url:{}}}:{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;return t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0)?{sampling:{tools:{}}}:{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function ui(e,t){let r={};for(let[o,n]of Object.entries(e)){if(n===void 0)continue;let s=t===void 0?void 0:t[o];if(s===void 0){r[o]=n;continue}if(Ph(n)&&Ph(s)){let a={};for(let[i,c]of Object.entries(n))c!==void 0&&s[i]===void 0&&!cS(o,i,s)&&(a[i]=c);Object.keys(a).length>0&&(r[o]=a)}}return Object.keys(r).length>0?r:void 0}var Zh="2026-07-28",Ft=[Zh];function Wr(e){return e>=Zh}function Uh(e){return e.filter(t=>!Wr(t))}function Nu(e){return e.filter(t=>Wr(t))}function Vh(e){let t=e.structuredContent;return t===void 0||!(typeof t!="object"||t===null||Array.isArray(t))||(e.content?.some(r=>r.type==="text")??!1)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var Fh=["task","inputRequests","requestState"];function ju(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||Fh.some(t=>t in e)?e:{...e,content:[]}}function uS(){let e=Vo(()=>Y([l(),F(),W(),nr(),K(l(),e),O(e)])),t=K(l(),e),r=Y([l(),F().int()]),o=l(),n=P({ttl:F().optional()}),s=P({taskId:l()}),a=oe({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),i=P({_meta:a.optional()}),c=i.extend({task:n.optional()}),u=P({method:l(),params:i.loose().optional()}),d=P({_meta:a.optional()}),p=P({method:l(),params:d.loose().optional()}),_=oe({_meta:a.optional()}),$=Y([l(),F().int()]),S=_.strict(),b=d.extend({requestId:$.optional(),reason:l().optional()}),f=p.extend({method:j("notifications/cancelled"),params:b}),m=P({src:l(),mimeType:l().optional(),sizes:O(l()).optional(),theme:ie(["light","dark"]).optional()}),z=P({icons:O(m).optional()}),h=P({name:l(),title:l().optional()}),v=h.extend({...h.shape,...z.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),E=St(P({applyDefaults:W().optional()}),t),y=sr(Ze=>Ze&&typeof Ze=="object"&&!Array.isArray(Ze)&&Object.keys(Ze).length===0?{form:{}}:Ze,St(P({form:E.optional(),url:t.optional()}),t.optional())),g=oe({list:t.optional(),cancel:t.optional(),requests:oe({sampling:oe({createMessage:t.optional()}).optional(),elicitation:oe({create:t.optional()}).optional()}).optional()}),R=oe({list:t.optional(),cancel:t.optional(),requests:oe({tools:oe({call:t.optional()}).optional()}).optional()}),I=P({experimental:K(l(),t).optional(),sampling:P({context:t.optional(),tools:t.optional()}).optional(),elicitation:y.optional(),roots:P({listChanged:W().optional()}).optional(),tasks:g.optional(),extensions:K(l(),t).optional()}),L=i.extend({protocolVersion:l(),capabilities:I,clientInfo:v}),N=u.extend({method:j("initialize"),params:L}),D=P({experimental:K(l(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:P({listChanged:W().optional()}).optional(),resources:P({subscribe:W().optional(),listChanged:W().optional()}).optional(),tools:P({listChanged:W().optional()}).optional(),tasks:R.optional(),extensions:K(l(),t).optional()}),B=_.extend({protocolVersion:l(),capabilities:D,serverInfo:v,instructions:l().optional()}),G=p.extend({method:j("notifications/initialized"),params:d.optional()}),pe=u.extend({method:j("ping"),params:i.optional()}),$e=P({progress:F(),total:X(F()),message:X(l())}),be=P({...d.shape,...$e.shape,progressToken:r}),Oe=p.extend({method:j("notifications/progress"),params:be}),he=i.extend({cursor:o.optional()}),C=u.extend({params:he.optional()}),x=_.extend({nextCursor:o.optional()}),V=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),w=V.extend({text:l()}),k=l().refine(Ze=>{try{return atob(Ze),!0}catch{return!1}},{message:"Invalid Base64 string"}),q=V.extend({blob:k}),J=ie(["user","assistant"]),te=P({audience:O(J).optional(),priority:F().min(0).max(1).optional(),lastModified:lt.datetime({offset:!0}).optional()}),de=P({...h.shape,...z.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(F()),annotations:te.optional(),_meta:X(oe({}))}),ae=P({...h.shape,...z.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:te.optional(),_meta:X(oe({}))}),ze=C.extend({method:j("resources/list")}),Fe=x.extend({resources:O(de)}),T=C.extend({method:j("resources/templates/list")}),A=x.extend({resourceTemplates:O(ae)}),Z=i.extend({uri:l()}),ne=Z,se=u.extend({method:j("resources/read"),params:ne}),le=_.extend({contents:O(Y([w,q]))}),Ce=p.extend({method:j("notifications/resources/list_changed"),params:d.optional()}),je=Z,Le=u.extend({method:j("resources/subscribe"),params:je}),Ne=Z,Ee=u.extend({method:j("resources/unsubscribe"),params:Ne}),Xe=d.extend({uri:l()}),qe=p.extend({method:j("notifications/resources/updated"),params:Xe}),pt=P({name:l(),description:X(l()),required:X(W())}),ot=P({...h.shape,...z.shape,description:X(l()),arguments:X(O(pt)),_meta:X(oe({}))}),mt=C.extend({method:j("prompts/list")}),$t=x.extend({prompts:O(ot)}),wt=i.extend({name:l(),arguments:K(l(),l()).optional()}),Bt=u.extend({method:j("prompts/get"),params:wt}),Kt=P({type:j("text"),text:l(),annotations:te.optional(),_meta:K(l(),Q()).optional()}),Gt=P({type:j("image"),data:k,mimeType:l(),annotations:te.optional(),_meta:K(l(),Q()).optional()}),Wt=P({type:j("audio"),data:k,mimeType:l(),annotations:te.optional(),_meta:K(l(),Q()).optional()}),eo=P({type:j("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),Et=P({type:j("resource"),resource:Y([w,q]),annotations:te.optional(),_meta:K(l(),Q()).optional()}),to=de.extend({type:j("resource_link")}),Qe=Y([Kt,Gt,Wt,to,Et]),hr=P({role:J,content:Qe}),fr=_.extend({description:l().optional(),messages:O(hr)}),Yt=p.extend({method:j("notifications/prompts/list_changed"),params:d.optional()}),ro=P({title:l().optional(),readOnlyHint:W().optional(),destructiveHint:W().optional(),idempotentHint:W().optional(),openWorldHint:W().optional()}),gr=P({taskSupport:ie(["required","optional","forbidden"]).optional()}),Xt=P({...h.shape,...z.shape,description:l().optional(),inputSchema:P({type:j("object"),properties:K(l(),e).optional(),required:O(l()).optional()}).catchall(Q()),outputSchema:P({type:j("object"),properties:K(l(),e).optional(),required:O(l()).optional()}).catchall(Q()).optional(),annotations:ro.optional(),execution:gr.optional(),_meta:K(l(),Q()).optional()}),_r=C.extend({method:j("tools/list")}),Sr=x.extend({tools:O(Xt)}),vr=_.extend({content:O(Qe),structuredContent:K(l(),Q()).optional(),isError:W().optional()}),De=c.extend({name:l(),arguments:K(l(),Q()).optional()}),oo=u.extend({method:j("tools/call"),params:De}),Pn=p.extend({method:j("notifications/tools/list_changed"),params:d.optional()}),yr=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),no=i.extend({level:yr}),so=u.extend({method:j("logging/setLevel"),params:no}),ao=d.extend({level:yr,logger:l().optional(),data:Q()}),io=p.extend({method:j("notifications/message"),params:ao}),co=P({name:l().optional()}),uo=P({hints:O(co).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),lo=P({mode:ie(["auto","required","none"]).optional()}),Tn=P({type:j("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:O(Qe),structuredContent:P({}).loose().optional(),isError:W().optional(),_meta:K(l(),Q()).optional()}),po=jr("type",[Kt,Gt,Wt]),Pt=jr("type",[Kt,Gt,Wt,eo,Tn]),mo=P({role:J,content:Y([Pt,O(Pt)]),_meta:K(l(),Q()).optional()}),ho=c.extend({messages:O(mo),modelPreferences:uo.optional(),systemPrompt:l().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:O(l()).optional(),metadata:t.optional(),tools:O(Xt).optional(),toolChoice:lo.optional()}),fo=u.extend({method:j("sampling/createMessage"),params:ho}),go=_.extend({model:l(),stopReason:X(ie(["endTurn","stopSequence","maxTokens"]).or(l())),role:J,content:po}),_o=_.extend({model:l(),stopReason:X(ie(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:J,content:Y([Pt,O(Pt)])}),So=P({type:j("boolean"),title:l().optional(),description:l().optional(),default:W().optional()}),vo=P({type:j("string"),title:l().optional(),description:l().optional(),minLength:F().optional(),maxLength:F().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:l().optional()}),yo=P({type:ie(["number","integer"]),title:l().optional(),description:l().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),bo=P({type:j("string"),title:l().optional(),description:l().optional(),enum:O(l()),default:l().optional()}),zo=P({type:j("string"),title:l().optional(),description:l().optional(),oneOf:O(P({const:l(),title:l()})),default:l().optional()}),Ro=P({type:j("string"),title:l().optional(),description:l().optional(),enum:O(l()),enumNames:O(l()).optional(),default:l().optional()}),$o=Y([bo,zo]),Qt=P({type:j("array"),title:l().optional(),description:l().optional(),minItems:F().optional(),maxItems:F().optional(),items:P({type:j("string"),enum:O(l())}),default:O(l()).optional()}),er=P({type:j("array"),title:l().optional(),description:l().optional(),minItems:F().optional(),maxItems:F().optional(),items:P({anyOf:O(P({const:l(),title:l()}))}),default:O(l()).optional()}),kn=Y([Qt,er]),Cn=Y([Ro,$o,kn]),Ge=Y([Cn,So,vo,yo]),We=c.extend({mode:j("form").optional(),message:l(),requestedSchema:P({type:j("object"),properties:K(l(),Ge),required:O(l()).optional()}).catchall(Q())}),wo=c.extend({mode:j("url"),message:l(),elicitationId:l(),url:l().url()}),nt=Y([We,wo]),In=u.extend({method:j("elicitation/create"),params:nt}),On=d.extend({elicitationId:l()}),Nn=p.extend({method:j("notifications/elicitation/complete"),params:On}),jn=_.extend({action:ie(["accept","decline","cancel"]),content:sr(Ze=>Ze===null?void 0:Ze,K(l(),Y([l(),F(),W(),O(l())])).optional())}),qn=P({type:j("ref/resource"),uri:l()}),xn=P({type:j("ref/prompt"),name:l()}),An=i.extend({ref:Y([xn,qn]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),Eo=u.extend({method:j("completion/complete"),params:An}),Mn=_.extend({completion:oe({values:O(l()).max(100),total:X(F().int()),hasMore:X(W())})}),Ln=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),br=u.extend({method:j("roots/list"),params:i.optional()}),Po=_.extend({roots:O(Ln)}),Dn=p.extend({method:j("notifications/roots/list_changed"),params:d.optional()}),Zn=oe({ttl:F().optional(),pollInterval:F().optional()}),Un=ie(["working","input_required","completed","failed","cancelled"]),Tt=P({taskId:l(),status:Un,ttl:Y([F(),nr()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(F()),statusMessage:X(l())}),Je=_.extend({task:Tt}),Vn=d.merge(Tt),tr=p.extend({method:j("notifications/tasks/status"),params:Vn}),zr=u.extend({method:j("tasks/get"),params:i.extend({taskId:l()})}),Rr=_.merge(Tt),$r=u.extend({method:j("tasks/result"),params:i.extend({taskId:l()})}),ki=_.loose(),Be=C.extend({method:j("tasks/list")}),Ie=x.extend({tasks:O(Tt)}),rr=u.extend({method:j("tasks/cancel"),params:i.extend({taskId:l()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:a,BaseRequestParamsSchema:i,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:d,NotificationSchema:p,ResultSchema:_,RequestIdSchema:$,EmptyResultSchema:S,CancelledNotificationParamsSchema:b,CancelledNotificationSchema:f,IconSchema:m,IconsSchema:z,BaseMetadataSchema:h,ImplementationSchema:v,ClientTasksCapabilitySchema:g,ServerTasksCapabilitySchema:R,ClientCapabilitiesSchema:I,InitializeRequestParamsSchema:L,InitializeRequestSchema:N,ServerCapabilitiesSchema:D,InitializeResultSchema:B,InitializedNotificationSchema:G,PingRequestSchema:pe,ProgressSchema:$e,ProgressNotificationParamsSchema:be,ProgressNotificationSchema:Oe,PaginatedRequestParamsSchema:he,PaginatedRequestSchema:C,PaginatedResultSchema:x,ResourceContentsSchema:V,TextResourceContentsSchema:w,BlobResourceContentsSchema:q,RoleSchema:J,AnnotationsSchema:te,ResourceSchema:de,ResourceTemplateSchema:ae,ListResourcesRequestSchema:ze,ListResourcesResultSchema:Fe,ListResourceTemplatesRequestSchema:T,ListResourceTemplatesResultSchema:A,ResourceRequestParamsSchema:Z,ReadResourceRequestParamsSchema:ne,ReadResourceRequestSchema:se,ReadResourceResultSchema:le,ResourceListChangedNotificationSchema:Ce,SubscribeRequestParamsSchema:je,SubscribeRequestSchema:Le,UnsubscribeRequestParamsSchema:Ne,UnsubscribeRequestSchema:Ee,ResourceUpdatedNotificationParamsSchema:Xe,ResourceUpdatedNotificationSchema:qe,PromptArgumentSchema:pt,PromptSchema:ot,ListPromptsRequestSchema:mt,ListPromptsResultSchema:$t,GetPromptRequestParamsSchema:wt,GetPromptRequestSchema:Bt,TextContentSchema:Kt,ImageContentSchema:Gt,AudioContentSchema:Wt,ToolUseContentSchema:eo,EmbeddedResourceSchema:Et,ResourceLinkSchema:to,ContentBlockSchema:Qe,PromptMessageSchema:hr,GetPromptResultSchema:fr,PromptListChangedNotificationSchema:Yt,ToolAnnotationsSchema:ro,ToolExecutionSchema:gr,ToolSchema:Xt,ListToolsRequestSchema:_r,ListToolsResultSchema:Sr,CallToolResultSchema:vr,CallToolRequestParamsSchema:De,CallToolRequestSchema:oo,ToolListChangedNotificationSchema:Pn,LoggingLevelSchema:yr,SetLevelRequestParamsSchema:no,SetLevelRequestSchema:so,LoggingMessageNotificationParamsSchema:ao,LoggingMessageNotificationSchema:io,ModelHintSchema:co,ModelPreferencesSchema:uo,ToolChoiceSchema:lo,ToolResultContentSchema:Tn,SamplingContentSchema:po,SamplingMessageContentBlockSchema:Pt,SamplingMessageSchema:mo,CreateMessageRequestParamsSchema:ho,CreateMessageRequestSchema:fo,CreateMessageResultSchema:go,CreateMessageResultWithToolsSchema:_o,BooleanSchemaSchema:So,StringSchemaSchema:vo,NumberSchemaSchema:yo,UntitledSingleSelectEnumSchemaSchema:bo,TitledSingleSelectEnumSchemaSchema:zo,LegacyTitledEnumSchemaSchema:Ro,SingleSelectEnumSchemaSchema:$o,UntitledMultiSelectEnumSchemaSchema:Qt,TitledMultiSelectEnumSchemaSchema:er,MultiSelectEnumSchemaSchema:kn,EnumSchemaSchema:Cn,PrimitiveSchemaDefinitionSchema:Ge,ElicitRequestFormParamsSchema:We,ElicitRequestURLParamsSchema:wo,ElicitRequestParamsSchema:nt,ElicitRequestSchema:In,ElicitationCompleteNotificationParamsSchema:On,ElicitationCompleteNotificationSchema:Nn,ElicitResultSchema:jn,ResourceTemplateReferenceSchema:qn,PromptReferenceSchema:xn,CompleteRequestParamsSchema:An,CompleteRequestSchema:Eo,CompleteResultSchema:Mn,RootSchema:Ln,ListRootsRequestSchema:br,ListRootsResultSchema:Po,RootsListChangedNotificationSchema:Dn,TaskCreationParamsSchema:Zn,TaskStatusSchema:Un,TaskSchema:Tt,CreateTaskResultSchema:Je,TaskStatusNotificationParamsSchema:Vn,TaskStatusNotificationSchema:tr,GetTaskRequestSchema:zr,GetTaskResultSchema:Rr,GetTaskPayloadRequestSchema:$r,GetTaskPayloadResultSchema:ki,ListTasksRequestSchema:Be,ListTasksResultSchema:Ie,CancelTaskRequestSchema:rr,CancelTaskResultSchema:_.merge(Tt),ClientRequestSchema:Y([pe,N,Eo,so,Bt,mt,ze,T,se,Le,Ee,oo,_r,zr,$r,Be,rr]),ClientNotificationSchema:Y([f,Oe,G,Dn,tr]),ClientResultSchema:Y([S,go,_o,jn,Po,Rr,Ie,Je]),ServerRequestSchema:Y([pe,fo,In,br,zr,$r,Be,rr]),ServerNotificationSchema:Y([f,Oe,io,qe,Ce,Pn,Yt,tr,Nn]),ServerResultSchema:Y([S,B,Mn,fr,$t,Fe,A,le,vr,Sr,Rr,Ie,Je]),CallToolResultWireSchema:Q().superRefine((Ze,tg)=>{if(!(typeof Ze!="object"||Ze===null||Array.isArray(Ze)||Ze.content!==void 0)){for(let pl of Fh)if(pl in Ze){tg.addIssue({code:"custom",message:`content is required when the body carries '${pl}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(ju).pipe(vr)}}var lS;function Hh(){return lS??=uS()}function Jh(e){return e.type!=="object"}var dS=new Set(["const","enum","default","examples"]),pS=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Th(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function mS(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(Th(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=gl(e.$schema)&&e.$recursiveAnchor!==!0,o=(n,s)=>{if(Array.isArray(n))return n.map(c=>o(c,!1));if(n===null||typeof n!="object"||!s&&Th(n.$id))return n;let a={},i=!1;for(let[c,u]of Object.entries(n))s?a[c]=o(u,!1):(c==="$ref"||c==="$dynamicRef")&&typeof u=="string"?a[c]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u:c==="$recursiveRef"&&u==="#"&&r?i=!0:dS.has(c)?a[c]=u:pS.has(c)?a[c]=o(u,!0):a[c]=o(u,!1);return i&&("$ref"in a?a.allOf=[...Array.isArray(a.allOf)?a.allOf:[],{$ref:"#/properties/result"}]:a.$ref="#/properties/result"),a};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:o(e,!1)},required:["result"]}}var Bh={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},Kh={"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},hS={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},ri;function qu(){if(ri)return ri;let e=Hh();return ri={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}},ri}function Gh(e){return Object.prototype.hasOwnProperty.call(Bh,e)}function Wh(e){return Object.prototype.hasOwnProperty.call(Kh,e)}function fS(e){return Object.prototype.hasOwnProperty.call(hS,e)}function gS(e){return fS(e)?qu().resultSchemas[e]:void 0}function _S(e){return Gh(e)?qu().requestSchemas[e]:void 0}function SS(e){return Wh(e)?qu().notificationSchemas[e]:void 0}var d0=Object.keys(Bh),p0=Object.keys(Kh);function ku(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function oi(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var kh={ok:!1,reason:"not-in-era"};function Ch(e){return ku(e)&&ku(e.outputSchema)&&Jh(e.outputSchema)}var xu={era:"2025-11-25",hasRequestMethod:Gh,hasNotificationMethod:Wh,validateRequest:(e,t)=>oi(_S(e),t),validateResult:(e,t)=>oi(gS(e),t),validateNotification:(e,t)=>oi(SS(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>kh,validateInputResponse:()=>kh,samplingResultVariant:(e,t)=>{let r=Hh();return oi(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=Vh(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!="object"||o===null||Array.isArray(o),s=t!==void 0&&Jh(t);return!n&&!s?r:{...r,structuredContent:{result:o}}},decodeResult(e,t){if(ku(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:r}}return{kind:"complete",result:t}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;return!Array.isArray(r)||!r.some(o=>Ch(o))?t:{...t,tools:r.map(o=>Ch(o)?{...o,outputSchema:mS(o.outputSchema)}:o)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function vS(){let e=Vo(()=>Y([l(),F(),W(),nr(),K(l(),e),O(e)])),t=K(l(),e),r=Y([l(),F().int()]),o=l(),n=Y([l(),F().int()]),s=ie(["user","assistant"]),a=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),i=l().refine(Ie=>{try{return atob(Ie),!0}catch{return!1}},{message:"Invalid Base64 string"}),c=P({ttl:F().optional()}),u=P({taskId:l()}),d=oe({progressToken:r.optional(),"io.modelcontextprotocol/related-task":u.optional()}),p=P({_meta:d.optional()}),_=p.extend({task:c.optional()}),$=P({_meta:d.optional()}),S=P({method:l(),params:$.loose().optional()}),b=P({src:l(),mimeType:l().optional(),sizes:O(l()).optional(),theme:ie(["light","dark"]).optional()}),f=P({icons:O(b).optional()}),m=P({name:l(),title:l().optional()}),z=m.extend({...m.shape,...f.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),h=St(P({applyDefaults:W().optional()}),t),v=sr(Ie=>Ie&&typeof Ie=="object"&&!Array.isArray(Ie)&&Object.keys(Ie).length===0?{form:{}}:Ie,St(P({form:h.optional(),url:t.optional()}),t.optional())),E=oe({list:t.optional(),cancel:t.optional(),requests:oe({sampling:oe({createMessage:t.optional()}).optional(),elicitation:oe({create:t.optional()}).optional()}).optional()}),y=oe({list:t.optional(),cancel:t.optional(),requests:oe({tools:oe({call:t.optional()}).optional()}).optional()}),g=P({experimental:K(l(),t).optional(),sampling:P({context:t.optional(),tools:t.optional()}).optional(),elicitation:v.optional(),roots:P({listChanged:W().optional()}).optional(),tasks:E.optional(),extensions:K(l(),t).optional()}),R=P({experimental:K(l(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:P({listChanged:W().optional()}).optional(),resources:P({subscribe:W().optional(),listChanged:W().optional()}).optional(),tools:P({listChanged:W().optional()}).optional(),tasks:y.optional(),extensions:K(l(),t).optional()}),I=P({progress:F(),total:X(F()),message:X(l())}),L=P({...$.shape,...I.shape,progressToken:r}),N=S.extend({method:j("notifications/progress"),params:L}),D=$.extend({level:a,logger:l().optional(),data:Q()}),B=S.extend({method:j("notifications/message"),params:D}),G=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),pe=G.extend({text:l()}),$e=G.extend({blob:i}),be=P({audience:O(s).optional(),priority:F().min(0).max(1).optional(),lastModified:lt.datetime({offset:!0}).optional()}),Oe=P({...m.shape,...f.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(F()),annotations:be.optional(),_meta:X(oe({}))}),he=P({...m.shape,...f.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:be.optional(),_meta:X(oe({}))}),C=S.extend({method:j("notifications/resources/list_changed"),params:$.optional()}),x=$.extend({uri:l()}),V=S.extend({method:j("notifications/resources/updated"),params:x}),w=P({name:l(),description:X(l()),required:X(W())}),k=P({...m.shape,...f.shape,description:X(l()),arguments:X(O(w)),_meta:X(oe({}))}),q=S.extend({method:j("notifications/prompts/list_changed"),params:$.optional()}),J=P({type:j("text"),text:l(),annotations:be.optional(),_meta:K(l(),Q()).optional()}),te=P({type:j("image"),data:i,mimeType:l(),annotations:be.optional(),_meta:K(l(),Q()).optional()}),de=P({type:j("audio"),data:i,mimeType:l(),annotations:be.optional(),_meta:K(l(),Q()).optional()}),ae=P({type:j("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),ze=P({type:j("resource"),resource:Y([pe,$e]),annotations:be.optional(),_meta:K(l(),Q()).optional()}),Fe=Oe.extend({type:j("resource_link")}),T=Y([J,te,de,Fe,ze]),A=P({role:s,content:T}),Z=P({title:l().optional(),readOnlyHint:W().optional(),destructiveHint:W().optional(),idempotentHint:W().optional(),openWorldHint:W().optional()}),ne=S.extend({method:j("notifications/tools/list_changed"),params:$.optional()}),se=P({name:l().optional()}),le=P({hints:O(se).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),Ce=P({mode:ie(["auto","required","none"]).optional()}),je=P({type:j("boolean"),title:l().optional(),description:l().optional(),default:W().optional()}),Le=P({type:j("string"),title:l().optional(),description:l().optional(),minLength:F().optional(),maxLength:F().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:l().optional()}),Ne=P({type:ie(["number","integer"]),title:l().optional(),description:l().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),Ee=P({type:j("string"),title:l().optional(),description:l().optional(),enum:O(l()),default:l().optional()}),Xe=P({type:j("string"),title:l().optional(),description:l().optional(),oneOf:O(P({const:l(),title:l()})),default:l().optional()}),qe=P({type:j("string"),title:l().optional(),description:l().optional(),enum:O(l()),enumNames:O(l()).optional(),default:l().optional()}),pt=Y([Ee,Xe]),ot=P({type:j("array"),title:l().optional(),description:l().optional(),minItems:F().optional(),maxItems:F().optional(),items:P({type:j("string"),enum:O(l())}),default:O(l()).optional()}),mt=P({type:j("array"),title:l().optional(),description:l().optional(),minItems:F().optional(),maxItems:F().optional(),items:P({anyOf:O(P({const:l(),title:l()}))}),default:O(l()).optional()}),$t=Y([ot,mt]),wt=Y([qe,pt,$t]),Bt=Y([wt,je,Le,Ne]),Kt=_.extend({mode:j("form").optional(),message:l(),requestedSchema:P({type:j("object"),properties:K(l(),Bt),required:O(l()).optional()}).catchall(Q())}),Gt=P({type:j("ref/resource"),uri:l()}),Wt=P({type:j("ref/prompt"),name:l()}),eo=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),Et=g.shape,to=P({experimental:Et.experimental,sampling:Et.sampling,elicitation:Et.elicitation,roots:Et.roots,extensions:Et.extensions}),Qe=R.shape,hr=P({experimental:Qe.experimental,logging:Qe.logging,completions:Qe.completions,prompts:Qe.prompts,resources:Qe.resources,tools:Qe.tools,extensions:Qe.extensions}),fr=oe({progressToken:r.optional(),[yt]:l(),[qr]:z.optional(),[bt]:to,[qt]:a.optional()}),Yt=P({...m.shape,...f.shape,description:l().optional(),inputSchema:oe({$schema:l().optional(),type:j("object")}),outputSchema:oe({$schema:l().optional()}).optional(),annotations:Z.optional(),_meta:K(l(),Q()).optional()}),ro=P({type:j("tool_result"),toolUseId:l(),content:O(T),structuredContent:Q().optional(),isError:W().optional(),_meta:K(l(),Q()).optional()}),gr=Y([J,te,de,ae,ro]),Xt=P({role:s,content:Y([gr,O(gr)]),_meta:K(l(),Q()).optional()}),_r=l(),Sr=oe({[dt]:z.optional().catch(void 0)}),vr=Sr.optional();function De(Ie){return oe({_meta:vr,resultType:_r.default("complete"),...Ie})}let oo=De({}),Pn=De({nextCursor:o.optional()}),yr=De({content:O(T),structuredContent:Q().optional(),isError:W().optional()}),no=De({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),tools:O(Yt),nextCursor:o.optional()}),so=De({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),prompts:O(k),nextCursor:o.optional()}),ao=De({description:l().optional(),messages:O(A)}),io=De({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resources:O(Oe),nextCursor:o.optional()}),co=De({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resourceTemplates:O(he),nextCursor:o.optional()}),uo=De({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),contents:O(Y([pe,$e]))}),lo=De({completion:P({values:O(l()).max(100),total:F().int().optional(),hasMore:W().optional()}).loose()}),Tn=De({ttlMs:F().int().min(0),cacheScope:ie(["public","private"])}),po=De({ttlMs:F().int().min(0).catch(0),cacheScope:ie(["public","private"]).catch("private"),supportedVersions:O(l()),capabilities:hr,instructions:l().optional()}),Pt=P({messages:O(Xt),modelPreferences:le.optional(),systemPrompt:l().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:O(l()).optional(),metadata:t.optional(),tools:O(Yt).optional(),toolChoice:Ce.optional()}),mo=P({method:j("sampling/createMessage"),params:Pt}),ho=P({method:j("roots/list"),params:P({_meta:K(l(),Q()).optional()}).optional()}),fo=P({...Xt.shape,model:l(),stopReason:l().optional()}),go=P({roots:O(eo)}),_o=P({action:ie(["accept","decline","cancel"]),content:K(l(),Y([l(),F(),W(),O(l())])).optional()}),So=P({mode:j("url"),message:l(),url:l().url()}),vo=Y([Kt,So]),yo=P({method:j("elicitation/create"),params:vo}),bo=Y([mo,ho,yo]),zo=Y([fo,go,_o]),Ro=K(l(),bo),$o=K(l(),zo),Qt=De({inputRequests:Ro.optional(),requestState:l().optional()}),er={inputResponses:$o.optional(),requestState:l().optional()},kn=P({_meta:fr,...er}),Cn=oe({progressToken:r.optional()});function Ge(Ie,rr){return P({method:j(Ie),params:P({_meta:fr,...rr})})}function We(Ie,rr){return P({method:j(Ie),params:P({_meta:Cn.optional(),...rr}).optional()})}let wo={name:l(),arguments:K(l(),Q()).optional(),...er},nt={cursor:o.optional()},In=Ge("tools/call",wo),On=Ge("tools/list",nt),Nn=Ge("prompts/list",nt),jn=Ge("prompts/get",{name:l(),arguments:K(l(),l()).optional(),...er}),qn=Ge("resources/list",nt),xn=Ge("resources/templates/list",nt),An=Ge("resources/read",{uri:l(),...er}),Eo={ref:Y([Wt,Gt]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()},Mn=Ge("completion/complete",Eo),Ln=Ge("server/discover",{}),br=P({toolsListChanged:W().optional(),promptsListChanged:W().optional(),resourcesListChanged:W().optional(),resourceSubscriptions:O(l()).optional()}),Po={notifications:br},Dn=Ge("subscriptions/listen",Po),Zn=Sr.extend({"io.modelcontextprotocol/subscriptionId":n}),Un=oe({_meta:Zn,resultType:_r.default("complete")}),Tt={"tools/call":We("tools/call",wo),"tools/list":We("tools/list",nt),"prompts/get":We("prompts/get",{name:l(),arguments:K(l(),l()).optional()}),"prompts/list":We("prompts/list",nt),"resources/list":We("resources/list",nt),"resources/templates/list":We("resources/templates/list",nt),"resources/read":We("resources/read",{uri:l()}),"completion/complete":We("completion/complete",Eo),"server/discover":We("server/discover",{}),"subscriptions/listen":We("subscriptions/listen",Po)};function Je(Ie){return oe({_meta:vr,...Ie})}let Vn={"tools/call":Je({content:O(T),structuredContent:Q().optional(),isError:W().optional()}),"tools/list":Je({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),tools:O(Yt),nextCursor:o.optional()}),"prompts/get":Je({description:l().optional(),messages:O(A)}),"prompts/list":Je({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),prompts:O(k),nextCursor:o.optional()}),"resources/list":Je({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resources:O(Oe),nextCursor:o.optional()}),"resources/templates/list":Je({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resourceTemplates:O(he),nextCursor:o.optional()}),"resources/read":Je({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),contents:O(Y([pe,$e]))}),"completion/complete":Je({completion:P({values:O(l()).max(100),total:F().int().optional(),hasMore:W().optional()}).loose()}),"server/discover":Je({ttlMs:F().int().min(0).catch(0),cacheScope:ie(["public","private"]).catch("private"),supportedVersions:O(l()),capabilities:hr,instructions:l().optional()}),"subscriptions/listen":Je({})},tr=oe({"io.modelcontextprotocol/subscriptionId":n.optional()}),zr=P({method:j("notifications/subscriptions/acknowledged"),params:P({_meta:tr.optional(),notifications:br})}),Rr=P({_meta:tr.optional(),requestId:n,reason:l().optional()}),$r=P({method:j("notifications/cancelled"),params:Rr}),ki={"notifications/cancelled":$r,"notifications/progress":N,"notifications/message":B,"notifications/resources/updated":V,"notifications/resources/list_changed":C,"notifications/tools/list_changed":ne,"notifications/prompts/list_changed":q,"notifications/subscriptions/acknowledged":zr},Be=Ie=>P({jsonrpc:j("2.0"),id:Y([l(),F().int()]),result:Ie}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:a,TaskMetadataSchema:c,RelatedTaskMetadataSchema:u,RequestMetaSchema:d,BaseRequestParamsSchema:p,TaskAugmentedRequestParamsSchema:_,NotificationsParamsSchema:$,NotificationSchema:S,IconSchema:b,IconsSchema:f,BaseMetadataSchema:m,ImplementationSchema:z,ClientTasksCapabilitySchema:E,ServerTasksCapabilitySchema:y,ClientCapabilitiesSchema:g,ServerCapabilitiesSchema:R,ProgressSchema:I,ProgressNotificationParamsSchema:L,ProgressNotificationSchema:N,LoggingMessageNotificationParamsSchema:D,LoggingMessageNotificationSchema:B,ResourceContentsSchema:G,TextResourceContentsSchema:pe,BlobResourceContentsSchema:$e,AnnotationsSchema:be,ResourceSchema:Oe,ResourceTemplateSchema:he,ResourceListChangedNotificationSchema:C,ResourceUpdatedNotificationParamsSchema:x,ResourceUpdatedNotificationSchema:V,PromptArgumentSchema:w,PromptSchema:k,PromptListChangedNotificationSchema:q,TextContentSchema:J,ImageContentSchema:te,AudioContentSchema:de,ToolUseContentSchema:ae,EmbeddedResourceSchema:ze,ResourceLinkSchema:Fe,ContentBlockSchema:T,PromptMessageSchema:A,ToolAnnotationsSchema:Z,ToolListChangedNotificationSchema:ne,ModelHintSchema:se,ModelPreferencesSchema:le,ToolChoiceSchema:Ce,BooleanSchemaSchema:je,StringSchemaSchema:Le,NumberSchemaSchema:Ne,UntitledSingleSelectEnumSchemaSchema:Ee,TitledSingleSelectEnumSchemaSchema:Xe,LegacyTitledEnumSchemaSchema:qe,SingleSelectEnumSchemaSchema:pt,UntitledMultiSelectEnumSchemaSchema:ot,TitledMultiSelectEnumSchemaSchema:mt,MultiSelectEnumSchemaSchema:$t,EnumSchemaSchema:wt,PrimitiveSchemaDefinitionSchema:Bt,ElicitRequestFormParamsSchema:Kt,ResourceTemplateReferenceSchema:Gt,PromptReferenceSchema:Wt,RootSchema:eo,ClientCapabilities2026Schema:to,ServerCapabilities2026Schema:hr,RequestMetaEnvelopeSchema:fr,ToolSchema:Yt,ToolResultContentSchema:ro,SamplingMessageContentBlockSchema:gr,SamplingMessageSchema:Xt,ResultTypeSchema:_r,ResultMetaSchema:Sr,ResultSchema:oo,PaginatedResultSchema:Pn,CallToolResultSchema:yr,ListToolsResultSchema:no,ListPromptsResultSchema:so,GetPromptResultSchema:ao,ListResourcesResultSchema:io,ListResourceTemplatesResultSchema:co,ReadResourceResultSchema:uo,CompleteResultSchema:lo,CacheableResultSchema:Tn,DiscoverResultSchema:po,CreateMessageRequestParamsSchema:Pt,CreateMessageRequestSchema:mo,ListRootsRequestSchema:ho,CreateMessageResultSchema:fo,ListRootsResultSchema:go,ElicitResultSchema:_o,ElicitRequestURLParamsSchema:So,ElicitRequestParamsSchema:vo,ElicitRequestSchema:yo,InputRequestSchema:bo,InputResponseSchema:zo,InputRequestsSchema:Ro,InputResponsesSchema:$o,InputRequiredResultSchema:Qt,InputResponseRequestParamsSchema:kn,CallToolRequestSchema:In,ListToolsRequestSchema:On,ListPromptsRequestSchema:Nn,GetPromptRequestSchema:jn,ListResourcesRequestSchema:qn,ListResourceTemplatesRequestSchema:xn,ReadResourceRequestSchema:An,CompleteRequestSchema:Mn,DiscoverRequestSchema:Ln,SubscriptionFilterSchema:br,SubscriptionsListenRequestSchema:Dn,SubscriptionsListenResultMetaSchema:Zn,SubscriptionsListenResultSchema:Un,dispatchRequestSchemas:Tt,dispatchResultSchemas:Vn,NotificationMetaSchema:tr,SubscriptionsAcknowledgedNotificationSchema:zr,CancelledNotificationParamsSchema:Rr,CancelledNotificationSchema:$r,notificationSchemas2026:ki,JSONRPCResultResponseSchema:Be(oo),CallToolResultResponseSchema:Be(Y([yr,Qt])),ListToolsResultResponseSchema:Be(no),ListPromptsResultResponseSchema:Be(so),GetPromptResultResponseSchema:Be(Y([ao,Qt])),ListResourcesResultResponseSchema:Be(io),ListResourceTemplatesResultResponseSchema:Be(co),ReadResourceResultResponseSchema:Be(Y([uo,Qt])),CompleteResultResponseSchema:Be(lo),DiscoverResultResponseSchema:Be(po)}}var yS;function pr(){return yS??=vS()}var bS=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function zS(e){return bS.includes(e)}var Br=Symbol("modelcontextprotocol.resultCacheHintFallback");function li(e,t){if(t===void 0)return e;let r=e[Br];if(r===void 0)return{...e,[Br]:t};let o={},n=r.ttlMs??t.ttlMs;n!==void 0&&(o.ttlMs=n);let s=r.cacheScope??t.cacheScope;return s!==void 0&&(o.cacheScope=s),{...e,[Br]:o}}function RS(e){return e[Br]}function Au(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Mu(e){return e==="public"||e==="private"}function Lu(e,t){if(e.ttlMs!==void 0&&!Au(e.ttlMs))throw new RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!Mu(e.cacheScope))throw new RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var H=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}({}),ee=class Yh extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return Kr(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 Kr(this,t)}constructor(t,r,o){super(r),this.code=t,this.data=o,this.name="ProtocolError",Ou(this,new.target)}static fromError(t,r,o){if(t===H.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new Xh(n.elicitations,r)}if(t===H.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new Yr({supported:n.supported,requested:n.requested},r)}if(t===H.InvalidParams||t===H.ResourceNotFound){let n=o;if(typeof n?.uri=="string"&&(t===H.ResourceNotFound||Object.keys(n).length===1))return new di(n.uri,r)}if(t===H.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities=="object"&&!Array.isArray(n.requiredCapabilities))return new pi({requiredCapabilities:n.requiredCapabilities},r)}return new Yh(t,r,o)}},di=class extends ee{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(H.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Xh=class extends ee{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(H.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Yr=class extends ee{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(H.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},pi=class extends ee{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(H.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},$S=0,wS="private",ES=["tools/call","prompts/get","resources/read"];function PS(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete"||ES.includes(e))return t;throw new ee(H.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function TS(e,t){let r=RS(t);if(t.resultType!=="complete"||!zS(e))return r===void 0?t:NS(t);let o=t,n=Au(o.ttlMs)?o.ttlMs:IS(r),s=Mu(o.cacheScope)?o.cacheScope:OS(r),a={...o,ttlMs:n,cacheScope:s};return delete a[Br],a}function kS(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function CS(e,t){if(t===void 0)return e;let r=e._meta;return r===void 0?{...e,_meta:{[dt]:t}}:!kS(r)||r[dt]!==void 0?e:{...e,_meta:{...r,[dt]:t}}}function IS(e){return e!==void 0&&Au(e.ttlMs)?e.ttlMs:$S}function OS(e){return e!==void 0&&Mu(e.cacheScope)?e.cacheScope:wS}function NS(e){let t={...e};return delete t[Br],t}var jS=["elicitation/create","sampling/createMessage","roots/list"],ni;function Qh(){if(ni)return ni;let e=pr();return ni={request:{"elicitation/create":P({method:j("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":P({method:j("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":P({method:j("roots/list"),params:oe({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},ni}function ef(e){return jS.includes(e)}function wu(e){return ef(e)?Qh().request[e]:void 0}function qS(e){return ef(e)?Qh().response[e]:void 0}var Du={"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},tf={"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 rf(e){return Object.prototype.hasOwnProperty.call(Du,e)}function of(e){return Object.prototype.hasOwnProperty.call(tf,e)}function xS(e){return Object.prototype.hasOwnProperty.call(Du,e)}function AS(e){return rf(e)?pr().dispatchRequestSchemas[e]:void 0}function MS(e){return xS(e)?pr().dispatchResultSchemas[e]:void 0}function LS(e){return of(e)?pr().notificationSchemas2026[e]:void 0}var m0=Object.keys(Du),h0=Object.keys(tf);function vn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function _n(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var DS={ok:!1,reason:"not-in-era"},ZS=[yt,bt];function US(e,t){let r=t,o=!1,n=()=>(o||(r={...r},o=!0),r),s=t.tools;e==="tools/list"&&Array.isArray(s)&&s.some(i=>vn(i)&&"execution"in i)&&(n().tools=s.map(i=>{if(!vn(i)||!("execution"in i))return i;let c={...i};return delete c.execution,c}));let a=t.capabilities;if(vn(a)&&"tasks"in a){let i={...a};delete i.tasks,n().capabilities=i}return r}var Zu={era:"2026-07-28",hasRequestMethod:rf,hasNotificationMethod:of,hasInputRequestMethod:e=>wu(e)!==void 0,validateRequest:(e,t)=>_n(AS(e),t),validateResult:(e,t)=>_n(MS(e),t),validateNotification:(e,t)=>_n(LS(e),t),validateInputRequest:(e,t)=>_n(wu(e),t),validateInputResponse:(e,t)=>_n(qS(e),t),samplingResultVariant:()=>DS,outboundEnvelope(e){return{[yt]:e.protocolVersion,[qr]:e.clientInfo,[bt]:e.clientCapabilities,...e.logLevel!==void 0&&{[qt]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of ZS)o in e||t.push({key:o,problem:"missing"});let r=pr().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let o of r.error.issues){let n=o.path.map(String),s=n.length>0?n.join("."):"_meta";n.length===1&&t.some(a=>a.key===s&&a.problem==="missing")||t.push({key:s,problem:o.message})}return t},projectCallToolResult:e=>Vh(e),inputRequestSchema:wu,decodeResult(e,t){if(!vn(t))return{kind:"invalid",error:new ce(me.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new ce(me.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 r!="string")return{kind:"invalid",error:new ce(me.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let a=t.inputRequests,i=vn(a)?a:{},c=t.requestState;return Object.keys(i).length===0&&typeof c!="string"?{kind:"invalid",error:new ce(me.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:i,...typeof c=="string"&&{requestState:c}}}if(r!=="complete")return{kind:"invalid",error:new ce(me.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=VS(),n=Object.hasOwn(o,e)?o[e]:void 0;if(n!==void 0){let a=n.safeParse(t);if(!a.success)return{kind:"invalid",error:new ce(me.InvalidResult,`Invalid result for ${e}: ${a.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,r){return CS(TS(e,PS(e,US(e,t))),r)},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=pr().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(r=>r.message).join("; ")}`}},si;function VS(){if(si)return si;let e=pr();return si={"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},si}var Rn="2026-07-28";function Vt(e){return e!==void 0&&Wr(e)?Zu:xu}function Ih(e){return e.revision!==void 0?Vt(e.revision).era:e.era==="modern"?Zu.era:xu.era}function Eu(e){return nf.some(t=>t.hasRequestMethod(e))}function Pu(e){return nf.some(t=>t.hasNotificationMethod(e))}var nf=[xu,Zu];function Oh(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function mr(e){if(!Oh(e))return;let t=e._meta;return Oh(t)?t:void 0}function mi(e){let t=mr(e);return t!==void 0&&yt in t}function hi(e){let t=mr(e)?.[yt];return typeof t=="string"?t:void 0}function fi(e){return Vt(Rn).validateEnvelopeMeta(e)}var FS=hl({AnnotationsSchema:()=>zt,AudioContentSchema:()=>Ur,BaseMetadataSchema:()=>vt,BaseRequestParamsSchema:()=>Ae,BlobResourceContentsSchema:()=>nn,BooleanSchemaSchema:()=>ln,CallToolRequestParamsSchema:()=>fa,CallToolRequestSchema:()=>ga,CallToolResultSchema:()=>un,CancelTaskRequestSchema:()=>uu,CancelTaskResultSchema:()=>lu,CancelledNotificationParamsSchema:()=>Ss,CancelledNotificationSchema:()=>Xo,ClientCapabilitiesSchema:()=>zs,ClientNotificationSchema:()=>pu,ClientRequestSchema:()=>du,ClientResultSchema:()=>mu,ClientTasksCapabilitySchema:()=>ys,CompatibilityCallToolResultSchema:()=>Xc,CompleteRequestParamsSchema:()=>Va,CompleteRequestSchema:()=>Fa,CompleteResultSchema:()=>Ha,ContentBlockSchema:()=>Vr,CreateMessageRequestParamsSchema:()=>Ta,CreateMessageRequestSchema:()=>ka,CreateMessageResultSchema:()=>Ca,CreateMessageResultWithToolsSchema:()=>Ia,CreateTaskResultSchema:()=>tu,CursorSchema:()=>Ho,DiscoverRequestSchema:()=>Ps,DiscoverResultSchema:()=>Ts,ElicitRequestFormParamsSchema:()=>Jr,ElicitRequestParamsSchema:()=>xa,ElicitRequestSchema:()=>Aa,ElicitRequestURLParamsSchema:()=>qa,ElicitResultSchema:()=>Da,ElicitationCompleteNotificationParamsSchema:()=>Ma,ElicitationCompleteNotificationSchema:()=>La,EmbeddedResourceSchema:()=>aa,EmptyResultSchema:()=>Yo,EnumSchemaSchema:()=>ja,GetPromptRequestParamsSchema:()=>oa,GetPromptRequestSchema:()=>na,GetPromptResultSchema:()=>ua,GetTaskPayloadRequestSchema:()=>su,GetTaskPayloadResultSchema:()=>au,GetTaskRequestSchema:()=>ou,GetTaskResultSchema:()=>nu,IconSchema:()=>vs,IconsSchema:()=>At,ImageContentSchema:()=>Zr,ImplementationSchema:()=>Mr,InitializeRequestParamsSchema:()=>Rs,InitializeRequestSchema:()=>$s,InitializeResultSchema:()=>ws,InitializedNotificationSchema:()=>Es,JSONArraySchema:()=>Gc,JSONObjectSchema:()=>Pe,JSONRPCErrorResponseSchema:()=>Ar,JSONRPCMessageSchema:()=>Wo,JSONRPCNotificationSchema:()=>Go,JSONRPCRequestSchema:()=>Ko,JSONRPCResponseSchema:()=>Wc,JSONRPCResultResponseSchema:()=>xr,JSONValueSchema:()=>jt,LegacyTitledEnumSchemaSchema:()=>mn,ListChangedOptionsBaseSchema:()=>Qc,ListPromptsRequestSchema:()=>ta,ListPromptsResultSchema:()=>ra,ListResourceTemplatesRequestSchema:()=>qs,ListResourceTemplatesResultSchema:()=>xs,ListResourcesRequestSchema:()=>Ns,ListResourcesResultSchema:()=>js,ListRootsRequestSchema:()=>Ba,ListRootsResultSchema:()=>Ka,ListTasksRequestSchema:()=>iu,ListTasksResultSchema:()=>cu,ListToolsRequestSchema:()=>ma,ListToolsResultSchema:()=>ha,LoggingLevelSchema:()=>Zt,LoggingMessageNotificationParamsSchema:()=>ya,LoggingMessageNotificationSchema:()=>ba,ModelHintSchema:()=>za,ModelPreferencesSchema:()=>Ra,MultiSelectEnumSchemaSchema:()=>Na,NotificationSchema:()=>Ve,NotificationsParamsSchema:()=>Ue,NumberSchemaSchema:()=>Hr,PaginatedRequestParamsSchema:()=>Is,PaginatedRequestSchema:()=>Mt,PaginatedResultSchema:()=>Lt,PingRequestSchema:()=>en,PrimitiveSchemaDefinitionSchema:()=>gn,ProgressNotificationParamsSchema:()=>Cs,ProgressNotificationSchema:()=>tn,ProgressSchema:()=>ks,ProgressTokenSchema:()=>Fo,PromptArgumentSchema:()=>Qs,PromptListChangedNotificationSchema:()=>la,PromptMessageSchema:()=>ca,PromptReferenceSchema:()=>Ua,PromptSchema:()=>ea,ReadResourceRequestParamsSchema:()=>As,ReadResourceRequestSchema:()=>Ms,ReadResourceResultSchema:()=>Ls,RelatedTaskMetadataSchema:()=>_s,RequestIdSchema:()=>xt,RequestMetaSchema:()=>Jo,RequestSchema:()=>Te,ResourceContentsSchema:()=>rn,ResourceLinkSchema:()=>ia,ResourceListChangedNotificationSchema:()=>Ds,ResourceRequestParamsSchema:()=>Lr,ResourceSchema:()=>sn,ResourceTemplateReferenceSchema:()=>Za,ResourceTemplateSchema:()=>Os,ResourceUpdatedNotificationParamsSchema:()=>Ys,ResourceUpdatedNotificationSchema:()=>Xs,ResultMetaObjectSchema:()=>Bo,ResultSchema:()=>ke,RoleSchema:()=>Dt,RootSchema:()=>Ja,RootsListChangedNotificationSchema:()=>Ga,SamplingContentSchema:()=>Ea,SamplingMessageContentBlockSchema:()=>ar,SamplingMessageSchema:()=>Pa,ServerCapabilitiesSchema:()=>Qo,ServerNotificationSchema:()=>fu,ServerRequestSchema:()=>hu,ServerResultSchema:()=>gu,ServerTasksCapabilitySchema:()=>bs,SetLevelRequestParamsSchema:()=>Sa,SetLevelRequestSchema:()=>va,SingleSelectEnumSchemaSchema:()=>Oa,StringSchemaSchema:()=>Fr,SubscribeRequestParamsSchema:()=>Zs,SubscribeRequestSchema:()=>Us,SubscriptionFilterSchema:()=>an,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Bs,SubscriptionsAcknowledgedNotificationSchema:()=>Ks,SubscriptionsListenRequestParamsSchema:()=>Hs,SubscriptionsListenRequestSchema:()=>Js,SubscriptionsListenResultMetaSchema:()=>Gs,SubscriptionsListenResultSchema:()=>Ws,TaskAugmentedRequestParamsSchema:()=>lr,TaskCreationParamsSchema:()=>eu,TaskMetadataSchema:()=>gs,TaskSchema:()=>Ut,TaskStatusNotificationParamsSchema:()=>Ya,TaskStatusNotificationSchema:()=>ru,TaskStatusSchema:()=>Wa,TextContentSchema:()=>Dr,TextResourceContentsSchema:()=>on,TitledMultiSelectEnumSchemaSchema:()=>fn,TitledSingleSelectEnumSchemaSchema:()=>pn,ToolAnnotationsSchema:()=>da,ToolChoiceSchema:()=>$a,ToolExecutionSchema:()=>pa,ToolListChangedNotificationSchema:()=>_a,ToolResultContentSchema:()=>wa,ToolSchema:()=>cn,ToolUseContentSchema:()=>sa,UnsubscribeRequestParamsSchema:()=>Vs,UnsubscribeRequestSchema:()=>Fs,UntitledMultiSelectEnumSchemaSchema:()=>hn,UntitledSingleSelectEnumSchemaSchema:()=>dn});var rt=e=>Ko.safeParse(e).success,Ht=e=>Go.safeParse(e).success,bn=e=>xr.safeParse(e).success,gi=e=>Ar.safeParse(e).success;var Rt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";function Uu(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Vu(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var Nh="x-mcp-header",HS=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,JS=new Set(["string","integer","boolean","number"]);function Fu(e){let t=[],r=new Map,o=(s,a,i)=>{if(s===null||typeof s!="object")return;let c=s;if(Nh in c){if(!i||a.length===0)return`${ai(a)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let d=c[Nh];if(typeof d!="string"||d.length===0)return`${ai(a)}: x-mcp-header MUST be a non-empty string`;if(!HS.test(d))return`${ai(a)}: x-mcp-header '${d}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let p=typeof c.type=="string"?c.type:void 0;if(p===void 0||!JS.has(p))return`${ai(a)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${p??"<none>"}`;let _=d.toLowerCase(),$=r.get(_);if($!==void 0)return`x-mcp-header '${d}' is not case-insensitively unique (also declared as '${$}')`;r.set(_,d),t.push({path:a,headerName:d,type:p})}let u=c.properties;if(u!==null&&typeof u=="object")for(let[d,p]of Object.entries(u)){let _=o(p,[...a,d],i);if(_!==void 0)return _}for(let d of BS){let p=c[d];if(p===void 0)continue;let _=Array.isArray(p)?p:p!==null&&typeof p=="object"&&KS.has(d)?Object.values(p):[p];for(let $ of _){let S=o($,[...a,`<${d}>`],!1);if(S!==void 0)return S}}},n=o(e,[],!0);return n===void 0?{valid:!0,declarations:t}:{valid:!1,reason:n}}var BS=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],KS=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function ai(e){return e.length===0?"<root>":e.join(".")}var ci=-32020,f0=[{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:[H.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:[ci,H.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:[H.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:[H.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:[H.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:[ci],conformance:["http-header-validation"],rationale:"SEP-2243 standard `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 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. 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:[H.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:[ci],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."}],GS={[H.ParseError]:400,[H.InvalidRequest]:400,[H.MethodNotFound]:404,[H.UnsupportedProtocolVersion]:400,[H.MissingRequiredClientCapability]:400,[ci]:400};function ii(e,t,r,o,n){return{kind:"reject",rung:e,cell:t,httpStatus:r,code:o.code,message:o.message,...o.data!==void 0&&{data:o.data},settled:n}}function Hu(e){if(!mi(e))return!1;let t=hi(e);if(t===void 0||!Wr(t))return!1;let r=mr(e);return r!==void 0&&fi(r).length===0}function Ju(e,t){switch(e.reason){case"http-method":return ii("http-method","modern-only-method-not-allowed",405,new ee(-32e3,"Method not allowed."),!0);case"batch":return ii("jsonrpc-shape","modern-only-batch-not-supported",400,new ee(H.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return ii("jsonrpc-shape","modern-only-response-post",400,new ee(H.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let r=e.requestedVersion;return ii("era-classification","modern-only-missing-envelope",400,r===void 0?new ee(H.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...t]}):new Yr({supported:[...t],requested:r}),!0)}}}function _i(e,t){return us(e,t)}function Sn(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function Gr(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 jh=!1,Cu="draft-2020-12";function Jt(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:Cu});else if(r.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().");jh||(jh=!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.")),o=cs(e,{target:Cu,io:t})}else throw new Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output")return o.type!==void 0?o:sf(o)?{type:"object",...o}:o;if(o.type!==void 0&&o.type!=="object")throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(o.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...o}}function sf(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(let t of["oneOf","anyOf","allOf"]){let r=e[t];if(Array.isArray(r)&&r.length>0)return r.every(o=>o!==null&&typeof o=="object"&&(o.type==="object"||sf(o)))}return!1}function WS(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function dr(e,t){let r=await e["~standard"].validate(t);return r.issues&&r.issues.length>0?{success:!1,error:r.issues.map(o=>WS(o)).join(", ")}:{success:!0,data:r.value}}function YS(e){let t=cs(e,{target:Cu,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var XS=/\\\.\\d\{(\d+)\}/;function QS(e){let t=XS.exec(e),r=[void 0,-1,0];return t&&r.push(Number(t[1])),[!1,!0].flatMap(o=>[!1,!0].flatMap(n=>r.map(s=>lt.datetime({local:o,offset:n,precision:s}))))}function ev(e,t){let r;switch(e){case"email":r=[sh()];break;case"uri":r=[ds()];break;case"date":r=[lt.date()];break;case"date-time":r=QS(t);break}return new Set(r.map(o=>YS(o)).filter(o=>o!==void 0))}function tv(e,t,r){return r!=="zod"?!0:ev(e,t).has(t)}function af(e){let t=Jt(e,"input"),r=t.properties||{},o=t.required||[];return Object.entries(r).map(([n,s])=>({name:n,description:s?.description,required:o.includes(n)}))}function zn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function rv(e){try{return Jt(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new ee(H.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var ov=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function Bu(e){return ov.has(e)||e.startsWith("x-")}var nv=new Set(["$schema",...Object.keys(Jr.shape.requestedSchema.shape)]),qh={string:Sn([Fr,dn,pn,mn]),number:Sn([Hr]),integer:Sn([Hr]),boolean:Sn([ln]),array:Sn([hn,fn])},sv=new Set(Fr.shape.format.unwrap().options);function av(e,t,r,o){if(!zn(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(qh,e.type)?qh[e.type]:void 0;if(n===void 0)return e;let s={};for(let[a,i]of Object.entries(e))n.has(a)||Bu(a)?s[a]=i:a==="pattern"&&e.type==="string"&&typeof e.format=="string"?sv.has(e.format)?(typeof i!="string"||!tv(e.format,i,r))&&o.push(`${t}.${a}`):s[a]=i:o.push(`${t}.${a}`);return s}function iv(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))n==="properties"&&zn(s)?r[n]=Object.fromEntries(Object.entries(s).map(([a,i])=>[a,av(i,`properties.${a}`,t,o)])):nv.has(n)?r[n]=s:Bu(n)||o.push(n);if(o.length>0)throw new ee(H.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function cv(e,t){if(!zn(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!_i(gn,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function Iu(e,t,r=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((o,n)=>Iu(o,t[n],`${r}[${n}]`)):!zn(e)||!zn(t)?[]:Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;return Object.prototype.hasOwnProperty.call(t,o)?Iu(n,t[o],s):Bu(o)?[]:[s]})}function uv(e){if(!Gr(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=iv(rv(e.requestedSchema),t),o=_i(Jr.shape.requestedSchema,r);if(!o.success)throw new ee(H.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${cv(r,o.error.message)}`);let n=Iu(r,o.data);if(n.length>0)throw new ee(H.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(o.data.required??[]).filter(a=>!Object.prototype.hasOwnProperty.call(o.data.properties,a));if(s.length>0)throw new ee(H.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function lv(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState=="string";if(!t&&!r)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 dv=Object.assign(lv,{elicit(e){try{return{method:"elicitation/create",params:uv(e)}}catch(t){throw t instanceof ee?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 cf=250;function uf(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function lf(e,t){return new Promise((r,o)=>{if(t?.aborted){o(t.reason instanceof ce?t.reason:new ce(me.RequestTimeout,String(t.reason)));return}let n=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e),s=()=>{clearTimeout(n),o(t?.reason instanceof ce?t.reason:new ce(me.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function df(e){let t=new AbortController,r=()=>t.abort(e?.reason);return e?.addEventListener("abort",r,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:o=>t.abort(o),dispose:()=>e?.removeEventListener("abort",r)}}var pv=["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"],mv={IdJagTokenExchangeResponseSchema:yu,OAuthClientInformationFullSchema:zu,OAuthClientInformationSchema:ti,OAuthClientMetadataSchema:ei,OAuthClientRegistrationErrorSchema:Ru,OAuthErrorResponseSchema:bu,OAuthMetadataSchema:Xa,OAuthProtectedResourceMetadataSchema:_u,OAuthTokenRevocationRequestSchema:$u,OAuthTokensSchema:vu,OpenIdProviderDiscoveryMetadataSchema:Su,OpenIdProviderMetadataSchema:Qa},pf={},mf={};function hf(e,t){let r=e.slice(0,-6);pf[r]=t,mf[r]=o=>t.safeParse(o).success}for(let e of pv)hf(e,FS[e]);for(let[e,t]of Object.entries(mv))hf(e,t);var hv=Object.freeze(pf),fv=Object.freeze(mf);function gv(e){switch(e){case"initialize":case"notifications/initialized":return Vt(void 0);case"server/discover":return Vt(Rn);default:return}}var ff=6e4,_v=[yt,qr,bt,qt],Sv=["inputResponses","requestState"];function xh(e,t){let r=e.params;if(!yn(r))return{message:e,lifted:{}};let o=r._meta,n=yn(o)?_v.filter(c=>c in o):[],s=t==="request"?Sv.filter(c=>c in r):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let a={},i={...r};if(n.length>0&&yn(o)){let c={},u={...o};for(let d of n)c[d]=o[d],delete u[d];a.envelope=c,Object.keys(u).length>0?i._meta=u:delete i._meta}for(let c of s)c==="inputResponses"&&(a.inputResponses=i[c]),c==="requestState"&&(a.requestState=i[c]),delete i[c];return{message:{...e,params:i},lifted:a}}function Ah(e,t){let r=e.validateResult(t,void 0);if(!(!r.ok&&r.reason==="not-in-era"))return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let n=e.validateResult(t,o);return n.ok?{value:n.value}:{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function $n(e){return()=>e}var vv=$n(void 0);function Ku(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:$n(t)}}}var gf;function Gu(e,t){gf(e,t)}var Wu=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{gf=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??hs,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 r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new ce(me.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&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,o,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:o})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new ce(me.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});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 r=this.transport?.onerror;this._transport.onerror=n=>{r?.(n),this._onerror(n)};let o=this._transport?.onmessage;this._transport.onmessage=(n,s)=>{o?.(n,s),bn(n)||gi(n)?this._onresponse(n):rt(n)?this._onrequest(n,s):Ht(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 o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new ce(me.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let o of e.values())o(r);for(let o of t.values())o.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=xh(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let a=Ih(t.classification);if(a!==o.era){this._onerror(new Error(`Era mismatch on inbound notification '${r.method}': classified as ${a} but this instance serves ${o.era}`));return}}if(Pu(r.method)&&!o.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;n===void 0&&s===void 0||Promise.resolve().then(()=>n===void 0?s(r):n(r,o)).catch(a=>this._onerror(new Error(`Uncaught error in notification handler: ${a}`)))}_onrequest(e,t){let{message:r,lifted:o}=xh(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,a=(b,f,m)=>{let z={jsonrpc:"2.0",id:r.id,error:{code:b,message:f,...m!==void 0&&{data:m}}};s?.send(z).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)))};if(t?.classification!==void 0){let b=Ih(t.classification);if(b!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${r.method}': classified as ${b} but this instance serves ${n.era}`));let f=t.classification.revision??b;a(H.UnsupportedProtocolVersion,`Unsupported protocol version: ${f}`,{supported:this._supportedProtocolVersions,requested:f});return}}if(Eu(r.method)&&!n.hasRequestMethod(r.method)){a(H.MethodNotFound,"Method not found");return}let i=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(i===void 0){a(H.MethodNotFound,"Method not found");return}let c=n.checkInboundEnvelope(o);if(c!==void 0){a(H.InvalidParams,c);return}let u=(b,f)=>this._notificationViaCodec(this._resolveOutboundCodec(b.method),b,{...f,relatedRequestId:r.id}),d=(b,f,m)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(b.method),b,f,{...m,relatedRequestId:r.id}),p=new AbortController;this._requestHandlerAbortControllers.set(r.id,p);let _=o.inputResponses===void 0?void 0:yv(o.inputResponses),$={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},..._!==void 0&&{inputResponses:_.accepted},..._!==void 0&&_.droppedKeys.length>0&&{droppedInputResponseKeys:_.droppedKeys},requestState:o.requestState===void 0?vv:$n(o.requestState),signal:p.signal,send:(b,f,m)=>{let z=this._resolveOutboundCodec(b.method);if(this._assertOutboundRequestInEra(z,b.method),Gr(f))return d(b,f,m);let h=Ah(z,b.method);if(h===void 0)throw new TypeError(`'${b.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return d(b,h,f)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},S=this.buildContext($,t);Promise.resolve().then(()=>i(r,S)).then(async b=>{if(p.signal.aborted)return;let f;try{f=n.encodeResult(r.method,b,this._outboundServerInfo())}catch(z){this._onerror(new Error(`Failed to encode result for ${r.method}: ${z}`)),a(H.InternalError,"Internal error");return}let m={result:f,jsonrpc:"2.0",id:r.id};await s?.send(m)},async b=>{if(p.signal.aborted)return;let f=Number.isSafeInteger(b.code)?b.code:H.InternalError,m={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(f),message:b.message??"Internal error",...b.data!==void 0&&{data:b.data}}};await s?.send(m)}).catch(b=>this._onerror(new Error(`Failed to send response: ${b}`))).finally(()=>{this._requestHandlerAbortControllers.get(r.id)===p&&this._requestHandlerAbortControllers.delete(r.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,o=Number(t),n=this._progressHandlers.get(o);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(i){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(i);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===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),bn(e)?r(e):r(ee.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,r){let o=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(o,e.method),Gr(t))return this._requestWithSchemaViaCodec(o,e,t,r);let n=Ah(o,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(o,e,n,t)}_negotiatedWireCodec(){return Vt(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=gv(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Eu(t)&&!e.hasRequestMethod(t))throw new ce(me.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r)}_requestWithSchemaViaCodec(e,t,r,o){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:a,headers:i}=o??{},c=Date.now(),u,d;return new Promise((p,_)=>{let $=y=>{_(y)};if(!this._transport){$(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(y){$(y);return}if(o?.signal?.aborted){let y=o.signal.reason;throw y instanceof ce?y:new ce(me.RequestTimeout,String(y))}let S=e.era===Rn&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,b=this._requestMessageId++;d=b;let f={...t,jsonrpc:"2.0",id:b};o?.onprogress&&(this._progressHandlers.set(b,o.onprogress),f.params={...t.params,_meta:{...t.params?._meta,progressToken:b}});let m=this._envelopeOutbound(f),z=!1,h=y=>{z||(this._progressHandlers.delete(b),S===void 0?this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:b,reason:String(y)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:a}).catch(g=>this._onerror(new Error(`Failed to send cancellation: ${g}`))):S.abort(),_(y instanceof ce?y:new ce(me.RequestTimeout,String(y))))};this._responseHandlers.set(b,y=>{if(o?.signal?.aborted)return;if(z=!0,y instanceof Error)return _(y);let g;try{g=e.decodeResult(t.method,y.result)}catch(I){return _(I instanceof Error?I:new Error(String(I)))}if(g.kind==="invalid")return _(g.error);if(g.kind==="input_required"){if(o?.allowInputRequired===!0)return p(bv(g));let I={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:c,retry:(L,N)=>this._requestWithSchemaViaCodec(e,L===void 0?{method:t.method}:{method:t.method,params:L},r,N)};return p(this._resolveNonCompleteResult(g,I))}let R=g.result;dr(r,R).then(I=>{I.success?p(I.data):_(new ce(me.InvalidResult,`Invalid result for ${t.method}: ${I.error}`))},_)}),u=()=>h(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let v=o?.timeout??ff,E=()=>h(new ce(me.RequestTimeout,"Request timed out",{timeout:v}));this._setupTimeout(b,v,o?.maxTotalTimeout,E,o?.resetTimeoutOnProgress??!1),this._transport.send(m,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:a,headers:i,requestSignal:S?.signal}).catch(y=>{this._progressHandlers.delete(b),_(y)})}).finally(()=>{u&&o?.signal?.removeEventListener("abort",u),d!==void 0&&(this._responseHandlers.delete(d),this._cleanupTimeout(d))})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new ce(me.NotConnected,"Not connected");if(Pu(t.method)&&!e.hasNotificationMethod(t.method))throw new ce(me.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 o=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId){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(o,r).catch(n=>this._onerror(n))});return}await this._transport.send(o,r)}setRequestHandler(e,t,r){this.assertRequestHandlerCapability(e);let o;if(typeof t=="function"){if(!Eu(e))throw new TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(n,s)=>{let a=this._negotiatedWireCodec(),i=a.validateRequest(e,n);if(!i.ok&&i.reason==="not-in-era"&&(i=a.validateInputRequest(e,n)),!i.ok)throw i.reason==="not-in-era"?new ee(H.InternalError,`No wire schema for ${e} in the resolved era`):new Error(i.message);return Promise.resolve(t(i.value,s))}}else if(r)o=async(n,s)=>{let a=await dr(t.params,{...n.params});if(!a.success)throw new ee(H.InvalidParams,`Invalid params for ${e}: ${a.error}`);return r(a.data,s)};else throw new TypeError("setRequestHandler: handler is required");this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.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,r){if(typeof t=="function"){if(!Pu(e))throw new TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(o,n)=>{let s=n.validateNotification(e,o);if(!s.ok)throw s.reason==="not-in-era"?new ee(H.InternalError,`No wire schema for ${e} in the resolved era`):new Error(s.message);return Promise.resolve(t(s.value))});return}if(!r)throw new TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async o=>{let n=await dr(t.params,{...o.params});if(!n.success)throw new ee(H.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function yn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Yu(e,t){let r={...e};for(let o in t){let n=o,s=t[n];if(s===void 0)continue;let a=r[n];r[n]=yn(a)&&yn(s)?{...a,...s}:s}return r}function Mh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function yv(e){let t={},r=[];if(!Mh(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!Mh(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function bv(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}var zv=U(e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(i){if(!i)throw new TypeError("argument string is required");var c=typeof i=="object"?s(i):i;if(typeof c!="string")throw new TypeError("argument string is required to be a string");var u=c.indexOf(";"),d=u!==-1?c.slice(0,u).trim():c.trim();if(!o.test(d))throw new TypeError("invalid media type");var p=new a(d.toLowerCase());if(u!==-1){var _,$,S;for(t.lastIndex=u;$=t.exec(c);){if($.index!==u)throw new TypeError("invalid parameter format");u+=$[0].length,_=$[1].toLowerCase(),S=$[2],S.charCodeAt(0)===34&&(S=S.slice(1,-1),S.indexOf("\\")!==-1&&(S=S.replace(r,"$1"))),p.parameters[_]=S}if(u!==c.length)throw new TypeError("invalid parameter format")}return p}function s(i){var c;if(typeof i.getHeader=="function"?c=i.getHeader("content-type"):typeof i.headers=="object"&&(c=i.headers&&i.headers["content-type"]),typeof c!="string")throw new TypeError("content-type header is missing from object");return c}function a(i){this.parameters=Object.create(null),this.type=i}}),g0=Bn(zv(),1);var _f=10*1024*1024,Xu=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??_f}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){for(;this._buffer;){let e=this._buffer.indexOf(`
65
+ `);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");this._buffer=this._buffer.subarray(e+1);try{return Sf(t)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0}};function Sf(e){return Wo.parse(JSON.parse(e))}function Qu(e){return JSON.stringify(e)+`
66
+ `}var Rv=/^[A-Za-z0-9._-]{1,128}$/;function $v(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!Rv.test(e)){let r=[...e].filter(o=>!/[A-Za-z0-9._-]/.test(o)).filter((o,n,s)=>s.indexOf(o)===n);return t.push(`Tool name contains invalid characters: ${r.map(o=>`"${o}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function wv(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function el(e){let t=$v(e);return wv(e,t.warnings),t.isValid}function Ev(e){return typeof e=="object"&&e!==null&&"_zod"in e}function Pv(e){return typeof e=="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName=="string"}function Tv(e){if(typeof e!="object"||e===null||Gr(e))return!1;let t=Object.getPrototypeOf(e);return t!==Object.prototype&&t!==null?!1:Object.values(e).every(r=>Ev(r))}function Si(e){if(e!==void 0){if(Tv(e))return P(e);if(typeof e=="object"&&e!==null&&!Gr(e)&&Object.values(e).some(t=>Pv(t)))throw new TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!Gr(e))throw new TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return e}}var yi=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends t{constructor(m){if(super(),!e.IDENTIFIER.test(m))throw new Error("CodeGen: name must be a valid identifier");this.str=m}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(m){super(),this._items=typeof m=="string"?[m]:m}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let m=this._items[0];return m===""||m==='""'}get str(){var m;return(m=this._str)!==null&&m!==void 0?m:this._str=this._items.reduce((z,h)=>`${z}${h}`,"")}get names(){var m;return(m=this._names)!==null&&m!==void 0?m:this._names=this._items.reduce((z,h)=>(h instanceof r&&(z[h.str]=(z[h.str]||0)+1),z),{})}};e._Code=o,e.nil=new o("");function n(m,...z){let h=[m[0]],v=0;for(;v<z.length;)i(h,z[v]),h.push(m[++v]);return new o(h)}e._=n;let s=new o("+");function a(m,...z){let h=[$(m[0])],v=0;for(;v<z.length;)h.push(s),i(h,z[v]),h.push(s,$(m[++v]));return c(h),new o(h)}e.str=a;function i(m,z){z instanceof o?m.push(...z._items):z instanceof r?m.push(z):m.push(p(z))}e.addCodeArg=i;function c(m){let z=1;for(;z<m.length-1;){if(m[z]===s){let h=u(m[z-1],m[z+1]);if(h!==void 0){m.splice(z-1,3,h);continue}m[z++]="+"}z++}}function u(m,z){if(z==='""')return m;if(m==='""')return z;if(typeof m=="string")return z instanceof r||m[m.length-1]!=='"'?void 0:typeof z!="string"?`${m.slice(0,-1)}${z}"`:z[0]==='"'?m.slice(0,-1)+z.slice(1):void 0;if(typeof z=="string"&&z[0]==='"'&&!(m instanceof r))return`"${m}${z.slice(1)}`}function d(m,z){return z.emptyStr()?m:m.emptyStr()?z:a`${m}${z}`}e.strConcat=d;function p(m){return typeof m=="number"||typeof m=="boolean"||m===null?m:$(Array.isArray(m)?m.join(","):m)}function _(m){return new o($(m))}e.stringify=_;function $(m){return JSON.stringify(m).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=$;function S(m){return typeof m=="string"&&e.IDENTIFIER.test(m)?new o(`.${m}`):n`[${m}]`}e.getProperty=S;function b(m){if(typeof m=="string"&&e.IDENTIFIER.test(m))return new o(`${m}`);throw new Error(`CodeGen: invalid export name: ${m}, use explicit $id name mapping`)}e.getEsmExportName=b;function f(m){return new o(m.toString())}e.regexpCode=f}),vf=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=yi();var r=class extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`),this.value=c.value}},o;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};var n=class{constructor({prefixes:c,parent:u}={}){this._names={},this._prefixes=c,this._parent=u}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){let u=this._names[c]||this._nameGroup(c);return`${c}${u.index++}`}_nameGroup(c){var u,d;if(!((d=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||d===void 0)&&d.has(c)||this._prefixes&&!this._prefixes.has(c))throw new Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}};e.Scope=n;var s=class extends t.Name{constructor(c,u){super(u),this.prefix=c}setValue(c,{property:u,itemIndex:d}){this.value=c,this.scopePath=(0,t._)`.${new t.Name(u)}[${d}]`}};e.ValueScopeName=s;let a=(0,t._)`\n`;var i=class extends n{constructor(c){super(c),this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?a:t.nil}}get(){return this._scope}name(c){return new s(c,this._newName(c))}value(c,u){var d;if(u.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let p=this.toName(c),{prefix:_}=p,$=(d=u.key)!==null&&d!==void 0?d:u.ref,S=this._values[_];if(S){let m=S.get($);if(m)return m}else S=this._values[_]=new Map;S.set($,p);let b=this._scope[_]||(this._scope[_]=[]),f=b.length;return b[f]=u.ref,p.setValue(u,{property:_,itemIndex:f}),p}getValue(c,u){let d=this._values[c];if(d)return d.get(u)}scopeRefs(c,u=this._values){return this._reduceValues(u,d=>{if(d.scopePath===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return(0,t._)`${c}${d.scopePath}`})}scopeCode(c=this._values,u,d){return this._reduceValues(c,p=>{if(p.value===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return p.value.code},u,d)}_reduceValues(c,u,d={},p){let _=t.nil;for(let $ in c){let S=c[$];if(!S)continue;let b=d[$]=d[$]||new Map;S.forEach(f=>{if(b.has(f))return;b.set(f,o.Started);let m=u(f);if(m){let z=this.opts.es5?e.varKinds.var:e.varKinds.const;_=(0,t._)`${_}${z} ${f} = ${m};${this.opts._n}`}else if(m=p?.(f))_=(0,t._)`${_}${m}${this.opts._n}`;else throw new r(f);b.set(f,o.Completed)})}return _}};e.ValueScope=i}),ue=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=yi(),r=vf();var o=yi();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var n=vf();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var s=class{optimizeNodes(){return this}optimizeNames(w,k){return this}},a=class extends s{constructor(w,k,q){super(),this.varKind=w,this.name=k,this.rhs=q}render({es5:w,_n:k}){let q=w?r.varKinds.var:this.varKind,J=this.rhs===void 0?"":` = ${this.rhs}`;return`${q} ${this.name}${J};`+k}optimizeNames(w,k){if(w[this.name.str])return this.rhs&&(this.rhs=G(this.rhs,w,k)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},i=class extends s{constructor(w,k,q){super(),this.lhs=w,this.rhs=k,this.sideEffects=q}render({_n:w}){return`${this.lhs} = ${this.rhs};`+w}optimizeNames(w,k){if(!(this.lhs instanceof t.Name&&!w[this.lhs.str]&&!this.sideEffects))return this.rhs=G(this.rhs,w,k),this}get names(){return B(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends i{constructor(w,k,q,J){super(w,q,J),this.op=k}render({_n:w}){return`${this.lhs} ${this.op}= ${this.rhs};`+w}},u=class extends s{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`${this.label}:`+w}},d=class extends s{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`break${this.label?` ${this.label}`:""};`+w}},p=class extends s{constructor(w){super(),this.error=w}render({_n:w}){return`throw ${this.error};`+w}get names(){return this.error.names}},_=class extends s{constructor(w){super(),this.code=w}render({_n:w}){return`${this.code};`+w}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(w,k){return this.code=G(this.code,w,k),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},$=class extends s{constructor(w=[]){super(),this.nodes=w}render(w){return this.nodes.reduce((k,q)=>k+q.render(w),"")}optimizeNodes(){let{nodes:w}=this,k=w.length;for(;k--;){let q=w[k].optimizeNodes();Array.isArray(q)?w.splice(k,1,...q):q?w[k]=q:w.splice(k,1)}return w.length>0?this:void 0}optimizeNames(w,k){let{nodes:q}=this,J=q.length;for(;J--;){let te=q[J];te.optimizeNames(w,k)||(pe(w,te.names),q.splice(J,1))}return q.length>0?this:void 0}get names(){return this.nodes.reduce((w,k)=>D(w,k.names),{})}},S=class extends ${render(w){return"{"+w._n+super.render(w)+"}"+w._n}},b=class extends ${},f=class extends S{};f.kind="else";var m=class vi extends S{constructor(k,q){super(q),this.condition=k}render(k){let q=`if(${this.condition})`+super.render(k);return this.else&&(q+="else "+this.else.render(k)),q}optimizeNodes(){super.optimizeNodes();let k=this.condition;if(k===!0)return this.nodes;let q=this.else;if(q){let J=q.optimizeNodes();q=this.else=Array.isArray(J)?new f(J):J}if(q)return k===!1?q instanceof vi?q:q.nodes:this.nodes.length?this:new vi($e(k),q instanceof vi?[q]:q.nodes);if(!(k===!1||!this.nodes.length))return this}optimizeNames(k,q){var J;if(this.else=(J=this.else)===null||J===void 0?void 0:J.optimizeNames(k,q),!!(super.optimizeNames(k,q)||this.else))return this.condition=G(this.condition,k,q),this}get names(){let k=super.names;return B(k,this.condition),this.else&&D(k,this.else.names),k}};m.kind="if";var z=class extends S{};z.kind="for";var h=class extends z{constructor(w){super(),this.iteration=w}render(w){return`for(${this.iteration})`+super.render(w)}optimizeNames(w,k){if(super.optimizeNames(w,k))return this.iteration=G(this.iteration,w,k),this}get names(){return D(super.names,this.iteration.names)}},v=class extends z{constructor(w,k,q,J){super(),this.varKind=w,this.name=k,this.from=q,this.to=J}render(w){let k=w.es5?r.varKinds.var:this.varKind,{name:q,from:J,to:te}=this;return`for(${k} ${q}=${J}; ${q}<${te}; ${q}++)`+super.render(w)}get names(){return B(B(super.names,this.from),this.to)}},E=class extends z{constructor(w,k,q,J){super(),this.loop=w,this.varKind=k,this.name=q,this.iterable=J}render(w){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(w)}optimizeNames(w,k){if(super.optimizeNames(w,k))return this.iterable=G(this.iterable,w,k),this}get names(){return D(super.names,this.iterable.names)}},y=class extends S{constructor(w,k,q){super(),this.name=w,this.args=k,this.async=q}render(w){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(w)}};y.kind="func";var g=class extends ${render(w){return"return "+super.render(w)}};g.kind="return";var R=class extends S{render(w){let k="try"+super.render(w);return this.catch&&(k+=this.catch.render(w)),this.finally&&(k+=this.finally.render(w)),k}optimizeNodes(){var w,k;return super.optimizeNodes(),(w=this.catch)===null||w===void 0||w.optimizeNodes(),(k=this.finally)===null||k===void 0||k.optimizeNodes(),this}optimizeNames(w,k){var q,J;return super.optimizeNames(w,k),(q=this.catch)===null||q===void 0||q.optimizeNames(w,k),(J=this.finally)===null||J===void 0||J.optimizeNames(w,k),this}get names(){let w=super.names;return this.catch&&D(w,this.catch.names),this.finally&&D(w,this.finally.names),w}},I=class extends S{constructor(w){super(),this.error=w}render(w){return`catch(${this.error})`+super.render(w)}};I.kind="catch";var L=class extends S{render(w){return"finally"+super.render(w)}};L.kind="finally";var N=class{constructor(w,k={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...k,_n:k.lines?`
67
+ `:""},this._extScope=w,this._scope=new r.Scope({parent:w}),this._nodes=[new b]}toString(){return this._root.render(this.opts)}name(w){return this._scope.name(w)}scopeName(w){return this._extScope.name(w)}scopeValue(w,k){let q=this._extScope.value(w,k);return(this._values[q.prefix]||(this._values[q.prefix]=new Set)).add(q),q}getScopeValue(w,k){return this._extScope.getValue(w,k)}scopeRefs(w){return this._extScope.scopeRefs(w,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(w,k,q,J){let te=this._scope.toName(k);return q!==void 0&&J&&(this._constants[te.str]=q),this._leafNode(new a(w,te,q)),te}const(w,k,q){return this._def(r.varKinds.const,w,k,q)}let(w,k,q){return this._def(r.varKinds.let,w,k,q)}var(w,k,q){return this._def(r.varKinds.var,w,k,q)}assign(w,k,q){return this._leafNode(new i(w,k,q))}add(w,k){return this._leafNode(new c(w,e.operators.ADD,k))}code(w){return typeof w=="function"?w():w!==t.nil&&this._leafNode(new _(w)),this}object(...w){let k=["{"];for(let[q,J]of w)k.length>1&&k.push(","),k.push(q),(q!==J||this.opts.es5)&&(k.push(":"),(0,t.addCodeArg)(k,J));return k.push("}"),new t._Code(k)}if(w,k,q){if(this._blockNode(new m(w)),k&&q)this.code(k).else().code(q).endIf();else if(k)this.code(k).endIf();else if(q)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(w){return this._elseNode(new m(w))}else(){return this._elseNode(new f)}endIf(){return this._endBlockNode(m,f)}_for(w,k){return this._blockNode(w),k&&this.code(k).endFor(),this}for(w,k){return this._for(new h(w),k)}forRange(w,k,q,J,te=this.opts.es5?r.varKinds.var:r.varKinds.let){let de=this._scope.toName(w);return this._for(new v(te,de,k,q),()=>J(de))}forOf(w,k,q,J=r.varKinds.const){let te=this._scope.toName(w);if(this.opts.es5){let de=k instanceof t.Name?k:this.var("_arr",k);return this.forRange("_i",0,(0,t._)`${de}.length`,ae=>{this.var(te,(0,t._)`${de}[${ae}]`),q(te)})}return this._for(new E("of",J,te,k),()=>q(te))}forIn(w,k,q,J=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(w,(0,t._)`Object.keys(${k})`,q);let te=this._scope.toName(w);return this._for(new E("in",J,te,k),()=>q(te))}endFor(){return this._endBlockNode(z)}label(w){return this._leafNode(new u(w))}break(w){return this._leafNode(new d(w))}return(w){let k=new g;if(this._blockNode(k),this.code(w),k.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(g)}try(w,k,q){if(!k&&!q)throw new Error('CodeGen: "try" without "catch" and "finally"');let J=new R;if(this._blockNode(J),this.code(w),k){let te=this.name("e");this._currNode=J.catch=new I(te),k(te)}return q&&(this._currNode=J.finally=new L,this.code(q)),this._endBlockNode(I,L)}throw(w){return this._leafNode(new p(w))}block(w,k){return this._blockStarts.push(this._nodes.length),w&&this.code(w).endBlock(k),this}endBlock(w){let k=this._blockStarts.pop();if(k===void 0)throw new Error("CodeGen: not in self-balancing block");let q=this._nodes.length-k;if(q<0||w!==void 0&&q!==w)throw new Error(`CodeGen: wrong number of nodes: ${q} vs ${w} expected`);return this._nodes.length=k,this}func(w,k=t.nil,q,J){return this._blockNode(new y(w,k,q)),J&&this.code(J).endFunc(),this}endFunc(){return this._endBlockNode(y)}optimize(w=1){for(;w-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(w){return this._currNode.nodes.push(w),this}_blockNode(w){this._currNode.nodes.push(w),this._nodes.push(w)}_endBlockNode(w,k){let q=this._currNode;if(q instanceof w||k&&q instanceof k)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${k?`${w.kind}/${k.kind}`:w.kind}"`)}_elseNode(w){let k=this._currNode;if(!(k instanceof m))throw new Error('CodeGen: "else" without "if"');return this._currNode=k.else=w,this}get _root(){return this._nodes[0]}get _currNode(){let w=this._nodes;return w[w.length-1]}set _currNode(w){let k=this._nodes;k[k.length-1]=w}};e.CodeGen=N;function D(w,k){for(let q in k)w[q]=(w[q]||0)+(k[q]||0);return w}function B(w,k){return k instanceof t._CodeOrName?D(w,k.names):w}function G(w,k,q){if(w instanceof t.Name)return J(w);if(!te(w))return w;return new t._Code(w._items.reduce((de,ae)=>(ae instanceof t.Name&&(ae=J(ae)),ae instanceof t._Code?de.push(...ae._items):de.push(ae),de),[]));function J(de){let ae=q[de.str];return ae===void 0||k[de.str]!==1?de:(delete k[de.str],ae)}function te(de){return de instanceof t._Code&&de._items.some(ae=>ae instanceof t.Name&&k[ae.str]===1&&q[ae.str]!==void 0)}}function pe(w,k){for(let q in k)w[q]=(w[q]||0)-(k[q]||0)}function $e(w){return typeof w=="boolean"||typeof w=="number"||w===null?!w:(0,t._)`!${V(w)}`}e.not=$e;let be=x(e.operators.AND);function Oe(...w){return w.reduce(be)}e.and=Oe;let he=x(e.operators.OR);function C(...w){return w.reduce(he)}e.or=C;function x(w){return(k,q)=>k===t.nil?q:q===t.nil?k:(0,t._)`${V(k)} ${w} ${V(q)}`}function V(w){return w instanceof t.Name?w:(0,t._)`(${w})`}}),fe=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let t=ue(),r=yi();function o(y){let g={};for(let R of y)g[R]=!0;return g}e.toHash=o;function n(y,g){return typeof g=="boolean"?g:Object.keys(g).length===0?!0:(s(y,g),!a(g,y.self.RULES.all))}e.alwaysValidSchema=n;function s(y,g=y.schema){let{opts:R,self:I}=y;if(!R.strictSchema||typeof g=="boolean")return;let L=I.RULES.keywords;for(let N in g)L[N]||E(y,`unknown keyword: "${N}"`)}e.checkUnknownRules=s;function a(y,g){if(typeof y=="boolean")return!y;for(let R in y)if(g[R])return!0;return!1}e.schemaHasRules=a;function i(y,g){if(typeof y=="boolean")return!y;for(let R in y)if(R!=="$ref"&&g.all[R])return!0;return!1}e.schemaHasRulesButRef=i;function c({topSchemaRef:y,schemaPath:g},R,I,L){if(!L){if(typeof R=="number"||typeof R=="boolean")return R;if(typeof R=="string")return(0,t._)`${R}`}return(0,t._)`${y}${g}${(0,t.getProperty)(I)}`}e.schemaRefOrVal=c;function u(y){return _(decodeURIComponent(y))}e.unescapeFragment=u;function d(y){return encodeURIComponent(p(y))}e.escapeFragment=d;function p(y){return typeof y=="number"?`${y}`:y.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=p;function _(y){return y.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=_;function $(y,g){if(Array.isArray(y))for(let R of y)g(R);else g(y)}e.eachItem=$;function S({mergeNames:y,mergeToName:g,mergeValues:R,resultToName:I}){return(L,N,D,B)=>{let G=D===void 0?N:D instanceof t.Name?(N instanceof t.Name?y(L,N,D):g(L,N,D),D):N instanceof t.Name?(g(L,D,N),N):R(N,D);return B===t.Name&&!(G instanceof t.Name)?I(L,G):G}}e.mergeEvaluated={props:S({mergeNames:(y,g,R)=>y.if((0,t._)`${R} !== true && ${g} !== undefined`,()=>{y.if((0,t._)`${g} === true`,()=>y.assign(R,!0),()=>y.assign(R,(0,t._)`${R} || {}`).code((0,t._)`Object.assign(${R}, ${g})`))}),mergeToName:(y,g,R)=>y.if((0,t._)`${R} !== true`,()=>{g===!0?y.assign(R,!0):(y.assign(R,(0,t._)`${R} || {}`),f(y,R,g))}),mergeValues:(y,g)=>y===!0?!0:{...y,...g},resultToName:b}),items:S({mergeNames:(y,g,R)=>y.if((0,t._)`${R} !== true && ${g} !== undefined`,()=>y.assign(R,(0,t._)`${g} === true ? true : ${R} > ${g} ? ${R} : ${g}`)),mergeToName:(y,g,R)=>y.if((0,t._)`${R} !== true`,()=>y.assign(R,g===!0?!0:(0,t._)`${R} > ${g} ? ${R} : ${g}`)),mergeValues:(y,g)=>y===!0?!0:Math.max(y,g),resultToName:(y,g)=>y.var("items",g)})};function b(y,g){if(g===!0)return y.var("props",!0);let R=y.var("props",(0,t._)`{}`);return g!==void 0&&f(y,R,g),R}e.evaluatedPropsToName=b;function f(y,g,R){Object.keys(R).forEach(I=>y.assign((0,t._)`${g}${(0,t.getProperty)(I)}`,!0))}e.setEvaluated=f;let m={};function z(y,g){return y.scopeValue("func",{ref:g,code:m[g.code]||(m[g.code]=new r._Code(g.code))})}e.useFunc=z;var h;(function(y){y[y.Num=0]="Num",y[y.Str=1]="Str"})(h||(e.Type=h={}));function v(y,g,R){if(y instanceof t.Name){let I=g===h.Num;return R?I?(0,t._)`"[" + ${y} + "]"`:(0,t._)`"['" + ${y} + "']"`:I?(0,t._)`"/" + ${y}`:(0,t._)`"/" + ${y}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return R?(0,t.getProperty)(y).toString():"/"+p(y)}e.getErrorPath=v;function E(y,g,R=y.opts.strictSchema){if(R){if(g=`strict mode: ${g}`,R===!0)throw new Error(g);y.self.logger.warn(g)}}e.checkStrictMode=E}),at=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};e.default=r}),zi=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=ue(),r=fe(),o=at();e.keywordError={message:({keyword:f})=>(0,t.str)`must pass "${f}" keyword validation`},e.keyword$DataError={message:({keyword:f,schemaType:m})=>m?(0,t.str)`"${f}" keyword must be ${m} ($data)`:(0,t.str)`"${f}" keyword is invalid ($data)`};function n(f,m=e.keywordError,z,h){let{it:v}=f,{gen:E,compositeRule:y,allErrors:g}=v,R=p(f,m,z);h??(y||g)?c(E,R):u(v,(0,t._)`[${R}]`)}e.reportError=n;function s(f,m=e.keywordError,z){let{it:h}=f,{gen:v,compositeRule:E,allErrors:y}=h;c(v,p(f,m,z)),E||y||u(h,o.default.vErrors)}e.reportExtraError=s;function a(f,m){f.assign(o.default.errors,m),f.if((0,t._)`${o.default.vErrors} !== null`,()=>f.if(m,()=>f.assign((0,t._)`${o.default.vErrors}.length`,m),()=>f.assign(o.default.vErrors,null)))}e.resetErrorsCount=a;function i({gen:f,keyword:m,schemaValue:z,data:h,errsCount:v,it:E}){if(v===void 0)throw new Error("ajv implementation error");let y=f.name("err");f.forRange("i",v,o.default.errors,g=>{f.const(y,(0,t._)`${o.default.vErrors}[${g}]`),f.if((0,t._)`${y}.instancePath === undefined`,()=>f.assign((0,t._)`${y}.instancePath`,(0,t.strConcat)(o.default.instancePath,E.errorPath))),f.assign((0,t._)`${y}.schemaPath`,(0,t.str)`${E.errSchemaPath}/${m}`),E.opts.verbose&&(f.assign((0,t._)`${y}.schema`,z),f.assign((0,t._)`${y}.data`,h))})}e.extendErrors=i;function c(f,m){let z=f.const("err",m);f.if((0,t._)`${o.default.vErrors} === null`,()=>f.assign(o.default.vErrors,(0,t._)`[${z}]`),(0,t._)`${o.default.vErrors}.push(${z})`),f.code((0,t._)`${o.default.errors}++`)}function u(f,m){let{gen:z,validateName:h,schemaEnv:v}=f;v.$async?z.throw((0,t._)`new ${f.ValidationError}(${m})`):(z.assign((0,t._)`${h}.errors`,m),z.return(!1))}let d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function p(f,m,z){let{createErrors:h}=f.it;return h===!1?(0,t._)`{}`:_(f,m,z)}function _(f,m,z={}){let{gen:h,it:v}=f,E=[$(v,z),S(f,z)];return b(f,m,E),h.object(...E)}function $({errorPath:f},{instancePath:m}){let z=m?(0,t.str)`${f}${(0,r.getErrorPath)(m,r.Type.Str)}`:f;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,z)]}function S({keyword:f,it:{errSchemaPath:m}},{schemaPath:z,parentSchema:h}){let v=h?m:(0,t.str)`${m}/${f}`;return z&&(v=(0,t.str)`${v}${(0,r.getErrorPath)(z,r.Type.Str)}`),[d.schemaPath,v]}function b(f,{params:m,message:z},h){let{keyword:v,data:E,schemaValue:y,it:g}=f,{opts:R,propertyName:I,topSchemaRef:L,schemaPath:N}=g;h.push([d.keyword,v],[d.params,typeof m=="function"?m(f):m||(0,t._)`{}`]),R.messages&&h.push([d.message,typeof z=="function"?z(f):z]),R.verbose&&h.push([d.schema,y],[d.parentSchema,(0,t._)`${L}${N}`],[o.default.data,E]),I&&h.push([d.propertyName,I])}}),kv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=zi(),r=ue(),o=at(),n={message:"boolean schema is false"};function s(c){let{gen:u,schema:d,validateName:p}=c;d===!1?i(c,!1):typeof d=="object"&&d.$async===!0?u.return(o.default.data):(u.assign((0,r._)`${p}.errors`,null),u.return(!0))}e.topBoolOrEmptySchema=s;function a(c,u){let{gen:d,schema:p}=c;p===!1?(d.var(u,!1),i(c)):d.var(u,!0)}e.boolOrEmptySchema=a;function i(c,u){let{gen:d,data:p}=c,_={gen:d,keyword:"false schema",data:p,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,t.reportError)(_,n,void 0,u)}}),yf=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set(["string","number","integer","boolean","null","object","array"]);function r(n){return typeof n=="string"&&t.has(n)}e.isJSONType=r;function o(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=o}),bf=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:n,self:s},a){let i=s.RULES.types[a];return i&&i!==!0&&r(n,i)}e.schemaHasRulesForType=t;function r(n,s){return s.rules.some(a=>o(n,a))}e.shouldUseGroup=r;function o(n,s){var a;return n[s.keyword]!==void 0||((a=s.definition.implements)===null||a===void 0?void 0:a.some(i=>n[i]!==void 0))}e.shouldUseRule=o}),bi=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let t=yf(),r=bf(),o=zi(),n=ue(),s=fe();var a;(function(h){h[h.Correct=0]="Correct",h[h.Wrong=1]="Wrong"})(a||(e.DataType=a={}));function i(h){let v=c(h.type);if(v.includes("null")){if(h.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!v.length&&h.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');h.nullable===!0&&v.push("null")}return v}e.getSchemaTypes=i;function c(h){let v=Array.isArray(h)?h:h?[h]:[];if(v.every(t.isJSONType))return v;throw new Error("type must be JSONType or JSONType[]: "+v.join(","))}e.getJSONTypes=c;function u(h,v){let{gen:E,data:y,opts:g}=h,R=p(v,g.coerceTypes),I=v.length>0&&!(R.length===0&&v.length===1&&(0,r.schemaHasRulesForType)(h,v[0]));if(I){let L=b(v,y,g.strictNumbers,a.Wrong);E.if(L,()=>{R.length?_(h,v,R):m(h)})}return I}e.coerceAndCheckDataType=u;let d=new Set(["string","number","integer","boolean","null"]);function p(h,v){return v?h.filter(E=>d.has(E)||v==="array"&&E==="array"):[]}function _(h,v,E){let{gen:y,data:g,opts:R}=h,I=y.let("dataType",(0,n._)`typeof ${g}`),L=y.let("coerced",(0,n._)`undefined`);R.coerceTypes==="array"&&y.if((0,n._)`${I} == 'object' && Array.isArray(${g}) && ${g}.length == 1`,()=>y.assign(g,(0,n._)`${g}[0]`).assign(I,(0,n._)`typeof ${g}`).if(b(v,g,R.strictNumbers),()=>y.assign(L,g))),y.if((0,n._)`${L} !== undefined`);for(let D of E)(d.has(D)||D==="array"&&R.coerceTypes==="array")&&N(D);y.else(),m(h),y.endIf(),y.if((0,n._)`${L} !== undefined`,()=>{y.assign(g,L),$(h,L)});function N(D){switch(D){case"string":y.elseIf((0,n._)`${I} == "number" || ${I} == "boolean"`).assign(L,(0,n._)`"" + ${g}`).elseIf((0,n._)`${g} === null`).assign(L,(0,n._)`""`);return;case"number":y.elseIf((0,n._)`${I} == "boolean" || ${g} === null
68
+ || (${I} == "string" && ${g} && ${g} == +${g})`).assign(L,(0,n._)`+${g}`);return;case"integer":y.elseIf((0,n._)`${I} === "boolean" || ${g} === null
69
+ || (${I} === "string" && ${g} && ${g} == +${g} && !(${g} % 1))`).assign(L,(0,n._)`+${g}`);return;case"boolean":y.elseIf((0,n._)`${g} === "false" || ${g} === 0 || ${g} === null`).assign(L,!1).elseIf((0,n._)`${g} === "true" || ${g} === 1`).assign(L,!0);return;case"null":y.elseIf((0,n._)`${g} === "" || ${g} === 0 || ${g} === false`),y.assign(L,null);return;case"array":y.elseIf((0,n._)`${I} === "string" || ${I} === "number"
70
+ || ${I} === "boolean" || ${g} === null`).assign(L,(0,n._)`[${g}]`)}}}function $({gen:h,parentData:v,parentDataProperty:E},y){h.if((0,n._)`${v} !== undefined`,()=>h.assign((0,n._)`${v}[${E}]`,y))}function S(h,v,E,y=a.Correct){let g=y===a.Correct?n.operators.EQ:n.operators.NEQ,R;switch(h){case"null":return(0,n._)`${v} ${g} null`;case"array":R=(0,n._)`Array.isArray(${v})`;break;case"object":R=(0,n._)`${v} && typeof ${v} == "object" && !Array.isArray(${v})`;break;case"integer":R=I((0,n._)`!(${v} % 1) && !isNaN(${v})`);break;case"number":R=I();break;default:return(0,n._)`typeof ${v} ${g} ${h}`}return y===a.Correct?R:(0,n.not)(R);function I(L=n.nil){return(0,n.and)((0,n._)`typeof ${v} == "number"`,L,E?(0,n._)`isFinite(${v})`:n.nil)}}e.checkDataType=S;function b(h,v,E,y){if(h.length===1)return S(h[0],v,E,y);let g,R=(0,s.toHash)(h);if(R.array&&R.object){let I=(0,n._)`typeof ${v} != "object"`;g=R.null?I:(0,n._)`!${v} || ${I}`,delete R.null,delete R.array,delete R.object}else g=n.nil;R.number&&delete R.integer;for(let I in R)g=(0,n.and)(g,S(I,v,E,y));return g}e.checkDataTypes=b;let f={message:({schema:h})=>`must be ${h}`,params:({schema:h,schemaValue:v})=>typeof h=="string"?(0,n._)`{type: ${h}}`:(0,n._)`{type: ${v}}`};function m(h){let v=z(h);(0,o.reportError)(v,f)}e.reportTypeError=m;function z(h){let{gen:v,data:E,schema:y}=h,g=(0,s.schemaRefOrVal)(h,y,"type");return{gen:v,keyword:"type",data:E,schema:y.type,schemaCode:g,schemaValue:g,parentSchema:y,params:{},it:h}}}),Cv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=ue(),r=fe();function o(s,a){let{properties:i,items:c}=s.schema;if(a==="object"&&i)for(let u in i)n(s,u,i[u].default);else a==="array"&&Array.isArray(c)&&c.forEach((u,d)=>n(s,d,u.default))}e.assignDefaults=o;function n(s,a,i){let{gen:c,compositeRule:u,data:d,opts:p}=s;if(i===void 0)return;let _=(0,t._)`${d}${(0,t.getProperty)(a)}`;if(u){(0,r.checkStrictMode)(s,`default is ignored for: ${_}`);return}let $=(0,t._)`${_} === undefined`;p.useDefaults==="empty"&&($=(0,t._)`${$} || ${_} === null || ${_} === ""`),c.if($,(0,t._)`${_} = ${(0,t.stringify)(i)}`)}}),it=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=ue(),r=fe(),o=at(),n=fe();function s(h,v){let{gen:E,data:y,it:g}=h;E.if(p(E,y,v,g.opts.ownProperties),()=>{h.setParams({missingProperty:(0,t._)`${v}`},!0),h.error()})}e.checkReportMissingProp=s;function a({gen:h,data:v,it:{opts:E}},y,g){return(0,t.or)(...y.map(R=>(0,t.and)(p(h,v,R,E.ownProperties),(0,t._)`${g} = ${R}`)))}e.checkMissingProp=a;function i(h,v){h.setParams({missingProperty:v},!0),h.error()}e.reportMissingProp=i;function c(h){return h.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function u(h,v,E){return(0,t._)`${c(h)}.call(${v}, ${E})`}e.isOwnProperty=u;function d(h,v,E,y){let g=(0,t._)`${v}${(0,t.getProperty)(E)} !== undefined`;return y?(0,t._)`${g} && ${u(h,v,E)}`:g}e.propertyInData=d;function p(h,v,E,y){let g=(0,t._)`${v}${(0,t.getProperty)(E)} === undefined`;return y?(0,t.or)(g,(0,t.not)(u(h,v,E))):g}e.noPropertyInData=p;function _(h){return h?Object.keys(h).filter(v=>v!=="__proto__"):[]}e.allSchemaProperties=_;function $(h,v){return _(v).filter(E=>!(0,r.alwaysValidSchema)(h,v[E]))}e.schemaProperties=$;function S({schemaCode:h,data:v,it:{gen:E,topSchemaRef:y,schemaPath:g,errorPath:R},it:I},L,N,D){let B=D?(0,t._)`${h}, ${v}, ${y}${g}`:v,G=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,R)],[o.default.parentData,I.parentData],[o.default.parentDataProperty,I.parentDataProperty],[o.default.rootData,o.default.rootData]];I.opts.dynamicRef&&G.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let pe=(0,t._)`${B}, ${E.object(...G)}`;return N!==t.nil?(0,t._)`${L}.call(${N}, ${pe})`:(0,t._)`${L}(${pe})`}e.callValidateCode=S;let b=(0,t._)`new RegExp`;function f({gen:h,it:{opts:v}},E){let y=v.unicodeRegExp?"u":"",{regExp:g}=v.code,R=g(E,y);return h.scopeValue("pattern",{key:R.toString(),ref:R,code:(0,t._)`${g.code==="new RegExp"?b:(0,n.useFunc)(h,g)}(${E}, ${y})`})}e.usePattern=f;function m(h){let{gen:v,data:E,keyword:y,it:g}=h,R=v.name("valid");if(g.allErrors){let L=v.let("valid",!0);return I(()=>v.assign(L,!1)),L}return v.var(R,!0),I(()=>v.break()),R;function I(L){let N=v.const("len",(0,t._)`${E}.length`);v.forRange("i",0,N,D=>{h.subschema({keyword:y,dataProp:D,dataPropType:r.Type.Num},R),v.if((0,t.not)(R),L)})}}e.validateArray=m;function z(h){let{gen:v,schema:E,keyword:y,it:g}=h;if(!Array.isArray(E))throw new Error("ajv implementation error");if(E.some(L=>(0,r.alwaysValidSchema)(g,L))&&!g.opts.unevaluated)return;let R=v.let("valid",!1),I=v.name("_valid");v.block(()=>E.forEach((L,N)=>{let D=h.subschema({keyword:y,schemaProp:N,compositeRule:!0},I);v.assign(R,(0,t._)`${R} || ${I}`),h.mergeValidEvaluated(D,I)||v.if((0,t.not)(R))})),h.result(R,()=>h.reset(),()=>h.error(!0))}e.validateUnion=z}),Iv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=ue(),r=at(),o=it(),n=zi();function s($,S){let{gen:b,keyword:f,schema:m,parentSchema:z,it:h}=$,v=S.macro.call(h.self,m,z,h),E=d(b,f,v);h.opts.validateSchema!==!1&&h.self.validateSchema(v,!0);let y=b.name("valid");$.subschema({schema:v,schemaPath:t.nil,errSchemaPath:`${h.errSchemaPath}/${f}`,topSchemaRef:E,compositeRule:!0},y),$.pass(y,()=>$.error(!0))}e.macroKeywordCode=s;function a($,S){var b;let{gen:f,keyword:m,schema:z,parentSchema:h,$data:v,it:E}=$;u(E,S);let y=d(f,m,!v&&S.compile?S.compile.call(E.self,z,h,E):S.validate),g=f.let("valid");$.block$data(g,R),$.ok((b=S.valid)!==null&&b!==void 0?b:g);function R(){if(S.errors===!1)N(),S.modifying&&i($),D(()=>$.error());else{let B=S.async?I():L();S.modifying&&i($),D(()=>c($,B))}}function I(){let B=f.let("ruleErrs",null);return f.try(()=>N((0,t._)`await `),G=>f.assign(g,!1).if((0,t._)`${G} instanceof ${E.ValidationError}`,()=>f.assign(B,(0,t._)`${G}.errors`),()=>f.throw(G))),B}function L(){let B=(0,t._)`${y}.errors`;return f.assign(B,null),N(t.nil),B}function N(B=S.async?(0,t._)`await `:t.nil){let G=E.opts.passContext?r.default.this:r.default.self,pe=!("compile"in S&&!v||S.schema===!1);f.assign(g,(0,t._)`${B}${(0,o.callValidateCode)($,y,G,pe)}`,S.modifying)}function D(B){var G;f.if((0,t.not)((G=S.valid)!==null&&G!==void 0?G:g),B)}}e.funcKeywordCode=a;function i($){let{gen:S,data:b,it:f}=$;S.if(f.parentData,()=>S.assign(b,(0,t._)`${f.parentData}[${f.parentDataProperty}]`))}function c($,S){let{gen:b}=$;b.if((0,t._)`Array.isArray(${S})`,()=>{b.assign(r.default.vErrors,(0,t._)`${r.default.vErrors} === null ? ${S} : ${r.default.vErrors}.concat(${S})`).assign(r.default.errors,(0,t._)`${r.default.vErrors}.length`),(0,n.extendErrors)($)},()=>$.error())}function u({schemaEnv:$},S){if(S.async&&!$.$async)throw new Error("async keyword in sync schema")}function d($,S,b){if(b===void 0)throw new Error(`keyword "${S}" failed to compile`);return $.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,t.stringify)(b)})}function p($,S,b=!1){return!S.length||S.some(f=>f==="array"?Array.isArray($):f==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==f||b&&typeof $>"u")}e.validSchemaType=p;function _({schema:$,opts:S,self:b,errSchemaPath:f},m,z){if(Array.isArray(m.keyword)?!m.keyword.includes(z):m.keyword!==z)throw new Error("ajv implementation error");let h=m.dependencies;if(h?.some(v=>!Object.prototype.hasOwnProperty.call($,v)))throw new Error(`parent schema must have dependencies of ${z}: ${h.join(",")}`);if(m.validateSchema&&!m.validateSchema($[z])){let v=`keyword "${z}" value is invalid at path "${f}": `+b.errorsText(m.validateSchema.errors);if(S.validateSchema==="log")b.logger.error(v);else throw new Error(v)}}e.validateKeywordUsage=_}),Ov=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=ue(),r=fe();function o(a,{keyword:i,schemaProp:c,schema:u,schemaPath:d,errSchemaPath:p,topSchemaRef:_}){if(i!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(i!==void 0){let $=a.schema[i];return c===void 0?{schema:$,schemaPath:(0,t._)`${a.schemaPath}${(0,t.getProperty)(i)}`,errSchemaPath:`${a.errSchemaPath}/${i}`}:{schema:$[c],schemaPath:(0,t._)`${a.schemaPath}${(0,t.getProperty)(i)}${(0,t.getProperty)(c)}`,errSchemaPath:`${a.errSchemaPath}/${i}/${(0,r.escapeFragment)(c)}`}}if(u!==void 0){if(d===void 0||p===void 0||_===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:d,topSchemaRef:_,errSchemaPath:p}}throw new Error('either "keyword" or "schema" must be passed')}e.getSubschema=o;function n(a,i,{dataProp:c,dataPropType:u,data:d,dataTypes:p,propertyName:_}){if(d!==void 0&&c!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:$}=i;if(c!==void 0){let{errorPath:b,dataPathArr:f,opts:m}=i;S($.let("data",(0,t._)`${i.data}${(0,t.getProperty)(c)}`,!0)),a.errorPath=(0,t.str)`${b}${(0,r.getErrorPath)(c,u,m.jsPropertySyntax)}`,a.parentDataProperty=(0,t._)`${c}`,a.dataPathArr=[...f,a.parentDataProperty]}d!==void 0&&(S(d instanceof t.Name?d:$.let("data",d,!0)),_!==void 0&&(a.propertyName=_)),p&&(a.dataTypes=p);function S(b){a.data=b,a.dataLevel=i.dataLevel+1,a.dataTypes=[],i.definedProperties=new Set,a.parentData=i.data,a.dataNames=[...i.dataNames,b]}}e.extendSubschemaData=n;function s(a,{jtdDiscriminator:i,jtdMetadata:c,compositeRule:u,createErrors:d,allErrors:p}){u!==void 0&&(a.compositeRule=u),d!==void 0&&(a.createErrors=d),p!==void 0&&(a.allErrors=p),a.jtdDiscriminator=i,a.jtdMetadata=c}e.extendSubschemaMode=s}),zf=U((e,t)=>{t.exports=function r(o,n){if(o===n)return!0;if(o&&n&&typeof o=="object"&&typeof n=="object"){if(o.constructor!==n.constructor)return!1;var s,a,i;if(Array.isArray(o)){if(s=o.length,s!=n.length)return!1;for(a=s;a--!==0;)if(!r(o[a],n[a]))return!1;return!0}if(o.constructor===RegExp)return o.source===n.source&&o.flags===n.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===n.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===n.toString();if(i=Object.keys(o),s=i.length,s!==Object.keys(n).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=s;a--!==0;){var c=i[a];if(!r(o[c],n[c]))return!1}return!0}return o!==o&&n!==n}}),Nv=U((e,t)=>{var r=t.exports=function(s,a,i){typeof a=="function"&&(i=a,a={}),i=a.cb||i;var c=typeof i=="function"?i:i.pre||function(){},u=i.post||function(){};o(a,c,u,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function o(s,a,i,c,u,d,p,_,$,S){if(c&&typeof c=="object"&&!Array.isArray(c)){a(c,u,d,p,_,$,S);for(var b in c){var f=c[b];if(Array.isArray(f)){if(b in r.arrayKeywords)for(var m=0;m<f.length;m++)o(s,a,i,f[m],u+"/"+b+"/"+m,d,u,b,c,m)}else if(b in r.propsKeywords){if(f&&typeof f=="object")for(var z in f)o(s,a,i,f[z],u+"/"+b+"/"+n(z),d,u,b,c,z)}else(b in r.keywords||s.allKeys&&!(b in r.skipKeywords))&&o(s,a,i,f,u+"/"+b,d,u,b,c)}i(c,u,d,p,_,$,S)}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}}),Ri=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=fe(),r=zf(),o=Nv(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(f,m=!0){return typeof f=="boolean"?!0:m===!0?!i(f):m?c(f)<=m:!1}e.inlineRef=s;let a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function i(f){for(let m in f){if(a.has(m))return!0;let z=f[m];if(Array.isArray(z)&&z.some(i)||typeof z=="object"&&i(z))return!0}return!1}function c(f){let m=0;for(let z in f){if(z==="$ref")return 1/0;if(m++,!n.has(z)&&(typeof f[z]=="object"&&(0,t.eachItem)(f[z],h=>m+=c(h)),m===1/0))return 1/0}return m}function u(f,m="",z){return z!==!1&&(m=_(m)),d(f,f.parse(m))}e.getFullPath=u;function d(f,m){return f.serialize(m).split("#")[0]+"#"}e._getFullPath=d;let p=/#\/?$/;function _(f){return f?f.replace(p,""):""}e.normalizeId=_;function $(f,m,z){return z=_(z),f.resolve(m,z)}e.resolveUrl=$;let S=/^[a-z_][-a-z0-9._]*$/i;function b(f,m){if(typeof f=="boolean")return{};let{schemaId:z,uriResolver:h}=this.opts,v=_(f[z]||m),E={"":v},y=u(h,v,!1),g={},R=new Set;return o(f,{allKeys:!0},(N,D,B,G)=>{if(G===void 0)return;let pe=y+D,$e=E[G];typeof N[z]=="string"&&($e=be.call(this,N[z])),Oe.call(this,N.$anchor),Oe.call(this,N.$dynamicAnchor),E[D]=$e;function be(he){let C=this.opts.uriResolver.resolve;if(he=_($e?C($e,he):he),R.has(he))throw L(he);R.add(he);let x=this.refs[he];return typeof x=="string"&&(x=this.refs[x]),typeof x=="object"?I(N,x.schema,he):he!==_(pe)&&(he[0]==="#"?(I(N,g[he],he),g[he]=N):this.refs[he]=pe),he}function Oe(he){if(typeof he=="string"){if(!S.test(he))throw new Error(`invalid anchor "${he}"`);be.call(this,`#${he}`)}}}),g;function I(N,D,B){if(D!==void 0&&!r(N,D))throw L(B)}function L(N){return new Error(`reference "${N}" resolves to more than one schema`)}}e.getSchemaRefs=b}),Xr=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=kv(),r=bi(),o=bf(),n=bi(),s=Cv(),a=Iv(),i=Ov(),c=ue(),u=at(),d=Ri(),p=fe(),_=zi();function $(T){if(y(T)&&(R(T),E(T))){m(T);return}S(T,()=>(0,t.topBoolOrEmptySchema)(T))}e.validateFunctionCode=$;function S({gen:T,validateName:A,schema:Z,schemaEnv:ne,opts:se},le){se.code.es5?T.func(A,(0,c._)`${u.default.data}, ${u.default.valCxt}`,ne.$async,()=>{T.code((0,c._)`"use strict"; ${h(Z,se)}`),f(T,se),T.code(le)}):T.func(A,(0,c._)`${u.default.data}, ${b(se)}`,ne.$async,()=>T.code(h(Z,se)).code(le))}function b(T){return(0,c._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${T.dynamicRef?(0,c._)`, ${u.default.dynamicAnchors}={}`:c.nil}}={}`}function f(T,A){T.if(u.default.valCxt,()=>{T.var(u.default.instancePath,(0,c._)`${u.default.valCxt}.${u.default.instancePath}`),T.var(u.default.parentData,(0,c._)`${u.default.valCxt}.${u.default.parentData}`),T.var(u.default.parentDataProperty,(0,c._)`${u.default.valCxt}.${u.default.parentDataProperty}`),T.var(u.default.rootData,(0,c._)`${u.default.valCxt}.${u.default.rootData}`),A.dynamicRef&&T.var(u.default.dynamicAnchors,(0,c._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{T.var(u.default.instancePath,(0,c._)`""`),T.var(u.default.parentData,(0,c._)`undefined`),T.var(u.default.parentDataProperty,(0,c._)`undefined`),T.var(u.default.rootData,u.default.data),A.dynamicRef&&T.var(u.default.dynamicAnchors,(0,c._)`{}`)})}function m(T){let{schema:A,opts:Z,gen:ne}=T;S(T,()=>{Z.$comment&&A.$comment&&G(T),N(T),ne.let(u.default.vErrors,null),ne.let(u.default.errors,0),Z.unevaluated&&z(T),I(T),pe(T)})}function z(T){let{gen:A,validateName:Z}=T;T.evaluated=A.const("evaluated",(0,c._)`${Z}.evaluated`),A.if((0,c._)`${T.evaluated}.dynamicProps`,()=>A.assign((0,c._)`${T.evaluated}.props`,(0,c._)`undefined`)),A.if((0,c._)`${T.evaluated}.dynamicItems`,()=>A.assign((0,c._)`${T.evaluated}.items`,(0,c._)`undefined`))}function h(T,A){let Z=typeof T=="object"&&T[A.schemaId];return Z&&(A.code.source||A.code.process)?(0,c._)`/*# sourceURL=${Z} */`:c.nil}function v(T,A){if(y(T)&&(R(T),E(T))){g(T,A);return}(0,t.boolOrEmptySchema)(T,A)}function E({schema:T,self:A}){if(typeof T=="boolean")return!T;for(let Z in T)if(A.RULES.all[Z])return!0;return!1}function y(T){return typeof T.schema!="boolean"}function g(T,A){let{schema:Z,gen:ne,opts:se}=T;se.$comment&&Z.$comment&&G(T),D(T),B(T);let le=ne.const("_errs",u.default.errors);I(T,le),ne.var(A,(0,c._)`${le} === ${u.default.errors}`)}function R(T){(0,p.checkUnknownRules)(T),L(T)}function I(T,A){if(T.opts.jtd)return be(T,[],!1,A);let Z=(0,r.getSchemaTypes)(T.schema);be(T,Z,!(0,r.coerceAndCheckDataType)(T,Z),A)}function L(T){let{schema:A,errSchemaPath:Z,opts:ne,self:se}=T;A.$ref&&ne.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(A,se.RULES)&&se.logger.warn(`$ref: keywords ignored in schema at path "${Z}"`)}function N(T){let{schema:A,opts:Z}=T;A.default!==void 0&&Z.useDefaults&&Z.strictSchema&&(0,p.checkStrictMode)(T,"default is ignored in the schema root")}function D(T){let A=T.schema[T.opts.schemaId];A&&(T.baseId=(0,d.resolveUrl)(T.opts.uriResolver,T.baseId,A))}function B(T){if(T.schema.$async&&!T.schemaEnv.$async)throw new Error("async schema in sync schema")}function G({gen:T,schemaEnv:A,schema:Z,errSchemaPath:ne,opts:se}){let le=Z.$comment;if(se.$comment===!0)T.code((0,c._)`${u.default.self}.logger.log(${le})`);else if(typeof se.$comment=="function"){let Ce=(0,c.str)`${ne}/$comment`,je=T.scopeValue("root",{ref:A.root});T.code((0,c._)`${u.default.self}.opts.$comment(${le}, ${Ce}, ${je}.schema)`)}}function pe(T){let{gen:A,schemaEnv:Z,validateName:ne,ValidationError:se,opts:le}=T;Z.$async?A.if((0,c._)`${u.default.errors} === 0`,()=>A.return(u.default.data),()=>A.throw((0,c._)`new ${se}(${u.default.vErrors})`)):(A.assign((0,c._)`${ne}.errors`,u.default.vErrors),le.unevaluated&&$e(T),A.return((0,c._)`${u.default.errors} === 0`))}function $e({gen:T,evaluated:A,props:Z,items:ne}){Z instanceof c.Name&&T.assign((0,c._)`${A}.props`,Z),ne instanceof c.Name&&T.assign((0,c._)`${A}.items`,ne)}function be(T,A,Z,ne){let{gen:se,schema:le,data:Ce,allErrors:je,opts:Le,self:Ne}=T,{RULES:Ee}=Ne;if(le.$ref&&(Le.ignoreKeywordsWithRef||!(0,p.schemaHasRulesButRef)(le,Ee))){se.block(()=>de(T,"$ref",Ee.all.$ref.definition));return}Le.jtd||he(T,A),se.block(()=>{for(let qe of Ee.rules)Xe(qe);Xe(Ee.post)});function Xe(qe){(0,o.shouldUseGroup)(le,qe)&&(qe.type?(se.if((0,n.checkDataType)(qe.type,Ce,Le.strictNumbers)),Oe(T,qe),A.length===1&&A[0]===qe.type&&Z&&(se.else(),(0,n.reportTypeError)(T)),se.endIf()):Oe(T,qe),je||se.if((0,c._)`${u.default.errors} === ${ne||0}`))}}function Oe(T,A){let{gen:Z,schema:ne,opts:{useDefaults:se}}=T;se&&(0,s.assignDefaults)(T,A.type),Z.block(()=>{for(let le of A.rules)(0,o.shouldUseRule)(ne,le)&&de(T,le.keyword,le.definition,A.type)})}function he(T,A){T.schemaEnv.meta||!T.opts.strictTypes||(C(T,A),T.opts.allowUnionTypes||x(T,A),V(T,T.dataTypes))}function C(T,A){if(A.length){if(!T.dataTypes.length){T.dataTypes=A;return}A.forEach(Z=>{k(T.dataTypes,Z)||J(T,`type "${Z}" not allowed by context "${T.dataTypes.join(",")}"`)}),q(T,A)}}function x(T,A){A.length>1&&!(A.length===2&&A.includes("null"))&&J(T,"use allowUnionTypes to allow union type keyword")}function V(T,A){let Z=T.self.RULES.all;for(let ne in Z){let se=Z[ne];if(typeof se=="object"&&(0,o.shouldUseRule)(T.schema,se)){let{type:le}=se.definition;le.length&&!le.some(Ce=>w(A,Ce))&&J(T,`missing type "${le.join(",")}" for keyword "${ne}"`)}}}function w(T,A){return T.includes(A)||A==="number"&&T.includes("integer")}function k(T,A){return T.includes(A)||A==="integer"&&T.includes("number")}function q(T,A){let Z=[];for(let ne of T.dataTypes)k(A,ne)?Z.push(ne):A.includes("integer")&&ne==="number"&&Z.push("integer");T.dataTypes=Z}function J(T,A){let Z=T.schemaEnv.baseId+T.errSchemaPath;A+=` at "${Z}" (strictTypes)`,(0,p.checkStrictMode)(T,A,T.opts.strictTypes)}var te=class{constructor(T,A,Z){if((0,a.validateKeywordUsage)(T,A,Z),this.gen=T.gen,this.allErrors=T.allErrors,this.keyword=Z,this.data=T.data,this.schema=T.schema[Z],this.$data=A.$data&&T.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(T,this.schema,Z,this.$data),this.schemaType=A.schemaType,this.parentSchema=T.schema,this.params={},this.it=T,this.def=A,this.$data)this.schemaCode=T.gen.const("vSchema",Fe(this.$data,T));else if(this.schemaCode=this.schemaValue,!(0,a.validSchemaType)(this.schema,A.schemaType,A.allowUndefined))throw new Error(`${Z} value must be ${JSON.stringify(A.schemaType)}`);("code"in A?A.trackErrors:A.errors!==!1)&&(this.errsCount=T.gen.const("_errs",u.default.errors))}result(T,A,Z){this.failResult((0,c.not)(T),A,Z)}failResult(T,A,Z){this.gen.if(T),Z?Z():this.error(),A?(this.gen.else(),A(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(T,A){this.failResult((0,c.not)(T),void 0,A)}fail(T){if(T===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(T),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(T){if(!this.$data)return this.fail(T);let{schemaCode:A}=this;this.fail((0,c._)`${A} !== undefined && (${(0,c.or)(this.invalid$data(),T)})`)}error(T,A,Z){if(A){this.setParams(A),this._error(T,Z),this.setParams({});return}this._error(T,Z)}_error(T,A){(T?_.reportExtraError:_.reportError)(this,this.def.error,A)}$dataError(){(0,_.reportError)(this,this.def.$dataError||_.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,_.resetErrorsCount)(this.gen,this.errsCount)}ok(T){this.allErrors||this.gen.if(T)}setParams(T,A){A?Object.assign(this.params,T):this.params=T}block$data(T,A,Z=c.nil){this.gen.block(()=>{this.check$data(T,Z),A()})}check$data(T=c.nil,A=c.nil){if(!this.$data)return;let{gen:Z,schemaCode:ne,schemaType:se,def:le}=this;Z.if((0,c.or)((0,c._)`${ne} === undefined`,A)),T!==c.nil&&Z.assign(T,!0),(se.length||le.validateSchema)&&(Z.elseIf(this.invalid$data()),this.$dataError(),T!==c.nil&&Z.assign(T,!1)),Z.else()}invalid$data(){let{gen:T,schemaCode:A,schemaType:Z,def:ne,it:se}=this;return(0,c.or)(le(),Ce());function le(){if(Z.length){if(!(A instanceof c.Name))throw new Error("ajv implementation error");let je=Array.isArray(Z)?Z:[Z];return(0,c._)`${(0,n.checkDataTypes)(je,A,se.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}function Ce(){if(ne.validateSchema){let je=T.scopeValue("validate$data",{ref:ne.validateSchema});return(0,c._)`!${je}(${A})`}return c.nil}}subschema(T,A){let Z=(0,i.getSubschema)(this.it,T);(0,i.extendSubschemaData)(Z,this.it,T),(0,i.extendSubschemaMode)(Z,T);let ne={...this.it,...Z,items:void 0,props:void 0};return v(ne,A),ne}mergeEvaluated(T,A){let{it:Z,gen:ne}=this;Z.opts.unevaluated&&(Z.props!==!0&&T.props!==void 0&&(Z.props=p.mergeEvaluated.props(ne,T.props,Z.props,A)),Z.items!==!0&&T.items!==void 0&&(Z.items=p.mergeEvaluated.items(ne,T.items,Z.items,A)))}mergeValidEvaluated(T,A){let{it:Z,gen:ne}=this;if(Z.opts.unevaluated&&(Z.props!==!0||Z.items!==!0))return ne.if(A,()=>this.mergeEvaluated(T,c.Name)),!0}};e.KeywordCxt=te;function de(T,A,Z,ne){let se=new te(T,Z,A);"code"in Z?Z.code(se,ne):se.$data&&Z.validate?(0,a.funcKeywordCode)(se,Z):"macro"in Z?(0,a.macroKeywordCode)(se,Z):(Z.compile||Z.validate)&&(0,a.funcKeywordCode)(se,Z)}let ae=/^\/(?:[^~]|~0|~1)*$/,ze=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Fe(T,{dataLevel:A,dataNames:Z,dataPathArr:ne}){let se,le;if(T==="")return u.default.rootData;if(T[0]==="/"){if(!ae.test(T))throw new Error(`Invalid JSON-pointer: ${T}`);se=T,le=u.default.rootData}else{let Ne=ze.exec(T);if(!Ne)throw new Error(`Invalid JSON-pointer: ${T}`);let Ee=+Ne[1];if(se=Ne[2],se==="#"){if(Ee>=A)throw new Error(Le("property/index",Ee));return ne[A-Ee]}if(Ee>A)throw new Error(Le("data",Ee));if(le=Z[A-Ee],!se)return le}let Ce=le,je=se.split("/");for(let Ne of je)Ne&&(le=(0,c._)`${le}${(0,c.getProperty)((0,p.unescapeJsonPointer)(Ne))}`,Ce=(0,c._)`${Ce} && ${le}`);return Ce;function Le(Ne,Ee){return`Cannot access ${Ne} ${Ee} levels up, current level is ${A}`}}e.getData=Fe}),wn=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}};e.default=t}),Qr=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ri();var r=class extends Error{constructor(o,n,s,a){super(a||`can't resolve reference ${s} from id ${n}`),this.missingRef=(0,t.resolveUrl)(o,n,s),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(o,this.missingRef))}};e.default=r}),$i=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=ue(),r=wn(),o=at(),n=Ri(),s=fe(),a=Xr();var i=class{constructor(m){var z;this.refs={},this.dynamicAnchors={};let h;typeof m.schema=="object"&&(h=m.schema),this.schema=m.schema,this.schemaId=m.schemaId,this.root=m.root||this,this.baseId=(z=m.baseId)!==null&&z!==void 0?z:(0,n.normalizeId)(h?.[m.schemaId||"$id"]),this.schemaPath=m.schemaPath,this.localRefs=m.localRefs,this.meta=m.meta,this.$async=h?.$async,this.refs={}}};e.SchemaEnv=i;function c(m){let z=p.call(this,m);if(z)return z;let h=(0,n.getFullPath)(this.opts.uriResolver,m.root.baseId),{es5:v,lines:E}=this.opts.code,{ownProperties:y}=this.opts,g=new t.CodeGen(this.scope,{es5:v,lines:E,ownProperties:y}),R;m.$async&&(R=g.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let I=g.scopeName("validate");m.validateName=I;let L={gen:g,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:g.scopeValue("schema",this.opts.code.source===!0?{ref:m.schema,code:(0,t.stringify)(m.schema)}:{ref:m.schema}),validateName:I,ValidationError:R,schema:m.schema,schemaEnv:m,rootId:h,baseId:m.baseId||h,schemaPath:t.nil,errSchemaPath:m.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this},N;try{this._compilations.add(m),(0,a.validateFunctionCode)(L),g.optimize(this.opts.code.optimize);let D=g.toString();N=`${g.scopeRefs(o.default.scope)}return ${D}`,this.opts.code.process&&(N=this.opts.code.process(N,m));let B=new Function(`${o.default.self}`,`${o.default.scope}`,N)(this,this.scope.get());if(this.scope.value(I,{ref:B}),B.errors=null,B.schema=m.schema,B.schemaEnv=m,m.$async&&(B.$async=!0),this.opts.code.source===!0&&(B.source={validateName:I,validateCode:D,scopeValues:g._values}),this.opts.unevaluated){let{props:G,items:pe}=L;B.evaluated={props:G instanceof t.Name?void 0:G,items:pe instanceof t.Name?void 0:pe,dynamicProps:G instanceof t.Name,dynamicItems:pe instanceof t.Name},B.source&&(B.source.evaluated=(0,t.stringify)(B.evaluated))}return m.validate=B,m}catch(D){throw delete m.validate,delete m.validateName,N&&this.logger.error("Error compiling schema, function code:",N),D}finally{this._compilations.delete(m)}}e.compileSchema=c;function u(m,z,h){var v;h=(0,n.resolveUrl)(this.opts.uriResolver,z,h);let E=m.refs[h];if(E)return E;let y=$.call(this,m,h);if(y===void 0){let g=(v=m.localRefs)===null||v===void 0?void 0:v[h],{schemaId:R}=this.opts;g&&(y=new i({schema:g,schemaId:R,root:m,baseId:z}))}if(y!==void 0)return m.refs[h]=d.call(this,y)}e.resolveRef=u;function d(m){return(0,n.inlineRef)(m.schema,this.opts.inlineRefs)?m.schema:m.validate?m:c.call(this,m)}function p(m){for(let z of this._compilations)if(_(z,m))return z}e.getCompilingSchema=p;function _(m,z){return m.schema===z.schema&&m.root===z.root&&m.baseId===z.baseId}function $(m,z){let h;for(;typeof(h=this.refs[z])=="string";)z=h;return h||this.schemas[z]||S.call(this,m,z)}function S(m,z){let h=this.opts.uriResolver.parse(z),v=(0,n._getFullPath)(this.opts.uriResolver,h),E=(0,n.getFullPath)(this.opts.uriResolver,m.baseId,void 0);if(Object.keys(m.schema).length>0&&v===E)return f.call(this,h,m);let y=(0,n.normalizeId)(v),g=this.refs[y]||this.schemas[y];if(typeof g=="string"){let R=S.call(this,m,g);return typeof R?.schema!="object"?void 0:f.call(this,h,R)}if(typeof g?.schema=="object"){if(g.validate||c.call(this,g),y===(0,n.normalizeId)(z)){let{schema:R}=g,{schemaId:I}=this.opts,L=R[I];return L&&(E=(0,n.resolveUrl)(this.opts.uriResolver,E,L)),new i({schema:R,schemaId:I,root:m,baseId:E})}return f.call(this,h,g)}}e.resolveSchema=S;let b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function f(m,{baseId:z,schema:h,root:v}){var E;if(((E=m.fragment)===null||E===void 0?void 0:E[0])!=="/")return;for(let R of m.fragment.slice(1).split("/")){if(typeof h=="boolean")return;let I=h[(0,s.unescapeFragment)(R)];if(I===void 0)return;h=I;let L=typeof h=="object"&&h[this.opts.schemaId];!b.has(R)&&L&&(z=(0,n.resolveUrl)(this.opts.uriResolver,z,L))}let y;if(typeof h!="boolean"&&h.$ref&&!(0,s.schemaHasRulesButRef)(h,this.RULES)){let R=(0,n.resolveUrl)(this.opts.uriResolver,z,h.$ref);y=S.call(this,v,R)}let{schemaId:g}=this.opts;if(y=y||new i({schema:h,schemaId:g,root:v,baseId:z}),y.schema!==y.root.schema)return y}}),jv=U((e,t)=>{t.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),Rf=U((e,t)=>{let r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),o=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(S){let b="",f=0,m=0;for(m=0;m<S.length;m++)if(f=S[m].charCodeAt(0),f!==48){if(!(f>=48&&f<=57||f>=65&&f<=70||f>=97&&f<=102))return"";b+=S[m];break}for(m+=1;m<S.length;m++){if(f=S[m].charCodeAt(0),!(f>=48&&f<=57||f>=65&&f<=70||f>=97&&f<=102))return"";b+=S[m]}return b}let s=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function a(S){return S.length=0,!0}function i(S,b,f){if(S.length){let m=n(S);if(m!=="")b.push(m);else return f.error=!0,!1;S.length=0}return!0}function c(S){let b=0,f={error:!1,address:"",zone:""},m=[],z=[],h=!1,v=!1,E=i;for(let y=0;y<S.length;y++){let g=S[y];if(!(g==="["||g==="]"))if(g===":"){if(h===!0&&(v=!0),!E(z,m,f))break;if(++b>7){f.error=!0;break}y>0&&S[y-1]===":"&&(h=!0),m.push(":");continue}else if(g==="%"){if(!E(z,m,f))break;E=a}else{z.push(g);continue}}return z.length&&(E===a?f.zone=z.join(""):v?m.push(z.join("")):m.push(n(z))),f.address=m.join(""),f}function u(S){if(d(S,":")<2)return{host:S,isIPV6:!1};let b=c(S);if(b.error)return{host:S,isIPV6:!1};{let f=b.address,m=b.address;return b.zone&&(f+="%"+b.zone,m+="%25"+b.zone),{host:f,isIPV6:!0,escapedHost:m}}}function d(S,b){let f=0;for(let m=0;m<S.length;m++)S[m]===b&&f++;return f}function p(S){let b=S,f=[],m=-1,z=0;for(;z=b.length;){if(z===1){if(b===".")break;if(b==="/"){f.push("/");break}else{f.push(b);break}}else if(z===2){if(b[0]==="."){if(b[1]===".")break;if(b[1]==="/"){b=b.slice(2);continue}}else if(b[0]==="/"&&(b[1]==="."||b[1]==="/")){f.push("/");break}}else if(z===3&&b==="/.."){f.length!==0&&f.pop(),f.push("/");break}if(b[0]==="."){if(b[1]==="."){if(b[2]==="/"){b=b.slice(3);continue}}else if(b[1]==="/"){b=b.slice(2);continue}}else if(b[0]==="/"&&b[1]==="."){if(b[2]==="/"){b=b.slice(2);continue}else if(b[2]==="."&&b[3]==="/"){b=b.slice(3),f.length!==0&&f.pop();continue}}if((m=b.indexOf("/",1))===-1){f.push(b);break}else f.push(b.slice(0,m)),b=b.slice(m)}return f.join("")}function _(S,b){let f=b!==!0?escape:unescape;return S.scheme!==void 0&&(S.scheme=f(S.scheme)),S.userinfo!==void 0&&(S.userinfo=f(S.userinfo)),S.host!==void 0&&(S.host=f(S.host)),S.path!==void 0&&(S.path=f(S.path)),S.query!==void 0&&(S.query=f(S.query)),S.fragment!==void 0&&(S.fragment=f(S.fragment)),S}function $(S){let b=[];if(S.userinfo!==void 0&&(b.push(S.userinfo),b.push("@")),S.host!==void 0){let f=unescape(S.host);if(!o(f)){let m=u(f);m.isIPV6===!0?f=`[${m.escapedHost}]`:f=S.host}b.push(f)}return(typeof S.port=="number"||typeof S.port=="string")&&(b.push(":"),b.push(String(S.port))),b.length?b.join(""):void 0}t.exports={nonSimpleDomain:s,recomposeAuthority:$,normalizeComponentEncoding:_,removeDotSegments:p,isIPv4:o,isUUID:r,normalizeIPv6:u,stringArrayToHexStripped:n}}),qv=U((e,t)=>{let{isUUID:r}=Rf(),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function s(g){return n.indexOf(g)!==-1}function a(g){return g.secure===!0?!0:g.secure===!1?!1:g.scheme?g.scheme.length===3&&(g.scheme[0]==="w"||g.scheme[0]==="W")&&(g.scheme[1]==="s"||g.scheme[1]==="S")&&(g.scheme[2]==="s"||g.scheme[2]==="S"):!1}function i(g){return g.host||(g.error=g.error||"HTTP URIs must have a host."),g}function c(g){let R=String(g.scheme).toLowerCase()==="https";return(g.port===(R?443:80)||g.port==="")&&(g.port=void 0),g.path||(g.path="/"),g}function u(g){return g.secure=a(g),g.resourceName=(g.path||"/")+(g.query?"?"+g.query:""),g.path=void 0,g.query=void 0,g}function d(g){if((g.port===(a(g)?443:80)||g.port==="")&&(g.port=void 0),typeof g.secure=="boolean"&&(g.scheme=g.secure?"wss":"ws",g.secure=void 0),g.resourceName){let[R,I]=g.resourceName.split("?");g.path=R&&R!=="/"?R:void 0,g.query=I,g.resourceName=void 0}return g.fragment=void 0,g}function p(g,R){if(!g.path)return g.error="URN can not be parsed",g;let I=g.path.match(o);if(I){let L=R.scheme||g.scheme||"urn";g.nid=I[1].toLowerCase(),g.nss=I[2];let N=y(`${L}:${R.nid||g.nid}`);g.path=void 0,N&&(g=N.parse(g,R))}else g.error=g.error||"URN can not be parsed.";return g}function _(g,R){if(g.nid===void 0)throw new Error("URN without nid cannot be serialized");let I=R.scheme||g.scheme||"urn",L=g.nid.toLowerCase(),N=y(`${I}:${R.nid||L}`);N&&(g=N.serialize(g,R));let D=g,B=g.nss;return D.path=`${L||R.nid}:${B}`,R.skipEscape=!0,D}function $(g,R){let I=g;return I.uuid=I.nss,I.nss=void 0,!R.tolerant&&(!I.uuid||!r(I.uuid))&&(I.error=I.error||"UUID is not valid."),I}function S(g){let R=g;return R.nss=(g.uuid||"").toLowerCase(),R}let b={scheme:"http",domainHost:!0,parse:i,serialize:c},f={scheme:"https",domainHost:b.domainHost,parse:i,serialize:c},m={scheme:"ws",domainHost:!0,parse:u,serialize:d},z={scheme:"wss",domainHost:m.domainHost,parse:m.parse,serialize:m.serialize},E={http:b,https:f,ws:m,wss:z,urn:{scheme:"urn",parse:p,serialize:_,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:$,serialize:S,skipNormalize:!0}};Object.setPrototypeOf(E,null);function y(g){return g&&(E[g]||E[g.toLowerCase()])||void 0}t.exports={wsIsSecure:a,SCHEMES:E,isValidSchemeName:s,getSchemeHandler:y}}),xv=U((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizeComponentEncoding:s,isIPv4:a,nonSimpleDomain:i}=Rf(),{SCHEMES:c,getSchemeHandler:u}=qv();function d(z,h){return typeof z=="string"?z=S(f(z,h),h):typeof z=="object"&&(z=f(S(z,h),h)),z}function p(z,h,v){let E=v?Object.assign({scheme:"null"},v):{scheme:"null"},y=_(f(z,E),f(h,E),E,!0);return E.skipEscape=!0,S(y,E)}function _(z,h,v,E){let y={};return E||(z=f(S(z,v),v),h=f(S(h,v),v)),v=v||{},!v.tolerant&&h.scheme?(y.scheme=h.scheme,y.userinfo=h.userinfo,y.host=h.host,y.port=h.port,y.path=o(h.path||""),y.query=h.query):(h.userinfo!==void 0||h.host!==void 0||h.port!==void 0?(y.userinfo=h.userinfo,y.host=h.host,y.port=h.port,y.path=o(h.path||""),y.query=h.query):(h.path?(h.path[0]==="/"?y.path=o(h.path):((z.userinfo!==void 0||z.host!==void 0||z.port!==void 0)&&!z.path?y.path="/"+h.path:z.path?y.path=z.path.slice(0,z.path.lastIndexOf("/")+1)+h.path:y.path=h.path,y.path=o(y.path)),y.query=h.query):(y.path=z.path,h.query!==void 0?y.query=h.query:y.query=z.query),y.userinfo=z.userinfo,y.host=z.host,y.port=z.port),y.scheme=z.scheme),y.fragment=h.fragment,y}function $(z,h,v){return typeof z=="string"?(z=unescape(z),z=S(s(f(z,v),!0),{...v,skipEscape:!0})):typeof z=="object"&&(z=S(s(z,!0),{...v,skipEscape:!0})),typeof h=="string"?(h=unescape(h),h=S(s(f(h,v),!0),{...v,skipEscape:!0})):typeof h=="object"&&(h=S(s(h,!0),{...v,skipEscape:!0})),z.toLowerCase()===h.toLowerCase()}function S(z,h){let v={host:z.host,scheme:z.scheme,userinfo:z.userinfo,port:z.port,path:z.path,query:z.query,nid:z.nid,nss:z.nss,uuid:z.uuid,fragment:z.fragment,reference:z.reference,resourceName:z.resourceName,secure:z.secure,error:""},E=Object.assign({},h),y=[],g=u(E.scheme||v.scheme);g&&g.serialize&&g.serialize(v,E),v.path!==void 0&&(E.skipEscape?v.path=unescape(v.path):(v.path=escape(v.path),v.scheme!==void 0&&(v.path=v.path.split("%3A").join(":")))),E.reference!=="suffix"&&v.scheme&&y.push(v.scheme,":");let R=n(v);if(R!==void 0&&(E.reference!=="suffix"&&y.push("//"),y.push(R),v.path&&v.path[0]!=="/"&&y.push("/")),v.path!==void 0){let I=v.path;!E.absolutePath&&(!g||!g.absolutePath)&&(I=o(I)),R===void 0&&I[0]==="/"&&I[1]==="/"&&(I="/%2F"+I.slice(2)),y.push(I)}return v.query!==void 0&&y.push("?",v.query),v.fragment!==void 0&&y.push("#",v.fragment),y.join("")}let b=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function f(z,h){let v=Object.assign({},h),E={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},y=!1;v.reference==="suffix"&&(v.scheme?z=v.scheme+":"+z:z="//"+z);let g=z.match(b);if(g){if(E.scheme=g[1],E.userinfo=g[3],E.host=g[4],E.port=parseInt(g[5],10),E.path=g[6]||"",E.query=g[7],E.fragment=g[8],isNaN(E.port)&&(E.port=g[5]),E.host)if(a(E.host)===!1){let I=r(E.host);E.host=I.host.toLowerCase(),y=I.isIPV6}else y=!0;E.scheme===void 0&&E.userinfo===void 0&&E.host===void 0&&E.port===void 0&&E.query===void 0&&!E.path?E.reference="same-document":E.scheme===void 0?E.reference="relative":E.fragment===void 0?E.reference="absolute":E.reference="uri",v.reference&&v.reference!=="suffix"&&v.reference!==E.reference&&(E.error=E.error||"URI is not a "+v.reference+" reference.");let R=u(v.scheme||E.scheme);if(!v.unicodeSupport&&(!R||!R.unicodeSupport)&&E.host&&(v.domainHost||R&&R.domainHost)&&y===!1&&i(E.host))try{E.host=URL.domainToASCII(E.host.toLowerCase())}catch(I){E.error=E.error||"Host's domain name can not be converted to ASCII: "+I}(!R||R&&!R.skipNormalize)&&(z.indexOf("%")!==-1&&(E.scheme!==void 0&&(E.scheme=unescape(E.scheme)),E.host!==void 0&&(E.host=unescape(E.host))),E.path&&(E.path=escape(unescape(E.path))),E.fragment&&(E.fragment=encodeURI(decodeURIComponent(E.fragment)))),R&&R.parse&&R.parse(E,v)}else E.error=E.error||"URI can not be parsed.";return E}let m={SCHEMES:c,normalize:d,resolve:p,resolveComponent:_,equal:$,serialize:S,parse:f};t.exports=m,t.exports.default=m,t.exports.fastUri=m}),Av=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xv();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),rl=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Xr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ue();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});let o=wn(),n=Qr(),s=yf(),a=$i(),i=ue(),c=Ri(),u=bi(),d=fe(),p=jv(),_=Av(),$=(C,x)=>new RegExp(C,x);$.code="new RegExp";let S=["removeAdditional","useDefaults","coerceTypes"],b=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),f={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},m={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},z=200;function h(C){var x,V,w,k,q,J,te,de,ae,ze,Fe,T,A,Z,ne,se,le,Ce,je,Le,Ne,Ee,Xe,qe,pt;let ot=C.strict,mt=(x=C.code)===null||x===void 0?void 0:x.optimize,$t=mt===!0||mt===void 0?1:mt||0,wt=(w=(V=C.code)===null||V===void 0?void 0:V.regExp)!==null&&w!==void 0?w:$,Bt=(k=C.uriResolver)!==null&&k!==void 0?k:_.default;return{strictSchema:(J=(q=C.strictSchema)!==null&&q!==void 0?q:ot)!==null&&J!==void 0?J:!0,strictNumbers:(de=(te=C.strictNumbers)!==null&&te!==void 0?te:ot)!==null&&de!==void 0?de:!0,strictTypes:(ze=(ae=C.strictTypes)!==null&&ae!==void 0?ae:ot)!==null&&ze!==void 0?ze:"log",strictTuples:(T=(Fe=C.strictTuples)!==null&&Fe!==void 0?Fe:ot)!==null&&T!==void 0?T:"log",strictRequired:(Z=(A=C.strictRequired)!==null&&A!==void 0?A:ot)!==null&&Z!==void 0?Z:!1,code:C.code?{...C.code,optimize:$t,regExp:wt}:{optimize:$t,regExp:wt},loopRequired:(ne=C.loopRequired)!==null&&ne!==void 0?ne:z,loopEnum:(se=C.loopEnum)!==null&&se!==void 0?se:z,meta:(le=C.meta)!==null&&le!==void 0?le:!0,messages:(Ce=C.messages)!==null&&Ce!==void 0?Ce:!0,inlineRefs:(je=C.inlineRefs)!==null&&je!==void 0?je:!0,schemaId:(Le=C.schemaId)!==null&&Le!==void 0?Le:"$id",addUsedSchema:(Ne=C.addUsedSchema)!==null&&Ne!==void 0?Ne:!0,validateSchema:(Ee=C.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(Xe=C.validateFormats)!==null&&Xe!==void 0?Xe:!0,unicodeRegExp:(qe=C.unicodeRegExp)!==null&&qe!==void 0?qe:!0,int32range:(pt=C.int32range)!==null&&pt!==void 0?pt:!0,uriResolver:Bt}}var v=class{constructor(C={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,C=this.opts={...C,...h(C)};let{es5:x,lines:V}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:b,es5:x,lines:V}),this.logger=D(C.logger);let w=C.validateFormats;C.validateFormats=!1,this.RULES=(0,s.getRules)(),E.call(this,f,C,"NOT SUPPORTED"),E.call(this,m,C,"DEPRECATED","warn"),this._metaOpts=L.call(this),C.formats&&R.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),C.keywords&&I.call(this,C.keywords),typeof C.meta=="object"&&this.addMetaSchema(C.meta),g.call(this),C.validateFormats=w}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:C,meta:x,schemaId:V}=this.opts,w=p;V==="id"&&(w={...p},w.id=w.$id,delete w.$id),x&&C&&this.addMetaSchema(w,w[V],!1)}defaultMeta(){let{meta:C,schemaId:x}=this.opts;return this.opts.defaultMeta=typeof C=="object"?C[x]||C:void 0}validate(C,x){let V;if(typeof C=="string"){if(V=this.getSchema(C),!V)throw new Error(`no schema with key or ref "${C}"`)}else V=this.compile(C);let w=V(x);return"$async"in V||(this.errors=V.errors),w}compile(C,x){let V=this._addSchema(C,x);return V.validate||this._compileSchemaEnv(V)}compileAsync(C,x){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:V}=this.opts;return w.call(this,C,x);async function w(ae,ze){await k.call(this,ae.$schema);let Fe=this._addSchema(ae,ze);return Fe.validate||q.call(this,Fe)}async function k(ae){ae&&!this.getSchema(ae)&&await w.call(this,{$ref:ae},!0)}async function q(ae){try{return this._compileSchemaEnv(ae)}catch(ze){if(!(ze instanceof n.default))throw ze;return J.call(this,ze),await te.call(this,ze.missingSchema),q.call(this,ae)}}function J({missingSchema:ae,missingRef:ze}){if(this.refs[ae])throw new Error(`AnySchema ${ae} is loaded but ${ze} cannot be resolved`)}async function te(ae){let ze=await de.call(this,ae);this.refs[ae]||await k.call(this,ze.$schema),this.refs[ae]||this.addSchema(ze,ae,x)}async function de(ae){let ze=this._loading[ae];if(ze)return ze;try{return await(this._loading[ae]=V(ae))}finally{delete this._loading[ae]}}}addSchema(C,x,V,w=this.opts.validateSchema){if(Array.isArray(C)){for(let q of C)this.addSchema(q,void 0,V,w);return this}let k;if(typeof C=="object"){let{schemaId:q}=this.opts;if(k=C[q],k!==void 0&&typeof k!="string")throw new Error(`schema ${q} must be string`)}return x=(0,c.normalizeId)(x||k),this._checkUnique(x),this.schemas[x]=this._addSchema(C,V,x,w,!0),this}addMetaSchema(C,x,V=this.opts.validateSchema){return this.addSchema(C,x,!0,V),this}validateSchema(C,x){if(typeof C=="boolean")return!0;let V;if(V=C.$schema,V!==void 0&&typeof V!="string")throw new Error("$schema must be a string");if(V=V||this.opts.defaultMeta||this.defaultMeta(),!V)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let w=this.validate(V,C);if(!w&&x){let k="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(k);else throw new Error(k)}return w}getSchema(C){let x;for(;typeof(x=y.call(this,C))=="string";)C=x;if(x===void 0){let{schemaId:V}=this.opts,w=new a.SchemaEnv({schema:{},schemaId:V});if(x=a.resolveSchema.call(this,w,C),!x)return;this.refs[C]=x}return x.validate||this._compileSchemaEnv(x)}removeSchema(C){if(C instanceof RegExp)return this._removeAllSchemas(this.schemas,C),this._removeAllSchemas(this.refs,C),this;switch(typeof C){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let x=y.call(this,C);return typeof x=="object"&&this._cache.delete(x.schema),delete this.schemas[C],delete this.refs[C],this}case"object":{let x=C;this._cache.delete(x);let V=C[this.opts.schemaId];return V&&(V=(0,c.normalizeId)(V),delete this.schemas[V],delete this.refs[V]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(C){for(let x of C)this.addKeyword(x);return this}addKeyword(C,x){let V;if(typeof C=="string")V=C,typeof x=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),x.keyword=V);else if(typeof C=="object"&&x===void 0){if(x=C,V=x.keyword,Array.isArray(V)&&!V.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(G.call(this,V,x),!x)return(0,d.eachItem)(V,k=>pe.call(this,k)),this;be.call(this,x);let w={...x,type:(0,u.getJSONTypes)(x.type),schemaType:(0,u.getJSONTypes)(x.schemaType)};return(0,d.eachItem)(V,w.type.length===0?k=>pe.call(this,k,w):k=>w.type.forEach(q=>pe.call(this,k,w,q))),this}getKeyword(C){let x=this.RULES.all[C];return typeof x=="object"?x.definition:!!x}removeKeyword(C){let{RULES:x}=this;delete x.keywords[C],delete x.all[C];for(let V of x.rules){let w=V.rules.findIndex(k=>k.keyword===C);w>=0&&V.rules.splice(w,1)}return this}addFormat(C,x){return typeof x=="string"&&(x=new RegExp(x)),this.formats[C]=x,this}errorsText(C=this.errors,{separator:x=", ",dataVar:V="data"}={}){return!C||C.length===0?"No errors":C.map(w=>`${V}${w.instancePath} ${w.message}`).reduce((w,k)=>w+x+k)}$dataMetaSchema(C,x){let V=this.RULES.all;C=JSON.parse(JSON.stringify(C));for(let w of x){let k=w.split("/").slice(1),q=C;for(let J of k)q=q[J];for(let J in V){let te=V[J];if(typeof te!="object")continue;let{$data:de}=te.definition,ae=q[J];de&&ae&&(q[J]=he(ae))}}return C}_removeAllSchemas(C,x){for(let V in C){let w=C[V];(!x||x.test(V))&&(typeof w=="string"?delete C[V]:w&&!w.meta&&(this._cache.delete(w.schema),delete C[V]))}}_addSchema(C,x,V,w=this.opts.validateSchema,k=this.opts.addUsedSchema){let q,{schemaId:J}=this.opts;if(typeof C=="object")q=C[J];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof C!="boolean")throw new Error("schema must be object or boolean")}let te=this._cache.get(C);if(te!==void 0)return te;V=(0,c.normalizeId)(q||V);let de=c.getSchemaRefs.call(this,C,V);return te=new a.SchemaEnv({schema:C,schemaId:J,meta:x,baseId:V,localRefs:de}),this._cache.set(te.schema,te),k&&!V.startsWith("#")&&(V&&this._checkUnique(V),this.refs[V]=te),w&&this.validateSchema(C,!0),te}_checkUnique(C){if(this.schemas[C]||this.refs[C])throw new Error(`schema with key or id "${C}" already exists`)}_compileSchemaEnv(C){if(C.meta?this._compileMetaSchema(C):a.compileSchema.call(this,C),!C.validate)throw new Error("ajv implementation error");return C.validate}_compileMetaSchema(C){let x=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,C)}finally{this.opts=x}}};v.ValidationError=o.default,v.MissingRefError=n.default,e.default=v;function E(C,x,V,w="error"){for(let k in C){let q=k;q in x&&this.logger[w](`${V}: option ${k}. ${C[q]}`)}}function y(C){return C=(0,c.normalizeId)(C),this.schemas[C]||this.refs[C]}function g(){let C=this.opts.schemas;if(C)if(Array.isArray(C))this.addSchema(C);else for(let x in C)this.addSchema(C[x],x)}function R(){for(let C in this.opts.formats){let x=this.opts.formats[C];x&&this.addFormat(C,x)}}function I(C){if(Array.isArray(C)){this.addVocabulary(C);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let x in C){let V=C[x];V.keyword||(V.keyword=x),this.addKeyword(V)}}function L(){let C={...this.opts};for(let x of S)delete C[x];return C}let N={log(){},warn(){},error(){}};function D(C){if(C===!1)return N;if(C===void 0)return console;if(C.log&&C.warn&&C.error)return C;throw new Error("logger must implement log, warn and error methods")}let B=/^[a-z_$][a-z0-9_$:-]*$/i;function G(C,x){let{RULES:V}=this;if((0,d.eachItem)(C,w=>{if(V.keywords[w])throw new Error(`Keyword ${w} is already defined`);if(!B.test(w))throw new Error(`Keyword ${w} has invalid name`)}),!!x&&x.$data&&!("code"in x||"validate"in x))throw new Error('$data keyword must have "code" or "validate" function')}function pe(C,x,V){var w;let k=x?.post;if(V&&k)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:q}=this,J=k?q.post:q.rules.find(({type:de})=>de===V);if(J||(J={type:V,rules:[]},q.rules.push(J)),q.keywords[C]=!0,!x)return;let te={keyword:C,definition:{...x,type:(0,u.getJSONTypes)(x.type),schemaType:(0,u.getJSONTypes)(x.schemaType)}};x.before?$e.call(this,J,te,x.before):J.rules.push(te),q.all[C]=te,(w=x.implements)===null||w===void 0||w.forEach(de=>this.addKeyword(de))}function $e(C,x,V){let w=C.rules.findIndex(k=>k.keyword===V);w>=0?C.rules.splice(w,0,x):(C.rules.push(x),this.logger.warn(`rule ${V} is not defined`))}function be(C){let{metaSchema:x}=C;x!==void 0&&(C.$data&&this.opts.$data&&(x=he(x)),C.validateSchema=this.compile(x,!0))}let Oe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function he(C){return{anyOf:[C,Oe]}}}),Mv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=t}),ol=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=Qr(),r=it(),o=ue(),n=at(),s=$i(),a=fe(),i={keyword:"$ref",schemaType:"string",code(d){let{gen:p,schema:_,it:$}=d,{baseId:S,schemaEnv:b,validateName:f,opts:m,self:z}=$,{root:h}=b;if((_==="#"||_==="#/")&&S===h.baseId)return E();let v=s.resolveRef.call(z,h,S,_);if(v===void 0)throw new t.default($.opts.uriResolver,S,_);if(v instanceof s.SchemaEnv)return y(v);return g(v);function E(){if(b===h)return u(d,f,b,b.$async);let R=p.scopeValue("root",{ref:h});return u(d,(0,o._)`${R}.validate`,h,h.$async)}function y(R){u(d,c(d,R),R,R.$async)}function g(R){let I=p.scopeValue("schema",m.code.source===!0?{ref:R,code:(0,o.stringify)(R)}:{ref:R}),L=p.name("valid"),N=d.subschema({schema:R,dataTypes:[],schemaPath:o.nil,topSchemaRef:I,errSchemaPath:_},L);d.mergeEvaluated(N),d.ok(L)}}};function c(d,p){let{gen:_}=d;return p.validate?_.scopeValue("validate",{ref:p.validate}):(0,o._)`${_.scopeValue("wrapper",{ref:p})}.validate`}e.getValidate=c;function u(d,p,_,$){let{gen:S,it:b}=d,{allErrors:f,schemaEnv:m,opts:z}=b,h=z.passContext?n.default.this:o.nil;$?v():E();function v(){if(!m.$async)throw new Error("async schema referenced by sync schema");let R=S.let("valid");S.try(()=>{S.code((0,o._)`await ${(0,r.callValidateCode)(d,p,h)}`),g(p),f||S.assign(R,!0)},I=>{S.if((0,o._)`!(${I} instanceof ${b.ValidationError})`,()=>S.throw(I)),y(I),f||S.assign(R,!1)}),d.ok(R)}function E(){d.result((0,r.callValidateCode)(d,p,h),()=>g(p),()=>y(p))}function y(R){let I=(0,o._)`${R}.errors`;S.assign(n.default.vErrors,(0,o._)`${n.default.vErrors} === null ? ${I} : ${n.default.vErrors}.concat(${I})`),S.assign(n.default.errors,(0,o._)`${n.default.vErrors}.length`)}function g(R){var I;if(!b.opts.unevaluated)return;let L=(I=_?.validate)===null||I===void 0?void 0:I.evaluated;if(b.props!==!0)if(L&&!L.dynamicProps)L.props!==void 0&&(b.props=a.mergeEvaluated.props(S,L.props,b.props));else{let N=S.var("props",(0,o._)`${R}.evaluated.props`);b.props=a.mergeEvaluated.props(S,N,b.props,o.Name)}if(b.items!==!0)if(L&&!L.dynamicItems)L.items!==void 0&&(b.items=a.mergeEvaluated.items(S,L.items,b.items));else{let N=S.var("items",(0,o._)`${R}.evaluated.items`);b.items=a.mergeEvaluated.items(S,N,b.items,o.Name)}}}e.callRef=u,e.default=i}),$f=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Mv(),r=ol(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o}),Lv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=t.operators,o={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},n={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:s,schemaCode:a})=>(0,t.str)`must be ${o[s].okStr} ${a}`,params:({keyword:s,schemaCode:a})=>(0,t._)`{comparison: ${o[s].okStr}, limit: ${a}}`},code(s){let{keyword:a,data:i,schemaCode:c}=s;s.fail$data((0,t._)`${i} ${o[a].fail} ${c} || isNaN(${i})`)}};e.default=n}),Dv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:o})=>(0,t.str)`must be multiple of ${o}`,params:({schemaCode:o})=>(0,t._)`{multipleOf: ${o}}`},code(o){let{gen:n,data:s,schemaCode:a,it:i}=o,c=i.opts.multipleOfPrecision,u=n.let("res"),d=c?(0,t._)`Math.abs(Math.round(${u}) - ${u}) > 1e-${c}`:(0,t._)`${u} !== parseInt(${u})`;o.fail$data((0,t._)`(${a} === 0 || (${u} = ${s}/${a}, ${d}))`)}};e.default=r}),Zv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(r){let o=r.length,n=0,s=0,a;for(;s<o;)n++,a=r.charCodeAt(s++),a>=55296&&a<=56319&&s<o&&(a=r.charCodeAt(s),(a&64512)===56320&&s++);return n}e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'}),Uv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=fe(),o=Zv(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:a}){let i=s==="maxLength"?"more":"fewer";return(0,t.str)`must NOT have ${i} than ${a} characters`},params:({schemaCode:s})=>(0,t._)`{limit: ${s}}`},code(s){let{keyword:a,data:i,schemaCode:c,it:u}=s,d=a==="maxLength"?t.operators.GT:t.operators.LT,p=u.opts.unicode===!1?(0,t._)`${i}.length`:(0,t._)`${(0,r.useFunc)(s.gen,o.default)}(${i})`;s.fail$data((0,t._)`${p} ${d} ${c}`)}};e.default=n}),Vv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=it(),r=fe(),o=ue(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,o.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,o._)`{pattern: ${s}}`},code(s){let{gen:a,data:i,$data:c,schema:u,schemaCode:d,it:p}=s,_=p.opts.unicodeRegExp?"u":"";if(c){let{regExp:$}=p.opts.code,S=$.code==="new RegExp"?(0,o._)`new RegExp`:(0,r.useFunc)(a,$),b=a.let("valid");a.try(()=>a.assign(b,(0,o._)`${S}(${d}, ${_}).test(${i})`),()=>a.assign(b,!1)),s.fail$data((0,o._)`!${b}`)}else{let $=(0,t.usePattern)(s,u);s.fail$data((0,o._)`!${$}.test(${i})`)}}};e.default=n}),Fv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxProperties"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${n} properties`},params:({schemaCode:o})=>(0,t._)`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:a}=o,i=n==="maxProperties"?t.operators.GT:t.operators.LT;o.fail$data((0,t._)`Object.keys(${s}).length ${i} ${a}`)}};e.default=r}),Hv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=it(),r=ue(),o=fe(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,r.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,r._)`{missingProperty: ${s}}`},code(s){let{gen:a,schema:i,schemaCode:c,data:u,$data:d,it:p}=s,{opts:_}=p;if(!d&&i.length===0)return;let $=i.length>=_.loopRequired;if(p.allErrors?S():b(),_.strictRequired){let z=s.parentSchema.properties,{definedProperties:h}=s.it;for(let v of i)if(z?.[v]===void 0&&!h.has(v)){let E=`required property "${v}" is not defined at "${p.schemaEnv.baseId+p.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(p,E,p.opts.strictRequired)}}function S(){if($||d)s.block$data(r.nil,f);else for(let z of i)(0,t.checkReportMissingProp)(s,z)}function b(){let z=a.let("missing");if($||d){let h=a.let("valid",!0);s.block$data(h,()=>m(z,h)),s.ok(h)}else a.if((0,t.checkMissingProp)(s,i,z)),(0,t.reportMissingProp)(s,z),a.else()}function f(){a.forOf("prop",c,z=>{s.setParams({missingProperty:z}),a.if((0,t.noPropertyInData)(a,u,z,_.ownProperties),()=>s.error())})}function m(z,h){s.setParams({missingProperty:z}),a.forOf(z,c,()=>{a.assign(h,(0,t.propertyInData)(a,u,z,_.ownProperties)),a.if((0,r.not)(h),()=>{s.error(),a.break()})},r.nil)}}};e.default=n}),Jv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxItems"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${n} items`},params:({schemaCode:o})=>(0,t._)`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:a}=o,i=n==="maxItems"?t.operators.GT:t.operators.LT;o.fail$data((0,t._)`${s}.length ${i} ${a}`)}};e.default=r}),nl=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=zf();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),Bv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=bi(),r=ue(),o=fe(),n=nl(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:a,j:i}})=>(0,r.str)`must NOT have duplicate items (items ## ${i} and ${a} are identical)`,params:({params:{i:a,j:i}})=>(0,r._)`{i: ${a}, j: ${i}}`},code(a){let{gen:i,data:c,$data:u,schema:d,parentSchema:p,schemaCode:_,it:$}=a;if(!u&&!d)return;let S=i.let("valid"),b=p.items?(0,t.getSchemaTypes)(p.items):[];a.block$data(S,f,(0,r._)`${_} === false`),a.ok(S);function f(){let v=i.let("i",(0,r._)`${c}.length`),E=i.let("j");a.setParams({i:v,j:E}),i.assign(S,!0),i.if((0,r._)`${v} > 1`,()=>(m()?z:h)(v,E))}function m(){return b.length>0&&!b.some(v=>v==="object"||v==="array")}function z(v,E){let y=i.name("item"),g=(0,t.checkDataTypes)(b,y,$.opts.strictNumbers,t.DataType.Wrong),R=i.const("indices",(0,r._)`{}`);i.for((0,r._)`;${v}--;`,()=>{i.let(y,(0,r._)`${c}[${v}]`),i.if(g,(0,r._)`continue`),b.length>1&&i.if((0,r._)`typeof ${y} == "string"`,(0,r._)`${y} += "_"`),i.if((0,r._)`typeof ${R}[${y}] == "number"`,()=>{i.assign(E,(0,r._)`${R}[${y}]`),a.error(),i.assign(S,!1).break()}).code((0,r._)`${R}[${y}] = ${v}`)})}function h(v,E){let y=(0,o.useFunc)(i,n.default),g=i.name("outer");i.label(g).for((0,r._)`;${v}--;`,()=>i.for((0,r._)`${E} = ${v}; ${E}--;`,()=>i.if((0,r._)`${y}(${c}[${v}], ${c}[${E}])`,()=>{a.error(),i.assign(S,!1).break(g)})))}}};e.default=s}),Kv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=fe(),o=nl(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,t._)`{allowedValue: ${s}}`},code(s){let{gen:a,data:i,$data:c,schemaCode:u,schema:d}=s;c||d&&typeof d=="object"?s.fail$data((0,t._)`!${(0,r.useFunc)(a,o.default)}(${i}, ${u})`):s.fail((0,t._)`${d} !== ${i}`)}};e.default=n}),Gv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=fe(),o=nl(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,t._)`{allowedValues: ${s}}`},code(s){let{gen:a,data:i,$data:c,schema:u,schemaCode:d,it:p}=s;if(!c&&u.length===0)throw new Error("enum must have non-empty array");let _=u.length>=p.opts.loopEnum,$,S=()=>$??($=(0,r.useFunc)(a,o.default)),b;if(_||c)b=a.let("valid"),s.block$data(b,f);else{if(!Array.isArray(u))throw new Error("ajv implementation error");let z=a.const("vSchema",d);b=(0,t.or)(...u.map((h,v)=>m(z,v)))}s.pass(b);function f(){a.assign(b,!1),a.forOf("v",d,z=>a.if((0,t._)`${S()}(${i}, ${z})`,()=>a.assign(b,!0).break()))}function m(z,h){let v=u[h];return typeof v=="object"&&v!==null?(0,t._)`${S()}(${i}, ${z}[${h}])`:(0,t._)`${i} === ${v}`}}};e.default=n}),wf=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Lv(),r=Dv(),o=Uv(),n=Vv(),s=Fv(),a=Hv(),i=Jv(),c=Bv(),u=Kv(),d=Gv(),p=[t.default,r.default,o.default,n.default,s.default,a.default,i.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,d.default];e.default=p}),Ef=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=ue(),r=fe(),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,t.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,t._)`{limit: ${s}}`},code(s){let{parentSchema:a,it:i}=s,{items:c}=a;if(!Array.isArray(c)){(0,r.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,c)}};function n(s,a){let{gen:i,schema:c,data:u,keyword:d,it:p}=s;p.items=!0;let _=i.const("len",(0,t._)`${u}.length`);if(c===!1)s.setParams({len:a.length}),s.pass((0,t._)`${_} <= ${a.length}`);else if(typeof c=="object"&&!(0,r.alwaysValidSchema)(p,c)){let S=i.var("valid",(0,t._)`${_} <= ${a.length}`);i.if((0,t.not)(S),()=>$(S)),s.ok(S)}function $(S){i.forRange("i",a.length,_,b=>{s.subschema({keyword:d,dataProp:b,dataPropType:r.Type.Num},S),p.allErrors||i.if((0,t.not)(S),()=>i.break())})}}e.validateAdditionalItems=n,e.default=o}),Pf=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=ue(),r=fe(),o=it(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(a){let{schema:i,it:c}=a;if(Array.isArray(i))return s(a,"additionalItems",i);c.items=!0,!(0,r.alwaysValidSchema)(c,i)&&a.ok((0,o.validateArray)(a))}};function s(a,i,c=a.schema){let{gen:u,parentSchema:d,data:p,keyword:_,it:$}=a;f(d),$.opts.unevaluated&&c.length&&$.items!==!0&&($.items=r.mergeEvaluated.items(u,c.length,$.items));let S=u.name("valid"),b=u.const("len",(0,t._)`${p}.length`);c.forEach((m,z)=>{(0,r.alwaysValidSchema)($,m)||(u.if((0,t._)`${b} > ${z}`,()=>a.subschema({keyword:_,schemaProp:z,dataProp:z},S)),a.ok(S))});function f(m){let{opts:z,errSchemaPath:h}=$,v=c.length,E=v===m.minItems&&(v===m.maxItems||m[i]===!1);if(z.strictTuples&&!E){let y=`"${_}" is ${v}-tuple, but minItems or maxItems/${i} are not specified or different at path "${h}"`;(0,r.checkStrictMode)($,y,z.strictTuples)}}}e.validateTuple=s,e.default=n}),Wv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Pf(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o=>(0,t.validateTuple)(o,"items")};e.default=r}),Yv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=fe(),o=it(),n=Ef(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,t.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,t._)`{limit: ${a}}`},code(a){let{schema:i,parentSchema:c,it:u}=a,{prefixItems:d}=c;u.items=!0,!(0,r.alwaysValidSchema)(u,i)&&(d?(0,n.validateAdditionalItems)(a,d):a.ok((0,o.validateArray)(a)))}};e.default=s}),Xv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=fe(),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:n,max:s}})=>s===void 0?(0,t.str)`must contain at least ${n} valid item(s)`:(0,t.str)`must contain at least ${n} and no more than ${s} valid item(s)`,params:({params:{min:n,max:s}})=>s===void 0?(0,t._)`{minContains: ${n}}`:(0,t._)`{minContains: ${n}, maxContains: ${s}}`},code(n){let{gen:s,schema:a,parentSchema:i,data:c,it:u}=n,d,p,{minContains:_,maxContains:$}=i;u.opts.next?(d=_===void 0?1:_,p=$):d=1;let S=s.const("len",(0,t._)`${c}.length`);if(n.setParams({min:d,max:p}),p===void 0&&d===0){(0,r.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(p!==void 0&&d>p){(0,r.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(u,a)){let h=(0,t._)`${S} >= ${d}`;p!==void 0&&(h=(0,t._)`${h} && ${S} <= ${p}`),n.pass(h);return}u.items=!0;let b=s.name("valid");p===void 0&&d===1?m(b,()=>s.if(b,()=>s.break())):d===0?(s.let(b,!0),p!==void 0&&s.if((0,t._)`${c}.length > 0`,f)):(s.let(b,!1),f()),n.result(b,()=>n.reset());function f(){let h=s.name("_valid"),v=s.let("count",0);m(h,()=>s.if(h,()=>z(v)))}function m(h,v){s.forRange("i",0,S,E=>{n.subschema({keyword:"contains",dataProp:E,dataPropType:r.Type.Num,compositeRule:!0},h),v()})}function z(h){s.code((0,t._)`${h}++`),p===void 0?s.if((0,t._)`${h} >= ${d}`,()=>s.assign(b,!0).break()):(s.if((0,t._)`${h} > ${p}`,()=>s.assign(b,!1).break()),d===1?s.assign(b,!0):s.if((0,t._)`${h} >= ${d}`,()=>s.assign(b,!0)))}}};e.default=o}),sl=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=ue(),r=fe(),o=it();e.error={message:({params:{property:c,depsCount:u,deps:d}})=>{let p=u===1?"property":"properties";return(0,t.str)`must have ${p} ${d} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:d,missingProperty:p}})=>(0,t._)`{property: ${c},
71
+ missingProperty: ${p},
72
+ depsCount: ${u},
73
+ deps: ${d}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){let[u,d]=s(c);a(c,u),i(c,d)}};function s({schema:c}){let u={},d={};for(let p in c){if(p==="__proto__")continue;let _=Array.isArray(c[p])?u:d;_[p]=c[p]}return[u,d]}function a(c,u=c.schema){let{gen:d,data:p,it:_}=c;if(Object.keys(u).length===0)return;let $=d.let("missing");for(let S in u){let b=u[S];if(b.length===0)continue;let f=(0,o.propertyInData)(d,p,S,_.opts.ownProperties);c.setParams({property:S,depsCount:b.length,deps:b.join(", ")}),_.allErrors?d.if(f,()=>{for(let m of b)(0,o.checkReportMissingProp)(c,m)}):(d.if((0,t._)`${f} && (${(0,o.checkMissingProp)(c,b,$)})`),(0,o.reportMissingProp)(c,$),d.else())}}e.validatePropertyDeps=a;function i(c,u=c.schema){let{gen:d,data:p,keyword:_,it:$}=c,S=d.name("valid");for(let b in u)(0,r.alwaysValidSchema)($,u[b])||(d.if((0,o.propertyInData)(d,p,b,$.opts.ownProperties),()=>{let f=c.subschema({keyword:_,schemaProp:b},S);c.mergeValidEvaluated(f,S)},()=>d.var(S,!0)),c.ok(S))}e.validateSchemaDeps=i,e.default=n}),Qv=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=fe(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>(0,t._)`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:a,data:i,it:c}=n;if((0,r.alwaysValidSchema)(c,a))return;let u=s.name("valid");s.forIn("key",i,d=>{n.setParams({propertyName:d}),n.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},u),s.if((0,t.not)(u),()=>{n.error(!0),c.allErrors||s.break()})}),n.ok(u)}};e.default=o}),Tf=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=it(),r=ue(),o=at(),n=fe(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:a})=>(0,r._)`{additionalProperty: ${a.additionalProperty}}`},code(a){let{gen:i,schema:c,parentSchema:u,data:d,errsCount:p,it:_}=a;if(!p)throw new Error("ajv implementation error");let{allErrors:$,opts:S}=_;if(_.props=!0,S.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(_,c))return;let b=(0,t.allSchemaProperties)(u.properties),f=(0,t.allSchemaProperties)(u.patternProperties);m(),a.ok((0,r._)`${p} === ${o.default.errors}`);function m(){i.forIn("key",d,y=>{!b.length&&!f.length?v(y):i.if(z(y),()=>v(y))})}function z(y){let g;if(b.length>8){let R=(0,n.schemaRefOrVal)(_,u.properties,"properties");g=(0,t.isOwnProperty)(i,R,y)}else b.length?g=(0,r.or)(...b.map(R=>(0,r._)`${y} === ${R}`)):g=r.nil;return f.length&&(g=(0,r.or)(g,...f.map(R=>(0,r._)`${(0,t.usePattern)(a,R)}.test(${y})`))),(0,r.not)(g)}function h(y){i.code((0,r._)`delete ${d}[${y}]`)}function v(y){if(S.removeAdditional==="all"||S.removeAdditional&&c===!1){h(y);return}if(c===!1){a.setParams({additionalProperty:y}),a.error(),$||i.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(_,c)){let g=i.name("valid");S.removeAdditional==="failing"?(E(y,g,!1),i.if((0,r.not)(g),()=>{a.reset(),h(y)})):(E(y,g),$||i.if((0,r.not)(g),()=>i.break()))}}function E(y,g,R){let I={keyword:"additionalProperties",dataProp:y,dataPropType:n.Type.Str};R===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),a.subschema(I,g)}}};e.default=s}),ey=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Xr(),r=it(),o=fe(),n=Tf(),s={keyword:"properties",type:"object",schemaType:"object",code(a){let{gen:i,schema:c,parentSchema:u,data:d,it:p}=a;p.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(p,n.default,"additionalProperties"));let _=(0,r.allSchemaProperties)(c);for(let m of _)p.definedProperties.add(m);p.opts.unevaluated&&_.length&&p.props!==!0&&(p.props=o.mergeEvaluated.props(i,(0,o.toHash)(_),p.props));let $=_.filter(m=>!(0,o.alwaysValidSchema)(p,c[m]));if($.length===0)return;let S=i.name("valid");for(let m of $)b(m)?f(m):(i.if((0,r.propertyInData)(i,d,m,p.opts.ownProperties)),f(m),p.allErrors||i.else().var(S,!0),i.endIf()),a.it.definedProperties.add(m),a.ok(S);function b(m){return p.opts.useDefaults&&!p.compositeRule&&c[m].default!==void 0}function f(m){a.subschema({keyword:"properties",schemaProp:m,dataProp:m},S)}}};e.default=s}),ty=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=it(),r=ue(),o=fe(),n=fe(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(a){let{gen:i,schema:c,data:u,parentSchema:d,it:p}=a,{opts:_}=p,$=(0,t.allSchemaProperties)(c),S=$.filter(E=>(0,o.alwaysValidSchema)(p,c[E]));if($.length===0||S.length===$.length&&(!p.opts.unevaluated||p.props===!0))return;let b=_.strictSchema&&!_.allowMatchingProperties&&d.properties,f=i.name("valid");p.props!==!0&&!(p.props instanceof r.Name)&&(p.props=(0,n.evaluatedPropsToName)(i,p.props));let{props:m}=p;z();function z(){for(let E of $)b&&h(E),p.allErrors?v(E):(i.var(f,!0),v(E),i.if(f))}function h(E){for(let y in b)new RegExp(E).test(y)&&(0,o.checkStrictMode)(p,`property ${y} matches pattern ${E} (use allowMatchingProperties)`)}function v(E){i.forIn("key",u,y=>{i.if((0,r._)`${(0,t.usePattern)(a,E)}.test(${y})`,()=>{let g=S.includes(E);g||a.subschema({keyword:"patternProperties",schemaProp:E,dataProp:y,dataPropType:n.Type.Str},f),p.opts.unevaluated&&m!==!0?i.assign((0,r._)`${m}[${y}]`,!0):!g&&!p.allErrors&&i.if((0,r.not)(f),()=>i.break())})})}}};e.default=s}),ry=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fe(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:s,it:a}=o;if((0,t.alwaysValidSchema)(a,s)){o.fail();return}let i=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),o.failResult(i,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r}),oy=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:it().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t}),ny=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=fe(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>(0,t._)`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:a,parentSchema:i,it:c}=n;if(!Array.isArray(a))throw new Error("ajv implementation error");if(c.opts.discriminator&&i.discriminator)return;let u=a,d=s.let("valid",!1),p=s.let("passing",null),_=s.name("_valid");n.setParams({passing:p}),s.block($),n.result(d,()=>n.reset(),()=>n.error(!0));function $(){u.forEach((S,b)=>{let f;(0,r.alwaysValidSchema)(c,S)?s.var(_,!0):f=n.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},_),b>0&&s.if((0,t._)`${_} && ${d}`).assign(d,!1).assign(p,(0,t._)`[${p}, ${b}]`).else(),s.if(_,()=>{s.assign(d,!0),s.assign(p,b),f&&n.mergeEvaluated(f,t.Name)})})}}};e.default=o}),sy=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fe(),r={keyword:"allOf",schemaType:"array",code(o){let{gen:n,schema:s,it:a}=o;if(!Array.isArray(s))throw new Error("ajv implementation error");let i=n.name("valid");s.forEach((c,u)=>{if((0,t.alwaysValidSchema)(a,c))return;let d=o.subschema({keyword:"allOf",schemaProp:u},i);o.ok(i),o.mergeEvaluated(d)})}};e.default=r}),ay=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=fe(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,t.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,t._)`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:a,parentSchema:i,it:c}=s;i.then===void 0&&i.else===void 0&&(0,r.checkStrictMode)(c,'"if" without "then" and "else" is ignored');let u=n(c,"then"),d=n(c,"else");if(!u&&!d)return;let p=a.let("valid",!0),_=a.name("_valid");if($(),s.reset(),u&&d){let b=a.let("ifClause");s.setParams({ifClause:b}),a.if(_,S("then",b),S("else",b))}else u?a.if(_,S("then")):a.if((0,t.not)(_),S("else"));s.pass(p,()=>s.error(!0));function $(){let b=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},_);s.mergeEvaluated(b)}function S(b,f){return()=>{let m=s.subschema({keyword:b},_);a.assign(p,_),s.mergeValidEvaluated(m,p),f?a.assign(f,(0,t._)`${b}`):s.setParams({ifClause:b})}}}};function n(s,a){let i=s.schema[a];return i!==void 0&&!(0,r.alwaysValidSchema)(s,i)}e.default=o}),iy=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fe(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:o,parentSchema:n,it:s}){n.if===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "if" is ignored`)}};e.default=r}),kf=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ef(),r=Wv(),o=Pf(),n=Yv(),s=Xv(),a=sl(),i=Qv(),c=Tf(),u=ey(),d=ty(),p=ry(),_=oy(),$=ny(),S=sy(),b=ay(),f=iy();function m(z=!1){let h=[p.default,_.default,$.default,S.default,b.default,f.default,i.default,c.default,a.default,u.default,d.default];return z?h.push(r.default,n.default):h.push(t.default,o.default),h.push(s.default),h}e.default=m}),cy=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,t.str)`must match format "${o}"`,params:({schemaCode:o})=>(0,t._)`{format: ${o}}`},code(o,n){let{gen:s,data:a,$data:i,schema:c,schemaCode:u,it:d}=o,{opts:p,errSchemaPath:_,schemaEnv:$,self:S}=d;if(!p.validateFormats)return;i?b():f();function b(){let m=s.scopeValue("formats",{ref:S.formats,code:p.code.formats}),z=s.const("fDef",(0,t._)`${m}[${u}]`),h=s.let("fType"),v=s.let("format");s.if((0,t._)`typeof ${z} == "object" && !(${z} instanceof RegExp)`,()=>s.assign(h,(0,t._)`${z}.type || "string"`).assign(v,(0,t._)`${z}.validate`),()=>s.assign(h,(0,t._)`"string"`).assign(v,z)),o.fail$data((0,t.or)(E(),y()));function E(){return p.strictSchema===!1?t.nil:(0,t._)`${u} && !${v}`}function y(){let g=$.$async?(0,t._)`(${z}.async ? await ${v}(${a}) : ${v}(${a}))`:(0,t._)`${v}(${a})`,R=(0,t._)`(typeof ${v} == "function" ? ${g} : ${v}.test(${a}))`;return(0,t._)`${v} && ${v} !== true && ${h} === ${n} && !${R}`}}function f(){let m=S.formats[c];if(!m){E();return}if(m===!0)return;let[z,h,v]=y(m);z===n&&o.pass(g());function E(){if(p.strictSchema===!1){S.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${c}" ignored in schema at path "${_}"`}}function y(R){let I=R instanceof RegExp?(0,t.regexpCode)(R):p.code.formats?(0,t._)`${p.code.formats}${(0,t.getProperty)(c)}`:void 0,L=s.scopeValue("formats",{key:c,ref:R,code:I});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,t._)`${L}.validate`]:["string",R,L]}function g(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!$.$async)throw new Error("async format in sync schema");return(0,t._)`await ${v}(${a})`}return typeof h=="function"?(0,t._)`${v}(${a})`:(0,t._)`${v}.test(${a})`}}}};e.default=r}),Cf=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[cy().default];e.default=t}),If=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),Of=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=$f(),r=wf(),o=kf(),n=Cf(),s=If(),a=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=a}),uy=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(r){r.Tag="tag",r.Mapping="mapping"})(t||(e.DiscrError=t={}))}),al=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=uy(),o=$i(),n=Qr(),s=fe(),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:i,tagName:c}})=>i===r.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:i,tag:c,tagName:u}})=>(0,t._)`{error: ${i}, tag: ${u}, tagValue: ${c}}`},code(i){let{gen:c,data:u,schema:d,parentSchema:p,it:_}=i,{oneOf:$}=p;if(!_.opts.discriminator)throw new Error("discriminator: requires discriminator option");let S=d.propertyName;if(typeof S!="string")throw new Error("discriminator: requires propertyName");if(d.mapping)throw new Error("discriminator: mapping is not supported");if(!$)throw new Error("discriminator: requires oneOf keyword");let b=c.let("valid",!1),f=c.const("tag",(0,t._)`${u}${(0,t.getProperty)(S)}`);c.if((0,t._)`typeof ${f} == "string"`,()=>m(),()=>i.error(!1,{discrError:r.DiscrError.Tag,tag:f,tagName:S})),i.ok(b);function m(){let v=h();c.if(!1);for(let E in v)c.elseIf((0,t._)`${f} === ${E}`),c.assign(b,z(v[E]));c.else(),i.error(!1,{discrError:r.DiscrError.Mapping,tag:f,tagName:S}),c.endIf()}function z(v){let E=c.name("valid"),y=i.subschema({keyword:"oneOf",schemaProp:v},E);return i.mergeEvaluated(y,t.Name),E}function h(){var v;let E={},y=R(p),g=!0;for(let N=0;N<$.length;N++){let D=$[N];if(D?.$ref&&!(0,s.schemaHasRulesButRef)(D,_.self.RULES)){let G=D.$ref;if(D=o.resolveRef.call(_.self,_.schemaEnv.root,_.baseId,G),D instanceof o.SchemaEnv&&(D=D.schema),D===void 0)throw new n.default(_.opts.uriResolver,_.baseId,G)}let B=(v=D?.properties)===null||v===void 0?void 0:v[S];if(typeof B!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${S}"`);g=g&&(y||R(D)),I(B,N)}if(!g)throw new Error(`discriminator: "${S}" must be required`);return E;function R({required:N}){return Array.isArray(N)&&N.includes(S)}function I(N,D){if(N.const)L(N.const,D);else if(N.enum)for(let B of N.enum)L(B,D);else throw new Error(`discriminator: "properties/${S}" must have "const" or "enum"`)}function L(N,D){if(typeof N!="string"||N in E)throw new Error(`discriminator: "${S}" values must be unique strings`);E[N]=D}}}};e.default=a}),ly=U((e,t)=>{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),Nf=U((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=rl(),o=Of(),n=al(),s=ly(),a=["/properties"],i="http://json-schema.org/draft-07/schema";var c=class extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach($=>this.addVocabulary($)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema($,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var u=Xr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=ue();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var p=wn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return p.default}});var _=Qr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return _.default}})}),jf=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=ue(),r=at(),o=$i(),n=ol(),s={keyword:"$dynamicAnchor",schemaType:"string",code:c=>a(c,c.schema)};function a(c,u){let{gen:d,it:p}=c;p.schemaEnv.root.dynamicAnchors[u]=!0;let _=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,$=p.errSchemaPath==="#"?p.validateName:i(c);d.if((0,t._)`!${_}`,()=>d.assign(_,$))}e.dynamicAnchor=a;function i(c){let{schemaEnv:u,schema:d,self:p}=c.it,{root:_,baseId:$,localRefs:S,meta:b}=u.root,{schemaId:f}=p.opts,m=new o.SchemaEnv({schema:d,schemaId:f,root:_,baseId:$,localRefs:S,meta:b});return o.compileSchema.call(p,m),(0,n.getValidate)(c,m)}e.default=s}),qf=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=ue(),r=at(),o=ol(),n={keyword:"$dynamicRef",schemaType:"string",code:a=>s(a,a.schema)};function s(a,i){let{gen:c,keyword:u,it:d}=a;if(i[0]!=="#")throw new Error(`"${u}" only supports hash fragment reference`);let p=i.slice(1);if(d.allErrors)_();else{let S=c.let("valid",!1);_(S),a.ok(S)}function _(S){if(d.schemaEnv.root.dynamicAnchors[p]){let b=c.let("_v",(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(p)}`);c.if(b,$(b,S),$(d.validateName,S))}else $(d.validateName,S)()}function $(S,b){return b?()=>c.block(()=>{(0,o.callRef)(a,S),c.let(b,!0)}):()=>(0,o.callRef)(a,S)}}e.dynamicRef=s,e.default=n}),dy=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=jf(),r=fe(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,t.dynamicAnchor)(n,""):(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o}),py=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=qf(),r={keyword:"$recursiveRef",schemaType:"string",code:o=>(0,t.dynamicRef)(o,o.schema)};e.default=r}),xf=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=jf(),r=qf(),o=dy(),n=py(),s=[t.default,r.default,o.default,n.default];e.default=s}),my=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=sl(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:o=>(0,t.validatePropertyDeps)(o)};e.default=r}),hy=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=sl(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:o=>(0,t.validateSchemaDeps)(o)};e.default=r}),fy=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fe(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:o,parentSchema:n,it:s}){n.contains===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "contains" is ignored`)}};e.default=r}),Af=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=my(),r=hy(),o=fy(),n=[t.default,r.default,o.default];e.default=n}),gy=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=fe(),o=at(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>(0,t._)`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:a,schema:i,data:c,errsCount:u,it:d}=s;if(!u)throw new Error("ajv implementation error");let{allErrors:p,props:_}=d;_ instanceof t.Name?a.if((0,t._)`${_} !== true`,()=>a.forIn("key",c,f=>a.if(S(_,f),()=>$(f)))):_!==!0&&a.forIn("key",c,f=>_===void 0?$(f):a.if(b(_,f),()=>$(f))),d.props=!0,s.ok((0,t._)`${u} === ${o.default.errors}`);function $(f){if(i===!1){s.setParams({unevaluatedProperty:f}),s.error(),p||a.break();return}if(!(0,r.alwaysValidSchema)(d,i)){let m=a.name("valid");s.subschema({keyword:"unevaluatedProperties",dataProp:f,dataPropType:r.Type.Str},m),p||a.if((0,t.not)(m),()=>a.break())}}function S(f,m){return(0,t._)`!${f} || !${f}[${m}]`}function b(f,m){let z=[];for(let h in f)f[h]===!0&&z.push((0,t._)`${m} !== ${h}`);return(0,t.and)(...z)}}};e.default=n}),_y=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ue(),r=fe(),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>(0,t.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,t._)`{limit: ${n}}`},code(n){let{gen:s,schema:a,data:i,it:c}=n,u=c.items||0;if(u===!0)return;let d=s.const("len",(0,t._)`${i}.length`);if(a===!1)n.setParams({len:u}),n.fail((0,t._)`${d} > ${u}`);else if(typeof a=="object"&&!(0,r.alwaysValidSchema)(c,a)){let _=s.var("valid",(0,t._)`${d} <= ${u}`);s.if((0,t.not)(_),()=>p(_,u)),n.ok(_)}c.items=!0;function p(_,$){s.forRange("i",$,d,S=>{n.subschema({keyword:"unevaluatedItems",dataProp:S,dataPropType:r.Type.Num},_),c.allErrors||s.if((0,t.not)(_),()=>s.break())})}}};e.default=o}),Mf=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=gy(),r=_y(),o=[t.default,r.default];e.default=o}),Sy=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),vy=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),yy=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),by=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),zy=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),Ry=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),$y=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),wy=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Sy(),r=vy(),o=yy(),n=by(),s=zy(),a=Ry(),i=$y(),c=["/properties"];function u(d){return[t,r,o,n,p(this,s),a,p(this,i)].forEach(_=>this.addMetaSchema(_,void 0,!1)),this;function p(_,$){return d?_.$dataMetaSchema($,c):$}}e.default=u}),Ey=U((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let r=rl(),o=Of(),n=xf(),s=Af(),a=Mf(),i=al(),c=wy(),u="https://json-schema.org/draft/2019-09/schema";var d=class extends r.default{constructor(b={}){super({...b,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach(b=>this.addVocabulary(b)),this.addVocabulary(s.default),this.addVocabulary(a.default),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:b,meta:f}=this.opts;f&&(c.default.call(this,b),this.refs["http://json-schema.org/schema"]=u)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}};e.Ajv2019=d,t.exports=e=d,t.exports.Ajv2019=d,Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var p=Xr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return p.KeywordCxt}});var _=ue();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return _._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return _.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return _.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return _.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return _.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return _.CodeGen}});var $=wn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return $.default}});var S=Qr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return S.default}})}),Py=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=$f(),r=wf(),o=kf(),n=xf(),s=Af(),a=Mf(),i=Cf(),c=If(),u=[n.default,t.default,r.default,(0,o.default)(!0),i.default,c.metadataVocabulary,c.contentVocabulary,s.default,a.default];e.default=u}),Ty=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}}),ky=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}}),Cy=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}}),Iy=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}}),Oy=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}}),Ny=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}}),jy=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),qy=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),xy=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ty(),r=ky(),o=Cy(),n=Iy(),s=Oy(),a=Ny(),i=jy(),c=qy(),u=["/properties"];function d(p){return[t,r,o,n,s,_(this,a),i,_(this,c)].forEach($=>this.addMetaSchema($,void 0,!1)),this;function _($,S){return p?$.$dataMetaSchema(S,u):S}}e.default=d}),Ay=U((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let r=rl(),o=Py(),n=al(),s=xy(),a="https://json-schema.org/draft/2020-12/schema";var i=class extends r.default{constructor(_={}){super({..._,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(_=>this.addVocabulary(_)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:_,meta:$}=this.opts;$&&(s.default.call(this,_),this.refs["http://json-schema.org/schema"]=a)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}};e.Ajv2020=i,t.exports=e=i,t.exports.Ajv2020=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var c=Xr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=ue();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=wn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=Qr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})}),My=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(N,D){return{validate:N,compare:D}}e.fullFormats={date:t(s,a),time:t(c(!0),u),"date-time":t(_(!0),$),"iso-time":t(c(),d),"iso-date-time":t(_(),S),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:m,"uri-reference":/^(?:[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,"uri-template":/^(?:(?:[^\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,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|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-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{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,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([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,regex:L,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:h,int32:{type:"number",validate:y},int64:{type:"number",validate:g},float:{type:"number",validate:R},double:{type:"number",validate:R},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,$),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,S),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(N){return N%4===0&&(N%100!==0||N%400===0)}let o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(N){let D=o.exec(N);if(!D)return!1;let B=+D[1],G=+D[2],pe=+D[3];return G>=1&&G<=12&&pe>=1&&pe<=(G===2&&r(B)?29:n[G])}function a(N,D){if(N&&D)return N>D?1:N<D?-1:0}let i=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(N){return function(B){let G=i.exec(B);if(!G)return!1;let pe=+G[1],$e=+G[2],be=+G[3],Oe=G[4],he=G[5]==="-"?-1:1,C=+(G[6]||0),x=+(G[7]||0);if(C>23||x>59||N&&!Oe)return!1;if(pe<=23&&$e<=59&&be<60)return!0;let V=$e-x*he,w=pe-C*he-(V<0?1:0);return(w===23||w===-1)&&(V===59||V===-1)&&be<61}}function u(N,D){if(!(N&&D))return;let B=new Date("2020-01-01T"+N).valueOf(),G=new Date("2020-01-01T"+D).valueOf();if(B&&G)return B-G}function d(N,D){if(!(N&&D))return;let B=i.exec(N),G=i.exec(D);if(B&&G)return N=B[1]+B[2]+B[3],D=G[1]+G[2]+G[3],N>D?1:N<D?-1:0}let p=/t|\s/i;function _(N){let D=c(N);return function(G){let pe=G.split(p);return pe.length===2&&s(pe[0])&&D(pe[1])}}function $(N,D){if(!(N&&D))return;let B=new Date(N).valueOf(),G=new Date(D).valueOf();if(B&&G)return B-G}function S(N,D){if(!(N&&D))return;let[B,G]=N.split(p),[pe,$e]=D.split(p),be=a(B,pe);if(be!==void 0)return be||u(G,$e)}let b=/\/|:/,f=/^(?:[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 m(N){return b.test(N)&&f.test(N)}let z=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function h(N){return z.lastIndex=0,z.test(N)}let v=-(2**31),E=2**31-1;function y(N){return Number.isInteger(N)&&N<=E&&N>=v}function g(N){return Number.isInteger(N)}function R(){return!0}let I=/[^\\]\\Z/;function L(N){if(I.test(N))return!1;try{return new RegExp(N),!0}catch{return!1}}}),Ly=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=Nf(),r=ue(),o=r.operators,n={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:i,schemaCode:c})=>(0,r.str)`should be ${n[i].okStr} ${c}`,params:({keyword:i,schemaCode:c})=>(0,r._)`{comparison: ${n[i].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(i){let{gen:c,data:u,schemaCode:d,keyword:p,it:_}=i,{opts:$,self:S}=_;if(!$.validateFormats)return;let b=new t.KeywordCxt(_,S.RULES.all.format.definition,"format");b.$data?f():m();function f(){let h=c.scopeValue("formats",{ref:S.formats,code:$.code.formats}),v=c.const("fmt",(0,r._)`${h}[${b.schemaCode}]`);i.fail$data((0,r.or)((0,r._)`typeof ${v} != "object"`,(0,r._)`${v} instanceof RegExp`,(0,r._)`typeof ${v}.compare != "function"`,z(v)))}function m(){let h=b.schema,v=S.formats[h];if(!v||v===!0)return;if(typeof v!="object"||v instanceof RegExp||typeof v.compare!="function")throw new Error(`"${p}": format "${h}" does not define "compare" function`);let E=c.scopeValue("formats",{key:h,ref:v,code:$.code.formats?(0,r._)`${$.code.formats}${(0,r.getProperty)(h)}`:void 0});i.fail$data(z(E))}function z(h){return(0,r._)`${h}.compare(${u}, ${d}) ${n[p].fail} 0`}},dependencies:["format"]};let a=i=>(i.addKeyword(e.formatLimitDefinition),i);e.default=a}),Dy=U((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=My(),o=Ly(),n=ue(),s=new n.Name("fullFormats"),a=new n.Name("fastFormats"),i=(u,d={keywords:!0})=>{if(Array.isArray(d))return c(u,d,r.fullFormats,s),u;let[p,_]=d.mode==="fast"?[r.fastFormats,a]:[r.fullFormats,s];return c(u,d.formats||r.formatNames,p,_),d.keywords&&(0,o.default)(u),u};i.get=(u,d="full")=>{let p=(d==="fast"?r.fastFormats:r.fullFormats)[u];if(!p)throw new Error(`Unknown format "${u}"`);return p};function c(u,d,p,_){var $,S;($=(S=u.opts.code).formats)!==null&&$!==void 0||(S.formats=(0,n._)`require("ajv-formats/dist/formats").${_}`);for(let b of d)u.addFormat(b,p[b])}t.exports=e=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i}),Lf=Nf(),Zy=Ey(),Uy=Ay(),Vy=Bn(Dy(),1),Fy=Vy.default;function tl(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Fy(t),t}var wi=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=tl(Uy.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=_l(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");return t==="2020-12"?this.ajv:t==="2019-09"?this._ajv2019??=tl(Zy.Ajv2019):this._ajvDraft7??=tl(Lf.Ajv)}getValidator(e){let t=this._engineFor(e),r="$id"in e&&typeof e.$id=="string"?t.getSchema(e.$id)??t.compile(e):t.compile(e);return o=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(r.errors)}}},T0=Lf.Ajv;var Ei=ig(require("node:process"),1);var Kf=Symbol.for("mcp.completable");function cl(e){return!!e&&typeof e=="object"&&Kf in e}function Jy(e){return e[Kf]?.complete}var SR=2**31-1;function By(e,t){switch(t.kind){case"tools_list_changed":return e.toolsListChanged===!0;case"prompts_list_changed":return e.promptsListChanged===!0;case"resources_list_changed":return e.resourcesListChanged===!0;case"resource_updated":return e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.includes(t.uri)}}function Ky(e,t){let r={},o=n=>t===void 0||n===!0;return e.toolsListChanged===!0&&o(t?.tools?.listChanged)&&(r.toolsListChanged=!0),e.promptsListChanged===!0&&o(t?.prompts?.listChanged)&&(r.promptsListChanged=!0),e.resourcesListChanged===!0&&o(t?.resources?.listChanged)&&(r.resourcesListChanged=!0),e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.length>0&&o(t?.resources?.subscribe)&&(r.resourceSubscriptions=[...e.resourceSubscriptions]),r}var Pi=1024;function Df(e,t){return{method:e.method,params:{...e.params,_meta:{...e.params?._meta,[cr]:t}}}}function Gy(e){let t=Vt(Rn).validateRequest("subscriptions/listen",e);return t.ok?t.value.params?.notifications:void 0}var Wy=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]),Gf=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor(e=Pi,t,r){this._maxSubscriptions=e,this._serverCapabilities=t,this._serverInfo=r}setServerCapabilities(e,t){this._serverCapabilities=e,t!==void 0&&(this._serverInfo=t)}has(e){return this._subs.has(e)}serve(e){if(this._serverCapabilities===void 0)throw new Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return{jsonrpc:"2.0",id:e.id,error:{code:-32603,message:"Subscription limit reached"}};let t=Gy(e);if(t===void 0)return{jsonrpc:"2.0",id:e.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let r=Ky(t,this._serverCapabilities);return this._subs.set(e.id,r),Df({method:"notifications/subscriptions/acknowledged",params:{notifications:r}},e.id)}cancel(e){return this._subs.delete(e)}routeOutbound(e){if(!Wy.has(e.method))return"passthrough";let t=e.params?.uri,r=typeof t=="string"?t:void 0,o=Yy(e.method,r),n=[];for(let[s,a]of this._subs)By(a,o)&&n.push(Df({method:e.method,params:e.params??{}},s));return n}teardownAll(){let e=[];for(let t of this._subs.keys())e.push({jsonrpc:"2.0",id:t,result:{resultType:"complete",_meta:{[cr]:t,...this._serverInfo!==void 0&&{[dt]:this._serverInfo}}}});return this._subs.clear(),e}};function Yy(e,t){switch(e){case"notifications/tools/list_changed":return{kind:"tools_list_changed"};case"notifications/prompts/list_changed":return{kind:"prompts_list_changed"};case"notifications/resources/list_changed":return{kind:"resources_list_changed"};default:return{kind:"resource_updated",uri:t??""}}}var Xy=8,Qy=6e5;function eb(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw new RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw new RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??Xy,roundTimeoutMs:e?.roundTimeoutMs??Qy,legacyShim:e?.legacyShim??!0}}function Wf(e,t,r){if(r===null||typeof r!="object"||typeof r.method!="string")throw new ee(H.InternalError,`Handler for ${e} returned an invalid input request '${t}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let o=r,n=Dh(o);if(n===void 0)throw new ee(H.InternalError,`Handler for ${e} returned an input request '${t}' of kind '${o.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:o,required:n}}function tb(){let e=globalThis.crypto;if(e?.randomUUID!==void 0)return e.randomUUID();let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let r=[...t].map(o=>o.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function il(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new ee(H.InternalError,t)}var rb=class{constructor(e){this._host=e}async fulfill(e,t,r,o,n){let{maxRounds:s,roundTimeoutMs:a}=this._host,i=o.mcpReq.signal,c=n,u=0;for(;;){if(u+=1,u>s)return il(e,uf(e,s));let d=c.inputRequests,p=d!=null&&Object.keys(d).length>0,_=typeof c.requestState=="string"?c.requestState:void 0;if(!p&&_===void 0)throw new ee(H.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let $;if(p){let f=this._host.resolvedClientCapabilities(o),m=[];for(let[h,v]of Object.entries(d)){let{embedded:E,required:y}=Wf(e,h,v);if(E.method!=="roots/list"&&E.params===void 0)throw new ee(H.InternalError,`Handler for ${e} returned an input request '${h}' of kind '${E.method}' without params`);if(ui(y,f)!==void 0)return il(e,`Cannot request input '${h}' (${E.method}): the client on this 2025-era connection did not declare the required capability${f===void 0?" (no client capabilities are available on this connection \u2014 per-request legacy serving cannot receive server-to-client requests)":""}`);m.push([h,E])}let z=df(i);try{let h={relatedRequestId:o.mcpReq.id,timeout:a,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:z.signal},v=await Promise.all(m.map(async([E,y])=>{try{return[E,await this._dispatchLeg(y,h)]}catch(g){throw z.abort(g),g}}));$=Object.fromEntries(v)}catch(h){if(i.aborted)throw h;return il(e,`Fulfilling input required by '${e}' failed: ${h instanceof Error?h.message:String(h)}`)}finally{z.dispose()}}else await lf(cf,i);let S={...o,mcpReq:{...o.mcpReq,inputResponses:$,droppedInputResponseKeys:void 0,requestState:$n(_)}};if(_!==void 0){let f=await this._host.verifyRequestState(_,S,e);f!==void 0&&(S=Ku(S,f))}let b=await t(r,S);if(!Rt(b))return b;c=b}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;return r.mode==="url"&&r.elicitationId===void 0&&(r={...r,elicitationId:tb()}),await this._host.sendElicitation(r,t)}case"sampling/createMessage":return await this._host.sendSampling(e.params,t);case"roots/list":return await this._host.listRoots(e.params,t)}}},ob=new Set(["tools/call","prompts/get","resources/read"]),nb,Yf,Xf;function ul(e,t){Yf(e,t)}function ll(e){return Xf(e)}var Ti=class extends Wu{_clientCapabilities;_clientVersion;static{nb=(e,t)=>{t.clientCapabilities!==void 0&&(e._clientCapabilities=t.clientCapabilities),t.clientInfo!==void 0&&(e._clientVersion=t.clientInfo)},Yf=(e,t)=>{let r=t.filter(o=>!e._supportedProtocolVersions.includes(o));r.length>0&&(e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r]),e.setRequestHandler("server/discover",()=>e._ondiscover())},Xf=e=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new rb({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:e=>this._inputRequestCapabilityView(e),verifyRequestState:(e,t,r)=>this._verifyRequestState(e,t,r),sendElicitation:(e,t)=>this._sendElicitationLeg(e,t,{validateAcceptedContent:!1}),sendSampling:(e,t)=>this.createMessage(e,t),listRoots:(e,t)=>this.listRoots(e,t)})}oninitialized;constructor(e,t){if(super(t),this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new wi,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=eb(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))o!==void 0&&Lu(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}this.setRequestHandler("initialize",r=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),Nu(this._supportedProtocolVersions).length>0&&this.setRequestHandler("server/discover",()=>this._ondiscover()),this._capabilities.logging&&this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(e,t)=>{let r=t.sessionId||t.http?.req?.headers.get("mcp-session-id")||void 0,{level:o}=e.params,n=_i(Zt,o);return n.success&&this._loggingLevels.set(r,n.data),{}})}buildContext(e,t){let r=e.http||t?.request||t?.closeSSEStream||t?.closeStandaloneSSEStream;return{...e,mcpReq:{...e.mcpReq,log:(o,n,s)=>{if(!this._capabilities.logging)return Promise.resolve();let a;if(this._servedModernEra()){if(a=e.mcpReq.envelope?.[qt],a===void 0)return Promise.resolve()}else a=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);return a!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(a)?Promise.resolve():e.mcpReq.notify({method:"notifications/message",params:{level:o,data:n,logger:s}})},elicitInput:(o,n)=>this.elicitInput(o,n),requestSampling:(o,n)=>this.createMessage(o,n)},http:r?{...e.http,req:t?.request,closeSSE:t?.closeSSEStream,closeStandaloneSSE:t?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(Zt.options.map((e,t)=>[e,t]));isMessageIgnored=(e,t)=>{let r=this._loggingLevels.get(t);return r?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r):!1};registerCapabilities(e){if(this.transport)throw new ce(me.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;this._capabilities=Yu(this._capabilities,e),!t&&this._capabilities.logging&&this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=ob.has(e);return r===void 0&&!o?async(n,s)=>{let a=await t(n,s);if(Rt(a))throw new ee(H.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return a}:async(n,s)=>{let a=o?await this._invokeInputRequiredCapableHandler(e,t,n,s):await t(n,s);if(Rt(a)){if(!o)throw new ee(H.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return a}return r===void 0?a:li(a,r)}}return async(r,o)=>{let n=Vt(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new ee(s.reason==="not-in-era"?H.InternalError:H.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let a=await this._invokeInputRequiredCapableHandler("tools/call",t,r,o);if(Rt(a))return a;let i=ju(a),c=n.validateResult("tools/call",i);if(!c.ok)throw new ee(c.reason==="not-in-era"?H.InternalError:H.InvalidParams,c.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${c.message}`);return c.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&Wr(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(e,t,r,o){let n=this._servedModernEra(),s=o.mcpReq.requestState();if(s!==void 0&&typeof s!="string")throw new ee(H.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let a=o;if(typeof s=="string"){let p=await this._verifyRequestState(s,o,e);p!==void 0&&(a=Ku(o,p))}let i;try{i=await t(r,a)}catch(p){throw p instanceof ee&&p.code===H.UrlElicitationRequired&&n?new ee(H.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { \u2026: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`):p}if(!Rt(i))return i;if(!n){if(!this._inputRequiredServing.legacyShim)throw new ee(H.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??ir}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,a,i)}let c=i.inputRequests,u=c!=null&&Object.keys(c).length>0,d=typeof i.requestState=="string";if(!u&&!d)throw new ee(H.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(u){let p=this._inputRequestCapabilityView(o);for(let[_,$]of Object.entries(c)){let{embedded:S,required:b}=Wf(e,_,$),f=ui(b,p);if(f!==void 0)throw new pi({requiredCapabilities:f},`Cannot request input '${_}' (${S.method}): the request's client capabilities do not declare the required capability`)}}return i}async _verifyRequestState(e,t,r){if(this._requestStateVerify!==void 0)try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(new Error(`requestState verification rejected ${r}: ${o instanceof Error?o.message:String(o)}`)),new ee(H.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[bt]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new ce(me.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${e}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead \u2014 the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:e,era:"2026-07-28"})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new ce(me.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new ce(me.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new ce(me.CapabilityNotSupported,`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new ce(me.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new ce(me.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new ce(me.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new ce(me.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new ce(me.CapabilityNotSupported,`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"completion/complete":if(!this._capabilities.completions)throw new ce(me.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new ce(me.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new ce(me.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new ce(me.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new ce(me.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;let r=Uh(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??ir;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:Nu(this._supportedProtocolVersions),capabilities:sb(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(e,t){return this._wireCodec().projectCallToolResult(e,t)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(e,t){if(this._assertPushApiInServedEra("sampling/createMessage"),(e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new ce(me.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages.at(-1),a=Array.isArray(s.content)?s.content:[s.content],i=a.some(p=>p.type==="tool_result"),c=e.messages.length>1?e.messages.at(-2):void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],d=u.some(p=>p.type==="tool_use");if(i){if(a.some(p=>p.type!=="tool_result"))throw new ee(H.InvalidParams,"The last message must contain only tool_result content if any is present");if(!d)throw new ee(H.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(d){let p=new Set(u.filter($=>$.type==="tool_use").map($=>$.id)),_=new Set(a.filter($=>$.type==="tool_result").map($=>$.toolUseId));if(p.size!==_.size||![...p].every($=>_.has($)))throw new ee(H.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=!!(e.tools||e.toolChoice),o=await this.request({method:"sampling/createMessage",params:e},t),n=this._wireCodec().samplingResultVariant(r,o);if(!n.ok)throw new ce(me.InvalidResult,`Invalid sampling/createMessage result: ${n.reason==="invalid"?n.message:n.reason}`);return n.value}async elicitInput(e,t){switch(this._assertPushApiInServedEra("elicitation/create"),e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new ce(me.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new ce(me.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(e,t)}async _sendElicitationLeg(e,t,r){let o=e.mode??"form",n=r?.validateAcceptedContent??!0;switch(o){case"url":{let s=e;return this.request({method:"elicitation/create",params:s},t)}case"form":{let s=e.mode==="form"?e:{...e,mode:"form"},a=await this.request({method:"elicitation/create",params:s},t);if(n&&a.action==="accept"&&a.content&&s.requestedSchema)try{let i=this._jsonSchemaValidator.getValidator(s.requestedSchema)(a.content);if(!i.valid)throw new ee(H.InvalidParams,`Elicitation response content does not match requested schema: ${i.errorMessage}`)}catch(i){throw i instanceof ee?i:new ee(H.InternalError,`Error validating elicitation response: ${i instanceof Error?i.message:String(i)}`)}return a}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new ce(me.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:e},t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function sb(e){return{...e}}var dl=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(!(t===void 0||!t.enabled)){if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return Uf;try{let r=Jt(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}}constructor(e,t){this.server=new Ti(e,t),t?.capabilities?.tools&&this.setToolRequestHandlers(),t?.capabilities?.resources&&this.setResourceRequestHandlers(),t?.capabilities?.prompts&&this.setPromptRequestHandlers()}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}_toolHandlersInitialized=!1;setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?Jt(t.inputSchema,"input"):Uf,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};return t.outputSchema&&(r.outputSchema=Jt(t.outputSchema,"output")),r})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let r=this._registeredTools[e.params.name];if(!r)throw new ee(H.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new ee(H.InvalidParams,`Tool ${e.params.name} disabled`);try{let o=await this.validateToolInput(r,e.params.arguments,e.params.name),n=await this.executeToolHandler(r,o,t);return await this.validateToolOutput(r,n,e.params.name),Rt(n)?n:this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(o){if(o instanceof ee&&o.code===H.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(!e.inputSchema)return;let o=await dr(e.inputSchema,t??{});if(!o.success)throw new ee(H.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${o.error}`);return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema||Rt(t)||t.isError)return;if(t.structuredContent===void 0)throw new ee(H.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let o=await dr(e.outputSchema,t.structuredContent);if(!o.success)throw new ee(H.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${o.error}`)}async executeToolHandler(e,t,r){return e.executor(t,r)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async e=>{switch(e.params.ref.type){case"ref/prompt":return Uu(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Vu(e),this.handleResourceCompletion(e,e.params.ref);default:throw new ee(H.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new ee(H.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new ee(H.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return En;let o=Bf(Jf(r.argsSchema)?.[e.params.argument.name]);if(!cl(o))return En;let n=Jy(o);return n?Hf(await n(e.params.argument.value,e.params.context)):En}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find(n=>n.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return En;throw new ee(H.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);return o?Hf(await o(e.params.argument.value,e.params.context)):En}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([n,s])=>s.enabled).map(([n,s])=>({uri:n,name:s.name,...s.metadata})),o=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let s=await n.resourceTemplate.listCallback(t);for(let a of s.resources)o.push({...n.metadata,...a})}return{resources:[...r,...o]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler("resources/read",async(e,t)=>{let r;try{r=new URL(e.params.uri)}catch{throw new ee(H.InvalidParams,`Resource URI ${e.params.uri} is invalid`,{uri:e.params.uri,reason:"invalid_uri"})}let o=this._registeredResources[r.toString()];if(o){if(!o.enabled)throw new ee(H.InvalidParams,`Resource ${r} disabled`);return li(await o.readCallback(r,t),o.cacheHint)}for(let n of Object.values(this._registeredResourceTemplates)){let s=n.resourceTemplate.uriTemplate.match(r.toString());if(s)return li(await n.readCallback(r,s,t),n.cacheHint)}throw new di(e.params.uri)}),this._resourceHandlersInitialized=!0)}_promptHandlersInitialized=!1;setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?af(t.argsSchema):void 0,icons:t.icons,_meta:t._meta}))})),this.server.setRequestHandler("prompts/get",async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new ee(H.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new ee(H.InvalidParams,`Prompt ${e.params.name} disabled`);return r.handler(e.params.arguments,t)}),this._promptHandlersInitialized=!0)}registerResource(e,t,r,o){let n=r.cacheHint,s=r;if(n!==void 0){Lu(n,`resource ${e}`);let a={...r};delete a.cacheHint,s=a}if(typeof t=="string"){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);let a=this._createRegisteredResource(e,r.title,t,s,o);return n!==void 0&&(a.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let a=this._createRegisteredResourceTemplate(e,r.title,t,s,o);return n!==void 0&&(a.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}}_createRegisteredResource(e,t,r,o,n){let s={name:e,title:t,metadata:o,readCallback:n,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:a=>{a.uri!==void 0&&a.uri!==r&&(delete this._registeredResources[r],a.uri&&(this._registeredResources[a.uri]=s)),a.name!==void 0&&(s.name=a.name),a.title!==void 0&&(s.title=a.title),a.metadata!==void 0&&(s.metadata=a.metadata),a.callback!==void 0&&(s.readCallback=a.callback),a.enabled!==void 0&&(s.enabled=a.enabled),this.sendResourceListChanged()}};return this._registeredResources[r]=s,s}_createRegisteredResourceTemplate(e,t,r,o,n){let s={resourceTemplate:r,title:t,metadata:o,readCallback:n,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:i=>{i.name!==void 0&&i.name!==e&&(delete this._registeredResourceTemplates[e],i.name&&(this._registeredResourceTemplates[i.name]=s)),i.title!==void 0&&(s.title=i.title),i.template!==void 0&&(s.resourceTemplate=i.template),i.metadata!==void 0&&(s.metadata=i.metadata),i.callback!==void 0&&(s.readCallback=i.callback),i.enabled!==void 0&&(s.enabled=i.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let a=r.uriTemplate.variableNames;return Array.isArray(a)&&a.some(i=>!!r.completeCallback(i))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(e,t,r,o,n,s,a){let i=o,c=n,u={title:t,description:r,argsSchema:o,icons:s,_meta:a,handler:Ff(e,o,n),enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:d=>{d.name!==void 0&&d.name!==e&&(delete this._registeredPrompts[e],d.name&&(this._registeredPrompts[d.name]=u)),d.title!==void 0&&(u.title=d.title),d.description!==void 0&&(u.description=d.description),d.icons!==void 0&&(u.icons=d.icons),d._meta!==void 0&&(u._meta=d._meta);let p=!1;d.argsSchema!==void 0&&(u.argsSchema=d.argsSchema,i=d.argsSchema,p=!0),d.callback!==void 0&&(c=d.callback,p=!0),p&&(u.handler=Ff(e,i,c)),d.enabled!==void 0&&(u.enabled=d.enabled),this.sendPromptListChanged()}};if(this._registeredPrompts[e]=u,o){let d=Jf(o);d&&Object.values(d).some(p=>cl(Bf(p)))&&this.setCompletionRequestHandler()}return u}_createRegisteredTool(e,t,r,o,n,s,a,i,c,u){if(el(e),o!==void 0)try{let _=Jt(o,"input");this._toolInputSchemaJson[e]=_;let $=Fu(_);$.valid||console.warn(`[mcp-sdk] tool '${e}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${$.reason}`)}catch{}let d=u,p={title:t,description:r,inputSchema:o,outputSchema:n,outputSchemaJson:Vf(n),annotations:s,icons:a,execution:i,_meta:c,handler:u,executor:Zf(o,u),enabled:!0,disable:()=>p.update({enabled:!1}),enable:()=>p.update({enabled:!0}),remove:()=>p.update({name:null}),update:_=>{_.name!==void 0&&_.name!==e&&(typeof _.name=="string"&&el(_.name),delete this._registeredTools[e],delete this._toolInputSchemaJson[e],_.name&&(delete this._toolInputSchemaJson[_.name],this._registeredTools[_.name]=p,e=_.name)),_.title!==void 0&&(p.title=_.title),_.description!==void 0&&(p.description=_.description);let $=!1;_.paramsSchema!==void 0&&(p.inputSchema=_.paramsSchema,delete this._toolInputSchemaJson[e],$=!0),_.callback!==void 0&&(p.handler=_.callback,d=_.callback,$=!0),$&&(p.executor=Zf(p.inputSchema,d)),_.outputSchema!==void 0&&(p.outputSchema=_.outputSchema,p.outputSchemaJson=Vf(_.outputSchema)),_.annotations!==void 0&&(p.annotations=_.annotations),_.icons!==void 0&&(p.icons=_.icons),_._meta!==void 0&&(p._meta=_._meta),_.enabled!==void 0&&(p.enabled=_.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=p,this.setToolRequestHandlers(),this.sendToolListChanged(),p}registerTool(e,t,r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:o,description:n,inputSchema:s,outputSchema:a,annotations:i,icons:c,_meta:u}=t;return this._createRegisteredTool(e,o,n,Si(s),Si(a),i,c,void 0,u,r)}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:o,description:n,argsSchema:s,icons:a,_meta:i}=t,c=this._createRegisteredPrompt(e,o,n,Si(s),r,a,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};function Zf(e,t){if(e){let o=t;return async(n,s)=>o(n,s)}let r=t;return async(o,n)=>r(n)}var Uf={type:"object",properties:{}};function Vf(e){if(e!==void 0)try{return Jt(e,"output")}catch{return}}function Ff(e,t,r){if(t){let o=r;return async(n,s)=>{let a=await dr(t,n);if(!a.success)throw new ee(H.InvalidParams,`Invalid arguments for prompt ${e}: ${a.error}`);return o(a.data,s)}}else{let o=r;return async(n,s)=>o(s)}}function Hf(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var En={completion:{values:[],hasMore:!1}};function Jf(e){let t=e;if(t.shape&&typeof t.shape=="object")return t.shape}function ab(e){return e?.type==="optional"}function Bf(e){return ab(e)?e.def?.innerType??e:e}var ib=class{_readBuffer;_started=!1;_closed=!1;constructor(e=Ei.default.stdin,t=Ei.default.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new Xu({maxBufferSize:r?.maxBufferSize})}onclose;onerror;onmessage;_ondata=e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(t){this.onerror?.(t),this.close().catch(()=>{})}};_onerror=e=>{this.onerror?.(e)};_onstdouterror=e=>{this.onerror?.(e),this.close().catch(()=>{})};async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._closed||(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdout.off("error",this._onstdouterror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.())}send(e){return this._closed?Promise.reject(new Error("StdioServerTransport is closed")):new Promise((t,r)=>{let o=Qu(e),n=!1,s=i=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",a),r(i))},a=()=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",a),t())};if(this._stdout.once("error",s),this._stdout.write(o)){if(n)return;n=!0,this._stdout.off("error",s),t()}else n||this._stdout.once("drain",a)})}},Qf=3e3,cb=class{onclose;onerror;onmessage;_closed=!1;_pendingRequests=new Set;_drainWaiters=[];constructor(e,t,r){this._wire=e,this._onInstanceClose=t,this._outboundIntercept=r}async start(){}async send(e,t){if(bn(e)||gi(e)){let{id:r}=e;r!==void 0&&this._settle(r)}if(!this._closed&&this._outboundIntercept?.(e)!=="handled")return this._wire.send(e,t)}setProtocolVersion=e=>{this._wire.setProtocolVersion?.(e)};deliver(e,t){if(!this._closed){if(rt(e))this._pendingRequests.add(e.id);else if(Ht(e)&&e.method==="notifications/cancelled"){let r=e.params?.requestId;r!==void 0&&this._settle(r)}this.onmessage?.(e,t)}}async whenRequestsAnswered(e){return this._closed||this._pendingRequests.size===0?!0:await new Promise(t=>{let r=()=>{clearTimeout(o),t(!0)},o=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter(n=>n!==r),t(!1)},e);this._drainWaiters.push(r)})}async close(){if(!this._closed){this._closed=!0,this._pendingRequests.clear(),this._releaseDrainWaiters();try{this._onInstanceClose()}finally{this.onclose?.()}}}_settle(e){this._pendingRequests.delete(e),this._pendingRequests.size===0&&this._releaseDrainWaiters()}_releaseDrainWaiters(){let e=this._drainWaiters;this._drainWaiters=[];for(let t of e)t()}};function ub(e){let t=e.params;if(e.method==="initialize"&&!Hu(t)){let s=t!==null&&typeof t=="object"&&typeof t.protocolVersion=="string"?t.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...s!==void 0&&{requestedVersion:s}}}if(!mi(t))return{kind:"legacy",reason:"no-claim"};let r=mr(t),o=(r===void 0?[]:fi(r))[0];if(o!==void 0)return{kind:"invalid-envelope",issue:o};let n=hi(t);return n===void 0||!Ft.includes(n)?{kind:"unsupported-revision",requested:n??"unknown"}:{kind:"modern",revision:n,classification:{era:"modern",revision:n}}}function eg(e,t={}){let r=t.legacy??"serve",o=t.transport??new ib,n={phase:"opening"},s,a=!1,i=()=>a||n.phase==="closed",c=R=>{try{t.onerror?.(R)}catch{}},u=(R,I,L,N)=>o.send({jsonrpc:"2.0",id:R,error:{code:I,message:L,...N!==void 0&&{data:N}}}).catch(D=>c(ct(D))),d=new Gf(t.maxSubscriptions??Pi),p=R=>{if(!Ht(R))return;let I=d.routeOutbound(R);if(I!=="passthrough"){for(let L of I)o.send({jsonrpc:"2.0",...L}).catch(N=>c(ct(N)));return"handled"}},_=async R=>{if(rt(R)&&R.method==="subscriptions/listen"){let I=mr(R.params),L=mi(R.params)?(I===void 0?[]:fi(I))[0]:{key:"_meta",problem:"the per-request envelope is required on protocol revision 2026-07-28"},N=hi(R.params),D;if(L!==void 0)D={jsonrpc:"2.0",id:R.id,error:{code:-32602,message:`Invalid _meta envelope: ${L.key}: ${L.problem}`}};else if(N===void 0||!Ft.includes(N)){let B=new Yr({supported:[...Ft],requested:N??"unknown"});D={jsonrpc:"2.0",id:R.id,error:{code:B.code,message:B.message,data:B.data}}}else D=d.serve(R);return await o.send("error"in D?D:{jsonrpc:"2.0",method:D.method,params:D.params}).catch(B=>c(ct(B))),!0}if(Ht(R)&&R.method==="notifications/cancelled"){let I=R.params?.requestId;if(I!==void 0&&d.cancel(I))return!0}return!1},$=(R,I,L)=>{let N=Ju({kind:"legacy",reason:I,...L!==void 0&&{requestedVersion:L}},Ft);return N===void 0?Promise.resolve():(c(new Error(`Rejected 2025-era request on a modern-only stdio connection (${N.cell}): ${N.message}`)),u(R.id,N.code,N.message,N.data))},S=R=>{a||R===s||y()},b=async(R,I)=>{let L=await e({era:R}),N=L instanceof dl?L.server:L;R==="modern"&&(Gu(N,I),ul(N,Ft),d.setServerCapabilities(N.getCapabilities(),ll(N)));let D=new cb(o,()=>S(D),R==="modern"?p:void 0);return await L.connect(D),{product:L,channel:D}},f=R=>R.product.close().catch(I=>c(ct(I))),m=async R=>{s=R.channel;try{await R.channel.whenRequestsAnswered(Qf)||c(new Error(`Discarded the probe instance with requests still unanswered after ${Qf}ms; continuing with the fallback`)),await R.product.close()}catch(I){c(ct(I))}finally{s=void 0}},z=async R=>{if(n.phase==="closed")return;if(n.phase==="pinned"){if(n.era==="modern"&&rt(R)&&R.method==="initialize"&&!Hu(R.params)){await $(R,"initialize",R.params!==null&&typeof R.params=="object"&&typeof R.params.protocolVersion=="string"?R.params.protocolVersion:void 0);return}if(n.era==="modern"&&await _(R))return;n.instance.channel.deliver(R);return}if(!rt(R)&&!Ht(R)){c(new Error("Discarded a JSON-RPC response received before the connection negotiated an era"));return}let I=ub(R);switch(I.kind){case"invalid-envelope":{let L=`Invalid _meta envelope for protocol revision 2026-07-28: ${I.issue.key}: ${I.issue.problem}`;rt(R)?await u(R.id,H.InvalidParams,L,{envelope:I.issue}):c(new Error(`Discarded a notification with a malformed envelope: ${L}`));return}case"unsupported-revision":if(rt(R)){let L=new Yr({supported:[...Ft],requested:I.requested});c(L),await u(R.id,L.code,L.message,L.data)}else c(new Error(`Discarded a notification claiming unsupported protocol revision ${I.requested}`));return;case"modern":if(rt(R)&&R.method==="server/discover"){if(n.phase==="probe"){n.instance.channel.deliver(R,{classification:I.classification});return}let L=await b("modern",I.revision);if(i()){await f(L);return}n={phase:"probe",instance:L},L.channel.deliver(R,{classification:I.classification});return}if(n.phase==="probe"){if(Ht(R)){n.instance.channel.deliver(R,{classification:I.classification});return}n={phase:"pinned",era:"modern",instance:n.instance}}else{let L=await b("modern",I.revision);if(i()){await f(L);return}n={phase:"pinned",era:"modern",instance:L}}if(await _(R))return;n.instance.channel.deliver(R,{classification:I.classification});return;case"legacy":{if(r==="reject"){rt(R)&&await $(R,I.reason,I.requestedVersion);return}if(n.phase==="probe"){if(await m(n.instance),i())return;n={phase:"opening"}}let L=await b("legacy");if(i()){await f(L);return}n={phase:"pinned",era:"legacy",instance:L},n.instance.channel.deliver(R);return}}},h=[],v=!1,E=async()=>{if(!v){v=!0;try{for(;h.length>0;){let R=h.shift();try{await z(R)}catch(I){rt(R)&&await u(R.id,H.InternalError,"Internal server error"),c(ct(I))}}}finally{v=!1}}},y=async()=>{if(a||n.phase==="closed")return;a=!0;let R=n;n={phase:"closed"};for(let I of d.teardownAll())await o.send(I).catch(L=>c(ct(L)));(R.phase==="probe"||R.phase==="pinned")&&await R.instance.product.close().catch(I=>c(ct(I))),await o.close().catch(I=>c(ct(I)))};o.onmessage=R=>{h.push(R),E()},o.onerror=R=>{c(R),(n.phase==="probe"||n.phase==="pinned")&&n.instance.channel.onerror?.(R)},o.onclose=()=>{if(a||n.phase==="closed")return;a=!0;let R=n;n={phase:"closed"},(R.phase==="probe"||R.phase==="pinned")&&R.instance.product.close().catch(I=>c(ct(I)))};let g=o.start().catch(R=>{throw c(ct(R)),R});return g.catch(()=>{}),{close:async()=>{await g.catch(()=>{}),await y()}}}function ct(e){return e instanceof Error?e:new Error(String(e))}0&&(module.exports={ProtocolError,ProtocolErrorCode,Server,serveStdio});
74
+ /*! For license information please see mcpSdk.js.LEGAL.txt */