Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

382 KB
Raw Blame
{
	"html": "<!doctype html><html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><style>\n:root{color-scheme:light dark;font:14px -apple-system,BlinkMacSystemFont,\"Segoe UI\",sans-serif}body{margin:0;background:Canvas;color:CanvasText}.card{padding:20px;max-width:680px}.brand{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#4f67d9}h1{font-size:21px;line-height:1.3;margin:8px 0 12px}h2{font-size:13px;margin:24px 0 10px}p{line-height:1.55}button{font:inherit;cursor:pointer}.open{background:#4f67d9;color:white;border:0;border-radius:8px;padding:9px 13px}.cue{display:flex;gap:14px;width:100%;padding:11px 0;text-align:left;color:inherit;background:transparent;border:0;border-top:1px solid #8885}.cue strong{min-width:42px;color:#4f67d9}.cue span{line-height:1.4}.more{font-size:12px;opacity:.7}\n</style></head><body><main class=\"card\"><div class=\"brand\">Cap</div><h1 id=\"title\">Recording</h1><p id=\"summary\">Loading recording context…</p><button class=\"open\" id=\"open\" type=\"button\">Open in Cap</button><h2 id=\"status\">Transcript</h2><div id=\"cues\"></div></main><script>(()=>{var{create:ok,defineProperty:Ba,getOwnPropertyDescriptor:nk,getOwnPropertyNames:sk,getPrototypeOf:ik}=Object,ak=Object.prototype.hasOwnProperty,Vd=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Jd=(e,t)=>{let r={};for(var o in e)Ba(r,o,{get:e[o],enumerable:!0});if(t)Ba(r,Symbol.toStringTag,{value:\"Module\"});return r},ck=(e,t,r,o)=>{if(t&&typeof t===\"object\"||typeof t===\"function\"){for(var n=sk(t),i=0,s=n.length,a;i<s;i++)if(a=n[i],!ak.call(e,a)&&a!==r)Ba(e,a,{get:((c)=>t[c]).bind(null,a),enumerable:!(o=nk(t,a))||o.enumerable})}return e},Hd=(e,t,r)=>(r=e!=null?ok(ik(e)):{},ck(t||!e||!e.__esModule?Ba(r,\"default\",{value:e,enumerable:!0}):r,e));var uk=new Set([\"https://json-schema.org/draft/2019-09/schema\",\"http://json-schema.org/draft/2019-09/schema\"]);function Bd(e){return typeof e===\"string\"&&uk.has(e.replace(/#$/,\"\"))}var Wd,Au=Object.freeze({status:\"aborted\"});function _(e,t,r){function o(a,c){if(!a._zod)Object.defineProperty(a,\"_zod\",{value:{def:c,constr:s,traits:new Set},enumerable:!1});if(a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=s.prototype,l=Object.keys(u);for(let m=0;m<l.length;m++){let h=l[m];if(!(h in a))a[h]=u[h].bind(a)}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,\"name\",{value:e});function s(a){var c;let u=r?.Parent?new i:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(s,\"init\",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:(a)=>{if(r?.Parent&&a instanceof r.Parent)return!0;return a?._zod?.traits?.has(e)}}),Object.defineProperty(s,\"name\",{value:e}),s}var lk=Symbol(\"zod_brand\");class $t extends Error{constructor(){super(\"Encountered Promise during synchronous parse. Use .parseAsync() instead.\")}}class Yn extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name=\"ZodEncodeError\"}}(Wd=globalThis).__zod_globalConfig??(Wd.__zod_globalConfig={});var So=globalThis.__zod_globalConfig;function Je(e){if(e)Object.assign(So,e);return So}function Ga(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 Mu(e,t=\"|\"){return e.map((r)=>Du(r)).join(t)}function Qn(e,t){if(typeof t===\"bigint\")return t.toString();return t}function Xn(e){return{get value(){{let r=e();return Object.defineProperty(this,\"value\",{value:r}),r}throw Error(\"cached value already set\")}}}function Ka(e){return e===null||e===void 0}function Ya(e){let t=e.startsWith(\"^\")?1:0,r=e.endsWith(\"$\")?e.length-1:e.length;return e.slice(t,r)}function Kd(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}var Gd=Symbol(\"evaluating\");function H(e,t,r){let o=void 0;Object.defineProperty(e,t,{get(){if(o===Gd)return;if(o===void 0)o=Gd,o=r();return o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function wr(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Vt(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function qu(e){return JSON.stringify(e)}function Yd(e){return e.toLowerCase().trim().replace(/[^\\w\\s-]/g,\"\").replace(/[\\s_-]+/g,\"-\").replace(/^-+|-+$/g,\"\")}var Lu=\"captureStackTrace\"in Error?Error.captureStackTrace:(...e)=>{};function zo(e){return typeof e===\"object\"&&e!==null&&!Array.isArray(e)}var Qd=Xn(()=>{if(So.jitless)return!1;if(typeof navigator<\"u\"&&navigator?.userAgent?.includes(\"Cloudflare\"))return!1;try{return new Function(\"\"),!0}catch(e){return!1}});function $r(e){if(zo(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!==\"function\")return!0;let r=t.prototype;if(zo(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,\"isPrototypeOf\")===!1)return!1;return!0}function Uu(e){if($r(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var Xd=new Set([\"string\",\"number\",\"symbol\"]);function Jt(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")}function it(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function O(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 Error(\"Cannot specify both `message` and `error` params\");t.error=t.message}if(delete t.message,typeof t.error===\"string\")return{...t,error:()=>t.error};return t}function Du(e){if(typeof e===\"bigint\")return e.toString()+\"n\";if(typeof e===\"string\")return`\"${e}\"`;return`${e}`}function em(e){return Object.keys(e).filter((t)=>e[t]._zod.optin===\"optional\"&&e[t]._zod.optout===\"optional\")}var tm={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function pk(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(\".pick() cannot be used on object schemas containing refinements\");let i=Vt(e._zod.def,{get shape(){let s={};for(let a in t){if(!(a in r.shape))throw Error(`Unrecognized key: \"${a}\"`);if(!t[a])continue;s[a]=r.shape[a]}return wr(this,\"shape\",s),s},checks:[]});return it(e,i)}function dk(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(\".omit() cannot be used on object schemas containing refinements\");let i=Vt(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw Error(`Unrecognized key: \"${a}\"`);if(!t[a])continue;delete s[a]}return wr(this,\"shape\",s),s},checks:[]});return it(e,i)}function mk(e,t){if(!$r(t))throw Error(\"Invalid input to extend: expected a plain object\");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw Error(\"Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.\")}let n=Vt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return wr(this,\"shape\",i),i}});return it(e,n)}function hk(e,t){if(!$r(t))throw Error(\"Invalid input to safeExtend: expected a plain object\");let r=Vt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return wr(this,\"shape\",o),o}});return it(e,r)}function fk(e,t){if(e._zod.def.checks?.length)throw Error(\".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.\");let r=Vt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return wr(this,\"shape\",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return it(e,r)}function gk(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(\".partial() cannot be used on object schemas containing refinements\");let s=Vt(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw Error(`Unrecognized key: \"${u}\"`);if(!r[u])continue;c[u]=e?new e({type:\"optional\",innerType:a[u]}):a[u]}else for(let u in a)c[u]=e?new e({type:\"optional\",innerType:a[u]}):a[u];return wr(this,\"shape\",c),c},checks:[]});return it(t,s)}function _k(e,t,r){let o=Vt(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let s in r){if(!(s in i))throw Error(`Unrecognized key: \"${s}\"`);if(!r[s])continue;i[s]=new e({type:\"nonoptional\",innerType:n[s]})}else for(let s in n)i[s]=new e({type:\"nonoptional\",innerType:n[s]});return wr(this,\"shape\",i),i}});return it(t,o)}function kr(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 rm(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 Ht(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Wa(e){return typeof e===\"string\"?e:e?.message}function at(e,t,r){let o=e.message?e.message:Wa(e.inst?._zod.def?.error?.(e))??Wa(t?.error?.(e))??Wa(r.customError?.(e))??Wa(r.localeError?.(e))??\"Invalid input\",{inst:n,continue:i,input:s,...a}=e;if(a.path??(a.path=[]),a.message=o,t?.reportInput)a.input=s;return a}function Qa(e){if(Array.isArray(e))return\"array\";if(typeof e===\"string\")return\"string\";return\"unknown\"}function om(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 Rr(...e){let[t,r,o]=e;if(typeof t===\"string\")return{message:t,code:\"custom\",input:r,inst:o};return{...t}}var nm=(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,Qn,2),Object.defineProperty(e,\"toString\",{value:()=>e.message,enumerable:!1})},Xa=_(\"$ZodError\",nm),Fu=_(\"$ZodError\",nm,{Parent:Error});function Vu(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function Ju(e,t=(r)=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let s of n.issues)if(s.code===\"invalid_union\"&&s.errors.length)s.errors.map((a)=>o({issues:a},[...i,...s.path]));else if(s.code===\"invalid_key\")o({issues:s.issues},[...i,...s.path]);else if(s.code===\"invalid_element\")o({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else{let c=r,u=0;while(u<a.length){let l=a[u];if(u!==a.length-1)c[l]=c[l]||{_errors:[]};else c[l]=c[l]||{_errors:[]},c[l]._errors.push(t(s));c=c[l],u++}}}};return o(e),r}var ec=(e)=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new $t;if(s.issues.length){let a=new(n?.Err??e)(s.issues.map((c)=>at(c,i,Je())));throw Lu(a,n?.callee),a}return s.value};var tc=(e)=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)s=await s;if(s.issues.length){let a=new(n?.Err??e)(s.issues.map((c)=>at(c,i,Je())));throw Lu(a,n?.callee),a}return s.value};var es=(e)=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new $t;return i.issues.length?{success:!1,error:new(e??Xa)(i.issues.map((s)=>at(s,n,Je())))}:{success:!0,data:i.value}},sm=es(Fu),ts=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)i=await i;return i.issues.length?{success:!1,error:new e(i.issues.map((s)=>at(s,n,Je())))}:{success:!0,data:i.value}},im=ts(Fu),am=(e)=>(t,r,o)=>{let n=o?{...o,direction:\"backward\"}:{direction:\"backward\"};return ec(e)(t,r,n)};var cm=(e)=>(t,r,o)=>ec(e)(t,r,o);var um=(e)=>async(t,r,o)=>{let n=o?{...o,direction:\"backward\"}:{direction:\"backward\"};return tc(e)(t,r,n)};var lm=(e)=>async(t,r,o)=>tc(e)(t,r,o);var pm=(e)=>(t,r,o)=>{let n=o?{...o,direction:\"backward\"}:{direction:\"backward\"};return es(e)(t,r,n)};var dm=(e)=>(t,r,o)=>es(e)(t,r,o);var mm=(e)=>async(t,r,o)=>{let n=o?{...o,direction:\"backward\"}:{direction:\"backward\"};return ts(e)(t,r,n)};var hm=(e)=>async(t,r,o)=>ts(e)(t,r,o);var fm=/^[cC][0-9a-z]{6,}$/,gm=/^[0-9a-z]+$/,_m=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Sm=/^[0-9a-vA-V]{20}$/,zm=/^[A-Za-z0-9]{27}$/,bm=/^[a-zA-Z0-9_-]{21}$/,ym=/^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/;var vm=/^([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})$/,Hu=(e)=>{if(!e)return/^([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)$/;return 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})$`)};var xm=/^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/;var zk=\"^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$\";function wm(){return new RegExp(zk,\"u\")}var $m=/^(?:(?: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])$/,km=/^(([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 Rm=/^((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])$/,Pm=/^(([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])$/,Tm=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Bu=/^[A-Za-z0-9_-]*$/;var Em=/^https?$/,Im=/^\\+[1-9]\\d{6,14}$/,Om=\"(?:(?:\\\\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])))\",Cm=new RegExp(`^${Om}$`);function Zm(e){return typeof e.precision===\"number\"?e.precision===-1?\"(?:[01]\\\\d|2[0-3]):[0-5]\\\\d\":e.precision===0?\"(?:[01]\\\\d|2[0-3]):[0-5]\\\\d:[0-5]\\\\d\":`(?:[01]\\\\d|2[0-3]):[0-5]\\\\d:[0-5]\\\\d\\\\.\\\\d{${e.precision}}`:\"(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?\"}function Nm(e){return new RegExp(`^${Zm(e)}$`)}function Am(e){let t=Zm({precision:e.precision}),r=[\"Z\"];if(e.local)r.push(\"\");if(e.offset)r.push(\"([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)\");let o=`${t}(?:${r.join(\"|\")})`;return new RegExp(`^${Om}T(?:${o})$`)}var jm=(e)=>{let t=e?`[\\\\s\\\\S]{${e?.minimum??0},${e?.maximum??\"\"}}`:\"[\\\\s\\\\S]*\";return new RegExp(`^${t}$`)};var Mm=/^-?\\d+$/,Wu=/^-?\\d+(?:\\.\\d+)?$/,qm=/^(?:true|false)$/i,Lm=/^null$/i;var Um=/^[^A-Z]*$/,Dm=/^[^a-z]*$/;var Te=_(\"$ZodCheck\",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Fm={number:\"number\",bigint:\"bigint\",object:\"date\"},Gu=_(\"$ZodCheckLessThan\",(e,t)=>{Te.init(e,t);let r=Fm[typeof t.value];e._zod.onattach.push((o)=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<i)if(t.inclusive)n.maximum=t.value;else n.exclusiveMaximum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;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})}}),Ku=_(\"$ZodCheckGreaterThan\",(e,t)=>{Te.init(e,t);let r=Fm[typeof t.value];e._zod.onattach.push((o)=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>i)if(t.inclusive)n.minimum=t.value;else n.exclusiveMinimum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;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})}}),Vm=_(\"$ZodCheckMultipleOf\",(e,t)=>{Te.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 Error(\"Cannot mix number and bigint in multiple_of check.\");if(typeof r.value===\"bigint\"?r.value%t.value===BigInt(0):Kd(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:\"not_multiple_of\",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Jm=_(\"$ZodCheckNumberFormat\",(e,t)=>{Te.init(e,t),t.format=t.format||\"float64\";let r=t.format?.includes(\"int\"),o=r?\"int\":\"number\",[n,i]=tm[t.format];e._zod.onattach.push((s)=>{let a=s._zod.bag;if(a.format=t.format,a.minimum=n,a.maximum=i,r)a.pattern=Mm}),e._zod.check=(s)=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:o,format:t.format,code:\"invalid_type\",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)s.issues.push({input:a,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});else s.issues.push({input:a,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}}if(a<n)s.issues.push({origin:\"number\",input:a,code:\"too_small\",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(a>i)s.issues.push({origin:\"number\",input:a,code:\"too_big\",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var Hm=_(\"$ZodCheckMaxLength\",(e,t)=>{var r;Te.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!Ka(n)&&n.length!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<n)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let n=o.value;if(n.length<=t.maximum)return;let s=Qa(n);o.issues.push({origin:s,code:\"too_big\",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Bm=_(\"$ZodCheckMinLength\",(e,t)=>{var r;Te.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!Ka(n)&&n.length!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>n)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let n=o.value;if(n.length>=t.minimum)return;let s=Qa(n);o.issues.push({origin:s,code:\"too_small\",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Wm=_(\"$ZodCheckLengthEquals\",(e,t)=>{var r;Te.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!Ka(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,i=n.length;if(i===t.length)return;let s=Qa(n),a=i>t.length;o.issues.push({origin:s,...a?{code:\"too_big\",maximum:t.length}:{code:\"too_small\",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),os=_(\"$ZodCheckStringFormat\",(e,t)=>{var r,o;if(Te.init(e,t),e._zod.onattach.push((n)=>{let i=n._zod.bag;if(i.format=t.format,t.pattern)i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern)}),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;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})});else(o=e._zod).check??(o.check=()=>{})}),Gm=_(\"$ZodCheckRegex\",(e,t)=>{os.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:\"string\",code:\"invalid_format\",format:\"regex\",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Km=_(\"$ZodCheckLowerCase\",(e,t)=>{t.pattern??(t.pattern=Um),os.init(e,t)}),Ym=_(\"$ZodCheckUpperCase\",(e,t)=>{t.pattern??(t.pattern=Dm),os.init(e,t)}),Qm=_(\"$ZodCheckIncludes\",(e,t)=>{Te.init(e,t);let r=Jt(t.includes),o=new RegExp(typeof t.position===\"number\"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push((n)=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:\"string\",code:\"invalid_format\",format:\"includes\",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Xm=_(\"$ZodCheckStartsWith\",(e,t)=>{Te.init(e,t);let r=new RegExp(`^${Jt(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)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:\"string\",code:\"invalid_format\",format:\"starts_with\",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),eh=_(\"$ZodCheckEndsWith\",(e,t)=>{Te.init(e,t);let r=new RegExp(`.*${Jt(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)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:\"string\",code:\"invalid_format\",format:\"ends_with\",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var th=_(\"$ZodCheckOverwrite\",(e,t)=>{Te.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class Yu{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e===\"function\"){e(this,{execution:\"sync\"}),e(this,{execution:\"async\"});return}let r=e.split(`\n`).filter((i)=>i),o=Math.min(...r.map((i)=>i.length-i.trimStart().length)),n=r.map((i)=>i.slice(o)).map((i)=>\" \".repeat(this.indent*2)+i);for(let i of n)this.content.push(i)}compile(){let e=Function,t=this?.args,o=[...(this?.content??[\"\"]).map((n)=>`  ${n}`)];return new e(...t,o.join(`\n`))}}var oh={major:4,minor:4,patch:3};var X=_(\"$ZodType\",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=oh;let o=[...e._zod.def.checks??[]];if(e._zod.traits.has(\"$ZodCheck\"))o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(s,a,c)=>{let u=kr(s),l;for(let m of a){if(m._zod.def.when){if(rm(s))continue;if(!m._zod.def.when(s))continue}else if(u)continue;let h=s.issues.length,f=m._zod.check(s);if(f instanceof Promise&&c?.async===!1)throw new $t;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{if(await f,s.issues.length===h)return;if(!u)u=kr(s,h)});else{if(s.issues.length===h)continue;if(!u)u=kr(s,h)}}if(l)return l.then(()=>s);return s},i=(s,a,c)=>{if(kr(s))return s.aborted=!0,s;let u=n(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new $t;return u.then((l)=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction===\"backward\"){let u=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});if(u instanceof Promise)return u.then((l)=>i(l,s,a));return i(u,s,a)}let c=e._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new $t;return c.then((u)=>n(u,o,a))}return n(c,o,a)}}H(e,\"~standard\",()=>({validate:(n)=>{try{let i=sm(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch(i){return im(e,n).then((s)=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:\"zod\",version:1}))}),nc=_(\"$ZodString\",(e,t)=>{X.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??jm(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value===\"string\")return r;return r.issues.push({expected:\"string\",code:\"invalid_type\",input:r.value,inst:e}),r}}),ae=_(\"$ZodStringFormat\",(e,t)=>{os.init(e,t),nc.init(e,t)}),dh=_(\"$ZodGUID\",(e,t)=>{t.pattern??(t.pattern=vm),ae.init(e,t)}),mh=_(\"$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 Error(`Invalid UUID version: \"${t.version}\"`);t.pattern??(t.pattern=Hu(o))}else t.pattern??(t.pattern=Hu());ae.init(e,t)}),hh=_(\"$ZodEmail\",(e,t)=>{t.pattern??(t.pattern=xm),ae.init(e,t)}),fh=_(\"$ZodURL\",(e,t)=>{ae.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===Em.source){if(!/^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);if(t.hostname){if(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})}if(t.protocol){if(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})}if(t.normalize)r.value=n.href;else r.value=o;return}catch(o){r.issues.push({code:\"invalid_format\",format:\"url\",input:r.value,inst:e,continue:!t.abort})}}}),gh=_(\"$ZodEmoji\",(e,t)=>{t.pattern??(t.pattern=wm()),ae.init(e,t)}),_h=_(\"$ZodNanoID\",(e,t)=>{t.pattern??(t.pattern=bm),ae.init(e,t)}),Sh=_(\"$ZodCUID\",(e,t)=>{t.pattern??(t.pattern=fm),ae.init(e,t)}),zh=_(\"$ZodCUID2\",(e,t)=>{t.pattern??(t.pattern=gm),ae.init(e,t)}),bh=_(\"$ZodULID\",(e,t)=>{t.pattern??(t.pattern=_m),ae.init(e,t)}),yh=_(\"$ZodXID\",(e,t)=>{t.pattern??(t.pattern=Sm),ae.init(e,t)}),vh=_(\"$ZodKSUID\",(e,t)=>{t.pattern??(t.pattern=zm),ae.init(e,t)}),xh=_(\"$ZodISODateTime\",(e,t)=>{t.pattern??(t.pattern=Am(t)),ae.init(e,t)}),wh=_(\"$ZodISODate\",(e,t)=>{t.pattern??(t.pattern=Cm),ae.init(e,t)}),$h=_(\"$ZodISOTime\",(e,t)=>{t.pattern??(t.pattern=Nm(t)),ae.init(e,t)}),kh=_(\"$ZodISODuration\",(e,t)=>{t.pattern??(t.pattern=ym),ae.init(e,t)}),Rh=_(\"$ZodIPv4\",(e,t)=>{t.pattern??(t.pattern=$m),ae.init(e,t),e._zod.bag.format=\"ipv4\"}),Ph=_(\"$ZodIPv6\",(e,t)=>{t.pattern??(t.pattern=km),ae.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 Th=_(\"$ZodCIDRv4\",(e,t)=>{t.pattern??(t.pattern=Rm),ae.init(e,t)}),Eh=_(\"$ZodCIDRv6\",(e,t)=>{t.pattern??(t.pattern=Pm),ae.init(e,t),e._zod.check=(r)=>{let o=r.value.split(\"/\");try{if(o.length!==2)throw Error();let[n,i]=o;if(!i)throw Error();let s=Number(i);if(`${s}`!==i)throw Error();if(s<0||s>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:\"invalid_format\",format:\"cidrv6\",input:r.value,inst:e,continue:!t.abort})}}});function Ih(e){if(e===\"\")return!0;if(/\\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Oh=_(\"$ZodBase64\",(e,t)=>{t.pattern??(t.pattern=Tm),ae.init(e,t),e._zod.bag.contentEncoding=\"base64\",e._zod.check=(r)=>{if(Ih(r.value))return;r.issues.push({code:\"invalid_format\",format:\"base64\",input:r.value,inst:e,continue:!t.abort})}});function bk(e){if(!Bu.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o===\"-\"?\"+\":\"/\"),r=t.padEnd(Math.ceil(t.length/4)*4,\"=\");return Ih(r)}var Ch=_(\"$ZodBase64URL\",(e,t)=>{t.pattern??(t.pattern=Bu),ae.init(e,t),e._zod.bag.contentEncoding=\"base64url\",e._zod.check=(r)=>{if(bk(r.value))return;r.issues.push({code:\"invalid_format\",format:\"base64url\",input:r.value,inst:e,continue:!t.abort})}}),Zh=_(\"$ZodE164\",(e,t)=>{t.pattern??(t.pattern=Im),ae.init(e,t)});function yk(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));if(\"typ\"in n&&n?.typ!==\"JWT\")return!1;if(!n.alg)return!1;if(t&&(!(\"alg\"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var Nh=_(\"$ZodJWT\",(e,t)=>{ae.init(e,t),e._zod.check=(r)=>{if(yk(r.value,t.alg))return;r.issues.push({code:\"invalid_format\",format:\"jwt\",input:r.value,inst:e,continue:!t.abort})}});var Xu=_(\"$ZodNumber\",(e,t)=>{X.init(e,t),e._zod.pattern=e._zod.bag.pattern??Wu,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}let n=r.value;if(typeof n===\"number\"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n===\"number\"?Number.isNaN(n)?\"NaN\":!Number.isFinite(n)?\"Infinity\":void 0:void 0;return r.issues.push({expected:\"number\",code:\"invalid_type\",input:n,inst:e,...i?{received:i}:{}}),r}}),Ah=_(\"$ZodNumberFormat\",(e,t)=>{Jm.init(e,t),Xu.init(e,t)}),jh=_(\"$ZodBoolean\",(e,t)=>{X.init(e,t),e._zod.pattern=qm,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(i){}let n=r.value;if(typeof n===\"boolean\")return r;return r.issues.push({expected:\"boolean\",code:\"invalid_type\",input:n,inst:e}),r}});var Mh=_(\"$ZodNull\",(e,t)=>{X.init(e,t),e._zod.pattern=Lm,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;if(n===null)return r;return r.issues.push({expected:\"null\",code:\"invalid_type\",input:n,inst:e}),r}}),qh=_(\"$ZodAny\",(e,t)=>{X.init(e,t),e._zod.parse=(r)=>r}),Lh=_(\"$ZodUnknown\",(e,t)=>{X.init(e,t),e._zod.parse=(r)=>r}),Uh=_(\"$ZodNever\",(e,t)=>{X.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:\"never\",code:\"invalid_type\",input:r.value,inst:e}),r)});function nh(e,t,r){if(e.issues.length)t.issues.push(...Ht(r,e.issues));t.value[r]=e.value}var Dh=_(\"$ZodArray\",(e,t)=>{X.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 i=[];for(let s=0;s<n.length;s++){let a=n[s],c=t.element._zod.run({value:a,issues:[]},o);if(c instanceof Promise)i.push(c.then((u)=>nh(u,r,s)));else nh(c,r,s)}if(i.length)return Promise.all(i).then(()=>r);return r}});function oc(e,t,r,o,n,i){let s=r in o;if(e.issues.length){if(n&&i&&!s)return;t.issues.push(...Ht(r,e.issues))}if(!s&&!n){if(!e.issues.length)t.issues.push({code:\"invalid_type\",expected:\"nonoptional\",input:void 0,path:[r]});return}if(e.value===void 0){if(s)t.value[r]=void 0}else t.value[r]=e.value}function Fh(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has(\"$ZodType\"))throw Error(`Invalid element at key \"${o}\": expected a Zod schema`);let r=em(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Vh(e,t,r,o,n,i){let s=[],a=n.keySet,c=n.catchall._zod,u=c.def.type,l=c.optin===\"optional\",m=c.optout===\"optional\";for(let h in t){if(h===\"__proto__\")continue;if(a.has(h))continue;if(u===\"never\"){s.push(h);continue}let f=c.run({value:t[h],issues:[]},o);if(f instanceof Promise)e.push(f.then((b)=>oc(b,r,h,t,l,m)));else oc(f,r,h,t,l,m)}if(s.length)r.issues.push({code:\"unrecognized_keys\",keys:s,input:t,inst:i});if(!e.length)return r;return Promise.all(e).then(()=>r)}var vk=_(\"$ZodObject\",(e,t)=>{if(X.init(e,t),!Object.getOwnPropertyDescriptor(t,\"shape\")?.get){let a=t.shape;Object.defineProperty(t,\"shape\",{get:()=>{let c={...a};return Object.defineProperty(t,\"shape\",{value:c}),c}})}let o=Xn(()=>Fh(t));H(e._zod,\"propValues\",()=>{let a=t.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let m of l.values)c[u].add(m)}}return c});let n=zo,i=t.catchall,s;e._zod.parse=(a,c)=>{s??(s=o.value);let u=a.value;if(!n(u))return a.issues.push({expected:\"object\",code:\"invalid_type\",input:u,inst:e}),a;a.value={};let l=[],m=s.shape;for(let h of s.keys){let f=m[h],b=f._zod.optin===\"optional\",I=f._zod.optout===\"optional\",x=f._zod.run({value:u[h],issues:[]},c);if(x instanceof Promise)l.push(x.then((J)=>oc(J,a,h,u,b,I)));else oc(x,a,h,u,b,I)}if(!i)return l.length?Promise.all(l).then(()=>a):a;return Vh(l,u,a,c,o.value,e)}}),Jh=_(\"$ZodObjectJIT\",(e,t)=>{vk.init(e,t);let r=e._zod.parse,o=Xn(()=>Fh(t)),n=(h)=>{let f=new Yu([\"shape\",\"payload\",\"ctx\"]),b=o.value,I=(M)=>{let k=qu(M);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};f.write(\"const input = payload.value;\");let x=Object.create(null),J=0;for(let M of b.keys)x[M]=`key_${J++}`;f.write(\"const newResult = {};\");for(let M of b.keys){let k=x[M],N=qu(M),K=h[M],de=K?._zod?.optin===\"optional\",Be=K?._zod?.optout===\"optional\";if(f.write(`const ${k} = ${I(M)};`),de&&Be)f.write(`\n        if (${k}.issues.length) {\n          if (${N} in input) {\n            payload.issues = payload.issues.concat(${k}.issues.map(iss => ({\n              ...iss,\n              path: iss.path ? [${N}, ...iss.path] : [${N}]\n            })));\n          }\n        }\n        \n        if (${k}.value === undefined) {\n          if (${N} in input) {\n            newResult[${N}] = undefined;\n          }\n        } else {\n          newResult[${N}] = ${k}.value;\n        }\n        \n      `);else if(!de)f.write(`\n        const ${k}_present = ${N} in input;\n        if (${k}.issues.length) {\n          payload.issues = payload.issues.concat(${k}.issues.map(iss => ({\n            ...iss,\n            path: iss.path ? [${N}, ...iss.path] : [${N}]\n          })));\n        }\n        if (!${k}_present && !${k}.issues.length) {\n          payload.issues.push({\n            code: \"invalid_type\",\n            expected: \"nonoptional\",\n            input: undefined,\n            path: [${N}]\n          });\n        }\n\n        if (${k}_present) {\n          if (${k}.value === undefined) {\n            newResult[${N}] = undefined;\n          } else {\n            newResult[${N}] = ${k}.value;\n          }\n        }\n\n      `);else f.write(`\n        if (${k}.issues.length) {\n          payload.issues = payload.issues.concat(${k}.issues.map(iss => ({\n            ...iss,\n            path: iss.path ? [${N}, ...iss.path] : [${N}]\n          })));\n        }\n        \n        if (${k}.value === undefined) {\n          if (${N} in input) {\n            newResult[${N}] = undefined;\n          }\n        } else {\n          newResult[${N}] = ${k}.value;\n        }\n        \n      `)}f.write(\"payload.value = newResult;\"),f.write(\"return payload;\");let re=f.compile();return(M,k)=>re(h,M,k)},i,s=zo,a=!So.jitless,u=a&&Qd.value,l=t.catchall,m;e._zod.parse=(h,f)=>{m??(m=o.value);let b=h.value;if(!s(b))return h.issues.push({expected:\"object\",code:\"invalid_type\",input:b,inst:e}),h;if(a&&u&&f?.async===!1&&f.jitless!==!0){if(!i)i=n(t.shape);if(h=i(h,f),!l)return h;return Vh([],b,h,f,m,e)}return r(h,f)}});function sh(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter((i)=>!kr(i));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:\"invalid_union\",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((s)=>at(s,o,Je())))}),t}var el=_(\"$ZodUnion\",(e,t)=>{X.init(e,t),H(e._zod,\"optin\",()=>t.options.some((o)=>o._zod.optin===\"optional\")?\"optional\":void 0),H(e._zod,\"optout\",()=>t.options.some((o)=>o._zod.optout===\"optional\")?\"optional\":void 0),H(e._zod,\"values\",()=>{if(t.options.every((o)=>o._zod.values))return new Set(t.options.flatMap((o)=>Array.from(o._zod.values)));return}),H(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)=>Ya(n.source)).join(\"|\")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,s=[];for(let a of t.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)s.push(c),i=!0;else{if(c.issues.length===0)return c;s.push(c)}}if(!i)return sh(s,o,e,n);return Promise.all(s).then((a)=>sh(a,o,e,n))}});var Hh=_(\"$ZodDiscriminatedUnion\",(e,t)=>{t.inclusive=!1,el.init(e,t);let r=e._zod.parse;H(e._zod,\"propValues\",()=>{let n={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw Error(`Invalid discriminated union option at index \"${t.options.indexOf(i)}\"`);for(let[a,c]of Object.entries(s)){if(!n[a])n[a]=new Set;for(let u of c)n[a].add(u)}}return n});let o=Xn(()=>{let n=t.options,i=new Map;for(let s of n){let a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw Error(`Invalid discriminated union option at index \"${t.options.indexOf(s)}\"`);for(let c of a){if(i.has(c))throw Error(`Duplicate discriminator value \"${String(c)}\"`);i.set(c,s)}}return i});e._zod.parse=(n,i)=>{let s=n.value;if(!zo(s))return n.issues.push({code:\"invalid_type\",expected:\"object\",input:s,inst:e}),n;let a=o.value.get(s?.[t.discriminator]);if(a)return a._zod.run(n,i);if(t.unionFallback||i.direction===\"backward\")return r(n,i);return n.issues.push({code:\"invalid_union\",errors:[],note:\"No matching discriminator\",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:s,path:[t.discriminator],inst:e}),n}}),Bh=_(\"$ZodIntersection\",(e,t)=>{X.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),s=t.right._zod.run({value:n,issues:[]},o);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([c,u])=>ih(r,c,u));return ih(r,i,s)}});function Qu(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($r(e)&&$r(t)){let r=Object.keys(t),o=Object.keys(e).filter((i)=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let s=Qu(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.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],i=t[o],s=Qu(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function ih(e,t,r){let o=new Map,n;for(let a of t.issues)if(a.code===\"unrecognized_keys\"){n??(n=a);for(let c of a.keys){if(!o.has(c))o.set(c,{});o.get(c).l=!0}}else e.issues.push(a);for(let a of r.issues)if(a.code===\"unrecognized_keys\")for(let c of a.keys){if(!o.has(c))o.set(c,{});o.get(c).r=!0}else e.issues.push(a);let i=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&n)e.issues.push({...n,keys:i});if(kr(e))return e;let s=Qu(t.value,r.value);if(!s.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var Wh=_(\"$ZodRecord\",(e,t)=>{X.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!$r(n))return r.issues.push({expected:\"record\",code:\"invalid_type\",input:n,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let a=new Set;for(let u of s)if(typeof u===\"string\"||typeof u===\"number\"||typeof u===\"symbol\"){a.add(typeof u===\"number\"?u.toString():u);let l=t.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw Error(\"Async schemas not supported in object keys currently\");if(l.issues.length){r.issues.push({code:\"invalid_key\",origin:\"record\",issues:l.issues.map((f)=>at(f,o,Je())),input:u,path:[u],inst:e});continue}let m=l.value,h=t.valueType._zod.run({value:n[u],issues:[]},o);if(h instanceof Promise)i.push(h.then((f)=>{if(f.issues.length)r.issues.push(...Ht(u,f.issues));r.value[m]=f.value}));else{if(h.issues.length)r.issues.push(...Ht(u,h.issues));r.value[m]=h.value}}let c;for(let u in n)if(!a.has(u))c=c??[],c.push(u);if(c&&c.length>0)r.issues.push({code:\"unrecognized_keys\",input:n,inst:e,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a===\"__proto__\")continue;if(!Object.prototype.propertyIsEnumerable.call(n,a))continue;let c=t.keyType._zod.run({value:a,issues:[]},o);if(c instanceof Promise)throw Error(\"Async schemas not supported in object keys currently\");if(typeof a===\"string\"&&Wu.test(a)&&c.issues.length){let m=t.keyType._zod.run({value:Number(a),issues:[]},o);if(m instanceof Promise)throw Error(\"Async schemas not supported in object keys currently\");if(m.issues.length===0)c=m}if(c.issues.length){if(t.mode===\"loose\")r.value[a]=n[a];else r.issues.push({code:\"invalid_key\",origin:\"record\",issues:c.issues.map((m)=>at(m,o,Je())),input:a,path:[a],inst:e});continue}let l=t.valueType._zod.run({value:n[a],issues:[]},o);if(l instanceof Promise)i.push(l.then((m)=>{if(m.issues.length)r.issues.push(...Ht(a,m.issues));r.value[c.value]=m.value}));else{if(l.issues.length)r.issues.push(...Ht(a,l.issues));r.value[c.value]=l.value}}}if(i.length)return Promise.all(i).then(()=>r);return r}});var Gh=_(\"$ZodEnum\",(e,t)=>{X.init(e,t);let r=Ga(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter((n)=>Xd.has(typeof n)).map((n)=>typeof n===\"string\"?Jt(n):n.toString()).join(\"|\")})$`),e._zod.parse=(n,i)=>{let s=n.value;if(o.has(s))return n;return n.issues.push({code:\"invalid_value\",values:r,input:s,inst:e}),n}}),Kh=_(\"$ZodLiteral\",(e,t)=>{if(X.init(e,t),t.values.length===0)throw 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\"?Jt(o):o?Jt(o.toString()):String(o)).join(\"|\")})$`),e._zod.parse=(o,n)=>{let i=o.value;if(r.has(i))return o;return o.issues.push({code:\"invalid_value\",values:t.values,input:i,inst:e}),o}});var Yh=_(\"$ZodTransform\",(e,t)=>{X.init(e,t),e._zod.optin=\"optional\",e._zod.parse=(r,o)=>{if(o.direction===\"backward\")throw new Yn(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then((s)=>(r.value=s,r.fallback=!0,r));if(n instanceof Promise)throw new $t;return r.value=n,r.fallback=!0,r}});function ah(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var tl=_(\"$ZodOptional\",(e,t)=>{X.init(e,t),e._zod.optin=\"optional\",e._zod.optout=\"optional\",H(e._zod,\"values\",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),H(e._zod,\"pattern\",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ya(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin===\"optional\"){let n=r.value,i=t.innerType._zod.run(r,o);if(i instanceof Promise)return i.then((s)=>ah(s,n));return ah(i,n)}if(r.value===void 0)return r;return t.innerType._zod.run(r,o)}}),Qh=_(\"$ZodExactOptional\",(e,t)=>{tl.init(e,t),H(e._zod,\"values\",()=>t.innerType._zod.values),H(e._zod,\"pattern\",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Xh=_(\"$ZodNullable\",(e,t)=>{X.init(e,t),H(e._zod,\"optin\",()=>t.innerType._zod.optin),H(e._zod,\"optout\",()=>t.innerType._zod.optout),H(e._zod,\"pattern\",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ya(r.source)}|null)$`):void 0}),H(e._zod,\"values\",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),ef=_(\"$ZodDefault\",(e,t)=>{X.init(e,t),e._zod.optin=\"optional\",H(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);if(n instanceof Promise)return n.then((i)=>ch(i,t));return ch(n,t)}});function ch(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var tf=_(\"$ZodPrefault\",(e,t)=>{X.init(e,t),e._zod.optin=\"optional\",H(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)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),rf=_(\"$ZodNonOptional\",(e,t)=>{X.init(e,t),H(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);if(n instanceof Promise)return n.then((i)=>uh(i,e));return uh(n,e)}});function uh(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:\"invalid_type\",expected:\"nonoptional\",input:e.value,inst:t});return e}var of=_(\"$ZodCatch\",(e,t)=>{X.init(e,t),e._zod.optin=\"optional\",H(e._zod,\"optout\",()=>t.innerType._zod.optout),H(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);if(n instanceof Promise)return n.then((i)=>{if(r.value=i.value,i.issues.length)r.value=t.catchValue({...r,error:{issues:i.issues.map((s)=>at(s,o,Je()))},input:r.value}),r.issues=[],r.fallback=!0;return r});if(r.value=n.value,n.issues.length)r.value=t.catchValue({...r,error:{issues:n.issues.map((i)=>at(i,o,Je()))},input:r.value}),r.issues=[],r.fallback=!0;return r}});var rl=_(\"$ZodPipe\",(e,t)=>{X.init(e,t),H(e._zod,\"values\",()=>t.in._zod.values),H(e._zod,\"optin\",()=>t.in._zod.optin),H(e._zod,\"optout\",()=>t.out._zod.optout),H(e._zod,\"propValues\",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction===\"backward\"){let i=t.out._zod.run(r,o);if(i instanceof Promise)return i.then((s)=>rc(s,t.in,o));return rc(i,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>rc(i,t.out,o));return rc(n,t.out,o)}});function rc(e,t,r){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var nf=_(\"$ZodPreprocess\",(e,t)=>{rl.init(e,t)}),sf=_(\"$ZodReadonly\",(e,t)=>{X.init(e,t),H(e._zod,\"propValues\",()=>t.innerType._zod.propValues),H(e._zod,\"values\",()=>t.innerType._zod.values),H(e._zod,\"optin\",()=>t.innerType?._zod?.optin),H(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);if(n instanceof Promise)return n.then(lh);return lh(n)}});function lh(e){return e.value=Object.freeze(e.value),e}var af=_(\"$ZodLazy\",(e,t)=>{X.init(e,t),H(e._zod,\"innerType\",()=>{let r=t;if(!r._cachedInner)r._cachedInner=t.getter();return r._cachedInner}),H(e._zod,\"pattern\",()=>e._zod.innerType?._zod?.pattern),H(e._zod,\"propValues\",()=>e._zod.innerType?._zod?.propValues),H(e._zod,\"optin\",()=>e._zod.innerType?._zod?.optin??void 0),H(e._zod,\"optout\",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),cf=_(\"$ZodCustom\",(e,t)=>{Te.init(e,t),X.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((i)=>ph(i,r,o,e));ph(n,r,o,e);return}});function ph(e,t,r,o){if(!e){let n={code:\"custom\",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(Rr(n))}}var xk=()=>{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 i=o[n.expected]??n.expected,s=om(n.input),a=o[s]??s;return`Invalid input: expected ${i}, received ${a}`}case\"invalid_value\":if(n.values.length===1)return`Invalid input: expected ${Du(n.values[0])}`;return`Invalid option: expected one of ${Mu(n.values,\"|\")}`;case\"too_big\":{let i=n.inclusive?\"<=\":\"<\",s=t(n.origin);if(s)return`Too big: expected ${n.origin??\"value\"} to have ${i}${n.maximum.toString()} ${s.unit??\"elements\"}`;return`Too big: expected ${n.origin??\"value\"} to be ${i}${n.maximum.toString()}`}case\"too_small\":{let i=n.inclusive?\">=\":\">\",s=t(n.origin);if(s)return`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${s.unit}`;return`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case\"invalid_format\":{let i=n;if(i.format===\"starts_with\")return`Invalid string: must start with \"${i.prefix}\"`;if(i.format===\"ends_with\")return`Invalid string: must end with \"${i.suffix}\"`;if(i.format===\"includes\")return`Invalid string: must include \"${i.includes}\"`;if(i.format===\"regex\")return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${r[i.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\":\"\"}: ${Mu(n.keys,\", \")}`;case\"invalid_key\":return`Invalid key in ${n.origin}`;case\"invalid_union\":if(n.options&&Array.isArray(n.options)&&n.options.length>0)return`Invalid discriminator value. Expected ${n.options.map((s)=>`'${s}'`).join(\" | \")}`;return\"Invalid input\";case\"invalid_element\":return`Invalid value in ${n.origin}`;default:return\"Invalid input\"}}};function ol(){return{localeError:xk()}}var uf,wk=Symbol(\"ZodOutput\"),$k=Symbol(\"ZodInput\");class lf{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r===\"object\"&&\"id\"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t===\"object\"&&\"id\"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function pf(){return new lf}(uf=globalThis).__zod_globalRegistry??(uf.__zod_globalRegistry=pf());var Bt=globalThis.__zod_globalRegistry;function df(e,t){return new e({type:\"string\",...O(t)})}function mf(e,t){return new e({type:\"string\",format:\"email\",check:\"string_format\",abort:!1,...O(t)})}function nl(e,t){return new e({type:\"string\",format:\"guid\",check:\"string_format\",abort:!1,...O(t)})}function hf(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,...O(t)})}function ff(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,version:\"v4\",...O(t)})}function gf(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,version:\"v6\",...O(t)})}function _f(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,version:\"v7\",...O(t)})}function sl(e,t){return new e({type:\"string\",format:\"url\",check:\"string_format\",abort:!1,...O(t)})}function Sf(e,t){return new e({type:\"string\",format:\"emoji\",check:\"string_format\",abort:!1,...O(t)})}function zf(e,t){return new e({type:\"string\",format:\"nanoid\",check:\"string_format\",abort:!1,...O(t)})}function bf(e,t){return new e({type:\"string\",format:\"cuid\",check:\"string_format\",abort:!1,...O(t)})}function yf(e,t){return new e({type:\"string\",format:\"cuid2\",check:\"string_format\",abort:!1,...O(t)})}function vf(e,t){return new e({type:\"string\",format:\"ulid\",check:\"string_format\",abort:!1,...O(t)})}function xf(e,t){return new e({type:\"string\",format:\"xid\",check:\"string_format\",abort:!1,...O(t)})}function wf(e,t){return new e({type:\"string\",format:\"ksuid\",check:\"string_format\",abort:!1,...O(t)})}function $f(e,t){return new e({type:\"string\",format:\"ipv4\",check:\"string_format\",abort:!1,...O(t)})}function kf(e,t){return new e({type:\"string\",format:\"ipv6\",check:\"string_format\",abort:!1,...O(t)})}function Rf(e,t){return new e({type:\"string\",format:\"cidrv4\",check:\"string_format\",abort:!1,...O(t)})}function Pf(e,t){return new e({type:\"string\",format:\"cidrv6\",check:\"string_format\",abort:!1,...O(t)})}function Tf(e,t){return new e({type:\"string\",format:\"base64\",check:\"string_format\",abort:!1,...O(t)})}function Ef(e,t){return new e({type:\"string\",format:\"base64url\",check:\"string_format\",abort:!1,...O(t)})}function If(e,t){return new e({type:\"string\",format:\"e164\",check:\"string_format\",abort:!1,...O(t)})}function Of(e,t){return new e({type:\"string\",format:\"jwt\",check:\"string_format\",abort:!1,...O(t)})}function Cf(e,t){return new e({type:\"string\",format:\"datetime\",check:\"string_format\",offset:!1,local:!1,precision:null,...O(t)})}function Zf(e,t){return new e({type:\"string\",format:\"date\",check:\"string_format\",...O(t)})}function Nf(e,t){return new e({type:\"string\",format:\"time\",check:\"string_format\",precision:null,...O(t)})}function Af(e,t){return new e({type:\"string\",format:\"duration\",check:\"string_format\",...O(t)})}function jf(e,t){return new e({type:\"number\",checks:[],...O(t)})}function Mf(e,t){return new e({type:\"number\",coerce:!0,checks:[],...O(t)})}function qf(e,t){return new e({type:\"number\",check:\"number_format\",abort:!1,format:\"safeint\",...O(t)})}function Lf(e,t){return new e({type:\"boolean\",...O(t)})}function Uf(e,t){return new e({type:\"null\",...O(t)})}function Df(e){return new e({type:\"any\"})}function Ff(e){return new e({type:\"unknown\"})}function Vf(e,t){return new e({type:\"never\",...O(t)})}function sc(e,t){return new Gu({check:\"less_than\",...O(t),value:e,inclusive:!1})}function ns(e,t){return new Gu({check:\"less_than\",...O(t),value:e,inclusive:!0})}function ic(e,t){return new Ku({check:\"greater_than\",...O(t),value:e,inclusive:!1})}function ss(e,t){return new Ku({check:\"greater_than\",...O(t),value:e,inclusive:!0})}function ac(e,t){return new Vm({check:\"multiple_of\",...O(t),value:e})}function cc(e,t){return new Hm({check:\"max_length\",...O(t),maximum:e})}function bo(e,t){return new Bm({check:\"min_length\",...O(t),minimum:e})}function uc(e,t){return new Wm({check:\"length_equals\",...O(t),length:e})}function il(e,t){return new Gm({check:\"string_format\",format:\"regex\",...O(t),pattern:e})}function al(e){return new Km({check:\"string_format\",format:\"lowercase\",...O(e)})}function cl(e){return new Ym({check:\"string_format\",format:\"uppercase\",...O(e)})}function ul(e,t){return new Qm({check:\"string_format\",format:\"includes\",...O(t),includes:e})}function ll(e,t){return new Xm({check:\"string_format\",format:\"starts_with\",...O(t),prefix:e})}function pl(e,t){return new eh({check:\"string_format\",format:\"ends_with\",...O(t),suffix:e})}function Wt(e){return new th({check:\"overwrite\",tx:e})}function dl(e){return Wt((t)=>t.normalize(e))}function ml(){return Wt((e)=>e.trim())}function hl(){return Wt((e)=>e.toLowerCase())}function fl(){return Wt((e)=>e.toUpperCase())}function gl(){return Wt((e)=>Yd(e))}function Jf(e,t,r){return new e({type:\"array\",element:t,...O(r)})}function Hf(e,t,r){return new e({type:\"custom\",check:\"custom\",fn:t,...O(r)})}function Bf(e,t){let r=kk((o)=>(o.addIssue=(n)=>{if(typeof n===\"string\")o.issues.push(Rr(n,o.value,r._zod.def));else{let i=n;if(i.fatal)i.continue=!1;i.code??(i.code=\"custom\"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(Rr(i))}},e(o.value,o)),t);return r}function kk(e,t){let r=new Te({check:\"custom\",...O(t)});return r._zod.check=e,r}function _l(e){let t=e?.target??\"draft-2020-12\";if(t===\"draft-4\")t=\"draft-04\";if(t===\"draft-7\")t=\"draft-07\";return{processors:e.processors??{},metadataRegistry:e?.metadata??Bt,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 ve(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{let h=s.schema,f=t.processors[n.type];if(!f)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(e,t,h,l)}let m=e._zod.parent;if(m){if(!s.ref)s.ref=m;ve(m,t,l),t.seen.get(m).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)Object.assign(s.schema,c);if(t.io===\"input\"&&qe(e))delete s.schema.examples,delete s.schema.default;if(t.io===\"input\"&&\"_prefault\"in s.schema)(o=s.schema).default??(o.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function Sl(e,t){let r=e.seen.get(t);if(!r)throw Error(\"Unprocessed schema. This is a bug in Zod.\");let o=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=o.get(a);if(c&&c!==s[0])throw Error(`Duplicate schema id \"${a}\" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,s[0])}}let n=(s)=>{let a=e.target===\"draft-2020-12\"?\"$defs\":\"definitions\";if(e.external){let m=e.external.registry.get(s[0])?.id,h=e.external.uri??((b)=>b);if(m)return{ref:h(m)};let f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${h(\"__shared\")}#/${a}/${f}`}}if(s[1]===r)return{ref:\"#\"};let u=`${\"#\"}/${a}/`,l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},i=(s)=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=n(s);if(a.def={...a.schema},u)a.defId=u;let l=a.schema;for(let m in l)delete l[m];l.$ref=c};if(e.cycles===\"throw\")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw Error(`Cycle detected: #/${a.cycle?.join(\"/\")}/<root>\n\nSet the \\`cycles\\` parameter to \\`\"ref\"\\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1){if(e.reused===\"ref\"){i(s);continue}}}}function zl(e,t){let r=e.seen.get(t);if(!r)throw Error(\"Unprocessed schema. This is a bug in Zod.\");let o=(a)=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},m=c.ref;if(c.ref=null,m){o(m);let f=e.seen.get(m),b=f.schema;if(b.$ref&&(e.target===\"draft-07\"||e.target===\"draft-04\"||e.target===\"openapi-3.0\"))u.allOf=u.allOf??[],u.allOf.push(b);else Object.assign(u,b);if(Object.assign(u,l),a._zod.parent===m)for(let x in u){if(x===\"$ref\"||x===\"allOf\")continue;if(!(x in l))delete u[x]}if(b.$ref&&f.def)for(let x in u){if(x===\"$ref\"||x===\"allOf\")continue;if(x in f.def&&JSON.stringify(u[x])===JSON.stringify(f.def[x]))delete u[x]}}let h=a._zod.parent;if(h&&h!==m){o(h);let f=e.seen.get(h);if(f?.schema.$ref){if(u.$ref=f.schema.$ref,f.def)for(let b in u){if(b===\"$ref\"||b===\"allOf\")continue;if(b in f.def&&JSON.stringify(u[b])===JSON.stringify(f.def[b]))delete u[b]}}}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...e.seen.entries()].reverse())o(a[0]);let n={};if(e.target===\"draft-2020-12\")n.$schema=\"https://json-schema.org/draft/2020-12/schema\";else if(e.target===\"draft-07\")n.$schema=\"http://json-schema.org/draft-07/schema#\";else if(e.target===\"draft-04\")n.$schema=\"http://json-schema.org/draft-04/schema#\";else if(e.target===\"openapi-3.0\");if(e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw Error(\"Schema is missing an `id` property\");n.$id=e.external.uri(a)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&n.id===i)delete n.id;let s=e.external?.defs??{};for(let a of e.seen.entries()){let c=a[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;s[c.defId]=c.def}}if(e.external);else if(Object.keys(s).length>0)if(e.target===\"draft-2020-12\")n.$defs=s;else n.definitions=s;try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,\"~standard\",{value:{...t[\"~standard\"],jsonSchema:{input:is(t,\"input\",e.processors),output:is(t,\"output\",e.processors)}},enumerable:!1,writable:!1}),a}catch(a){throw Error(\"Error converting schema to JSON.\")}}function qe(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 qe(o.element,r);if(o.type===\"set\")return qe(o.valueType,r);if(o.type===\"lazy\")return qe(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 qe(o.innerType,r);if(o.type===\"intersection\")return qe(o.left,r)||qe(o.right,r);if(o.type===\"record\"||o.type===\"map\")return qe(o.keyType,r)||qe(o.valueType,r);if(o.type===\"pipe\"){if(e._zod.traits.has(\"$ZodCodec\"))return!0;return qe(o.in,r)||qe(o.out,r)}if(o.type===\"object\"){for(let n in o.shape)if(qe(o.shape[n],r))return!0;return!1}if(o.type===\"union\"){for(let n of o.options)if(qe(n,r))return!0;return!1}if(o.type===\"tuple\"){for(let n of o.items)if(qe(n,r))return!0;if(o.rest&&qe(o.rest,r))return!0;return!1}return!1}var Wf=(e,t={})=>(r)=>{let o=_l({...r,processors:t});return ve(e,o),Sl(o,e),zl(o,e)},is=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:i}=o??{},s=_l({...n??{},target:i,io:t,processors:r});return ve(e,s),Sl(s,e),zl(s,e)};var Rk={guid:\"uuid\",url:\"uri\",datetime:\"date-time\",json_string:\"json-string\",regex:\"\"},Gf=(e,t,r,o)=>{let n=r;n.type=\"string\";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof i===\"number\")n.minLength=i;if(typeof s===\"number\")n.maxLength=s;if(a){if(n.format=Rk[a]??a,n.format===\"\")delete n.format;if(a===\"time\")delete n.format}if(u)n.contentEncoding=u;if(c&&c.size>0){let l=[...c];if(l.length===1)n.pattern=l[0].source;else if(l.length>1)n.allOf=[...l.map((m)=>({...t.target===\"draft-07\"||t.target===\"draft-04\"||t.target===\"openapi-3.0\"?{type:\"string\"}:{},pattern:m.source}))]}},Kf=(e,t,r,o)=>{let n=r,{minimum:i,maximum:s,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;if(typeof a===\"string\"&&a.includes(\"int\"))n.type=\"integer\";else n.type=\"number\";let m=typeof l===\"number\"&&l>=(i??Number.NEGATIVE_INFINITY),h=typeof u===\"number\"&&u<=(s??Number.POSITIVE_INFINITY),f=t.target===\"draft-04\"||t.target===\"openapi-3.0\";if(m)if(f)n.minimum=l,n.exclusiveMinimum=!0;else n.exclusiveMinimum=l;else if(typeof i===\"number\")n.minimum=i;if(h)if(f)n.maximum=u,n.exclusiveMaximum=!0;else n.exclusiveMaximum=u;else if(typeof s===\"number\")n.maximum=s;if(typeof c===\"number\")n.multipleOf=c},Yf=(e,t,r,o)=>{r.type=\"boolean\"};var Qf=(e,t,r,o)=>{if(t.target===\"openapi-3.0\")r.type=\"string\",r.nullable=!0,r.enum=[null];else r.type=\"null\"};var Xf=(e,t,r,o)=>{r.not={}},eg=(e,t,r,o)=>{},tg=(e,t,r,o)=>{};var rg=(e,t,r,o)=>{let n=e._zod.def,i=Ga(n.entries);if(i.every((s)=>typeof s===\"number\"))r.type=\"number\";if(i.every((s)=>typeof s===\"string\"))r.type=\"string\";r.enum=i},og=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable===\"throw\")throw Error(\"Literal `undefined` cannot be represented in JSON Schema\")}else if(typeof s===\"bigint\")if(t.unrepresentable===\"throw\")throw Error(\"BigInt literals cannot be represented in JSON Schema\");else i.push(Number(s));else i.push(s);if(i.length===0);else if(i.length===1){let s=i[0];if(r.type=s===null?\"null\":typeof s,t.target===\"draft-04\"||t.target===\"openapi-3.0\")r.enum=[s];else r.const=s}else{if(i.every((s)=>typeof s===\"number\"))r.type=\"number\";if(i.every((s)=>typeof s===\"string\"))r.type=\"string\";if(i.every((s)=>typeof s===\"boolean\"))r.type=\"boolean\";if(i.every((s)=>s===null))r.type=\"null\";r.enum=i}};var ng=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"Custom types cannot be represented in JSON Schema\")};var sg=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"Transforms cannot be represented in JSON Schema\")};var ig=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;if(typeof s===\"number\")n.minItems=s;if(typeof a===\"number\")n.maxItems=a;n.type=\"array\",n.items=ve(i.element,t,{...o,path:[...o.path,\"items\"]})},ag=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type=\"object\",n.properties={};let s=i.shape;for(let u in s)n.properties[u]=ve(s[u],t,{...o,path:[...o.path,\"properties\",u]});let a=new Set(Object.keys(s)),c=new Set([...a].filter((u)=>{let l=i.shape[u]._zod;if(t.io===\"input\")return l.optin===void 0;else return l.optout===void 0}));if(c.size>0)n.required=Array.from(c);if(i.catchall?._zod.def.type===\"never\")n.additionalProperties=!1;else if(!i.catchall){if(t.io===\"output\")n.additionalProperties=!1}else if(i.catchall)n.additionalProperties=ve(i.catchall,t,{...o,path:[...o.path,\"additionalProperties\"]})},cg=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,s=n.options.map((a,c)=>ve(a,t,{...o,path:[...o.path,i?\"oneOf\":\"anyOf\",c]}));if(i)r.oneOf=s;else r.anyOf=s},ug=(e,t,r,o)=>{let n=e._zod.def,i=ve(n.left,t,{...o,path:[...o.path,\"allOf\",0]}),s=ve(n.right,t,{...o,path:[...o.path,\"allOf\",1]}),a=(u)=>(\"allOf\"in u)&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=c};var lg=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type=\"object\";let s=i.keyType,c=s._zod.bag?.patterns;if(i.mode===\"loose\"&&c&&c.size>0){let l=ve(i.valueType,t,{...o,path:[...o.path,\"patternProperties\",\"*\"]});n.patternProperties={};for(let m of c)n.patternProperties[m.source]=l}else{if(t.target===\"draft-07\"||t.target===\"draft-2020-12\")n.propertyNames=ve(i.keyType,t,{...o,path:[...o.path,\"propertyNames\"]});n.additionalProperties=ve(i.valueType,t,{...o,path:[...o.path,\"additionalProperties\"]})}let u=s._zod.values;if(u){let l=[...u].filter((m)=>typeof m===\"string\"||typeof m===\"number\");if(l.length>0)n.required=l}},pg=(e,t,r,o)=>{let n=e._zod.def,i=ve(n.innerType,t,o),s=t.seen.get(e);if(t.target===\"openapi-3.0\")s.ref=n.innerType,r.nullable=!0;else r.anyOf=[i,{type:\"null\"}]},dg=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},mg=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},hg=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let i=t.seen.get(e);if(i.ref=n.innerType,t.io===\"input\")r._prefault=JSON.parse(JSON.stringify(n.defaultValue))},fg=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw Error(\"Dynamic catch values are not supported in JSON Schema\")}r.default=s},gg=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has(\"$ZodTransform\"),s=t.io===\"input\"?i?n.out:n.in:n.out;ve(s,t,o);let a=t.seen.get(e);a.ref=s},_g=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0};var bl=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Sg=(e,t,r,o)=>{let n=e._zod.innerType;ve(n,t,o);let i=t.seen.get(e);i.ref=n};var Nk=_(\"ZodISODateTime\",(e,t)=>{xh.init(e,t),me.init(e,t)});function yl(e){return Cf(Nk,e)}var Ak=_(\"ZodISODate\",(e,t)=>{wh.init(e,t),me.init(e,t)});function zg(e){return Zf(Ak,e)}var jk=_(\"ZodISOTime\",(e,t)=>{$h.init(e,t),me.init(e,t)});function bg(e){return Nf(jk,e)}var Mk=_(\"ZodISODuration\",(e,t)=>{kh.init(e,t),me.init(e,t)});function yg(e){return Af(Mk,e)}var qk=(e,t)=>{Xa.init(e,t),e.name=\"ZodError\",Object.defineProperties(e,{format:{value:(r)=>Ju(e,r)},flatten:{value:(r)=>Vu(e,r)},addIssue:{value:(r)=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Qn,2)}},addIssues:{value:(r)=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Qn,2)}},isEmpty:{get(){return e.issues.length===0}}})};var Ke=_(\"ZodError\",qk,{Parent:Error});var xg=ec(Ke),wg=tc(Ke),$g=es(Ke),kg=ts(Ke),Rg=am(Ke),Pg=cm(Ke),Tg=um(Ke),Eg=lm(Ke),Ig=pm(Ke),Og=dm(Ke),Cg=mm(Ke),Zg=hm(Ke);var Ng=new WeakMap;function as(e,t,r){let o=Object.getPrototypeOf(e),n=Ng.get(o);if(!n)n=new Set,Ng.set(o,n);if(n.has(t))return;n.add(t);for(let i in r){let s=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}var oe=_(\"ZodType\",(e,t)=>(X.init(e,t),Object.assign(e[\"~standard\"],{jsonSchema:{input:is(e,\"input\"),output:is(e,\"output\")}}),e.toJSONSchema=Wf(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,\"_def\",{value:t}),e.parse=(r,o)=>xg(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>$g(e,r,o),e.parseAsync=async(r,o)=>wg(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>kg(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Rg(e,r,o),e.decode=(r,o)=>Pg(e,r,o),e.encodeAsync=async(r,o)=>Tg(e,r,o),e.decodeAsync=async(r,o)=>Eg(e,r,o),e.safeEncode=(r,o)=>Ig(e,r,o),e.safeDecode=(r,o)=>Og(e,r,o),e.safeEncodeAsync=async(r,o)=>Cg(e,r,o),e.safeDecodeAsync=async(r,o)=>Zg(e,r,o),as(e,\"ZodType\",{check(...r){let o=this.def;return this.clone(Vt(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 it(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(TR(r,o))},superRefine(r,o){return this.check(ER(r,o))},overwrite(r){return this.check(Wt(r))},optional(){return he(this)},exactOptional(){return fR(this)},nullable(){return qg(this)},nullish(){return he(qg(this))},nonoptional(r){return yR(this,r)},array(){return w(this)},or(r){return ne([this,r])},and(r){return dc(this,r)},transform(r){return Lg(this,Gg(r))},default(r){return SR(this,r)},prefault(r){return bR(this,r)},catch(r){return xR(this,r)},pipe(r){return Lg(this,r)},readonly(){return kR(this)},describe(r){let o=this.clone();return Bt.add(o,{description:r}),o},meta(...r){if(r.length===0)return Bt.get(this);let o=this.clone();return Bt.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 Bt.get(e)?.description},configurable:!0}),e)),Ug=_(\"_ZodString\",(e,t)=>{nc.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Gf(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,as(e,\"_ZodString\",{regex(...o){return this.check(il(...o))},includes(...o){return this.check(ul(...o))},startsWith(...o){return this.check(ll(...o))},endsWith(...o){return this.check(pl(...o))},min(...o){return this.check(bo(...o))},max(...o){return this.check(cc(...o))},length(...o){return this.check(uc(...o))},nonempty(...o){return this.check(bo(1,...o))},lowercase(o){return this.check(al(o))},uppercase(o){return this.check(cl(o))},trim(){return this.check(ml())},normalize(...o){return this.check(dl(...o))},toLowerCase(){return this.check(hl())},toUpperCase(){return this.check(fl())},slugify(){return this.check(gl())}})}),Dg=_(\"ZodString\",(e,t)=>{nc.init(e,t),Ug.init(e,t),e.email=(r)=>e.check(mf(Uk,r)),e.url=(r)=>e.check(sl(Fg,r)),e.jwt=(r)=>e.check(Of(rR,r)),e.emoji=(r)=>e.check(Sf(Dk,r)),e.guid=(r)=>e.check(nl(Ag,r)),e.uuid=(r)=>e.check(hf(lc,r)),e.uuidv4=(r)=>e.check(ff(lc,r)),e.uuidv6=(r)=>e.check(gf(lc,r)),e.uuidv7=(r)=>e.check(_f(lc,r)),e.nanoid=(r)=>e.check(zf(Fk,r)),e.guid=(r)=>e.check(nl(Ag,r)),e.cuid=(r)=>e.check(bf(Vk,r)),e.cuid2=(r)=>e.check(yf(Jk,r)),e.ulid=(r)=>e.check(vf(Hk,r)),e.base64=(r)=>e.check(Tf(Xk,r)),e.base64url=(r)=>e.check(Ef(eR,r)),e.xid=(r)=>e.check(xf(Bk,r)),e.ksuid=(r)=>e.check(wf(Wk,r)),e.ipv4=(r)=>e.check($f(Gk,r)),e.ipv6=(r)=>e.check(kf(Kk,r)),e.cidrv4=(r)=>e.check(Rf(Yk,r)),e.cidrv6=(r)=>e.check(Pf(Qk,r)),e.e164=(r)=>e.check(If(tR,r)),e.datetime=(r)=>e.check(yl(r)),e.date=(r)=>e.check(zg(r)),e.time=(r)=>e.check(bg(r)),e.duration=(r)=>e.check(yg(r))});function d(e){return df(Dg,e)}var me=_(\"ZodStringFormat\",(e,t)=>{ae.init(e,t),Ug.init(e,t)}),Uk=_(\"ZodEmail\",(e,t)=>{hh.init(e,t),me.init(e,t)});var Ag=_(\"ZodGUID\",(e,t)=>{dh.init(e,t),me.init(e,t)});var lc=_(\"ZodUUID\",(e,t)=>{mh.init(e,t),me.init(e,t)});var Fg=_(\"ZodURL\",(e,t)=>{fh.init(e,t),me.init(e,t)});function Vg(e){return sl(Fg,e)}var Dk=_(\"ZodEmoji\",(e,t)=>{gh.init(e,t),me.init(e,t)});var Fk=_(\"ZodNanoID\",(e,t)=>{_h.init(e,t),me.init(e,t)});var Vk=_(\"ZodCUID\",(e,t)=>{Sh.init(e,t),me.init(e,t)});var Jk=_(\"ZodCUID2\",(e,t)=>{zh.init(e,t),me.init(e,t)});var Hk=_(\"ZodULID\",(e,t)=>{bh.init(e,t),me.init(e,t)});var Bk=_(\"ZodXID\",(e,t)=>{yh.init(e,t),me.init(e,t)});var Wk=_(\"ZodKSUID\",(e,t)=>{vh.init(e,t),me.init(e,t)});var Gk=_(\"ZodIPv4\",(e,t)=>{Rh.init(e,t),me.init(e,t)});var Kk=_(\"ZodIPv6\",(e,t)=>{Ph.init(e,t),me.init(e,t)});var Yk=_(\"ZodCIDRv4\",(e,t)=>{Th.init(e,t),me.init(e,t)});var Qk=_(\"ZodCIDRv6\",(e,t)=>{Eh.init(e,t),me.init(e,t)});var Xk=_(\"ZodBase64\",(e,t)=>{Oh.init(e,t),me.init(e,t)});var eR=_(\"ZodBase64URL\",(e,t)=>{Ch.init(e,t),me.init(e,t)});var tR=_(\"ZodE164\",(e,t)=>{Zh.init(e,t),me.init(e,t)});var rR=_(\"ZodJWT\",(e,t)=>{Nh.init(e,t),me.init(e,t)});var pc=_(\"ZodNumber\",(e,t)=>{Xu.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Kf(e,o,n,i),as(e,\"ZodNumber\",{gt(o,n){return this.check(ic(o,n))},gte(o,n){return this.check(ss(o,n))},min(o,n){return this.check(ss(o,n))},lt(o,n){return this.check(sc(o,n))},lte(o,n){return this.check(ns(o,n))},max(o,n){return this.check(ns(o,n))},int(o){return this.check(jg(o))},safe(o){return this.check(jg(o))},positive(o){return this.check(ic(0,o))},nonnegative(o){return this.check(ss(0,o))},negative(o){return this.check(sc(0,o))},nonpositive(o){return this.check(ns(0,o))},multipleOf(o,n){return this.check(ac(o,n))},step(o,n){return this.check(ac(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??0.5),e.isFinite=!0,e.format=r.format??null});function G(e){return jf(pc,e)}var oR=_(\"ZodNumberFormat\",(e,t)=>{Ah.init(e,t),pc.init(e,t)});function jg(e){return qf(oR,e)}var Jg=_(\"ZodBoolean\",(e,t)=>{jh.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yf(e,r,o,n)});function Y(e){return Lf(Jg,e)}var nR=_(\"ZodNull\",(e,t)=>{Mh.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qf(e,r,o,n)});function wl(e){return Uf(nR,e)}var sR=_(\"ZodAny\",(e,t)=>{qh.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>eg(e,r,o,n)});function Hg(){return Df(sR)}var iR=_(\"ZodUnknown\",(e,t)=>{Lh.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tg(e,r,o,n)});function Se(){return Ff(iR)}var aR=_(\"ZodNever\",(e,t)=>{Uh.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xf(e,r,o,n)});function cR(e){return Vf(aR,e)}var uR=_(\"ZodArray\",(e,t)=>{Dh.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ig(e,r,o,n),e.element=t.element,as(e,\"ZodArray\",{min(r,o){return this.check(bo(r,o))},nonempty(r){return this.check(bo(1,r))},max(r,o){return this.check(cc(r,o))},length(r,o){return this.check(uc(r,o))},unwrap(){return this.element}})});function w(e,t){return Jf(uR,e,t)}var Bg=_(\"ZodObject\",(e,t)=>{Jh.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ag(e,r,o,n),H(e,\"shape\",()=>t.shape),as(e,\"ZodObject\",{keyof(){return He(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Se()})},loose(){return this.clone({...this._zod.def,catchall:Se()})},strict(){return this.clone({...this._zod.def,catchall:cR()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return mk(this,r)},safeExtend(r){return hk(this,r)},merge(r){return fk(this,r)},pick(r){return pk(this,r)},omit(r){return dk(this,r)},partial(...r){return gk(Kg,this,r[0])},required(...r){return _k(Yg,this,r[0])}})});function P(e,t){let r={type:\"object\",shape:e??{},...O(t)};return new Bg(r)}function $e(e,t){return new Bg({type:\"object\",shape:e,catchall:Se(),...O(t)})}var Wg=_(\"ZodUnion\",(e,t)=>{el.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cg(e,r,o,n),e.options=t.options});function ne(e,t){return new Wg({type:\"union\",options:e,...O(t)})}var lR=_(\"ZodDiscriminatedUnion\",(e,t)=>{Wg.init(e,t),Hh.init(e,t)});function $l(e,t,r){return new lR({type:\"union\",options:t,discriminator:e,...O(r)})}var pR=_(\"ZodIntersection\",(e,t)=>{Bh.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ug(e,r,o,n)});function dc(e,t){return new pR({type:\"intersection\",left:e,right:t})}var Mg=_(\"ZodRecord\",(e,t)=>{Wh.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lg(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function fe(e,t,r){if(!t||!t._zod)return new Mg({type:\"record\",keyType:d(),valueType:e,...O(t)});return new Mg({type:\"record\",keyType:e,valueType:t,...O(r)})}var xl=_(\"ZodEnum\",(e,t)=>{Gh.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>rg(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new xl({...t,checks:[],...O(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let s of o)if(r.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new xl({...t,checks:[],...O(n),entries:i})}});function He(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new xl({type:\"enum\",entries:r,...O(t)})}var dR=_(\"ZodLiteral\",(e,t)=>{Kh.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>og(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,\"value\",{get(){if(t.values.length>1)throw Error(\"This schema contains multiple valid literal values. Use `.values` instead.\");return t.values[0]}})});function C(e,t){return new dR({type:\"literal\",values:Array.isArray(e)?e:[e],...O(t)})}var mR=_(\"ZodTransform\",(e,t)=>{Yh.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sg(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction===\"backward\")throw new Yn(e.constructor.name);r.addIssue=(i)=>{if(typeof i===\"string\")r.issues.push(Rr(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;s.code??(s.code=\"custom\"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(Rr(s))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((i)=>(r.value=i,r.fallback=!0,r));return r.value=n,r.fallback=!0,r}});function Gg(e){return new mR({type:\"transform\",transform:e})}var Kg=_(\"ZodOptional\",(e,t)=>{tl.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bl(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function he(e){return new Kg({type:\"optional\",innerType:e})}var hR=_(\"ZodExactOptional\",(e,t)=>{Qh.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bl(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function fR(e){return new hR({type:\"optional\",innerType:e})}var gR=_(\"ZodNullable\",(e,t)=>{Xh.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pg(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function qg(e){return new gR({type:\"nullable\",innerType:e})}var _R=_(\"ZodDefault\",(e,t)=>{ef.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mg(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function SR(e,t){return new _R({type:\"default\",innerType:e,get defaultValue(){return typeof t===\"function\"?t():Uu(t)}})}var zR=_(\"ZodPrefault\",(e,t)=>{tf.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hg(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function bR(e,t){return new zR({type:\"prefault\",innerType:e,get defaultValue(){return typeof t===\"function\"?t():Uu(t)}})}var Yg=_(\"ZodNonOptional\",(e,t)=>{rf.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dg(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function yR(e,t){return new Yg({type:\"nonoptional\",innerType:e,...O(t)})}var vR=_(\"ZodCatch\",(e,t)=>{of.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fg(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xR(e,t){return new vR({type:\"catch\",innerType:e,catchValue:typeof t===\"function\"?t:()=>t})}var Qg=_(\"ZodPipe\",(e,t)=>{rl.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gg(e,r,o,n),e.in=t.in,e.out=t.out});function Lg(e,t){return new Qg({type:\"pipe\",in:e,out:t})}var wR=_(\"ZodPreprocess\",(e,t)=>{Qg.init(e,t),nf.init(e,t)}),$R=_(\"ZodReadonly\",(e,t)=>{sf.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_g(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function kR(e){return new $R({type:\"readonly\",innerType:e})}var RR=_(\"ZodLazy\",(e,t)=>{af.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sg(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Xg(e){return new RR({type:\"lazy\",getter:e})}var PR=_(\"ZodCustom\",(e,t)=>{cf.init(e,t),oe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ng(e,r,o,n)});function TR(e,t={}){return Hf(PR,e,t)}function ER(e,t){return Bf(e,t)}function kl(e,t){return new wR({type:\"pipe\",in:Gg(e),out:t})}var t_={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 e_;(function(e){})(e_||(e_={}));function IR(e){return Mf(pc,e)}Je(ol());var mc=\"2025-11-25\";var hc=[mc,\"2025-06-18\",\"2025-03-26\",\"2024-11-05\",\"2024-10-07\"],fc=\"io.modelcontextprotocol/related-task\",Pr=\"io.modelcontextprotocol/protocolVersion\",vo=\"io.modelcontextprotocol/clientInfo\",Kt=\"io.modelcontextprotocol/serverInfo\",Tr=\"io.modelcontextprotocol/clientCapabilities\",gc=\"io.modelcontextprotocol/subscriptionId\",xo=\"io.modelcontextprotocol/logLevel\";var Er=\"2.0\";var kt=Xg(()=>ne([d(),G(),Y(),wl(),fe(d(),kt),w(kt)])),ze=fe(d(),kt),_c=w(kt),wo=ne([d(),G().int()]),$o=d(),cs=P({ttl:G().optional()}),us=P({taskId:d()}),ko=$e({progressToken:wo.optional(),[fc]:us.optional()}),Pe=P({_meta:ko.optional()}),Yt=Pe.extend({task:cs.optional()}),be=P({method:d(),params:Pe.loose().optional()}),je=P({_meta:ko.optional()}),Ee=P({method:d(),params:je.loose().optional()}),Ro=$e({get[Kt](){return gt.optional().catch(void 0)}}),ye=$e({_meta:Ro.optional()}),ct=ne([d(),G().int()]),Po=P({jsonrpc:C(Er),id:ct,...be.shape}).strict(),To=P({jsonrpc:C(Er),...Ee.shape}).strict(),Ir=P({jsonrpc:C(Er),id:ct,result:ye}).strict(),Or=P({jsonrpc:C(Er),id:ct.optional(),error:P({code:G().int(),message:d(),data:Se().optional()})}).strict(),Cr=ne([Po,To,Ir,Or]),Sc=ne([Ir,Or]),Qt=ye.strict(),ls=je.extend({requestId:ct.optional(),reason:d().optional()}),Eo=Ee.extend({method:C(\"notifications/cancelled\"),params:ls}),ps=P({src:d(),mimeType:d().optional(),sizes:w(d()).optional(),theme:He([\"light\",\"dark\"]).optional()}),Rt=P({icons:w(ps).optional()}),ft=P({name:d(),title:d().optional()}),gt=ft.extend({...ft.shape,...Rt.shape,version:d(),websiteUrl:d().optional(),description:d().optional()}),OR=dc(P({applyDefaults:Y().optional()}),ze),CR=kl((e)=>{if(e&&typeof e===\"object\"&&!Array.isArray(e)&&Object.keys(e).length===0)return{form:{}};return e},dc(P({form:OR.optional(),url:ze.optional()}),ze.optional())),zc=$e({list:ze.optional(),cancel:ze.optional(),requests:$e({sampling:$e({createMessage:ze.optional()}).optional(),elicitation:$e({create:ze.optional()}).optional()}).optional()}),bc=$e({list:ze.optional(),cancel:ze.optional(),requests:$e({tools:$e({call:ze.optional()}).optional()}).optional()}),ds=P({experimental:fe(d(),ze).optional(),sampling:P({context:ze.optional(),tools:ze.optional()}).optional(),elicitation:CR.optional(),roots:P({listChanged:Y().optional()}).optional(),tasks:zc.optional(),extensions:fe(d(),ze).optional()}),ms=Pe.extend({protocolVersion:d(),capabilities:ds,clientInfo:gt}),hs=be.extend({method:C(\"initialize\"),params:ms}),Io=P({experimental:fe(d(),ze).optional(),logging:ze.optional(),completions:ze.optional(),prompts:P({listChanged:Y().optional()}).optional(),resources:P({subscribe:Y().optional(),listChanged:Y().optional()}).optional(),tools:P({listChanged:Y().optional()}).optional(),tasks:bc.optional(),extensions:fe(d(),ze).optional()}),fs=ye.extend({protocolVersion:d(),capabilities:Io,serverInfo:gt,instructions:d().optional()}),gs=Ee.extend({method:C(\"notifications/initialized\"),params:je.optional()}),_s=be.extend({method:C(\"server/discover\"),params:Pe.optional()}),Oo=ye.extend({supportedVersions:w(d()),capabilities:Io,instructions:d().optional()}),Co=be.extend({method:C(\"ping\"),params:Pe.optional()}),Ss=P({progress:G(),total:he(G()),message:he(d())}),zs=P({...je.shape,...Ss.shape,progressToken:wo}),Zo=Ee.extend({method:C(\"notifications/progress\"),params:zs}),bs=Pe.extend({cursor:$o.optional()}),Pt=be.extend({params:bs.optional()}),Tt=ye.extend({nextCursor:$o.optional()}),No=P({uri:d(),mimeType:he(d()),_meta:fe(d(),Se()).optional()}),Ao=No.extend({text:d()}),Pl=d().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:\"Invalid Base64 string\"}),jo=No.extend({blob:Pl}),Et=He([\"user\",\"assistant\"]),_t=P({audience:w(Et).optional(),priority:G().min(0).max(1).optional(),lastModified:yl({offset:!0}).optional()}),Mo=P({...ft.shape,...Rt.shape,uri:d(),description:he(d()),mimeType:he(d()),size:he(G()),annotations:_t.optional(),_meta:he($e({}))}),ys=P({...ft.shape,...Rt.shape,uriTemplate:d(),description:he(d()),mimeType:he(d()),annotations:_t.optional(),_meta:he($e({}))}),vs=Pt.extend({method:C(\"resources/list\")}),xs=Tt.extend({resources:w(Mo)}),ws=Pt.extend({method:C(\"resources/templates/list\")}),$s=Tt.extend({resourceTemplates:w(ys)}),Zr=Pe.extend({uri:d()}),ks=Zr,Rs=be.extend({method:C(\"resources/read\"),params:ks}),Ps=ye.extend({contents:w(ne([Ao,jo]))}),Ts=Ee.extend({method:C(\"notifications/resources/list_changed\"),params:je.optional()}),Es=Zr,Is=be.extend({method:C(\"resources/subscribe\"),params:Es}),Os=Zr,Cs=be.extend({method:C(\"resources/unsubscribe\"),params:Os}),qo=P({toolsListChanged:Y().optional(),promptsListChanged:Y().optional(),resourcesListChanged:Y().optional(),resourceSubscriptions:w(d()).optional()}),Zs=Pe.extend({notifications:qo}),Ns=be.extend({method:C(\"subscriptions/listen\"),params:Zs}),As=je.extend({notifications:qo}),js=Ee.extend({method:C(\"notifications/subscriptions/acknowledged\"),params:As}),Ms=Ro.extend({[gc]:ct}),qs=ye.extend({_meta:Ms}),Ls=je.extend({uri:d()}),Us=Ee.extend({method:C(\"notifications/resources/updated\"),params:Ls}),Ds=P({name:d(),description:he(d()),required:he(Y())}),Fs=P({...ft.shape,...Rt.shape,description:he(d()),arguments:he(w(Ds)),_meta:he($e({}))}),Vs=Pt.extend({method:C(\"prompts/list\")}),Js=Tt.extend({prompts:w(Fs)}),Hs=Pe.extend({name:d(),arguments:fe(d(),d()).optional()}),Bs=be.extend({method:C(\"prompts/get\"),params:Hs}),Nr=P({type:C(\"text\"),text:d(),annotations:_t.optional(),_meta:fe(d(),Se()).optional()}),Ar=P({type:C(\"image\"),data:Pl,mimeType:d(),annotations:_t.optional(),_meta:fe(d(),Se()).optional()}),jr=P({type:C(\"audio\"),data:Pl,mimeType:d(),annotations:_t.optional(),_meta:fe(d(),Se()).optional()}),Ws=P({type:C(\"tool_use\"),name:d(),id:d(),input:fe(d(),Se()),_meta:fe(d(),Se()).optional()}),Mr=P({type:C(\"resource\"),resource:ne([Ao,jo]),annotations:_t.optional(),_meta:fe(d(),Se()).optional()}),qr=Mo.extend({type:C(\"resource_link\")}),St=ne([Nr,Ar,jr,qr,Mr]),Gs=P({role:Et,content:St}),Ks=ye.extend({description:d().optional(),messages:w(Gs)}),Ys=Ee.extend({method:C(\"notifications/prompts/list_changed\"),params:je.optional()}),Qs=P({title:d().optional(),readOnlyHint:Y().optional(),destructiveHint:Y().optional(),idempotentHint:Y().optional(),openWorldHint:Y().optional()}),Xs=P({taskSupport:He([\"required\",\"optional\",\"forbidden\"]).optional()}),Xt=P({...ft.shape,...Rt.shape,description:d().optional(),inputSchema:P({type:C(\"object\"),properties:fe(d(),kt).optional(),required:w(d()).optional()}).catchall(Se()),outputSchema:$e({$schema:d().optional()}).optional(),annotations:Qs.optional(),execution:Xs.optional(),_meta:fe(d(),Se()).optional()}),ei=Pt.extend({method:C(\"tools/list\")}),ti=Tt.extend({tools:w(Xt)}),er=ye.extend({content:w(St).default([]),structuredContent:Se().optional(),isError:Y().optional()}),yc=er.or(ye.extend({toolResult:Se()})),ri=Yt.extend({name:d(),arguments:fe(d(),Se()).optional()}),oi=be.extend({method:C(\"tools/call\"),params:ri}),ni=Ee.extend({method:C(\"notifications/tools/list_changed\"),params:je.optional()}),vc=P({autoRefresh:Y().default(!0),debounceMs:G().int().nonnegative().default(300)}),Lo=He([\"debug\",\"info\",\"notice\",\"warning\",\"error\",\"critical\",\"alert\",\"emergency\"]),si=Pe.extend({level:Lo}),ii=be.extend({method:C(\"logging/setLevel\"),params:si}),ai=je.extend({level:Lo,logger:d().optional(),data:Se()}),ci=Ee.extend({method:C(\"notifications/message\"),params:ai}),ui=P({name:d().optional()}),li=P({hints:w(ui).optional(),costPriority:G().min(0).max(1).optional(),speedPriority:G().min(0).max(1).optional(),intelligencePriority:G().min(0).max(1).optional()}),pi=P({mode:He([\"auto\",\"required\",\"none\"]).optional()}),di=P({type:C(\"tool_result\"),toolUseId:d().describe(\"The unique identifier for the corresponding tool call.\"),content:w(St),structuredContent:Se().optional(),isError:Y().optional(),_meta:fe(d(),Se()).optional()}),mi=$l(\"type\",[Nr,Ar,jr]),Gt=$l(\"type\",[Nr,Ar,jr,Ws,di]),hi=P({role:Et,content:ne([Gt,w(Gt)]),_meta:fe(d(),Se()).optional()}),fi=Yt.extend({messages:w(hi),modelPreferences:li.optional(),systemPrompt:d().optional(),includeContext:He([\"none\",\"thisServer\",\"allServers\"]).optional(),temperature:G().optional(),maxTokens:G().int(),stopSequences:w(d()).optional(),metadata:ze.optional(),tools:w(Xt).optional(),toolChoice:pi.optional()}),gi=be.extend({method:C(\"sampling/createMessage\"),params:fi}),_i=ye.extend({model:d(),stopReason:he(He([\"endTurn\",\"stopSequence\",\"maxTokens\"]).or(d())),role:Et,content:mi}),Si=ye.extend({model:d(),stopReason:he(He([\"endTurn\",\"stopSequence\",\"maxTokens\",\"toolUse\"]).or(d())),role:Et,content:ne([Gt,w(Gt)])}),Uo=P({type:C(\"boolean\"),title:d().optional(),description:d().optional(),default:Y().optional()}),Lr=P({type:C(\"string\"),title:d().optional(),description:d().optional(),minLength:G().optional(),maxLength:G().optional(),format:He([\"email\",\"uri\",\"date\",\"date-time\"]).optional(),default:d().optional()}),Ur=P({type:He([\"number\",\"integer\"]),title:d().optional(),description:d().optional(),minimum:G().optional(),maximum:G().optional(),default:G().optional()}),Do=P({type:C(\"string\"),title:d().optional(),description:d().optional(),enum:w(d()),default:d().optional()}),Fo=P({type:C(\"string\"),title:d().optional(),description:d().optional(),oneOf:w(P({const:d(),title:d()})),default:d().optional()}),Vo=P({type:C(\"string\"),title:d().optional(),description:d().optional(),enum:w(d()),enumNames:w(d()).optional(),default:d().optional()}),zi=ne([Do,Fo]),Jo=P({type:C(\"array\"),title:d().optional(),description:d().optional(),minItems:G().optional(),maxItems:G().optional(),items:P({type:C(\"string\"),enum:w(d())}),default:w(d()).optional()}),Ho=P({type:C(\"array\"),title:d().optional(),description:d().optional(),minItems:G().optional(),maxItems:G().optional(),items:P({anyOf:w(P({const:d(),title:d()}))}),default:w(d()).optional()}),bi=ne([Jo,Ho]),yi=ne([Vo,zi,bi]),Bo=ne([yi,Uo,Lr,Ur]),Dr=Yt.extend({mode:C(\"form\").optional(),message:d(),requestedSchema:P({type:C(\"object\"),properties:fe(d(),Bo),required:w(d()).optional()}).catchall(Se())}),vi=Yt.extend({mode:C(\"url\"),message:d(),elicitationId:d(),url:d().url()}),xi=ne([Dr,vi]),wi=be.extend({method:C(\"elicitation/create\"),params:xi}),$i=je.extend({elicitationId:d()}),ki=Ee.extend({method:C(\"notifications/elicitation/complete\"),params:$i}),Ri=ye.extend({action:He([\"accept\",\"decline\",\"cancel\"]),content:kl((e)=>e===null?void 0:e,fe(d(),ne([d(),G(),Y(),w(d())])).optional())}),Pi=P({type:C(\"ref/resource\"),uri:d()}),Ti=P({type:C(\"ref/prompt\"),name:d()}),Ei=Pe.extend({ref:ne([Ti,Pi]),argument:P({name:d(),value:d()}),context:P({arguments:fe(d(),d()).optional()}).optional()}),Ii=be.extend({method:C(\"completion/complete\"),params:Ei}),Oi=ye.extend({completion:$e({values:w(d()).max(100),total:he(G().int()),hasMore:he(Y())})}),Ci=P({uri:d().startsWith(\"file://\"),name:d().optional(),_meta:fe(d(),Se()).optional()}),Zi=be.extend({method:C(\"roots/list\"),params:Pe.optional()}),Ni=ye.extend({roots:w(Ci)}),Ai=Ee.extend({method:C(\"notifications/roots/list_changed\"),params:je.optional()}),xc=$e({ttl:G().optional(),pollInterval:G().optional()}),ji=He([\"working\",\"input_required\",\"completed\",\"failed\",\"cancelled\"]),It=P({taskId:d(),status:ji,ttl:ne([G(),wl()]),createdAt:d(),lastUpdatedAt:d(),pollInterval:he(G()),statusMessage:he(d())}),wc=ye.extend({task:It}),Mi=je.merge(It),$c=Ee.extend({method:C(\"notifications/tasks/status\"),params:Mi}),kc=be.extend({method:C(\"tasks/get\"),params:Pe.extend({taskId:d()})}),Rc=ye.merge(It),Pc=be.extend({method:C(\"tasks/result\"),params:Pe.extend({taskId:d()})}),Tc=ye.loose(),Ec=Pt.extend({method:C(\"tasks/list\")}),Ic=Tt.extend({tasks:w(It)}),Oc=be.extend({method:C(\"tasks/cancel\"),params:Pe.extend({taskId:d()})}),Cc=ye.merge(It),Zc=ne([Co,hs,_s,Ii,ii,Bs,Vs,vs,ws,Rs,Is,Cs,Ns,oi,ei]),Nc=ne([Eo,Zo,gs,Ai]),Ac=ne([Qt,_i,Si,Ri,Ni]),jc=ne([Co,gi,wi,Zi]),Mc=ne([Eo,Zo,ci,Us,Ts,ni,Ys,js,ki]),qc=ne([Qt,fs,Oo,Oi,Ks,Js,xs,$s,Ps,er,ti,qs]),Re=Vg().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:t_.custom,message:\"URL must be parseable\",fatal:!0}),Au}).refine((e)=>{let t=new URL(e);return t.protocol!==\"javascript:\"&&t.protocol!==\"data:\"&&t.protocol!==\"vbscript:\"},{message:\"URL cannot use javascript:, data:, or vbscript: scheme\"}),qi=$e({resource:d().url(),authorization_servers:w(Re).optional(),jwks_uri:d().url().optional(),scopes_supported:w(d()).optional(),bearer_methods_supported:w(d()).optional(),resource_signing_alg_values_supported:w(d()).optional(),resource_name:d().optional(),resource_documentation:d().optional(),resource_policy_uri:d().url().optional(),resource_tos_uri:d().url().optional(),tls_client_certificate_bound_access_tokens:Y().optional(),authorization_details_types_supported:w(d()).optional(),dpop_signing_alg_values_supported:w(d()).optional(),dpop_bound_access_tokens_required:Y().optional()}),Wo=$e({issuer:d(),authorization_endpoint:Re,token_endpoint:Re,registration_endpoint:Re.optional(),scopes_supported:w(d()).optional(),response_types_supported:w(d()),response_modes_supported:w(d()).optional(),grant_types_supported:w(d()).optional(),token_endpoint_auth_methods_supported:w(d()).optional(),token_endpoint_auth_signing_alg_values_supported:w(d()).optional(),service_documentation:Re.optional(),revocation_endpoint:Re.optional(),revocation_endpoint_auth_methods_supported:w(d()).optional(),revocation_endpoint_auth_signing_alg_values_supported:w(d()).optional(),introspection_endpoint:d().optional(),introspection_endpoint_auth_methods_supported:w(d()).optional(),introspection_endpoint_auth_signing_alg_values_supported:w(d()).optional(),code_challenge_methods_supported:w(d()).optional(),client_id_metadata_document_supported:Y().optional(),authorization_response_iss_parameter_supported:Y().optional().catch(void 0)}),Li=$e({issuer:d(),authorization_endpoint:Re,token_endpoint:Re,userinfo_endpoint:Re.optional(),jwks_uri:Re,registration_endpoint:Re.optional(),scopes_supported:w(d()).optional(),response_types_supported:w(d()),response_modes_supported:w(d()).optional(),grant_types_supported:w(d()).optional(),acr_values_supported:w(d()).optional(),subject_types_supported:w(d()),id_token_signing_alg_values_supported:w(d()),id_token_encryption_alg_values_supported:w(d()).optional(),id_token_encryption_enc_values_supported:w(d()).optional(),userinfo_signing_alg_values_supported:w(d()).optional(),userinfo_encryption_alg_values_supported:w(d()).optional(),userinfo_encryption_enc_values_supported:w(d()).optional(),request_object_signing_alg_values_supported:w(d()).optional(),request_object_encryption_alg_values_supported:w(d()).optional(),request_object_encryption_enc_values_supported:w(d()).optional(),token_endpoint_auth_methods_supported:w(d()).optional(),token_endpoint_auth_signing_alg_values_supported:w(d()).optional(),display_values_supported:w(d()).optional(),claim_types_supported:w(d()).optional(),claims_supported:w(d()).optional(),service_documentation:d().optional(),claims_locales_supported:w(d()).optional(),ui_locales_supported:w(d()).optional(),claims_parameter_supported:Y().optional(),request_parameter_supported:Y().optional(),request_uri_parameter_supported:Y().optional(),require_request_uri_registration:Y().optional(),op_policy_uri:Re.optional(),op_tos_uri:Re.optional(),client_id_metadata_document_supported:Y().optional(),authorization_response_iss_parameter_supported:Y().optional().catch(void 0)}),Ui=P({...Li.shape,...Wo.pick({code_challenge_methods_supported:!0}).shape}),Di=P({access_token:d(),id_token:d().optional(),token_type:d(),expires_in:IR().optional(),scope:d().optional(),refresh_token:d().optional()}).strip(),Fi=P({issued_token_type:C(\"urn:ietf:params:oauth:token-type:id-jag\"),access_token:d(),token_type:d().optional(),expires_in:G().optional(),scope:d().optional()}).strip(),Vi=P({error:d(),error_description:d().optional(),error_uri:d().optional()}),Rl=Re.optional().or(C(\"\").transform(()=>{return})),Ji=P({redirect_uris:w(Re),token_endpoint_auth_method:d().optional(),grant_types:w(d()).optional(),response_types:w(d()).optional(),application_type:d().optional(),client_name:d().optional(),client_uri:Re.optional(),logo_uri:Rl,scope:d().optional(),contacts:w(d()).optional(),tos_uri:Rl,policy_uri:d().optional(),jwks_uri:Re.optional(),jwks:Hg().optional(),software_id:d().optional(),software_version:d().optional(),software_statement:d().optional()}).strip(),Hi=P({client_id:d(),client_secret:d().optional(),client_id_issued_at:G().optional(),client_secret_expires_at:G().optional()}).strip(),Bi=Ji.merge(Hi),Lc=P({error:d(),error_description:d().optional()}).strip(),Uc=P({token:d(),token_type_hint:d().optional()}).strip();var d_;function S(e,t,r){function o(a,c){if(!a._zod)Object.defineProperty(a,\"_zod\",{value:{def:c,constr:s,traits:new Set},enumerable:!1});if(a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=s.prototype,l=Object.keys(u);for(let m=0;m<l.length;m++){let h=l[m];if(!(h in a))a[h]=u[h].bind(a)}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,\"name\",{value:e});function s(a){var c;let u=r?.Parent?new i:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(s,\"init\",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:(a)=>{if(r?.Parent&&a instanceof r.Parent)return!0;return a?._zod?.traits?.has(e)}}),Object.defineProperty(s,\"name\",{value:e}),s}var iZ=Symbol(\"zod_brand\");class Ot extends Error{constructor(){super(\"Encountered Promise during synchronous parse. Use .parseAsync() instead.\")}}class Wi extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name=\"ZodEncodeError\"}}(d_=globalThis).__zod_globalConfig??(d_.__zod_globalConfig={});var Go=globalThis.__zod_globalConfig;function Ye(e){if(e)Object.assign(Go,e);return Go}function Fc(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 El(e,t=\"|\"){return e.map((r)=>Zl(r)).join(t)}function Gi(e,t){if(typeof t===\"bigint\")return t.toString();return t}function Ki(e){return{get value(){{let r=e();return Object.defineProperty(this,\"value\",{value:r}),r}throw Error(\"cached value already set\")}}}function Vc(e){return e===null||e===void 0}function Jc(e){let t=e.startsWith(\"^\")?1:0,r=e.endsWith(\"$\")?e.length-1:e.length;return e.slice(t,r)}function h_(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}var m_=Symbol(\"evaluating\");function B(e,t,r){let o=void 0;Object.defineProperty(e,t,{get(){if(o===m_)return;if(o===void 0)o=m_,o=r();return o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Fr(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function tr(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function Il(e){return JSON.stringify(e)}function f_(e){return e.toLowerCase().trim().replace(/[^\\w\\s-]/g,\"\").replace(/[\\s_-]+/g,\"-\").replace(/^-+|-+$/g,\"\")}var Ol=\"captureStackTrace\"in Error?Error.captureStackTrace:(...e)=>{};function Ko(e){return typeof e===\"object\"&&e!==null&&!Array.isArray(e)}var g_=Ki(()=>{if(Go.jitless)return!1;if(typeof navigator<\"u\"&&navigator?.userAgent?.includes(\"Cloudflare\"))return!1;try{return new Function(\"\"),!0}catch(e){return!1}});function Vr(e){if(Ko(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!==\"function\")return!0;let r=t.prototype;if(Ko(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,\"isPrototypeOf\")===!1)return!1;return!0}function Cl(e){if(Vr(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var __=new Set([\"string\",\"number\",\"symbol\"]);function rr(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")}function zt(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function Z(e){let t=e;if(!t)return{};if(typeof t===\"string\")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error(\"Cannot specify both `message` and `error` params\");t.error=t.message}if(delete t.message,typeof t.error===\"string\")return{...t,error:()=>t.error};return t}function Zl(e){if(typeof e===\"bigint\")return e.toString()+\"n\";if(typeof e===\"string\")return`\"${e}\"`;return`${e}`}function S_(e){return Object.keys(e).filter((t)=>e[t]._zod.optin===\"optional\"&&e[t]._zod.optout===\"optional\")}var z_={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ZR(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(\".pick() cannot be used on object schemas containing refinements\");let i=tr(e._zod.def,{get shape(){let s={};for(let a in t){if(!(a in r.shape))throw Error(`Unrecognized key: \"${a}\"`);if(!t[a])continue;s[a]=r.shape[a]}return Fr(this,\"shape\",s),s},checks:[]});return zt(e,i)}function NR(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(\".omit() cannot be used on object schemas containing refinements\");let i=tr(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw Error(`Unrecognized key: \"${a}\"`);if(!t[a])continue;delete s[a]}return Fr(this,\"shape\",s),s},checks:[]});return zt(e,i)}function AR(e,t){if(!Vr(t))throw Error(\"Invalid input to extend: expected a plain object\");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw Error(\"Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.\")}let n=tr(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Fr(this,\"shape\",i),i}});return zt(e,n)}function jR(e,t){if(!Vr(t))throw Error(\"Invalid input to safeExtend: expected a plain object\");let r=tr(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Fr(this,\"shape\",o),o}});return zt(e,r)}function MR(e,t){if(e._zod.def.checks?.length)throw Error(\".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.\");let r=tr(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Fr(this,\"shape\",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return zt(e,r)}function qR(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(\".partial() cannot be used on object schemas containing refinements\");let s=tr(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw Error(`Unrecognized key: \"${u}\"`);if(!r[u])continue;c[u]=e?new e({type:\"optional\",innerType:a[u]}):a[u]}else for(let u in a)c[u]=e?new e({type:\"optional\",innerType:a[u]}):a[u];return Fr(this,\"shape\",c),c},checks:[]});return zt(t,s)}function LR(e,t,r){let o=tr(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let s in r){if(!(s in i))throw Error(`Unrecognized key: \"${s}\"`);if(!r[s])continue;i[s]=new e({type:\"nonoptional\",innerType:n[s]})}else for(let s in n)i[s]=new e({type:\"nonoptional\",innerType:n[s]});return Fr(this,\"shape\",i),i}});return zt(t,o)}function Jr(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 b_(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 or(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Dc(e){return typeof e===\"string\"?e:e?.message}function ut(e,t,r){let o=e.message?e.message:Dc(e.inst?._zod.def?.error?.(e))??Dc(t?.error?.(e))??Dc(r.customError?.(e))??Dc(r.localeError?.(e))??\"Invalid input\",{inst:n,continue:i,input:s,...a}=e;if(a.path??(a.path=[]),a.message=o,t?.reportInput)a.input=s;return a}function Hc(e){if(Array.isArray(e))return\"array\";if(typeof e===\"string\")return\"string\";return\"unknown\"}function y_(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 Hr(...e){let[t,r,o]=e;if(typeof t===\"string\")return{message:t,code:\"custom\",input:r,inst:o};return{...t}}var v_=(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,Gi,2),Object.defineProperty(e,\"toString\",{value:()=>e.message,enumerable:!1})},Bc=S(\"$ZodError\",v_),Nl=S(\"$ZodError\",v_,{Parent:Error});function x_(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function w_(e,t=(r)=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let s of n.issues)if(s.code===\"invalid_union\"&&s.errors.length)s.errors.map((a)=>o({issues:a},[...i,...s.path]));else if(s.code===\"invalid_key\")o({issues:s.issues},[...i,...s.path]);else if(s.code===\"invalid_element\")o({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else{let c=r,u=0;while(u<a.length){let l=a[u];if(u!==a.length-1)c[l]=c[l]||{_errors:[]};else c[l]=c[l]||{_errors:[]},c[l]._errors.push(t(s));c=c[l],u++}}}};return o(e),r}var Wc=(e)=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Ot;if(s.issues.length){let a=new(n?.Err??e)(s.issues.map((c)=>ut(c,i,Ye())));throw Ol(a,n?.callee),a}return s.value};var Gc=(e)=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)s=await s;if(s.issues.length){let a=new(n?.Err??e)(s.issues.map((c)=>ut(c,i,Ye())));throw Ol(a,n?.callee),a}return s.value};var Yi=(e)=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new Ot;return i.issues.length?{success:!1,error:new(e??Bc)(i.issues.map((s)=>ut(s,n,Ye())))}:{success:!0,data:i.value}},$_=Yi(Nl),Qi=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)i=await i;return i.issues.length?{success:!1,error:new e(i.issues.map((s)=>ut(s,n,Ye())))}:{success:!0,data:i.value}},k_=Qi(Nl),R_=(e)=>(t,r,o)=>{let n=o?{...o,direction:\"backward\"}:{direction:\"backward\"};return Wc(e)(t,r,n)};var P_=(e)=>(t,r,o)=>Wc(e)(t,r,o);var T_=(e)=>async(t,r,o)=>{let n=o?{...o,direction:\"backward\"}:{direction:\"backward\"};return Gc(e)(t,r,n)};var E_=(e)=>async(t,r,o)=>Gc(e)(t,r,o);var I_=(e)=>(t,r,o)=>{let n=o?{...o,direction:\"backward\"}:{direction:\"backward\"};return Yi(e)(t,r,n)};var O_=(e)=>(t,r,o)=>Yi(e)(t,r,o);var C_=(e)=>async(t,r,o)=>{let n=o?{...o,direction:\"backward\"}:{direction:\"backward\"};return Qi(e)(t,r,n)};var Z_=(e)=>async(t,r,o)=>Qi(e)(t,r,o);var N_=/^[cC][0-9a-z]{6,}$/,A_=/^[0-9a-z]+$/,j_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,M_=/^[0-9a-vA-V]{20}$/,q_=/^[A-Za-z0-9]{27}$/,L_=/^[a-zA-Z0-9_-]{21}$/,U_=/^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/;var D_=/^([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})$/,Al=(e)=>{if(!e)return/^([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)$/;return 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})$`)};var F_=/^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/;var DR=\"^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$\";function V_(){return new RegExp(DR,\"u\")}var J_=/^(?:(?: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])$/,H_=/^(([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 B_=/^((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])$/,W_=/^(([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])$/,G_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,jl=/^[A-Za-z0-9_-]*$/;var K_=/^https?$/,Y_=/^\\+[1-9]\\d{6,14}$/,Q_=\"(?:(?:\\\\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])))\",X_=new RegExp(`^${Q_}$`);function eS(e){return typeof e.precision===\"number\"?e.precision===-1?\"(?:[01]\\\\d|2[0-3]):[0-5]\\\\d\":e.precision===0?\"(?:[01]\\\\d|2[0-3]):[0-5]\\\\d:[0-5]\\\\d\":`(?:[01]\\\\d|2[0-3]):[0-5]\\\\d:[0-5]\\\\d\\\\.\\\\d{${e.precision}}`:\"(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?\"}function tS(e){return new RegExp(`^${eS(e)}$`)}function rS(e){let t=eS({precision:e.precision}),r=[\"Z\"];if(e.local)r.push(\"\");if(e.offset)r.push(\"([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)\");let o=`${t}(?:${r.join(\"|\")})`;return new RegExp(`^${Q_}T(?:${o})$`)}var oS=(e)=>{let t=e?`[\\\\s\\\\S]{${e?.minimum??0},${e?.maximum??\"\"}}`:\"[\\\\s\\\\S]*\";return new RegExp(`^${t}$`)};var nS=/^-?\\d+$/,Ml=/^-?\\d+(?:\\.\\d+)?$/,sS=/^(?:true|false)$/i,iS=/^null$/i;var aS=/^[^A-Z]*$/,cS=/^[^a-z]*$/;var Ie=S(\"$ZodCheck\",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),uS={number:\"number\",bigint:\"bigint\",object:\"date\"},ql=S(\"$ZodCheckLessThan\",(e,t)=>{Ie.init(e,t);let r=uS[typeof t.value];e._zod.onattach.push((o)=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<i)if(t.inclusive)n.maximum=t.value;else n.exclusiveMaximum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;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})}}),Ll=S(\"$ZodCheckGreaterThan\",(e,t)=>{Ie.init(e,t);let r=uS[typeof t.value];e._zod.onattach.push((o)=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>i)if(t.inclusive)n.minimum=t.value;else n.exclusiveMinimum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;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})}}),lS=S(\"$ZodCheckMultipleOf\",(e,t)=>{Ie.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 Error(\"Cannot mix number and bigint in multiple_of check.\");if(typeof r.value===\"bigint\"?r.value%t.value===BigInt(0):h_(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:\"not_multiple_of\",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),pS=S(\"$ZodCheckNumberFormat\",(e,t)=>{Ie.init(e,t),t.format=t.format||\"float64\";let r=t.format?.includes(\"int\"),o=r?\"int\":\"number\",[n,i]=z_[t.format];e._zod.onattach.push((s)=>{let a=s._zod.bag;if(a.format=t.format,a.minimum=n,a.maximum=i,r)a.pattern=nS}),e._zod.check=(s)=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:o,format:t.format,code:\"invalid_type\",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)s.issues.push({input:a,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});else s.issues.push({input:a,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}}if(a<n)s.issues.push({origin:\"number\",input:a,code:\"too_small\",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(a>i)s.issues.push({origin:\"number\",input:a,code:\"too_big\",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var dS=S(\"$ZodCheckMaxLength\",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!Vc(n)&&n.length!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<n)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let n=o.value;if(n.length<=t.maximum)return;let s=Hc(n);o.issues.push({origin:s,code:\"too_big\",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),mS=S(\"$ZodCheckMinLength\",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!Vc(n)&&n.length!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>n)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let n=o.value;if(n.length>=t.minimum)return;let s=Hc(n);o.issues.push({origin:s,code:\"too_small\",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),hS=S(\"$ZodCheckLengthEquals\",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!Vc(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,i=n.length;if(i===t.length)return;let s=Hc(n),a=i>t.length;o.issues.push({origin:s,...a?{code:\"too_big\",maximum:t.length}:{code:\"too_small\",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Xi=S(\"$ZodCheckStringFormat\",(e,t)=>{var r,o;if(Ie.init(e,t),e._zod.onattach.push((n)=>{let i=n._zod.bag;if(i.format=t.format,t.pattern)i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern)}),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;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})});else(o=e._zod).check??(o.check=()=>{})}),fS=S(\"$ZodCheckRegex\",(e,t)=>{Xi.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:\"string\",code:\"invalid_format\",format:\"regex\",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),gS=S(\"$ZodCheckLowerCase\",(e,t)=>{t.pattern??(t.pattern=aS),Xi.init(e,t)}),_S=S(\"$ZodCheckUpperCase\",(e,t)=>{t.pattern??(t.pattern=cS),Xi.init(e,t)}),SS=S(\"$ZodCheckIncludes\",(e,t)=>{Ie.init(e,t);let r=rr(t.includes),o=new RegExp(typeof t.position===\"number\"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push((n)=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:\"string\",code:\"invalid_format\",format:\"includes\",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),zS=S(\"$ZodCheckStartsWith\",(e,t)=>{Ie.init(e,t);let r=new RegExp(`^${rr(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)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:\"string\",code:\"invalid_format\",format:\"starts_with\",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),bS=S(\"$ZodCheckEndsWith\",(e,t)=>{Ie.init(e,t);let r=new RegExp(`.*${rr(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)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:\"string\",code:\"invalid_format\",format:\"ends_with\",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var yS=S(\"$ZodCheckOverwrite\",(e,t)=>{Ie.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class Ul{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e===\"function\"){e(this,{execution:\"sync\"}),e(this,{execution:\"async\"});return}let r=e.split(`\n`).filter((i)=>i),o=Math.min(...r.map((i)=>i.length-i.trimStart().length)),n=r.map((i)=>i.slice(o)).map((i)=>\" \".repeat(this.indent*2)+i);for(let i of n)this.content.push(i)}compile(){let e=Function,t=this?.args,o=[...(this?.content??[\"\"]).map((n)=>`  ${n}`)];return new e(...t,o.join(`\n`))}}var xS={major:4,minor:4,patch:3};var se=S(\"$ZodType\",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=xS;let o=[...e._zod.def.checks??[]];if(e._zod.traits.has(\"$ZodCheck\"))o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(s,a,c)=>{let u=Jr(s),l;for(let m of a){if(m._zod.def.when){if(b_(s))continue;if(!m._zod.def.when(s))continue}else if(u)continue;let h=s.issues.length,f=m._zod.check(s);if(f instanceof Promise&&c?.async===!1)throw new Ot;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{if(await f,s.issues.length===h)return;if(!u)u=Jr(s,h)});else{if(s.issues.length===h)continue;if(!u)u=Jr(s,h)}}if(l)return l.then(()=>s);return s},i=(s,a,c)=>{if(Jr(s))return s.aborted=!0,s;let u=n(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new Ot;return u.then((l)=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction===\"backward\"){let u=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});if(u instanceof Promise)return u.then((l)=>i(l,s,a));return i(u,s,a)}let c=e._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new Ot;return c.then((u)=>n(u,o,a))}return n(c,o,a)}}B(e,\"~standard\",()=>({validate:(n)=>{try{let i=$_(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch(i){return k_(e,n).then((s)=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:\"zod\",version:1}))}),Xc=S(\"$ZodString\",(e,t)=>{se.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??oS(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value===\"string\")return r;return r.issues.push({expected:\"string\",code:\"invalid_type\",input:r.value,inst:e}),r}}),ce=S(\"$ZodStringFormat\",(e,t)=>{Xi.init(e,t),Xc.init(e,t)}),OS=S(\"$ZodGUID\",(e,t)=>{t.pattern??(t.pattern=D_),ce.init(e,t)}),CS=S(\"$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 Error(`Invalid UUID version: \"${t.version}\"`);t.pattern??(t.pattern=Al(o))}else t.pattern??(t.pattern=Al());ce.init(e,t)}),ZS=S(\"$ZodEmail\",(e,t)=>{t.pattern??(t.pattern=F_),ce.init(e,t)}),NS=S(\"$ZodURL\",(e,t)=>{ce.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===K_.source){if(!/^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);if(t.hostname){if(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})}if(t.protocol){if(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})}if(t.normalize)r.value=n.href;else r.value=o;return}catch(o){r.issues.push({code:\"invalid_format\",format:\"url\",input:r.value,inst:e,continue:!t.abort})}}}),AS=S(\"$ZodEmoji\",(e,t)=>{t.pattern??(t.pattern=V_()),ce.init(e,t)}),jS=S(\"$ZodNanoID\",(e,t)=>{t.pattern??(t.pattern=L_),ce.init(e,t)}),MS=S(\"$ZodCUID\",(e,t)=>{t.pattern??(t.pattern=N_),ce.init(e,t)}),qS=S(\"$ZodCUID2\",(e,t)=>{t.pattern??(t.pattern=A_),ce.init(e,t)}),LS=S(\"$ZodULID\",(e,t)=>{t.pattern??(t.pattern=j_),ce.init(e,t)}),US=S(\"$ZodXID\",(e,t)=>{t.pattern??(t.pattern=M_),ce.init(e,t)}),DS=S(\"$ZodKSUID\",(e,t)=>{t.pattern??(t.pattern=q_),ce.init(e,t)}),FS=S(\"$ZodISODateTime\",(e,t)=>{t.pattern??(t.pattern=rS(t)),ce.init(e,t)}),VS=S(\"$ZodISODate\",(e,t)=>{t.pattern??(t.pattern=X_),ce.init(e,t)}),JS=S(\"$ZodISOTime\",(e,t)=>{t.pattern??(t.pattern=tS(t)),ce.init(e,t)}),HS=S(\"$ZodISODuration\",(e,t)=>{t.pattern??(t.pattern=U_),ce.init(e,t)}),BS=S(\"$ZodIPv4\",(e,t)=>{t.pattern??(t.pattern=J_),ce.init(e,t),e._zod.bag.format=\"ipv4\"}),WS=S(\"$ZodIPv6\",(e,t)=>{t.pattern??(t.pattern=H_),ce.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 GS=S(\"$ZodCIDRv4\",(e,t)=>{t.pattern??(t.pattern=B_),ce.init(e,t)}),KS=S(\"$ZodCIDRv6\",(e,t)=>{t.pattern??(t.pattern=W_),ce.init(e,t),e._zod.check=(r)=>{let o=r.value.split(\"/\");try{if(o.length!==2)throw Error();let[n,i]=o;if(!i)throw Error();let s=Number(i);if(`${s}`!==i)throw Error();if(s<0||s>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:\"invalid_format\",format:\"cidrv6\",input:r.value,inst:e,continue:!t.abort})}}});function YS(e){if(e===\"\")return!0;if(/\\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var QS=S(\"$ZodBase64\",(e,t)=>{t.pattern??(t.pattern=G_),ce.init(e,t),e._zod.bag.contentEncoding=\"base64\",e._zod.check=(r)=>{if(YS(r.value))return;r.issues.push({code:\"invalid_format\",format:\"base64\",input:r.value,inst:e,continue:!t.abort})}});function FR(e){if(!jl.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o===\"-\"?\"+\":\"/\"),r=t.padEnd(Math.ceil(t.length/4)*4,\"=\");return YS(r)}var XS=S(\"$ZodBase64URL\",(e,t)=>{t.pattern??(t.pattern=jl),ce.init(e,t),e._zod.bag.contentEncoding=\"base64url\",e._zod.check=(r)=>{if(FR(r.value))return;r.issues.push({code:\"invalid_format\",format:\"base64url\",input:r.value,inst:e,continue:!t.abort})}}),ez=S(\"$ZodE164\",(e,t)=>{t.pattern??(t.pattern=Y_),ce.init(e,t)});function VR(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));if(\"typ\"in n&&n?.typ!==\"JWT\")return!1;if(!n.alg)return!1;if(t&&(!(\"alg\"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var tz=S(\"$ZodJWT\",(e,t)=>{ce.init(e,t),e._zod.check=(r)=>{if(VR(r.value,t.alg))return;r.issues.push({code:\"invalid_format\",format:\"jwt\",input:r.value,inst:e,continue:!t.abort})}});var Fl=S(\"$ZodNumber\",(e,t)=>{se.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ml,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}let n=r.value;if(typeof n===\"number\"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n===\"number\"?Number.isNaN(n)?\"NaN\":!Number.isFinite(n)?\"Infinity\":void 0:void 0;return r.issues.push({expected:\"number\",code:\"invalid_type\",input:n,inst:e,...i?{received:i}:{}}),r}}),rz=S(\"$ZodNumberFormat\",(e,t)=>{pS.init(e,t),Fl.init(e,t)}),oz=S(\"$ZodBoolean\",(e,t)=>{se.init(e,t),e._zod.pattern=sS,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(i){}let n=r.value;if(typeof n===\"boolean\")return r;return r.issues.push({expected:\"boolean\",code:\"invalid_type\",input:n,inst:e}),r}});var nz=S(\"$ZodNull\",(e,t)=>{se.init(e,t),e._zod.pattern=iS,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;if(n===null)return r;return r.issues.push({expected:\"null\",code:\"invalid_type\",input:n,inst:e}),r}});var sz=S(\"$ZodUnknown\",(e,t)=>{se.init(e,t),e._zod.parse=(r)=>r}),iz=S(\"$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)});function wS(e,t,r){if(e.issues.length)t.issues.push(...or(r,e.issues));t.value[r]=e.value}var az=S(\"$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 i=[];for(let s=0;s<n.length;s++){let a=n[s],c=t.element._zod.run({value:a,issues:[]},o);if(c instanceof Promise)i.push(c.then((u)=>wS(u,r,s)));else wS(c,r,s)}if(i.length)return Promise.all(i).then(()=>r);return r}});function Qc(e,t,r,o,n,i){let s=r in o;if(e.issues.length){if(n&&i&&!s)return;t.issues.push(...or(r,e.issues))}if(!s&&!n){if(!e.issues.length)t.issues.push({code:\"invalid_type\",expected:\"nonoptional\",input:void 0,path:[r]});return}if(e.value===void 0){if(s)t.value[r]=void 0}else t.value[r]=e.value}function cz(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has(\"$ZodType\"))throw Error(`Invalid element at key \"${o}\": expected a Zod schema`);let r=S_(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function uz(e,t,r,o,n,i){let s=[],a=n.keySet,c=n.catchall._zod,u=c.def.type,l=c.optin===\"optional\",m=c.optout===\"optional\";for(let h in t){if(h===\"__proto__\")continue;if(a.has(h))continue;if(u===\"never\"){s.push(h);continue}let f=c.run({value:t[h],issues:[]},o);if(f instanceof Promise)e.push(f.then((b)=>Qc(b,r,h,t,l,m)));else Qc(f,r,h,t,l,m)}if(s.length)r.issues.push({code:\"unrecognized_keys\",keys:s,input:t,inst:i});if(!e.length)return r;return Promise.all(e).then(()=>r)}var JR=S(\"$ZodObject\",(e,t)=>{if(se.init(e,t),!Object.getOwnPropertyDescriptor(t,\"shape\")?.get){let a=t.shape;Object.defineProperty(t,\"shape\",{get:()=>{let c={...a};return Object.defineProperty(t,\"shape\",{value:c}),c}})}let o=Ki(()=>cz(t));B(e._zod,\"propValues\",()=>{let a=t.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let m of l.values)c[u].add(m)}}return c});let n=Ko,i=t.catchall,s;e._zod.parse=(a,c)=>{s??(s=o.value);let u=a.value;if(!n(u))return a.issues.push({expected:\"object\",code:\"invalid_type\",input:u,inst:e}),a;a.value={};let l=[],m=s.shape;for(let h of s.keys){let f=m[h],b=f._zod.optin===\"optional\",I=f._zod.optout===\"optional\",x=f._zod.run({value:u[h],issues:[]},c);if(x instanceof Promise)l.push(x.then((J)=>Qc(J,a,h,u,b,I)));else Qc(x,a,h,u,b,I)}if(!i)return l.length?Promise.all(l).then(()=>a):a;return uz(l,u,a,c,o.value,e)}}),lz=S(\"$ZodObjectJIT\",(e,t)=>{JR.init(e,t);let r=e._zod.parse,o=Ki(()=>cz(t)),n=(h)=>{let f=new Ul([\"shape\",\"payload\",\"ctx\"]),b=o.value,I=(M)=>{let k=Il(M);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};f.write(\"const input = payload.value;\");let x=Object.create(null),J=0;for(let M of b.keys)x[M]=`key_${J++}`;f.write(\"const newResult = {};\");for(let M of b.keys){let k=x[M],N=Il(M),K=h[M],de=K?._zod?.optin===\"optional\",Be=K?._zod?.optout===\"optional\";if(f.write(`const ${k} = ${I(M)};`),de&&Be)f.write(`\n        if (${k}.issues.length) {\n          if (${N} in input) {\n            payload.issues = payload.issues.concat(${k}.issues.map(iss => ({\n              ...iss,\n              path: iss.path ? [${N}, ...iss.path] : [${N}]\n            })));\n          }\n        }\n        \n        if (${k}.value === undefined) {\n          if (${N} in input) {\n            newResult[${N}] = undefined;\n          }\n        } else {\n          newResult[${N}] = ${k}.value;\n        }\n        \n      `);else if(!de)f.write(`\n        const ${k}_present = ${N} in input;\n        if (${k}.issues.length) {\n          payload.issues = payload.issues.concat(${k}.issues.map(iss => ({\n            ...iss,\n            path: iss.path ? [${N}, ...iss.path] : [${N}]\n          })));\n        }\n        if (!${k}_present && !${k}.issues.length) {\n          payload.issues.push({\n            code: \"invalid_type\",\n            expected: \"nonoptional\",\n            input: undefined,\n            path: [${N}]\n          });\n        }\n\n        if (${k}_present) {\n          if (${k}.value === undefined) {\n            newResult[${N}] = undefined;\n          } else {\n            newResult[${N}] = ${k}.value;\n          }\n        }\n\n      `);else f.write(`\n        if (${k}.issues.length) {\n          payload.issues = payload.issues.concat(${k}.issues.map(iss => ({\n            ...iss,\n            path: iss.path ? [${N}, ...iss.path] : [${N}]\n          })));\n        }\n        \n        if (${k}.value === undefined) {\n          if (${N} in input) {\n            newResult[${N}] = undefined;\n          }\n        } else {\n          newResult[${N}] = ${k}.value;\n        }\n        \n      `)}f.write(\"payload.value = newResult;\"),f.write(\"return payload;\");let re=f.compile();return(M,k)=>re(h,M,k)},i,s=Ko,a=!Go.jitless,u=a&&g_.value,l=t.catchall,m;e._zod.parse=(h,f)=>{m??(m=o.value);let b=h.value;if(!s(b))return h.issues.push({expected:\"object\",code:\"invalid_type\",input:b,inst:e}),h;if(a&&u&&f?.async===!1&&f.jitless!==!0){if(!i)i=n(t.shape);if(h=i(h,f),!l)return h;return uz([],b,h,f,m,e)}return r(h,f)}});function $S(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter((i)=>!Jr(i));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:\"invalid_union\",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((s)=>ut(s,o,Ye())))}),t}var Vl=S(\"$ZodUnion\",(e,t)=>{se.init(e,t),B(e._zod,\"optin\",()=>t.options.some((o)=>o._zod.optin===\"optional\")?\"optional\":void 0),B(e._zod,\"optout\",()=>t.options.some((o)=>o._zod.optout===\"optional\")?\"optional\":void 0),B(e._zod,\"values\",()=>{if(t.options.every((o)=>o._zod.values))return new Set(t.options.flatMap((o)=>Array.from(o._zod.values)));return}),B(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)=>Jc(n.source)).join(\"|\")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,s=[];for(let a of t.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)s.push(c),i=!0;else{if(c.issues.length===0)return c;s.push(c)}}if(!i)return $S(s,o,e,n);return Promise.all(s).then((a)=>$S(a,o,e,n))}});var pz=S(\"$ZodDiscriminatedUnion\",(e,t)=>{t.inclusive=!1,Vl.init(e,t);let r=e._zod.parse;B(e._zod,\"propValues\",()=>{let n={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw Error(`Invalid discriminated union option at index \"${t.options.indexOf(i)}\"`);for(let[a,c]of Object.entries(s)){if(!n[a])n[a]=new Set;for(let u of c)n[a].add(u)}}return n});let o=Ki(()=>{let n=t.options,i=new Map;for(let s of n){let a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw Error(`Invalid discriminated union option at index \"${t.options.indexOf(s)}\"`);for(let c of a){if(i.has(c))throw Error(`Duplicate discriminator value \"${String(c)}\"`);i.set(c,s)}}return i});e._zod.parse=(n,i)=>{let s=n.value;if(!Ko(s))return n.issues.push({code:\"invalid_type\",expected:\"object\",input:s,inst:e}),n;let a=o.value.get(s?.[t.discriminator]);if(a)return a._zod.run(n,i);if(t.unionFallback||i.direction===\"backward\")return r(n,i);return n.issues.push({code:\"invalid_union\",errors:[],note:\"No matching discriminator\",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:s,path:[t.discriminator],inst:e}),n}}),dz=S(\"$ZodIntersection\",(e,t)=>{se.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),s=t.right._zod.run({value:n,issues:[]},o);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([c,u])=>kS(r,c,u));return kS(r,i,s)}});function Dl(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(Vr(e)&&Vr(t)){let r=Object.keys(t),o=Object.keys(e).filter((i)=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let s=Dl(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.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],i=t[o],s=Dl(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function kS(e,t,r){let o=new Map,n;for(let a of t.issues)if(a.code===\"unrecognized_keys\"){n??(n=a);for(let c of a.keys){if(!o.has(c))o.set(c,{});o.get(c).l=!0}}else e.issues.push(a);for(let a of r.issues)if(a.code===\"unrecognized_keys\")for(let c of a.keys){if(!o.has(c))o.set(c,{});o.get(c).r=!0}else e.issues.push(a);let i=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&n)e.issues.push({...n,keys:i});if(Jr(e))return e;let s=Dl(t.value,r.value);if(!s.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var mz=S(\"$ZodRecord\",(e,t)=>{se.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Vr(n))return r.issues.push({expected:\"record\",code:\"invalid_type\",input:n,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let a=new Set;for(let u of s)if(typeof u===\"string\"||typeof u===\"number\"||typeof u===\"symbol\"){a.add(typeof u===\"number\"?u.toString():u);let l=t.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw Error(\"Async schemas not supported in object keys currently\");if(l.issues.length){r.issues.push({code:\"invalid_key\",origin:\"record\",issues:l.issues.map((f)=>ut(f,o,Ye())),input:u,path:[u],inst:e});continue}let m=l.value,h=t.valueType._zod.run({value:n[u],issues:[]},o);if(h instanceof Promise)i.push(h.then((f)=>{if(f.issues.length)r.issues.push(...or(u,f.issues));r.value[m]=f.value}));else{if(h.issues.length)r.issues.push(...or(u,h.issues));r.value[m]=h.value}}let c;for(let u in n)if(!a.has(u))c=c??[],c.push(u);if(c&&c.length>0)r.issues.push({code:\"unrecognized_keys\",input:n,inst:e,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a===\"__proto__\")continue;if(!Object.prototype.propertyIsEnumerable.call(n,a))continue;let c=t.keyType._zod.run({value:a,issues:[]},o);if(c instanceof Promise)throw Error(\"Async schemas not supported in object keys currently\");if(typeof a===\"string\"&&Ml.test(a)&&c.issues.length){let m=t.keyType._zod.run({value:Number(a),issues:[]},o);if(m instanceof Promise)throw Error(\"Async schemas not supported in object keys currently\");if(m.issues.length===0)c=m}if(c.issues.length){if(t.mode===\"loose\")r.value[a]=n[a];else r.issues.push({code:\"invalid_key\",origin:\"record\",issues:c.issues.map((m)=>ut(m,o,Ye())),input:a,path:[a],inst:e});continue}let l=t.valueType._zod.run({value:n[a],issues:[]},o);if(l instanceof Promise)i.push(l.then((m)=>{if(m.issues.length)r.issues.push(...or(a,m.issues));r.value[c.value]=m.value}));else{if(l.issues.length)r.issues.push(...or(a,l.issues));r.value[c.value]=l.value}}}if(i.length)return Promise.all(i).then(()=>r);return r}});var hz=S(\"$ZodEnum\",(e,t)=>{se.init(e,t);let r=Fc(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter((n)=>__.has(typeof n)).map((n)=>typeof n===\"string\"?rr(n):n.toString()).join(\"|\")})$`),e._zod.parse=(n,i)=>{let s=n.value;if(o.has(s))return n;return n.issues.push({code:\"invalid_value\",values:r,input:s,inst:e}),n}}),fz=S(\"$ZodLiteral\",(e,t)=>{if(se.init(e,t),t.values.length===0)throw 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\"?rr(o):o?rr(o.toString()):String(o)).join(\"|\")})$`),e._zod.parse=(o,n)=>{let i=o.value;if(r.has(i))return o;return o.issues.push({code:\"invalid_value\",values:t.values,input:i,inst:e}),o}});var gz=S(\"$ZodTransform\",(e,t)=>{se.init(e,t),e._zod.optin=\"optional\",e._zod.parse=(r,o)=>{if(o.direction===\"backward\")throw new Wi(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then((s)=>(r.value=s,r.fallback=!0,r));if(n instanceof Promise)throw new Ot;return r.value=n,r.fallback=!0,r}});function RS(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var Jl=S(\"$ZodOptional\",(e,t)=>{se.init(e,t),e._zod.optin=\"optional\",e._zod.optout=\"optional\",B(e._zod,\"values\",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),B(e._zod,\"pattern\",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Jc(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin===\"optional\"){let n=r.value,i=t.innerType._zod.run(r,o);if(i instanceof Promise)return i.then((s)=>RS(s,n));return RS(i,n)}if(r.value===void 0)return r;return t.innerType._zod.run(r,o)}}),_z=S(\"$ZodExactOptional\",(e,t)=>{Jl.init(e,t),B(e._zod,\"values\",()=>t.innerType._zod.values),B(e._zod,\"pattern\",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Sz=S(\"$ZodNullable\",(e,t)=>{se.init(e,t),B(e._zod,\"optin\",()=>t.innerType._zod.optin),B(e._zod,\"optout\",()=>t.innerType._zod.optout),B(e._zod,\"pattern\",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Jc(r.source)}|null)$`):void 0}),B(e._zod,\"values\",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),zz=S(\"$ZodDefault\",(e,t)=>{se.init(e,t),e._zod.optin=\"optional\",B(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);if(n instanceof Promise)return n.then((i)=>PS(i,t));return PS(n,t)}});function PS(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var bz=S(\"$ZodPrefault\",(e,t)=>{se.init(e,t),e._zod.optin=\"optional\",B(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)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),yz=S(\"$ZodNonOptional\",(e,t)=>{se.init(e,t),B(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);if(n instanceof Promise)return n.then((i)=>TS(i,e));return TS(n,e)}});function TS(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:\"invalid_type\",expected:\"nonoptional\",input:e.value,inst:t});return e}var vz=S(\"$ZodCatch\",(e,t)=>{se.init(e,t),e._zod.optin=\"optional\",B(e._zod,\"optout\",()=>t.innerType._zod.optout),B(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);if(n instanceof Promise)return n.then((i)=>{if(r.value=i.value,i.issues.length)r.value=t.catchValue({...r,error:{issues:i.issues.map((s)=>ut(s,o,Ye()))},input:r.value}),r.issues=[],r.fallback=!0;return r});if(r.value=n.value,n.issues.length)r.value=t.catchValue({...r,error:{issues:n.issues.map((i)=>ut(i,o,Ye()))},input:r.value}),r.issues=[],r.fallback=!0;return r}});var Hl=S(\"$ZodPipe\",(e,t)=>{se.init(e,t),B(e._zod,\"values\",()=>t.in._zod.values),B(e._zod,\"optin\",()=>t.in._zod.optin),B(e._zod,\"optout\",()=>t.out._zod.optout),B(e._zod,\"propValues\",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction===\"backward\"){let i=t.out._zod.run(r,o);if(i instanceof Promise)return i.then((s)=>Yc(s,t.in,o));return Yc(i,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>Yc(i,t.out,o));return Yc(n,t.out,o)}});function Yc(e,t,r){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var xz=S(\"$ZodPreprocess\",(e,t)=>{Hl.init(e,t)}),wz=S(\"$ZodReadonly\",(e,t)=>{se.init(e,t),B(e._zod,\"propValues\",()=>t.innerType._zod.propValues),B(e._zod,\"values\",()=>t.innerType._zod.values),B(e._zod,\"optin\",()=>t.innerType?._zod?.optin),B(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);if(n instanceof Promise)return n.then(ES);return ES(n)}});function ES(e){return e.value=Object.freeze(e.value),e}var $z=S(\"$ZodLazy\",(e,t)=>{se.init(e,t),B(e._zod,\"innerType\",()=>{let r=t;if(!r._cachedInner)r._cachedInner=t.getter();return r._cachedInner}),B(e._zod,\"pattern\",()=>e._zod.innerType?._zod?.pattern),B(e._zod,\"propValues\",()=>e._zod.innerType?._zod?.propValues),B(e._zod,\"optin\",()=>e._zod.innerType?._zod?.optin??void 0),B(e._zod,\"optout\",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),kz=S(\"$ZodCustom\",(e,t)=>{Ie.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((i)=>IS(i,r,o,e));IS(n,r,o,e);return}});function IS(e,t,r,o){if(!e){let n={code:\"custom\",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(Hr(n))}}var HR=()=>{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 i=o[n.expected]??n.expected,s=y_(n.input),a=o[s]??s;return`Invalid input: expected ${i}, received ${a}`}case\"invalid_value\":if(n.values.length===1)return`Invalid input: expected ${Zl(n.values[0])}`;return`Invalid option: expected one of ${El(n.values,\"|\")}`;case\"too_big\":{let i=n.inclusive?\"<=\":\"<\",s=t(n.origin);if(s)return`Too big: expected ${n.origin??\"value\"} to have ${i}${n.maximum.toString()} ${s.unit??\"elements\"}`;return`Too big: expected ${n.origin??\"value\"} to be ${i}${n.maximum.toString()}`}case\"too_small\":{let i=n.inclusive?\">=\":\">\",s=t(n.origin);if(s)return`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${s.unit}`;return`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case\"invalid_format\":{let i=n;if(i.format===\"starts_with\")return`Invalid string: must start with \"${i.prefix}\"`;if(i.format===\"ends_with\")return`Invalid string: must end with \"${i.suffix}\"`;if(i.format===\"includes\")return`Invalid string: must include \"${i.includes}\"`;if(i.format===\"regex\")return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${r[i.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\":\"\"}: ${El(n.keys,\", \")}`;case\"invalid_key\":return`Invalid key in ${n.origin}`;case\"invalid_union\":if(n.options&&Array.isArray(n.options)&&n.options.length>0)return`Invalid discriminator value. Expected ${n.options.map((s)=>`'${s}'`).join(\" | \")}`;return\"Invalid input\";case\"invalid_element\":return`Invalid value in ${n.origin}`;default:return\"Invalid input\"}}};function Bl(){return{localeError:HR()}}var Rz,RZ=Symbol(\"ZodOutput\"),PZ=Symbol(\"ZodInput\");class Pz{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r===\"object\"&&\"id\"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t===\"object\"&&\"id\"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function BR(){return new Pz}(Rz=globalThis).__zod_globalRegistry??(Rz.__zod_globalRegistry=BR());var Br=globalThis.__zod_globalRegistry;function Tz(e,t){return new e({type:\"string\",...Z(t)})}function Wl(e,t){return new e({type:\"string\",format:\"email\",check:\"string_format\",abort:!1,...Z(t)})}function Gl(e,t){return new e({type:\"string\",format:\"guid\",check:\"string_format\",abort:!1,...Z(t)})}function Ez(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,...Z(t)})}function Iz(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,version:\"v4\",...Z(t)})}function Oz(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,version:\"v6\",...Z(t)})}function Cz(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,version:\"v7\",...Z(t)})}function Kl(e,t){return new e({type:\"string\",format:\"url\",check:\"string_format\",abort:!1,...Z(t)})}function Zz(e,t){return new e({type:\"string\",format:\"emoji\",check:\"string_format\",abort:!1,...Z(t)})}function Nz(e,t){return new e({type:\"string\",format:\"nanoid\",check:\"string_format\",abort:!1,...Z(t)})}function Az(e,t){return new e({type:\"string\",format:\"cuid\",check:\"string_format\",abort:!1,...Z(t)})}function jz(e,t){return new e({type:\"string\",format:\"cuid2\",check:\"string_format\",abort:!1,...Z(t)})}function Mz(e,t){return new e({type:\"string\",format:\"ulid\",check:\"string_format\",abort:!1,...Z(t)})}function qz(e,t){return new e({type:\"string\",format:\"xid\",check:\"string_format\",abort:!1,...Z(t)})}function Lz(e,t){return new e({type:\"string\",format:\"ksuid\",check:\"string_format\",abort:!1,...Z(t)})}function Uz(e,t){return new e({type:\"string\",format:\"ipv4\",check:\"string_format\",abort:!1,...Z(t)})}function Dz(e,t){return new e({type:\"string\",format:\"ipv6\",check:\"string_format\",abort:!1,...Z(t)})}function Fz(e,t){return new e({type:\"string\",format:\"cidrv4\",check:\"string_format\",abort:!1,...Z(t)})}function Vz(e,t){return new e({type:\"string\",format:\"cidrv6\",check:\"string_format\",abort:!1,...Z(t)})}function Jz(e,t){return new e({type:\"string\",format:\"base64\",check:\"string_format\",abort:!1,...Z(t)})}function Hz(e,t){return new e({type:\"string\",format:\"base64url\",check:\"string_format\",abort:!1,...Z(t)})}function Bz(e,t){return new e({type:\"string\",format:\"e164\",check:\"string_format\",abort:!1,...Z(t)})}function Wz(e,t){return new e({type:\"string\",format:\"jwt\",check:\"string_format\",abort:!1,...Z(t)})}function Gz(e,t){return new e({type:\"string\",format:\"datetime\",check:\"string_format\",offset:!1,local:!1,precision:null,...Z(t)})}function Kz(e,t){return new e({type:\"string\",format:\"date\",check:\"string_format\",...Z(t)})}function Yz(e,t){return new e({type:\"string\",format:\"time\",check:\"string_format\",precision:null,...Z(t)})}function Qz(e,t){return new e({type:\"string\",format:\"duration\",check:\"string_format\",...Z(t)})}function Xz(e,t){return new e({type:\"number\",checks:[],...Z(t)})}function eb(e,t){return new e({type:\"number\",check:\"number_format\",abort:!1,format:\"safeint\",...Z(t)})}function tb(e,t){return new e({type:\"boolean\",...Z(t)})}function rb(e,t){return new e({type:\"null\",...Z(t)})}function ob(e){return new e({type:\"unknown\"})}function nb(e,t){return new e({type:\"never\",...Z(t)})}function eu(e,t){return new ql({check:\"less_than\",...Z(t),value:e,inclusive:!1})}function ea(e,t){return new ql({check:\"less_than\",...Z(t),value:e,inclusive:!0})}function tu(e,t){return new Ll({check:\"greater_than\",...Z(t),value:e,inclusive:!1})}function ta(e,t){return new Ll({check:\"greater_than\",...Z(t),value:e,inclusive:!0})}function ru(e,t){return new lS({check:\"multiple_of\",...Z(t),value:e})}function ou(e,t){return new dS({check:\"max_length\",...Z(t),maximum:e})}function Yo(e,t){return new mS({check:\"min_length\",...Z(t),minimum:e})}function nu(e,t){return new hS({check:\"length_equals\",...Z(t),length:e})}function Yl(e,t){return new fS({check:\"string_format\",format:\"regex\",...Z(t),pattern:e})}function Ql(e){return new gS({check:\"string_format\",format:\"lowercase\",...Z(e)})}function Xl(e){return new _S({check:\"string_format\",format:\"uppercase\",...Z(e)})}function ep(e,t){return new SS({check:\"string_format\",format:\"includes\",...Z(t),includes:e})}function tp(e,t){return new zS({check:\"string_format\",format:\"starts_with\",...Z(t),prefix:e})}function rp(e,t){return new bS({check:\"string_format\",format:\"ends_with\",...Z(t),suffix:e})}function nr(e){return new yS({check:\"overwrite\",tx:e})}function op(e){return nr((t)=>t.normalize(e))}function np(){return nr((e)=>e.trim())}function sp(){return nr((e)=>e.toLowerCase())}function ip(){return nr((e)=>e.toUpperCase())}function ap(){return nr((e)=>f_(e))}function sb(e,t,r){return new e({type:\"array\",element:t,...Z(r)})}function ib(e,t,r){return new e({type:\"custom\",check:\"custom\",fn:t,...Z(r)})}function ab(e,t){let r=WR((o)=>(o.addIssue=(n)=>{if(typeof n===\"string\")o.issues.push(Hr(n,o.value,r._zod.def));else{let i=n;if(i.fatal)i.continue=!1;i.code??(i.code=\"custom\"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(Hr(i))}},e(o.value,o)),t);return r}function WR(e,t){let r=new Ie({check:\"custom\",...Z(t)});return r._zod.check=e,r}function oa(e){let t=e?.target??\"draft-2020-12\";if(t===\"draft-4\")t=\"draft-04\";if(t===\"draft-7\")t=\"draft-07\";return{processors:e.processors??{},metadataRegistry:e?.metadata??Br,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 ee(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{let h=s.schema,f=t.processors[n.type];if(!f)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(e,t,h,l)}let m=e._zod.parent;if(m){if(!s.ref)s.ref=m;ee(m,t,l),t.seen.get(m).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)Object.assign(s.schema,c);if(t.io===\"input\"&&Le(e))delete s.schema.examples,delete s.schema.default;if(t.io===\"input\"&&\"_prefault\"in s.schema)(o=s.schema).default??(o.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function na(e,t){let r=e.seen.get(t);if(!r)throw Error(\"Unprocessed schema. This is a bug in Zod.\");let o=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=o.get(a);if(c&&c!==s[0])throw Error(`Duplicate schema id \"${a}\" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,s[0])}}let n=(s)=>{let a=e.target===\"draft-2020-12\"?\"$defs\":\"definitions\";if(e.external){let m=e.external.registry.get(s[0])?.id,h=e.external.uri??((b)=>b);if(m)return{ref:h(m)};let f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${h(\"__shared\")}#/${a}/${f}`}}if(s[1]===r)return{ref:\"#\"};let u=`${\"#\"}/${a}/`,l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},i=(s)=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=n(s);if(a.def={...a.schema},u)a.defId=u;let l=a.schema;for(let m in l)delete l[m];l.$ref=c};if(e.cycles===\"throw\")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw Error(`Cycle detected: #/${a.cycle?.join(\"/\")}/<root>\n\nSet the \\`cycles\\` parameter to \\`\"ref\"\\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1){if(e.reused===\"ref\"){i(s);continue}}}}function sa(e,t){let r=e.seen.get(t);if(!r)throw Error(\"Unprocessed schema. This is a bug in Zod.\");let o=(a)=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},m=c.ref;if(c.ref=null,m){o(m);let f=e.seen.get(m),b=f.schema;if(b.$ref&&(e.target===\"draft-07\"||e.target===\"draft-04\"||e.target===\"openapi-3.0\"))u.allOf=u.allOf??[],u.allOf.push(b);else Object.assign(u,b);if(Object.assign(u,l),a._zod.parent===m)for(let x in u){if(x===\"$ref\"||x===\"allOf\")continue;if(!(x in l))delete u[x]}if(b.$ref&&f.def)for(let x in u){if(x===\"$ref\"||x===\"allOf\")continue;if(x in f.def&&JSON.stringify(u[x])===JSON.stringify(f.def[x]))delete u[x]}}let h=a._zod.parent;if(h&&h!==m){o(h);let f=e.seen.get(h);if(f?.schema.$ref){if(u.$ref=f.schema.$ref,f.def)for(let b in u){if(b===\"$ref\"||b===\"allOf\")continue;if(b in f.def&&JSON.stringify(u[b])===JSON.stringify(f.def[b]))delete u[b]}}}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...e.seen.entries()].reverse())o(a[0]);let n={};if(e.target===\"draft-2020-12\")n.$schema=\"https://json-schema.org/draft/2020-12/schema\";else if(e.target===\"draft-07\")n.$schema=\"http://json-schema.org/draft-07/schema#\";else if(e.target===\"draft-04\")n.$schema=\"http://json-schema.org/draft-04/schema#\";else if(e.target===\"openapi-3.0\");if(e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw Error(\"Schema is missing an `id` property\");n.$id=e.external.uri(a)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&n.id===i)delete n.id;let s=e.external?.defs??{};for(let a of e.seen.entries()){let c=a[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;s[c.defId]=c.def}}if(e.external);else if(Object.keys(s).length>0)if(e.target===\"draft-2020-12\")n.$defs=s;else n.definitions=s;try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,\"~standard\",{value:{...t[\"~standard\"],jsonSchema:{input:ra(t,\"input\",e.processors),output:ra(t,\"output\",e.processors)}},enumerable:!1,writable:!1}),a}catch(a){throw Error(\"Error converting schema to JSON.\")}}function Le(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 Le(o.element,r);if(o.type===\"set\")return Le(o.valueType,r);if(o.type===\"lazy\")return Le(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 Le(o.innerType,r);if(o.type===\"intersection\")return Le(o.left,r)||Le(o.right,r);if(o.type===\"record\"||o.type===\"map\")return Le(o.keyType,r)||Le(o.valueType,r);if(o.type===\"pipe\"){if(e._zod.traits.has(\"$ZodCodec\"))return!0;return Le(o.in,r)||Le(o.out,r)}if(o.type===\"object\"){for(let n in o.shape)if(Le(o.shape[n],r))return!0;return!1}if(o.type===\"union\"){for(let n of o.options)if(Le(n,r))return!0;return!1}if(o.type===\"tuple\"){for(let n of o.items)if(Le(n,r))return!0;if(o.rest&&Le(o.rest,r))return!0;return!1}return!1}var cb=(e,t={})=>(r)=>{let o=oa({...r,processors:t});return ee(e,o),na(o,e),sa(o,e)},ra=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:i}=o??{},s=oa({...n??{},target:i,io:t,processors:r});return ee(e,s),na(s,e),sa(s,e)};var GR={guid:\"uuid\",url:\"uri\",datetime:\"date-time\",json_string:\"json-string\",regex:\"\"},cp=(e,t,r,o)=>{let n=r;n.type=\"string\";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof i===\"number\")n.minLength=i;if(typeof s===\"number\")n.maxLength=s;if(a){if(n.format=GR[a]??a,n.format===\"\")delete n.format;if(a===\"time\")delete n.format}if(u)n.contentEncoding=u;if(c&&c.size>0){let l=[...c];if(l.length===1)n.pattern=l[0].source;else if(l.length>1)n.allOf=[...l.map((m)=>({...t.target===\"draft-07\"||t.target===\"draft-04\"||t.target===\"openapi-3.0\"?{type:\"string\"}:{},pattern:m.source}))]}},up=(e,t,r,o)=>{let n=r,{minimum:i,maximum:s,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;if(typeof a===\"string\"&&a.includes(\"int\"))n.type=\"integer\";else n.type=\"number\";let m=typeof l===\"number\"&&l>=(i??Number.NEGATIVE_INFINITY),h=typeof u===\"number\"&&u<=(s??Number.POSITIVE_INFINITY),f=t.target===\"draft-04\"||t.target===\"openapi-3.0\";if(m)if(f)n.minimum=l,n.exclusiveMinimum=!0;else n.exclusiveMinimum=l;else if(typeof i===\"number\")n.minimum=i;if(h)if(f)n.maximum=u,n.exclusiveMaximum=!0;else n.exclusiveMaximum=u;else if(typeof s===\"number\")n.maximum=s;if(typeof c===\"number\")n.multipleOf=c},lp=(e,t,r,o)=>{r.type=\"boolean\"},lb=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"BigInt cannot be represented in JSON Schema\")},pb=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"Symbols cannot be represented in JSON Schema\")},pp=(e,t,r,o)=>{if(t.target===\"openapi-3.0\")r.type=\"string\",r.nullable=!0,r.enum=[null];else r.type=\"null\"},db=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"Undefined cannot be represented in JSON Schema\")},mb=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"Void cannot be represented in JSON Schema\")},dp=(e,t,r,o)=>{r.not={}},hb=(e,t,r,o)=>{},mp=(e,t,r,o)=>{},fb=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"Date cannot be represented in JSON Schema\")},hp=(e,t,r,o)=>{let n=e._zod.def,i=Fc(n.entries);if(i.every((s)=>typeof s===\"number\"))r.type=\"number\";if(i.every((s)=>typeof s===\"string\"))r.type=\"string\";r.enum=i},fp=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable===\"throw\")throw Error(\"Literal `undefined` cannot be represented in JSON Schema\")}else if(typeof s===\"bigint\")if(t.unrepresentable===\"throw\")throw Error(\"BigInt literals cannot be represented in JSON Schema\");else i.push(Number(s));else i.push(s);if(i.length===0);else if(i.length===1){let s=i[0];if(r.type=s===null?\"null\":typeof s,t.target===\"draft-04\"||t.target===\"openapi-3.0\")r.enum=[s];else r.const=s}else{if(i.every((s)=>typeof s===\"number\"))r.type=\"number\";if(i.every((s)=>typeof s===\"string\"))r.type=\"string\";if(i.every((s)=>typeof s===\"boolean\"))r.type=\"boolean\";if(i.every((s)=>s===null))r.type=\"null\";r.enum=i}},gb=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"NaN cannot be represented in JSON Schema\")},_b=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw Error(\"Pattern not found in template literal\");n.type=\"string\",n.pattern=i.source},Sb=(e,t,r,o)=>{let n=r,i={type:\"string\",format:\"binary\",contentEncoding:\"binary\"},{minimum:s,maximum:a,mime:c}=e._zod.bag;if(s!==void 0)i.minLength=s;if(a!==void 0)i.maxLength=a;if(c)if(c.length===1)i.contentMediaType=c[0],Object.assign(n,i);else Object.assign(n,i),n.anyOf=c.map((u)=>({contentMediaType:u}));else Object.assign(n,i)},zb=(e,t,r,o)=>{r.type=\"boolean\"},gp=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"Custom types cannot be represented in JSON Schema\")},bb=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"Function types cannot be represented in JSON Schema\")},_p=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"Transforms cannot be represented in JSON Schema\")},yb=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"Map cannot be represented in JSON Schema\")},vb=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"Set cannot be represented in JSON Schema\")},Sp=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;if(typeof s===\"number\")n.minItems=s;if(typeof a===\"number\")n.maxItems=a;n.type=\"array\",n.items=ee(i.element,t,{...o,path:[...o.path,\"items\"]})},zp=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type=\"object\",n.properties={};let s=i.shape;for(let u in s)n.properties[u]=ee(s[u],t,{...o,path:[...o.path,\"properties\",u]});let a=new Set(Object.keys(s)),c=new Set([...a].filter((u)=>{let l=i.shape[u]._zod;if(t.io===\"input\")return l.optin===void 0;else return l.optout===void 0}));if(c.size>0)n.required=Array.from(c);if(i.catchall?._zod.def.type===\"never\")n.additionalProperties=!1;else if(!i.catchall){if(t.io===\"output\")n.additionalProperties=!1}else if(i.catchall)n.additionalProperties=ee(i.catchall,t,{...o,path:[...o.path,\"additionalProperties\"]})},bp=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,s=n.options.map((a,c)=>ee(a,t,{...o,path:[...o.path,i?\"oneOf\":\"anyOf\",c]}));if(i)r.oneOf=s;else r.anyOf=s},yp=(e,t,r,o)=>{let n=e._zod.def,i=ee(n.left,t,{...o,path:[...o.path,\"allOf\",0]}),s=ee(n.right,t,{...o,path:[...o.path,\"allOf\",1]}),a=(u)=>(\"allOf\"in u)&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=c},xb=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type=\"array\";let s=t.target===\"draft-2020-12\"?\"prefixItems\":\"items\",a=t.target===\"draft-2020-12\"?\"items\":t.target===\"openapi-3.0\"?\"items\":\"additionalItems\",c=i.items.map((h,f)=>ee(h,t,{...o,path:[...o.path,s,f]})),u=i.rest?ee(i.rest,t,{...o,path:[...o.path,a,...t.target===\"openapi-3.0\"?[i.items.length]:[]]}):null;if(t.target===\"draft-2020-12\"){if(n.prefixItems=c,u)n.items=u}else if(t.target===\"openapi-3.0\"){if(n.items={anyOf:c},u)n.items.anyOf.push(u);if(n.minItems=c.length,!u)n.maxItems=c.length}else if(n.items=c,u)n.additionalItems=u;let{minimum:l,maximum:m}=e._zod.bag;if(typeof l===\"number\")n.minItems=l;if(typeof m===\"number\")n.maxItems=m},vp=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type=\"object\";let s=i.keyType,c=s._zod.bag?.patterns;if(i.mode===\"loose\"&&c&&c.size>0){let l=ee(i.valueType,t,{...o,path:[...o.path,\"patternProperties\",\"*\"]});n.patternProperties={};for(let m of c)n.patternProperties[m.source]=l}else{if(t.target===\"draft-07\"||t.target===\"draft-2020-12\")n.propertyNames=ee(i.keyType,t,{...o,path:[...o.path,\"propertyNames\"]});n.additionalProperties=ee(i.valueType,t,{...o,path:[...o.path,\"additionalProperties\"]})}let u=s._zod.values;if(u){let l=[...u].filter((m)=>typeof m===\"string\"||typeof m===\"number\");if(l.length>0)n.required=l}},xp=(e,t,r,o)=>{let n=e._zod.def,i=ee(n.innerType,t,o),s=t.seen.get(e);if(t.target===\"openapi-3.0\")s.ref=n.innerType,r.nullable=!0;else r.anyOf=[i,{type:\"null\"}]},wp=(e,t,r,o)=>{let n=e._zod.def;ee(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},$p=(e,t,r,o)=>{let n=e._zod.def;ee(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},kp=(e,t,r,o)=>{let n=e._zod.def;ee(n.innerType,t,o);let i=t.seen.get(e);if(i.ref=n.innerType,t.io===\"input\")r._prefault=JSON.parse(JSON.stringify(n.defaultValue))},Rp=(e,t,r,o)=>{let n=e._zod.def;ee(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw Error(\"Dynamic catch values are not supported in JSON Schema\")}r.default=s},Pp=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has(\"$ZodTransform\"),s=t.io===\"input\"?i?n.out:n.in:n.out;ee(s,t,o);let a=t.seen.get(e);a.ref=s},Tp=(e,t,r,o)=>{let n=e._zod.def;ee(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},wb=(e,t,r,o)=>{let n=e._zod.def;ee(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},su=(e,t,r,o)=>{let n=e._zod.def;ee(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Ep=(e,t,r,o)=>{let n=e._zod.innerType;ee(n,t,o);let i=t.seen.get(e);i.ref=n},ub={string:cp,number:up,boolean:lp,bigint:lb,symbol:pb,null:pp,undefined:db,void:mb,never:dp,any:hb,unknown:mp,date:fb,enum:hp,literal:fp,nan:gb,template_literal:_b,file:Sb,success:zb,custom:gp,function:bb,transform:_p,map:yb,set:vb,array:Sp,object:zp,union:bp,intersection:yp,tuple:xb,record:vp,nullable:xp,nonoptional:wp,default:$p,prefault:kp,catch:Rp,pipe:Pp,readonly:Tp,promise:wb,optional:su,lazy:Ep};function iu(e,t){if(\"_idmap\"in e){let o=e,n=oa({...t,processors:ub}),i={};for(let c of o._idmap.entries()){let[u,l]=c;ee(l,n)}let s={},a={registry:o,uri:t?.uri,defs:i};n.external=a;for(let c of o._idmap.entries()){let[u,l]=c;na(n,l),s[u]=sa(n,l)}if(Object.keys(i).length>0){let c=n.target===\"draft-2020-12\"?\"$defs\":\"definitions\";s.__shared={[c]:i}}return{schemas:s}}let r=oa({...t,processors:ub});return ee(e,r),na(r,e),sa(r,e)}var oP=S(\"ZodISODateTime\",(e,t)=>{FS.init(e,t),ge.init(e,t)});function aa(e){return Gz(oP,e)}var nP=S(\"ZodISODate\",(e,t)=>{VS.init(e,t),ge.init(e,t)});function Ip(e){return Kz(nP,e)}var sP=S(\"ZodISOTime\",(e,t)=>{JS.init(e,t),ge.init(e,t)});function $b(e){return Yz(sP,e)}var iP=S(\"ZodISODuration\",(e,t)=>{HS.init(e,t),ge.init(e,t)});function kb(e){return Qz(iP,e)}var cP=(e,t)=>{Bc.init(e,t),e.name=\"ZodError\",Object.defineProperties(e,{format:{value:(r)=>w_(e,r)},flatten:{value:(r)=>x_(e,r)},addIssue:{value:(r)=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Gi,2)}},addIssues:{value:(r)=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Gi,2)}},isEmpty:{get(){return e.issues.length===0}}})};var Qe=S(\"ZodError\",cP,{Parent:Error});var Rb=Wc(Qe),Pb=Gc(Qe),au=Yi(Qe),Tb=Qi(Qe),Eb=R_(Qe),Ib=P_(Qe),Ob=T_(Qe),Cb=E_(Qe),Zb=I_(Qe),Nb=O_(Qe),Ab=C_(Qe),jb=Z_(Qe);var Mb=new WeakMap;function ca(e,t,r){let o=Object.getPrototypeOf(e),n=Mb.get(o);if(!n)n=new Set,Mb.set(o,n);if(n.has(t))return;n.add(t);for(let i in r){let s=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}var ue=S(\"ZodType\",(e,t)=>(se.init(e,t),Object.assign(e[\"~standard\"],{jsonSchema:{input:ra(e,\"input\"),output:ra(e,\"output\")}}),e.toJSONSchema=cb(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,\"_def\",{value:t}),e.parse=(r,o)=>Rb(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>au(e,r,o),e.parseAsync=async(r,o)=>Pb(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Tb(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Eb(e,r,o),e.decode=(r,o)=>Ib(e,r,o),e.encodeAsync=async(r,o)=>Ob(e,r,o),e.decodeAsync=async(r,o)=>Cb(e,r,o),e.safeEncode=(r,o)=>Zb(e,r,o),e.safeDecode=(r,o)=>Nb(e,r,o),e.safeEncodeAsync=async(r,o)=>Ab(e,r,o),e.safeDecodeAsync=async(r,o)=>jb(e,r,o),ca(e,\"ZodType\",{check(...r){let o=this.def;return this.clone(tr(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 zt(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(QP(r,o))},superRefine(r,o){return this.check(XP(r,o))},overwrite(r){return this.check(nr(r))},optional(){return D(this)},exactOptional(){return MP(this)},nullable(){return Db(this)},nullish(){return D(Db(this))},nonoptional(r){return VP(this,r)},array(){return R(this)},or(r){return q([this,r])},and(r){return Qo(this,r)},transform(r){return Fb(this,Qb(r))},default(r){return UP(this,r)},prefault(r){return FP(this,r)},catch(r){return HP(this,r)},pipe(r){return Fb(this,r)},readonly(){return GP(this)},describe(r){let o=this.clone();return Br.add(o,{description:r}),o},meta(...r){if(r.length===0)return Br.get(this);let o=this.clone();return Br.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 Br.get(e)?.description},configurable:!0}),e)),Vb=S(\"_ZodString\",(e,t)=>{Xc.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(o,n,i)=>cp(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,ca(e,\"_ZodString\",{regex(...o){return this.check(Yl(...o))},includes(...o){return this.check(ep(...o))},startsWith(...o){return this.check(tp(...o))},endsWith(...o){return this.check(rp(...o))},min(...o){return this.check(Yo(...o))},max(...o){return this.check(ou(...o))},length(...o){return this.check(nu(...o))},nonempty(...o){return this.check(Yo(1,...o))},lowercase(o){return this.check(Ql(o))},uppercase(o){return this.check(Xl(o))},trim(){return this.check(np())},normalize(...o){return this.check(op(...o))},toLowerCase(){return this.check(sp())},toUpperCase(){return this.check(ip())},slugify(){return this.check(ap())}})}),lP=S(\"ZodString\",(e,t)=>{Xc.init(e,t),Vb.init(e,t),e.email=(r)=>e.check(Wl(Jb,r)),e.url=(r)=>e.check(Kl(Bb,r)),e.jwt=(r)=>e.check(Wz($P,r)),e.emoji=(r)=>e.check(Zz(pP,r)),e.guid=(r)=>e.check(Gl(qb,r)),e.uuid=(r)=>e.check(Ez(cu,r)),e.uuidv4=(r)=>e.check(Iz(cu,r)),e.uuidv6=(r)=>e.check(Oz(cu,r)),e.uuidv7=(r)=>e.check(Cz(cu,r)),e.nanoid=(r)=>e.check(Nz(dP,r)),e.guid=(r)=>e.check(Gl(qb,r)),e.cuid=(r)=>e.check(Az(mP,r)),e.cuid2=(r)=>e.check(jz(hP,r)),e.ulid=(r)=>e.check(Mz(fP,r)),e.base64=(r)=>e.check(Jz(vP,r)),e.base64url=(r)=>e.check(Hz(xP,r)),e.xid=(r)=>e.check(qz(gP,r)),e.ksuid=(r)=>e.check(Lz(_P,r)),e.ipv4=(r)=>e.check(Uz(SP,r)),e.ipv6=(r)=>e.check(Dz(zP,r)),e.cidrv4=(r)=>e.check(Fz(bP,r)),e.cidrv6=(r)=>e.check(Vz(yP,r)),e.e164=(r)=>e.check(Bz(wP,r)),e.datetime=(r)=>e.check(aa(r)),e.date=(r)=>e.check(Ip(r)),e.time=(r)=>e.check($b(r)),e.duration=(r)=>e.check(kb(r))});function p(e){return Tz(lP,e)}var ge=S(\"ZodStringFormat\",(e,t)=>{ce.init(e,t),Vb.init(e,t)}),Jb=S(\"ZodEmail\",(e,t)=>{ZS.init(e,t),ge.init(e,t)});function Hb(e){return Wl(Jb,e)}var qb=S(\"ZodGUID\",(e,t)=>{OS.init(e,t),ge.init(e,t)});var cu=S(\"ZodUUID\",(e,t)=>{CS.init(e,t),ge.init(e,t)});var Bb=S(\"ZodURL\",(e,t)=>{NS.init(e,t),ge.init(e,t)});function Wb(e){return Kl(Bb,e)}var pP=S(\"ZodEmoji\",(e,t)=>{AS.init(e,t),ge.init(e,t)});var dP=S(\"ZodNanoID\",(e,t)=>{jS.init(e,t),ge.init(e,t)});var mP=S(\"ZodCUID\",(e,t)=>{MS.init(e,t),ge.init(e,t)});var hP=S(\"ZodCUID2\",(e,t)=>{qS.init(e,t),ge.init(e,t)});var fP=S(\"ZodULID\",(e,t)=>{LS.init(e,t),ge.init(e,t)});var gP=S(\"ZodXID\",(e,t)=>{US.init(e,t),ge.init(e,t)});var _P=S(\"ZodKSUID\",(e,t)=>{DS.init(e,t),ge.init(e,t)});var SP=S(\"ZodIPv4\",(e,t)=>{BS.init(e,t),ge.init(e,t)});var zP=S(\"ZodIPv6\",(e,t)=>{WS.init(e,t),ge.init(e,t)});var bP=S(\"ZodCIDRv4\",(e,t)=>{GS.init(e,t),ge.init(e,t)});var yP=S(\"ZodCIDRv6\",(e,t)=>{KS.init(e,t),ge.init(e,t)});var vP=S(\"ZodBase64\",(e,t)=>{QS.init(e,t),ge.init(e,t)});var xP=S(\"ZodBase64URL\",(e,t)=>{XS.init(e,t),ge.init(e,t)});var wP=S(\"ZodE164\",(e,t)=>{ez.init(e,t),ge.init(e,t)});var $P=S(\"ZodJWT\",(e,t)=>{tz.init(e,t),ge.init(e,t)});var Gb=S(\"ZodNumber\",(e,t)=>{Fl.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(o,n,i)=>up(e,o,n,i),ca(e,\"ZodNumber\",{gt(o,n){return this.check(tu(o,n))},gte(o,n){return this.check(ta(o,n))},min(o,n){return this.check(ta(o,n))},lt(o,n){return this.check(eu(o,n))},lte(o,n){return this.check(ea(o,n))},max(o,n){return this.check(ea(o,n))},int(o){return this.check(Lb(o))},safe(o){return this.check(Lb(o))},positive(o){return this.check(tu(0,o))},nonnegative(o){return this.check(ta(0,o))},negative(o){return this.check(eu(0,o))},nonpositive(o){return this.check(ea(0,o))},multipleOf(o,n){return this.check(ru(o,n))},step(o,n){return this.check(ru(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??0.5),e.isFinite=!0,e.format=r.format??null});function E(e){return Xz(Gb,e)}var kP=S(\"ZodNumberFormat\",(e,t)=>{rz.init(e,t),Gb.init(e,t)});function Lb(e){return eb(kP,e)}var RP=S(\"ZodBoolean\",(e,t)=>{oz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lp(e,r,o,n)});function U(e){return tb(RP,e)}var PP=S(\"ZodNull\",(e,t)=>{nz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pp(e,r,o,n)});function uu(e){return rb(PP,e)}var TP=S(\"ZodUnknown\",(e,t)=>{sz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mp(e,r,o,n)});function L(){return ob(TP)}var EP=S(\"ZodNever\",(e,t)=>{iz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dp(e,r,o,n)});function IP(e){return nb(EP,e)}var OP=S(\"ZodArray\",(e,t)=>{az.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sp(e,r,o,n),e.element=t.element,ca(e,\"ZodArray\",{min(r,o){return this.check(Yo(r,o))},nonempty(r){return this.check(Yo(1,r))},max(r,o){return this.check(ou(r,o))},length(r,o){return this.check(nu(r,o))},unwrap(){return this.element}})});function R(e,t){return sb(OP,e,t)}var Kb=S(\"ZodObject\",(e,t)=>{lz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zp(e,r,o,n),B(e,\"shape\",()=>t.shape),ca(e,\"ZodObject\",{keyof(){return W(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:L()})},loose(){return this.clone({...this._zod.def,catchall:L()})},strict(){return this.clone({...this._zod.def,catchall:IP()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return AR(this,r)},safeExtend(r){return jR(this,r)},merge(r){return MR(this,r)},pick(r){return ZR(this,r)},omit(r){return NR(this,r)},partial(...r){return qR(Xb,this,r[0])},required(...r){return LR(ey,this,r[0])}})});function g(e,t){let r={type:\"object\",shape:e??{},...Z(t)};return new Kb(r)}function V(e,t){return new Kb({type:\"object\",shape:e,catchall:L(),...Z(t)})}var Yb=S(\"ZodUnion\",(e,t)=>{Vl.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bp(e,r,o,n),e.options=t.options});function q(e,t){return new Yb({type:\"union\",options:e,...Z(t)})}var CP=S(\"ZodDiscriminatedUnion\",(e,t)=>{Yb.init(e,t),pz.init(e,t)});function Zp(e,t,r){return new CP({type:\"union\",options:t,discriminator:e,...Z(r)})}var ZP=S(\"ZodIntersection\",(e,t)=>{dz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yp(e,r,o,n)});function Qo(e,t){return new ZP({type:\"intersection\",left:e,right:t})}var Ub=S(\"ZodRecord\",(e,t)=>{mz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vp(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function j(e,t,r){if(!t||!t._zod)return new Ub({type:\"record\",keyType:p(),valueType:e,...Z(t)});return new Ub({type:\"record\",keyType:e,valueType:t,...Z(r)})}var Cp=S(\"ZodEnum\",(e,t)=>{hz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(o,n,i)=>hp(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new Cp({...t,checks:[],...Z(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let s of o)if(r.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new Cp({...t,checks:[],...Z(n),entries:i})}});function W(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new Cp({type:\"enum\",entries:r,...Z(t)})}var NP=S(\"ZodLiteral\",(e,t)=>{fz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fp(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,\"value\",{get(){if(t.values.length>1)throw Error(\"This schema contains multiple valid literal values. Use `.values` instead.\");return t.values[0]}})});function v(e,t){return new NP({type:\"literal\",values:Array.isArray(e)?e:[e],...Z(t)})}var AP=S(\"ZodTransform\",(e,t)=>{gz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_p(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction===\"backward\")throw new Wi(e.constructor.name);r.addIssue=(i)=>{if(typeof i===\"string\")r.issues.push(Hr(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;s.code??(s.code=\"custom\"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(Hr(s))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((i)=>(r.value=i,r.fallback=!0,r));return r.value=n,r.fallback=!0,r}});function Qb(e){return new AP({type:\"transform\",transform:e})}var Xb=S(\"ZodOptional\",(e,t)=>{Jl.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>su(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function D(e){return new Xb({type:\"optional\",innerType:e})}var jP=S(\"ZodExactOptional\",(e,t)=>{_z.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>su(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function MP(e){return new jP({type:\"optional\",innerType:e})}var qP=S(\"ZodNullable\",(e,t)=>{Sz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Db(e){return new qP({type:\"nullable\",innerType:e})}var LP=S(\"ZodDefault\",(e,t)=>{zz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$p(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function UP(e,t){return new LP({type:\"default\",innerType:e,get defaultValue(){return typeof t===\"function\"?t():Cl(t)}})}var DP=S(\"ZodPrefault\",(e,t)=>{bz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>kp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function FP(e,t){return new DP({type:\"prefault\",innerType:e,get defaultValue(){return typeof t===\"function\"?t():Cl(t)}})}var ey=S(\"ZodNonOptional\",(e,t)=>{yz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function VP(e,t){return new ey({type:\"nonoptional\",innerType:e,...Z(t)})}var JP=S(\"ZodCatch\",(e,t)=>{vz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Rp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function HP(e,t){return new JP({type:\"catch\",innerType:e,catchValue:typeof t===\"function\"?t:()=>t})}var ty=S(\"ZodPipe\",(e,t)=>{Hl.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pp(e,r,o,n),e.in=t.in,e.out=t.out});function Fb(e,t){return new ty({type:\"pipe\",in:e,out:t})}var BP=S(\"ZodPreprocess\",(e,t)=>{ty.init(e,t),xz.init(e,t)}),WP=S(\"ZodReadonly\",(e,t)=>{wz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function GP(e){return new WP({type:\"readonly\",innerType:e})}var KP=S(\"ZodLazy\",(e,t)=>{$z.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ep(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Np(e){return new KP({type:\"lazy\",getter:e})}var YP=S(\"ZodCustom\",(e,t)=>{kz.init(e,t),ue.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gp(e,r,o,n)});function QP(e,t={}){return ib(YP,e,t)}function XP(e,t){return ab(e,t)}function lu(e,t){return new BP({type:\"pipe\",in:Qb(e),out:t})}Ye(Bl());var Up=Symbol.for(\"mcp.sdk.errorBrands\");function Gr(e,t){let r=new Set,o=t;while(typeof o===\"function\"){let n=o.mcpBrand;if(Object.prototype.hasOwnProperty.call(o,\"mcpBrand\")&&typeof n===\"string\")r.add(n);o=Object.getPrototypeOf(o)}if(r.size===0)return;Object.defineProperty(e,Up,{value:r,enumerable:!1,configurable:!0})}function Xe(e,t){try{if(typeof t===\"object\"&&t!==null&&Object.prototype.hasOwnProperty.call(e,\"mcpBrand\")&&typeof e.mcpBrand===\"string\"&&Object.prototype.hasOwnProperty.call(t,Up)){let r=t[Up];if(r&&typeof r.has===\"function\"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var e0=class e extends Error{static{Object.defineProperty(this,\"mcpBrand\",{value:\"mcp.OAuthError\"})}static[Symbol.hasInstance](t){return Xe(this,t)}static isInstance(t){if(typeof this!==\"function\")throw TypeError(\"isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`\");return Xe(this,t)}constructor(t,r,o){super(r);this.code=t,this.errorUri=o,this.name=\"OAuthError\",Gr(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};if(this.errorUri)t.error_uri=this.errorUri;return t}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},Oe=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}({}),ke=class extends Error{static{Object.defineProperty(this,\"mcpBrand\",{value:\"mcp.SdkError\"})}static[Symbol.hasInstance](e){return Xe(this,e)}static isInstance(e){if(typeof this!==\"function\")throw TypeError(\"isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`\");return Xe(this,e)}constructor(e,t,r){super(t);this.code=e,this.data=r,this.name=\"SdkError\",Gr(this,new.target)}},t0=class extends ke{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}};var r0=\"2026-07-28\";function dy(e){return e>=r0}function my(e){let t=e.structuredContent;if(t===void 0)return e;if(!(typeof t!==\"object\"||t===null||Array.isArray(t)))return e;if(e.content?.some((r)=>r.type===\"text\")??!1)return e;return{...e,content:[...e.content??[],{type:\"text\",text:JSON.stringify(t)}]}}var hy=[\"task\",\"inputRequests\",\"requestState\"];function o0(e){if(e===null||typeof e!==\"object\"||Array.isArray(e)||e.content!==void 0||hy.some((t)=>(t in e)))return e;return{...e,content:[]}}function n0(){let e=Np(()=>q([p(),E(),U(),uu(),j(p(),e),R(e)])),t=j(p(),e),r=q([p(),E().int()]),o=p(),n=g({ttl:E().optional()}),i=g({taskId:p()}),s=V({progressToken:r.optional(),\"io.modelcontextprotocol/related-task\":i.optional()}),a=g({_meta:s.optional()}),c=a.extend({task:n.optional()}),u=g({method:p(),params:a.loose().optional()}),l=g({_meta:s.optional()}),m=g({method:p(),params:l.loose().optional()}),h=V({_meta:s.optional()}),f=q([p(),E().int()]),b=h.strict(),I=l.extend({requestId:f.optional(),reason:p().optional()}),x=m.extend({method:v(\"notifications/cancelled\"),params:I}),J=g({src:p(),mimeType:p().optional(),sizes:R(p()).optional(),theme:W([\"light\",\"dark\"]).optional()}),re=g({icons:R(J).optional()}),M=g({name:p(),title:p().optional()}),k=M.extend({...M.shape,...re.shape,version:p(),websiteUrl:p().optional(),description:p().optional()}),N=Qo(g({applyDefaults:U().optional()}),t),K=lu((Ae)=>{if(Ae&&typeof Ae===\"object\"&&!Array.isArray(Ae)&&Object.keys(Ae).length===0)return{form:{}};return Ae},Qo(g({form:N.optional(),url:t.optional()}),t.optional())),de=V({list:t.optional(),cancel:t.optional(),requests:V({sampling:V({createMessage:t.optional()}).optional(),elicitation:V({create:t.optional()}).optional()}).optional()}),Be=V({list:t.optional(),cancel:t.optional(),requests:V({tools:V({call:t.optional()}).optional()}).optional()}),Me=g({experimental:j(p(),t).optional(),sampling:g({context:t.optional(),tools:t.optional()}).optional(),elicitation:K.optional(),roots:g({listChanged:U().optional()}).optional(),tasks:de.optional(),extensions:j(p(),t).optional()}),jt=a.extend({protocolVersion:p(),capabilities:Me,clientInfo:k}),lr=u.extend({method:v(\"initialize\"),params:jt}),rn=g({experimental:j(p(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:g({listChanged:U().optional()}).optional(),resources:g({subscribe:U().optional(),listChanged:U().optional()}).optional(),tools:g({listChanged:U().optional()}).optional(),tasks:Be.optional(),extensions:j(p(),t).optional()}),on=h.extend({protocolVersion:p(),capabilities:rn,serverInfo:k,instructions:p().optional()}),eo=m.extend({method:v(\"notifications/initialized\"),params:l.optional()}),Mt=u.extend({method:v(\"ping\"),params:a.optional()}),pr=g({progress:E(),total:D(E()),message:D(p())}),dt=g({...l.shape,...pr.shape,progressToken:r}),qt=m.extend({method:v(\"notifications/progress\"),params:dt}),to=a.extend({cursor:o.optional()}),xt=u.extend({params:to.optional()}),wt=h.extend({nextCursor:o.optional()}),ro=g({uri:p(),mimeType:D(p()),_meta:j(p(),L()).optional()}),oo=ro.extend({text:p()}),dr=p().refine((Ae)=>{try{return atob(Ae),!0}catch{return!1}},{message:\"Invalid Base64 string\"}),no=ro.extend({blob:dr}),mt=W([\"user\",\"assistant\"]),nt=g({audience:R(mt).optional(),priority:E().min(0).max(1).optional(),lastModified:aa({offset:!0}).optional()}),mr=g({...M.shape,...re.shape,uri:p(),description:D(p()),mimeType:D(p()),size:D(E()),annotations:nt.optional(),_meta:D(V({}))}),nn=g({...M.shape,...re.shape,uriTemplate:p(),description:D(p()),mimeType:D(p()),annotations:nt.optional(),_meta:D(V({}))}),sn=xt.extend({method:v(\"resources/list\")}),an=wt.extend({resources:R(mr)}),Lt=xt.extend({method:v(\"resources/templates/list\")}),so=wt.extend({resourceTemplates:R(nn)}),hr=a.extend({uri:p()}),cn=hr,un=u.extend({method:v(\"resources/read\"),params:cn}),ln=h.extend({contents:R(q([oo,no]))}),pn=m.extend({method:v(\"notifications/resources/list_changed\"),params:l.optional()}),dn=hr,mn=u.extend({method:v(\"resources/subscribe\"),params:dn}),hn=hr,fn=u.extend({method:v(\"resources/unsubscribe\"),params:hn}),gn=l.extend({uri:p()}),_n=m.extend({method:v(\"notifications/resources/updated\"),params:gn}),Sn=g({name:p(),description:D(p()),required:D(U())}),zn=g({...M.shape,...re.shape,description:D(p()),arguments:D(R(Sn)),_meta:D(V({}))}),bn=xt.extend({method:v(\"prompts/list\")}),yn=wt.extend({prompts:R(zn)}),vn=a.extend({name:p(),arguments:j(p(),p()).optional()}),xn=u.extend({method:v(\"prompts/get\"),params:vn}),fr=g({type:v(\"text\"),text:p(),annotations:nt.optional(),_meta:j(p(),L()).optional()}),gr=g({type:v(\"image\"),data:dr,mimeType:p(),annotations:nt.optional(),_meta:j(p(),L()).optional()}),_r=g({type:v(\"audio\"),data:dr,mimeType:p(),annotations:nt.optional(),_meta:j(p(),L()).optional()}),wn=g({type:v(\"tool_use\"),name:p(),id:p(),input:j(p(),L()),_meta:j(p(),L()).optional()}),Ut=g({type:v(\"resource\"),resource:q([oo,no]),annotations:nt.optional(),_meta:j(p(),L()).optional()}),$n=mr.extend({type:v(\"resource_link\")}),tt=q([fr,gr,_r,$n,Ut]),io=g({role:mt,content:tt}),ao=h.extend({description:p().optional(),messages:R(io)}),Sr=m.extend({method:v(\"notifications/prompts/list_changed\"),params:l.optional()}),kn=g({title:p().optional(),readOnlyHint:U().optional(),destructiveHint:U().optional(),idempotentHint:U().optional(),openWorldHint:U().optional()}),co=g({taskSupport:W([\"required\",\"optional\",\"forbidden\"]).optional()}),zr=g({...M.shape,...re.shape,description:p().optional(),inputSchema:g({type:v(\"object\"),properties:j(p(),e).optional(),required:R(p()).optional()}).catchall(L()),outputSchema:g({type:v(\"object\"),properties:j(p(),e).optional(),required:R(p()).optional()}).catchall(L()).optional(),annotations:kn.optional(),execution:co.optional(),_meta:j(p(),L()).optional()}),uo=xt.extend({method:v(\"tools/list\")}),lo=wt.extend({tools:R(zr)}),po=h.extend({content:R(tt),structuredContent:j(p(),L()).optional(),isError:U().optional()}),Ne=c.extend({name:p(),arguments:j(p(),L()).optional()}),Rn=u.extend({method:v(\"tools/call\"),params:Ne}),Ea=m.extend({method:v(\"notifications/tools/list_changed\"),params:l.optional()}),mo=W([\"debug\",\"info\",\"notice\",\"warning\",\"error\",\"critical\",\"alert\",\"emergency\"]),Pn=a.extend({level:mo}),Tn=u.extend({method:v(\"logging/setLevel\"),params:Pn}),En=l.extend({level:mo,logger:p().optional(),data:L()}),In=m.extend({method:v(\"notifications/message\"),params:En}),On=g({name:p().optional()}),Cn=g({hints:R(On).optional(),costPriority:E().min(0).max(1).optional(),speedPriority:E().min(0).max(1).optional(),intelligencePriority:E().min(0).max(1).optional()}),Zn=g({mode:W([\"auto\",\"required\",\"none\"]).optional()}),Ia=g({type:v(\"tool_result\"),toolUseId:p().describe(\"The unique identifier for the corresponding tool call.\"),content:R(tt),structuredContent:g({}).loose().optional(),isError:U().optional(),_meta:j(p(),L()).optional()}),Nn=Zp(\"type\",[fr,gr,_r]),Dt=Zp(\"type\",[fr,gr,_r,wn,Ia]),An=g({role:mt,content:q([Dt,R(Dt)]),_meta:j(p(),L()).optional()}),jn=c.extend({messages:R(An),modelPreferences:Cn.optional(),systemPrompt:p().optional(),includeContext:W([\"none\",\"thisServer\",\"allServers\"]).optional(),temperature:E().optional(),maxTokens:E().int(),stopSequences:R(p()).optional(),metadata:t.optional(),tools:R(zr).optional(),toolChoice:Zn.optional()}),Mn=u.extend({method:v(\"sampling/createMessage\"),params:jn}),qn=h.extend({model:p(),stopReason:D(W([\"endTurn\",\"stopSequence\",\"maxTokens\"]).or(p())),role:mt,content:Nn}),Ln=h.extend({model:p(),stopReason:D(W([\"endTurn\",\"stopSequence\",\"maxTokens\",\"toolUse\"]).or(p())),role:mt,content:q([Dt,R(Dt)])}),Un=g({type:v(\"boolean\"),title:p().optional(),description:p().optional(),default:U().optional()}),Dn=g({type:v(\"string\"),title:p().optional(),description:p().optional(),minLength:E().optional(),maxLength:E().optional(),format:W([\"email\",\"uri\",\"date\",\"date-time\"]).optional(),default:p().optional()}),Fn=g({type:W([\"number\",\"integer\"]),title:p().optional(),description:p().optional(),minimum:E().optional(),maximum:E().optional(),default:E().optional()}),Vn=g({type:v(\"string\"),title:p().optional(),description:p().optional(),enum:R(p()),default:p().optional()}),Jn=g({type:v(\"string\"),title:p().optional(),description:p().optional(),oneOf:R(g({const:p(),title:p()})),default:p().optional()}),Hn=g({type:v(\"string\"),title:p().optional(),description:p().optional(),enum:R(p()),enumNames:R(p()).optional(),default:p().optional()}),Bn=q([Vn,Jn]),br=g({type:v(\"array\"),title:p().optional(),description:p().optional(),minItems:E().optional(),maxItems:E().optional(),items:g({type:v(\"string\"),enum:R(p())}),default:R(p()).optional()}),yr=g({type:v(\"array\"),title:p().optional(),description:p().optional(),minItems:E().optional(),maxItems:E().optional(),items:g({anyOf:R(g({const:p(),title:p()}))}),default:R(p()).optional()}),Oa=q([br,yr]),Ca=q([Hn,Bn,Oa]),We=q([Ca,Un,Dn,Fn]),Ge=c.extend({mode:v(\"form\").optional(),message:p(),requestedSchema:g({type:v(\"object\"),properties:j(p(),We),required:R(p()).optional()}).catchall(L())}),Wn=c.extend({mode:v(\"url\"),message:p(),elicitationId:p(),url:p().url()}),st=q([Ge,Wn]),Za=u.extend({method:v(\"elicitation/create\"),params:st}),Na=l.extend({elicitationId:p()}),Aa=m.extend({method:v(\"notifications/elicitation/complete\"),params:Na}),ja=h.extend({action:W([\"accept\",\"decline\",\"cancel\"]),content:lu((Ae)=>Ae===null?void 0:Ae,j(p(),q([p(),E(),U(),R(p())])).optional())}),Ma=g({type:v(\"ref/resource\"),uri:p()}),qa=g({type:v(\"ref/prompt\"),name:p()}),La=a.extend({ref:q([qa,Ma]),argument:g({name:p(),value:p()}),context:g({arguments:j(p(),p()).optional()}).optional()}),Gn=u.extend({method:v(\"completion/complete\"),params:La}),Ua=h.extend({completion:V({values:R(p()).max(100),total:D(E().int()),hasMore:D(U())})}),Da=g({uri:p().startsWith(\"file://\"),name:p().optional(),_meta:j(p(),L()).optional()}),ho=u.extend({method:v(\"roots/list\"),params:a.optional()}),Kn=h.extend({roots:R(Da)}),Fa=m.extend({method:v(\"notifications/roots/list_changed\"),params:l.optional()}),Va=V({ttl:E().optional(),pollInterval:E().optional()}),Ja=W([\"working\",\"input_required\",\"completed\",\"failed\",\"cancelled\"]),Ft=g({taskId:p(),status:Ja,ttl:q([E(),uu()]),createdAt:p(),lastUpdatedAt:p(),pollInterval:D(E()),statusMessage:D(p())}),Fe=h.extend({task:Ft}),Ha=l.merge(Ft),vr=m.extend({method:v(\"notifications/tasks/status\"),params:Ha}),fo=u.extend({method:v(\"tasks/get\"),params:a.extend({taskId:p()})}),go=h.merge(Ft),_o=u.extend({method:v(\"tasks/result\"),params:a.extend({taskId:p()})}),Nu=h.loose(),Ve=xt.extend({method:v(\"tasks/list\")}),xe=wt.extend({tasks:R(Ft)}),xr=u.extend({method:v(\"tasks/cancel\"),params:a.extend({taskId:p()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:i,RequestMetaSchema:s,BaseRequestParamsSchema:a,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:l,NotificationSchema:m,ResultSchema:h,RequestIdSchema:f,EmptyResultSchema:b,CancelledNotificationParamsSchema:I,CancelledNotificationSchema:x,IconSchema:J,IconsSchema:re,BaseMetadataSchema:M,ImplementationSchema:k,ClientTasksCapabilitySchema:de,ServerTasksCapabilitySchema:Be,ClientCapabilitiesSchema:Me,InitializeRequestParamsSchema:jt,InitializeRequestSchema:lr,ServerCapabilitiesSchema:rn,InitializeResultSchema:on,InitializedNotificationSchema:eo,PingRequestSchema:Mt,ProgressSchema:pr,ProgressNotificationParamsSchema:dt,ProgressNotificationSchema:qt,PaginatedRequestParamsSchema:to,PaginatedRequestSchema:xt,PaginatedResultSchema:wt,ResourceContentsSchema:ro,TextResourceContentsSchema:oo,BlobResourceContentsSchema:no,RoleSchema:mt,AnnotationsSchema:nt,ResourceSchema:mr,ResourceTemplateSchema:nn,ListResourcesRequestSchema:sn,ListResourcesResultSchema:an,ListResourceTemplatesRequestSchema:Lt,ListResourceTemplatesResultSchema:so,ResourceRequestParamsSchema:hr,ReadResourceRequestParamsSchema:cn,ReadResourceRequestSchema:un,ReadResourceResultSchema:ln,ResourceListChangedNotificationSchema:pn,SubscribeRequestParamsSchema:dn,SubscribeRequestSchema:mn,UnsubscribeRequestParamsSchema:hn,UnsubscribeRequestSchema:fn,ResourceUpdatedNotificationParamsSchema:gn,ResourceUpdatedNotificationSchema:_n,PromptArgumentSchema:Sn,PromptSchema:zn,ListPromptsRequestSchema:bn,ListPromptsResultSchema:yn,GetPromptRequestParamsSchema:vn,GetPromptRequestSchema:xn,TextContentSchema:fr,ImageContentSchema:gr,AudioContentSchema:_r,ToolUseContentSchema:wn,EmbeddedResourceSchema:Ut,ResourceLinkSchema:$n,ContentBlockSchema:tt,PromptMessageSchema:io,GetPromptResultSchema:ao,PromptListChangedNotificationSchema:Sr,ToolAnnotationsSchema:kn,ToolExecutionSchema:co,ToolSchema:zr,ListToolsRequestSchema:uo,ListToolsResultSchema:lo,CallToolResultSchema:po,CallToolRequestParamsSchema:Ne,CallToolRequestSchema:Rn,ToolListChangedNotificationSchema:Ea,LoggingLevelSchema:mo,SetLevelRequestParamsSchema:Pn,SetLevelRequestSchema:Tn,LoggingMessageNotificationParamsSchema:En,LoggingMessageNotificationSchema:In,ModelHintSchema:On,ModelPreferencesSchema:Cn,ToolChoiceSchema:Zn,ToolResultContentSchema:Ia,SamplingContentSchema:Nn,SamplingMessageContentBlockSchema:Dt,SamplingMessageSchema:An,CreateMessageRequestParamsSchema:jn,CreateMessageRequestSchema:Mn,CreateMessageResultSchema:qn,CreateMessageResultWithToolsSchema:Ln,BooleanSchemaSchema:Un,StringSchemaSchema:Dn,NumberSchemaSchema:Fn,UntitledSingleSelectEnumSchemaSchema:Vn,TitledSingleSelectEnumSchemaSchema:Jn,LegacyTitledEnumSchemaSchema:Hn,SingleSelectEnumSchemaSchema:Bn,UntitledMultiSelectEnumSchemaSchema:br,TitledMultiSelectEnumSchemaSchema:yr,MultiSelectEnumSchemaSchema:Oa,EnumSchemaSchema:Ca,PrimitiveSchemaDefinitionSchema:We,ElicitRequestFormParamsSchema:Ge,ElicitRequestURLParamsSchema:Wn,ElicitRequestParamsSchema:st,ElicitRequestSchema:Za,ElicitationCompleteNotificationParamsSchema:Na,ElicitationCompleteNotificationSchema:Aa,ElicitResultSchema:ja,ResourceTemplateReferenceSchema:Ma,PromptReferenceSchema:qa,CompleteRequestParamsSchema:La,CompleteRequestSchema:Gn,CompleteResultSchema:Ua,RootSchema:Da,ListRootsRequestSchema:ho,ListRootsResultSchema:Kn,RootsListChangedNotificationSchema:Fa,TaskCreationParamsSchema:Va,TaskStatusSchema:Ja,TaskSchema:Ft,CreateTaskResultSchema:Fe,TaskStatusNotificationParamsSchema:Ha,TaskStatusNotificationSchema:vr,GetTaskRequestSchema:fo,GetTaskResultSchema:go,GetTaskPayloadRequestSchema:_o,GetTaskPayloadResultSchema:Nu,ListTasksRequestSchema:Ve,ListTasksResultSchema:xe,CancelTaskRequestSchema:xr,CancelTaskResultSchema:h.merge(Ft),ClientRequestSchema:q([Mt,lr,Gn,Tn,xn,bn,sn,Lt,un,mn,fn,Rn,uo,fo,_o,Ve,xr]),ClientNotificationSchema:q([x,qt,eo,Fa,vr]),ClientResultSchema:q([b,qn,Ln,ja,Kn,go,xe,Fe]),ServerRequestSchema:q([Mt,Mn,Za,ho,fo,_o,Ve,xr]),ServerNotificationSchema:q([x,qt,In,_n,pn,Ea,Sr,vr,Aa]),ServerResultSchema:q([b,on,Ua,ao,yn,an,so,ln,po,lo,go,xe,Fe]),CallToolResultWireSchema:L().superRefine((Ae,rk)=>{if(typeof Ae!==\"object\"||Ae===null||Array.isArray(Ae)||Ae.content!==void 0)return;for(let Fd of hy)if(Fd in Ae){rk.addIssue({code:\"custom\",message:`content is required when the body carries '${Fd}' — another result family cannot default into an empty tools/call success`});return}}).transform(o0).pipe(po)}}var s0;function fy(){return s0??=n0()}function gy(e){return e.type!==\"object\"}var i0=new Set([\"const\",\"enum\",\"default\",\"examples\"]),a0=new Set([\"properties\",\"patternProperties\",\"$defs\",\"definitions\",\"dependentSchemas\",\"dependencies\"]);function ry(e){return e!==void 0&&!(typeof e===\"string\"&&e.startsWith(\"#\"))}function c0(e){let t=typeof e.$schema===\"string\"?e.$schema:void 0;if(ry(e.$id))return{...t!==void 0&&{$schema:t},type:\"object\",properties:{result:e},required:[\"result\"]};let r=Bd(e.$schema)&&e.$recursiveAnchor!==!0,o=(n,i)=>{if(Array.isArray(n))return n.map((c)=>o(c,!1));if(n===null||typeof n!==\"object\")return n;if(!i&&ry(n.$id))return n;let s={},a=!1;for(let[c,u]of Object.entries(n))if(i)s[c]=o(u,!1);else if((c===\"$ref\"||c===\"$dynamicRef\")&&typeof u===\"string\")s[c]=u===\"#\"?\"#/properties/result\":u.startsWith(\"#/\")?`#/properties/result${u.slice(1)}`:u;else if(c===\"$recursiveRef\"&&u===\"#\"&&r)a=!0;else if(i0.has(c))s[c]=u;else if(a0.has(c))s[c]=o(u,!0);else s[c]=o(u,!1);if(a)if(\"$ref\"in s)s.allOf=[...Array.isArray(s.allOf)?s.allOf:[],{$ref:\"#/properties/result\"}];else s.$ref=\"#/properties/result\";return s};return{...t!==void 0&&{$schema:t},type:\"object\",properties:{result:o(e,!1)},required:[\"result\"]}}var _y={ping:null,initialize:null,\"completion/complete\":null,\"logging/setLevel\":null,\"prompts/get\":null,\"prompts/list\":null,\"resources/list\":null,\"resources/templates/list\":null,\"resources/read\":null,\"resources/subscribe\":null,\"resources/unsubscribe\":null,\"tools/call\":null,\"tools/list\":null,\"tasks/get\":null,\"tasks/result\":null,\"tasks/list\":null,\"tasks/cancel\":null,\"sampling/createMessage\":null,\"elicitation/create\":null,\"roots/list\":null},Sy={\"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},u0={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},pu;function Bp(){if(pu)return pu;let e=fy();return pu={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}},pu}function zy(e){return Object.prototype.hasOwnProperty.call(_y,e)}function by(e){return Object.prototype.hasOwnProperty.call(Sy,e)}function l0(e){return Object.prototype.hasOwnProperty.call(u0,e)}function p0(e){return l0(e)?Bp().resultSchemas[e]:void 0}function d0(e){return zy(e)?Bp().requestSchemas[e]:void 0}function m0(e){return by(e)?Bp().notificationSchemas[e]:void 0}var cA=Object.keys(_y),uA=Object.keys(Sy);function Dp(e){return e!==null&&typeof e===\"object\"&&!Array.isArray(e)}function du(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 oy={ok:!1,reason:\"not-in-era\"};function ny(e){return Dp(e)&&Dp(e.outputSchema)&&gy(e.outputSchema)}function sy(e){return e}var Wp={era:\"2025-11-25\",hasRequestMethod:zy,hasNotificationMethod:by,validateRequest:(e,t)=>du(d0(e),t),validateResult:(e,t)=>du(p0(e),t),validateNotification:(e,t)=>du(m0(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>oy,validateInputResponse:()=>oy,samplingResultVariant:(e,t)=>{let r=fy();return du(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:(e)=>{return},validateEnvelopeMeta:(e)=>[],projectCallToolResult(e,t){let r=my(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!==\"object\"||o===null||Array.isArray(o),i=t!==void 0&&gy(t);if(!n&&!i)return r;return{...r,structuredContent:{result:o}}},decodeResult(e,t){if(Dp(t)&&\"resultType\"in t){let r={...t};return delete r.resultType,{kind:\"complete\",result:sy(r)}}return{kind:\"complete\",result:sy(t)}},encodeResult(e,t){if(e!==\"tools/list\")return t;let r=t.tools;if(!Array.isArray(r)||!r.some((o)=>ny(o)))return t;return{...t,tools:r.map((o)=>ny(o)?{...o,outputSchema:c0(o.outputSchema)}:o)}},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope:(e)=>{return}};function h0(){let e=Np(()=>q([p(),E(),U(),uu(),j(p(),e),R(e)])),t=j(p(),e),r=q([p(),E().int()]),o=p(),n=q([p(),E().int()]),i=W([\"user\",\"assistant\"]),s=W([\"debug\",\"info\",\"notice\",\"warning\",\"error\",\"critical\",\"alert\",\"emergency\"]),a=p().refine((xe)=>{try{return atob(xe),!0}catch{return!1}},{message:\"Invalid Base64 string\"}),c=g({ttl:E().optional()}),u=g({taskId:p()}),l=V({progressToken:r.optional(),\"io.modelcontextprotocol/related-task\":u.optional()}),m=g({_meta:l.optional()}),h=m.extend({task:c.optional()}),f=g({_meta:l.optional()}),b=g({method:p(),params:f.loose().optional()}),I=g({src:p(),mimeType:p().optional(),sizes:R(p()).optional(),theme:W([\"light\",\"dark\"]).optional()}),x=g({icons:R(I).optional()}),J=g({name:p(),title:p().optional()}),re=J.extend({...J.shape,...x.shape,version:p(),websiteUrl:p().optional(),description:p().optional()}),M=Qo(g({applyDefaults:U().optional()}),t),k=lu((xe)=>{if(xe&&typeof xe===\"object\"&&!Array.isArray(xe)&&Object.keys(xe).length===0)return{form:{}};return xe},Qo(g({form:M.optional(),url:t.optional()}),t.optional())),N=V({list:t.optional(),cancel:t.optional(),requests:V({sampling:V({createMessage:t.optional()}).optional(),elicitation:V({create:t.optional()}).optional()}).optional()}),K=V({list:t.optional(),cancel:t.optional(),requests:V({tools:V({call:t.optional()}).optional()}).optional()}),de=g({experimental:j(p(),t).optional(),sampling:g({context:t.optional(),tools:t.optional()}).optional(),elicitation:k.optional(),roots:g({listChanged:U().optional()}).optional(),tasks:N.optional(),extensions:j(p(),t).optional()}),Be=g({experimental:j(p(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:g({listChanged:U().optional()}).optional(),resources:g({subscribe:U().optional(),listChanged:U().optional()}).optional(),tools:g({listChanged:U().optional()}).optional(),tasks:K.optional(),extensions:j(p(),t).optional()}),Me=g({progress:E(),total:D(E()),message:D(p())}),jt=g({...f.shape,...Me.shape,progressToken:r}),lr=b.extend({method:v(\"notifications/progress\"),params:jt}),rn=f.extend({level:s,logger:p().optional(),data:L()}),on=b.extend({method:v(\"notifications/message\"),params:rn}),eo=g({uri:p(),mimeType:D(p()),_meta:j(p(),L()).optional()}),Mt=eo.extend({text:p()}),pr=eo.extend({blob:a}),dt=g({audience:R(i).optional(),priority:E().min(0).max(1).optional(),lastModified:aa({offset:!0}).optional()}),qt=g({...J.shape,...x.shape,uri:p(),description:D(p()),mimeType:D(p()),size:D(E()),annotations:dt.optional(),_meta:D(V({}))}),to=g({...J.shape,...x.shape,uriTemplate:p(),description:D(p()),mimeType:D(p()),annotations:dt.optional(),_meta:D(V({}))}),xt=b.extend({method:v(\"notifications/resources/list_changed\"),params:f.optional()}),wt=f.extend({uri:p()}),ro=b.extend({method:v(\"notifications/resources/updated\"),params:wt}),oo=g({name:p(),description:D(p()),required:D(U())}),dr=g({...J.shape,...x.shape,description:D(p()),arguments:D(R(oo)),_meta:D(V({}))}),no=b.extend({method:v(\"notifications/prompts/list_changed\"),params:f.optional()}),mt=g({type:v(\"text\"),text:p(),annotations:dt.optional(),_meta:j(p(),L()).optional()}),nt=g({type:v(\"image\"),data:a,mimeType:p(),annotations:dt.optional(),_meta:j(p(),L()).optional()}),mr=g({type:v(\"audio\"),data:a,mimeType:p(),annotations:dt.optional(),_meta:j(p(),L()).optional()}),nn=g({type:v(\"tool_use\"),name:p(),id:p(),input:j(p(),L()),_meta:j(p(),L()).optional()}),sn=g({type:v(\"resource\"),resource:q([Mt,pr]),annotations:dt.optional(),_meta:j(p(),L()).optional()}),an=qt.extend({type:v(\"resource_link\")}),Lt=q([mt,nt,mr,an,sn]),so=g({role:i,content:Lt}),hr=g({title:p().optional(),readOnlyHint:U().optional(),destructiveHint:U().optional(),idempotentHint:U().optional(),openWorldHint:U().optional()}),cn=b.extend({method:v(\"notifications/tools/list_changed\"),params:f.optional()}),un=g({name:p().optional()}),ln=g({hints:R(un).optional(),costPriority:E().min(0).max(1).optional(),speedPriority:E().min(0).max(1).optional(),intelligencePriority:E().min(0).max(1).optional()}),pn=g({mode:W([\"auto\",\"required\",\"none\"]).optional()}),dn=g({type:v(\"boolean\"),title:p().optional(),description:p().optional(),default:U().optional()}),mn=g({type:v(\"string\"),title:p().optional(),description:p().optional(),minLength:E().optional(),maxLength:E().optional(),format:W([\"email\",\"uri\",\"date\",\"date-time\"]).optional(),default:p().optional()}),hn=g({type:W([\"number\",\"integer\"]),title:p().optional(),description:p().optional(),minimum:E().optional(),maximum:E().optional(),default:E().optional()}),fn=g({type:v(\"string\"),title:p().optional(),description:p().optional(),enum:R(p()),default:p().optional()}),gn=g({type:v(\"string\"),title:p().optional(),description:p().optional(),oneOf:R(g({const:p(),title:p()})),default:p().optional()}),_n=g({type:v(\"string\"),title:p().optional(),description:p().optional(),enum:R(p()),enumNames:R(p()).optional(),default:p().optional()}),Sn=q([fn,gn]),zn=g({type:v(\"array\"),title:p().optional(),description:p().optional(),minItems:E().optional(),maxItems:E().optional(),items:g({type:v(\"string\"),enum:R(p())}),default:R(p()).optional()}),bn=g({type:v(\"array\"),title:p().optional(),description:p().optional(),minItems:E().optional(),maxItems:E().optional(),items:g({anyOf:R(g({const:p(),title:p()}))}),default:R(p()).optional()}),yn=q([zn,bn]),vn=q([_n,Sn,yn]),xn=q([vn,dn,mn,hn]),fr=h.extend({mode:v(\"form\").optional(),message:p(),requestedSchema:g({type:v(\"object\"),properties:j(p(),xn),required:R(p()).optional()}).catchall(L())}),gr=g({type:v(\"ref/resource\"),uri:p()}),_r=g({type:v(\"ref/prompt\"),name:p()}),wn=g({uri:p().startsWith(\"file://\"),name:p().optional(),_meta:j(p(),L()).optional()}),Ut=de.shape,$n=g({experimental:Ut.experimental,sampling:Ut.sampling,elicitation:Ut.elicitation,roots:Ut.roots,extensions:Ut.extensions}),tt=Be.shape,io=g({experimental:tt.experimental,logging:tt.logging,completions:tt.completions,prompts:tt.prompts,resources:tt.resources,tools:tt.tools,extensions:tt.extensions}),ao=V({progressToken:r.optional(),[Pr]:p(),[vo]:re.optional(),[Tr]:$n,[xo]:s.optional()}),Sr=g({...J.shape,...x.shape,description:p().optional(),inputSchema:V({$schema:p().optional(),type:v(\"object\")}),outputSchema:V({$schema:p().optional()}).optional(),annotations:hr.optional(),_meta:j(p(),L()).optional()}),kn=g({type:v(\"tool_result\"),toolUseId:p(),content:R(Lt),structuredContent:L().optional(),isError:U().optional(),_meta:j(p(),L()).optional()}),co=q([mt,nt,mr,nn,kn]),zr=g({role:i,content:q([co,R(co)]),_meta:j(p(),L()).optional()}),uo=p(),lo=V({[Kt]:re.optional().catch(void 0)}),po=lo.optional();function Ne(xe){return V({_meta:po,resultType:uo.default(\"complete\"),...xe})}let Rn=Ne({}),Ea=Ne({nextCursor:o.optional()}),mo=Ne({content:R(Lt),structuredContent:L().optional(),isError:U().optional()}),Pn=Ne({ttlMs:E().int().min(0),cacheScope:W([\"public\",\"private\"]),tools:R(Sr),nextCursor:o.optional()}),Tn=Ne({ttlMs:E().int().min(0),cacheScope:W([\"public\",\"private\"]),prompts:R(dr),nextCursor:o.optional()}),En=Ne({description:p().optional(),messages:R(so)}),In=Ne({ttlMs:E().int().min(0),cacheScope:W([\"public\",\"private\"]),resources:R(qt),nextCursor:o.optional()}),On=Ne({ttlMs:E().int().min(0),cacheScope:W([\"public\",\"private\"]),resourceTemplates:R(to),nextCursor:o.optional()}),Cn=Ne({ttlMs:E().int().min(0),cacheScope:W([\"public\",\"private\"]),contents:R(q([Mt,pr]))}),Zn=Ne({completion:g({values:R(p()).max(100),total:E().int().optional(),hasMore:U().optional()}).loose()}),Ia=Ne({ttlMs:E().int().min(0),cacheScope:W([\"public\",\"private\"])}),Nn=Ne({ttlMs:E().int().min(0).catch(0),cacheScope:W([\"public\",\"private\"]).catch(\"private\"),supportedVersions:R(p()),capabilities:io,instructions:p().optional()}),Dt=g({messages:R(zr),modelPreferences:ln.optional(),systemPrompt:p().optional(),includeContext:W([\"none\",\"thisServer\",\"allServers\"]).optional(),temperature:E().optional(),maxTokens:E().int(),stopSequences:R(p()).optional(),metadata:t.optional(),tools:R(Sr).optional(),toolChoice:pn.optional()}),An=g({method:v(\"sampling/createMessage\"),params:Dt}),jn=g({method:v(\"roots/list\"),params:g({_meta:j(p(),L()).optional()}).optional()}),Mn=g({...zr.shape,model:p(),stopReason:p().optional()}),qn=g({roots:R(wn)}),Ln=g({action:W([\"accept\",\"decline\",\"cancel\"]),content:j(p(),q([p(),E(),U(),R(p())])).optional()}),Un=g({mode:v(\"url\"),message:p(),url:p().url()}),Dn=q([fr,Un]),Fn=g({method:v(\"elicitation/create\"),params:Dn}),Vn=q([An,jn,Fn]),Jn=q([Mn,qn,Ln]),Hn=j(p(),Vn),Bn=j(p(),Jn),br=Ne({inputRequests:Hn.optional(),requestState:p().optional()}),yr={inputResponses:Bn.optional(),requestState:p().optional()},Oa=g({_meta:ao,...yr}),Ca=V({progressToken:r.optional()});function We(xe,xr){return g({method:v(xe),params:g({_meta:ao,...xr})})}function Ge(xe,xr){return g({method:v(xe),params:g({_meta:Ca.optional(),...xr}).optional()})}let Wn={name:p(),arguments:j(p(),L()).optional(),...yr},st={cursor:o.optional()},Za=We(\"tools/call\",Wn),Na=We(\"tools/list\",st),Aa=We(\"prompts/list\",st),ja=We(\"prompts/get\",{name:p(),arguments:j(p(),p()).optional(),...yr}),Ma=We(\"resources/list\",st),qa=We(\"resources/templates/list\",st),La=We(\"resources/read\",{uri:p(),...yr}),Gn={ref:q([_r,gr]),argument:g({name:p(),value:p()}),context:g({arguments:j(p(),p()).optional()}).optional()},Ua=We(\"completion/complete\",Gn),Da=We(\"server/discover\",{}),ho=g({toolsListChanged:U().optional(),promptsListChanged:U().optional(),resourcesListChanged:U().optional(),resourceSubscriptions:R(p()).optional()}),Kn={notifications:ho},Fa=We(\"subscriptions/listen\",Kn),Va=lo.extend({\"io.modelcontextprotocol/subscriptionId\":n}),Ja=V({_meta:Va,resultType:uo.default(\"complete\")}),Ft={\"tools/call\":Ge(\"tools/call\",Wn),\"tools/list\":Ge(\"tools/list\",st),\"prompts/get\":Ge(\"prompts/get\",{name:p(),arguments:j(p(),p()).optional()}),\"prompts/list\":Ge(\"prompts/list\",st),\"resources/list\":Ge(\"resources/list\",st),\"resources/templates/list\":Ge(\"resources/templates/list\",st),\"resources/read\":Ge(\"resources/read\",{uri:p()}),\"completion/complete\":Ge(\"completion/complete\",Gn),\"server/discover\":Ge(\"server/discover\",{}),\"subscriptions/listen\":Ge(\"subscriptions/listen\",Kn)};function Fe(xe){return V({_meta:po,...xe})}let Ha={\"tools/call\":Fe({content:R(Lt),structuredContent:L().optional(),isError:U().optional()}),\"tools/list\":Fe({ttlMs:E().int().min(0),cacheScope:W([\"public\",\"private\"]),tools:R(Sr),nextCursor:o.optional()}),\"prompts/get\":Fe({description:p().optional(),messages:R(so)}),\"prompts/list\":Fe({ttlMs:E().int().min(0),cacheScope:W([\"public\",\"private\"]),prompts:R(dr),nextCursor:o.optional()}),\"resources/list\":Fe({ttlMs:E().int().min(0),cacheScope:W([\"public\",\"private\"]),resources:R(qt),nextCursor:o.optional()}),\"resources/templates/list\":Fe({ttlMs:E().int().min(0),cacheScope:W([\"public\",\"private\"]),resourceTemplates:R(to),nextCursor:o.optional()}),\"resources/read\":Fe({ttlMs:E().int().min(0),cacheScope:W([\"public\",\"private\"]),contents:R(q([Mt,pr]))}),\"completion/complete\":Fe({completion:g({values:R(p()).max(100),total:E().int().optional(),hasMore:U().optional()}).loose()}),\"server/discover\":Fe({ttlMs:E().int().min(0).catch(0),cacheScope:W([\"public\",\"private\"]).catch(\"private\"),supportedVersions:R(p()),capabilities:io,instructions:p().optional()}),\"subscriptions/listen\":Fe({})},vr=V({\"io.modelcontextprotocol/subscriptionId\":n.optional()}),fo=g({method:v(\"notifications/subscriptions/acknowledged\"),params:g({_meta:vr.optional(),notifications:ho})}),go=g({_meta:vr.optional(),requestId:n,reason:p().optional()}),_o=g({method:v(\"notifications/cancelled\"),params:go}),Nu={\"notifications/cancelled\":_o,\"notifications/progress\":lr,\"notifications/message\":on,\"notifications/resources/updated\":ro,\"notifications/resources/list_changed\":xt,\"notifications/tools/list_changed\":cn,\"notifications/prompts/list_changed\":no,\"notifications/subscriptions/acknowledged\":fo},Ve=(xe)=>g({jsonrpc:v(\"2.0\"),id:q([p(),E().int()]),result:xe}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:i,LoggingLevelSchema:s,TaskMetadataSchema:c,RelatedTaskMetadataSchema:u,RequestMetaSchema:l,BaseRequestParamsSchema:m,TaskAugmentedRequestParamsSchema:h,NotificationsParamsSchema:f,NotificationSchema:b,IconSchema:I,IconsSchema:x,BaseMetadataSchema:J,ImplementationSchema:re,ClientTasksCapabilitySchema:N,ServerTasksCapabilitySchema:K,ClientCapabilitiesSchema:de,ServerCapabilitiesSchema:Be,ProgressSchema:Me,ProgressNotificationParamsSchema:jt,ProgressNotificationSchema:lr,LoggingMessageNotificationParamsSchema:rn,LoggingMessageNotificationSchema:on,ResourceContentsSchema:eo,TextResourceContentsSchema:Mt,BlobResourceContentsSchema:pr,AnnotationsSchema:dt,ResourceSchema:qt,ResourceTemplateSchema:to,ResourceListChangedNotificationSchema:xt,ResourceUpdatedNotificationParamsSchema:wt,ResourceUpdatedNotificationSchema:ro,PromptArgumentSchema:oo,PromptSchema:dr,PromptListChangedNotificationSchema:no,TextContentSchema:mt,ImageContentSchema:nt,AudioContentSchema:mr,ToolUseContentSchema:nn,EmbeddedResourceSchema:sn,ResourceLinkSchema:an,ContentBlockSchema:Lt,PromptMessageSchema:so,ToolAnnotationsSchema:hr,ToolListChangedNotificationSchema:cn,ModelHintSchema:un,ModelPreferencesSchema:ln,ToolChoiceSchema:pn,BooleanSchemaSchema:dn,StringSchemaSchema:mn,NumberSchemaSchema:hn,UntitledSingleSelectEnumSchemaSchema:fn,TitledSingleSelectEnumSchemaSchema:gn,LegacyTitledEnumSchemaSchema:_n,SingleSelectEnumSchemaSchema:Sn,UntitledMultiSelectEnumSchemaSchema:zn,TitledMultiSelectEnumSchemaSchema:bn,MultiSelectEnumSchemaSchema:yn,EnumSchemaSchema:vn,PrimitiveSchemaDefinitionSchema:xn,ElicitRequestFormParamsSchema:fr,ResourceTemplateReferenceSchema:gr,PromptReferenceSchema:_r,RootSchema:wn,ClientCapabilities2026Schema:$n,ServerCapabilities2026Schema:io,RequestMetaEnvelopeSchema:ao,ToolSchema:Sr,ToolResultContentSchema:kn,SamplingMessageContentBlockSchema:co,SamplingMessageSchema:zr,ResultTypeSchema:uo,ResultMetaSchema:lo,ResultSchema:Rn,PaginatedResultSchema:Ea,CallToolResultSchema:mo,ListToolsResultSchema:Pn,ListPromptsResultSchema:Tn,GetPromptResultSchema:En,ListResourcesResultSchema:In,ListResourceTemplatesResultSchema:On,ReadResourceResultSchema:Cn,CompleteResultSchema:Zn,CacheableResultSchema:Ia,DiscoverResultSchema:Nn,CreateMessageRequestParamsSchema:Dt,CreateMessageRequestSchema:An,ListRootsRequestSchema:jn,CreateMessageResultSchema:Mn,ListRootsResultSchema:qn,ElicitResultSchema:Ln,ElicitRequestURLParamsSchema:Un,ElicitRequestParamsSchema:Dn,ElicitRequestSchema:Fn,InputRequestSchema:Vn,InputResponseSchema:Jn,InputRequestsSchema:Hn,InputResponsesSchema:Bn,InputRequiredResultSchema:br,InputResponseRequestParamsSchema:Oa,CallToolRequestSchema:Za,ListToolsRequestSchema:Na,ListPromptsRequestSchema:Aa,GetPromptRequestSchema:ja,ListResourcesRequestSchema:Ma,ListResourceTemplatesRequestSchema:qa,ReadResourceRequestSchema:La,CompleteRequestSchema:Ua,DiscoverRequestSchema:Da,SubscriptionFilterSchema:ho,SubscriptionsListenRequestSchema:Fa,SubscriptionsListenResultMetaSchema:Va,SubscriptionsListenResultSchema:Ja,dispatchRequestSchemas:Ft,dispatchResultSchemas:Ha,NotificationMetaSchema:vr,SubscriptionsAcknowledgedNotificationSchema:fo,CancelledNotificationParamsSchema:go,CancelledNotificationSchema:_o,notificationSchemas2026:Nu,JSONRPCResultResponseSchema:Ve(Rn),CallToolResultResponseSchema:Ve(q([mo,br])),ListToolsResultResponseSchema:Ve(Pn),ListPromptsResultResponseSchema:Ve(Tn),GetPromptResultResponseSchema:Ve(q([En,br])),ListResourcesResultResponseSchema:Ve(In),ListResourceTemplatesResultResponseSchema:Ve(On),ReadResourceResultResponseSchema:Ve(q([Cn,br])),CompleteResultResponseSchema:Ve(Zn),DiscoverResultResponseSchema:Ve(Nn)}}var f0;function Wr(){return f0??=h0()}var g0=[\"tools/list\",\"prompts/list\",\"resources/list\",\"resources/templates/list\",\"resources/read\",\"server/discover\"];function _0(e){return g0.includes(e)}var Gp=Symbol(\"modelcontextprotocol.resultCacheHintFallback\");function S0(e){return e[Gp]}function yy(e){return typeof e===\"number\"&&Number.isSafeInteger(e)&&e>=0}function vy(e){return e===\"public\"||e===\"private\"}var F=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}({}),Ce=class e extends Error{static{Object.defineProperty(this,\"mcpBrand\",{value:\"mcp.ProtocolError\"})}static[Symbol.hasInstance](t){return Xe(this,t)}static isInstance(t){if(typeof this!==\"function\")throw TypeError(\"isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`\");return Xe(this,t)}constructor(t,r,o){super(r);this.code=t,this.data=o,this.name=\"ProtocolError\",Gr(this,new.target)}static fromError(t,r,o){if(t===F.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new wy(n.elicitations,r)}if(t===F.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested===\"string\")return new $y({supported:n.supported,requested:n.requested},r)}if(t===F.InvalidParams||t===F.ResourceNotFound){let n=o;if(typeof n?.uri===\"string\"&&(t===F.ResourceNotFound||Object.keys(n).length===1))return new xy(n.uri,r)}if(t===F.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities===\"object\"&&!Array.isArray(n.requiredCapabilities))return new ky({requiredCapabilities:n.requiredCapabilities},r)}return new e(t,r,o)}},xy=class extends Ce{static{Object.defineProperty(this,\"mcpBrand\",{value:\"mcp.ResourceNotFoundError\"})}constructor(e,t=`Resource not found: ${e}`){super(F.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},wy=class extends Ce{static{Object.defineProperty(this,\"mcpBrand\",{value:\"mcp.UrlElicitationRequiredError\"})}constructor(e,t=`URL elicitation${e.length>1?\"s\":\"\"} required`){super(F.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},$y=class extends Ce{static{Object.defineProperty(this,\"mcpBrand\",{value:\"mcp.UnsupportedProtocolVersionError\"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(F.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},ky=class extends Ce{static{Object.defineProperty(this,\"mcpBrand\",{value:\"mcp.MissingRequiredClientCapabilityError\"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(\", \")}`){super(F.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},z0=0,b0=\"private\",y0=[\"tools/call\",\"prompts/get\",\"resources/read\"];function v0(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:\"complete\"};if(r===\"complete\")return t;if(y0.includes(e))return t;throw new Ce(F.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function x0(e,t){let r=S0(t);if(t.resultType!==\"complete\"||!_0(e))return r===void 0?t:P0(t);let o=t,n=yy(o.ttlMs)?o.ttlMs:k0(r),i=vy(o.cacheScope)?o.cacheScope:R0(r),s={...o,ttlMs:n,cacheScope:i};return delete s[Gp],s}function w0(e){return e!==null&&typeof e===\"object\"&&!Array.isArray(e)}function $0(e,t){if(t===void 0)return e;let r=e._meta;if(r===void 0)return{...e,_meta:{[Kt]:t}};if(!w0(r))return e;if(r[Kt]!==void 0)return e;return{...e,_meta:{...r,[Kt]:t}}}function k0(e){return e!==void 0&&yy(e.ttlMs)?e.ttlMs:z0}function R0(e){return e!==void 0&&vy(e.cacheScope)?e.cacheScope:b0}function P0(e){let t={...e};return delete t[Gp],t}var T0=[\"elicitation/create\",\"sampling/createMessage\",\"roots/list\"],mu;function Ry(){if(mu)return mu;let e=Wr();return mu={request:{\"elicitation/create\":g({method:v(\"elicitation/create\"),params:e.ElicitRequestParamsSchema}),\"sampling/createMessage\":g({method:v(\"sampling/createMessage\"),params:e.CreateMessageRequestParamsSchema}),\"roots/list\":g({method:v(\"roots/list\"),params:V({}).optional()})},response:{\"elicitation/create\":e.ElicitResultSchema,\"sampling/createMessage\":e.CreateMessageResultSchema,\"roots/list\":e.ListRootsResultSchema}},mu}function Py(e){return T0.includes(e)}function Ap(e){return Py(e)?Ry().request[e]:void 0}function E0(e){return Py(e)?Ry().response[e]:void 0}var Kp={\"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},Ty={\"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 Ey(e){return Object.prototype.hasOwnProperty.call(Kp,e)}function Iy(e){return Object.prototype.hasOwnProperty.call(Ty,e)}function I0(e){return Object.prototype.hasOwnProperty.call(Kp,e)}function O0(e){return Ey(e)?Wr().dispatchRequestSchemas[e]:void 0}function C0(e){return I0(e)?Wr().dispatchResultSchemas[e]:void 0}function Z0(e){return Iy(e)?Wr().notificationSchemas2026[e]:void 0}var lA=Object.keys(Kp),pA=Object.keys(Ty);function pa(e){return e!==null&&typeof e===\"object\"&&!Array.isArray(e)}function ua(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 N0={ok:!1,reason:\"not-in-era\"},A0=[Pr,Tr];function j0(e,t){let r=t,o=!1,n=()=>{if(!o)r={...r},o=!0;return r},i=t.tools;if(e===\"tools/list\"&&Array.isArray(i)&&i.some((a)=>pa(a)&&(\"execution\"in a)))n().tools=i.map((a)=>{if(!pa(a)||!(\"execution\"in a))return a;let c={...a};return delete c.execution,c});let s=t.capabilities;if(pa(s)&&\"tasks\"in s){let a={...s};delete a.tasks,n().capabilities=a}return r}var Yp={era:\"2026-07-28\",hasRequestMethod:Ey,hasNotificationMethod:Iy,hasInputRequestMethod:(e)=>Ap(e)!==void 0,validateRequest:(e,t)=>ua(O0(e),t),validateResult:(e,t)=>ua(C0(e),t),validateNotification:(e,t)=>ua(Z0(e),t),validateInputRequest:(e,t)=>ua(Ap(e),t),validateInputResponse:(e,t)=>ua(E0(e),t),samplingResultVariant:()=>N0,outboundEnvelope(e){return{[Pr]:e.protocolVersion,[vo]:e.clientInfo,[Tr]:e.clientCapabilities,...e.logLevel!==void 0&&{[xo]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of A0)if(!(o in e))t.push({key:o,problem:\"missing\"});let r=Wr().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let o of r.error.issues){let n=o.path.map(String),i=n.length>0?n.join(\".\"):\"_meta\";if(n.length===1&&t.some((s)=>s.key===i&&s.problem===\"missing\"))continue;t.push({key:i,problem:o.message})}return t},projectCallToolResult:(e)=>my(e),inputRequestSchema:Ap,decodeResult(e,t){if(!pa(t))return{kind:\"invalid\",error:new ke(Oe.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:\"invalid\",error:new ke(Oe.InvalidResult,`Invalid result for ${e}: missing required resultType — 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 ke(Oe.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r===\"input_required\"){let s=t.inputRequests,a=pa(s)?s:{},c=t.requestState;if(Object.keys(a).length===0&&typeof c!==\"string\")return{kind:\"invalid\",error:new ke(Oe.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\"})};return{kind:\"input_required\",inputRequests:a,...typeof c===\"string\"&&{requestState:c}}}if(r!==\"complete\")return{kind:\"invalid\",error:new ke(Oe.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=M0(),n=Object.hasOwn(o,e)?o[e]:void 0;if(n!==void 0){let s=n.safeParse(t);if(!s.success)return{kind:\"invalid\",error:new ke(Oe.InvalidResult,`Invalid result for ${e}: ${s.error}`,{method:e})}}let i={...t};return delete i.resultType,{kind:\"complete\",result:i}},encodeResult(e,t,r){return $0(x0(e,v0(e,j0(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=Wr().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(\"; \")}`}},hu;function M0(){if(hu)return hu;let e=Wr();return hu={\"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},hu}var Qp=\"2026-07-28\";function ma(e){return e!==void 0&&dy(e)?Yp:Wp}function iy(e){if(e.revision!==void 0)return ma(e.revision).era;return e.era===\"modern\"?Yp.era:Wp.era}function jp(e){return Oy.some((t)=>t.hasRequestMethod(e))}function Mp(e){return Oy.some((t)=>t.hasNotificationMethod(e))}var Oy=[Wp,Yp],q0=Jd({AnnotationsSchema:()=>_t,AudioContentSchema:()=>jr,BaseMetadataSchema:()=>ft,BaseRequestParamsSchema:()=>Pe,BlobResourceContentsSchema:()=>jo,BooleanSchemaSchema:()=>Uo,CallToolRequestParamsSchema:()=>ri,CallToolRequestSchema:()=>oi,CallToolResultSchema:()=>er,CancelTaskRequestSchema:()=>Oc,CancelTaskResultSchema:()=>Cc,CancelledNotificationParamsSchema:()=>ls,CancelledNotificationSchema:()=>Eo,ClientCapabilitiesSchema:()=>ds,ClientNotificationSchema:()=>Nc,ClientRequestSchema:()=>Zc,ClientResultSchema:()=>Ac,ClientTasksCapabilitySchema:()=>zc,CompatibilityCallToolResultSchema:()=>yc,CompleteRequestParamsSchema:()=>Ei,CompleteRequestSchema:()=>Ii,CompleteResultSchema:()=>Oi,ContentBlockSchema:()=>St,CreateMessageRequestParamsSchema:()=>fi,CreateMessageRequestSchema:()=>gi,CreateMessageResultSchema:()=>_i,CreateMessageResultWithToolsSchema:()=>Si,CreateTaskResultSchema:()=>wc,CursorSchema:()=>$o,DiscoverRequestSchema:()=>_s,DiscoverResultSchema:()=>Oo,ElicitRequestFormParamsSchema:()=>Dr,ElicitRequestParamsSchema:()=>xi,ElicitRequestSchema:()=>wi,ElicitRequestURLParamsSchema:()=>vi,ElicitResultSchema:()=>Ri,ElicitationCompleteNotificationParamsSchema:()=>$i,ElicitationCompleteNotificationSchema:()=>ki,EmbeddedResourceSchema:()=>Mr,EmptyResultSchema:()=>Qt,EnumSchemaSchema:()=>yi,GetPromptRequestParamsSchema:()=>Hs,GetPromptRequestSchema:()=>Bs,GetPromptResultSchema:()=>Ks,GetTaskPayloadRequestSchema:()=>Pc,GetTaskPayloadResultSchema:()=>Tc,GetTaskRequestSchema:()=>kc,GetTaskResultSchema:()=>Rc,IconSchema:()=>ps,IconsSchema:()=>Rt,ImageContentSchema:()=>Ar,ImplementationSchema:()=>gt,InitializeRequestParamsSchema:()=>ms,InitializeRequestSchema:()=>hs,InitializeResultSchema:()=>fs,InitializedNotificationSchema:()=>gs,JSONArraySchema:()=>_c,JSONObjectSchema:()=>ze,JSONRPCErrorResponseSchema:()=>Or,JSONRPCMessageSchema:()=>Cr,JSONRPCNotificationSchema:()=>To,JSONRPCRequestSchema:()=>Po,JSONRPCResponseSchema:()=>Sc,JSONRPCResultResponseSchema:()=>Ir,JSONValueSchema:()=>kt,LegacyTitledEnumSchemaSchema:()=>Vo,ListChangedOptionsBaseSchema:()=>vc,ListPromptsRequestSchema:()=>Vs,ListPromptsResultSchema:()=>Js,ListResourceTemplatesRequestSchema:()=>ws,ListResourceTemplatesResultSchema:()=>$s,ListResourcesRequestSchema:()=>vs,ListResourcesResultSchema:()=>xs,ListRootsRequestSchema:()=>Zi,ListRootsResultSchema:()=>Ni,ListTasksRequestSchema:()=>Ec,ListTasksResultSchema:()=>Ic,ListToolsRequestSchema:()=>ei,ListToolsResultSchema:()=>ti,LoggingLevelSchema:()=>Lo,LoggingMessageNotificationParamsSchema:()=>ai,LoggingMessageNotificationSchema:()=>ci,ModelHintSchema:()=>ui,ModelPreferencesSchema:()=>li,MultiSelectEnumSchemaSchema:()=>bi,NotificationSchema:()=>Ee,NotificationsParamsSchema:()=>je,NumberSchemaSchema:()=>Ur,PaginatedRequestParamsSchema:()=>bs,PaginatedRequestSchema:()=>Pt,PaginatedResultSchema:()=>Tt,PingRequestSchema:()=>Co,PrimitiveSchemaDefinitionSchema:()=>Bo,ProgressNotificationParamsSchema:()=>zs,ProgressNotificationSchema:()=>Zo,ProgressSchema:()=>Ss,ProgressTokenSchema:()=>wo,PromptArgumentSchema:()=>Ds,PromptListChangedNotificationSchema:()=>Ys,PromptMessageSchema:()=>Gs,PromptReferenceSchema:()=>Ti,PromptSchema:()=>Fs,ReadResourceRequestParamsSchema:()=>ks,ReadResourceRequestSchema:()=>Rs,ReadResourceResultSchema:()=>Ps,RelatedTaskMetadataSchema:()=>us,RequestIdSchema:()=>ct,RequestMetaSchema:()=>ko,RequestSchema:()=>be,ResourceContentsSchema:()=>No,ResourceLinkSchema:()=>qr,ResourceListChangedNotificationSchema:()=>Ts,ResourceRequestParamsSchema:()=>Zr,ResourceSchema:()=>Mo,ResourceTemplateReferenceSchema:()=>Pi,ResourceTemplateSchema:()=>ys,ResourceUpdatedNotificationParamsSchema:()=>Ls,ResourceUpdatedNotificationSchema:()=>Us,ResultMetaObjectSchema:()=>Ro,ResultSchema:()=>ye,RoleSchema:()=>Et,RootSchema:()=>Ci,RootsListChangedNotificationSchema:()=>Ai,SamplingContentSchema:()=>mi,SamplingMessageContentBlockSchema:()=>Gt,SamplingMessageSchema:()=>hi,ServerCapabilitiesSchema:()=>Io,ServerNotificationSchema:()=>Mc,ServerRequestSchema:()=>jc,ServerResultSchema:()=>qc,ServerTasksCapabilitySchema:()=>bc,SetLevelRequestParamsSchema:()=>si,SetLevelRequestSchema:()=>ii,SingleSelectEnumSchemaSchema:()=>zi,StringSchemaSchema:()=>Lr,SubscribeRequestParamsSchema:()=>Es,SubscribeRequestSchema:()=>Is,SubscriptionFilterSchema:()=>qo,SubscriptionsAcknowledgedNotificationParamsSchema:()=>As,SubscriptionsAcknowledgedNotificationSchema:()=>js,SubscriptionsListenRequestParamsSchema:()=>Zs,SubscriptionsListenRequestSchema:()=>Ns,SubscriptionsListenResultMetaSchema:()=>Ms,SubscriptionsListenResultSchema:()=>qs,TaskAugmentedRequestParamsSchema:()=>Yt,TaskCreationParamsSchema:()=>xc,TaskMetadataSchema:()=>cs,TaskSchema:()=>It,TaskStatusNotificationParamsSchema:()=>Mi,TaskStatusNotificationSchema:()=>$c,TaskStatusSchema:()=>ji,TextContentSchema:()=>Nr,TextResourceContentsSchema:()=>Ao,TitledMultiSelectEnumSchemaSchema:()=>Ho,TitledSingleSelectEnumSchemaSchema:()=>Fo,ToolAnnotationsSchema:()=>Qs,ToolChoiceSchema:()=>pi,ToolExecutionSchema:()=>Xs,ToolListChangedNotificationSchema:()=>ni,ToolResultContentSchema:()=>di,ToolSchema:()=>Xt,ToolUseContentSchema:()=>Ws,UnsubscribeRequestParamsSchema:()=>Os,UnsubscribeRequestSchema:()=>Cs,UntitledMultiSelectEnumSchemaSchema:()=>Jo,UntitledSingleSelectEnumSchemaSchema:()=>Do});var Cy=(e)=>Po.safeParse(e).success,Zy=(e)=>To.safeParse(e).success,Fp=(e)=>Ir.safeParse(e).success,Ny=(e)=>Or.safeParse(e).success;var da=-32020,dA=[{rung:\"http-method\",order:1,evaluatedAt:\"edge\",codes:[-32000],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:[F.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:[da,F.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:[F.InvalidParams],conformance:[\"server-stateless\"],rationale:\"A present envelope claim with a malformed envelope — and a missing envelope on a request whose protocol-version header names a modern revision — 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:[F.MethodNotFound],conformance:[\"server-stateless\"],rationale:\"Method existence outranks parameter validity: a method absent from the negotiated revision’s 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:[F.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:[da],conformance:[\"http-header-validation\"],rationale:\"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier’s 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–6) are consulted.\"},{rung:\"client-capabilities\",order:8,evaluatedAt:\"pre-dispatch\",codes:[F.MissingRequiredClientCapability],conformance:[\"server-stateless\"],rationale:\"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced — 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:[da],conformance:[\"http-custom-header-server-validation\"],rationale:\"SEP-2243 `Mcp-Param-*` headers are validated against the named tool’s `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.\"}],mA={[F.ParseError]:400,[F.InvalidRequest]:400,[F.MethodNotFound]:404,[F.UnsupportedProtocolVersion]:400,[F.MissingRequiredClientCapability]:400,[da]:400};function Xp(e,t){return au(e,t)}function la(e){return new Set(e.flatMap((t)=>Object.keys(t.shape)))}function Vp(e){if(e==null)return!1;let t=typeof e;if(t!==\"object\"&&t!==\"function\")return!1;if(!(\"~standard\"in e))return!1;return typeof e[\"~standard\"]?.validate===\"function\"}var ay=!1,Jp=\"draft-2020-12\";function L0(e,t=\"input\"){let r=e[\"~standard\"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:Jp});else if(r.vendor===\"zod\"){if(!(\"_zod\"in e))throw 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().\");if(!ay)ay=!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=iu(e,{target:Jp,io:t})}else throw 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\"){if(o.type!==void 0)return o;return Ay(o)?{type:\"object\",...o}:o}if(o.type!==void 0&&o.type!==\"object\")throw 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 Ay(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\"||Ay(o)))}return!1}function U0(e){if(!e.path?.length)return e.message;return`${e.path.map((t)=>String(typeof t===\"object\"?t.key:t)).join(\".\")}: ${e.message}`}async function qp(e,t){let r=await e[\"~standard\"].validate(t);if(r.issues&&r.issues.length>0)return{success:!1,error:r.issues.map((o)=>U0(o)).join(\", \")};return{success:!0,data:r.value}}function D0(e){let t=iu(e,{target:Jp,io:\"input\"});return typeof t.pattern===\"string\"?t.pattern:void 0}var F0=/\\\\\\.\\\\d\\{(\\d+)\\}/;function V0(e){let t=F0.exec(e),r=[void 0,-1,0];if(t)r.push(Number(t[1]));return[!1,!0].flatMap((o)=>[!1,!0].flatMap((n)=>r.map((i)=>aa({local:o,offset:n,precision:i}))))}function J0(e,t){let r;switch(e){case\"email\":r=[Hb()];break;case\"uri\":r=[Wb()];break;case\"date\":r=[Ip()];break;case\"date-time\":r=V0(t);break}return new Set(r.map((o)=>D0(o)).filter((o)=>o!==void 0))}function H0(e,t,r){if(r!==\"zod\")return!0;return J0(e,t).has(t)}function ha(e){return typeof e===\"object\"&&e!==null&&!Array.isArray(e)}function B0(e){try{return L0(e,\"input\")}catch(t){let r=t instanceof Error?t.message:String(t);throw new Ce(F.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var W0=new Set([\"$comment\",\"deprecated\",\"description\",\"examples\",\"readOnly\",\"title\",\"writeOnly\"]);function ed(e){return W0.has(e)||e.startsWith(\"x-\")}var G0=new Set([\"$schema\",...Object.keys(Dr.shape.requestedSchema.shape)]),cy={string:la([Lr,Do,Fo,Vo]),number:la([Ur]),integer:la([Ur]),boolean:la([Uo]),array:la([Jo,Ho])},K0=new Set(Lr.shape.format.unwrap().options);function Y0(e,t,r,o){if(!ha(e))return e;let n=typeof e.type===\"string\"&&Object.hasOwn(cy,e.type)?cy[e.type]:void 0;if(n===void 0)return e;let i={};for(let[s,a]of Object.entries(e))if(n.has(s)||ed(s))i[s]=a;else if(s===\"pattern\"&&e.type===\"string\"&&typeof e.format===\"string\"){if(!K0.has(e.format))i[s]=a;else if(typeof a!==\"string\"||!H0(e.format,a,r))o.push(`${t}.${s}`)}else o.push(`${t}.${s}`);return i}function Q0(e,t){let r={},o=[];for(let[n,i]of Object.entries(e))if(n===\"properties\"&&ha(i))r[n]=Object.fromEntries(Object.entries(i).map(([s,a])=>[s,Y0(a,`properties.${s}`,t,o)]));else if(G0.has(n))r[n]=i;else if(!ed(n))o.push(n);if(o.length>0)throw new Ce(F.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(\", \")}`);return r}function X0(e,t){if(!ha(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!Xp(Bo,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(\", \"):t}function Hp(e,t,r=\"\"){if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((o,n)=>Hp(o,t[n],`${r}[${n}]`));if(!ha(e)||!ha(t))return[];return Object.entries(e).flatMap(([o,n])=>{let i=r?`${r}.${o}`:o;if(!Object.prototype.hasOwnProperty.call(t,o))return ed(o)?[]:[i];return Hp(n,t[o],i)})}function eT(e){if(!Vp(e.requestedSchema))return{...e,mode:\"form\",requestedSchema:e.requestedSchema};let t=e.requestedSchema[\"~standard\"].vendor,r=Q0(B0(e.requestedSchema),t),o=Xp(Dr.shape.requestedSchema,r);if(!o.success)throw new Ce(F.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${X0(r,o.error.message)}`);let n=Hp(r,o.data);if(n.length>0)throw new Ce(F.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(\", \")}`);let i=(o.data.required??[]).filter((s)=>!Object.prototype.hasOwnProperty.call(o.data.properties,s));if(i.length>0)throw new Ce(F.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${i.join(\", \")}`);return{...e,mode:\"form\",requestedSchema:o.data}}function tT(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState===\"string\";if(!t&&!r)throw 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 hA=Object.assign(tT,{elicit(e){try{return{method:\"elicitation/create\",params:eT(e)}}catch(t){throw t instanceof Ce?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 rT=[\"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\"],oT={IdJagTokenExchangeResponseSchema:Fi,OAuthClientInformationFullSchema:Bi,OAuthClientInformationSchema:Hi,OAuthClientMetadataSchema:Ji,OAuthClientRegistrationErrorSchema:Lc,OAuthErrorResponseSchema:Vi,OAuthMetadataSchema:Wo,OAuthProtectedResourceMetadataSchema:qi,OAuthTokenRevocationRequestSchema:Uc,OAuthTokensSchema:Di,OpenIdProviderDiscoveryMetadataSchema:Ui,OpenIdProviderMetadataSchema:Li},jy={},My={};function qy(e,t){let r=e.slice(0,-6);jy[r]=t,My[r]=(o)=>t.safeParse(o).success}for(let e of rT)qy(e,q0[e]);for(let[e,t]of Object.entries(oT))qy(e,t);var nT=Object.freeze(jy),sT=Object.freeze(My);function iT(e){switch(e){case\"initialize\":case\"notifications/initialized\":return ma(void 0);case\"server/discover\":return ma(Qp);default:return}}var Ly=60000,aT=[Pr,vo,Tr,xo],cT=[\"inputResponses\",\"requestState\"];function uy(e,t){let r=e.params;if(!Lp(r))return{message:e,lifted:{}};let o=r._meta,n=Lp(o)?aT.filter((c)=>(c in o)):[],i=t===\"request\"?cT.filter((c)=>(c in r)):[];if(n.length===0&&i.length===0)return{message:e,lifted:{}};let s={},a={...r};if(n.length>0&&Lp(o)){let c={},u={...o};for(let l of n)c[l]=o[l],delete u[l];if(s.envelope=c,Object.keys(u).length>0)a._meta=u;else delete a._meta}for(let c of i){if(c===\"inputResponses\")s.inputResponses=a[c];if(c===\"requestState\")s.requestState=a[c];delete a[c]}return{message:{...e,params:a},lifted:s}}function ly(e,t){let r=e.validateResult(t,void 0);if(!r.ok&&r.reason===\"not-in-era\")return;return{\"~standard\":{version:1,vendor:\"mcp-wire-codec\",validate(o){let n=e.validateResult(t,o);if(n.ok)return{value:n.value};return{issues:[{message:n.reason===\"invalid\"?n.message:`not-in-era: ${t}`}]}}}}}function Uy(e){return()=>e}var uT=Uy(void 0),lT,td=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{lT=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??hc,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 ke(Oe.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){if(!e.params.requestId)return;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 ke(Oe.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);if(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,i)=>{if(o?.(n,i),Fp(n)||Ny(n))this._onresponse(n);else if(Cy(n))this._onrequest(n,i);else if(Zy(n))this._onnotification(n,i);else this._onerror(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 ke(Oe.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}=uy(e,\"notification\"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===\"drop\")return;if(t?.classification!==void 0){let s=iy(t.classification);if(s!==o.era){this._onerror(Error(`Era mismatch on inbound notification '${r.method}': classified as ${s} but this instance serves ${o.era}`));return}}if(Mp(r.method)&&!o.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),i=this.fallbackNotificationHandler;if(n===void 0&&i===void 0)return;Promise.resolve().then(()=>n===void 0?i(r):n(r,o)).catch((s)=>this._onerror(Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){let{message:r,lifted:o}=uy(e,\"request\"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===\"drop\"){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let i=this._transport,s=(I,x,J)=>{let re={jsonrpc:\"2.0\",id:r.id,error:{code:I,message:x,...J!==void 0&&{data:J}}};i?.send(re).catch((M)=>this._onerror(Error(`Failed to send an error response: ${M}`)))};if(t?.classification!==void 0){let I=iy(t.classification);if(I!==n.era){this._onerror(Error(`Era mismatch on inbound request '${r.method}': classified as ${I} but this instance serves ${n.era}`));let x=t.classification.revision??I;s(F.UnsupportedProtocolVersion,`Unsupported protocol version: ${x}`,{supported:this._supportedProtocolVersions,requested:x});return}}if(jp(r.method)&&!n.hasRequestMethod(r.method)){s(F.MethodNotFound,\"Method not found\");return}let a=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(a===void 0){s(F.MethodNotFound,\"Method not found\");return}let c=n.checkInboundEnvelope(o);if(c!==void 0){s(F.InvalidParams,c);return}let u=(I,x)=>this._notificationViaCodec(this._resolveOutboundCodec(I.method),I,{...x,relatedRequestId:r.id}),l=(I,x,J)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(I.method),I,x,{...J,relatedRequestId:r.id}),m=new AbortController;this._requestHandlerAbortControllers.set(r.id,m);let h=o.inputResponses===void 0?void 0:pT(o.inputResponses),f={sessionId:i?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},...h!==void 0&&{inputResponses:h.accepted},...h!==void 0&&h.droppedKeys.length>0&&{droppedInputResponseKeys:h.droppedKeys},requestState:o.requestState===void 0?uT:Uy(o.requestState),signal:m.signal,send:(I,x,J)=>{let re=this._resolveOutboundCodec(I.method);if(this._assertOutboundRequestInEra(re,I.method),Vp(x))return l(I,x,J);let M=ly(re,I.method);if(M===void 0)throw TypeError(`'${I.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return l(I,M,x)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},b=this.buildContext(f,t);Promise.resolve().then(()=>a(r,b)).then(async(I)=>{if(m.signal.aborted)return;let x;try{x=n.encodeResult(r.method,I,this._outboundServerInfo())}catch(re){this._onerror(Error(`Failed to encode result for ${r.method}: ${re}`)),s(F.InternalError,\"Internal error\");return}let J={result:x,jsonrpc:\"2.0\",id:r.id};await i?.send(J)},async(I)=>{if(m.signal.aborted)return;let x=Number.isSafeInteger(I.code)?I.code:F.InternalError,J={jsonrpc:\"2.0\",id:r.id,error:{code:n.encodeErrorCode(x),message:I.message??\"Internal error\",...I.data!==void 0&&{data:I.data}}};await i?.send(J)}).catch((I)=>this._onerror(Error(`Failed to send response: ${I}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(r.id)===m)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(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let i=this._responseHandlers.get(o),s=this._timeoutInfo.get(o);if(s&&i&&s.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(a){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),i(a);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Fp(e))r(e);else r(Ce.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),Vp(t))return this._requestWithSchemaViaCodec(o,e,t,r);let n=ly(o,e.method);if(n===void 0)throw 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 ma(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=iT(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(jp(t)&&!e.hasRequestMethod(t))throw new ke(Oe.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:i,onresumptiontoken:s,headers:a}=o??{},c=Date.now(),u,l;return new Promise((m,h)=>{let f=(K)=>{h(K)};if(!this._transport){f(Error(\"Not connected\"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(K){f(K);return}if(o?.signal?.aborted){let K=o.signal.reason;throw K instanceof ke?K:new ke(Oe.RequestTimeout,String(K))}let b=e.era===Qp&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,I=this._requestMessageId++;l=I;let x={...t,jsonrpc:\"2.0\",id:I};if(o?.onprogress)this._progressHandlers.set(I,o.onprogress),x.params={...t.params,_meta:{...t.params?._meta,progressToken:I}};let J=this._envelopeOutbound(x),re=!1,M=(K)=>{if(re)return;if(this._progressHandlers.delete(I),b===void 0)this._transport?.send(this._envelopeOutbound({jsonrpc:\"2.0\",method:\"notifications/cancelled\",params:{requestId:I,reason:String(K)}}),{relatedRequestId:n,resumptionToken:i,onresumptiontoken:s}).catch((de)=>this._onerror(Error(`Failed to send cancellation: ${de}`)));else b.abort();h(K instanceof ke?K:new ke(Oe.RequestTimeout,String(K)))};this._responseHandlers.set(I,(K)=>{if(o?.signal?.aborted)return;if(re=!0,K instanceof Error)return h(K);let de;try{de=e.decodeResult(t.method,K.result)}catch(Me){return h(Me instanceof Error?Me:Error(String(Me)))}if(de.kind===\"invalid\")return h(de.error);if(de.kind===\"input_required\"){if(o?.allowInputRequired===!0)return m(dT(de));let Me={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:c,retry:(jt,lr)=>this._requestWithSchemaViaCodec(e,jt===void 0?{method:t.method}:{method:t.method,params:jt},r,lr)};return m(this._resolveNonCompleteResult(de,Me))}let Be=de.result;qp(r,Be).then((Me)=>{if(Me.success)m(Me.data);else h(new ke(Oe.InvalidResult,`Invalid result for ${t.method}: ${Me.error}`))},h)}),u=()=>M(o?.signal?.reason),o?.signal?.addEventListener(\"abort\",u,{once:!0});let k=o?.timeout??Ly,N=()=>M(new ke(Oe.RequestTimeout,\"Request timed out\",{timeout:k}));this._setupTimeout(I,k,o?.maxTotalTimeout,N,o?.resetTimeoutOnProgress??!1),this._transport.send(J,{relatedRequestId:n,resumptionToken:i,onresumptiontoken:s,headers:a,requestSignal:b?.signal}).catch((K)=>{this._progressHandlers.delete(I),h(K)})}).finally(()=>{if(u)o?.signal?.removeEventListener(\"abort\",u);if(l!==void 0)this._responseHandlers.delete(l),this._cleanupTimeout(l)})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new ke(Oe.NotConnected,\"Not connected\");if(Mp(t.method)&&!e.hasNotificationMethod(t.method))throw new ke(Oe.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(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;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(!jp(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(n,i)=>{let s=this._negotiatedWireCodec(),a=s.validateRequest(e,n);if(!a.ok&&a.reason===\"not-in-era\")a=s.validateInputRequest(e,n);if(!a.ok){if(a.reason===\"not-in-era\")throw new Ce(F.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(a.message)}return Promise.resolve(t(a.value,i))}}else if(r)o=async(n,i)=>{let s=await qp(t.params,{...n.params});if(!s.success)throw new Ce(F.InvalidParams,`Invalid params for ${e}: ${s.error}`);return r(s.data,i)};else throw 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 Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if(typeof t===\"function\"){if(!Mp(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(o,n)=>{let i=n.validateNotification(e,o);if(!i.ok){if(i.reason===\"not-in-era\")throw new Ce(F.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(i.message)}return Promise.resolve(t(i.value))});return}if(!r)throw TypeError(\"setNotificationHandler: handler is required\");this._notificationHandlers.set(e,async(o)=>{let n=await qp(t.params,{...o.params});if(!n.success)throw new Ce(F.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Lp(e){return e!==null&&typeof e===\"object\"&&!Array.isArray(e)}function py(e){return typeof e===\"object\"&&e!==null&&!Array.isArray(e)}function pT(e){let t={},r=[];if(!py(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!py(n)||\"method\"in n||\"result\"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function dT(e){return{resultType:\"input_required\",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}/*!\n* content-type\n* Copyright(c) 2015 Douglas Christopher Wilson\n* MIT Licensed\n*/var mT=Vd((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(a){if(!a)throw TypeError(\"argument string is required\");var c=typeof a===\"object\"?i(a):a;if(typeof c!==\"string\")throw TypeError(\"argument string is required to be a string\");var u=c.indexOf(\";\"),l=u!==-1?c.slice(0,u).trim():c.trim();if(!o.test(l))throw TypeError(\"invalid media type\");var m=new s(l.toLowerCase());if(u!==-1){var h,f,b;t.lastIndex=u;while(f=t.exec(c)){if(f.index!==u)throw TypeError(\"invalid parameter format\");if(u+=f[0].length,h=f[1].toLowerCase(),b=f[2],b.charCodeAt(0)===34){if(b=b.slice(1,-1),b.indexOf(\"\\\\\")!==-1)b=b.replace(r,\"$1\")}m.parameters[h]=b}if(u!==c.length)throw TypeError(\"invalid parameter format\")}return m}function i(a){var c;if(typeof a.getHeader===\"function\")c=a.getHeader(\"content-type\");else if(typeof a.headers===\"object\")c=a.headers&&a.headers[\"content-type\"];if(typeof c!==\"string\")throw TypeError(\"content-type header is missing from object\");return c}function s(a){this.parameters=Object.create(null),this.type=a}}),fA=Hd(mT(),1);var kA=typeof self<\"u\"&&self.location&&self.location.origin!==\"null\"?new URL(self.location.origin+self.location.pathname+location.search):new URL(\"https://github.com/cfworker\");var hT=/^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/,fT=[0,31,28,31,30,31,30,31,31,30,31,30,31],gT=/^(\\d\\d):(\\d\\d):(\\d\\d)(\\.\\d+)?(z|[+-]\\d\\d(?::?\\d\\d)?)?$/i,_T=/^(?=.{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,ST=/^(?:[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,zT=/^(?:(?:[^\\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,bT=/^(?:(?:https?|ftp):\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!10(?:\\.\\d{1,3}){3})(?!127(?:\\.\\d{1,3}){3})(?!169\\.254(?:\\.\\d{1,3}){2})(?!192\\.168(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-?)*[a-z\\u{00a1}-\\u{ffff}0-9]+)(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-?)*[a-z\\u{00a1}-\\u{ffff}0-9]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$/iu,yT=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,vT=/^(?:\\/(?:[^~/]|~0|~1)*)*$/,xT=/^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,wT=/^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/,$T=(e)=>{if(e[0]==='\"')return!1;let[t,r,...o]=e.split(\"@\");if(!t||!r||o.length!==0||t.length>64||r.length>253)return!1;if(t[0]===\".\"||t.endsWith(\".\")||t.includes(\"..\"))return!1;if(!/^[a-z0-9.-]+$/i.test(r)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t))return!1;return r.split(\".\").every((n)=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(n))},kT=/^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/,RT=/^((([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,PT=(e)=>e.length>1&&e.length<80&&(/^P\\d+([.,]\\d+)?W$/.test(e)||/^P[\\dYMDTHS]*(\\d[.,]\\d+)?[YMDHS]$/.test(e)&&/^P([.,\\d]+Y)?([.,\\d]+M)?([.,\\d]+D)?(T([.,\\d]+H)?([.,\\d]+M)?([.,\\d]+S)?)?$/.test(e));function bt(e){return e.test.bind(e)}var RA={date:Dy,time:Fy.bind(void 0,!1),\"date-time\":IT,duration:PT,uri:ZT,\"uri-reference\":bt(ST),\"uri-template\":bt(zT),url:bt(bT),email:$T,hostname:bt(_T),ipv4:bt(kT),ipv6:bt(RT),regex:AT,uuid:bt(yT),\"json-pointer\":bt(vT),\"json-pointer-uri-fragment\":bt(xT),\"relative-json-pointer\":bt(wT)};function TT(e){return e%4===0&&(e%100!==0||e%400===0)}function Dy(e){let t=e.match(hT);if(!t)return!1;let r=+t[1],o=+t[2],n=+t[3];return o>=1&&o<=12&&n>=1&&n<=(o==2&&TT(r)?29:fT[o])}function Fy(e,t){let r=t.match(gT);if(!r)return!1;let o=+r[1],n=+r[2],i=+r[3],s=!!r[5];return(o<=23&&n<=59&&i<=59||o==23&&n==59&&i==60)&&(!e||s)}var ET=/t|\\s/i;function IT(e){let t=e.split(ET);return t.length==2&&Dy(t[0])&&Fy(!0,t[1])}var OT=/\\/|:/,CT=/^(?:[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 ZT(e){return OT.test(e)&&CT.test(e)}var NT=/[^\\\\]\\\\Z/;function AT(e){if(NT.test(e))return!1;try{return new RegExp(e,\"u\"),!0}catch(t){return!1}}var MT;MT=globalThis.crypto;var fa=class extends Error{static{Object.defineProperty(this,\"mcpBrand\",{value:\"mcp.OAuthClientFlowError\"})}static[Symbol.hasInstance](e){return Xe(this,e)}static isInstance(e){if(typeof this!==\"function\")throw TypeError(\"isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`\");return Xe(this,e)}constructor(e){super(e);this.name=new.target.name,Gr(this,new.target)}},Sj=class extends fa{static{Object.defineProperty(this,\"mcpBrand\",{value:\"mcp.IssuerMismatchError\"})}kind;expected;received;constructor(e,t,r){super(`Issuer mismatch in ${e===\"metadata\"?\"authorization server metadata (RFC 8414 §3.3)\":\"authorization response (RFC 9207)\"}: expected ${JSON.stringify(t)}, received ${JSON.stringify(r)}`);this.kind=e,this.expected=t,this.received=r}},zj=class extends fa{static{Object.defineProperty(this,\"mcpBrand\",{value:\"mcp.RegistrationRejectedError\"})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`);this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},bj=class extends fa{static{Object.defineProperty(this,\"mcpBrand\",{value:\"mcp.InsecureTokenEndpointError\"})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / 127.0.0.1 / ::1 are exempt).`);this.tokenEndpoint=e}},yj=class extends fa{static{Object.defineProperty(this,\"mcpBrand\",{value:\"mcp.AuthorizationServerMismatchError\"})}constructor(e,t){super(`Authorization server changed between redirect and callback (redirected to ${JSON.stringify(e)}, callback resolved ${JSON.stringify(t)}); refusing to send authorization_code/code_verifier to a different token endpoint`);this.recordedIssuer=e,this.currentIssuer=t}},vj=class extends fa{static{Object.defineProperty(this,\"mcpBrand\",{value:\"mcp.InsufficientScopeError\"})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required \"${e.requiredScope}\"`:\"\"}`);this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}};var xj=class extends Error{static{Object.defineProperty(this,\"mcpBrand\",{value:\"mcp.UnauthorizedError\"})}static[Symbol.hasInstance](e){return Xe(this,e)}static isInstance(e){if(typeof this!==\"function\")throw TypeError(\"isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`\");return Xe(this,e)}constructor(e){super(e??\"Unauthorized\");this.name=\"UnauthorizedError\",Gr(this,new.target)}};var wj=class extends Error{static{Object.defineProperty(this,\"mcpBrand\",{value:\"mcp.SseError\"})}static[Symbol.hasInstance](e){return Xe(this,e)}static isInstance(e){if(typeof this!==\"function\")throw TypeError(\"isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`\");return Xe(this,e)}constructor(e,t,r){super(`SSE error: ${t}`);this.code=e,this.event=r,Gr(this,new.target)}};var Vy;function z(e,t,r){function o(a,c){if(!a._zod)Object.defineProperty(a,\"_zod\",{value:{def:c,constr:s,traits:new Set},enumerable:!1});if(a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=s.prototype,l=Object.keys(u);for(let m=0;m<l.length;m++){let h=l[m];if(!(h in a))a[h]=u[h].bind(a)}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,\"name\",{value:e});function s(a){var c;let u=r?.Parent?new i:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(s,\"init\",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:(a)=>{if(r?.Parent&&a instanceof r.Parent)return!0;return a?._zod?.traits?.has(e)}}),Object.defineProperty(s,\"name\",{value:e}),s}var qT=Symbol(\"zod_brand\");class Zt extends Error{constructor(){super(\"Encountered Promise during synchronous parse. Use .parseAsync() instead.\")}}class ga extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name=\"ZodEncodeError\"}}(Vy=globalThis).__zod_globalConfig??(Vy.__zod_globalConfig={});var Xo=globalThis.__zod_globalConfig;function Ue(e){if(e)Object.assign(Xo,e);return Xo}function gu(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 od(e,t=\"|\"){return e.map((r)=>ad(r)).join(t)}function Sa(e,t){if(typeof t===\"bigint\")return t.toString();return t}function _u(e){return{get value(){{let r=e();return Object.defineProperty(this,\"value\",{value:r}),r}throw Error(\"cached value already set\")}}}function Su(e){return e===null||e===void 0}function zu(e){let t=e.startsWith(\"^\")?1:0,r=e.endsWith(\"$\")?e.length-1:e.length;return e.slice(t,r)}function Hy(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}var Jy=Symbol(\"evaluating\");function Q(e,t,r){let o=void 0;Object.defineProperty(e,t,{get(){if(o===Jy)return;if(o===void 0)o=Jy,o=r();return o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Kr(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function sr(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function nd(e){return JSON.stringify(e)}function By(e){return e.toLowerCase().trim().replace(/[^\\w\\s-]/g,\"\").replace(/[\\s_-]+/g,\"-\").replace(/^-+|-+$/g,\"\")}var sd=\"captureStackTrace\"in Error?Error.captureStackTrace:(...e)=>{};function _a(e){return typeof e===\"object\"&&e!==null&&!Array.isArray(e)}var Wy=_u(()=>{if(Xo.jitless)return!1;if(typeof navigator<\"u\"&&navigator?.userAgent?.includes(\"Cloudflare\"))return!1;try{return new Function(\"\"),!0}catch(e){return!1}});function Yr(e){if(_a(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!==\"function\")return!0;let r=t.prototype;if(_a(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,\"isPrototypeOf\")===!1)return!1;return!0}function id(e){if(Yr(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var Gy=new Set([\"string\",\"number\",\"symbol\"]);function ir(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")}function lt(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function A(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 Error(\"Cannot specify both `message` and `error` params\");t.error=t.message}if(delete t.message,typeof t.error===\"string\")return{...t,error:()=>t.error};return t}function ad(e){if(typeof e===\"bigint\")return e.toString()+\"n\";if(typeof e===\"string\")return`\"${e}\"`;return`${e}`}function Ky(e){return Object.keys(e).filter((t)=>e[t]._zod.optin===\"optional\"&&e[t]._zod.optout===\"optional\")}var Yy={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function LT(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(\".pick() cannot be used on object schemas containing refinements\");let i=sr(e._zod.def,{get shape(){let s={};for(let a in t){if(!(a in r.shape))throw Error(`Unrecognized key: \"${a}\"`);if(!t[a])continue;s[a]=r.shape[a]}return Kr(this,\"shape\",s),s},checks:[]});return lt(e,i)}function UT(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(\".omit() cannot be used on object schemas containing refinements\");let i=sr(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw Error(`Unrecognized key: \"${a}\"`);if(!t[a])continue;delete s[a]}return Kr(this,\"shape\",s),s},checks:[]});return lt(e,i)}function DT(e,t){if(!Yr(t))throw Error(\"Invalid input to extend: expected a plain object\");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw Error(\"Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.\")}let n=sr(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Kr(this,\"shape\",i),i}});return lt(e,n)}function FT(e,t){if(!Yr(t))throw Error(\"Invalid input to safeExtend: expected a plain object\");let r=sr(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Kr(this,\"shape\",o),o}});return lt(e,r)}function VT(e,t){if(e._zod.def.checks?.length)throw Error(\".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.\");let r=sr(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Kr(this,\"shape\",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return lt(e,r)}function JT(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(\".partial() cannot be used on object schemas containing refinements\");let s=sr(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw Error(`Unrecognized key: \"${u}\"`);if(!r[u])continue;c[u]=e?new e({type:\"optional\",innerType:a[u]}):a[u]}else for(let u in a)c[u]=e?new e({type:\"optional\",innerType:a[u]}):a[u];return Kr(this,\"shape\",c),c},checks:[]});return lt(t,s)}function HT(e,t,r){let o=sr(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let s in r){if(!(s in i))throw Error(`Unrecognized key: \"${s}\"`);if(!r[s])continue;i[s]=new e({type:\"nonoptional\",innerType:n[s]})}else for(let s in n)i[s]=new e({type:\"nonoptional\",innerType:n[s]});return Kr(this,\"shape\",i),i}});return lt(t,o)}function Qr(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 Qy(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 ar(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function fu(e){return typeof e===\"string\"?e:e?.message}function pt(e,t,r){let o=e.message?e.message:fu(e.inst?._zod.def?.error?.(e))??fu(t?.error?.(e))??fu(r.customError?.(e))??fu(r.localeError?.(e))??\"Invalid input\",{inst:n,continue:i,input:s,...a}=e;if(a.path??(a.path=[]),a.message=o,t?.reportInput)a.input=s;return a}function bu(e){if(Array.isArray(e))return\"array\";if(typeof e===\"string\")return\"string\";return\"unknown\"}function Xy(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 Xr(...e){let[t,r,o]=e;if(typeof t===\"string\")return{message:t,code:\"custom\",input:r,inst:o};return{...t}}var ev=(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,Sa,2),Object.defineProperty(e,\"toString\",{value:()=>e.message,enumerable:!1})},yu=z(\"$ZodError\",ev),cd=z(\"$ZodError\",ev,{Parent:Error});function ud(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function ld(e,t=(r)=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let s of n.issues)if(s.code===\"invalid_union\"&&s.errors.length)s.errors.map((a)=>o({issues:a},[...i,...s.path]));else if(s.code===\"invalid_key\")o({issues:s.issues},[...i,...s.path]);else if(s.code===\"invalid_element\")o({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else{let c=r,u=0;while(u<a.length){let l=a[u];if(u!==a.length-1)c[l]=c[l]||{_errors:[]};else c[l]=c[l]||{_errors:[]},c[l]._errors.push(t(s));c=c[l],u++}}}};return o(e),r}var vu=(e)=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Zt;if(s.issues.length){let a=new(n?.Err??e)(s.issues.map((c)=>pt(c,i,Ue())));throw sd(a,n?.callee),a}return s.value};var xu=(e)=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)s=await s;if(s.issues.length){let a=new(n?.Err??e)(s.issues.map((c)=>pt(c,i,Ue())));throw sd(a,n?.callee),a}return s.value};var za=(e)=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new Zt;return i.issues.length?{success:!1,error:new(e??yu)(i.issues.map((s)=>pt(s,n,Ue())))}:{success:!0,data:i.value}},tv=za(cd),ba=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)i=await i;return i.issues.length?{success:!1,error:new e(i.issues.map((s)=>pt(s,n,Ue())))}:{success:!0,data:i.value}},rv=ba(cd),ov=(e)=>(t,r,o)=>{let n=o?{...o,direction:\"backward\"}:{direction:\"backward\"};return vu(e)(t,r,n)};var nv=(e)=>(t,r,o)=>vu(e)(t,r,o);var sv=(e)=>async(t,r,o)=>{let n=o?{...o,direction:\"backward\"}:{direction:\"backward\"};return xu(e)(t,r,n)};var iv=(e)=>async(t,r,o)=>xu(e)(t,r,o);var av=(e)=>(t,r,o)=>{let n=o?{...o,direction:\"backward\"}:{direction:\"backward\"};return za(e)(t,r,n)};var cv=(e)=>(t,r,o)=>za(e)(t,r,o);var uv=(e)=>async(t,r,o)=>{let n=o?{...o,direction:\"backward\"}:{direction:\"backward\"};return ba(e)(t,r,n)};var lv=(e)=>async(t,r,o)=>ba(e)(t,r,o);var pv=/^[cC][0-9a-z]{6,}$/,dv=/^[0-9a-z]+$/,mv=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,hv=/^[0-9a-vA-V]{20}$/,fv=/^[A-Za-z0-9]{27}$/,gv=/^[a-zA-Z0-9_-]{21}$/,_v=/^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/;var Sv=/^([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})$/,pd=(e)=>{if(!e)return/^([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)$/;return 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})$`)};var zv=/^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/;var WT=\"^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$\";function bv(){return new RegExp(WT,\"u\")}var yv=/^(?:(?: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])$/,vv=/^(([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 xv=/^((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])$/,wv=/^(([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])$/,$v=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dd=/^[A-Za-z0-9_-]*$/;var kv=/^https?$/,Rv=/^\\+[1-9]\\d{6,14}$/,Pv=\"(?:(?:\\\\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])))\",Tv=new RegExp(`^${Pv}$`);function Ev(e){return typeof e.precision===\"number\"?e.precision===-1?\"(?:[01]\\\\d|2[0-3]):[0-5]\\\\d\":e.precision===0?\"(?:[01]\\\\d|2[0-3]):[0-5]\\\\d:[0-5]\\\\d\":`(?:[01]\\\\d|2[0-3]):[0-5]\\\\d:[0-5]\\\\d\\\\.\\\\d{${e.precision}}`:\"(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?\"}function Iv(e){return new RegExp(`^${Ev(e)}$`)}function Ov(e){let t=Ev({precision:e.precision}),r=[\"Z\"];if(e.local)r.push(\"\");if(e.offset)r.push(\"([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)\");let o=`${t}(?:${r.join(\"|\")})`;return new RegExp(`^${Pv}T(?:${o})$`)}var Cv=(e)=>{let t=e?`[\\\\s\\\\S]{${e?.minimum??0},${e?.maximum??\"\"}}`:\"[\\\\s\\\\S]*\";return new RegExp(`^${t}$`)};var Zv=/^-?\\d+$/,md=/^-?\\d+(?:\\.\\d+)?$/,Nv=/^(?:true|false)$/i;var Av=/^undefined$/i;var jv=/^[^A-Z]*$/,Mv=/^[^a-z]*$/;var Ze=z(\"$ZodCheck\",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),qv={number:\"number\",bigint:\"bigint\",object:\"date\"},hd=z(\"$ZodCheckLessThan\",(e,t)=>{Ze.init(e,t);let r=qv[typeof t.value];e._zod.onattach.push((o)=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<i)if(t.inclusive)n.maximum=t.value;else n.exclusiveMaximum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;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})}}),fd=z(\"$ZodCheckGreaterThan\",(e,t)=>{Ze.init(e,t);let r=qv[typeof t.value];e._zod.onattach.push((o)=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>i)if(t.inclusive)n.minimum=t.value;else n.exclusiveMinimum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;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})}}),Lv=z(\"$ZodCheckMultipleOf\",(e,t)=>{Ze.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 Error(\"Cannot mix number and bigint in multiple_of check.\");if(typeof r.value===\"bigint\"?r.value%t.value===BigInt(0):Hy(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:\"not_multiple_of\",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Uv=z(\"$ZodCheckNumberFormat\",(e,t)=>{Ze.init(e,t),t.format=t.format||\"float64\";let r=t.format?.includes(\"int\"),o=r?\"int\":\"number\",[n,i]=Yy[t.format];e._zod.onattach.push((s)=>{let a=s._zod.bag;if(a.format=t.format,a.minimum=n,a.maximum=i,r)a.pattern=Zv}),e._zod.check=(s)=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:o,format:t.format,code:\"invalid_type\",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)s.issues.push({input:a,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});else s.issues.push({input:a,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}}if(a<n)s.issues.push({origin:\"number\",input:a,code:\"too_small\",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(a>i)s.issues.push({origin:\"number\",input:a,code:\"too_big\",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var Dv=z(\"$ZodCheckMaxLength\",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!Su(n)&&n.length!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<n)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let n=o.value;if(n.length<=t.maximum)return;let s=bu(n);o.issues.push({origin:s,code:\"too_big\",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Fv=z(\"$ZodCheckMinLength\",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!Su(n)&&n.length!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>n)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let n=o.value;if(n.length>=t.minimum)return;let s=bu(n);o.issues.push({origin:s,code:\"too_small\",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Vv=z(\"$ZodCheckLengthEquals\",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!Su(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,i=n.length;if(i===t.length)return;let s=bu(n),a=i>t.length;o.issues.push({origin:s,...a?{code:\"too_big\",maximum:t.length}:{code:\"too_small\",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),va=z(\"$ZodCheckStringFormat\",(e,t)=>{var r,o;if(Ze.init(e,t),e._zod.onattach.push((n)=>{let i=n._zod.bag;if(i.format=t.format,t.pattern)i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern)}),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;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})});else(o=e._zod).check??(o.check=()=>{})}),Jv=z(\"$ZodCheckRegex\",(e,t)=>{va.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:\"string\",code:\"invalid_format\",format:\"regex\",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Hv=z(\"$ZodCheckLowerCase\",(e,t)=>{t.pattern??(t.pattern=jv),va.init(e,t)}),Bv=z(\"$ZodCheckUpperCase\",(e,t)=>{t.pattern??(t.pattern=Mv),va.init(e,t)}),Wv=z(\"$ZodCheckIncludes\",(e,t)=>{Ze.init(e,t);let r=ir(t.includes),o=new RegExp(typeof t.position===\"number\"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push((n)=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:\"string\",code:\"invalid_format\",format:\"includes\",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Gv=z(\"$ZodCheckStartsWith\",(e,t)=>{Ze.init(e,t);let r=new RegExp(`^${ir(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)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:\"string\",code:\"invalid_format\",format:\"starts_with\",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Kv=z(\"$ZodCheckEndsWith\",(e,t)=>{Ze.init(e,t);let r=new RegExp(`.*${ir(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)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:\"string\",code:\"invalid_format\",format:\"ends_with\",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Yv=z(\"$ZodCheckOverwrite\",(e,t)=>{Ze.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class gd{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e===\"function\"){e(this,{execution:\"sync\"}),e(this,{execution:\"async\"});return}let r=e.split(`\n`).filter((i)=>i),o=Math.min(...r.map((i)=>i.length-i.trimStart().length)),n=r.map((i)=>i.slice(o)).map((i)=>\" \".repeat(this.indent*2)+i);for(let i of n)this.content.push(i)}compile(){let e=Function,t=this?.args,o=[...(this?.content??[\"\"]).map((n)=>`  ${n}`)];return new e(...t,o.join(`\n`))}}var Xv={major:4,minor:4,patch:3};var ie=z(\"$ZodType\",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Xv;let o=[...e._zod.def.checks??[]];if(e._zod.traits.has(\"$ZodCheck\"))o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(s,a,c)=>{let u=Qr(s),l;for(let m of a){if(m._zod.def.when){if(Qy(s))continue;if(!m._zod.def.when(s))continue}else if(u)continue;let h=s.issues.length,f=m._zod.check(s);if(f instanceof Promise&&c?.async===!1)throw new Zt;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{if(await f,s.issues.length===h)return;if(!u)u=Qr(s,h)});else{if(s.issues.length===h)continue;if(!u)u=Qr(s,h)}}if(l)return l.then(()=>s);return s},i=(s,a,c)=>{if(Qr(s))return s.aborted=!0,s;let u=n(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new Zt;return u.then((l)=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction===\"backward\"){let u=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});if(u instanceof Promise)return u.then((l)=>i(l,s,a));return i(u,s,a)}let c=e._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new Zt;return c.then((u)=>n(u,o,a))}return n(c,o,a)}}Q(e,\"~standard\",()=>({validate:(n)=>{try{let i=tv(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch(i){return rv(e,n).then((s)=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:\"zod\",version:1}))}),ku=z(\"$ZodString\",(e,t)=>{ie.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Cv(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value===\"string\")return r;return r.issues.push({expected:\"string\",code:\"invalid_type\",input:r.value,inst:e}),r}}),le=z(\"$ZodStringFormat\",(e,t)=>{va.init(e,t),ku.init(e,t)}),cx=z(\"$ZodGUID\",(e,t)=>{t.pattern??(t.pattern=Sv),le.init(e,t)}),ux=z(\"$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 Error(`Invalid UUID version: \"${t.version}\"`);t.pattern??(t.pattern=pd(o))}else t.pattern??(t.pattern=pd());le.init(e,t)}),lx=z(\"$ZodEmail\",(e,t)=>{t.pattern??(t.pattern=zv),le.init(e,t)}),px=z(\"$ZodURL\",(e,t)=>{le.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===kv.source){if(!/^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);if(t.hostname){if(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})}if(t.protocol){if(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})}if(t.normalize)r.value=n.href;else r.value=o;return}catch(o){r.issues.push({code:\"invalid_format\",format:\"url\",input:r.value,inst:e,continue:!t.abort})}}}),dx=z(\"$ZodEmoji\",(e,t)=>{t.pattern??(t.pattern=bv()),le.init(e,t)}),mx=z(\"$ZodNanoID\",(e,t)=>{t.pattern??(t.pattern=gv),le.init(e,t)}),hx=z(\"$ZodCUID\",(e,t)=>{t.pattern??(t.pattern=pv),le.init(e,t)}),fx=z(\"$ZodCUID2\",(e,t)=>{t.pattern??(t.pattern=dv),le.init(e,t)}),gx=z(\"$ZodULID\",(e,t)=>{t.pattern??(t.pattern=mv),le.init(e,t)}),_x=z(\"$ZodXID\",(e,t)=>{t.pattern??(t.pattern=hv),le.init(e,t)}),Sx=z(\"$ZodKSUID\",(e,t)=>{t.pattern??(t.pattern=fv),le.init(e,t)}),zx=z(\"$ZodISODateTime\",(e,t)=>{t.pattern??(t.pattern=Ov(t)),le.init(e,t)}),bx=z(\"$ZodISODate\",(e,t)=>{t.pattern??(t.pattern=Tv),le.init(e,t)}),yx=z(\"$ZodISOTime\",(e,t)=>{t.pattern??(t.pattern=Iv(t)),le.init(e,t)}),vx=z(\"$ZodISODuration\",(e,t)=>{t.pattern??(t.pattern=_v),le.init(e,t)}),xx=z(\"$ZodIPv4\",(e,t)=>{t.pattern??(t.pattern=yv),le.init(e,t),e._zod.bag.format=\"ipv4\"}),wx=z(\"$ZodIPv6\",(e,t)=>{t.pattern??(t.pattern=vv),le.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 $x=z(\"$ZodCIDRv4\",(e,t)=>{t.pattern??(t.pattern=xv),le.init(e,t)}),kx=z(\"$ZodCIDRv6\",(e,t)=>{t.pattern??(t.pattern=wv),le.init(e,t),e._zod.check=(r)=>{let o=r.value.split(\"/\");try{if(o.length!==2)throw Error();let[n,i]=o;if(!i)throw Error();let s=Number(i);if(`${s}`!==i)throw Error();if(s<0||s>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:\"invalid_format\",format:\"cidrv6\",input:r.value,inst:e,continue:!t.abort})}}});function Rx(e){if(e===\"\")return!0;if(/\\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Px=z(\"$ZodBase64\",(e,t)=>{t.pattern??(t.pattern=$v),le.init(e,t),e._zod.bag.contentEncoding=\"base64\",e._zod.check=(r)=>{if(Rx(r.value))return;r.issues.push({code:\"invalid_format\",format:\"base64\",input:r.value,inst:e,continue:!t.abort})}});function GT(e){if(!dd.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o===\"-\"?\"+\":\"/\"),r=t.padEnd(Math.ceil(t.length/4)*4,\"=\");return Rx(r)}var Tx=z(\"$ZodBase64URL\",(e,t)=>{t.pattern??(t.pattern=dd),le.init(e,t),e._zod.bag.contentEncoding=\"base64url\",e._zod.check=(r)=>{if(GT(r.value))return;r.issues.push({code:\"invalid_format\",format:\"base64url\",input:r.value,inst:e,continue:!t.abort})}}),Ex=z(\"$ZodE164\",(e,t)=>{t.pattern??(t.pattern=Rv),le.init(e,t)});function KT(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));if(\"typ\"in n&&n?.typ!==\"JWT\")return!1;if(!n.alg)return!1;if(t&&(!(\"alg\"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var Ix=z(\"$ZodJWT\",(e,t)=>{le.init(e,t),e._zod.check=(r)=>{if(KT(r.value,t.alg))return;r.issues.push({code:\"invalid_format\",format:\"jwt\",input:r.value,inst:e,continue:!t.abort})}});var Sd=z(\"$ZodNumber\",(e,t)=>{ie.init(e,t),e._zod.pattern=e._zod.bag.pattern??md,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}let n=r.value;if(typeof n===\"number\"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n===\"number\"?Number.isNaN(n)?\"NaN\":!Number.isFinite(n)?\"Infinity\":void 0:void 0;return r.issues.push({expected:\"number\",code:\"invalid_type\",input:n,inst:e,...i?{received:i}:{}}),r}}),Ox=z(\"$ZodNumberFormat\",(e,t)=>{Uv.init(e,t),Sd.init(e,t)}),Cx=z(\"$ZodBoolean\",(e,t)=>{ie.init(e,t),e._zod.pattern=Nv,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(i){}let n=r.value;if(typeof n===\"boolean\")return r;return r.issues.push({expected:\"boolean\",code:\"invalid_type\",input:n,inst:e}),r}});var Zx=z(\"$ZodUndefined\",(e,t)=>{ie.init(e,t),e._zod.pattern=Av,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;if(typeof n>\"u\")return r;return r.issues.push({expected:\"undefined\",code:\"invalid_type\",input:n,inst:e}),r}});var Nx=z(\"$ZodAny\",(e,t)=>{ie.init(e,t),e._zod.parse=(r)=>r}),Ax=z(\"$ZodUnknown\",(e,t)=>{ie.init(e,t),e._zod.parse=(r)=>r}),jx=z(\"$ZodNever\",(e,t)=>{ie.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:\"never\",code:\"invalid_type\",input:r.value,inst:e}),r)});function ex(e,t,r){if(e.issues.length)t.issues.push(...ar(r,e.issues));t.value[r]=e.value}var Mx=z(\"$ZodArray\",(e,t)=>{ie.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 i=[];for(let s=0;s<n.length;s++){let a=n[s],c=t.element._zod.run({value:a,issues:[]},o);if(c instanceof Promise)i.push(c.then((u)=>ex(u,r,s)));else ex(c,r,s)}if(i.length)return Promise.all(i).then(()=>r);return r}});function $u(e,t,r,o,n,i){let s=r in o;if(e.issues.length){if(n&&i&&!s)return;t.issues.push(...ar(r,e.issues))}if(!s&&!n){if(!e.issues.length)t.issues.push({code:\"invalid_type\",expected:\"nonoptional\",input:void 0,path:[r]});return}if(e.value===void 0){if(s)t.value[r]=void 0}else t.value[r]=e.value}function qx(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has(\"$ZodType\"))throw Error(`Invalid element at key \"${o}\": expected a Zod schema`);let r=Ky(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Lx(e,t,r,o,n,i){let s=[],a=n.keySet,c=n.catchall._zod,u=c.def.type,l=c.optin===\"optional\",m=c.optout===\"optional\";for(let h in t){if(h===\"__proto__\")continue;if(a.has(h))continue;if(u===\"never\"){s.push(h);continue}let f=c.run({value:t[h],issues:[]},o);if(f instanceof Promise)e.push(f.then((b)=>$u(b,r,h,t,l,m)));else $u(f,r,h,t,l,m)}if(s.length)r.issues.push({code:\"unrecognized_keys\",keys:s,input:t,inst:i});if(!e.length)return r;return Promise.all(e).then(()=>r)}var YT=z(\"$ZodObject\",(e,t)=>{if(ie.init(e,t),!Object.getOwnPropertyDescriptor(t,\"shape\")?.get){let a=t.shape;Object.defineProperty(t,\"shape\",{get:()=>{let c={...a};return Object.defineProperty(t,\"shape\",{value:c}),c}})}let o=_u(()=>qx(t));Q(e._zod,\"propValues\",()=>{let a=t.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let m of l.values)c[u].add(m)}}return c});let n=_a,i=t.catchall,s;e._zod.parse=(a,c)=>{s??(s=o.value);let u=a.value;if(!n(u))return a.issues.push({expected:\"object\",code:\"invalid_type\",input:u,inst:e}),a;a.value={};let l=[],m=s.shape;for(let h of s.keys){let f=m[h],b=f._zod.optin===\"optional\",I=f._zod.optout===\"optional\",x=f._zod.run({value:u[h],issues:[]},c);if(x instanceof Promise)l.push(x.then((J)=>$u(J,a,h,u,b,I)));else $u(x,a,h,u,b,I)}if(!i)return l.length?Promise.all(l).then(()=>a):a;return Lx(l,u,a,c,o.value,e)}}),Ux=z(\"$ZodObjectJIT\",(e,t)=>{YT.init(e,t);let r=e._zod.parse,o=_u(()=>qx(t)),n=(h)=>{let f=new gd([\"shape\",\"payload\",\"ctx\"]),b=o.value,I=(M)=>{let k=nd(M);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};f.write(\"const input = payload.value;\");let x=Object.create(null),J=0;for(let M of b.keys)x[M]=`key_${J++}`;f.write(\"const newResult = {};\");for(let M of b.keys){let k=x[M],N=nd(M),K=h[M],de=K?._zod?.optin===\"optional\",Be=K?._zod?.optout===\"optional\";if(f.write(`const ${k} = ${I(M)};`),de&&Be)f.write(`\n        if (${k}.issues.length) {\n          if (${N} in input) {\n            payload.issues = payload.issues.concat(${k}.issues.map(iss => ({\n              ...iss,\n              path: iss.path ? [${N}, ...iss.path] : [${N}]\n            })));\n          }\n        }\n        \n        if (${k}.value === undefined) {\n          if (${N} in input) {\n            newResult[${N}] = undefined;\n          }\n        } else {\n          newResult[${N}] = ${k}.value;\n        }\n        \n      `);else if(!de)f.write(`\n        const ${k}_present = ${N} in input;\n        if (${k}.issues.length) {\n          payload.issues = payload.issues.concat(${k}.issues.map(iss => ({\n            ...iss,\n            path: iss.path ? [${N}, ...iss.path] : [${N}]\n          })));\n        }\n        if (!${k}_present && !${k}.issues.length) {\n          payload.issues.push({\n            code: \"invalid_type\",\n            expected: \"nonoptional\",\n            input: undefined,\n            path: [${N}]\n          });\n        }\n\n        if (${k}_present) {\n          if (${k}.value === undefined) {\n            newResult[${N}] = undefined;\n          } else {\n            newResult[${N}] = ${k}.value;\n          }\n        }\n\n      `);else f.write(`\n        if (${k}.issues.length) {\n          payload.issues = payload.issues.concat(${k}.issues.map(iss => ({\n            ...iss,\n            path: iss.path ? [${N}, ...iss.path] : [${N}]\n          })));\n        }\n        \n        if (${k}.value === undefined) {\n          if (${N} in input) {\n            newResult[${N}] = undefined;\n          }\n        } else {\n          newResult[${N}] = ${k}.value;\n        }\n        \n      `)}f.write(\"payload.value = newResult;\"),f.write(\"return payload;\");let re=f.compile();return(M,k)=>re(h,M,k)},i,s=_a,a=!Xo.jitless,u=a&&Wy.value,l=t.catchall,m;e._zod.parse=(h,f)=>{m??(m=o.value);let b=h.value;if(!s(b))return h.issues.push({expected:\"object\",code:\"invalid_type\",input:b,inst:e}),h;if(a&&u&&f?.async===!1&&f.jitless!==!0){if(!i)i=n(t.shape);if(h=i(h,f),!l)return h;return Lx([],b,h,f,m,e)}return r(h,f)}});function tx(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter((i)=>!Qr(i));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:\"invalid_union\",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((s)=>pt(s,o,Ue())))}),t}var Dx=z(\"$ZodUnion\",(e,t)=>{ie.init(e,t),Q(e._zod,\"optin\",()=>t.options.some((o)=>o._zod.optin===\"optional\")?\"optional\":void 0),Q(e._zod,\"optout\",()=>t.options.some((o)=>o._zod.optout===\"optional\")?\"optional\":void 0),Q(e._zod,\"values\",()=>{if(t.options.every((o)=>o._zod.values))return new Set(t.options.flatMap((o)=>Array.from(o._zod.values)));return}),Q(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)=>zu(n.source)).join(\"|\")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,s=[];for(let a of t.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)s.push(c),i=!0;else{if(c.issues.length===0)return c;s.push(c)}}if(!i)return tx(s,o,e,n);return Promise.all(s).then((a)=>tx(a,o,e,n))}});var Fx=z(\"$ZodIntersection\",(e,t)=>{ie.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),s=t.right._zod.run({value:n,issues:[]},o);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([c,u])=>rx(r,c,u));return rx(r,i,s)}});function _d(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(Yr(e)&&Yr(t)){let r=Object.keys(t),o=Object.keys(e).filter((i)=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let s=_d(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.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],i=t[o],s=_d(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function rx(e,t,r){let o=new Map,n;for(let a of t.issues)if(a.code===\"unrecognized_keys\"){n??(n=a);for(let c of a.keys){if(!o.has(c))o.set(c,{});o.get(c).l=!0}}else e.issues.push(a);for(let a of r.issues)if(a.code===\"unrecognized_keys\")for(let c of a.keys){if(!o.has(c))o.set(c,{});o.get(c).r=!0}else e.issues.push(a);let i=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&n)e.issues.push({...n,keys:i});if(Qr(e))return e;let s=_d(t.value,r.value);if(!s.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var Vx=z(\"$ZodRecord\",(e,t)=>{ie.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Yr(n))return r.issues.push({expected:\"record\",code:\"invalid_type\",input:n,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let a=new Set;for(let u of s)if(typeof u===\"string\"||typeof u===\"number\"||typeof u===\"symbol\"){a.add(typeof u===\"number\"?u.toString():u);let l=t.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw Error(\"Async schemas not supported in object keys currently\");if(l.issues.length){r.issues.push({code:\"invalid_key\",origin:\"record\",issues:l.issues.map((f)=>pt(f,o,Ue())),input:u,path:[u],inst:e});continue}let m=l.value,h=t.valueType._zod.run({value:n[u],issues:[]},o);if(h instanceof Promise)i.push(h.then((f)=>{if(f.issues.length)r.issues.push(...ar(u,f.issues));r.value[m]=f.value}));else{if(h.issues.length)r.issues.push(...ar(u,h.issues));r.value[m]=h.value}}let c;for(let u in n)if(!a.has(u))c=c??[],c.push(u);if(c&&c.length>0)r.issues.push({code:\"unrecognized_keys\",input:n,inst:e,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a===\"__proto__\")continue;if(!Object.prototype.propertyIsEnumerable.call(n,a))continue;let c=t.keyType._zod.run({value:a,issues:[]},o);if(c instanceof Promise)throw Error(\"Async schemas not supported in object keys currently\");if(typeof a===\"string\"&&md.test(a)&&c.issues.length){let m=t.keyType._zod.run({value:Number(a),issues:[]},o);if(m instanceof Promise)throw Error(\"Async schemas not supported in object keys currently\");if(m.issues.length===0)c=m}if(c.issues.length){if(t.mode===\"loose\")r.value[a]=n[a];else r.issues.push({code:\"invalid_key\",origin:\"record\",issues:c.issues.map((m)=>pt(m,o,Ue())),input:a,path:[a],inst:e});continue}let l=t.valueType._zod.run({value:n[a],issues:[]},o);if(l instanceof Promise)i.push(l.then((m)=>{if(m.issues.length)r.issues.push(...ar(a,m.issues));r.value[c.value]=m.value}));else{if(l.issues.length)r.issues.push(...ar(a,l.issues));r.value[c.value]=l.value}}}if(i.length)return Promise.all(i).then(()=>r);return r}});var Jx=z(\"$ZodEnum\",(e,t)=>{ie.init(e,t);let r=gu(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter((n)=>Gy.has(typeof n)).map((n)=>typeof n===\"string\"?ir(n):n.toString()).join(\"|\")})$`),e._zod.parse=(n,i)=>{let s=n.value;if(o.has(s))return n;return n.issues.push({code:\"invalid_value\",values:r,input:s,inst:e}),n}}),Hx=z(\"$ZodLiteral\",(e,t)=>{if(ie.init(e,t),t.values.length===0)throw 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\"?ir(o):o?ir(o.toString()):String(o)).join(\"|\")})$`),e._zod.parse=(o,n)=>{let i=o.value;if(r.has(i))return o;return o.issues.push({code:\"invalid_value\",values:t.values,input:i,inst:e}),o}});var Bx=z(\"$ZodTransform\",(e,t)=>{ie.init(e,t),e._zod.optin=\"optional\",e._zod.parse=(r,o)=>{if(o.direction===\"backward\")throw new ga(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then((s)=>(r.value=s,r.fallback=!0,r));if(n instanceof Promise)throw new Zt;return r.value=n,r.fallback=!0,r}});function ox(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var zd=z(\"$ZodOptional\",(e,t)=>{ie.init(e,t),e._zod.optin=\"optional\",e._zod.optout=\"optional\",Q(e._zod,\"values\",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Q(e._zod,\"pattern\",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zu(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin===\"optional\"){let n=r.value,i=t.innerType._zod.run(r,o);if(i instanceof Promise)return i.then((s)=>ox(s,n));return ox(i,n)}if(r.value===void 0)return r;return t.innerType._zod.run(r,o)}}),Wx=z(\"$ZodExactOptional\",(e,t)=>{zd.init(e,t),Q(e._zod,\"values\",()=>t.innerType._zod.values),Q(e._zod,\"pattern\",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Gx=z(\"$ZodNullable\",(e,t)=>{ie.init(e,t),Q(e._zod,\"optin\",()=>t.innerType._zod.optin),Q(e._zod,\"optout\",()=>t.innerType._zod.optout),Q(e._zod,\"pattern\",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zu(r.source)}|null)$`):void 0}),Q(e._zod,\"values\",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),Kx=z(\"$ZodDefault\",(e,t)=>{ie.init(e,t),e._zod.optin=\"optional\",Q(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);if(n instanceof Promise)return n.then((i)=>nx(i,t));return nx(n,t)}});function nx(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Yx=z(\"$ZodPrefault\",(e,t)=>{ie.init(e,t),e._zod.optin=\"optional\",Q(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)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),Qx=z(\"$ZodNonOptional\",(e,t)=>{ie.init(e,t),Q(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);if(n instanceof Promise)return n.then((i)=>sx(i,e));return sx(n,e)}});function sx(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:\"invalid_type\",expected:\"nonoptional\",input:e.value,inst:t});return e}var Xx=z(\"$ZodCatch\",(e,t)=>{ie.init(e,t),e._zod.optin=\"optional\",Q(e._zod,\"optout\",()=>t.innerType._zod.optout),Q(e._zod,\"values\",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction===\"backward\")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>{if(r.value=i.value,i.issues.length)r.value=t.catchValue({...r,error:{issues:i.issues.map((s)=>pt(s,o,Ue()))},input:r.value}),r.issues=[],r.fallback=!0;return r});if(r.value=n.value,n.issues.length)r.value=t.catchValue({...r,error:{issues:n.issues.map((i)=>pt(i,o,Ue()))},input:r.value}),r.issues=[],r.fallback=!0;return r}});var ew=z(\"$ZodPipe\",(e,t)=>{ie.init(e,t),Q(e._zod,\"values\",()=>t.in._zod.values),Q(e._zod,\"optin\",()=>t.in._zod.optin),Q(e._zod,\"optout\",()=>t.out._zod.optout),Q(e._zod,\"propValues\",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction===\"backward\"){let i=t.out._zod.run(r,o);if(i instanceof Promise)return i.then((s)=>wu(s,t.in,o));return wu(i,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>wu(i,t.out,o));return wu(n,t.out,o)}});function wu(e,t,r){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var tw=z(\"$ZodReadonly\",(e,t)=>{ie.init(e,t),Q(e._zod,\"propValues\",()=>t.innerType._zod.propValues),Q(e._zod,\"values\",()=>t.innerType._zod.values),Q(e._zod,\"optin\",()=>t.innerType?._zod?.optin),Q(e._zod,\"optout\",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction===\"backward\")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then(ix);return ix(n)}});function ix(e){return e.value=Object.freeze(e.value),e}var rw=z(\"$ZodCustom\",(e,t)=>{Ze.init(e,t),ie.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((i)=>ax(i,r,o,e));ax(n,r,o,e);return}});function ax(e,t,r,o){if(!e){let n={code:\"custom\",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(Xr(n))}}var QT=()=>{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 i=o[n.expected]??n.expected,s=Xy(n.input),a=o[s]??s;return`Invalid input: expected ${i}, received ${a}`}case\"invalid_value\":if(n.values.length===1)return`Invalid input: expected ${ad(n.values[0])}`;return`Invalid option: expected one of ${od(n.values,\"|\")}`;case\"too_big\":{let i=n.inclusive?\"<=\":\"<\",s=t(n.origin);if(s)return`Too big: expected ${n.origin??\"value\"} to have ${i}${n.maximum.toString()} ${s.unit??\"elements\"}`;return`Too big: expected ${n.origin??\"value\"} to be ${i}${n.maximum.toString()}`}case\"too_small\":{let i=n.inclusive?\">=\":\">\",s=t(n.origin);if(s)return`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${s.unit}`;return`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case\"invalid_format\":{let i=n;if(i.format===\"starts_with\")return`Invalid string: must start with \"${i.prefix}\"`;if(i.format===\"ends_with\")return`Invalid string: must end with \"${i.suffix}\"`;if(i.format===\"includes\")return`Invalid string: must include \"${i.includes}\"`;if(i.format===\"regex\")return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${r[i.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\":\"\"}: ${od(n.keys,\", \")}`;case\"invalid_key\":return`Invalid key in ${n.origin}`;case\"invalid_union\":if(n.options&&Array.isArray(n.options)&&n.options.length>0)return`Invalid discriminator value. Expected ${n.options.map((s)=>`'${s}'`).join(\" | \")}`;return\"Invalid input\";case\"invalid_element\":return`Invalid value in ${n.origin}`;default:return\"Invalid input\"}}};function bd(){return{localeError:QT()}}var ow,XT=Symbol(\"ZodOutput\"),eE=Symbol(\"ZodInput\");class nw{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r===\"object\"&&\"id\"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t===\"object\"&&\"id\"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function sw(){return new nw}(ow=globalThis).__zod_globalRegistry??(ow.__zod_globalRegistry=sw());var cr=globalThis.__zod_globalRegistry;function iw(e,t){return new e({type:\"string\",...A(t)})}function aw(e,t){return new e({type:\"string\",format:\"email\",check:\"string_format\",abort:!1,...A(t)})}function yd(e,t){return new e({type:\"string\",format:\"guid\",check:\"string_format\",abort:!1,...A(t)})}function cw(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,...A(t)})}function uw(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,version:\"v4\",...A(t)})}function lw(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,version:\"v6\",...A(t)})}function pw(e,t){return new e({type:\"string\",format:\"uuid\",check:\"string_format\",abort:!1,version:\"v7\",...A(t)})}function dw(e,t){return new e({type:\"string\",format:\"url\",check:\"string_format\",abort:!1,...A(t)})}function mw(e,t){return new e({type:\"string\",format:\"emoji\",check:\"string_format\",abort:!1,...A(t)})}function hw(e,t){return new e({type:\"string\",format:\"nanoid\",check:\"string_format\",abort:!1,...A(t)})}function fw(e,t){return new e({type:\"string\",format:\"cuid\",check:\"string_format\",abort:!1,...A(t)})}function gw(e,t){return new e({type:\"string\",format:\"cuid2\",check:\"string_format\",abort:!1,...A(t)})}function _w(e,t){return new e({type:\"string\",format:\"ulid\",check:\"string_format\",abort:!1,...A(t)})}function Sw(e,t){return new e({type:\"string\",format:\"xid\",check:\"string_format\",abort:!1,...A(t)})}function zw(e,t){return new e({type:\"string\",format:\"ksuid\",check:\"string_format\",abort:!1,...A(t)})}function bw(e,t){return new e({type:\"string\",format:\"ipv4\",check:\"string_format\",abort:!1,...A(t)})}function yw(e,t){return new e({type:\"string\",format:\"ipv6\",check:\"string_format\",abort:!1,...A(t)})}function vw(e,t){return new e({type:\"string\",format:\"cidrv4\",check:\"string_format\",abort:!1,...A(t)})}function xw(e,t){return new e({type:\"string\",format:\"cidrv6\",check:\"string_format\",abort:!1,...A(t)})}function ww(e,t){return new e({type:\"string\",format:\"base64\",check:\"string_format\",abort:!1,...A(t)})}function $w(e,t){return new e({type:\"string\",format:\"base64url\",check:\"string_format\",abort:!1,...A(t)})}function kw(e,t){return new e({type:\"string\",format:\"e164\",check:\"string_format\",abort:!1,...A(t)})}function Rw(e,t){return new e({type:\"string\",format:\"jwt\",check:\"string_format\",abort:!1,...A(t)})}function Pw(e,t){return new e({type:\"string\",format:\"datetime\",check:\"string_format\",offset:!1,local:!1,precision:null,...A(t)})}function Tw(e,t){return new e({type:\"string\",format:\"date\",check:\"string_format\",...A(t)})}function Ew(e,t){return new e({type:\"string\",format:\"time\",check:\"string_format\",precision:null,...A(t)})}function Iw(e,t){return new e({type:\"string\",format:\"duration\",check:\"string_format\",...A(t)})}function Ow(e,t){return new e({type:\"number\",checks:[],...A(t)})}function Cw(e,t){return new e({type:\"number\",check:\"number_format\",abort:!1,format:\"safeint\",...A(t)})}function Zw(e,t){return new e({type:\"boolean\",...A(t)})}function Nw(e,t){return new e({type:\"undefined\",...A(t)})}function Aw(e){return new e({type:\"any\"})}function jw(e){return new e({type:\"unknown\"})}function Mw(e,t){return new e({type:\"never\",...A(t)})}function Ru(e,t){return new hd({check:\"less_than\",...A(t),value:e,inclusive:!1})}function xa(e,t){return new hd({check:\"less_than\",...A(t),value:e,inclusive:!0})}function Pu(e,t){return new fd({check:\"greater_than\",...A(t),value:e,inclusive:!1})}function wa(e,t){return new fd({check:\"greater_than\",...A(t),value:e,inclusive:!0})}function Tu(e,t){return new Lv({check:\"multiple_of\",...A(t),value:e})}function Eu(e,t){return new Dv({check:\"max_length\",...A(t),maximum:e})}function en(e,t){return new Fv({check:\"min_length\",...A(t),minimum:e})}function Iu(e,t){return new Vv({check:\"length_equals\",...A(t),length:e})}function vd(e,t){return new Jv({check:\"string_format\",format:\"regex\",...A(t),pattern:e})}function xd(e){return new Hv({check:\"string_format\",format:\"lowercase\",...A(e)})}function wd(e){return new Bv({check:\"string_format\",format:\"uppercase\",...A(e)})}function $d(e,t){return new Wv({check:\"string_format\",format:\"includes\",...A(t),includes:e})}function kd(e,t){return new Gv({check:\"string_format\",format:\"starts_with\",...A(t),prefix:e})}function Rd(e,t){return new Kv({check:\"string_format\",format:\"ends_with\",...A(t),suffix:e})}function ur(e){return new Yv({check:\"overwrite\",tx:e})}function Pd(e){return ur((t)=>t.normalize(e))}function Td(){return ur((e)=>e.trim())}function Ed(){return ur((e)=>e.toLowerCase())}function Id(){return ur((e)=>e.toUpperCase())}function Od(){return ur((e)=>By(e))}function qw(e,t,r){return new e({type:\"array\",element:t,...A(r)})}function Lw(e,t,r){return new e({type:\"custom\",check:\"custom\",fn:t,...A(r)})}function Uw(e,t){let r=tE((o)=>(o.addIssue=(n)=>{if(typeof n===\"string\")o.issues.push(Xr(n,o.value,r._zod.def));else{let i=n;if(i.fatal)i.continue=!1;i.code??(i.code=\"custom\"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(Xr(i))}},e(o.value,o)),t);return r}function tE(e,t){let r=new Ze({check:\"custom\",...A(t)});return r._zod.check=e,r}function Cd(e){let t=e?.target??\"draft-2020-12\";if(t===\"draft-4\")t=\"draft-04\";if(t===\"draft-7\")t=\"draft-07\";return{processors:e.processors??{},metadataRegistry:e?.metadata??cr,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 we(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{let h=s.schema,f=t.processors[n.type];if(!f)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(e,t,h,l)}let m=e._zod.parent;if(m){if(!s.ref)s.ref=m;we(m,t,l),t.seen.get(m).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)Object.assign(s.schema,c);if(t.io===\"input\"&&De(e))delete s.schema.examples,delete s.schema.default;if(t.io===\"input\"&&\"_prefault\"in s.schema)(o=s.schema).default??(o.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function Zd(e,t){let r=e.seen.get(t);if(!r)throw Error(\"Unprocessed schema. This is a bug in Zod.\");let o=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=o.get(a);if(c&&c!==s[0])throw Error(`Duplicate schema id \"${a}\" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,s[0])}}let n=(s)=>{let a=e.target===\"draft-2020-12\"?\"$defs\":\"definitions\";if(e.external){let m=e.external.registry.get(s[0])?.id,h=e.external.uri??((b)=>b);if(m)return{ref:h(m)};let f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${h(\"__shared\")}#/${a}/${f}`}}if(s[1]===r)return{ref:\"#\"};let u=`${\"#\"}/${a}/`,l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},i=(s)=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=n(s);if(a.def={...a.schema},u)a.defId=u;let l=a.schema;for(let m in l)delete l[m];l.$ref=c};if(e.cycles===\"throw\")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw Error(`Cycle detected: #/${a.cycle?.join(\"/\")}/<root>\n\nSet the \\`cycles\\` parameter to \\`\"ref\"\\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1){if(e.reused===\"ref\"){i(s);continue}}}}function Nd(e,t){let r=e.seen.get(t);if(!r)throw Error(\"Unprocessed schema. This is a bug in Zod.\");let o=(a)=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},m=c.ref;if(c.ref=null,m){o(m);let f=e.seen.get(m),b=f.schema;if(b.$ref&&(e.target===\"draft-07\"||e.target===\"draft-04\"||e.target===\"openapi-3.0\"))u.allOf=u.allOf??[],u.allOf.push(b);else Object.assign(u,b);if(Object.assign(u,l),a._zod.parent===m)for(let x in u){if(x===\"$ref\"||x===\"allOf\")continue;if(!(x in l))delete u[x]}if(b.$ref&&f.def)for(let x in u){if(x===\"$ref\"||x===\"allOf\")continue;if(x in f.def&&JSON.stringify(u[x])===JSON.stringify(f.def[x]))delete u[x]}}let h=a._zod.parent;if(h&&h!==m){o(h);let f=e.seen.get(h);if(f?.schema.$ref){if(u.$ref=f.schema.$ref,f.def)for(let b in u){if(b===\"$ref\"||b===\"allOf\")continue;if(b in f.def&&JSON.stringify(u[b])===JSON.stringify(f.def[b]))delete u[b]}}}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...e.seen.entries()].reverse())o(a[0]);let n={};if(e.target===\"draft-2020-12\")n.$schema=\"https://json-schema.org/draft/2020-12/schema\";else if(e.target===\"draft-07\")n.$schema=\"http://json-schema.org/draft-07/schema#\";else if(e.target===\"draft-04\")n.$schema=\"http://json-schema.org/draft-04/schema#\";else if(e.target===\"openapi-3.0\");if(e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw Error(\"Schema is missing an `id` property\");n.$id=e.external.uri(a)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&n.id===i)delete n.id;let s=e.external?.defs??{};for(let a of e.seen.entries()){let c=a[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;s[c.defId]=c.def}}if(e.external);else if(Object.keys(s).length>0)if(e.target===\"draft-2020-12\")n.$defs=s;else n.definitions=s;try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,\"~standard\",{value:{...t[\"~standard\"],jsonSchema:{input:$a(t,\"input\",e.processors),output:$a(t,\"output\",e.processors)}},enumerable:!1,writable:!1}),a}catch(a){throw Error(\"Error converting schema to JSON.\")}}function De(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 De(o.element,r);if(o.type===\"set\")return De(o.valueType,r);if(o.type===\"lazy\")return De(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 De(o.innerType,r);if(o.type===\"intersection\")return De(o.left,r)||De(o.right,r);if(o.type===\"record\"||o.type===\"map\")return De(o.keyType,r)||De(o.valueType,r);if(o.type===\"pipe\"){if(e._zod.traits.has(\"$ZodCodec\"))return!0;return De(o.in,r)||De(o.out,r)}if(o.type===\"object\"){for(let n in o.shape)if(De(o.shape[n],r))return!0;return!1}if(o.type===\"union\"){for(let n of o.options)if(De(n,r))return!0;return!1}if(o.type===\"tuple\"){for(let n of o.items)if(De(n,r))return!0;if(o.rest&&De(o.rest,r))return!0;return!1}return!1}var Dw=(e,t={})=>(r)=>{let o=Cd({...r,processors:t});return we(e,o),Zd(o,e),Nd(o,e)},$a=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:i}=o??{},s=Cd({...n??{},target:i,io:t,processors:r});return we(e,s),Zd(s,e),Nd(s,e)};var rE={guid:\"uuid\",url:\"uri\",datetime:\"date-time\",json_string:\"json-string\",regex:\"\"},Fw=(e,t,r,o)=>{let n=r;n.type=\"string\";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof i===\"number\")n.minLength=i;if(typeof s===\"number\")n.maxLength=s;if(a){if(n.format=rE[a]??a,n.format===\"\")delete n.format;if(a===\"time\")delete n.format}if(u)n.contentEncoding=u;if(c&&c.size>0){let l=[...c];if(l.length===1)n.pattern=l[0].source;else if(l.length>1)n.allOf=[...l.map((m)=>({...t.target===\"draft-07\"||t.target===\"draft-04\"||t.target===\"openapi-3.0\"?{type:\"string\"}:{},pattern:m.source}))]}},Vw=(e,t,r,o)=>{let n=r,{minimum:i,maximum:s,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;if(typeof a===\"string\"&&a.includes(\"int\"))n.type=\"integer\";else n.type=\"number\";let m=typeof l===\"number\"&&l>=(i??Number.NEGATIVE_INFINITY),h=typeof u===\"number\"&&u<=(s??Number.POSITIVE_INFINITY),f=t.target===\"draft-04\"||t.target===\"openapi-3.0\";if(m)if(f)n.minimum=l,n.exclusiveMinimum=!0;else n.exclusiveMinimum=l;else if(typeof i===\"number\")n.minimum=i;if(h)if(f)n.maximum=u,n.exclusiveMaximum=!0;else n.exclusiveMaximum=u;else if(typeof s===\"number\")n.maximum=s;if(typeof c===\"number\")n.multipleOf=c},Jw=(e,t,r,o)=>{r.type=\"boolean\"};var Hw=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"Undefined cannot be represented in JSON Schema\")};var Bw=(e,t,r,o)=>{r.not={}},Ww=(e,t,r,o)=>{},Gw=(e,t,r,o)=>{};var Kw=(e,t,r,o)=>{let n=e._zod.def,i=gu(n.entries);if(i.every((s)=>typeof s===\"number\"))r.type=\"number\";if(i.every((s)=>typeof s===\"string\"))r.type=\"string\";r.enum=i},Yw=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable===\"throw\")throw Error(\"Literal `undefined` cannot be represented in JSON Schema\")}else if(typeof s===\"bigint\")if(t.unrepresentable===\"throw\")throw Error(\"BigInt literals cannot be represented in JSON Schema\");else i.push(Number(s));else i.push(s);if(i.length===0);else if(i.length===1){let s=i[0];if(r.type=s===null?\"null\":typeof s,t.target===\"draft-04\"||t.target===\"openapi-3.0\")r.enum=[s];else r.const=s}else{if(i.every((s)=>typeof s===\"number\"))r.type=\"number\";if(i.every((s)=>typeof s===\"string\"))r.type=\"string\";if(i.every((s)=>typeof s===\"boolean\"))r.type=\"boolean\";if(i.every((s)=>s===null))r.type=\"null\";r.enum=i}};var Qw=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"Custom types cannot be represented in JSON Schema\")};var Xw=(e,t,r,o)=>{if(t.unrepresentable===\"throw\")throw Error(\"Transforms cannot be represented in JSON Schema\")};var e$=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;if(typeof s===\"number\")n.minItems=s;if(typeof a===\"number\")n.maxItems=a;n.type=\"array\",n.items=we(i.element,t,{...o,path:[...o.path,\"items\"]})},t$=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type=\"object\",n.properties={};let s=i.shape;for(let u in s)n.properties[u]=we(s[u],t,{...o,path:[...o.path,\"properties\",u]});let a=new Set(Object.keys(s)),c=new Set([...a].filter((u)=>{let l=i.shape[u]._zod;if(t.io===\"input\")return l.optin===void 0;else return l.optout===void 0}));if(c.size>0)n.required=Array.from(c);if(i.catchall?._zod.def.type===\"never\")n.additionalProperties=!1;else if(!i.catchall){if(t.io===\"output\")n.additionalProperties=!1}else if(i.catchall)n.additionalProperties=we(i.catchall,t,{...o,path:[...o.path,\"additionalProperties\"]})},r$=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,s=n.options.map((a,c)=>we(a,t,{...o,path:[...o.path,i?\"oneOf\":\"anyOf\",c]}));if(i)r.oneOf=s;else r.anyOf=s},o$=(e,t,r,o)=>{let n=e._zod.def,i=we(n.left,t,{...o,path:[...o.path,\"allOf\",0]}),s=we(n.right,t,{...o,path:[...o.path,\"allOf\",1]}),a=(u)=>(\"allOf\"in u)&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=c};var n$=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type=\"object\";let s=i.keyType,c=s._zod.bag?.patterns;if(i.mode===\"loose\"&&c&&c.size>0){let l=we(i.valueType,t,{...o,path:[...o.path,\"patternProperties\",\"*\"]});n.patternProperties={};for(let m of c)n.patternProperties[m.source]=l}else{if(t.target===\"draft-07\"||t.target===\"draft-2020-12\")n.propertyNames=we(i.keyType,t,{...o,path:[...o.path,\"propertyNames\"]});n.additionalProperties=we(i.valueType,t,{...o,path:[...o.path,\"additionalProperties\"]})}let u=s._zod.values;if(u){let l=[...u].filter((m)=>typeof m===\"string\"||typeof m===\"number\");if(l.length>0)n.required=l}},s$=(e,t,r,o)=>{let n=e._zod.def,i=we(n.innerType,t,o),s=t.seen.get(e);if(t.target===\"openapi-3.0\")s.ref=n.innerType,r.nullable=!0;else r.anyOf=[i,{type:\"null\"}]},i$=(e,t,r,o)=>{let n=e._zod.def;we(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},a$=(e,t,r,o)=>{let n=e._zod.def;we(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},c$=(e,t,r,o)=>{let n=e._zod.def;we(n.innerType,t,o);let i=t.seen.get(e);if(i.ref=n.innerType,t.io===\"input\")r._prefault=JSON.parse(JSON.stringify(n.defaultValue))},u$=(e,t,r,o)=>{let n=e._zod.def;we(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw Error(\"Dynamic catch values are not supported in JSON Schema\")}r.default=s},l$=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has(\"$ZodTransform\"),s=t.io===\"input\"?i?n.out:n.in:n.out;we(s,t,o);let a=t.seen.get(e);a.ref=s},p$=(e,t,r,o)=>{let n=e._zod.def;we(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0};var Ad=(e,t,r,o)=>{let n=e._zod.def;we(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType};var lE=z(\"ZodISODateTime\",(e,t)=>{zx.init(e,t),_e.init(e,t)});function d$(e){return Pw(lE,e)}var pE=z(\"ZodISODate\",(e,t)=>{bx.init(e,t),_e.init(e,t)});function m$(e){return Tw(pE,e)}var dE=z(\"ZodISOTime\",(e,t)=>{yx.init(e,t),_e.init(e,t)});function h$(e){return Ew(dE,e)}var mE=z(\"ZodISODuration\",(e,t)=>{vx.init(e,t),_e.init(e,t)});function f$(e){return Iw(mE,e)}var fE=(e,t)=>{yu.init(e,t),e.name=\"ZodError\",Object.defineProperties(e,{format:{value:(r)=>ld(e,r)},flatten:{value:(r)=>ud(e,r)},addIssue:{value:(r)=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Sa,2)}},addIssues:{value:(r)=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Sa,2)}},isEmpty:{get(){return e.issues.length===0}}})};var et=z(\"ZodError\",fE,{Parent:Error});var _$=vu(et),S$=xu(et),z$=za(et),b$=ba(et),y$=ov(et),v$=nv(et),x$=sv(et),w$=iv(et),$$=av(et),k$=cv(et),R$=uv(et),P$=lv(et);var T$=new WeakMap;function Ra(e,t,r){let o=Object.getPrototypeOf(e),n=T$.get(o);if(!n)n=new Set,T$.set(o,n);if(n.has(t))return;n.add(t);for(let i in r){let s=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}var pe=z(\"ZodType\",(e,t)=>(ie.init(e,t),Object.assign(e[\"~standard\"],{jsonSchema:{input:$a(e,\"input\"),output:$a(e,\"output\")}}),e.toJSONSchema=Dw(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,\"_def\",{value:t}),e.parse=(r,o)=>_$(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>z$(e,r,o),e.parseAsync=async(r,o)=>S$(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>b$(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>y$(e,r,o),e.decode=(r,o)=>v$(e,r,o),e.encodeAsync=async(r,o)=>x$(e,r,o),e.decodeAsync=async(r,o)=>w$(e,r,o),e.safeEncode=(r,o)=>$$(e,r,o),e.safeDecode=(r,o)=>k$(e,r,o),e.safeEncodeAsync=async(r,o)=>R$(e,r,o),e.safeDecodeAsync=async(r,o)=>P$(e,r,o),Ra(e,\"ZodType\",{check(...r){let o=this.def;return this.clone(sr(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 lt(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(lI(r,o))},superRefine(r,o){return this.check(pI(r,o))},overwrite(r){return this.check(ur(r))},optional(){return C$(this)},exactOptional(){return YE(this)},nullable(){return Z$(this)},nullish(){return C$(Z$(this))},nonoptional(r){return oI(this,r)},array(){return rt(this)},or(r){return ot([this,r])},and(r){return JE(this,r)},transform(r){return N$(this,GE(r))},default(r){return eI(this,r)},prefault(r){return rI(this,r)},catch(r){return sI(this,r)},pipe(r){return N$(this,r)},readonly(){return cI(this)},describe(r){let o=this.clone();return cr.add(o,{description:r}),o},meta(...r){if(r.length===0)return cr.get(this);let o=this.clone();return cr.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 cr.get(e)?.description},configurable:!0}),e)),A$=z(\"_ZodString\",(e,t)=>{ku.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Fw(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Ra(e,\"_ZodString\",{regex(...o){return this.check(vd(...o))},includes(...o){return this.check($d(...o))},startsWith(...o){return this.check(kd(...o))},endsWith(...o){return this.check(Rd(...o))},min(...o){return this.check(en(...o))},max(...o){return this.check(Eu(...o))},length(...o){return this.check(Iu(...o))},nonempty(...o){return this.check(en(1,...o))},lowercase(o){return this.check(xd(o))},uppercase(o){return this.check(wd(o))},trim(){return this.check(Td())},normalize(...o){return this.check(Pd(...o))},toLowerCase(){return this.check(Ed())},toUpperCase(){return this.check(Id())},slugify(){return this.check(Od())}})}),_E=z(\"ZodString\",(e,t)=>{ku.init(e,t),A$.init(e,t),e.email=(r)=>e.check(aw(SE,r)),e.url=(r)=>e.check(dw(zE,r)),e.jwt=(r)=>e.check(Rw(ZE,r)),e.emoji=(r)=>e.check(mw(bE,r)),e.guid=(r)=>e.check(yd(E$,r)),e.uuid=(r)=>e.check(cw(Ou,r)),e.uuidv4=(r)=>e.check(uw(Ou,r)),e.uuidv6=(r)=>e.check(lw(Ou,r)),e.uuidv7=(r)=>e.check(pw(Ou,r)),e.nanoid=(r)=>e.check(hw(yE,r)),e.guid=(r)=>e.check(yd(E$,r)),e.cuid=(r)=>e.check(fw(vE,r)),e.cuid2=(r)=>e.check(gw(xE,r)),e.ulid=(r)=>e.check(_w(wE,r)),e.base64=(r)=>e.check(ww(IE,r)),e.base64url=(r)=>e.check($w(OE,r)),e.xid=(r)=>e.check(Sw($E,r)),e.ksuid=(r)=>e.check(zw(kE,r)),e.ipv4=(r)=>e.check(bw(RE,r)),e.ipv6=(r)=>e.check(yw(PE,r)),e.cidrv4=(r)=>e.check(vw(TE,r)),e.cidrv6=(r)=>e.check(xw(EE,r)),e.e164=(r)=>e.check(kw(CE,r)),e.datetime=(r)=>e.check(d$(r)),e.date=(r)=>e.check(m$(r)),e.time=(r)=>e.check(h$(r)),e.duration=(r)=>e.check(f$(r))});function te(e){return iw(_E,e)}var _e=z(\"ZodStringFormat\",(e,t)=>{le.init(e,t),A$.init(e,t)}),SE=z(\"ZodEmail\",(e,t)=>{lx.init(e,t),_e.init(e,t)});var E$=z(\"ZodGUID\",(e,t)=>{cx.init(e,t),_e.init(e,t)});var Ou=z(\"ZodUUID\",(e,t)=>{ux.init(e,t),_e.init(e,t)});var zE=z(\"ZodURL\",(e,t)=>{px.init(e,t),_e.init(e,t)});var bE=z(\"ZodEmoji\",(e,t)=>{dx.init(e,t),_e.init(e,t)});var yE=z(\"ZodNanoID\",(e,t)=>{mx.init(e,t),_e.init(e,t)});var vE=z(\"ZodCUID\",(e,t)=>{hx.init(e,t),_e.init(e,t)});var xE=z(\"ZodCUID2\",(e,t)=>{fx.init(e,t),_e.init(e,t)});var wE=z(\"ZodULID\",(e,t)=>{gx.init(e,t),_e.init(e,t)});var $E=z(\"ZodXID\",(e,t)=>{_x.init(e,t),_e.init(e,t)});var kE=z(\"ZodKSUID\",(e,t)=>{Sx.init(e,t),_e.init(e,t)});var RE=z(\"ZodIPv4\",(e,t)=>{xx.init(e,t),_e.init(e,t)});var PE=z(\"ZodIPv6\",(e,t)=>{wx.init(e,t),_e.init(e,t)});var TE=z(\"ZodCIDRv4\",(e,t)=>{$x.init(e,t),_e.init(e,t)});var EE=z(\"ZodCIDRv6\",(e,t)=>{kx.init(e,t),_e.init(e,t)});var IE=z(\"ZodBase64\",(e,t)=>{Px.init(e,t),_e.init(e,t)});var OE=z(\"ZodBase64URL\",(e,t)=>{Tx.init(e,t),_e.init(e,t)});var CE=z(\"ZodE164\",(e,t)=>{Ex.init(e,t),_e.init(e,t)});var ZE=z(\"ZodJWT\",(e,t)=>{Ix.init(e,t),_e.init(e,t)});var j$=z(\"ZodNumber\",(e,t)=>{Sd.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Vw(e,o,n,i),Ra(e,\"ZodNumber\",{gt(o,n){return this.check(Pu(o,n))},gte(o,n){return this.check(wa(o,n))},min(o,n){return this.check(wa(o,n))},lt(o,n){return this.check(Ru(o,n))},lte(o,n){return this.check(xa(o,n))},max(o,n){return this.check(xa(o,n))},int(o){return this.check(I$(o))},safe(o){return this.check(I$(o))},positive(o){return this.check(Pu(0,o))},nonnegative(o){return this.check(wa(0,o))},negative(o){return this.check(Ru(0,o))},nonpositive(o){return this.check(xa(0,o))},multipleOf(o,n){return this.check(Tu(o,n))},step(o,n){return this.check(Tu(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??0.5),e.isFinite=!0,e.format=r.format??null});function vt(e){return Ow(j$,e)}var NE=z(\"ZodNumberFormat\",(e,t)=>{Ox.init(e,t),j$.init(e,t)});function I$(e){return Cw(NE,e)}var AE=z(\"ZodBoolean\",(e,t)=>{Cx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jw(e,r,o,n)});function Nt(e){return Zw(AE,e)}var jE=z(\"ZodUndefined\",(e,t)=>{Zx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hw(e,r,o,n)});function Md(e){return Nw(jE,e)}var ME=z(\"ZodAny\",(e,t)=>{Nx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ww(e,r,o,n)});function M$(){return Aw(ME)}var qE=z(\"ZodUnknown\",(e,t)=>{Ax.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gw(e,r,o,n)});function tn(){return jw(qE)}var LE=z(\"ZodNever\",(e,t)=>{jx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bw(e,r,o,n)});function qd(e){return Mw(LE,e)}var UE=z(\"ZodArray\",(e,t)=>{Mx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>e$(e,r,o,n),e.element=t.element,Ra(e,\"ZodArray\",{min(r,o){return this.check(en(r,o))},nonempty(r){return this.check(en(1,r))},max(r,o){return this.check(Eu(r,o))},length(r,o){return this.check(Iu(r,o))},unwrap(){return this.element}})});function rt(e,t){return qw(UE,e,t)}var DE=z(\"ZodObject\",(e,t)=>{Ux.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>t$(e,r,o,n),Q(e,\"shape\",()=>t.shape),Ra(e,\"ZodObject\",{keyof(){return HE(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:tn()})},loose(){return this.clone({...this._zod.def,catchall:tn()})},strict(){return this.clone({...this._zod.def,catchall:qd()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return DT(this,r)},safeExtend(r){return FT(this,r)},merge(r){return VT(this,r)},pick(r){return LT(this,r)},omit(r){return UT(this,r)},partial(...r){return JT(q$,this,r[0])},required(...r){return HT(L$,this,r[0])}})});function T(e,t){let r={type:\"object\",shape:e??{},...A(t)};return new DE(r)}var FE=z(\"ZodUnion\",(e,t)=>{Dx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>r$(e,r,o,n),e.options=t.options});function ot(e,t){return new FE({type:\"union\",options:e,...A(t)})}var VE=z(\"ZodIntersection\",(e,t)=>{Fx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>o$(e,r,o,n)});function JE(e,t){return new VE({type:\"intersection\",left:e,right:t})}var O$=z(\"ZodRecord\",(e,t)=>{Vx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>n$(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function At(e,t,r){if(!t||!t._zod)return new O$({type:\"record\",keyType:te(),valueType:e,...A(t)});return new O$({type:\"record\",keyType:e,valueType:t,...A(r)})}var jd=z(\"ZodEnum\",(e,t)=>{Jx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Kw(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new jd({...t,checks:[],...A(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let s of o)if(r.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new jd({...t,checks:[],...A(n),entries:i})}});function HE(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new jd({type:\"enum\",entries:r,...A(t)})}var BE=z(\"ZodLiteral\",(e,t)=>{Hx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yw(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,\"value\",{get(){if(t.values.length>1)throw Error(\"This schema contains multiple valid literal values. Use `.values` instead.\");return t.values[0]}})});function y(e,t){return new BE({type:\"literal\",values:Array.isArray(e)?e:[e],...A(t)})}var WE=z(\"ZodTransform\",(e,t)=>{Bx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xw(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction===\"backward\")throw new ga(e.constructor.name);r.addIssue=(i)=>{if(typeof i===\"string\")r.issues.push(Xr(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;s.code??(s.code=\"custom\"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(Xr(s))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((i)=>(r.value=i,r.fallback=!0,r));return r.value=n,r.fallback=!0,r}});function GE(e){return new WE({type:\"transform\",transform:e})}var q$=z(\"ZodOptional\",(e,t)=>{zd.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ad(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function C$(e){return new q$({type:\"optional\",innerType:e})}var KE=z(\"ZodExactOptional\",(e,t)=>{Wx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ad(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function YE(e){return new KE({type:\"optional\",innerType:e})}var QE=z(\"ZodNullable\",(e,t)=>{Gx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>s$(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Z$(e){return new QE({type:\"nullable\",innerType:e})}var XE=z(\"ZodDefault\",(e,t)=>{Kx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>a$(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function eI(e,t){return new XE({type:\"default\",innerType:e,get defaultValue(){return typeof t===\"function\"?t():id(t)}})}var tI=z(\"ZodPrefault\",(e,t)=>{Yx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>c$(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function rI(e,t){return new tI({type:\"prefault\",innerType:e,get defaultValue(){return typeof t===\"function\"?t():id(t)}})}var L$=z(\"ZodNonOptional\",(e,t)=>{Qx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>i$(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function oI(e,t){return new L$({type:\"nonoptional\",innerType:e,...A(t)})}var nI=z(\"ZodCatch\",(e,t)=>{Xx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>u$(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function sI(e,t){return new nI({type:\"catch\",innerType:e,catchValue:typeof t===\"function\"?t:()=>t})}var iI=z(\"ZodPipe\",(e,t)=>{ew.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>l$(e,r,o,n),e.in=t.in,e.out=t.out});function N$(e,t){return new iI({type:\"pipe\",in:e,out:t})}var aI=z(\"ZodReadonly\",(e,t)=>{tw.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>p$(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function cI(e){return new aI({type:\"readonly\",innerType:e})}var uI=z(\"ZodCustom\",(e,t)=>{rw.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qw(e,r,o,n)});function lI(e,t={}){return Lw(uI,e,t)}function pI(e,t){return Uw(e,t)}Ue(bd());class H${_eventSlots=new Map;setHandler(e,t){let r=this._ensureEventSlot(e);if(r.onHandler&&t)console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener(\"${String(e)}\", …) to add multiple listeners without replacing.`);r.onHandler=t}getHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let r=this._eventSlots.get(e);if(!r)return;let o=r.listeners.indexOf(t);if(o!==-1)r.listeners.splice(o,1)}dispatch(e,t){let r=this._eventSlots.get(e);if(!r)return;r.onHandler?.(t);for(let o of[...r.listeners])o(t)}_ensureEventSlot(e){let t=this._eventSlots.get(e);if(!t)t={listeners:[]},this._eventSlots.set(e,t);return t}}class B${_methods=new Set;claim(e,t){if(this._methods.has(e))throw Error(`Handler for \"${e}\" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(e)}replace(e){this._methods.add(e)}release(e){this._methods.delete(e)}has(e){return this._methods.has(e)}}var U$=new Set;function D$(e,t){let[r,o]=t,n=r?.shape;if(typeof n?.method?.value!==\"string\")return;let i=n.method.value,s=e===\"request\"?\"setRequestHandler\":\"setNotificationHandler\";if(!U$.has(s))U$.add(s),console.warn(`[ext-apps] ${s}(Schema, handler) is deprecated; use ${s}(\"${i}\", { params: Schema.shape.params }, handler).`);let a=o;return[i,{params:n.params},e===\"request\"?(c,u)=>a({method:i,params:c},dI(u)):(c)=>a({method:i,params:c})]}function dI(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var mI=\"2026-01-26\";var hI=\"ui/notifications/tool-input-partial\";class W${eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=(r)=>{if(t&&r.source!==this.eventSource){console.debug(\"Ignoring message from unknown source\",r);return}let o=Cr.safeParse(r.data);if(o.success)console.debug(\"Parsed message\",o.data),this.onmessage?.(o.data);else if(r.data?.jsonrpc!==\"2.0\")console.debug(\"Ignoring non-JSON-RPC message\",o.error.message,r);else console.error(\"Failed to parse message\",o.error.message,r),this.onerror?.(Error(\"Invalid JSON-RPC message received: \"+o.error.message))}}async start(){window.addEventListener(\"message\",this.messageListener)}async send(e,t){if(e.method!==hI)console.debug(\"Sending message\",e);this.eventTarget.postMessage(e,\"*\")}async close(){window.removeEventListener(\"message\",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var fI=ot([y(\"light\"),y(\"dark\")]).describe(\"Color theme preference for the host environment.\"),Pa=ot([y(\"inline\"),y(\"fullscreen\"),y(\"pip\")]).describe(\"Display mode for UI presentation.\"),gI=ot([y(\"--color-background-primary\"),y(\"--color-background-secondary\"),y(\"--color-background-tertiary\"),y(\"--color-background-inverse\"),y(\"--color-background-ghost\"),y(\"--color-background-info\"),y(\"--color-background-danger\"),y(\"--color-background-success\"),y(\"--color-background-warning\"),y(\"--color-background-disabled\"),y(\"--color-text-primary\"),y(\"--color-text-secondary\"),y(\"--color-text-tertiary\"),y(\"--color-text-inverse\"),y(\"--color-text-ghost\"),y(\"--color-text-info\"),y(\"--color-text-danger\"),y(\"--color-text-success\"),y(\"--color-text-warning\"),y(\"--color-text-disabled\"),y(\"--color-border-primary\"),y(\"--color-border-secondary\"),y(\"--color-border-tertiary\"),y(\"--color-border-inverse\"),y(\"--color-border-ghost\"),y(\"--color-border-info\"),y(\"--color-border-danger\"),y(\"--color-border-success\"),y(\"--color-border-warning\"),y(\"--color-border-disabled\"),y(\"--color-ring-primary\"),y(\"--color-ring-secondary\"),y(\"--color-ring-inverse\"),y(\"--color-ring-info\"),y(\"--color-ring-danger\"),y(\"--color-ring-success\"),y(\"--color-ring-warning\"),y(\"--font-sans\"),y(\"--font-mono\"),y(\"--font-weight-normal\"),y(\"--font-weight-medium\"),y(\"--font-weight-semibold\"),y(\"--font-weight-bold\"),y(\"--font-text-xs-size\"),y(\"--font-text-sm-size\"),y(\"--font-text-md-size\"),y(\"--font-text-lg-size\"),y(\"--font-heading-xs-size\"),y(\"--font-heading-sm-size\"),y(\"--font-heading-md-size\"),y(\"--font-heading-lg-size\"),y(\"--font-heading-xl-size\"),y(\"--font-heading-2xl-size\"),y(\"--font-heading-3xl-size\"),y(\"--font-text-xs-line-height\"),y(\"--font-text-sm-line-height\"),y(\"--font-text-md-line-height\"),y(\"--font-text-lg-line-height\"),y(\"--font-heading-xs-line-height\"),y(\"--font-heading-sm-line-height\"),y(\"--font-heading-md-line-height\"),y(\"--font-heading-lg-line-height\"),y(\"--font-heading-xl-line-height\"),y(\"--font-heading-2xl-line-height\"),y(\"--font-heading-3xl-line-height\"),y(\"--border-radius-xs\"),y(\"--border-radius-sm\"),y(\"--border-radius-md\"),y(\"--border-radius-lg\"),y(\"--border-radius-xl\"),y(\"--border-radius-full\"),y(\"--border-width-regular\"),y(\"--shadow-hairline\"),y(\"--shadow-sm\"),y(\"--shadow-md\"),y(\"--shadow-lg\")]).describe(\"CSS variable keys available to MCP apps for theming.\"),_I=At(gI.describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),ot([te(),Md()]).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),o1=T({method:y(\"ui/open-link\"),params:T({url:te().describe(\"URL to open in the host's browser\")})}),SI=T({isError:Nt().optional().describe(\"True if the host failed to open the URL (e.g., due to security policy).\")}).passthrough(),zI=T({isError:Nt().optional().describe(\"True if the download failed (e.g., user cancelled or host denied).\")}).passthrough(),bI=T({isError:Nt().optional().describe(\"True if the host rejected or failed to deliver the message.\")}).passthrough(),n1=T({method:y(\"ui/notifications/sandbox-proxy-ready\"),params:T({})}),Ud=T({connectDomains:rt(te()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP \\`connect-src\\` directive\n- Empty or omitted → no network connections (secure default)`),resourceDomains:rt(te()).optional().describe(\"Origins for static resources (images, scripts, stylesheets, fonts, media).\\n\\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\\n- Wildcard subdomains supported: `https://*.example.com`\\n- Empty or omitted → no network resources (secure default)\"),frameDomains:rt(te()).optional().describe(\"Origins for nested iframes.\\n\\n- Maps to CSP `frame-src` directive\\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)\"),baseUriDomains:rt(te()).optional().describe(\"Allowed base URIs for the document.\\n\\n- Maps to CSP `base-uri` directive\\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)\")}),Dd=T({camera:T({}).optional().describe(\"Request camera access.\\n\\nMaps to Permission Policy `camera` feature.\"),microphone:T({}).optional().describe(\"Request microphone access.\\n\\nMaps to Permission Policy `microphone` feature.\"),geolocation:T({}).optional().describe(\"Request geolocation access.\\n\\nMaps to Permission Policy `geolocation` feature.\"),clipboardWrite:T({}).optional().describe(\"Request clipboard write access.\\n\\nMaps to Permission Policy `clipboard-write` feature.\")}),s1=T({method:y(\"ui/notifications/size-changed\"),params:T({width:vt().optional().describe(\"New width in pixels.\"),height:vt().optional().describe(\"New height in pixels.\")})}),yI=T({method:y(\"ui/notifications/tool-input\"),params:T({arguments:At(te(),tn().describe(\"Complete tool call arguments as key-value pairs.\")).optional().describe(\"Complete tool call arguments as key-value pairs.\")})}),vI=T({method:y(\"ui/notifications/tool-input-partial\"),params:T({arguments:At(te(),tn().describe(\"Partial tool call arguments (incomplete, may change).\")).optional().describe(\"Partial tool call arguments (incomplete, may change).\")})}),xI=T({method:y(\"ui/notifications/tool-cancelled\"),params:T({reason:te().optional().describe('Optional reason for the cancellation (e.g., \"user action\", \"timeout\").')})}),wI=T({fonts:te().optional()}),$I=T({variables:_I.optional().describe(\"CSS variables for theming the app.\"),css:wI.optional().describe(\"CSS blocks that apps can inject.\")}),kI=T({method:y(\"ui/resource-teardown\"),params:T({})}),RI=At(te(),tn()),F$=T({text:T({}).optional().describe(\"Host supports text content blocks.\"),image:T({}).optional().describe(\"Host supports image content blocks.\"),audio:T({}).optional().describe(\"Host supports audio content blocks.\"),resource:T({}).optional().describe(\"Host supports resource content blocks.\"),resourceLink:T({}).optional().describe(\"Host supports resource link content blocks.\"),structuredContent:T({}).optional().describe(\"Host supports structured content.\")}),i1=T({method:y(\"ui/notifications/request-teardown\"),params:T({}).optional()}),PI=T({experimental:At(te(),At(te(),M$()).describe(\"Experimental features keyed by identifier.\")).optional().describe(\"Experimental features keyed by identifier.\"),openLinks:T({}).optional().describe(\"Host supports opening external URLs.\"),downloadFile:T({}).optional().describe(\"Host supports file downloads via ui/download-file.\"),serverTools:T({listChanged:Nt().optional().describe(\"Host supports tools/list_changed notifications.\")}).optional().describe(\"Host can proxy tool calls to the MCP server.\"),serverResources:T({listChanged:Nt().optional().describe(\"Host supports resources/list_changed notifications.\")}).optional().describe(\"Host can proxy resource reads to the MCP server.\"),logging:T({}).optional().describe(\"Host accepts log messages.\"),sandbox:T({permissions:Dd.optional().describe(\"Permissions granted by the host (camera, microphone, geolocation).\"),csp:Ud.optional().describe(\"CSP domains approved by the host.\")}).optional().describe(\"Sandbox configuration applied by the host.\"),updateModelContext:F$.optional().describe(\"Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.\"),message:F$.optional().describe(\"Host supports receiving content messages (ui/message) from the view.\"),sampling:T({tools:T({}).optional().describe(\"Host supports tool use via `tools` and `toolChoice` parameters.\")}).optional().describe(\"Host supports LLM sampling (sampling/createMessage) from the view.\\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.\")}),TI=T({experimental:At(te(),At(te(),M$()).describe(\"Experimental features keyed by identifier.\")).optional().describe(\"Experimental features keyed by identifier.\"),tools:T({listChanged:Nt().optional().describe(\"App supports tools/list_changed notifications.\")}).optional().describe(\"App exposes MCP-style tools that the host can call.\"),availableDisplayModes:rt(Pa).optional().describe(\"Display modes the app supports.\")}),a1=T({method:y(\"ui/notifications/initialized\"),params:T({}).optional()}),c1=T({csp:Ud.optional().describe(\"Content Security Policy configuration for UI resources.\"),permissions:Dd.optional().describe(\"Sandbox permissions requested by the UI resource.\"),domain:te().optional().describe(`Dedicated origin for view sandbox.\n\nUseful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.\n\n**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:\n- Hash-based subdomains (e.g., \\`{hash}.claudemcpcontent.com\\`)\n- URL-derived subdomains (e.g., \\`www-example-com.oaiusercontent.com\\`)\n\nIf omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:Nt().optional().describe(`Visual boundary preference - true if view prefers a visible border.\n\nBoolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.\n\n- \\`true\\`: request visible border + background\n- \\`false\\`: request no visible border + background\n- omitted: host decides border`)}),u1=T({method:y(\"ui/request-display-mode\"),params:T({mode:Pa.describe(\"The display mode being requested.\")})}),EI=T({mode:Pa.describe(\"The display mode that was actually set. May differ from requested if not supported.\")}).passthrough(),II=ot([y(\"model\"),y(\"app\")]).describe(\"Tool visibility scope - who can access the tool.\"),l1=T({resourceUri:te().optional(),visibility:rt(II).optional().describe(`Who can access this tool. Default: [\"model\", \"app\"]\n- \"model\": Tool visible to and callable by the agent\n- \"app\": Tool callable by the app from this server only`),csp:qd().optional(),permissions:qd().optional()}),p1=T({mimeTypes:rt(te()).optional().describe('Array of supported MIME types for UI resources.\\nMust include `\"text/html;profile=mcp-app\"` for MCP Apps support.')}),d1=T({method:y(\"ui/download-file\"),params:T({contents:rt(ot([Mr,qr])).describe(\"Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.\")})}),m1=T({method:y(\"ui/message\"),params:T({role:y(\"user\").describe('Message role, currently only \"user\" is supported.'),content:rt(St).describe(\"Message content blocks (text, image, etc.).\")})}),h1=T({method:y(\"ui/notifications/sandbox-resource-ready\"),params:T({html:te().describe(\"HTML content to load into the inner iframe.\"),sandbox:te().optional().describe(\"Optional override for the inner iframe's sandbox attribute.\"),csp:Ud.optional().describe(\"CSP configuration from resource metadata.\"),permissions:Dd.optional().describe(\"Sandbox permissions from resource metadata.\")})}),OI=T({method:y(\"ui/notifications/tool-result\"),params:er.describe(\"Standard MCP tool execution result.\")}),G$=T({toolInfo:T({id:ct.optional().describe(\"JSON-RPC id of the tools/call request.\"),tool:Xt.describe(\"Tool definition including name, inputSchema, etc.\")}).optional().describe(\"Metadata of the tool call that instantiated this App.\"),theme:fI.optional().describe(\"Current color theme preference.\"),styles:$I.optional().describe(\"Style configuration for theming the app.\"),displayMode:Pa.optional().describe(\"How the UI is currently displayed.\"),availableDisplayModes:rt(Pa).optional().describe(\"Display modes the host supports.\"),containerDimensions:ot([T({height:vt().describe(\"Fixed container height in pixels.\")}),T({maxHeight:ot([vt(),Md()]).optional().describe(\"Maximum container height in pixels.\")})]).and(ot([T({width:vt().describe(\"Fixed container width in pixels.\")}),T({maxWidth:ot([vt(),Md()]).optional().describe(\"Maximum container width in pixels.\")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other\ncontainer holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:te().optional().describe(\"User's language and region preference in BCP 47 format.\"),timeZone:te().optional().describe(\"User's timezone in IANA format.\"),userAgent:te().optional().describe(\"Host application identifier.\"),platform:ot([y(\"web\"),y(\"desktop\"),y(\"mobile\")]).optional().describe(\"Platform type for responsive design decisions.\"),deviceCapabilities:T({touch:Nt().optional().describe(\"Whether the device supports touch input.\"),hover:Nt().optional().describe(\"Whether the device supports hover interactions.\")}).optional().describe(\"Device input capabilities.\"),safeAreaInsets:T({top:vt().describe(\"Top safe area inset in pixels.\"),right:vt().describe(\"Right safe area inset in pixels.\"),bottom:vt().describe(\"Bottom safe area inset in pixels.\"),left:vt().describe(\"Left safe area inset in pixels.\")}).optional().describe(\"Mobile safe area boundaries in pixels.\")}).passthrough(),CI=T({method:y(\"ui/notifications/host-context-changed\"),params:G$.describe(\"Partial context update containing only changed fields.\")}),f1=T({method:y(\"ui/update-model-context\"),params:T({content:rt(St).optional().describe(\"Context content blocks (text, image, etc.).\"),structuredContent:At(te(),tn().describe(\"Structured content for machine-readable context data.\")).optional().describe(\"Structured content for machine-readable context data.\")})}),g1=T({method:y(\"ui/initialize\"),params:T({appInfo:gt.describe(\"App identification (name and version).\"),appCapabilities:TI.describe(\"Features and capabilities this app provides.\"),protocolVersion:te().describe(\"Protocol version this app supports.\")})}),ZI=T({protocolVersion:te().describe('Negotiated protocol version string (e.g., \"2025-11-21\").'),hostInfo:gt.describe(\"Host application identification and version.\"),hostCapabilities:PI.describe(\"Features and capabilities provided by the host.\"),hostContext:G$.describe(\"Rich context about the host environment.\")}).passthrough(),NI={target:\"draft-2020-12\"};async function V$(e,t){let r=e[\"~standard\"];if(r.jsonSchema)return r.jsonSchema[t](NI);throw Error(`Schema (vendor: ${r.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function J$(e,t,r=\"\"){let o=await e[\"~standard\"].validate(t);if(o.issues){let n=o.issues.map((i)=>{let s=i.path?.map((a)=>typeof a===\"object\"?a.key:a).join(\".\");return s?`${s}: ${i.message}`:i.message}).join(\"; \");throw Error(r+n)}return o.value}function K$(e){let t=document.documentElement;t.setAttribute(\"data-theme\",e),t.style.colorScheme=e}function AI(e,t){let r={...e,...t};if(t.experimental!==void 0)r.experimental={...e.experimental,...t.experimental};if(t.tools!==void 0)r.tools={...e.tools,...t.tools};return r}class Cu extends td{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new H$;_methods=new B$;setRequestHandler=(...e)=>{let[t,...r]=D$(\"request\",e)??e;this._methods.claim(t,\"setRequestHandler\"),super.setRequestHandler.call(this,t,...r)};setNotificationHandler=(...e)=>{let[t,...r]=D$(\"notification\",e)??e;this._methods.claim(t,\"setNotificationHandler\"),super.setNotificationHandler.call(this,t,...r)};removeRequestHandler=(e)=>{this._methods.release(e),super.removeRequestHandler(e)};removeNotificationHandler=(e)=>{this._methods.release(e),super.removeNotificationHandler(e)};replaceRequestHandler=(e,...t)=>{this._methods.replace(e),super.setRequestHandler.call(this,e,...t)};_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:yI,toolinputpartial:vI,toolresult:OI,toolcancelled:xI,hostcontextchanged:CI};static ONE_SHOT_EVENTS=new Set([\"toolinput\",\"toolinputpartial\",\"toolresult\",\"toolcancelled\"]);_everHadListener=new Set;_assertHandlerTiming(e){if(!Cu.ONE_SHOT_EVENTS.has(e)||this._everHadListener.has(e))return;if(this._everHadListener.add(e),!this._initializedSent)return;let t=`[ext-apps] \"${String(e)}\" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(t);console.warn(t)}setEventHandler(e,t){if(t)this._assertHandlerTiming(e);this._ensureEventSlot(e),this._events.setHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.addEventListener(e,t)}removeEventListener(e,t){this._events.removeEventListener(e,t)}_ensureEventSlot(e){if(this._registeredEvents.has(e))return;let t=this.eventSchemas[e];if(!t)throw Error(`Unknown event: ${String(e)}`);this.setNotificationHandler(t.shape.method.value,{params:t.shape.params},(r)=>{let o=r;if(e===\"hostcontextchanged\")this._hostContext={...this._hostContext,...o};this._events.dispatch(e,o)}),this._registeredEvents.add(e)}getEventHandler(e){return this._events.getHandler(e)}warnIfRequestHandlerReplaced(e,t,r){if(t&&r)console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}constructor(e,t={},r={autoResize:!0}){super(r);if(this._appInfo=e,this._appCapabilities=t,this.options=r,this._methods.replace(\"notifications/cancelled\"),this._methods.replace(\"notifications/progress\"),!r.allowUnsafeEval)Ue({jitless:!0});this.replaceRequestHandler(\"ping\",(o)=>(console.log(\"Received ping:\",o.params),{})),this.setEventHandler(\"hostcontextchanged\",void 0)}buildContext(e){return e}registerAppCapabilities(e){if(this.transport)throw Error(\"Cannot register capabilities after transport is established\");this._appCapabilities=AI(this._appCapabilities,e)}registerTool(e,t,r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let o=this,n=()=>{if(o._initializedSent&&o._appCapabilities.tools?.listChanged)o.sendToolListChanged()},i=t.inputSchema!==void 0,s={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,n()},disable(){this.enabled=!1,n()},update(a){Object.assign(this,a),n()},remove(){if(o._registeredTools[e]!==s)return;delete o._registeredTools[e],n()},handler:async(a,c)=>{if(!s.enabled)throw Error(`Tool ${e} is disabled`);let u;if(i){let l=s.inputSchema,m=l?await J$(l,a??{},`Invalid input for tool ${e}: `):a??{};u=await r(m,c)}else u=await r(c);if(s.outputSchema&&!u.isError)u.structuredContent=await J$(s.outputSchema,u.structuredContent,`Invalid output for tool ${e}: `);return u}};if(this._registeredTools[e]=s,!this._appCapabilities.tools&&!this.transport)this.registerAppCapabilities({tools:{listChanged:!0}});return this.ensureToolHandlersInitialized(),n(),s}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){if(this._toolHandlersInitialized)return;this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let r=this._registeredTools[e.name];if(!r)throw Error(`Tool ${e.name} not found`);return r.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([r,o])=>o.enabled).map(async([r,o])=>{let n={name:r,title:o.title,description:o.description,inputSchema:o.inputSchema?await V$(o.inputSchema,\"input\"):{type:\"object\",properties:{}}};if(o.outputSchema)n.outputSchema=await V$(o.outputSchema,\"output\");if(o.annotations)n.annotations=o.annotations;if(o._meta)n._meta=o._meta;return n}))})}async sendToolListChanged(e={}){this._assertInitialized(\"sendToolListChanged\"),await this.notification({method:\"notifications/tools/list_changed\",params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(\"toolinput\")}set ontoolinput(e){this.setEventHandler(\"toolinput\",e)}get ontoolinputpartial(){return this.getEventHandler(\"toolinputpartial\")}set ontoolinputpartial(e){this.setEventHandler(\"toolinputpartial\",e)}get ontoolresult(){return this.getEventHandler(\"toolresult\")}set ontoolresult(e){this.setEventHandler(\"toolresult\",e)}get ontoolcancelled(){return this.getEventHandler(\"toolcancelled\")}set ontoolcancelled(e){this.setEventHandler(\"toolcancelled\",e)}get onhostcontextchanged(){return this.getEventHandler(\"hostcontextchanged\")}set onhostcontextchanged(e){this.setEventHandler(\"hostcontextchanged\",e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(\"onteardown\",this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(\"ui/resource-teardown\",{params:kI.shape.params,result:RI},(t,r)=>{if(!this._onteardown)throw Error(\"No onteardown handler set\");return this._onteardown(t,r)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(\"oncalltool\",this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(\"tools/call\",(t,r)=>{if(!this._oncalltool)throw Error(\"No oncalltool handler set\");return this._oncalltool(t.params,r)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(\"onlisttools\",this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(\"tools/list\",(t,r)=>{if(!this._onlisttools)throw Error(\"No onlisttools handler set\");return this._onlisttools(t.params,r)})}assertCapabilityForMethod(e){switch(e){case\"sampling/createMessage\":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`);break}}assertRequestHandlerCapability(e){switch(e){case\"tools/call\":case\"tools/list\":if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;default:return}}assertNotificationCapability(e){}async callServerTool(e,t){if(this._assertInitialized(\"callServerTool\"),typeof e===\"string\")throw Error(`callServerTool() expects an object as its first argument, but received a string (\"${e}\"). Did you mean: callServerTool({ name: \"${e}\", arguments: { ... } })?`);return await this.request({method:\"tools/call\",params:e},{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(\"readServerResource\"),await this.request({method:\"resources/read\",params:e},t)}async listServerResources(e,t){return this._assertInitialized(\"listServerResources\"),await this.request({method:\"resources/list\",params:e},t)}async createSamplingMessage(e,t){return this._assertInitialized(\"createSamplingMessage\"),await this.request({method:\"sampling/createMessage\",params:e},t)}sendMessage(e,t){return this._assertInitialized(\"sendMessage\"),this.request({method:\"ui/message\",params:e},bI,t)}sendLog(e){return this.notification({method:\"notifications/message\",params:e})}updateModelContext(e,t){return this._assertInitialized(\"updateModelContext\"),this.request({method:\"ui/update-model-context\",params:e},Qt,t)}openLink(e,t){return this._assertInitialized(\"openLink\"),this.request({method:\"ui/open-link\",params:e},SI,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(\"downloadFile\"),this.request({method:\"ui/download-file\",params:e},zI,t)}requestTeardown(e={}){return this.notification({method:\"ui/notifications/request-teardown\",params:e})}requestDisplayMode(e,t){return this._assertInitialized(\"requestDisplayMode\"),this.request({method:\"ui/request-display-mode\",params:e},EI,t)}sendSizeChanged(e){return this.notification({method:\"ui/notifications/size-changed\",params:e})}setupSizeChangedNotifications(){let e=!1,t=0,r=0,o=()=>{if(e)return;e=!0,requestAnimationFrame(()=>{e=!1;let i=document.documentElement,s=i.style.height;i.style.height=\"max-content\";let a=Math.ceil(i.getBoundingClientRect().height);i.style.height=s;let c=Math.ceil(window.innerWidth);if(c!==t||a!==r)t=c,r=a,this.sendSizeChanged({width:c,height:a})})};o();let n=new ResizeObserver(o);return n.observe(document.documentElement),n.observe(document.body),()=>n.disconnect()}async connect(e=new W$(window.parent,window.parent),t){if(this.transport)throw Error(\"App is already connected. Call close() before connecting again.\");this._initializedSent=!1;try{await super.connect(e);let r=await this.request({method:\"ui/initialize\",params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:mI}},ZI,t);if(r===void 0)throw Error(`Server sent invalid initialize result: ${r}`);if(this._hostCapabilities=r.hostCapabilities,this._hostInfo=r.hostInfo,this._hostContext=r.hostContext,await this.notification({method:\"ui/notifications/initialized\"}),this._initializedSent=!0,this.options?.autoResize)this.setupSizeChangedNotifications()}catch(r){throw this.close(),r}}}var Y$=document.getElementById(\"title\"),Q$=document.getElementById(\"summary\"),Zu=document.getElementById(\"cues\"),X$=document.getElementById(\"status\"),ek=document.getElementById(\"open\"),Ta=new Cu({name:\"Cap recording card\",version:\"1.0.0\"}),tk=(e)=>{try{let t=new URL(e);return t.protocol===\"https:\"?t.toString():null}catch{return null}},jI=(e)=>{if(!Y$||!Q$||!Zu||!X$||!ek)return;Y$.textContent=e.title,Q$.textContent=e.summary??\"No summary available\",X$.textContent=e.transcriptStatus===\"disabled\"?\"Transcript disabled\":e.transcriptStatus===\"too_large\"?\"Transcript too large to display\":e.transcriptStatus===\"not_ready\"?\"Transcript not ready\":\"Transcript\",Zu.replaceChildren();for(let r of e.cues){let o=tk(r.url);if(!o)continue;let n=document.createElement(\"button\");n.type=\"button\",n.className=\"cue\";let i=document.createElement(\"strong\"),s=Math.floor(r.startMs/1000);i.textContent=`${Math.floor(s/60)}:${String(s%60).padStart(2,\"0\")}`;let a=document.createElement(\"span\");a.textContent=r.text,n.append(i,a),n.addEventListener(\"click\",()=>Ta.openLink({url:o})),Zu.append(n)}if(e.hasMoreCues){let r=document.createElement(\"p\");r.className=\"more\",r.textContent=\"More transcript moments are available in Cap.\",Zu.append(r)}let t=tk(e.url);if(t)ek.onclick=()=>{Ta.openLink({url:t})}};Ta.ontoolresult=(e)=>{let t=e.structuredContent;if(t&&typeof t.title===\"string\"&&typeof t.url===\"string\"&&Array.isArray(t.cues)&&typeof t.transcriptStatus===\"string\")jI(t)};Ta.onhostcontextchanged=(e)=>{if(e.theme)K$(e.theme)};Ta.connect();})();\n</script></body></html>"
}