@mcpjam/inspector 3.27.0 → 3.27.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{CaniuseCapabilityPage-CXmikV_v.js → CaniuseCapabilityPage-BGCx_CV1.js} +4 -4
- package/dist/client/assets/{CaniuseLoadingScreen-CISUL_K4.js → CaniuseLoadingScreen-CnLJTk-6.js} +2 -2
- package/dist/client/assets/{PosthogUtils-E_cG1Twh.js → PosthogUtils-BnkWsJl1.js} +1 -1
- package/dist/client/assets/{PosthogUtils-DE_PkwDN.js → PosthogUtils-CreNC30F.js} +2 -2
- package/dist/client/assets/{access-link-C0MWhbv8.js → access-link-CiqZlBT_.js} +2 -2
- package/dist/client/assets/{app-bootstrap-DfSpCiag.js → app-bootstrap-Dihy9pBm.js} +328 -328
- package/dist/client/assets/{app-navigation-BQGUR9cb.js → app-navigation-BzZWduTQ.js} +2 -2
- package/dist/client/assets/{bundle-mjs-DKP7sq7T.js → bundle-mjs-C4gHyVze.js} +2 -2
- package/dist/client/assets/{caniuse-bootstrap-D6d1Susz.js → caniuse-bootstrap-DClGA--s.js} +3 -3
- package/dist/client/assets/{chunk-D32TOXHM-D2CUPCH8.js → chunk-D32TOXHM-BM6p8aoA.js} +5 -5
- package/dist/client/assets/{dead-clicks-autocapture-DvbdThCp.js → dead-clicks-autocapture-DMIvXYDI.js} +2 -2
- package/dist/client/assets/{error-reporting-B_hxqtsN.js → error-reporting-BufzMdax.js} +1 -1
- package/dist/client/assets/{error-reporting-CJClTLWK.js → error-reporting-C3V1rL02.js} +2 -2
- package/dist/client/assets/{exception-autocapture-CkcPU7XW.js → exception-autocapture-D42Ql1CZ.js} +2 -2
- package/dist/client/assets/{feature-flags-BUIQpHKT.js → feature-flags-9Kzm95Iy.js} +3 -3
- package/dist/client/assets/{first-run-oauth-return-l9GCZrqg.js → first-run-oauth-return-DBF8M446.js} +2 -2
- package/dist/client/assets/{highlighted-body-KQOG7T2V-uT92T9zL.js → highlighted-body-KQOG7T2V-BDDk3j-o.js} +2 -2
- package/dist/client/assets/{index-ByP2kceG.js → index-CB2B0gyI.js} +3 -3
- package/dist/client/assets/{jszip.min-C5LLiUXa.js → jszip.min-D0H-wysy.js} +2 -2
- package/dist/client/assets/{mcp-init-BIoRq6yl.js → mcp-init-D384t3us.js} +3 -3
- package/dist/client/assets/{mermaid-MCJ5UELQ-BCP5Oj92.js → mermaid-MCJ5UELQ-DXZIWzsB.js} +1 -1
- package/dist/client/assets/{module-Wq_OenZL.js → module-BHBrpZ4U.js} +2 -2
- package/dist/client/assets/{module-D3s7YCoh.js → module-CmXaunIz.js} +1 -1
- package/dist/client/assets/posthog-bundled-extensions-CrY82kI1.js +3 -0
- package/dist/client/assets/{posthog-bundled-extensions-BIjySVP-.js → posthog-bundled-extensions-DUscOFM-.js} +1 -1
- package/dist/client/assets/{posthog-recorder-DTh3r-Ko.js → posthog-recorder-PnXQoK1P.js} +2 -2
- package/dist/client/assets/{preload-helper-BN6vHXe1.js → preload-helper-Dk-R02bM.js} +1 -1
- package/dist/client/assets/{project-route-CjZmQY5n.js → project-route-CwOywjoT.js} +2 -2
- package/dist/client/assets/{react-dom-DtL8G3gn.js → react-dom-s4nupq_N.js} +2 -2
- package/dist/client/assets/{rolldown-runtime-KtSMB9jY.js → rolldown-runtime-Df2-koJ7.js} +1 -1
- package/dist/client/assets/{server-feature-flags-wgvQSqd5.js → server-feature-flags-ByZjY7fi.js} +2 -2
- package/dist/client/assets/{server-feature-flags-BBH-SYjw.js → server-feature-flags-CqB4sk67.js} +1 -1
- package/dist/client/assets/{session-revoked-HpzxsCkX.js → session-revoked-B_iZLaTD.js} +2 -2
- package/dist/client/assets/{surveys-BYfLymeD.js → surveys-B4xlE-Cz.js} +2 -2
- package/dist/client/assets/telemetry-files-620cc3a6060f3829.js +1 -0
- package/dist/client/assets/{trace-timeline-BFtz0cI8.js → trace-timeline-BEzP_FzL.js} +1 -1
- package/dist/client/assets/{trace-timeline-CRxEZYCU.js → trace-timeline-BWWuYM0j.js} +2 -2
- package/dist/client/assets/{web-vitals-C1IvwuFq.js → web-vitals-jdhe8VpD.js} +2 -2
- package/dist/client/index.html +12 -12
- package/dist/server/harness-install-cli.js +3 -3
- package/dist/server/index.js +2 -2
- package/package.json +2 -2
- package/dist/client/assets/posthog-bundled-extensions-CQjB_Dfr.js +0 -3
- package/dist/client/assets/telemetry-files-5758eea65e761de9.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.27.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ceeedd80-35f0-4746-953b-5770b216e312",e._sentryDebugIdIdentifier="sentry-dbid-ceeedd80-35f0-4746-953b-5770b216e312")}catch{}})();function Le(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,n])=>t.indexOf(+r)===-1).map(([r,n])=>n)}function St(e,t="|"){return e.map(r=>gr(r)).join(t)}function Fe(e,t){return typeof t=="bigint"?t.toString():t}var Hn=class{constructor(e){this._getter=e,this._value=void 0}get value(){const e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Pe(e){return new Hn(e)}function Gn(e){return e==null}function rt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function qn(e,t){const r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var $t=Symbol("evaluating");function Yn(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==$t)return n===void 0&&(n=$t,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function U(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function nt(e){const t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function L(e){return nt(e._zod.def)??e._zod.def.shape}function pr(e,t,r){Object.defineProperty(e,t,{get(){const n=r();return U(this,t,n),n},enumerable:!0,configurable:!0})}function hr(e,t,r){t in e?U(e,t,r):e[t]=r}function H(e,t,r,n){const o=L(t);for(const i of r){const s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?pr(e,i,()=>{const a=t._zod.def.shape[i];return n?n(a,i):a}):hr(e,i,n?n(s.value,i):s.value))}}function Xn(e,t){for(const r of Reflect.ownKeys(t)){const n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?pr(e,r,()=>t[r]):hr(e,r,n.value))}}function T(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Qn(e){return JSON.stringify(e)}function eo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var mr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ce(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var to=Pe(()=>{if(R.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});function q(e){if(ce(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(ce(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function vr(e){return q(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ro=new Set(["string","number","symbol"]);function Y(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function W(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function v(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function gr(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function no(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var _r={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},oo={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function io(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o={};return H(o,e,Ee(e,t)),W(e,T(r,{shape:o,checks:[]}))}function Ee(e,t){const r=L(e),n=[];for(const o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o)}return n}function so(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=new Set(Ee(e,t)),i={};return H(i,e,Reflect.ownKeys(L(e)).filter(s=>!o.has(s))),W(e,T(r,{shape:i,checks:[]}))}function ao(e,t){if(!q(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const n=L(e);for(const o of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return W(e,T(e._zod.def,{shape:yr(e,t)}))}function yr(e,t){const r={};return H(r,e,Reflect.ownKeys(L(e))),Xn(r,t),r}function uo(e,t){if(!q(t))throw new Error("Invalid input to safeExtend: expected a plain object");return W(e,T(e._zod.def,{shape:yr(e,t)}))}function co(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r={};return H(r,e,Reflect.ownKeys(L(e))),H(r,t,Reflect.ownKeys(L(t))),W(e,T(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Pt(e,t,r,n="partial"){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);const i=r?new Set(Ee(t,r)):void 0,s={};return H(s,t,Reflect.ownKeys(L(t)),e&&((a,u)=>i&&!i.has(u)?a:new e({type:"optional",innerType:a}))),W(t,T(t._zod.def,{shape:s,checks:[]}))}function lo(e,t,r){const n=r?new Set(Ee(t,r)):void 0,o={};return H(o,t,Reflect.ownKeys(L(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),W(t,T(t._zod.def,{shape:o}))}function C(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 fo(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 M(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ne(e){return typeof e=="string"?e:e?.message}function Et(e){const t=[];for(const r of e??[]){const n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;const o=n.maximum??n.length??n.size;o>=0&&t.push([o,r])}return t}function Je(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function V(e,t,r){var n;const o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);const i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ne(e.inst?._zod.def?.error?.(e))??ne(i?.(e))??ne(t?.error?.(e))??ne(r.customError?.(e))??ne(r.localeError?.(e))??"Invalid input",a={};for(const u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(a[u]=e[u]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}var po=/[\uD800-\uDBFF]/;function ot(e){const t=e.length;if(!po.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function it(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ho(e){const 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";const r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function le(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function mo(e,t){for(const r in t){const n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):vo(e,r,n.value)}}function B(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function st(e,t,r){return B(e,t,r,!1)}function br(e,t){for(const r in e){const n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return B(this,r,n(this))},set(o){B(this,r,o)}})}return t}function vo(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:B(this,t,r.bind(this))},set(n){B(this,t,n)}})}function go(e,t){const r=Object.getPrototypeOf(e);return t in r?void 0:r}var Re,F=!1,_o={configurable:!0,get(){F=!0}};function y(e,t,r){const n=Object.getPrototypeOf(e._zod);if(t in n&&Re!==e._zod){Re=void 0;return}Re=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,_o);const o=F;F=!1;try{const i=r(this);return F?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),F=F||o,i}catch(i){throw delete this[t],F=F||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function yo(e,t,r,n){const o=go(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){const i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var bo="~constantCatch";function wo(e){const t=()=>e;return t[bo]=!0,t}var Zt,Kc=Object.freeze({status:"aborted"}),je={value:void 0,enumerable:!1},At="captureStackTrace"in Error?Error:null;function zo(e){const t=At;if(t){const r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return At=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function f(e,t,r,n){const o={};function i(h){this.def=h,this.constr=d,this.traits=new Set}i.prototype=o;const s=r,a=s&&new WeakSet;function u(h,p){if(h._zod){if(h._zod.traits.has(e))return}else{je.value=new i(p);try{Object.defineProperty(h,"_zod",je)}finally{je.value=void 0}}if(h._zod.traits.add(e),t(h,p),a){const g=Object.getPrototypeOf(h),_=h._zod.constr.prototype;let b=g;for(;b&&b!==_;)b=Object.getPrototypeOf(b);const I=b??g;a.has(I)||(a.add(I),mo(I,s))}const m=d.prototype;for(const g in m)Object.prototype.hasOwnProperty.call(m,g)&&(g in h||(h[g]=m[g].bind(h)))}const c=n?.Parent??Object;class l extends c{}Object.defineProperty(l,"name",{value:e});function d(h){const p=n?.Parent?zo(l):this;u(p,h);const m=p._zod.deferred;if(m){for(const _ of m)_();p._zod.deferred=void 0}const g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(p),p}return Object.defineProperty(d,"init",{value:u}),Object.defineProperty(d,Symbol.hasInstance,{value:h=>n?.Parent&&h instanceof n.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var K=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},wr=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(Zt=globalThis).__zod_globalConfig??(Zt.__zod_globalConfig={});var R=globalThis.__zod_globalConfig;function x(e){return e&&Object.assign(R,e),R}function ko(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Fe,2)),e.message}function Oo(e){this._zod.message=e}var So={get:ko,set:Oo,enumerable:!0,configurable:!0},Ce={value:void 0,enumerable:!1},It=new WeakSet([Object.prototype,Error.prototype]),zr=(e,t)=>{e.name="$ZodError",Ce.value=t,Object.defineProperty(e,"issues",Ce),Ce.value=void 0,Object.defineProperty(e,"message",So);const r=Object.getPrototypeOf(e);It.has(r)||(It.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){const n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},$o=f("$ZodError",zr),Po=f("$ZodError",zr,void 0,{Parent:Error});function Eo(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function Zo(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?Eo(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return{formErrors:n,fieldErrors:r}}function Ao(e,t=r=>r.message){const r={_errors:[]},n=(o,i=[])=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>n({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else{const a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else{let u=r,c=0;for(;c<a.length;){const l=a[c],d=c===a.length-1;if(l==="_errors"){d&&u._errors.push(t(s)),c++;continue}Object.prototype.hasOwnProperty.call(u,l)||Object.defineProperty(u,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const h=u[l];d&&h._errors.push(t(s)),u=h,c++}}}};return n(e),r}function Ze(e,t){return{callee:t?.callee??e,Err:t?.Err}}var at=e=>{const t=(r,n,o,i)=>{const s=o?{...o,async:!1}:{async:!1},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new K;if(a.issues.length){const u=new(i?.Err??e)(a.issues.map(c=>V(c,s,x())));throw mr(u,i?.callee??t),u}return a.value};return t},ut=e=>{const t=async(r,n,o,i)=>{const s=o?{...o,async:!0}:{async:!0};let a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const u=new(i?.Err??e)(a.issues.map(c=>V(c,s,x())));throw mr(u,i?.callee??t),u}return a.value};return t},Ae=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new K;return i.issues.length?kr(e,i.issues,o):{success:!0,data:i.value}},Hc=Ae(Po);function kr(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>V(o,r,x()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}var ct=e=>async(t,r,n)=>{const o=n?{...n,async:!0}:{async:!0};let i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?kr(e,i.issues,o):{success:!0,data:i.value}},Io=Symbol.for("zod.compile.invalid"),To=Symbol.for("zod.compile.fallback"),No=((e,t,r)=>{const n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Io)return!0;if(n.definite===!0&&r===void 0)return!1}return Ro(e,t,r)});function Ro(e,t,r){const n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun;let i;if(o?(n[To]=!0,i=o({value:t,issues:[]},n)):i=e._zod.run({value:t,issues:[]},n),i instanceof Promise)throw new K;return i.issues.length===0}var jo=async(e,t,r)=>{const n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},Co=e=>{const t=at(e),r=(n,o,i,s)=>{const a=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,a,Ze(r,s))};return r},Do=e=>{const t=at(e),r=(n,o,i,s)=>t(n,o,i,Ze(r,s));return r},xo=e=>{const t=ut(e),r=async(n,o,i,s)=>{const a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,a,Ze(r,s))};return r},Uo=e=>{const t=ut(e),r=async(n,o,i,s)=>await t(n,o,i,Ze(r,s));return r},Mo=e=>(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return Ae(e)(t,r,o)},Lo=e=>(t,r,n)=>Ae(e)(t,r,n),Fo=e=>async(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return ct(e)(t,r,o)},Jo=e=>async(t,r,n)=>ct(e)(t,r,n),Vo=/^[cC][0-9a-z]{6,}$/,Bo=/^[0-9a-z]+$/,Wo=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Ko=/^[0-9a-vA-V]{20}$/,Ho=/^[A-Za-z0-9]{27}$/,Go=/^[a-zA-Z0-9_-]{21}$/;function qo(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Yo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Xo=/^([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})$/,Tt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Qo=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ei="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function ti(){return new RegExp(ei,"u")}var ri=/^(?:(?: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])$/,ni=/^(([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}|:))$/,oi=/^((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])$/,ii=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,si=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ai=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,ui=/^https?$/,ci=/^\+[1-9]\d{6,14}$/,Or="(?:(?:\\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])))";function li(e){return new RegExp(`^${e}$`)}var fi=li(Or);function Ve(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function di(e){return new RegExp(`^${Ve(e)}$`)}function pi(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${Ve({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${Ve({precision:e.precision})}`:r;return new RegExp(`^${Or}T(?:${n})$`)}var hi=/^[\s\S]{0,}$/,mi=/^-?\d+$/,lt=/^-?\d+(?:\.\d+)?$/,vi=/^(?:true|false)$/i,gi=/^null$/i,_i=/^undefined$/i,yi=/^[^A-Z]*$/,bi=/^[^a-z]*$/,A=f("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),ft=e=>{const t=e.value;return!Gn(t)&&t.length!==void 0},ye={number:"number",bigint:"bigint",object:"date"},Sr=f("$ZodCheckLessThan",(e,t)=>{A.init(e,t);const r=ye[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:ye[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$r=f("$ZodCheckGreaterThan",(e,t)=>{A.init(e,t);const r=ye[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:ye[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wi=f("$ZodCheckMultipleOf",(e,t)=>{A.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):qn(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),zi=f("$ZodCheckNumberFormat",(e,t)=>{A.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[o,i]=_r[t.format];e._zod.check=s=>{const a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){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:n,inclusive:!0,continue:!t.abort}):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:n,inclusive:!0,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),ki=f("$ZodCheckMaxLength",(e,t)=>{var r;A.init(e,t),(r=e._zod.def).when??(r.when=ft),e._zod.check=n=>{const o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?ot(o):i)<=t.maximum)return;const s=it(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Oi=f("$ZodCheckMinLength",(e,t)=>{var r;A.init(e,t),(r=e._zod.def).when??(r.when=ft),e._zod.check=n=>{const o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?ot(o):i)>=t.minimum)return;const s=it(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Si=f("$ZodCheckLengthEquals",(e,t)=>{var r;A.init(e,t),(r=e._zod.def).when??(r.when=ft),e._zod.check=n=>{const o=n.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?ot(o):i;if(s===t.length)return;const a=it(o),u=s>t.length;n.issues.push({origin:a,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ie=f("$ZodCheckStringFormat",(e,t)=>{var r,n;A.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),$i=f("$ZodCheckRegex",(e,t)=>{Ie.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Pi=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=yi),Ie.init(e,t)}),Ei=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=bi),Ie.init(e,t)}),Zi=f("$ZodCheckIncludes",(e,t)=>{A.init(e,t);const r=Y(t.includes);t.pattern=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ai=f("$ZodCheckStartsWith",(e,t)=>{A.init(e,t);const r=new RegExp(`^${Y(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ii=f("$ZodCheckEndsWith",(e,t)=>{A.init(e,t);const r=new RegExp(`.*${Y(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function Nt(e,t,r){e.issues.length&&t.issues.push(...M(r,e.issues))}var Ti=f("$ZodCheckProperties",(e,t)=>{A.init(e,t),st(e,Symbol.iterator,function*(){yield e});let r;e._zod.check=n=>{if(n.value==null){n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});return}r??(r=Reflect.ownKeys(t.shape).map(s=>[s,t.shape[s]]));const o=n.value;let i;for(const[s,a]of r){const u=a._zod.run({value:o[s],issues:[]},{});u instanceof Promise?(i??(i=[]),i.push(u.then(c=>Nt(c,n,s)))):Nt(u,n,s)}if(i)return Promise.all(i).then(()=>{})}}),Ni=f("$ZodCheckOverwrite",(e,t)=>{A.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}}),Ri=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const t=e.split(`
|
|
1
|
+
(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.27.2"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d57db0d5-04b6-4e8f-9888-67114c140451",e._sentryDebugIdIdentifier="sentry-dbid-d57db0d5-04b6-4e8f-9888-67114c140451")}catch{}})();function Le(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,n])=>t.indexOf(+r)===-1).map(([r,n])=>n)}function St(e,t="|"){return e.map(r=>gr(r)).join(t)}function Fe(e,t){return typeof t=="bigint"?t.toString():t}var Hn=class{constructor(e){this._getter=e,this._value=void 0}get value(){const e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Pe(e){return new Hn(e)}function Gn(e){return e==null}function rt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function qn(e,t){const r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var $t=Symbol("evaluating");function Yn(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==$t)return n===void 0&&(n=$t,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function U(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function nt(e){const t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function L(e){return nt(e._zod.def)??e._zod.def.shape}function pr(e,t,r){Object.defineProperty(e,t,{get(){const n=r();return U(this,t,n),n},enumerable:!0,configurable:!0})}function hr(e,t,r){t in e?U(e,t,r):e[t]=r}function H(e,t,r,n){const o=L(t);for(const i of r){const s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?pr(e,i,()=>{const a=t._zod.def.shape[i];return n?n(a,i):a}):hr(e,i,n?n(s.value,i):s.value))}}function Xn(e,t){for(const r of Reflect.ownKeys(t)){const n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?pr(e,r,()=>t[r]):hr(e,r,n.value))}}function T(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Qn(e){return JSON.stringify(e)}function eo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var mr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ce(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var to=Pe(()=>{if(R.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});function q(e){if(ce(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(ce(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function vr(e){return q(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ro=new Set(["string","number","symbol"]);function Y(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function W(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function v(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function gr(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function no(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var _r={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},oo={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function io(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o={};return H(o,e,Ee(e,t)),W(e,T(r,{shape:o,checks:[]}))}function Ee(e,t){const r=L(e),n=[];for(const o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o)}return n}function so(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=new Set(Ee(e,t)),i={};return H(i,e,Reflect.ownKeys(L(e)).filter(s=>!o.has(s))),W(e,T(r,{shape:i,checks:[]}))}function ao(e,t){if(!q(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const n=L(e);for(const o of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return W(e,T(e._zod.def,{shape:yr(e,t)}))}function yr(e,t){const r={};return H(r,e,Reflect.ownKeys(L(e))),Xn(r,t),r}function uo(e,t){if(!q(t))throw new Error("Invalid input to safeExtend: expected a plain object");return W(e,T(e._zod.def,{shape:yr(e,t)}))}function co(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r={};return H(r,e,Reflect.ownKeys(L(e))),H(r,t,Reflect.ownKeys(L(t))),W(e,T(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Pt(e,t,r,n="partial"){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);const i=r?new Set(Ee(t,r)):void 0,s={};return H(s,t,Reflect.ownKeys(L(t)),e&&((a,u)=>i&&!i.has(u)?a:new e({type:"optional",innerType:a}))),W(t,T(t._zod.def,{shape:s,checks:[]}))}function lo(e,t,r){const n=r?new Set(Ee(t,r)):void 0,o={};return H(o,t,Reflect.ownKeys(L(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),W(t,T(t._zod.def,{shape:o}))}function C(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 fo(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 M(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ne(e){return typeof e=="string"?e:e?.message}function Et(e){const t=[];for(const r of e??[]){const n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;const o=n.maximum??n.length??n.size;o>=0&&t.push([o,r])}return t}function Je(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function V(e,t,r){var n;const o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);const i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ne(e.inst?._zod.def?.error?.(e))??ne(i?.(e))??ne(t?.error?.(e))??ne(r.customError?.(e))??ne(r.localeError?.(e))??"Invalid input",a={};for(const u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(a[u]=e[u]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}var po=/[\uD800-\uDBFF]/;function ot(e){const t=e.length;if(!po.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function it(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ho(e){const 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";const r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function le(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function mo(e,t){for(const r in t){const n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):vo(e,r,n.value)}}function B(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function st(e,t,r){return B(e,t,r,!1)}function br(e,t){for(const r in e){const n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return B(this,r,n(this))},set(o){B(this,r,o)}})}return t}function vo(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:B(this,t,r.bind(this))},set(n){B(this,t,n)}})}function go(e,t){const r=Object.getPrototypeOf(e);return t in r?void 0:r}var Re,F=!1,_o={configurable:!0,get(){F=!0}};function y(e,t,r){const n=Object.getPrototypeOf(e._zod);if(t in n&&Re!==e._zod){Re=void 0;return}Re=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,_o);const o=F;F=!1;try{const i=r(this);return F?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),F=F||o,i}catch(i){throw delete this[t],F=F||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function yo(e,t,r,n){const o=go(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){const i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var bo="~constantCatch";function wo(e){const t=()=>e;return t[bo]=!0,t}var Zt,Kc=Object.freeze({status:"aborted"}),je={value:void 0,enumerable:!1},At="captureStackTrace"in Error?Error:null;function zo(e){const t=At;if(t){const r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return At=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function f(e,t,r,n){const o={};function i(h){this.def=h,this.constr=d,this.traits=new Set}i.prototype=o;const s=r,a=s&&new WeakSet;function u(h,p){if(h._zod){if(h._zod.traits.has(e))return}else{je.value=new i(p);try{Object.defineProperty(h,"_zod",je)}finally{je.value=void 0}}if(h._zod.traits.add(e),t(h,p),a){const g=Object.getPrototypeOf(h),_=h._zod.constr.prototype;let b=g;for(;b&&b!==_;)b=Object.getPrototypeOf(b);const I=b??g;a.has(I)||(a.add(I),mo(I,s))}const m=d.prototype;for(const g in m)Object.prototype.hasOwnProperty.call(m,g)&&(g in h||(h[g]=m[g].bind(h)))}const c=n?.Parent??Object;class l extends c{}Object.defineProperty(l,"name",{value:e});function d(h){const p=n?.Parent?zo(l):this;u(p,h);const m=p._zod.deferred;if(m){for(const _ of m)_();p._zod.deferred=void 0}const g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(p),p}return Object.defineProperty(d,"init",{value:u}),Object.defineProperty(d,Symbol.hasInstance,{value:h=>n?.Parent&&h instanceof n.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var K=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},wr=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(Zt=globalThis).__zod_globalConfig??(Zt.__zod_globalConfig={});var R=globalThis.__zod_globalConfig;function x(e){return e&&Object.assign(R,e),R}function ko(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Fe,2)),e.message}function Oo(e){this._zod.message=e}var So={get:ko,set:Oo,enumerable:!0,configurable:!0},Ce={value:void 0,enumerable:!1},It=new WeakSet([Object.prototype,Error.prototype]),zr=(e,t)=>{e.name="$ZodError",Ce.value=t,Object.defineProperty(e,"issues",Ce),Ce.value=void 0,Object.defineProperty(e,"message",So);const r=Object.getPrototypeOf(e);It.has(r)||(It.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){const n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},$o=f("$ZodError",zr),Po=f("$ZodError",zr,void 0,{Parent:Error});function Eo(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function Zo(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?Eo(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return{formErrors:n,fieldErrors:r}}function Ao(e,t=r=>r.message){const r={_errors:[]},n=(o,i=[])=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>n({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else{const a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else{let u=r,c=0;for(;c<a.length;){const l=a[c],d=c===a.length-1;if(l==="_errors"){d&&u._errors.push(t(s)),c++;continue}Object.prototype.hasOwnProperty.call(u,l)||Object.defineProperty(u,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const h=u[l];d&&h._errors.push(t(s)),u=h,c++}}}};return n(e),r}function Ze(e,t){return{callee:t?.callee??e,Err:t?.Err}}var at=e=>{const t=(r,n,o,i)=>{const s=o?{...o,async:!1}:{async:!1},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new K;if(a.issues.length){const u=new(i?.Err??e)(a.issues.map(c=>V(c,s,x())));throw mr(u,i?.callee??t),u}return a.value};return t},ut=e=>{const t=async(r,n,o,i)=>{const s=o?{...o,async:!0}:{async:!0};let a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const u=new(i?.Err??e)(a.issues.map(c=>V(c,s,x())));throw mr(u,i?.callee??t),u}return a.value};return t},Ae=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new K;return i.issues.length?kr(e,i.issues,o):{success:!0,data:i.value}},Hc=Ae(Po);function kr(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>V(o,r,x()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}var ct=e=>async(t,r,n)=>{const o=n?{...n,async:!0}:{async:!0};let i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?kr(e,i.issues,o):{success:!0,data:i.value}},Io=Symbol.for("zod.compile.invalid"),To=Symbol.for("zod.compile.fallback"),No=((e,t,r)=>{const n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Io)return!0;if(n.definite===!0&&r===void 0)return!1}return Ro(e,t,r)});function Ro(e,t,r){const n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun;let i;if(o?(n[To]=!0,i=o({value:t,issues:[]},n)):i=e._zod.run({value:t,issues:[]},n),i instanceof Promise)throw new K;return i.issues.length===0}var jo=async(e,t,r)=>{const n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},Co=e=>{const t=at(e),r=(n,o,i,s)=>{const a=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,a,Ze(r,s))};return r},Do=e=>{const t=at(e),r=(n,o,i,s)=>t(n,o,i,Ze(r,s));return r},xo=e=>{const t=ut(e),r=async(n,o,i,s)=>{const a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,a,Ze(r,s))};return r},Uo=e=>{const t=ut(e),r=async(n,o,i,s)=>await t(n,o,i,Ze(r,s));return r},Mo=e=>(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return Ae(e)(t,r,o)},Lo=e=>(t,r,n)=>Ae(e)(t,r,n),Fo=e=>async(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return ct(e)(t,r,o)},Jo=e=>async(t,r,n)=>ct(e)(t,r,n),Vo=/^[cC][0-9a-z]{6,}$/,Bo=/^[0-9a-z]+$/,Wo=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Ko=/^[0-9a-vA-V]{20}$/,Ho=/^[A-Za-z0-9]{27}$/,Go=/^[a-zA-Z0-9_-]{21}$/;function qo(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Yo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Xo=/^([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})$/,Tt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Qo=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ei="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function ti(){return new RegExp(ei,"u")}var ri=/^(?:(?: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])$/,ni=/^(([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}|:))$/,oi=/^((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])$/,ii=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,si=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ai=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,ui=/^https?$/,ci=/^\+[1-9]\d{6,14}$/,Or="(?:(?:\\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])))";function li(e){return new RegExp(`^${e}$`)}var fi=li(Or);function Ve(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function di(e){return new RegExp(`^${Ve(e)}$`)}function pi(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${Ve({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${Ve({precision:e.precision})}`:r;return new RegExp(`^${Or}T(?:${n})$`)}var hi=/^[\s\S]{0,}$/,mi=/^-?\d+$/,lt=/^-?\d+(?:\.\d+)?$/,vi=/^(?:true|false)$/i,gi=/^null$/i,_i=/^undefined$/i,yi=/^[^A-Z]*$/,bi=/^[^a-z]*$/,A=f("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),ft=e=>{const t=e.value;return!Gn(t)&&t.length!==void 0},ye={number:"number",bigint:"bigint",object:"date"},Sr=f("$ZodCheckLessThan",(e,t)=>{A.init(e,t);const r=ye[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:ye[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$r=f("$ZodCheckGreaterThan",(e,t)=>{A.init(e,t);const r=ye[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:ye[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wi=f("$ZodCheckMultipleOf",(e,t)=>{A.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):qn(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),zi=f("$ZodCheckNumberFormat",(e,t)=>{A.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[o,i]=_r[t.format];e._zod.check=s=>{const a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){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:n,inclusive:!0,continue:!t.abort}):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:n,inclusive:!0,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),ki=f("$ZodCheckMaxLength",(e,t)=>{var r;A.init(e,t),(r=e._zod.def).when??(r.when=ft),e._zod.check=n=>{const o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?ot(o):i)<=t.maximum)return;const s=it(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Oi=f("$ZodCheckMinLength",(e,t)=>{var r;A.init(e,t),(r=e._zod.def).when??(r.when=ft),e._zod.check=n=>{const o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?ot(o):i)>=t.minimum)return;const s=it(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Si=f("$ZodCheckLengthEquals",(e,t)=>{var r;A.init(e,t),(r=e._zod.def).when??(r.when=ft),e._zod.check=n=>{const o=n.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?ot(o):i;if(s===t.length)return;const a=it(o),u=s>t.length;n.issues.push({origin:a,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ie=f("$ZodCheckStringFormat",(e,t)=>{var r,n;A.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),$i=f("$ZodCheckRegex",(e,t)=>{Ie.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Pi=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=yi),Ie.init(e,t)}),Ei=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=bi),Ie.init(e,t)}),Zi=f("$ZodCheckIncludes",(e,t)=>{A.init(e,t);const r=Y(t.includes);t.pattern=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ai=f("$ZodCheckStartsWith",(e,t)=>{A.init(e,t);const r=new RegExp(`^${Y(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ii=f("$ZodCheckEndsWith",(e,t)=>{A.init(e,t);const r=new RegExp(`.*${Y(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function Nt(e,t,r){e.issues.length&&t.issues.push(...M(r,e.issues))}var Ti=f("$ZodCheckProperties",(e,t)=>{A.init(e,t),st(e,Symbol.iterator,function*(){yield e});let r;e._zod.check=n=>{if(n.value==null){n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});return}r??(r=Reflect.ownKeys(t.shape).map(s=>[s,t.shape[s]]));const o=n.value;let i;for(const[s,a]of r){const u=a._zod.run({value:o[s],issues:[]},{});u instanceof Promise?(i??(i=[]),i.push(u.then(c=>Nt(c,n,s)))):Nt(u,n,s)}if(i)return Promise.all(i).then(()=>{})}}),Ni=f("$ZodCheckOverwrite",(e,t)=>{A.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}}),Ri=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const t=e.split(`
|
|
2
2
|
`).filter(o=>o),r=Math.min(...t.map(o=>o.length-o.trimStart().length)),n=t.map(o=>o.slice(r)).map(o=>" ".repeat(this.indent*2)+o);for(const o of n)this.content.push(o)}compile(){const e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
3
3
|
${t.join(`
|
|
4
4
|
`)}
|
|
@@ -54,6 +54,6 @@ ${t.join(`
|
|
|
54
54
|
|
|
55
55
|
`)}return _.write("payload.value = newResult;"),_.write("return payload;"),_.compile()};let s;const a=ce,u=!R.jitless,l=u&&to.value,d=t.catchall;let h;e._zod.parse=(p,m)=>{h??(h=n.value);const g=p.value;return a(g)?u&&l&&m?.async===!1&&m.jitless!==!0?(s||(s=i(t.shape)),p=s(p,m),d?jr([],g,p,m,h,e,m?.abortEarly===!0):p):r(p,m):(p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p)}});function Ct(e,t,r,n){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!C(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>V(s,n,x())))}),t)}var Cr=f("$ZodUnion",(e,t)=>{w.init(e,t),y(e,"optin",n=>n.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),y(e,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),y(e,"values",n=>{if(n.def.options.every(o=>o._zod.values))return new Set(n.def.options.flatMap(o=>Array.from(o._zod.values)))}),y(e,"pattern",n=>{if(n.def.options.every(o=>o._zod.pattern)){const o=n.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>rt(i.source)).join("|")})$`)}});const r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1;const s=[];for(const a of t.options){const u=a._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)s.push(u),i=!0;else{if(u.issues.length===0)return u;s.push(u)}}return i?Promise.all(s).then(a=>Ct(a,n,e,o)):Ct(s,n,e,o)}});function Es(e){const t=new Map;for(const r of e.options){const n=r._zod.propValues?.[e.discriminator];if(!n||n.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(const o of n)if(t.has(o)){if(o!==void 0)throw new Error(`Duplicate discriminator value "${String(o)}"`);t.set(o,null)}else t.set(o,r)}return t}var Zs=f("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Cr.init(e,t);const r=e._zod.parse;y(e,"propValues",o=>{const i={};let s=0;for(const a of o.def.options){const u=a._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(a)}"`);u[o.def.discriminator]?.has(void 0)&&s++;for(const[c,l]of Object.entries(u)){Object.prototype.hasOwnProperty.call(i,c)||U(i,c,new Set);for(const d of l)i[c].add(d)}}return!o.def.unionFallback&&s>1&&i[o.def.discriminator]?.delete(void 0),i}),t.options.forEach((o,i)=>{const s=nt(o._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});const n=Pe(()=>Es(t));e._zod.parse=(o,i)=>{const s=o.value;if(!ce(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;const a=s?.[t.discriminator],u=n.value.get(a);return u&&(a!==void 0||i.direction!=="backward")?u._zod.run(o,i):t.unionFallback||i.direction==="backward"?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter(c=>n.value.get(c)!==null),input:s,path:[t.discriminator],inst:e}),o)}}),As=f("$ZodIntersection",(e,t)=>{w.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([a,u])=>Dt(r,a,u)):Dt(r,i,s)}});function Be(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(q(e)&&q(t)){const r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const i of n){if(i==="__proto__")continue;const s=Be(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],i=t[n],s=Be(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Dt(e,t,r){const n=new Map;let o;const i=new Map,s=(c,l)=>{let d;if(c.code==="unrecognized_keys"&&!c.path?.length)o??(o=c),d=c.keys;else if(c.code==="invalid_key"&&c.origin==="record"&&c.path?.length===1){const h=String(c.path[0]);i.has(h)||i.set(h,c),d=[h]}else return!1;for(const h of d)n.has(h)||n.set(h,{}),n.get(h)[l]=!0;return!0};for(const c of t.issues)s(c,"l")||e.issues.push(c);for(const c of r.issues)s(c,"r")||e.issues.push(c);const a=[...n].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(a.length){const c=o?a.filter(l=>o.keys.includes(l)):[];c.length&&e.issues.push({...o,keys:c});for(const l of a)!c.includes(l)&&i.has(l)&&e.issues.push(i.get(l))}const u=Be(t.value,r.value);if(!u.valid){if(C(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}var Is=f("$ZodTuple",(e,t)=>{w.init(e,t);const r=t.items,n=R.memoizer;n?.attach(e),e._zod.parse=(o,i)=>{const s=o.value;if(!Array.isArray(s))return o.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=n?n.alloc(e,o,[],i):[];const a=[],u=xt(r,"optin"),c=xt(r,"optout");if(!t.rest){if(s.length<u)return o.issues.push({code:"too_small",minimum:u,inclusive:!0,input:s,inst:e,origin:"array"}),o;s.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:s,inst:e,origin:"array"})}const l=new Array(r.length),d=t.rest?i?.abortEarly:void 0;let h=!1;for(let p=0;p<r.length;p++){const m=r[p]._zod.run({value:s[p],issues:[]},i);m instanceof Promise?a.push(m.then(g=>{l[p]=g})):(l[p]=m,d&&!h&&m.issues.length&&(h=C(m)))}if(t.rest&&!h){let p=r.length-1;const m=s.slice(r.length);let g=o.issues.length;for(const _ of m){if(d&&o.issues.length!==g){if(C(o,g))break;g=o.issues.length}p++;const b=t.rest._zod.run({value:_,issues:[]},i);b instanceof Promise?a.push(b.then(I=>Ut(I,o,p))):Ut(b,o,p)}}return a.length?Promise.all(a).then(()=>Mt(l,o,r,s,c)):Mt(l,o,r,s,c)}});function xt(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function Ut(e,t,r){e.issues.length&&t.issues.push(...M(r,e.issues)),t.value[r]=e.value}function Mt(e,t,r,n,o){for(let i=0;i<r.length;i++){const s=e[i],a=i<n.length;if(!a&&i>=o&&r[i]._zod.optin==="optional"){t.value.length=i;break}if(s.issues.length){if(!a&&i>=o){t.value.length=i;break}t.issues.push(...M(i,s.issues))}t.value[i]=s.value}for(let i=t.value.length-1;i>=n.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}var Ts=f("$ZodRecord",(e,t)=>{w.init(e,t);const r=R.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{const i=n.value;if(!q(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const s=[],a=t.keyType._zod.values;if(a&&!t.partial){n.value=r?r.alloc(e,n,{},o):{};const u=new Set;for(const l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(u.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;const d=t.keyType._zod.run({value:l,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>V(m,o,x())),input:l,path:[l],inst:e});continue}const h=d.value;if(h==="__proto__")continue;const p=t.valueType._zod.run({value:i[l],issues:[]},o);p instanceof Promise?s.push(p.then(m=>{m.issues.length&&n.issues.push(...M(l,m.issues)),n.value[h]=m.value})):(p.issues.length&&n.issues.push(...M(l,p.issues)),n.value[h]=p.value)}let c;for(const l in i)if(!u.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;n.value[l]=i[l]}else c=c??[],c.push(l);c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c,continue:!0})}else{n.value=r?r.alloc(e,n,{},o):{};let u;for(const c of Reflect.ownKeys(i)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,c))continue;let l=t.keyType._zod.run({value:c,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&<.test(c)&&l.issues.length){const p=t.keyType._zod.run({value:Number(c),issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){t.mode==="loose"?n.value[c]=i[c]:a?(u=u??[],u.push(c)):n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>V(p,o,x())),input:c,path:[c],inst:e});continue}const d=l.value;if(d==="__proto__")continue;const h=t.valueType._zod.run({value:i[c],issues:[]},o);h instanceof Promise?s.push(h.then(p=>{p.issues.length&&n.issues.push(...M(c,p.issues)),n.value[d]=p.value})):(h.issues.length&&n.issues.push(...M(c,h.issues)),n.value[d]=h.value)}u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u,continue:!0})}return s.length?Promise.all(s).then(()=>n):n}}),Ns=f("$ZodEnum",(e,t)=>{w.init(e,t);const r=Le(t.entries),n=new Set(r);e._zod.values=n,y(e,"pattern",o=>{const i=Le(o.def.entries).filter(s=>ro.has(typeof s));return new RegExp(i.length?`^(${i.map(s=>Y(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{const s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),Rs=f("$ZodLiteral",(e,t)=>{w.init(e,t);const r=new Set(t.values);e._zod.values=r,y(e,"pattern",n=>{const o=n.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?Y(i):i?Y(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{const i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),js=f("$ZodTransform",(e,t)=>{w.init(e,t),e._zod.optin="optional",R.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new wr(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r));if(o instanceof Promise)throw new K;return r.value=o,r}});function Lt(e,t){return e.value=t.issues.length?void 0:t.value,e}var Dr=f("$ZodOptional",(e,t)=>{w.init(e,t),y(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",y(e,"values",r=>{const n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),y(e,"pattern",r=>{const n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${rt(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;const o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>Lt(r,i)):Lt(r,o)}return t.innerType._zod.run(r,n)}}),Cs=f("$ZodExactOptional",(e,t)=>{Dr.init(e,t),y(e,"values",r=>r.def.innerType._zod.values),y(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Ds=f("$ZodNullable",(e,t)=>{w.init(e,t),y(e,"optin",r=>r.def.innerType._zod.optin),y(e,"optout",r=>r.def.innerType._zod.optout),y(e,"pattern",r=>{const n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${rt(n.source)}|null)$`):void 0}),y(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),xs=f("$ZodDefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",y(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Ft(i,t)):Ft(o,t)}});function Ft(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Us=f("$ZodPrefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",y(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Ms=f("$ZodNonOptional",(e,t)=>{w.init(e,t),y(e,"values",r=>{const n=r.def.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Jt(i,e)):Jt(o,e)}});function Jt(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function Vt(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>V(o,n,x()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Ls=f("$ZodCatch",(e,t)=>{w.init(e,t),y(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),y(e,"optout",r=>r.def.innerType._zod.optout),y(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>Vt(r,i,t,n)):Vt(r,o,t,n)}}),xr=f("$ZodPipe",(e,t)=>{w.init(e,t),y(e,"values",r=>r.def.in._zod.values),y(e,"optin",r=>r.def.in._zod.optin),y(e,"optout",r=>r.def.out._zod.optout),y(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>pe(s,t.in,n)):pe(i,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>pe(i,t.out,n)):pe(o,t.out,n)}});function pe(e,t,r){return e.issues.some(n=>n.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var Fs=f("$ZodPreprocess",(e,t)=>{xr.init(e,t)}),Js=f("$ZodReadonly",(e,t)=>{w.init(e,t),y(e,"propValues",r=>r.def.innerType._zod.propValues),y(e,"values",r=>r.def.innerType._zod.values),y(e,"optin",r=>r.def.innerType?._zod?.optin),y(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Bt):Bt(o)}});function Bt(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Vs=f("$ZodLazy",(e,t)=>{w.init(e,t),Yn(e._zod,"innerType",()=>{const r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),y(e,"pattern",r=>r.innerType?._zod?.pattern),y(e,"propValues",r=>r.innerType?._zod?.propValues),y(e,"optin",r=>r.innerType?._zod?.optin??void 0),y(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),Bs=f("$ZodCustom",(e,t)=>{A.init(e,t),w.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>Wt(i,r,n,e));Wt(o,r,n,e)}});function Wt(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(le(o))}}var Ws=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},We="~memo",Kt=[];function Ur(e){return e!==null&&typeof e=="object"}function De(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var Mr=new WeakMap,oe=0,ge=1,ae=2;function _e(e,t,r){const n=Mr.get(e);if(n!==void 0)return n?ae:oe;if(t.has(e))return ae;t.add(e);let o=oe;const i=c=>{if(o!==ae&&c?._zod){const l=_e(c,t,r);l>o&&(o=l)}},s=(c,l)=>{let d=oe;for(const h of Reflect.ownKeys(c)){const p=Object.getOwnPropertyDescriptor(c,h);if(l&&!p.enumerable)continue;const m=p.get?ge:p.value?._zod?_e(p.value,t,r):oe;m>d&&(d=m)}return d},a=c=>{c>o&&(o=c)},u=e._zod.def;switch(u.type){case"object":{const c=nt(u);a(c?s(c,!0):ge),i(u.catchall);break}case"array":i(u.element);break;case"tuple":for(const c of u.items)i(c);i(u.rest);break;case"record":case"map":i(u.keyType),i(u.valueType);break;case"set":i(u.valueType);break;case"union":for(const c of u.options)i(c);break;case"intersection":i(u.left),i(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(u.innerType);break;case"pipe":i(u.in),i(u.out);break;case"function":i(u.input),i(u.output);break;case"lazy":{const c=u._cachedInner??(r?e._zod.innerType:void 0);a(c?_e(c,t,!1):ge);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const c in u){const l=Object.getOwnPropertyDescriptor(u,c);if(!l||l.get)continue;const d=l.value;if(!(!d||typeof d!="object")){if(d._zod)i(d);else if(Array.isArray(d))for(const h of d)i(h)}}}return t.delete(e),Ks(e,o)}function Ks(e,t){return t!==ge&&Mr.set(e,t===ae),t}function Hs(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var he,me=[],Gs={alloc(e,t,r){const n=he;if(!n)return r;he=void 0;const o={value:r,issues:null};return n.set(t.value,o),me.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&Ys(i,o.value))throw new Ws;return r(o,i)};e._zod.parse=n,e._zod.run===r&&(e._zod.run=n)})},attach(e){var t;let r,n=!1,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const s=e._zod.parse,a=(u,c)=>{if(r===void 0){const b=_e(e,new Set,!1);if(b===oe)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(u,c);b===ae||n?r=!0:n=!0}const l=u.value;if(!Ur(l))return s(u,c);let d=c[We];d||(d={buckets:new WeakMap,backEdges:void 0},c[We]=d);let h;o===c?h=i:(h=Hs(d,e),o=c,i=h);const p=h.get(l);if(p)return u.value=p.value,p.issues?p.issues.length&&u.issues.push(...De(p.issues)):(u.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(p.value)),u;he=h;const m=me.length,g=s(u,c);he=void 0;const _=me.length>m?me.pop():void 0;return g instanceof Promise?g.then(b=>(_&&(_.issues=b.issues.length?De(b.issues):Kt),b)):(_&&(_.issues=g.issues.length?De(g.issues):Kt),g)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a)})}};function qs(){return Gs}function Ys(e,t){const r=e[We]?.backEdges;return r!==void 0&&Ur(t)&&r.has(t)}var Xs=()=>{const 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(i){return e[i]??null}const 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",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,s){return i==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):n[i]??i}return i=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${o(i.expected)}, received ${o(ho(i.input),i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${gr(i.values[0])}`:`Invalid option: expected one of ${St(i.values,"|")}`;case"too_big":{const s=i.exact?"exactly ":i.inclusive?"<=":"<",a=t(i.origin);return a?`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{const s=i.exact?"exactly ":i.inclusive?">=":">",a=t(i.origin);return a?`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${a.unit}`:`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{const s=i;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${St(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(s=>`'${s}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Qs(){return{localeError:Xs()}}var Ht,ea=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const r=t[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ta(){return new ea}(Ht=globalThis).__zod_globalRegistry??(Ht.__zod_globalRegistry=ta());var ie=globalThis.__zod_globalRegistry;function ht(e){return e.checks&&(e.checks=[...e.checks]),e}function ra(e,t){return new e(ht({type:"string",...v(t)}))}function Lr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...v(t)})}function na(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...v(t)})}function Fr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...v(t)})}function oa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...v(t)})}function ia(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...v(t)})}function sa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...v(t)})}function Jr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...v(t)})}function aa(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...v(t)})}function ua(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...v(t)})}function ca(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...v(t)})}function la(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...v(t)})}function fa(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...v(t)})}function da(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...v(t)})}function pa(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...v(t)})}function ha(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...v(t)})}function ma(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...v(t)})}function va(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...v(t)})}function ga(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...v(t)})}function Vr(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...v(t)})}function _a(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...v(t)})}function ya(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...v(t)})}function ba(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...v(t)})}function Br(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...v(t)})}function Wr(e,t){return new e({type:"string",format:"date",check:"string_format",...v(t)})}function wa(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...v(t)})}function za(e,t){return new e({type:"string",format:"duration",check:"string_format",...v(t)})}function ka(e,t){return new e(ht({type:"number",checks:[],...v(t)}))}function Gc(e,t){return new e(ht({type:"number",coerce:!0,checks:[],...v(t)}))}function Oa(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...v(t)})}function Sa(e,t){return new e({type:"boolean",...v(t)})}function $a(e,t){return new e({type:"undefined",...v(t)})}function Pa(e,t){return new e({type:"null",...v(t)})}function Ea(e){return new e({type:"any"})}function Za(e){return new e({type:"unknown"})}function Aa(e,t){return new e({type:"never",...v(t)})}function Gt(e,t){return new Sr({check:"less_than",...v(t),value:e,inclusive:!1})}function xe(e,t){return new Sr({check:"less_than",...v(t),value:e,inclusive:!0})}function qt(e,t){return new $r({check:"greater_than",...v(t),value:e,inclusive:!1})}function Ue(e,t){return new $r({check:"greater_than",...v(t),value:e,inclusive:!0})}function Yt(e,t){return new wi({check:"multiple_of",...v(t),value:e})}function Kr(e,t){return new ki({check:"max_length",...v(t),maximum:e})}function we(e,t){return new Oi({check:"min_length",...v(t),minimum:e})}function Hr(e,t){return new Si({check:"length_equals",...v(t),length:e})}function Ia(e,t){return new $i({check:"string_format",format:"regex",...v(t),pattern:e})}function Ta(e){return new Pi({check:"string_format",format:"lowercase",...v(e)})}function Na(e){return new Ei({check:"string_format",format:"uppercase",...v(e)})}function Ra(e,t){return new Zi({check:"string_format",format:"includes",...v(t),includes:e})}function ja(e,t){return new Ai({check:"string_format",format:"starts_with",...v(t),prefix:e})}function Ca(e,t){return new Ii({check:"string_format",format:"ends_with",...v(t),suffix:e})}function Da(e,t){return new Ti({check:"properties",shape:e,...v(t)})}function ee(e){return new Ni({check:"overwrite",tx:e})}function xa(e){return ee(t=>t.normalize(e))}function Ua(){return ee(e=>e.trim())}function Ma(){return ee(e=>e.toLowerCase())}function La(){return ee(e=>e.toUpperCase())}function Fa(){return ee(e=>eo(e))}function Ja(e,t,r){return new e({type:"array",element:t,...v(r)})}function Va(e,t,r){const n=v(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Ba(e,t,r){return new e({type:"custom",check:"custom",fn:t,...v(r)})}function Wa(e,t){const r=Ka(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(le(o,n.value,r._zod.def));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(le(i))}},e(n.value,n)),t);return r}function Ka(e,t){const r=new A({check:"custom",...v(t)});return r._zod.check=e,r}function ue(e,...t){for(const r of t)for(const n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&U(e,n,r[n]);return e}function ze(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ie,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function E(e,t,r,n,o){const i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(r,i),!0}function k(e,t,r={path:[],schemaPath:[]}){var n;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;const s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const c={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,c);else{const d=s.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,d,c)}const l=e._zod.parent;l&&(s.ref||(s.ref=l),k(l,t,c),t.seen.get(l).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&ue(s.schema,u),t.io==="input"&&Z(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Xt(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function ke(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const n=new Map;for(const s of e.seen.entries()){const a=e.metadataRegistry.get(s[0])?.id;if(a){const u=n.get(a);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,s[0])}}const o=s=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(s[0])?.id,h=e.external.uri??(m=>m);if(d)return{ref:h(d)};const p=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=p,{defId:p,ref:`${h("__shared")}#/${a}/${Xt(p)}`}}const u="#",c=`${u}/${a}/`;if(s[1]===r&&!s[1].schema.id)return{ref:u};const l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:c+Xt(l)}},i=s=>{if(s[1].schema.$ref)return;const a=s[1],{ref:u,defId:c}=o(s);a.def={...a.schema},c&&(a.defId=c);const l=a.schema;for(const d in l)delete l[d];l.$ref=u};if(e.cycles==="throw")for(const s of e.seen.entries()){const a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
56
56
|
|
|
57
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const a=s[1];if(t===s[0]){i(s);continue}if(e.external){const 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}a.count>1&&e.reused==="ref"&&i(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Gr(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const r=[];for(const n of t){if(!n||typeof n!="object")return;Gr(n);const o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;const i=n.type;for(const s of Array.isArray(i)?i:[i]){if(typeof s!="string")return;r.includes(s)||r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var qr=new Set(["type","properties","required","additionalProperties"]),Qt=["oneOf","anyOf"];function er(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Ke(e){const t=[];for(const i of e){if(typeof i!="object"||i.type!=="object")return null;for(const s in i)if(!qr.has(s))return null;t.push(i)}const r={},n=new Set;for(const i of t){for(const s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;const a=[];for(const c of t){const l=c.properties?.[s]??er(c);l!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(l))||a.push(l))}const u=a.length===1?a[0]:Ke(a)??{allOf:a};U(r,s,u)}for(const s of i.required??[])n.add(s)}const o={type:"object",properties:r};if(n.size&&(o.required=[...n]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{const i=[];for(const s of t){const a=er(s);a&&!i.some(u=>JSON.stringify(u)===JSON.stringify(a))&&i.push(a)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function Ha(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const o of qr)if(o in e)return;const r=t.filter(o=>Qt.some(i=>Array.isArray(o[i])));let n=null;if(!r.length)n=Ke(t);else{const o=r[0],i=Qt.find(u=>Array.isArray(o[u]));if(Object.keys(o).length!==1)return;const s=t.filter(u=>u!==o),a=o[i].map(u=>Ke([...s,u]));if(a.some(u=>!u))return;n={[i]:a}}n&&(delete e.allOf,ue(e,n))}function Oe(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=a=>{const u=e.seen.get(a);if(u.ref===null)return;const c=u.def??u.schema,l={...c},d=u.ref;if(u.ref=null,d){n(d);const p=e.seen.get(d),m=p.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):ue(c,m),ue(c,l),a._zod.parent===d)for(const g in c)g==="$ref"||g==="allOf"||g in l||delete c[g];if(m.$ref&&p.def)for(const g in c)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(c[g])===JSON.stringify(p.def[g])&&delete c[g]}const h=a._zod.parent;if(h&&h!==d){n(h);const p=e.seen.get(h);if(p?.schema.$ref&&(c.$ref=p.schema.$ref,p.def))for(const m in c)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(c[m])===JSON.stringify(p.def[m])&&delete c[m]}e.override({zodSchema:a,jsonSchema:c,path:u.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const a of[...e.seen.entries()].reverse())n(a[0]);if(e.target!=="openapi-3.0")for(const a of e.seen.entries())Gr(a[1].def??a[1].schema);for(const a of e.deferred)a();if(e.intersections.length){const a=new Map;for(const u of e.seen.values())for(const c of[u.schema,u.def]){const l=c?.allOf;if(!Array.isArray(l))continue;const d=a.get(l);d?d.push(c):a.set(l,[c])}for(const u of e.intersections)for(const c of a.get(u)??[])Ha(c)}}const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}ue(o,r.defId?r.schema:r.def??r.schema);const i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;const s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const a of e.seen.entries()){const u=a[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,U(s,u.defId,u.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Se(t,"input",e.processors),output:Se(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Z(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Z(n.element,r);if(n.type==="set")return Z(n.valueType,r);if(n.type==="lazy")return Z(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return Z(n.innerType,r);if(n.type==="intersection")return Z(n.left,r)||Z(n.right,r);if(n.type==="record"||n.type==="map")return Z(n.keyType,r)||Z(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Z(n.in,r)||Z(n.out,r);if(n.type==="object"){for(const o in n.shape)if(Z(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(const o of n.options)if(Z(o,r))return!0;return!1}if(n.type==="tuple"){for(const o of n.items)if(Z(o,r))return!0;return!!(n.rest&&Z(n.rest,r))}return!1}var Ga=(e,t={})=>r=>{const n=ze({...r,processors:t});return k(e,n),ke(n,e),Oe(n,e)},Se=(e,t,r={})=>n=>{const{libraryOptions:o,target:i}=n??{},s=ze({...o??{},target:i,io:t,processors:r});return k(e,s),ke(s,e),Oe(s,e)},X=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},Q=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},tr=(e,t)=>{X(e,"minimum",t),Q(e,"maximum",t)},Yr=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},Xr=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Qr=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},en=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},rr=(e,t)=>X(e,"minimum",t.minimum),nr=(e,t)=>Q(e,"maximum",t.maximum),or=e=>(t,r)=>{en(t,r.format);const[n,o]=e[r.format];X(t,"minimum",n),Q(t,"maximum",o)},qa={greater_than:(e,t)=>X(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Q(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Yr(e,t.value),number_format:or(_r),bigint_format:or(oo),min_length:rr,max_length:nr,length_equals:(e,t)=>tr(e,t.length),min_size:rr,max_size:nr,size_equals:(e,t)=>tr(e,t.size),string_format:(e,t)=>{en(e,t.format),t.pattern&&Xr(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Qr(e,t.mime)};function N(e){const t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(const i of n)qa[i._zod.def.check]?.(t,i._zod.def);const o=e._zod.bag;o.minimum!==void 0&&X(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&X(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&Q(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&Q(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&Yr(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&Qr(t,o.mime);for(const i of o.patterns??[])Xr(t,i);return t}var Ya={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Xa=new Map([[Tr,si],[pt,ai]]),tn=e=>Xa.get(e)??e,rn=(e,t,r,n)=>{const o=r;o.type="string";const{minimum:i,maximum:s,format:a,patterns:u,contentEncoding:c,laxFormat:l}=N(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=Ya[a]??a,o.format===""&&delete o.format,(a==="time"||l)&&delete o.format),c&&(o.contentEncoding=c),u&&u.size>0){const d=[...u].map(tn);d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},nn=(e,t,r,n)=>{const o=r,{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c,isInt:l}=N(e);o.type=l?"integer":"number";const d=typeof c=="number"&&c>=(i??Number.NEGATIVE_INFINITY),h=typeof u=="number"&&u<=(s??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";if(d?p?(o.minimum=c,o.exclusiveMinimum=!0):o.exclusiveMinimum=c:typeof i=="number"&&(o.minimum=i),h?p?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u:typeof s=="number"&&(o.maximum=s),a){const m=new Set;for(const b of a)Number.isFinite(b)&&b!==0?m.add(Math.abs(b)):E(e,t,o,n,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);const[g,..._]=m;g!==void 0&&(o.multipleOf=g),_.length&&(o.allOf=[...o.allOf??[],..._.map(b=>({multipleOf:b}))])}},on=(e,t,r,n)=>{r.type="boolean"},Qa=(e,t,r,n)=>{E(e,t,r,n,"BigInt cannot be represented in JSON Schema")},eu=(e,t,r,n)=>{E(e,t,r,n,"Symbols cannot be represented in JSON Schema")},sn=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},an=(e,t,r,n)=>{E(e,t,r,n,"Undefined cannot be represented in JSON Schema")},tu=(e,t,r,n)=>{E(e,t,r,n,"Void cannot be represented in JSON Schema")},un=(e,t,r,n)=>{r.not={}},cn=(e,t,r,n)=>{},ln=(e,t,r,n)=>{},ru=(e,t,r,n)=>{E(e,t,r,n,"Date cannot be represented in JSON Schema")},fn=(e,t,r,n)=>{const o=e._zod.def,i=Le(o.entries);if(i.length===0){r.not={};return}i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},dn=(e,t,r,n)=>{const o=e._zod.def;if(o.values.length===0){r.not={};return}const i=[];for(const s of o.values)if(s===void 0){if(E(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(E(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i},nu=(e,t,r,n)=>{E(e,t,r,n,"NaN cannot be represented in JSON Schema")},ou=(e,t,r,n)=>{const o=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source},iu=(e,t,r,n)=>{const o=r;o.type="string",o.format="binary",o.contentEncoding="binary";const{minimum:i,maximum:s,mime:a}=N(e);i!==void 0&&(o.minLength=i),s!==void 0&&(o.maxLength=s),a&&(a.length===0?o.not={}:a.length===1?o.contentMediaType=a[0]:o.anyOf=a.map(u=>({contentMediaType:u})))},su=(e,t,r,n)=>{r.type="boolean"},pn=(e,t,r,n)=>{E(e,t,r,n,"Custom types cannot be represented in JSON Schema")},au=(e,t,r,n)=>{E(e,t,r,n,"Function types cannot be represented in JSON Schema")},hn=(e,t,r,n)=>{E(e,t,r,n,"Transforms cannot be represented in JSON Schema")},uu=(e,t,r,n)=>{E(e,t,r,n,"Map cannot be represented in JSON Schema")},cu=(e,t,r,n)=>{E(e,t,r,n,"Set cannot be represented in JSON Schema")},mn=(e,t,r,n)=>{const o=r,i=e._zod.def,{minimum:s,maximum:a}=N(e);typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=k(i.element,t,{...n,path:[...n.path,"items"]})};function fe(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?fe(t.out):t.type==="catch"?fe(t.innerType):e._zod.optin}var vn=(e,t,r,n)=>{const o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&E(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(const u in s)U(o.properties,u,k(s[u],t,{...n,path:[...n.path,"properties",u]}));const a=[];for(const u of Object.keys(s)){const c=i.shape[u];(t.io==="input"?fe(c)===void 0:c._zod.optout===void 0)&&a.push(u)}a.length>0&&(o.required=a),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=k(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},gn=(e,t,r,n)=>{const o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,u)=>k(a,t,{...n,path:[...n.path,i?"oneOf":"anyOf",u]}));i?r.oneOf=s:r.anyOf=s},_n=(e,t,r,n)=>{const o=e._zod.def,i=k(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=k(o.right,t,{...n,path:[...n.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,u=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=u,t.intersections.push(u)},yn=(e,t,r,n)=>{const o=r,i=e._zod.def;o.type="array";const s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=i.items.map((g,_)=>k(g,t,{...n,path:[...n.path,s,_]})),c=i.rest?k(i.rest,t,{...n,path:[...n.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;let l=i.items.length;for(;l>0;){const g=i.items[l-1];if(!(t.io==="input"?fe(g)!==void 0:g._zod.optout==="optional"))break;l--}const d=i.items.length,h=!i.rest;t.target==="draft-2020-12"?(o.prefixItems=u,h?o.items=!1:c&&(o.items=c),l>0&&(o.minItems=l),h&&(o.maxItems=d)):t.target==="openapi-3.0"?(o.items={anyOf:u},c&&o.items.anyOf.push(c),l>0&&(o.minItems=l),h&&(o.maxItems=d)):(o.items=u,h?o.additionalItems=!1:c&&(o.additionalItems=c),l>0&&(o.minItems=l),h&&(o.maxItems=d));const{minimum:p,maximum:m}=N(e);typeof p=="number"&&(o.minItems=p),typeof m=="number"&&(o.maxItems=m)};function He(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);const m=e.get(t)?.def;if(!m)return t;const g=He(e,m,r);return g===m?t:g}for(const m of["anyOf","oneOf"]){const g=t[m];if(!Array.isArray(g))continue;const _=g.map(b=>He(e,b,r));_.some((b,I)=>b!==g[I])&&(t={...t,[m]:_})}const n=Array.isArray(t.type)?t.type:[t.type],o=!n.includes("string")&&n.some(m=>m==="number"||m==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(m=>typeof m=="number"))return t;const{minimum:s,maximum:a,exclusiveMinimum:u,exclusiveMaximum:c,multipleOf:l,format:d,id:h,...p}=t;return p.enum?p.enum=p.enum.map(m=>typeof m=="number"?String(m):m):typeof p.const=="number"&&(p.const=String(p.const)),o&&(p.type="string",i||(p.pattern=(n.includes("number")?lt:mi).source)),p}var Ge=new WeakMap;function lu(e){const t=new Map;for(const n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);const r=new Map;for(const n of Ge.get(e)??[]){const o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===!0||r.has(i))continue;const s=He(t,i,new Set);s!==i&&r.set(i,s)}if(r.size)for(const n of e.seen.values())for(const o of[n.schema,n.def]){const i=o&&r.get(o.propertyNames);i&&(o.propertyNames=i)}}var bn=(e,t,r,n)=>{const o=r,i=e._zod.def;o.type="object";const s=i.keyType,a=N(s).patterns;if(i.mode==="loose"&&a&&a.size>0){const l=k(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(const d of a)U(o.patternProperties,tn(d).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=k(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let l=Ge.get(t);l||(l=[],Ge.set(t,l),t.deferred.push(()=>lu(t))),l.push(e)}o.additionalProperties=k(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}const u=s._zod.values,c=t.io==="input"&&fe(i.valueType)!==void 0;if(u&&!i.partial&&!c){const l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(o.required=l.map(String))}},wn=(e,t,r,n)=>{const o=e._zod.def,i=k(o.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},zn=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},mt=Symbol();function kn(e,t,r,n,o){let i=!1;const s=JSON.stringify(e,(a,u)=>typeof u!="bigint"?u:(i=!0,null));return i?(E(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),mt):JSON.parse(s)}var On=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType;const s=kn(o.defaultValue,e,t,r,n);s!==mt&&(r.default=s)},Sn=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;const s=kn(o.defaultValue,e,t,r,n);s!==mt&&(r._prefault=s)},$n=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{E(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},Pn=(e,t,r,n)=>{const o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;k(s,t,n);const a=t.seen.get(e);a.ref=s},En=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0},fu=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},vt=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},Zn=(e,t,r,n)=>{const o=e._zod.innerType;k(o,t,n);const i=t.seen.get(e);i.ref=o},ir={string:rn,number:nn,boolean:on,bigint:Qa,symbol:eu,null:sn,undefined:an,void:tu,never:un,any:cn,unknown:ln,date:ru,enum:fn,literal:dn,nan:nu,template_literal:ou,file:iu,success:su,custom:pn,function:au,transform:hn,map:uu,set:cu,array:mn,object:vn,union:gn,intersection:_n,tuple:yn,record:bn,nullable:wn,nonoptional:zn,default:On,prefault:Sn,catch:$n,pipe:Pn,readonly:En,promise:fu,optional:vt,lazy:Zn};function qc(e,t){if("_idmap"in e){const n=e,o=ze({...t,processors:ir}),i={};for(const a of n._idmap.entries()){const[u,c]=a;k(c,o)}const s={};o.external={registry:n,uri:t?.uri,defs:i};for(const a of n._idmap.entries()){const[u,c]=a;ke(o,c),U(s,u,Oe(o,c))}return Object.keys(i).length>0&&(s.__shared={[o.target==="draft-2020-12"?"$defs":"definitions"]:i}),{schemas:s}}const r=ze({...t,processors:ir});return k(e,r),ke(r,e),Oe(r,e)}var sr=new WeakSet([Object.prototype,Error.prototype]);function ve(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var An=(e,t)=>{$o.init(e,t),e.name="ZodError";const r=Object.getPrototypeOf(e);sr.has(r)||(sr.add(r),ve(r,"format",n=>o=>Ao(n,o)),ve(r,"flatten",n=>o=>Zo(n,o)),ve(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,Fe,2)}),ve(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,Fe,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Yc=f("ZodError",An),j=f("ZodError",An,void 0,{Parent:Error}),du=at(j),pu=ut(j),hu=Ae(j),mu=ct(j),vu=Co(j),gu=Do(j),_u=xo(j),yu=Uo(j),bu=Mo(j),wu=Lo(j),zu=Fo(j),ku=Jo(j);function Ou(){R.localeError||x(Qs())}function de(){R.memoizer||x({memoizer:qs()})}var z=f("ZodType",(e,t)=>(Ou(),w.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(T(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return W(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(bc(e,t))},superRefine(e,t){return this.check(wc(e,t))},overwrite(e){return this.check(ee(e))},optional(){return ur(this)},exactOptional(){return ac(this)},nullable(){return cr(this)},nullish(){return ur(cr(this))},nonoptional(e){return pc(this,e)},array(){return Xu(this)},or(e){return Qu([this,e])},and(e){return rc(this,e)},transform(e){return lr(this,Mn(e))},default(e){return lc(this,e)},prefault(e){return dc(this,e)},catch(e){return mc(this,e)},pipe(e){return lr(this,e)},readonly(){return _c(this)},describe(e){const t=this.clone();return ie.add(t,{description:e}),t},meta(...e){if(e.length===0)return ie.get(this);const t=this.clone();return ie.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return st(this,"~standard",{...Er(this),jsonSchema:{input:Se(this,"input"),output:Se(this,"output")}})},set"~standard"(e){B(this,"~standard",e)},parse:function e(t,r){return du(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await pu(this,t,r,{callee:e})},safeParse(e,t){return hu(this,e,t)},async safeParseAsync(e,t){return mu(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){B(this,"spa",e)},validate(e,t){return No(this,e,t)},validateAsync(e,t){return jo(this,e,t)},encode:function e(t,r){return vu(this,t,r,{callee:e})},decode:function e(t,r){return gu(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await _u(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await yu(this,t,r,{callee:e})},safeEncode(e,t){return bu(this,e,t)},safeDecode(e,t){return wu(this,e,t)},async safeEncodeAsync(e,t){return zu(this,e,t)},async safeDecodeAsync(e,t){return ku(this,e,t)},toJSONSchema(e){return Ga(this,{})(e)},get description(){return ie.get(this)?.description},get _def(){return this._zod.def}}),In=f("_ZodString",(e,t)=>{dt.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rn(e,r,n,o)},br({format:e=>N(e).format??null,minLength:e=>N(e).minimum??null,maxLength:e=>N(e).maximum??null},{regex(...e){return this.check(Ia(...e))},includes(...e){return this.check(Ra(...e))},startsWith(...e){return this.check(ja(...e))},endsWith(...e){return this.check(Ca(...e))},min(...e){return this.check(we(...e))},max(...e){return this.check(Kr(...e))},length(...e){return this.check(Hr(...e))},nonempty(...e){return this.check(we(1,...e))},lowercase(e){return this.check(Ta(e))},uppercase(e){return this.check(Na(e))},trim(){return this.check(Ua())},normalize(...e){return this.check(xa(...e))},toLowerCase(){return this.check(Ma())},toUpperCase(){return this.check(La())},slugify(){return this.check(Fa())}})),Su=f("ZodString",(e,t)=>{dt.init(e,t),In.init(e,t)},{email(e){return this.check(Lr(Rn,e))},url(e){return this.check(Jr(jn,e))},jwt(e){return this.check(ba(Ju,e))},emoji(e){return this.check(aa(Au,e))},guid(e){return this.check(na(Zu,e))},uuid(e){return this.check(Fr(se,e))},uuidv4(e){return this.check(oa(se,e))},uuidv6(e){return this.check(ia(se,e))},uuidv7(e){return this.check(sa(se,e))},nanoid(e){return this.check(ua(Iu,e))},cuid(e){return this.check(ca(Tu,e))},cuid2(e){return this.check(la(Nu,e))},ulid(e){return this.check(fa(Ru,e))},base64(e){return this.check(Vr(Cn,e))},base64url(e){return this.check(_a(Lu,e))},xid(e){return this.check(da(ju,e))},ksuid(e){return this.check(pa(Cu,e))},ipv4(e){return this.check(ha(Du,e))},ipv6(e){return this.check(ma(xu,e))},cidrv4(e){return this.check(va(Uu,e))},cidrv6(e){return this.check(ga(Mu,e))},e164(e){return this.check(ya(Fu,e))},datetime(e){return this.check(Br(Tn,e))},date(e){return this.check(Wr(Nn,e))},time(e){return this.check(wa(Pu,e))},duration(e){return this.check(za(Eu,e))}});function $u(e){return ra(Su,e)}var $=f("ZodStringFormat",(e,t)=>{S.init(e,t),In.init(e,t)}),Tn=f("ZodISODateTime",(e,t)=>{Qi.init(e,t),$.init(e,t)}),Nn=f("ZodISODate",(e,t)=>{es.init(e,t),$.init(e,t)}),Pu=f("ZodISOTime",(e,t)=>{ts.init(e,t),$.init(e,t)}),Eu=f("ZodISODuration",(e,t)=>{rs.init(e,t),$.init(e,t)}),Rn=f("ZodEmail",(e,t)=>{Ui.init(e,t),$.init(e,t)});function Xc(e){return Lr(Rn,e)}var Zu=f("ZodGUID",(e,t)=>{Di.init(e,t),$.init(e,t)}),se=f("ZodUUID",(e,t)=>{xi.init(e,t),$.init(e,t)});function Qc(e){return Fr(se,e)}var jn=f("ZodURL",(e,t)=>{Bi.init(e,t),$.init(e,t)});function el(e){return Jr(jn,e)}var Au=f("ZodEmoji",(e,t)=>{Wi.init(e,t),$.init(e,t)}),Iu=f("ZodNanoID",(e,t)=>{Ki.init(e,t),$.init(e,t)}),Tu=f("ZodCUID",(e,t)=>{Hi.init(e,t),$.init(e,t)}),Nu=f("ZodCUID2",(e,t)=>{Gi.init(e,t),$.init(e,t)}),Ru=f("ZodULID",(e,t)=>{qi.init(e,t),$.init(e,t)}),ju=f("ZodXID",(e,t)=>{Yi.init(e,t),$.init(e,t)}),Cu=f("ZodKSUID",(e,t)=>{Xi.init(e,t),$.init(e,t)}),Du=f("ZodIPv4",(e,t)=>{ns.init(e,t),$.init(e,t)}),xu=f("ZodIPv6",(e,t)=>{is.init(e,t),$.init(e,t)}),Uu=f("ZodCIDRv4",(e,t)=>{ss.init(e,t),$.init(e,t)}),Mu=f("ZodCIDRv6",(e,t)=>{us.init(e,t),$.init(e,t)}),Cn=f("ZodBase64",(e,t)=>{cs.init(e,t),$.init(e,t)});function tl(e){return Vr(Cn,e)}var Lu=f("ZodBase64URL",(e,t)=>{fs.init(e,t),$.init(e,t)}),Fu=f("ZodE164",(e,t)=>{ds.init(e,t),$.init(e,t)}),Ju=f("ZodJWT",(e,t)=>{hs.init(e,t),$.init(e,t)}),Dn=f("ZodNumber",(e,t)=>{Nr.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>nn(e,r,n,o),e.isFinite=!0},br({minValue:e=>{const{minimum:t,exclusiveMinimum:r}=N(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:r}=N(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:r}=N(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>N(e).format??null},{gt(e,t){return this.check(qt(e,t))},gte(e,t){return this.check(Ue(e,t))},min(e,t){return this.check(Ue(e,t))},lt(e,t){return this.check(Gt(e,t))},lte(e,t){return this.check(xe(e,t))},max(e,t){return this.check(xe(e,t))},int(e){return this.check(ar(e))},safe(e){return this.check(ar(e))},positive(e){return this.check(qt(0,e))},nonnegative(e){return this.check(Ue(0,e))},negative(e){return this.check(Gt(0,e))},nonpositive(e){return this.check(xe(0,e))},multipleOf(e,t){return this.check(Yt(e,t))},step(e,t){return this.check(Yt(e,t))},finite(){return this}}));function rl(e){return ka(Dn,e)}var Vu=f("ZodNumberFormat",(e,t)=>{ms.init(e,t),Dn.init(e,t)});function ar(e){return Oa(Vu,e)}var Bu=f("ZodBoolean",(e,t)=>{vs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>on(e,r,n,o)});function nl(e){return Sa(Bu,e)}var Wu=f("ZodUndefined",(e,t)=>{gs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>an(e,r,n,o)});function ol(e){return $a(Wu,e)}var Ku=f("ZodNull",(e,t)=>{_s.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>sn(e,r,n,o)});function il(e){return Pa(Ku,e)}var Hu=f("ZodAny",(e,t)=>{ys.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>cn(e,r,n,o)});function sl(){return Ea(Hu)}var Gu=f("ZodUnknown",(e,t)=>{bs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ln(e,r,n,o)});function qe(){return Za(Gu)}var qu=f("ZodNever",(e,t)=>{ws.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>un(e,r,n,o)});function xn(e){return Aa(qu,e)}var Yu=f("ZodArray",(e,t)=>{de(),Os.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mn(e,r,n,o),e.element=t.element},{min(e,t){return this.check(we(e,t))},nonempty(e){return this.check(we(1,e))},max(e,t){return this.check(Kr(e,t))},length(e,t){return this.check(Hr(e,t))},unwrap(){return this.element}});function Xu(e,t){return Ja(Yu,e,t)}var gt=f("ZodObject",(e,t)=>{de(),Ps.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vn(e,r,n,o),yo(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return oc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(T(this._zod.def,{catchall:e}))},passthrough(){return this.clone(T(this._zod.def,{catchall:qe()}))},loose(){return this.clone(T(this._zod.def,{catchall:qe()}))},strict(){return this.clone(T(this._zod.def,{catchall:xn()}))},strip(){return this.clone(T(this._zod.def,{catchall:void 0}))},extend(e){return ao(this,e)},safeExtend(e){return uo(this,e)},merge(e){return co(this,e)},pick(e){return io(this,e)},omit(e){return so(this,e)},partial(...e){return Pt(_t,this,e[0])},exactPartial(...e){return Pt(Ln,this,e[0],"exactPartial")},required(...e){return lo(Fn,this,e[0])}});function al(e,t){const r={type:"object",shape:e??{},...v(t)};return new gt(r)}function ul(e,t){return new gt({type:"object",shape:e,catchall:xn(),...v(t)})}function cl(e,t){return new gt({type:"object",shape:e,catchall:qe(),...v(t)})}var Un=f("ZodUnion",(e,t)=>{Cr.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>gn(e,r,n,o),e.options=t.options});function Qu(e,t){return new Un({type:"union",options:e,...v(t)})}var ec=f("ZodDiscriminatedUnion",(e,t)=>{Un.init(e,t),Zs.init(e,t)});function ll(e,t,r){return new ec({type:"union",options:t,discriminator:e,...v(r)})}var tc=f("ZodIntersection",(e,t)=>{As.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_n(e,r,n,o)});function rc(e,t){return new tc({type:"intersection",left:e,right:t})}var nc=f("ZodTuple",(e,t)=>{de(),Is.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yn(e,r,n,o)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){const e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new _t({type:"optional",innerType:t}))})}});function fl(e,t,r){const n=t instanceof w,o=n?r:t;return new nc({type:"tuple",items:e,rest:n?t:null,...v(o)})}var Ye=f("ZodRecord",(e,t)=>{de(),Ts.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>bn(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function dl(e,t,r){return!t||!t._zod?new Ye({type:"record",keyType:$u(),valueType:e,...v(t)}):new Ye({type:"record",keyType:e,valueType:t,...v(r)})}function pl(e,t,r){return new Ye({type:"record",keyType:e,valueType:t,...v(r),partial:!0})}var Xe=f("ZodEnum",(e,t)=>{Ns.init(e,t),z.init(e,t),e._zod.processJSONSchema=(n,o,i)=>fn(e,n,o,i),e.enum=t.entries,e.options=[...e._zod.values];const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const i={};for(const s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Xe({...t,checks:[],...v(o),entries:i})},e.exclude=(n,o)=>{const i={...t.entries};for(const s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Xe({...t,checks:[],...v(o),entries:i})}});function oc(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Xe({type:"enum",entries:r,...v(t)})}var ic=f("ZodLiteral",(e,t)=>{Rs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>dn(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function hl(e,t){return new ic({type:"literal",values:Array.isArray(e)?e:[e],...v(t)})}var sc=f("ZodTransform",(e,t)=>{de(),js.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>hn(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new wr(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(le(i,r.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=e),r.issues.push(le(s))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function Mn(e){return new sc({type:"transform",transform:e})}var _t=f("ZodOptional",(e,t)=>{Dr.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vt(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ur(e){return new _t({type:"optional",innerType:e})}var Ln=f("ZodExactOptional",(e,t)=>{Cs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vt(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ac(e){return new Ln({type:"optional",innerType:e})}var uc=f("ZodNullable",(e,t)=>{Ds.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wn(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function cr(e){return new uc({type:"nullable",innerType:e})}var cc=f("ZodDefault",(e,t)=>{xs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>On(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function lc(e,t){return new cc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():vr(t)}})}var fc=f("ZodPrefault",(e,t)=>{Us.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Sn(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function dc(e,t){return new fc({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():vr(t)}})}var Fn=f("ZodNonOptional",(e,t)=>{Ms.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zn(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function pc(e,t){return new Fn({type:"nonoptional",innerType:e,...v(t)})}var hc=f("ZodCatch",(e,t)=>{Ls.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$n(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function mc(e,t){return new hc({type:"catch",innerType:e,catchValue:typeof t=="function"?t:wo(t)})}var Jn=f("ZodPipe",(e,t)=>{xr.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Pn(e,r,n,o),e.in=t.in,e.out=t.out});function lr(e,t){return new Jn({type:"pipe",in:e,out:t})}var vc=f("ZodPreprocess",(e,t)=>{Jn.init(e,t),Fs.init(e,t)}),gc=f("ZodReadonly",(e,t)=>{Js.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>En(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function _c(e){return new gc({type:"readonly",innerType:e})}var yc=f("ZodLazy",(e,t)=>{Vs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zn(e,r,n,o),e.unwrap=()=>e._zod.def.getter()});function ml(e){return new yc({type:"lazy",getter:e})}var yt=f("ZodCustom",(e,t)=>{Bs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pn(e,r,n,o)});function vl(e,t){return Va(yt,e??(()=>!0),t)}function bc(e,t={}){return Ba(yt,e,t)}function wc(e,t){return Wa(e,t)}var zc=f("ZodInstanceOf",(e,t)=>{yt.init(e,t)},{properties(e,t){return this.check(Da(e,t))}});function gl(e,t={}){const r=new zc({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...v(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}function _l(e,t){return new vc({type:"pipe",in:Mn(e),out:t})}function yl(e){return Br(Tn,e)}function bl(e){return Wr(Nn,e)}var kc="io.modelcontextprotocol/skills";function fr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Oc(e){const t=e?.extensions;if(!fr(t)||!Object.prototype.hasOwnProperty.call(t,"io.modelcontextprotocol/skills"))return;const r=t[kc];return fr(r)?r:void 0}function wl(e){return Oc(e)!==void 0}var Sc="io.modelcontextprotocol/ui",$c="text/html;profile=mcp-app";function $e(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Pc(e,t){if(!e&&!t)return;if(!e)return{...t};if(!t)return{...e};const r={...e};for(const n of Object.keys(t)){const o=r[n],i=t[n];$e(o)&&$e(i)?r[n]={...o,...i}:r[n]=i}return r}function zl(){return{extensions:{[Sc]:{mimeTypes:[$c]}}}}function kl(e){return{...e??{}}}function Ol(e,t){const r=e,n=t,o={...e??{},...t??{}};if(n&&Object.prototype.hasOwnProperty.call(n,"extensions")){const i=n.extensions;i===void 0?o.extensions=r?.extensions:$e(i)?Object.keys(i).length===0?o.extensions={}:$e(r?.extensions)?o.extensions=Pc(r.extensions,i):o.extensions={...i}:o.extensions=i}return o}function Sl(){return"12.1.0"}var Qe="[A-Za-z0-9!#$%&'*+.^_`|~-]+";function Ec(e){const t={},r=new RegExp(`(${Qe})\\s*=\\s*(?:"((?:\\\\.|[^"\\\\])*)"|([^,\\s]+))`,"g");for(let n=r.exec(e);n;n=r.exec(e)){const o=n[2];t[n[1].toLowerCase()]=o!==void 0?o.replace(/\\([\s\S])/g,"$1"):n[3]??""}return t}function $l(e){return bt(e)[0]??{}}function Pl(e){if(!e)return;const t=e.split(/\s+/).map(r=>r.trim()).filter(Boolean);return t.length>0?Array.from(new Set(t)):void 0}function El(e,t){const r=[],n=new Set;for(const o of[...e??[],...t??[]]){const i=o?.trim();!i||n.has(i)||(n.add(i),r.push(i))}return r}function bt(e){if(!e)return[];const t=[];let r="",n=!1;for(let a=0;a<e.length;a++){const u=e[a];n&&u==="\\"&&a+1<e.length?(r+=u+e[a+1],a++):u==='"'?(n=!n,r+=u):u===","&&!n?(t.push(r),r=""):r+=u}t.push(r);const o=[],i=new RegExp(`^(${Qe})\\s+(?!\\s*=)(.+)$`,"s"),s=new RegExp(`^(${Qe})$`);for(const a of t){const u=a.trim();if(!u)continue;const c=i.exec(u),l=c?null:s.exec(u);c?o.push({scheme:c[1].toLowerCase(),params:[c[2]]}):l?o.push({scheme:l[1].toLowerCase(),params:[]}):o.length>0&&o[o.length-1].params.push(u)}return o.filter(a=>a.scheme==="bearer").map(a=>Ec(a.params.join(", ")))}function Zc(e){return bt(e).length>0}var Zl=class extends Error{status;constructor(e,t){super(e),this.name="UnexpectedProbeStatusError",this.status=t}},Vn="MCP server returned HTTP ";function Al(e){return e.startsWith(Vn)}function Ac(e){if(e.status===401)return{kind:"challenged",specCompliant:!0};if(e.status===200)return{kind:"anonymous_allowed"};if(e.status===403&&Zc(e.wwwAuthenticateHeader))return{kind:"challenged",specCompliant:!1};const t=e.serverMessage||e.statusText,r=`${Vn}${e.status}${t?` ${t}`:""}`;return e.status===403?e.wwwAuthenticateHeader?.trim()?{kind:"unexpected",message:`${r}, and its WWW-Authenticate header offers no Bearer challenge. MCP OAuth has nothing to discover from without one, so the flow cannot continue against this server.`}:{kind:"unexpected",message:`${r} with no WWW-Authenticate challenge. MCP requires 401 with a WWW-Authenticate header to begin OAuth, so there is nothing to discover from. A bare 403 usually means a proxy, WAF, or IP allowlist rejected the request before the MCP server saw it.`}:{kind:"unexpected",message:`${r} where MCP requires 401 Unauthorized (or 200, if the server allows anonymous access).`}}function Il(e){return e.step!=="request_without_token"||e.status===void 0?!1:Ac({status:e.status,statusText:e.statusText,wwwAuthenticateHeader:e.wwwAuthenticateHeader}).kind==="challenged"}function Tl(e){const t=Number.isInteger(e.maxRetries)&&e.maxRetries>=0?e.maxRetries:1;switch(e.authMode){case"m2m":return"throw";case"debugger":return"manual";case"interactive":return e.attempt<t?"reauthorize":"throw"}}function Nl(e){const t=e.customScopes?.trim();if(t)return t;const r=e.challengedScopes?.filter(Boolean)??[];if(r.length>0)return Array.from(new Set(r)).join(" ");const n=e.supportedScopes?.filter(Boolean)??[];if(n.length!==0)return Array.from(new Set(n)).join(" ")}var wt=Object.freeze({fieldChars:512,rawChars:2048}),Ic="mcp/www_authenticate";function zt(e,t){return e.length>t?e.slice(0,t):e}function J(e){if(typeof e!="string")return;const t=e.trim();return t?zt(t,wt.fieldChars):void 0}var dr=Object.freeze({challengeHeader:"none",hasResourceMetadata:!1,hasScope:!1,hasErrorParams:!1});function Tc(e,t){return(t?e.find(r=>r.error==="insufficient_scope"):void 0)??e.find(r=>r.error)??e.find(r=>r.resource_metadata||r.scope)??e[0]}function Nc(e,t){const r=typeof e=="string"?e.trim():"";if(!r)return{source:t,facets:{...dr}};let n=[];try{n=bt(r)}catch{n=[]}const o=zt(r,wt.rawChars);if(n.length===0)return{source:t,raw:o,facets:{...dr,challengeHeader:"other-scheme"}};const i=Tc(n,t==="http_403_insufficient_scope"||t==="tool_result_meta")??{},s=J(i.error),a=J(i.error_description),u=J(i.scope),c=J(i.resource_metadata);return{source:t,...s?{error:s}:{},...a?{errorDescription:a}:{},...u?{requiredScope:u}:{},...c?{resourceMetadataUrl:c}:{},raw:o,facets:{challengeHeader:"bearer",hasResourceMetadata:c!==void 0,hasScope:u!==void 0,hasErrorParams:s!==void 0&&a!==void 0}}}function G(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Rl(e){if(!G(e)||e.isError!==!0)return;const t=e._meta;if(!G(t))return;const r=t[Ic],n=(Array.isArray(r)?r:[r]).filter(o=>typeof o=="string"&&o.trim()!=="");if(n.length!==0)return Nc(n.map(o=>{const i=o.trim();return i.startsWith("'")&&i.endsWith("'")?i.slice(1,-1):i}).join(", "),"tool_result_meta")}function jl(e){if(!G(e))return;const t=e.source;if(t!=="http_401"&&t!=="http_403_insufficient_scope"&&t!=="tool_result_meta")return;const r=G(e.facets)?e.facets:{},n=r.challengeHeader==="bearer"||r.challengeHeader==="other-scheme"?r.challengeHeader:"none",o=e.effectiveAuth,i=J(e.error),s=J(e.errorDescription),a=J(e.requiredScope),u=J(e.resourceMetadataUrl),c=typeof e.raw=="string"&&e.raw?zt(e.raw,wt.rawChars):void 0;return{source:t,...i?{error:i}:{},...s?{errorDescription:s}:{},...a?{requiredScope:a}:{},...u?{resourceMetadataUrl:u}:{},...c?{raw:c}:{},...o==="discover"||o==="oauth"||o==="xaa"||o==="bearer"||o==="none"?{effectiveAuth:o}:{},facets:{challengeHeader:n,hasResourceMetadata:r.hasResourceMetadata===!0,hasScope:r.hasScope===!0,hasErrorParams:r.hasErrorParams===!0}}}function Me(e){if(!Array.isArray(e))return;const t=[];for(const r of e){if(!G(r)||typeof r.type!="string")continue;const n=Array.isArray(r.scopes)?r.scopes.filter(o=>typeof o=="string"):void 0;t.push({type:r.type,...n?{scopes:n}:{}})}return t}function Cl(e){const t=e.declaration??void 0,r=Me(t?.securitySchemes);if(r)return{schemes:r,source:"tool"};const n=Me((G(t?._meta)?t._meta:void 0)?.securitySchemes);if(n)return{schemes:n,source:"tool-meta"};const o=Me(e.serverDefault);return o?{schemes:o,source:"server-default"}:e.serverDefault===null?{schemes:[],source:"none"}:{schemes:[],source:"unresolved"}}function Rc(e){return e?.schemes.some(t=>t.type==="oauth2")===!0}var jc=["prompt","notify","passthrough"],Cc=["any","bearer-header","resource-metadata"],Dc=["any","oauth2-scheme","oauth2-scheme+error-params"],xc=Object.freeze({unauthorizedChallenge:"prompt",unauthorizedChallengeTrigger:"any",toolResultAuthChallenge:"passthrough",toolResultAuthChallengeTrigger:"oauth2-scheme+error-params"});function Dl(e,t,r){const n={...xc,...Uc(t??{})};if(e.source==="http_403_insufficient_scope")return{action:"prompt",reason:"honored"};if(e.source==="http_401"){const s=n.unauthorizedChallenge;if(s==="passthrough")return{action:"passthrough",reason:"not-honored"};const a=n.unauthorizedChallengeTrigger;return a!=="any"&&e.facets.challengeHeader!=="bearer"?{action:"passthrough",reason:"missing-bearer-header"}:a==="resource-metadata"&&!e.facets.hasResourceMetadata?{action:"passthrough",reason:"missing-resource-metadata"}:{action:s,reason:"honored"}}const o=n.toolResultAuthChallenge;if(o==="passthrough")return{action:"passthrough",reason:"not-honored"};const i=n.toolResultAuthChallengeTrigger;if(i!=="any"){if(r?.source==="unresolved"||r===void 0)return{action:"notify",reason:"schemes-unresolved"};if(!Rc(r))return{action:"passthrough",reason:"missing-oauth2-scheme"};if(i==="oauth2-scheme+error-params"&&!e.facets.hasErrorParams)return{action:"passthrough",reason:"missing-error-params"}}return{action:o,reason:"honored"}}function Uc(e){const t={};for(const[r,n]of Object.entries(e))n!==void 0&&(t[r]=n);return t}function xl(e){if(!G(e))return;const t={},r=i=>jc.includes(i)?i:void 0,n=r(e.unauthorizedChallenge);n&&(t.unauthorizedChallenge=n),Cc.includes(e.unauthorizedChallengeTrigger)&&(t.unauthorizedChallengeTrigger=e.unauthorizedChallengeTrigger);const o=r(e.toolResultAuthChallenge);return o&&(t.toolResultAuthChallenge=o),Dc.includes(e.toolResultAuthChallengeTrigger)&&(t.toolResultAuthChallengeTrigger=e.toolResultAuthChallengeTrigger),Object.keys(t).length>0?t:void 0}function Ul(e,t,r="This host"){switch(t.reason){case"honored":return t.action==="prompt"?`${r} shows a sign-in prompt for this challenge and retries the call after sign-in.`:t.action==="notify"?`${r} tells the user to sign in, but does not retry the call.`:`${r} treats this challenge as an ordinary error.`;case"not-honored":return e.source==="tool_result_meta"?`${r} ignores _meta["mcp/www_authenticate"] on a tool result. To ask for sign-in, return HTTP 401 with a WWW-Authenticate: Bearer header instead.`:`${r} does not start sign-in from an HTTP 401 on a tool call.`;case"missing-bearer-header":return`${r} starts sign-in only when the 401 carries a WWW-Authenticate: Bearer header. Add one, with resource_metadata pointing at your Protected Resource Metadata.`;case"missing-resource-metadata":return`${r} needs resource_metadata="…" in the WWW-Authenticate challenge before it starts sign-in.`;case"missing-oauth2-scheme":return`${r} shows its sign-in UI for a _meta challenge only when the tool declares securitySchemes with an oauth2 entry.`;case"schemes-unresolved":return`This tool declares no securitySchemes, so it inherits the server default, which MCPJam cannot see. ${r} would show sign-in only if that default includes oauth2. Declare securitySchemes on the tool to make this explicit.`;case"missing-error-params":return`${r} needs both error and error_description in _meta["mcp/www_authenticate"] before it shows sign-in.`}}var et=["2025-03-26","2025-06-18","2025-11-25","2026-07-28"],Mc=et[et.length-1];function Ml(e){return e===Mc?`Latest (${e})`:e}var Lc=new Set(["2024-10-07","2024-11-05","2025-03-26","2025-06-18","2025-11-25"]);function Fc(e){return Lc.has(e)}function Ll(e){return et.includes(e)}function Fl(e){return e.length>0&&!Fc(e)}var Jc=["claude-code","codex","cursor","copilot-cli","opencode","claude-web","chatgpt-web"];function Jl(e){return typeof e=="string"&&Jc.includes(e)}var Vl=["sidebarApps","conversationPanels","fileViewers","fileResources","localFiles","settings","displayModes","deepLinks","modelContext","messages","mentions","forms","onboarding"],Bl=["verified","refuted","unverifiable"],Wl=["oauth2-dcr","oauth2-cimd","oauth2-preregistered","api-key","none"],Kl=["omit","fixed","challenge","all-supported"],Hl=["none","client_secret_basic","client_secret_post"],Vc="mcpjam-xaa-cli",tt="2025-11-25",Bc="io.modelcontextprotocol/enterprise-managed-authorization";function Gl(e){return{headers:{Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":tt,Authorization:`Bearer ${e}`},body:{jsonrpc:"2.0",id:Vc,method:"initialize",params:{protocolVersion:tt,capabilities:{extensions:{[Bc]:{}}},clientInfo:{name:"MCPJam XAA CLI",version:"1.0.0"}}}}}function Bn(e){if(!e||typeof e!="object")return e;const t=e;return t.transport==="sse"?t.mcpResponse:e}function Wc(e){if(!e||typeof e!="object")return;const t=e.error;if(!t||typeof t!="object")return;const{code:r,message:n}=t,o=[];return typeof r=="number"&&o.push(String(r)),typeof n=="string"&&n.length>0&&o.push(n),o.length>0?o.join(": "):"JSON-RPC error"}function ql(e){if(e&&typeof e=="object"){const i=e.error;if(typeof i=="string"&&i.length>0)return i}const t=Bn(e),r=Wc(t);if(r)return r;const n=t;if(!t||typeof t!="object"||n.jsonrpc!=="2.0"||n.id!=="mcpjam-xaa-cli"||n.result===null||typeof n.result!="object")return"MCP server did not return a JSON-RPC initialize result";const o=n.result.protocolVersion;if(o!=="2025-11-25")return`MCP server negotiated protocol version ${String(o)}; expected ${tt}`}function Yl(e){const t=Bn(e);if(!t||typeof t!="object")return"unknown";const r=t.result;if(!r||typeof r!="object")return"unknown";const n=r.capabilities;if(!n||typeof n!="object")return"unknown";const o=n.extensions;return!o||typeof o!="object"?"unknown":Object.prototype.hasOwnProperty.call(o,"io.modelcontextprotocol/enterprise-managed-authorization")?"advertised":"not_advertised"}export{Xu as $,Il as A,zl as B,Rc as C,hu as Ct,Zl as D,Gc as Dt,Cl as E,qc as Et,Nl as F,bl as G,kl as H,Tl as I,oc as J,yl as K,Sl as L,$l as M,bt as N,Ac as O,Hc as Ot,Pl as P,sl as Q,Sc as R,Ul as S,Qc as St,Rl as T,Yc as Tt,kc as U,Ol as V,wl as W,il as X,gl as Y,ol as Z,xc as _,$u as _t,Jc as a,rc as at,xl as b,qe as bt,Kl as c,cl as ct,Jl as d,al as dt,tl as et,et as f,ur as ft,jc as g,ul as gt,Ml as h,dl as ht,Yl as i,Xc as it,Al as j,El as k,Kc as kt,Hl as l,xn as lt,Fl as m,_l as mt,Gl as n,vl as nt,Wl as o,ml as ot,Ll as p,pl as pt,Dn as q,ql as r,ll as rt,Bl as s,hl as st,Bc as t,nl as tt,Vl as u,rl as ut,Dc as v,fl as vt,jl as w,mu as wt,Dl as x,el as xt,Cc as y,Qu as yt,$c as z};
|
|
57
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const a=s[1];if(t===s[0]){i(s);continue}if(e.external){const 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}a.count>1&&e.reused==="ref"&&i(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Gr(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const r=[];for(const n of t){if(!n||typeof n!="object")return;Gr(n);const o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;const i=n.type;for(const s of Array.isArray(i)?i:[i]){if(typeof s!="string")return;r.includes(s)||r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var qr=new Set(["type","properties","required","additionalProperties"]),Qt=["oneOf","anyOf"];function er(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Ke(e){const t=[];for(const i of e){if(typeof i!="object"||i.type!=="object")return null;for(const s in i)if(!qr.has(s))return null;t.push(i)}const r={},n=new Set;for(const i of t){for(const s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;const a=[];for(const c of t){const l=c.properties?.[s]??er(c);l!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(l))||a.push(l))}const u=a.length===1?a[0]:Ke(a)??{allOf:a};U(r,s,u)}for(const s of i.required??[])n.add(s)}const o={type:"object",properties:r};if(n.size&&(o.required=[...n]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{const i=[];for(const s of t){const a=er(s);a&&!i.some(u=>JSON.stringify(u)===JSON.stringify(a))&&i.push(a)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function Ha(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const o of qr)if(o in e)return;const r=t.filter(o=>Qt.some(i=>Array.isArray(o[i])));let n=null;if(!r.length)n=Ke(t);else{const o=r[0],i=Qt.find(u=>Array.isArray(o[u]));if(Object.keys(o).length!==1)return;const s=t.filter(u=>u!==o),a=o[i].map(u=>Ke([...s,u]));if(a.some(u=>!u))return;n={[i]:a}}n&&(delete e.allOf,ue(e,n))}function Oe(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=a=>{const u=e.seen.get(a);if(u.ref===null)return;const c=u.def??u.schema,l={...c},d=u.ref;if(u.ref=null,d){n(d);const p=e.seen.get(d),m=p.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):ue(c,m),ue(c,l),a._zod.parent===d)for(const g in c)g==="$ref"||g==="allOf"||g in l||delete c[g];if(m.$ref&&p.def)for(const g in c)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(c[g])===JSON.stringify(p.def[g])&&delete c[g]}const h=a._zod.parent;if(h&&h!==d){n(h);const p=e.seen.get(h);if(p?.schema.$ref&&(c.$ref=p.schema.$ref,p.def))for(const m in c)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(c[m])===JSON.stringify(p.def[m])&&delete c[m]}e.override({zodSchema:a,jsonSchema:c,path:u.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const a of[...e.seen.entries()].reverse())n(a[0]);if(e.target!=="openapi-3.0")for(const a of e.seen.entries())Gr(a[1].def??a[1].schema);for(const a of e.deferred)a();if(e.intersections.length){const a=new Map;for(const u of e.seen.values())for(const c of[u.schema,u.def]){const l=c?.allOf;if(!Array.isArray(l))continue;const d=a.get(l);d?d.push(c):a.set(l,[c])}for(const u of e.intersections)for(const c of a.get(u)??[])Ha(c)}}const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}ue(o,r.defId?r.schema:r.def??r.schema);const i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;const s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const a of e.seen.entries()){const u=a[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,U(s,u.defId,u.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Se(t,"input",e.processors),output:Se(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Z(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Z(n.element,r);if(n.type==="set")return Z(n.valueType,r);if(n.type==="lazy")return Z(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return Z(n.innerType,r);if(n.type==="intersection")return Z(n.left,r)||Z(n.right,r);if(n.type==="record"||n.type==="map")return Z(n.keyType,r)||Z(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Z(n.in,r)||Z(n.out,r);if(n.type==="object"){for(const o in n.shape)if(Z(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(const o of n.options)if(Z(o,r))return!0;return!1}if(n.type==="tuple"){for(const o of n.items)if(Z(o,r))return!0;return!!(n.rest&&Z(n.rest,r))}return!1}var Ga=(e,t={})=>r=>{const n=ze({...r,processors:t});return k(e,n),ke(n,e),Oe(n,e)},Se=(e,t,r={})=>n=>{const{libraryOptions:o,target:i}=n??{},s=ze({...o??{},target:i,io:t,processors:r});return k(e,s),ke(s,e),Oe(s,e)},X=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},Q=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},tr=(e,t)=>{X(e,"minimum",t),Q(e,"maximum",t)},Yr=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},Xr=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Qr=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},en=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},rr=(e,t)=>X(e,"minimum",t.minimum),nr=(e,t)=>Q(e,"maximum",t.maximum),or=e=>(t,r)=>{en(t,r.format);const[n,o]=e[r.format];X(t,"minimum",n),Q(t,"maximum",o)},qa={greater_than:(e,t)=>X(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Q(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Yr(e,t.value),number_format:or(_r),bigint_format:or(oo),min_length:rr,max_length:nr,length_equals:(e,t)=>tr(e,t.length),min_size:rr,max_size:nr,size_equals:(e,t)=>tr(e,t.size),string_format:(e,t)=>{en(e,t.format),t.pattern&&Xr(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Qr(e,t.mime)};function N(e){const t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(const i of n)qa[i._zod.def.check]?.(t,i._zod.def);const o=e._zod.bag;o.minimum!==void 0&&X(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&X(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&Q(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&Q(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&Yr(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&Qr(t,o.mime);for(const i of o.patterns??[])Xr(t,i);return t}var Ya={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Xa=new Map([[Tr,si],[pt,ai]]),tn=e=>Xa.get(e)??e,rn=(e,t,r,n)=>{const o=r;o.type="string";const{minimum:i,maximum:s,format:a,patterns:u,contentEncoding:c,laxFormat:l}=N(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=Ya[a]??a,o.format===""&&delete o.format,(a==="time"||l)&&delete o.format),c&&(o.contentEncoding=c),u&&u.size>0){const d=[...u].map(tn);d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},nn=(e,t,r,n)=>{const o=r,{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c,isInt:l}=N(e);o.type=l?"integer":"number";const d=typeof c=="number"&&c>=(i??Number.NEGATIVE_INFINITY),h=typeof u=="number"&&u<=(s??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";if(d?p?(o.minimum=c,o.exclusiveMinimum=!0):o.exclusiveMinimum=c:typeof i=="number"&&(o.minimum=i),h?p?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u:typeof s=="number"&&(o.maximum=s),a){const m=new Set;for(const b of a)Number.isFinite(b)&&b!==0?m.add(Math.abs(b)):E(e,t,o,n,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);const[g,..._]=m;g!==void 0&&(o.multipleOf=g),_.length&&(o.allOf=[...o.allOf??[],..._.map(b=>({multipleOf:b}))])}},on=(e,t,r,n)=>{r.type="boolean"},Qa=(e,t,r,n)=>{E(e,t,r,n,"BigInt cannot be represented in JSON Schema")},eu=(e,t,r,n)=>{E(e,t,r,n,"Symbols cannot be represented in JSON Schema")},sn=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},an=(e,t,r,n)=>{E(e,t,r,n,"Undefined cannot be represented in JSON Schema")},tu=(e,t,r,n)=>{E(e,t,r,n,"Void cannot be represented in JSON Schema")},un=(e,t,r,n)=>{r.not={}},cn=(e,t,r,n)=>{},ln=(e,t,r,n)=>{},ru=(e,t,r,n)=>{E(e,t,r,n,"Date cannot be represented in JSON Schema")},fn=(e,t,r,n)=>{const o=e._zod.def,i=Le(o.entries);if(i.length===0){r.not={};return}i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},dn=(e,t,r,n)=>{const o=e._zod.def;if(o.values.length===0){r.not={};return}const i=[];for(const s of o.values)if(s===void 0){if(E(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(E(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i},nu=(e,t,r,n)=>{E(e,t,r,n,"NaN cannot be represented in JSON Schema")},ou=(e,t,r,n)=>{const o=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source},iu=(e,t,r,n)=>{const o=r;o.type="string",o.format="binary",o.contentEncoding="binary";const{minimum:i,maximum:s,mime:a}=N(e);i!==void 0&&(o.minLength=i),s!==void 0&&(o.maxLength=s),a&&(a.length===0?o.not={}:a.length===1?o.contentMediaType=a[0]:o.anyOf=a.map(u=>({contentMediaType:u})))},su=(e,t,r,n)=>{r.type="boolean"},pn=(e,t,r,n)=>{E(e,t,r,n,"Custom types cannot be represented in JSON Schema")},au=(e,t,r,n)=>{E(e,t,r,n,"Function types cannot be represented in JSON Schema")},hn=(e,t,r,n)=>{E(e,t,r,n,"Transforms cannot be represented in JSON Schema")},uu=(e,t,r,n)=>{E(e,t,r,n,"Map cannot be represented in JSON Schema")},cu=(e,t,r,n)=>{E(e,t,r,n,"Set cannot be represented in JSON Schema")},mn=(e,t,r,n)=>{const o=r,i=e._zod.def,{minimum:s,maximum:a}=N(e);typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=k(i.element,t,{...n,path:[...n.path,"items"]})};function fe(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?fe(t.out):t.type==="catch"?fe(t.innerType):e._zod.optin}var vn=(e,t,r,n)=>{const o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&E(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(const u in s)U(o.properties,u,k(s[u],t,{...n,path:[...n.path,"properties",u]}));const a=[];for(const u of Object.keys(s)){const c=i.shape[u];(t.io==="input"?fe(c)===void 0:c._zod.optout===void 0)&&a.push(u)}a.length>0&&(o.required=a),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=k(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},gn=(e,t,r,n)=>{const o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,u)=>k(a,t,{...n,path:[...n.path,i?"oneOf":"anyOf",u]}));i?r.oneOf=s:r.anyOf=s},_n=(e,t,r,n)=>{const o=e._zod.def,i=k(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=k(o.right,t,{...n,path:[...n.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,u=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=u,t.intersections.push(u)},yn=(e,t,r,n)=>{const o=r,i=e._zod.def;o.type="array";const s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=i.items.map((g,_)=>k(g,t,{...n,path:[...n.path,s,_]})),c=i.rest?k(i.rest,t,{...n,path:[...n.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;let l=i.items.length;for(;l>0;){const g=i.items[l-1];if(!(t.io==="input"?fe(g)!==void 0:g._zod.optout==="optional"))break;l--}const d=i.items.length,h=!i.rest;t.target==="draft-2020-12"?(o.prefixItems=u,h?o.items=!1:c&&(o.items=c),l>0&&(o.minItems=l),h&&(o.maxItems=d)):t.target==="openapi-3.0"?(o.items={anyOf:u},c&&o.items.anyOf.push(c),l>0&&(o.minItems=l),h&&(o.maxItems=d)):(o.items=u,h?o.additionalItems=!1:c&&(o.additionalItems=c),l>0&&(o.minItems=l),h&&(o.maxItems=d));const{minimum:p,maximum:m}=N(e);typeof p=="number"&&(o.minItems=p),typeof m=="number"&&(o.maxItems=m)};function He(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);const m=e.get(t)?.def;if(!m)return t;const g=He(e,m,r);return g===m?t:g}for(const m of["anyOf","oneOf"]){const g=t[m];if(!Array.isArray(g))continue;const _=g.map(b=>He(e,b,r));_.some((b,I)=>b!==g[I])&&(t={...t,[m]:_})}const n=Array.isArray(t.type)?t.type:[t.type],o=!n.includes("string")&&n.some(m=>m==="number"||m==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(m=>typeof m=="number"))return t;const{minimum:s,maximum:a,exclusiveMinimum:u,exclusiveMaximum:c,multipleOf:l,format:d,id:h,...p}=t;return p.enum?p.enum=p.enum.map(m=>typeof m=="number"?String(m):m):typeof p.const=="number"&&(p.const=String(p.const)),o&&(p.type="string",i||(p.pattern=(n.includes("number")?lt:mi).source)),p}var Ge=new WeakMap;function lu(e){const t=new Map;for(const n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);const r=new Map;for(const n of Ge.get(e)??[]){const o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===!0||r.has(i))continue;const s=He(t,i,new Set);s!==i&&r.set(i,s)}if(r.size)for(const n of e.seen.values())for(const o of[n.schema,n.def]){const i=o&&r.get(o.propertyNames);i&&(o.propertyNames=i)}}var bn=(e,t,r,n)=>{const o=r,i=e._zod.def;o.type="object";const s=i.keyType,a=N(s).patterns;if(i.mode==="loose"&&a&&a.size>0){const l=k(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(const d of a)U(o.patternProperties,tn(d).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=k(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let l=Ge.get(t);l||(l=[],Ge.set(t,l),t.deferred.push(()=>lu(t))),l.push(e)}o.additionalProperties=k(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}const u=s._zod.values,c=t.io==="input"&&fe(i.valueType)!==void 0;if(u&&!i.partial&&!c){const l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(o.required=l.map(String))}},wn=(e,t,r,n)=>{const o=e._zod.def,i=k(o.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},zn=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},mt=Symbol();function kn(e,t,r,n,o){let i=!1;const s=JSON.stringify(e,(a,u)=>typeof u!="bigint"?u:(i=!0,null));return i?(E(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),mt):JSON.parse(s)}var On=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType;const s=kn(o.defaultValue,e,t,r,n);s!==mt&&(r.default=s)},Sn=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;const s=kn(o.defaultValue,e,t,r,n);s!==mt&&(r._prefault=s)},$n=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{E(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},Pn=(e,t,r,n)=>{const o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;k(s,t,n);const a=t.seen.get(e);a.ref=s},En=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0},fu=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},vt=(e,t,r,n)=>{const o=e._zod.def;k(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},Zn=(e,t,r,n)=>{const o=e._zod.innerType;k(o,t,n);const i=t.seen.get(e);i.ref=o},ir={string:rn,number:nn,boolean:on,bigint:Qa,symbol:eu,null:sn,undefined:an,void:tu,never:un,any:cn,unknown:ln,date:ru,enum:fn,literal:dn,nan:nu,template_literal:ou,file:iu,success:su,custom:pn,function:au,transform:hn,map:uu,set:cu,array:mn,object:vn,union:gn,intersection:_n,tuple:yn,record:bn,nullable:wn,nonoptional:zn,default:On,prefault:Sn,catch:$n,pipe:Pn,readonly:En,promise:fu,optional:vt,lazy:Zn};function qc(e,t){if("_idmap"in e){const n=e,o=ze({...t,processors:ir}),i={};for(const a of n._idmap.entries()){const[u,c]=a;k(c,o)}const s={};o.external={registry:n,uri:t?.uri,defs:i};for(const a of n._idmap.entries()){const[u,c]=a;ke(o,c),U(s,u,Oe(o,c))}return Object.keys(i).length>0&&(s.__shared={[o.target==="draft-2020-12"?"$defs":"definitions"]:i}),{schemas:s}}const r=ze({...t,processors:ir});return k(e,r),ke(r,e),Oe(r,e)}var sr=new WeakSet([Object.prototype,Error.prototype]);function ve(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var An=(e,t)=>{$o.init(e,t),e.name="ZodError";const r=Object.getPrototypeOf(e);sr.has(r)||(sr.add(r),ve(r,"format",n=>o=>Ao(n,o)),ve(r,"flatten",n=>o=>Zo(n,o)),ve(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,Fe,2)}),ve(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,Fe,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Yc=f("ZodError",An),j=f("ZodError",An,void 0,{Parent:Error}),du=at(j),pu=ut(j),hu=Ae(j),mu=ct(j),vu=Co(j),gu=Do(j),_u=xo(j),yu=Uo(j),bu=Mo(j),wu=Lo(j),zu=Fo(j),ku=Jo(j);function Ou(){R.localeError||x(Qs())}function de(){R.memoizer||x({memoizer:qs()})}var z=f("ZodType",(e,t)=>(Ou(),w.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(T(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return W(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(bc(e,t))},superRefine(e,t){return this.check(wc(e,t))},overwrite(e){return this.check(ee(e))},optional(){return ur(this)},exactOptional(){return ac(this)},nullable(){return cr(this)},nullish(){return ur(cr(this))},nonoptional(e){return pc(this,e)},array(){return Xu(this)},or(e){return Qu([this,e])},and(e){return rc(this,e)},transform(e){return lr(this,Mn(e))},default(e){return lc(this,e)},prefault(e){return dc(this,e)},catch(e){return mc(this,e)},pipe(e){return lr(this,e)},readonly(){return _c(this)},describe(e){const t=this.clone();return ie.add(t,{description:e}),t},meta(...e){if(e.length===0)return ie.get(this);const t=this.clone();return ie.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return st(this,"~standard",{...Er(this),jsonSchema:{input:Se(this,"input"),output:Se(this,"output")}})},set"~standard"(e){B(this,"~standard",e)},parse:function e(t,r){return du(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await pu(this,t,r,{callee:e})},safeParse(e,t){return hu(this,e,t)},async safeParseAsync(e,t){return mu(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){B(this,"spa",e)},validate(e,t){return No(this,e,t)},validateAsync(e,t){return jo(this,e,t)},encode:function e(t,r){return vu(this,t,r,{callee:e})},decode:function e(t,r){return gu(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await _u(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await yu(this,t,r,{callee:e})},safeEncode(e,t){return bu(this,e,t)},safeDecode(e,t){return wu(this,e,t)},async safeEncodeAsync(e,t){return zu(this,e,t)},async safeDecodeAsync(e,t){return ku(this,e,t)},toJSONSchema(e){return Ga(this,{})(e)},get description(){return ie.get(this)?.description},get _def(){return this._zod.def}}),In=f("_ZodString",(e,t)=>{dt.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rn(e,r,n,o)},br({format:e=>N(e).format??null,minLength:e=>N(e).minimum??null,maxLength:e=>N(e).maximum??null},{regex(...e){return this.check(Ia(...e))},includes(...e){return this.check(Ra(...e))},startsWith(...e){return this.check(ja(...e))},endsWith(...e){return this.check(Ca(...e))},min(...e){return this.check(we(...e))},max(...e){return this.check(Kr(...e))},length(...e){return this.check(Hr(...e))},nonempty(...e){return this.check(we(1,...e))},lowercase(e){return this.check(Ta(e))},uppercase(e){return this.check(Na(e))},trim(){return this.check(Ua())},normalize(...e){return this.check(xa(...e))},toLowerCase(){return this.check(Ma())},toUpperCase(){return this.check(La())},slugify(){return this.check(Fa())}})),Su=f("ZodString",(e,t)=>{dt.init(e,t),In.init(e,t)},{email(e){return this.check(Lr(Rn,e))},url(e){return this.check(Jr(jn,e))},jwt(e){return this.check(ba(Ju,e))},emoji(e){return this.check(aa(Au,e))},guid(e){return this.check(na(Zu,e))},uuid(e){return this.check(Fr(se,e))},uuidv4(e){return this.check(oa(se,e))},uuidv6(e){return this.check(ia(se,e))},uuidv7(e){return this.check(sa(se,e))},nanoid(e){return this.check(ua(Iu,e))},cuid(e){return this.check(ca(Tu,e))},cuid2(e){return this.check(la(Nu,e))},ulid(e){return this.check(fa(Ru,e))},base64(e){return this.check(Vr(Cn,e))},base64url(e){return this.check(_a(Lu,e))},xid(e){return this.check(da(ju,e))},ksuid(e){return this.check(pa(Cu,e))},ipv4(e){return this.check(ha(Du,e))},ipv6(e){return this.check(ma(xu,e))},cidrv4(e){return this.check(va(Uu,e))},cidrv6(e){return this.check(ga(Mu,e))},e164(e){return this.check(ya(Fu,e))},datetime(e){return this.check(Br(Tn,e))},date(e){return this.check(Wr(Nn,e))},time(e){return this.check(wa(Pu,e))},duration(e){return this.check(za(Eu,e))}});function $u(e){return ra(Su,e)}var $=f("ZodStringFormat",(e,t)=>{S.init(e,t),In.init(e,t)}),Tn=f("ZodISODateTime",(e,t)=>{Qi.init(e,t),$.init(e,t)}),Nn=f("ZodISODate",(e,t)=>{es.init(e,t),$.init(e,t)}),Pu=f("ZodISOTime",(e,t)=>{ts.init(e,t),$.init(e,t)}),Eu=f("ZodISODuration",(e,t)=>{rs.init(e,t),$.init(e,t)}),Rn=f("ZodEmail",(e,t)=>{Ui.init(e,t),$.init(e,t)});function Xc(e){return Lr(Rn,e)}var Zu=f("ZodGUID",(e,t)=>{Di.init(e,t),$.init(e,t)}),se=f("ZodUUID",(e,t)=>{xi.init(e,t),$.init(e,t)});function Qc(e){return Fr(se,e)}var jn=f("ZodURL",(e,t)=>{Bi.init(e,t),$.init(e,t)});function el(e){return Jr(jn,e)}var Au=f("ZodEmoji",(e,t)=>{Wi.init(e,t),$.init(e,t)}),Iu=f("ZodNanoID",(e,t)=>{Ki.init(e,t),$.init(e,t)}),Tu=f("ZodCUID",(e,t)=>{Hi.init(e,t),$.init(e,t)}),Nu=f("ZodCUID2",(e,t)=>{Gi.init(e,t),$.init(e,t)}),Ru=f("ZodULID",(e,t)=>{qi.init(e,t),$.init(e,t)}),ju=f("ZodXID",(e,t)=>{Yi.init(e,t),$.init(e,t)}),Cu=f("ZodKSUID",(e,t)=>{Xi.init(e,t),$.init(e,t)}),Du=f("ZodIPv4",(e,t)=>{ns.init(e,t),$.init(e,t)}),xu=f("ZodIPv6",(e,t)=>{is.init(e,t),$.init(e,t)}),Uu=f("ZodCIDRv4",(e,t)=>{ss.init(e,t),$.init(e,t)}),Mu=f("ZodCIDRv6",(e,t)=>{us.init(e,t),$.init(e,t)}),Cn=f("ZodBase64",(e,t)=>{cs.init(e,t),$.init(e,t)});function tl(e){return Vr(Cn,e)}var Lu=f("ZodBase64URL",(e,t)=>{fs.init(e,t),$.init(e,t)}),Fu=f("ZodE164",(e,t)=>{ds.init(e,t),$.init(e,t)}),Ju=f("ZodJWT",(e,t)=>{hs.init(e,t),$.init(e,t)}),Dn=f("ZodNumber",(e,t)=>{Nr.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>nn(e,r,n,o),e.isFinite=!0},br({minValue:e=>{const{minimum:t,exclusiveMinimum:r}=N(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:r}=N(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:r}=N(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>N(e).format??null},{gt(e,t){return this.check(qt(e,t))},gte(e,t){return this.check(Ue(e,t))},min(e,t){return this.check(Ue(e,t))},lt(e,t){return this.check(Gt(e,t))},lte(e,t){return this.check(xe(e,t))},max(e,t){return this.check(xe(e,t))},int(e){return this.check(ar(e))},safe(e){return this.check(ar(e))},positive(e){return this.check(qt(0,e))},nonnegative(e){return this.check(Ue(0,e))},negative(e){return this.check(Gt(0,e))},nonpositive(e){return this.check(xe(0,e))},multipleOf(e,t){return this.check(Yt(e,t))},step(e,t){return this.check(Yt(e,t))},finite(){return this}}));function rl(e){return ka(Dn,e)}var Vu=f("ZodNumberFormat",(e,t)=>{ms.init(e,t),Dn.init(e,t)});function ar(e){return Oa(Vu,e)}var Bu=f("ZodBoolean",(e,t)=>{vs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>on(e,r,n,o)});function nl(e){return Sa(Bu,e)}var Wu=f("ZodUndefined",(e,t)=>{gs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>an(e,r,n,o)});function ol(e){return $a(Wu,e)}var Ku=f("ZodNull",(e,t)=>{_s.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>sn(e,r,n,o)});function il(e){return Pa(Ku,e)}var Hu=f("ZodAny",(e,t)=>{ys.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>cn(e,r,n,o)});function sl(){return Ea(Hu)}var Gu=f("ZodUnknown",(e,t)=>{bs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ln(e,r,n,o)});function qe(){return Za(Gu)}var qu=f("ZodNever",(e,t)=>{ws.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>un(e,r,n,o)});function xn(e){return Aa(qu,e)}var Yu=f("ZodArray",(e,t)=>{de(),Os.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mn(e,r,n,o),e.element=t.element},{min(e,t){return this.check(we(e,t))},nonempty(e){return this.check(we(1,e))},max(e,t){return this.check(Kr(e,t))},length(e,t){return this.check(Hr(e,t))},unwrap(){return this.element}});function Xu(e,t){return Ja(Yu,e,t)}var gt=f("ZodObject",(e,t)=>{de(),Ps.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vn(e,r,n,o),yo(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return oc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(T(this._zod.def,{catchall:e}))},passthrough(){return this.clone(T(this._zod.def,{catchall:qe()}))},loose(){return this.clone(T(this._zod.def,{catchall:qe()}))},strict(){return this.clone(T(this._zod.def,{catchall:xn()}))},strip(){return this.clone(T(this._zod.def,{catchall:void 0}))},extend(e){return ao(this,e)},safeExtend(e){return uo(this,e)},merge(e){return co(this,e)},pick(e){return io(this,e)},omit(e){return so(this,e)},partial(...e){return Pt(_t,this,e[0])},exactPartial(...e){return Pt(Ln,this,e[0],"exactPartial")},required(...e){return lo(Fn,this,e[0])}});function al(e,t){const r={type:"object",shape:e??{},...v(t)};return new gt(r)}function ul(e,t){return new gt({type:"object",shape:e,catchall:xn(),...v(t)})}function cl(e,t){return new gt({type:"object",shape:e,catchall:qe(),...v(t)})}var Un=f("ZodUnion",(e,t)=>{Cr.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>gn(e,r,n,o),e.options=t.options});function Qu(e,t){return new Un({type:"union",options:e,...v(t)})}var ec=f("ZodDiscriminatedUnion",(e,t)=>{Un.init(e,t),Zs.init(e,t)});function ll(e,t,r){return new ec({type:"union",options:t,discriminator:e,...v(r)})}var tc=f("ZodIntersection",(e,t)=>{As.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_n(e,r,n,o)});function rc(e,t){return new tc({type:"intersection",left:e,right:t})}var nc=f("ZodTuple",(e,t)=>{de(),Is.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yn(e,r,n,o)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){const e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new _t({type:"optional",innerType:t}))})}});function fl(e,t,r){const n=t instanceof w,o=n?r:t;return new nc({type:"tuple",items:e,rest:n?t:null,...v(o)})}var Ye=f("ZodRecord",(e,t)=>{de(),Ts.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>bn(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function dl(e,t,r){return!t||!t._zod?new Ye({type:"record",keyType:$u(),valueType:e,...v(t)}):new Ye({type:"record",keyType:e,valueType:t,...v(r)})}function pl(e,t,r){return new Ye({type:"record",keyType:e,valueType:t,...v(r),partial:!0})}var Xe=f("ZodEnum",(e,t)=>{Ns.init(e,t),z.init(e,t),e._zod.processJSONSchema=(n,o,i)=>fn(e,n,o,i),e.enum=t.entries,e.options=[...e._zod.values];const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const i={};for(const s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Xe({...t,checks:[],...v(o),entries:i})},e.exclude=(n,o)=>{const i={...t.entries};for(const s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Xe({...t,checks:[],...v(o),entries:i})}});function oc(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Xe({type:"enum",entries:r,...v(t)})}var ic=f("ZodLiteral",(e,t)=>{Rs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>dn(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function hl(e,t){return new ic({type:"literal",values:Array.isArray(e)?e:[e],...v(t)})}var sc=f("ZodTransform",(e,t)=>{de(),js.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>hn(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new wr(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(le(i,r.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=e),r.issues.push(le(s))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function Mn(e){return new sc({type:"transform",transform:e})}var _t=f("ZodOptional",(e,t)=>{Dr.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vt(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ur(e){return new _t({type:"optional",innerType:e})}var Ln=f("ZodExactOptional",(e,t)=>{Cs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vt(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ac(e){return new Ln({type:"optional",innerType:e})}var uc=f("ZodNullable",(e,t)=>{Ds.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wn(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function cr(e){return new uc({type:"nullable",innerType:e})}var cc=f("ZodDefault",(e,t)=>{xs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>On(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function lc(e,t){return new cc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():vr(t)}})}var fc=f("ZodPrefault",(e,t)=>{Us.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Sn(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function dc(e,t){return new fc({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():vr(t)}})}var Fn=f("ZodNonOptional",(e,t)=>{Ms.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zn(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function pc(e,t){return new Fn({type:"nonoptional",innerType:e,...v(t)})}var hc=f("ZodCatch",(e,t)=>{Ls.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$n(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function mc(e,t){return new hc({type:"catch",innerType:e,catchValue:typeof t=="function"?t:wo(t)})}var Jn=f("ZodPipe",(e,t)=>{xr.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Pn(e,r,n,o),e.in=t.in,e.out=t.out});function lr(e,t){return new Jn({type:"pipe",in:e,out:t})}var vc=f("ZodPreprocess",(e,t)=>{Jn.init(e,t),Fs.init(e,t)}),gc=f("ZodReadonly",(e,t)=>{Js.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>En(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function _c(e){return new gc({type:"readonly",innerType:e})}var yc=f("ZodLazy",(e,t)=>{Vs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zn(e,r,n,o),e.unwrap=()=>e._zod.def.getter()});function ml(e){return new yc({type:"lazy",getter:e})}var yt=f("ZodCustom",(e,t)=>{Bs.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pn(e,r,n,o)});function vl(e,t){return Va(yt,e??(()=>!0),t)}function bc(e,t={}){return Ba(yt,e,t)}function wc(e,t){return Wa(e,t)}var zc=f("ZodInstanceOf",(e,t)=>{yt.init(e,t)},{properties(e,t){return this.check(Da(e,t))}});function gl(e,t={}){const r=new zc({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...v(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}function _l(e,t){return new vc({type:"pipe",in:Mn(e),out:t})}function yl(e){return Br(Tn,e)}function bl(e){return Wr(Nn,e)}var kc="io.modelcontextprotocol/skills";function fr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Oc(e){const t=e?.extensions;if(!fr(t)||!Object.prototype.hasOwnProperty.call(t,"io.modelcontextprotocol/skills"))return;const r=t[kc];return fr(r)?r:void 0}function wl(e){return Oc(e)!==void 0}var Sc="io.modelcontextprotocol/ui",$c="text/html;profile=mcp-app";function $e(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Pc(e,t){if(!e&&!t)return;if(!e)return{...t};if(!t)return{...e};const r={...e};for(const n of Object.keys(t)){const o=r[n],i=t[n];$e(o)&&$e(i)?r[n]={...o,...i}:r[n]=i}return r}function zl(){return{extensions:{[Sc]:{mimeTypes:[$c]}}}}function kl(e){return{...e??{}}}function Ol(e,t){const r=e,n=t,o={...e??{},...t??{}};if(n&&Object.prototype.hasOwnProperty.call(n,"extensions")){const i=n.extensions;i===void 0?o.extensions=r?.extensions:$e(i)?Object.keys(i).length===0?o.extensions={}:$e(r?.extensions)?o.extensions=Pc(r.extensions,i):o.extensions={...i}:o.extensions=i}return o}function Sl(){return"12.1.2"}var Qe="[A-Za-z0-9!#$%&'*+.^_`|~-]+";function Ec(e){const t={},r=new RegExp(`(${Qe})\\s*=\\s*(?:"((?:\\\\.|[^"\\\\])*)"|([^,\\s]+))`,"g");for(let n=r.exec(e);n;n=r.exec(e)){const o=n[2];t[n[1].toLowerCase()]=o!==void 0?o.replace(/\\([\s\S])/g,"$1"):n[3]??""}return t}function $l(e){return bt(e)[0]??{}}function Pl(e){if(!e)return;const t=e.split(/\s+/).map(r=>r.trim()).filter(Boolean);return t.length>0?Array.from(new Set(t)):void 0}function El(e,t){const r=[],n=new Set;for(const o of[...e??[],...t??[]]){const i=o?.trim();!i||n.has(i)||(n.add(i),r.push(i))}return r}function bt(e){if(!e)return[];const t=[];let r="",n=!1;for(let a=0;a<e.length;a++){const u=e[a];n&&u==="\\"&&a+1<e.length?(r+=u+e[a+1],a++):u==='"'?(n=!n,r+=u):u===","&&!n?(t.push(r),r=""):r+=u}t.push(r);const o=[],i=new RegExp(`^(${Qe})\\s+(?!\\s*=)(.+)$`,"s"),s=new RegExp(`^(${Qe})$`);for(const a of t){const u=a.trim();if(!u)continue;const c=i.exec(u),l=c?null:s.exec(u);c?o.push({scheme:c[1].toLowerCase(),params:[c[2]]}):l?o.push({scheme:l[1].toLowerCase(),params:[]}):o.length>0&&o[o.length-1].params.push(u)}return o.filter(a=>a.scheme==="bearer").map(a=>Ec(a.params.join(", ")))}function Zc(e){return bt(e).length>0}var Zl=class extends Error{status;constructor(e,t){super(e),this.name="UnexpectedProbeStatusError",this.status=t}},Vn="MCP server returned HTTP ";function Al(e){return e.startsWith(Vn)}function Ac(e){if(e.status===401)return{kind:"challenged",specCompliant:!0};if(e.status===200)return{kind:"anonymous_allowed"};if(e.status===403&&Zc(e.wwwAuthenticateHeader))return{kind:"challenged",specCompliant:!1};const t=e.serverMessage||e.statusText,r=`${Vn}${e.status}${t?` ${t}`:""}`;return e.status===403?e.wwwAuthenticateHeader?.trim()?{kind:"unexpected",message:`${r}, and its WWW-Authenticate header offers no Bearer challenge. MCP OAuth has nothing to discover from without one, so the flow cannot continue against this server.`}:{kind:"unexpected",message:`${r} with no WWW-Authenticate challenge. MCP requires 401 with a WWW-Authenticate header to begin OAuth, so there is nothing to discover from. A bare 403 usually means a proxy, WAF, or IP allowlist rejected the request before the MCP server saw it.`}:{kind:"unexpected",message:`${r} where MCP requires 401 Unauthorized (or 200, if the server allows anonymous access).`}}function Il(e){return e.step!=="request_without_token"||e.status===void 0?!1:Ac({status:e.status,statusText:e.statusText,wwwAuthenticateHeader:e.wwwAuthenticateHeader}).kind==="challenged"}function Tl(e){const t=Number.isInteger(e.maxRetries)&&e.maxRetries>=0?e.maxRetries:1;switch(e.authMode){case"m2m":return"throw";case"debugger":return"manual";case"interactive":return e.attempt<t?"reauthorize":"throw"}}function Nl(e){const t=e.customScopes?.trim();if(t)return t;const r=e.challengedScopes?.filter(Boolean)??[];if(r.length>0)return Array.from(new Set(r)).join(" ");const n=e.supportedScopes?.filter(Boolean)??[];if(n.length!==0)return Array.from(new Set(n)).join(" ")}var wt=Object.freeze({fieldChars:512,rawChars:2048}),Ic="mcp/www_authenticate";function zt(e,t){return e.length>t?e.slice(0,t):e}function J(e){if(typeof e!="string")return;const t=e.trim();return t?zt(t,wt.fieldChars):void 0}var dr=Object.freeze({challengeHeader:"none",hasResourceMetadata:!1,hasScope:!1,hasErrorParams:!1});function Tc(e,t){return(t?e.find(r=>r.error==="insufficient_scope"):void 0)??e.find(r=>r.error)??e.find(r=>r.resource_metadata||r.scope)??e[0]}function Nc(e,t){const r=typeof e=="string"?e.trim():"";if(!r)return{source:t,facets:{...dr}};let n=[];try{n=bt(r)}catch{n=[]}const o=zt(r,wt.rawChars);if(n.length===0)return{source:t,raw:o,facets:{...dr,challengeHeader:"other-scheme"}};const i=Tc(n,t==="http_403_insufficient_scope"||t==="tool_result_meta")??{},s=J(i.error),a=J(i.error_description),u=J(i.scope),c=J(i.resource_metadata);return{source:t,...s?{error:s}:{},...a?{errorDescription:a}:{},...u?{requiredScope:u}:{},...c?{resourceMetadataUrl:c}:{},raw:o,facets:{challengeHeader:"bearer",hasResourceMetadata:c!==void 0,hasScope:u!==void 0,hasErrorParams:s!==void 0&&a!==void 0}}}function G(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Rl(e){if(!G(e)||e.isError!==!0)return;const t=e._meta;if(!G(t))return;const r=t[Ic],n=(Array.isArray(r)?r:[r]).filter(o=>typeof o=="string"&&o.trim()!=="");if(n.length!==0)return Nc(n.map(o=>{const i=o.trim();return i.startsWith("'")&&i.endsWith("'")?i.slice(1,-1):i}).join(", "),"tool_result_meta")}function jl(e){if(!G(e))return;const t=e.source;if(t!=="http_401"&&t!=="http_403_insufficient_scope"&&t!=="tool_result_meta")return;const r=G(e.facets)?e.facets:{},n=r.challengeHeader==="bearer"||r.challengeHeader==="other-scheme"?r.challengeHeader:"none",o=e.effectiveAuth,i=J(e.error),s=J(e.errorDescription),a=J(e.requiredScope),u=J(e.resourceMetadataUrl),c=typeof e.raw=="string"&&e.raw?zt(e.raw,wt.rawChars):void 0;return{source:t,...i?{error:i}:{},...s?{errorDescription:s}:{},...a?{requiredScope:a}:{},...u?{resourceMetadataUrl:u}:{},...c?{raw:c}:{},...o==="discover"||o==="oauth"||o==="xaa"||o==="bearer"||o==="none"?{effectiveAuth:o}:{},facets:{challengeHeader:n,hasResourceMetadata:r.hasResourceMetadata===!0,hasScope:r.hasScope===!0,hasErrorParams:r.hasErrorParams===!0}}}function Me(e){if(!Array.isArray(e))return;const t=[];for(const r of e){if(!G(r)||typeof r.type!="string")continue;const n=Array.isArray(r.scopes)?r.scopes.filter(o=>typeof o=="string"):void 0;t.push({type:r.type,...n?{scopes:n}:{}})}return t}function Cl(e){const t=e.declaration??void 0,r=Me(t?.securitySchemes);if(r)return{schemes:r,source:"tool"};const n=Me((G(t?._meta)?t._meta:void 0)?.securitySchemes);if(n)return{schemes:n,source:"tool-meta"};const o=Me(e.serverDefault);return o?{schemes:o,source:"server-default"}:e.serverDefault===null?{schemes:[],source:"none"}:{schemes:[],source:"unresolved"}}function Rc(e){return e?.schemes.some(t=>t.type==="oauth2")===!0}var jc=["prompt","notify","passthrough"],Cc=["any","bearer-header","resource-metadata"],Dc=["any","oauth2-scheme","oauth2-scheme+error-params"],xc=Object.freeze({unauthorizedChallenge:"prompt",unauthorizedChallengeTrigger:"any",toolResultAuthChallenge:"passthrough",toolResultAuthChallengeTrigger:"oauth2-scheme+error-params"});function Dl(e,t,r){const n={...xc,...Uc(t??{})};if(e.source==="http_403_insufficient_scope")return{action:"prompt",reason:"honored"};if(e.source==="http_401"){const s=n.unauthorizedChallenge;if(s==="passthrough")return{action:"passthrough",reason:"not-honored"};const a=n.unauthorizedChallengeTrigger;return a!=="any"&&e.facets.challengeHeader!=="bearer"?{action:"passthrough",reason:"missing-bearer-header"}:a==="resource-metadata"&&!e.facets.hasResourceMetadata?{action:"passthrough",reason:"missing-resource-metadata"}:{action:s,reason:"honored"}}const o=n.toolResultAuthChallenge;if(o==="passthrough")return{action:"passthrough",reason:"not-honored"};const i=n.toolResultAuthChallengeTrigger;if(i!=="any"){if(r?.source==="unresolved"||r===void 0)return{action:"notify",reason:"schemes-unresolved"};if(!Rc(r))return{action:"passthrough",reason:"missing-oauth2-scheme"};if(i==="oauth2-scheme+error-params"&&!e.facets.hasErrorParams)return{action:"passthrough",reason:"missing-error-params"}}return{action:o,reason:"honored"}}function Uc(e){const t={};for(const[r,n]of Object.entries(e))n!==void 0&&(t[r]=n);return t}function xl(e){if(!G(e))return;const t={},r=i=>jc.includes(i)?i:void 0,n=r(e.unauthorizedChallenge);n&&(t.unauthorizedChallenge=n),Cc.includes(e.unauthorizedChallengeTrigger)&&(t.unauthorizedChallengeTrigger=e.unauthorizedChallengeTrigger);const o=r(e.toolResultAuthChallenge);return o&&(t.toolResultAuthChallenge=o),Dc.includes(e.toolResultAuthChallengeTrigger)&&(t.toolResultAuthChallengeTrigger=e.toolResultAuthChallengeTrigger),Object.keys(t).length>0?t:void 0}function Ul(e,t,r="This host"){switch(t.reason){case"honored":return t.action==="prompt"?`${r} shows a sign-in prompt for this challenge and retries the call after sign-in.`:t.action==="notify"?`${r} tells the user to sign in, but does not retry the call.`:`${r} treats this challenge as an ordinary error.`;case"not-honored":return e.source==="tool_result_meta"?`${r} ignores _meta["mcp/www_authenticate"] on a tool result. To ask for sign-in, return HTTP 401 with a WWW-Authenticate: Bearer header instead.`:`${r} does not start sign-in from an HTTP 401 on a tool call.`;case"missing-bearer-header":return`${r} starts sign-in only when the 401 carries a WWW-Authenticate: Bearer header. Add one, with resource_metadata pointing at your Protected Resource Metadata.`;case"missing-resource-metadata":return`${r} needs resource_metadata="…" in the WWW-Authenticate challenge before it starts sign-in.`;case"missing-oauth2-scheme":return`${r} shows its sign-in UI for a _meta challenge only when the tool declares securitySchemes with an oauth2 entry.`;case"schemes-unresolved":return`This tool declares no securitySchemes, so it inherits the server default, which MCPJam cannot see. ${r} would show sign-in only if that default includes oauth2. Declare securitySchemes on the tool to make this explicit.`;case"missing-error-params":return`${r} needs both error and error_description in _meta["mcp/www_authenticate"] before it shows sign-in.`}}var et=["2025-03-26","2025-06-18","2025-11-25","2026-07-28"],Mc=et[et.length-1];function Ml(e){return e===Mc?`Latest (${e})`:e}var Lc=new Set(["2024-10-07","2024-11-05","2025-03-26","2025-06-18","2025-11-25"]);function Fc(e){return Lc.has(e)}function Ll(e){return et.includes(e)}function Fl(e){return e.length>0&&!Fc(e)}var Jc=["claude-code","codex","cursor","copilot-cli","opencode","claude-web","chatgpt-web"];function Jl(e){return typeof e=="string"&&Jc.includes(e)}var Vl=["sidebarApps","conversationPanels","fileViewers","fileResources","localFiles","settings","displayModes","deepLinks","modelContext","messages","mentions","forms","onboarding"],Bl=["verified","refuted","unverifiable"],Wl=["oauth2-dcr","oauth2-cimd","oauth2-preregistered","api-key","none"],Kl=["omit","fixed","challenge","all-supported"],Hl=["none","client_secret_basic","client_secret_post"],Vc="mcpjam-xaa-cli",tt="2025-11-25",Bc="io.modelcontextprotocol/enterprise-managed-authorization";function Gl(e){return{headers:{Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":tt,Authorization:`Bearer ${e}`},body:{jsonrpc:"2.0",id:Vc,method:"initialize",params:{protocolVersion:tt,capabilities:{extensions:{[Bc]:{}}},clientInfo:{name:"MCPJam XAA CLI",version:"1.0.0"}}}}}function Bn(e){if(!e||typeof e!="object")return e;const t=e;return t.transport==="sse"?t.mcpResponse:e}function Wc(e){if(!e||typeof e!="object")return;const t=e.error;if(!t||typeof t!="object")return;const{code:r,message:n}=t,o=[];return typeof r=="number"&&o.push(String(r)),typeof n=="string"&&n.length>0&&o.push(n),o.length>0?o.join(": "):"JSON-RPC error"}function ql(e){if(e&&typeof e=="object"){const i=e.error;if(typeof i=="string"&&i.length>0)return i}const t=Bn(e),r=Wc(t);if(r)return r;const n=t;if(!t||typeof t!="object"||n.jsonrpc!=="2.0"||n.id!=="mcpjam-xaa-cli"||n.result===null||typeof n.result!="object")return"MCP server did not return a JSON-RPC initialize result";const o=n.result.protocolVersion;if(o!=="2025-11-25")return`MCP server negotiated protocol version ${String(o)}; expected ${tt}`}function Yl(e){const t=Bn(e);if(!t||typeof t!="object")return"unknown";const r=t.result;if(!r||typeof r!="object")return"unknown";const n=r.capabilities;if(!n||typeof n!="object")return"unknown";const o=n.extensions;return!o||typeof o!="object"?"unknown":Object.prototype.hasOwnProperty.call(o,"io.modelcontextprotocol/enterprise-managed-authorization")?"advertised":"not_advertised"}export{Xu as $,Il as A,zl as B,Rc as C,hu as Ct,Zl as D,Gc as Dt,Cl as E,qc as Et,Nl as F,bl as G,kl as H,Tl as I,oc as J,yl as K,Sl as L,$l as M,bt as N,Ac as O,Hc as Ot,Pl as P,sl as Q,Sc as R,Ul as S,Qc as St,Rl as T,Yc as Tt,kc as U,Ol as V,wl as W,il as X,gl as Y,ol as Z,xc as _,$u as _t,Jc as a,rc as at,xl as b,qe as bt,Kl as c,cl as ct,Jl as d,al as dt,tl as et,et as f,ur as ft,jc as g,ul as gt,Ml as h,dl as ht,Yl as i,Xc as it,Al as j,El as k,Kc as kt,Hl as l,xn as lt,Fl as m,_l as mt,Gl as n,vl as nt,Wl as o,ml as ot,Ll as p,pl as pt,Dn as q,ql as r,ll as rt,Bl as s,hl as st,Bc as t,nl as tt,Vl as u,rl as ut,Dc as v,fl as vt,jl as w,mu as wt,Dl as x,el as xt,Cc as y,Qu as yt,$c as z};
|
|
58
58
|
|
|
59
|
-
//# sourceMappingURL=mcp-init-
|
|
59
|
+
//# sourceMappingURL=mcp-init-D384t3us.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as f}from"./chunk-D32TOXHM-
|
|
1
|
+
import{s as f}from"./chunk-D32TOXHM-BM6p8aoA.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.27.2"};var d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="2dfb924b-fe7a-44b9-9513-71edeb23e935",e._sentryDebugIdIdentifier="sentry-dbid-2dfb924b-fe7a-44b9-9513-71edeb23e935")}catch{}})();export{f as Mermaid};
|