forge-terminal 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/chunks/{boot-ISMRSTLL.js → boot-3M2WUSSL.js} +1 -1
- package/dist/chunks/{chunk-CKWYIU2N.js → chunk-XYYVNUE6.js} +2 -2
- package/dist/chunks/chunk-Z5PQWCG5.js +4 -0
- package/dist/chunks/{colour-LZ7EJ6H4.js → colour-6YGDI44N.js} +1 -1
- package/dist/chunks/{execute-JRS6RQZA.js → execute-BRPAGFUR.js} +1 -1
- package/dist/chunks/launch-ILBEFGNR.js +65 -0
- package/dist/chunks/{server-A327QWB6.js → server-ETHSTOP6.js} +3 -3
- package/dist/chunks/theme-TYCKAIEA.js +3 -0
- package/dist/chunks/{update-note-6GBF5AE4.js → update-note-ES7TWSUT.js} +1 -1
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/chunk-CXVYIBCA.js +0 -4
- package/dist/chunks/launch-BWYE27OQ.js +0 -65
- package/dist/chunks/theme-YG3CRJBG.js +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{f as zd}from"./chunk-PBIS2ONZ.js";import{a as bd,c as Rd}from"./chunk-CKWYIU2N.js";import{n as Sd,o as yd,s as vd}from"./chunk-RE7E6NA7.js";import{a as ac}from"./chunk-QVACE4IE.js";import{d as dd,f as pd,h as md}from"./chunk-M6LD6DHO.js";import{c as fd,d as hd,e as gd,f as _d}from"./chunk-VNAIHACR.js";import"./chunk-LI2JPLF7.js";import"./chunk-775ILWZI.js";import"./chunk-OIZCRBLT.js";import{a as ir}from"./chunk-CXVYIBCA.js";import{I as mt,g as ld}from"./chunk-E5QDHFKQ.js";import{d as ud}from"./chunk-J7FLFHQJ.js";import{b as cc}from"./chunk-4L6HNYSN.js";import"./chunk-HON4OV7M.js";import{d as ic}from"./chunk-TMUK2DD3.js";var rS=Object.create,ss=Object.defineProperty,oS=Object.getOwnPropertyDescriptor,nS=Object.getOwnPropertyNames,sS=Object.getPrototypeOf,iS=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$d=(e,t)=>{let r={};for(var o in e)ss(r,o,{get:e[o],enumerable:!0});return t&&ss(r,Symbol.toStringTag,{value:"Module"}),r},aS=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=nS(t),s=0,i=n.length,c;s<i;s++)c=n[s],!iS.call(e,c)&&c!==r&&ss(e,c,{get:(a=>t[a]).bind(null,c),enumerable:!(o=oS(t,c))||o.enumerable});return e},is=(e,t,r)=>(r=e!=null?rS(sS(e)):{},aS(t||!e||!e.__esModule?ss(r,"default",{value:e,enumerable:!0}):r,e));var cS=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),wd=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),uS=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),lS=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Pd(e){return typeof e=="string"&&wd.has(e.replace(/#$/,""))}function Ed(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(cS.has(r))return"2020-12";if(wd.has(r))return"2019-09";if(uS.has(r)||lS.has(r))return"draft-7";throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var ae={};ic(ae,{BIGINT_FORMAT_RANGES:()=>ls,CONSTANT_CATCH:()=>Md,Class:()=>dc,NUMBER_FORMAT_RANGES:()=>Mo,aborted:()=>ct,allowsEval:()=>_c,assert:()=>hS,assertEqual:()=>dS,assertIs:()=>mS,assertNever:()=>fS,assertNotEqual:()=>pS,assignProp:()=>Ye,attachSchema:()=>ps,base64ToUint8Array:()=>Ad,base64urlToUint8Array:()=>jS,cached:()=>Nr,captureStackTrace:()=>cs,cleanEnum:()=>NS,cleanRegex:()=>qo,clone:()=>st,cloneDef:()=>SS,codePointLength:()=>Lo,constantCatch:()=>Ld,createTransparentProxy:()=>$S,defineLazy:()=>fc,defineLazyInternal:()=>ge,derived:()=>MS,esc:()=>hc,escapeRegex:()=>St,explicitlyAborted:()=>vc,extend:()=>ES,finalizeIssue:()=>ut,floatSafeRemainder:()=>mc,getElementAtPath:()=>yS,getEnumValues:()=>Ir,getLengthableOrigin:()=>Do,getParsedType:()=>RS,getSizableOrigin:()=>xd,hexToUint8Array:()=>AS,hide:()=>ms,installLazyProp:()=>US,isObject:()=>cr,isPlainObject:()=>At,issue:()=>xr,joinValues:()=>as,jsonStringifyReplacer:()=>Or,members:()=>zc,merge:()=>kS,mergeDefs:()=>_t,normalizeParams:()=>te,nullish:()=>pc,numKeys:()=>zS,objectClone:()=>gS,omit:()=>PS,optionalKeys:()=>yc,own:()=>xt,parsedType:()=>bc,partial:()=>CS,pick:()=>wS,prefixIssues:()=>yt,primitiveTypes:()=>Nd,promiseAllObject:()=>vS,propertyKeyTypes:()=>Sc,randomString:()=>bS,rawShape:()=>jr,required:()=>IS,safeExtend:()=>TS,shallowClone:()=>Od,slugify:()=>gc,stringifyPrimitive:()=>us,toZod:()=>kd,uint8ArrayToBase64:()=>qd,uint8ArrayToBase64url:()=>xS,uint8ArrayToHex:()=>qS,unwrapMessage:()=>Cr});function dS(e){return e}function pS(e){return e}function kd(){return e=>e}function mS(e){}function fS(e){throw new Error("Unexpected value in exhaustive check")}function hS(e){}function Ir(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function as(e,t="|"){return e.map(r=>us(r)).join(t)}function Or(e,t){return typeof t=="bigint"?t.toString():t}var lc=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Nr(e){return new lc(e)}function pc(e){return e==null}function qo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function mc(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var Td=Symbol("evaluating");function fc(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Td)return o===void 0&&(o=Td,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function gS(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ye(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function jr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function gt(e){return jr(e._zod.def)??e._zod.def.shape}function Cd(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return Ye(this,t,o),o},enumerable:!0,configurable:!0})}function Id(e,t,r){t in e?Ye(e,t,r):e[t]=r}function ar(e,t,r,o){let n=gt(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);i.enumerable&&(i.get?Cd(e,s,()=>{let c=t._zod.def.shape[s];return o?o(c,s):c}):Id(e,s,o?o(i.value,s):i.value))}}function _S(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?Cd(e,r,()=>t[r]):Id(e,r,o.value))}}function _t(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function SS(e){return _t(e._zod.def)}function yS(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function vS(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=o[s];return n})}function bS(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function hc(e){return JSON.stringify(e)}function gc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var cs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function cr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var _c=Nr(()=>{if(Xe.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function At(e){if(cr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(cr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Od(e){return At(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function zS(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var RS=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Sc=new Set(["string","number","symbol"]),Nd=new Set(["string","number","bigint","boolean","symbol","undefined"]);function St(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function st(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function te(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function $S(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,s){return t??(t=e()),Reflect.set(t,o,n,s)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function us(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function yc(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Mo={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]},ls={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function wS(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return ar(s,e,ds(e,t)),st(e,_t(r,{shape:s,checks:[]}))}function ds(e,t){let r=gt(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw new Error(`Unrecognized key: "${String(n)}"`);t[n]&&o.push(n)}return o}function PS(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(ds(e,t)),i={};return ar(i,e,Reflect.ownKeys(gt(e)).filter(c=>!s.has(c))),st(e,_t(r,{shape:i,checks:[]}))}function ES(e,t){if(!At(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=gt(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return st(e,_t(e._zod.def,{shape:jd(e,t)}))}function jd(e,t){let r={};return ar(r,e,Reflect.ownKeys(gt(e))),_S(r,t),r}function TS(e,t){if(!At(t))throw new Error("Invalid input to safeExtend: expected a plain object");return st(e,_t(e._zod.def,{shape:jd(e,t)}))}function kS(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.");let r={};ar(r,e,Reflect.ownKeys(gt(e))),ar(r,t,Reflect.ownKeys(gt(t)));let o=_t(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return st(e,o)}function CS(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let c=r?new Set(ds(t,r)):void 0,a={};return ar(a,t,Reflect.ownKeys(gt(t)),e&&((u,d)=>c&&!c.has(d)?u:new e({type:"optional",innerType:u}))),st(t,_t(t._zod.def,{shape:a,checks:[]}))}function IS(e,t,r){let o=r?new Set(ds(t,r)):void 0,n={};return ar(n,t,Reflect.ownKeys(gt(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),st(t,_t(t._zod.def,{shape:n}))}function ct(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 vc(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 yt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Cr(e){return typeof e=="string"?e:e?.message}function ps(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function ut(e,t,r){var o;let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:Cr(e.inst?._zod.def?.error?.(e))??Cr(s?.(e))??Cr(t?.error?.(e))??Cr(r.customError?.(e))??Cr(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e))a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__"||(c[a]=e[a]);return c.path??(c.path=[]),c.message=i,t?.reportInput&&(c.input=e.input),c}function xd(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var OS=/[\uD800-\uDBFF]/;function Lo(e){let t=e.length;if(!OS.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(r--,o++);return r}function Do(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function bc(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function xr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function NS(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Ad(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function qd(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function jS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Ad(t+r)}function xS(e){return qd(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function AS(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function qS(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var dc=class{constructor(...t){}};function zc(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):LS(e,r,o.value)}}function xt(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function ms(e,t,r){return xt(e,t,r,!1)}function MS(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return xt(this,r,o(this))},set(n){xt(this,r,n)}})}return t}function LS(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:xt(this,t,r.bind(this))},set(o){xt(this,t,o)}})}function DS(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var uc,jt=!1,ZS={configurable:!0,get(){jt=!0}};function ge(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&uc!==e._zod){uc=void 0;return}uc=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,ZS);let n=jt;jt=!1;try{let s=r(this);return jt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),jt=jt||n,s}catch(s){throw delete this[t],jt=jt||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function US(e,t,r,o){let n=DS(e,t);n&&Object.defineProperty(n,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:s})}})}var Md="~constantCatch";function Ld(e){let t=()=>e;return t[Md]=!0,t}var Dd,$c=Object.freeze({status:"aborted"}),Rc={value:void 0,enumerable:!1},Zd="captureStackTrace"in Error?Error:null;function VS(e){let t=Zd;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return Zd=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function q(e,t,r,o){let n={};function s(g){this.def=g,this.constr=m,this.traits=new Set}s.prototype=n;let i=r,c=i&&new WeakSet;function a(g,v){if(g._zod){if(g._zod.traits.has(e))return}else{Rc.value=new s(v);try{Object.defineProperty(g,"_zod",Rc)}finally{Rc.value=void 0}}if(g._zod.traits.add(e),t(g,v),c){let _=Object.getPrototypeOf(g),h=g._zod.constr.prototype,f=_;for(;f&&f!==h;)f=Object.getPrototypeOf(f);let z=f??_;c.has(z)||(c.add(z),zc(z,i))}let p=m.prototype;for(let _ in p)Object.prototype.hasOwnProperty.call(p,_)&&(_ in g||(g[_]=p[_].bind(g)))}let u=o?.Parent??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function m(g){let v=o?.Parent?VS(d):this;a(v,g);let p=v._zod.deferred;if(p){for(let h of p)h();v._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(v),v}return Object.defineProperty(m,"init",{value:a}),Object.defineProperty(m,Symbol.hasInstance,{value:g=>o?.Parent&&g instanceof o.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(m,"name",{value:e}),m}var lt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ar=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Dd=globalThis).__zod_globalConfig??(Dd.__zod_globalConfig={});var Xe=globalThis.__zod_globalConfig;function Qe(e){return e&&Object.assign(Xe,e),Xe}function FS(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Or,2)),e.message}function HS(e){this._zod.message=e}var JS={get:FS,set:HS,enumerable:!0,configurable:!0},Pc={value:void 0,enumerable:!1},Ud=new WeakSet([Object.prototype,Error.prototype]),Vd=(e,t)=>{e.name="$ZodError",Pc.value=t,Object.defineProperty(e,"issues",Pc),Pc.value=void 0,Object.defineProperty(e,"message",JS);let r=Object.getPrototypeOf(e);Ud.has(r)||(Ud.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},Fd=q("$ZodError",Vd),lR=q("$ZodError",Vd,void 0,{Parent:Error});function BS(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 Ec(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?BS(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Tc(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(c=>o({issues:c},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let c=[...s,...i.path];if(c.length===0)r._errors.push(t(i));else{let a=r,u=0;for(;u<c.length;){let d=c[u],m=u===c.length-1;if(d==="_errors"){m&&a._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(a,d)||Object.defineProperty(a,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let g=a[d];m&&g._errors.push(t(i)),a=g,u++}}}};return o(e),r}function fs(e,t){return{callee:t?.callee??e,Err:t?.Err}}var hs=e=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise)throw new lt;if(c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>ut(u,i,Qe())));throw cs(a,s?.callee??t),a}return c.value};return t};var gs=e=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise&&(c=await c),c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>ut(u,i,Qe())));throw cs(a,s?.callee??t),a}return c.value};return t};var _s=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new lt;return s.issues.length?Hd(e,s.issues,n):{success:!0,data:s.value}};function Hd(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(n=>ut(n,r,Qe()))),t=void 0,r=void 0),o},set error(n){o=n,t=void 0,r=void 0}}}var Ss=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?Hd(e,s.issues,n):{success:!0,data:s.value}};var KS=Symbol.for("zod.compile.invalid"),GS=Symbol.for("zod.compile.fallback"),kc=((e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==KS)return!0;if(o.definite===!0&&r===void 0)return!1}return WS(e,t,r)});function WS(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n?(o[GS]=!0,s=n({value:t,issues:[]},o)):s=e._zod.run({value:t,issues:[]},o),s instanceof Promise)throw new lt;return s.issues.length===0}var Cc=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);return n instanceof Promise&&(n=await n),n.issues.length===0},Jd=e=>{let t=hs(e),r=(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,c,fs(r,i))};return r};var Bd=e=>{let t=hs(e),r=(o,n,s,i)=>t(o,n,s,fs(r,i));return r};var Kd=e=>{let t=gs(e),r=async(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,c,fs(r,i))};return r};var Gd=e=>{let t=gs(e),r=async(o,n,s,i)=>await t(o,n,s,fs(r,i));return r};var Wd=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return _s(e)(t,r,n)};var Yd=e=>(t,r,o)=>_s(e)(t,r,o);var Xd=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ss(e)(t,r,n)};var Qd=e=>async(t,r,o)=>Ss(e)(t,r,o);var ep=/^[cC][0-9a-z]{6,}$/,tp=/^[0-9a-z]+$/,rp=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,op=/^[0-9a-vA-V]{20}$/,np=/^[A-Za-z0-9]{27}$/,sp=/^[a-zA-Z0-9_-]{21}$/;function ip(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var ap=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var cp=/^([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})$/,Oc=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var up=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var YS="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function lp(){return new RegExp(YS,"u")}var dp=/^(?:(?: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])$/,pp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var mp=/^((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])$/,fp=/^(([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])$/,hp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,gp=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var _p=/^https?$/,Sp=/^\+[1-9]\d{6,14}$/;var yp="(?:(?:\\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 XS(e){return new RegExp(`^${e}$`)}var vp=XS(yp);function Ic(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function bp(e){return new RegExp(`^${Ic(e)}$`)}function zp(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Ic({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Ic({precision:e.precision})}`:r;return new RegExp(`^${yp}T(?:${o})$`)}var Rp=/^[\s\S]{0,}$/;var $p=/^-?\d+n?$/,Nc=/^-?\d+$/,Zo=/^-?\d+(?:\.\d+)?$/,wp=/^(?:true|false)$/i,Pp=/^null$/i;var Ep=/^[^A-Z]*$/,Tp=/^[^a-z]*$/;var Ze=q("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var jc=e=>{let t=e.value;return!pc(t)&&t.length!==void 0},ys={number:"number",bigint:"bigint",object:"date"},xc=q("$ZodCheckLessThan",(e,t)=>{Ze.init(e,t);let r=ys[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:ys[typeof o.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ac=q("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);let r=ys[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:ys[typeof o.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),kp=q("$ZodCheckMultipleOf",(e,t)=>{Ze.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):mc(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})}}),Cp=q("$ZodCheckNumberFormat",(e,t)=>{Ze.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Mo[t.format];e._zod.check=i=>{let c=i.value;if(r){if(!Number.isInteger(c)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?i.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}c<n&&i.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>s&&i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Ip=q("$ZodCheckMaxLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=jc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>t.maximum?Lo(n):s)<=t.maximum)return;let c=Do(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Op=q("$ZodCheckMinLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=jc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>=t.minimum&&s<t.minimum*2?Lo(n):s)>=t.minimum)return;let c=Do(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Np=q("$ZodCheckLengthEquals",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=jc),e._zod.check=o=>{let n=o.value,s=n.length,i=typeof n=="string"&&s>=t.length&&s<=t.length*2?Lo(n):s;if(i===t.length)return;let c=Do(n),a=i>t.length;o.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Uo=q("$ZodCheckStringFormat",(e,t)=>{var r,o;Ze.init(e,t),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),jp=q("$ZodCheckRegex",(e,t)=>{Uo.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})}}),xp=q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ep),Uo.init(e,t)}),Ap=q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Tp),Uo.init(e,t)}),qp=q("$ZodCheckIncludes",(e,t)=>{Ze.init(e,t);let r=St(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Mp=q("$ZodCheckStartsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`^${St(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Lp=q("$ZodCheckEndsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`.*${St(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Dp=q("$ZodCheckOverwrite",(e,t)=>{Ze.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var vs=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
3
|
+
import{f as zd}from"./chunk-PBIS2ONZ.js";import{a as bd,c as Rd}from"./chunk-XYYVNUE6.js";import{n as Sd,o as yd,s as vd}from"./chunk-RE7E6NA7.js";import{a as ac}from"./chunk-QVACE4IE.js";import{d as dd,f as pd,h as md}from"./chunk-M6LD6DHO.js";import{c as fd,d as hd,e as gd,f as _d}from"./chunk-VNAIHACR.js";import"./chunk-LI2JPLF7.js";import"./chunk-775ILWZI.js";import"./chunk-OIZCRBLT.js";import{a as ir}from"./chunk-Z5PQWCG5.js";import{I as mt,g as ld}from"./chunk-E5QDHFKQ.js";import{d as ud}from"./chunk-J7FLFHQJ.js";import{b as cc}from"./chunk-4L6HNYSN.js";import"./chunk-HON4OV7M.js";import{d as ic}from"./chunk-TMUK2DD3.js";var rS=Object.create,ss=Object.defineProperty,oS=Object.getOwnPropertyDescriptor,nS=Object.getOwnPropertyNames,sS=Object.getPrototypeOf,iS=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$d=(e,t)=>{let r={};for(var o in e)ss(r,o,{get:e[o],enumerable:!0});return t&&ss(r,Symbol.toStringTag,{value:"Module"}),r},aS=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=nS(t),s=0,i=n.length,c;s<i;s++)c=n[s],!iS.call(e,c)&&c!==r&&ss(e,c,{get:(a=>t[a]).bind(null,c),enumerable:!(o=oS(t,c))||o.enumerable});return e},is=(e,t,r)=>(r=e!=null?rS(sS(e)):{},aS(t||!e||!e.__esModule?ss(r,"default",{value:e,enumerable:!0}):r,e));var cS=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),wd=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),uS=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),lS=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Pd(e){return typeof e=="string"&&wd.has(e.replace(/#$/,""))}function Ed(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(cS.has(r))return"2020-12";if(wd.has(r))return"2019-09";if(uS.has(r)||lS.has(r))return"draft-7";throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var ae={};ic(ae,{BIGINT_FORMAT_RANGES:()=>ls,CONSTANT_CATCH:()=>Md,Class:()=>dc,NUMBER_FORMAT_RANGES:()=>Mo,aborted:()=>ct,allowsEval:()=>_c,assert:()=>hS,assertEqual:()=>dS,assertIs:()=>mS,assertNever:()=>fS,assertNotEqual:()=>pS,assignProp:()=>Ye,attachSchema:()=>ps,base64ToUint8Array:()=>Ad,base64urlToUint8Array:()=>jS,cached:()=>Nr,captureStackTrace:()=>cs,cleanEnum:()=>NS,cleanRegex:()=>qo,clone:()=>st,cloneDef:()=>SS,codePointLength:()=>Lo,constantCatch:()=>Ld,createTransparentProxy:()=>$S,defineLazy:()=>fc,defineLazyInternal:()=>ge,derived:()=>MS,esc:()=>hc,escapeRegex:()=>St,explicitlyAborted:()=>vc,extend:()=>ES,finalizeIssue:()=>ut,floatSafeRemainder:()=>mc,getElementAtPath:()=>yS,getEnumValues:()=>Ir,getLengthableOrigin:()=>Do,getParsedType:()=>RS,getSizableOrigin:()=>xd,hexToUint8Array:()=>AS,hide:()=>ms,installLazyProp:()=>US,isObject:()=>cr,isPlainObject:()=>At,issue:()=>xr,joinValues:()=>as,jsonStringifyReplacer:()=>Or,members:()=>zc,merge:()=>kS,mergeDefs:()=>_t,normalizeParams:()=>te,nullish:()=>pc,numKeys:()=>zS,objectClone:()=>gS,omit:()=>PS,optionalKeys:()=>yc,own:()=>xt,parsedType:()=>bc,partial:()=>CS,pick:()=>wS,prefixIssues:()=>yt,primitiveTypes:()=>Nd,promiseAllObject:()=>vS,propertyKeyTypes:()=>Sc,randomString:()=>bS,rawShape:()=>jr,required:()=>IS,safeExtend:()=>TS,shallowClone:()=>Od,slugify:()=>gc,stringifyPrimitive:()=>us,toZod:()=>kd,uint8ArrayToBase64:()=>qd,uint8ArrayToBase64url:()=>xS,uint8ArrayToHex:()=>qS,unwrapMessage:()=>Cr});function dS(e){return e}function pS(e){return e}function kd(){return e=>e}function mS(e){}function fS(e){throw new Error("Unexpected value in exhaustive check")}function hS(e){}function Ir(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function as(e,t="|"){return e.map(r=>us(r)).join(t)}function Or(e,t){return typeof t=="bigint"?t.toString():t}var lc=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Nr(e){return new lc(e)}function pc(e){return e==null}function qo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function mc(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var Td=Symbol("evaluating");function fc(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Td)return o===void 0&&(o=Td,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function gS(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ye(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function jr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function gt(e){return jr(e._zod.def)??e._zod.def.shape}function Cd(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return Ye(this,t,o),o},enumerable:!0,configurable:!0})}function Id(e,t,r){t in e?Ye(e,t,r):e[t]=r}function ar(e,t,r,o){let n=gt(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);i.enumerable&&(i.get?Cd(e,s,()=>{let c=t._zod.def.shape[s];return o?o(c,s):c}):Id(e,s,o?o(i.value,s):i.value))}}function _S(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?Cd(e,r,()=>t[r]):Id(e,r,o.value))}}function _t(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function SS(e){return _t(e._zod.def)}function yS(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function vS(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=o[s];return n})}function bS(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function hc(e){return JSON.stringify(e)}function gc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var cs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function cr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var _c=Nr(()=>{if(Xe.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function At(e){if(cr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(cr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Od(e){return At(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function zS(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var RS=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Sc=new Set(["string","number","symbol"]),Nd=new Set(["string","number","bigint","boolean","symbol","undefined"]);function St(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function st(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function te(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function $S(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,s){return t??(t=e()),Reflect.set(t,o,n,s)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function us(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function yc(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Mo={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]},ls={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function wS(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return ar(s,e,ds(e,t)),st(e,_t(r,{shape:s,checks:[]}))}function ds(e,t){let r=gt(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw new Error(`Unrecognized key: "${String(n)}"`);t[n]&&o.push(n)}return o}function PS(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(ds(e,t)),i={};return ar(i,e,Reflect.ownKeys(gt(e)).filter(c=>!s.has(c))),st(e,_t(r,{shape:i,checks:[]}))}function ES(e,t){if(!At(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=gt(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return st(e,_t(e._zod.def,{shape:jd(e,t)}))}function jd(e,t){let r={};return ar(r,e,Reflect.ownKeys(gt(e))),_S(r,t),r}function TS(e,t){if(!At(t))throw new Error("Invalid input to safeExtend: expected a plain object");return st(e,_t(e._zod.def,{shape:jd(e,t)}))}function kS(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.");let r={};ar(r,e,Reflect.ownKeys(gt(e))),ar(r,t,Reflect.ownKeys(gt(t)));let o=_t(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return st(e,o)}function CS(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let c=r?new Set(ds(t,r)):void 0,a={};return ar(a,t,Reflect.ownKeys(gt(t)),e&&((u,d)=>c&&!c.has(d)?u:new e({type:"optional",innerType:u}))),st(t,_t(t._zod.def,{shape:a,checks:[]}))}function IS(e,t,r){let o=r?new Set(ds(t,r)):void 0,n={};return ar(n,t,Reflect.ownKeys(gt(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),st(t,_t(t._zod.def,{shape:n}))}function ct(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 vc(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 yt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Cr(e){return typeof e=="string"?e:e?.message}function ps(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function ut(e,t,r){var o;let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:Cr(e.inst?._zod.def?.error?.(e))??Cr(s?.(e))??Cr(t?.error?.(e))??Cr(r.customError?.(e))??Cr(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e))a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__"||(c[a]=e[a]);return c.path??(c.path=[]),c.message=i,t?.reportInput&&(c.input=e.input),c}function xd(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var OS=/[\uD800-\uDBFF]/;function Lo(e){let t=e.length;if(!OS.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(r--,o++);return r}function Do(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function bc(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function xr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function NS(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Ad(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function qd(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function jS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Ad(t+r)}function xS(e){return qd(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function AS(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function qS(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var dc=class{constructor(...t){}};function zc(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):LS(e,r,o.value)}}function xt(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function ms(e,t,r){return xt(e,t,r,!1)}function MS(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return xt(this,r,o(this))},set(n){xt(this,r,n)}})}return t}function LS(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:xt(this,t,r.bind(this))},set(o){xt(this,t,o)}})}function DS(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var uc,jt=!1,ZS={configurable:!0,get(){jt=!0}};function ge(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&uc!==e._zod){uc=void 0;return}uc=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,ZS);let n=jt;jt=!1;try{let s=r(this);return jt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),jt=jt||n,s}catch(s){throw delete this[t],jt=jt||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function US(e,t,r,o){let n=DS(e,t);n&&Object.defineProperty(n,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:s})}})}var Md="~constantCatch";function Ld(e){let t=()=>e;return t[Md]=!0,t}var Dd,$c=Object.freeze({status:"aborted"}),Rc={value:void 0,enumerable:!1},Zd="captureStackTrace"in Error?Error:null;function VS(e){let t=Zd;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return Zd=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function q(e,t,r,o){let n={};function s(g){this.def=g,this.constr=m,this.traits=new Set}s.prototype=n;let i=r,c=i&&new WeakSet;function a(g,v){if(g._zod){if(g._zod.traits.has(e))return}else{Rc.value=new s(v);try{Object.defineProperty(g,"_zod",Rc)}finally{Rc.value=void 0}}if(g._zod.traits.add(e),t(g,v),c){let _=Object.getPrototypeOf(g),h=g._zod.constr.prototype,f=_;for(;f&&f!==h;)f=Object.getPrototypeOf(f);let z=f??_;c.has(z)||(c.add(z),zc(z,i))}let p=m.prototype;for(let _ in p)Object.prototype.hasOwnProperty.call(p,_)&&(_ in g||(g[_]=p[_].bind(g)))}let u=o?.Parent??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function m(g){let v=o?.Parent?VS(d):this;a(v,g);let p=v._zod.deferred;if(p){for(let h of p)h();v._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(v),v}return Object.defineProperty(m,"init",{value:a}),Object.defineProperty(m,Symbol.hasInstance,{value:g=>o?.Parent&&g instanceof o.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(m,"name",{value:e}),m}var lt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ar=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Dd=globalThis).__zod_globalConfig??(Dd.__zod_globalConfig={});var Xe=globalThis.__zod_globalConfig;function Qe(e){return e&&Object.assign(Xe,e),Xe}function FS(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Or,2)),e.message}function HS(e){this._zod.message=e}var JS={get:FS,set:HS,enumerable:!0,configurable:!0},Pc={value:void 0,enumerable:!1},Ud=new WeakSet([Object.prototype,Error.prototype]),Vd=(e,t)=>{e.name="$ZodError",Pc.value=t,Object.defineProperty(e,"issues",Pc),Pc.value=void 0,Object.defineProperty(e,"message",JS);let r=Object.getPrototypeOf(e);Ud.has(r)||(Ud.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},Fd=q("$ZodError",Vd),lR=q("$ZodError",Vd,void 0,{Parent:Error});function BS(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 Ec(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?BS(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Tc(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(c=>o({issues:c},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let c=[...s,...i.path];if(c.length===0)r._errors.push(t(i));else{let a=r,u=0;for(;u<c.length;){let d=c[u],m=u===c.length-1;if(d==="_errors"){m&&a._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(a,d)||Object.defineProperty(a,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let g=a[d];m&&g._errors.push(t(i)),a=g,u++}}}};return o(e),r}function fs(e,t){return{callee:t?.callee??e,Err:t?.Err}}var hs=e=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise)throw new lt;if(c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>ut(u,i,Qe())));throw cs(a,s?.callee??t),a}return c.value};return t};var gs=e=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise&&(c=await c),c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>ut(u,i,Qe())));throw cs(a,s?.callee??t),a}return c.value};return t};var _s=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new lt;return s.issues.length?Hd(e,s.issues,n):{success:!0,data:s.value}};function Hd(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(n=>ut(n,r,Qe()))),t=void 0,r=void 0),o},set error(n){o=n,t=void 0,r=void 0}}}var Ss=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?Hd(e,s.issues,n):{success:!0,data:s.value}};var KS=Symbol.for("zod.compile.invalid"),GS=Symbol.for("zod.compile.fallback"),kc=((e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==KS)return!0;if(o.definite===!0&&r===void 0)return!1}return WS(e,t,r)});function WS(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n?(o[GS]=!0,s=n({value:t,issues:[]},o)):s=e._zod.run({value:t,issues:[]},o),s instanceof Promise)throw new lt;return s.issues.length===0}var Cc=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);return n instanceof Promise&&(n=await n),n.issues.length===0},Jd=e=>{let t=hs(e),r=(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,c,fs(r,i))};return r};var Bd=e=>{let t=hs(e),r=(o,n,s,i)=>t(o,n,s,fs(r,i));return r};var Kd=e=>{let t=gs(e),r=async(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,c,fs(r,i))};return r};var Gd=e=>{let t=gs(e),r=async(o,n,s,i)=>await t(o,n,s,fs(r,i));return r};var Wd=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return _s(e)(t,r,n)};var Yd=e=>(t,r,o)=>_s(e)(t,r,o);var Xd=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ss(e)(t,r,n)};var Qd=e=>async(t,r,o)=>Ss(e)(t,r,o);var ep=/^[cC][0-9a-z]{6,}$/,tp=/^[0-9a-z]+$/,rp=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,op=/^[0-9a-vA-V]{20}$/,np=/^[A-Za-z0-9]{27}$/,sp=/^[a-zA-Z0-9_-]{21}$/;function ip(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var ap=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var cp=/^([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})$/,Oc=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var up=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var YS="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function lp(){return new RegExp(YS,"u")}var dp=/^(?:(?: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])$/,pp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var mp=/^((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])$/,fp=/^(([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])$/,hp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,gp=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var _p=/^https?$/,Sp=/^\+[1-9]\d{6,14}$/;var yp="(?:(?:\\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 XS(e){return new RegExp(`^${e}$`)}var vp=XS(yp);function Ic(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function bp(e){return new RegExp(`^${Ic(e)}$`)}function zp(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Ic({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Ic({precision:e.precision})}`:r;return new RegExp(`^${yp}T(?:${o})$`)}var Rp=/^[\s\S]{0,}$/;var $p=/^-?\d+n?$/,Nc=/^-?\d+$/,Zo=/^-?\d+(?:\.\d+)?$/,wp=/^(?:true|false)$/i,Pp=/^null$/i;var Ep=/^[^A-Z]*$/,Tp=/^[^a-z]*$/;var Ze=q("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var jc=e=>{let t=e.value;return!pc(t)&&t.length!==void 0},ys={number:"number",bigint:"bigint",object:"date"},xc=q("$ZodCheckLessThan",(e,t)=>{Ze.init(e,t);let r=ys[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:ys[typeof o.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ac=q("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);let r=ys[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:ys[typeof o.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),kp=q("$ZodCheckMultipleOf",(e,t)=>{Ze.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):mc(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})}}),Cp=q("$ZodCheckNumberFormat",(e,t)=>{Ze.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Mo[t.format];e._zod.check=i=>{let c=i.value;if(r){if(!Number.isInteger(c)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?i.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}c<n&&i.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>s&&i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Ip=q("$ZodCheckMaxLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=jc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>t.maximum?Lo(n):s)<=t.maximum)return;let c=Do(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Op=q("$ZodCheckMinLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=jc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>=t.minimum&&s<t.minimum*2?Lo(n):s)>=t.minimum)return;let c=Do(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Np=q("$ZodCheckLengthEquals",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=jc),e._zod.check=o=>{let n=o.value,s=n.length,i=typeof n=="string"&&s>=t.length&&s<=t.length*2?Lo(n):s;if(i===t.length)return;let c=Do(n),a=i>t.length;o.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Uo=q("$ZodCheckStringFormat",(e,t)=>{var r,o;Ze.init(e,t),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),jp=q("$ZodCheckRegex",(e,t)=>{Uo.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})}}),xp=q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ep),Uo.init(e,t)}),Ap=q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Tp),Uo.init(e,t)}),qp=q("$ZodCheckIncludes",(e,t)=>{Ze.init(e,t);let r=St(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Mp=q("$ZodCheckStartsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`^${St(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Lp=q("$ZodCheckEndsWith",(e,t)=>{Ze.init(e,t);let r=new RegExp(`.*${St(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Dp=q("$ZodCheckOverwrite",(e,t)=>{Ze.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var vs=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
4
4
|
`).filter(i=>i),n=Math.min(...o.map(i=>i.length-i.trimStart().length)),s=o.map(i=>i.slice(n)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
5
5
|
${r.join(`
|
|
6
6
|
`)}
|
|
@@ -68,6 +68,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
68
68
|
deps: ${d}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(a){let[u,d]=s(a);i(a,u),c(a,d)}};function s({schema:a}){let u={},d={};for(let m in a){if(m==="__proto__")continue;let g=Array.isArray(a[m])?u:d;g[m]=a[m]}return[u,d]}function i(a,u=a.schema){let{gen:d,data:m,it:g}=a;if(Object.keys(u).length===0)return;let v=d.let("missing");for(let p in u){let _=u[p];if(_.length===0)continue;let h=(0,o.propertyInData)(d,m,p,g.opts.ownProperties);a.setParams({property:p,depsCount:_.length,deps:_.join(", ")}),g.allErrors?d.if(h,()=>{for(let f of _)(0,o.checkReportMissingProp)(a,f)}):(d.if((0,t._)`${h} && (${(0,o.checkMissingProp)(a,_,v)})`),(0,o.reportMissingProp)(a,v),d.else())}}e.validatePropertyDeps=i;function c(a,u=a.schema){let{gen:d,data:m,keyword:g,it:v}=a,p=d.name("valid");for(let _ in u)(0,r.alwaysValidSchema)(v,u[_])||(d.if((0,o.propertyInData)(d,m,_,v.opts.ownProperties),()=>{let h=a.subschema({keyword:g,schemaProp:_},p);a.mergeValidEvaluated(h,p)},()=>d.var(p,!0)),a.ok(p))}e.validateSchemaDeps=c,e.default=n})),kz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>(0,t._)`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:i,data:c,it:a}=n;if((0,r.alwaysValidSchema)(a,i))return;let u=s.name("valid");s.forIn("key",c,d=>{n.setParams({propertyName:d}),n.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},u),s.if((0,t.not)(u),()=>{n.error(!0),a.allErrors||s.break()})}),n.ok(u)}};e.default=o})),s_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pt(),r=le(),o=dt(),n=_e(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>(0,r._)`{additionalProperty: ${i.additionalProperty}}`},code(i){let{gen:c,schema:a,parentSchema:u,data:d,errsCount:m,it:g}=i;if(!m)throw new Error("ajv implementation error");let{allErrors:v,opts:p}=g;if(g.props=!0,p.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(g,a))return;let _=(0,t.allSchemaProperties)(u.properties),h=(0,t.allSchemaProperties)(u.patternProperties);f(),i.ok((0,r._)`${m} === ${o.default.errors}`);function f(){c.forIn("key",d,b=>{!_.length&&!h.length?R(b):c.if(z(b),()=>R(b))})}function z(b){let S;if(_.length>8){let E=(0,n.schemaRefOrVal)(g,u.properties,"properties");S=(0,t.isOwnProperty)(c,E,b)}else _.length?S=(0,r.or)(..._.map(E=>(0,r._)`${b} === ${E}`)):S=r.nil;return h.length&&(S=(0,r.or)(S,...h.map(E=>(0,r._)`${(0,t.usePattern)(i,E)}.test(${b})`))),(0,r.not)(S)}function y(b){c.code((0,r._)`delete ${d}[${b}]`)}function R(b){if(p.removeAdditional==="all"||p.removeAdditional&&a===!1){y(b);return}if(a===!1){i.setParams({additionalProperty:b}),i.error(),v||c.break();return}if(typeof a=="object"&&!(0,n.alwaysValidSchema)(g,a)){let S=c.name("valid");p.removeAdditional==="failing"?(w(b,S,!1),c.if((0,r.not)(S),()=>{i.reset(),y(b)})):(w(b,S),v||c.if((0,r.not)(S),()=>c.break()))}}function w(b,S,E){let j={keyword:"additionalProperties",dataProp:b,dataPropType:n.Type.Str};E===!1&&Object.assign(j,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(j,S)}}};e.default=s})),Cz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=io(),r=pt(),o=_e(),n=s_(),s={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:c,schema:a,parentSchema:u,data:d,it:m}=i;m.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(m,n.default,"additionalProperties"));let g=(0,r.allSchemaProperties)(a);for(let f of g)m.definedProperties.add(f);m.opts.unevaluated&&g.length&&m.props!==!0&&(m.props=o.mergeEvaluated.props(c,(0,o.toHash)(g),m.props));let v=g.filter(f=>!(0,o.alwaysValidSchema)(m,a[f]));if(v.length===0)return;let p=c.name("valid");for(let f of v)_(f)?h(f):(c.if((0,r.propertyInData)(c,d,f,m.opts.ownProperties)),h(f),m.allErrors||c.else().var(p,!0),c.endIf()),i.it.definedProperties.add(f),i.ok(p);function _(f){return m.opts.useDefaults&&!m.compositeRule&&a[f].default!==void 0}function h(f){i.subschema({keyword:"properties",schemaProp:f,dataProp:f},p)}}};e.default=s})),Iz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pt(),r=le(),o=_e(),n=_e(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:c,schema:a,data:u,parentSchema:d,it:m}=i,{opts:g}=m,v=(0,t.allSchemaProperties)(a),p=v.filter(w=>(0,o.alwaysValidSchema)(m,a[w]));if(v.length===0||p.length===v.length&&(!m.opts.unevaluated||m.props===!0))return;let _=g.strictSchema&&!g.allowMatchingProperties&&d.properties,h=c.name("valid");m.props!==!0&&!(m.props instanceof r.Name)&&(m.props=(0,n.evaluatedPropsToName)(c,m.props));let{props:f}=m;z();function z(){for(let w of v)_&&y(w),m.allErrors?R(w):(c.var(h,!0),R(w),c.if(h))}function y(w){for(let b in _)new RegExp(w).test(b)&&(0,o.checkStrictMode)(m,`property ${b} matches pattern ${w} (use allowMatchingProperties)`)}function R(w){c.forIn("key",u,b=>{c.if((0,r._)`${(0,t.usePattern)(i,w)}.test(${b})`,()=>{let S=p.includes(w);S||i.subschema({keyword:"patternProperties",schemaProp:w,dataProp:b,dataPropType:n.Type.Str},h),m.opts.unevaluated&&f!==!0?c.assign((0,r._)`${f}[${b}]`,!0):!S&&!m.allErrors&&c.if((0,r.not)(h),()=>c.break())})})}}};e.default=s})),Oz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:s,it:i}=o;if((0,t.alwaysValidSchema)(i,s)){o.fail();return}let c=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},c),o.failResult(c,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r})),Nz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:pt().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t})),jz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>(0,t._)`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:i,parentSchema:c,it:a}=n;if(!Array.isArray(i))throw new Error("ajv implementation error");if(a.opts.discriminator&&c.discriminator)return;let u=i,d=s.let("valid",!1),m=s.let("passing",null),g=s.name("_valid");n.setParams({passing:m}),s.block(v),n.result(d,()=>n.reset(),()=>n.error(!0));function v(){u.forEach((p,_)=>{let h;(0,r.alwaysValidSchema)(a,p)?s.var(g,!0):h=n.subschema({keyword:"oneOf",schemaProp:_,compositeRule:!0},g),_>0&&s.if((0,t._)`${g} && ${d}`).assign(d,!1).assign(m,(0,t._)`[${m}, ${_}]`).else(),s.if(g,()=>{s.assign(d,!0),s.assign(m,_),h&&n.mergeEvaluated(h,t.Name)})})}}};e.default=o})),xz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:"allOf",schemaType:"array",code(o){let{gen:n,schema:s,it:i}=o;if(!Array.isArray(s))throw new Error("ajv implementation error");let c=n.name("valid");s.forEach((a,u)=>{if((0,t.alwaysValidSchema)(i,a))return;let d=o.subschema({keyword:"allOf",schemaProp:u},c);o.ok(c),o.mergeEvaluated(d)})}};e.default=r})),Az=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,t.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,t._)`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:i,parentSchema:c,it:a}=s;c.then===void 0&&c.else===void 0&&(0,r.checkStrictMode)(a,'"if" without "then" and "else" is ignored');let u=n(a,"then"),d=n(a,"else");if(!u&&!d)return;let m=i.let("valid",!0),g=i.name("_valid");if(v(),s.reset(),u&&d){let _=i.let("ifClause");s.setParams({ifClause:_}),i.if(g,p("then",_),p("else",_))}else u?i.if(g,p("then")):i.if((0,t.not)(g),p("else"));s.pass(m,()=>s.error(!0));function v(){let _=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);s.mergeEvaluated(_)}function p(_,h){return()=>{let f=s.subschema({keyword:_},g);i.assign(m,g),s.mergeValidEvaluated(f,m),h?i.assign(h,(0,t._)`${_}`):s.setParams({ifClause:_})}}}};function n(s,i){let c=s.schema[i];return c!==void 0&&!(0,r.alwaysValidSchema)(s,c)}e.default=o})),qz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:o,parentSchema:n,it:s}){n.if===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "if" is ignored`)}};e.default=r})),i_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=o_(),r=Pz(),o=n_(),n=Ez(),s=Tz(),i=td(),c=kz(),a=s_(),u=Cz(),d=Iz(),m=Oz(),g=Nz(),v=jz(),p=xz(),_=Az(),h=qz();function f(z=!1){let y=[m.default,g.default,v.default,p.default,_.default,h.default,c.default,a.default,i.default,u.default,d.default];return z?y.push(r.default,n.default):y.push(t.default,o.default),y.push(s.default),y}e.default=f})),Mz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,t.str)`must match format "${o}"`,params:({schemaCode:o})=>(0,t._)`{format: ${o}}`},code(o,n){let{gen:s,data:i,$data:c,schema:a,schemaCode:u,it:d}=o,{opts:m,errSchemaPath:g,schemaEnv:v,self:p}=d;if(!m.validateFormats)return;c?_():h();function _(){let f=s.scopeValue("formats",{ref:p.formats,code:m.code.formats}),z=s.const("fDef",(0,t._)`${f}[${u}]`),y=s.let("fType"),R=s.let("format");s.if((0,t._)`typeof ${z} == "object" && !(${z} instanceof RegExp)`,()=>s.assign(y,(0,t._)`${z}.type || "string"`).assign(R,(0,t._)`${z}.validate`),()=>s.assign(y,(0,t._)`"string"`).assign(R,z)),o.fail$data((0,t.or)(w(),b()));function w(){return m.strictSchema===!1?t.nil:(0,t._)`${u} && !${R}`}function b(){let S=v.$async?(0,t._)`(${z}.async ? await ${R}(${i}) : ${R}(${i}))`:(0,t._)`${R}(${i})`,E=(0,t._)`(typeof ${R} == "function" ? ${S} : ${R}.test(${i}))`;return(0,t._)`${R} && ${R} !== true && ${y} === ${n} && !${E}`}}function h(){let f=p.formats[a];if(!f){w();return}if(f===!0)return;let[z,y,R]=b(f);z===n&&o.pass(S());function w(){if(m.strictSchema===!1){p.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${a}" ignored in schema at path "${g}"`}}function b(E){let j=E instanceof RegExp?(0,t.regexpCode)(E):m.code.formats?(0,t._)`${m.code.formats}${(0,t.getProperty)(a)}`:void 0,F=s.scopeValue("formats",{key:a,ref:E,code:j});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,t._)`${F}.validate`]:["string",E,F]}function S(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!v.$async)throw new Error("async format in sync schema");return(0,t._)`await ${R}(${i})`}return typeof y=="function"?(0,t._)`${R}(${i})`:(0,t._)`${R}.test(${i})`}}}};e.default=r})),a_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[Mz().default];e.default=t})),c_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]})),u_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=t_(),r=r_(),o=i_(),n=a_(),s=c_(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i})),Lz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(r){r.Tag="tag",r.Mapping="mapping"})(t||(e.DiscrError=t={}))})),rd=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=Lz(),o=Xa(),n=ao(),s=_e(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:a}})=>c===r.DiscrError.Tag?`tag "${a}" must be string`:`value of tag "${a}" must be in oneOf`,params:({params:{discrError:c,tag:a,tagName:u}})=>(0,t._)`{error: ${c}, tag: ${u}, tagValue: ${a}}`},code(c){let{gen:a,data:u,schema:d,parentSchema:m,it:g}=c,{oneOf:v}=m;if(!g.opts.discriminator)throw new Error("discriminator: requires discriminator option");let p=d.propertyName;if(typeof p!="string")throw new Error("discriminator: requires propertyName");if(d.mapping)throw new Error("discriminator: mapping is not supported");if(!v)throw new Error("discriminator: requires oneOf keyword");let _=a.let("valid",!1),h=a.const("tag",(0,t._)`${u}${(0,t.getProperty)(p)}`);a.if((0,t._)`typeof ${h} == "string"`,()=>f(),()=>c.error(!1,{discrError:r.DiscrError.Tag,tag:h,tagName:p})),c.ok(_);function f(){let R=y();a.if(!1);for(let w in R)a.elseIf((0,t._)`${h} === ${w}`),a.assign(_,z(R[w]));a.else(),c.error(!1,{discrError:r.DiscrError.Mapping,tag:h,tagName:p}),a.endIf()}function z(R){let w=a.name("valid"),b=c.subschema({keyword:"oneOf",schemaProp:R},w);return c.mergeEvaluated(b,t.Name),w}function y(){var R;let w={},b=E(m),S=!0;for(let M=0;M<v.length;M++){let Z=v[M];if(Z?.$ref&&!(0,s.schemaHasRulesButRef)(Z,g.self.RULES)){let G=Z.$ref;if(Z=o.resolveRef.call(g.self,g.schemaEnv.root,g.baseId,G),Z instanceof o.SchemaEnv&&(Z=Z.schema),Z===void 0)throw new n.default(g.opts.uriResolver,g.baseId,G)}let Y=(R=Z?.properties)===null||R===void 0?void 0:R[p];if(typeof Y!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);S=S&&(b||E(Z)),j(Y,M)}if(!S)throw new Error(`discriminator: "${p}" must be required`);return w;function E({required:M}){return Array.isArray(M)&&M.includes(p)}function j(M,Z){if(M.const)F(M.const,Z);else if(M.enum)for(let Y of M.enum)F(Y,Z);else throw new Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}function F(M,Z){if(typeof M!="string"||M in w)throw new Error(`discriminator: "${p}" values must be unique strings`);w[M]=Z}}}};e.default=i})),Dz=U(((e,t)=>{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}})),l_=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=Xl(),o=u_(),n=rd(),s=Dz(),i=["/properties"],c="http://json-schema.org/draft-07/schema";var a=class extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let v=this.opts.$data?this.$dataMetaSchema(s,i):s;this.addMetaSchema(v,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};e.Ajv=a,t.exports=e=a,t.exports.Ajv=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var u=io();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var m=Mn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return m.default}});var g=ao();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return g.default}})})),d_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=le(),r=dt(),o=Xa(),n=Ql(),s={keyword:"$dynamicAnchor",schemaType:"string",code:a=>i(a,a.schema)};function i(a,u){let{gen:d,it:m}=a;m.schemaEnv.root.dynamicAnchors[u]=!0;let g=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,v=m.errSchemaPath==="#"?m.validateName:c(a);d.if((0,t._)`!${g}`,()=>d.assign(g,v))}e.dynamicAnchor=i;function c(a){let{schemaEnv:u,schema:d,self:m}=a.it,{root:g,baseId:v,localRefs:p,meta:_}=u.root,{schemaId:h}=m.opts,f=new o.SchemaEnv({schema:d,schemaId:h,root:g,baseId:v,localRefs:p,meta:_});return o.compileSchema.call(m,f),(0,n.getValidate)(a,f)}e.default=s})),p_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=le(),r=dt(),o=Ql(),n={keyword:"$dynamicRef",schemaType:"string",code:i=>s(i,i.schema)};function s(i,c){let{gen:a,keyword:u,it:d}=i;if(c[0]!=="#")throw new Error(`"${u}" only supports hash fragment reference`);let m=c.slice(1);if(d.allErrors)g();else{let p=a.let("valid",!1);g(p),i.ok(p)}function g(p){if(d.schemaEnv.root.dynamicAnchors[m]){let _=a.let("_v",(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(m)}`);a.if(_,v(_,p),v(d.validateName,p))}else v(d.validateName,p)()}function v(p,_){return _?()=>a.block(()=>{(0,o.callRef)(i,p),a.let(_,!0)}):()=>(0,o.callRef)(i,p)}}e.dynamicRef=s,e.default=n})),Zz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d_(),r=_e(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,t.dynamicAnchor)(n,""):(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o})),Uz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p_(),r={keyword:"$recursiveRef",schemaType:"string",code:o=>(0,t.dynamicRef)(o,o.schema)};e.default=r})),m_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d_(),r=p_(),o=Zz(),n=Uz(),s=[t.default,r.default,o.default,n.default];e.default=s})),Vz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=td(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:o=>(0,t.validatePropertyDeps)(o)};e.default=r})),Fz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=td(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:o=>(0,t.validateSchemaDeps)(o)};e.default=r})),Hz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:o,parentSchema:n,it:s}){n.contains===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "contains" is ignored`)}};e.default=r})),f_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Vz(),r=Fz(),o=Hz(),n=[t.default,r.default,o.default];e.default=n})),Jz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=dt(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>(0,t._)`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:i,schema:c,data:a,errsCount:u,it:d}=s;if(!u)throw new Error("ajv implementation error");let{allErrors:m,props:g}=d;g instanceof t.Name?i.if((0,t._)`${g} !== true`,()=>i.forIn("key",a,h=>i.if(p(g,h),()=>v(h)))):g!==!0&&i.forIn("key",a,h=>g===void 0?v(h):i.if(_(g,h),()=>v(h))),d.props=!0,s.ok((0,t._)`${u} === ${o.default.errors}`);function v(h){if(c===!1){s.setParams({unevaluatedProperty:h}),s.error(),m||i.break();return}if(!(0,r.alwaysValidSchema)(d,c)){let f=i.name("valid");s.subschema({keyword:"unevaluatedProperties",dataProp:h,dataPropType:r.Type.Str},f),m||i.if((0,t.not)(f),()=>i.break())}}function p(h,f){return(0,t._)`!${h} || !${h}[${f}]`}function _(h,f){let z=[];for(let y in h)h[y]===!0&&z.push((0,t._)`${f} !== ${y}`);return(0,t.and)(...z)}}};e.default=n})),Bz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>(0,t.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,t._)`{limit: ${n}}`},code(n){let{gen:s,schema:i,data:c,it:a}=n,u=a.items||0;if(u===!0)return;let d=s.const("len",(0,t._)`${c}.length`);if(i===!1)n.setParams({len:u}),n.fail((0,t._)`${d} > ${u}`);else if(typeof i=="object"&&!(0,r.alwaysValidSchema)(a,i)){let g=s.var("valid",(0,t._)`${d} <= ${u}`);s.if((0,t.not)(g),()=>m(g,u)),n.ok(g)}a.items=!0;function m(g,v){s.forRange("i",v,d,p=>{n.subschema({keyword:"unevaluatedItems",dataProp:p,dataPropType:r.Type.Num},g),a.allErrors||s.if((0,t.not)(g),()=>s.break())})}}};e.default=o})),h_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Jz(),r=Bz(),o=[t.default,r.default];e.default=o})),Kz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}})),Gz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}})),Wz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}})),Yz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}})),Xz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}})),Qz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}})),e0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}})),t0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Kz(),r=Gz(),o=Wz(),n=Yz(),s=Xz(),i=Qz(),c=e0(),a=["/properties"];function u(d){return[t,r,o,n,m(this,s),i,m(this,c)].forEach(g=>this.addMetaSchema(g,void 0,!1)),this;function m(g,v){return d?g.$dataMetaSchema(v,a):v}}e.default=u})),r0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let r=Xl(),o=u_(),n=m_(),s=f_(),i=h_(),c=rd(),a=t0(),u="https://json-schema.org/draft/2019-09/schema";var d=class extends r.default{constructor(_={}){super({..._,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach(_=>this.addVocabulary(_)),this.addVocabulary(s.default),this.addVocabulary(i.default),this.opts.discriminator&&this.addKeyword(c.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:_,meta:h}=this.opts;h&&(a.default.call(this,_),this.refs["http://json-schema.org/schema"]=u)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}};e.Ajv2019=d,t.exports=e=d,t.exports.Ajv2019=d,Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var m=io();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return m.KeywordCxt}});var g=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return g.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return g.CodeGen}});var v=Mn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return v.default}});var p=ao();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})),o0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=t_(),r=r_(),o=i_(),n=m_(),s=f_(),i=h_(),c=a_(),a=c_(),u=[n.default,t.default,r.default,(0,o.default)(!0),c.default,a.metadataVocabulary,a.contentVocabulary,s.default,i.default];e.default=u})),n0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}})),s0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}})),i0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}})),a0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}})),c0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}})),u0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}})),l0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}})),d0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}})),p0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n0(),r=s0(),o=i0(),n=a0(),s=c0(),i=u0(),c=l0(),a=d0(),u=["/properties"];function d(m){return[t,r,o,n,s,g(this,i),c,g(this,a)].forEach(v=>this.addMetaSchema(v,void 0,!1)),this;function g(v,p){return m?v.$dataMetaSchema(p,u):p}}e.default=d})),m0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let r=Xl(),o=o0(),n=rd(),s=p0(),i="https://json-schema.org/draft/2020-12/schema";var c=class extends r.default{constructor(g={}){super({...g,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:g,meta:v}=this.opts;v&&(s.default.call(this,g),this.refs["http://json-schema.org/schema"]=i)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}};e.Ajv2020=c,t.exports=e=c,t.exports.Ajv2020=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var a=io();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return a.KeywordCxt}});var u=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=Mn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var m=ao();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})),f0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(M,Z){return{validate:M,compare:Z}}e.fullFormats={date:t(s,i),time:t(a(!0),u),"date-time":t(g(!0),v),"iso-time":t(a(),d),"iso-date-time":t(g(),p),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:f,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:F,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:"number",validate:b},int64:{type:"number",validate:S},float:{type:"number",validate:E},double:{type:"number",validate:E},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,v),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,p),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(M){return M%4===0&&(M%100!==0||M%400===0)}let o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(M){let Z=o.exec(M);if(!Z)return!1;let Y=+Z[1],G=+Z[2],fe=+Z[3];return G>=1&&G<=12&&fe>=1&&fe<=(G===2&&r(Y)?29:n[G])}function i(M,Z){if(M&&Z)return M>Z?1:M<Z?-1:0}let c=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function a(M){return function(Y){let G=c.exec(Y);if(!G)return!1;let fe=+G[1],$e=+G[2],be=+G[3],Oe=G[4],he=G[5]==="-"?-1:1,C=+(G[6]||0),x=+(G[7]||0);if(C>23||x>59||M&&!Oe)return!1;if(fe<=23&&$e<=59&&be<60)return!0;let V=$e-x*he,$=fe-C*he-(V<0?1:0);return($===23||$===-1)&&(V===59||V===-1)&&be<61}}function u(M,Z){if(!(M&&Z))return;let Y=new Date("2020-01-01T"+M).valueOf(),G=new Date("2020-01-01T"+Z).valueOf();if(Y&&G)return Y-G}function d(M,Z){if(!(M&&Z))return;let Y=c.exec(M),G=c.exec(Z);if(Y&&G)return M=Y[1]+Y[2]+Y[3],Z=G[1]+G[2]+G[3],M>Z?1:M<Z?-1:0}let m=/t|\s/i;function g(M){let Z=a(M);return function(G){let fe=G.split(m);return fe.length===2&&s(fe[0])&&Z(fe[1])}}function v(M,Z){if(!(M&&Z))return;let Y=new Date(M).valueOf(),G=new Date(Z).valueOf();if(Y&&G)return Y-G}function p(M,Z){if(!(M&&Z))return;let[Y,G]=M.split(m),[fe,$e]=Z.split(m),be=i(Y,fe);if(be!==void 0)return be||u(G,$e)}let _=/\/|:/,h=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function f(M){return _.test(M)&&h.test(M)}let z=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(M){return z.lastIndex=0,z.test(M)}let R=-(2**31),w=2**31-1;function b(M){return Number.isInteger(M)&&M<=w&&M>=R}function S(M){return Number.isInteger(M)}function E(){return!0}let j=/[^\\]\\Z/;function F(M){if(j.test(M))return!1;try{return new RegExp(M),!0}catch{return!1}}})),h0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=l_(),r=le(),o=r.operators,n={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:c,schemaCode:a})=>(0,r.str)`should be ${n[c].okStr} ${a}`,params:({keyword:c,schemaCode:a})=>(0,r._)`{comparison: ${n[c].okStr}, limit: ${a}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(c){let{gen:a,data:u,schemaCode:d,keyword:m,it:g}=c,{opts:v,self:p}=g;if(!v.validateFormats)return;let _=new t.KeywordCxt(g,p.RULES.all.format.definition,"format");_.$data?h():f();function h(){let y=a.scopeValue("formats",{ref:p.formats,code:v.code.formats}),R=a.const("fmt",(0,r._)`${y}[${_.schemaCode}]`);c.fail$data((0,r.or)((0,r._)`typeof ${R} != "object"`,(0,r._)`${R} instanceof RegExp`,(0,r._)`typeof ${R}.compare != "function"`,z(R)))}function f(){let y=_.schema,R=p.formats[y];if(!R||R===!0)return;if(typeof R!="object"||R instanceof RegExp||typeof R.compare!="function")throw new Error(`"${m}": format "${y}" does not define "compare" function`);let w=a.scopeValue("formats",{key:y,ref:R,code:v.code.formats?(0,r._)`${v.code.formats}${(0,r.getProperty)(y)}`:void 0});c.fail$data(z(w))}function z(y){return(0,r._)`${y}.compare(${u}, ${d}) ${n[m].fail} 0`}},dependencies:["format"]};let i=c=>(c.addKeyword(e.formatLimitDefinition),c);e.default=i})),g0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=f0(),o=h0(),n=le(),s=new n.Name("fullFormats"),i=new n.Name("fastFormats"),c=(u,d={keywords:!0})=>{if(Array.isArray(d))return a(u,d,r.fullFormats,s),u;let[m,g]=d.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,s];return a(u,d.formats||r.formatNames,m,g),d.keywords&&(0,o.default)(u),u};c.get=(u,d="full")=>{let m=(d==="fast"?r.fastFormats:r.fullFormats)[u];if(!m)throw new Error(`Unknown format "${u}"`);return m};function a(u,d,m,g){var v,p;(v=(p=u.opts.code).formats)!==null&&v!==void 0||(p.formats=(0,n._)`require("ajv-formats/dist/formats").${g}`);for(let _ of d)u.addFormat(_,m[_])}t.exports=e=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c})),g_=l_(),_0=r0(),S0=m0(),y0=is(g0(),1),v0=y0.default;function Yl(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return v0(t),t}var Qa=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=Yl(S0.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=Ed(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");return t==="2020-12"?this.ajv:t==="2019-09"?this._ajv2019??=Yl(_0.Ajv2019):this._ajvDraft7??=Yl(g_.Ajv)}getValidator(e){let t=this._engineFor(e),r="$id"in e&&typeof e.$id=="string"?t.getSchema(e.$id)??t.compile(e):t.compile(e);return o=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(r.errors)}}},Hw=g_.Ajv;import od from"node:process";var $_=Symbol.for("mcp.completable");function sd(e){return!!e&&typeof e=="object"&&$_ in e}function R0(e){return e[$_]?.complete}var AP=2**31-1;function $0(e){return typeof e=="object"&&e!==null&&"setScopeChallengeResolver"in e&&typeof e.setScopeChallengeResolver=="function"}var w0=8,P0=6e5;function E0(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw new RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw new RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??w0,roundTimeoutMs:e?.roundTimeoutMs??P0,legacyShim:e?.legacyShim??!0}}function w_(e,t,r){if(r===null||typeof r!="object"||typeof r.method!="string")throw new oe(B.InternalError,`Handler for ${e} returned an invalid input request '${t}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let o=r,n=vg(o);if(n===void 0)throw new oe(B.InternalError,`Handler for ${e} returned an input request '${t}' of kind '${o.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:o,required:n}}function T0(){let e=globalThis.crypto;if(e?.randomUUID!==void 0)return e.randomUUID();let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let r=[...t].map(o=>o.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function nd(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new oe(B.InternalError,t)}var k0=class{constructor(e){this._host=e}async fulfill(e,t,r,o,n){let{maxRounds:s,roundTimeoutMs:i}=this._host,c=o.mcpReq.signal,a=n,u=0;for(;;){if(u+=1,u>s)return nd(e,Zg(e,s));let d=a.inputRequests,m=d!=null&&Object.keys(d).length>0,g=typeof a.requestState=="string"?a.requestState:void 0;if(!m&&g===void 0)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let v;if(m){let h=this._host.resolvedClientCapabilities(o),f=[];for(let[y,R]of Object.entries(d)){let{embedded:w,required:b}=w_(e,y,R);if(w.method!=="roots/list"&&w.params===void 0)throw new oe(B.InternalError,`Handler for ${e} returned an input request '${y}' of kind '${w.method}' without params`);if(Za(b,h)!==void 0)return nd(e,`Cannot request input '${y}' (${w.method}): the client on this 2025-era connection did not declare the required capability${h===void 0?" (no client capabilities are available on this connection \u2014 per-request legacy serving cannot receive server-to-client requests)":""}`);f.push([y,w])}let z=Vg(c);try{let y={relatedRequestId:o.mcpReq.id,timeout:i,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:z.signal},R=await Promise.all(f.map(async([w,b])=>{try{return[w,await this._dispatchLeg(b,y)]}catch(S){throw z.abort(S),S}}));v=Object.fromEntries(R)}catch(y){if(c.aborted)throw y;return nd(e,`Fulfilling input required by '${e}' failed: ${y instanceof Error?y.message:String(y)}`)}finally{z.dispose()}}else await Ug(Dg,c);let p={...o,mcpReq:{...o.mcpReq,inputResponses:v,droppedInputResponseKeys:void 0,requestState:qn(g)}};if(g!==void 0){let h=await this._host.verifyRequestState(g,p,e);h!==void 0&&(p=Hl(p,h))}let _=await t(r,p);if(!Tt(_))return _;a=_}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;return r.mode==="url"&&r.elicitationId===void 0&&(r={...r,elicitationId:T0()}),await this._host.sendElicitation(r,t)}case"sampling/createMessage":return await this._host.sendSampling(e.params,t);case"roots/list":return await this._host.listRoots(e.params,t)}}},C0=new Set(["tools/call","prompts/get","resources/read"]),I0,O0,N0;var P_=class extends Jl{_clientCapabilities;_clientVersion;static{I0=(e,t)=>{t.clientCapabilities!==void 0&&(e._clientCapabilities=t.clientCapabilities),t.clientInfo!==void 0&&(e._clientVersion=t.clientInfo)},O0=(e,t)=>{let r=t.filter(o=>!e._supportedProtocolVersions.includes(o));r.length>0&&(e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r]),e.setRequestHandler("server/discover",()=>e._ondiscover())},N0=e=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new k0({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:e=>this._inputRequestCapabilityView(e),verifyRequestState:(e,t,r)=>this._verifyRequestState(e,t,r),sendElicitation:(e,t)=>this._sendElicitationLeg(e,t,{validateAcceptedContent:!1}),sendSampling:(e,t)=>this.createMessage(e,t),listRoots:(e,t)=>this.listRoots(e,t)})}oninitialized;constructor(e,t){if(super(t),this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new Qa,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=E0(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))o!==void 0&&Nl(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}this.setRequestHandler("initialize",r=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),El(this._supportedProtocolVersions).length>0&&this.setRequestHandler("server/discover",()=>this._ondiscover()),this._capabilities.logging&&this._registerLoggingHandler()}async connect(e){if(this.transport!==void 0)throw new ue(me.AlreadyConnected,"Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.");await super.connect(e)}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(e,t)=>{let r=t.sessionId||t.http?.req?.headers.get("mcp-session-id")||void 0,{level:o}=e.params,n=Ha(Bt,o);return n.success&&this._loggingLevels.set(r,n.data),{}})}buildContext(e,t){let r=e.http||t?.request||t?.closeSSEStream||t?.closeStandaloneSSEStream;return{...e,mcpReq:{...e.mcpReq,log:(o,n,s)=>{if(!this._capabilities.logging)return Promise.resolve();let i;if(this._servedModernEra()){if(i=e.mcpReq.envelope?.[Zt],i===void 0)return Promise.resolve()}else i=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);return i!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(i)?Promise.resolve():e.mcpReq.notify({method:"notifications/message",params:{level:o,data:n,logger:s}})},elicitInput:(o,n)=>this.elicitInput(o,n),requestSampling:(o,n)=>this.createMessage(o,n)},http:r?{...e.http,req:t?.request,closeSSE:t?.closeSSEStream,closeStandaloneSSE:t?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(Bt.options.map((e,t)=>[e,t]));isMessageIgnored=(e,t)=>{let r=this._loggingLevels.get(t);return r?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r):!1};registerCapabilities(e){if(this.transport)throw new ue(me.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;this._capabilities=Bl(this._capabilities,e),!t&&this._capabilities.logging&&this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=C0.has(e);return r===void 0&&!o?async(n,s)=>{let i=await t(n,s);if(Tt(i))throw new oe(B.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}:async(n,s)=>{let i=o?await this._invokeInputRequiredCapableHandler(e,t,n,s):await t(n,s);if(Tt(i)){if(!o)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}return r===void 0?i:Ua(i,r)}}return async(r,o)=>{let n=no(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new oe(s.reason==="not-in-era"?B.InternalError:B.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let i=await this._invokeInputRequiredCapableHandler("tools/call",t,r,o);if(Tt(i))return i;let c=Tl(i),a=n.validateResult("tools/call",c);if(!a.ok)throw new oe(a.reason==="not-in-era"?B.InternalError:B.InvalidParams,a.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${a.message}`);return a.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&An(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(e,t,r,o){let n=this._servedModernEra(),s=o.mcpReq.requestState();if(s!==void 0&&typeof s!="string")throw new oe(B.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let i=o;if(typeof s=="string"){let m=await this._verifyRequestState(s,o,e);m!==void 0&&(i=Hl(o,m))}let c;try{c=await t(r,i)}catch(m){throw m instanceof oe&&m.code===B.UrlElicitationRequired&&n?new oe(B.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { \u2026: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`):m}if(!Tt(c))return c;if(!n){if(!this._inputRequiredServing.legacyShim)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??pr}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,i,c)}let a=c.inputRequests,u=a!=null&&Object.keys(a).length>0,d=typeof c.requestState=="string";if(!u&&!d)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(u){let m=this._inputRequestCapabilityView(o);for(let[g,v]of Object.entries(a)){let{embedded:p,required:_}=w_(e,g,v),h=Za(_,m);if(h!==void 0)throw new Fa({requiredCapabilities:h},`Cannot request input '${g}' (${p.method}): the request's client capabilities do not declare the required capability`)}}return c}async _verifyRequestState(e,t,r){if(this._requestStateVerify!==void 0)try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(new Error(`requestState verification rejected ${r}: ${o instanceof Error?o.message:String(o)}`)),new oe(B.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[Pt]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new ue(me.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${e}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead \u2014 the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:e,era:"2026-07-28"})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new ue(me.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new ue(me.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new ue(me.CapabilityNotSupported,`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new ue(me.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new ue(me.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new ue(me.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new ue(me.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"completion/complete":if(!this._capabilities.completions)throw new ue(me.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new ue(me.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new ue(me.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new ue(me.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new ue(me.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;let r=bg(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??pr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:El(this._supportedProtocolVersions),capabilities:j0(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(e,t){return this._wireCodec().projectCallToolResult(e,t)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(e,t){if(this._assertPushApiInServedEra("sampling/createMessage"),(e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new ue(me.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages.at(-1),i=Array.isArray(s.content)?s.content:[s.content],c=i.some(m=>m.type==="tool_result"),a=e.messages.length>1?e.messages.at(-2):void 0,u=a?Array.isArray(a.content)?a.content:[a.content]:[],d=u.some(m=>m.type==="tool_use");if(c){if(i.some(m=>m.type!=="tool_result"))throw new oe(B.InvalidParams,"The last message must contain only tool_result content if any is present");if(!d)throw new oe(B.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(d){let m=new Set(u.filter(v=>v.type==="tool_use").map(v=>v.id)),g=new Set(i.filter(v=>v.type==="tool_result").map(v=>v.toolUseId));if(m.size!==g.size||![...m].every(v=>g.has(v)))throw new oe(B.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=!!(e.tools||e.toolChoice),o=await this.request({method:"sampling/createMessage",params:e},t),n=this._wireCodec().samplingResultVariant(r,o);if(!n.ok)throw new ue(me.InvalidResult,`Invalid sampling/createMessage result: ${n.reason==="invalid"?n.message:n.reason}`);return n.value}async elicitInput(e,t){switch(this._assertPushApiInServedEra("elicitation/create"),e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new ue(me.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(e,t)}async _sendElicitationLeg(e,t,r){let o=e.mode??"form",n=r?.validateAcceptedContent??!0;switch(o){case"url":{let s=e;return this.request({method:"elicitation/create",params:s},t)}case"form":{let s=e.mode==="form"?e:{...e,mode:"form"},i=await this.request({method:"elicitation/create",params:s},t);if(n&&i.action==="accept"&&i.content&&s.requestedSchema)try{let c=this._jsonSchemaValidator.getValidator(s.requestedSchema)(i.content);if(!c.valid)throw new oe(B.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(c){throw c instanceof oe?c:new oe(B.InternalError,`Error validating elicitation response: ${c instanceof Error?c.message:String(c)}`)}return i}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:e},t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function j0(e){return{...e}}function x0(e,t){let r=0,o=[e];for(;o.length>0;){let n=o.pop();if(!(n===null||typeof n!="object"))if(Array.isArray(n))for(let s of n){if(++r>t)return r;s!==null&&typeof s=="object"&&o.push(s)}else for(let s in n){if(!Object.prototype.hasOwnProperty.call(n,s))continue;if(++r>t)return r;let i=n[s];i!==null&&typeof i=="object"&&o.push(i)}}return r}function A0(e){if(!(e===void 0||e===1/0)){if(typeof e!="number"||Number.isNaN(e)||e<1)throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(e)}`);return e}}var ec=class{server;_maxToolInputElements;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(!(t===void 0||!t.enabled)){if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return S_;try{let r=_r(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}}constructor(e,t){this.server=new P_(e,t),this._maxToolInputElements=A0(t?.maxToolInputElements),t?.capabilities?.tools&&this.setToolRequestHandlers(),t?.capabilities?.resources&&this.setResourceRequestHandlers(),t?.capabilities?.prompts&&this.setPromptRequestHandlers()}async connect(e){return $0(e)&&e.setScopeChallengeResolver(t=>this.resolveScopeChallenge(t)),await this.server.connect(e)}async close(){await this.server.close()}resolveScopeChallenge=e=>{switch(e.request.method){case"tools/call":{let t=e.request.params?.name;if(typeof t!="string")return;let r=this._registeredTools[t];return r===void 0||!r.enabled?void 0:r.scopeChallenge?.(e)}case"resources/read":{let t=e.request.params?.uri;if(typeof t!="string")return;let r;try{r=new URL(t)}catch{return}let o=this._registeredResources[r.toString()];if(o!==void 0)return o.enabled?o.scopeChallenge?.(e):void 0;for(let n of Object.values(this._registeredResourceTemplates))if(n.resourceTemplate.uriTemplate.match(r.toString()))return n.enabled?n.scopeChallenge?.(e):void 0;return}case"prompts/get":{let t=e.request.params?.name;if(typeof t!="string")return;let r=this._registeredPrompts[t];return r===void 0||!r.enabled?void 0:r.scopeChallenge?.(e)}default:return}};_toolHandlersInitialized=!1;setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?q0(e,t.inputSchema):S_,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};return t.outputSchema&&(r.outputSchema=_r(t.outputSchema,"output")),r})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let r=this._registeredTools[e.params.name];if(!r)throw new oe(B.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new oe(B.InvalidParams,`Tool ${e.params.name} disabled`);try{let o=await this.validateToolInput(r,e.params.arguments,e.params.name),n=await this.executeToolHandler(r,o,t);return await this.validateToolOutput(r,n,e.params.name),Tt(n)?n:this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(o){if(o instanceof oe&&o.code===B.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(this._maxToolInputElements!==void 0&&x0(t,this._maxToolInputElements)>this._maxToolInputElements)throw new oe(B.InvalidParams,`Invalid arguments for tool ${r}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);if(!e.inputSchema)return;let o=await gr(e.inputSchema,t??{});if(!o.success)throw new oe(B.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${o.error}`);return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema||Tt(t)||t.isError)return;if(t.structuredContent===void 0)throw new oe(B.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let o=await gr(e.outputSchema,t.structuredContent);if(!o.success)throw new oe(B.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${o.error}`)}async executeToolHandler(e,t,r){return e.executor(t,r)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async e=>{switch(e.params.ref.type){case"ref/prompt":return Zl(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Ul(e),this.handleResourceCompletion(e,e.params.ref);default:throw new oe(B.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new oe(B.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new oe(B.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return Ln;let o=R_(z_(r.argsSchema)?.[e.params.argument.name]);if(!sd(o))return Ln;let n=R0(o);return n?b_(await n(e.params.argument.value,e.params.context)):Ln}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find(n=>n.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return Ln;throw new oe(B.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);return o?b_(await o(e.params.argument.value,e.params.context)):Ln}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([n,s])=>s.enabled).map(([n,s])=>({uri:n,name:s.name,...s.metadata})),o=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let s=await n.resourceTemplate.listCallback(t);for(let i of s.resources)o.push({...n.metadata,...i})}return{resources:[...r,...o]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler("resources/read",async(e,t)=>{let r;try{r=new URL(e.params.uri)}catch{throw new oe(B.InvalidParams,`Resource URI ${e.params.uri} is invalid`,{uri:e.params.uri,reason:"invalid_uri"})}let o=this._registeredResources[r.toString()];if(o){if(!o.enabled)throw new oe(B.InvalidParams,`Resource ${r} disabled`);return Ua(await o.readCallback(r,t),o.cacheHint)}for(let n of Object.values(this._registeredResourceTemplates)){let s=n.resourceTemplate.uriTemplate.match(r.toString());if(s){if(!n.enabled)throw new oe(B.InvalidParams,`Resource template ${n.resourceTemplate.uriTemplate} disabled`);return Ua(await n.readCallback(r,s,t),n.cacheHint)}}throw new Va(e.params.uri)}),this._resourceHandlersInitialized=!0)}_promptHandlersInitialized=!1;setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?Lg(t.argsSchema):void 0,icons:t.icons,_meta:t._meta}))})),this.server.setRequestHandler("prompts/get",async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new oe(B.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new oe(B.InvalidParams,`Prompt ${e.params.name} disabled`);return r.handler(e.params.arguments,t)}),this._promptHandlersInitialized=!0)}registerResource(e,t,r,o){let{cacheHint:n,scopeChallenge:s,...i}=r,c=i;if(n!==void 0&&Nl(n,`resource ${e}`),typeof t=="string"){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);let a=this._createRegisteredResource(e,r.title,t,c,s,o);return n!==void 0&&(a.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let a=this._createRegisteredResourceTemplate(e,r.title,t,c,s,o);return n!==void 0&&(a.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}}_createRegisteredResource(e,t,r,o,n,s){let i={name:e,title:t,metadata:o,readCallback:s,scopeChallenge:n,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({uri:null}),update:c=>{c.uri!==void 0&&c.uri!==r&&(delete this._registeredResources[r],c.uri&&(this._registeredResources[c.uri]=i)),c.name!==void 0&&(i.name=c.name),c.title!==void 0&&(i.title=c.title),c.metadata!==void 0&&(i.metadata=c.metadata),c.callback!==void 0&&(i.readCallback=c.callback),c.scopeChallenge!==void 0&&(i.scopeChallenge=c.scopeChallenge===null?void 0:c.scopeChallenge),c.enabled!==void 0&&(i.enabled=c.enabled),this.sendResourceListChanged()}};return this._registeredResources[r]=i,i}_createRegisteredResourceTemplate(e,t,r,o,n,s){let i={resourceTemplate:r,title:t,metadata:o,readCallback:s,scopeChallenge:n,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:a=>{a.name!==void 0&&a.name!==e&&(delete this._registeredResourceTemplates[e],a.name&&(this._registeredResourceTemplates[a.name]=i)),a.title!==void 0&&(i.title=a.title),a.template!==void 0&&(i.resourceTemplate=a.template),a.metadata!==void 0&&(i.metadata=a.metadata),a.callback!==void 0&&(i.readCallback=a.callback),a.scopeChallenge!==void 0&&(i.scopeChallenge=a.scopeChallenge===null?void 0:a.scopeChallenge),a.enabled!==void 0&&(i.enabled=a.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=i;let c=r.uriTemplate.variableNames;return Array.isArray(c)&&c.some(a=>!!r.completeCallback(a))&&this.setCompletionRequestHandler(),i}_createRegisteredPrompt(e,t,r,o,n,s,i,c){let a=o,u=n,d={title:t,description:r,argsSchema:o,icons:s,scopeChallenge:i,_meta:c,handler:v_(e,o,n),enabled:!0,disable:()=>d.update({enabled:!1}),enable:()=>d.update({enabled:!0}),remove:()=>d.update({name:null}),update:m=>{m.name!==void 0&&m.name!==e&&(delete this._registeredPrompts[e],m.name&&(this._registeredPrompts[m.name]=d)),m.title!==void 0&&(d.title=m.title),m.description!==void 0&&(d.description=m.description),m.icons!==void 0&&(d.icons=m.icons),m.scopeChallenge!==void 0&&(d.scopeChallenge=m.scopeChallenge===null?void 0:m.scopeChallenge),m._meta!==void 0&&(d._meta=m._meta);let g=!1;m.argsSchema!==void 0&&(d.argsSchema=m.argsSchema,a=m.argsSchema,g=!0),m.callback!==void 0&&(u=m.callback,g=!0),g&&(d.handler=v_(e,a,u)),m.enabled!==void 0&&(d.enabled=m.enabled),this.sendPromptListChanged()}};if(this._registeredPrompts[e]=d,o){let m=z_(o);m&&Object.values(m).some(g=>sd(R_(g)))&&this.setCompletionRequestHandler()}return d}_createRegisteredTool(e,t,r,o,n,s,i,c,a,u,d){Wl(e);let m=d,g,v={title:t,description:r,inputSchema:o,outputSchema:n,get outputSchemaJson(){return g??=y_(v.outputSchema)},set outputSchemaJson(p){g=p},annotations:s,icons:i,execution:c,scopeChallenge:a,_meta:u,handler:d,executor:__(o,d),enabled:!0,disable:()=>v.update({enabled:!1}),enable:()=>v.update({enabled:!0}),remove:()=>v.update({name:null}),update:p=>{p.name!==void 0&&p.name!==e&&(typeof p.name=="string"&&Wl(p.name),delete this._registeredTools[e],delete this._toolInputSchemaJson[e],p.name&&(delete this._toolInputSchemaJson[p.name],this._registeredTools[p.name]=v,e=p.name)),p.title!==void 0&&(v.title=p.title),p.description!==void 0&&(v.description=p.description);let _=!1;p.paramsSchema!==void 0&&(v.inputSchema=p.paramsSchema,delete this._toolInputSchemaJson[e],_=!0),p.callback!==void 0&&(v.handler=p.callback,m=p.callback,_=!0),_&&(v.executor=__(v.inputSchema,m)),p.outputSchema!==void 0&&(v.outputSchema=p.outputSchema,v.outputSchemaJson=y_(p.outputSchema)),p.annotations!==void 0&&(v.annotations=p.annotations),p.icons!==void 0&&(v.icons=p.icons),p.scopeChallenge!==void 0&&(v.scopeChallenge=p.scopeChallenge===null?void 0:p.scopeChallenge),p._meta!==void 0&&(v._meta=p._meta),p.enabled!==void 0&&(v.enabled=p.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=v,this.setToolRequestHandlers(),this.sendToolListChanged(),v}registerTool(e,t,r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:o,description:n,inputSchema:s,outputSchema:i,annotations:c,icons:a,scopeChallenge:u,_meta:d}=t;return this._createRegisteredTool(e,o,n,Ja(s),Ja(i),c,a,void 0,u,d,r)}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:o,description:n,argsSchema:s,icons:i,scopeChallenge:c,_meta:a}=t,u=this._createRegisteredPrompt(e,o,n,Ja(s),r,i,c,a);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),u}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};function __(e,t){if(e){let o=t;return async(n,s)=>o(n,s)}let r=t;return async(o,n)=>r(n)}var S_={type:"object",properties:{}};function q0(e,t){let r=_r(t,"input"),o=Vl(r);return o.valid||console.warn(`[mcp-sdk] tool '${e}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${o.reason}`),r}function y_(e){if(e!==void 0)try{return _r(e,"output")}catch{return}}function v_(e,t,r){if(t){let o=r;return async(n,s)=>{let i=await gr(t,n??{});if(!i.success)throw new oe(B.InvalidParams,`Invalid arguments for prompt ${e}: ${i.error}`);return o(i.data,s)}}else{let o=r;return async(n,s)=>o(s)}}function b_(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var Ln={completion:{values:[],hasMore:!1}};function z_(e){let t=e;if(t.shape&&typeof t.shape=="object")return t.shape}function M0(e){return e?.type==="optional"}function R_(e){return M0(e)?e.def?.innerType??e:e}var CE=4*1024*1024;var E_=Symbol("swallowsErrorsAfterClose"),T_=class{_readBuffer;_started=!1;_closed=!1;constructor(e=od.stdin,t=od.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new Kl({maxBufferSize:r?.maxBufferSize})}onclose;onerror;onmessage;_ondata=e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(t){this.onerror?.(t),this.close().catch(()=>{})}};_onerror=e=>{this.onerror?.(e)};_onstdouterror=e=>{this._closed||(this.onerror?.(e),this.close().catch(()=>{}))};_onstdinclose=()=>{this.close().catch(()=>{})};async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0;for(let e of this._stdout.listeners("error"))e[E_]&&this._stdout.off("error",e);(this._stdin.readableEnded||this._stdin.destroyed)&&setImmediate(this._onstdinclose),this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdin.on("end",this._onstdinclose),this._stdin.on("close",this._onstdinclose),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._closed||(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.off("end",this._onstdinclose),this._stdin.off("close",this._onstdinclose),this._onstdouterror[E_]=!0,this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.())}send(e){return this._closed?Promise.reject(new Error("StdioServerTransport is closed")):new Promise((t,r)=>{let o=Gl(e),n=!1,s=c=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),r(c))},i=()=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),t())};if(this._stdout.once("error",s),this._stdout.write(o)){if(n)return;n=!0,this._stdout.off("error",s),t()}else n||this._stdout.once("drain",i)})}};import{isAbsolute as J0}from"node:path";function k_(e,t){let r=e.find(o=>o.id===t);if(r?.kind!=="select")throw new Error(`no select option "${t}"`);return r.choices.map(o=>o.value)}var C_={kind:"document",path:"/forge.pdf",format:"pdf",bytes:0,pages:2,encrypted:!1},B0=dd(),K0=vd.map(e=>e.id),G0=k_(Sd.options([C_],{},cc),"degrees").map(Number),KE=k_(yd.options([C_],{},cc),"mode");var tc=l().refine(J0,"must be an absolute path").describe("An absolute path."),rc=I(tc).min(1),W0=Lt("mode",[P({mode:O("every-page")}),P({mode:O("every-n"),n:L().int().min(1)}),P({mode:O("points"),after:I(L().int().min(1)).min(1).describe("Cut after these pages (1-based).")})]).describe("How to split: every page, every N pages, or after the given pages."),I_=P({paths:rc.describe("Absolute paths of files (or folders) to inspect.")}),O_=P({}),N_=P({paths:rc.describe("Absolute paths of files, folders or globs to convert."),to:ce(B0).optional().describe(`Target format id. Use "jpeg" for JPG. Required, except with trim or resize, which keep each image's own format when it is omitted.`),output:tc.optional().describe("A folder (or, for one input, a file) to write to. Default: beside each source."),quality:L().int().min(1).max(100).optional().describe("For lossy targets, 1-100."),dpi:L().int().min(36).max(600).optional().describe("PDF \u2192 image resolution. Default 150."),pages:l().optional().describe('PDF \u2192 image page selection, e.g. "3-7,12". Default all.'),background:l().optional().describe("Fill colour when transparency must be flattened. Default #ffffff."),keepMetadata:H().optional().describe("Keep EXIF and GPS data. Default false."),password:l().optional().describe("Password for an encrypted PDF. Never echoed back."),overwrite:H().optional().describe("Replace existing outputs. Default false \u2014 only when the user asked."),recursive:H().optional().describe("Descend into subfolders of a folder input."),trim:H().optional().describe("Images only: cut transparent or solid-colour edges, writing name-trimmed. Keeps the format unless `to` is given. Refused for animated images and when nothing would be trimmed (unless also resizing)."),resize:W([Me({percent:L().min(1).max(md)}),Me({width:L().int().min(1)}),Me({height:L().int().min(1)})]).optional().describe("Images only: resize to { percent } of the size (1-200), or an exact { width } or { height } with the other side following. Writes name-<W>x<H>; with trim, name-trimmed-<50pct|1200w|900h>. Keeps the format unless `to` is given. No side over 16384 px, no more than 100 MP."),sharpen:H().optional().describe("Images only: sharpen at the same size with the optional boost extension, writing name-sharp. `to` is then the output format. Fails with extension-missing when it is not installed; the fix is `forge extensions add boost`."),boost:W([O(2),O(3),O(4)]).optional().describe("Images only: enlarge 2, 3 or 4 times with the optional boost extension, writing name-2x / name-3x / name-4x. `to` is then the output format (png keeps transparency). Fails with extension-missing when it is not installed; the fix is `forge extensions add boost`. 3 needs boost 1.1.0 or later: an older install fails with extension-outdated, fixed by the same command; while no released boost makes 3 it fails with invalid-arguments naming the factors that work."),removeBackground:H().optional().describe("Images only: cut out the subject with the optional remove-background extension, writing name-cutout. `to` must carry transparency (png, webp, avif, tiff). Fails with extension-missing when it is not installed; the fix is `forge extensions add remove-background`.")}),j_=P({paths:rc.describe("Absolute paths of files to compress."),quality:L().int().min(1).max(100).optional().describe("Compress to this quality."),maxSize:l().optional().describe('Compress until it fits, e.g. "500kb" or "2mb".'),dpi:L().int().min(36).max(600).optional().describe("For a PDF: image resolution."),output:tc.optional().describe("A folder or file to write to."),overwrite:H().optional().describe("Replace existing outputs. Default false.")}).refine(e=>e.quality===void 0!=(e.maxSize===void 0),{message:"Give exactly one of quality or maxSize."}),x_=P({op:ce(K0).describe("The page operation."),paths:rc.describe("Absolute PDF paths. merge takes two or more, in order; the others take one."),pages:l().optional().describe('extract / delete: which pages, e.g. "3-7,12".'),separate:H().optional().describe("extract: one file per page."),degrees:O(G0).optional().describe("rotate: degrees clockwise."),split:W0.optional(),overwrite:H().optional().describe("Replace existing outputs. Default false.")}),Dn=Me({path:l().optional(),code:l(),title:l(),detail:l(),hint:l().optional()}),Y0=Me({op:l(),source:l(),sources:I(l()),outputs:I(l()),inputBytes:L(),outputBytes:L(),warnings:I(Me({code:l(),message:l()}))}),oc=Me({forge:l(),ok:H(),results:I(Y0),failures:I(Dn)}),A_=Me({forge:l(),ok:H(),probes:I(Me({path:l(),kind:ce(["image","document"]),format:l(),bytes:L(),width:L().optional(),height:L().optional(),pages:L().optional(),encrypted:H().optional(),targets:I(l()),actions:I(l())})),failures:I(Dn)}),q_=Me({forge:l(),ok:H(),formats:I(Me({id:l(),label:l(),extensions:I(l()),read:H(),write:H(),lossy:H()})),failures:I(Dn)}),M_=l().describe("A hex colour: #RRGGBB, #RGB, or without the #"),L_=P({path:tc.describe("An image file (absolute path): a photo, a screenshot or artwork"),inside:M_.optional().describe("Show the shades of the palette colour nearest this one")}),D_=P({colour:M_}),Z_=Me({forge:l(),ok:H(),palette:Me({source:l(),inside:l().optional(),colours:I(Me({hex:l(),rgb:l(),oklch:l(),share:L()}))}),failures:I(Dn)}),U_=Me({forge:l(),ok:H(),scale:Me({reference:l(),steps:I(Me({step:L(),hex:l(),oklch:l(),white:L(),black:L()}))}),failures:I(Dn)});import{Writable as X0}from"node:stream";function V_(e=process.stdout,t=process.stderr){let r=e.write.bind(e);return e.write=t.write.bind(t),new X0({write(o,n,s){r(o,n,s)}})}import{basename as Q0}from"node:path";import{pathToFileURL as eR}from"node:url";var F_={interactive:!1},H_=Promise.resolve();function tR(e){let t=H_.then(e,e);return H_=t.catch(()=>{}),t}var Zn=(e,t)=>tR(()=>Rd(e,t===void 0?F_:{...F_,signal:t}));function J_(e){let t=e.path===void 0?"":` (${e.path})`,r=e.hint===void 0?"":` ${e.hint}`;return`\u2715 ${e.title}${t}: ${e.detail}${r}`}function B_(e){let t=e.results.map(o=>`\u2713 ${o.source} \u2192 ${o.outputs.join(", ")}`);t.push(...e.failures.map(J_));let r=e.results.flatMap(o=>o.outputs).map(o=>({type:"resource_link",uri:eR(o).href,name:Q0(o)}));return{content:[{type:"text",text:t.join(`
|
|
69
69
|
`)||"Nothing to do."},...r],structuredContent:{...e},isError:!e.ok}}var Un=e=>B_(fd(ir,e)),Sr=e=>B_(hd(ir,e));async function K_(e){let t=_d(ir,await bd(e.paths)),r=t.probes.map(o=>{let n=o.pages===void 0?`${o.width}\xD7${o.height}`:`${o.pages} pages`;return`${o.path}: ${o.format}, ${o.bytes} bytes, ${n}${o.encrypted?", password-protected":""}. Can become: ${o.targets.join(", ")}. Actions: ${o.actions.join(", ")}.`});return r.push(...t.failures.map(J_)),{content:[{type:"text",text:r.join(`
|
|
70
70
|
`)}],structuredContent:{...t},isError:!t.ok}}function G_(){let e=gd(ir,pd());return{content:[{type:"text",text:e.formats.map(r=>{let o=r.read&&r.write?"read and write":r.read?"read only":"write only";return`${r.id} (${r.extensions.join(" ")}): ${o}`}).join(`
|
|
71
|
-
`)}],structuredContent:{...e}}}async function W_(e,t){let r=[...e.sharpen===!0?["sharpen"]:[],...e.boost!==void 0?["boost"]:[],...e.removeBackground===!0?["removeBackground"]:[]];if(e.trim===!0||e.resize!==void 0){if(r.length>0)return Sr(mt(`${e.trim===!0?"trim":"resize"} cannot be combined with ${r[0]}.`,"Run them one after the other."));let i={kind:"edit",inputs:e.paths,trim:e.trim===!0,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...e.resize===void 0?{}:{resize:e.resize},...e.to===void 0?{}:{target:e.to},...e.output===void 0?{}:{output:e.output}};return Un(await Zn(i))}if(e.to===void 0)return Sr(mt("forge_convert needs `to`, the target format.","Only trim and resize may leave it out, to keep each image's own format."));let n=e.to;if(r.length>0){if(r.length>1)return Sr(mt(`Use one operation at a time \u2014 got ${r.join(" and ")}.`));let i=e.sharpen===!0?1:e.boost,c={kind:"extension-op",op:i!==void 0?"boost":"remove-background",inputs:e.paths,target:n,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...i===void 0?{}:{scale:i},...e.output===void 0?{}:{output:e.output}};return Un(await Zn(c,t))}let s={kind:"convert",inputs:e.paths,target:n,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,dpi:e.dpi??150,passwordStdin:!1,...e.output===void 0?{}:{output:e.output},...e.pages===void 0?{}:{pages:e.pages},...e.password===void 0?{}:{password:e.password}};return Un(await Zn(s))}async function Y_(e){let t={kind:"compress",inputs:e.paths,options:{background:"#ffffff",keepMetadata:!1},force:e.overwrite??!1,recursive:!1,debug:!1};if(e.quality!==void 0&&(t.quality=e.quality),e.maxSize!==void 0){let r=ud(e.maxSize);if(r===void 0)return Sr(mt(`${e.maxSize} is not a size.`,"Try a number with a unit, for example 500kb, 2mb or 1.5mb."));t.maxBytes=r}return e.dpi!==void 0&&(t.dpi=e.dpi),e.output!==void 0&&(t.output=e.output),Un(await Zn(t))}async function X_(e){let t={kind:"pageop",action:e.op,inputs:e.paths,force:e.overwrite??!1,debug:!1};if(e.op==="extract"||e.op==="delete"){if(e.pages===void 0)return Sr(mt(`${e.op} needs pages, for example "3-7,12".`));t.pages=e.pages,e.op==="extract"&&e.separate===!0&&(t.separate=!0)}if(e.op==="rotate"){if(e.degrees===void 0)return Sr(mt("rotate needs degrees: 90, 180 or 270."));t.rotate=e.degrees}if(e.op==="split"){if(e.split===void 0)return Sr(mt("split needs a split mode: every-page, every-n or points."));t.split=e.split}return Un(await Zn(t))}function id(e){return{content:[{type:"text",text:e}],isError:!0}}async function Q_(e){let t=e.inside===void 0?void 0:ac(e.inside);if(e.inside!==void 0&&!t)return id(`${e.inside} is not a colour. Try #RRGGBB.`);try{let{runPalette:r}=await import("./colour-
|
|
72
|
-
`)}],structuredContent:{...n}}}catch(r){if(ld(r))return id(`${r.title}: ${r.detail}${r.hint?` ${r.hint}`:""}`);throw r}}async function eS(e){let t=ac(e.colour);if(!t)return id(`${e.colour} is not a colour. Try #RRGGBB.`);let{runScale:r}=await import("./colour-
|
|
71
|
+
`)}],structuredContent:{...e}}}async function W_(e,t){let r=[...e.sharpen===!0?["sharpen"]:[],...e.boost!==void 0?["boost"]:[],...e.removeBackground===!0?["removeBackground"]:[]];if(e.trim===!0||e.resize!==void 0){if(r.length>0)return Sr(mt(`${e.trim===!0?"trim":"resize"} cannot be combined with ${r[0]}.`,"Run them one after the other."));let i={kind:"edit",inputs:e.paths,trim:e.trim===!0,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...e.resize===void 0?{}:{resize:e.resize},...e.to===void 0?{}:{target:e.to},...e.output===void 0?{}:{output:e.output}};return Un(await Zn(i))}if(e.to===void 0)return Sr(mt("forge_convert needs `to`, the target format.","Only trim and resize may leave it out, to keep each image's own format."));let n=e.to;if(r.length>0){if(r.length>1)return Sr(mt(`Use one operation at a time \u2014 got ${r.join(" and ")}.`));let i=e.sharpen===!0?1:e.boost,c={kind:"extension-op",op:i!==void 0?"boost":"remove-background",inputs:e.paths,target:n,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...i===void 0?{}:{scale:i},...e.output===void 0?{}:{output:e.output}};return Un(await Zn(c,t))}let s={kind:"convert",inputs:e.paths,target:n,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,dpi:e.dpi??150,passwordStdin:!1,...e.output===void 0?{}:{output:e.output},...e.pages===void 0?{}:{pages:e.pages},...e.password===void 0?{}:{password:e.password}};return Un(await Zn(s))}async function Y_(e){let t={kind:"compress",inputs:e.paths,options:{background:"#ffffff",keepMetadata:!1},force:e.overwrite??!1,recursive:!1,debug:!1};if(e.quality!==void 0&&(t.quality=e.quality),e.maxSize!==void 0){let r=ud(e.maxSize);if(r===void 0)return Sr(mt(`${e.maxSize} is not a size.`,"Try a number with a unit, for example 500kb, 2mb or 1.5mb."));t.maxBytes=r}return e.dpi!==void 0&&(t.dpi=e.dpi),e.output!==void 0&&(t.output=e.output),Un(await Zn(t))}async function X_(e){let t={kind:"pageop",action:e.op,inputs:e.paths,force:e.overwrite??!1,debug:!1};if(e.op==="extract"||e.op==="delete"){if(e.pages===void 0)return Sr(mt(`${e.op} needs pages, for example "3-7,12".`));t.pages=e.pages,e.op==="extract"&&e.separate===!0&&(t.separate=!0)}if(e.op==="rotate"){if(e.degrees===void 0)return Sr(mt("rotate needs degrees: 90, 180 or 270."));t.rotate=e.degrees}if(e.op==="split"){if(e.split===void 0)return Sr(mt("split needs a split mode: every-page, every-n or points."));t.split=e.split}return Un(await Zn(t))}function id(e){return{content:[{type:"text",text:e}],isError:!0}}async function Q_(e){let t=e.inside===void 0?void 0:ac(e.inside);if(e.inside!==void 0&&!t)return id(`${e.inside} is not a colour. Try #RRGGBB.`);try{let{runPalette:r}=await import("./colour-6YGDI44N.js"),o=await r({kind:"palette",input:e.path,svg:!1,...t?{inside:t}:{}},{json:!0,colour:!1}),n=JSON.parse(o.stdout[0]??"{}"),s=zd(n.palette.colours.map(c=>c.share));return{content:[{type:"text",text:n.palette.colours.map((c,a)=>`${c.hex} ${s[a]}%`).join(`
|
|
72
|
+
`)}],structuredContent:{...n}}}catch(r){if(ld(r))return id(`${r.title}: ${r.detail}${r.hint?` ${r.hint}`:""}`);throw r}}async function eS(e){let t=ac(e.colour);if(!t)return id(`${e.colour} is not a colour. Try #RRGGBB.`);let{runScale:r}=await import("./colour-6YGDI44N.js"),o=await r({kind:"scale",colour:t,svg:!1},{json:!0,colour:!1}),n=JSON.parse(o.stdout[0]??"{}");return{content:[{type:"text",text:n.scale.steps.map(i=>`${i.step} ${i.hex} white ${i.white} black ${i.black}`).join(`
|
|
73
73
|
`)}],structuredContent:{...n}}}function rR(e=process.platform){return[`Forge converts, compresses and edits files on this ${e==="win32"?"PC":"Mac"}, locally.`,"Every path must be absolute.","Call forge_probe first: it says what a file is, every format it can become, and every action that applies.","Nothing is overwritten unless you pass overwrite: true \u2014 only do that when the user asked to replace a file.","A failure hint that mentions --force means overwrite: true here; --output means the output argument; --password-stdin means the password argument."].join(" ")}var oR=rR(),nc={readOnlyHint:!0,openWorldHint:!1},ad={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1};function nR(){let e=new ec({name:"forge",version:ir},{instructions:oR});return e.registerTool("forge_probe",{title:"Inspect files",description:"What each file is and what Forge can do with it: format (read from content, not the extension), size, pages or dimensions, whether it is password-protected, every format it can become, and every action that applies. Writes nothing.",inputSchema:I_,outputSchema:A_,annotations:nc},t=>K_(t)),e.registerTool("forge_formats",{title:"List formats",description:"Every format Forge reads and writes. Writes nothing.",inputSchema:O_,outputSchema:q_,annotations:nc},()=>G_()),e.registerTool("forge_convert",{title:"Convert files",description:"Convert files to another format, beside each source unless output is given. A PDF becomes one image per page (choose pages and dpi); Word documents become PDF; images convert between formats; with trim or resize they keep their format unless `to` is given. Returns every output path and a file:// link to each.",inputSchema:N_,outputSchema:oc,annotations:ad},(t,r)=>W_(t,r.mcpReq.signal)),e.registerTool("forge_compress",{title:"Compress files",description:'Make files smaller without changing their format: by quality (1-100) or to fit a size such as "500kb". Writes <name>-small.<ext> beside the source unless output is given. A lossless format such as PNG cannot be compressed; convert it instead.',inputSchema:j_,outputSchema:oc,annotations:ad},t=>Y_(t)),e.registerTool("forge_pdf",{title:"PDF page operations",description:"merge (two or more PDFs, in order), split, extract, delete or rotate pages. Writes new files beside the source and never edits the original. Password-protected PDFs are refused.",inputSchema:x_,outputSchema:oc,annotations:ad},t=>X_(t)),e.registerTool("forge_palette",{title:"Colours of an image",description:"An image's main colours, most of the image first, each as hex, rgb and OKLCH with its share. With inside, the shades that one colour is made of. Writes nothing.",inputSchema:L_,outputSchema:Z_,annotations:nc},t=>Q_(t)),e.registerTool("forge_scale",{title:"Tonal scale",description:"A 50\u2013950 tonal scale built in OKLCH with the given colour at 500, each step with its contrast against white and black text. Writes nothing.",inputSchema:D_,outputSchema:U_,annotations:nc},t=>eS(t)),e}async function _T(e){if(e.length>0)throw mt(`forge mcp takes no arguments, got: ${e.join(" ")}.`,"Register it with your agent, for example: claude mcp add forge -- forge mcp");let t=V_();await nR().connect(new T_(process.stdin,t))}export{oR as INSTRUCTIONS,nR as createForgeServer,rR as instructionsFor,_T as runMcpServer};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v}from"./chunk-Z5PQWCG5.js";import"./chunk-TMUK2DD3.js";export{t as BAR,c as DARK,d as LIGHT,g as MODE_KEYS,j as MODE_MARKERS,f as MODE_ORDER,e as NEUTRAL,b as SYMBOLS,a as VERSION,v as applyColourPreference,u as colourEnabled,s as colourProp,o as commandsPalette,n as dotGradient,k as modeColours,i as modeForKey,l as modeGradient,p as modePalette,m as modeWash,q as paintsCanvas,r as paletteFor,h as tabStep};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{b as m,c as w,d as h,f as l,g as p,h as b}from"./chunk-YZG5A3GA.js";import{c as u,d as $}from"./chunk-
|
|
3
|
+
import{b as m,c as w,d as h,f as l,g as p,h as b}from"./chunk-YZG5A3GA.js";import{c as u,d as $}from"./chunk-Z5PQWCG5.js";import{e as g}from"./chunk-4L6HNYSN.js";import"./chunk-HON4OV7M.js";import"./chunk-TMUK2DD3.js";import{spawn as x}from"node:child_process";var P=60;function v(t,n){let e=Number.parseInt(t.slice(1),16);return`\x1B[${n};2;${e>>16&255};${e>>8&255};${e&255}m`}function C(t,n,e){let i=[" \u2191 ",`Forge ${t} is available`,` \xB7 your version ${n}`],r=[" In terminal: ","forge update"];if(e===void 0)return[i.join(""),r.join("")];let s=v(e.newTagBg,48),o=f=>v(f,38),c="\x1B[1m",a="\x1B[0m",d=f=>" ".repeat(Math.max(0,P-f.join("").length));return[`${s}${o(e.newTag)}${c}${i[0]}${o(e.fg)}${i[1]}${a}${s}${o(e.dim)}${i[2]}${d(i)}${a}`,`${s}${o(e.dim)}${r[0]}${o(e.fg)}${c}${r[1]}${a}${s}${d(r)}${a}`]}async function I(t,n){let e=n.now??Date.now(),{prefs:i}=await g();if(!h(i,n.env??process.env))return[];let r=await l();b(r,e)&&n.refresh();let s=r?.latest;if(r===void 0||s===void 0||!w(s,t))return[];let o=r.notifiedAt;if(o!==void 0&&o<=e&&e-o<=m)return[];await p({...r,notifiedAt:e}).catch(()=>{});let c=n.colour?i.theme==="light"?$:u:void 0;return C(s,t,c)}function N(t,n=process.platform,e=x){if(t!==void 0)try{e(process.execPath,[...process.execArgv,t,"__update-check"],{detached:!0,stdio:"ignore",...n==="win32"?{windowsHide:!0}:{}}).unref()}catch{}}export{I as afterCommand,C as noteLines,N as spawnRefresh};
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
3
3
|
const require = __forgeCreateRequire(import.meta.url);
|
|
4
|
-
import{b as W,d as B}from"./chunks/chunk-IBPGC4N2.js";import{a as U}from"./chunks/chunk-QVACE4IE.js";import{h as j}from"./chunks/chunk-M6LD6DHO.js";import{d as G}from"./chunks/chunk-VNAIHACR.js";import"./chunks/chunk-LI2JPLF7.js";import{a as X}from"./chunks/chunk-775ILWZI.js";import"./chunks/chunk-OIZCRBLT.js";import{a as y}from"./chunks/chunk-
|
|
4
|
+
import{b as W,d as B}from"./chunks/chunk-IBPGC4N2.js";import{a as U}from"./chunks/chunk-QVACE4IE.js";import{h as j}from"./chunks/chunk-M6LD6DHO.js";import{d as G}from"./chunks/chunk-VNAIHACR.js";import"./chunks/chunk-LI2JPLF7.js";import{a as X}from"./chunks/chunk-775ILWZI.js";import"./chunks/chunk-OIZCRBLT.js";import{a as y}from"./chunks/chunk-Z5PQWCG5.js";import{a as D}from"./chunks/chunk-Q45MSMTN.js";import{I as d,L as P,ca as K,da as T,e as J,g as E}from"./chunks/chunk-E5QDHFKQ.js";import{d as Y}from"./chunks/chunk-J7FLFHQJ.js";import"./chunks/chunk-4L6HNYSN.js";import"./chunks/chunk-HON4OV7M.js";import"./chunks/chunk-TMUK2DD3.js";import*as ae from"node:module";var w=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},C=class extends w{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var $=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new C(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function H(s){let e=s.name()+(s.variadic===!0?"...":"");return s.required?"<"+e+">":"["+e+"]"}import{EventEmitter as de}from"node:events";import q from"node:child_process";import O from"node:path";import V from"node:fs";import g from"node:process";import{stripVTControlCharacters as fe}from"node:util";import{stripVTControlCharacters as he}from"node:util";var S=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((i,r)=>i.name().localeCompare(r.name())),t}compareOptions(e,t){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),r=n.long&&e._findOption(n.long);!i&&!r?t.push(n):n.long&&!r?t.push(e.createOption(n.long,n.description)):n.short&&!i&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(r=>!r.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>H(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(i)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(i)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,""]}groupItems(e,t,n){let i=new Map;return e.forEach(r=>{let o=n(r);i.has(o)||i.set(o,[])}),t.forEach(r=>{let o=n(r);i.has(o)||i.set(o,[]),i.get(o).push(r)}),i}formatHelp(e,t){let n=t.padWidth(e,t),i=t.helpWidth??80;function r(a,p){return t.formatItem(a,n,p,t)}let o=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],u=t.commandDescription(e);u.length>0&&(o=o.concat([t.boxWrap(t.styleCommandDescription(u),i),""]));let h=t.visibleArguments(e).map(a=>r(t.styleArgumentTerm(t.argumentTerm(a)),t.styleArgumentDescription(t.argumentDescription(a))));if(o=o.concat(this.formatItemList("Arguments:",h,t)),this.groupItems(e.options,t.visibleOptions(e),a=>a.helpGroupHeading??"Options:").forEach((a,p)=>{let f=a.map(m=>r(t.styleOptionTerm(t.optionTerm(m)),t.styleOptionDescription(t.optionDescription(m))));o=o.concat(this.formatItemList(p,f,t))}),t.showGlobalOptions){let a=t.visibleGlobalOptions(e).map(p=>r(t.styleOptionTerm(t.optionTerm(p)),t.styleOptionDescription(t.optionDescription(p))));o=o.concat(this.formatItemList("Global Options:",a,t))}return this.groupItems(e.commands,t.visibleCommands(e),a=>a.helpGroup()||"Commands:").forEach((a,p)=>{let f=a.map(m=>r(t.styleSubcommandTerm(t.subcommandTerm(m)),t.styleSubcommandDescription(t.subcommandDescription(m))));o=o.concat(this.formatItemList(p,f,t))}),o.join(`
|
|
5
5
|
`)}displayWidth(e){return he(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,i){let o=" ".repeat(2);if(!n)return o+e;let u=e.padEnd(t+e.length-i.displayWidth(e)),h=2,l=(this.helpWidth??80)-t-h-2,a;return l<this.minWidthToWrap||i.preformatted(n)?a=n:a=i.boxWrap(n,l).replace(/\n/g,`
|
|
6
6
|
`+" ".repeat(t+h)),o+u+" ".repeat(h)+a.replace(/\n/g,`
|
|
7
7
|
${o}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,r=[];return n.forEach(o=>{let u=o.match(i);if(u===null){r.push("");return}let h=[u.shift()],c=this.displayWidth(h[0]);u.forEach(l=>{let a=this.displayWidth(l);if(c+a<=t){h.push(l),c+=a;return}r.push(h.join(""));let p=l.trimStart();h=[p],c=this.displayWidth(p)}),r.push(h.join(""))}),r.join(`
|
|
@@ -53,14 +53,14 @@ An image's main colours, most of the image first.
|
|
|
53
53
|
${be}`).configureOutput({outputError:()=>{}}).exitOverride().allowExcessArguments(!1);try{t.parse(s,{from:"user"})}catch(f){if(f instanceof w&&f.code!=="commander.helpDisplayed"&&f.code!=="commander.version"){let[m="",..._]=f.message.replace(/^error: /,"").split(`
|
|
54
54
|
`),b=_.join(" ").trim().replace(/^\((.*)\)\.?$/,"$1");throw d(`${m.charAt(0).toUpperCase()}${m.slice(1).replace(/\.$/,"")}.`,b||"Run forge --help to see what Forge accepts.")}throw f}let n=t.opts(),i=t.args;if(n.formats)return{kind:"formats"};if(n.pages!==void 0&&n.to===void 0)throw d("--pages needs --to: it chooses which pages to render.");let r=["merge","split","extract","delete","rotate"].filter(f=>n[f]!==void 0);if(r.length>1)throw d(`Use one operation at a time \u2014 got ${r.map(f=>`--${f}`).join(" and ")}.`);let o=[...n.sharpen?["--sharpen"]:[],...e!==void 0?["--boost"]:[],...n.removeBg?["--remove-bg"]:[]],u=[...n.resize!==void 0?["--resize"]:[],...n.width!==void 0?["--width"]:[],...n.height!==void 0?["--height"]:[]];if(n.trim||u.length>0){if(u.length>1)throw d(`Use one of --resize, --width and --height \u2014 got ${u.join(" and ")}.`);let f=[...o,...n.maxSize!==void 0?["--max-size"]:[],...n.pages!==void 0?["--pages"]:[],...r.map(x=>`--${x}`)][0];if(f!==void 0)throw d(`${u[0]??"--trim"} cannot be combined with ${f}.`,f==="--max-size"?"Resize first, then compress the result: forge photo-1200x900.jpg --max-size 500kb":"Run them one after the other.");let m=n.resize!==void 0?{percent:_e(n.resize)}:n.width!==void 0?{width:te("--width",n.width)}:n.height!==void 0?{height:te("--height",n.height)}:void 0;if(i.length===0)throw d("No files given.","Name an image, for example: forge photo.jpg --resize 50%");let _={background:String(n.background),keepMetadata:!!n.keepMetadata};n.quality!==void 0&&(_.quality=N(String(n.quality)));let b={kind:"edit",inputs:i,trim:!!n.trim,options:_,force:!!n.force,recursive:!!n.recursive,debug:!!n.debug};return m!==void 0&&(b.resize=m),n.to&&(b.target=z(String(n.to))),n.output!==void 0&&(b.output=String(n.output)),n.concurrency!==void 0&&(b.concurrency=F(String(n.concurrency))),b}let h=n.sharpen?1:e,c=h!==void 0?"boost":n.removeBg?"remove-background":null;if(c!==null){if(o.length>1)throw d(`Use one operation at a time \u2014 got ${o.join(" and ")}.`);let f=o[0];if(r.length>0)throw d(`${f} cannot be combined with --${r[0]}.`);if(n.maxSize!==void 0||n.pages!==void 0)throw d(`${f} cannot be combined with ${n.maxSize!==void 0?"--max-size":"--pages"}.`);if(i.length===0)throw d("No files given.",`Name an image, for example: forge photo.jpg ${f}`);let m=n.to?z(String(n.to)):"png";if(c==="remove-background"){let x=X(m);if(x)throw x}let _={background:String(n.background),keepMetadata:!!n.keepMetadata};n.quality!==void 0&&(_.quality=N(String(n.quality)));let b={kind:"extension-op",op:c,inputs:i,target:m,options:_,force:!!n.force,recursive:!!n.recursive,debug:!!n.debug};return h!==void 0&&(b.scale=h),n.output!==void 0&&(b.output=String(n.output)),n.concurrency!==void 0&&(b.concurrency=F(String(n.concurrency))),b}if(r.length===1){let f=r[0];if(i.length===0)throw d("No files given.",`Name a PDF, for example: forge doc.pdf --${f}`);if(n.separate&&f!=="extract")throw d(`--separate only applies to --extract, not --${f}.`);if(n.output!==void 0)throw d(`--output does not apply to --${f}.`,"Page operations name their own outputs, beside the source. Rename the result afterwards.");let m={kind:"pageop",action:f,inputs:i,force:!!n.force,debug:!!n.debug};if(f==="rotate"){let _=Number(n.rotate);if(!Number.isInteger(_)||_%90!==0||_===0||_>=360)throw d(`--rotate takes a multiple of 90 below 360, not "${n.rotate}".`);m.rotate=_}if((f==="extract"||f==="delete")&&(m.pages=String(n[f]),f==="extract"&&n.separate&&(m.separate=!0)),f==="split"){let _=String(n.split),b=_.match(/^every=(\d+)$/),x=_.match(/^at=([\d,\s]+)$/);if(_==="every-page")m.split={mode:"every-page"};else if(b?.[1]!==void 0){let k=Number(b[1]);if(!Number.isInteger(k)||k<1)throw d(`--split every=N takes a whole number of pages, at least 1, not "${b[1]}".`);m.split={mode:"every-n",n:k}}else if(x?.[1])m.split={mode:"points",after:x[1].split(",").map(k=>Number(k.trim()))};else throw d(`--split takes every-page, every=N or at=N,N \u2014 not "${_}".`)}return m}if(i.length===0&&!n.to&&n.quality===void 0&&n.maxSize===void 0)return{kind:"shell"};if(n.quality!==void 0&&n.maxSize!==void 0)throw d("Use either --quality or --max-size, not both.","They are two ways of asking for the same thing, and Forge will not guess which wins.");if(!n.to&&(n.quality!==void 0||n.maxSize!==void 0)){if(i.length===0)throw d("No files given.","Name a file, for example: forge photo.jpg --max-size 500kb");let f={background:String(n.background),keepMetadata:!!n.keepMetadata},m={kind:"compress",inputs:i,options:f,force:!!n.force,recursive:!!n.recursive,debug:!!n.debug};if(n.quality!==void 0&&(m.quality=N(String(n.quality))),n.maxSize!==void 0&&(m.maxBytes=ne(n.maxSize)),n.output!==void 0&&(m.output=String(n.output)),t.getOptionValueSource("dpi")==="cli"){let _=Number(n.dpi);if(!Number.isInteger(_)||_<36||_>600)throw P(n.dpi);m.dpi=_}return n.concurrency!==void 0&&(m.concurrency=F(String(n.concurrency))),m}if(!n.to)throw d("No target format given.","Add --to <format>, for example: forge photo.jpg --to webp");if(i.length===0)throw d("No files given.","Name a file, a folder or a glob, for example: forge photo.jpg --to webp");let l={background:String(n.background),keepMetadata:!!n.keepMetadata};n.quality!==void 0&&(l.quality=N(String(n.quality)));let a=Number(n.dpi);if(!Number.isInteger(a)||a<36||a>600)throw P(n.dpi);let p={kind:"convert",inputs:i,target:z(String(n.to)),options:l,force:!!n.force,recursive:!!n.recursive,debug:!!n.debug,dpi:a,passwordStdin:!!n.passwordStdin};return n.output!==void 0&&(p.output=String(n.output)),n.pages!==void 0&&(p.pages=String(n.pages)),n.maxSize!==void 0&&(p.maxBytes=ne(n.maxSize)),n.concurrency!==void 0&&(p.concurrency=F(String(n.concurrency))),p}function L(s){return E(s)?s:K(s)}function oe(s,e){return T(L(s),{debug:e})}function se(s,e){process.once("beforeExit",()=>{s()||(e(new Error("Forge stopped before it finished: it was waiting for input that never came.")),process.exitCode=1)})}ae.enableCompileCache?.();function $e({completed:s,total:e}){s===0?process.stderr.write(`Converting ${e} files
|
|
55
55
|
`):process.stderr.write(` ${s}/${e}
|
|
56
|
-
`)}async function Se(){let s=process.argv.slice(2),e=s.includes("--debug"),t=R(s);try{if(s[0]==="__update-check"){let{checkNow:a}=await import("./chunks/check-DN7SEN44.js");await a();return}if(s[0]==="mcp"){let{runMcpServer:a}=await import("./chunks/server-
|
|
56
|
+
`)}async function Se(){let s=process.argv.slice(2),e=s.includes("--debug"),t=R(s);try{if(s[0]==="__update-check"){let{checkNow:a}=await import("./chunks/check-DN7SEN44.js");await a();return}if(s[0]==="mcp"){let{runMcpServer:a}=await import("./chunks/server-ETHSTOP6.js");await a(s.slice(1));return}let n=re(s);if(n.kind==="shell"){if(t)throw d("No files given.","Name a file, for example: forge photo.jpg --to webp --json");if(!process.stdout.isTTY||!process.stdin.isTTY){process.stderr.write(`Forge needs a file and a target format.
|
|
57
57
|
Try: forge photo.jpg --to webp
|
|
58
|
-
`),process.exitCode=2;return}let{applyColourPreference:a}=await import("./chunks/theme-
|
|
58
|
+
`),process.exitCode=2;return}let{applyColourPreference:a}=await import("./chunks/theme-TYCKAIEA.js");a();let{bootShell:p}=await import("./chunks/boot-3M2WUSSL.js");await p();return}let{execute:i}=await import("./chunks/execute-BRPAGFUR.js"),r,o=0,u=(a,p)=>{let f=Date.now();if(a<p&&f-o<100)return;o=f;let m=_=>(_/1e6).toFixed(1);process.stderr.write(`\r downloading ${m(a)} / ${m(p)} MB${a>=p?`
|
|
59
59
|
`:""}`)},h=!!process.stderr.isTTY&&!t,c=new AbortController;n.kind==="extension-op"&&process.once("SIGINT",()=>c.abort());let l=await i(n,{json:t,...h?{onInstalling:a=>{r=W(process.stderr,`installing Forge ${a}`)}}:{},signal:c.signal,...h?{onDownload:u}:{},colour:!!process.stdout.isTTY&&!t&&B(),onProgress:h?a=>{a.completed>0&&r?.stop(),$e(a)}:void 0,...h?{onSearch:a=>{r??=W(process.stderr,"finding the smallest that fits"),r.update(a)}}:{}});if(r?.stop(),l.stdout.length>0&&process.stdout.write(`${l.stdout.join(`
|
|
60
60
|
`)}
|
|
61
61
|
`),l.stderr.length>0&&process.stderr.write(`${l.stderr.join(`
|
|
62
62
|
`)}
|
|
63
|
-
`),process.exitCode=c.signal.aborted?130:l.exitCode,h&&process.stdout.isTTY&&n.kind!=="update")try{let{afterCommand:a,spawnRefresh:p}=await import("./chunks/update-note-
|
|
63
|
+
`),process.exitCode=c.signal.aborted?130:l.exitCode,h&&process.stdout.isTTY&&n.kind!=="update")try{let{afterCommand:a,spawnRefresh:p}=await import("./chunks/update-note-ES7TWSUT.js"),{runningScript:f}=await import("./chunks/install-HCF5BIA6.js"),m=await a(y,{refresh:()=>p(f(process.argv[1])),colour:B()});m.length>0&&process.stderr.write(`
|
|
64
64
|
${m.join(`
|
|
65
65
|
`)}
|
|
66
66
|
`)}catch{}}catch(n){if(E(n)){t?process.stdout.write(`${JSON.stringify(G(y,n))}
|