xmcp 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +53 -60
- package/dist/config/index.d.ts +5 -5
- package/dist/config/schemas/experimental/index.d.ts +4 -4
- package/dist/config.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +59 -66
- package/dist/runtime/adapter-express.js +83 -88
- package/dist/runtime/adapter-fastify.js +83 -88
- package/dist/runtime/adapter-fetch-cloudflare.js +235 -0
- package/dist/runtime/adapter-fetch.js +239 -0
- package/dist/runtime/adapter-nestjs.js +83 -88
- package/dist/runtime/adapter-nextjs.js +82 -87
- package/dist/runtime/cloudflare-worker.js +87 -92
- package/dist/runtime/http.js +92 -97
- package/dist/runtime/stdio.js +71 -76
- package/dist/runtime/vercel.js +92 -97
- package/package.json +1 -1
- package/dist/runtime/adapter-tanstack-cloudflare.js +0 -240
- package/dist/runtime/adapter-tanstack.js +0 -244
package/dist/index.js
CHANGED
|
@@ -1,83 +1,76 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("zod/v3"));else if("function"==typeof define&&define.amd)define(["zod/v3"],t);else{var r="object"==typeof exports?t(require("zod/v3")):t(e["zod/v3"]);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,e=>(()=>{var t,r,o={9454(e,t,r){"use strict";var o=r(181).Buffer,a=r(181).SlowBuffer;function i(e,t){if(!o.isBuffer(e)||!o.isBuffer(t)||e.length!==t.length)return!1;for(var r=0,a=0;a<e.length;a++)r|=e[a]^t[a];return 0===r}e.exports=i,i.install=function(){o.prototype.equal=a.prototype.equal=function(e){return i(this,e)}};var s=o.prototype.equal,n=a.prototype.equal;i.restore=function(){o.prototype.equal=s,a.prototype.equal=n}},6507(e,t,r){"use strict";let o=r(5317),a=r(8388),i=r(442);function s(e,t,r){let s=a(e,t,r),n=o.spawn(s.command,s.args,s.options);return i.hookChildProcess(n,s),n}e.exports=s,e.exports.spawn=s,e.exports.sync=function(e,t,r){let s=a(e,t,r),n=o.spawnSync(s.command,s.args,s.options);return n.error=n.error||i.verifyENOENTSync(n.status,s),n},e.exports._parse=a,e.exports._enoent=i},442(e){"use strict";let t="win32"===process.platform;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function o(e,o){return t&&1===e&&!o.file?r(o.original,"spawn"):null}e.exports={hookChildProcess:function(e,r){if(!t)return;let a=e.emit;e.emit=function(t,i){if("exit"===t){let t=o(i,r);if(t)return a.call(e,"error",t)}return a.apply(e,arguments)}},verifyENOENT:o,verifyENOENTSync:function(e,o){return t&&1===e&&!o.file?r(o.original,"spawnSync"):null},notFoundError:r}},8388(e,t,r){"use strict";let o=r(6928),a=r(3803),i=r(2077),s=r(1880),n="win32"===process.platform,l=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;e.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);let u={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?u:function(e){let t;if(!n)return e;let r=(e.file=a(e),(t=e.file&&s(e.file))?(e.args.unshift(e.file),e.command=t,a(e)):e.file),u=!l.test(r);if(e.options.forceShell||u){let t=c.test(r);e.command=o.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,t));let a=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${a}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}(u)}},2077(e){"use strict";let t=/([()\][%!^"`<>&|;, *?])/g;e.exports.command=function(e){return e.replace(t,"^$1")},e.exports.argument=function(e,r){return e=(e=(e=`${e}`).replace(/(?=(\\+?)?)\1"/g,'$1$1\\"')).replace(/(?=(\\+?)?)\1$/,"$1$1"),e=(e=`"${e}"`).replace(t,"^$1"),r&&(e=e.replace(t,"^$1")),e}},1880(e,t,r){"use strict";let o=r(9896),a=r(600);e.exports=function(e){let t,r=Buffer.alloc(150);try{t=o.openSync(e,"r"),o.readSync(t,r,0,150,0),o.closeSync(t)}catch(e){}return a(r.toString())}},3803(e,t,r){"use strict";let o=r(6928),a=r(1905),i=r(9695);function s(e,t){let r,s=e.options.env||process.env,n=process.cwd(),l=null!=e.options.cwd,c=l&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch(e){}try{r=a.sync(e.command,{path:s[i({env:s})],pathExt:t?o.delimiter:void 0})}catch(e){}finally{c&&process.chdir(n)}return r&&(r=o.resolve(l?e.options.cwd:"",r)),r}e.exports=function(e){return s(e)||s(e,!0)}},8583(e,t,r){let o=r(9896),a=r(6928),i=r(857),s=r(6982),n=r(4519).version,l=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function c(e){console.log(`[dotenv@${n}][DEBUG] ${e}`)}function u(e){console.log(`[dotenv@${n}] ${e}`)}function d(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function p(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)o.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=a.resolve(process.cwd(),".env.vault");return o.existsSync(t)?t:null}function h(e){return"~"===e[0]?a.join(i.homedir(),e.slice(1)):e}let f={configDotenv:function(e){let t,r=a.resolve(process.cwd(),".env"),i="utf8",s=!!(e&&e.debug),n=!e||!("quiet"in e)||e.quiet;e&&e.encoding?i=e.encoding:s&&c("No encoding is specified. UTF-8 is used by default");let l=[r];if(e&&e.path)if(Array.isArray(e.path))for(let t of(l=[],e.path))l.push(h(t));else l=[h(e.path)];let d={};for(let r of l)try{let t=f.parse(o.readFileSync(r,{encoding:i}));f.populate(d,t,e)}catch(e){s&&c(`Failed to load ${r} ${e.message}`),t=e}let p=process.env;if(e&&null!=e.processEnv&&(p=e.processEnv),f.populate(p,d,e),s||!n){let e=Object.keys(d).length,r=[];for(let e of l)try{let t=a.relative(process.cwd(),e);r.push(t)}catch(r){s&&c(`Failed to load ${e} ${r.message}`),t=r}u(`injecting env (${e}) from ${r.join(",")}`)}return t?{parsed:d,error:t}:{parsed:d}},_configVault:function(e){let t=!!(e&&e.debug),r=!e||!("quiet"in e)||e.quiet;(t||!r)&&u("Loading env from encrypted .env.vault");let o=f._parseVault(e),a=process.env;return e&&null!=e.processEnv&&(a=e.processEnv),f.populate(a,o,e),{parsed:o}},_parseVault:function(e){let t,r=p(e=e||{});e.path=r;let o=f.configDotenv(e);if(!o.parsed){let e=Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);throw e.code="MISSING_DATA",e}let a=d(e).split(","),i=a.length;for(let e=0;e<i;e++)try{let r=a[e].trim(),i=function(e,t){let r;try{r=new URL(t)}catch(e){if("ERR_INVALID_URL"===e.code){let e=Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw e.code="INVALID_DOTENV_KEY",e}throw e}let o=r.password;if(!o){let e=Error("INVALID_DOTENV_KEY: Missing key part");throw e.code="INVALID_DOTENV_KEY",e}let a=r.searchParams.get("environment");if(!a){let e=Error("INVALID_DOTENV_KEY: Missing environment part");throw e.code="INVALID_DOTENV_KEY",e}let i=`DOTENV_VAULT_${a.toUpperCase()}`,s=e.parsed[i];if(!s){let e=Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${i} in your .env.vault file.`);throw e.code="NOT_FOUND_DOTENV_ENVIRONMENT",e}return{ciphertext:s,key:o}}(o,r);t=f.decrypt(i.ciphertext,i.key);break}catch(t){if(e+1>=i)throw t}return f.parse(t)},config:function(e){if(0===d(e).length)return f.configDotenv(e);let t=p(e);if(!t){var r;return r=`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`,console.log(`[dotenv@${n}][WARN] ${r}`),f.configDotenv(e)}return f._configVault(e)},decrypt:function(e,t){let r=Buffer.from(t.slice(-64),"hex"),o=Buffer.from(e,"base64"),a=o.subarray(0,12),i=o.subarray(-16);o=o.subarray(12,-16);try{let e=s.createDecipheriv("aes-256-gcm",r,a);return e.setAuthTag(i),`${e.update(o)}${e.final()}`}catch(o){let e=o instanceof RangeError,t="Invalid key length"===o.message,r="Unsupported state or unable to authenticate data"===o.message;if(e||t){let e=Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw e.code="INVALID_DOTENV_KEY",e}if(r){let e=Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw e.code="DECRYPTION_FAILED",e}throw o}},parse:function(e){let t,r={},o=e.toString();for(o=o.replace(/\r\n?/mg,"\n");null!=(t=l.exec(o));){let e=t[1],o=t[2]||"",a=(o=o.trim())[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),'"'===a&&(o=(o=o.replace(/\\n/g,"\n")).replace(/\\r/g,"\r")),r[e]=o}return r},populate:function(e,t,r={}){let o=!!(r&&r.debug),a=!!(r&&r.override);if("object"!=typeof t){let e=Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw e.code="OBJECT_REQUIRED",e}for(let r of Object.keys(t))Object.prototype.hasOwnProperty.call(e,r)?(!0===a&&(e[r]=t[r]),o&&(!0===a?c(`"${r}" is already defined and WAS overwritten`):c(`"${r}" is already defined and was NOT overwritten`))):e[r]=t[r]}};e.exports.configDotenv=f.configDotenv,e.exports._configVault=f._configVault,e.exports._parseVault=f._parseVault,e.exports.config=f.config,e.exports.decrypt=f.decrypt,e.exports.parse=f.parse,e.exports.populate=f.populate,e.exports=f},9053(e,t,r){"use strict";var o=r(6608).Buffer,a=r(2188);function i(e){if(o.isBuffer(e))return e;if("string"==typeof e)return o.from(e,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function s(e,t,r){for(var o=0;t+o<r&&0===e[t+o];)++o;return e[t+o]>=128&&--o,o}e.exports={derToJose:function(e,t){e=i(e);var r=a(t),s=r+1,n=e.length,l=0;if(48!==e[l++])throw Error('Could not find expected "seq"');var c=e[l++];if(129===c&&(c=e[l++]),n-l<c)throw Error('"seq" specified length of "'+c+'", only "'+(n-l)+'" remaining');if(2!==e[l++])throw Error('Could not find expected "int" for "r"');var u=e[l++];if(n-l-2<u)throw Error('"r" specified length of "'+u+'", only "'+(n-l-2)+'" available');if(s<u)throw Error('"r" specified length of "'+u+'", max of "'+s+'" is acceptable');var d=l;if(l+=u,2!==e[l++])throw Error('Could not find expected "int" for "s"');var p=e[l++];if(n-l!==p)throw Error('"s" specified length of "'+p+'", expected "'+(n-l)+'"');if(s<p)throw Error('"s" specified length of "'+p+'", max of "'+s+'" is acceptable');var h=l;if((l+=p)!==n)throw Error('Expected to consume entire buffer, but "'+(n-l)+'" bytes remain');var f=r-u,m=r-p,y=o.allocUnsafe(f+u+m+p);for(l=0;l<f;++l)y[l]=0;e.copy(y,l,d+Math.max(-f,0),d+u),l=r;for(var g=l;l<g+m;++l)y[l]=0;return e.copy(y,l,h+Math.max(-m,0),h+p),y=(y=y.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(e,t){e=i(e);var r=a(t),n=e.length;if(n!==2*r)throw TypeError('"'+t+'" signatures must be "'+2*r+'" bytes, saw "'+n+'"');var l=s(e,0,r),c=s(e,r,e.length),u=r-l,d=r-c,p=2+u+1+1+d,h=p<128,f=o.allocUnsafe((h?2:3)+p),m=0;return f[m++]=48,h?f[m++]=p:(f[m++]=129,f[m++]=255&p),f[m++]=2,f[m++]=u,l<0?(f[m++]=0,m+=e.copy(f,m,0,r)):m+=e.copy(f,m,l,r),f[m++]=2,f[m++]=d,c<0?(f[m++]=0,e.copy(f,m,r)):e.copy(f,m,r+c),f}}},2188(e){"use strict";function t(e){return(e/8|0)+ +(e%8!=0)}var r={ES256:t(256),ES384:t(384),ES512:t(521)};e.exports=function(e){var t=r[e];if(t)return t;throw Error('Unknown algorithm "'+e+'"')}},9344(e,t,r){var o;function a(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw TypeError("callback not provided");return new Promise(function(r,o){a(e,t||{},function(e,t){e?o(e):r(t)})})}o(e,t||{},function(e,o){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,o=!1),r(e,o)})}r(9896),o="win32"===process.platform||global.TESTING_WINDOWS?r(8541):r(709),e.exports=a,a.sync=function(e,t){try{return o.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}},709(e,t,r){e.exports=a,a.sync=function(e,t){return i(o.statSync(e),t)};var o=r(9896);function a(e,t,r){o.stat(e,function(e,o){r(e,!e&&i(o,t))})}function i(e,t){var r,o,a,i,s,n,l,c,u;return e.isFile()&&(r=e,o=t,a=r.mode,i=r.uid,s=r.gid,n=void 0!==o.uid?o.uid:process.getuid&&process.getuid(),l=void 0!==o.gid?o.gid:process.getgid&&process.getgid(),c=parseInt("100",8),u=parseInt("010",8),a&parseInt("001",8)||a&u&&s===l||a&c&&i===n||a&(c|u)&&0===n)}},8541(e,t,r){e.exports=i,i.sync=function(e,t){return a(o.statSync(e),e,t)};var o=r(9896);function a(e,t,r){if(!e.isSymbolicLink()&&!e.isFile())return!1;var o=void 0!==r.pathExt?r.pathExt:process.env.PATHEXT;if(!o||-1!==(o=o.split(";")).indexOf(""))return!0;for(var a=0;a<o.length;a++){var i=o[a].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,r){o.stat(e,function(o,i){r(o,!o&&a(i,e,t))})}},2548(e,t,r){var o=r(3263);e.exports=function(e,t){t=t||{};var r=o.decode(e,t);if(!r)return null;var a=r.payload;if("string"==typeof a)try{var i=JSON.parse(a);null!==i&&"object"==typeof i&&(a=i)}catch(e){}return!0===t.complete?{header:r.header,payload:a,signature:r.signature}:a}},8400(e,t,r){e.exports={decode:r(2548),verify:r(6467),sign:r(9147),JsonWebTokenError:r(1957),NotBeforeError:r(4470),TokenExpiredError:r(7788)}},1957(e){var t=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e.exports=t},4470(e,t,r){var o=r(1957),a=function(e,t){o.call(this,e),this.name="NotBeforeError",this.date=t};a.prototype=Object.create(o.prototype),a.prototype.constructor=a,e.exports=a},7788(e,t,r){var o=r(1957),a=function(e,t){o.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};a.prototype=Object.create(o.prototype),a.prototype.constructor=a,e.exports=a},5841(e,t,r){e.exports=r(3895).satisfies(process.version,">=15.7.0")},953(e,t,r){e.exports=r(3895).satisfies(process.version,"^6.12.0 || >=8.0.0")},455(e,t,r){e.exports=r(3895).satisfies(process.version,">=16.9.0")},4559(e,t,r){var o=r(3866);e.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if("string"==typeof e){var a=o(e);if(void 0===a)return;return Math.floor(r+a/1e3)}if("number"==typeof e)return r+e}},723(e,t,r){let o=r(5841),a=r(455),i={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},s={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};e.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let n=i[r];if(!n)throw Error(`Unknown key type "${r}".`);if(!n.includes(e))throw Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(o)switch(r){case"ec":let l=t.asymmetricKeyDetails.namedCurve,c=s[e];if(l!==c)throw Error(`"alg" parameter "${e}" requires curve "${c}".`);break;case"rsa-pss":if(a){let r=parseInt(e.slice(-3),10),{hashAlgorithm:o,mgf1HashAlgorithm:a,saltLength:i}=t.asymmetricKeyDetails;if(o!==`sha${r}`||a!==o)throw Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(void 0!==i&&i>r>>3)throw Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}}}},9147(e,t,r){let o=r(4559),a=r(953),i=r(723),s=r(3263),n=r(5357),l=r(6782),c=r(5250),u=r(8094),d=r(6052),p=r(1251),h=r(8430),{KeyObject:f,createSecretKey:m,createPrivateKey:y}=r(6982),g=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];a&&g.splice(3,0,"PS256","PS384","PS512");let v={expiresIn:{isValid:function(e){return c(e)||p(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return c(e)||p(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return p(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:n.bind(null,g),message:'"algorithm" must be a valid string enum value'},header:{isValid:d,message:'"header" must be an object'},encoding:{isValid:p,message:'"encoding" must be a string'},issuer:{isValid:p,message:'"issuer" must be a string'},subject:{isValid:p,message:'"subject" must be a string'},jwtid:{isValid:p,message:'"jwtid" must be a string'},noTimestamp:{isValid:l,message:'"noTimestamp" must be a boolean'},keyid:{isValid:p,message:'"keyid" must be a string'},mutatePayload:{isValid:l,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:l,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:l,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},b={iat:{isValid:u,message:'"iat" should be a number of seconds'},exp:{isValid:u,message:'"exp" should be a number of seconds'},nbf:{isValid:u,message:'"nbf" should be a number of seconds'}};function _(e,t,r,o){if(!d(r))throw Error('Expected "'+o+'" to be a plain object.');Object.keys(r).forEach(function(a){let i=e[a];if(!i){if(!t)throw Error('"'+a+'" is not allowed in "'+o+'"');return}if(!i.isValid(r[a]))throw Error(i.message)})}let S={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},$=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];e.exports=function(e,t,r,a){var n,l;"function"==typeof r?(a=r,r={}):r=r||{};let c="object"==typeof e&&!Buffer.isBuffer(e),u=Object.assign({alg:r.algorithm||"HS256",typ:c?"JWT":void 0,kid:r.keyid},r.header);function d(e){if(a)return a(e);throw e}if(!t&&"none"!==r.algorithm)return d(Error("secretOrPrivateKey must have a value"));if(null!=t&&!(t instanceof f))try{t=y(t)}catch(e){try{t=m("string"==typeof t?Buffer.from(t):t)}catch(e){return d(Error("secretOrPrivateKey is not valid key material"))}}if(u.alg.startsWith("HS")&&"secret"!==t.type)return d(Error(`secretOrPrivateKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)){if("private"!==t.type)return d(Error(`secretOrPrivateKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInsecureKeySizes&&!u.alg.startsWith("ES")&&void 0!==t.asymmetricKeyDetails&&t.asymmetricKeyDetails.modulusLength<2048)return d(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`))}if(void 0===e)return d(Error("payload is required"));if(c){try{n=e,_(b,!0,n,"payload")}catch(e){return d(e)}r.mutatePayload||(e=Object.assign({},e))}else{let t=$.filter(function(e){return void 0!==r[e]});if(t.length>0)return d(Error("invalid "+t.join(",")+" option for "+typeof e+" payload"))}if(void 0!==e.exp&&void 0!==r.expiresIn)return d(Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(void 0!==e.nbf&&void 0!==r.notBefore)return d(Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{l=r,_(v,!1,l,"options")}catch(e){return d(e)}if(!r.allowInvalidAsymmetricKeyTypes)try{i(u.alg,t)}catch(e){return d(e)}let p=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:c&&(e.iat=p),void 0!==r.notBefore){try{e.nbf=o(r.notBefore,p)}catch(e){return d(e)}if(void 0===e.nbf)return d(Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(void 0!==r.expiresIn&&"object"==typeof e){try{e.exp=o(r.expiresIn,p)}catch(e){return d(e)}if(void 0===e.exp)return d(Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(S).forEach(function(t){let o=S[t];if(void 0!==r[t]){if(void 0!==e[o])return d(Error('Bad "options.'+t+'" option. The payload already has an "'+o+'" property.'));e[o]=r[t]}});let g=r.encoding||"utf8";if("function"==typeof a)a=a&&h(a),s.createSign({header:u,privateKey:t,payload:e,encoding:g}).once("error",a).once("done",function(e){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&e.length<256)return a(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`));a(null,e)});else{let o=s.sign({header:u,payload:e,secret:t,encoding:g});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&o.length<256)throw Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`);return o}}},6467(e,t,r){let o=r(1957),a=r(4470),i=r(7788),s=r(2548),n=r(4559),l=r(723),c=r(953),u=r(3263),{KeyObject:d,createSecretKey:p,createPublicKey:h}=r(6982),f=["RS256","RS384","RS512"],m=["ES256","ES384","ES512"],y=["RS256","RS384","RS512"],g=["HS256","HS384","HS512"];c&&(f.splice(f.length,0,"PS256","PS384","PS512"),y.splice(y.length,0,"PS256","PS384","PS512")),e.exports=function(e,t,r,c){let v,b,_;if("function"!=typeof r||c||(c=r,r={}),r||(r={}),r=Object.assign({},r),v=c||function(e,t){if(e)throw e;return t},r.clockTimestamp&&"number"!=typeof r.clockTimestamp)return v(new o("clockTimestamp must be a number"));if(void 0!==r.nonce&&("string"!=typeof r.nonce||""===r.nonce.trim()))return v(new o("nonce must be a non-empty string"));if(void 0!==r.allowInvalidAsymmetricKeyTypes&&"boolean"!=typeof r.allowInvalidAsymmetricKeyTypes)return v(new o("allowInvalidAsymmetricKeyTypes must be a boolean"));let S=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return v(new o("jwt must be provided"));if("string"!=typeof e)return v(new o("jwt must be a string"));let $=e.split(".");if(3!==$.length)return v(new o("jwt malformed"));try{b=s(e,{complete:!0})}catch(e){return v(e)}if(!b)return v(new o("invalid token"));let w=b.header;if("function"==typeof t){if(!c)return v(new o("verify must be called asynchronous if secret or public key is provided as a callback"));_=t}else _=function(e,r){return r(null,t)};return _(w,function(t,s){let c;if(t)return v(new o("error in secret or public key callback: "+t.message));let _=""!==$[2].trim();if(!_&&s)return v(new o("jwt signature is required"));if(_&&!s)return v(new o("secret or public key must be provided"));if(!_&&!r.algorithms)return v(new o('please specify "none" in "algorithms" to verify unsigned tokens'));if(null!=s&&!(s instanceof d))try{s=h(s)}catch(e){try{s=p("string"==typeof s?Buffer.from(s):s)}catch(e){return v(new o("secretOrPublicKey is not valid key material"))}}if(r.algorithms||("secret"===s.type?r.algorithms=g:["rsa","rsa-pss"].includes(s.asymmetricKeyType)?r.algorithms=y:"ec"===s.asymmetricKeyType?r.algorithms=m:r.algorithms=f),-1===r.algorithms.indexOf(b.header.alg))return v(new o("invalid algorithm"));if(w.alg.startsWith("HS")&&"secret"!==s.type)return v(new o(`secretOrPublicKey must be a symmetric key when using ${w.alg}`));if(/^(?:RS|PS|ES)/.test(w.alg)&&"public"!==s.type)return v(new o(`secretOrPublicKey must be an asymmetric key when using ${w.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{l(w.alg,s)}catch(e){return v(e)}try{c=u.verify(e,b.header.alg,s)}catch(e){return v(e)}if(!c)return v(new o("invalid signature"));let E=b.payload;if(void 0!==E.nbf&&!r.ignoreNotBefore){if("number"!=typeof E.nbf)return v(new o("invalid nbf value"));if(E.nbf>S+(r.clockTolerance||0))return v(new a("jwt not active",new Date(1e3*E.nbf)))}if(void 0!==E.exp&&!r.ignoreExpiration){if("number"!=typeof E.exp)return v(new o("invalid exp value"));if(S>=E.exp+(r.clockTolerance||0))return v(new i("jwt expired",new Date(1e3*E.exp)))}if(r.audience){let e=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(E.aud)?E.aud:[E.aud]).some(function(t){return e.some(function(e){return e instanceof RegExp?e.test(t):e===t})}))return v(new o("jwt audience invalid. expected: "+e.join(" or ")))}if(r.issuer&&("string"==typeof r.issuer&&E.iss!==r.issuer||Array.isArray(r.issuer)&&-1===r.issuer.indexOf(E.iss)))return v(new o("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&E.sub!==r.subject)return v(new o("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&E.jti!==r.jwtid)return v(new o("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&E.nonce!==r.nonce)return v(new o("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if("number"!=typeof E.iat)return v(new o("iat required when maxAge is specified"));let e=n(r.maxAge,E.iat);if(void 0===e)return v(new o('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(S>=e+(r.clockTolerance||0))return v(new i("maxAge exceeded",new Date(1e3*e)))}return!0===r.complete?v(null,{header:w,payload:E,signature:b.signature}):v(null,E)})}},2357(e,t,r){var o,a=r(6608).Buffer,i=r(6982),s=r(9053),n=r(9023),l="secret must be a string or buffer",c="key must be a string or a buffer",u="function"==typeof i.createPublicKey;function d(e){if(!a.isBuffer(e)&&"string"!=typeof e&&(!u||"object"!=typeof e||"string"!=typeof e.type||"string"!=typeof e.asymmetricKeyType||"function"!=typeof e.export))throw m(c)}function p(e){if(!a.isBuffer(e)&&"string"!=typeof e&&"object"!=typeof e)throw m("key must be a string, a buffer or an object")}function h(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function f(e){var t=4-(e=e.toString()).length%4;if(4!==t)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function m(e){var t=[].slice.call(arguments,1);return TypeError(n.format.bind(n,e).apply(null,t))}function y(e){var t;return t=e,a.isBuffer(t)||"string"==typeof t||(e=JSON.stringify(e)),e}function g(e){return function(t,r){!function(e){if(!a.isBuffer(e)){if("string"!=typeof e){if(!u||"object"!=typeof e||"secret"!==e.type||"function"!=typeof e.export)throw m(l)}}}(r),t=y(t);var o=i.createHmac("sha"+e,r);return h((o.update(t),o.digest("base64")))}}u&&(c+=" or a KeyObject",l+="or a KeyObject");var v="timingSafeEqual"in i?function(e,t){return e.byteLength===t.byteLength&&i.timingSafeEqual(e,t)}:function(e,t){return o||(o=r(9454)),o(e,t)};function b(e){return function(t,r,o){var i=g(e)(t,o);return v(a.from(r),a.from(i))}}function _(e){return function(t,r){p(r),t=y(t);var o=i.createSign("RSA-SHA"+e);return h((o.update(t),o.sign(r,"base64")))}}function S(e){return function(t,r,o){d(o),t=y(t),r=f(r);var a=i.createVerify("RSA-SHA"+e);return a.update(t),a.verify(o,r,"base64")}}function $(e){return function(t,r){p(r),t=y(t);var o=i.createSign("RSA-SHA"+e);return h((o.update(t),o.sign({key:r,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}function w(e){return function(t,r,o){d(o),t=y(t),r=f(r);var a=i.createVerify("RSA-SHA"+e);return a.update(t),a.verify({key:o,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function E(e){var t=_(e);return function(){var r=t.apply(null,arguments);return s.derToJose(r,"ES"+e)}}function R(e){var t=S(e);return function(r,o,a){return t(r,o=s.joseToDer(o,"ES"+e).toString("base64"),a)}}function P(){return function(){return""}}function k(){return function(e,t){return""===t}}e.exports=function(e){var t=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!t)throw m('"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".',e);var r=(t[1]||t[3]).toLowerCase(),o=t[2];return{sign:({hs:g,rs:_,ps:$,es:E,none:P})[r](o),verify:({hs:b,rs:S,ps:w,es:R,none:k})[r](o)}}},3263(e,t,r){var o=r(9615),a=r(6747);t.ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],t.sign=o.sign,t.verify=a.verify,t.decode=a.decode,t.isValid=a.isValid,t.createSign=function(e){return new o(e)},t.createVerify=function(e){return new a(e)}},6360(e,t,r){var o=r(6608).Buffer,a=r(2203);function i(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=o.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=o.alloc(0),e.pipe(this),this;if(e.length||"object"==typeof e)return this.buffer=e,this.writable=!1,process.nextTick((function(){this.emit("end",e),this.readable=!1,this.emit("close")}).bind(this)),this;throw TypeError("Unexpected data type ("+typeof e+")")}r(9023).inherits(i,a),i.prototype.write=function(e){this.buffer=o.concat([this.buffer,o.from(e)]),this.emit("data",e)},i.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},e.exports=i},9615(e,t,r){var o=r(6608).Buffer,a=r(6360),i=r(2357),s=r(2203),n=r(5911),l=r(9023);function c(e,t){return o.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function u(e){var t,r,o,a=e.header,s=e.payload,u=e.secret||e.privateKey,d=e.encoding,p=i(a.alg),h=(t=(t=d)||"utf8",r=c(n(a),"binary"),o=c(n(s),t),l.format("%s.%s",r,o)),f=p.sign(h,u);return l.format("%s.%s",h,f)}function d(e){var t=e.secret;if(t=null==(t=null==t?e.privateKey:t)?e.key:t,!0===/^hs/i.test(e.header.alg)&&null==t)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new a(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new a(e.payload),this.secret.once("close",(function(){!this.payload.writable&&this.readable&&this.sign()}).bind(this)),this.payload.once("close",(function(){!this.secret.writable&&this.readable&&this.sign()}).bind(this))}l.inherits(d,s),d.prototype.sign=function(){try{var e=u({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},d.sign=u,e.exports=d},5911(e,t,r){var o=r(181).Buffer;e.exports=function(e){return"string"==typeof e?e:"number"==typeof e||o.isBuffer(e)?e.toString():JSON.stringify(e)}},6747(e,t,r){var o=r(6608).Buffer,a=r(6360),i=r(2357),s=r(2203),n=r(5911),l=r(9023),c=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function u(e){var t=e.split(".",1)[0],r=o.from(t,"base64").toString("binary");if("[object Object]"===Object.prototype.toString.call(r))return r;try{return JSON.parse(r)}catch(e){return}}function d(e){return e.split(".")[2]}function p(e){return c.test(e)&&!!u(e)}function h(e,t,r){if(!t){var o=Error("Missing algorithm parameter for jws.verify");throw o.code="MISSING_ALGORITHM",o}var a=d(e=n(e)),s=e.split(".",2).join(".");return i(t).verify(s,a,r)}function f(e,t){if(t=t||{},!p(e=n(e)))return null;var r,a,i=u(e);if(!i)return null;var s=(r=r||"utf8",a=e.split(".")[1],o.from(a,"base64").toString(r));return("JWT"===i.typ||t.json)&&(s=JSON.parse(s,t.encoding)),{header:i,payload:s,signature:d(e)}}function m(e){var t=(e=e||{}).secret;if(t=null==(t=null==t?e.publicKey:t)?e.key:t,!0===/^hs/i.test(e.algorithm)&&null==t)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new a(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new a(e.signature),this.secret.once("close",(function(){!this.signature.writable&&this.readable&&this.verify()}).bind(this)),this.signature.once("close",(function(){!this.secret.writable&&this.readable&&this.verify()}).bind(this))}l.inherits(m,s),m.prototype.verify=function(){try{var e=h(this.signature.buffer,this.algorithm,this.key.buffer),t=f(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},m.decode=f,m.isValid=p,m.verify=h,e.exports=m},5357(e){var t,r,o=1/0,a=0/0,i=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=/^(?:0|[1-9]\d*)$/,u=parseInt;function d(e){return e!=e}var p=Object.prototype,h=p.hasOwnProperty,f=p.toString,m=p.propertyIsEnumerable,y=(t=Object.keys,r=Object,function(e){return t(r(e))}),g=Math.max,v=Array.isArray;function b(e){var t,r,o;return null!=e&&"number"==typeof(t=e.length)&&t>-1&&t%1==0&&t<=0x1fffffffffffff&&"[object Function]"!=(o=_(r=e)?f.call(r):"")&&"[object GeneratorFunction]"!=o}function _(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function S(e){return!!e&&"object"==typeof e}e.exports=function(e,t,r,$){e=b(e)?e:function(e){return e?function(e,t){for(var r=-1,o=e?e.length:0,a=Array(o);++r<o;)a[r]=t(e[r],r,e);return a}(b(e)?function(e,t){var r,o,a,i,s=v(e)||S(o=r=e)&&b(o)&&h.call(r,"callee")&&(!m.call(r,"callee")||"[object Arguments]"==f.call(r))?function(e,t){for(var r=-1,o=Array(e);++r<e;)o[r]=t(r);return o}(e.length,String):[],n=s.length,l=!!n;for(var u in e){h.call(e,u)&&!(l&&("length"==u||(a=u,(i=null==(i=n)?0x1fffffffffffff:i)&&("number"==typeof a||c.test(a))&&a>-1&&a%1==0&&a<i)))&&s.push(u)}return s}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||p))return y(e);var t,r,o=[];for(var a in Object(e))h.call(e,a)&&"constructor"!=a&&o.push(a);return o}(e),function(t){return e[t]}):[]}(e),r=r&&!$?(R=(E=(w=r)?(w=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||S(t)&&"[object Symbol]"==f.call(t))return a;if(_(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=_(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var o=n.test(e);return o||l.test(e)?u(e.slice(2),o?2:8):s.test(e)?a:+e}(w))===o||w===-o?(w<0?-1:1)*17976931348623157e292:w==w?w:0:0===w?w:0)%1,E==E?R?E-R:E:0):0;var w,E,R,P,k=e.length;return r<0&&(r=g(k+r,0)),"string"==typeof(P=e)||!v(P)&&S(P)&&"[object String]"==f.call(P)?r<=k&&e.indexOf(t,r)>-1:!!k&&function(e,t,r){if(t!=t){for(var o=e.length,a=r+-1;++a<o;)if(d(e[a],a,e))return a;return -1}for(var i=r-1,s=e.length;++i<s;)if(e[i]===t)return i;return -1}(e,t,r)>-1}},6782(e){var t=Object.prototype.toString;e.exports=function(e){var r;return!0===e||!1===e||!!(r=e)&&"object"==typeof r&&"[object Boolean]"==t.call(e)}},5250(e){var t=1/0,r=0/0,o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,n=parseInt,l=Object.prototype.toString;function c(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var u,d,p;return"number"==typeof e&&e==(p=(d=(u=e)?(u=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==l.call(t))return r;if(c(e)){var t,u="function"==typeof e.valueOf?e.valueOf():e;e=c(u)?u+"":u}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var d=i.test(e);return d||s.test(e)?n(e.slice(2),d?2:8):a.test(e)?r:+e}(u))===t||u===-t?(u<0?-1:1)*17976931348623157e292:u==u?u:0:0===u?u:0)%1,d==d?p?d-p:d:0)}},8094(e){var t=Object.prototype.toString;e.exports=function(e){return"number"==typeof e||!!e&&"object"==typeof e&&"[object Number]"==t.call(e)}},6052(e){var t,r,o=Object.prototype,a=Function.prototype.toString,i=o.hasOwnProperty,s=a.call(Object),n=o.toString,l=(t=Object.getPrototypeOf,r=Object,function(e){return t(r(e))});e.exports=function(e){if(!(e&&"object"==typeof e)||"[object Object]"!=n.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=l(e);if(null===t)return!0;var r=i.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&a.call(r)==s}},1251(e){var t=Object.prototype.toString,r=Array.isArray;e.exports=function(e){var o;return"string"==typeof e||!r(e)&&!!(o=e)&&"object"==typeof o&&"[object String]"==t.call(e)}},8430(e){var t=1/0,r=0/0,o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,n=parseInt,l=Object.prototype.toString;function c(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var u,d,p,h,f=2,m=e;if("function"!=typeof m)throw TypeError("Expected a function");return p=(d=(u=f)?(u=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==l.call(t))return r;if(c(e)){var t,u="function"==typeof e.valueOf?e.valueOf():e;e=c(u)?u+"":u}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var d=i.test(e);return d||s.test(e)?n(e.slice(2),d?2:8):a.test(e)?r:+e}(u))===t||u===-t?(u<0?-1:1)*17976931348623157e292:u==u?u:0:0===u?u:0)%1,f=d==d?p?d-p:d:0,function(){return--f>0&&(h=m.apply(this,arguments)),f<=1&&(m=void 0),h}}},3866(e){function t(e,t,r,o){return Math.round(e/r)+" "+o+(t>=1.5*r?"s":"")}e.exports=function(e,r){r=r||{};var o,a,i,s,n=typeof e;if("string"===n&&e.length>0){var l=e;if(!((l=String(l)).length>100)){var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(c){var u=parseFloat(c[1]);switch((c[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*u;case"weeks":case"week":case"w":return 6048e5*u;case"days":case"day":case"d":return 864e5*u;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*u;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*u;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:break}}}return}if("number"===n&&isFinite(e)){return r.long?(a=Math.abs(o=e))>=864e5?t(o,a,864e5,"day"):a>=36e5?t(o,a,36e5,"hour"):a>=6e4?t(o,a,6e4,"minute"):a>=1e3?t(o,a,1e3,"second"):o+" ms":(s=Math.abs(i=e))>=864e5?Math.round(i/864e5)+"d":s>=36e5?Math.round(i/36e5)+"h":s>=6e4?Math.round(i/6e4)+"m":s>=1e3?Math.round(i/1e3)+"s":i+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},9695(e){"use strict";let t=(e={})=>{let t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path"};e.exports=t,e.exports.default=t},6608(e,t,r){var o=r(181),a=o.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return a(e,t,r)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=o:(i(o,t),t.Buffer=s),s.prototype=Object.create(a.prototype),i(a,s),s.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return a(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var o=a(e);return void 0!==t?"string"==typeof r?o.fill(t,r):o.fill(t):o.fill(0),o},s.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return a(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return o.SlowBuffer(e)}},8610(e,t,r){"use strict";let o=Symbol("SemVer ANY");class a{static get ANY(){return o}constructor(e,t){if(t=i(t),e instanceof a)if(!!t.loose===e.loose)return e;else e=e.value;c("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===o?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){let t=this.options.loose?s[n.COMPARATORLOOSE]:s[n.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=o}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===o||e===o)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof a))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=i(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))}}e.exports=a;let i=r(4621),{safeRe:s,t:n}=r(152),l=r(5461),c=r(674),u=r(2398),d=r(2069)},2069(e,t,r){"use strict";let o=/\s+/g;class a{constructor(e,t){if(t=s(t),e instanceof a)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else return new a(e.raw,t);if(e instanceof n)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(o," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!g(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(const e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&m)|(this.options.loose&&y))+":"+e,r=i.get(t);if(r)return r;let o=this.options.loose,a=o?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];l("hyphen replace",e=e.replace(a,x(this.options.includePrerelease))),l("comparator trim",e=e.replace(u[d.COMPARATORTRIM],p)),l("tilde trim",e=e.replace(u[d.TILDETRIM],h)),l("caret trim",e=e.replace(u[d.CARETTRIM],f));let s=e.split(" ").map(e=>_(e,this.options)).join(" ").split(/\s+/).map(e=>O(e,this.options));o&&(s=s.filter(e=>(l("loose invalid filter",e,this.options),!!e.match(u[d.COMPARATORLOOSE])))),l("range list",s);let c=new Map;for(let e of s.map(e=>new n(e,this.options))){if(g(e))return[e];c.set(e.value,e)}c.size>1&&c.has("")&&c.delete("");let v=[...c.values()];return i.set(t,v),v}intersects(e,t){if(!(e instanceof a))throw TypeError("a Range is required");return this.set.some(r=>b(r,t)&&e.set.some(e=>b(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(j(this.set[t],e,this.options))return!0;return!1}}e.exports=a;let i=new(r(2044)),s=r(4621),n=r(8610),l=r(674),c=r(2398),{safeRe:u,t:d,comparatorTrimReplace:p,tildeTrimReplace:h,caretTrimReplace:f}=r(152),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:y}=r(5076),g=e=>"<0.0.0-0"===e.value,v=e=>""===e.value,b=(e,t)=>{let r=!0,o=e.slice(),a=o.pop();for(;r&&o.length;)r=o.every(e=>a.intersects(e,t)),a=o.pop();return r},_=(e,t)=>(l("comp",e=e.replace(u[d.BUILD],""),t),l("caret",e=E(e,t)),l("tildes",e=$(e,t)),l("xrange",e=P(e,t)),l("stars",e=T(e,t)),e),S=e=>!e||"x"===e.toLowerCase()||"*"===e,$=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(" "),w=(e,t)=>{let r=t.loose?u[d.TILDELOOSE]:u[d.TILDE];return e.replace(r,(t,r,o,a,i)=>{let s;return l("tilde",e,t,r,o,a,i),S(r)?s="":S(o)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:S(a)?s=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?(l("replaceTilde pr",i),s=`>=${r}.${o}.${a}-${i} <${r}.${+o+1}.0-0`):s=`>=${r}.${o}.${a} <${r}.${+o+1}.0-0`,l("tilde return",s),s})},E=(e,t)=>e.trim().split(/\s+/).map(e=>R(e,t)).join(" "),R=(e,t)=>{l("caret",e,t);let r=t.loose?u[d.CARETLOOSE]:u[d.CARET],o=t.includePrerelease?"-0":"";return e.replace(r,(t,r,a,i,s)=>{let n;return l("caret",e,t,r,a,i,s),S(r)?n="":S(a)?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:S(i)?n="0"===r?`>=${r}.${a}.0${o} <${r}.${+a+1}.0-0`:`>=${r}.${a}.0${o} <${+r+1}.0.0-0`:s?(l("replaceCaret pr",s),n="0"===r?"0"===a?`>=${r}.${a}.${i}-${s} <${r}.${a}.${+i+1}-0`:`>=${r}.${a}.${i}-${s} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${i}-${s} <${+r+1}.0.0-0`):(l("no pr"),n="0"===r?"0"===a?`>=${r}.${a}.${i}${o} <${r}.${a}.${+i+1}-0`:`>=${r}.${a}.${i}${o} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${i} <${+r+1}.0.0-0`),l("caret return",n),n})},P=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map(e=>k(e,t)).join(" ")),k=(e,t)=>{e=e.trim();let r=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return e.replace(r,(r,o,a,i,s,n)=>{l("xRange",e,r,o,a,i,s,n);let c=S(a),u=c||S(i),d=u||S(s);return"="===o&&d&&(o=""),n=t.includePrerelease?"-0":"",c?r=">"===o||"<"===o?"<0.0.0-0":"*":o&&d?(u&&(i=0),s=0,">"===o?(o=">=",u?(a=+a+1,i=0):i=+i+1,s=0):"<="===o&&(o="<",u?a=+a+1:i=+i+1),"<"===o&&(n="-0"),r=`${o+a}.${i}.${s}${n}`):u?r=`>=${a}.0.0${n} <${+a+1}.0.0-0`:d&&(r=`>=${a}.${i}.0${n} <${a}.${+i+1}.0-0`),l("xRange return",r),r})},T=(e,t)=>(l("replaceStars",e,t),e.trim().replace(u[d.STAR],"")),O=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),x=e=>(t,r,o,a,i,s,n,l,c,u,d,p)=>(r=S(o)?"":S(a)?`>=${o}.0.0${e?"-0":""}`:S(i)?`>=${o}.${a}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`,l=S(c)?"":S(u)?`<${+c+1}.0.0-0`:S(d)?`<${c}.${+u+1}.0-0`:p?`<=${c}.${u}.${d}-${p}`:e?`<${c}.${u}.${+d+1}-0`:`<=${l}`,`${r} ${l}`.trim()),j=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(l(e[r].semver),e[r].semver!==n.ANY&&e[r].semver.prerelease.length>0){let o=e[r].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}},2398(e,t,r){"use strict";let o=r(674),{MAX_LENGTH:a,MAX_SAFE_INTEGER:i}=r(5076),{safeRe:s,t:n}=r(152),l=r(4621),{compareIdentifiers:c}=r(9101);class u{constructor(e,t){if(t=l(t),e instanceof u)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else e=e.version;else if("string"!=typeof e)throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>a)throw TypeError(`version is longer than ${a} characters`);o("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?s[n.LOOSE]:s[n.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(o("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return(e instanceof u||(e=new u(e,this.options)),this.major<e.major)?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:+(this.patch>e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return -1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],a=e.prerelease[t];if(o("prerelease compare",t,r,a),void 0===r&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===r)return -1;else if(r===a)continue;else return c(r,a)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{let r=this.build[t],a=e.build[t];if(o("build compare",t,r,a),void 0===r&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===r)return -1;else if(r===a)continue;else return c(r,a)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw Error("invalid increment argument: identifier is empty");if(t){let e=`-${t}`.match(this.options.loose?s[n.PRERELEASELOOSE]:s[n.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{let e=+!!Number(r);if(0===this.prerelease.length)this.prerelease=[e];else{let o=this.prerelease.length;for(;--o>=0;)"number"==typeof this.prerelease[o]&&(this.prerelease[o]++,o=-2);if(-1===o){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let o=[t,e];!1===r&&(o=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},5608(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},5461(e,t,r){"use strict";let o=r(8271),a=r(733),i=r(1686),s=r(6479),n=r(7257),l=r(5850);e.exports=(e,t,r,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return o(e,r,c);case"!=":return a(e,r,c);case">":return i(e,r,c);case">=":return s(e,r,c);case"<":return n(e,r,c);case"<=":return l(e,r,c);default:throw TypeError(`Invalid operator: ${t}`)}}},7771(e,t,r){"use strict";let o=r(2398),a=r(6802),{safeRe:i,t:s}=r(152);e.exports=(e,t)=>{if(e instanceof o)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let o,a=t.includePrerelease?i[s.COERCERTLFULL]:i[s.COERCERTL];for(;(o=a.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&o.index+o[0].length===r.index+r[0].length||(r=o),a.lastIndex=o.index+o[1].length+o[2].length;a.lastIndex=-1}else r=e.match(t.includePrerelease?i[s.COERCEFULL]:i[s.COERCE]);if(null===r)return null;let n=r[2],l=r[3]||"0",c=r[4]||"0",u=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return a(`${n}.${l}.${c}${u}${d}`,t)}},8767(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r)=>{let a=new o(e,r),i=new o(t,r);return a.compare(i)||a.compareBuild(i)}},6293(e,t,r){"use strict";let o=r(6958);e.exports=(e,t)=>o(e,t,!0)},6958(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r)=>new o(e,r).compare(new o(t,r))},3086(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e,null,!0),a=o(t,null,!0),i=r.compare(a);if(0===i)return null;let s=i>0,n=s?r:a,l=s?a:r,c=!!n.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(n))return l.minor&&!l.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==a.major?u+"major":r.minor!==a.minor?u+"minor":r.patch!==a.patch?u+"patch":"prerelease"}},8271(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0===o(e,t,r)},1686(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>o(e,t,r)>0},6479(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>o(e,t,r)>=0},3625(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r,a,i)=>{"string"==typeof r&&(i=a,a=r,r=void 0);try{return new o(e instanceof o?e.version:e,r).inc(t,a,i).version}catch(e){return null}}},7257(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0>o(e,t,r)},5850(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0>=o(e,t,r)},7744(e,t,r){"use strict";let o=r(2398);e.exports=(e,t)=>new o(e,t).major},4812(e,t,r){"use strict";let o=r(2398);e.exports=(e,t)=>new o(e,t).minor},733(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0!==o(e,t,r)},6802(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r=!1)=>{if(e instanceof o)return e;try{return new o(e,t)}catch(e){if(!r)return null;throw e}}},8643(e,t,r){"use strict";let o=r(2398);e.exports=(e,t)=>new o(e,t).patch},9283(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e,t);return r&&r.prerelease.length?r.prerelease:null}},7032(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>o(t,e,r)},9839(e,t,r){"use strict";let o=r(8767);e.exports=(e,t)=>e.sort((e,r)=>o(r,e,t))},4056(e,t,r){"use strict";let o=r(2069);e.exports=(e,t,r)=>{try{t=new o(t,r)}catch(e){return!1}return t.test(e)}},7697(e,t,r){"use strict";let o=r(8767);e.exports=(e,t)=>e.sort((e,r)=>o(e,r,t))},6807(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e,t);return r?r.version:null}},3895(e,t,r){"use strict";let o=r(152),a=r(5076),i=r(2398),s=r(9101),n=r(6802),l=r(6807),c=r(5608),u=r(3625),d=r(3086),p=r(7744),h=r(4812),f=r(8643),m=r(9283),y=r(6958),g=r(7032),v=r(6293),b=r(8767),_=r(7697),S=r(9839),$=r(1686),w=r(7257),E=r(8271),R=r(733),P=r(6479),k=r(5850),T=r(5461),O=r(7771),x=r(8610),j=r(2069),C=r(4056),N=r(6613),I=r(7114),A=r(1008),M=r(203),q=r(5372),z=r(4713),L=r(4497),D=r(9272),U=r(3490);e.exports={parse:n,valid:l,clean:c,inc:u,diff:d,major:p,minor:h,patch:f,prerelease:m,compare:y,rcompare:g,compareLoose:v,compareBuild:b,sort:_,rsort:S,gt:$,lt:w,eq:E,neq:R,gte:P,lte:k,cmp:T,coerce:O,Comparator:x,Range:j,satisfies:C,toComparators:N,maxSatisfying:I,minSatisfying:A,minVersion:M,validRange:q,outside:z,gtr:L,ltr:D,intersects:U,simplifyRange:r(4039),subset:r(22),SemVer:i,re:o.re,src:o.src,tokens:o.t,SEMVER_SPEC_VERSION:a.SEMVER_SPEC_VERSION,RELEASE_TYPES:a.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}},5076(e){"use strict";e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||0x1fffffffffffff,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},674(e){"use strict";e.exports="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}},9101(e){"use strict";let t=/^[0-9]+$/,r=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:e<r?-1:1;let o=t.test(e),a=t.test(r);return o&&a&&(e*=1,r*=1),e===r?0:o&&!a?-1:a&&!o?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},2044(e){"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(void 0!==t)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},4621(e){"use strict";let t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},152(e,t,r){"use strict";let{MAX_SAFE_COMPONENT_LENGTH:o,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:i}=r(5076),s=r(674),n=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],d=t.t={},p=0,h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[h,a]],m=(e,t,r)=>{let o=(e=>{for(let[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),a=p++;s(e,a,t),d[e]=a,c[a]=t,u[a]=o,n[a]=new RegExp(t,r?"g":void 0),l[a]=new RegExp(o,r?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),m("MAINVERSION",`(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${c[d.PRERELEASEIDENTIFIER]}(?:\\.${c[d.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${c[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[d.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${h}+`),m("BUILD",`(?:\\+(${c[d.BUILDIDENTIFIER]}(?:\\.${c[d.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${c[d.MAINVERSION]}${c[d.PRERELEASE]}?${c[d.BUILD]}?`),m("FULL",`^${c[d.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${c[d.MAINVERSIONLOOSE]}${c[d.PRERELEASELOOSE]}?${c[d.BUILD]}?`),m("LOOSE",`^${c[d.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${c[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${c[d.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:${c[d.PRERELEASE]})?${c[d.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:${c[d.PRERELEASELOOSE]})?${c[d.BUILD]}?)?)?`),m("XRANGE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${o}})(?:\\.(\\d{1,${o}}))?(?:\\.(\\d{1,${o}}))?`),m("COERCE",`${c[d.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",c[d.COERCEPLAIN]+`(?:${c[d.PRERELEASE]})?`+`(?:${c[d.BUILD]})?`+"(?:$|[^\\d])"),m("COERCERTL",c[d.COERCE],!0),m("COERCERTLFULL",c[d.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${c[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${c[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${c[d.LONECARET]}${c[d.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${c[d.LONECARET]}${c[d.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${c[d.GTLT]}\\s*(${c[d.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]}|${c[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${c[d.XRANGEPLAIN]})\\s+-\\s+(${c[d.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${c[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[d.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},4497(e,t,r){"use strict";let o=r(4713);e.exports=(e,t,r)=>o(e,t,">",r)},3490(e,t,r){"use strict";let o=r(2069);e.exports=(e,t,r)=>(e=new o(e,r),t=new o(t,r),e.intersects(t,r))},9272(e,t,r){"use strict";let o=r(4713);e.exports=(e,t,r)=>o(e,t,"<",r)},7114(e,t,r){"use strict";let o=r(2398),a=r(2069);e.exports=(e,t,r)=>{let i=null,s=null,n=null;try{n=new a(t,r)}catch(e){return null}return e.forEach(e=>{n.test(e)&&(!i||-1===s.compare(e))&&(s=new o(i=e,r))}),i}},1008(e,t,r){"use strict";let o=r(2398),a=r(2069);e.exports=(e,t,r)=>{let i=null,s=null,n=null;try{n=new a(t,r)}catch(e){return null}return e.forEach(e=>{n.test(e)&&(!i||1===s.compare(e))&&(s=new o(i=e,r))}),i}},203(e,t,r){"use strict";let o=r(2398),a=r(2069),i=r(1686);e.exports=(e,t)=>{e=new a(e,t);let r=new o("0.0.0");if(e.test(r)||(r=new o("0.0.0-0"),e.test(r)))return r;r=null;for(let t=0;t<e.set.length;++t){let a=e.set[t],s=null;a.forEach(e=>{let t=new o(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":(!s||i(t,s))&&(s=t);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),s&&(!r||i(r,s))&&(r=s)}return r&&e.test(r)?r:null}},4713(e,t,r){"use strict";let o=r(2398),a=r(8610),{ANY:i}=a,s=r(2069),n=r(4056),l=r(1686),c=r(7257),u=r(5850),d=r(6479);e.exports=(e,t,r,p)=>{let h,f,m,y,g;switch(e=new o(e,p),t=new s(t,p),r){case">":h=l,f=u,m=c,y=">",g=">=";break;case"<":h=c,f=d,m=l,y="<",g="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(n(e,t,p))return!1;for(let r=0;r<t.set.length;++r){let o=t.set[r],s=null,n=null;if(o.forEach(e=>{e.semver===i&&(e=new a(">=0.0.0")),s=s||e,n=n||e,h(e.semver,s.semver,p)?s=e:m(e.semver,n.semver,p)&&(n=e)}),s.operator===y||s.operator===g||(!n.operator||n.operator===y)&&f(e,n.semver)||n.operator===g&&m(e,n.semver))return!1}return!0}},4039(e,t,r){"use strict";let o=r(4056),a=r(6958);e.exports=(e,t,r)=>{let i=[],s=null,n=null,l=e.sort((e,t)=>a(e,t,r));for(let e of l)o(e,t,r)?(n=e,s||(s=e)):(n&&i.push([s,n]),n=null,s=null);s&&i.push([s,null]);let c=[];for(let[e,t]of i)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");let u=c.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return u.length<d.length?u:t}},22(e,t,r){"use strict";let o=r(2069),a=r(8610),{ANY:i}=a,s=r(4056),n=r(6958),l=[new a(">=0.0.0-0")],c=[new a(">=0.0.0")],u=(e,t,r)=>{let o,a,u,h,f,m,y;if(e===t)return!0;if(1===e.length&&e[0].semver===i)if(1===t.length&&t[0].semver===i)return!0;else e=r.includePrerelease?l:c;if(1===t.length&&t[0].semver===i)if(r.includePrerelease)return!0;else t=c;let g=new Set;for(let t of e)">"===t.operator||">="===t.operator?o=d(o,t,r):"<"===t.operator||"<="===t.operator?a=p(a,t,r):g.add(t.semver);if(g.size>1)return null;if(o&&a&&((u=n(o.semver,a.semver,r))>0||0===u&&(">="!==o.operator||"<="!==a.operator)))return null;for(let e of g){if(o&&!s(e,String(o),r)||a&&!s(e,String(a),r))return null;for(let o of t)if(!s(e,String(o),r))return!1;return!0}let v=!!a&&!r.includePrerelease&&!!a.semver.prerelease.length&&a.semver,b=!!o&&!r.includePrerelease&&!!o.semver.prerelease.length&&o.semver;for(let e of(v&&1===v.prerelease.length&&"<"===a.operator&&0===v.prerelease[0]&&(v=!1),t)){if(y=y||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,o){if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),">"===e.operator||">="===e.operator){if((h=d(o,e,r))===e&&h!==o)return!1}else if(">="===o.operator&&!s(o.semver,String(e),r))return!1}if(a){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if((f=p(a,e,r))===e&&f!==a)return!1}else if("<="===a.operator&&!s(a.semver,String(e),r))return!1}if(!e.operator&&(a||o)&&0!==u)return!1}return(!o||!m||!!a||0===u)&&(!a||!y||!!o||0===u)&&!b&&!v&&!0},d=(e,t,r)=>{if(!e)return t;let o=n(e.semver,t.semver,r);return o>0?e:o<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,r)=>{if(!e)return t;let o=n(e.semver,t.semver,r);return o<0?e:o>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new o(e,r),t=new o(t,r);let a=!1;e:for(let o of e.set){for(let e of t.set){let t=u(o,e,r);if(a=a||null!==t,t)continue e}if(a)return!1}return!0}},6613(e,t,r){"use strict";let o=r(2069);e.exports=(e,t)=>new o(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},5372(e,t,r){"use strict";let o=r(2069);e.exports=(e,t)=>{try{return new o(e,t).range||"*"}catch(e){return null}}},600(e,t,r){"use strict";let o=r(9638);e.exports=(e="")=>{let t=e.match(o);if(!t)return null;let[r,a]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return"env"===i?a:a?`${i} ${a}`:i}},9638(e){"use strict";e.exports=/^#!(.*)/},1905(e,t,r){let o="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,a=r(6928),i=o?";":":",s=r(9344),n=e=>Object.assign(Error(`not found: ${e}`),{code:"ENOENT"}),l=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||o&&e.match(/\\/)?[""]:[...o?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],s=o?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",n=o?s.split(r):[""];return o&&-1!==e.indexOf(".")&&""!==n[0]&&n.unshift(""),{pathEnv:a,pathExt:n,pathExtExe:s}},c=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});let{pathEnv:o,pathExt:i,pathExtExe:c}=l(e,t),u=[],d=r=>new Promise((i,s)=>{if(r===o.length)return t.all&&u.length?i(u):s(n(e));let l=o[r],c=/^".*"$/.test(l)?l.slice(1,-1):l,d=a.join(c,e);i(p(!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,r,0))}),p=(e,r,o)=>new Promise((a,n)=>{if(o===i.length)return a(d(r+1));let l=i[o];s(e+l,{pathExt:c},(i,s)=>{if(!i&&s)if(!t.all)return a(e+l);else u.push(e+l);return a(p(e,r,o+1))})});return r?d(0).then(e=>r(null,e),r):d(0)};e.exports=c,c.sync=(e,t)=>{let{pathEnv:r,pathExt:o,pathExtExe:i}=l(e,t=t||{}),c=[];for(let n=0;n<r.length;n++){let l=r[n],u=/^".*"$/.test(l)?l.slice(1,-1):l,d=a.join(u,e),p=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<o.length;e++){let r=p+o[e];try{if(s.sync(r,{pathExt:i}))if(!t.all)return r;else c.push(r)}catch(e){}}}if(t.all&&c.length)return c;if(t.nothrow)return null;throw n(e)}},181(e){"use strict";e.exports=require("buffer")},5317(e){"use strict";e.exports=require("child_process")},6982(e){"use strict";e.exports=require("crypto")},9896(e){"use strict";e.exports=require("fs")},7598(e){"use strict";e.exports=require("node:crypto")},857(e){"use strict";e.exports=require("os")},6928(e){"use strict";e.exports=require("path")},2203(e){"use strict";e.exports=require("stream")},9023(e){"use strict";e.exports=require("util")},4953(t){"use strict";t.exports=e},4891(e,t,r){"use strict";let o;r.d(t,{importJWK:()=>G,importPKCS8:()=>B,SignJWT:()=>U});let a=new TextEncoder,i=new TextDecoder;function s(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>127)throw TypeError("non-ASCII string encountered in encode()");t[r]=o}return t}function n(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function l(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64("string"==typeof e?e:i.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=i.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/");try{return n(t)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}function c(e){let t=e;return("string"==typeof t&&(t=a.encode(t)),Uint8Array.prototype.toBase64)?t.toBase64({alphabet:"base64url",omitPadding:!0}):(function(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=[];for(let r=0;r<e.length;r+=32768)t.push(String.fromCharCode.apply(null,e.subarray(r,r+32768)));return btoa(t.join(""))})(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}class u extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class d extends u{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class p extends u{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class h extends u{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}class f extends u{[Symbol.asyncIterator];static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(e="multiple matching keys found in the JSON Web Key Set",t){super(e,t)}}let m=(e,t="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function y(e,t){if(parseInt(e.hash.name.slice(4),10)!==t)throw m(`SHA-${t}`,"algorithm.hash")}function g(e,t,...r){if((r=r.filter(Boolean)).length>2){let t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}let v=(e,t,...r)=>g(`Key for the ${e} algorithm must be `,t,...r);async function b(e,t,r){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw TypeError(((e,...t)=>g("Key must be ",e,...t))(t,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}return!function(e,t,r){switch(t){case"HS256":case"HS384":case"HS512":if("HMAC"!==e.algorithm.name)throw m("HMAC");y(e.algorithm,parseInt(t.slice(2),10));break;case"RS256":case"RS384":case"RS512":if("RSASSA-PKCS1-v1_5"!==e.algorithm.name)throw m("RSASSA-PKCS1-v1_5");y(e.algorithm,parseInt(t.slice(2),10));break;case"PS256":case"PS384":case"PS512":if("RSA-PSS"!==e.algorithm.name)throw m("RSA-PSS");y(e.algorithm,parseInt(t.slice(2),10));break;case"Ed25519":case"EdDSA":if("Ed25519"!==e.algorithm.name)throw m("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":let o;if(o=e.algorithm,o.name!==t)throw m(t);break;case"ES256":case"ES384":case"ES512":{if("ECDSA"!==e.algorithm.name)throw m("ECDSA");let r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw m(r,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}if(r&&!e.usages.includes(r))throw TypeError(`CryptoKey does not support this operation, its usages must include ${r}.`)}(t,e,r),t}async function _(e,t,r){let o=await b(e,t,"sign");return!function(e,t){if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}}(e,o),new Uint8Array(await crypto.subtle.sign(function(e,t){let r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new d(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}(e,o.algorithm),o,r))}function S(e){if("object"!=typeof e||null===e||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}let $=e=>S(e)&&"string"==typeof e.kty,w=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},E=e=>e?.[Symbol.toStringTag]==="KeyObject",R=e=>w(e)||E(e),P=e=>e?.[Symbol.toStringTag],k=(e,t,r)=>{if(void 0!==t.use){let e;switch(r){case"sign":case"verify":e="sig";break;case"encrypt":case"decrypt":e="enc"}if(t.use!==e)throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`)}if(void 0!==t.alg&&t.alg!==e)throw TypeError(`Invalid key for this operation, its "alg" must be "${e}" when present`);if(Array.isArray(t.key_ops)){let o;switch(!0){case"sign"===r||"verify"===r:case"dir"===e:case e.includes("CBC-HS"):o=r;break;case e.startsWith("PBES2"):o="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):o=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===r?"wrapKey":"unwrapKey":r;break;case"encrypt"===r&&e.startsWith("RSA"):o="wrapKey";break;case"decrypt"===r:o=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(o&&t.key_ops?.includes?.(o)===!1)throw TypeError(`Invalid key for this operation, its "key_ops" must include "${o}" when present`)}return!0},T='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';async function O(e){if(!e.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:t,keyUsages:r}=function(e){let t,r;switch(e.kty){case"AKP":switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},r=e.priv?["sign"]:["verify"];break;default:throw new d(T)}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new d(T)}break;case"EC":switch(e.alg){case"ES256":case"ES384":case"ES512":t={name:"ECDSA",namedCurve:({ES256:"P-256",ES384:"P-384",ES512:"P-521"})[e.alg]},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new d(T)}break;case"OKP":switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new d(T)}break;default:throw new d('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),o={...e};return"AKP"!==o.kty&&delete o.alg,delete o.use,crypto.subtle.importKey("jwk",o,t,e.ext??(!e.d&&!e.priv),e.key_ops??r)}let x="given KeyObject instance cannot be used for this algorithm",j=async(e,t,r,a=!1)=>{let i=(o||=new WeakMap).get(e);if(i?.[r])return i[r];let s=await O({...t,alg:r});return a&&Object.freeze(e),i?i[r]=s:o.set(e,{[r]:s}),s};async function C(e,t){if(e instanceof Uint8Array||w(e))return e;if(E(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{let r,a=(o||=new WeakMap).get(e);if(a?.[t])return a[t];let i="public"===e.type,s=!!i;if("x25519"===e.asymmetricKeyType){switch(t){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw TypeError(x)}r=e.toCryptoKey(e.asymmetricKeyType,s,i?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw TypeError(x);r=e.toCryptoKey(e.asymmetricKeyType,s,[i?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(t!==e.asymmetricKeyType.toUpperCase())throw TypeError(x);r=e.toCryptoKey(e.asymmetricKeyType,s,[i?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let o;switch(t){case"RSA-OAEP":o="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":o="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":o="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":o="SHA-512";break;default:throw TypeError(x)}if(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:o},s,i?["encrypt"]:["decrypt"]);r=e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:o},s,[i?"verify":"sign"])}if("ec"===e.asymmetricKeyType){let o=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(e.asymmetricKeyDetails?.namedCurve);if(!o)throw TypeError(x);let a={ES256:"P-256",ES384:"P-384",ES512:"P-521"};a[t]&&o===a[t]&&(r=e.toCryptoKey({name:"ECDSA",namedCurve:o},s,[i?"verify":"sign"])),t.startsWith("ECDH-ES")&&(r=e.toCryptoKey({name:"ECDH",namedCurve:o},s,i?[]:["deriveBits"]))}if(!r)throw TypeError(x);return a?a[t]=r:o.set(e,{[t]:r}),r})(e,t)}catch(e){if(e instanceof TypeError)throw e}let r=e.export({format:"jwk"});return j(e,r,t)}if($(e))return e.k?l(e.k):j(e,e,t,!0);throw Error("unreachable")}function N(e,t){if(e)throw TypeError(`${t} can only be called once`)}Symbol();class I{#e;#t;#r;constructor(e){if(!(e instanceof Uint8Array))throw TypeError("payload must be an instance of Uint8Array");this.#e=e}setProtectedHeader(e){return N(this.#t,"setProtectedHeader"),this.#t=e,this}setUnprotectedHeader(e){return N(this.#r,"setUnprotectedHeader"),this.#r=e,this}async sign(e,t){let r,o,a,i;if(!this.#t&&!this.#r)throw new p("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!function(...e){let t,r=e.filter(Boolean);if(0===r.length||1===r.length)return!0;for(let e of r){let r=Object.keys(e);if(!t||0===t.size){t=new Set(r);continue}for(let e of r){if(t.has(e))return!1;t.add(e)}}return!0}(this.#t,this.#r))throw new p("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...this.#t,...this.#r},l=function(e,t,r,o,a){let i;if(void 0!==a.crit&&o?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||void 0===o.crit)return new Set;if(!Array.isArray(o.crit)||0===o.crit.length||o.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');for(let s of(i=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t,o.crit)){if(!i.has(s))throw new d(`Extension Header Parameter "${s}" is not recognized`);if(void 0===a[s])throw new e(`Extension Header Parameter "${s}" is missing`);if(i.get(s)&&void 0===o[s])throw new e(`Extension Header Parameter "${s}" MUST be integrity protected`)}return new Set(o.crit)}(p,new Map([["b64",!0]]),t?.crit,this.#t,n),u=!0;if(l.has("b64")&&"boolean"!=typeof(u=this.#t.b64))throw new p('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:h}=n;if("string"!=typeof h||!h)throw new p('JWS "alg" (Algorithm) Header Parameter missing or invalid');var f="sign";switch(h.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((e,t,r)=>{if(!(t instanceof Uint8Array)){if($(t)){if("oct"===t.kty&&"string"==typeof t.k&&k(e,t,r))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!R(t))throw TypeError(v(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw TypeError(`${P(t)} instances for symmetric algorithms must be of type "secret"`)}})(h,e,f);break;default:((e,t,r)=>{if($(t))switch(r){case"decrypt":case"sign":if("oct"!==t.kty&&("AKP"===t.kty&&"string"==typeof t.priv||"string"==typeof t.d)&&k(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if("oct"!==t.kty&&void 0===t.d&&void 0===t.priv&&k(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a public JWK")}if(!R(t))throw TypeError(v(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw TypeError(`${P(t)} instances for asymmetric algorithms must not be of type "secret"`);if("public"===t.type)switch(r){case"sign":throw TypeError(`${P(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw TypeError(`${P(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if("private"===t.type)switch(r){case"verify":throw TypeError(`${P(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw TypeError(`${P(t)} instances for asymmetric algorithm encryption must be of type "public"`)}})(h,e,f)}u?o=s(r=c(this.#e)):(o=this.#e,r=""),this.#t?i=s(a=c(JSON.stringify(this.#t))):(a="",i=new Uint8Array);let m=function(...e){let t=new Uint8Array(e.reduce((e,{length:t})=>e+t,0)),r=0;for(let o of e)t.set(o,r),r+=o.length;return t}(i,s("."),o),y=await C(e,h),g={signature:c(await _(h,y,m)),payload:r};return this.#r&&(g.header=this.#r),this.#t&&(g.protected=a),g}}class A{#o;constructor(e){this.#o=new I(e)}setProtectedHeader(e){return this.#o.setProtectedHeader(e),this}async sign(e,t){let r=await this.#o.sign(e,t);if(void 0===r.payload)throw TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}let M=e=>Math.floor(e.getTime()/1e3),q=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function z(e){let t,r=q.exec(e);if(!r||r[4]&&r[1])throw TypeError("Invalid time period format");let o=parseFloat(r[2]);switch(r[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":t=Math.round(o);break;case"minute":case"minutes":case"min":case"mins":case"m":t=Math.round(60*o);break;case"hour":case"hours":case"hr":case"hrs":case"h":t=Math.round(3600*o);break;case"day":case"days":case"d":t=Math.round(86400*o);break;case"week":case"weeks":case"w":t=Math.round(604800*o);break;default:t=Math.round(0x1e187e0*o)}return"-"===r[1]||"ago"===r[4]?-t:t}function L(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}class D{#e;constructor(e){if(!S(e))throw TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(e)}data(){return a.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(e){this.#e.iss=e}get sub(){return this.#e.sub}set sub(e){this.#e.sub=e}get aud(){return this.#e.aud}set aud(e){this.#e.aud=e}set jti(e){this.#e.jti=e}set nbf(e){"number"==typeof e?this.#e.nbf=L("setNotBefore",e):e instanceof Date?this.#e.nbf=L("setNotBefore",M(e)):this.#e.nbf=M(new Date)+z(e)}set exp(e){"number"==typeof e?this.#e.exp=L("setExpirationTime",e):e instanceof Date?this.#e.exp=L("setExpirationTime",M(e)):this.#e.exp=M(new Date)+z(e)}set iat(e){void 0===e?this.#e.iat=M(new Date):e instanceof Date?this.#e.iat=L("setIssuedAt",M(e)):"string"==typeof e?this.#e.iat=L("setIssuedAt",M(new Date)+z(e)):this.#e.iat=L("setIssuedAt",e)}}class U{#t;#a;constructor(e={}){this.#a=new D(e)}setIssuer(e){return this.#a.iss=e,this}setSubject(e){return this.#a.sub=e,this}setAudience(e){return this.#a.aud=e,this}setJti(e){return this.#a.jti=e,this}setNotBefore(e){return this.#a.nbf=e,this}setExpirationTime(e){return this.#a.exp=e,this}setIssuedAt(e){return this.#a.iat=e,this}setProtectedHeader(e){return this.#t=e,this}async sign(e,t){let r=new A(this.#a.data());if(r.setProtectedHeader(this.#t),Array.isArray(this.#t?.crit)&&this.#t.crit.includes("b64")&&!1===this.#t.b64)throw new h("JWTs MUST NOT use unencoded payload");return r.sign(e,t)}}let V=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},F=e=>{let t=e.data[e.pos++];if(128&t){let r=127&t,o=0;for(let t=0;t<r;t++)o=o<<8|e.data[e.pos++];return o}return t},H=(e,t,r)=>{if(e.data[e.pos++]!==t)throw Error(r)},K=(e,t)=>{let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},J=async(e,t,r,o)=>{let a,i,s="spki"===e,n=()=>s?["verify"]:["sign"];switch(r){case"PS256":case"PS384":case"PS512":a={name:"RSA-PSS",hash:`SHA-${r.slice(-3)}`},i=n();break;case"RS256":case"RS384":case"RS512":a={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${r.slice(-3)}`},i=n();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":a={name:"RSA-OAEP",hash:`SHA-${parseInt(r.slice(-3),10)||1}`},i=s?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":a={name:"ECDSA",namedCurve:({ES256:"P-256",ES384:"P-384",ES512:"P-521"})[r]},i=n();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{let e=o.getNamedCurve(t);a="X25519"===e?{name:"X25519"}:{name:"ECDH",namedCurve:e}}catch(e){throw new d("Invalid or unsupported key format")}i=s?[]:["deriveBits"];break;case"Ed25519":case"EdDSA":a={name:"Ed25519"},i=n();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":a={name:r},i=n();break;default:throw new d('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,a,o?.extractable??!!s,i)};async function B(e,t,r){let o,a,i;if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw TypeError('"pkcs8" must be PKCS#8 formatted string');return o=/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,a=n(e.replace(o,"")),i=r,t?.startsWith?.("ECDH-ES")&&((i||={}).getNamedCurve=e=>{let t,r={data:e,pos:0};return H(r,48,"Invalid PKCS#8 structure"),F(r),H(r,2,"Expected version field"),t=F(r),r.pos+=t,H(r,48,"Expected algorithm identifier"),F(r),r.pos,(e=>{let t,r=(H(e,6,"Expected algorithm OID"),t=F(e),K(e,t));if(V(r,[43,101,110]))return"X25519";if(!V(r,[42,134,72,206,61,2,1]))throw Error("Unsupported key algorithm");H(e,6,"Expected curve OID");let o=F(e),a=K(e,o);for(let{name:e,oid:t}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(V(a,t))return e;throw Error("Unsupported named curve")})(r)}),J("pkcs8",a,t,i)}async function G(e,t,r){let o;if(!S(e))throw TypeError("JWK must be an object");switch(t??=e.alg,o??=r?.extractable??e.ext,e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw TypeError('missing "k" (Key Value) Parameter value');return l(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new d('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return O({...e,alg:t,ext:o});case"AKP":if("string"!=typeof e.alg||!e.alg)throw TypeError('missing "alg" (Algorithm) Parameter value');if(void 0!==t&&t!==e.alg)throw TypeError("JWK alg and alg option value mismatch");return O({...e,ext:o});case"EC":case"OKP":return O({...e,alg:t,ext:o});default:throw new d('Unsupported "kty" (Key Type) Parameter value')}}},4519(e){"use strict";e.exports=JSON.parse('{"name":"dotenv","version":"16.6.1","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","pretest":"npm run lint && npm run dts-check","test":"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"homepage":"https://github.com/motdotla/dotenv#readme","funding":"https://dotenvx.com","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@types/node":"^18.11.3","decache":"^4.6.2","sinon":"^14.0.1","standard":"^17.0.0","standard-version":"^9.5.0","tap":"^19.2.0","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}')},8330(e){"use strict";e.exports=JSON.parse('{"name":"xmcp","description":"The MCP framework","version":"1.5.0","author":{"name":"xmcp","email":"support@xmcp.dev","url":"https://xmcp.dev"},"contributors":[{"name":"Valentina Bearzotti","email":"valebearzotti1@gmail.com","url":"https://github.com/valebearzotti"},{"name":"Jose Rago","email":"jose@basement.studio","url":"https://github.com/ragojose"}],"license":"MIT","keywords":["mcp","modelcontextprotocol","http","stdio"],"repository":{"type":"git","url":"https://github.com/basementstudio/xmcp"},"homepage":"https://xmcp.dev","type":"commonjs","main":"./dist/index.js","types":"./dist/index.d.ts","bin":{"xmcp":"dist/cli.js"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js","default":"./dist/index.js"},"./node":{"types":"./dist/node.d.ts","node":"./dist/node.js"},"./host-bridge":{"types":"./dist/host-bridge.d.ts","import":"./dist/host-bridge.js","require":"./dist/host-bridge.js","default":"./dist/host-bridge.js"},"./headers":{"types":"./dist/runtime/headers.d.ts","require":"./dist/runtime/headers.js","default":"./dist/runtime/headers.js"},"./cloudflare":{"types":"./dist/cloudflare.d.ts","import":"./dist/cloudflare.js","require":"./dist/cloudflare.js","default":"./dist/cloudflare.js"},"./config":{"types":"./dist/config/index.d.ts","import":"./dist/config.js","require":"./dist/config.js","default":"./dist/config.js"},"./package.json":"./package.json","./client":{"types":"./dist/client.d.ts","node":"./dist/client.js"}},"typesVersions":{"*":{"node":["dist/node.d.ts"],"host-bridge":["dist/host-bridge.d.ts"],"headers":["dist/runtime/headers.d.ts"],"cloudflare":["dist/cloudflare.d.ts"],"config":["dist/config/index.d.ts"],"client":["dist/client.d.ts"]}},"files":["dist"],"scripts":{"dev":"cross-env NODE_ENV=development tsx --watch --tsconfig ./bundler.tsconfig.json ./bundler/index.ts","build":"cross-env NODE_ENV=production tsx --tsconfig ./bundler.tsconfig.json ./bundler/index.ts","analyze":"cross-env GENERATE_STATS=true pnpm build && pnpm tsx scripts/analyze-rspack-stats.ts","bench":"tsx bench/run.mts","test:config":"pnpm --dir ../compiler test:config","test:adapters":"node --import tsx --test src/runtime/adapters/*/__tests__/*.test.ts","test:runtime":"node --import tsx --test src/runtime/utils/__tests__/*.test.ts src/runtime/utils/ui/__tests__/*.test.ts","test:client":"node --import tsx --test src/client/__tests__/*.test.ts"},"dependencies":{},"devDependencies":{"@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/node":"^2.0.0","@modelcontextprotocol/server":"^2.0.0","@nestjs/common":"^11.1.12","@rspack/core":"^1.6.7","@types/async-retry":"^1.4.9","@types/content-type":"^1.1.9","@types/express":"^5.0.6","@types/fs-extra":"^11.0.4","@types/jsonwebtoken":"^9.0.10","@types/node":"^22.19.2","@types/react":"^19.2.7","@types/react-dom":"^19.2.3","async-retry":"^1.3.3","chalk":"^5.6.2","chokidar":"^3.6.0","ci-info":"^4.3.1","commander":"^11.1.0","content-type":"^1.0.5","cross-env":"^7.0.3","del":"^7.1.0","dotenv":"^16.6.1","express":"^4.22.1","fastify":"^5.12.5","fs-extra":"^11.3.2","glob":"^11.1.0","is-docker":"^4.0.0","is-wsl":"^3.1.0","jose":"^6.1.3","json5":"^2.2.3","jsonwebtoken":"^9.0.3","memfs":"^4.51.1","postcss-loader":"^8.2.0","raw-body":"^3.0.2","reflect-metadata":"^0.2.2","rxjs":"^7.8.2","ts-checker-rspack-plugin":"^1.2.1","tsx":"^4.21.0","typescript":"^5.9.3","zod-to-json-schema":"^3.25.0"},"peerDependencies":{"@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/server":"^2.0.0","jose":"^6.1.3","react":">=19.0.0","react-dom":">=19.0.0","zod":"^3.25.76 || ^4.0.0"},"peerDependenciesMeta":{"@modelcontextprotocol/client":{"optional":true},"@modelcontextprotocol/server":{"optional":true},"jose":{"optional":true},"react":{"optional":true},"react-dom":{"optional":true}}}')}},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o||"object"==typeof e&&e&&(4&o&&e.__esModule||16&o&&"function"==typeof e.then))return e;var a=Object.create(null);i.r(a);var s={};t=t||[null,r({}),r([]),r(r)];for(var n=2&o&&e;("object"==typeof n||"function"==typeof n)&&!~t.indexOf(n);n=r(n))Object.getOwnPropertyNames(n).forEach(t=>{s[t]=()=>e[t]});return s.default=()=>e,i.d(a,s),a},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{"use strict";let e,t,r,o,a,n,l,c,u;i.r(s),i.d(s,{HOST_CONTEXT_CHANGED_METHOD:()=>fX,isEnvHeader:()=>fj,createSTDIOClient:()=>fq,INITIALIZE_METHOD:()=>fF,LOG_MESSAGE_METHOD:()=>fZ,OPEN_LINK_METHOD:()=>fJ,REQUEST_DISPLAY_MODE_METHOD:()=>fK,inputResponse:()=>n8,disconnectSTDIOClient:()=>fD,embeddedResource:()=>q,isInputRequiredResult:()=>nG,callSTDIOClientTool:()=>fL,headersToRecord:()=>fC,MCP_APPS_PROTOCOL_VERSION:()=>fV,extractToolNamesFromRequest:()=>fU,UI_MESSAGE_METHOD:()=>fG,completable:()=>cJ,acceptedContent:()=>n6,listSTDIOClientTools:()=>fz,UPDATE_MODEL_CONTEXT_METHOD:()=>fB,UrlElicitationRequiredError:()=>nV,createRequestStateCodec:()=>cZ,audio:()=>M,createMcpHostBridge:()=>f1,SIZE_CHANGED_METHOD:()=>fY,image:()=>A,INITIALIZED_METHOD:()=>fH,inputRequired:()=>n3,RESOURCES_READ_METHOD:()=>fW,createContext:()=>N,getRequestContext:()=>D,jwtAuthMiddleware:()=>O,createHTTPClient:()=>fM,apiKeyAuthMiddleware:()=>P});var d,p,h,f,m,y,g,v,b,_,S=i(8583),$=i.n(S),w=i(4953);let E=w.z.object({apiKey:w.z.string().optional(),headerName:w.z.string().optional(),validateApiKey:w.z.function().args(w.z.string()).returns(w.z.promise(w.z.boolean())).optional()}).strict().refine(e=>void 0!==e.apiKey||void 0!==e.validateApiKey,{message:"Either 'apiKey' or 'validateApiKey' must be provided"}).refine(e=>void 0===e.apiKey||void 0===e.validateApiKey,{message:"'apiKey' and 'validateApiKey' are mutually exclusive - provide only one"}),R="Unauthorized: Missing or invalid API key";function P(e){let t=E.safeParse(e);if(!t.success){let r="apiKey"in e,o="validateApiKey"in e;if(r&&o)throw Error("'apiKey' and 'validateApiKey' are mutually exclusive - provide only one");if(r||o)throw Error(`Invalid configuration: ${t.error.message}`);throw Error("Either 'apiKey' or 'validateApiKey' must be provided")}let r=e.headerName??"x-api-key",o="apiKey"in e?e.apiKey:void 0,a="validateApiKey"in e?e.validateApiKey:void 0;return async(t,i,s)=>{let n=t.header(r);!n||"apiKey"in e&&n!==o||a&&!await a(n)?i.status(401).json({error:R}):s()}}var k=i(8400),T=i.n(k);function O(e){return(t,r,o)=>{let a=t.header("Authorization");if(!a||!a.startsWith("Bearer "))return void r.status(401).json({error:"Unauthorized: Missing or malformed Authorization header"});let i=a.slice(7).trim();if(!i)return void r.status(401).json({error:"Unauthorized: Missing access token"});try{let{secret:r,...a}=e;t.user=T().verify(i,r,a),o()}catch(e){r.status(401).json({error:"Unauthorized: Invalid or expired token"})}}}let x=require("async_hooks"),j=(e,t)=>{globalThis[e]=t},C=e=>globalThis[e];function N({name:e,fallback:t=!0}){let r=Symbol.for(`xmcp-context-${e}`),o=Symbol.for(`xmcp-context-${e}-fallback-store`);if(C(r))return C(r);let a=new x.AsyncLocalStorage,i=globalThis[o]??{current:null};j(o,i);let s={provider:(e,r)=>(t&&(i.current=e),a.run(e,r)),getContext:()=>{let r=a.getStore();if(r)return r;if(t&&i.current)return i.current;throw Error(`getContext() can only be used within the ${e} context.`)},setContext:r=>{let o=a.getStore()??(t?i.current:null);if(!o)throw Error(`setContext() can only be used within the ${e} context.`);Object.assign(o,r)}};return j(r,s),s}function I(e){let t;if(e instanceof Uint8Array)t=e;else if(e instanceof ArrayBuffer)t=new Uint8Array(e);else throw TypeError("Expected bytes as a Uint8Array or ArrayBuffer");let r="";for(let e=0;e<t.length;e+=32768)r+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(r)}function A(e,t){return{type:"image",data:I(e),mimeType:t}}function M(e,t){return{type:"audio",data:I(e),mimeType:t}}function q(e,t,r){return{type:"resource",resource:{uri:e,...void 0===r?{}:{mimeType:r},..."string"==typeof t?{text:t}:{blob:I(t)}}}}let z=N({name:"http-request-context"});z.setContext,z.getContext,z.provider;let L=N({name:"request-context",fallback:!1});function D(){try{return L.getContext()}catch{throw Error("getRequestContext() can only be used while handling an MCP request.")}}var U=Object.create,V=Object.defineProperty,F=Object.getOwnPropertyDescriptor,H=Object.getOwnPropertyNames,K=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty,B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);let G=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Z=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),W=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),X=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]),Y=Object.freeze({status:"aborted"});function Q(e,t,r){function o(r,o){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:o,constr:s,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,o);let a=s.prototype,i=Object.keys(a);for(let e=0;e<i.length;e++){let t=i[e];t in r||(r[t]=a[t].bind(r))}}let a=r?.Parent??Object;class i extends a{}function s(e){var t;let a=r?.Parent?new i:this;for(let r of(o(a,e),(t=a._zod).deferred??(t.deferred=[]),a._zod.deferred))r();return a}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Symbol("zod_brand");class ee extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class et extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(v=globalThis).__zod_globalConfig??(v.__zod_globalConfig={});let er=globalThis.__zod_globalConfig;function eo(e){return e&&Object.assign(er,e),er}let ea=/^[cC][0-9a-z]{6,}$/,ei=/^[0-9a-z]+$/,es=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,en=/^[0-9a-vA-V]{20}$/,el=/^[A-Za-z0-9]{27}$/,ec=/^[a-zA-Z0-9_-]{21}$/,eu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ed=/^([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})$/,ep=e=>e?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)$/,eh=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ef=/^(?:(?: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])$/,em=/^(([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}|:))$/,ey=/^((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])$/,eg=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ev=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,eb=/^[A-Za-z0-9_-]*$/,e_=/^https?$/,eS=/^\+[1-9]\d{6,14}$/,e$="(?:(?:\\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])))",ew=RegExp(`^${e$}$`);function eE(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let eR=/^-?\d+$/,eP=/^-?\d+(?:\.\d+)?$/,ek=/^(?:true|false)$/i,eT=/^null$/i,eO=/^[^A-Z]*$/,ex=/^[^a-z]*$/;function ej(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function eC(e,t){return"bigint"==typeof t?t.toString():t}function eN(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function eI(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}let eA=Symbol("evaluating");function eM(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==eA)return void 0===o&&(o=eA,o=r()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function eq(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ez(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function eL(e){return JSON.stringify(e)}let eD="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function eU(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let eV=eN(()=>{if(er.jitless||"undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eF(e){if(!1===eU(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==eU(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function eH(e){return eF(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let eK=new Set(["string","number","symbol"]);function eJ(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eB(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function eG(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}let eZ={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function eW(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function eX(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eY(e){return"string"==typeof e?e:e?.message}function eQ(e,t,r){let o=e.message?e.message:eY(e.inst?._zod.def?.error?.(e))??eY(t?.error?.(e))??eY(r.customError?.(e))??eY(r.localeError?.(e))??"Invalid input",{inst:a,continue:i,input:s,...n}=e;return n.path??(n.path=[]),n.message=o,t?.reportInput&&(n.input=s),n}function e0(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function e1(...e){let[t,r,o]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:o}:{...t}}let e2=Q("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),e9={number:"number",bigint:"bigint",object:"date"},e4=Q("$ZodCheckLessThan",(e,t)=>{e2.init(e,t);let r=e9[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,o=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<o&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),e5=Q("$ZodCheckGreaterThan",(e,t)=>{e2.init(e,t);let r=e9[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,o=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>o&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),e3=Q("$ZodCheckMultipleOf",(e,t)=>{e2.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{let o,a,i;if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0==(a=Math.round(o=r.value/t.value),i=Number.EPSILON*Math.max(Math.abs(o),1),Math.abs(o-a)<i?0:o-a))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),e6=Q("$ZodCheckNumberFormat",(e,t)=>{e2.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[a,i]=eZ[t.format];e._zod.onattach.push(e=>{let o=e._zod.bag;o.format=t.format,o.minimum=a,o.maximum=i,r&&(o.pattern=eR)}),e._zod.check=s=>{let n=s.value;if(r){if(!Number.isInteger(n))return void s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:n,inst:e});if(!Number.isSafeInteger(n))return void(n>0?s.issues.push({input:n,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}):s.issues.push({input:n,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}))}n<a&&s.issues.push({origin:"number",input:n,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),n>i&&s.issues.push({origin:"number",input:n,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),e8=Q("$ZodCheckMaxLength",(e,t)=>{var r;e2.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let o=r.value;if(o.length<=t.maximum)return;let a=e0(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),e7=Q("$ZodCheckMinLength",(e,t)=>{var r;e2.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let o=r.value;if(o.length>=t.minimum)return;let a=e0(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),te=Q("$ZodCheckLengthEquals",(e,t)=>{var r;e2.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let o=r.value,a=o.length;if(a===t.length)return;let i=e0(o),s=a>t.length;r.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),tt=Q("$ZodCheckStringFormat",(e,t)=>{var r,o;e2.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),tr=Q("$ZodCheckRegex",(e,t)=>{tt.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})}}),to=Q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=eO),tt.init(e,t)}),ta=Q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ex),tt.init(e,t)}),ti=Q("$ZodCheckIncludes",(e,t)=>{e2.init(e,t);let r=eJ(t.includes),o=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),ts=Q("$ZodCheckStartsWith",(e,t)=>{e2.init(e,t);let r=RegExp(`^${eJ(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),tn=Q("$ZodCheckEndsWith",(e,t)=>{e2.init(e,t);let r=RegExp(`.*${eJ(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),tl=Q("$ZodCheckOverwrite",(e,t)=>{e2.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class tc{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let tu=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,eC,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},td=Q("$ZodError",tu),tp=Q("$ZodError",tu,{Parent:Error}),th=e=>(t,r,o,a)=>{let i=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new ee;if(s.issues.length){let t=new(a?.Err??e)(s.issues.map(e=>eQ(e,i,eo())));throw eD(t,a?.callee),t}return s.value},tf=e=>async(t,r,o,a)=>{let i=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(a?.Err??e)(s.issues.map(e=>eQ(e,i,eo())));throw eD(t,a?.callee),t}return s.value},tm=e=>(t,r,o)=>{let a=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise)throw new ee;return i.issues.length?{success:!1,error:new(e??td)(i.issues.map(e=>eQ(e,a,eo())))}:{success:!0,data:i.value}},ty=tm(tp),tg=e=>async(t,r,o)=>{let a=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},a);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>eQ(e,a,eo())))}:{success:!0,data:i.value}},tv=tg(tp),tb={major:4,minor:4,patch:3},t_=Q("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tb;let o=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&o.unshift(e),o))for(let r of t._zod.onattach)r(e);if(0===o.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let o,a=eW(e);for(let i of t){if(i._zod.def.when){if(function(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}(e)||!i._zod.def.when(e))continue}else if(a)continue;let t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&r?.async===!1)throw new ee;if(o||s instanceof Promise)o=(o??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(a||(a=eW(e,t)))});else{if(e.issues.length===t)continue;a||(a=eW(e,t))}}return o?o.then(()=>e):e},r=(r,a,i)=>{if(eW(r))return r.aborted=!0,r;let s=t(a,o,i);if(s instanceof Promise){if(!1===i.async)throw new ee;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(a,i)=>{if(i.skipChecks)return e._zod.parse(a,i);if("backward"===i.direction){let t=e._zod.parse({value:a.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,i)):r(t,a,i)}let s=e._zod.parse(a,i);if(s instanceof Promise){if(!1===i.async)throw new ee;return s.then(e=>t(e,o,i))}return t(s,o,i)}}eM(e,"~standard",()=>({validate:t=>{try{let r=ty(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return tv(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),tS=Q("$ZodString",(e,t)=>{var r;let o;t_.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(o=(r=e._zod.bag)?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*",RegExp(`^${o}$`)),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),t$=Q("$ZodStringFormat",(e,t)=>{tt.init(e,t),tS.init(e,t)}),tw=Q("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ed),t$.init(e,t)}),tE=Q("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ep(e))}else t.pattern??(t.pattern=ep());t$.init(e,t)}),tR=Q("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=eh),t$.init(e,t)}),tP=Q("$ZodURL",(e,t)=>{t$.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===e_.source&&!/^https?:\/\//i.test(o))return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});let a=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=a.href:r.value=o;return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),tk=Q("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),t$.init(e,t)}),tT=Q("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ec),t$.init(e,t)}),tO=Q("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ea),t$.init(e,t)}),tx=Q("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ei),t$.init(e,t)}),tj=Q("$ZodULID",(e,t)=>{t.pattern??(t.pattern=es),t$.init(e,t)}),tC=Q("$ZodXID",(e,t)=>{t.pattern??(t.pattern=en),t$.init(e,t)}),tN=Q("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=el),t$.init(e,t)}),tI=Q("$ZodISODateTime",(e,t)=>{let r,o,a;t.pattern??(r=eE({precision:t.precision}),o=["Z"],t.local&&o.push(""),t.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),a=`${r}(?:${o.join("|")})`,t.pattern=RegExp(`^${e$}T(?:${a})$`)),t$.init(e,t)}),tA=Q("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ew),t$.init(e,t)}),tM=Q("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${eE(t)}$`)),t$.init(e,t)}),tq=Q("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eu),t$.init(e,t)}),tz=Q("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ef),t$.init(e,t),e._zod.bag.format="ipv4"}),tL=Q("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=em),t$.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),tD=Q("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ey),t$.init(e,t)}),tU=Q("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=eg),t$.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(2!==o.length)throw Error();let[e,t]=o;if(!t)throw Error();let r=Number(t);if(`${r}`!==t||r<0||r>128)throw Error();new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function tV(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let tF=Q("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ev),t$.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{tV(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),tH=Q("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=eb),t$.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{!function(e){if(!eb.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return tV(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),tK=Q("$ZodE164",(e,t)=>{t.pattern??(t.pattern=eS),t$.init(e,t)}),tJ=Q("$ZodJWT",(e,t)=>{t$.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[o]=r;if(!o)return!1;let a=JSON.parse(atob(o));if("typ"in a&&a?.typ!=="JWT"||!a.alg||t&&(!("alg"in a)||a.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),tB=Q("$ZodNumber",(e,t)=>{t_.init(e,t),e._zod.pattern=e._zod.bag.pattern??eP,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let a=r.value;if("number"==typeof a&&!Number.isNaN(a)&&Number.isFinite(a))return r;let i="number"==typeof a?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...i?{received:i}:{}}),r}}),tG=Q("$ZodNumberFormat",(e,t)=>{e6.init(e,t),tB.init(e,t)}),tZ=Q("$ZodBoolean",(e,t)=>{t_.init(e,t),e._zod.pattern=ek,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let a=r.value;return"boolean"==typeof a||r.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:e}),r}}),tW=Q("$ZodNull",(e,t)=>{t_.init(e,t),e._zod.pattern=eT,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let o=t.value;return null===o||t.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),t}}),tX=Q("$ZodAny",(e,t)=>{t_.init(e,t),e._zod.parse=e=>e}),tY=Q("$ZodUnknown",(e,t)=>{t_.init(e,t),e._zod.parse=e=>e}),tQ=Q("$ZodNever",(e,t)=>{t_.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function t0(e,t,r){e.issues.length&&t.issues.push(...eX(r,e.issues)),t.value[r]=e.value}let t1=Q("$ZodArray",(e,t)=>{t_.init(e,t),e._zod.parse=(r,o)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),r;r.value=Array(a.length);let i=[];for(let e=0;e<a.length;e++){let s=a[e],n=t.element._zod.run({value:s,issues:[]},o);n instanceof Promise?i.push(n.then(t=>t0(t,r,e))):t0(n,r,e)}return i.length?Promise.all(i).then(()=>r):r}});function t2(e,t,r,o,a,i){let s=r in o;if(e.issues.length){if(a&&i&&!s)return;t.issues.push(...eX(r,e.issues))}if(!s&&!a){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?s&&(t.value[r]=void 0):t.value[r]=e.value}function t9(e){var t;let r=Object.keys(e.shape);for(let t of r)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${t}": expected a Zod schema`);let o=Object.keys(t=e.shape).filter(e=>"optional"===t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(o)}}function t4(e,t,r,o,a,i){let s=[],n=a.keySet,l=a.catchall._zod,c=l.def.type,u="optional"===l.optin,d="optional"===l.optout;for(let a in t){if("__proto__"===a||n.has(a))continue;if("never"===c){s.push(a);continue}let i=l.run({value:t[a],issues:[]},o);i instanceof Promise?e.push(i.then(e=>t2(e,r,a,t,u,d))):t2(i,r,a,t,u,d)}return(s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length)?Promise.all(e).then(()=>r):r}let t5=Q("$ZodObject",(e,t)=>{let r;t_.init(e,t);let o=Object.getOwnPropertyDescriptor(t,"shape");if(!o?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}let a=eN(()=>t9(t));eM(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let o=e[t]._zod;if(o.values)for(let e of(r[t]??(r[t]=new Set),o.values))r[t].add(e)}return r});let i=t.catchall;e._zod.parse=(t,o)=>{r??(r=a.value);let s=t.value;if(!eU(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};let n=[],l=r.shape;for(let e of r.keys){let r=l[e],a="optional"===r._zod.optin,i="optional"===r._zod.optout,c=r._zod.run({value:s[e],issues:[]},o);c instanceof Promise?n.push(c.then(r=>t2(r,t,e,s,a,i))):t2(c,t,e,s,a,i)}return i?t4(n,s,t,o,a.value,e):n.length?Promise.all(n).then(()=>t):t}}),t3=Q("$ZodObjectJIT",(e,t)=>{let r,o;t5.init(e,t);let a=e._zod.parse,i=eN(()=>t9(t)),s=!er.jitless,n=s&&eV.value,l=t.catchall;e._zod.parse=(c,u)=>{o??(o=i.value);let d=c.value;return eU(d)?s&&n&&u?.async===!1&&!0!==u.jitless?(r||(r=(e=>{let t=new tc(["shape","payload","ctx"]),r=i.value,o=e=>{let t=eL(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let a=Object.create(null),s=0;for(let e of r.keys)a[e]=`key_${s++}`;for(let i of(t.write("const newResult = {};"),r.keys)){let r=a[i],s=eL(i),n=e[i],l=n?._zod?.optin==="optional",c=n?._zod?.optout==="optional";t.write(`const ${r} = ${o(i)};`),l&&c?t.write(`
|
|
2
|
-
|
|
3
|
-
if (${s} in input) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
1
|
+
!function(t,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("zod/v3"));else if("function"==typeof define&&define.amd)define(["zod/v3"],r);else{var o="object"==typeof exports?r(require("zod/v3")):r(t["zod/v3"]);for(var a in o)("object"==typeof exports?exports:t)[a]=o[a]}}(this,t=>(()=>{var r,o,a={9454(t,r,o){"use strict";var a=o(181).Buffer,i=o(181).SlowBuffer;function s(t,r){if(!a.isBuffer(t)||!a.isBuffer(r)||t.length!==r.length)return!1;for(var o=0,i=0;i<t.length;i++)o|=t[i]^r[i];return 0===o}t.exports=s,s.install=function(){a.prototype.equal=i.prototype.equal=function(t){return s(this,t)}};var n=a.prototype.equal,l=i.prototype.equal;s.restore=function(){a.prototype.equal=n,i.prototype.equal=l}},6507(t,r,o){"use strict";let a=o(5317),i=o(8388),s=o(442);function n(t,r,o){let n=i(t,r,o),l=a.spawn(n.command,n.args,n.options);return s.hookChildProcess(l,n),l}t.exports=n,t.exports.spawn=n,t.exports.sync=function(t,r,o){let n=i(t,r,o),l=a.spawnSync(n.command,n.args,n.options);return l.error=l.error||s.verifyENOENTSync(l.status,n),l},t.exports._parse=i,t.exports._enoent=s},442(t){"use strict";let r="win32"===process.platform;function o(t,r){return Object.assign(Error(`${r} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${r} ${t.command}`,path:t.command,spawnargs:t.args})}function a(t,a){return r&&1===t&&!a.file?o(a.original,"spawn"):null}t.exports={hookChildProcess:function(t,o){if(!r)return;let i=t.emit;t.emit=function(r,s){if("exit"===r){let r=a(s,o);if(r)return i.call(t,"error",r)}return i.apply(t,arguments)}},verifyENOENT:a,verifyENOENTSync:function(t,a){return r&&1===t&&!a.file?o(a.original,"spawnSync"):null},notFoundError:o}},8388(t,r,o){"use strict";let a=o(6928),i=o(3803),s=o(2077),n=o(1880),l="win32"===process.platform,c=/\.(?:com|exe)$/i,u=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;t.exports=function(t,r,o){r&&!Array.isArray(r)&&(o=r,r=null);let d={command:t,args:r=r?r.slice(0):[],options:o=Object.assign({},o),file:void 0,original:{command:t,args:r}};return o.shell?d:function(t){let r;if(!l)return t;let o=(t.file=i(t),(r=t.file&&n(t.file))?(t.args.unshift(t.file),t.command=r,i(t)):t.file),d=!c.test(o);if(t.options.forceShell||d){let r=u.test(o);t.command=a.normalize(t.command),t.command=s.command(t.command),t.args=t.args.map(t=>s.argument(t,r));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}(d)}},2077(t){"use strict";let r=/([()\][%!^"`<>&|;, *?])/g;t.exports.command=function(t){return t.replace(r,"^$1")},t.exports.argument=function(t,o){return t=(t=(t=`${t}`).replace(/(?=(\\+?)?)\1"/g,'$1$1\\"')).replace(/(?=(\\+?)?)\1$/,"$1$1"),t=(t=`"${t}"`).replace(r,"^$1"),o&&(t=t.replace(r,"^$1")),t}},1880(t,r,o){"use strict";let a=o(9896),i=o(600);t.exports=function(t){let r,o=Buffer.alloc(150);try{r=a.openSync(t,"r"),a.readSync(r,o,0,150,0),a.closeSync(r)}catch(t){}return i(o.toString())}},3803(t,r,o){"use strict";let a=o(6928),i=o(1905),s=o(9695);function n(t,r){let o,n=t.options.env||process.env,l=process.cwd(),c=null!=t.options.cwd,u=c&&void 0!==process.chdir&&!process.chdir.disabled;if(u)try{process.chdir(t.options.cwd)}catch(t){}try{o=i.sync(t.command,{path:n[s({env:n})],pathExt:r?a.delimiter:void 0})}catch(t){}finally{u&&process.chdir(l)}return o&&(o=a.resolve(c?t.options.cwd:"",o)),o}t.exports=function(t){return n(t)||n(t,!0)}},8583(t,r,o){let a=o(9896),i=o(6928),s=o(857),n=o(6982),l=o(4519).version,c=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function u(t){console.log(`[dotenv@${l}][DEBUG] ${t}`)}function d(t){console.log(`[dotenv@${l}] ${t}`)}function p(t){return t&&t.DOTENV_KEY&&t.DOTENV_KEY.length>0?t.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function h(t){let r=null;if(t&&t.path&&t.path.length>0)if(Array.isArray(t.path))for(let o of t.path)a.existsSync(o)&&(r=o.endsWith(".vault")?o:`${o}.vault`);else r=t.path.endsWith(".vault")?t.path:`${t.path}.vault`;else r=i.resolve(process.cwd(),".env.vault");return a.existsSync(r)?r:null}function f(t){return"~"===t[0]?i.join(s.homedir(),t.slice(1)):t}let m={configDotenv:function(t){let r,o=i.resolve(process.cwd(),".env"),s="utf8",n=!!(t&&t.debug),l=!t||!("quiet"in t)||t.quiet;t&&t.encoding?s=t.encoding:n&&u("No encoding is specified. UTF-8 is used by default");let c=[o];if(t&&t.path)if(Array.isArray(t.path))for(let r of(c=[],t.path))c.push(f(r));else c=[f(t.path)];let p={};for(let o of c)try{let r=m.parse(a.readFileSync(o,{encoding:s}));m.populate(p,r,t)}catch(t){n&&u(`Failed to load ${o} ${t.message}`),r=t}let h=process.env;if(t&&null!=t.processEnv&&(h=t.processEnv),m.populate(h,p,t),n||!l){let t=Object.keys(p).length,o=[];for(let t of c)try{let r=i.relative(process.cwd(),t);o.push(r)}catch(o){n&&u(`Failed to load ${t} ${o.message}`),r=o}d(`injecting env (${t}) from ${o.join(",")}`)}return r?{parsed:p,error:r}:{parsed:p}},_configVault:function(t){let r=!!(t&&t.debug),o=!t||!("quiet"in t)||t.quiet;(r||!o)&&d("Loading env from encrypted .env.vault");let a=m._parseVault(t),i=process.env;return t&&null!=t.processEnv&&(i=t.processEnv),m.populate(i,a,t),{parsed:a}},_parseVault:function(t){let r,o=h(t=t||{});t.path=o;let a=m.configDotenv(t);if(!a.parsed){let t=Error(`MISSING_DATA: Cannot parse ${o} for an unknown reason`);throw t.code="MISSING_DATA",t}let i=p(t).split(","),s=i.length;for(let t=0;t<s;t++)try{let o=i[t].trim(),s=function(t,r){let o;try{o=new URL(r)}catch(t){if("ERR_INVALID_URL"===t.code){let t=Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw t.code="INVALID_DOTENV_KEY",t}throw t}let a=o.password;if(!a){let t=Error("INVALID_DOTENV_KEY: Missing key part");throw t.code="INVALID_DOTENV_KEY",t}let i=o.searchParams.get("environment");if(!i){let t=Error("INVALID_DOTENV_KEY: Missing environment part");throw t.code="INVALID_DOTENV_KEY",t}let s=`DOTENV_VAULT_${i.toUpperCase()}`,n=t.parsed[s];if(!n){let t=Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${s} in your .env.vault file.`);throw t.code="NOT_FOUND_DOTENV_ENVIRONMENT",t}return{ciphertext:n,key:a}}(a,o);r=m.decrypt(s.ciphertext,s.key);break}catch(r){if(t+1>=s)throw r}return m.parse(r)},config:function(t){if(0===p(t).length)return m.configDotenv(t);let r=h(t);if(!r){var o;return o=`You set DOTENV_KEY but you are missing a .env.vault file at ${r}. Did you forget to build it?`,console.log(`[dotenv@${l}][WARN] ${o}`),m.configDotenv(t)}return m._configVault(t)},decrypt:function(t,r){let o=Buffer.from(r.slice(-64),"hex"),a=Buffer.from(t,"base64"),i=a.subarray(0,12),s=a.subarray(-16);a=a.subarray(12,-16);try{let t=n.createDecipheriv("aes-256-gcm",o,i);return t.setAuthTag(s),`${t.update(a)}${t.final()}`}catch(a){let t=a instanceof RangeError,r="Invalid key length"===a.message,o="Unsupported state or unable to authenticate data"===a.message;if(t||r){let t=Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw t.code="INVALID_DOTENV_KEY",t}if(o){let t=Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw t.code="DECRYPTION_FAILED",t}throw a}},parse:function(t){let r,o={},a=t.toString();for(a=a.replace(/\r\n?/mg,"\n");null!=(r=c.exec(a));){let t=r[1],a=r[2]||"",i=(a=a.trim())[0];a=a.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),'"'===i&&(a=(a=a.replace(/\\n/g,"\n")).replace(/\\r/g,"\r")),o[t]=a}return o},populate:function(t,r,o={}){let a=!!(o&&o.debug),i=!!(o&&o.override);if("object"!=typeof r){let t=Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw t.code="OBJECT_REQUIRED",t}for(let o of Object.keys(r))Object.prototype.hasOwnProperty.call(t,o)?(!0===i&&(t[o]=r[o]),a&&(!0===i?u(`"${o}" is already defined and WAS overwritten`):u(`"${o}" is already defined and was NOT overwritten`))):t[o]=r[o]}};t.exports.configDotenv=m.configDotenv,t.exports._configVault=m._configVault,t.exports._parseVault=m._parseVault,t.exports.config=m.config,t.exports.decrypt=m.decrypt,t.exports.parse=m.parse,t.exports.populate=m.populate,t.exports=m},9053(t,r,o){"use strict";var a=o(6608).Buffer,i=o(2188);function s(t){if(a.isBuffer(t))return t;if("string"==typeof t)return a.from(t,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function n(t,r,o){for(var a=0;r+a<o&&0===t[r+a];)++a;return t[r+a]>=128&&--a,a}t.exports={derToJose:function(t,r){t=s(t);var o=i(r),n=o+1,l=t.length,c=0;if(48!==t[c++])throw Error('Could not find expected "seq"');var u=t[c++];if(129===u&&(u=t[c++]),l-c<u)throw Error('"seq" specified length of "'+u+'", only "'+(l-c)+'" remaining');if(2!==t[c++])throw Error('Could not find expected "int" for "r"');var d=t[c++];if(l-c-2<d)throw Error('"r" specified length of "'+d+'", only "'+(l-c-2)+'" available');if(n<d)throw Error('"r" specified length of "'+d+'", max of "'+n+'" is acceptable');var p=c;if(c+=d,2!==t[c++])throw Error('Could not find expected "int" for "s"');var h=t[c++];if(l-c!==h)throw Error('"s" specified length of "'+h+'", expected "'+(l-c)+'"');if(n<h)throw Error('"s" specified length of "'+h+'", max of "'+n+'" is acceptable');var f=c;if((c+=h)!==l)throw Error('Expected to consume entire buffer, but "'+(l-c)+'" bytes remain');var m=o-d,y=o-h,g=a.allocUnsafe(m+d+y+h);for(c=0;c<m;++c)g[c]=0;t.copy(g,c,p+Math.max(-m,0),p+d),c=o;for(var v=c;c<v+y;++c)g[c]=0;return t.copy(g,c,f+Math.max(-y,0),f+h),g=(g=g.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(t,r){t=s(t);var o=i(r),l=t.length;if(l!==2*o)throw TypeError('"'+r+'" signatures must be "'+2*o+'" bytes, saw "'+l+'"');var c=n(t,0,o),u=n(t,o,t.length),d=o-c,p=o-u,h=2+d+1+1+p,f=h<128,m=a.allocUnsafe((f?2:3)+h),y=0;return m[y++]=48,f?m[y++]=h:(m[y++]=129,m[y++]=255&h),m[y++]=2,m[y++]=d,c<0?(m[y++]=0,y+=t.copy(m,y,0,o)):y+=t.copy(m,y,c,o),m[y++]=2,m[y++]=p,u<0?(m[y++]=0,t.copy(m,y,o)):t.copy(m,y,o+u),m}}},2188(t){"use strict";function r(t){return(t/8|0)+ +(t%8!=0)}var o={ES256:r(256),ES384:r(384),ES512:r(521)};t.exports=function(t){var r=o[t];if(r)return r;throw Error('Unknown algorithm "'+t+'"')}},9344(t,r,o){var a;function i(t,r,o){if("function"==typeof r&&(o=r,r={}),!o){if("function"!=typeof Promise)throw TypeError("callback not provided");return new Promise(function(o,a){i(t,r||{},function(t,r){t?a(t):o(r)})})}a(t,r||{},function(t,a){t&&("EACCES"===t.code||r&&r.ignoreErrors)&&(t=null,a=!1),o(t,a)})}o(9896),a="win32"===process.platform||global.TESTING_WINDOWS?o(8541):o(709),t.exports=i,i.sync=function(t,r){try{return a.sync(t,r||{})}catch(t){if(r&&r.ignoreErrors||"EACCES"===t.code)return!1;throw t}}},709(t,r,o){t.exports=i,i.sync=function(t,r){return s(a.statSync(t),r)};var a=o(9896);function i(t,r,o){a.stat(t,function(t,a){o(t,!t&&s(a,r))})}function s(t,r){var o,a,i,s,n,l,c,u,d;return t.isFile()&&(o=t,a=r,i=o.mode,s=o.uid,n=o.gid,l=void 0!==a.uid?a.uid:process.getuid&&process.getuid(),c=void 0!==a.gid?a.gid:process.getgid&&process.getgid(),u=parseInt("100",8),d=parseInt("010",8),i&parseInt("001",8)||i&d&&n===c||i&u&&s===l||i&(u|d)&&0===l)}},8541(t,r,o){t.exports=s,s.sync=function(t,r){return i(a.statSync(t),t,r)};var a=o(9896);function i(t,r,o){if(!t.isSymbolicLink()&&!t.isFile())return!1;var a=void 0!==o.pathExt?o.pathExt:process.env.PATHEXT;if(!a||-1!==(a=a.split(";")).indexOf(""))return!0;for(var i=0;i<a.length;i++){var s=a[i].toLowerCase();if(s&&r.substr(-s.length).toLowerCase()===s)return!0}return!1}function s(t,r,o){a.stat(t,function(a,s){o(a,!a&&i(s,t,r))})}},2548(t,r,o){var a=o(3263);t.exports=function(t,r){r=r||{};var o=a.decode(t,r);if(!o)return null;var i=o.payload;if("string"==typeof i)try{var s=JSON.parse(i);null!==s&&"object"==typeof s&&(i=s)}catch(t){}return!0===r.complete?{header:o.header,payload:i,signature:o.signature}:i}},8400(t,r,o){t.exports={decode:o(2548),verify:o(6467),sign:o(9147),JsonWebTokenError:o(1957),NotBeforeError:o(4470),TokenExpiredError:o(7788)}},1957(t){var r=function(t,r){Error.call(this,t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=t,r&&(this.inner=r)};r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,t.exports=r},4470(t,r,o){var a=o(1957),i=function(t,r){a.call(this,t),this.name="NotBeforeError",this.date=r};i.prototype=Object.create(a.prototype),i.prototype.constructor=i,t.exports=i},7788(t,r,o){var a=o(1957),i=function(t,r){a.call(this,t),this.name="TokenExpiredError",this.expiredAt=r};i.prototype=Object.create(a.prototype),i.prototype.constructor=i,t.exports=i},5841(t,r,o){t.exports=o(3895).satisfies(process.version,">=15.7.0")},953(t,r,o){t.exports=o(3895).satisfies(process.version,"^6.12.0 || >=8.0.0")},455(t,r,o){t.exports=o(3895).satisfies(process.version,">=16.9.0")},4559(t,r,o){var a=o(3866);t.exports=function(t,r){var o=r||Math.floor(Date.now()/1e3);if("string"==typeof t){var i=a(t);if(void 0===i)return;return Math.floor(o+i/1e3)}if("number"==typeof t)return o+t}},723(t,r,o){let a=o(5841),i=o(455),s={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},n={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};t.exports=function(t,r){if(!t||!r)return;let o=r.asymmetricKeyType;if(!o)return;let l=s[o];if(!l)throw Error(`Unknown key type "${o}".`);if(!l.includes(t))throw Error(`"alg" parameter for "${o}" key type must be one of: ${l.join(", ")}.`);if(a)switch(o){case"ec":let c=r.asymmetricKeyDetails.namedCurve,u=n[t];if(c!==u)throw Error(`"alg" parameter "${t}" requires curve "${u}".`);break;case"rsa-pss":if(i){let o=parseInt(t.slice(-3),10),{hashAlgorithm:a,mgf1HashAlgorithm:i,saltLength:s}=r.asymmetricKeyDetails;if(a!==`sha${o}`||i!==a)throw Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${t}.`);if(void 0!==s&&s>o>>3)throw Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${t}.`)}}}},9147(t,r,o){let a=o(4559),i=o(953),s=o(723),n=o(3263),l=o(5357),c=o(6782),u=o(5250),d=o(8094),p=o(6052),h=o(1251),f=o(8430),{KeyObject:m,createSecretKey:y,createPrivateKey:g}=o(6982),v=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];i&&v.splice(3,0,"PS256","PS384","PS512");let b={expiresIn:{isValid:function(t){return u(t)||h(t)&&t},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(t){return u(t)||h(t)&&t},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(t){return h(t)||Array.isArray(t)},message:'"audience" must be a string or array'},algorithm:{isValid:l.bind(null,v),message:'"algorithm" must be a valid string enum value'},header:{isValid:p,message:'"header" must be an object'},encoding:{isValid:h,message:'"encoding" must be a string'},issuer:{isValid:h,message:'"issuer" must be a string'},subject:{isValid:h,message:'"subject" must be a string'},jwtid:{isValid:h,message:'"jwtid" must be a string'},noTimestamp:{isValid:c,message:'"noTimestamp" must be a boolean'},keyid:{isValid:h,message:'"keyid" must be a string'},mutatePayload:{isValid:c,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:c,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:c,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},_={iat:{isValid:d,message:'"iat" should be a number of seconds'},exp:{isValid:d,message:'"exp" should be a number of seconds'},nbf:{isValid:d,message:'"nbf" should be a number of seconds'}};function S(t,r,o,a){if(!p(o))throw Error('Expected "'+a+'" to be a plain object.');Object.keys(o).forEach(function(i){let s=t[i];if(!s){if(!r)throw Error('"'+i+'" is not allowed in "'+a+'"');return}if(!s.isValid(o[i]))throw Error(s.message)})}let $={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},w=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];t.exports=function(t,r,o,i){var l,c;"function"==typeof o?(i=o,o={}):o=o||{};let u="object"==typeof t&&!Buffer.isBuffer(t),d=Object.assign({alg:o.algorithm||"HS256",typ:u?"JWT":void 0,kid:o.keyid},o.header);function p(t){if(i)return i(t);throw t}if(!r&&"none"!==o.algorithm)return p(Error("secretOrPrivateKey must have a value"));if(null!=r&&!(r instanceof m))try{r=g(r)}catch(t){try{r=y("string"==typeof r?Buffer.from(r):r)}catch(t){return p(Error("secretOrPrivateKey is not valid key material"))}}if(d.alg.startsWith("HS")&&"secret"!==r.type)return p(Error(`secretOrPrivateKey must be a symmetric key when using ${d.alg}`));if(/^(?:RS|PS|ES)/.test(d.alg)){if("private"!==r.type)return p(Error(`secretOrPrivateKey must be an asymmetric key when using ${d.alg}`));if(!o.allowInsecureKeySizes&&!d.alg.startsWith("ES")&&void 0!==r.asymmetricKeyDetails&&r.asymmetricKeyDetails.modulusLength<2048)return p(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${d.alg}`))}if(void 0===t)return p(Error("payload is required"));if(u){try{l=t,S(_,!0,l,"payload")}catch(t){return p(t)}o.mutatePayload||(t=Object.assign({},t))}else{let r=w.filter(function(t){return void 0!==o[t]});if(r.length>0)return p(Error("invalid "+r.join(",")+" option for "+typeof t+" payload"))}if(void 0!==t.exp&&void 0!==o.expiresIn)return p(Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(void 0!==t.nbf&&void 0!==o.notBefore)return p(Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{c=o,S(b,!1,c,"options")}catch(t){return p(t)}if(!o.allowInvalidAsymmetricKeyTypes)try{s(d.alg,r)}catch(t){return p(t)}let h=t.iat||Math.floor(Date.now()/1e3);if(o.noTimestamp?delete t.iat:u&&(t.iat=h),void 0!==o.notBefore){try{t.nbf=a(o.notBefore,h)}catch(t){return p(t)}if(void 0===t.nbf)return p(Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(void 0!==o.expiresIn&&"object"==typeof t){try{t.exp=a(o.expiresIn,h)}catch(t){return p(t)}if(void 0===t.exp)return p(Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys($).forEach(function(r){let a=$[r];if(void 0!==o[r]){if(void 0!==t[a])return p(Error('Bad "options.'+r+'" option. The payload already has an "'+a+'" property.'));t[a]=o[r]}});let v=o.encoding||"utf8";if("function"==typeof i)i=i&&f(i),n.createSign({header:d,privateKey:r,payload:t,encoding:v}).once("error",i).once("done",function(t){if(!o.allowInsecureKeySizes&&/^(?:RS|PS)/.test(d.alg)&&t.length<256)return i(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${d.alg}`));i(null,t)});else{let a=n.sign({header:d,payload:t,secret:r,encoding:v});if(!o.allowInsecureKeySizes&&/^(?:RS|PS)/.test(d.alg)&&a.length<256)throw Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${d.alg}`);return a}}},6467(t,r,o){let a=o(1957),i=o(4470),s=o(7788),n=o(2548),l=o(4559),c=o(723),u=o(953),d=o(3263),{KeyObject:p,createSecretKey:h,createPublicKey:f}=o(6982),m=["RS256","RS384","RS512"],y=["ES256","ES384","ES512"],g=["RS256","RS384","RS512"],v=["HS256","HS384","HS512"];u&&(m.splice(m.length,0,"PS256","PS384","PS512"),g.splice(g.length,0,"PS256","PS384","PS512")),t.exports=function(t,r,o,u){let b,_,S;if("function"!=typeof o||u||(u=o,o={}),o||(o={}),o=Object.assign({},o),b=u||function(t,r){if(t)throw t;return r},o.clockTimestamp&&"number"!=typeof o.clockTimestamp)return b(new a("clockTimestamp must be a number"));if(void 0!==o.nonce&&("string"!=typeof o.nonce||""===o.nonce.trim()))return b(new a("nonce must be a non-empty string"));if(void 0!==o.allowInvalidAsymmetricKeyTypes&&"boolean"!=typeof o.allowInvalidAsymmetricKeyTypes)return b(new a("allowInvalidAsymmetricKeyTypes must be a boolean"));let $=o.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return b(new a("jwt must be provided"));if("string"!=typeof t)return b(new a("jwt must be a string"));let w=t.split(".");if(3!==w.length)return b(new a("jwt malformed"));try{_=n(t,{complete:!0})}catch(t){return b(t)}if(!_)return b(new a("invalid token"));let E=_.header;if("function"==typeof r){if(!u)return b(new a("verify must be called asynchronous if secret or public key is provided as a callback"));S=r}else S=function(t,o){return o(null,r)};return S(E,function(r,n){let u;if(r)return b(new a("error in secret or public key callback: "+r.message));let S=""!==w[2].trim();if(!S&&n)return b(new a("jwt signature is required"));if(S&&!n)return b(new a("secret or public key must be provided"));if(!S&&!o.algorithms)return b(new a('please specify "none" in "algorithms" to verify unsigned tokens'));if(null!=n&&!(n instanceof p))try{n=f(n)}catch(t){try{n=h("string"==typeof n?Buffer.from(n):n)}catch(t){return b(new a("secretOrPublicKey is not valid key material"))}}if(o.algorithms||("secret"===n.type?o.algorithms=v:["rsa","rsa-pss"].includes(n.asymmetricKeyType)?o.algorithms=g:"ec"===n.asymmetricKeyType?o.algorithms=y:o.algorithms=m),-1===o.algorithms.indexOf(_.header.alg))return b(new a("invalid algorithm"));if(E.alg.startsWith("HS")&&"secret"!==n.type)return b(new a(`secretOrPublicKey must be a symmetric key when using ${E.alg}`));if(/^(?:RS|PS|ES)/.test(E.alg)&&"public"!==n.type)return b(new a(`secretOrPublicKey must be an asymmetric key when using ${E.alg}`));if(!o.allowInvalidAsymmetricKeyTypes)try{c(E.alg,n)}catch(t){return b(t)}try{u=d.verify(t,_.header.alg,n)}catch(t){return b(t)}if(!u)return b(new a("invalid signature"));let R=_.payload;if(void 0!==R.nbf&&!o.ignoreNotBefore){if("number"!=typeof R.nbf)return b(new a("invalid nbf value"));if(R.nbf>$+(o.clockTolerance||0))return b(new i("jwt not active",new Date(1e3*R.nbf)))}if(void 0!==R.exp&&!o.ignoreExpiration){if("number"!=typeof R.exp)return b(new a("invalid exp value"));if($>=R.exp+(o.clockTolerance||0))return b(new s("jwt expired",new Date(1e3*R.exp)))}if(o.audience){let t=Array.isArray(o.audience)?o.audience:[o.audience];if(!(Array.isArray(R.aud)?R.aud:[R.aud]).some(function(r){return t.some(function(t){return t instanceof RegExp?t.test(r):t===r})}))return b(new a("jwt audience invalid. expected: "+t.join(" or ")))}if(o.issuer&&("string"==typeof o.issuer&&R.iss!==o.issuer||Array.isArray(o.issuer)&&-1===o.issuer.indexOf(R.iss)))return b(new a("jwt issuer invalid. expected: "+o.issuer));if(o.subject&&R.sub!==o.subject)return b(new a("jwt subject invalid. expected: "+o.subject));if(o.jwtid&&R.jti!==o.jwtid)return b(new a("jwt jwtid invalid. expected: "+o.jwtid));if(o.nonce&&R.nonce!==o.nonce)return b(new a("jwt nonce invalid. expected: "+o.nonce));if(o.maxAge){if("number"!=typeof R.iat)return b(new a("iat required when maxAge is specified"));let t=l(o.maxAge,R.iat);if(void 0===t)return b(new a('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if($>=t+(o.clockTolerance||0))return b(new s("maxAge exceeded",new Date(1e3*t)))}return!0===o.complete?b(null,{header:E,payload:R,signature:_.signature}):b(null,R)})}},2357(t,r,o){var a,i=o(6608).Buffer,s=o(6982),n=o(9053),l=o(9023),c="secret must be a string or buffer",u="key must be a string or a buffer",d="function"==typeof s.createPublicKey;function p(t){if(!i.isBuffer(t)&&"string"!=typeof t&&(!d||"object"!=typeof t||"string"!=typeof t.type||"string"!=typeof t.asymmetricKeyType||"function"!=typeof t.export))throw y(u)}function h(t){if(!i.isBuffer(t)&&"string"!=typeof t&&"object"!=typeof t)throw y("key must be a string, a buffer or an object")}function f(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function m(t){var r=4-(t=t.toString()).length%4;if(4!==r)for(var o=0;o<r;++o)t+="=";return t.replace(/\-/g,"+").replace(/_/g,"/")}function y(t){var r=[].slice.call(arguments,1);return TypeError(l.format.bind(l,t).apply(null,r))}function g(t){var r;return r=t,i.isBuffer(r)||"string"==typeof r||(t=JSON.stringify(t)),t}function v(t){return function(r,o){!function(t){if(!i.isBuffer(t)){if("string"!=typeof t){if(!d||"object"!=typeof t||"secret"!==t.type||"function"!=typeof t.export)throw y(c)}}}(o),r=g(r);var a=s.createHmac("sha"+t,o);return f((a.update(r),a.digest("base64")))}}d&&(u+=" or a KeyObject",c+="or a KeyObject");var b="timingSafeEqual"in s?function(t,r){return t.byteLength===r.byteLength&&s.timingSafeEqual(t,r)}:function(t,r){return a||(a=o(9454)),a(t,r)};function _(t){return function(r,o,a){var s=v(t)(r,a);return b(i.from(o),i.from(s))}}function S(t){return function(r,o){h(o),r=g(r);var a=s.createSign("RSA-SHA"+t);return f((a.update(r),a.sign(o,"base64")))}}function $(t){return function(r,o,a){p(a),r=g(r),o=m(o);var i=s.createVerify("RSA-SHA"+t);return i.update(r),i.verify(a,o,"base64")}}function w(t){return function(r,o){h(o),r=g(r);var a=s.createSign("RSA-SHA"+t);return f((a.update(r),a.sign({key:o,padding:s.constants.RSA_PKCS1_PSS_PADDING,saltLength:s.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}function E(t){return function(r,o,a){p(a),r=g(r),o=m(o);var i=s.createVerify("RSA-SHA"+t);return i.update(r),i.verify({key:a,padding:s.constants.RSA_PKCS1_PSS_PADDING,saltLength:s.constants.RSA_PSS_SALTLEN_DIGEST},o,"base64")}}function R(t){var r=S(t);return function(){var o=r.apply(null,arguments);return n.derToJose(o,"ES"+t)}}function P(t){var r=$(t);return function(o,a,i){return r(o,a=n.joseToDer(a,"ES"+t).toString("base64"),i)}}function k(){return function(){return""}}function O(){return function(t,r){return""===r}}t.exports=function(t){var r=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!r)throw y('"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".',t);var o=(r[1]||r[3]).toLowerCase(),a=r[2];return{sign:({hs:v,rs:S,ps:w,es:R,none:k})[o](a),verify:({hs:_,rs:$,ps:E,es:P,none:O})[o](a)}}},3263(t,r,o){var a=o(9615),i=o(6747);r.ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],r.sign=a.sign,r.verify=i.verify,r.decode=i.decode,r.isValid=i.isValid,r.createSign=function(t){return new a(t)},r.createVerify=function(t){return new i(t)}},6360(t,r,o){var a=o(6608).Buffer,i=o(2203);function s(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=a.alloc(0),this;if("function"==typeof t.pipe)return this.buffer=a.alloc(0),t.pipe(this),this;if(t.length||"object"==typeof t)return this.buffer=t,this.writable=!1,process.nextTick((function(){this.emit("end",t),this.readable=!1,this.emit("close")}).bind(this)),this;throw TypeError("Unexpected data type ("+typeof t+")")}o(9023).inherits(s,i),s.prototype.write=function(t){this.buffer=a.concat([this.buffer,a.from(t)]),this.emit("data",t)},s.prototype.end=function(t){t&&this.write(t),this.emit("end",t),this.emit("close"),this.writable=!1,this.readable=!1},t.exports=s},9615(t,r,o){var a=o(6608).Buffer,i=o(6360),s=o(2357),n=o(2203),l=o(5911),c=o(9023);function u(t,r){return a.from(t,r).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function d(t){var r,o,a,i=t.header,n=t.payload,d=t.secret||t.privateKey,p=t.encoding,h=s(i.alg),f=(r=(r=p)||"utf8",o=u(l(i),"binary"),a=u(l(n),r),c.format("%s.%s",o,a)),m=h.sign(f,d);return c.format("%s.%s",f,m)}function p(t){var r=t.secret;if(r=null==(r=null==r?t.privateKey:r)?t.key:r,!0===/^hs/i.test(t.header.alg)&&null==r)throw TypeError("secret must be a string or buffer or a KeyObject");var o=new i(r);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=o,this.payload=new i(t.payload),this.secret.once("close",(function(){!this.payload.writable&&this.readable&&this.sign()}).bind(this)),this.payload.once("close",(function(){!this.secret.writable&&this.readable&&this.sign()}).bind(this))}c.inherits(p,n),p.prototype.sign=function(){try{var t=d({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",t),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(t){this.readable=!1,this.emit("error",t),this.emit("close")}},p.sign=d,t.exports=p},5911(t,r,o){var a=o(181).Buffer;t.exports=function(t){return"string"==typeof t?t:"number"==typeof t||a.isBuffer(t)?t.toString():JSON.stringify(t)}},6747(t,r,o){var a=o(6608).Buffer,i=o(6360),s=o(2357),n=o(2203),l=o(5911),c=o(9023),u=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function d(t){var r=t.split(".",1)[0],o=a.from(r,"base64").toString("binary");if("[object Object]"===Object.prototype.toString.call(o))return o;try{return JSON.parse(o)}catch(t){return}}function p(t){return t.split(".")[2]}function h(t){return u.test(t)&&!!d(t)}function f(t,r,o){if(!r){var a=Error("Missing algorithm parameter for jws.verify");throw a.code="MISSING_ALGORITHM",a}var i=p(t=l(t)),n=t.split(".",2).join(".");return s(r).verify(n,i,o)}function m(t,r){if(r=r||{},!h(t=l(t)))return null;var o,i,s=d(t);if(!s)return null;var n=(o=o||"utf8",i=t.split(".")[1],a.from(i,"base64").toString(o));return("JWT"===s.typ||r.json)&&(n=JSON.parse(n,r.encoding)),{header:s,payload:n,signature:p(t)}}function y(t){var r=(t=t||{}).secret;if(r=null==(r=null==r?t.publicKey:r)?t.key:r,!0===/^hs/i.test(t.algorithm)&&null==r)throw TypeError("secret must be a string or buffer or a KeyObject");var o=new i(r);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=o,this.signature=new i(t.signature),this.secret.once("close",(function(){!this.signature.writable&&this.readable&&this.verify()}).bind(this)),this.signature.once("close",(function(){!this.secret.writable&&this.readable&&this.verify()}).bind(this))}c.inherits(y,n),y.prototype.verify=function(){try{var t=f(this.signature.buffer,this.algorithm,this.key.buffer),r=m(this.signature.buffer,this.encoding);return this.emit("done",t,r),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(t){this.readable=!1,this.emit("error",t),this.emit("close")}},y.decode=m,y.isValid=h,y.verify=f,t.exports=y},5357(t){var r,o,a=1/0,i=0/0,s=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=/^(?:0|[1-9]\d*)$/,d=parseInt;function p(t){return t!=t}var h=Object.prototype,f=h.hasOwnProperty,m=h.toString,y=h.propertyIsEnumerable,g=(r=Object.keys,o=Object,function(t){return r(o(t))}),v=Math.max,b=Array.isArray;function _(t){var r,o,a;return null!=t&&"number"==typeof(r=t.length)&&r>-1&&r%1==0&&r<=0x1fffffffffffff&&"[object Function]"!=(a=S(o=t)?m.call(o):"")&&"[object GeneratorFunction]"!=a}function S(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}function $(t){return!!t&&"object"==typeof t}t.exports=function(t,r,o,w){t=_(t)?t:function(t){return t?function(t,r){for(var o=-1,a=t?t.length:0,i=Array(a);++o<a;)i[o]=r(t[o],o,t);return i}(_(t)?function(t,r){var o,a,i,s,n=b(t)||$(a=o=t)&&_(a)&&f.call(o,"callee")&&(!y.call(o,"callee")||"[object Arguments]"==m.call(o))?function(t,r){for(var o=-1,a=Array(t);++o<t;)a[o]=r(o);return a}(t.length,String):[],l=n.length,c=!!l;for(var d in t){f.call(t,d)&&!(c&&("length"==d||(i=d,(s=null==(s=l)?0x1fffffffffffff:s)&&("number"==typeof i||u.test(i))&&i>-1&&i%1==0&&i<s)))&&n.push(d)}return n}(t):function(t){if(o=(r=t)&&r.constructor,r!==("function"==typeof o&&o.prototype||h))return g(t);var r,o,a=[];for(var i in Object(t))f.call(t,i)&&"constructor"!=i&&a.push(i);return a}(t),function(r){return t[r]}):[]}(t),o=o&&!w?(P=(R=(E=o)?(E=function(t){if("number"==typeof t)return t;if("symbol"==typeof(r=t)||$(r)&&"[object Symbol]"==m.call(r))return i;if(S(t)){var r,o="function"==typeof t.valueOf?t.valueOf():t;t=S(o)?o+"":o}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(s,"");var a=l.test(t);return a||c.test(t)?d(t.slice(2),a?2:8):n.test(t)?i:+t}(E))===a||E===-a?(E<0?-1:1)*17976931348623157e292:E==E?E:0:0===E?E:0)%1,R==R?P?R-P:R:0):0;var E,R,P,k,O=t.length;return o<0&&(o=v(O+o,0)),"string"==typeof(k=t)||!b(k)&&$(k)&&"[object String]"==m.call(k)?o<=O&&t.indexOf(r,o)>-1:!!O&&function(t,r,o){if(r!=r){for(var a=t.length,i=o+-1;++i<a;)if(p(t[i],i,t))return i;return -1}for(var s=o-1,n=t.length;++s<n;)if(t[s]===r)return s;return -1}(t,r,o)>-1}},6782(t){var r=Object.prototype.toString;t.exports=function(t){var o;return!0===t||!1===t||!!(o=t)&&"object"==typeof o&&"[object Boolean]"==r.call(t)}},5250(t){var r=1/0,o=0/0,a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,n=/^0o[0-7]+$/i,l=parseInt,c=Object.prototype.toString;function u(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}t.exports=function(t){var d,p,h;return"number"==typeof t&&t==(h=(p=(d=t)?(d=function(t){if("number"==typeof t)return t;if("symbol"==typeof(r=t)||r&&"object"==typeof r&&"[object Symbol]"==c.call(r))return o;if(u(t)){var r,d="function"==typeof t.valueOf?t.valueOf():t;t=u(d)?d+"":d}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(a,"");var p=s.test(t);return p||n.test(t)?l(t.slice(2),p?2:8):i.test(t)?o:+t}(d))===r||d===-r?(d<0?-1:1)*17976931348623157e292:d==d?d:0:0===d?d:0)%1,p==p?h?p-h:p:0)}},8094(t){var r=Object.prototype.toString;t.exports=function(t){return"number"==typeof t||!!t&&"object"==typeof t&&"[object Number]"==r.call(t)}},6052(t){var r,o,a=Object.prototype,i=Function.prototype.toString,s=a.hasOwnProperty,n=i.call(Object),l=a.toString,c=(r=Object.getPrototypeOf,o=Object,function(t){return r(o(t))});t.exports=function(t){if(!(t&&"object"==typeof t)||"[object Object]"!=l.call(t)||function(t){var r=!1;if(null!=t&&"function"!=typeof t.toString)try{r=!!(t+"")}catch(t){}return r}(t))return!1;var r=c(t);if(null===r)return!0;var o=s.call(r,"constructor")&&r.constructor;return"function"==typeof o&&o instanceof o&&i.call(o)==n}},1251(t){var r=Object.prototype.toString,o=Array.isArray;t.exports=function(t){var a;return"string"==typeof t||!o(t)&&!!(a=t)&&"object"==typeof a&&"[object String]"==r.call(t)}},8430(t){var r=1/0,o=0/0,a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,n=/^0o[0-7]+$/i,l=parseInt,c=Object.prototype.toString;function u(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}t.exports=function(t){var d,p,h,f,m=2,y=t;if("function"!=typeof y)throw TypeError("Expected a function");return h=(p=(d=m)?(d=function(t){if("number"==typeof t)return t;if("symbol"==typeof(r=t)||r&&"object"==typeof r&&"[object Symbol]"==c.call(r))return o;if(u(t)){var r,d="function"==typeof t.valueOf?t.valueOf():t;t=u(d)?d+"":d}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(a,"");var p=s.test(t);return p||n.test(t)?l(t.slice(2),p?2:8):i.test(t)?o:+t}(d))===r||d===-r?(d<0?-1:1)*17976931348623157e292:d==d?d:0:0===d?d:0)%1,m=p==p?h?p-h:p:0,function(){return--m>0&&(f=y.apply(this,arguments)),m<=1&&(y=void 0),f}}},3866(t){function r(t,r,o,a){return Math.round(t/o)+" "+a+(r>=1.5*o?"s":"")}t.exports=function(t,o){o=o||{};var a,i,s,n,l=typeof t;if("string"===l&&t.length>0){var c=t;if(!((c=String(c)).length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(u){var d=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*d;case"weeks":case"week":case"w":return 6048e5*d;case"days":case"day":case"d":return 864e5*d;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*d;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*d;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:break}}}return}if("number"===l&&isFinite(t)){return o.long?(i=Math.abs(a=t))>=864e5?r(a,i,864e5,"day"):i>=36e5?r(a,i,36e5,"hour"):i>=6e4?r(a,i,6e4,"minute"):i>=1e3?r(a,i,1e3,"second"):a+" ms":(n=Math.abs(s=t))>=864e5?Math.round(s/864e5)+"d":n>=36e5?Math.round(s/36e5)+"h":n>=6e4?Math.round(s/6e4)+"m":n>=1e3?Math.round(s/1e3)+"s":s+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},9695(t){"use strict";let r=(t={})=>{let r=t.env||process.env;return"win32"!==(t.platform||process.platform)?"PATH":Object.keys(r).reverse().find(t=>"PATH"===t.toUpperCase())||"Path"};t.exports=r,t.exports.default=r},6608(t,r,o){var a=o(181),i=a.Buffer;function s(t,r){for(var o in t)r[o]=t[o]}function n(t,r,o){return i(t,r,o)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=a:(s(a,r),r.Buffer=n),n.prototype=Object.create(i.prototype),s(i,n),n.from=function(t,r,o){if("number"==typeof t)throw TypeError("Argument must not be a number");return i(t,r,o)},n.alloc=function(t,r,o){if("number"!=typeof t)throw TypeError("Argument must be a number");var a=i(t);return void 0!==r?"string"==typeof o?a.fill(r,o):a.fill(r):a.fill(0),a},n.allocUnsafe=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return i(t)},n.allocUnsafeSlow=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return a.SlowBuffer(t)}},8610(t,r,o){"use strict";let a=Symbol("SemVer ANY");class i{static get ANY(){return a}constructor(t,r){if(r=s(r),t instanceof i)if(!!r.loose===t.loose)return t;else t=t.value;u("comparator",t=t.trim().split(/\s+/).join(" "),r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===a?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(t){let r=this.options.loose?n[l.COMPARATORLOOSE]:n[l.COMPARATOR],o=t.match(r);if(!o)throw TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new d(o[2],this.options.loose):this.semver=a}toString(){return this.value}test(t){if(u("Comparator.test",t,this.options.loose),this.semver===a||t===a)return!0;if("string"==typeof t)try{t=new d(t,this.options)}catch(t){return!1}return c(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof i))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(t.value,r).test(this.value):""===t.operator?""===t.value||new p(this.value,r).test(t.semver):!((r=s(r)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===t.value)||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||c(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||c(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">"))}}t.exports=i;let s=o(4621),{safeRe:n,t:l}=o(152),c=o(5461),u=o(674),d=o(2398),p=o(2069)},2069(t,r,o){"use strict";let a=/\s+/g;class i{constructor(t,r){if(r=n(r),t instanceof i)if(!!r.loose===t.loose&&!!r.includePrerelease===t.includePrerelease)return t;else return new i(t.raw,r);if(t instanceof l)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(a," "),this.set=this.raw.split("||").map(t=>this.parseRange(t.trim())).filter(t=>t.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const t=this.set[0];if(this.set=this.set.filter(t=>!v(t[0])),0===this.set.length)this.set=[t];else if(this.set.length>1){for(const t of this.set)if(1===t.length&&b(t[0])){this.set=[t];break}}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let t=0;t<r.length;t++)t>0&&(this.formatted+=" "),this.formatted+=r[t].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){let r=((this.options.includePrerelease&&y)|(this.options.loose&&g))+":"+t,o=s.get(r);if(o)return o;let a=this.options.loose,i=a?d[p.HYPHENRANGELOOSE]:d[p.HYPHENRANGE];c("hyphen replace",t=t.replace(i,j(this.options.includePrerelease))),c("comparator trim",t=t.replace(d[p.COMPARATORTRIM],h)),c("tilde trim",t=t.replace(d[p.TILDETRIM],f)),c("caret trim",t=t.replace(d[p.CARETTRIM],m));let n=t.split(" ").map(t=>S(t,this.options)).join(" ").split(/\s+/).map(t=>x(t,this.options));a&&(n=n.filter(t=>(c("loose invalid filter",t,this.options),!!t.match(d[p.COMPARATORLOOSE])))),c("range list",n);let u=new Map;for(let t of n.map(t=>new l(t,this.options))){if(v(t))return[t];u.set(t.value,t)}u.size>1&&u.has("")&&u.delete("");let b=[...u.values()];return s.set(r,b),b}intersects(t,r){if(!(t instanceof i))throw TypeError("a Range is required");return this.set.some(o=>_(o,r)&&t.set.some(t=>_(t,r)&&o.every(o=>t.every(t=>o.intersects(t,r)))))}test(t){if(!t)return!1;if("string"==typeof t)try{t=new u(t,this.options)}catch(t){return!1}for(let r=0;r<this.set.length;r++)if(C(this.set[r],t,this.options))return!0;return!1}}t.exports=i;let s=new(o(2044)),n=o(4621),l=o(8610),c=o(674),u=o(2398),{safeRe:d,t:p,comparatorTrimReplace:h,tildeTrimReplace:f,caretTrimReplace:m}=o(152),{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:g}=o(5076),v=t=>"<0.0.0-0"===t.value,b=t=>""===t.value,_=(t,r)=>{let o=!0,a=t.slice(),i=a.pop();for(;o&&a.length;)o=a.every(t=>i.intersects(t,r)),i=a.pop();return o},S=(t,r)=>(c("comp",t=t.replace(d[p.BUILD],""),r),c("caret",t=R(t,r)),c("tildes",t=w(t,r)),c("xrange",t=k(t,r)),c("stars",t=T(t,r)),t),$=t=>!t||"x"===t.toLowerCase()||"*"===t,w=(t,r)=>t.trim().split(/\s+/).map(t=>E(t,r)).join(" "),E=(t,r)=>{let o=r.loose?d[p.TILDELOOSE]:d[p.TILDE];return t.replace(o,(r,o,a,i,s)=>{let n;return c("tilde",t,r,o,a,i,s),$(o)?n="":$(a)?n=`>=${o}.0.0 <${+o+1}.0.0-0`:$(i)?n=`>=${o}.${a}.0 <${o}.${+a+1}.0-0`:s?(c("replaceTilde pr",s),n=`>=${o}.${a}.${i}-${s} <${o}.${+a+1}.0-0`):n=`>=${o}.${a}.${i} <${o}.${+a+1}.0-0`,c("tilde return",n),n})},R=(t,r)=>t.trim().split(/\s+/).map(t=>P(t,r)).join(" "),P=(t,r)=>{c("caret",t,r);let o=r.loose?d[p.CARETLOOSE]:d[p.CARET],a=r.includePrerelease?"-0":"";return t.replace(o,(r,o,i,s,n)=>{let l;return c("caret",t,r,o,i,s,n),$(o)?l="":$(i)?l=`>=${o}.0.0${a} <${+o+1}.0.0-0`:$(s)?l="0"===o?`>=${o}.${i}.0${a} <${o}.${+i+1}.0-0`:`>=${o}.${i}.0${a} <${+o+1}.0.0-0`:n?(c("replaceCaret pr",n),l="0"===o?"0"===i?`>=${o}.${i}.${s}-${n} <${o}.${i}.${+s+1}-0`:`>=${o}.${i}.${s}-${n} <${o}.${+i+1}.0-0`:`>=${o}.${i}.${s}-${n} <${+o+1}.0.0-0`):(c("no pr"),l="0"===o?"0"===i?`>=${o}.${i}.${s}${a} <${o}.${i}.${+s+1}-0`:`>=${o}.${i}.${s}${a} <${o}.${+i+1}.0-0`:`>=${o}.${i}.${s} <${+o+1}.0.0-0`),c("caret return",l),l})},k=(t,r)=>(c("replaceXRanges",t,r),t.split(/\s+/).map(t=>O(t,r)).join(" ")),O=(t,r)=>{t=t.trim();let o=r.loose?d[p.XRANGELOOSE]:d[p.XRANGE];return t.replace(o,(o,a,i,s,n,l)=>{c("xRange",t,o,a,i,s,n,l);let u=$(i),d=u||$(s),p=d||$(n);return"="===a&&p&&(a=""),l=r.includePrerelease?"-0":"",u?o=">"===a||"<"===a?"<0.0.0-0":"*":a&&p?(d&&(s=0),n=0,">"===a?(a=">=",d?(i=+i+1,s=0):s=+s+1,n=0):"<="===a&&(a="<",d?i=+i+1:s=+s+1),"<"===a&&(l="-0"),o=`${a+i}.${s}.${n}${l}`):d?o=`>=${i}.0.0${l} <${+i+1}.0.0-0`:p&&(o=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),c("xRange return",o),o})},T=(t,r)=>(c("replaceStars",t,r),t.trim().replace(d[p.STAR],"")),x=(t,r)=>(c("replaceGTE0",t,r),t.trim().replace(d[r.includePrerelease?p.GTE0PRE:p.GTE0],"")),j=t=>(r,o,a,i,s,n,l,c,u,d,p,h)=>(o=$(a)?"":$(i)?`>=${a}.0.0${t?"-0":""}`:$(s)?`>=${a}.${i}.0${t?"-0":""}`:n?`>=${o}`:`>=${o}${t?"-0":""}`,c=$(u)?"":$(d)?`<${+u+1}.0.0-0`:$(p)?`<${u}.${+d+1}.0-0`:h?`<=${u}.${d}.${p}-${h}`:t?`<${u}.${d}.${+p+1}-0`:`<=${c}`,`${o} ${c}`.trim()),C=(t,r,o)=>{for(let o=0;o<t.length;o++)if(!t[o].test(r))return!1;if(r.prerelease.length&&!o.includePrerelease){for(let o=0;o<t.length;o++)if(c(t[o].semver),t[o].semver!==l.ANY&&t[o].semver.prerelease.length>0){let a=t[o].semver;if(a.major===r.major&&a.minor===r.minor&&a.patch===r.patch)return!0}return!1}return!0}},2398(t,r,o){"use strict";let a=o(674),{MAX_LENGTH:i,MAX_SAFE_INTEGER:s}=o(5076),{safeRe:n,t:l}=o(152),c=o(4621),{compareIdentifiers:u}=o(9101);class d{constructor(t,r){if(r=c(r),t instanceof d)if(!!r.loose===t.loose&&!!r.includePrerelease===t.includePrerelease)return t;else t=t.version;else if("string"!=typeof t)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>i)throw TypeError(`version is longer than ${i} characters`);a("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const o=t.trim().match(r.loose?n[l.LOOSE]:n[l.FULL]);if(!o)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>s||this.major<0)throw TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(t=>{if(/^[0-9]+$/.test(t)){let r=+t;if(r>=0&&r<s)return r}return t}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(a("SemVer.compare",this.version,this.options,t),!(t instanceof d)){if("string"==typeof t&&t===this.version)return 0;t=new d(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return(t instanceof d||(t=new d(t,this.options)),this.major<t.major)?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof d||(t=new d(t,this.options)),this.prerelease.length&&!t.prerelease.length)return -1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let o=this.prerelease[r],i=t.prerelease[r];if(a("prerelease compare",r,o,i),void 0===o&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===o)return -1;else if(o===i)continue;else return u(o,i)}while(++r)}compareBuild(t){t instanceof d||(t=new d(t,this.options));let r=0;do{let o=this.build[r],i=t.build[r];if(a("build compare",r,o,i),void 0===o&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===o)return -1;else if(o===i)continue;else return u(o,i)}while(++r)}inc(t,r,o){if(t.startsWith("pre")){if(!r&&!1===o)throw Error("invalid increment argument: identifier is empty");if(r){let t=`-${r}`.match(this.options.loose?n[l.PRERELEASELOOSE]:n[l.PRERELEASE]);if(!t||t[1]!==r)throw Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,o),this.inc("pre",r,o);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",r,o),this.inc("pre",r,o);break;case"release":if(0===this.prerelease.length)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{let t=+!!Number(o);if(0===this.prerelease.length)this.prerelease=[t];else{let a=this.prerelease.length;for(;--a>=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(r===this.prerelease.join(".")&&!1===o)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(t)}}if(r){let a=[r,t];!1===o&&(a=[r]),0===u(this.prerelease[0],r)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}t.exports=d},5608(t,r,o){"use strict";let a=o(6802);t.exports=(t,r)=>{let o=a(t.trim().replace(/^[=v]+/,""),r);return o?o.version:null}},5461(t,r,o){"use strict";let a=o(8271),i=o(733),s=o(1686),n=o(6479),l=o(7257),c=o(5850);t.exports=(t,r,o,u)=>{switch(r){case"===":return"object"==typeof t&&(t=t.version),"object"==typeof o&&(o=o.version),t===o;case"!==":return"object"==typeof t&&(t=t.version),"object"==typeof o&&(o=o.version),t!==o;case"":case"=":case"==":return a(t,o,u);case"!=":return i(t,o,u);case">":return s(t,o,u);case">=":return n(t,o,u);case"<":return l(t,o,u);case"<=":return c(t,o,u);default:throw TypeError(`Invalid operator: ${r}`)}}},7771(t,r,o){"use strict";let a=o(2398),i=o(6802),{safeRe:s,t:n}=o(152);t.exports=(t,r)=>{if(t instanceof a)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;let o=null;if((r=r||{}).rtl){let a,i=r.includePrerelease?s[n.COERCERTLFULL]:s[n.COERCERTL];for(;(a=i.exec(t))&&(!o||o.index+o[0].length!==t.length);)o&&a.index+a[0].length===o.index+o[0].length||(o=a),i.lastIndex=a.index+a[1].length+a[2].length;i.lastIndex=-1}else o=t.match(r.includePrerelease?s[n.COERCEFULL]:s[n.COERCE]);if(null===o)return null;let l=o[2],c=o[3]||"0",u=o[4]||"0",d=r.includePrerelease&&o[5]?`-${o[5]}`:"",p=r.includePrerelease&&o[6]?`+${o[6]}`:"";return i(`${l}.${c}.${u}${d}${p}`,r)}},8767(t,r,o){"use strict";let a=o(2398);t.exports=(t,r,o)=>{let i=new a(t,o),s=new a(r,o);return i.compare(s)||i.compareBuild(s)}},6293(t,r,o){"use strict";let a=o(6958);t.exports=(t,r)=>a(t,r,!0)},6958(t,r,o){"use strict";let a=o(2398);t.exports=(t,r,o)=>new a(t,o).compare(new a(r,o))},3086(t,r,o){"use strict";let a=o(6802);t.exports=(t,r)=>{let o=a(t,null,!0),i=a(r,null,!0),s=o.compare(i);if(0===s)return null;let n=s>0,l=n?o:i,c=n?i:o,u=!!l.prerelease.length;if(c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(0===c.compareMain(l))return c.minor&&!c.patch?"minor":"patch"}let d=u?"pre":"";return o.major!==i.major?d+"major":o.minor!==i.minor?d+"minor":o.patch!==i.patch?d+"patch":"prerelease"}},8271(t,r,o){"use strict";let a=o(6958);t.exports=(t,r,o)=>0===a(t,r,o)},1686(t,r,o){"use strict";let a=o(6958);t.exports=(t,r,o)=>a(t,r,o)>0},6479(t,r,o){"use strict";let a=o(6958);t.exports=(t,r,o)=>a(t,r,o)>=0},3625(t,r,o){"use strict";let a=o(2398);t.exports=(t,r,o,i,s)=>{"string"==typeof o&&(s=i,i=o,o=void 0);try{return new a(t instanceof a?t.version:t,o).inc(r,i,s).version}catch(t){return null}}},7257(t,r,o){"use strict";let a=o(6958);t.exports=(t,r,o)=>0>a(t,r,o)},5850(t,r,o){"use strict";let a=o(6958);t.exports=(t,r,o)=>0>=a(t,r,o)},7744(t,r,o){"use strict";let a=o(2398);t.exports=(t,r)=>new a(t,r).major},4812(t,r,o){"use strict";let a=o(2398);t.exports=(t,r)=>new a(t,r).minor},733(t,r,o){"use strict";let a=o(6958);t.exports=(t,r,o)=>0!==a(t,r,o)},6802(t,r,o){"use strict";let a=o(2398);t.exports=(t,r,o=!1)=>{if(t instanceof a)return t;try{return new a(t,r)}catch(t){if(!o)return null;throw t}}},8643(t,r,o){"use strict";let a=o(2398);t.exports=(t,r)=>new a(t,r).patch},9283(t,r,o){"use strict";let a=o(6802);t.exports=(t,r)=>{let o=a(t,r);return o&&o.prerelease.length?o.prerelease:null}},7032(t,r,o){"use strict";let a=o(6958);t.exports=(t,r,o)=>a(r,t,o)},9839(t,r,o){"use strict";let a=o(8767);t.exports=(t,r)=>t.sort((t,o)=>a(o,t,r))},4056(t,r,o){"use strict";let a=o(2069);t.exports=(t,r,o)=>{try{r=new a(r,o)}catch(t){return!1}return r.test(t)}},7697(t,r,o){"use strict";let a=o(8767);t.exports=(t,r)=>t.sort((t,o)=>a(t,o,r))},6807(t,r,o){"use strict";let a=o(6802);t.exports=(t,r)=>{let o=a(t,r);return o?o.version:null}},3895(t,r,o){"use strict";let a=o(152),i=o(5076),s=o(2398),n=o(9101),l=o(6802),c=o(6807),u=o(5608),d=o(3625),p=o(3086),h=o(7744),f=o(4812),m=o(8643),y=o(9283),g=o(6958),v=o(7032),b=o(6293),_=o(8767),S=o(7697),$=o(9839),w=o(1686),E=o(7257),R=o(8271),P=o(733),k=o(6479),O=o(5850),T=o(5461),x=o(7771),j=o(8610),C=o(2069),N=o(4056),I=o(6613),A=o(7114),M=o(1008),q=o(203),z=o(5372),L=o(4713),D=o(4497),U=o(9272),V=o(3490);t.exports={parse:l,valid:c,clean:u,inc:d,diff:p,major:h,minor:f,patch:m,prerelease:y,compare:g,rcompare:v,compareLoose:b,compareBuild:_,sort:S,rsort:$,gt:w,lt:E,eq:R,neq:P,gte:k,lte:O,cmp:T,coerce:x,Comparator:j,Range:C,satisfies:N,toComparators:I,maxSatisfying:A,minSatisfying:M,minVersion:q,validRange:z,outside:L,gtr:D,ltr:U,intersects:V,simplifyRange:o(4039),subset:o(22),SemVer:s,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers}},5076(t){"use strict";t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||0x1fffffffffffff,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},674(t){"use strict";t.exports="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}},9101(t){"use strict";let r=/^[0-9]+$/,o=(t,o)=>{if("number"==typeof t&&"number"==typeof o)return t===o?0:t<o?-1:1;let a=r.test(t),i=r.test(o);return a&&i&&(t*=1,o*=1),t===o?0:a&&!i?-1:i&&!a?1:t<o?-1:1};t.exports={compareIdentifiers:o,rcompareIdentifiers:(t,r)=>o(r,t)}},2044(t){"use strict";t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(void 0!==r)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&void 0!==r){if(this.map.size>=this.max){let t=this.map.keys().next().value;this.delete(t)}this.map.set(t,r)}return this}}},4621(t){"use strict";let r=Object.freeze({loose:!0}),o=Object.freeze({});t.exports=t=>t?"object"!=typeof t?r:t:o},152(t,r,o){"use strict";let{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:s}=o(5076),n=o(674),l=(r=t.exports={}).re=[],c=r.safeRe=[],u=r.src=[],d=r.safeSrc=[],p=r.t={},h=0,f="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",s],[f,i]],y=(t,r,o)=>{let a=(t=>{for(let[r,o]of m)t=t.split(`${r}*`).join(`${r}{0,${o}}`).split(`${r}+`).join(`${r}{1,${o}}`);return t})(r),i=h++;n(t,i,r),p[t]=i,u[i]=r,d[i]=a,l[i]=new RegExp(r,o?"g":void 0),c[i]=new RegExp(a,o?"g":void 0)};y("NUMERICIDENTIFIER","0|[1-9]\\d*"),y("NUMERICIDENTIFIERLOOSE","\\d+"),y("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),y("MAINVERSION",`(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})`),y("MAINVERSIONLOOSE",`(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})`),y("PRERELEASEIDENTIFIER",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIER]})`),y("PRERELEASEIDENTIFIERLOOSE",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIERLOOSE]})`),y("PRERELEASE",`(?:-(${u[p.PRERELEASEIDENTIFIER]}(?:\\.${u[p.PRERELEASEIDENTIFIER]})*))`),y("PRERELEASELOOSE",`(?:-?(${u[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[p.PRERELEASEIDENTIFIERLOOSE]})*))`),y("BUILDIDENTIFIER",`${f}+`),y("BUILD",`(?:\\+(${u[p.BUILDIDENTIFIER]}(?:\\.${u[p.BUILDIDENTIFIER]})*))`),y("FULLPLAIN",`v?${u[p.MAINVERSION]}${u[p.PRERELEASE]}?${u[p.BUILD]}?`),y("FULL",`^${u[p.FULLPLAIN]}$`),y("LOOSEPLAIN",`[v=\\s]*${u[p.MAINVERSIONLOOSE]}${u[p.PRERELEASELOOSE]}?${u[p.BUILD]}?`),y("LOOSE",`^${u[p.LOOSEPLAIN]}$`),y("GTLT","((?:<|>)?=?)"),y("XRANGEIDENTIFIERLOOSE",`${u[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),y("XRANGEIDENTIFIER",`${u[p.NUMERICIDENTIFIER]}|x|X|\\*`),y("XRANGEPLAIN",`[v=\\s]*(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:${u[p.PRERELEASE]})?${u[p.BUILD]}?)?)?`),y("XRANGEPLAINLOOSE",`[v=\\s]*(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:${u[p.PRERELEASELOOSE]})?${u[p.BUILD]}?)?)?`),y("XRANGE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAIN]}$`),y("XRANGELOOSE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAINLOOSE]}$`),y("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),y("COERCE",`${u[p.COERCEPLAIN]}(?:$|[^\\d])`),y("COERCEFULL",u[p.COERCEPLAIN]+`(?:${u[p.PRERELEASE]})?`+`(?:${u[p.BUILD]})?`+"(?:$|[^\\d])"),y("COERCERTL",u[p.COERCE],!0),y("COERCERTLFULL",u[p.COERCEFULL],!0),y("LONETILDE","(?:~>?)"),y("TILDETRIM",`(\\s*)${u[p.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",y("TILDE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAIN]}$`),y("TILDELOOSE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAINLOOSE]}$`),y("LONECARET","(?:\\^)"),y("CARETTRIM",`(\\s*)${u[p.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",y("CARET",`^${u[p.LONECARET]}${u[p.XRANGEPLAIN]}$`),y("CARETLOOSE",`^${u[p.LONECARET]}${u[p.XRANGEPLAINLOOSE]}$`),y("COMPARATORLOOSE",`^${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]})$|^$`),y("COMPARATOR",`^${u[p.GTLT]}\\s*(${u[p.FULLPLAIN]})$|^$`),y("COMPARATORTRIM",`(\\s*)${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]}|${u[p.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",y("HYPHENRANGE",`^\\s*(${u[p.XRANGEPLAIN]})\\s+-\\s+(${u[p.XRANGEPLAIN]})\\s*$`),y("HYPHENRANGELOOSE",`^\\s*(${u[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[p.XRANGEPLAINLOOSE]})\\s*$`),y("STAR","(<|>)?=?\\s*\\*"),y("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),y("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},4497(t,r,o){"use strict";let a=o(4713);t.exports=(t,r,o)=>a(t,r,">",o)},3490(t,r,o){"use strict";let a=o(2069);t.exports=(t,r,o)=>(t=new a(t,o),r=new a(r,o),t.intersects(r,o))},9272(t,r,o){"use strict";let a=o(4713);t.exports=(t,r,o)=>a(t,r,"<",o)},7114(t,r,o){"use strict";let a=o(2398),i=o(2069);t.exports=(t,r,o)=>{let s=null,n=null,l=null;try{l=new i(r,o)}catch(t){return null}return t.forEach(t=>{l.test(t)&&(!s||-1===n.compare(t))&&(n=new a(s=t,o))}),s}},1008(t,r,o){"use strict";let a=o(2398),i=o(2069);t.exports=(t,r,o)=>{let s=null,n=null,l=null;try{l=new i(r,o)}catch(t){return null}return t.forEach(t=>{l.test(t)&&(!s||1===n.compare(t))&&(n=new a(s=t,o))}),s}},203(t,r,o){"use strict";let a=o(2398),i=o(2069),s=o(1686);t.exports=(t,r)=>{t=new i(t,r);let o=new a("0.0.0");if(t.test(o)||(o=new a("0.0.0-0"),t.test(o)))return o;o=null;for(let r=0;r<t.set.length;++r){let i=t.set[r],n=null;i.forEach(t=>{let r=new a(t.semver.version);switch(t.operator){case">":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":(!n||s(r,n))&&(n=r);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${t.operator}`)}}),n&&(!o||s(o,n))&&(o=n)}return o&&t.test(o)?o:null}},4713(t,r,o){"use strict";let a=o(2398),i=o(8610),{ANY:s}=i,n=o(2069),l=o(4056),c=o(1686),u=o(7257),d=o(5850),p=o(6479);t.exports=(t,r,o,h)=>{let f,m,y,g,v;switch(t=new a(t,h),r=new n(r,h),o){case">":f=c,m=d,y=u,g=">",v=">=";break;case"<":f=u,m=p,y=c,g="<",v="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(l(t,r,h))return!1;for(let o=0;o<r.set.length;++o){let a=r.set[o],n=null,l=null;if(a.forEach(t=>{t.semver===s&&(t=new i(">=0.0.0")),n=n||t,l=l||t,f(t.semver,n.semver,h)?n=t:y(t.semver,l.semver,h)&&(l=t)}),n.operator===g||n.operator===v||(!l.operator||l.operator===g)&&m(t,l.semver)||l.operator===v&&y(t,l.semver))return!1}return!0}},4039(t,r,o){"use strict";let a=o(4056),i=o(6958);t.exports=(t,r,o)=>{let s=[],n=null,l=null,c=t.sort((t,r)=>i(t,r,o));for(let t of c)a(t,r,o)?(l=t,n||(n=t)):(l&&s.push([n,l]),l=null,n=null);n&&s.push([n,null]);let u=[];for(let[t,r]of s)t===r?u.push(t):r||t!==c[0]?r?t===c[0]?u.push(`<=${r}`):u.push(`${t} - ${r}`):u.push(`>=${t}`):u.push("*");let d=u.join(" || "),p="string"==typeof r.raw?r.raw:String(r);return d.length<p.length?d:r}},22(t,r,o){"use strict";let a=o(2069),i=o(8610),{ANY:s}=i,n=o(4056),l=o(6958),c=[new i(">=0.0.0-0")],u=[new i(">=0.0.0")],d=(t,r,o)=>{let a,i,d,f,m,y,g;if(t===r)return!0;if(1===t.length&&t[0].semver===s)if(1===r.length&&r[0].semver===s)return!0;else t=o.includePrerelease?c:u;if(1===r.length&&r[0].semver===s)if(o.includePrerelease)return!0;else r=u;let v=new Set;for(let r of t)">"===r.operator||">="===r.operator?a=p(a,r,o):"<"===r.operator||"<="===r.operator?i=h(i,r,o):v.add(r.semver);if(v.size>1)return null;if(a&&i&&((d=l(a.semver,i.semver,o))>0||0===d&&(">="!==a.operator||"<="!==i.operator)))return null;for(let t of v){if(a&&!n(t,String(a),o)||i&&!n(t,String(i),o))return null;for(let a of r)if(!n(t,String(a),o))return!1;return!0}let b=!!i&&!o.includePrerelease&&!!i.semver.prerelease.length&&i.semver,_=!!a&&!o.includePrerelease&&!!a.semver.prerelease.length&&a.semver;for(let t of(b&&1===b.prerelease.length&&"<"===i.operator&&0===b.prerelease[0]&&(b=!1),r)){if(g=g||">"===t.operator||">="===t.operator,y=y||"<"===t.operator||"<="===t.operator,a){if(_&&t.semver.prerelease&&t.semver.prerelease.length&&t.semver.major===_.major&&t.semver.minor===_.minor&&t.semver.patch===_.patch&&(_=!1),">"===t.operator||">="===t.operator){if((f=p(a,t,o))===t&&f!==a)return!1}else if(">="===a.operator&&!n(a.semver,String(t),o))return!1}if(i){if(b&&t.semver.prerelease&&t.semver.prerelease.length&&t.semver.major===b.major&&t.semver.minor===b.minor&&t.semver.patch===b.patch&&(b=!1),"<"===t.operator||"<="===t.operator){if((m=h(i,t,o))===t&&m!==i)return!1}else if("<="===i.operator&&!n(i.semver,String(t),o))return!1}if(!t.operator&&(i||a)&&0!==d)return!1}return(!a||!y||!!i||0===d)&&(!i||!g||!!a||0===d)&&!_&&!b&&!0},p=(t,r,o)=>{if(!t)return r;let a=l(t.semver,r.semver,o);return a>0?t:a<0||">"===r.operator&&">="===t.operator?r:t},h=(t,r,o)=>{if(!t)return r;let a=l(t.semver,r.semver,o);return a<0?t:a>0||"<"===r.operator&&"<="===t.operator?r:t};t.exports=(t,r,o={})=>{if(t===r)return!0;t=new a(t,o),r=new a(r,o);let i=!1;e:for(let a of t.set){for(let t of r.set){let r=d(a,t,o);if(i=i||null!==r,r)continue e}if(i)return!1}return!0}},6613(t,r,o){"use strict";let a=o(2069);t.exports=(t,r)=>new a(t,r).set.map(t=>t.map(t=>t.value).join(" ").trim().split(" "))},5372(t,r,o){"use strict";let a=o(2069);t.exports=(t,r)=>{try{return new a(t,r).range||"*"}catch(t){return null}}},600(t,r,o){"use strict";let a=o(9638);t.exports=(t="")=>{let r=t.match(a);if(!r)return null;let[o,i]=r[0].replace(/#! ?/,"").split(" "),s=o.split("/").pop();return"env"===s?i:i?`${s} ${i}`:s}},9638(t){"use strict";t.exports=/^#!(.*)/},1905(t,r,o){let a="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,i=o(6928),s=a?";":":",n=o(9344),l=t=>Object.assign(Error(`not found: ${t}`),{code:"ENOENT"}),c=(t,r)=>{let o=r.colon||s,i=t.match(/\//)||a&&t.match(/\\/)?[""]:[...a?[process.cwd()]:[],...(r.path||process.env.PATH||"").split(o)],n=a?r.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",l=a?n.split(o):[""];return a&&-1!==t.indexOf(".")&&""!==l[0]&&l.unshift(""),{pathEnv:i,pathExt:l,pathExtExe:n}},u=(t,r,o)=>{"function"==typeof r&&(o=r,r={}),r||(r={});let{pathEnv:a,pathExt:s,pathExtExe:u}=c(t,r),d=[],p=o=>new Promise((s,n)=>{if(o===a.length)return r.all&&d.length?s(d):n(l(t));let c=a[o],u=/^".*"$/.test(c)?c.slice(1,-1):c,p=i.join(u,t);s(h(!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p,o,0))}),h=(t,o,a)=>new Promise((i,l)=>{if(a===s.length)return i(p(o+1));let c=s[a];n(t+c,{pathExt:u},(s,n)=>{if(!s&&n)if(!r.all)return i(t+c);else d.push(t+c);return i(h(t,o,a+1))})});return o?p(0).then(t=>o(null,t),o):p(0)};t.exports=u,u.sync=(t,r)=>{let{pathEnv:o,pathExt:a,pathExtExe:s}=c(t,r=r||{}),u=[];for(let l=0;l<o.length;l++){let c=o[l],d=/^".*"$/.test(c)?c.slice(1,-1):c,p=i.join(d,t),h=!d&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;for(let t=0;t<a.length;t++){let o=h+a[t];try{if(n.sync(o,{pathExt:s}))if(!r.all)return o;else u.push(o)}catch(t){}}}if(r.all&&u.length)return u;if(r.nothrow)return null;throw l(t)}},181(t){"use strict";t.exports=require("buffer")},5317(t){"use strict";t.exports=require("child_process")},6982(t){"use strict";t.exports=require("crypto")},9896(t){"use strict";t.exports=require("fs")},7598(t){"use strict";t.exports=require("node:crypto")},857(t){"use strict";t.exports=require("os")},6928(t){"use strict";t.exports=require("path")},2203(t){"use strict";t.exports=require("stream")},9023(t){"use strict";t.exports=require("util")},4953(r){"use strict";r.exports=t},4891(t,r,o){"use strict";let a;o.d(r,{importJWK:()=>Z,importPKCS8:()=>G,SignJWT:()=>V});let i=new TextEncoder,s=new TextDecoder;function n(t){let r=new Uint8Array(t.length);for(let o=0;o<t.length;o++){let a=t.charCodeAt(o);if(a>127)throw TypeError("non-ASCII string encountered in encode()");r[o]=a}return r}function l(t){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(t);let r=atob(t),o=new Uint8Array(r.length);for(let t=0;t<r.length;t++)o[t]=r.charCodeAt(t);return o}function c(t){if(Uint8Array.fromBase64)return Uint8Array.fromBase64("string"==typeof t?t:s.decode(t),{alphabet:"base64url"});let r=t;r instanceof Uint8Array&&(r=s.decode(r)),r=r.replace(/-/g,"+").replace(/_/g,"/");try{return l(r)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}function u(t){let r=t;return("string"==typeof r&&(r=i.encode(r)),Uint8Array.prototype.toBase64)?r.toBase64({alphabet:"base64url",omitPadding:!0}):(function(t){if(Uint8Array.prototype.toBase64)return t.toBase64();let r=[];for(let o=0;o<t.length;o+=32768)r.push(String.fromCharCode.apply(null,t.subarray(o,o+32768)));return btoa(r.join(""))})(r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}class d extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,r){super(t,r),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class p extends d{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class h extends d{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class f extends d{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}class m extends d{[Symbol.asyncIterator];static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(t="multiple matching keys found in the JSON Web Key Set",r){super(t,r)}}let y=(t,r="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${r} must be ${t}`);function g(t,r){if(parseInt(t.hash.name.slice(4),10)!==r)throw y(`SHA-${r}`,"algorithm.hash")}function v(t,r,...o){if((o=o.filter(Boolean)).length>2){let r=o.pop();t+=`one of type ${o.join(", ")}, or ${r}.`}else 2===o.length?t+=`one of type ${o[0]} or ${o[1]}.`:t+=`of type ${o[0]}.`;return null==r?t+=` Received ${r}`:"function"==typeof r&&r.name?t+=` Received function ${r.name}`:"object"==typeof r&&null!=r&&r.constructor?.name&&(t+=` Received an instance of ${r.constructor.name}`),t}let b=(t,r,...o)=>v(`Key for the ${t} algorithm must be `,r,...o);async function _(t,r,o){if(r instanceof Uint8Array){if(!t.startsWith("HS"))throw TypeError(((t,...r)=>v("Key must be ",t,...r))(r,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",r,{hash:`SHA-${t.slice(-3)}`,name:"HMAC"},!1,[o])}return!function(t,r,o){switch(r){case"HS256":case"HS384":case"HS512":if("HMAC"!==t.algorithm.name)throw y("HMAC");g(t.algorithm,parseInt(r.slice(2),10));break;case"RS256":case"RS384":case"RS512":if("RSASSA-PKCS1-v1_5"!==t.algorithm.name)throw y("RSASSA-PKCS1-v1_5");g(t.algorithm,parseInt(r.slice(2),10));break;case"PS256":case"PS384":case"PS512":if("RSA-PSS"!==t.algorithm.name)throw y("RSA-PSS");g(t.algorithm,parseInt(r.slice(2),10));break;case"Ed25519":case"EdDSA":if("Ed25519"!==t.algorithm.name)throw y("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":let a;if(a=t.algorithm,a.name!==r)throw y(r);break;case"ES256":case"ES384":case"ES512":{if("ECDSA"!==t.algorithm.name)throw y("ECDSA");let o=function(t){switch(t){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}(r);if(t.algorithm.namedCurve!==o)throw y(o,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}if(o&&!t.usages.includes(o))throw TypeError(`CryptoKey does not support this operation, its usages must include ${o}.`)}(r,t,o),r}async function S(t,r,o){let a=await _(t,r,"sign");return!function(t,r){if(t.startsWith("RS")||t.startsWith("PS")){let{modulusLength:o}=r.algorithm;if("number"!=typeof o||o<2048)throw TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)}}(t,a),new Uint8Array(await crypto.subtle.sign(function(t,r){let o=`SHA-${t.slice(-3)}`;switch(t){case"HS256":case"HS384":case"HS512":return{hash:o,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:o,name:"RSA-PSS",saltLength:parseInt(t.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:o,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:o,name:"ECDSA",namedCurve:r.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:t};default:throw new p(`alg ${t} is not supported either by JOSE or your javascript runtime`)}}(t,a.algorithm),a,o))}function $(t){if("object"!=typeof t||null===t||"[object Object]"!==Object.prototype.toString.call(t))return!1;if(null===Object.getPrototypeOf(t))return!0;let r=t;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(t)===r}let w=t=>$(t)&&"string"==typeof t.kty,E=t=>{if(t?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return t instanceof CryptoKey}catch{return!1}},R=t=>t?.[Symbol.toStringTag]==="KeyObject",P=t=>E(t)||R(t),k=t=>t?.[Symbol.toStringTag],O=(t,r,o)=>{if(void 0!==r.use){let t;switch(o){case"sign":case"verify":t="sig";break;case"encrypt":case"decrypt":t="enc"}if(r.use!==t)throw TypeError(`Invalid key for this operation, its "use" must be "${t}" when present`)}if(void 0!==r.alg&&r.alg!==t)throw TypeError(`Invalid key for this operation, its "alg" must be "${t}" when present`);if(Array.isArray(r.key_ops)){let a;switch(!0){case"sign"===o||"verify"===o:case"dir"===t:case t.includes("CBC-HS"):a=o;break;case t.startsWith("PBES2"):a="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(t):a=!t.includes("GCM")&&t.endsWith("KW")?"encrypt"===o?"wrapKey":"unwrapKey":o;break;case"encrypt"===o&&t.startsWith("RSA"):a="wrapKey";break;case"decrypt"===o:a=t.startsWith("RSA")?"unwrapKey":"deriveBits"}if(a&&r.key_ops?.includes?.(a)===!1)throw TypeError(`Invalid key for this operation, its "key_ops" must include "${a}" when present`)}return!0},T='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';async function x(t){if(!t.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:r,keyUsages:o}=function(t){let r,o;switch(t.kty){case"AKP":switch(t.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":r={name:t.alg},o=t.priv?["sign"]:["verify"];break;default:throw new p(T)}break;case"RSA":switch(t.alg){case"PS256":case"PS384":case"PS512":r={name:"RSA-PSS",hash:`SHA-${t.alg.slice(-3)}`},o=t.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":r={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${t.alg.slice(-3)}`},o=t.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":r={name:"RSA-OAEP",hash:`SHA-${parseInt(t.alg.slice(-3),10)||1}`},o=t.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new p(T)}break;case"EC":switch(t.alg){case"ES256":case"ES384":case"ES512":r={name:"ECDSA",namedCurve:({ES256:"P-256",ES384:"P-384",ES512:"P-521"})[t.alg]},o=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":r={name:"ECDH",namedCurve:t.crv},o=t.d?["deriveBits"]:[];break;default:throw new p(T)}break;case"OKP":switch(t.alg){case"Ed25519":case"EdDSA":r={name:"Ed25519"},o=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":r={name:t.crv},o=t.d?["deriveBits"]:[];break;default:throw new p(T)}break;default:throw new p('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:r,keyUsages:o}}(t),a={...t};return"AKP"!==a.kty&&delete a.alg,delete a.use,crypto.subtle.importKey("jwk",a,r,t.ext??(!t.d&&!t.priv),t.key_ops??o)}let j="given KeyObject instance cannot be used for this algorithm",C=async(t,r,o,i=!1)=>{let s=(a||=new WeakMap).get(t);if(s?.[o])return s[o];let n=await x({...r,alg:o});return i&&Object.freeze(t),s?s[o]=n:a.set(t,{[o]:n}),n};async function N(t,r){if(t instanceof Uint8Array||E(t))return t;if(R(t)){if("secret"===t.type)return t.export();if("toCryptoKey"in t&&"function"==typeof t.toCryptoKey)try{return((t,r)=>{let o,i=(a||=new WeakMap).get(t);if(i?.[r])return i[r];let s="public"===t.type,n=!!s;if("x25519"===t.asymmetricKeyType){switch(r){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw TypeError(j)}o=t.toCryptoKey(t.asymmetricKeyType,n,s?[]:["deriveBits"])}if("ed25519"===t.asymmetricKeyType){if("EdDSA"!==r&&"Ed25519"!==r)throw TypeError(j);o=t.toCryptoKey(t.asymmetricKeyType,n,[s?"verify":"sign"])}switch(t.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(r!==t.asymmetricKeyType.toUpperCase())throw TypeError(j);o=t.toCryptoKey(t.asymmetricKeyType,n,[s?"verify":"sign"])}if("rsa"===t.asymmetricKeyType){let a;switch(r){case"RSA-OAEP":a="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":a="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":a="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":a="SHA-512";break;default:throw TypeError(j)}if(r.startsWith("RSA-OAEP"))return t.toCryptoKey({name:"RSA-OAEP",hash:a},n,s?["encrypt"]:["decrypt"]);o=t.toCryptoKey({name:r.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:a},n,[s?"verify":"sign"])}if("ec"===t.asymmetricKeyType){let a=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(t.asymmetricKeyDetails?.namedCurve);if(!a)throw TypeError(j);let i={ES256:"P-256",ES384:"P-384",ES512:"P-521"};i[r]&&a===i[r]&&(o=t.toCryptoKey({name:"ECDSA",namedCurve:a},n,[s?"verify":"sign"])),r.startsWith("ECDH-ES")&&(o=t.toCryptoKey({name:"ECDH",namedCurve:a},n,s?[]:["deriveBits"]))}if(!o)throw TypeError(j);return i?i[r]=o:a.set(t,{[r]:o}),o})(t,r)}catch(t){if(t instanceof TypeError)throw t}let o=t.export({format:"jwk"});return C(t,o,r)}if(w(t))return t.k?c(t.k):C(t,t,r,!0);throw Error("unreachable")}function I(t,r){if(t)throw TypeError(`${r} can only be called once`)}Symbol();class A{#e;#t;#r;constructor(t){if(!(t instanceof Uint8Array))throw TypeError("payload must be an instance of Uint8Array");this.#e=t}setProtectedHeader(t){return I(this.#t,"setProtectedHeader"),this.#t=t,this}setUnprotectedHeader(t){return I(this.#r,"setUnprotectedHeader"),this.#r=t,this}async sign(t,r){let o,a,i,s;if(!this.#t&&!this.#r)throw new h("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!function(...t){let r,o=t.filter(Boolean);if(0===o.length||1===o.length)return!0;for(let t of o){let o=Object.keys(t);if(!r||0===r.size){r=new Set(o);continue}for(let t of o){if(r.has(t))return!1;r.add(t)}}return!0}(this.#t,this.#r))throw new h("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let l={...this.#t,...this.#r},c=function(t,r,o,a,i){let s;if(void 0!==i.crit&&a?.crit===void 0)throw new t('"crit" (Critical) Header Parameter MUST be integrity protected');if(!a||void 0===a.crit)return new Set;if(!Array.isArray(a.crit)||0===a.crit.length||a.crit.some(t=>"string"!=typeof t||0===t.length))throw new t('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');for(let n of(s=void 0!==o?new Map([...Object.entries(o),...r.entries()]):r,a.crit)){if(!s.has(n))throw new p(`Extension Header Parameter "${n}" is not recognized`);if(void 0===i[n])throw new t(`Extension Header Parameter "${n}" is missing`);if(s.get(n)&&void 0===a[n])throw new t(`Extension Header Parameter "${n}" MUST be integrity protected`)}return new Set(a.crit)}(h,new Map([["b64",!0]]),r?.crit,this.#t,l),d=!0;if(c.has("b64")&&"boolean"!=typeof(d=this.#t.b64))throw new h('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:f}=l;if("string"!=typeof f||!f)throw new h('JWS "alg" (Algorithm) Header Parameter missing or invalid');var m="sign";switch(f.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((t,r,o)=>{if(!(r instanceof Uint8Array)){if(w(r)){if("oct"===r.kty&&"string"==typeof r.k&&O(t,r,o))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!P(r))throw TypeError(b(t,r,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==r.type)throw TypeError(`${k(r)} instances for symmetric algorithms must be of type "secret"`)}})(f,t,m);break;default:((t,r,o)=>{if(w(r))switch(o){case"decrypt":case"sign":if("oct"!==r.kty&&("AKP"===r.kty&&"string"==typeof r.priv||"string"==typeof r.d)&&O(t,r,o))return;throw TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if("oct"!==r.kty&&void 0===r.d&&void 0===r.priv&&O(t,r,o))return;throw TypeError("JSON Web Key for this operation must be a public JWK")}if(!P(r))throw TypeError(b(t,r,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===r.type)throw TypeError(`${k(r)} instances for asymmetric algorithms must not be of type "secret"`);if("public"===r.type)switch(o){case"sign":throw TypeError(`${k(r)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw TypeError(`${k(r)} instances for asymmetric algorithm decryption must be of type "private"`)}if("private"===r.type)switch(o){case"verify":throw TypeError(`${k(r)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw TypeError(`${k(r)} instances for asymmetric algorithm encryption must be of type "public"`)}})(f,t,m)}d?a=n(o=u(this.#e)):(a=this.#e,o=""),this.#t?s=n(i=u(JSON.stringify(this.#t))):(i="",s=new Uint8Array);let y=function(...t){let r=new Uint8Array(t.reduce((t,{length:r})=>t+r,0)),o=0;for(let a of t)r.set(a,o),o+=a.length;return r}(s,n("."),a),g=await N(t,f),v={signature:u(await S(f,g,y)),payload:o};return this.#r&&(v.header=this.#r),this.#t&&(v.protected=i),v}}class M{#o;constructor(t){this.#o=new A(t)}setProtectedHeader(t){return this.#o.setProtectedHeader(t),this}async sign(t,r){let o=await this.#o.sign(t,r);if(void 0===o.payload)throw TypeError("use the flattened module for creating JWS with b64: false");return`${o.protected}.${o.payload}.${o.signature}`}}let q=t=>Math.floor(t.getTime()/1e3),z=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function L(t){let r,o=z.exec(t);if(!o||o[4]&&o[1])throw TypeError("Invalid time period format");let a=parseFloat(o[2]);switch(o[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":r=Math.round(a);break;case"minute":case"minutes":case"min":case"mins":case"m":r=Math.round(60*a);break;case"hour":case"hours":case"hr":case"hrs":case"h":r=Math.round(3600*a);break;case"day":case"days":case"d":r=Math.round(86400*a);break;case"week":case"weeks":case"w":r=Math.round(604800*a);break;default:r=Math.round(0x1e187e0*a)}return"-"===o[1]||"ago"===o[4]?-r:r}function D(t,r){if(!Number.isFinite(r))throw TypeError(`Invalid ${t} input`);return r}class U{#e;constructor(t){if(!$(t))throw TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(t)}data(){return i.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(t){this.#e.iss=t}get sub(){return this.#e.sub}set sub(t){this.#e.sub=t}get aud(){return this.#e.aud}set aud(t){this.#e.aud=t}set jti(t){this.#e.jti=t}set nbf(t){"number"==typeof t?this.#e.nbf=D("setNotBefore",t):t instanceof Date?this.#e.nbf=D("setNotBefore",q(t)):this.#e.nbf=q(new Date)+L(t)}set exp(t){"number"==typeof t?this.#e.exp=D("setExpirationTime",t):t instanceof Date?this.#e.exp=D("setExpirationTime",q(t)):this.#e.exp=q(new Date)+L(t)}set iat(t){void 0===t?this.#e.iat=q(new Date):t instanceof Date?this.#e.iat=D("setIssuedAt",q(t)):"string"==typeof t?this.#e.iat=D("setIssuedAt",q(new Date)+L(t)):this.#e.iat=D("setIssuedAt",t)}}class V{#t;#a;constructor(t={}){this.#a=new U(t)}setIssuer(t){return this.#a.iss=t,this}setSubject(t){return this.#a.sub=t,this}setAudience(t){return this.#a.aud=t,this}setJti(t){return this.#a.jti=t,this}setNotBefore(t){return this.#a.nbf=t,this}setExpirationTime(t){return this.#a.exp=t,this}setIssuedAt(t){return this.#a.iat=t,this}setProtectedHeader(t){return this.#t=t,this}async sign(t,r){let o=new M(this.#a.data());if(o.setProtectedHeader(this.#t),Array.isArray(this.#t?.crit)&&this.#t.crit.includes("b64")&&!1===this.#t.b64)throw new f("JWTs MUST NOT use unencoded payload");return o.sign(t,r)}}let F=(t,r)=>{if(t.byteLength!==r.length)return!1;for(let o=0;o<t.byteLength;o++)if(t[o]!==r[o])return!1;return!0},H=t=>{let r=t.data[t.pos++];if(128&r){let o=127&r,a=0;for(let r=0;r<o;r++)a=a<<8|t.data[t.pos++];return a}return r},K=(t,r,o)=>{if(t.data[t.pos++]!==r)throw Error(o)},J=(t,r)=>{let o=t.data.subarray(t.pos,t.pos+r);return t.pos+=r,o},B=async(t,r,o,a)=>{let i,s,n="spki"===t,l=()=>n?["verify"]:["sign"];switch(o){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:`SHA-${o.slice(-3)}`},s=l();break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${o.slice(-3)}`},s=l();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:`SHA-${parseInt(o.slice(-3),10)||1}`},s=n?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":i={name:"ECDSA",namedCurve:({ES256:"P-256",ES384:"P-384",ES512:"P-521"})[o]},s=l();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{let t=a.getNamedCurve(r);i="X25519"===t?{name:"X25519"}:{name:"ECDH",namedCurve:t}}catch(t){throw new p("Invalid or unsupported key format")}s=n?[]:["deriveBits"];break;case"Ed25519":case"EdDSA":i={name:"Ed25519"},s=l();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":i={name:o},s=l();break;default:throw new p('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(t,r,i,a?.extractable??!!n,s)};async function G(t,r,o){let a,i,s;if("string"!=typeof t||0!==t.indexOf("-----BEGIN PRIVATE KEY-----"))throw TypeError('"pkcs8" must be PKCS#8 formatted string');return a=/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,i=l(t.replace(a,"")),s=o,r?.startsWith?.("ECDH-ES")&&((s||={}).getNamedCurve=t=>{let r,o={data:t,pos:0};return K(o,48,"Invalid PKCS#8 structure"),H(o),K(o,2,"Expected version field"),r=H(o),o.pos+=r,K(o,48,"Expected algorithm identifier"),H(o),o.pos,(t=>{let r,o=(K(t,6,"Expected algorithm OID"),r=H(t),J(t,r));if(F(o,[43,101,110]))return"X25519";if(!F(o,[42,134,72,206,61,2,1]))throw Error("Unsupported key algorithm");K(t,6,"Expected curve OID");let a=H(t),i=J(t,a);for(let{name:t,oid:r}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(F(i,r))return t;throw Error("Unsupported named curve")})(o)}),B("pkcs8",i,r,s)}async function Z(t,r,o){let a;if(!$(t))throw TypeError("JWK must be an object");switch(r??=t.alg,a??=o?.extractable??t.ext,t.kty){case"oct":if("string"!=typeof t.k||!t.k)throw TypeError('missing "k" (Key Value) Parameter value');return c(t.k);case"RSA":if("oth"in t&&void 0!==t.oth)throw new p('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return x({...t,alg:r,ext:a});case"AKP":if("string"!=typeof t.alg||!t.alg)throw TypeError('missing "alg" (Algorithm) Parameter value');if(void 0!==r&&r!==t.alg)throw TypeError("JWK alg and alg option value mismatch");return x({...t,ext:a});case"EC":case"OKP":return x({...t,alg:r,ext:a});default:throw new p('Unsupported "kty" (Key Type) Parameter value')}}},4519(t){"use strict";t.exports=JSON.parse('{"name":"dotenv","version":"16.6.1","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","pretest":"npm run lint && npm run dts-check","test":"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"homepage":"https://github.com/motdotla/dotenv#readme","funding":"https://dotenvx.com","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@types/node":"^18.11.3","decache":"^4.6.2","sinon":"^14.0.1","standard":"^17.0.0","standard-version":"^9.5.0","tap":"^19.2.0","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}')},8330(t){"use strict";t.exports=JSON.parse('{"name":"xmcp","description":"The MCP framework","version":"1.6.0","author":{"name":"xmcp","email":"support@xmcp.dev","url":"https://xmcp.dev"},"contributors":[{"name":"Valentina Bearzotti","email":"valebearzotti1@gmail.com","url":"https://github.com/valebearzotti"},{"name":"Jose Rago","email":"jose@basement.studio","url":"https://github.com/ragojose"}],"license":"MIT","keywords":["mcp","modelcontextprotocol","http","stdio"],"repository":{"type":"git","url":"https://github.com/basementstudio/xmcp"},"homepage":"https://xmcp.dev","type":"commonjs","main":"./dist/index.js","types":"./dist/index.d.ts","bin":{"xmcp":"dist/cli.js"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js","default":"./dist/index.js"},"./node":{"types":"./dist/node.d.ts","node":"./dist/node.js"},"./host-bridge":{"types":"./dist/host-bridge.d.ts","import":"./dist/host-bridge.js","require":"./dist/host-bridge.js","default":"./dist/host-bridge.js"},"./headers":{"types":"./dist/runtime/headers.d.ts","require":"./dist/runtime/headers.js","default":"./dist/runtime/headers.js"},"./cloudflare":{"types":"./dist/cloudflare.d.ts","import":"./dist/cloudflare.js","require":"./dist/cloudflare.js","default":"./dist/cloudflare.js"},"./config":{"types":"./dist/config/index.d.ts","import":"./dist/config.js","require":"./dist/config.js","default":"./dist/config.js"},"./package.json":"./package.json","./client":{"types":"./dist/client.d.ts","node":"./dist/client.js"}},"typesVersions":{"*":{"node":["dist/node.d.ts"],"host-bridge":["dist/host-bridge.d.ts"],"headers":["dist/runtime/headers.d.ts"],"cloudflare":["dist/cloudflare.d.ts"],"config":["dist/config/index.d.ts"],"client":["dist/client.d.ts"]}},"files":["dist"],"scripts":{"dev":"cross-env NODE_ENV=development tsx --watch --tsconfig ./bundler.tsconfig.json ./bundler/index.ts","build":"cross-env NODE_ENV=production tsx --tsconfig ./bundler.tsconfig.json ./bundler/index.ts","analyze":"cross-env GENERATE_STATS=true pnpm build && pnpm tsx scripts/analyze-rspack-stats.ts","bench":"tsx bench/run.mts","test:config":"pnpm --dir ../compiler test:config","test:adapters":"node --import tsx --test src/runtime/adapters/*/__tests__/*.test.ts","test:runtime":"node --import tsx --test src/runtime/utils/__tests__/*.test.ts src/runtime/utils/ui/__tests__/*.test.ts","test:client":"node --import tsx --test src/client/__tests__/*.test.ts"},"dependencies":{},"devDependencies":{"@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/node":"^2.0.0","@modelcontextprotocol/server":"^2.0.0","@nestjs/common":"^11.1.12","@rspack/core":"^1.6.7","@types/async-retry":"^1.4.9","@types/content-type":"^1.1.9","@types/express":"^5.0.6","@types/fs-extra":"^11.0.4","@types/jsonwebtoken":"^9.0.10","@types/node":"^22.19.2","@types/react":"^19.2.7","@types/react-dom":"^19.2.3","async-retry":"^1.3.3","chalk":"^5.6.2","chokidar":"^3.6.0","ci-info":"^4.3.1","commander":"^11.1.0","content-type":"^1.0.5","cross-env":"^7.0.3","del":"^7.1.0","dotenv":"^16.6.1","express":"^4.22.1","fastify":"^5.12.5","fs-extra":"^11.3.2","glob":"^11.1.0","is-docker":"^4.0.0","is-wsl":"^3.1.0","jose":"^6.1.3","json5":"^2.2.3","jsonwebtoken":"^9.0.3","memfs":"^4.51.1","postcss-loader":"^8.2.0","raw-body":"^3.0.2","reflect-metadata":"^0.2.2","rxjs":"^7.8.2","ts-checker-rspack-plugin":"^1.2.1","tsx":"^4.21.0","typescript":"^5.9.3","zod-to-json-schema":"^3.25.0"},"peerDependencies":{"@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/server":"^2.0.0","jose":"^6.1.3","react":">=19.0.0","react-dom":">=19.0.0","zod":"^3.25.76 || ^4.0.0"},"peerDependenciesMeta":{"@modelcontextprotocol/client":{"optional":true},"@modelcontextprotocol/server":{"optional":true},"jose":{"optional":true},"react":{"optional":true},"react-dom":{"optional":true}}}')}},i={};function s(t){var r=i[t];if(void 0!==r)return r.exports;var o=i[t]={exports:{}};return a[t](o,o.exports,s),o.exports}s.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return s.d(r,{a:r}),r},o=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,s.t=function(t,a){if(1&a&&(t=this(t)),8&a||"object"==typeof t&&t&&(4&a&&t.__esModule||16&a&&"function"==typeof t.then))return t;var i=Object.create(null);s.r(i);var n={};r=r||[null,o({}),o([]),o(o)];for(var l=2&a&&t;("object"==typeof l||"function"==typeof l)&&!~r.indexOf(l);l=o(l))Object.getOwnPropertyNames(l).forEach(r=>{n[r]=()=>t[r]});return n.default=()=>t,s.d(i,n),i},s.d=(t,r)=>{for(var o in r)s.o(r,o)&&!s.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},s.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";let t,r,o,a,i,l,c,u,d,p,h,f,m,y,g,v,b,_,S;s.r(n),s.d(n,{HOST_CONTEXT_CHANGED_METHOD:()=>yr,isEnvHeader:()=>mJ,createSTDIOClient:()=>mY,INITIALIZE_METHOD:()=>m4,LOG_MESSAGE_METHOD:()=>ye,OPEN_LINK_METHOD:()=>m6,REQUEST_DISPLAY_MODE_METHOD:()=>m3,inputResponse:()=>ch,disconnectSTDIOClient:()=>m1,embeddedResource:()=>G,isInputRequiredResult:()=>l7,callSTDIOClientTool:()=>m0,headersToRecord:()=>mB,MCP_APPS_PROTOCOL_VERSION:()=>m9,extractToolNamesFromRequest:()=>m2,UI_MESSAGE_METHOD:()=>m7,completable:()=>u6,acceptedContent:()=>cp,listSTDIOClientTools:()=>mQ,UPDATE_MODEL_CONTEXT_METHOD:()=>m8,UrlElicitationRequiredError:()=>l9,createRequestStateCodec:()=>de,audio:()=>B,createMcpHostBridge:()=>ys,SIZE_CHANGED_METHOD:()=>yo,image:()=>J,INITIALIZED_METHOD:()=>m5,inputRequired:()=>cd,RESOURCES_READ_METHOD:()=>yt,createContext:()=>H,getRequestContext:()=>X,jwtAuthMiddleware:()=>D,createHTTPClient:()=>mX,apiKeyAuthMiddleware:()=>q});var $,w,E,R,P,k,O,T,x,j,C=s(8583),N=s.n(C),I=s(4953);let A=I.z.object({apiKey:I.z.string().optional(),headerName:I.z.string().optional(),validateApiKey:I.z.function().args(I.z.string()).returns(I.z.promise(I.z.boolean())).optional()}).strict().refine(t=>void 0!==t.apiKey||void 0!==t.validateApiKey,{message:"Either 'apiKey' or 'validateApiKey' must be provided"}).refine(t=>void 0===t.apiKey||void 0===t.validateApiKey,{message:"'apiKey' and 'validateApiKey' are mutually exclusive - provide only one"}),M="Unauthorized: Missing or invalid API key";function q(t){let r=A.safeParse(t);if(!r.success){let o="apiKey"in t,a="validateApiKey"in t;if(o&&a)throw Error("'apiKey' and 'validateApiKey' are mutually exclusive - provide only one");if(o||a)throw Error(`Invalid configuration: ${r.error.message}`);throw Error("Either 'apiKey' or 'validateApiKey' must be provided")}let o=t.headerName??"x-api-key",a="apiKey"in t?t.apiKey:void 0,i="validateApiKey"in t?t.validateApiKey:void 0;return async(r,s,n)=>{let l=r.header(o);!l||"apiKey"in t&&l!==a||i&&!await i(l)?s.status(401).json({error:M}):n()}}var z=s(8400),L=s.n(z);function D(t){return(r,o,a)=>{let i=r.header("Authorization");if(!i||!i.startsWith("Bearer "))return void o.status(401).json({error:"Unauthorized: Missing or malformed Authorization header"});let s=i.slice(7).trim();if(!s)return void o.status(401).json({error:"Unauthorized: Missing access token"});try{let{secret:o,...i}=t;r.user=L().verify(s,o,i),a()}catch(t){o.status(401).json({error:"Unauthorized: Invalid or expired token"})}}}let U=require("async_hooks"),V=(t,r)=>{globalThis[t]=r},F=t=>globalThis[t];function H({name:t,fallback:r=!0}){let o=Symbol.for(`xmcp-context-${t}`),a=Symbol.for(`xmcp-context-${t}-fallback-store`);if(F(o))return F(o);let i=new U.AsyncLocalStorage,s=globalThis[a]??{current:null};V(a,s);let n={provider:(t,o)=>(r&&(s.current=t),i.run(t,o)),getContext:()=>{let o=i.getStore();if(o)return o;if(r&&s.current)return s.current;throw Error(`getContext() can only be used within the ${t} context.`)},setContext:o=>{let a=i.getStore()??(r?s.current:null);if(!a)throw Error(`setContext() can only be used within the ${t} context.`);Object.assign(a,o)}};return V(o,n),n}function K(t){let r;if(t instanceof Uint8Array)r=t;else if(t instanceof ArrayBuffer)r=new Uint8Array(t);else throw TypeError("Expected bytes as a Uint8Array or ArrayBuffer");let o="";for(let t=0;t<r.length;t+=32768)o+=String.fromCharCode(...r.subarray(t,t+32768));return btoa(o)}function J(t,r){return{type:"image",data:K(t),mimeType:r}}function B(t,r){return{type:"audio",data:K(t),mimeType:r}}function G(t,r,o){return{type:"resource",resource:{uri:t,...void 0===o?{}:{mimeType:o},..."string"==typeof r?{text:r}:{blob:K(r)}}}}let Z=H({name:"http-request-context"});Z.setContext,Z.getContext,Z.provider;let W=H({name:"request-context",fallback:!1});function X(){try{return W.getContext()}catch{throw Error("getRequestContext() can only be used while handling an MCP request.")}}var Y=Object.create,Q=Object.defineProperty,ee=Object.getOwnPropertyDescriptor,et=Object.getOwnPropertyNames,er=Object.getPrototypeOf,eo=Object.prototype.hasOwnProperty,ea=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports);function ei(t){let r=Object.values(t).filter(t=>"number"==typeof t);return Object.entries(t).filter(([t,o])=>-1===r.indexOf(+t)).map(([t,r])=>r)}function es(t,r="|"){return t.map(t=>eO(t)).join(r)}function en(t,r){return"bigint"==typeof r?r.toString():r}class el{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return void 0!==t&&(this._value=t(),this._getter=void 0),this._value}}function ec(t){return new el(t)}function eu(t){let r=+!!t.startsWith("^"),o=t.endsWith("$")?t.length-1:t.length;return t.slice(r,o)}let ed=Symbol("evaluating");function ep(t,r,o){Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0})}function eh(t){let r=Object.getOwnPropertyDescriptor(t,"shape");return r?.get?r.get.raw:r?.value}function ef(t){return eh(t._zod.def)??t._zod.def.shape}function em(t,r,o){Object.defineProperty(t,r,{get(){let t=o();return ep(this,r,t),t},enumerable:!0,configurable:!0})}function ey(t,r,o){r in t?ep(t,r,o):t[r]=o}function eg(t,r,o,a){let i=ef(r);for(let s of o){let o=Object.getOwnPropertyDescriptor(i,s);o.enumerable&&(o.get?em(t,s,()=>{let t=r._zod.def.shape[s];return a?a(t,s):t}):ey(t,s,a?a(o.value,s):o.value))}}function ev(...t){let r={};for(let o of t)Object.assign(r,Object.getOwnPropertyDescriptors(o));return Object.defineProperties({},r)}let eb="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function e_(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}let eS=ec(()=>{if(e0.jitless||"undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(t){return!1}});function e$(t){if(!1===e_(t))return!1;let r=t.constructor;if(void 0===r||"function"!=typeof r)return!0;let o=r.prototype;return!1!==e_(o)&&!1!==Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")}function ew(t){return e$(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}let eE=new Set(["string","number","symbol"]);function eR(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eP(t,r,o){let a=new t._zod.constr(r??t._zod.def);return(!r||o?.parent)&&(a._zod.parent=t),a}function ek(t){if(!t)return{};if("string"==typeof t)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return(delete t.message,"string"==typeof t.error)?{...t,error:()=>t.error}:t}function eO(t){return"bigint"==typeof t?t.toString()+"n":"string"==typeof t?`"${t}"`:`${t}`}let eT={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ex={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ej(t,r){let o=ef(t),a=[];for(let t of Reflect.ownKeys(r)){if(!Object.getOwnPropertyDescriptor(o,t)?.enumerable)throw Error(`Unrecognized key: "${String(t)}"`);r[t]&&a.push(t)}return a}function eC(t,r){let o={};eg(o,t,Reflect.ownKeys(ef(t)));for(let t of Reflect.ownKeys(r)){let a=Object.getOwnPropertyDescriptor(r,t);a.enumerable&&(a.get?em(o,t,()=>r[t]):ey(o,t,a.value))}return o}function eN(t,r,o,a="partial"){let i=r._zod.def.checks;if(i&&i.length>0)throw Error(`.${a}() cannot be used on object schemas containing refinements`);let s=o?new Set(ej(r,o)):void 0,n={};return eg(n,r,Reflect.ownKeys(ef(r)),t&&((r,o)=>s&&!s.has(o)?r:new t({type:"optional",innerType:r}))),eP(r,ev(r._zod.def,{shape:n,checks:[]}))}function eI(t,r=0){if(!0===t.aborted)return!0;for(let o=r;o<t.issues.length;o++)if(t.issues[o]?.continue!==!0)return!0;return!1}function eA(t,r){return r.map(r=>(r.path??(r.path=[]),r.path.unshift(t),r))}function eM(t){return"string"==typeof t?t:t?.message}function eq(t,r,o){var a;for(let i=r;i<t.length;i++)(a=t[i]).schema??(a.schema=o)}function ez(t,r,o){let a=t.inst?._zod?.traits;a?.has("$ZodType")&&(a.has("$ZodCheck")?t.schema??(t.schema=t.inst):t.schema=t.inst);let i=t.schema!==t.inst?t.schema?._zod.def?.error:void 0,s=t.message?t.message:eM(t.inst?._zod.def?.error?.(t))??eM(i?.(t))??eM(r?.error?.(t))??eM(o.customError?.(t))??eM(o.localeError?.(t))??"Invalid input",n={};for(let r of Object.keys(t))"inst"!==r&&"schema"!==r&&"continue"!==r&&"input"!==r&&"__proto__"!==r&&(n[r]=t[r]);return n.path??(n.path=[]),n.message=s,r?.reportInput&&(n.input=t.input),n}let eL=/[\uD800-\uDBFF]/;function eD(t){let r=t.length;if(!eL.test(t))return r;let o=r;for(let a=0;a<r-1;a++)(64512&t.charCodeAt(a))==55296&&(64512&t.charCodeAt(a+1))==56320&&(o--,a++);return o}function eU(t){return Array.isArray(t)?"array":"string"==typeof t?"string":"unknown"}function eV(...t){let[r,o,a]=t;return"string"==typeof r?{message:r,code:"custom",input:o,inst:a}:{...r}}function eF(t,r,o,a=!0){return Object.defineProperty(t,r,{configurable:!0,writable:!0,enumerable:a,value:o}),o}function eH(t,r){for(let o in t){let a=t[o];Object.defineProperty(r,o,{configurable:!0,enumerable:!0,get(){return eF(this,o,a(this))},set(t){eF(this,o,t)}})}return r}let eK=!1,eJ={configurable:!0,get(){eK=!0}};function eB(r,o,a){let i=Object.getPrototypeOf(r._zod);if(o in i&&t!==r._zod){t=void 0;return}t=r._zod,Object.defineProperty(i,o,{configurable:!0,get(){Object.defineProperty(this,o,eJ);let t=eK;eK=!1;try{let r=a(this);return eK?delete this[o]:Object.defineProperty(this,o,{configurable:!0,writable:!0,value:r}),eK=eK||t,r}catch(r){throw delete this[o],eK=eK||t,r}},set(t){Object.defineProperty(this,o,{configurable:!0,writable:!0,value:t})}})}let eG=Object.freeze({status:"aborted"}),eZ={value:void 0,enumerable:!1},eW="captureStackTrace"in Error?Error:null;function eX(t,r,o,a){function i(t){this.def=t,this.constr=u,this.traits=new Set}i.prototype={};let s=o&&new WeakSet;function n(a,n){if(a._zod){if(a._zod.traits.has(t))return}else{eZ.value=new i(n);try{Object.defineProperty(a,"_zod",eZ)}finally{eZ.value=void 0}}if(a._zod.traits.add(t),r(a,n),s){let t=Object.getPrototypeOf(a),r=a._zod.constr.prototype,i=t;for(;i&&i!==r;)i=Object.getPrototypeOf(i);let n=i??t;if(!s.has(n)){s.add(n);for(let t in o){let r=Object.getOwnPropertyDescriptor(o,t);r.get?Object.defineProperty(n,t,{...r,enumerable:!1}):function(t,r,o){Object.defineProperty(t,r,{configurable:!0,get(){return this==null?o:eF(this,r,o.bind(this))},set(t){eF(this,r,t)}})}(n,t,r.value)}}}let l=u.prototype;for(let t in l)Object.prototype.hasOwnProperty.call(l,t)&&(t in a||(a[t]=l[t].bind(a)))}let l=a?.Parent??Object;class c extends l{}function u(t){let r=a?.Parent?function(t){let r=eW;if(r){let o=r.stackTraceLimit;if("number"==typeof o){try{r.stackTraceLimit=0}catch{return eW=null,new t}try{return new t}finally{r.stackTraceLimit=o}}}return new t}(c):this;n(r,t);let o=r._zod.deferred;if(o){for(let t of o)t();r._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(r),r}return Object.defineProperty(c,"name",{value:t}),Object.defineProperty(u,"init",{value:n}),Object.defineProperty(u,Symbol.hasInstance,{value:r=>!!a?.Parent&&r instanceof a.Parent||r?._zod?.traits?.has(t)}),Object.defineProperty(u,"name",{value:t}),u}class eY extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class eQ extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(T=globalThis).__zod_globalConfig??(T.__zod_globalConfig={});let e0=globalThis.__zod_globalConfig;function e1(t){return t&&Object.assign(e0,t),e0}class e2 extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let e9="~memo",e4=[];function e5(t){return null!==t&&"object"==typeof t}function e3(t){return t.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}let e6=new WeakMap,e8=[],e7={alloc(t,o,a){let i=r;if(!i)return a;r=void 0;let s={value:a,issues:null};return i.set(o.value,s),e8.push(s),a},guard(t){var r;(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred.push(()=>{let r=t._zod.parse,o=(t,o)=>{var a,i;let s;if("backward"!==o.direction&&(a=o,i=t.value,void 0!==(s=a[e9]?.backEdges)&&e5(i)&&s.has(i)))throw new e2;return r(t,o)};t._zod.parse=o,t._zod.run===r&&(t._zod.run=o)})},attach(t){var o;let a,i,s,n=!1;(o=t._zod).deferred??(o.deferred=[]),t._zod.deferred.push(()=>{let o=t._zod.parse,l=(c,u)=>{let d;if(void 0===a){let r=function t(r,o,a){var i,s;let n=e6.get(r);if(void 0!==n)return 2*!!n;if(o.has(r))return 2;o.add(r);let l=0,c=r=>{if(2!==l&&r?._zod){let i=t(r,o,a);i>l&&(l=i)}},u=t=>{t>l&&(l=t)},d=r._zod.def;switch(d.type){case"object":{let r=eh(d);u(r?((r,i)=>{let s=0;for(let n of Reflect.ownKeys(r)){let l=Object.getOwnPropertyDescriptor(r,n);if(i&&!l.enumerable)continue;let c=l.get?1:l.value?._zod?t(l.value,o,a):0;c>s&&(s=c)}return s})(r,!0):1),c(d.catchall);break}case"array":c(d.element);break;case"tuple":for(let t of d.items)c(t);c(d.rest);break;case"record":case"map":c(d.keyType),c(d.valueType);break;case"set":c(d.valueType);break;case"union":for(let t of d.options)c(t);break;case"intersection":c(d.left),c(d.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":c(d.innerType);break;case"pipe":c(d.in),c(d.out);break;case"function":c(d.input),c(d.output);break;case"lazy":{let i=d._cachedInner??(a?r._zod.innerType:void 0);u(i?t(i,o,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let t in d){let r=Object.getOwnPropertyDescriptor(d,t);if(!r||r.get)continue;let o=r.value;if(o&&"object"==typeof o){if(o._zod)c(o);else if(Array.isArray(o))for(let t of o)c(t)}}}return o.delete(r),i=r,1!==(s=l)&&e6.set(i,2===s),s}(t,new Set,!1);if(0===r)return t._zod.parse=o,t._zod.run===l&&(t._zod.run=o),o(c,u);2===r||n?a=!0:n=!0}let p=c.value;if(!e5(p))return o(c,u);let h=u[e9];if(h||(h={buckets:new WeakMap,backEdges:void 0},u[e9]=h),i===u)d=s;else{var f;let r;(r=(f=h).buckets.get(t))||(r=new WeakMap,f.buckets.set(t,r)),d=r,i=u,s=d}let m=d.get(p);if(m)return c.value=m.value,m.issues?m.issues.length&&c.issues.push(...e3(m.issues)):(c.memo=!0,h.backEdges??(h.backEdges=new WeakSet),h.backEdges.add(m.value)),c;r=d;let y=e8.length,g=o(c,u);r=void 0;let v=e8.length>y?e8.pop():void 0;return g instanceof Promise?g.then(t=>(v&&(v.issues=t.issues.length?e3(t.issues):e4),t)):(v&&(v.issues=g.issues.length?e3(g.issues):e4),g)};t._zod.parse=l,t._zod.run===o&&(t._zod.run=l)})}},te=/^[cC][0-9a-z]{6,}$/,tt=/^[0-9a-z]+$/,tr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,to=/^[0-9a-vA-V]{20}$/,ta=/^[A-Za-z0-9]{27}$/,ti=/^[a-zA-Z0-9_-]{21}$/,ts=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tn=/^([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})$/,tl=t=>t?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/,tc=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,tu=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,td=/^(?:(?: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])$/,tp=/^(([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}|:))$/,th=/^((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])$/,tf=/^(([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])$/,tm=/^https?$/,ty=/^\+[1-9]\d{6,14}$/,tg="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",tv=RegExp(`^${tg}$`);function tb(t){let r="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof t.precision?-1===t.precision?`${r}`:0===t.precision?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${t.precision}}`:t.seconds?`${r}:[0-5]\\d(?:\\.\\d+)?`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}let t_=/^[\s\S]{0,}$/,tS=/^-?\d+$/,t$=/^-?\d+(?:\.\d+)?$/,tw=/^(?:true|false)$/i,tE=/^null$/i,tR=/^[^A-Z]*$/,tP=/^[^a-z]*$/,tk=eX("$ZodCheck",(t,r)=>{var o;t._zod??(t._zod={}),t._zod.def=r,(o=t._zod).onattach??(o.onattach=[])}),tO=t=>{let r=t.value;return null!=r&&void 0!==r.length},tT={number:"number",bigint:"bigint",object:"date"},tx=eX("$ZodCheckLessThan",(t,r)=>{tk.init(t,r);let o=tT[typeof r.value];t._zod.check=a=>{(r.inclusive?a.value<=r.value:a.value<r.value)||a.issues.push({origin:tT[typeof a.value]??o,code:"too_big",maximum:"object"==typeof r.value?r.value.getTime():r.value,input:a.value,inclusive:r.inclusive,inst:t,continue:!r.abort})}}),tj=eX("$ZodCheckGreaterThan",(t,r)=>{tk.init(t,r);let o=tT[typeof r.value];t._zod.check=a=>{(r.inclusive?a.value>=r.value:a.value>r.value)||a.issues.push({origin:tT[typeof a.value]??o,code:"too_small",minimum:"object"==typeof r.value?r.value.getTime():r.value,input:a.value,inclusive:r.inclusive,inst:t,continue:!r.abort})}}),tC=eX("$ZodCheckMultipleOf",(t,r)=>{tk.init(t,r),t._zod.check=o=>{let a,i,s;if(typeof o.value!=typeof r.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof o.value?r.value!==BigInt(0)&&o.value%r.value===BigInt(0):0==(i=Math.round(a=o.value/r.value),s=4*Number.EPSILON*Math.max(Math.abs(a),1),Math.abs(a-i)<s?0:a-i))||o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:r.value,input:o.value,inst:t,continue:!r.abort})}}),tN=eX("$ZodCheckNumberFormat",(t,r)=>{tk.init(t,r),r.format=r.format||"float64";let o=r.format?.includes("int"),a=o?"int":"number",[i,s]=eT[r.format];t._zod.check=n=>{let l=n.value;if(o){if(!Number.isInteger(l))return void n.issues.push({expected:a,format:r.format,code:"invalid_type",continue:!1,input:l,inst:t});if(!Number.isSafeInteger(l))return void(l>0?n.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:a,inclusive:!0,continue:!r.abort}):n.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:a,inclusive:!0,continue:!r.abort}))}l<i&&n.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!r.abort}),l>s&&n.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!r.abort})}}),tI=eX("$ZodCheckMaxLength",(t,r)=>{var o;tk.init(t,r),(o=t._zod.def).when??(o.when=tO),t._zod.check=o=>{let a=o.value,i=a.length;if(("string"==typeof a&&i>r.maximum?eD(a):i)<=r.maximum)return;let s=eU(a);o.issues.push({origin:s,code:"too_big",maximum:r.maximum,inclusive:!0,input:a,inst:t,continue:!r.abort})}}),tA=eX("$ZodCheckMinLength",(t,r)=>{var o;tk.init(t,r),(o=t._zod.def).when??(o.when=tO),t._zod.check=o=>{let a=o.value,i=a.length;if(("string"==typeof a&&i>=r.minimum&&i<2*r.minimum?eD(a):i)>=r.minimum)return;let s=eU(a);o.issues.push({origin:s,code:"too_small",minimum:r.minimum,inclusive:!0,input:a,inst:t,continue:!r.abort})}}),tM=eX("$ZodCheckLengthEquals",(t,r)=>{var o;tk.init(t,r),(o=t._zod.def).when??(o.when=tO),t._zod.check=o=>{let a=o.value,i=a.length,s="string"==typeof a&&i>=r.length&&i<=2*r.length?eD(a):i;if(s===r.length)return;let n=eU(a),l=s>r.length;o.issues.push({origin:n,...l?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:t,continue:!r.abort})}}),tq=eX("$ZodCheckStringFormat",(t,r)=>{var o,a;tk.init(t,r),r.pattern?(o=t._zod).check??(o.check=o=>{r.pattern.lastIndex=0,r.pattern.test(o.value)||o.issues.push({origin:"string",code:"invalid_format",format:r.format,input:o.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:t,continue:!r.abort})}):(a=t._zod).check??(a.check=()=>{})}),tz=eX("$ZodCheckRegex",(t,r)=>{tq.init(t,r),t._zod.check=o=>{r.pattern.lastIndex=0,r.pattern.test(o.value)||o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:r.pattern.toString(),inst:t,continue:!r.abort})}}),tL=eX("$ZodCheckLowerCase",(t,r)=>{r.pattern??(r.pattern=tR),tq.init(t,r)}),tD=eX("$ZodCheckUpperCase",(t,r)=>{r.pattern??(r.pattern=tP),tq.init(t,r)}),tU=eX("$ZodCheckIncludes",(t,r)=>{tk.init(t,r);let o=eR(r.includes),a=new RegExp("number"==typeof r.position?`^.{${r.position},}${o}`:o);r.pattern=a,t._zod.check=o=>{o.value.includes(r.includes,r.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:o.value,inst:t,continue:!r.abort})}}),tV=eX("$ZodCheckStartsWith",(t,r)=>{tk.init(t,r);let o=RegExp(`^${eR(r.prefix)}.*`);r.pattern??(r.pattern=o),t._zod.check=o=>{o.value.startsWith(r.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:o.value,inst:t,continue:!r.abort})}}),tF=eX("$ZodCheckEndsWith",(t,r)=>{tk.init(t,r);let o=RegExp(`.*${eR(r.suffix)}$`);r.pattern??(r.pattern=o),t._zod.check=o=>{o.value.endsWith(r.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:o.value,inst:t,continue:!r.abort})}}),tH=eX("$ZodCheckOverwrite",(t,r)=>{tk.init(t,r),t._zod.check=t=>{t.value=r.tx(t.value)}});class tK{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("function"==typeof t){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split("\n").filter(t=>t),o=Math.min(...r.map(t=>t.length-t.trimStart().length));for(let t of r.map(t=>t.slice(o)).map(t=>" ".repeat(2*this.indent)+t))this.content.push(t)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
2
|
+
${r.join("\n")}
|
|
3
|
+
};`)(...Object.values(this.closed))}}let tJ={major:4,minor:6,patch:5},tB=eX("$ZodType",(t,r)=>{var o;t??(t={}),t._zod.def=r,t._zod.bag=t._zod.bag||{},t._zod.version=tJ;let a=t._zod.def.checks,i=t._zod.traits.has("$ZodCheck")?[t,...a??[]]:a?.length?[...a]:[];for(let r of i)for(let o of r._zod.onattach)o(t);if(0===i.length)(o=t._zod).deferred??(o.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let r=(r,o,a)=>{let i;if(r.memo)return r;let s=eI(r);for(let n of o){if(n._zod.def.when){if(function(t,r=0){if(!0===t.aborted)return!0;for(let o=r;o<t.issues.length;o++)if(t.issues[o]?.continue===!1)return!0;return!1}(r)||!n._zod.def.when(r))continue}else if(s)continue;let o=r.issues.length,l=n._zod.check(r);if(l instanceof Promise&&a?.async===!1)throw new eY;if(i||l instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await l,r.issues.length!==o&&(eq(r.issues,o,t),s||(s=eI(r,o)))});else{if(r.issues.length===o)continue;eq(r.issues,o,t),s||(s=eI(r,o))}}return i?i.then(()=>r):r},o=(o,a,s)=>{if(eI(o))return o.aborted=!0,o;let n=r(a,i,s);if(n instanceof Promise){if(!1===s.async)throw new eY;return n.then(r=>t._zod.parse(r,s))}return t._zod.parse(n,s)};t._zod.run=(a,s)=>{if(s.skipChecks)return t._zod.parse(a,s);if("backward"===s.direction){let r=t._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return r instanceof Promise?r.then(t=>o(t,a,s)):o(r,a,s)}let n=t._zod.parse(a,s);if(n instanceof Promise){if(!1===s.async)throw new eY;return n.then(t=>r(t,i,s))}return r(n,i,s)}}},{get"~standard"(){return eF(this,"~standard",tW(this),!1)},set"~standard"(value){eF(this,"~standard",value)}}),tG=(t,r)=>t.issues.length?{issues:t.issues.map(t=>ez(t,r,e1()))}:{value:t.value};async function tZ(t,r){let o={async:!0};return tG(await t._zod.run({value:r,issues:[]},o),o)}function tW(t){return{validate:r=>{let o={async:!1};try{let a=t._zod.run({value:r,issues:[]},o);if(!(a instanceof Promise))return tG(a,o)}catch(t){}return tZ(t,r)},vendor:"zod",version:1}}let tX=eX("$ZodString",(t,r)=>{tB.init(t,r),t._zod.pattern=r.pattern??t_,t._zod.parse=(o,a)=>{if(r.coerce)try{o.value=String(o.value)}catch(t){}return"string"==typeof o.value||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:t}),o}}),tY=eX("$ZodStringFormat",(t,r)=>{tq.init(t,r),tX.init(t,r)}),tQ=eX("$ZodGUID",(t,r)=>{r.pattern??(r.pattern=tn),tY.init(t,r)}),t0=eX("$ZodUUID",(t,r)=>{if(r.version){let t={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(void 0===t)throw Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=tl(t))}else r.pattern??(r.pattern=tl());tY.init(t,r)}),t1=eX("$ZodEmail",(t,r)=>{r.pattern??(r.pattern=tc),tY.init(t,r)});function t2(t){try{if("undefined"!=typeof URL&&"function"==typeof URL.canParse)return URL.canParse(t);return new URL(t),!0}catch{return!1}}let t9=/[\t\n\r]/g;function t4(t){return t.replace(t9,"")}let t5=eX("$ZodURL",(t,r)=>{tY.init(t,r),t._zod.check=o=>{try{var a,i;let s=o.value.trim(),n="normalize"in r||"hostname"in r||"protocol"in r?function(t,r){if(!r.normalize&&r.protocol?.source===tm.source&&!/^https?:\/\//i.test(t))return 1;try{if("undefined"!=typeof URL){let r=URL;if("function"==typeof r.parse)return r.parse(t)??2}return new URL(t)}catch{return 2}}(s,r):t2(s)||2;if(1===n)return void o.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:o.value,inst:t,continue:!r.abort});if(2===n)return void o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:t,continue:!r.abort});if(!0===n){o.value=t4(s);return}r.hostname&&((a=r.hostname).lastIndex=0,!a.test(n.hostname))&&o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:r.hostname.source,input:o.value,inst:t,continue:!r.abort}),r.protocol&&((i=r.protocol).lastIndex=0,!i.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol))&&o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:o.value,inst:t,continue:!r.abort}),o.value=r.normalize?n.href:t4(s);return}catch(a){o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:t,continue:!r.abort})}}}),t3=eX("$ZodEmoji",(t,r)=>{r.pattern??(r.pattern=RegExp(tu,"u")),tY.init(t,r)}),t6=eX("$ZodNanoID",(t,r)=>{var o;if(void 0!==r.length&&(!Number.isInteger(r.length)||r.length<1))throw Error(`Invalid nanoid length: ${r.length}`);r.pattern??(r.pattern=void 0===r.length?ti:(o=r.length,RegExp(`^[a-zA-Z0-9_-]{${o}}$`))),tY.init(t,r)}),t8=eX("$ZodCUID",(t,r)=>{r.pattern??(r.pattern=te),tY.init(t,r)}),t7=eX("$ZodCUID2",(t,r)=>{r.pattern??(r.pattern=tt),tY.init(t,r)}),re=eX("$ZodULID",(t,r)=>{r.pattern??(r.pattern=tr),tY.init(t,r)}),rt=eX("$ZodXID",(t,r)=>{r.pattern??(r.pattern=to),tY.init(t,r)}),rr=eX("$ZodKSUID",(t,r)=>{r.pattern??(r.pattern=ta),tY.init(t,r)}),ro=eX("$ZodISODateTime",(t,r)=>{let o,a,i;r.pattern??(o=["Z"],r.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),a=`${tb({precision:r.precision,seconds:!0})}(?:${o.join("|")})`,i=r.local?`${a}|${tb({precision:r.precision})}`:a,r.pattern=RegExp(`^${tg}T(?:${i})$`)),tY.init(t,r)}),ra=eX("$ZodISODate",(t,r)=>{r.pattern??(r.pattern=tv),tY.init(t,r)}),ri=eX("$ZodISOTime",(t,r)=>{r.pattern??(r.pattern=RegExp(`^${tb(r)}$`)),tY.init(t,r)}),rs=eX("$ZodISODuration",(t,r)=>{r.pattern??(r.pattern=ts),tY.init(t,r)}),rn=eX("$ZodIPv4",(t,r)=>{r.pattern??(r.pattern=td),tY.init(t,r)}),rl=/^[0-9a-fA-F:.]+$/;function rc(t){return!!rl.test(t)&&t2(`http://[${t}]`)}let ru=eX("$ZodIPv6",(t,r)=>{r.pattern??(r.pattern=tp),tY.init(t,r),t._zod.check=o=>{rc(o.value)||o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:t,continue:!r.abort})}}),rd=eX("$ZodCIDRv4",(t,r)=>{r.pattern??(r.pattern=th),tY.init(t,r)}),rp=eX("$ZodCIDRv6",(t,r)=>{r.pattern??(r.pattern=tf),tY.init(t,r),t._zod.check=o=>{!function(t){let r=t.split("/");if(2!==r.length)return!1;let[o,a]=r;if(!a)return!1;let i=Number(a);return`${i}`===a&&!(i<0)&&!(i>128)&&rc(o)}(o.value)&&o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:t,continue:!r.abort})}});function rh(t){if(""===t)return!0;if(/\s/.test(t)||t.length%4!=0)return!1;try{return atob(t),!0}catch{return!1}}let rf=/^[0-9a-zA-Z+/]*={0,2}$/,rm=eX("$ZodBase64",(t,r)=>{r.pattern??(r.pattern=rf),tY.init(t,r),t._zod.check=o=>{rh(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:t,continue:!r.abort})}}),ry=/^[A-Za-z0-9_-]*$/,rg=eX("$ZodBase64URL",(t,r)=>{r.pattern??(r.pattern=ry),tY.init(t,r),t._zod.check=o=>{!function(t){if(!ry.test(t))return!1;let r=t.replace(/[-_]/g,t=>"-"===t?"+":"/");return rh(r.padEnd(4*Math.ceil(r.length/4),"="))}(o.value)&&o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:t,continue:!r.abort})}}),rv=eX("$ZodE164",(t,r)=>{r.pattern??(r.pattern=ty),tY.init(t,r)}),rb=eX("$ZodJWT",(t,r)=>{tY.init(t,r),t._zod.check=o=>{!function(t,r=null){try{let o=t.split(".");if(3!==o.length)return!1;let[a]=o;if(!a)return!1;let i=JSON.parse(atob(a));if("typ"in i&&i?.typ!=="JWT"||!i.alg||r&&(!("alg"in i)||i.alg!==r))return!1;return!0}catch{return!1}}(o.value,r.alg)&&o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:t,continue:!r.abort})}}),r_=eX("$ZodNumber",(t,r)=>{tB.init(t,r),t._zod.pattern=t$,t._zod.parse=(o,a)=>{if(r.coerce)try{o.value=Number(o.value)}catch(t){}let i=o.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return o;let s="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return o.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),o}}),rS=eX("$ZodNumberFormat",(t,r)=>{tN.init(t,r),r_.init(t,r)}),r$=eX("$ZodBoolean",(t,r)=>{tB.init(t,r),t._zod.pattern=tw,t._zod.parse=(o,a)=>{if(r.coerce)try{o.value=!!o.value}catch(t){}let i=o.value;return"boolean"==typeof i||o.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),o}}),rw=eX("$ZodNull",(t,r)=>{tB.init(t,r),t._zod.pattern=tE,t._zod.values=new Set([null]),t._zod.parse=(r,o)=>{let a=r.value;return null===a||r.issues.push({expected:"null",code:"invalid_type",input:a,inst:t}),r}}),rE=eX("$ZodAny",(t,r)=>{tB.init(t,r),t._zod.parse=t=>t}),rR=eX("$ZodUnknown",(t,r)=>{tB.init(t,r),t._zod.parse=t=>t}),rP=eX("$ZodNever",(t,r)=>{tB.init(t,r),t._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function rk(t,r,o){t.issues.length&&r.issues.push(...eA(o,t.issues)),r.value[o]=t.value}let rO=eX("$ZodArray",(t,r)=>{tB.init(t,r);let o=e0.memoizer;o?.attach(t),t._zod.parse=(a,i)=>{let s=a.value;if(!Array.isArray(s))return a.issues.push({expected:"array",code:"invalid_type",input:s,inst:t}),a;a.value=o?o.alloc(t,a,Array(s.length),i):Array(s.length);let n=[],l=i?.abortEarly;for(let t=0;t<s.length;t++){let o=s[t],c=r.element._zod.run({value:o,issues:[]},i);if(c instanceof Promise)n.push(c.then(r=>rk(r,a,t)));else if(rk(c,a,t),l&&0!==c.issues.length&&eI(c))break}return n.length?Promise.all(n).then(()=>a):a}});function rT(t,r,o,a,i,s){let n=o in a,l="optional"===s;if(n||!l||"optional"!==i){if(t.issues.length){if(void 0!==i&&l&&!n)return;r.issues.push(...eA(o,t.issues))}if(!n&&void 0===i){t.issues.length||r.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[o]});return}void 0===t.value?(n||"defaulted"===i&&!l)&&(r.value[o]=void 0):r.value[o]=t.value}}let rx=[];function rj(t){var r;let o=Object.keys(t.shape),a=Object.getOwnPropertySymbols(t.shape),i=a.length?a:rx,s=i.length?[...o,...i]:o;for(let r of s)if(!t.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(r)}": expected a Zod schema`);let n=Object.keys(r=t.shape).filter(t=>void 0!==r[t]._zod.optin&&"optional"===r[t]._zod.optout);return{...t,allKeys:s,symbolKeys:i,keySet:new Set(o),numKeys:o.length,optionalKeys:new Set(n)}}function rC(t,r,o,a,i,s,n){let l=[],c=i.keySet,u=i.catchall._zod,d=u.def.type,p=u.optin,h=u.optout,f=0;for(let i in r){if(n&&o.issues.length!==f){if(eI(o,f))break;f=o.issues.length}if(c.has(i))continue;if("__proto__"===i){"never"===d&&l.push(i);continue}if("never"===d){l.push(i);continue}let s=u.run({value:r[i],issues:[]},a);s instanceof Promise?t.push(s.then(t=>rT(t,o,i,r,p,h))):rT(s,o,i,r,p,h)}return(l.length&&o.issues.push({code:"unrecognized_keys",keys:l,input:r,inst:s,continue:!0}),t.length)?Promise.all(t).then(()=>o):o}let rN=eX("$ZodObject",(t,r)=>{let o;tB.init(t,r);let a=Object.getOwnPropertyDescriptor(r,"shape"),i=a?.get?a.get.raw:r.shape??{};if(i){let t=()=>{let o={...i};return Object.defineProperty(r,"shape",{value:o}),t.raw=o,o};t.raw=i,Object.defineProperty(r,"shape",{get:t})}let s=ec(()=>rj(r));eB(t,"propValues",t=>{let r=t.def.shape,o={};for(let t in r){let a=r[t]._zod;if(a.values){for(let r of(Object.prototype.hasOwnProperty.call(o,t)||ep(o,t,new Set),a.values))o[t].add(r);void 0!==a.optin&&o[t].add(void 0)}}return o});let n=r.catchall,l=e0.memoizer;l?.attach(t),t._zod.parse=(r,a)=>{o??(o=s.value);let i=r.value;if(!e_(i))return r.issues.push({expected:"object",code:"invalid_type",input:i,inst:t}),r;r.value=l?l.alloc(t,r,{},a):{};let c=[],u=o.shape,d=a?.abortEarly,p=r.issues.length;for(let t of o.allKeys){if(d&&r.issues.length!==p){if(eI(r,p))break;p=r.issues.length}if("__proto__"===t)continue;let o=u[t],s=o._zod.optin,n=o._zod.optout,l=o._zod.run({value:i[t],issues:[]},a);l instanceof Promise?c.push(l.then(o=>rT(o,r,t,i,s,n))):rT(l,r,t,i,s,n)}return n?rC(c,i,r,a,s.value,t,!0===d):c.length?Promise.all(c).then(()=>r):r}}),rI=eX("$ZodObjectJIT",(t,r)=>{let o,a;rN.init(t,r);let i=t._zod.parse,s=ec(()=>rj(r)),n=e0.memoizer,l=!e0.jitless,c=l&&eS.value,u=r.catchall;t._zod.parse=(d,p)=>{a??(a=s.value);let h=d.value;return e_(h)?l&&c&&p?.async===!1&&!0!==p.jitless?(o||(o=(r=>{let o=s.value,a=o.symbolKeys,i=new tK(["payload","ctx"],{shape:r,inst:t,memo:n,syms:a}),l=t=>`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`,c=(t,r)=>`
|
|
4
|
+
let ${t}_ab = false;
|
|
5
|
+
for (let i = 0; i < ${t}.issues.length; i++) {
|
|
6
|
+
const iss = ${t}.issues[i];
|
|
7
|
+
iss.path = iss.path ? [${r}, ...iss.path] : [${r}];
|
|
8
|
+
payload.issues.push(iss);
|
|
9
|
+
if (iss.continue !== true) ${t}_ab = true;
|
|
8
10
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
if (${t}_ab && ctx && ctx.abortEarly) {
|
|
12
|
+
payload.value = newResult;
|
|
13
|
+
return payload;
|
|
14
|
+
}`;i.write("const input = payload.value;");let u=Object.create(null),d=0;for(let t of o.allKeys)u[t]=`key_${d++}`;for(let t of(i.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};"),o.allKeys)){if("__proto__"===t)continue;let o=u[t],s="symbol"==typeof t?`syms[${a.indexOf(t)}]`:JSON.stringify(t),n=`${s} in input`,d=r[t],p=d?._zod?.optin,h=void 0!==p,f=d?._zod?.optout==="optional";if(i.write(`const ${o} = ${l(s)};`),h&&f){let t="optional"===p?`${o}_present`:`${o}.value !== undefined || ${o}_present`;i.write(`
|
|
15
|
+
const ${o}_present = ${n};
|
|
16
|
+
if (!${o}.issues.length || ${o}_present) {
|
|
17
|
+
if (${o}.issues.length) {${c(o,s)}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (${t}) {
|
|
21
|
+
newResult[${s}] = ${o}.value;
|
|
14
22
|
}
|
|
15
|
-
} else {
|
|
16
|
-
newResult[${s}] = ${r}.value;
|
|
17
23
|
}
|
|
18
|
-
|
|
19
|
-
`)
|
|
20
|
-
if (${
|
|
21
|
-
payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
|
|
22
|
-
...iss,
|
|
23
|
-
path: iss.path ? [${s}, ...iss.path] : [${s}]
|
|
24
|
-
})));
|
|
24
|
+
|
|
25
|
+
`)}else h?(i.write(`
|
|
26
|
+
if (${o}.issues.length) {${c(o,s)}
|
|
25
27
|
}
|
|
26
|
-
|
|
27
|
-
if (${
|
|
28
|
-
|
|
29
|
-
newResult[${s}] = undefined;
|
|
30
|
-
}
|
|
31
|
-
} else {
|
|
32
|
-
newResult[${s}] = ${r}.value;
|
|
28
|
+
`),"defaulted"===p?i.write(`newResult[${s}] = ${o}.value;`):i.write(`
|
|
29
|
+
if (${o}.value !== undefined || ${n}) {
|
|
30
|
+
newResult[${s}] = ${o}.value;
|
|
33
31
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (${r}.issues.length) {
|
|
38
|
-
payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
|
|
39
|
-
...iss,
|
|
40
|
-
path: iss.path ? [${s}, ...iss.path] : [${s}]
|
|
41
|
-
})));
|
|
32
|
+
`)):i.write(`
|
|
33
|
+
const ${o}_present = ${n};
|
|
34
|
+
if (${o}.issues.length) {${c(o,s)}
|
|
42
35
|
}
|
|
43
|
-
if (!${
|
|
36
|
+
if (!${o}_present && !${o}.issues.length) {
|
|
44
37
|
payload.issues.push({
|
|
45
38
|
code: "invalid_type",
|
|
46
39
|
expected: "nonoptional",
|
|
47
40
|
input: undefined,
|
|
48
41
|
path: [${s}]
|
|
49
42
|
});
|
|
43
|
+
if (ctx && ctx.abortEarly) {
|
|
44
|
+
payload.value = newResult;
|
|
45
|
+
return payload;
|
|
46
|
+
}
|
|
50
47
|
}
|
|
51
48
|
|
|
52
|
-
if (${
|
|
53
|
-
|
|
54
|
-
newResult[${s}] = undefined;
|
|
55
|
-
} else {
|
|
56
|
-
newResult[${s}] = ${r}.value;
|
|
57
|
-
}
|
|
49
|
+
if (${o}_present) {
|
|
50
|
+
newResult[${s}] = ${o}.value;
|
|
58
51
|
}
|
|
59
52
|
|
|
60
|
-
`)}t.write("payload.value = newResult;"),t.write("return payload;");let n=t.compile();return(t,r)=>n(e,t,r)})(t.shape)),c=r(c,u),l)?t4([],d,c,u,o,e):c:a(c,u):(c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c)}});function t6(e,t,r,o){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let a=e.filter(e=>!eW(e));return 1===a.length?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>eQ(e,o,eo())))}),t)}let t8=Q("$ZodUnion",(e,t)=>{t_.init(e,t),eM(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),eM(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eM(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),eM(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>eI(e.source)).join("|")})$`)}});let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(o,a)=>{if(r)return r(o,a);let i=!1,s=[];for(let e of t.options){let t=e._zod.run({value:o.value,issues:[]},a);if(t instanceof Promise)s.push(t),i=!0;else{if(0===t.issues.length)return t;s.push(t)}}return i?Promise.all(s).then(t=>t6(t,o,e,a)):t6(s,o,e,a)}}),t7=Q("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,t8.init(e,t);let r=e._zod.parse;eM(e._zod,"propValues",()=>{let e={};for(let r of t.options){let o=r._zod.propValues;if(!o||0===Object.keys(o).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let[t,r]of Object.entries(o))for(let o of(e[t]||(e[t]=new Set),r))e[t].add(o)}return e});let o=eN(()=>{let e=t.options,r=new Map;for(let o of e){let e=o._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let t of e){if(r.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);r.set(t,o)}}return r});e._zod.parse=(a,i)=>{let s=a.value;if(!eU(s))return a.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),a;let n=o.value.get(s?.[t.discriminator]);return n?n._zod.run(a,i):t.unionFallback||"backward"===i.direction?r(a,i):(a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:s,path:[t.discriminator],inst:e}),a)}}),re=Q("$ZodIntersection",(e,t)=>{t_.init(e,t),e._zod.parse=(e,r)=>{let o=e.value,a=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([t,r])=>rt(e,t,r)):rt(e,a,i)}});function rt(e,t,r){let o,a=new Map;for(let r of t.issues)if("unrecognized_keys"===r.code)for(let e of(o??(o=r),r.keys))a.has(e)||a.set(e,{}),a.get(e).l=!0;else e.issues.push(r);for(let t of r.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)a.has(e)||a.set(e,{}),a.get(e).r=!0;else e.issues.push(t);let i=[...a].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&o&&e.issues.push({...o,keys:i}),eW(e))return e;let s=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(eF(t)&&eF(r)){let o=Object.keys(r),a=Object.keys(t).filter(e=>-1!==o.indexOf(e)),i={...t,...r};for(let o of a){let a=e(t[o],r[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i[o]=a.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let o=[];for(let a=0;a<t.length;a++){let i=e(t[a],r[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};o.push(i.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!s.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}let rr=Q("$ZodRecord",(e,t)=>{t_.init(e,t),e._zod.parse=(r,o)=>{let a=r.value;if(!eF(a))return r.issues.push({expected:"record",code:"invalid_type",input:a,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){let n;r.value={};let l=new Set;for(let n of s)if("string"==typeof n||"number"==typeof n||"symbol"==typeof n){l.add("number"==typeof n?n.toString():n);let s=t.keyType._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(s.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(e=>eQ(e,o,eo())),input:n,path:[n],inst:e});continue}let c=s.value,u=t.valueType._zod.run({value:a[n],issues:[]},o);u instanceof Promise?i.push(u.then(e=>{e.issues.length&&r.issues.push(...eX(n,e.issues)),r.value[c]=e.value})):(u.issues.length&&r.issues.push(...eX(n,u.issues)),r.value[c]=u.value)}for(let e in a)l.has(e)||(n=n??[]).push(e);n&&n.length>0&&r.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:n})}else for(let s of(r.value={},Reflect.ownKeys(a))){if("__proto__"===s||!Object.prototype.propertyIsEnumerable.call(a,s))continue;let n=t.keyType._zod.run({value:s,issues:[]},o);if(n instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof s&&eP.test(s)&&n.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},o);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(n=e)}if(n.issues.length){"loose"===t.mode?r.value[s]=a[s]:r.issues.push({code:"invalid_key",origin:"record",issues:n.issues.map(e=>eQ(e,o,eo())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:a[s],issues:[]},o);l instanceof Promise?i.push(l.then(e=>{e.issues.length&&r.issues.push(...eX(s,e.issues)),r.value[n.value]=e.value})):(l.issues.length&&r.issues.push(...eX(s,l.issues)),r.value[n.value]=l.value)}return i.length?Promise.all(i).then(()=>r):r}}),ro=Q("$ZodEnum",(e,t)=>{t_.init(e,t);let r=ej(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=RegExp(`^(${r.filter(e=>eK.has(typeof e)).map(e=>"string"==typeof e?eJ(e):e.toString()).join("|")})$`),e._zod.parse=(t,a)=>{let i=t.value;return o.has(i)||t.issues.push({code:"invalid_value",values:r,input:i,inst:e}),t}}),ra=Q("$ZodLiteral",(e,t)=>{if(t_.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?eJ(e):e?eJ(e.toString()):String(e)).join("|")})$`),e._zod.parse=(o,a)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),ri=Q("$ZodTransform",(e,t)=>{t_.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if("backward"===o.direction)throw new et(e.constructor.name);let a=t.transform(r.value,r);if(o.async)return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(r.value=e,r.fallback=!0,r));if(a instanceof Promise)throw new ee;return r.value=a,r.fallback=!0,r}});function rs(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let rn=Q("$ZodOptional",(e,t)=>{t_.init(e,t),e._zod.optin="optional",e._zod.optout="optional",eM(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),eM(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${eI(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){let o=e.value,a=t.innerType._zod.run(e,r);return a instanceof Promise?a.then(e=>rs(e,o)):rs(a,o)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),rl=Q("$ZodExactOptional",(e,t)=>{rn.init(e,t),eM(e._zod,"values",()=>t.innerType._zod.values),eM(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),rc=Q("$ZodNullable",(e,t)=>{t_.init(e,t),eM(e._zod,"optin",()=>t.innerType._zod.optin),eM(e._zod,"optout",()=>t.innerType._zod.optout),eM(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${eI(e.source)}|null)$`):void 0}),eM(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),ru=Q("$ZodDefault",(e,t)=>{t_.init(e,t),e._zod.optin="optional",eM(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let o=t.innerType._zod.run(e,r);return o instanceof Promise?o.then(e=>rd(e,t)):rd(o,t)}});function rd(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let rp=Q("$ZodPrefault",(e,t)=>{t_.init(e,t),e._zod.optin="optional",eM(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),rh=Q("$ZodNonOptional",(e,t)=>{t_.init(e,t),eM(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,o)=>{let a=t.innerType._zod.run(r,o);return a instanceof Promise?a.then(t=>rf(t,e)):rf(a,e)}});function rf(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let rm=Q("$ZodCatch",(e,t)=>{t_.init(e,t),e._zod.optin="optional",eM(e._zod,"optout",()=>t.innerType._zod.optout),eM(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let o=t.innerType._zod.run(e,r);return o instanceof Promise?o.then(o=>(e.value=o.value,o.issues.length&&(e.value=t.catchValue({...e,error:{issues:o.issues.map(e=>eQ(e,r,eo()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=o.value,o.issues.length&&(e.value=t.catchValue({...e,error:{issues:o.issues.map(e=>eQ(e,r,eo()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),ry=Q("$ZodPipe",(e,t)=>{t_.init(e,t),eM(e._zod,"values",()=>t.in._zod.values),eM(e._zod,"optin",()=>t.in._zod.optin),eM(e._zod,"optout",()=>t.out._zod.optout),eM(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let o=t.out._zod.run(e,r);return o instanceof Promise?o.then(e=>rg(e,t.in,r)):rg(o,t.in,r)}let o=t.in._zod.run(e,r);return o instanceof Promise?o.then(e=>rg(e,t.out,r)):rg(o,t.out,r)}});function rg(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}let rv=Q("$ZodPreprocess",(e,t)=>{ry.init(e,t)}),rb=Q("$ZodReadonly",(e,t)=>{t_.init(e,t),eM(e._zod,"propValues",()=>t.innerType._zod.propValues),eM(e._zod,"values",()=>t.innerType._zod.values),eM(e._zod,"optin",()=>t.innerType?._zod?.optin),eM(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let o=t.innerType._zod.run(e,r);return o instanceof Promise?o.then(r_):r_(o)}});function r_(e){return e.value=Object.freeze(e.value),e}let rS=Q("$ZodLazy",(e,t)=>{t_.init(e,t),eM(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),eM(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),eM(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),eM(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),eM(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)}),r$=Q("$ZodCustom",(e,t)=>{e2.init(e,t),t_.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let o=r.value,a=t.fn(o);if(a instanceof Promise)return a.then(t=>rw(t,r,o,e));rw(a,r,o,e)}});function rw(e,t,r,o){if(!e){let e={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(e.params=o._zod.def.params),t.issues.push(e1(e))}}Symbol("ZodOutput"),Symbol("ZodInput");(b=globalThis).__zod_globalRegistry??(b.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let rE=globalThis.__zod_globalRegistry;function rR(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...eG(t)})}function rP(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...eG(t)})}function rk(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...eG(t)})}function rT(e,t){return new e4({check:"less_than",...eG(t),value:e,inclusive:!1})}function rO(e,t){return new e4({check:"less_than",...eG(t),value:e,inclusive:!0})}function rx(e,t){return new e5({check:"greater_than",...eG(t),value:e,inclusive:!1})}function rj(e,t){return new e5({check:"greater_than",...eG(t),value:e,inclusive:!0})}function rC(e,t){return new e3({check:"multiple_of",...eG(t),value:e})}function rN(e,t){return new e8({check:"max_length",...eG(t),maximum:e})}function rI(e,t){return new e7({check:"min_length",...eG(t),minimum:e})}function rA(e,t){return new te({check:"length_equals",...eG(t),length:e})}function rM(e){return new tl({check:"overwrite",tx:e})}function rq(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??rE,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function rz(e,t,r={path:[],schemaPath:[]}){var o;let a=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let n=e._zod.toJSONSchema?.();if(n)s.schema=n;else{let o={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,o);else{let r=s.schema,i=t.processors[a.type];if(!i)throw Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);i(e,t,r,o)}let i=e._zod.parent;i&&(s.ref||(s.ref=i),rz(i,t,o),t.seen.get(i).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),"input"===t.io&&function e(t,r){let o=r??{seen:new Set};if(o.seen.has(t))return!1;o.seen.add(t);let a=t._zod.def;if("transform"===a.type)return!0;if("array"===a.type)return e(a.element,o);if("set"===a.type)return e(a.valueType,o);if("lazy"===a.type)return e(a.getter(),o);if("promise"===a.type||"optional"===a.type||"nonoptional"===a.type||"nullable"===a.type||"readonly"===a.type||"default"===a.type||"prefault"===a.type)return e(a.innerType,o);if("intersection"===a.type)return e(a.left,o)||e(a.right,o);if("record"===a.type||"map"===a.type)return e(a.keyType,o)||e(a.valueType,o);if("pipe"===a.type)return!!t._zod.traits.has("$ZodCodec")||e(a.in,o)||e(a.out,o);if("object"===a.type){for(let t in a.shape)if(e(a.shape[t],o))return!0;return!1}if("union"===a.type){for(let t of a.options)if(e(t,o))return!0;return!1}if("tuple"===a.type){for(let t of a.items)if(e(t,o))return!0;if(a.rest&&e(a.rest,o))return!0}return!1}(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&"_prefault"in s.schema&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function rL(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let t of e.seen.entries()){let r=e.metadataRegistry.get(t[0])?.id;if(r){let e=o.get(r);if(e&&e!==t[0])throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(r,t[0])}}let a=t=>{if(t[1].schema.$ref)return;let o=t[1],{ref:a,defId:i}=(t=>{let o="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,a=e.external.uri??(e=>e);if(r)return{ref:a(r)};let i=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=i,{defId:i,ref:`${a("__shared")}#/${o}/${i}`}}if(t[1]===r)return{ref:"#"};let a=`#/${o}/`,i=t[1].schema.id??`__schema${e.counter++}`;return{defId:i,ref:a+i}})(t);o.def={...o.schema},i&&(o.defId=i);let s=o.schema;for(let e in s)delete s[e];s.$ref=a};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
53
|
+
`)}return i.write("payload.value = newResult;"),i.write("return payload;"),i.compile()})(r.shape)),d=o(d,p),u)?rC([],h,d,p,a,t,p?.abortEarly===!0):d:i(d,p):(d.issues.push({expected:"object",code:"invalid_type",input:h,inst:t}),d)}});function rA(t,r,o,a){for(let o of t)if(0===o.issues.length)return r.value=o.value,r;let i=t.filter(t=>!eI(t));return 1===i.length?(r.value=i[0].value,i[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:o,errors:t.map(t=>t.issues.map(t=>ez(t,a,e1())))}),r)}let rM=eX("$ZodUnion",(t,r)=>{tB.init(t,r),eB(t,"optin",t=>t.def.options.some(t=>"defaulted"===t._zod.optin)?"defaulted":t.def.options.some(t=>void 0!==t._zod.optin)?"optional":void 0),eB(t,"optout",t=>t.def.options.some(t=>"optional"===t._zod.optout)?"optional":void 0),eB(t,"values",t=>{if(t.def.options.every(t=>t._zod.values))return new Set(t.def.options.flatMap(t=>Array.from(t._zod.values)))}),eB(t,"pattern",t=>{if(t.def.options.every(t=>t._zod.pattern)){let r=t.def.options.map(t=>t._zod.pattern);return RegExp(`^(${r.map(t=>eu(t.source)).join("|")})$`)}});let o=1===r.options.length?r.options[0]._zod.run:null;t._zod.parse=(a,i)=>{if(o)return o(a,i);let s=!1,n=[];for(let t of r.options){let r=t._zod.run({value:a.value,issues:[]},i);if(r instanceof Promise)n.push(r),s=!0;else{if(0===r.issues.length)return r;n.push(r)}}return s?Promise.all(n).then(r=>rA(r,a,t,i)):rA(n,a,t,i)}}),rq=eX("$ZodDiscriminatedUnion",(t,r)=>{r.inclusive=!1,rM.init(t,r);let o=t._zod.parse;eB(t,"propValues",t=>{let r={},o=0;for(let a of t.def.options){let i=a._zod.propValues;if(!i||0===Object.keys(i).length)throw Error(`Invalid discriminated union option at index "${t.def.options.indexOf(a)}"`);for(let[a,s]of(i[t.def.discriminator]?.has(void 0)&&o++,Object.entries(i)))for(let t of(Object.prototype.hasOwnProperty.call(r,a)||ep(r,a,new Set),s))r[a].add(t)}return!t.def.unionFallback&&o>1&&r[t.def.discriminator]?.delete(void 0),r}),r.options.forEach((t,o)=>{let a=eh(t._zod.def);if(a&&!Object.prototype.hasOwnProperty.call(a,r.discriminator))throw Error(`Invalid discriminated union option at index "${o}"`)});let a=ec(()=>(function(t){let r=new Map;for(let o of t.options){let a=o._zod.propValues?.[t.discriminator];if(!a||0===a.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let t of a)if(r.has(t)){if(void 0!==t)throw Error(`Duplicate discriminator value "${String(t)}"`);r.set(t,null)}else r.set(t,o)}return r})(r));t._zod.parse=(i,s)=>{let n=i.value;if(!e_(n))return i.issues.push({code:"invalid_type",expected:"object",input:n,inst:t}),i;let l=n?.[r.discriminator],c=a.value.get(l);return c&&(void 0!==l||"backward"!==s.direction)?c._zod.run(i,s):r.unionFallback||"backward"===s.direction?o(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:r.discriminator,options:Array.from(a.value.keys()).filter(t=>null!==a.value.get(t)),input:n,path:[r.discriminator],inst:t}),i)}}),rz=eX("$ZodIntersection",(t,r)=>{tB.init(t,r),t._zod.parse=(t,o)=>{let a=t.value,i=r.left._zod.run({value:a,issues:[]},o),s=r.right._zod.run({value:a,issues:[]},o);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([r,o])=>rL(t,r,o)):rL(t,i,s)}});function rL(t,r,o){let a,i=new Map,s=new Map,n=(t,r)=>{let o;if("unrecognized_keys"!==t.code||t.path?.length)if("invalid_key"!==t.code||"record"!==t.origin||t.path?.length!==1)return!1;else{let r=String(t.path[0]);s.has(r)||s.set(r,t),o=[r]}else a??(a=t),o=t.keys;for(let t of o)i.has(t)||i.set(t,{}),i.get(t)[r]=!0;return!0};for(let o of r.issues)n(o,"l")||t.issues.push(o);for(let r of o.issues)n(r,"r")||t.issues.push(r);let l=[...i].filter(([,t])=>t.l&&t.r).map(([t])=>t);if(l.length){let r=a?l.filter(t=>a.keys.includes(t)):[];for(let o of(r.length&&t.issues.push({...a,keys:r}),l))!r.includes(o)&&s.has(o)&&t.issues.push(s.get(o))}let c=function t(r,o){if(r===o||r instanceof Date&&o instanceof Date&&+r==+o)return{valid:!0,data:r};if(e$(r)&&e$(o)){let a=Object.keys(o),i=Object.keys(r).filter(t=>-1!==a.indexOf(t)),s={...r,...o};for(let a of(Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__,i)){if("__proto__"===a)continue;let i=t(r[a],o[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};s[a]=i.data}return{valid:!0,data:s}}if(Array.isArray(r)&&Array.isArray(o)){if(r.length!==o.length)return{valid:!1,mergeErrorPath:[]};let a=[];for(let i=0;i<r.length;i++){let s=t(r[i],o[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};a.push(s.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}(r.value,o.value);if(!c.valid){if(eI(t))return t;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return t.value=c.data,t}let rD=eX("$ZodRecord",(t,r)=>{tB.init(t,r);let o=e0.memoizer;o?.attach(t),t._zod.parse=(a,i)=>{let s=a.value;if(!e$(s))return a.issues.push({expected:"record",code:"invalid_type",input:s,inst:t}),a;let n=[],l=r.keyType._zod.values;if(l&&!r.partial){let c;a.value=o?o.alloc(t,a,{},i):{};let u=new Set;for(let o of l)if("string"==typeof o||"number"==typeof o||"symbol"==typeof o){if(u.add("number"==typeof o?o.toString():o),"__proto__"===o)continue;let l=r.keyType._zod.run({value:o,issues:[]},i);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(l.issues.length){a.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(t=>ez(t,i,e1())),input:o,path:[o],inst:t});continue}let c=l.value;if("__proto__"===c)continue;let d=r.valueType._zod.run({value:s[o],issues:[]},i);d instanceof Promise?n.push(d.then(t=>{t.issues.length&&a.issues.push(...eA(o,t.issues)),a.value[c]=t.value})):(d.issues.length&&a.issues.push(...eA(o,d.issues)),a.value[c]=d.value)}for(let t in s)if(!u.has(t))if("loose"===r.mode){if("__proto__"===t)continue;a.value[t]=s[t]}else(c=c??[]).push(t);c&&c.length>0&&a.issues.push({code:"unrecognized_keys",input:s,inst:t,keys:c,continue:!0})}else{let c;for(let u of(a.value=o?o.alloc(t,a,{},i):{},Reflect.ownKeys(s))){if("__proto__"===u||!Object.prototype.propertyIsEnumerable.call(s,u))continue;let o=r.keyType._zod.run({value:u,issues:[]},i);if(o instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof u&&t$.test(u)&&o.issues.length){let t=r.keyType._zod.run({value:Number(u),issues:[]},i);if(t instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===t.issues.length&&(o=t)}if(o.issues.length){"loose"===r.mode?a.value[u]=s[u]:l?(c=c??[]).push(u):a.issues.push({code:"invalid_key",origin:"record",issues:o.issues.map(t=>ez(t,i,e1())),input:u,path:[u],inst:t});continue}let d=o.value;if("__proto__"===d)continue;let p=r.valueType._zod.run({value:s[u],issues:[]},i);p instanceof Promise?n.push(p.then(t=>{t.issues.length&&a.issues.push(...eA(u,t.issues)),a.value[d]=t.value})):(p.issues.length&&a.issues.push(...eA(u,p.issues)),a.value[d]=p.value)}c&&c.length>0&&a.issues.push({code:"unrecognized_keys",input:s,inst:t,keys:c,continue:!0})}return n.length?Promise.all(n).then(()=>a):a}}),rU=eX("$ZodEnum",(t,r)=>{tB.init(t,r);let o=ei(r.entries),a=new Set(o);t._zod.values=a,eB(t,"pattern",t=>{let r=ei(t.def.entries).filter(t=>eE.has(typeof t));return new RegExp(r.length?`^(${r.map(t=>eR(t.toString())).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(r,i)=>{let s=r.value;return a.has(s)||r.issues.push({code:"invalid_value",values:o,input:s,inst:t}),r}}),rV=eX("$ZodLiteral",(t,r)=>{tB.init(t,r);let o=new Set(r.values);t._zod.values=o,eB(t,"pattern",t=>{let r=t.def.values;return new RegExp(r.length?`^(${r.map(t=>"string"==typeof t?eR(t):t?eR(t.toString()):String(t)).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(a,i)=>{let s=a.value;return o.has(s)||a.issues.push({code:"invalid_value",values:r.values,input:s,inst:t}),a}}),rF=eX("$ZodTransform",(t,r)=>{tB.init(t,r),t._zod.optin="optional",e0.memoizer?.guard(t),t._zod.parse=(o,a)=>{if("backward"===a.direction)throw new eQ(t.constructor.name);let i=r.transform(o.value,o);if(a.async)return(i instanceof Promise?i:Promise.resolve(i)).then(t=>(o.value=t,o));if(i instanceof Promise)throw new eY;return o.value=i,o}});function rH(t,r){return t.value=r.issues.length?void 0:r.value,t}let rK=eX("$ZodOptional",(t,r)=>{tB.init(t,r),eB(t,"optin",t=>"defaulted"===t.def.innerType._zod.optin?"defaulted":"optional"),t._zod.optout="optional",eB(t,"values",t=>{let r=t.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),eB(t,"pattern",t=>{let r=t.def.innerType._zod.pattern;return r?RegExp(`^(${eu(r.source)})?$`):void 0}),t._zod.parse=(t,o)=>{if(void 0===t.value){if("defaulted"!==r.innerType._zod.optin)return t;let a=r.innerType._zod.run({value:t.value,issues:[]},o);return a instanceof Promise?a.then(r=>rH(t,r)):rH(t,a)}return r.innerType._zod.run(t,o)}}),rJ=eX("$ZodExactOptional",(t,r)=>{rK.init(t,r),eB(t,"values",t=>t.def.innerType._zod.values),eB(t,"pattern",t=>t.def.innerType._zod.pattern),t._zod.parse=(t,o)=>r.innerType._zod.run(t,o)}),rB=eX("$ZodNullable",(t,r)=>{tB.init(t,r),eB(t,"optin",t=>t.def.innerType._zod.optin),eB(t,"optout",t=>t.def.innerType._zod.optout),eB(t,"pattern",t=>{let r=t.def.innerType._zod.pattern;return r?RegExp(`^(${eu(r.source)}|null)$`):void 0}),eB(t,"values",t=>t.def.innerType._zod.values?new Set([...t.def.innerType._zod.values,null]):void 0),t._zod.parse=(t,o)=>null===t.value?t:r.innerType._zod.run(t,o)}),rG=eX("$ZodDefault",(t,r)=>{tB.init(t,r),t._zod.optin="defaulted",eB(t,"values",t=>t.def.innerType._zod.values),t._zod.parse=(t,o)=>{if("backward"===o.direction)return r.innerType._zod.run(t,o);if(void 0===t.value)return t.value=r.defaultValue,t;let a=r.innerType._zod.run(t,o);return a instanceof Promise?a.then(t=>rZ(t,r)):rZ(a,r)}});function rZ(t,r){return void 0===t.value&&(t.value=r.defaultValue),t}let rW=eX("$ZodPrefault",(t,r)=>{tB.init(t,r),t._zod.optin="defaulted",eB(t,"values",t=>t.def.innerType._zod.values),t._zod.parse=(t,o)=>("backward"===o.direction||void 0===t.value&&(t.value=r.defaultValue),r.innerType._zod.run(t,o))}),rX=eX("$ZodNonOptional",(t,r)=>{tB.init(t,r),eB(t,"values",t=>{let r=t.def.innerType._zod.values;return r?new Set([...r].filter(t=>void 0!==t)):void 0}),t._zod.parse=(o,a)=>{let i=r.innerType._zod.run(o,a);return i instanceof Promise?i.then(r=>rY(r,t)):rY(i,t)}});function rY(t,r){return t.issues.length||void 0!==t.value||t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:r}),t}function rQ(t,r,o,a){return r.issues.length?t.value=o.catchValue({...r,value:t.value,error:{issues:r.issues.map(t=>ez(t,a,e1()))},input:t.value}):(t.value=r.value,r.memo&&(t.memo=!0)),t}let r0=eX("$ZodCatch",(t,r)=>{tB.init(t,r),eB(t,"optin",t=>"defaulted"===t.def.innerType._zod.optin?"defaulted":"optional"),eB(t,"optout",t=>t.def.innerType._zod.optout),eB(t,"values",t=>t.def.innerType._zod.values),t._zod.parse=(t,o)=>{if("backward"===o.direction)return r.innerType._zod.run(t,o);let a=r.innerType._zod.run({value:t.value,issues:[]},o);return a instanceof Promise?a.then(a=>rQ(t,a,r,o)):rQ(t,a,r,o)}}),r1=eX("$ZodPipe",(t,r)=>{tB.init(t,r),eB(t,"values",t=>t.def.in._zod.values),eB(t,"optin",t=>t.def.in._zod.optin),eB(t,"optout",t=>t.def.out._zod.optout),eB(t,"propValues",t=>t.def.in._zod.propValues),t._zod.parse=(t,o)=>{if("backward"===o.direction){let a=r.out._zod.run(t,o);return a instanceof Promise?a.then(t=>r2(t,r.in,o)):r2(a,r.in,o)}let a=r.in._zod.run(t,o);return a instanceof Promise?a.then(t=>r2(t,r.out,o)):r2(a,r.out,o)}});function r2(t,r,o){return t.issues.some(t=>"unrecognized_keys"!==t.code)?(t.aborted=!0,t):r._zod.run({value:t.value,issues:t.issues},o)}let r9=eX("$ZodPreprocess",(t,r)=>{r1.init(t,r)}),r4=eX("$ZodReadonly",(t,r)=>{tB.init(t,r),eB(t,"propValues",t=>t.def.innerType._zod.propValues),eB(t,"values",t=>t.def.innerType._zod.values),eB(t,"optin",t=>t.def.innerType?._zod?.optin),eB(t,"optout",t=>t.def.innerType?._zod?.optout),t._zod.parse=(t,o)=>{if("backward"===o.direction)return r.innerType._zod.run(t,o);let a=r.innerType._zod.run(t,o);return a instanceof Promise?a.then(r5):r5(a)}});function r5(t){return t.memo||(t.value=Object.freeze(t.value)),t}let r3=eX("$ZodLazy",(t,r)=>{var o;let a;tB.init(t,r),o=t._zod,Object.defineProperty(o,"innerType",{get(){if(a!==ed)return void 0===a&&(a=ed,a=(()=>(r._cachedInner||(r._cachedInner=r.getter()),r._cachedInner))()),a},set(t){Object.defineProperty(o,"innerType",{value:t})},configurable:!0}),eB(t,"pattern",t=>t.innerType?._zod?.pattern),eB(t,"propValues",t=>t.innerType?._zod?.propValues),eB(t,"optin",t=>t.innerType?._zod?.optin??void 0),eB(t,"optout",t=>t.innerType?._zod?.optout??void 0),t._zod.parse=(r,o)=>t._zod.innerType._zod.run(r,o)}),r6=eX("$ZodCustom",(t,r)=>{tk.init(t,r),tB.init(t,r),t._zod.parse=(t,r)=>t,t._zod.check=o=>{let a=o.value,i=r.fn(a);if(i instanceof Promise)return i.then(r=>r8(r,o,a,t));r8(i,o,a,t)}});function r8(t,r,o,a){if(!t){let t={code:"custom",input:o,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(t.params=a._zod.def.params),r.issues.push(eV(t))}}(x=globalThis).__zod_globalRegistry??(x.__zod_globalRegistry=new class t{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&"object"==typeof o&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&"object"==typeof r&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let a={...o,...this._map.get(t)};return Object.keys(a).length?a:void 0}return this._map.get(t)}has(t){return this._map.has(t)}});let r7=globalThis.__zod_globalRegistry;function oe(t){return t.checks&&(t.checks=[...t.checks]),t}function ot(t,r){return new t({type:"string",format:"email",check:"string_format",abort:!1,...ek(r)})}function or(t,r){return new t({type:"string",format:"url",check:"string_format",abort:!1,...ek(r)})}function oo(t,r){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ek(r)})}function oa(t,r){return new t({type:"string",format:"date",check:"string_format",...ek(r)})}function oi(t,r){return new tx({check:"less_than",...ek(r),value:t,inclusive:!1})}function os(t,r){return new tx({check:"less_than",...ek(r),value:t,inclusive:!0})}function on(t,r){return new tj({check:"greater_than",...ek(r),value:t,inclusive:!1})}function ol(t,r){return new tj({check:"greater_than",...ek(r),value:t,inclusive:!0})}function oc(t,r){return new tC({check:"multiple_of",...ek(r),value:t})}function ou(t,r){return new tI({check:"max_length",...ek(r),maximum:t})}function od(t,r){return new tA({check:"min_length",...ek(r),minimum:t})}function op(t,r){return new tM({check:"length_equals",...ek(r),length:t})}function oh(t){return new tH({check:"overwrite",tx:t})}function of(t,...r){for(let o of r)for(let r of Reflect.ownKeys(o))Object.prototype.propertyIsEnumerable.call(o,r)&&ep(t,r,o[r]);return t}function om(t){let r=t?.target??"draft-2020-12";return"draft-4"===r&&(r="draft-04"),"draft-7"===r&&(r="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??r7,target:r,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:t?.cycles??"ref",reused:t?.reused??"inline",intersections:[],deferred:[],external:t?.external??void 0}}function oy(t,r,o,a,i){let s="function"==typeof r.unrepresentable?r.unrepresentable({zodSchema:t,path:a.path,message:i}):r.unrepresentable;if("any"===s)return!1;if(void 0===s||"throw"===s)throw Error(i);return Object.assign(o,s),!0}function og(t,r,o={path:[],schemaPath:[]}){var a;let i=t._zod.def,s=r.seen.get(t);if(s)return s.count++,o.schemaPath.includes(t)&&(s.cycle=o.path),s.schema;let n={schema:{},count:1,cycle:void 0,path:o.path};r.seen.set(t,n),r.sharedDefsExtractedFor=void 0,r.sharedEmitDoneFor=void 0;let l=t._zod.toJSONSchema?.();if(l)n.schema=l;else{let a={...o,schemaPath:[...o.schemaPath,t],path:o.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(r,n.schema,a);else{let o=n.schema,s=r.processors[i.type];if(!s)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);s(t,r,o,a)}let s=t._zod.parent;s&&(n.ref||(n.ref=s),og(s,r,a),r.seen.get(s).isParent=!0)}let c=r.metadataRegistry.get(t);return c&&of(n.schema,c),"input"===r.io&&function t(r,o){let a=o??{seen:new Set};if(a.seen.has(r))return!1;a.seen.add(r);let i=r._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return t(i.element,a);if("set"===i.type)return t(i.valueType,a);if("lazy"===i.type)return t(i.getter(),a);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type||"catch"===i.type)return t(i.innerType,a);if("intersection"===i.type)return t(i.left,a)||t(i.right,a);if("record"===i.type||"map"===i.type)return t(i.keyType,a)||t(i.valueType,a);if("pipe"===i.type)return!!r._zod.traits.has("$ZodCodec")||t(i.in,a)||t(i.out,a);if("object"===i.type){for(let r in i.shape)if(t(i.shape[r],a))return!0;return!1}if("union"===i.type){for(let r of i.options)if(t(r,a))return!0;return!1}if("tuple"===i.type){for(let r of i.items)if(t(r,a))return!0;if(i.rest&&t(i.rest,a))return!0}return!1}(t)&&(delete n.schema.examples,delete n.schema.default),"input"===r.io&&"_prefault"in n.schema&&((a=n.schema).default??(a.default=n.schema._prefault)),delete n.schema._prefault,r.seen.get(t).schema}function ov(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function ob(t,r){let o=t.seen.get(r);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;let a=new Map;for(let r of t.seen.entries()){let o=t.metadataRegistry.get(r[0])?.id;if(o){let t=a.get(o);if(t&&t!==r[0])throw Error(`Duplicate schema id "${o}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(o,r[0])}}let i=r=>{if(r[1].schema.$ref)return;let a=r[1],{ref:i,defId:s}=(r=>{let a="draft-2020-12"===t.target?"$defs":"definitions";if(t.external){let o=t.external.registry.get(r[0])?.id,i=t.external.uri??(t=>t);if(o)return{ref:i(o)};let s=r[1].defId??r[1].schema.id??`schema${t.counter++}`;return r[1].defId=s,{defId:s,ref:`${i("__shared")}#/${a}/${ov(s)}`}}let i=`#/${a}/`;if(r[1]===o&&!r[1].schema.id)return{ref:"#"};let s=r[1].schema.id??`__schema${t.counter++}`;return{defId:s,ref:i+ov(s)}})(r);a.def={...a.schema},s&&(a.defId=s);let n=a.schema;for(let t in n)delete n[t];n.$ref=i};if("throw"===t.cycles)for(let r of t.seen.entries()){let t=r[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join("/")}/<root>
|
|
61
54
|
|
|
62
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let o=r[1];if(t===r[0]){a(r);continue}if(e.external){let o=e.external.registry.get(r[0])?.id;if(t!==r[0]&&o){a(r);continue}}if(e.metadataRegistry.get(r[0])?.id||o.cycle||o.count>1&&"ref"===e.reused){a(r);continue}}}function rD(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=t=>{let r=e.seen.get(t);if(null===r.ref)return;let a=r.def??r.schema,i={...a},s=r.ref;if(r.ref=null,s){o(s);let r=e.seen.get(s),n=r.schema;if(n.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(a.allOf=a.allOf??[],a.allOf.push(n)):Object.assign(a,n),Object.assign(a,i),t._zod.parent===s)for(let e in a)"$ref"!==e&&"allOf"!==e&&(e in i||delete a[e]);if(n.$ref&&r.def)for(let e in a)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(a[e])===JSON.stringify(r.def[e])&&delete a[e]}let n=t._zod.parent;if(n&&n!==s){o(n);let t=e.seen.get(n);if(t?.schema.$ref&&(a.$ref=t.schema.$ref,t.def))for(let e in a)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(a[e])===JSON.stringify(t.def[e])&&delete a[e]}e.override({zodSchema:t,jsonSchema:a,path:r.path??[]})};for(let t of[...e.seen.entries()].reverse())o(t[0]);let a={};if("draft-2020-12"===e.target?a.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?a.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");a.$id=e.external.uri(r)}Object.assign(a,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;void 0!==i&&a.id===i&&delete a.id;let s=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?a.$defs=s:a.definitions=s);try{let r=JSON.parse(JSON.stringify(a));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:rU(t,"input",e.processors),output:rU(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let rU=(e,t,r={})=>o=>{let{libraryOptions:a,target:i}=o??{},s=rq({...a??{},target:i,io:t,processors:r});return rz(e,s),rL(s,e),rD(s,e)},rV={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},rF=(e,t,r,o)=>{r.type="string";let{minimum:a,maximum:i,format:s,patterns:n,contentEncoding:l}=e._zod.bag;if("number"==typeof a&&(r.minLength=a),"number"==typeof i&&(r.maxLength=i),s&&(r.format=rV[s]??s,""===r.format&&delete r.format,"time"===s&&delete r.format),l&&(r.contentEncoding=l),n&&n.size>0){let e=[...n];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}},rH=(e,t,r,o)=>{let{minimum:a,maximum:i,format:s,multipleOf:n,exclusiveMaximum:l,exclusiveMinimum:c}=e._zod.bag;"string"==typeof s&&s.includes("int")?r.type="integer":r.type="number";let u="number"==typeof c&&c>=(a??-1/0),d="number"==typeof l&&l<=(i??1/0),p="draft-04"===t.target||"openapi-3.0"===t.target;u?p?(r.minimum=c,r.exclusiveMinimum=!0):r.exclusiveMinimum=c:"number"==typeof a&&(r.minimum=a),d?p?(r.maximum=l,r.exclusiveMaximum=!0):r.exclusiveMaximum=l:"number"==typeof i&&(r.maximum=i),"number"==typeof n&&(r.multipleOf=n)},rK=(e,t,r,o)=>{r.type="boolean"},rJ=(e,t,r,o)=>{"openapi-3.0"===t.target?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},rB=(e,t,r,o)=>{r.not={}},rG=(e,t,r,o)=>{},rZ=(e,t,r,o)=>{},rW=(e,t,r,o)=>{let a=ej(e._zod.def.entries);a.every(e=>"number"==typeof e)&&(r.type="number"),a.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=a},rX=(e,t,r,o)=>{let a=e._zod.def,i=[];for(let e of a.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e)if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else i.push(Number(e));else i.push(e);if(0===i.length);else if(1===i.length){let e=i[0];r.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?r.enum=[e]:r.const=e}else i.every(e=>"number"==typeof e)&&(r.type="number"),i.every(e=>"string"==typeof e)&&(r.type="string"),i.every(e=>"boolean"==typeof e)&&(r.type="boolean"),i.every(e=>null===e)&&(r.type="null"),r.enum=i},rY=(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")},rQ=(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")},r0=(e,t,r,o)=>{let a=e._zod.def,{minimum:i,maximum:s}=e._zod.bag;"number"==typeof i&&(r.minItems=i),"number"==typeof s&&(r.maxItems=s),r.type="array",r.items=rz(a.element,t,{...o,path:[...o.path,"items"]})},r1=(e,t,r,o)=>{let a=e._zod.def;r.type="object",r.properties={};let i=a.shape;for(let e in i)r.properties[e]=rz(i[e],t,{...o,path:[...o.path,"properties",e]});let s=new Set([...new Set(Object.keys(i))].filter(e=>{let r=a.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));s.size>0&&(r.required=Array.from(s)),a.catchall?._zod.def.type==="never"?r.additionalProperties=!1:a.catchall?a.catchall&&(r.additionalProperties=rz(a.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)},r2=(e,t,r,o)=>{let a=e._zod.def,i=!1===a.inclusive,s=a.options.map((e,r)=>rz(e,t,{...o,path:[...o.path,i?"oneOf":"anyOf",r]}));i?r.oneOf=s:r.anyOf=s},r9=(e,t,r,o)=>{let a=e._zod.def,i=rz(a.left,t,{...o,path:[...o.path,"allOf",0]}),s=rz(a.right,t,{...o,path:[...o.path,"allOf",1]}),n=e=>"allOf"in e&&1===Object.keys(e).length;r.allOf=[...n(i)?i.allOf:[i],...n(s)?s.allOf:[s]]},r4=(e,t,r,o)=>{let a=e._zod.def;r.type="object";let i=a.keyType,s=i._zod.bag,n=s?.patterns;if("loose"===a.mode&&n&&n.size>0){let e=rz(a.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});for(let t of(r.patternProperties={},n))r.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(r.propertyNames=rz(a.keyType,t,{...o,path:[...o.path,"propertyNames"]})),r.additionalProperties=rz(a.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let l=i._zod.values;if(l){let e=[...l].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(r.required=e)}},r5=(e,t,r,o)=>{let a=e._zod.def,i=rz(a.innerType,t,o),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=a.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},r3=(e,t,r,o)=>{let a=e._zod.def;rz(a.innerType,t,o),t.seen.get(e).ref=a.innerType},r6=(e,t,r,o)=>{let a=e._zod.def;rz(a.innerType,t,o),t.seen.get(e).ref=a.innerType,r.default=JSON.parse(JSON.stringify(a.defaultValue))},r8=(e,t,r,o)=>{let a=e._zod.def;rz(a.innerType,t,o),t.seen.get(e).ref=a.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(a.defaultValue)))},r7=(e,t,r,o)=>{let a,i=e._zod.def;rz(i.innerType,t,o),t.seen.get(e).ref=i.innerType;try{a=i.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},oe=(e,t,r,o)=>{let a=e._zod.def,i=a.in._zod.traits.has("$ZodTransform"),s="input"===t.io?i?a.out:a.in:a.out;rz(s,t,o),t.seen.get(e).ref=s},ot=(e,t,r,o)=>{let a=e._zod.def;rz(a.innerType,t,o),t.seen.get(e).ref=a.innerType,r.readOnly=!0},or=(e,t,r,o)=>{let a=e._zod.def;rz(a.innerType,t,o),t.seen.get(e).ref=a.innerType},oo=(e,t,r,o)=>{let a=e._zod.innerType;rz(a,t,o),t.seen.get(e).ref=a},oa={string:rF,number:rH,boolean:rK,bigint:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema")},symbol:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema")},null:rJ,undefined:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema")},void:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Void cannot be represented in JSON Schema")},never:rB,any:rG,unknown:rZ,date:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Date cannot be represented in JSON Schema")},enum:rW,literal:rX,nan:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("NaN cannot be represented in JSON Schema")},template_literal:(e,t,r,o)=>{let a=e._zod.pattern;if(!a)throw Error("Pattern not found in template literal");r.type="string",r.pattern=a.source},file:(e,t,r,o)=>{let a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:s,mime:n}=e._zod.bag;void 0!==i&&(a.minLength=i),void 0!==s&&(a.maxLength=s),n?1===n.length?(a.contentMediaType=n[0],Object.assign(r,a)):(Object.assign(r,a),r.anyOf=n.map(e=>({contentMediaType:e}))):Object.assign(r,a)},success:(e,t,r,o)=>{r.type="boolean"},custom:rY,function:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Function types cannot be represented in JSON Schema")},transform:rQ,map:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Map cannot be represented in JSON Schema")},set:(e,t,r,o)=>{if("throw"===t.unrepresentable)throw Error("Set cannot be represented in JSON Schema")},array:r0,object:r1,union:r2,intersection:r9,tuple:(e,t,r,o)=>{let a=e._zod.def;r.type="array";let i="draft-2020-12"===t.target?"prefixItems":"items",s="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",n=a.items.map((e,r)=>rz(e,t,{...o,path:[...o.path,i,r]})),l=a.rest?rz(a.rest,t,{...o,path:[...o.path,s,..."openapi-3.0"===t.target?[a.items.length]:[]]}):null;"draft-2020-12"===t.target?(r.prefixItems=n,l&&(r.items=l)):"openapi-3.0"===t.target?(r.items={anyOf:n},l&&r.items.anyOf.push(l),r.minItems=n.length,l||(r.maxItems=n.length)):(r.items=n,l&&(r.additionalItems=l));let{minimum:c,maximum:u}=e._zod.bag;"number"==typeof c&&(r.minItems=c),"number"==typeof u&&(r.maxItems=u)},record:r4,nullable:r5,nonoptional:r3,default:r6,prefault:r8,catch:r7,pipe:oe,readonly:ot,promise:(e,t,r,o)=>{let a=e._zod.def;rz(a.innerType,t,o),t.seen.get(e).ref=a.innerType},optional:or,lazy:oo};function oi(e,t){if("_idmap"in e){let r=rq({...t,processors:oa}),o={};for(let t of e._idmap.entries()){let[e,o]=t;rz(o,r)}let a={};for(let i of(r.external={registry:e,uri:t?.uri,defs:o},e._idmap.entries())){let[e,t]=i;rL(r,t),a[e]=rD(r,t)}return Object.keys(o).length>0&&(a.__shared={["draft-2020-12"===r.target?"$defs":"definitions"]:o}),{schemas:a}}let r=rq({...t,processors:oa});return rz(e,r),rL(r,e),rD(r,e)}let os=Q("ZodISODateTime",(e,t)=>{tI.init(e,t),oj.init(e,t)});function on(e){return new os({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...eG(e)})}let ol=Q("ZodISODate",(e,t)=>{tA.init(e,t),oj.init(e,t)});function oc(e){return new ol({type:"string",format:"date",check:"string_format",...eG(e)})}let ou=Q("ZodISOTime",(e,t)=>{tM.init(e,t),oj.init(e,t)}),od=Q("ZodISODuration",(e,t)=>{tq.init(e,t),oj.init(e,t)}),op=Q("ZodError",(e,t)=>{td.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let r={_errors:[]},o=(e,a=[])=>{for(let i of e.issues)if("invalid_union"===i.code&&i.errors.length)i.errors.map(e=>o({issues:e},[...a,...i.path]));else if("invalid_key"===i.code)o({issues:i.issues},[...a,...i.path]);else if("invalid_element"===i.code)o({issues:i.issues},[...a,...i.path]);else{let e=[...a,...i.path];if(0===e.length)r._errors.push(t(i));else{let o=r,a=0;for(;a<e.length;){let r=e[a];a===e.length-1?(o[r]=o[r]||{_errors:[]},o[r]._errors.push(t(i))):o[r]=o[r]||{_errors:[]},o=o[r],a++}}}};return o(e),r})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let r={},o=[];for(let a of e.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):o.push(t(a));return{formErrors:o,fieldErrors:r}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,eC,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,eC,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),oh=th(op),of=tf(op),om=tm(op),oy=tg(op),og=(e,t,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return th(op)(e,t,o)},ov=(e,t,r)=>th(op)(e,t,r),ob=async(e,t,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return tf(op)(e,t,o)},o_=async(e,t,r)=>tf(op)(e,t,r),oS=(e,t,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return tm(op)(e,t,o)},o$=(e,t,r)=>tm(op)(e,t,r),ow=async(e,t,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return tg(op)(e,t,o)},oE=async(e,t,r)=>tg(op)(e,t,r),oR=new WeakMap;function oP(e,t,r){let o=Object.getPrototypeOf(e),a=oR.get(o);if(a||(a=new Set,oR.set(o,a)),!a.has(t))for(let e in a.add(t),r){let t=r[e];Object.defineProperty(o,e,{configurable:!0,enumerable:!1,get(){let r=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:r}),r},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let ok=Q("ZodType",(e,t)=>(t_.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:rU(e,"input"),output:rU(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{let o=rq({...r,processors:t});return rz(e,o),rL(o,e),rD(o,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,r)=>oh(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>om(e,t,r),e.parseAsync=async(t,r)=>of(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>oy(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>og(e,t,r),e.decode=(t,r)=>ov(e,t,r),e.encodeAsync=async(t,r)=>ob(e,t,r),e.decodeAsync=async(t,r)=>o_(e,t,r),e.safeEncode=(t,r)=>oS(e,t,r),e.safeDecode=(t,r)=>o$(e,t,r),e.safeEncodeAsync=async(t,r)=>ow(e,t,r),e.safeDecodeAsync=async(t,r)=>oE(e,t,r),oP(e,"ZodType",{check(...e){let t=this.def;return this.clone(ez(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return eB(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new aN({type:"custom",check:"custom",fn:e,...eG(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var r;let o,a;return r=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(e1(e,t.value,o._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=o),e.continue??(e.continue=!o._zod.def.abort),t.issues.push(e1(e)))},e(t.value,t)),(a=new e2({check:"custom",...eG(t)}))._zod.check=r,o=a}(e,t))},overwrite(e){return this.check(rM(e))},optional(){return ab(this)},exactOptional(){var e;return e=this,new a_({type:"optional",innerType:e})},nullable(){return a$(this)},nullish(){return ab(a$(this))},nonoptional(e){var t;return t=this,new aR({type:"nonoptional",innerType:t,...eG(e)})},array(){return ae(this)},or(e){return ai([this,e])},and(e){return ac(this,e)},transform(e){return aT(this,ag(e))},default(e){var t,r;return t=this,r=e,new aw({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():eH(r)}})},prefault(e){var t,r;return t=this,r=e,new aE({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():eH(r)}})},catch(e){var t,r;return t=this,new aP({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:()=>r})},pipe(e){return aT(this,e)},readonly(){var e;return e=this,new ax({type:"readonly",innerType:e})},describe(e){let t=this.clone();return rE.add(t,{description:e}),t},meta(...e){if(0===e.length)return rE.get(this);let t=this.clone();return rE.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>rE.get(e)?.description,configurable:!0}),e)),oT=Q("_ZodString",(e,t)=>{tS.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rF(e,t,r,o);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,oP(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new tr({check:"string_format",format:"regex",...eG(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new ti({check:"string_format",format:"includes",...eG(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new ts({check:"string_format",format:"starts_with",...eG(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new tn({check:"string_format",format:"ends_with",...eG(t),suffix:e})}(...e))},min(...e){return this.check(rI(...e))},max(...e){return this.check(rN(...e))},length(...e){return this.check(rA(...e))},nonempty(...e){return this.check(rI(1,...e))},lowercase(e){return this.check(new to({check:"string_format",format:"lowercase",...eG(e)}))},uppercase(e){return this.check(new ta({check:"string_format",format:"uppercase",...eG(e)}))},trim(){return this.check(rM(e=>e.trim()))},normalize(...e){return this.check(function(e){return rM(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(rM(e=>e.toLowerCase()))},toUpperCase(){return this.check(rM(e=>e.toUpperCase()))},slugify(){return this.check(rM(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}})}),oO=Q("ZodString",(e,t)=>{tS.init(e,t),oT.init(e,t),e.email=t=>e.check(rR(oC,t)),e.url=t=>e.check(rk(oA,t)),e.jwt=t=>e.check(new oW({type:"string",format:"jwt",check:"string_format",abort:!1,...eG(t)})),e.emoji=t=>e.check(new oM({type:"string",format:"emoji",check:"string_format",abort:!1,...eG(t)})),e.guid=t=>e.check(rP(oN,t)),e.uuid=t=>e.check(new oI({type:"string",format:"uuid",check:"string_format",abort:!1,...eG(t)})),e.uuidv4=t=>e.check(new oI({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...eG(t)})),e.uuidv6=t=>e.check(new oI({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...eG(t)})),e.uuidv7=t=>e.check(new oI({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...eG(t)})),e.nanoid=t=>e.check(new oq({type:"string",format:"nanoid",check:"string_format",abort:!1,...eG(t)})),e.guid=t=>e.check(rP(oN,t)),e.cuid=t=>e.check(new oz({type:"string",format:"cuid",check:"string_format",abort:!1,...eG(t)})),e.cuid2=t=>e.check(new oL({type:"string",format:"cuid2",check:"string_format",abort:!1,...eG(t)})),e.ulid=t=>e.check(new oD({type:"string",format:"ulid",check:"string_format",abort:!1,...eG(t)})),e.base64=t=>e.check(new oB({type:"string",format:"base64",check:"string_format",abort:!1,...eG(t)})),e.base64url=t=>e.check(new oG({type:"string",format:"base64url",check:"string_format",abort:!1,...eG(t)})),e.xid=t=>e.check(new oU({type:"string",format:"xid",check:"string_format",abort:!1,...eG(t)})),e.ksuid=t=>e.check(new oV({type:"string",format:"ksuid",check:"string_format",abort:!1,...eG(t)})),e.ipv4=t=>e.check(new oF({type:"string",format:"ipv4",check:"string_format",abort:!1,...eG(t)})),e.ipv6=t=>e.check(new oH({type:"string",format:"ipv6",check:"string_format",abort:!1,...eG(t)})),e.cidrv4=t=>e.check(new oK({type:"string",format:"cidrv4",check:"string_format",abort:!1,...eG(t)})),e.cidrv6=t=>e.check(new oJ({type:"string",format:"cidrv6",check:"string_format",abort:!1,...eG(t)})),e.e164=t=>e.check(new oZ({type:"string",format:"e164",check:"string_format",abort:!1,...eG(t)})),e.datetime=t=>e.check(on(t)),e.date=t=>e.check(oc(t)),e.time=t=>e.check(new ou({type:"string",format:"time",check:"string_format",precision:null,...eG(t)})),e.duration=t=>e.check(new od({type:"string",format:"duration",check:"string_format",...eG(t)}))});function ox(e){return new oO({type:"string",...eG(e)})}let oj=Q("ZodStringFormat",(e,t)=>{t$.init(e,t),oT.init(e,t)}),oC=Q("ZodEmail",(e,t)=>{tR.init(e,t),oj.init(e,t)}),oN=Q("ZodGUID",(e,t)=>{tw.init(e,t),oj.init(e,t)}),oI=Q("ZodUUID",(e,t)=>{tE.init(e,t),oj.init(e,t)}),oA=Q("ZodURL",(e,t)=>{tP.init(e,t),oj.init(e,t)}),oM=Q("ZodEmoji",(e,t)=>{tk.init(e,t),oj.init(e,t)}),oq=Q("ZodNanoID",(e,t)=>{tT.init(e,t),oj.init(e,t)}),oz=Q("ZodCUID",(e,t)=>{tO.init(e,t),oj.init(e,t)}),oL=Q("ZodCUID2",(e,t)=>{tx.init(e,t),oj.init(e,t)}),oD=Q("ZodULID",(e,t)=>{tj.init(e,t),oj.init(e,t)}),oU=Q("ZodXID",(e,t)=>{tC.init(e,t),oj.init(e,t)}),oV=Q("ZodKSUID",(e,t)=>{tN.init(e,t),oj.init(e,t)}),oF=Q("ZodIPv4",(e,t)=>{tz.init(e,t),oj.init(e,t)}),oH=Q("ZodIPv6",(e,t)=>{tL.init(e,t),oj.init(e,t)}),oK=Q("ZodCIDRv4",(e,t)=>{tD.init(e,t),oj.init(e,t)}),oJ=Q("ZodCIDRv6",(e,t)=>{tU.init(e,t),oj.init(e,t)}),oB=Q("ZodBase64",(e,t)=>{tF.init(e,t),oj.init(e,t)}),oG=Q("ZodBase64URL",(e,t)=>{tH.init(e,t),oj.init(e,t)}),oZ=Q("ZodE164",(e,t)=>{tK.init(e,t),oj.init(e,t)}),oW=Q("ZodJWT",(e,t)=>{tJ.init(e,t),oj.init(e,t)}),oX=Q("ZodNumber",(e,t)=>{tB.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rH(e,t,r,o),oP(e,"ZodNumber",{gt(e,t){return this.check(rx(e,t))},gte(e,t){return this.check(rj(e,t))},min(e,t){return this.check(rj(e,t))},lt(e,t){return this.check(rT(e,t))},lte(e,t){return this.check(rO(e,t))},max(e,t){return this.check(rO(e,t))},int(e){return this.check(o0(e))},safe(e){return this.check(o0(e))},positive(e){return this.check(rx(0,e))},nonnegative(e){return this.check(rj(0,e))},negative(e){return this.check(rT(0,e))},nonpositive(e){return this.check(rO(0,e))},multipleOf(e,t){return this.check(rC(e,t))},step(e,t){return this.check(rC(e,t))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??-1/0,r.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(r.maximum??1/0,r.exclusiveMaximum??1/0)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function oY(e){return new oX({type:"number",checks:[],...eG(e)})}let oQ=Q("ZodNumberFormat",(e,t)=>{tG.init(e,t),oX.init(e,t)});function o0(e){return new oQ({type:"number",check:"number_format",abort:!1,format:"safeint",...eG(e)})}let o1=Q("ZodBoolean",(e,t)=>{tZ.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rK(e,t,r,o)});function o2(e){return new o1({type:"boolean",...eG(e)})}let o9=Q("ZodNull",(e,t)=>{tW.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rJ(e,t,r,o)});function o4(e){return new o9({type:"null",...eG(e)})}let o5=Q("ZodAny",(e,t)=>{tX.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rG(e,t,r,o)}),o3=Q("ZodUnknown",(e,t)=>{tY.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rZ(e,t,r,o)});function o6(){return new o3({type:"unknown"})}let o8=Q("ZodNever",(e,t)=>{tQ.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rB(e,t,r,o)}),o7=Q("ZodArray",(e,t)=>{t1.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r0(e,t,r,o),e.element=t.element,oP(e,"ZodArray",{min(e,t){return this.check(rI(e,t))},nonempty(e){return this.check(rI(1,e))},max(e,t){return this.check(rN(e,t))},length(e,t){return this.check(rA(e,t))},unwrap(){return this.element}})});function ae(e,t){return new o7({type:"array",element:e,...eG(t)})}let at=Q("ZodObject",(e,t)=>{t3.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r1(e,t,r,o),eM(e,"shape",()=>t.shape),oP(e,"ZodObject",{keyof(){return ah(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:o6()})},loose(){return this.clone({...this._zod.def,catchall:o6()})},strict(){return this.clone({...this._zod.def,catchall:new o8({type:"never",...eG(void 0)})})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!eF(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=ez(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return eq(this,"shape",r),r}});return eB(e,o)}(this,e)},safeExtend(e){var t=this;if(!eF(e))throw Error("Invalid input to safeExtend: expected a plain object");let r=ez(t._zod.def,{get shape(){let r={...t._zod.def.shape,...e};return eq(this,"shape",r),r}});return eB(t,r)},merge(e){var t=this;if(t._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=ez(t._zod.def,{get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return eq(this,"shape",r),r},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return eB(t,r)},pick(e){return function(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let a=ez(e._zod.def,{get shape(){let e={};for(let o in t){if(!(o in r.shape))throw Error(`Unrecognized key: "${o}"`);t[o]&&(e[o]=r.shape[o])}return eq(this,"shape",e),e},checks:[]});return eB(e,a)}(this,e)},omit(e){return function(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let a=ez(e._zod.def,{get shape(){let o={...e._zod.def.shape};for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete o[e]}return eq(this,"shape",o),o},checks:[]});return eB(e,a)}(this,e)},partial(...e){return function(e,t,r){let o=t._zod.def.checks;if(o&&o.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let a=ez(t._zod.def,{get shape(){let o=t._zod.def.shape,a={...o};if(r)for(let t in r){if(!(t in o))throw Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=e?new e({type:"optional",innerType:o[t]}):o[t])}else for(let t in o)a[t]=e?new e({type:"optional",innerType:o[t]}):o[t];return eq(this,"shape",a),a},checks:[]});return eB(t,a)}(av,this,e[0])},required(...e){var t,r;let o;return t=this,r=e[0],o=ez(t._zod.def,{get shape(){let e=t._zod.def.shape,o={...e};if(r)for(let t in r){if(!(t in o))throw Error(`Unrecognized key: "${t}"`);r[t]&&(o[t]=new aR({type:"nonoptional",innerType:e[t]}))}else for(let t in e)o[t]=new aR({type:"nonoptional",innerType:e[t]});return eq(this,"shape",o),o}}),eB(t,o)}})});function ar(e,t){return new at({type:"object",shape:e??{},...eG(t)})}function ao(e,t){return new at({type:"object",shape:e,catchall:o6(),...eG(t)})}let aa=Q("ZodUnion",(e,t)=>{t8.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r2(e,t,r,o),e.options=t.options});function ai(e,t){return new aa({type:"union",options:e,...eG(t)})}let as=Q("ZodDiscriminatedUnion",(e,t)=>{aa.init(e,t),t7.init(e,t)});function an(e,t,r){return new as({type:"union",options:t,discriminator:e,...eG(r)})}let al=Q("ZodIntersection",(e,t)=>{re.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r9(e,t,r,o)});function ac(e,t){return new al({type:"intersection",left:e,right:t})}let au=Q("ZodRecord",(e,t)=>{rr.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r4(e,t,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function ad(e,t,r){return new au(t&&t._zod?{type:"record",keyType:e,valueType:t,...eG(r)}:{type:"record",keyType:ox(),valueType:e,...eG(t)})}let ap=Q("ZodEnum",(e,t)=>{ro.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rW(e,t,r,o),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,o)=>{let a={};for(let o of e)if(r.has(o))a[o]=t.entries[o];else throw Error(`Key ${o} not found in enum`);return new ap({...t,checks:[],...eG(o),entries:a})},e.exclude=(e,o)=>{let a={...t.entries};for(let t of e)if(r.has(t))delete a[t];else throw Error(`Key ${t} not found in enum`);return new ap({...t,checks:[],...eG(o),entries:a})}});function ah(e,t){return new ap({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...eG(t)})}let af=Q("ZodLiteral",(e,t)=>{ra.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rX(e,t,r,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function am(e,t){return new af({type:"literal",values:Array.isArray(e)?e:[e],...eG(t)})}let ay=Q("ZodTransform",(e,t)=>{ri.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rQ(e,t,r,o),e._zod.parse=(r,o)=>{if("backward"===o.direction)throw new et(e.constructor.name);r.addIssue=o=>{"string"==typeof o?r.issues.push(e1(o,r.value,t)):(o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),r.issues.push(e1(o)))};let a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r.fallback=!0,r)):(r.value=a,r.fallback=!0,r)}});function ag(e){return new ay({type:"transform",transform:e})}let av=Q("ZodOptional",(e,t)=>{rn.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>or(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function ab(e){return new av({type:"optional",innerType:e})}let a_=Q("ZodExactOptional",(e,t)=>{rl.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>or(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),aS=Q("ZodNullable",(e,t)=>{rc.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r5(e,t,r,o),e.unwrap=()=>e._zod.def.innerType});function a$(e){return new aS({type:"nullable",innerType:e})}let aw=Q("ZodDefault",(e,t)=>{ru.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r6(e,t,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),aE=Q("ZodPrefault",(e,t)=>{rp.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r8(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),aR=Q("ZodNonOptional",(e,t)=>{rh.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r3(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),aP=Q("ZodCatch",(e,t)=>{rm.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>r7(e,t,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),ak=Q("ZodPipe",(e,t)=>{ry.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oe(e,t,r,o),e.in=t.in,e.out=t.out});function aT(e,t){return new ak({type:"pipe",in:e,out:t})}let aO=Q("ZodPreprocess",(e,t)=>{ak.init(e,t),rv.init(e,t)}),ax=Q("ZodReadonly",(e,t)=>{rb.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>ot(e,t,r,o),e.unwrap=()=>e._zod.def.innerType}),aj=Q("ZodLazy",(e,t)=>{rS.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>oo(e,t,r,o),e.unwrap=()=>e._zod.def.getter()});function aC(e){return new aj({type:"lazy",getter:e})}let aN=Q("ZodCustom",(e,t)=>{r$.init(e,t),ok.init(e,t),e._zod.processJSONSchema=(t,r,o)=>rY(e,t,r,o)});function aI(e,t){return new aO({type:"pipe",in:ag(e),out:t})}_||(_={});let aA="2025-11-25",aM=[aA,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],aq="io.modelcontextprotocol/protocolVersion",az="io.modelcontextprotocol/clientInfo",aL="io.modelcontextprotocol/serverInfo",aD="io.modelcontextprotocol/clientCapabilities",aU="io.modelcontextprotocol/subscriptionId",aV="io.modelcontextprotocol/logLevel",aF=aC(()=>ai([ox(),oY(),o2(),o4(),ad(ox(),aF),ae(aF)])),aH=ad(ox(),aF),aK=ae(aF),aJ=ai([ox(),oY().int()]),aB=ox(),aG=ar({ttl:oY().optional()}),aZ=ar({taskId:ox()}),aW=ao({progressToken:aJ.optional(),"io.modelcontextprotocol/related-task":aZ.optional()}),aX=ar({_meta:aW.optional()}),aY=aX.extend({task:aG.optional()}),aQ=ar({method:ox(),params:aX.loose().optional()}),a0=ar({_meta:aW.optional()}),a1=ar({method:ox(),params:a0.loose().optional()}),a2=ao({get[aL](){return il.optional().catch(void 0)}}),a9=ao({_meta:a2.optional()}),a4=ai([ox(),oY().int()]),a5=ar({jsonrpc:am("2.0"),id:a4,...aQ.shape}).strict(),a3=ar({jsonrpc:am("2.0"),...a1.shape}).strict(),a6=ar({jsonrpc:am("2.0"),id:a4,result:a9}).strict(),a8=ar({jsonrpc:am("2.0"),id:a4.optional(),error:ar({code:oY().int(),message:ox(),data:o6().optional()})}).strict(),a7=ai([a5,a3,a6,a8]),ie=ai([a6,a8]),it=a9.strict(),ir=a0.extend({requestId:a4.optional(),reason:ox().optional()}),io=a1.extend({method:am("notifications/cancelled"),params:ir}),ia=ar({src:ox(),mimeType:ox().optional(),sizes:ae(ox()).optional(),theme:ah(["light","dark"]).optional()}),ii=ar({icons:ae(ia).optional()}),is=ar({name:ox(),title:ox().optional()}),il=is.extend({...is.shape,...ii.shape,version:ox(),websiteUrl:ox().optional(),description:ox().optional()}),ic=ac(ar({applyDefaults:o2().optional()}),aH),iu=aI(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,ac(ar({form:ic.optional(),url:aH.optional()}),aH.optional())),id=ao({list:aH.optional(),cancel:aH.optional(),requests:ao({sampling:ao({createMessage:aH.optional()}).optional(),elicitation:ao({create:aH.optional()}).optional()}).optional()}),ip=ao({list:aH.optional(),cancel:aH.optional(),requests:ao({tools:ao({call:aH.optional()}).optional()}).optional()}),ih=ar({experimental:ad(ox(),aH).optional(),sampling:ar({context:aH.optional(),tools:aH.optional()}).optional(),elicitation:iu.optional(),roots:ar({listChanged:o2().optional()}).optional(),tasks:id.optional(),extensions:ad(ox(),aH).optional()}),im=aX.extend({protocolVersion:ox(),capabilities:ih,clientInfo:il}),iy=aQ.extend({method:am("initialize"),params:im}),ig=ar({experimental:ad(ox(),aH).optional(),logging:aH.optional(),completions:aH.optional(),prompts:ar({listChanged:o2().optional()}).optional(),resources:ar({subscribe:o2().optional(),listChanged:o2().optional()}).optional(),tools:ar({listChanged:o2().optional()}).optional(),tasks:ip.optional(),extensions:ad(ox(),aH).optional()}),iv=a9.extend({protocolVersion:ox(),capabilities:ig,serverInfo:il,instructions:ox().optional()}),ib=a1.extend({method:am("notifications/initialized"),params:a0.optional()}),i_=aQ.extend({method:am("server/discover"),params:aX.optional()}),iS=a9.extend({supportedVersions:ae(ox()),capabilities:ig,instructions:ox().optional()}),i$=aQ.extend({method:am("ping"),params:aX.optional()}),iw=ar({progress:oY(),total:ab(oY()),message:ab(ox())}),iE=ar({...a0.shape,...iw.shape,progressToken:aJ}),iR=a1.extend({method:am("notifications/progress"),params:iE}),iP=aX.extend({cursor:aB.optional()}),ik=aQ.extend({params:iP.optional()}),iT=a9.extend({nextCursor:aB.optional()}),iO=ar({uri:ox(),mimeType:ab(ox()),_meta:ad(ox(),o6()).optional()}),ix=iO.extend({text:ox()}),ij=ox().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),iC=iO.extend({blob:ij}),iN=ah(["user","assistant"]),iI=ar({audience:ae(iN).optional(),priority:oY().min(0).max(1).optional(),lastModified:on({offset:!0}).optional()}),iA=ar({...is.shape,...ii.shape,uri:ox(),description:ab(ox()),mimeType:ab(ox()),size:ab(oY()),annotations:iI.optional(),_meta:ab(ao({}))}),iM=ar({...is.shape,...ii.shape,uriTemplate:ox(),description:ab(ox()),mimeType:ab(ox()),annotations:iI.optional(),_meta:ab(ao({}))}),iq=ik.extend({method:am("resources/list")}),iz=iT.extend({resources:ae(iA)}),iL=ik.extend({method:am("resources/templates/list")}),iD=iT.extend({resourceTemplates:ae(iM)}),iU=aX.extend({uri:ox()}),iV=aQ.extend({method:am("resources/read"),params:iU}),iF=a9.extend({contents:ae(ai([ix,iC]))}),iH=a1.extend({method:am("notifications/resources/list_changed"),params:a0.optional()}),iK=aQ.extend({method:am("resources/subscribe"),params:iU}),iJ=aQ.extend({method:am("resources/unsubscribe"),params:iU}),iB=ar({toolsListChanged:o2().optional(),promptsListChanged:o2().optional(),resourcesListChanged:o2().optional(),resourceSubscriptions:ae(ox()).optional()}),iG=aX.extend({notifications:iB}),iZ=aQ.extend({method:am("subscriptions/listen"),params:iG}),iW=a0.extend({notifications:iB}),iX=a1.extend({method:am("notifications/subscriptions/acknowledged"),params:iW}),iY=a2.extend({[aU]:a4}),iQ=a9.extend({_meta:iY}),i0=a0.extend({uri:ox()}),i1=a1.extend({method:am("notifications/resources/updated"),params:i0}),i2=ar({name:ox(),description:ab(ox()),required:ab(o2())}),i9=ar({...is.shape,...ii.shape,description:ab(ox()),arguments:ab(ae(i2)),_meta:ab(ao({}))}),i4=ik.extend({method:am("prompts/list")}),i5=iT.extend({prompts:ae(i9)}),i3=aX.extend({name:ox(),arguments:ad(ox(),ox()).optional()}),i6=aQ.extend({method:am("prompts/get"),params:i3}),i8=ar({type:am("text"),text:ox(),annotations:iI.optional(),_meta:ad(ox(),o6()).optional()}),i7=ar({type:am("image"),data:ij,mimeType:ox(),annotations:iI.optional(),_meta:ad(ox(),o6()).optional()}),se=ar({type:am("audio"),data:ij,mimeType:ox(),annotations:iI.optional(),_meta:ad(ox(),o6()).optional()}),st=ar({type:am("tool_use"),name:ox(),id:ox(),input:ad(ox(),o6()),_meta:ad(ox(),o6()).optional()}),sr=ar({type:am("resource"),resource:ai([ix,iC]),annotations:iI.optional(),_meta:ad(ox(),o6()).optional()}),so=iA.extend({type:am("resource_link")}),sa=ai([i8,i7,se,so,sr]),si=ar({role:iN,content:sa}),ss=a9.extend({description:ox().optional(),messages:ae(si)}),sn=a1.extend({method:am("notifications/prompts/list_changed"),params:a0.optional()}),sl=ar({title:ox().optional(),readOnlyHint:o2().optional(),destructiveHint:o2().optional(),idempotentHint:o2().optional(),openWorldHint:o2().optional()}),sc=ar({taskSupport:ah(["required","optional","forbidden"]).optional()}),su=ar({...is.shape,...ii.shape,description:ox().optional(),inputSchema:ar({type:am("object"),properties:ad(ox(),aF).optional(),required:ae(ox()).optional()}).catchall(o6()),outputSchema:ao({$schema:ox().optional()}).optional(),annotations:sl.optional(),execution:sc.optional(),_meta:ad(ox(),o6()).optional()}),sd=ik.extend({method:am("tools/list")}),sp=iT.extend({tools:ae(su)}),sh=a9.extend({content:ae(sa).default([]),structuredContent:o6().optional(),isError:o2().optional()}),sf=sh.or(a9.extend({toolResult:o6()})),sm=aY.extend({name:ox(),arguments:ad(ox(),o6()).optional()}),sy=aQ.extend({method:am("tools/call"),params:sm}),sg=a1.extend({method:am("notifications/tools/list_changed"),params:a0.optional()}),sv=ar({autoRefresh:o2().default(!0),debounceMs:oY().int().nonnegative().default(300)}),sb=ah(["debug","info","notice","warning","error","critical","alert","emergency"]),s_=aX.extend({level:sb}),sS=aQ.extend({method:am("logging/setLevel"),params:s_}),s$=a0.extend({level:sb,logger:ox().optional(),data:o6()}),sw=a1.extend({method:am("notifications/message"),params:s$}),sE=ar({name:ox().optional()}),sR=ar({hints:ae(sE).optional(),costPriority:oY().min(0).max(1).optional(),speedPriority:oY().min(0).max(1).optional(),intelligencePriority:oY().min(0).max(1).optional()}),sP=ar({mode:ah(["auto","required","none"]).optional()}),sk=ar({type:am("tool_result"),toolUseId:ox().describe("The unique identifier for the corresponding tool call."),content:ae(sa),structuredContent:o6().optional(),isError:o2().optional(),_meta:ad(ox(),o6()).optional()}),sT=an("type",[i8,i7,se]),sO=an("type",[i8,i7,se,st,sk]),sx=ar({role:iN,content:ai([sO,ae(sO)]),_meta:ad(ox(),o6()).optional()}),sj=aY.extend({messages:ae(sx),modelPreferences:sR.optional(),systemPrompt:ox().optional(),includeContext:ah(["none","thisServer","allServers"]).optional(),temperature:oY().optional(),maxTokens:oY().int(),stopSequences:ae(ox()).optional(),metadata:aH.optional(),tools:ae(su).optional(),toolChoice:sP.optional()}),sC=aQ.extend({method:am("sampling/createMessage"),params:sj}),sN=a9.extend({model:ox(),stopReason:ab(ah(["endTurn","stopSequence","maxTokens"]).or(ox())),role:iN,content:sT}),sI=a9.extend({model:ox(),stopReason:ab(ah(["endTurn","stopSequence","maxTokens","toolUse"]).or(ox())),role:iN,content:ai([sO,ae(sO)])}),sA=ar({type:am("boolean"),title:ox().optional(),description:ox().optional(),default:o2().optional()}),sM=ar({type:am("string"),title:ox().optional(),description:ox().optional(),minLength:oY().optional(),maxLength:oY().optional(),format:ah(["email","uri","date","date-time"]).optional(),default:ox().optional()}),sq=ar({type:ah(["number","integer"]),title:ox().optional(),description:ox().optional(),minimum:oY().optional(),maximum:oY().optional(),default:oY().optional()}),sz=ar({type:am("string"),title:ox().optional(),description:ox().optional(),enum:ae(ox()),default:ox().optional()}),sL=ar({type:am("string"),title:ox().optional(),description:ox().optional(),oneOf:ae(ar({const:ox(),title:ox()})),default:ox().optional()}),sD=ar({type:am("string"),title:ox().optional(),description:ox().optional(),enum:ae(ox()),enumNames:ae(ox()).optional(),default:ox().optional()}),sU=ai([sz,sL]),sV=ar({type:am("array"),title:ox().optional(),description:ox().optional(),minItems:oY().optional(),maxItems:oY().optional(),items:ar({type:am("string"),enum:ae(ox())}),default:ae(ox()).optional()}),sF=ar({type:am("array"),title:ox().optional(),description:ox().optional(),minItems:oY().optional(),maxItems:oY().optional(),items:ar({anyOf:ae(ar({const:ox(),title:ox()}))}),default:ae(ox()).optional()}),sH=ai([sV,sF]),sK=ai([sD,sU,sH]),sJ=ai([sK,sA,sM,sq]),sB=aY.extend({mode:am("form").optional(),message:ox(),requestedSchema:ar({type:am("object"),properties:ad(ox(),sJ),required:ae(ox()).optional()}).catchall(o6())}),sG=aY.extend({mode:am("url"),message:ox(),elicitationId:ox(),url:ox().url()}),sZ=ai([sB,sG]),sW=aQ.extend({method:am("elicitation/create"),params:sZ}),sX=a0.extend({elicitationId:ox()}),sY=a1.extend({method:am("notifications/elicitation/complete"),params:sX}),sQ=a9.extend({action:ah(["accept","decline","cancel"]),content:aI(e=>null===e?void 0:e,ad(ox(),ai([ox(),oY(),o2(),ae(ox())])).optional())}),s0=ar({type:am("ref/resource"),uri:ox()}),s1=ar({type:am("ref/prompt"),name:ox()}),s2=aX.extend({ref:ai([s1,s0]),argument:ar({name:ox(),value:ox()}),context:ar({arguments:ad(ox(),ox()).optional()}).optional()}),s9=aQ.extend({method:am("completion/complete"),params:s2}),s4=a9.extend({completion:ao({values:ae(ox()).max(100),total:ab(oY().int()),hasMore:ab(o2())})}),s5=ar({uri:ox().startsWith("file://"),name:ox().optional(),_meta:ad(ox(),o6()).optional()}),s3=aQ.extend({method:am("roots/list"),params:aX.optional()}),s6=a9.extend({roots:ae(s5)}),s8=a1.extend({method:am("notifications/roots/list_changed"),params:a0.optional()}),s7=ao({ttl:oY().optional(),pollInterval:oY().optional()}),ne=ah(["working","input_required","completed","failed","cancelled"]),nt=ar({taskId:ox(),status:ne,ttl:ai([oY(),o4()]),createdAt:ox(),lastUpdatedAt:ox(),pollInterval:ab(oY()),statusMessage:ab(ox())}),nr=a9.extend({task:nt}),no=a0.merge(nt),na=a1.extend({method:am("notifications/tasks/status"),params:no}),ni=aQ.extend({method:am("tasks/get"),params:aX.extend({taskId:ox()})}),ns=a9.merge(nt),nn=aQ.extend({method:am("tasks/result"),params:aX.extend({taskId:ox()})}),nl=a9.loose(),nc=ik.extend({method:am("tasks/list")}),nu=iT.extend({tasks:ae(nt)}),nd=aQ.extend({method:am("tasks/cancel"),params:aX.extend({taskId:ox()})}),np=a9.merge(nt),nh=ai([i$,iy,i_,s9,sS,i6,i4,iq,iL,iV,iK,iJ,iZ,sy,sd]),nf=ai([io,iR,ib,s8]),nm=ai([it,sN,sI,sQ,s6]),ny=ai([i$,sC,sW,s3]),ng=ai([io,iR,sw,i1,iH,sg,sn,iX,sY]),nv=ai([it,iv,iS,s4,ss,i5,iz,iD,iF,sh,sp,iQ]),nb=rk(oA,void 0).superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:"custom",message:"URL must be parseable",fatal:!0}),Y}).refine(e=>{let t=new URL(e);return"javascript:"!==t.protocol&&"data:"!==t.protocol&&"vbscript:"!==t.protocol},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),n_=ao({resource:ox().url(),authorization_servers:ae(nb).optional(),jwks_uri:ox().url().optional(),scopes_supported:ae(ox()).optional(),bearer_methods_supported:ae(ox()).optional(),resource_signing_alg_values_supported:ae(ox()).optional(),resource_name:ox().optional(),resource_documentation:ox().optional(),resource_policy_uri:ox().url().optional(),resource_tos_uri:ox().url().optional(),tls_client_certificate_bound_access_tokens:o2().optional(),authorization_details_types_supported:ae(ox()).optional(),dpop_signing_alg_values_supported:ae(ox()).optional(),dpop_bound_access_tokens_required:o2().optional()}),nS=ao({issuer:ox(),authorization_endpoint:nb,token_endpoint:nb,registration_endpoint:nb.optional(),scopes_supported:ae(ox()).optional(),response_types_supported:ae(ox()),response_modes_supported:ae(ox()).optional(),grant_types_supported:ae(ox()).optional(),token_endpoint_auth_methods_supported:ae(ox()).optional(),token_endpoint_auth_signing_alg_values_supported:ae(ox()).optional(),service_documentation:nb.optional(),revocation_endpoint:nb.optional(),revocation_endpoint_auth_methods_supported:ae(ox()).optional(),revocation_endpoint_auth_signing_alg_values_supported:ae(ox()).optional(),introspection_endpoint:ox().optional(),introspection_endpoint_auth_methods_supported:ae(ox()).optional(),introspection_endpoint_auth_signing_alg_values_supported:ae(ox()).optional(),code_challenge_methods_supported:ae(ox()).optional(),client_id_metadata_document_supported:o2().optional(),authorization_response_iss_parameter_supported:o2().optional().catch(void 0)}),n$=ao({issuer:ox(),authorization_endpoint:nb,token_endpoint:nb,userinfo_endpoint:nb.optional(),jwks_uri:nb,registration_endpoint:nb.optional(),scopes_supported:ae(ox()).optional(),response_types_supported:ae(ox()),response_modes_supported:ae(ox()).optional(),grant_types_supported:ae(ox()).optional(),acr_values_supported:ae(ox()).optional(),subject_types_supported:ae(ox()),id_token_signing_alg_values_supported:ae(ox()),id_token_encryption_alg_values_supported:ae(ox()).optional(),id_token_encryption_enc_values_supported:ae(ox()).optional(),userinfo_signing_alg_values_supported:ae(ox()).optional(),userinfo_encryption_alg_values_supported:ae(ox()).optional(),userinfo_encryption_enc_values_supported:ae(ox()).optional(),request_object_signing_alg_values_supported:ae(ox()).optional(),request_object_encryption_alg_values_supported:ae(ox()).optional(),request_object_encryption_enc_values_supported:ae(ox()).optional(),token_endpoint_auth_methods_supported:ae(ox()).optional(),token_endpoint_auth_signing_alg_values_supported:ae(ox()).optional(),display_values_supported:ae(ox()).optional(),claim_types_supported:ae(ox()).optional(),claims_supported:ae(ox()).optional(),service_documentation:ox().optional(),claims_locales_supported:ae(ox()).optional(),ui_locales_supported:ae(ox()).optional(),claims_parameter_supported:o2().optional(),request_parameter_supported:o2().optional(),request_uri_parameter_supported:o2().optional(),require_request_uri_registration:o2().optional(),op_policy_uri:nb.optional(),op_tos_uri:nb.optional(),client_id_metadata_document_supported:o2().optional(),authorization_response_iss_parameter_supported:o2().optional().catch(void 0)}),nw=ar({...n$.shape,...nS.pick({code_challenge_methods_supported:!0}).shape}),nE=ar({access_token:ox(),id_token:ox().optional(),token_type:ox(),expires_in:new oX({type:"number",coerce:!0,checks:[],...eG(void 0)}).optional(),scope:ox().optional(),refresh_token:ox().optional()}).strip(),nR=ar({issued_token_type:am("urn:ietf:params:oauth:token-type:id-jag"),access_token:ox(),token_type:ox().optional(),expires_in:oY().optional(),scope:ox().optional()}).strip(),nP=ar({error:ox(),error_description:ox().optional(),error_uri:ox().optional()}),nk=nb.optional().or(am("").transform(()=>void 0)),nT=ar({redirect_uris:ae(nb),token_endpoint_auth_method:ox().optional(),grant_types:ae(ox()).optional(),response_types:ae(ox()).optional(),application_type:ox().optional(),client_name:ox().optional(),client_uri:nb.optional(),logo_uri:nk,scope:ox().optional(),contacts:ae(ox()).optional(),tos_uri:nk,policy_uri:ox().optional(),jwks_uri:nb.optional(),jwks:new o5({type:"any"}).optional(),software_id:ox().optional(),software_version:ox().optional(),software_statement:ox().optional()}).strip(),nO=ar({client_id:ox(),client_secret:ox().optional(),client_id_issued_at:oY().optional(),client_secret_expires_at:oY().optional()}).strip(),nx=nT.merge(nO),nj=ar({error:ox(),error_description:ox().optional()}).strip(),nC=ar({token:ox(),token_type_hint:ox().optional()}).strip(),nN=Symbol.for("mcp.sdk.errorBrands");function nI(e,t){let r=new Set,o=t;for(;"function"==typeof o;){let e=o.mcpBrand;Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&"string"==typeof e&&r.add(e),o=Object.getPrototypeOf(o)}0!==r.size&&Object.defineProperty(e,nN,{value:r,enumerable:!1,configurable:!0})}function nA(e,t){try{if("object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&"string"==typeof e.mcpBrand&&Object.prototype.hasOwnProperty.call(t,nN)){let r=t[nN];if(r&&"function"==typeof r.has&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}(class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](e){return nA(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return nA(this,e)}constructor(e,t,r){super(t),this.code=e,this.errorUri=r,this.name="OAuthError",nI(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}});(d={}).NotConnected="NOT_CONNECTED",d.AlreadyConnected="ALREADY_CONNECTED",d.NotInitialized="NOT_INITIALIZED",d.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",d.RequestTimeout="REQUEST_TIMEOUT",d.ConnectionClosed="CONNECTION_CLOSED",d.SendFailed="SEND_FAILED",d.InvalidResult="INVALID_RESULT",d.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",d.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",d.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",d.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",d.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",d.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",d.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",d.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",d.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",d.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",d.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION";var nM=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return nA(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return nA(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="SdkError",nI(this,new.target)}};(class extends nM{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r){super(e,t,r),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}});let nq={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},nz={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null};Object.keys(nq),Object.keys(nz);Symbol("modelcontextprotocol.resultCacheHintFallback");let nL=((p={})[p.ParseError=-32700]="ParseError",p[p.InvalidRequest=-32600]="InvalidRequest",p[p.MethodNotFound=-32601]="MethodNotFound",p[p.InvalidParams=-32602]="InvalidParams",p[p.InternalError=-32603]="InternalError",p[p.ResourceNotFound=-32002]="ResourceNotFound",p[p.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",p[p.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",p[p.UrlElicitationRequired=-32042]="UrlElicitationRequired",p);var nD=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](e){return nA(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return nA(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="ProtocolError",nI(this,new.target)}static fromError(t,r,o){return t===nL.UrlElicitationRequired&&o&&o.elicitations?new nV(o.elicitations,r):t===nL.UnsupportedProtocolVersion&&o&&Array.isArray(o.supported)&&"string"==typeof o.requested?new nF({supported:o.supported,requested:o.requested},r):(t===nL.InvalidParams||t===nL.ResourceNotFound)&&"string"==typeof o?.uri&&(t===nL.ResourceNotFound||1===Object.keys(o).length)?new nU(o.uri,r):t===nL.MissingRequiredClientCapability&&o&&null!==o.requiredCapabilities&&"object"==typeof o.requiredCapabilities&&!Array.isArray(o.requiredCapabilities)?new nH({requiredCapabilities:o.requiredCapabilities},r):new e(t,r,o)}},nU=class extends nD{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(nL.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},nV=class extends nD{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(nL.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},nF=class extends nD{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(nL.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},nH=class extends nD{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(nL.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}};let nK={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},nJ={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};Object.keys(nK),Object.keys(nJ);var nB=((e,t)=>{let r={};for(var o in e)V(r,o,{get:e[o],enumerable:!0});return t&&V(r,Symbol.toStringTag,{value:"Module"}),r})({AnnotationsSchema:()=>iI,AudioContentSchema:()=>se,BaseMetadataSchema:()=>is,BaseRequestParamsSchema:()=>aX,BlobResourceContentsSchema:()=>iC,BooleanSchemaSchema:()=>sA,CallToolRequestParamsSchema:()=>sm,CallToolRequestSchema:()=>sy,CallToolResultSchema:()=>sh,CancelTaskRequestSchema:()=>nd,CancelTaskResultSchema:()=>np,CancelledNotificationParamsSchema:()=>ir,CancelledNotificationSchema:()=>io,ClientCapabilitiesSchema:()=>ih,ClientNotificationSchema:()=>nf,ClientRequestSchema:()=>nh,ClientResultSchema:()=>nm,ClientTasksCapabilitySchema:()=>id,CompatibilityCallToolResultSchema:()=>sf,CompleteRequestParamsSchema:()=>s2,CompleteRequestSchema:()=>s9,CompleteResultSchema:()=>s4,ContentBlockSchema:()=>sa,CreateMessageRequestParamsSchema:()=>sj,CreateMessageRequestSchema:()=>sC,CreateMessageResultSchema:()=>sN,CreateMessageResultWithToolsSchema:()=>sI,CreateTaskResultSchema:()=>nr,CursorSchema:()=>aB,DiscoverRequestSchema:()=>i_,DiscoverResultSchema:()=>iS,ElicitRequestFormParamsSchema:()=>sB,ElicitRequestParamsSchema:()=>sZ,ElicitRequestSchema:()=>sW,ElicitRequestURLParamsSchema:()=>sG,ElicitResultSchema:()=>sQ,ElicitationCompleteNotificationParamsSchema:()=>sX,ElicitationCompleteNotificationSchema:()=>sY,EmbeddedResourceSchema:()=>sr,EmptyResultSchema:()=>it,EnumSchemaSchema:()=>sK,GetPromptRequestParamsSchema:()=>i3,GetPromptRequestSchema:()=>i6,GetPromptResultSchema:()=>ss,GetTaskPayloadRequestSchema:()=>nn,GetTaskPayloadResultSchema:()=>nl,GetTaskRequestSchema:()=>ni,GetTaskResultSchema:()=>ns,IconSchema:()=>ia,IconsSchema:()=>ii,ImageContentSchema:()=>i7,ImplementationSchema:()=>il,InitializeRequestParamsSchema:()=>im,InitializeRequestSchema:()=>iy,InitializeResultSchema:()=>iv,InitializedNotificationSchema:()=>ib,JSONArraySchema:()=>aK,JSONObjectSchema:()=>aH,JSONRPCErrorResponseSchema:()=>a8,JSONRPCMessageSchema:()=>a7,JSONRPCNotificationSchema:()=>a3,JSONRPCRequestSchema:()=>a5,JSONRPCResponseSchema:()=>ie,JSONRPCResultResponseSchema:()=>a6,JSONValueSchema:()=>aF,LegacyTitledEnumSchemaSchema:()=>sD,ListChangedOptionsBaseSchema:()=>sv,ListPromptsRequestSchema:()=>i4,ListPromptsResultSchema:()=>i5,ListResourceTemplatesRequestSchema:()=>iL,ListResourceTemplatesResultSchema:()=>iD,ListResourcesRequestSchema:()=>iq,ListResourcesResultSchema:()=>iz,ListRootsRequestSchema:()=>s3,ListRootsResultSchema:()=>s6,ListTasksRequestSchema:()=>nc,ListTasksResultSchema:()=>nu,ListToolsRequestSchema:()=>sd,ListToolsResultSchema:()=>sp,LoggingLevelSchema:()=>sb,LoggingMessageNotificationParamsSchema:()=>s$,LoggingMessageNotificationSchema:()=>sw,ModelHintSchema:()=>sE,ModelPreferencesSchema:()=>sR,MultiSelectEnumSchemaSchema:()=>sH,NotificationSchema:()=>a1,NotificationsParamsSchema:()=>a0,NumberSchemaSchema:()=>sq,PaginatedRequestParamsSchema:()=>iP,PaginatedRequestSchema:()=>ik,PaginatedResultSchema:()=>iT,PingRequestSchema:()=>i$,PrimitiveSchemaDefinitionSchema:()=>sJ,ProgressNotificationParamsSchema:()=>iE,ProgressNotificationSchema:()=>iR,ProgressSchema:()=>iw,ProgressTokenSchema:()=>aJ,PromptArgumentSchema:()=>i2,PromptListChangedNotificationSchema:()=>sn,PromptMessageSchema:()=>si,PromptReferenceSchema:()=>s1,PromptSchema:()=>i9,ReadResourceRequestParamsSchema:()=>iU,ReadResourceRequestSchema:()=>iV,ReadResourceResultSchema:()=>iF,RelatedTaskMetadataSchema:()=>aZ,RequestIdSchema:()=>a4,RequestMetaSchema:()=>aW,RequestSchema:()=>aQ,ResourceContentsSchema:()=>iO,ResourceLinkSchema:()=>so,ResourceListChangedNotificationSchema:()=>iH,ResourceRequestParamsSchema:()=>iU,ResourceSchema:()=>iA,ResourceTemplateReferenceSchema:()=>s0,ResourceTemplateSchema:()=>iM,ResourceUpdatedNotificationParamsSchema:()=>i0,ResourceUpdatedNotificationSchema:()=>i1,ResultMetaObjectSchema:()=>a2,ResultSchema:()=>a9,RoleSchema:()=>iN,RootSchema:()=>s5,RootsListChangedNotificationSchema:()=>s8,SamplingContentSchema:()=>sT,SamplingMessageContentBlockSchema:()=>sO,SamplingMessageSchema:()=>sx,ServerCapabilitiesSchema:()=>ig,ServerNotificationSchema:()=>ng,ServerRequestSchema:()=>ny,ServerResultSchema:()=>nv,ServerTasksCapabilitySchema:()=>ip,SetLevelRequestParamsSchema:()=>s_,SetLevelRequestSchema:()=>sS,SingleSelectEnumSchemaSchema:()=>sU,StringSchemaSchema:()=>sM,SubscribeRequestParamsSchema:()=>iU,SubscribeRequestSchema:()=>iK,SubscriptionFilterSchema:()=>iB,SubscriptionsAcknowledgedNotificationParamsSchema:()=>iW,SubscriptionsAcknowledgedNotificationSchema:()=>iX,SubscriptionsListenRequestParamsSchema:()=>iG,SubscriptionsListenRequestSchema:()=>iZ,SubscriptionsListenResultMetaSchema:()=>iY,SubscriptionsListenResultSchema:()=>iQ,TaskAugmentedRequestParamsSchema:()=>aY,TaskCreationParamsSchema:()=>s7,TaskMetadataSchema:()=>aG,TaskSchema:()=>nt,TaskStatusNotificationParamsSchema:()=>no,TaskStatusNotificationSchema:()=>na,TaskStatusSchema:()=>ne,TextContentSchema:()=>i8,TextResourceContentsSchema:()=>ix,TitledMultiSelectEnumSchemaSchema:()=>sF,TitledSingleSelectEnumSchemaSchema:()=>sL,ToolAnnotationsSchema:()=>sl,ToolChoiceSchema:()=>sP,ToolExecutionSchema:()=>sc,ToolListChangedNotificationSchema:()=>sg,ToolResultContentSchema:()=>sk,ToolSchema:()=>su,ToolUseContentSchema:()=>st,UnsubscribeRequestParamsSchema:()=>iU,UnsubscribeRequestSchema:()=>iJ,UntitledMultiSelectEnumSchemaSchema:()=>sV,UntitledSingleSelectEnumSchemaSchema:()=>sz});let nG=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&"input_required"===e.resultType;function nZ(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function nW(e){if(null==e)return!1;let t=typeof e;return("object"===t||"function"===t)&&"~standard"in e&&"function"==typeof e["~standard"]?.validate}nL.InvalidRequest,nL.UnsupportedProtocolVersion,nL.InvalidParams,nL.MethodNotFound,nL.InvalidParams,nL.MissingRequiredClientCapability,nL.ParseError,nL.InvalidRequest,nL.MethodNotFound,nL.UnsupportedProtocolVersion,nL.MissingRequiredClientCapability;let nX=!1,nY="draft-2020-12",nQ=/\\\.\\d\{(\d+)\}/;function n0(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let n1=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function n2(e){return n1.has(e)||e.startsWith("x-")}let n9=new Set(["$schema",...Object.keys(sB.shape.requestedSchema.shape)]),n4={string:nZ([sM,sz,sL,sD]),number:nZ([sq]),integer:nZ([sq]),boolean:nZ([sA]),array:nZ([sV,sF])},n5=new Set(sM.shape.format.unwrap().options),n3=Object.assign(function(e){let t=void 0!==e.inputRequests&&Object.keys(e.inputRequests).length>0,r="string"==typeof e.requestState;if(!t&&!r)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...void 0!==e.inputRequests&&{inputRequests:e.inputRequests},...void 0!==e.requestState&&{requestState:e.requestState}}},{elicit(e){try{return{method:"elicitation/create",params:function(e){var t;if(!nW(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let r=e.requestedSchema["~standard"].vendor,o=function(e,t){let r={},o=[];for(let[a,i]of Object.entries(e))"properties"===a&&n0(i)?r[a]=Object.fromEntries(Object.entries(i).map(([e,r])=>[e,function(e,t,r,o){if(!n0(e))return e;let a="string"==typeof e.type&&Object.hasOwn(n4,e.type)?n4[e.type]:void 0;if(void 0===a)return e;let i={};for(let[n,l]of Object.entries(e))if(a.has(n)||n2(n))i[n]=l;else if("pattern"===n&&"string"===e.type&&"string"==typeof e.format)if(n5.has(e.format)){var s;"string"==typeof l&&(s=e.format,"zod"!==r||(function(e,t){let r;switch(e){case"email":r=[rR(oC,void 0)];break;case"uri":r=[rk(oA,void 0)];break;case"date":r=[oc()];break;case"date-time":let o,a;o=nQ.exec(t),a=[void 0,-1,0],o&&a.push(Number(o[1])),r=[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>a.map(r=>on({local:e,offset:t,precision:r}))))}return new Set(r.map(e=>{let t;return t=oi(e,{target:nY,io:"input"}),"string"==typeof t.pattern?t.pattern:void 0}).filter(e=>void 0!==e))})(s,l).has(l))||o.push(`${t}.${n}`)}else i[n]=l;else o.push(`${t}.${n}`);return i}(r,`properties.${e}`,t,o)])):n9.has(a)?r[a]=i:n2(a)||o.push(a);if(o.length>0)throw new nD(nL.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}(function(e){try{return function(e,t="input"){let r,o=e["~standard"];if(o.jsonSchema)r=o.jsonSchema[t]({target:nY});else if("zod"===o.vendor){if(!("_zod"in e))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");nX||(nX=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=oi(e,{target:nY,io:t})}else throw Error(`Schema library "${o.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if("output"===t)return void 0!==r.type||!function e(t){if("properties"in t||"patternProperties"in t||"additionalProperties"in t||"required"in t)return!0;for(let r of["oneOf","anyOf","allOf"]){let o=t[r];if(Array.isArray(o)&&o.length>0)return o.every(t=>null!==t&&"object"==typeof t&&("object"===t.type||e(t)))}return!1}(r)?r:{type:"object",...r};if(void 0!==r.type&&"object"!==r.type)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...r}}(e,"input")}catch(t){let e=t instanceof Error?t.message:String(t);throw new nD(nL.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${e}`)}}(e.requestedSchema),r),a=(t=sB.shape.requestedSchema,om(t,o));if(!a.success)throw new nD(nL.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${function(e,t){if(!n0(e.properties))return t;let r=Object.entries(e.properties).filter(([,e])=>!om(sJ,e).success).map(([e])=>`properties.${e}`);return r.length>0?r.join(", "):t}(o,a.error.message)}`);let i=function e(t,r,o=""){return Array.isArray(t)&&Array.isArray(r)?t.flatMap((t,a)=>e(t,r[a],`${o}[${a}]`)):n0(t)&&n0(r)?Object.entries(t).flatMap(([t,a])=>{let i=o?`${o}.${t}`:t;return Object.prototype.hasOwnProperty.call(r,t)?e(a,r[t],i):n2(t)?[]:[i]}):[]}(o,a.data);if(i.length>0)throw new nD(nL.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(", ")}`);let s=(a.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(a.data.properties,e));if(s.length>0)throw new nD(nL.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:a.data}}(e)}}catch(e){throw e instanceof nD?TypeError(e.message,{cause:e}):e}},elicitUrl:e=>({method:"elicitation/create",params:{...e,mode:"url"}}),createMessage:e=>({method:"sampling/createMessage",params:e}),listRoots:()=>({method:"roots/list"})});function n6(e,t,r){let o=n8(e,t);if("elicit"!==o.kind||"accept"!==o.action||void 0===o.content)return;if(void 0===r)return o.content;let a=r["~standard"].validate(o.content);if(a instanceof Promise)throw TypeError("acceptedContent(responses, key, schema) requires a synchronously-validating schema");return void 0===a.issues?a.value:void 0}function n8(e,t){if(void 0===e||"object"!=typeof e||null===e)return{kind:"missing"};let r=e[t];if(null===r||"object"!=typeof r||Array.isArray(r))return{kind:"missing"};if("accept"===r.action||"decline"===r.action||"cancel"===r.action){let e=r.content;return{kind:"elicit",action:r.action,...null!==e&&"object"==typeof e&&!Array.isArray(e)&&{content:e}}}return Array.isArray(r.roots)?{kind:"roots",roots:r.roots}:"string"==typeof r.role&&void 0!==r.content?{kind:"sampling",result:r}:{kind:"missing"}}let n7={},le={};function lt(e,t){let r=e.slice(0,-6);n7[r]=t,le[r]=e=>t.safeParse(e).success}for(let e of["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"])lt(e,nB[e]);for(let[e,t]of Object.entries({IdJagTokenExchangeResponseSchema:nR,OAuthClientInformationFullSchema:nx,OAuthClientInformationSchema:nO,OAuthClientMetadataSchema:nT,OAuthClientRegistrationErrorSchema:nj,OAuthErrorResponseSchema:nP,OAuthMetadataSchema:nS,OAuthProtectedResourceMetadataSchema:n_,OAuthTokenRevocationRequestSchema:nC,OAuthTokensSchema:nE,OpenIdProviderDiscoveryMetadataSchema:nw,OpenIdProviderMetadataSchema:n$}))lt(e,t);Object.freeze(n7),Object.freeze(le);h=void 0,()=>h;B(e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function a(e){this.parameters=Object.create(null),this.type=e}e.parse=function(e){if(!e)throw TypeError("argument string is required");var i,s,n,l="object"==typeof e?function(e){var t;if("function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]),"string"!=typeof t)throw TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof l)throw TypeError("argument string is required to be a string");var c=l.indexOf(";"),u=-1!==c?l.slice(0,c).trim():l.trim();if(!o.test(u))throw TypeError("invalid media type");var d=new a(u.toLowerCase());if(-1!==c){for(t.lastIndex=c;s=t.exec(l);){if(s.index!==c)throw TypeError("invalid parameter format");c+=s[0].length,i=s[1].toLowerCase(),34===(n=s[2]).charCodeAt(0)&&-1!==(n=n.slice(1,-1)).indexOf("\\")&&(n=n.replace(r,"$1")),d.parameters[i]=n}if(c!==l.length)throw TypeError("invalid parameter format")}return d}})();var lr=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return""===e||'""'===e}get str(){var e;return null!=(e=this._str)?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!=(e=this._names)?e:this._names=this._items.reduce((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e),{})}};function a(e,...t){let r=[e[0]],i=0;for(;i<t.length;)n(r,t[i]),r.push(e[++i]);return new o(r)}e._Code=o,e.nil=new o(""),e._=a;let i=new o("+");function s(e,...t){let a=[l(e[0])],c=0;for(;c<t.length;)a.push(i),n(a,t[c]),a.push(i,l(e[++c]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===i){var o,a;let i=(o=e[t-1],'""'===(a=e[t+1])?o:'""'===o?a:"string"==typeof o?a instanceof r||'"'!==o[o.length-1]?void 0:"string"!=typeof a?`${o.slice(0,-1)}${a}"`:'"'===a[0]?o.slice(0,-1)+a.slice(1):void 0:"string"!=typeof a||'"'!==a[0]||o instanceof r?void 0:`"${o}${a.slice(1)}`);if(void 0!==i){e.splice(t-1,3,i);continue}e[t++]="+"}t++}}(a),new o(a)}function n(e,t){var a;t instanceof o?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(a=t)||"boolean"==typeof a||null===a?a:l(Array.isArray(a)?a.join(","):a))}function l(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=s,e.addCodeArg=n,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:s`${e}${t}`},e.stringify=function(e){return new o(l(e))},e.safeStringify=l,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new o(`.${t}`):a`[${t}]`},e.getEsmExportName=function(t){if("string"==typeof t&&e.IDENTIFIER.test(t))return new o(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)},e.regexpCode=function(e){return new o(e.toString())}}),lo=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=lr();var r,o,a=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}};(r=o||(e.UsedValueState=o={}))[r.Started=0]="Started",r[r.Completed=1]="Completed",e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if((null==(r=null==(t=this._parent)?void 0:t._prefixes)?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var s=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:r,itemIndex:o}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(r)}[${o}]`}};e.ValueScopeName=s;let n=(0,t._)`\n`;var l=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?n:t.nil}}get(){return this._scope}name(e){return new s(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:a}=o,i=null!=(r=t.key)?r:t.ref,s=this._values[a];if(s){let e=s.get(i);if(e)return e}else s=this._values[a]=new Map;s.set(i,o);let n=this._scope[a]||(this._scope[a]=[]),l=n.length;return n[l]=t.ref,o.setValue(t,{property:a,itemIndex:l}),o}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,r=this._values){return this._reduceValues(r,r=>{if(void 0===r.scopePath)throw Error(`CodeGen: name "${r}" has no value`);return(0,t._)`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(r,i,s={},n){let l=t.nil;for(let c in r){let u=r[c];if(!u)continue;let d=s[c]=s[c]||new Map;u.forEach(r=>{if(d.has(r))return;d.set(r,o.Started);let s=i(r);if(s){let o=this.opts.es5?e.varKinds.var:e.varKinds.const;l=(0,t._)`${l}${o} ${r} = ${s};${this.opts._n}`}else if(s=null==n?void 0:n(r))l=(0,t._)`${l}${s}${this.opts._n}`;else throw new a(r);d.set(r,o.Completed)})}return l}};e.ValueScope=l}),la=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=lr(),r=lo();var o=lr();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var a=lo();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var i=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},s=class extends i{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let o=e?r.varKinds.var:this.varKind,a=void 0===this.rhs?"":` = ${this.rhs}`;return`${o} ${this.name}${a};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=x(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},n=class extends i{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=x(this.rhs,e,r),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},l=class extends n{constructor(e,t,r,o){super(e,r,o),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},c=class extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},d=class extends i{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},p=class extends i{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=x(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},h=class extends i{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,o=r.length;for(;o--;){let a=r[o];a.optimizeNames(e,t)||(function(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}(e,a.names),r.splice(o,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>T(e,t.names),{})}},f=class extends h{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},m=class extends h{},y=class extends f{};y.kind="else";var g=class e extends f{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(!0===t)return this.nodes;let r=this.else;if(r){let e=r.optimizeNodes();r=this.else=Array.isArray(e)?new y(e):e}return r?!1===t?r instanceof e?r:r.nodes:this.nodes.length?this:new e(j(t),r instanceof e?[r]:r.nodes):!1!==t&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null==(r=this.else)?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=x(this.condition,e,t),this}get names(){let e=super.names;return O(e,this.condition),this.else&&T(e,this.else.names),e}};g.kind="if";var v=class extends f{};v.kind="for";var b=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=x(this.iteration,e,t),this}get names(){return T(super.names,this.iteration.names)}},_=class extends v{constructor(e,t,r,o){super(),this.varKind=e,this.name=t,this.from=r,this.to=o}render(e){let t=e.es5?r.varKinds.var:this.varKind,{name:o,from:a,to:i}=this;return`for(${t} ${o}=${a}; ${o}<${i}; ${o}++)`+super.render(e)}get names(){return O(O(super.names,this.from),this.to)}},S=class extends v{constructor(e,t,r,o){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=x(this.iterable,e,t),this}get names(){return T(super.names,this.iterable.names)}},$=class extends f{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};$.kind="func";var w=class extends h{render(e){return"return "+super.render(e)}};w.kind="return";var E=class extends f{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null==(e=this.catch)||e.optimizeNodes(),null==(t=this.finally)||t.optimizeNodes(),this}optimizeNames(e,t){var r,o;return super.optimizeNames(e,t),null==(r=this.catch)||r.optimizeNames(e,t),null==(o=this.finally)||o.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&T(e,this.catch.names),this.finally&&T(e,this.finally.names),e}},R=class extends f{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};R.kind="catch";var P=class extends f{render(e){return"finally"+super.render(e)}};P.kind="finally";var k=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,o){let a=this._scope.toName(t);return void 0!==r&&o&&(this._constants[a.str]=r),this._leafNode(new s(e,a,r)),a}const(e,t,o){return this._def(r.varKinds.const,e,t,o)}let(e,t,o){return this._def(r.varKinds.let,e,t,o)}var(e,t,o){return this._def(r.varKinds.var,e,t,o)}assign(e,t,r){return this._leafNode(new n(e,t,r))}add(t,r){return this._leafNode(new l(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new p(e)),this}object(...e){let r=["{"];for(let[o,a]of e)r.length>1&&r.push(","),r.push(o),(o!==a||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,a));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new g(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new g(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(g,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new b(e),t)}forRange(e,t,o,a,i=this.opts.es5?r.varKinds.var:r.varKinds.let){let s=this._scope.toName(e);return this._for(new _(i,s,t,o),()=>a(s))}forOf(e,o,a,i=r.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let e=o instanceof t.Name?o:this.var("_arr",o);return this.forRange("_i",0,(0,t._)`${e}.length`,r=>{this.var(s,(0,t._)`${e}[${r}]`),a(s)})}return this._for(new S("of",i,s,o),()=>a(s))}forIn(e,o,a,i=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${o})`,a);let s=this._scope.toName(e);return this._for(new S("in",i,s,o),()=>a(s))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new c(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new w;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(w)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let o=new E;if(this._blockNode(o),this.code(e),t){let e=this.name("e");this._currNode=o.catch=new R(e),t(e)}return r&&(this._currNode=o.finally=new P,this.code(r)),this._endBlockNode(R,P)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(void 0===t)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,o,a){return this._blockNode(new $(e,r,o)),a&&this.code(a).endFunc(),this}endFunc(){return this._endBlockNode($)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof g))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function T(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function O(e,r){return r instanceof t._CodeOrName?T(e,r.names):e}function x(e,r,o){var a;if(e instanceof t.Name)return i(e);if(!((a=e)instanceof t._Code&&a._items.some(e=>e instanceof t.Name&&1===r[e.str]&&void 0!==o[e.str])))return e;return new t._Code(e._items.reduce((e,r)=>(r instanceof t.Name&&(r=i(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e),[]));function i(e){let t=o[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function j(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:(0,t._)`!${A(e)}`}e.CodeGen=k,e.not=j;let C=I(e.operators.AND);e.and=function(...e){return e.reduce(C)};let N=I(e.operators.OR);function I(e){return(r,o)=>r===t.nil?o:o===t.nil?r:(0,t._)`${A(r)} ${e} ${A(o)}`}function A(e){return e instanceof t.Name?e:(0,t._)`(${e})`}e.or=function(...e){return e.reduce(N)}}),li=B(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let o=la(),a=lr();function i(e,t=e.schema){let{opts:r,self:o}=e;if(!r.strictSchema||"boolean"==typeof t)return;let a=o.RULES.keywords;for(let r in t)a[r]||h(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}function n(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:a}){return(i,s,n,l)=>{let c=void 0===n?s:n instanceof o.Name?(s instanceof o.Name?e(i,s,n):t(i,s,n),n):s instanceof o.Name?(t(i,n,s),s):r(s,n);return l!==o.Name||c instanceof o.Name?c:a(i,c)}}function u(e,t){if(!0===t)return e.var("props",!0);let r=e.var("props",(0,o._)`{}`);return void 0!==t&&d(e,r,t),r}function d(e,t,r){Object.keys(r).forEach(r=>e.assign((0,o._)`${t}${(0,o.getProperty)(r)}`,!0))}e.toHash=function(e){let t={};for(let r of e)t[r]=!0;return t},e.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(i(e,t),!s(t,e.self.RULES.all))},e.checkUnknownRules=i,e.schemaHasRules=s,e.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(let r in e)if("$ref"!==r&&t.all[r])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,a,i){if(!i){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return(0,o._)`${r}`}return(0,o._)`${e}${t}${(0,o.getProperty)(a)}`},e.unescapeFragment=function(e){return l(decodeURIComponent(e))},e.escapeFragment=function(e){return encodeURIComponent(n(e))},e.escapeJsonPointer=n,e.unescapeJsonPointer=l,e.eachItem=function(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)},e.mergeEvaluated={props:c({mergeNames:(e,t,r)=>e.if((0,o._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,o._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,o._)`${r} || {}`).code((0,o._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,o._)`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,(0,o._)`${r} || {}`),d(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:c({mergeNames:(e,t,r)=>e.if((0,o._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,o._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,o._)`${r} !== true`,()=>e.assign(r,!0===t||(0,o._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},e.evaluatedPropsToName=u,e.setEvaluated=d;let p={};function h(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw Error(t);e.self.logger.warn(t)}}e.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:p[t.code]||(p[t.code]=new a._Code(t.code))})},(r=t||(e.Type=t={}))[r.Num=0]="Num",r[r.Str=1]="Str",e.getErrorPath=function(e,r,a){if(e instanceof o.Name){let i=r===t.Num;return a?i?(0,o._)`"[" + ${e} + "]"`:(0,o._)`"['" + ${e} + "']"`:i?(0,o._)`"/" + ${e}`:(0,o._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return a?(0,o.getProperty)(e).toString():"/"+n(e)},e.checkStrictMode=h}),ls=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la();e.default={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")}}),ln=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=la(),r=li(),o=ls();function a(e,r){let a=e.const("err",r);e.if((0,t._)`${o.default.vErrors} === null`,()=>e.assign(o.default.vErrors,(0,t._)`[${a}]`),(0,t._)`${o.default.vErrors}.push(${a})`),e.code((0,t._)`${o.default.errors}++`)}function i(e,r){let{gen:o,validateName:a,schemaEnv:i}=e;i.$async?o.throw((0,t._)`new ${e.ValidationError}(${r})`):(o.assign((0,t._)`${a}.errors`,r),o.return(!1))}e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?(0,t.str)`"${e}" keyword must be ${r} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`},e.reportError=function(r,o=e.keywordError,s,l){let{it:c}=r,{gen:u,compositeRule:d,allErrors:p}=c,h=n(r,o,s);(null!=l?l:d||p)?a(u,h):i(c,(0,t._)`[${h}]`)},e.reportExtraError=function(t,r=e.keywordError,s){let{it:l}=t,{gen:c,compositeRule:u,allErrors:d}=l;a(c,n(t,r,s)),u||d||i(l,o.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(o.default.errors,r),e.if((0,t._)`${o.default.vErrors} !== null`,()=>e.if(r,()=>e.assign((0,t._)`${o.default.vErrors}.length`,r),()=>e.assign(o.default.vErrors,null)))},e.extendErrors=function({gen:e,keyword:r,schemaValue:a,data:i,errsCount:s,it:n}){if(void 0===s)throw Error("ajv implementation error");let l=e.name("err");e.forRange("i",s,o.default.errors,s=>{e.const(l,(0,t._)`${o.default.vErrors}[${s}]`),e.if((0,t._)`${l}.instancePath === undefined`,()=>e.assign((0,t._)`${l}.instancePath`,(0,t.strConcat)(o.default.instancePath,n.errorPath))),e.assign((0,t._)`${l}.schemaPath`,(0,t.str)`${n.errSchemaPath}/${r}`),n.opts.verbose&&(e.assign((0,t._)`${l}.schema`,a),e.assign((0,t._)`${l}.data`,i))})};let s={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function n(e,a,i){let{createErrors:n}=e.it;return!1===n?(0,t._)`{}`:function(e,a,i={}){let{gen:n,it:l}=e,c=[function({errorPath:e},{instancePath:a}){let i=a?(0,t.str)`${e}${(0,r.getErrorPath)(a,r.Type.Str)}`:e;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,i)]}(l,i),function({keyword:e,it:{errSchemaPath:o}},{schemaPath:a,parentSchema:i}){let n=i?o:(0,t.str)`${o}/${e}`;return a&&(n=(0,t.str)`${n}${(0,r.getErrorPath)(a,r.Type.Str)}`),[s.schemaPath,n]}(e,i)];return function(e,{params:r,message:a},i){let{keyword:n,data:l,schemaValue:c,it:u}=e,{opts:d,propertyName:p,topSchemaRef:h,schemaPath:f}=u;i.push([s.keyword,n],[s.params,"function"==typeof r?r(e):r||(0,t._)`{}`]),d.messages&&i.push([s.message,"function"==typeof a?a(e):a]),d.verbose&&i.push([s.schema,c],[s.parentSchema,(0,t._)`${h}${f}`],[o.default.data,l]),p&&i.push([s.propertyName,p])}(e,a,c),n.object(...c)}(e,a,i)}}),ll=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=ln(),r=la(),o=ls(),a={message:"boolean schema is false"};function i(e,r){let{gen:o,data:i}=e;(0,t.reportError)({gen:o,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},a,void 0,r)}e.topBoolOrEmptySchema=function(e){let{gen:t,schema:a,validateName:s}=e;!1===a?i(e,!1):"object"==typeof a&&!0===a.$async?t.return(o.default.data):(t.assign((0,r._)`${s}.errors`,null),t.return(!0))},e.boolOrEmptySchema=function(e,t){let{gen:r,schema:o}=e;!1===o?(r.var(t,!1),i(e)):r.var(t,!0)}}),lc=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set(["string","number","integer","boolean","null","object","array"]);e.isJSONType=function(e){return"string"==typeof e&&t.has(e)},e.getRules=function(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}}),lu=B(e=>{function t(e,t){return t.rules.some(t=>r(e,t))}function r(e,t){var r;return void 0!==e[t.keyword]||(null==(r=t.definition.implements)?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0,e.schemaHasRulesForType=function({schema:e,self:r},o){let a=r.RULES.types[o];return a&&!0!==a&&t(e,a)},e.shouldUseGroup=t,e.shouldUseRule=r}),ld=B(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let o=lc(),a=lu(),i=ln(),s=la(),n=li();function l(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(o.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}(r=t||(e.DataType=t={}))[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong",e.getSchemaTypes=function(e){let t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},e.getJSONTypes=l,e.coerceAndCheckDataType=function(e,r){var o,i;let{gen:n,data:l,opts:u}=e,p=(o=r,(i=u.coerceTypes)?o.filter(e=>c.has(e)||"array"===i&&"array"===e):[]),f=r.length>0&&!(0===p.length&&1===r.length&&(0,a.schemaHasRulesForType)(e,r[0]));if(f){let o=d(r,l,u.strictNumbers,t.Wrong);n.if(o,()=>{p.length?function(e,t,r){let{gen:o,data:a,opts:i}=e,n=o.let("dataType",(0,s._)`typeof ${a}`),l=o.let("coerced",(0,s._)`undefined`);for(let e of("array"===i.coerceTypes&&o.if((0,s._)`${n} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>o.assign(a,(0,s._)`${a}[0]`).assign(n,(0,s._)`typeof ${a}`).if(d(t,a,i.strictNumbers),()=>o.assign(l,a))),o.if((0,s._)`${l} !== undefined`),r))(c.has(e)||"array"===e&&"array"===i.coerceTypes)&&function(e){switch(e){case"string":o.elseIf((0,s._)`${n} == "number" || ${n} == "boolean"`).assign(l,(0,s._)`"" + ${a}`).elseIf((0,s._)`${a} === null`).assign(l,(0,s._)`""`);return;case"number":o.elseIf((0,s._)`${n} == "boolean" || ${a} === null
|
|
63
|
-
|| (${
|
|
64
|
-
|| (${
|
|
65
|
-
|| ${n} === "boolean" || ${a} === null`).assign(l,(0,s._)`[${a}]`)}}(e);o.else(),h(e),o.endIf(),o.if((0,s._)`${l} !== undefined`,()=>{o.assign(a,l),function({gen:e,parentData:t,parentDataProperty:r},o){e.if((0,s._)`${t} !== undefined`,()=>e.assign((0,s._)`${t}[${r}]`,o))}(e,l)})}(e,r,p):h(e)})}return f};let c=new Set(["string","number","integer","boolean","null"]);function u(e,r,o,a=t.Correct){let i,n=a===t.Correct?s.operators.EQ:s.operators.NEQ;switch(e){case"null":return(0,s._)`${r} ${n} null`;case"array":i=(0,s._)`Array.isArray(${r})`;break;case"object":i=(0,s._)`${r} && typeof ${r} == "object" && !Array.isArray(${r})`;break;case"integer":i=l((0,s._)`!(${r} % 1) && !isNaN(${r})`);break;case"number":i=l();break;default:return(0,s._)`typeof ${r} ${n} ${e}`}return a===t.Correct?i:(0,s.not)(i);function l(e=s.nil){return(0,s.and)((0,s._)`typeof ${r} == "number"`,e,o?(0,s._)`isFinite(${r})`:s.nil)}}function d(e,t,r,o){let a;if(1===e.length)return u(e[0],t,r,o);let i=(0,n.toHash)(e);if(i.array&&i.object){let e=(0,s._)`typeof ${t} != "object"`;a=i.null?e:(0,s._)`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else a=s.nil;for(let e in i.number&&delete i.integer,i)a=(0,s.and)(a,u(e,t,r,o));return a}e.checkDataType=u,e.checkDataTypes=d;let p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?(0,s._)`{type: ${e}}`:(0,s._)`{type: ${t}}`};function h(e){let t=function(e){let{gen:t,data:r,schema:o}=e,a=(0,n.schemaRefOrVal)(e,o,"type");return{gen:t,keyword:"type",data:r,schema:o.type,schemaCode:a,schemaValue:a,parentSchema:o,params:{},it:e}}(e);(0,i.reportError)(t,p)}e.reportTypeError=h}),lp=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=la(),r=li();function o(e,o,a){let{gen:i,compositeRule:s,data:n,opts:l}=e;if(void 0===a)return;let c=(0,t._)`${n}${(0,t.getProperty)(o)}`;if(s)return void(0,r.checkStrictMode)(e,`default is ignored for: ${c}`);let u=(0,t._)`${c} === undefined`;"empty"===l.useDefaults&&(u=(0,t._)`${u} || ${c} === null || ${c} === ""`),i.if(u,(0,t._)`${c} = ${(0,t.stringify)(a)}`)}e.assignDefaults=function(e,t){let{properties:r,items:a}=e.schema;if("object"===t&&r)for(let t in r)o(e,t,r[t].default);else"array"===t&&Array.isArray(a)&&a.forEach((t,r)=>o(e,r,t.default))}}),lh=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=la(),r=li(),o=ls(),a=li();function i(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}function s(e,r,o){return(0,t._)`${i(e)}.call(${r}, ${o})`}function n(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} === undefined`;return a?(0,t.or)(i,(0,t.not)(s(e,r,o))):i}function l(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}e.checkReportMissingProp=function(e,r){let{gen:o,data:a,it:i}=e;o.if(n(o,a,r,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${r}`},!0),e.error()})},e.checkMissingProp=function({gen:e,data:r,it:{opts:o}},a,i){return(0,t.or)(...a.map(a=>(0,t.and)(n(e,r,a,o.ownProperties),(0,t._)`${i} = ${a}`)))},e.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},e.hasPropFunc=i,e.isOwnProperty=s,e.propertyInData=function(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} !== undefined`;return a?(0,t._)`${i} && ${s(e,r,o)}`:i},e.noPropertyInData=n,e.allSchemaProperties=l,e.schemaProperties=function(e,t){return l(t).filter(o=>!(0,r.alwaysValidSchema)(e,t[o]))},e.callValidateCode=function({schemaCode:e,data:r,it:{gen:a,topSchemaRef:i,schemaPath:s,errorPath:n},it:l},c,u,d){let p=d?(0,t._)`${e}, ${r}, ${i}${s}`:r,h=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,n)],[o.default.parentData,l.parentData],[o.default.parentDataProperty,l.parentDataProperty],[o.default.rootData,o.default.rootData]];l.opts.dynamicRef&&h.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let f=(0,t._)`${p}, ${a.object(...h)}`;return u!==t.nil?(0,t._)`${c}.call(${u}, ${f})`:(0,t._)`${c}(${f})`};let c=(0,t._)`new RegExp`;e.usePattern=function({gen:e,it:{opts:r}},o){let i=r.unicodeRegExp?"u":"",{regExp:s}=r.code,n=s(o,i);return e.scopeValue("pattern",{key:n.toString(),ref:n,code:(0,t._)`${"new RegExp"===s.code?c:(0,a.useFunc)(e,s)}(${o}, ${i})`})},e.validateArray=function(e){let{gen:o,data:a,keyword:i,it:s}=e,n=o.name("valid");if(s.allErrors){let e=o.let("valid",!0);return l(()=>o.assign(e,!1)),e}return o.var(n,!0),l(()=>o.break()),n;function l(s){let l=o.const("len",(0,t._)`${a}.length`);o.forRange("i",0,l,a=>{e.subschema({keyword:i,dataProp:a,dataPropType:r.Type.Num},n),o.if((0,t.not)(n),s)})}},e.validateUnion=function(e){let{gen:o,schema:a,keyword:i,it:s}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(a.some(e=>(0,r.alwaysValidSchema)(s,e))&&!s.opts.unevaluated)return;let n=o.let("valid",!1),l=o.name("_valid");o.block(()=>a.forEach((r,a)=>{let s=e.subschema({keyword:i,schemaProp:a,compositeRule:!0},l);o.assign(n,(0,t._)`${n} || ${l}`),e.mergeValidEvaluated(s,l)||o.if((0,t.not)(n))})),e.result(n,()=>e.reset(),()=>e.error(!0))}}),lf=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=la(),r=ls(),o=lh(),a=ln();function i(e){let{gen:r,data:o,it:a}=e;r.if(a.parentData,()=>r.assign(o,(0,t._)`${a.parentData}[${a.parentDataProperty}]`))}function s(e,r,o){if(void 0===o)throw Error(`keyword "${r}" failed to compile`);return e.scopeValue("keyword","function"==typeof o?{ref:o}:{ref:o,code:(0,t.stringify)(o)})}e.macroKeywordCode=function(e,r){let{gen:o,keyword:a,schema:i,parentSchema:n,it:l}=e,c=r.macro.call(l.self,i,n,l),u=s(o,a,c);!1!==l.opts.validateSchema&&l.self.validateSchema(c,!0);let d=o.name("valid");e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${l.errSchemaPath}/${a}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,()=>e.error(!0))},e.funcKeywordCode=function(e,n){var l;let{gen:c,keyword:u,schema:d,parentSchema:p,$data:h,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}(f,n);let m=s(c,u,!h&&n.compile?n.compile.call(f.self,d,p,f):n.validate),y=c.let("valid");function g(a=n.async?(0,t._)`await `:t.nil){let i=f.opts.passContext?r.default.this:r.default.self,s=!("compile"in n&&!h||!1===n.schema);c.assign(y,(0,t._)`${a}${(0,o.callValidateCode)(e,m,i,s)}`,n.modifying)}function v(e){var r;c.if((0,t.not)(null!=(r=n.valid)?r:y),e)}e.block$data(y,function(){if(!1===n.errors)g(),n.modifying&&i(e),v(()=>e.error());else{let o,s,l=n.async?(o=c.let("ruleErrs",null),c.try(()=>g((0,t._)`await `),e=>c.assign(y,!1).if((0,t._)`${e} instanceof ${f.ValidationError}`,()=>c.assign(o,(0,t._)`${e}.errors`),()=>c.throw(e))),o):(s=(0,t._)`${m}.errors`,c.assign(s,null),g(t.nil),s);n.modifying&&i(e),v(()=>(function(e,o){let{gen:i}=e;i.if((0,t._)`Array.isArray(${o})`,()=>{i.assign(r.default.vErrors,(0,t._)`${r.default.vErrors} === null ? ${o} : ${r.default.vErrors}.concat(${o})`).assign(r.default.errors,(0,t._)`${r.default.vErrors}.length`),(0,a.extendErrors)(e)},()=>e.error())})(e,l))}}),e.ok(null!=(l=n.valid)?l:y)},e.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},e.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:o},a,i){if(Array.isArray(a.keyword)?!a.keyword.includes(i):a.keyword!==i)throw Error("ajv implementation error");let s=a.dependencies;if(null==s?void 0:s.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(a.validateSchema&&!a.validateSchema(e[i])){let e=`keyword "${i}" value is invalid at path "${o}": `+r.errorsText(a.validateSchema.errors);if("log"===t.validateSchema)r.logger.error(e);else throw Error(e)}}}),lm=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=la(),r=li();e.getSubschema=function(e,{keyword:o,schemaProp:a,schema:i,schemaPath:s,errSchemaPath:n,topSchemaRef:l}){if(void 0!==o&&void 0!==i)throw Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==o){let i=e.schema[o];return void 0===a?{schema:i,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(o)}`,errSchemaPath:`${e.errSchemaPath}/${o}`}:{schema:i[a],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(o)}${(0,t.getProperty)(a)}`,errSchemaPath:`${e.errSchemaPath}/${o}/${(0,r.escapeFragment)(a)}`}}if(void 0!==i){if(void 0===s||void 0===n||void 0===l)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:s,topSchemaRef:l,errSchemaPath:n}}throw Error('either "keyword" or "schema" must be passed')},e.extendSubschemaData=function(e,o,{dataProp:a,dataPropType:i,data:s,dataTypes:n,propertyName:l}){if(void 0!==s&&void 0!==a)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=o;if(void 0!==a){let{errorPath:s,dataPathArr:n,opts:l}=o;u(c.let("data",(0,t._)`${o.data}${(0,t.getProperty)(a)}`,!0)),e.errorPath=(0,t.str)`${s}${(0,r.getErrorPath)(a,i,l.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${a}`,e.dataPathArr=[...n,e.parentDataProperty]}function u(t){e.data=t,e.dataLevel=o.dataLevel+1,e.dataTypes=[],o.definedProperties=new Set,e.parentData=o.data,e.dataNames=[...o.dataNames,t]}void 0!==s&&(u(s instanceof t.Name?s:c.let("data",s,!0)),void 0!==l&&(e.propertyName=l)),n&&(e.dataTypes=n)},e.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:o,createErrors:a,allErrors:i}){void 0!==o&&(e.compositeRule=o),void 0!==a&&(e.createErrors=a),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}}),ly=B((e,t)=>{t.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)){if((o=t.length)!=r.length)return!1;for(a=o;0!=a--;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((o=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(a=o;0!=a--;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=o;0!=a--;){var o,a,i,s=i[a];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}}),lg=B((e,t)=>{var r=t.exports=function(e,t,o){"function"==typeof t&&(o=t,t={});var a="function"==typeof(o=t.cb||o)?o:o.pre||function(){};!function e(t,o,a,i,s,n,l,c,u,d){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var p in o(i,s,n,l,c,u,d),i){var h=i[p];if(Array.isArray(h)){if(p in r.arrayKeywords)for(var f=0;f<h.length;f++)e(t,o,a,h[f],s+"/"+p+"/"+f,n,s,p,i,f)}else if(p in r.propsKeywords){if(h&&"object"==typeof h)for(var m in h)e(t,o,a,h[m],s+"/"+p+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),n,s,p,i,m)}else(p in r.keywords||t.allKeys&&!(p in r.skipKeywords))&&e(t,o,a,h,s+"/"+p,n,s,p,i)}a(i,s,n,l,c,u,d)}}(t,a,o.post||function(){},e,"",e)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}}),lv=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=li(),r=ly(),o=lg(),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);e.inlineRef=function(e,r=!0){return"boolean"==typeof e||(!0===r?!function e(t){for(let r in t){if(i.has(r))return!0;let o=t[r];if(Array.isArray(o)&&o.some(e)||"object"==typeof o&&e(o))return!0}return!1}(e):!!r&&function e(r){let o=0;for(let i in r)if("$ref"===i||(o++,!a.has(i)&&("object"==typeof r[i]&&(0,t.eachItem)(r[i],t=>o+=e(t)),o===1/0)))return 1/0;return o}(e)<=r)};let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function s(e,t="",r){return!1!==r&&(t=c(t)),n(e,e.parse(t))}function n(e,t){return e.serialize(t).split("#")[0]+"#"}e.getFullPath=s,e._getFullPath=n;let l=/#\/?$/;function c(e){return e?e.replace(l,""):""}e.normalizeId=c,e.resolveUrl=function(e,t,r){return r=c(r),e.resolve(t,r)};let u=/^[a-z_][-a-z0-9._]*$/i;e.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};let{schemaId:a,uriResolver:i}=this.opts,n=c(e[a]||t),l={"":n},d=s(i,n,!1),p={},h=new Set;return o(e,{allKeys:!0},(e,t,r,o)=>{if(void 0===o)return;let i=d+t,s=l[o];function n(t){let r=this.opts.uriResolver.resolve;if(t=c(s?r(s,t):t),h.has(t))throw m(t);h.add(t);let o=this.refs[t];return"string"==typeof o&&(o=this.refs[o]),"object"==typeof o?f(e,o.schema,t):t!==c(i)&&("#"===t[0]?(f(e,p[t],t),p[t]=e):this.refs[t]=i),t}function y(e){if("string"==typeof e){if(!u.test(e))throw Error(`invalid anchor "${e}"`);n.call(this,`#${e}`)}}"string"==typeof e[a]&&(s=n.call(this,e[a])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),l[t]=s}),p;function f(e,t,o){if(void 0!==t&&!r(e,t))throw m(o)}function m(e){return Error(`reference "${e}" resolves to more than one schema`)}}}),lb=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=ll(),r=ld(),o=lu(),a=ld(),i=lp(),s=lf(),n=lm(),l=la(),c=ls(),u=lv(),d=li(),p=ln();function h({gen:e,validateName:t,schema:r,schemaEnv:o,opts:a},i){var s;a.code.es5?e.func(t,(0,l._)`${c.default.data}, ${c.default.valCxt}`,o.$async,()=>{var t,o;e.code((0,l._)`"use strict"; ${f(r,a)}`),t=e,o=a,t.if(c.default.valCxt,()=>{t.var(c.default.instancePath,(0,l._)`${c.default.valCxt}.${c.default.instancePath}`),t.var(c.default.parentData,(0,l._)`${c.default.valCxt}.${c.default.parentData}`),t.var(c.default.parentDataProperty,(0,l._)`${c.default.valCxt}.${c.default.parentDataProperty}`),t.var(c.default.rootData,(0,l._)`${c.default.valCxt}.${c.default.rootData}`),o.dynamicRef&&t.var(c.default.dynamicAnchors,(0,l._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{t.var(c.default.instancePath,(0,l._)`""`),t.var(c.default.parentData,(0,l._)`undefined`),t.var(c.default.parentDataProperty,(0,l._)`undefined`),t.var(c.default.rootData,c.default.data),o.dynamicRef&&t.var(c.default.dynamicAnchors,(0,l._)`{}`)}),e.code(i)}):e.func(t,(0,l._)`${c.default.data}, ${(s=a,(0,l._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${s.dynamicRef?(0,l._)`, ${c.default.dynamicAnchors}={}`:l.nil}}={}`)}`,o.$async,()=>e.code(f(r,a)).code(i))}function f(e,t){let r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,l._)`/*# sourceURL=${r} */`:l.nil}function m({schema:e,self:t}){if("boolean"==typeof e)return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function y(e){return"boolean"!=typeof e.schema}function g(e){(0,d.checkUnknownRules)(e),function(e){let{schema:t,errSchemaPath:r,opts:o,self:a}=e;t.$ref&&o.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,a.RULES)&&a.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function v(e,t){if(e.opts.jtd)return _(e,[],!1,t);let o=(0,r.getSchemaTypes)(e.schema);_(e,o,!(0,r.coerceAndCheckDataType)(e,o),t)}function b({gen:e,schemaEnv:t,schema:r,errSchemaPath:o,opts:a}){let i=r.$comment;if(!0===a.$comment)e.code((0,l._)`${c.default.self}.logger.log(${i})`);else if("function"==typeof a.$comment){let r=(0,l.str)`${o}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,l._)`${c.default.self}.opts.$comment(${i}, ${r}, ${a}.schema)`)}}function _(e,t,r,i){var s,n,u,p;let{gen:h,schema:f,data:m,allErrors:y,opts:g,self:v}=e,{RULES:b}=v;if(f.$ref&&(g.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(f,b)))return void h.block(()=>R(e,"$ref",b.all.$ref.definition));function _(s){(0,o.shouldUseGroup)(f,s)&&(s.type?(h.if((0,a.checkDataType)(s.type,m,g.strictNumbers)),S(e,s),1===t.length&&t[0]===s.type&&r&&(h.else(),(0,a.reportTypeError)(e)),h.endIf()):S(e,s),y||h.if((0,l._)`${c.default.errors} === ${i||0}`))}g.jtd||(s=e,n=t,!s.schemaEnv.meta&&s.opts.strictTypes&&(function(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{$(e.dataTypes,t)||w(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){let r=[];for(let o of e.dataTypes)$(t,o)?r.push(o):t.includes("integer")&&"number"===o&&r.push("integer");e.dataTypes=r}(e,t)}}(s,n),s.opts.allowUnionTypes||(u=s,(p=n).length>1&&!(2===p.length&&p.includes("null"))&&w(u,"use allowUnionTypes to allow union type keyword")),function(e,t){let r=e.self.RULES.all;for(let a in r){let i=r[a];if("object"==typeof i&&(0,o.shouldUseRule)(e.schema,i)){let{type:r}=i.definition;r.length&&!r.some(e=>{var r,o;return r=t,o=e,r.includes(o)||"number"===o&&r.includes("integer")})&&w(e,`missing type "${r.join(",")}" for keyword "${a}"`)}}}(s,s.dataTypes))),h.block(()=>{for(let e of b.rules)_(e);_(b.post)})}function S(e,t){let{gen:r,schema:a,opts:{useDefaults:s}}=e;s&&(0,i.assignDefaults)(e,t.type),r.block(()=>{for(let r of t.rules)(0,o.shouldUseRule)(a,r)&&R(e,r.keyword,r.definition,t.type)})}function $(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function w(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}e.validateFunctionCode=function(e){y(e)&&(g(e),m(e))?function(e){let{schema:t,opts:r,gen:o}=e;h(e,()=>{r.$comment&&t.$comment&&b(e),function(e){let{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,d.checkStrictMode)(e,"default is ignored in the schema root")}(e),o.let(c.default.vErrors,null),o.let(c.default.errors,0),r.unevaluated&&function(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,l._)`${r}.evaluated`),t.if((0,l._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,l._)`${e.evaluated}.props`,(0,l._)`undefined`)),t.if((0,l._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,l._)`${e.evaluated}.items`,(0,l._)`undefined`))}(e),v(e),function(e){let{gen:t,schemaEnv:r,validateName:o,ValidationError:a,opts:i}=e;r.$async?t.if((0,l._)`${c.default.errors} === 0`,()=>t.return(c.default.data),()=>t.throw((0,l._)`new ${a}(${c.default.vErrors})`)):(t.assign((0,l._)`${o}.errors`,c.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:r,items:o}){r instanceof l.Name&&e.assign((0,l._)`${t}.props`,r),o instanceof l.Name&&e.assign((0,l._)`${t}.items`,o)}(e),t.return((0,l._)`${c.default.errors} === 0`))}(e)})}(e):h(e,()=>(0,t.topBoolOrEmptySchema)(e))};var E=class{constructor(e,t,r){if((0,s.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",T(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",c.default.errors))}result(e,t,r){this.failResult((0,l.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,l.not)(e),void 0,t)}fail(e){if(void 0===e){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,l._)`${t} !== undefined && (${(0,l.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=l.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=l.nil,t=l.nil){if(!this.$data)return;let{gen:r,schemaCode:o,schemaType:a,def:i}=this;r.if((0,l.or)((0,l._)`${o} === undefined`,t)),e!==l.nil&&r.assign(e,!0),(a.length||i.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==l.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:o,it:i}=this;return(0,l.or)(function(){if(r.length){if(!(t instanceof l.Name))throw Error("ajv implementation error");let e=Array.isArray(r)?r:[r];return(0,l._)`${(0,a.checkDataTypes)(e,t,i.opts.strictNumbers,a.DataType.Wrong)}`}return l.nil}(),function(){if(o.validateSchema){let r=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,l._)`!${r}(${t})`}return l.nil}())}subschema(e,r){let o=(0,n.getSubschema)(this.it,e);(0,n.extendSubschemaData)(o,this.it,e),(0,n.extendSubschemaMode)(o,e);let a={...this.it,...o,items:void 0,props:void 0};return!function(e,r){if(y(e)&&(g(e),m(e)))return function(e,t){var r;let o,{schema:a,gen:i,opts:s}=e;s.$comment&&a.$comment&&b(e),(o=(r=e).schema[r.opts.schemaId])&&(r.baseId=(0,u.resolveUrl)(r.opts.uriResolver,r.baseId,o)),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}(e);let n=i.const("_errs",c.default.errors);v(e,n),i.var(t,(0,l._)`${n} === ${c.default.errors}`)}(e,r);(0,t.boolOrEmptySchema)(e,r)}(a,r),a}mergeEvaluated(e,t){let{it:r,gen:o}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=d.mergeEvaluated.props(o,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=d.mergeEvaluated.items(o,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:o}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return o.if(t,()=>this.mergeEvaluated(e,l.Name)),!0}};function R(e,t,r,o){let a=new E(e,r,t);"code"in r?r.code(a,o):a.$data&&r.validate?(0,s.funcKeywordCode)(a,r):"macro"in r?(0,s.macroKeywordCode)(a,r):(r.compile||r.validate)&&(0,s.funcKeywordCode)(a,r)}e.KeywordCxt=E;let P=/^\/(?:[^~]|~0|~1)*$/,k=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function T(e,{dataLevel:t,dataNames:r,dataPathArr:o}){let a,i;if(""===e)return c.default.rootData;if("/"===e[0]){if(!P.test(e))throw Error(`Invalid JSON-pointer: ${e}`);a=e,i=c.default.rootData}else{let s=k.exec(e);if(!s)throw Error(`Invalid JSON-pointer: ${e}`);let l=+s[1];if("#"===(a=s[2])){if(l>=t)throw Error(n("property/index",l));return o[t-l]}if(l>t)throw Error(n("data",l));if(i=r[t-l],!a)return i}let s=i;for(let e of a.split("/"))e&&(i=(0,l._)`${i}${(0,l.getProperty)((0,d.unescapeJsonPointer)(e))}`,s=(0,l._)`${s} && ${i}`);return s;function n(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}e.getData=T}),l_=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}}),lS=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lv();e.default=class extends Error{constructor(e,r,o,a){super(a||`can't resolve reference ${o} from id ${r}`),this.missingRef=(0,t.resolveUrl)(e,r,o),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}}),l$=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=la(),r=l_(),o=ls(),a=lv(),i=li(),s=lb();var n=class{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!=(t=e.baseId)?t:(0,a.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}};function l(e){let i,n,l=u.call(this,e);if(l)return l;let c=(0,a.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:d,lines:p}=this.opts.code,{ownProperties:h}=this.opts,f=new t.CodeGen(this.scope,{es5:d,lines:p,ownProperties:h});e.$async&&(i=f.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName("validate");e.validateName=m;let y={gen:f,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:c,baseId:e.baseId||c,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this};try{this._compilations.add(e),(0,s.validateFunctionCode)(y),f.optimize(this.opts.code.optimize);let r=f.toString();n=`${f.scopeRefs(o.default.scope)}return ${r}`,this.opts.code.process&&(n=this.opts.code.process(n,e));let a=Function(`${o.default.self}`,`${o.default.scope}`,n)(this,this.scope.get());if(this.scope.value(m,{ref:a}),a.errors=null,a.schema=e.schema,a.schemaEnv=e,e.$async&&(a.$async=!0),!0===this.opts.code.source&&(a.source={validateName:m,validateCode:r,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:r}=y;a.evaluated={props:e instanceof t.Name?void 0:e,items:r instanceof t.Name?void 0:r,dynamicProps:e instanceof t.Name,dynamicItems:r instanceof t.Name},a.source&&(a.source.evaluated=(0,t.stringify)(a.evaluated))}return e.validate=a,e}catch(t){throw delete e.validate,delete e.validateName,n&&this.logger.error("Error compiling schema, function code:",n),t}finally{this._compilations.delete(e)}}function c(e){return(0,a.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:l.call(this,e)}function u(e){for(let o of this._compilations){var t,r;if(t=o,r=e,t.schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return o}}function d(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||p.call(this,e,t)}function p(e,t){let r=this.opts.uriResolver.parse(t),o=(0,a._getFullPath)(this.opts.uriResolver,r),i=(0,a.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&o===i)return f.call(this,r,e);let s=(0,a.normalizeId)(o),c=this.refs[s]||this.schemas[s];if("string"==typeof c){let t=p.call(this,e,c);if("object"!=typeof(null==t?void 0:t.schema))return;return f.call(this,r,t)}if("object"==typeof(null==c?void 0:c.schema)){if(c.validate||l.call(this,c),s===(0,a.normalizeId)(t)){let{schema:t}=c,{schemaId:r}=this.opts,o=t[r];return o&&(i=(0,a.resolveUrl)(this.opts.uriResolver,i,o)),new n({schema:t,schemaId:r,root:e,baseId:i})}return f.call(this,r,c)}}e.SchemaEnv=n,e.compileSchema=l,e.resolveRef=function(e,t,r){var o;r=(0,a.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=d.call(this,e,r);if(void 0===s){let a=null==(o=e.localRefs)?void 0:o[r],{schemaId:i}=this.opts;a&&(s=new n({schema:a,schemaId:i,root:e,baseId:t}))}if(void 0!==s)return e.refs[r]=c.call(this,s)},e.getCompilingSchema=u,e.resolveSchema=p;let h=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function f(e,{baseId:t,schema:r,root:o}){var s;let l;if((null==(s=e.fragment)?void 0:s[0])!=="/")return;for(let o of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;let e=r[(0,i.unescapeFragment)(o)];if(void 0===e)return;let s="object"==typeof(r=e)&&r[this.opts.schemaId];!h.has(o)&&s&&(t=(0,a.resolveUrl)(this.opts.uriResolver,t,s))}if("boolean"!=typeof r&&r.$ref&&!(0,i.schemaHasRulesButRef)(r,this.RULES)){let e=(0,a.resolveUrl)(this.opts.uriResolver,t,r.$ref);l=p.call(this,o,e)}let{schemaId:c}=this.opts;if((l=l||new n({schema:r,schemaId:c,root:o,baseId:t})).schema!==l.root.schema)return l}}),lw=B((e,t)=>{t.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),lE=B((e,t)=>{let r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),o=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function a(e){let t="",r=0,o=0;for(o=0;o<e.length;o++)if(48!==(r=e[o].charCodeAt(0))){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[o];break}for(o+=1;o<e.length;o++){if(!((r=e[o].charCodeAt(0))>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[o]}return t}function i(e){return e.length=0,!0}function s(e,t,r){if(e.length){let o=a(e);if(""===o)return r.error=!0,!1;t.push(o),e.length=0}return!0}function n(e){if(2>function(e,t){let r=0;for(let t=0;t<e.length;t++)":"===e[t]&&r++;return r}(e,":"))return{host:e,isIPV6:!1};let t=function(e){let t=0,r={error:!1,address:"",zone:""},o=[],n=[],l=!1,c=!1,u=s;for(let a=0;a<e.length;a++){let s=e[a];if("["!==s&&"]"!==s)if(":"===s){if(!0===l&&(c=!0),!u(n,o,r))break;if(++t>7){r.error=!0;break}a>0&&":"===e[a-1]&&(l=!0),o.push(":");continue}else if("%"===s){if(!u(n,o,r))break;u=i}else{n.push(s);continue}}return n.length&&(u===i?r.zone=n.join(""):c?o.push(n.join("")):o.push(a(n))),r.address=o.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:r}}}t.exports={nonSimpleDomain:RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u),recomposeAuthority:function(e){let t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let r=unescape(e.host);if(!o(r)){let t=n(r);r=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(r)}return("number"==typeof e.port||"string"==typeof e.port)&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){let r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){let t=e,r=[],o=-1,a=0;for(;a=t.length;){if(1===a)if("."===t)break;else if("/"===t){r.push("/");break}else{r.push(t);break}if(2===a){if("."===t[0]){if("."===t[1])break;else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===a&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}else if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(o=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,o)),t=t.slice(o)}return r.join("")},isIPv4:o,isUUID:r,normalizeIPv6:n,stringArrayToHexStripped:a}}),lR=B((e,t)=>{let{isUUID:r}=lE(),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,a=["http","https","ws","wss","urn","urn:uuid"];function i(e){return!0===e.secure||!1!==e.secure&&!!e.scheme&&3===e.scheme.length&&("w"===e.scheme[0]||"W"===e.scheme[0])&&("s"===e.scheme[1]||"S"===e.scheme[1])&&("s"===e.scheme[2]||"S"===e.scheme[2])}function s(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function n(e){let t="https"===String(e.scheme).toLowerCase();return(e.port===(t?443:80)||""===e.port)&&(e.port=void 0),e.path||(e.path="/"),e}let l={scheme:"http",domainHost:!0,parse:s,serialize:n},c={scheme:"https",domainHost:l.domainHost,parse:s,serialize:n},u={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=i(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if((e.port===(i(e)?443:80)||""===e.port)&&(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},d={scheme:"wss",domainHost:u.domainHost,parse:u.parse,serialize:u.serialize},p={http:l,https:c,ws:u,wss:d,urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(o);if(r){let o=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let a=h(`${o}:${t.nid||e.nid}`);e.path=void 0,a&&(e=a.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){if(void 0===e.nid)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",o=e.nid.toLowerCase(),a=h(`${r}:${t.nid||o}`);a&&(e=a.serialize(e,t));let i=e,s=e.nss;return i.path=`${o||t.nid}:${s}`,t.skipEscape=!0,i},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){return e.uuid=e.nss,e.nss=void 0,t.tolerant||e.uuid&&r(e.uuid)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e){return e.nss=(e.uuid||"").toLowerCase(),e},skipNormalize:!0}};function h(e){return e&&(p[e]||p[e.toLowerCase()])||void 0}Object.setPrototypeOf(p,null),t.exports={wsIsSecure:i,SCHEMES:p,isValidSchemeName:function(e){return -1!==a.indexOf(e)},getSchemeHandler:h}}),lP=B((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:a,normalizeComponentEncoding:i,isIPv4:s,nonSimpleDomain:n}=lE(),{SCHEMES:l,getSchemeHandler:c}=lR();function u(e,t,r,a){let i={};return a||(e=h(d(e,r),r),t=h(d(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(t.path?("/"===t.path[0]?i.path=o(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=o(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function d(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},i=Object.assign({},t),s=[],n=c(i.scheme||r.scheme);n&&n.serialize&&n.serialize(r,i),void 0!==r.path&&(i.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==i.reference&&r.scheme&&s.push(r.scheme,":");let l=a(r);if(void 0!==l&&("suffix"!==i.reference&&s.push("//"),s.push(l),r.path&&"/"!==r.path[0]&&s.push("/")),void 0!==r.path){let e=r.path;i.absolutePath||n&&n.absolutePath||(e=o(e)),void 0===l&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),s.push(e)}return void 0!==r.query&&s.push("?",r.query),void 0!==r.fragment&&s.push("#",r.fragment),s.join("")}let p=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function h(e,t){let o=Object.assign({},t),a={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;"suffix"===o.reference&&(e=o.scheme?o.scheme+":"+e:"//"+e);let l=e.match(p);if(l){if(a.scheme=l[1],a.userinfo=l[3],a.host=l[4],a.port=parseInt(l[5],10),a.path=l[6]||"",a.query=l[7],a.fragment=l[8],isNaN(a.port)&&(a.port=l[5]),a.host)if(!1===s(a.host)){let e=r(a.host);a.host=e.host.toLowerCase(),i=e.isIPV6}else i=!0;void 0!==a.scheme||void 0!==a.userinfo||void 0!==a.host||void 0!==a.port||void 0!==a.query||a.path?void 0===a.scheme?a.reference="relative":void 0===a.fragment?a.reference="absolute":a.reference="uri":a.reference="same-document",o.reference&&"suffix"!==o.reference&&o.reference!==a.reference&&(a.error=a.error||"URI is not a "+o.reference+" reference.");let t=c(o.scheme||a.scheme);if(!o.unicodeSupport&&(!t||!t.unicodeSupport)&&a.host&&(o.domainHost||t&&t.domainHost)&&!1===i&&n(a.host))try{a.host=URL.domainToASCII(a.host.toLowerCase())}catch(e){a.error=a.error||"Host's domain name can not be converted to ASCII: "+e}(!t||t&&!t.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==a.scheme&&(a.scheme=unescape(a.scheme)),void 0!==a.host&&(a.host=unescape(a.host))),a.path&&(a.path=escape(unescape(a.path))),a.fragment&&(a.fragment=encodeURI(decodeURIComponent(a.fragment)))),t&&t.parse&&t.parse(a,o)}else a.error=a.error||"URI can not be parsed.";return a}let f={SCHEMES:l,normalize:function(e,t){return"string"==typeof e?e=d(h(e,t),t):"object"==typeof e&&(e=h(d(e,t),t)),e},resolve:function(e,t,r){let o=r?Object.assign({scheme:"null"},r):{scheme:"null"},a=u(h(e,o),h(t,o),o,!0);return o.skipEscape=!0,d(a,o)},resolveComponent:u,equal:function(e,t,r){return"string"==typeof e?e=d(i(h(e=unescape(e),r),!0),{...r,skipEscape:!0}):"object"==typeof e&&(e=d(i(e,!0),{...r,skipEscape:!0})),"string"==typeof t?t=d(i(h(t=unescape(t),r),!0),{...r,skipEscape:!0}):"object"==typeof t&&(t=d(i(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:d,parse:h};t.exports=f,t.exports.default=f,t.exports.fastUri=f}),lk=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lP();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),lT=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=lb();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=la();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});let o=l_(),a=lS(),i=lc(),s=l$(),n=la(),l=lv(),c=ld(),u=li(),d=lw(),p=lk(),h=(e,t)=>new RegExp(e,t);h.code="new RegExp";let f=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};var v=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...function(e){var t,r,o,a,i,s,n,l,c,u,d,f,m,y,g,v,b,_,S,$,w,E,R,P,k;let T=e.strict,O=null==(t=e.code)?void 0:t.optimize,x=!0===O||void 0===O?1:O||0,j=null!=(o=null==(r=e.code)?void 0:r.regExp)?o:h,C=null!=(a=e.uriResolver)?a:p.default;return{strictSchema:null==(s=null!=(i=e.strictSchema)?i:T)||s,strictNumbers:null==(l=null!=(n=e.strictNumbers)?n:T)||l,strictTypes:null!=(u=null!=(c=e.strictTypes)?c:T)?u:"log",strictTuples:null!=(f=null!=(d=e.strictTuples)?d:T)?f:"log",strictRequired:null!=(y=null!=(m=e.strictRequired)?m:T)&&y,code:e.code?{...e.code,optimize:x,regExp:j}:{optimize:x,regExp:j},loopRequired:null!=(g=e.loopRequired)?g:200,loopEnum:null!=(v=e.loopEnum)?v:200,meta:null==(b=e.meta)||b,messages:null==(_=e.messages)||_,inlineRefs:null==(S=e.inlineRefs)||S,schemaId:null!=($=e.schemaId)?$:"$id",addUsedSchema:null==(w=e.addUsedSchema)||w,validateSchema:null==(E=e.validateSchema)||E,validateFormats:null==(R=e.validateFormats)||R,unicodeRegExp:null==(P=e.unicodeRegExp)||P,int32range:null==(k=e.int32range)||k,uriResolver:C}}(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new n.ValueScope({scope:{},prefixes:m,es5:t,lines:r}),this.logger=function(e){if(!1===e)return R;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}(e.logger);const o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),b.call(this,y,e,"NOT SUPPORTED"),b.call(this,g,e,"DEPRECATED","warn"),this._metaOpts=E.call(this),e.formats&&$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&w.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),S.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,o=d;"id"===r&&((o={...d}).id=o.$id,delete o.$id),t&&e&&this.addMetaSchema(o,o[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let o=r(t);return"$async"in r||(this.errors=r.errors),o}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return o.call(this,e,t);async function o(e,t){await i.call(this,e.$schema);let r=this._addSchema(e,t);return r.validate||s.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await o.call(this,{$ref:e},!0)}async function s(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return n.call(this,t),await l.call(this,t.missingSchema),s.call(this,e)}}function n({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){let r=await c.call(this,e);this.refs[e]||await i.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function c(e){let t=this._loading[e];if(t)return t;try{return await (this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,o=this.opts.validateSchema){let a;if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,r,o);return this}if("object"==typeof e){let{schemaId:t}=this.opts;if(void 0!==(a=e[t])&&"string"!=typeof a)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||a),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,o,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){let r;if("boolean"==typeof e)return!0;if(void 0!==(r=e.$schema)&&"string"!=typeof r)throw Error("$schema must be a string");if(!(r=r||this.opts.defaultMeta||this.defaultMeta()))return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(r,e);if(!o&&t){let e="schema is invalid: "+this.errorsText();if("log"===this.opts.validateSchema)this.logger.error(e);else throw Error(e)}return o}getSchema(e){let t;for(;"string"==typeof(t=_.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,o=new s.SchemaEnv({schema:{},schemaId:r});if(!(t=s.resolveSchema.call(this,o,e)))return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=_.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{this._cache.delete(e);let t=e[this.opts.schemaId];return t&&(t=(0,l.normalizeId)(t),delete this.schemas[t],delete this.refs[t]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else if("object"==typeof e&&void 0===t){if(Array.isArray(r=(t=e).keyword)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(k.call(this,r,t),!t)return(0,u.eachItem)(r,e=>T.call(this,e)),this;x.call(this,t);let o={...t,type:(0,c.getJSONTypes)(t.type),schemaType:(0,c.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(r,0===o.type.length?e=>T.call(this,e,o):e=>o.type.forEach(t=>T.call(this,e,o,t))),this}getKeyword(e){let t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;for(let r of(delete t.keywords[e],delete t.all[e],t.rules)){let t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){let r=this.RULES.all;for(let o of(e=JSON.parse(JSON.stringify(e)),t)){let t=o.split("/").slice(1),a=e;for(let e of t)a=a[e];for(let e in r){let t=r[e];if("object"!=typeof t)continue;let{$data:o}=t.definition,i=a[e];o&&i&&(a[e]=C(i))}}return e}_removeAllSchemas(e,t){for(let r in e){let o=e[r];(!t||t.test(r))&&("string"==typeof o?delete e[r]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[r]))}}_addSchema(e,t,r,o=this.opts.validateSchema,a=this.opts.addUsedSchema){let i,{schemaId:n}=this.opts;if("object"==typeof e)i=e[n];else if(this.opts.jtd)throw Error("schema must be object");else if("boolean"!=typeof e)throw Error("schema must be object or boolean");let c=this._cache.get(e);if(void 0!==c)return c;r=(0,l.normalizeId)(i||r);let u=l.getSchemaRefs.call(this,e,r);return c=new s.SchemaEnv({schema:e,schemaId:n,meta:t,baseId:r,localRefs:u}),this._cache.set(c.schema,c),a&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=c),o&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}};function b(e,t,r,o="error"){for(let a in e)a in t&&this.logger[o](`${r}: option ${a}. ${e[a]}`)}function _(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function S(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function $(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function w(e){if(Array.isArray(e))return void this.addVocabulary(e);for(let t in this.logger.warn("keywords option as map is deprecated, pass array"),e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function E(){let e={...this.opts};for(let t of f)delete e[t];return e}v.ValidationError=o.default,v.MissingRefError=a.default,e.default=v;let R={log(){},warn(){},error(){}},P=/^[a-z_$][a-z0-9_$:-]*$/i;function k(e,t){let{RULES:r}=this;if((0,u.eachItem)(e,e=>{if(r.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!P.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t||"validate"in t))throw Error('$data keyword must have "code" or "validate" function')}function T(e,t,r){var o;let a=null==t?void 0:t.post;if(r&&a)throw Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=a?i.post:i.rules.find(({type:e})=>e===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;let n={keyword:e,definition:{...t,type:(0,c.getJSONTypes)(t.type),schemaType:(0,c.getJSONTypes)(t.schemaType)}};t.before?O.call(this,s,n,t.before):s.rules.push(n),i.all[e]=n,null==(o=t.implements)||o.forEach(e=>this.addKeyword(e))}function O(e,t,r){let o=e.rules.findIndex(e=>e.keyword===r);o>=0?e.rules.splice(o,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function x(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=C(t)),e.validateSchema=this.compile(t,!0))}let j={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function C(e){return{anyOf:[e,j]}}}),lO=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}}),lx=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=lS(),r=lh(),o=la(),a=ls(),i=l$(),s=li();function n(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,o._)`${r.scopeValue("wrapper",{ref:t})}.validate`}function l(e,t,i,n){let{gen:l,it:c}=e,{allErrors:u,schemaEnv:d,opts:p}=c,h=p.passContext?a.default.this:o.nil;function f(e){let t=(0,o._)`${e}.errors`;l.assign(a.default.vErrors,(0,o._)`${a.default.vErrors} === null ? ${t} : ${a.default.vErrors}.concat(${t})`),l.assign(a.default.errors,(0,o._)`${a.default.vErrors}.length`)}function m(e){var t;if(!c.opts.unevaluated)return;let r=null==(t=null==i?void 0:i.validate)?void 0:t.evaluated;if(!0!==c.props)if(r&&!r.dynamicProps)void 0!==r.props&&(c.props=s.mergeEvaluated.props(l,r.props,c.props));else{let t=l.var("props",(0,o._)`${e}.evaluated.props`);c.props=s.mergeEvaluated.props(l,t,c.props,o.Name)}if(!0!==c.items)if(r&&!r.dynamicItems)void 0!==r.items&&(c.items=s.mergeEvaluated.items(l,r.items,c.items));else{let t=l.var("items",(0,o._)`${e}.evaluated.items`);c.items=s.mergeEvaluated.items(l,t,c.items,o.Name)}}n?function(){if(!d.$async)throw Error("async schema referenced by sync schema");let a=l.let("valid");l.try(()=>{l.code((0,o._)`await ${(0,r.callValidateCode)(e,t,h)}`),m(t),u||l.assign(a,!0)},e=>{l.if((0,o._)`!(${e} instanceof ${c.ValidationError})`,()=>l.throw(e)),f(e),u||l.assign(a,!1)}),e.ok(a)}():e.result((0,r.callValidateCode)(e,t,h),()=>m(t),()=>f(t))}e.getValidate=n,e.callRef=l,e.default={keyword:"$ref",schemaType:"string",code(e){var r,a;let s,c,u,{gen:d,schema:p,it:h}=e,{baseId:f,schemaEnv:m,validateName:y,opts:g,self:v}=h,{root:b}=m;if(("#"===p||"#/"===p)&&f===b.baseId){if(m===b)return l(e,y,m,m.$async);let t=d.scopeValue("root",{ref:b});return l(e,(0,o._)`${t}.validate`,b,b.$async)}let _=i.resolveRef.call(v,b,f,p);if(void 0===_)throw new t.default(h.opts.uriResolver,f,p);return _ instanceof i.SchemaEnv?void l(e,n(e,r=_),r,r.$async):(a=_,s=d.scopeValue("schema",!0===g.code.source?{ref:a,code:(0,o.stringify)(a)}:{ref:a}),c=d.name("valid"),u=e.subschema({schema:a,dataTypes:[],schemaPath:o.nil,topSchemaRef:s,errSchemaPath:p},c),void(e.mergeEvaluated(u),e.ok(c)))}}}),lj=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lO(),r=lx();e.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default]}),lC=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la(),r=t.operators,o={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}};e.default={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must be ${o[e].okStr} ${r}`,params:({keyword:e,schemaCode:r})=>(0,t._)`{comparison: ${o[e].okStr}, limit: ${r}}`},code(e){let{keyword:r,data:a,schemaCode:i}=e;e.fail$data((0,t._)`${a} ${o[r].fail} ${i} || isNaN(${a})`)}}}),lN=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la();e.default={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:r,data:o,schemaCode:a,it:i}=e,s=i.opts.multipleOfPrecision,n=r.let("res"),l=s?(0,t._)`Math.abs(Math.round(${n}) - ${n}) > 1e-${s}`:(0,t._)`${n} !== parseInt(${n})`;e.fail$data((0,t._)`(${a} === 0 || (${n} = ${o}/${a}, ${l}))`)}}}),lI=B(e=>{function t(e){let t,r=e.length,o=0,a=0;for(;a<r;)o++,(t=e.charCodeAt(a++))>=55296&&t<=56319&&a<r&&(64512&(t=e.charCodeAt(a)))==56320&&a++;return o}Object.defineProperty(e,"__esModule",{value:!0}),e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'}),lA=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la(),r=li(),o=lI();e.default={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must NOT have ${"maxLength"===e?"more":"fewer"} than ${r} characters`,params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:a,data:i,schemaCode:s,it:n}=e,l="maxLength"===a?t.operators.GT:t.operators.LT,c=!1===n.opts.unicode?(0,t._)`${i}.length`:(0,t._)`${(0,r.useFunc)(e.gen,o.default)}(${i})`;e.fail$data((0,t._)`${c} ${l} ${s}`)}}}),lM=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lh(),r=li(),o=la();e.default={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,o.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,o._)`{pattern: ${e}}`},code(e){let{gen:a,data:i,$data:s,schema:n,schemaCode:l,it:c}=e,u=c.opts.unicodeRegExp?"u":"";if(s){let{regExp:t}=c.opts.code,s="new RegExp"===t.code?(0,o._)`new RegExp`:(0,r.useFunc)(a,t),n=a.let("valid");a.try(()=>a.assign(n,(0,o._)`${s}(${l}, ${u}).test(${i})`),()=>a.assign(n,!1)),e.fail$data((0,o._)`!${n}`)}else{let r=(0,t.usePattern)(e,n);e.fail$data((0,o._)`!${r}.test(${i})`)}}}}),lq=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la();e.default={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${r} properties`,params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:r,data:o,schemaCode:a}=e,i="maxProperties"===r?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${o}).length ${i} ${a}`)}}}),lz=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lh(),r=la(),o=li();e.default={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>(0,r.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,r._)`{missingProperty: ${e}}`},code(e){let{gen:a,schema:i,schemaCode:s,data:n,$data:l,it:c}=e,{opts:u}=c;if(!l&&0===i.length)return;let d=i.length>=u.loopRequired;if(c.allErrors?function(){if(d||l)e.block$data(r.nil,p);else for(let r of i)(0,t.checkReportMissingProp)(e,r)}():function(){let o=a.let("missing");if(d||l){let i=a.let("valid",!0);e.block$data(i,()=>{var l,c;return l=o,c=i,void(e.setParams({missingProperty:l}),a.forOf(l,s,()=>{a.assign(c,(0,t.propertyInData)(a,n,l,u.ownProperties)),a.if((0,r.not)(c),()=>{e.error(),a.break()})},r.nil))}),e.ok(i)}else a.if((0,t.checkMissingProp)(e,i,o)),(0,t.reportMissingProp)(e,o),a.else()}(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:r}=e.it;for(let e of i)if((null==t?void 0:t[e])===void 0&&!r.has(e)){let t=`required property "${e}" is not defined at "${c.schemaEnv.baseId+c.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(c,t,c.opts.strictRequired)}}function p(){a.forOf("prop",s,r=>{e.setParams({missingProperty:r}),a.if((0,t.noPropertyInData)(a,n,r,u.ownProperties),()=>e.error())})}}}}),lL=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la();e.default={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must NOT have ${"maxItems"===e?"more":"fewer"} than ${r} items`,params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:r,data:o,schemaCode:a}=e,i="maxItems"===r?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${o}.length ${i} ${a}`)}}}),lD=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ly();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),lU=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ld(),r=la(),o=li(),a=lD();e.default={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>(0,r.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,r._)`{i: ${e}, j: ${t}}`},code(e){let{gen:i,data:s,$data:n,schema:l,parentSchema:c,schemaCode:u,it:d}=e;if(!n&&!l)return;let p=i.let("valid"),h=c.items?(0,t.getSchemaTypes)(c.items):[];e.block$data(p,function(){let n=i.let("i",(0,r._)`${s}.length`),l=i.let("j");e.setParams({i:n,j:l}),i.assign(p,!0),i.if((0,r._)`${n} > 1`,()=>(h.length>0&&!h.some(e=>"object"===e||"array"===e)?function(o,a){let n=i.name("item"),l=(0,t.checkDataTypes)(h,n,d.opts.strictNumbers,t.DataType.Wrong),c=i.const("indices",(0,r._)`{}`);i.for((0,r._)`;${o}--;`,()=>{i.let(n,(0,r._)`${s}[${o}]`),i.if(l,(0,r._)`continue`),h.length>1&&i.if((0,r._)`typeof ${n} == "string"`,(0,r._)`${n} += "_"`),i.if((0,r._)`typeof ${c}[${n}] == "number"`,()=>{i.assign(a,(0,r._)`${c}[${n}]`),e.error(),i.assign(p,!1).break()}).code((0,r._)`${c}[${n}] = ${o}`)})}:function(t,n){let l=(0,o.useFunc)(i,a.default),c=i.name("outer");i.label(c).for((0,r._)`;${t}--;`,()=>i.for((0,r._)`${n} = ${t}; ${n}--;`,()=>i.if((0,r._)`${l}(${s}[${t}], ${s}[${n}])`,()=>{e.error(),i.assign(p,!1).break(c)})))})(n,l))},(0,r._)`${u} === false`),e.ok(p)}}}),lV=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la(),r=li(),o=lD();e.default={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:a,data:i,$data:s,schemaCode:n,schema:l}=e;s||l&&"object"==typeof l?e.fail$data((0,t._)`!${(0,r.useFunc)(a,o.default)}(${i}, ${n})`):e.fail((0,t._)`${l} !== ${i}`)}}}),lF=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la(),r=li(),o=lD();e.default={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let a,i,{gen:s,data:n,$data:l,schema:c,schemaCode:u,it:d}=e;if(!l&&0===c.length)throw Error("enum must have non-empty array");let p=c.length>=d.opts.loopEnum,h=()=>null!=a?a:a=(0,r.useFunc)(s,o.default);if(p||l)i=s.let("valid"),e.block$data(i,function(){s.assign(i,!1),s.forOf("v",u,e=>s.if((0,t._)`${h()}(${n}, ${e})`,()=>s.assign(i,!0).break()))});else{if(!Array.isArray(c))throw Error("ajv implementation error");let e=s.const("vSchema",u);i=(0,t.or)(...c.map((r,o)=>{var a,i;let s;return a=e,"object"==typeof(s=c[i=o])&&null!==s?(0,t._)`${h()}(${n}, ${a}[${i}])`:(0,t._)`${n} === ${s}`}))}e.pass(i)}}}),lH=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lC(),r=lN(),o=lA(),a=lM(),i=lq(),s=lz(),n=lL(),l=lU(),c=lV(),u=lF();e.default=[t.default,r.default,o.default,a.default,i.default,s.default,n.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,u.default]}),lK=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=la(),r=li();function o(e,o){let{gen:a,schema:i,data:s,keyword:n,it:l}=e;l.items=!0;let c=a.const("len",(0,t._)`${s}.length`);if(!1===i)e.setParams({len:o.length}),e.pass((0,t._)`${c} <= ${o.length}`);else if("object"==typeof i&&!(0,r.alwaysValidSchema)(l,i)){let i=a.var("valid",(0,t._)`${c} <= ${o.length}`);a.if((0,t.not)(i),()=>{var s;return s=i,void a.forRange("i",o.length,c,o=>{e.subschema({keyword:n,dataProp:o,dataPropType:r.Type.Num},s),l.allErrors||a.if((0,t.not)(s),()=>a.break())})}),e.ok(i)}}e.validateAdditionalItems=o,e.default={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:a}=e,{items:i}=t;Array.isArray(i)?o(e,i):(0,r.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas')}}}),lJ=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=la(),r=li(),o=lh();function a(e,o,i=e.schema){let{gen:s,parentSchema:n,data:l,keyword:c,it:u}=e;(function(e){let{opts:t,errSchemaPath:a}=u,s=i.length,n=s===e.minItems&&(s===e.maxItems||!1===e[o]);if(t.strictTuples&&!n){let e=`"${c}" is ${s}-tuple, but minItems or maxItems/${o} are not specified or different at path "${a}"`;(0,r.checkStrictMode)(u,e,t.strictTuples)}})(n),u.opts.unevaluated&&i.length&&!0!==u.items&&(u.items=r.mergeEvaluated.items(s,i.length,u.items));let d=s.name("valid"),p=s.const("len",(0,t._)`${l}.length`);i.forEach((o,a)=>{(0,r.alwaysValidSchema)(u,o)||(s.if((0,t._)`${p} > ${a}`,()=>e.subschema({keyword:c,schemaProp:a,dataProp:a},d)),e.ok(d))})}e.validateTuple=a,e.default={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,"additionalItems",t);i.items=!0,(0,r.alwaysValidSchema)(i,t)||e.ok((0,o.validateArray)(e))}}}),lB=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lJ();e.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,t.validateTuple)(e,"items")}}),lG=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la(),r=li(),o=lh(),a=lK();e.default={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:i,it:s}=e,{prefixItems:n}=i;s.items=!0,(0,r.alwaysValidSchema)(s,t)||(n?(0,a.validateAdditionalItems)(e,n):e.ok((0,o.validateArray)(e)))}}}),lZ=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la(),r=li();e.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:r}})=>void 0===r?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${r} valid item(s)`,params:({params:{min:e,max:r}})=>void 0===r?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${r}}`},code(e){let o,a,{gen:i,schema:s,parentSchema:n,data:l,it:c}=e,{minContains:u,maxContains:d}=n;c.opts.next?(o=void 0===u?1:u,a=d):o=1;let p=i.const("len",(0,t._)`${l}.length`);if(e.setParams({min:o,max:a}),void 0===a&&0===o)return void(0,r.checkStrictMode)(c,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==a&&o>a){(0,r.checkStrictMode)(c,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,r.alwaysValidSchema)(c,s)){let r=(0,t._)`${p} >= ${o}`;void 0!==a&&(r=(0,t._)`${r} && ${p} <= ${a}`),e.pass(r);return}c.items=!0;let h=i.name("valid");function f(){let e=i.name("_valid"),r=i.let("count",0);m(e,()=>i.if(e,()=>{var e;return e=r,void(i.code((0,t._)`${e}++`),void 0===a?i.if((0,t._)`${e} >= ${o}`,()=>i.assign(h,!0).break()):(i.if((0,t._)`${e} > ${a}`,()=>i.assign(h,!1).break()),1===o?i.assign(h,!0):i.if((0,t._)`${e} >= ${o}`,()=>i.assign(h,!0))))}))}function m(t,o){i.forRange("i",0,p,a=>{e.subschema({keyword:"contains",dataProp:a,dataPropType:r.Type.Num,compositeRule:!0},t),o()})}void 0===a&&1===o?m(h,()=>i.if(h,()=>i.break())):0===o?(i.let(h,!0),void 0!==a&&i.if((0,t._)`${l}.length > 0`,f)):(i.let(h,!1),f()),e.result(h,()=>e.reset())}}}),lW=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=la(),r=li(),o=lh();e.error={message:({params:{property:e,depsCount:r,deps:o}})=>(0,t.str)`must have ${1===r?"property":"properties"} ${o} when property ${e} is present`,params:({params:{property:e,depsCount:r,deps:o,missingProperty:a}})=>(0,t._)`{property: ${e},
|
|
66
|
-
missingProperty: ${
|
|
67
|
-
depsCount: ${
|
|
68
|
-
deps: ${o}}`};let a={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){let[t,r]=function({schema:e}){let t={},r={};for(let o in e)"__proto__"!==o&&((Array.isArray(e[o])?t:r)[o]=e[o]);return[t,r]}(e);i(e,t),s(e,r)}};function i(e,r=e.schema){let{gen:a,data:s,it:n}=e;if(0===Object.keys(r).length)return;let l=a.let("missing");for(let i in r){let c=r[i];if(0===c.length)continue;let u=(0,o.propertyInData)(a,s,i,n.opts.ownProperties);e.setParams({property:i,depsCount:c.length,deps:c.join(", ")}),n.allErrors?a.if(u,()=>{for(let t of c)(0,o.checkReportMissingProp)(e,t)}):(a.if((0,t._)`${u} && (${(0,o.checkMissingProp)(e,c,l)})`),(0,o.reportMissingProp)(e,l),a.else())}}function s(e,t=e.schema){let{gen:a,data:i,keyword:n,it:l}=e,c=a.name("valid");for(let s in t)(0,r.alwaysValidSchema)(l,t[s])||(a.if((0,o.propertyInData)(a,i,s,l.opts.ownProperties),()=>{let t=e.subschema({keyword:n,schemaProp:s},c);e.mergeValidEvaluated(t,c)},()=>a.var(c,!0)),e.ok(c))}e.validatePropertyDeps=i,e.validateSchemaDeps=s,e.default=a}),lX=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la(),r=li();e.default={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:o,schema:a,data:i,it:s}=e;if((0,r.alwaysValidSchema)(s,a))return;let n=o.name("valid");o.forIn("key",i,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},n),o.if((0,t.not)(n),()=>{e.error(!0),s.allErrors||o.break()})}),e.ok(n)}}}),lY=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lh(),r=la(),o=ls(),a=li();e.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>(0,r._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:i,schema:s,parentSchema:n,data:l,errsCount:c,it:u}=e;if(!c)throw Error("ajv implementation error");let{allErrors:d,opts:p}=u;if(u.props=!0,"all"!==p.removeAdditional&&(0,a.alwaysValidSchema)(u,s))return;let h=(0,t.allSchemaProperties)(n.properties),f=(0,t.allSchemaProperties)(n.patternProperties);function m(e){i.code((0,r._)`delete ${l}[${e}]`)}function y(t){if("all"===p.removeAdditional||p.removeAdditional&&!1===s)return void m(t);if(!1===s){e.setParams({additionalProperty:t}),e.error(),d||i.break();return}if("object"==typeof s&&!(0,a.alwaysValidSchema)(u,s)){let o=i.name("valid");"failing"===p.removeAdditional?(g(t,o,!1),i.if((0,r.not)(o),()=>{e.reset(),m(t)})):(g(t,o),d||i.if((0,r.not)(o),()=>i.break()))}}function g(t,r,o){let i={keyword:"additionalProperties",dataProp:t,dataPropType:a.Type.Str};!1===o&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}i.forIn("key",l,o=>{h.length||f.length?i.if(function(o){let s;if(h.length>8){let e=(0,a.schemaRefOrVal)(u,n.properties,"properties");s=(0,t.isOwnProperty)(i,e,o)}else s=h.length?(0,r.or)(...h.map(e=>(0,r._)`${o} === ${e}`)):r.nil;return f.length&&(s=(0,r.or)(s,...f.map(a=>(0,r._)`${(0,t.usePattern)(e,a)}.test(${o})`))),(0,r.not)(s)}(o),()=>y(o)):y(o)}),e.ok((0,r._)`${c} === ${o.default.errors}`)}}}),lQ=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lb(),r=lh(),o=li(),a=lY();e.default={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:i,schema:s,parentSchema:n,data:l,it:c}=e;"all"===c.opts.removeAdditional&&void 0===n.additionalProperties&&a.default.code(new t.KeywordCxt(c,a.default,"additionalProperties"));let u=(0,r.allSchemaProperties)(s);for(let e of u)c.definedProperties.add(e);c.opts.unevaluated&&u.length&&!0!==c.props&&(c.props=o.mergeEvaluated.props(i,(0,o.toHash)(u),c.props));let d=u.filter(e=>!(0,o.alwaysValidSchema)(c,s[e]));if(0===d.length)return;let p=i.name("valid");for(let t of d){var h;(h=t,c.opts.useDefaults&&!c.compositeRule&&void 0!==s[h].default)?f(t):(i.if((0,r.propertyInData)(i,l,t,c.opts.ownProperties)),f(t),c.allErrors||i.else().var(p,!0),i.endIf()),e.it.definedProperties.add(t),e.ok(p)}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}}}),l0=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lh(),r=la(),o=li(),a=li();e.default={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:i,schema:s,data:n,parentSchema:l,it:c}=e,{opts:u}=c,d=(0,t.allSchemaProperties)(s),p=d.filter(e=>(0,o.alwaysValidSchema)(c,s[e]));if(0===d.length||p.length===d.length&&(!c.opts.unevaluated||!0===c.props))return;let h=u.strictSchema&&!u.allowMatchingProperties&&l.properties,f=i.name("valid");!0===c.props||c.props instanceof r.Name||(c.props=(0,a.evaluatedPropsToName)(i,c.props));let{props:m}=c;for(let e of d)h&&function(e){for(let t in h)new RegExp(e).test(t)&&(0,o.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}(e),c.allErrors?y(e):(i.var(f,!0),y(e),i.if(f));function y(o){i.forIn("key",n,s=>{i.if((0,r._)`${(0,t.usePattern)(e,o)}.test(${s})`,()=>{let t=p.includes(o);t||e.subschema({keyword:"patternProperties",schemaProp:o,dataProp:s,dataPropType:a.Type.Str},f),c.opts.unevaluated&&!0!==m?i.assign((0,r._)`${m}[${s}]`,!0):t||c.allErrors||i.if((0,r.not)(f),()=>i.break())})})}}}}),l1=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=li();e.default={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:r,schema:o,it:a}=e;if((0,t.alwaysValidSchema)(a,o))return void e.fail();let i=r.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}}}),l2=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:lh().validateUnion,error:{message:"must match a schema in anyOf"}}}),l9=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la(),r=li();e.default={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:o,schema:a,parentSchema:i,it:s}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;let n=o.let("valid",!1),l=o.let("passing",null),c=o.name("_valid");e.setParams({passing:l}),o.block(function(){a.forEach((a,i)=>{let u;(0,r.alwaysValidSchema)(s,a)?o.var(c,!0):u=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},c),i>0&&o.if((0,t._)`${c} && ${n}`).assign(n,!1).assign(l,(0,t._)`[${l}, ${i}]`).else(),o.if(c,()=>{o.assign(n,!0),o.assign(l,i),u&&e.mergeEvaluated(u,t.Name)})})}),e.result(n,()=>e.reset(),()=>e.error(!0))}}}),l4=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=li();e.default={keyword:"allOf",schemaType:"array",code(e){let{gen:r,schema:o,it:a}=e;if(!Array.isArray(o))throw Error("ajv implementation error");let i=r.name("valid");o.forEach((r,o)=>{if((0,t.alwaysValidSchema)(a,r))return;let s=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(s)})}}}),l5=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la(),r=li();function o(e,t){let o=e.schema[t];return void 0!==o&&!(0,r.alwaysValidSchema)(e,o)}e.default={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let a,{gen:i,parentSchema:s,it:n}=e;void 0===s.then&&void 0===s.else&&(0,r.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let l=o(n,"then"),c=o(n,"else");if(!l&&!c)return;let u=i.let("valid",!0),d=i.name("_valid");if(a=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},d),e.mergeEvaluated(a),e.reset(),l&&c){let t=i.let("ifClause");e.setParams({ifClause:t}),i.if(d,p("then",t),p("else",t))}else l?i.if(d,p("then")):i.if((0,t.not)(d),p("else"));function p(r,o){return()=>{let a=e.subschema({keyword:r},d);i.assign(u,d),e.mergeValidEvaluated(a,u),o?i.assign(o,(0,t._)`${r}`):e.setParams({ifClause:r})}}e.pass(u,()=>e.error(!0))}}}),l3=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=li();e.default={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:r,it:o}){void 0===r.if&&(0,t.checkStrictMode)(o,`"${e}" without "if" is ignored`)}}}),l6=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lK(),r=lB(),o=lJ(),a=lG(),i=lZ(),s=lW(),n=lX(),l=lY(),c=lQ(),u=l0(),d=l1(),p=l2(),h=l9(),f=l4(),m=l5(),y=l3();e.default=function(e=!1){let g=[d.default,p.default,h.default,f.default,m.default,y.default,n.default,l.default,s.default,c.default,u.default];return e?g.push(r.default,a.default):g.push(t.default,o.default),g.push(i.default),g}}),l8=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la();e.default={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,r){let o,a,i,s,n,l,{gen:c,data:u,$data:d,schema:p,schemaCode:h,it:f}=e,{opts:m,errSchemaPath:y,schemaEnv:g,self:v}=f;m.validateFormats&&(d?(o=c.scopeValue("formats",{ref:v.formats,code:m.code.formats}),a=c.const("fDef",(0,t._)`${o}[${h}]`),i=c.let("fType"),s=c.let("format"),c.if((0,t._)`typeof ${a} == "object" && !(${a} instanceof RegExp)`,()=>c.assign(i,(0,t._)`${a}.type || "string"`).assign(s,(0,t._)`${a}.validate`),()=>c.assign(i,(0,t._)`"string"`).assign(s,a)),e.fail$data((0,t.or)(!1===m.strictSchema?t.nil:(0,t._)`${h} && !${s}`,(n=g.$async?(0,t._)`(${a}.async ? await ${s}(${u}) : ${s}(${u}))`:(0,t._)`${s}(${u})`,l=(0,t._)`(typeof ${s} == "function" ? ${n} : ${s}.test(${u}))`,(0,t._)`${s} && ${s} !== true && ${i} === ${r} && !${l}`)))):function(){var o;let a,i,s=v.formats[p];if(!s){if(!1===m.strictSchema)return v.logger.warn(n());throw Error(n());function n(){return`unknown format "${p}" ignored in schema at path "${y}"`}}if(!0===s)return;let[l,d,h]=(a=(o=s)instanceof RegExp?(0,t.regexpCode)(o):m.code.formats?(0,t._)`${m.code.formats}${(0,t.getProperty)(p)}`:void 0,i=c.scopeValue("formats",{key:p,ref:o,code:a}),"object"!=typeof o||o instanceof RegExp?["string",o,i]:[o.type||"string",o.validate,(0,t._)`${i}.validate`]);l===r&&e.pass(function(){if("object"==typeof s&&!(s instanceof RegExp)&&s.async){if(!g.$async)throw Error("async format in sync schema");return(0,t._)`await ${h}(${u})`}return"function"==typeof d?(0,t._)`${h}(${u})`:(0,t._)`${h}.test(${u})`}())}())}}}),l7=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[l8().default]}),ce=B(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"]}),ct=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lj(),r=lH(),o=l6(),a=l7(),i=ce();e.default=[t.default,r.default,(0,o.default)(),a.default,i.metadataVocabulary,i.contentVocabulary]}),cr=B(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,(r=t||(e.DiscrError=t={})).Tag="tag",r.Mapping="mapping"}),co=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la(),r=cr(),o=l$(),a=lS(),i=li();e.default={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===r.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:r,tagName:o}})=>(0,t._)`{error: ${e}, tag: ${o}, tagValue: ${r}}`},code(e){let{gen:s,data:n,schema:l,parentSchema:c,it:u}=e,{oneOf:d}=c;if(!u.opts.discriminator)throw Error("discriminator: requires discriminator option");let p=l.propertyName;if("string"!=typeof p)throw Error("discriminator: requires propertyName");if(l.mapping)throw Error("discriminator: mapping is not supported");if(!d)throw Error("discriminator: requires oneOf keyword");let h=s.let("valid",!1),f=s.const("tag",(0,t._)`${n}${(0,t.getProperty)(p)}`);s.if((0,t._)`typeof ${f} == "string"`,()=>(function(){let n=function(){var e;let t={},r=n(c),s=!0;for(let t=0;t<d.length;t++){let c=d[t];if((null==c?void 0:c.$ref)&&!(0,i.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if((c=o.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e))instanceof o.SchemaEnv&&(c=c.schema),void 0===c)throw new a.default(u.opts.uriResolver,u.baseId,e)}let h=null==(e=null==c?void 0:c.properties)?void 0:e[p];if("object"!=typeof h)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);s=s&&(r||n(c)),function(e,t){if(e.const)l(e.const,t);else if(e.enum)for(let r of e.enum)l(r,t);else throw Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}(h,t)}if(!s)throw Error(`discriminator: "${p}" must be required`);return t;function n({required:e}){return Array.isArray(e)&&e.includes(p)}function l(e,r){if("string"!=typeof e||e in t)throw Error(`discriminator: "${p}" values must be unique strings`);t[e]=r}}();for(let r in s.if(!1),n)s.elseIf((0,t._)`${f} === ${r}`),s.assign(h,function(r){let o=s.name("valid"),a=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(a,t.Name),o}(n[r]));s.else(),e.error(!1,{discrError:r.DiscrError.Mapping,tag:f,tagName:p}),s.endIf()})(),()=>e.error(!1,{discrError:r.DiscrError.Tag,tag:f,tagName:p})),e.ok(h)}}}),ca=B((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}}),ci=B((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=lT(),o=ct(),a=co(),i=ca(),s=["/properties"],n="http://json-schema.org/draft-07/schema";var l=class extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(i,s):i;this.addMetaSchema(e,n,!1),this.refs["http://json-schema.org/schema"]=n}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}};e.Ajv=l,t.exports=e=l,t.exports.Ajv=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var c=lb();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=la();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=l_();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=lS();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})}),cs=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=la(),r=ls(),o=l$(),a=lx();function i(e,i){let{gen:s,it:n}=e;n.schemaEnv.root.dynamicAnchors[i]=!0;let l=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(i)}`,c="#"===n.errSchemaPath?n.validateName:function(e){let{schemaEnv:t,schema:r,self:i}=e.it,{root:s,baseId:n,localRefs:l,meta:c}=t.root,{schemaId:u}=i.opts,d=new o.SchemaEnv({schema:r,schemaId:u,root:s,baseId:n,localRefs:l,meta:c});return o.compileSchema.call(i,d),(0,a.getValidate)(e,d)}(e);s.if((0,t._)`!${l}`,()=>s.assign(l,c))}e.dynamicAnchor=i,e.default={keyword:"$dynamicAnchor",schemaType:"string",code:e=>i(e,e.schema)}}),cn=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=la(),r=ls(),o=lx();function a(e,a){let{gen:i,keyword:s,it:n}=e;if("#"!==a[0])throw Error(`"${s}" only supports hash fragment reference`);let l=a.slice(1);if(n.allErrors)c();else{let t=i.let("valid",!1);c(t),e.ok(t)}function c(e){if(n.schemaEnv.root.dynamicAnchors[l]){let o=i.let("_v",(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(l)}`);i.if(o,u(o,e),u(n.validateName,e))}else u(n.validateName,e)()}function u(t,r){return r?()=>i.block(()=>{(0,o.callRef)(e,t),i.let(r,!0)}):()=>(0,o.callRef)(e,t)}}e.dynamicRef=a,e.default={keyword:"$dynamicRef",schemaType:"string",code:e=>a(e,e.schema)}}),cl=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cs(),r=li();e.default={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,t.dynamicAnchor)(e,""):(0,r.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}}}),cc=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cn();e.default={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,t.dynamicRef)(e,e.schema)}}),cu=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cs(),r=cn(),o=cl(),a=cc();e.default=[t.default,r.default,o.default,a.default]}),cd=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lW();e.default={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}}),cp=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lW();e.default={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,t.validateSchemaDeps)(e)}}),ch=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=li();e.default={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:r,it:o}){void 0===r.contains&&(0,t.checkStrictMode)(o,`"${e}" without "contains" is ignored`)}}}),cf=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cd(),r=cp(),o=ch();e.default=[t.default,r.default,o.default]}),cm=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la(),r=li(),o=ls();e.default={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:e})=>(0,t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:a,schema:i,data:s,errsCount:n,it:l}=e;if(!n)throw Error("ajv implementation error");let{allErrors:c,props:u}=l;function d(o){if(!1===i){e.setParams({unevaluatedProperty:o}),e.error(),c||a.break();return}if(!(0,r.alwaysValidSchema)(l,i)){let i=a.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:o,dataPropType:r.Type.Str},i),c||a.if((0,t.not)(i),()=>a.break())}}u instanceof t.Name?a.if((0,t._)`${u} !== true`,()=>a.forIn("key",s,e=>{var r,o;return a.if((r=u,o=e,(0,t._)`!${r} || !${r}[${o}]`),()=>d(e))})):!0!==u&&a.forIn("key",s,e=>void 0===u?d(e):a.if(function(e,r){let o=[];for(let a in e)!0===e[a]&&o.push((0,t._)`${r} !== ${a}`);return(0,t.and)(...o)}(u,e),()=>d(e))),l.props=!0,e.ok((0,t._)`${n} === ${o.default.errors}`)}}}),cy=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=la(),r=li();e.default={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{gen:o,schema:a,data:i,it:s}=e,n=s.items||0;if(!0===n)return;let l=o.const("len",(0,t._)`${i}.length`);if(!1===a)e.setParams({len:n}),e.fail((0,t._)`${l} > ${n}`);else if("object"==typeof a&&!(0,r.alwaysValidSchema)(s,a)){let a=o.var("valid",(0,t._)`${l} <= ${n}`);o.if((0,t.not)(a),()=>{var i,c;return i=a,c=n,void o.forRange("i",c,l,a=>{e.subschema({keyword:"unevaluatedItems",dataProp:a,dataPropType:r.Type.Num},i),s.allErrors||o.if((0,t.not)(i),()=>o.break())})}),e.ok(a)}s.items=!0}}}),cg=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cm(),r=cy();e.default=[t.default,r.default]}),cv=B((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"}]}}}}}),cb=B((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:"#"}}}}}),c_=B((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:"#"}}}}),cS=B((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:{}}}}}),c$=B((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"}}}}),cw=B((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}}}}),cE=B((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:[]}}}}),cR=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cv(),r=cb(),o=c_(),a=cS(),i=c$(),s=cw(),n=cE(),l=["/properties"];e.default=function(e){return[t,r,o,a,c(this,i),s,c(this,n)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function c(t,r){return e?t.$dataMetaSchema(r,l):r}}}),cP=B((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=lT(),o=ct(),a=cu(),i=cf(),s=cg(),n=co(),l=cR(),c="https://json-schema.org/draft/2019-09/schema";var u=class extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(a.default),o.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(i.default),this.addVocabulary(s.default),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(l.default.call(this,e),this.refs["http://json-schema.org/schema"]=c)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};e.Ajv2019=u,t.exports=e=u,t.exports.Ajv2019=u,Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var d=lb();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var p=la();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var h=l_();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return h.default}});var f=lS();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}),ck=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lj(),r=lH(),o=l6(),a=cu(),i=cf(),s=cg(),n=l7(),l=ce();e.default=[a.default,t.default,r.default,(0,o.default)(!0),n.default,l.metadataVocabulary,l.contentVocabulary,i.default,s.default]}),cT=B((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}}}}),cO=B((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"}}}}}),cx=B((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"}}}}),cj=B((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"}}}}),cC=B((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"}}}}),cN=B((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"}}}}),cI=B((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}}}}),cA=B((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:[]}}}}),cM=B(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cT(),r=cO(),o=cx(),a=cj(),i=cC(),s=cN(),n=cI(),l=cA(),c=["/properties"];e.default=function(e){return[t,r,o,a,i,u(this,s),n,u(this,l)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function u(t,r){return e?t.$dataMetaSchema(r,c):r}}}),cq=B((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=lT(),o=ck(),a=co(),i=cM(),s="https://json-schema.org/draft/2020-12/schema";var n=class extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(i.default.call(this,e),this.refs["http://json-schema.org/schema"]=s)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}};e.Ajv2020=n,t.exports=e=n,t.exports.Ajv2020=n,Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var l=lb();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=la();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var u=l_();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=lS();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}),cz=B(e=>{function t(e,t){return{validate:e,compare:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:t(a,i),time:t(n(!0),l),"date-time":t(d(!0),p),"iso-time":t(n(),c),"iso-date-time":t(d(),h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return f.test(e)&&m.test(e)},"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:function(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},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:function(e){return y.lastIndex=0,y.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=v&&e>=g}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:b},double:{type:"number",validate:b},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,l),"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,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"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,h),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);let r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){var t;let a=r.exec(e);if(!a)return!1;let i=+a[1],s=+a[2],n=+a[3];return s>=1&&s<=12&&n>=1&&n<=(2===s&&(t=i)%4==0&&(t%100!=0||t%400==0)?29:o[s])}function i(e,t){if(e&&t)return e>t?1:e<t?-1:0}let s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function n(e){return function(t){let r=s.exec(t);if(!r)return!1;let o=+r[1],a=+r[2],i=+r[3],n=r[4],l="-"===r[5]?-1:1,c=+(r[6]||0),u=+(r[7]||0);if(c>23||u>59||e&&!n)return!1;if(o<=23&&a<=59&&i<60)return!0;let d=a-u*l,p=o-c*l-(d<0);return(23===p||-1===p)&&(59===d||-1===d)&&i<61}}function l(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),o=new Date("2020-01-01T"+t).valueOf();if(r&&o)return r-o}function c(e,t){if(!(e&&t))return;let r=s.exec(e),o=s.exec(t);if(r&&o)return(e=r[1]+r[2]+r[3])>(t=o[1]+o[2]+o[3])?1:e<t?-1:0}let u=/t|\s/i;function d(e){let t=n(e);return function(e){let r=e.split(u);return 2===r.length&&a(r[0])&&t(r[1])}}function p(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),o=new Date(t).valueOf();if(r&&o)return r-o}function h(e,t){if(!(e&&t))return;let[r,o]=e.split(u),[a,s]=t.split(u),n=i(r,a);if(void 0!==n)return n||l(o,s)}let f=/\/|:/,m=/^(?:[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,y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,g=-0x80000000,v=0x80000000-1;function b(){return!0}let _=/[^\\]\\Z/}),cL=B(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=ci(),r=la(),o=r.operators,a={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}};e.formatLimitDefinition={keyword:Object.keys(a),type:"string",schemaType:"string",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,r.str)`should be ${a[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,r._)`{comparison: ${a[e].okStr}, limit: ${t}}`},code(e){let o,i,{gen:s,data:n,schemaCode:l,keyword:c,it:u}=e,{opts:d,self:p}=u;if(!d.validateFormats)return;let h=new t.KeywordCxt(u,p.RULES.all.format.definition,"format");function f(e){return(0,r._)`${e}.compare(${n}, ${l}) ${a[c].fail} 0`}h.$data?(o=s.scopeValue("formats",{ref:p.formats,code:d.code.formats}),i=s.const("fmt",(0,r._)`${o}[${h.schemaCode}]`),e.fail$data((0,r.or)((0,r._)`typeof ${i} != "object"`,(0,r._)`${i} instanceof RegExp`,(0,r._)`typeof ${i}.compare != "function"`,f(i)))):function(){let t=h.schema,o=p.formats[t];if(!o||!0===o)return;if("object"!=typeof o||o instanceof RegExp||"function"!=typeof o.compare)throw Error(`"${c}": format "${t}" does not define "compare" function`);let a=s.scopeValue("formats",{key:t,ref:o,code:d.code.formats?(0,r._)`${d.code.formats}${(0,r.getProperty)(t)}`:void 0});e.fail$data(f(a))}()},dependencies:["format"]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}),cD=B((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=cz(),o=cL(),a=la(),i=new a.Name("fullFormats"),s=new a.Name("fastFormats"),n=(e,t={keywords:!0})=>{if(Array.isArray(t))return l(e,t,r.fullFormats,i),e;let[a,n]="fast"===t.mode?[r.fastFormats,s]:[r.fullFormats,i];return l(e,t.formats||r.formatNames,a,n),t.keywords&&(0,o.default)(e),e};function l(e,t,r,o){var i;for(let s of(null!=(i=e.opts.code).formats||(i.formats=(0,a._)`require("ajv-formats/dist/formats").${o}`),t))e.addFormat(s,r[s])}n.get=(e,t="full")=>{let o=("fast"===t?r.fastFormats:r.fullFormats)[e];if(!o)throw Error(`Unknown format "${e}"`);return o},t.exports=e=n,Object.defineProperty(e,"__esModule",{value:!0}),e.default=n}),cU=ci(),cV=cP(),cF=cq();((e,t,r,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var a,i=H(t),s=0,n=i.length;s<n;s++)a=i[s],J.call(e,a)||a===r||V(e,a,{get:(e=>t[e]).bind(null,a),enumerable:!(o=F(t,a))||o.enumerable});return e})(V(null!=(u=cD())?U(K(u)):{},"default",{value:u,enumerable:!0}),u).default;cU.Ajv;let cH=require("node:process"),cK=Symbol.for("mcp.completable");function cJ(e,t){return Object.defineProperty(e,cK,{value:{complete:t},enumerable:!1,writable:!1,configurable:!1}),e}function cB(e){let t="";for(let r of e)t+=String.fromCodePoint(r);return btoa(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function cG(e){let t=atob(e.replaceAll("-","+").replaceAll("_","/")),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.codePointAt(e);return r}function cZ(e){let t,r=globalThis.crypto?.subtle;if(void 0===r)throw TypeError("createRequestStateCodec requires the Web Crypto API (globalThis.crypto.subtle); see https://ts.sdk.modelcontextprotocol.io/v2/troubleshooting for the Node.js polyfill instructions");let o="string"==typeof e.key?new TextEncoder().encode(e.key):Uint8Array.from(e.key);if(o.byteLength<32)throw RangeError(`createRequestStateCodec: key must be at least 32 bytes (got ${o.byteLength})`);let a=e.ttlSeconds??600;if(!Number.isFinite(a))throw RangeError("createRequestStateCodec: ttlSeconds must be a finite number");let i=e.bind,s=()=>t??=r.importKey("raw",o,{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]),n=new TextEncoder,l=async e=>cB(new Uint8Array(await r.sign("HMAC",await s(),n.encode("mcp.requestState.bind:"+e))).slice(0,16));return{async mint(e,t){let o={p:e,exp:Math.floor(Date.now()/1e3)+a};if(void 0!==i){if(void 0===t)throw TypeError("createRequestStateCodec: mint() requires ctx when a bind callback is configured");o.b=await l(i(t))}let c=cB(n.encode(JSON.stringify(o)));return`v1.${c}.${cB(new Uint8Array(await r.sign("HMAC",await s(),n.encode("v1."+c))))}`},async verify(e,t){let o,a,c=e.lastIndexOf(".");if(!e.startsWith("v1.")||c<=3)throw Error("malformed");let u=e.slice(3,c);try{o=cG(e.slice(c+1))}catch{throw Error("malformed")}if(!await r.verify("HMAC",await s(),o,n.encode("v1."+u)))throw Error("mac");try{a=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(cG(u)))}catch{throw Error("malformed")}if("number"!=typeof a.exp||a.exp<Math.floor(Date.now()/1e3))throw Error("expired");if(void 0!==i){let e=await l(i(t));if(void 0===a.b||!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let o=0;o<e.length;o++)r|=e.codePointAt(o)^t.codePointAt(o);return 0===r}(a.b,e))throw Error("bind")}else if(void 0!==a.b)throw Error("bind");return a.p}}}var cW=Object.create,cX=Object.defineProperty,cY=Object.getOwnPropertyDescriptor,cQ=Object.getOwnPropertyNames,c0=Object.getPrototypeOf,c1=Object.prototype.hasOwnProperty,c2=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c9=(e,t,r)=>(r=null!=e?cW(c0(e)):{},((e,t,r,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var a,i=cQ(t),s=0,n=i.length;s<n;s++)a=i[s],c1.call(e,a)||a===r||cX(e,a,{get:(e=>t[e]).bind(null,a),enumerable:!(o=cY(t,a))||o.enumerable});return e})(!t&&e&&e.__esModule?r:cX(r,"default",{value:e,enumerable:!0}),e));let c4=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),c5=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),c3=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),c6=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]),c8=Symbol.for("mcp.sdk.errorBrands");function c7(e,t){let r=new Set,o=t;for(;"function"==typeof o;){let e=o.mcpBrand;Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&"string"==typeof e&&r.add(e),o=Object.getPrototypeOf(o)}0!==r.size&&Object.defineProperty(e,c8,{value:r,enumerable:!1,configurable:!0})}function ue(e,t){try{if("object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&"string"==typeof e.mcpBrand&&Object.prototype.hasOwnProperty.call(t,c8)){let r=t[c8];if(r&&"function"==typeof r.has&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}let ut=((f={}).InvalidRequest="invalid_request",f.InvalidClient="invalid_client",f.InvalidGrant="invalid_grant",f.UnauthorizedClient="unauthorized_client",f.UnsupportedGrantType="unsupported_grant_type",f.InvalidScope="invalid_scope",f.AccessDenied="access_denied",f.ServerError="server_error",f.TemporarilyUnavailable="temporarily_unavailable",f.UnsupportedResponseType="unsupported_response_type",f.UnsupportedTokenType="unsupported_token_type",f.InvalidToken="invalid_token",f.MethodNotAllowed="method_not_allowed",f.TooManyRequests="too_many_requests",f.InvalidClientMetadata="invalid_client_metadata",f.InvalidRedirectUri="invalid_redirect_uri",f.InsufficientScope="insufficient_scope",f.InvalidTarget="invalid_target",f);var ur=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](e){return ue(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return ue(this,e)}constructor(e,t,r){super(t),this.code=e,this.errorUri=r,this.name="OAuthError",c7(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}};let uo=((m={}).NotConnected="NOT_CONNECTED",m.AlreadyConnected="ALREADY_CONNECTED",m.NotInitialized="NOT_INITIALIZED",m.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",m.RequestTimeout="REQUEST_TIMEOUT",m.ConnectionClosed="CONNECTION_CLOSED",m.SendFailed="SEND_FAILED",m.InvalidResult="INVALID_RESULT",m.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",m.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",m.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",m.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",m.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",m.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",m.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",m.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",m.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",m.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",m.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",m);var ua=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return ue(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return ue(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="SdkError",c7(this,new.target)}},ui=class extends ua{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r){super(e,t,r),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};let us="2026-07-28",un=[us];function ul(e){return e.filter(e=>!(e>=us))}function uc(e){return e.filter(e=>e>=us)}function uu(e){let t=e.structuredContent;return void 0===t||!("object"!=typeof t||null===t||Array.isArray(t))||e.content?.some(e=>"text"===e.type)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}let ud=["task","inputRequests","requestState"];function up(e){return null===e||"object"!=typeof e||Array.isArray(e)||void 0!==e.content||ud.some(t=>t in e)?e:{...e,content:[]}}function uh(){let e,t,o,a,i,s,n,l,c,u,d,p,h,f,m,y,g,v,b,_,S,$,w,E,R,P,k,T,O,x,j,C,N,I,A,M,q,z,L,D,U,V,F,H,K,J,B,G,Z,W,X,Y,Q,ee,et,er,eo,ea,ei,es,en,el,ec,eu,ed,ep,eh,ef,em,ey,eg,ev,eb,e_,eS,e$,ew,eE,eR,eP,ek,eT,eO,ex,ej,eC,eN,eI,eA,eM,eq,ez,eL,eD,eU,eV,eF,eH,eK,eJ,eB,eG,eZ,eW,eX,eY,eQ,e0,e1,e2,e9,e4,e5,e3,e6,e8,e7,te,tt,tr,to,ta,ti,ts,tn,tl,tc,tu,td,tp,th,tf,tm,ty,tg,tv,tb,t_,tS,t$;return r??=(e=aC(()=>ai([ox(),oY(),o2(),o4(),ad(ox(),e),ae(e)])),t=ad(ox(),e),o=ai([ox(),oY().int()]),a=ox(),i=ar({ttl:oY().optional()}),s=ar({taskId:ox()}),c=(l=ar({_meta:(n=ao({progressToken:o.optional(),"io.modelcontextprotocol/related-task":s.optional()})).optional()})).extend({task:i.optional()}),u=ar({method:ox(),params:l.loose().optional()}),d=ar({_meta:n.optional()}),p=ar({method:ox(),params:d.loose().optional()}),h=ao({_meta:n.optional()}),f=ai([ox(),oY().int()]),m=h.strict(),y=d.extend({requestId:f.optional(),reason:ox().optional()}),g=p.extend({method:am("notifications/cancelled"),params:y}),v=ar({src:ox(),mimeType:ox().optional(),sizes:ae(ox()).optional(),theme:ah(["light","dark"]).optional()}),b=ar({icons:ae(v).optional()}),S=(_=ar({name:ox(),title:ox().optional()})).extend({..._.shape,...b.shape,version:ox(),websiteUrl:ox().optional(),description:ox().optional()}),$=ac(ar({applyDefaults:o2().optional()}),t),w=aI(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,ac(ar({form:$.optional(),url:t.optional()}),t.optional())),E=ao({list:t.optional(),cancel:t.optional(),requests:ao({sampling:ao({createMessage:t.optional()}).optional(),elicitation:ao({create:t.optional()}).optional()}).optional()}),R=ao({list:t.optional(),cancel:t.optional(),requests:ao({tools:ao({call:t.optional()}).optional()}).optional()}),P=ar({experimental:ad(ox(),t).optional(),sampling:ar({context:t.optional(),tools:t.optional()}).optional(),elicitation:w.optional(),roots:ar({listChanged:o2().optional()}).optional(),tasks:E.optional(),extensions:ad(ox(),t).optional()}),k=l.extend({protocolVersion:ox(),capabilities:P,clientInfo:S}),T=u.extend({method:am("initialize"),params:k}),O=ar({experimental:ad(ox(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:ar({listChanged:o2().optional()}).optional(),resources:ar({subscribe:o2().optional(),listChanged:o2().optional()}).optional(),tools:ar({listChanged:o2().optional()}).optional(),tasks:R.optional(),extensions:ad(ox(),t).optional()}),x=h.extend({protocolVersion:ox(),capabilities:O,serverInfo:S,instructions:ox().optional()}),j=p.extend({method:am("notifications/initialized"),params:d.optional()}),C=u.extend({method:am("ping"),params:l.optional()}),N=ar({progress:oY(),total:ab(oY()),message:ab(ox())}),I=ar({...d.shape,...N.shape,progressToken:o}),A=p.extend({method:am("notifications/progress"),params:I}),M=l.extend({cursor:a.optional()}),q=u.extend({params:M.optional()}),z=h.extend({nextCursor:a.optional()}),D=(L=ar({uri:ox(),mimeType:ab(ox()),_meta:ad(ox(),o6()).optional()})).extend({text:ox()}),U=ox().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),V=L.extend({blob:U}),H=ar({audience:ae(F=ah(["user","assistant"])).optional(),priority:oY().min(0).max(1).optional(),lastModified:on({offset:!0}).optional()}),K=ar({..._.shape,...b.shape,uri:ox(),description:ab(ox()),mimeType:ab(ox()),size:ab(oY()),annotations:H.optional(),_meta:ab(ao({}))}),J=ar({..._.shape,...b.shape,uriTemplate:ox(),description:ab(ox()),mimeType:ab(ox()),annotations:H.optional(),_meta:ab(ao({}))}),B=q.extend({method:am("resources/list")}),G=z.extend({resources:ae(K)}),Z=q.extend({method:am("resources/templates/list")}),W=z.extend({resourceTemplates:ae(J)}),X=l.extend({uri:ox()}),Y=u.extend({method:am("resources/read"),params:X}),Q=h.extend({contents:ae(ai([D,V]))}),ee=p.extend({method:am("notifications/resources/list_changed"),params:d.optional()}),et=u.extend({method:am("resources/subscribe"),params:X}),er=u.extend({method:am("resources/unsubscribe"),params:X}),eo=d.extend({uri:ox()}),ea=p.extend({method:am("notifications/resources/updated"),params:eo}),ei=ar({name:ox(),description:ab(ox()),required:ab(o2())}),es=ar({..._.shape,...b.shape,description:ab(ox()),arguments:ab(ae(ei)),_meta:ab(ao({}))}),en=q.extend({method:am("prompts/list")}),el=z.extend({prompts:ae(es)}),ec=l.extend({name:ox(),arguments:ad(ox(),ox()).optional()}),eu=u.extend({method:am("prompts/get"),params:ec}),ed=ar({type:am("text"),text:ox(),annotations:H.optional(),_meta:ad(ox(),o6()).optional()}),ep=ar({type:am("image"),data:U,mimeType:ox(),annotations:H.optional(),_meta:ad(ox(),o6()).optional()}),eh=ar({type:am("audio"),data:U,mimeType:ox(),annotations:H.optional(),_meta:ad(ox(),o6()).optional()}),ef=ar({type:am("tool_use"),name:ox(),id:ox(),input:ad(ox(),o6()),_meta:ad(ox(),o6()).optional()}),em=ar({type:am("resource"),resource:ai([D,V]),annotations:H.optional(),_meta:ad(ox(),o6()).optional()}),ev=ar({role:F,content:eg=ai([ed,ep,eh,ey=K.extend({type:am("resource_link")}),em])}),eb=h.extend({description:ox().optional(),messages:ae(ev)}),e_=p.extend({method:am("notifications/prompts/list_changed"),params:d.optional()}),eS=ar({title:ox().optional(),readOnlyHint:o2().optional(),destructiveHint:o2().optional(),idempotentHint:o2().optional(),openWorldHint:o2().optional()}),e$=ar({taskSupport:ah(["required","optional","forbidden"]).optional()}),ew=ar({..._.shape,...b.shape,description:ox().optional(),inputSchema:ar({type:am("object"),properties:ad(ox(),e).optional(),required:ae(ox()).optional()}).catchall(o6()),outputSchema:ar({type:am("object"),properties:ad(ox(),e).optional(),required:ae(ox()).optional()}).catchall(o6()).optional(),annotations:eS.optional(),execution:e$.optional(),_meta:ad(ox(),o6()).optional()}),eE=q.extend({method:am("tools/list")}),eR=z.extend({tools:ae(ew)}),eP=h.extend({content:ae(eg),structuredContent:ad(ox(),o6()).optional(),isError:o2().optional()}),ek=c.extend({name:ox(),arguments:ad(ox(),o6()).optional()}),eT=u.extend({method:am("tools/call"),params:ek}),eO=p.extend({method:am("notifications/tools/list_changed"),params:d.optional()}),ex=ah(["debug","info","notice","warning","error","critical","alert","emergency"]),ej=l.extend({level:ex}),eC=u.extend({method:am("logging/setLevel"),params:ej}),eN=d.extend({level:ex,logger:ox().optional(),data:o6()}),eI=p.extend({method:am("notifications/message"),params:eN}),eA=ar({name:ox().optional()}),eM=ar({hints:ae(eA).optional(),costPriority:oY().min(0).max(1).optional(),speedPriority:oY().min(0).max(1).optional(),intelligencePriority:oY().min(0).max(1).optional()}),eq=ar({mode:ah(["auto","required","none"]).optional()}),ez=ar({type:am("tool_result"),toolUseId:ox().describe("The unique identifier for the corresponding tool call."),content:ae(eg),structuredContent:ar({}).loose().optional(),isError:o2().optional(),_meta:ad(ox(),o6()).optional()}),eL=an("type",[ed,ep,eh]),eU=ar({role:F,content:ai([eD=an("type",[ed,ep,eh,ef,ez]),ae(eD)]),_meta:ad(ox(),o6()).optional()}),eV=c.extend({messages:ae(eU),modelPreferences:eM.optional(),systemPrompt:ox().optional(),includeContext:ah(["none","thisServer","allServers"]).optional(),temperature:oY().optional(),maxTokens:oY().int(),stopSequences:ae(ox()).optional(),metadata:t.optional(),tools:ae(ew).optional(),toolChoice:eq.optional()}),eF=u.extend({method:am("sampling/createMessage"),params:eV}),eH=h.extend({model:ox(),stopReason:ab(ah(["endTurn","stopSequence","maxTokens"]).or(ox())),role:F,content:eL}),eK=h.extend({model:ox(),stopReason:ab(ah(["endTurn","stopSequence","maxTokens","toolUse"]).or(ox())),role:F,content:ai([eD,ae(eD)])}),eJ=ar({type:am("boolean"),title:ox().optional(),description:ox().optional(),default:o2().optional()}),eB=ar({type:am("string"),title:ox().optional(),description:ox().optional(),minLength:oY().optional(),maxLength:oY().optional(),format:ah(["email","uri","date","date-time"]).optional(),default:ox().optional()}),eG=ar({type:ah(["number","integer"]),title:ox().optional(),description:ox().optional(),minimum:oY().optional(),maximum:oY().optional(),default:oY().optional()}),eZ=ar({type:am("string"),title:ox().optional(),description:ox().optional(),enum:ae(ox()),default:ox().optional()}),eW=ar({type:am("string"),title:ox().optional(),description:ox().optional(),oneOf:ae(ar({const:ox(),title:ox()})),default:ox().optional()}),eX=ar({type:am("string"),title:ox().optional(),description:ox().optional(),enum:ae(ox()),enumNames:ae(ox()).optional(),default:ox().optional()}),eY=ai([eZ,eW]),eQ=ar({type:am("array"),title:ox().optional(),description:ox().optional(),minItems:oY().optional(),maxItems:oY().optional(),items:ar({type:am("string"),enum:ae(ox())}),default:ae(ox()).optional()}),e1=ai([eQ,e0=ar({type:am("array"),title:ox().optional(),description:ox().optional(),minItems:oY().optional(),maxItems:oY().optional(),items:ar({anyOf:ae(ar({const:ox(),title:ox()}))}),default:ae(ox()).optional()})]),e2=ai([eX,eY,e1]),e9=ai([e2,eJ,eB,eG]),e4=c.extend({mode:am("form").optional(),message:ox(),requestedSchema:ar({type:am("object"),properties:ad(ox(),e9),required:ae(ox()).optional()}).catchall(o6())}),e3=ai([e4,e5=c.extend({mode:am("url"),message:ox(),elicitationId:ox(),url:ox().url()})]),e6=u.extend({method:am("elicitation/create"),params:e3}),e8=d.extend({elicitationId:ox()}),e7=p.extend({method:am("notifications/elicitation/complete"),params:e8}),te=h.extend({action:ah(["accept","decline","cancel"]),content:aI(e=>null===e?void 0:e,ad(ox(),ai([ox(),oY(),o2(),ae(ox())])).optional())}),tt=ar({type:am("ref/resource"),uri:ox()}),tr=ar({type:am("ref/prompt"),name:ox()}),to=l.extend({ref:ai([tr,tt]),argument:ar({name:ox(),value:ox()}),context:ar({arguments:ad(ox(),ox()).optional()}).optional()}),ta=u.extend({method:am("completion/complete"),params:to}),ti=h.extend({completion:ao({values:ae(ox()).max(100),total:ab(oY().int()),hasMore:ab(o2())})}),ts=ar({uri:ox().startsWith("file://"),name:ox().optional(),_meta:ad(ox(),o6()).optional()}),tn=u.extend({method:am("roots/list"),params:l.optional()}),tl=h.extend({roots:ae(ts)}),tc=p.extend({method:am("notifications/roots/list_changed"),params:d.optional()}),tu=ao({ttl:oY().optional(),pollInterval:oY().optional()}),td=ah(["working","input_required","completed","failed","cancelled"]),tp=ar({taskId:ox(),status:td,ttl:ai([oY(),o4()]),createdAt:ox(),lastUpdatedAt:ox(),pollInterval:ab(oY()),statusMessage:ab(ox())}),th=h.extend({task:tp}),tf=d.merge(tp),tm=p.extend({method:am("notifications/tasks/status"),params:tf}),ty=u.extend({method:am("tasks/get"),params:l.extend({taskId:ox()})}),tg=h.merge(tp),tv=u.extend({method:am("tasks/result"),params:l.extend({taskId:ox()})}),tb=h.loose(),t_=q.extend({method:am("tasks/list")}),tS=z.extend({tasks:ae(tp)}),t$=u.extend({method:am("tasks/cancel"),params:l.extend({taskId:ox()})}),{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:a,TaskMetadataSchema:i,RelatedTaskMetadataSchema:s,RequestMetaSchema:n,BaseRequestParamsSchema:l,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:d,NotificationSchema:p,ResultSchema:h,RequestIdSchema:f,EmptyResultSchema:m,CancelledNotificationParamsSchema:y,CancelledNotificationSchema:g,IconSchema:v,IconsSchema:b,BaseMetadataSchema:_,ImplementationSchema:S,ClientTasksCapabilitySchema:E,ServerTasksCapabilitySchema:R,ClientCapabilitiesSchema:P,InitializeRequestParamsSchema:k,InitializeRequestSchema:T,ServerCapabilitiesSchema:O,InitializeResultSchema:x,InitializedNotificationSchema:j,PingRequestSchema:C,ProgressSchema:N,ProgressNotificationParamsSchema:I,ProgressNotificationSchema:A,PaginatedRequestParamsSchema:M,PaginatedRequestSchema:q,PaginatedResultSchema:z,ResourceContentsSchema:L,TextResourceContentsSchema:D,BlobResourceContentsSchema:V,RoleSchema:F,AnnotationsSchema:H,ResourceSchema:K,ResourceTemplateSchema:J,ListResourcesRequestSchema:B,ListResourcesResultSchema:G,ListResourceTemplatesRequestSchema:Z,ListResourceTemplatesResultSchema:W,ResourceRequestParamsSchema:X,ReadResourceRequestParamsSchema:X,ReadResourceRequestSchema:Y,ReadResourceResultSchema:Q,ResourceListChangedNotificationSchema:ee,SubscribeRequestParamsSchema:X,SubscribeRequestSchema:et,UnsubscribeRequestParamsSchema:X,UnsubscribeRequestSchema:er,ResourceUpdatedNotificationParamsSchema:eo,ResourceUpdatedNotificationSchema:ea,PromptArgumentSchema:ei,PromptSchema:es,ListPromptsRequestSchema:en,ListPromptsResultSchema:el,GetPromptRequestParamsSchema:ec,GetPromptRequestSchema:eu,TextContentSchema:ed,ImageContentSchema:ep,AudioContentSchema:eh,ToolUseContentSchema:ef,EmbeddedResourceSchema:em,ResourceLinkSchema:ey,ContentBlockSchema:eg,PromptMessageSchema:ev,GetPromptResultSchema:eb,PromptListChangedNotificationSchema:e_,ToolAnnotationsSchema:eS,ToolExecutionSchema:e$,ToolSchema:ew,ListToolsRequestSchema:eE,ListToolsResultSchema:eR,CallToolResultSchema:eP,CallToolRequestParamsSchema:ek,CallToolRequestSchema:eT,ToolListChangedNotificationSchema:eO,LoggingLevelSchema:ex,SetLevelRequestParamsSchema:ej,SetLevelRequestSchema:eC,LoggingMessageNotificationParamsSchema:eN,LoggingMessageNotificationSchema:eI,ModelHintSchema:eA,ModelPreferencesSchema:eM,ToolChoiceSchema:eq,ToolResultContentSchema:ez,SamplingContentSchema:eL,SamplingMessageContentBlockSchema:eD,SamplingMessageSchema:eU,CreateMessageRequestParamsSchema:eV,CreateMessageRequestSchema:eF,CreateMessageResultSchema:eH,CreateMessageResultWithToolsSchema:eK,BooleanSchemaSchema:eJ,StringSchemaSchema:eB,NumberSchemaSchema:eG,UntitledSingleSelectEnumSchemaSchema:eZ,TitledSingleSelectEnumSchemaSchema:eW,LegacyTitledEnumSchemaSchema:eX,SingleSelectEnumSchemaSchema:eY,UntitledMultiSelectEnumSchemaSchema:eQ,TitledMultiSelectEnumSchemaSchema:e0,MultiSelectEnumSchemaSchema:e1,EnumSchemaSchema:e2,PrimitiveSchemaDefinitionSchema:e9,ElicitRequestFormParamsSchema:e4,ElicitRequestURLParamsSchema:e5,ElicitRequestParamsSchema:e3,ElicitRequestSchema:e6,ElicitationCompleteNotificationParamsSchema:e8,ElicitationCompleteNotificationSchema:e7,ElicitResultSchema:te,ResourceTemplateReferenceSchema:tt,PromptReferenceSchema:tr,CompleteRequestParamsSchema:to,CompleteRequestSchema:ta,CompleteResultSchema:ti,RootSchema:ts,ListRootsRequestSchema:tn,ListRootsResultSchema:tl,RootsListChangedNotificationSchema:tc,TaskCreationParamsSchema:tu,TaskStatusSchema:td,TaskSchema:tp,CreateTaskResultSchema:th,TaskStatusNotificationParamsSchema:tf,TaskStatusNotificationSchema:tm,GetTaskRequestSchema:ty,GetTaskResultSchema:tg,GetTaskPayloadRequestSchema:tv,GetTaskPayloadResultSchema:tb,ListTasksRequestSchema:t_,ListTasksResultSchema:tS,CancelTaskRequestSchema:t$,CancelTaskResultSchema:h.merge(tp),ClientRequestSchema:ai([C,T,ta,eC,eu,en,B,Z,Y,et,er,eT,eE,ty,tv,t_,t$]),ClientNotificationSchema:ai([g,A,j,tc,tm]),ClientResultSchema:ai([m,eH,eK,te,tl,tg,tS,th]),ServerRequestSchema:ai([C,eF,e6,tn,ty,tv,t_,t$]),ServerNotificationSchema:ai([g,A,eI,ea,ee,eO,e_,tm,e7]),ServerResultSchema:ai([m,x,ti,eb,el,G,W,Q,eP,eR,tg,tS,th]),CallToolResultWireSchema:o6().superRefine((e,t)=>{if(!("object"!=typeof e||null===e||Array.isArray(e))&&void 0===e.content){for(let r of ud)if(r in e)return void t.addIssue({code:"custom",message:`content is required when the body carries '${r}' — another result family cannot default into an empty tools/call success`})}}).transform(up).pipe(eP)})}function uf(e){return"object"!==e.type}let um=new Set(["const","enum","default","examples"]),uy=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function ug(e){return void 0!==e&&!("string"==typeof e&&e.startsWith("#"))}let uv={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},ub={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},u_={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};function uS(){if(o)return o;let e=uh();return o={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}}}function u$(e){return Object.prototype.hasOwnProperty.call(uv,e)}function uw(e){return Object.prototype.hasOwnProperty.call(ub,e)}function uE(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function uR(e,t){if(void 0===e)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}Object.keys(uv),Object.keys(ub);let uP={ok:!1,reason:"not-in-era"};function uk(e){return uE(e)&&uE(e.outputSchema)&&uf(e.outputSchema)}let uT={era:"2025-11-25",hasRequestMethod:u$,hasNotificationMethod:uw,validateRequest:(e,t)=>uR(u$(e)?uS().requestSchemas[e]:void 0,t),validateResult:(e,t)=>uR(Object.prototype.hasOwnProperty.call(u_,e)?uS().resultSchemas[e]:void 0,t),validateNotification:(e,t)=>uR(uw(e)?uS().notificationSchemas[e]:void 0,t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>uP,validateInputResponse:()=>uP,samplingResultVariant:(e,t)=>{let r=uh();return uR(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=uu(e),o=r.structuredContent;if(void 0===o)return r;let a="object"!=typeof o||null===o||Array.isArray(o),i=void 0!==t&&uf(t);return a||i?{...r,structuredContent:{result:o}}:r},decodeResult(e,t){if(uE(t)&&"resultType"in t){let e={...t};return delete e.resultType,{kind:"complete",result:e}}return{kind:"complete",result:t}},encodeResult(e,t){if("tools/list"!==e)return t;let r=t.tools;return Array.isArray(r)&&r.some(e=>uk(e))?{...t,tools:r.map(e=>uk(e)?{...e,outputSchema:function(e){var t;let r="string"==typeof e.$schema?e.$schema:void 0;if(ug(e.$id))return{...void 0!==r&&{$schema:r},type:"object",properties:{result:e},required:["result"]};let o="string"==typeof(t=e.$schema)&&c5.has(t.replace(/#$/,""))&&!0!==e.$recursiveAnchor,a=(e,t)=>{if(Array.isArray(e))return e.map(e=>a(e,!1));if(null===e||"object"!=typeof e||!t&&ug(e.$id))return e;let r={},i=!1;for(let[s,n]of Object.entries(e))t?r[s]=a(n,!1):("$ref"===s||"$dynamicRef"===s)&&"string"==typeof n?r[s]="#"===n?"#/properties/result":n.startsWith("#/")?`#/properties/result${n.slice(1)}`:n:"$recursiveRef"===s&&"#"===n&&o?i=!0:um.has(s)?r[s]=n:uy.has(s)?r[s]=a(n,!0):r[s]=a(n,!1);return i&&("$ref"in r?r.allOf=[...Array.isArray(r.allOf)?r.allOf:[],{$ref:"#/properties/result"}]:r.$ref="#/properties/result"),r};return{...void 0!==r&&{$schema:r},type:"object",properties:{result:a(e,!1)},required:["result"]}}(e.outputSchema)}:e)}:t},encodeErrorCode:e=>-32002===e?-32602:e,checkInboundEnvelope:e=>void 0};function uO(){return a??=function(){let e=aC(()=>ai([ox(),oY(),o2(),o4(),ad(ox(),e),ae(e)])),t=ad(ox(),e),r=ai([ox(),oY().int()]),o=ox(),a=ai([ox(),oY().int()]),i=ah(["user","assistant"]),s=ah(["debug","info","notice","warning","error","critical","alert","emergency"]),n=ox().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),l=ar({ttl:oY().optional()}),c=ar({taskId:ox()}),u=ao({progressToken:r.optional(),"io.modelcontextprotocol/related-task":c.optional()}),d=ar({_meta:u.optional()}),p=d.extend({task:l.optional()}),h=ar({_meta:u.optional()}),f=ar({method:ox(),params:h.loose().optional()}),m=ar({src:ox(),mimeType:ox().optional(),sizes:ae(ox()).optional(),theme:ah(["light","dark"]).optional()}),y=ar({icons:ae(m).optional()}),g=ar({name:ox(),title:ox().optional()}),v=g.extend({...g.shape,...y.shape,version:ox(),websiteUrl:ox().optional(),description:ox().optional()}),b=ac(ar({applyDefaults:o2().optional()}),t),_=aI(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,ac(ar({form:b.optional(),url:t.optional()}),t.optional())),S=ao({list:t.optional(),cancel:t.optional(),requests:ao({sampling:ao({createMessage:t.optional()}).optional(),elicitation:ao({create:t.optional()}).optional()}).optional()}),$=ao({list:t.optional(),cancel:t.optional(),requests:ao({tools:ao({call:t.optional()}).optional()}).optional()}),w=ar({experimental:ad(ox(),t).optional(),sampling:ar({context:t.optional(),tools:t.optional()}).optional(),elicitation:_.optional(),roots:ar({listChanged:o2().optional()}).optional(),tasks:S.optional(),extensions:ad(ox(),t).optional()}),E=ar({experimental:ad(ox(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:ar({listChanged:o2().optional()}).optional(),resources:ar({subscribe:o2().optional(),listChanged:o2().optional()}).optional(),tools:ar({listChanged:o2().optional()}).optional(),tasks:$.optional(),extensions:ad(ox(),t).optional()}),R=ar({progress:oY(),total:ab(oY()),message:ab(ox())}),P=ar({...h.shape,...R.shape,progressToken:r}),k=f.extend({method:am("notifications/progress"),params:P}),T=h.extend({level:s,logger:ox().optional(),data:o6()}),O=f.extend({method:am("notifications/message"),params:T}),x=ar({uri:ox(),mimeType:ab(ox()),_meta:ad(ox(),o6()).optional()}),j=x.extend({text:ox()}),C=x.extend({blob:n}),N=ar({audience:ae(i).optional(),priority:oY().min(0).max(1).optional(),lastModified:on({offset:!0}).optional()}),I=ar({...g.shape,...y.shape,uri:ox(),description:ab(ox()),mimeType:ab(ox()),size:ab(oY()),annotations:N.optional(),_meta:ab(ao({}))}),A=ar({...g.shape,...y.shape,uriTemplate:ox(),description:ab(ox()),mimeType:ab(ox()),annotations:N.optional(),_meta:ab(ao({}))}),M=f.extend({method:am("notifications/resources/list_changed"),params:h.optional()}),q=h.extend({uri:ox()}),z=f.extend({method:am("notifications/resources/updated"),params:q}),L=ar({name:ox(),description:ab(ox()),required:ab(o2())}),D=ar({...g.shape,...y.shape,description:ab(ox()),arguments:ab(ae(L)),_meta:ab(ao({}))}),U=f.extend({method:am("notifications/prompts/list_changed"),params:h.optional()}),V=ar({type:am("text"),text:ox(),annotations:N.optional(),_meta:ad(ox(),o6()).optional()}),F=ar({type:am("image"),data:n,mimeType:ox(),annotations:N.optional(),_meta:ad(ox(),o6()).optional()}),H=ar({type:am("audio"),data:n,mimeType:ox(),annotations:N.optional(),_meta:ad(ox(),o6()).optional()}),K=ar({type:am("tool_use"),name:ox(),id:ox(),input:ad(ox(),o6()),_meta:ad(ox(),o6()).optional()}),J=ar({type:am("resource"),resource:ai([j,C]),annotations:N.optional(),_meta:ad(ox(),o6()).optional()}),B=I.extend({type:am("resource_link")}),G=ai([V,F,H,B,J]),Z=ar({role:i,content:G}),W=ar({title:ox().optional(),readOnlyHint:o2().optional(),destructiveHint:o2().optional(),idempotentHint:o2().optional(),openWorldHint:o2().optional()}),X=f.extend({method:am("notifications/tools/list_changed"),params:h.optional()}),Y=ar({name:ox().optional()}),Q=ar({hints:ae(Y).optional(),costPriority:oY().min(0).max(1).optional(),speedPriority:oY().min(0).max(1).optional(),intelligencePriority:oY().min(0).max(1).optional()}),ee=ar({mode:ah(["auto","required","none"]).optional()}),et=ar({type:am("boolean"),title:ox().optional(),description:ox().optional(),default:o2().optional()}),er=ar({type:am("string"),title:ox().optional(),description:ox().optional(),minLength:oY().optional(),maxLength:oY().optional(),format:ah(["email","uri","date","date-time"]).optional(),default:ox().optional()}),eo=ar({type:ah(["number","integer"]),title:ox().optional(),description:ox().optional(),minimum:oY().optional(),maximum:oY().optional(),default:oY().optional()}),ea=ar({type:am("string"),title:ox().optional(),description:ox().optional(),enum:ae(ox()),default:ox().optional()}),ei=ar({type:am("string"),title:ox().optional(),description:ox().optional(),oneOf:ae(ar({const:ox(),title:ox()})),default:ox().optional()}),es=ar({type:am("string"),title:ox().optional(),description:ox().optional(),enum:ae(ox()),enumNames:ae(ox()).optional(),default:ox().optional()}),en=ai([ea,ei]),el=ar({type:am("array"),title:ox().optional(),description:ox().optional(),minItems:oY().optional(),maxItems:oY().optional(),items:ar({type:am("string"),enum:ae(ox())}),default:ae(ox()).optional()}),ec=ar({type:am("array"),title:ox().optional(),description:ox().optional(),minItems:oY().optional(),maxItems:oY().optional(),items:ar({anyOf:ae(ar({const:ox(),title:ox()}))}),default:ae(ox()).optional()}),eu=ai([el,ec]),ed=ai([es,en,eu]),ep=ai([ed,et,er,eo]),eh=p.extend({mode:am("form").optional(),message:ox(),requestedSchema:ar({type:am("object"),properties:ad(ox(),ep),required:ae(ox()).optional()}).catchall(o6())}),ef=ar({type:am("ref/resource"),uri:ox()}),em=ar({type:am("ref/prompt"),name:ox()}),ey=ar({uri:ox().startsWith("file://"),name:ox().optional(),_meta:ad(ox(),o6()).optional()}),eg=w.shape,ev=ar({experimental:eg.experimental,sampling:eg.sampling,elicitation:eg.elicitation,roots:eg.roots,extensions:eg.extensions}),eb=E.shape,e_=ar({experimental:eb.experimental,logging:eb.logging,completions:eb.completions,prompts:eb.prompts,resources:eb.resources,tools:eb.tools,extensions:eb.extensions}),eS=ao({progressToken:r.optional(),[aq]:ox(),[az]:v.optional(),[aD]:ev,[aV]:s.optional()}),e$=ar({...g.shape,...y.shape,description:ox().optional(),inputSchema:ao({$schema:ox().optional(),type:am("object")}),outputSchema:ao({$schema:ox().optional()}).optional(),annotations:W.optional(),_meta:ad(ox(),o6()).optional()}),ew=ar({type:am("tool_result"),toolUseId:ox(),content:ae(G),structuredContent:o6().optional(),isError:o2().optional(),_meta:ad(ox(),o6()).optional()}),eE=ai([V,F,H,K,ew]),eR=ar({role:i,content:ai([eE,ae(eE)]),_meta:ad(ox(),o6()).optional()}),eP=ox(),ek=ao({[aL]:v.optional().catch(void 0)}),eT=ek.optional();function eO(e){return ao({_meta:eT,resultType:eP.default("complete"),...e})}let ex=eO({}),ej=eO({nextCursor:o.optional()}),eC=eO({content:ae(G),structuredContent:o6().optional(),isError:o2().optional()}),eN=eO({ttlMs:oY().int().min(0),cacheScope:ah(["public","private"]),tools:ae(e$),nextCursor:o.optional()}),eI=eO({ttlMs:oY().int().min(0),cacheScope:ah(["public","private"]),prompts:ae(D),nextCursor:o.optional()}),eA=eO({description:ox().optional(),messages:ae(Z)}),eM=eO({ttlMs:oY().int().min(0),cacheScope:ah(["public","private"]),resources:ae(I),nextCursor:o.optional()}),eq=eO({ttlMs:oY().int().min(0),cacheScope:ah(["public","private"]),resourceTemplates:ae(A),nextCursor:o.optional()}),ez=eO({ttlMs:oY().int().min(0),cacheScope:ah(["public","private"]),contents:ae(ai([j,C]))}),eL=eO({completion:ar({values:ae(ox()).max(100),total:oY().int().optional(),hasMore:o2().optional()}).loose()}),eD=eO({ttlMs:oY().int().min(0),cacheScope:ah(["public","private"])}),eU=eO({ttlMs:oY().int().min(0).catch(0),cacheScope:ah(["public","private"]).catch("private"),supportedVersions:ae(ox()),capabilities:e_,instructions:ox().optional()}),eV=ar({messages:ae(eR),modelPreferences:Q.optional(),systemPrompt:ox().optional(),includeContext:ah(["none","thisServer","allServers"]).optional(),temperature:oY().optional(),maxTokens:oY().int(),stopSequences:ae(ox()).optional(),metadata:t.optional(),tools:ae(e$).optional(),toolChoice:ee.optional()}),eF=ar({method:am("sampling/createMessage"),params:eV}),eH=ar({method:am("roots/list"),params:ar({_meta:ad(ox(),o6()).optional()}).optional()}),eK=ar({...eR.shape,model:ox(),stopReason:ox().optional()}),eJ=ar({roots:ae(ey)}),eB=ar({action:ah(["accept","decline","cancel"]),content:ad(ox(),ai([ox(),oY(),o2(),ae(ox())])).optional()}),eG=ar({mode:am("url"),message:ox(),url:ox().url()}),eZ=ai([eh,eG]),eW=ar({method:am("elicitation/create"),params:eZ}),eX=ai([eF,eH,eW]),eY=ai([eK,eJ,eB]),eQ=ad(ox(),eX),e0=ad(ox(),eY),e1=eO({inputRequests:eQ.optional(),requestState:ox().optional()}),e2={inputResponses:e0.optional(),requestState:ox().optional()},e9=ar({_meta:eS,...e2}),e4=ao({progressToken:r.optional()});function e5(e,t){return ar({method:am(e),params:ar({_meta:eS,...t})})}function e3(e,t){return ar({method:am(e),params:ar({_meta:e4.optional(),...t}).optional()})}let e6={name:ox(),arguments:ad(ox(),o6()).optional(),...e2},e8={cursor:o.optional()},e7=e5("tools/call",e6),te=e5("tools/list",e8),tt=e5("prompts/list",e8),tr=e5("prompts/get",{name:ox(),arguments:ad(ox(),ox()).optional(),...e2}),to=e5("resources/list",e8),ta=e5("resources/templates/list",e8),ti=e5("resources/read",{uri:ox(),...e2}),ts={ref:ai([em,ef]),argument:ar({name:ox(),value:ox()}),context:ar({arguments:ad(ox(),ox()).optional()}).optional()},tn=e5("completion/complete",ts),tl=e5("server/discover",{}),tc=ar({toolsListChanged:o2().optional(),promptsListChanged:o2().optional(),resourcesListChanged:o2().optional(),resourceSubscriptions:ae(ox()).optional()}),tu={notifications:tc},td=e5("subscriptions/listen",tu),tp=ek.extend({"io.modelcontextprotocol/subscriptionId":a}),th=ao({_meta:tp,resultType:eP.default("complete")}),tf={"tools/call":e3("tools/call",e6),"tools/list":e3("tools/list",e8),"prompts/get":e3("prompts/get",{name:ox(),arguments:ad(ox(),ox()).optional()}),"prompts/list":e3("prompts/list",e8),"resources/list":e3("resources/list",e8),"resources/templates/list":e3("resources/templates/list",e8),"resources/read":e3("resources/read",{uri:ox()}),"completion/complete":e3("completion/complete",ts),"server/discover":e3("server/discover",{}),"subscriptions/listen":e3("subscriptions/listen",tu)};function tm(e){return ao({_meta:eT,...e})}let ty={"tools/call":tm({content:ae(G),structuredContent:o6().optional(),isError:o2().optional()}),"tools/list":tm({ttlMs:oY().int().min(0),cacheScope:ah(["public","private"]),tools:ae(e$),nextCursor:o.optional()}),"prompts/get":tm({description:ox().optional(),messages:ae(Z)}),"prompts/list":tm({ttlMs:oY().int().min(0),cacheScope:ah(["public","private"]),prompts:ae(D),nextCursor:o.optional()}),"resources/list":tm({ttlMs:oY().int().min(0),cacheScope:ah(["public","private"]),resources:ae(I),nextCursor:o.optional()}),"resources/templates/list":tm({ttlMs:oY().int().min(0),cacheScope:ah(["public","private"]),resourceTemplates:ae(A),nextCursor:o.optional()}),"resources/read":tm({ttlMs:oY().int().min(0),cacheScope:ah(["public","private"]),contents:ae(ai([j,C]))}),"completion/complete":tm({completion:ar({values:ae(ox()).max(100),total:oY().int().optional(),hasMore:o2().optional()}).loose()}),"server/discover":tm({ttlMs:oY().int().min(0).catch(0),cacheScope:ah(["public","private"]).catch("private"),supportedVersions:ae(ox()),capabilities:e_,instructions:ox().optional()}),"subscriptions/listen":tm({})},tg=ao({"io.modelcontextprotocol/subscriptionId":a.optional()}),tv=ar({method:am("notifications/subscriptions/acknowledged"),params:ar({_meta:tg.optional(),notifications:tc})}),tb=ar({_meta:tg.optional(),requestId:a,reason:ox().optional()}),t_=ar({method:am("notifications/cancelled"),params:tb}),tS=e=>ar({jsonrpc:am("2.0"),id:ai([ox(),oY().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:a,RoleSchema:i,LoggingLevelSchema:s,TaskMetadataSchema:l,RelatedTaskMetadataSchema:c,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:p,NotificationsParamsSchema:h,NotificationSchema:f,IconSchema:m,IconsSchema:y,BaseMetadataSchema:g,ImplementationSchema:v,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:$,ClientCapabilitiesSchema:w,ServerCapabilitiesSchema:E,ProgressSchema:R,ProgressNotificationParamsSchema:P,ProgressNotificationSchema:k,LoggingMessageNotificationParamsSchema:T,LoggingMessageNotificationSchema:O,ResourceContentsSchema:x,TextResourceContentsSchema:j,BlobResourceContentsSchema:C,AnnotationsSchema:N,ResourceSchema:I,ResourceTemplateSchema:A,ResourceListChangedNotificationSchema:M,ResourceUpdatedNotificationParamsSchema:q,ResourceUpdatedNotificationSchema:z,PromptArgumentSchema:L,PromptSchema:D,PromptListChangedNotificationSchema:U,TextContentSchema:V,ImageContentSchema:F,AudioContentSchema:H,ToolUseContentSchema:K,EmbeddedResourceSchema:J,ResourceLinkSchema:B,ContentBlockSchema:G,PromptMessageSchema:Z,ToolAnnotationsSchema:W,ToolListChangedNotificationSchema:X,ModelHintSchema:Y,ModelPreferencesSchema:Q,ToolChoiceSchema:ee,BooleanSchemaSchema:et,StringSchemaSchema:er,NumberSchemaSchema:eo,UntitledSingleSelectEnumSchemaSchema:ea,TitledSingleSelectEnumSchemaSchema:ei,LegacyTitledEnumSchemaSchema:es,SingleSelectEnumSchemaSchema:en,UntitledMultiSelectEnumSchemaSchema:el,TitledMultiSelectEnumSchemaSchema:ec,MultiSelectEnumSchemaSchema:eu,EnumSchemaSchema:ed,PrimitiveSchemaDefinitionSchema:ep,ElicitRequestFormParamsSchema:eh,ResourceTemplateReferenceSchema:ef,PromptReferenceSchema:em,RootSchema:ey,ClientCapabilities2026Schema:ev,ServerCapabilities2026Schema:e_,RequestMetaEnvelopeSchema:eS,ToolSchema:e$,ToolResultContentSchema:ew,SamplingMessageContentBlockSchema:eE,SamplingMessageSchema:eR,ResultTypeSchema:eP,ResultMetaSchema:ek,ResultSchema:ex,PaginatedResultSchema:ej,CallToolResultSchema:eC,ListToolsResultSchema:eN,ListPromptsResultSchema:eI,GetPromptResultSchema:eA,ListResourcesResultSchema:eM,ListResourceTemplatesResultSchema:eq,ReadResourceResultSchema:ez,CompleteResultSchema:eL,CacheableResultSchema:eD,DiscoverResultSchema:eU,CreateMessageRequestParamsSchema:eV,CreateMessageRequestSchema:eF,ListRootsRequestSchema:eH,CreateMessageResultSchema:eK,ListRootsResultSchema:eJ,ElicitResultSchema:eB,ElicitRequestURLParamsSchema:eG,ElicitRequestParamsSchema:eZ,ElicitRequestSchema:eW,InputRequestSchema:eX,InputResponseSchema:eY,InputRequestsSchema:eQ,InputResponsesSchema:e0,InputRequiredResultSchema:e1,InputResponseRequestParamsSchema:e9,CallToolRequestSchema:e7,ListToolsRequestSchema:te,ListPromptsRequestSchema:tt,GetPromptRequestSchema:tr,ListResourcesRequestSchema:to,ListResourceTemplatesRequestSchema:ta,ReadResourceRequestSchema:ti,CompleteRequestSchema:tn,DiscoverRequestSchema:tl,SubscriptionFilterSchema:tc,SubscriptionsListenRequestSchema:td,SubscriptionsListenResultMetaSchema:tp,SubscriptionsListenResultSchema:th,dispatchRequestSchemas:tf,dispatchResultSchemas:ty,NotificationMetaSchema:tg,SubscriptionsAcknowledgedNotificationSchema:tv,CancelledNotificationParamsSchema:tb,CancelledNotificationSchema:t_,notificationSchemas2026:{"notifications/cancelled":t_,"notifications/progress":k,"notifications/message":O,"notifications/resources/updated":z,"notifications/resources/list_changed":M,"notifications/tools/list_changed":X,"notifications/prompts/list_changed":U,"notifications/subscriptions/acknowledged":tv},JSONRPCResultResponseSchema:tS(ex),CallToolResultResponseSchema:tS(ai([eC,e1])),ListToolsResultResponseSchema:tS(eN),ListPromptsResultResponseSchema:tS(eI),GetPromptResultResponseSchema:tS(ai([eA,e1])),ListResourcesResultResponseSchema:tS(eM),ListResourceTemplatesResultResponseSchema:tS(eq),ReadResourceResultResponseSchema:tS(ai([ez,e1])),CompleteResultResponseSchema:tS(eL),DiscoverResultResponseSchema:tS(eU)}}()}let ux=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"],uj=Symbol("modelcontextprotocol.resultCacheHintFallback");function uC(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function uN(e){return"public"===e||"private"===e}let uI=((y={})[y.ParseError=-32700]="ParseError",y[y.InvalidRequest=-32600]="InvalidRequest",y[y.MethodNotFound=-32601]="MethodNotFound",y[y.InvalidParams=-32602]="InvalidParams",y[y.InternalError=-32603]="InternalError",y[y.ResourceNotFound=-32002]="ResourceNotFound",y[y.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",y[y.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",y[y.UrlElicitationRequired=-32042]="UrlElicitationRequired",y);var uA=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](e){return ue(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return ue(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="ProtocolError",c7(this,new.target)}static fromError(t,r,o){return t===uI.UrlElicitationRequired&&o&&o.elicitations?new uq(o.elicitations,r):t===uI.UnsupportedProtocolVersion&&o&&Array.isArray(o.supported)&&"string"==typeof o.requested?new uz({supported:o.supported,requested:o.requested},r):(t===uI.InvalidParams||t===uI.ResourceNotFound)&&"string"==typeof o?.uri&&(t===uI.ResourceNotFound||1===Object.keys(o).length)?new uM(o.uri,r):t===uI.MissingRequiredClientCapability&&o&&null!==o.requiredCapabilities&&"object"==typeof o.requiredCapabilities&&!Array.isArray(o.requiredCapabilities)?new uL({requiredCapabilities:o.requiredCapabilities},r):new e(t,r,o)}},uM=class extends uA{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(uI.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},uq=class extends uA{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(uI.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},uz=class extends uA{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(uI.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},uL=class extends uA{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(uI.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}};let uD=["tools/call","prompts/get","resources/read"],uU=["elicitation/create","sampling/createMessage","roots/list"];function uV(){if(n)return n;let e=uO();return n={request:{"elicitation/create":ar({method:am("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":ar({method:am("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":ar({method:am("roots/list"),params:ao({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}}}function uF(e){return uU.includes(e)}function uH(e){return uF(e)?uV().request[e]:void 0}let uK={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},uJ={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function uB(e){return Object.prototype.hasOwnProperty.call(uK,e)}function uG(e){return Object.prototype.hasOwnProperty.call(uJ,e)}function uZ(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function uW(e,t){if(void 0===e)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}Object.keys(uK),Object.keys(uJ);let uX={ok:!1,reason:"not-in-era"},uY=[aq,aD],uQ={era:"2026-07-28",hasRequestMethod:uB,hasNotificationMethod:uG,hasInputRequestMethod:e=>void 0!==uH(e),validateRequest:(e,t)=>uW(uB(e)?uO().dispatchRequestSchemas[e]:void 0,t),validateResult:(e,t)=>uW(Object.prototype.hasOwnProperty.call(uK,e)?uO().dispatchResultSchemas[e]:void 0,t),validateNotification:(e,t)=>uW(uG(e)?uO().notificationSchemas2026[e]:void 0,t),validateInputRequest:(e,t)=>uW(uH(e),t),validateInputResponse:(e,t)=>uW(uF(e)?uV().response[e]:void 0,t),samplingResultVariant:()=>uX,outboundEnvelope:e=>({[aq]:e.protocolVersion,[az]:e.clientInfo,[aD]:e.clientCapabilities,...void 0!==e.logLevel&&{[aV]:e.logLevel}}),validateEnvelopeMeta(e){let t=[];for(let r of uY)r in e||t.push({key:r,problem:"missing"});let r=uO().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let e of r.error.issues){let r=e.path.map(String),o=r.length>0?r.join("."):"_meta";1===r.length&&t.some(e=>e.key===o&&"missing"===e.problem)||t.push({key:o,problem:e.message})}return t},projectCallToolResult:e=>uu(e),inputRequestSchema:uH,decodeResult(e,t){if(!uZ(t))return{kind:"invalid",error:new ua(uo.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(void 0===r)return{kind:"invalid",error:new ua(uo.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if("string"!=typeof r)return{kind:"invalid",error:new ua(uo.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if("input_required"===r){let r=t.inputRequests,o=uZ(r)?r:{},a=t.requestState;return 0===Object.keys(o).length&&"string"!=typeof a?{kind:"invalid",error:new ua(uo.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:o,..."string"==typeof a&&{requestState:a}}}if("complete"!==r)return{kind:"invalid",error:new ua(uo.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=function(){if(l)return l;let e=uO();return l={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema}}(),a=Object.hasOwn(o,e)?o[e]:void 0;if(void 0!==a){let r=a.safeParse(t);if(!r.success)return{kind:"invalid",error:new ua(uo.InvalidResult,`Invalid result for ${e}: ${r.error}`,{method:e})}}let i={...t};return delete i.resultType,{kind:"complete",result:i}},encodeResult:(e,t,r)=>(function(e,t){if(void 0===t)return e;let r=e._meta;return void 0===r?{...e,_meta:{[aL]:t}}:null===r||"object"!=typeof r||Array.isArray(r)||void 0!==r[aL]?e:{...e,_meta:{...r,[aL]:t}}})(function(e,t){var r,o;let a=t[uj];if("complete"!==t.resultType||!ux.includes(e)){let e;return void 0===a?t:(e={...t},delete e[uj],e)}let i=uC(t.ttlMs)?t.ttlMs:void 0!==(r=a)&&uC(r.ttlMs)?r.ttlMs:0,s=uN(t.cacheScope)?t.cacheScope:void 0!==(o=a)&&uN(o.cacheScope)?o.cacheScope:"private",n={...t,ttlMs:i,cacheScope:s};return delete n[uj],n}(e,function(e,t){let r=t.resultType;if(void 0===r)return{...t,resultType:"complete"};if("complete"===r||uD.includes(e))return t;throw new uA(uI.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}(e,function(e,t){let r=t,o=!1,a=()=>(o||(r={...r},o=!0),r),i=t.tools;"tools/list"===e&&Array.isArray(i)&&i.some(e=>uZ(e)&&"execution"in e)&&(a().tools=i.map(e=>{if(!uZ(e)||!("execution"in e))return e;let t={...e};return delete t.execution,t}));let s=t.capabilities;if(uZ(s)&&"tasks"in s){let e={...s};delete e.tasks,a().capabilities=e}return r}(e,t))),r),encodeErrorCode:e=>-32002===e?-32602:e,checkInboundEnvelope(e){if(void 0===e.envelope)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=uO().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join("; ")}`}},u0="2026-07-28";function u1(e){return void 0!==e&&e>=us?uQ:uT}function u2(e){return void 0!==e.revision?u1(e.revision).era:"modern"===e.era?uQ.era:uT.era}function u9(e){return u5.some(t=>t.hasRequestMethod(e))}function u4(e){return u5.some(t=>t.hasNotificationMethod(e))}let u5=[uT,uQ];var u3=((e,t)=>{let r={};for(var o in e)cX(r,o,{get:e[o],enumerable:!0});return t&&cX(r,Symbol.toStringTag,{value:"Module"}),r})({AnnotationsSchema:()=>iI,AudioContentSchema:()=>se,BaseMetadataSchema:()=>is,BaseRequestParamsSchema:()=>aX,BlobResourceContentsSchema:()=>iC,BooleanSchemaSchema:()=>sA,CallToolRequestParamsSchema:()=>sm,CallToolRequestSchema:()=>sy,CallToolResultSchema:()=>sh,CancelTaskRequestSchema:()=>nd,CancelTaskResultSchema:()=>np,CancelledNotificationParamsSchema:()=>ir,CancelledNotificationSchema:()=>io,ClientCapabilitiesSchema:()=>ih,ClientNotificationSchema:()=>nf,ClientRequestSchema:()=>nh,ClientResultSchema:()=>nm,ClientTasksCapabilitySchema:()=>id,CompatibilityCallToolResultSchema:()=>sf,CompleteRequestParamsSchema:()=>s2,CompleteRequestSchema:()=>s9,CompleteResultSchema:()=>s4,ContentBlockSchema:()=>sa,CreateMessageRequestParamsSchema:()=>sj,CreateMessageRequestSchema:()=>sC,CreateMessageResultSchema:()=>sN,CreateMessageResultWithToolsSchema:()=>sI,CreateTaskResultSchema:()=>nr,CursorSchema:()=>aB,DiscoverRequestSchema:()=>i_,DiscoverResultSchema:()=>iS,ElicitRequestFormParamsSchema:()=>sB,ElicitRequestParamsSchema:()=>sZ,ElicitRequestSchema:()=>sW,ElicitRequestURLParamsSchema:()=>sG,ElicitResultSchema:()=>sQ,ElicitationCompleteNotificationParamsSchema:()=>sX,ElicitationCompleteNotificationSchema:()=>sY,EmbeddedResourceSchema:()=>sr,EmptyResultSchema:()=>it,EnumSchemaSchema:()=>sK,GetPromptRequestParamsSchema:()=>i3,GetPromptRequestSchema:()=>i6,GetPromptResultSchema:()=>ss,GetTaskPayloadRequestSchema:()=>nn,GetTaskPayloadResultSchema:()=>nl,GetTaskRequestSchema:()=>ni,GetTaskResultSchema:()=>ns,IconSchema:()=>ia,IconsSchema:()=>ii,ImageContentSchema:()=>i7,ImplementationSchema:()=>il,InitializeRequestParamsSchema:()=>im,InitializeRequestSchema:()=>iy,InitializeResultSchema:()=>iv,InitializedNotificationSchema:()=>ib,JSONArraySchema:()=>aK,JSONObjectSchema:()=>aH,JSONRPCErrorResponseSchema:()=>a8,JSONRPCMessageSchema:()=>a7,JSONRPCNotificationSchema:()=>a3,JSONRPCRequestSchema:()=>a5,JSONRPCResponseSchema:()=>ie,JSONRPCResultResponseSchema:()=>a6,JSONValueSchema:()=>aF,LegacyTitledEnumSchemaSchema:()=>sD,ListChangedOptionsBaseSchema:()=>sv,ListPromptsRequestSchema:()=>i4,ListPromptsResultSchema:()=>i5,ListResourceTemplatesRequestSchema:()=>iL,ListResourceTemplatesResultSchema:()=>iD,ListResourcesRequestSchema:()=>iq,ListResourcesResultSchema:()=>iz,ListRootsRequestSchema:()=>s3,ListRootsResultSchema:()=>s6,ListTasksRequestSchema:()=>nc,ListTasksResultSchema:()=>nu,ListToolsRequestSchema:()=>sd,ListToolsResultSchema:()=>sp,LoggingLevelSchema:()=>sb,LoggingMessageNotificationParamsSchema:()=>s$,LoggingMessageNotificationSchema:()=>sw,ModelHintSchema:()=>sE,ModelPreferencesSchema:()=>sR,MultiSelectEnumSchemaSchema:()=>sH,NotificationSchema:()=>a1,NotificationsParamsSchema:()=>a0,NumberSchemaSchema:()=>sq,PaginatedRequestParamsSchema:()=>iP,PaginatedRequestSchema:()=>ik,PaginatedResultSchema:()=>iT,PingRequestSchema:()=>i$,PrimitiveSchemaDefinitionSchema:()=>sJ,ProgressNotificationParamsSchema:()=>iE,ProgressNotificationSchema:()=>iR,ProgressSchema:()=>iw,ProgressTokenSchema:()=>aJ,PromptArgumentSchema:()=>i2,PromptListChangedNotificationSchema:()=>sn,PromptMessageSchema:()=>si,PromptReferenceSchema:()=>s1,PromptSchema:()=>i9,ReadResourceRequestParamsSchema:()=>iU,ReadResourceRequestSchema:()=>iV,ReadResourceResultSchema:()=>iF,RelatedTaskMetadataSchema:()=>aZ,RequestIdSchema:()=>a4,RequestMetaSchema:()=>aW,RequestSchema:()=>aQ,ResourceContentsSchema:()=>iO,ResourceLinkSchema:()=>so,ResourceListChangedNotificationSchema:()=>iH,ResourceRequestParamsSchema:()=>iU,ResourceSchema:()=>iA,ResourceTemplateReferenceSchema:()=>s0,ResourceTemplateSchema:()=>iM,ResourceUpdatedNotificationParamsSchema:()=>i0,ResourceUpdatedNotificationSchema:()=>i1,ResultMetaObjectSchema:()=>a2,ResultSchema:()=>a9,RoleSchema:()=>iN,RootSchema:()=>s5,RootsListChangedNotificationSchema:()=>s8,SamplingContentSchema:()=>sT,SamplingMessageContentBlockSchema:()=>sO,SamplingMessageSchema:()=>sx,ServerCapabilitiesSchema:()=>ig,ServerNotificationSchema:()=>ng,ServerRequestSchema:()=>ny,ServerResultSchema:()=>nv,ServerTasksCapabilitySchema:()=>ip,SetLevelRequestParamsSchema:()=>s_,SetLevelRequestSchema:()=>sS,SingleSelectEnumSchemaSchema:()=>sU,StringSchemaSchema:()=>sM,SubscribeRequestParamsSchema:()=>iU,SubscribeRequestSchema:()=>iK,SubscriptionFilterSchema:()=>iB,SubscriptionsAcknowledgedNotificationParamsSchema:()=>iW,SubscriptionsAcknowledgedNotificationSchema:()=>iX,SubscriptionsListenRequestParamsSchema:()=>iG,SubscriptionsListenRequestSchema:()=>iZ,SubscriptionsListenResultMetaSchema:()=>iY,SubscriptionsListenResultSchema:()=>iQ,TaskAugmentedRequestParamsSchema:()=>aY,TaskCreationParamsSchema:()=>s7,TaskMetadataSchema:()=>aG,TaskSchema:()=>nt,TaskStatusNotificationParamsSchema:()=>no,TaskStatusNotificationSchema:()=>na,TaskStatusSchema:()=>ne,TextContentSchema:()=>i8,TextResourceContentsSchema:()=>ix,TitledMultiSelectEnumSchemaSchema:()=>sF,TitledSingleSelectEnumSchemaSchema:()=>sL,ToolAnnotationsSchema:()=>sl,ToolChoiceSchema:()=>sP,ToolExecutionSchema:()=>sc,ToolListChangedNotificationSchema:()=>sg,ToolResultContentSchema:()=>sk,ToolSchema:()=>su,ToolUseContentSchema:()=>st,UnsubscribeRequestParamsSchema:()=>iU,UnsubscribeRequestSchema:()=>iJ,UntitledMultiSelectEnumSchemaSchema:()=>sV,UntitledSingleSelectEnumSchemaSchema:()=>sz});let u6=e=>a6.safeParse(e).success,u8=e=>a8.safeParse(e).success,u7=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&"input_required"===e.resultType,de="x-mcp-header",dt=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,dr=new Set(["string","integer","boolean","number"]);function da(e){let t=[],r=new Map,o=(e,a,i)=>{if(null===e||"object"!=typeof e)return;if(de in e){if(!i||0===a.length)return`${dn(a)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let o=e[de];if("string"!=typeof o||0===o.length)return`${dn(a)}: x-mcp-header MUST be a non-empty string`;if(!dt.test(o))return`${dn(a)}: x-mcp-header '${o}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let s="string"==typeof e.type?e.type:void 0;if(void 0===s||!dr.has(s))return`${dn(a)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${s??"<none>"}`;let n=o.toLowerCase(),l=r.get(n);if(void 0!==l)return`x-mcp-header '${o}' is not case-insensitively unique (also declared as '${l}')`;r.set(n,o),t.push({path:a,headerName:o,type:s})}let s=e.properties;if(null!==s&&"object"==typeof s)for(let[e,t]of Object.entries(s)){let r=o(t,[...a,e],i);if(void 0!==r)return r}for(let t of di){let r=e[t];if(void 0!==r)for(let e of Array.isArray(r)?r:null!==r&&"object"==typeof r&&ds.has(t)?Object.values(r):[r]){let r=o(e,[...a,`<${t}>`],!1);if(void 0!==r)return r}}},a=o(e,[],!0);return void 0===a?{valid:!0,declarations:t}:{valid:!1,reason:a}}let di=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],ds=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function dn(e){return 0===e.length?"<root>":e.join(".")}let dl="=?base64?";function dc(e){return!function(e){if(0===e.length||e.startsWith(dl)&&e.endsWith("?=")||e!==e.trim())return!0;for(let t=0;t<e.length;t++){let r=e.codePointAt(t);if(9!==r&&(!(r>=32)||!(r<=126)))return!0}return!1}(e)?e:`${dl}${function(e){let t=new TextEncoder().encode(e),r="";for(let e of t)r+=String.fromCodePoint(e);return btoa(r)}(e)}?=`}function du(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function dd(e){if(null==e)return!1;let t=typeof e;return("object"===t||"function"===t)&&"~standard"in e&&"function"==typeof e["~standard"]?.validate}uI.InvalidRequest,uI.UnsupportedProtocolVersion,uI.InvalidParams,uI.MethodNotFound,uI.InvalidParams,uI.MissingRequiredClientCapability,uI.ParseError,uI.InvalidRequest,uI.MethodNotFound,uI.UnsupportedProtocolVersion,uI.MissingRequiredClientCapability;let dp=!1,dh="draft-2020-12";async function df(e,t){let r=await e["~standard"].validate(t);return r.issues&&r.issues.length>0?{success:!1,error:r.issues.map(e=>e.path?.length?`${e.path.map(e=>String("object"==typeof e?e.key:e)).join(".")}: ${e.message}`:e.message).join(", ")}:{success:!0,data:r.value}}let dm=/\\\.\\d\{(\d+)\}/;function dy(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let dg=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function dv(e){return dg.has(e)||e.startsWith("x-")}let db=new Set(["$schema",...Object.keys(sB.shape.requestedSchema.shape)]),d_={string:du([sM,sz,sL,sD]),number:du([sq]),integer:du([sq]),boolean:du([sA]),array:du([sV,sF])},dS=new Set(sM.shape.format.unwrap().options);async function d$(e){let{config:t,method:r,originalParams:o,requestOptions:a,hooks:i,signal:s}=e,n=e.flowStartedAt??Date.now(),l=e.firstPayload,c=0;for(;;){let e;if((c+=1)>t.maxRounds){var u;throw new ua(uo.InputRequiredRoundsExceeded,(u=t.maxRounds,`Multi-round-trip request '${r}' still required input after ${u} rounds (inputRequired.maxRounds)`),{rounds:t.maxRounds,lastResult:{inputRequests:l.inputRequests,...void 0!==l.requestState&&{requestState:l.requestState}}})}a.onprogress?.({progress:c,message:`Fulfilling input required by '${r}' (round ${c})`});let d=Object.entries(l.inputRequests??{});if(d.length>0){let t=function(e){let t=new AbortController,r=()=>t.abort(e?.reason);return e?.addEventListener("abort",r,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:e=>t.abort(e),dispose:()=>e?.removeEventListener("abort",r)}}(s);try{let r=await Promise.all(d.map(async([e,r])=>{try{return[e,await i.dispatchInputRequest(e,r,t.signal)]}catch(e){throw t.abort(e),e}}));e=Object.fromEntries(r)}finally{t.dispose()}}else await function(e,t){return new Promise((e,r)=>{if(t?.aborted)return void r(t.reason instanceof ua?t.reason:new ua(uo.RequestTimeout,String(t.reason)));let o=setTimeout(()=>{t?.removeEventListener("abort",a),e()},250),a=()=>{clearTimeout(o),r(t?.reason instanceof ua?t.reason:new ua(uo.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",a,{once:!0})})}(0,s);let p={...void 0!==a.timeout&&{timeout:a.timeout}};if(void 0!==a.maxTotalTimeout){let e=Date.now()-n,t=a.maxTotalTimeout-e;if(t<=0)throw new ua(uo.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:a.maxTotalTimeout,totalElapsed:e});p.maxTotalTimeout=t}let h=await i.retry(function(e,t,r){let o=void 0!==t&&Object.keys(t).length>0;return o||void 0!==r?{...e,...o&&{inputResponses:t},...void 0!==r&&{requestState:r}}:e}(o,e,l.requestState),p);if(u7(h)){l={inputRequests:h.inputRequests??{},...void 0!==h.requestState&&{requestState:h.requestState}};continue}return h}}Object.assign(function(e){let t=void 0!==e.inputRequests&&Object.keys(e.inputRequests).length>0,r="string"==typeof e.requestState;if(!t&&!r)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...void 0!==e.inputRequests&&{inputRequests:e.inputRequests},...void 0!==e.requestState&&{requestState:e.requestState}}},{elicit(e){try{return{method:"elicitation/create",params:function(e){var t;if(!dd(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let r=e.requestedSchema["~standard"].vendor,o=function(e,t){let r={},o=[];for(let[a,i]of Object.entries(e))"properties"===a&&dy(i)?r[a]=Object.fromEntries(Object.entries(i).map(([e,r])=>[e,function(e,t,r,o){if(!dy(e))return e;let a="string"==typeof e.type&&Object.hasOwn(d_,e.type)?d_[e.type]:void 0;if(void 0===a)return e;let i={};for(let[n,l]of Object.entries(e))if(a.has(n)||dv(n))i[n]=l;else if("pattern"===n&&"string"===e.type&&"string"==typeof e.format)if(dS.has(e.format)){var s;"string"==typeof l&&(s=e.format,"zod"!==r||(function(e,t){let r;switch(e){case"email":r=[rR(oC,void 0)];break;case"uri":r=[rk(oA,void 0)];break;case"date":r=[oc()];break;case"date-time":let o,a;o=dm.exec(t),a=[void 0,-1,0],o&&a.push(Number(o[1])),r=[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>a.map(r=>on({local:e,offset:t,precision:r}))))}return new Set(r.map(e=>{let t;return t=oi(e,{target:dh,io:"input"}),"string"==typeof t.pattern?t.pattern:void 0}).filter(e=>void 0!==e))})(s,l).has(l))||o.push(`${t}.${n}`)}else i[n]=l;else o.push(`${t}.${n}`);return i}(r,`properties.${e}`,t,o)])):db.has(a)?r[a]=i:dv(a)||o.push(a);if(o.length>0)throw new uA(uI.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}(function(e){try{return function(e,t="input"){let r,o=e["~standard"];if(o.jsonSchema)r=o.jsonSchema[t]({target:dh});else if("zod"===o.vendor){if(!("_zod"in e))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");dp||(dp=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=oi(e,{target:dh,io:t})}else throw Error(`Schema library "${o.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if("output"===t)return void 0!==r.type||!function e(t){if("properties"in t||"patternProperties"in t||"additionalProperties"in t||"required"in t)return!0;for(let r of["oneOf","anyOf","allOf"]){let o=t[r];if(Array.isArray(o)&&o.length>0)return o.every(t=>null!==t&&"object"==typeof t&&("object"===t.type||e(t)))}return!1}(r)?r:{type:"object",...r};if(void 0!==r.type&&"object"!==r.type)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...r}}(e,"input")}catch(t){let e=t instanceof Error?t.message:String(t);throw new uA(uI.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${e}`)}}(e.requestedSchema),r),a=(t=sB.shape.requestedSchema,om(t,o));if(!a.success)throw new uA(uI.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${function(e,t){if(!dy(e.properties))return t;let r=Object.entries(e.properties).filter(([,e])=>!om(sJ,e).success).map(([e])=>`properties.${e}`);return r.length>0?r.join(", "):t}(o,a.error.message)}`);let i=function e(t,r,o=""){return Array.isArray(t)&&Array.isArray(r)?t.flatMap((t,a)=>e(t,r[a],`${o}[${a}]`)):dy(t)&&dy(r)?Object.entries(t).flatMap(([t,a])=>{let i=o?`${o}.${t}`:t;return Object.prototype.hasOwnProperty.call(r,t)?e(a,r[t],i):dv(t)?[]:[i]}):[]}(o,a.data);if(i.length>0)throw new uA(uI.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(", ")}`);let s=(a.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(a.data.properties,e));if(s.length>0)throw new uA(uI.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:a.data}}(e)}}catch(e){throw e instanceof uA?TypeError(e.message,{cause:e}):e}},elicitUrl:e=>({method:"elicitation/create",params:{...e,mode:"url"}}),createMessage:e=>({method:"sampling/createMessage",params:e}),listRoots:()=>({method:"roots/list"})});let dw={},dE={};function dR(e,t){let r=e.slice(0,-6);dw[r]=t,dE[r]=e=>t.safeParse(e).success}for(let e of["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"])dR(e,u3[e]);for(let[e,t]of Object.entries({IdJagTokenExchangeResponseSchema:nR,OAuthClientInformationFullSchema:nx,OAuthClientInformationSchema:nO,OAuthClientMetadataSchema:nT,OAuthClientRegistrationErrorSchema:nj,OAuthErrorResponseSchema:nP,OAuthMetadataSchema:nS,OAuthProtectedResourceMetadataSchema:n_,OAuthTokenRevocationRequestSchema:nC,OAuthTokensSchema:nE,OpenIdProviderDiscoveryMetadataSchema:nw,OpenIdProviderMetadataSchema:n$}))dR(e,t);Object.freeze(dw);let dP=Object.freeze(dE),dk=[aq,az,aD,aV],dT=["inputResponses","requestState"];function dO(e,t){let r=e.params;if(!dN(r))return{message:e,lifted:{}};let o=r._meta,a=dN(o)?dk.filter(e=>e in o):[],i="request"===t?dT.filter(e=>e in r):[];if(0===a.length&&0===i.length)return{message:e,lifted:{}};let s={},n={...r};if(a.length>0&&dN(o)){let e={},t={...o};for(let r of a)e[r]=o[r],delete t[r];s.envelope=e,Object.keys(t).length>0?n._meta=t:delete n._meta}for(let e of i)"inputResponses"===e&&(s.inputResponses=n[e]),"requestState"===e&&(s.requestState=n[e]),delete n[e];return{message:{...e,params:n},lifted:s}}function dx(e,t){let r=e.validateResult(t,void 0);if(r.ok||"not-in-era"!==r.reason)return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(r){let o=e.validateResult(t,r);return o.ok?{value:o.value}:{issues:[{message:"invalid"===o.reason?o.message:`not-in-era: ${t}`}]}}}}}let dj=(g=void 0,()=>g);var dC=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??aM,this.setNotificationHandler("notifications/cancelled",e=>{this._oncancel(e)}),this.setNotificationHandler("notifications/progress",e=>{this._onprogress(e)}),this.setRequestHandler("ping",e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(void 0===t)return e;let r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new ua(uo.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,o,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:a,onTimeout:o})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new ua(uo.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let r=this.transport?.onerror;this._transport.onerror=e=>{r?.(e),this._onerror(e)};let o=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{if(o?.(e,t),u6(e)||u8(e))this._onresponse(e);else if(a5.safeParse(e).success)this._onrequest(e,t);else a3.safeParse(e).success?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;for(let e of(this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._timeoutInfo.values()))clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new ua(uo.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(r);for(let e of t.values())e.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=dO(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&"drop"===this._shouldDropInbound(e))return;if(t?.classification!==void 0){let e=u2(t.classification);if(e!==o.era)return void this._onerror(Error(`Era mismatch on inbound notification '${r.method}': classified as ${e} but this instance serves ${o.era}`))}if(u4(r.method)&&!o.hasNotificationMethod(r.method))return;let a=this._notificationHandlers.get(r.method),i=this.fallbackNotificationHandler;(void 0!==a||void 0!==i)&&Promise.resolve().then(()=>void 0===a?i(r):a(r,o)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){var r;let{message:o,lifted:a}=dO(e,"request"),i=this._negotiatedWireCodec();if(t?.classification===void 0&&"drop"===this._shouldDropInbound(e))return void this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));let s=this._transport,n=(e,t,r)=>{let a={jsonrpc:"2.0",id:o.id,error:{code:e,message:t,...void 0!==r&&{data:r}}};s?.send(a).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=u2(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${o.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;n(uI.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(u9(o.method)&&!i.hasRequestMethod(o.method))return void n(uI.MethodNotFound,"Method not found");let l=this._requestHandlers.get(o.method)??this.fallbackRequestHandler;if(void 0===l)return void n(uI.MethodNotFound,"Method not found");let c=i.checkInboundEnvelope(a);if(void 0!==c)return void n(uI.InvalidParams,c);let u=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:o.id}),d=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:o.id}),p=new AbortController;this._requestHandlerAbortControllers.set(o.id,p);let h=void 0===a.inputResponses?void 0:function(e){let t={},r=[];if(!dI(e))return{accepted:t,droppedKeys:r};for(let[o,a]of Object.entries(e)){if(!dI(a)||"method"in a||"result"in a){r.push(o);continue}t[o]=a}return{accepted:t,droppedKeys:r}}(a.inputResponses),f={sessionId:s?.sessionId,mcpReq:{id:o.id,method:o.method,_meta:o.params?._meta,...void 0!==a.envelope&&{envelope:a.envelope},...void 0!==h&&{inputResponses:h.accepted},...void 0!==h&&h.droppedKeys.length>0&&{droppedInputResponseKeys:h.droppedKeys},requestState:void 0===a.requestState?dj:(r=a.requestState,()=>r),signal:p.signal,send:(e,t,r)=>{let o=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(o,e.method),dd(t))return d(e,t,r);let a=dx(o,e.method);if(void 0===a)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return d(e,a,t)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(f,t);Promise.resolve().then(()=>l(o,m)).then(async e=>{let t;if(p.signal.aborted)return;try{t=i.encodeResult(o.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${o.method}: ${e}`)),n(uI.InternalError,"Internal error");return}let r={result:t,jsonrpc:"2.0",id:o.id};await s?.send(r)},async e=>{if(p.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:uI.InternalError,r={jsonrpc:"2.0",id:o.id,error:{code:i.encodeErrorCode(t),message:e.message??"Internal error",...void 0!==e.data&&{data:e.data}}};await s?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(o.id)===p&&this._requestHandlerAbortControllers.delete(o.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,o=Number(t),a=this._progressHandlers.get(o);if(!a)return void this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));let i=this._responseHandlers.get(o),s=this._timeoutInfo.get(o);if(s&&i&&s.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(e){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),i(e);return}a(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);void 0===r?this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`)):(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),r(u6(e)?e:uA.fromError(e.error.code,e.error.message,e.error.data)))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,r){let o=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(o,e.method),dd(t))return this._requestWithSchemaViaCodec(o,e,t,r);let a=dx(o,e.method);if(void 0===a)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(o,e,a,t)}_negotiatedWireCodec(){return u1(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(void 0===this._negotiatedProtocolVersion){let t=function(e){switch(e){case"initialize":case"notifications/initialized":return u1(void 0);case"server/discover":return u1(u0);default:return}}(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(u9(t)&&!e.hasRequestMethod(t))throw new ua(uo.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r)}_requestWithSchemaViaCodec(e,t,r,o){let a,i,{relatedRequestId:s,resumptionToken:n,onresumptiontoken:l,headers:c}=o??{},u=Date.now();return new Promise((d,p)=>{let h=e=>{p(e)};if(!this._transport)return void h(Error("Not connected"));if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){h(e);return}if(o?.signal?.aborted){let e=o.signal.reason;throw e instanceof ua?e:new ua(uo.RequestTimeout,String(e))}let f=e.era===u0&&!0===this._transport.hasPerRequestStream?new AbortController:void 0,m=this._requestMessageId++;i=m;let y={...t,jsonrpc:"2.0",id:m};o?.onprogress&&(this._progressHandlers.set(m,o.onprogress),y.params={...t.params,_meta:{...t.params?._meta,progressToken:m}});let g=this._envelopeOutbound(y),v=!1,b=e=>{v||(this._progressHandlers.delete(m),void 0===f?this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(e)}}),{relatedRequestId:s,resumptionToken:n,onresumptiontoken:l}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):f.abort(),p(e instanceof ua?e:new ua(uo.RequestTimeout,String(e))))};this._responseHandlers.set(m,a=>{let i;if(!o?.signal?.aborted){if(v=!0,a instanceof Error)return p(a);try{i=e.decodeResult(t.method,a.result)}catch(e){return p(e instanceof Error?e:Error(String(e)))}if("invalid"===i.kind)return p(i.error);if("input_required"===i.kind){var s;return o?.allowInputRequired===!0?d({resultType:"input_required",inputRequests:(s=i).inputRequests,...void 0!==s.requestState&&{requestState:s.requestState}}):d(this._resolveNonCompleteResult(i,{codec:e,request:t,resultSchema:r,options:o,flowStartedAt:u,retry:(o,a)=>this._requestWithSchemaViaCodec(e,void 0===o?{method:t.method}:{method:t.method,params:o},r,a)}))}df(r,i.result).then(e=>{e.success?d(e.data):p(new ua(uo.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},p)}}),a=()=>b(o?.signal?.reason),o?.signal?.addEventListener("abort",a,{once:!0});let _=o?.timeout??6e4;this._setupTimeout(m,_,o?.maxTotalTimeout,()=>b(new ua(uo.RequestTimeout,"Request timed out",{timeout:_})),o?.resetTimeoutOnProgress??!1),this._transport.send(g,{relatedRequestId:s,resumptionToken:n,onresumptiontoken:l,headers:c,requestSignal:f?.signal}).catch(e=>{this._progressHandlers.delete(m),p(e)})}).finally(()=>{a&&o?.signal?.removeEventListener("abort",a),void 0!==i&&(this._responseHandlers.delete(i),this._cleanupTimeout(i))})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new ua(uo.NotConnected,"Not connected");if(u4(t.method)&&!e.hasNotificationMethod(t.method))throw new ua(uo.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let o=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(o,r).catch(e=>this._onerror(e))});return}await this._transport.send(o,r)}setRequestHandler(e,t,r){let o;if(this.assertRequestHandlerCapability(e),"function"==typeof t){if(!u9(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(r,o)=>{let a=this._negotiatedWireCodec(),i=a.validateRequest(e,r);if(i.ok||"not-in-era"!==i.reason||(i=a.validateInputRequest(e,r)),!i.ok){if("not-in-era"===i.reason)throw new uA(uI.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(i.message)}return Promise.resolve(t(i.value,o))}}else if(r)o=async(o,a)=>{let i=await df(t.params,{...o.params});if(!i.success)throw new uA(uI.InvalidParams,`Invalid params for ${e}: ${i.error}`);return r(i.data,a)};else throw TypeError("setRequestHandler: handler is required");this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if("function"==typeof t){if(!u4(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(r,o)=>{let a=o.validateNotification(e,r);if(!a.ok){if("not-in-era"===a.reason)throw new uA(uI.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(a.message)}return Promise.resolve(t(a.value))});return}if(!r)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async o=>{let a=await df(t.params,{...o.params});if(!a.success)throw new uA(uI.InvalidParams,`Invalid params for notification ${e}: ${a.error}`);await r(a.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function dN(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function dI(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function dA(e){throw new ua(uo.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}async function dM(e,t,r,o,a){var i;if(!dI(o)||"string"!=typeof o.method)throw new ua(uo.InvalidResult,`Invalid input request '${r}': each inputRequests entry must be an embedded request object with a method`,{key:r});let s=o.method;if(!t.hasInputRequestMethod(s))throw new ua(uo.InvalidResult,`Invalid input request '${r}': '${s}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:r,method:s});let n=e.getRequestHandler(s);if(void 0===n)throw new ua(uo.CapabilityNotSupported,`Cannot fulfil input request '${r}': no handler is registered for '${s}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:r,method:s});let l=dI(o.params)?o.params:void 0;return await n({jsonrpc:"2.0",id:r,method:s,...void 0!==l&&{params:l}},e.buildContext({sessionId:e.sessionId,mcpReq:{id:r,method:s,_meta:l?._meta,requestState:(i=void 0,()=>i),signal:a,send:()=>dA("send"),notify:()=>dA("notify")}}))}var dq=c9(c2(e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function a(e){this.parameters=Object.create(null),this.type=e}e.parse=function(e){if(!e)throw TypeError("argument string is required");var i,s,n,l="object"==typeof e?function(e){var t;if("function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]),"string"!=typeof t)throw TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof l)throw TypeError("argument string is required to be a string");var c=l.indexOf(";"),u=-1!==c?l.slice(0,c).trim():l.trim();if(!o.test(u))throw TypeError("invalid media type");var d=new a(u.toLowerCase());if(-1!==c){for(t.lastIndex=c;s=t.exec(l);){if(s.index!==c)throw TypeError("invalid parameter format");c+=s[0].length,i=s[1].toLowerCase(),34===(n=s[2]).charCodeAt(0)&&-1!==(n=n.slice(1,-1)).indexOf("\\")&&(n=n.replace(r,"$1")),d.parameters[i]=n}if(c!==l.length)throw TypeError("invalid parameter format")}return d}})(),1),dz=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??0xa00000}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){for(;this._buffer;){let t=this._buffer.indexOf("\n");if(-1===t)break;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");this._buffer=this._buffer.subarray(t+1);try{var e;return e=r,a7.parse(JSON.parse(e))}catch(e){if(e instanceof SyntaxError)continue;throw e}}return null}clear(){this._buffer=void 0}};function dL(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}var dD=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return""===e||'""'===e}get str(){var e;return null!=(e=this._str)?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!=(e=this._names)?e:this._names=this._items.reduce((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e),{})}};function a(e,...t){let r=[e[0]],i=0;for(;i<t.length;)n(r,t[i]),r.push(e[++i]);return new o(r)}e._Code=o,e.nil=new o(""),e._=a;let i=new o("+");function s(e,...t){let a=[l(e[0])],c=0;for(;c<t.length;)a.push(i),n(a,t[c]),a.push(i,l(e[++c]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===i){var o,a;let i=(o=e[t-1],'""'===(a=e[t+1])?o:'""'===o?a:"string"==typeof o?a instanceof r||'"'!==o[o.length-1]?void 0:"string"!=typeof a?`${o.slice(0,-1)}${a}"`:'"'===a[0]?o.slice(0,-1)+a.slice(1):void 0:"string"!=typeof a||'"'!==a[0]||o instanceof r?void 0:`"${o}${a.slice(1)}`);if(void 0!==i){e.splice(t-1,3,i);continue}e[t++]="+"}t++}}(a),new o(a)}function n(e,t){var a;t instanceof o?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(a=t)||"boolean"==typeof a||null===a?a:l(Array.isArray(a)?a.join(","):a))}function l(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=s,e.addCodeArg=n,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:s`${e}${t}`},e.stringify=function(e){return new o(l(e))},e.safeStringify=l,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new o(`.${t}`):a`[${t}]`},e.getEsmExportName=function(t){if("string"==typeof t&&e.IDENTIFIER.test(t))return new o(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)},e.regexpCode=function(e){return new o(e.toString())}}),dU=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=dD();var r,o,a=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}};(r=o||(e.UsedValueState=o={}))[r.Started=0]="Started",r[r.Completed=1]="Completed",e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if((null==(r=null==(t=this._parent)?void 0:t._prefixes)?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var s=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:r,itemIndex:o}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(r)}[${o}]`}};e.ValueScopeName=s;let n=(0,t._)`\n`;var l=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?n:t.nil}}get(){return this._scope}name(e){return new s(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:a}=o,i=null!=(r=t.key)?r:t.ref,s=this._values[a];if(s){let e=s.get(i);if(e)return e}else s=this._values[a]=new Map;s.set(i,o);let n=this._scope[a]||(this._scope[a]=[]),l=n.length;return n[l]=t.ref,o.setValue(t,{property:a,itemIndex:l}),o}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,r=this._values){return this._reduceValues(r,r=>{if(void 0===r.scopePath)throw Error(`CodeGen: name "${r}" has no value`);return(0,t._)`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(r,i,s={},n){let l=t.nil;for(let c in r){let u=r[c];if(!u)continue;let d=s[c]=s[c]||new Map;u.forEach(r=>{if(d.has(r))return;d.set(r,o.Started);let s=i(r);if(s){let o=this.opts.es5?e.varKinds.var:e.varKinds.const;l=(0,t._)`${l}${o} ${r} = ${s};${this.opts._n}`}else if(s=null==n?void 0:n(r))l=(0,t._)`${l}${s}${this.opts._n}`;else throw new a(r);d.set(r,o.Completed)})}return l}};e.ValueScope=l}),dV=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=dD(),r=dU();var o=dD();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var a=dU();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var i=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},s=class extends i{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let o=e?r.varKinds.var:this.varKind,a=void 0===this.rhs?"":` = ${this.rhs}`;return`${o} ${this.name}${a};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=x(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},n=class extends i{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=x(this.rhs,e,r),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},l=class extends n{constructor(e,t,r,o){super(e,r,o),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},c=class extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},d=class extends i{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},p=class extends i{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=x(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},h=class extends i{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,o=r.length;for(;o--;){let a=r[o];a.optimizeNames(e,t)||(function(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}(e,a.names),r.splice(o,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>T(e,t.names),{})}},f=class extends h{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},m=class extends h{},y=class extends f{};y.kind="else";var g=class e extends f{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(!0===t)return this.nodes;let r=this.else;if(r){let e=r.optimizeNodes();r=this.else=Array.isArray(e)?new y(e):e}return r?!1===t?r instanceof e?r:r.nodes:this.nodes.length?this:new e(j(t),r instanceof e?[r]:r.nodes):!1!==t&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null==(r=this.else)?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=x(this.condition,e,t),this}get names(){let e=super.names;return O(e,this.condition),this.else&&T(e,this.else.names),e}};g.kind="if";var v=class extends f{};v.kind="for";var b=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=x(this.iteration,e,t),this}get names(){return T(super.names,this.iteration.names)}},_=class extends v{constructor(e,t,r,o){super(),this.varKind=e,this.name=t,this.from=r,this.to=o}render(e){let t=e.es5?r.varKinds.var:this.varKind,{name:o,from:a,to:i}=this;return`for(${t} ${o}=${a}; ${o}<${i}; ${o}++)`+super.render(e)}get names(){return O(O(super.names,this.from),this.to)}},S=class extends v{constructor(e,t,r,o){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=x(this.iterable,e,t),this}get names(){return T(super.names,this.iterable.names)}},$=class extends f{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};$.kind="func";var w=class extends h{render(e){return"return "+super.render(e)}};w.kind="return";var E=class extends f{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null==(e=this.catch)||e.optimizeNodes(),null==(t=this.finally)||t.optimizeNodes(),this}optimizeNames(e,t){var r,o;return super.optimizeNames(e,t),null==(r=this.catch)||r.optimizeNames(e,t),null==(o=this.finally)||o.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&T(e,this.catch.names),this.finally&&T(e,this.finally.names),e}},R=class extends f{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};R.kind="catch";var P=class extends f{render(e){return"finally"+super.render(e)}};P.kind="finally";var k=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,o){let a=this._scope.toName(t);return void 0!==r&&o&&(this._constants[a.str]=r),this._leafNode(new s(e,a,r)),a}const(e,t,o){return this._def(r.varKinds.const,e,t,o)}let(e,t,o){return this._def(r.varKinds.let,e,t,o)}var(e,t,o){return this._def(r.varKinds.var,e,t,o)}assign(e,t,r){return this._leafNode(new n(e,t,r))}add(t,r){return this._leafNode(new l(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new p(e)),this}object(...e){let r=["{"];for(let[o,a]of e)r.length>1&&r.push(","),r.push(o),(o!==a||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,a));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new g(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new g(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(g,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new b(e),t)}forRange(e,t,o,a,i=this.opts.es5?r.varKinds.var:r.varKinds.let){let s=this._scope.toName(e);return this._for(new _(i,s,t,o),()=>a(s))}forOf(e,o,a,i=r.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let e=o instanceof t.Name?o:this.var("_arr",o);return this.forRange("_i",0,(0,t._)`${e}.length`,r=>{this.var(s,(0,t._)`${e}[${r}]`),a(s)})}return this._for(new S("of",i,s,o),()=>a(s))}forIn(e,o,a,i=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${o})`,a);let s=this._scope.toName(e);return this._for(new S("in",i,s,o),()=>a(s))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new c(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new w;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(w)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let o=new E;if(this._blockNode(o),this.code(e),t){let e=this.name("e");this._currNode=o.catch=new R(e),t(e)}return r&&(this._currNode=o.finally=new P,this.code(r)),this._endBlockNode(R,P)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(void 0===t)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,o,a){return this._blockNode(new $(e,r,o)),a&&this.code(a).endFunc(),this}endFunc(){return this._endBlockNode($)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof g))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function T(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function O(e,r){return r instanceof t._CodeOrName?T(e,r.names):e}function x(e,r,o){var a;if(e instanceof t.Name)return i(e);if(!((a=e)instanceof t._Code&&a._items.some(e=>e instanceof t.Name&&1===r[e.str]&&void 0!==o[e.str])))return e;return new t._Code(e._items.reduce((e,r)=>(r instanceof t.Name&&(r=i(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e),[]));function i(e){let t=o[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function j(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:(0,t._)`!${A(e)}`}e.CodeGen=k,e.not=j;let C=I(e.operators.AND);e.and=function(...e){return e.reduce(C)};let N=I(e.operators.OR);function I(e){return(r,o)=>r===t.nil?o:o===t.nil?r:(0,t._)`${A(r)} ${e} ${A(o)}`}function A(e){return e instanceof t.Name?e:(0,t._)`(${e})`}e.or=function(...e){return e.reduce(N)}}),dF=c2(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let o=dV(),a=dD();function i(e,t=e.schema){let{opts:r,self:o}=e;if(!r.strictSchema||"boolean"==typeof t)return;let a=o.RULES.keywords;for(let r in t)a[r]||h(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}function n(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:a}){return(i,s,n,l)=>{let c=void 0===n?s:n instanceof o.Name?(s instanceof o.Name?e(i,s,n):t(i,s,n),n):s instanceof o.Name?(t(i,n,s),s):r(s,n);return l!==o.Name||c instanceof o.Name?c:a(i,c)}}function u(e,t){if(!0===t)return e.var("props",!0);let r=e.var("props",(0,o._)`{}`);return void 0!==t&&d(e,r,t),r}function d(e,t,r){Object.keys(r).forEach(r=>e.assign((0,o._)`${t}${(0,o.getProperty)(r)}`,!0))}e.toHash=function(e){let t={};for(let r of e)t[r]=!0;return t},e.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(i(e,t),!s(t,e.self.RULES.all))},e.checkUnknownRules=i,e.schemaHasRules=s,e.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(let r in e)if("$ref"!==r&&t.all[r])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,a,i){if(!i){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return(0,o._)`${r}`}return(0,o._)`${e}${t}${(0,o.getProperty)(a)}`},e.unescapeFragment=function(e){return l(decodeURIComponent(e))},e.escapeFragment=function(e){return encodeURIComponent(n(e))},e.escapeJsonPointer=n,e.unescapeJsonPointer=l,e.eachItem=function(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)},e.mergeEvaluated={props:c({mergeNames:(e,t,r)=>e.if((0,o._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,o._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,o._)`${r} || {}`).code((0,o._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,o._)`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,(0,o._)`${r} || {}`),d(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:c({mergeNames:(e,t,r)=>e.if((0,o._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,o._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,o._)`${r} !== true`,()=>e.assign(r,!0===t||(0,o._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},e.evaluatedPropsToName=u,e.setEvaluated=d;let p={};function h(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw Error(t);e.self.logger.warn(t)}}e.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:p[t.code]||(p[t.code]=new a._Code(t.code))})},(r=t||(e.Type=t={}))[r.Num=0]="Num",r[r.Str=1]="Str",e.getErrorPath=function(e,r,a){if(e instanceof o.Name){let i=r===t.Num;return a?i?(0,o._)`"[" + ${e} + "]"`:(0,o._)`"['" + ${e} + "']"`:i?(0,o._)`"/" + ${e}`:(0,o._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return a?(0,o.getProperty)(e).toString():"/"+n(e)},e.checkStrictMode=h}),dH=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV();e.default={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")}}),dK=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=dV(),r=dF(),o=dH();function a(e,r){let a=e.const("err",r);e.if((0,t._)`${o.default.vErrors} === null`,()=>e.assign(o.default.vErrors,(0,t._)`[${a}]`),(0,t._)`${o.default.vErrors}.push(${a})`),e.code((0,t._)`${o.default.errors}++`)}function i(e,r){let{gen:o,validateName:a,schemaEnv:i}=e;i.$async?o.throw((0,t._)`new ${e.ValidationError}(${r})`):(o.assign((0,t._)`${a}.errors`,r),o.return(!1))}e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?(0,t.str)`"${e}" keyword must be ${r} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`},e.reportError=function(r,o=e.keywordError,s,l){let{it:c}=r,{gen:u,compositeRule:d,allErrors:p}=c,h=n(r,o,s);(null!=l?l:d||p)?a(u,h):i(c,(0,t._)`[${h}]`)},e.reportExtraError=function(t,r=e.keywordError,s){let{it:l}=t,{gen:c,compositeRule:u,allErrors:d}=l;a(c,n(t,r,s)),u||d||i(l,o.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(o.default.errors,r),e.if((0,t._)`${o.default.vErrors} !== null`,()=>e.if(r,()=>e.assign((0,t._)`${o.default.vErrors}.length`,r),()=>e.assign(o.default.vErrors,null)))},e.extendErrors=function({gen:e,keyword:r,schemaValue:a,data:i,errsCount:s,it:n}){if(void 0===s)throw Error("ajv implementation error");let l=e.name("err");e.forRange("i",s,o.default.errors,s=>{e.const(l,(0,t._)`${o.default.vErrors}[${s}]`),e.if((0,t._)`${l}.instancePath === undefined`,()=>e.assign((0,t._)`${l}.instancePath`,(0,t.strConcat)(o.default.instancePath,n.errorPath))),e.assign((0,t._)`${l}.schemaPath`,(0,t.str)`${n.errSchemaPath}/${r}`),n.opts.verbose&&(e.assign((0,t._)`${l}.schema`,a),e.assign((0,t._)`${l}.data`,i))})};let s={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function n(e,a,i){let{createErrors:n}=e.it;return!1===n?(0,t._)`{}`:function(e,a,i={}){let{gen:n,it:l}=e,c=[function({errorPath:e},{instancePath:a}){let i=a?(0,t.str)`${e}${(0,r.getErrorPath)(a,r.Type.Str)}`:e;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,i)]}(l,i),function({keyword:e,it:{errSchemaPath:o}},{schemaPath:a,parentSchema:i}){let n=i?o:(0,t.str)`${o}/${e}`;return a&&(n=(0,t.str)`${n}${(0,r.getErrorPath)(a,r.Type.Str)}`),[s.schemaPath,n]}(e,i)];return function(e,{params:r,message:a},i){let{keyword:n,data:l,schemaValue:c,it:u}=e,{opts:d,propertyName:p,topSchemaRef:h,schemaPath:f}=u;i.push([s.keyword,n],[s.params,"function"==typeof r?r(e):r||(0,t._)`{}`]),d.messages&&i.push([s.message,"function"==typeof a?a(e):a]),d.verbose&&i.push([s.schema,c],[s.parentSchema,(0,t._)`${h}${f}`],[o.default.data,l]),p&&i.push([s.propertyName,p])}(e,a,c),n.object(...c)}(e,a,i)}}),dJ=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=dK(),r=dV(),o=dH(),a={message:"boolean schema is false"};function i(e,r){let{gen:o,data:i}=e;(0,t.reportError)({gen:o,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},a,void 0,r)}e.topBoolOrEmptySchema=function(e){let{gen:t,schema:a,validateName:s}=e;!1===a?i(e,!1):"object"==typeof a&&!0===a.$async?t.return(o.default.data):(t.assign((0,r._)`${s}.errors`,null),t.return(!0))},e.boolOrEmptySchema=function(e,t){let{gen:r,schema:o}=e;!1===o?(r.var(t,!1),i(e)):r.var(t,!0)}}),dB=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set(["string","number","integer","boolean","null","object","array"]);e.isJSONType=function(e){return"string"==typeof e&&t.has(e)},e.getRules=function(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}}),dG=c2(e=>{function t(e,t){return t.rules.some(t=>r(e,t))}function r(e,t){var r;return void 0!==e[t.keyword]||(null==(r=t.definition.implements)?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0,e.schemaHasRulesForType=function({schema:e,self:r},o){let a=r.RULES.types[o];return a&&!0!==a&&t(e,a)},e.shouldUseGroup=t,e.shouldUseRule=r}),dZ=c2(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let o=dB(),a=dG(),i=dK(),s=dV(),n=dF();function l(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(o.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}(r=t||(e.DataType=t={}))[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong",e.getSchemaTypes=function(e){let t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},e.getJSONTypes=l,e.coerceAndCheckDataType=function(e,r){var o,i;let{gen:n,data:l,opts:u}=e,p=(o=r,(i=u.coerceTypes)?o.filter(e=>c.has(e)||"array"===i&&"array"===e):[]),f=r.length>0&&!(0===p.length&&1===r.length&&(0,a.schemaHasRulesForType)(e,r[0]));if(f){let o=d(r,l,u.strictNumbers,t.Wrong);n.if(o,()=>{p.length?function(e,t,r){let{gen:o,data:a,opts:i}=e,n=o.let("dataType",(0,s._)`typeof ${a}`),l=o.let("coerced",(0,s._)`undefined`);for(let e of("array"===i.coerceTypes&&o.if((0,s._)`${n} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>o.assign(a,(0,s._)`${a}[0]`).assign(n,(0,s._)`typeof ${a}`).if(d(t,a,i.strictNumbers),()=>o.assign(l,a))),o.if((0,s._)`${l} !== undefined`),r))(c.has(e)||"array"===e&&"array"===i.coerceTypes)&&function(e){switch(e){case"string":o.elseIf((0,s._)`${n} == "number" || ${n} == "boolean"`).assign(l,(0,s._)`"" + ${a}`).elseIf((0,s._)`${a} === null`).assign(l,(0,s._)`""`);return;case"number":o.elseIf((0,s._)`${n} == "boolean" || ${a} === null
|
|
69
|
-
|| (${
|
|
70
|
-
|| (${
|
|
71
|
-
|| ${n} === "boolean" || ${a} === null`).assign(l,(0,s._)`[${a}]`)}}(e);o.else(),h(e),o.endIf(),o.if((0,s._)`${l} !== undefined`,()=>{o.assign(a,l),function({gen:e,parentData:t,parentDataProperty:r},o){e.if((0,s._)`${t} !== undefined`,()=>e.assign((0,s._)`${t}[${r}]`,o))}(e,l)})}(e,r,p):h(e)})}return f};let c=new Set(["string","number","integer","boolean","null"]);function u(e,r,o,a=t.Correct){let i,n=a===t.Correct?s.operators.EQ:s.operators.NEQ;switch(e){case"null":return(0,s._)`${r} ${n} null`;case"array":i=(0,s._)`Array.isArray(${r})`;break;case"object":i=(0,s._)`${r} && typeof ${r} == "object" && !Array.isArray(${r})`;break;case"integer":i=l((0,s._)`!(${r} % 1) && !isNaN(${r})`);break;case"number":i=l();break;default:return(0,s._)`typeof ${r} ${n} ${e}`}return a===t.Correct?i:(0,s.not)(i);function l(e=s.nil){return(0,s.and)((0,s._)`typeof ${r} == "number"`,e,o?(0,s._)`isFinite(${r})`:s.nil)}}function d(e,t,r,o){let a;if(1===e.length)return u(e[0],t,r,o);let i=(0,n.toHash)(e);if(i.array&&i.object){let e=(0,s._)`typeof ${t} != "object"`;a=i.null?e:(0,s._)`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else a=s.nil;for(let e in i.number&&delete i.integer,i)a=(0,s.and)(a,u(e,t,r,o));return a}e.checkDataType=u,e.checkDataTypes=d;let p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?(0,s._)`{type: ${e}}`:(0,s._)`{type: ${t}}`};function h(e){let t=function(e){let{gen:t,data:r,schema:o}=e,a=(0,n.schemaRefOrVal)(e,o,"type");return{gen:t,keyword:"type",data:r,schema:o.type,schemaCode:a,schemaValue:a,parentSchema:o,params:{},it:e}}(e);(0,i.reportError)(t,p)}e.reportTypeError=h}),dW=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=dV(),r=dF();function o(e,o,a){let{gen:i,compositeRule:s,data:n,opts:l}=e;if(void 0===a)return;let c=(0,t._)`${n}${(0,t.getProperty)(o)}`;if(s)return void(0,r.checkStrictMode)(e,`default is ignored for: ${c}`);let u=(0,t._)`${c} === undefined`;"empty"===l.useDefaults&&(u=(0,t._)`${u} || ${c} === null || ${c} === ""`),i.if(u,(0,t._)`${c} = ${(0,t.stringify)(a)}`)}e.assignDefaults=function(e,t){let{properties:r,items:a}=e.schema;if("object"===t&&r)for(let t in r)o(e,t,r[t].default);else"array"===t&&Array.isArray(a)&&a.forEach((t,r)=>o(e,r,t.default))}}),dX=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=dV(),r=dF(),o=dH(),a=dF();function i(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}function s(e,r,o){return(0,t._)`${i(e)}.call(${r}, ${o})`}function n(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} === undefined`;return a?(0,t.or)(i,(0,t.not)(s(e,r,o))):i}function l(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}e.checkReportMissingProp=function(e,r){let{gen:o,data:a,it:i}=e;o.if(n(o,a,r,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${r}`},!0),e.error()})},e.checkMissingProp=function({gen:e,data:r,it:{opts:o}},a,i){return(0,t.or)(...a.map(a=>(0,t.and)(n(e,r,a,o.ownProperties),(0,t._)`${i} = ${a}`)))},e.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},e.hasPropFunc=i,e.isOwnProperty=s,e.propertyInData=function(e,r,o,a){let i=(0,t._)`${r}${(0,t.getProperty)(o)} !== undefined`;return a?(0,t._)`${i} && ${s(e,r,o)}`:i},e.noPropertyInData=n,e.allSchemaProperties=l,e.schemaProperties=function(e,t){return l(t).filter(o=>!(0,r.alwaysValidSchema)(e,t[o]))},e.callValidateCode=function({schemaCode:e,data:r,it:{gen:a,topSchemaRef:i,schemaPath:s,errorPath:n},it:l},c,u,d){let p=d?(0,t._)`${e}, ${r}, ${i}${s}`:r,h=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,n)],[o.default.parentData,l.parentData],[o.default.parentDataProperty,l.parentDataProperty],[o.default.rootData,o.default.rootData]];l.opts.dynamicRef&&h.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let f=(0,t._)`${p}, ${a.object(...h)}`;return u!==t.nil?(0,t._)`${c}.call(${u}, ${f})`:(0,t._)`${c}(${f})`};let c=(0,t._)`new RegExp`;e.usePattern=function({gen:e,it:{opts:r}},o){let i=r.unicodeRegExp?"u":"",{regExp:s}=r.code,n=s(o,i);return e.scopeValue("pattern",{key:n.toString(),ref:n,code:(0,t._)`${"new RegExp"===s.code?c:(0,a.useFunc)(e,s)}(${o}, ${i})`})},e.validateArray=function(e){let{gen:o,data:a,keyword:i,it:s}=e,n=o.name("valid");if(s.allErrors){let e=o.let("valid",!0);return l(()=>o.assign(e,!1)),e}return o.var(n,!0),l(()=>o.break()),n;function l(s){let l=o.const("len",(0,t._)`${a}.length`);o.forRange("i",0,l,a=>{e.subschema({keyword:i,dataProp:a,dataPropType:r.Type.Num},n),o.if((0,t.not)(n),s)})}},e.validateUnion=function(e){let{gen:o,schema:a,keyword:i,it:s}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(a.some(e=>(0,r.alwaysValidSchema)(s,e))&&!s.opts.unevaluated)return;let n=o.let("valid",!1),l=o.name("_valid");o.block(()=>a.forEach((r,a)=>{let s=e.subschema({keyword:i,schemaProp:a,compositeRule:!0},l);o.assign(n,(0,t._)`${n} || ${l}`),e.mergeValidEvaluated(s,l)||o.if((0,t.not)(n))})),e.result(n,()=>e.reset(),()=>e.error(!0))}}),dY=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=dV(),r=dH(),o=dX(),a=dK();function i(e){let{gen:r,data:o,it:a}=e;r.if(a.parentData,()=>r.assign(o,(0,t._)`${a.parentData}[${a.parentDataProperty}]`))}function s(e,r,o){if(void 0===o)throw Error(`keyword "${r}" failed to compile`);return e.scopeValue("keyword","function"==typeof o?{ref:o}:{ref:o,code:(0,t.stringify)(o)})}e.macroKeywordCode=function(e,r){let{gen:o,keyword:a,schema:i,parentSchema:n,it:l}=e,c=r.macro.call(l.self,i,n,l),u=s(o,a,c);!1!==l.opts.validateSchema&&l.self.validateSchema(c,!0);let d=o.name("valid");e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${l.errSchemaPath}/${a}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,()=>e.error(!0))},e.funcKeywordCode=function(e,n){var l;let{gen:c,keyword:u,schema:d,parentSchema:p,$data:h,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}(f,n);let m=s(c,u,!h&&n.compile?n.compile.call(f.self,d,p,f):n.validate),y=c.let("valid");function g(a=n.async?(0,t._)`await `:t.nil){let i=f.opts.passContext?r.default.this:r.default.self,s=!("compile"in n&&!h||!1===n.schema);c.assign(y,(0,t._)`${a}${(0,o.callValidateCode)(e,m,i,s)}`,n.modifying)}function v(e){var r;c.if((0,t.not)(null!=(r=n.valid)?r:y),e)}e.block$data(y,function(){if(!1===n.errors)g(),n.modifying&&i(e),v(()=>e.error());else{let o,s,l=n.async?(o=c.let("ruleErrs",null),c.try(()=>g((0,t._)`await `),e=>c.assign(y,!1).if((0,t._)`${e} instanceof ${f.ValidationError}`,()=>c.assign(o,(0,t._)`${e}.errors`),()=>c.throw(e))),o):(s=(0,t._)`${m}.errors`,c.assign(s,null),g(t.nil),s);n.modifying&&i(e),v(()=>(function(e,o){let{gen:i}=e;i.if((0,t._)`Array.isArray(${o})`,()=>{i.assign(r.default.vErrors,(0,t._)`${r.default.vErrors} === null ? ${o} : ${r.default.vErrors}.concat(${o})`).assign(r.default.errors,(0,t._)`${r.default.vErrors}.length`),(0,a.extendErrors)(e)},()=>e.error())})(e,l))}}),e.ok(null!=(l=n.valid)?l:y)},e.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},e.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:o},a,i){if(Array.isArray(a.keyword)?!a.keyword.includes(i):a.keyword!==i)throw Error("ajv implementation error");let s=a.dependencies;if(null==s?void 0:s.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(a.validateSchema&&!a.validateSchema(e[i])){let e=`keyword "${i}" value is invalid at path "${o}": `+r.errorsText(a.validateSchema.errors);if("log"===t.validateSchema)r.logger.error(e);else throw Error(e)}}}),dQ=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=dV(),r=dF();e.getSubschema=function(e,{keyword:o,schemaProp:a,schema:i,schemaPath:s,errSchemaPath:n,topSchemaRef:l}){if(void 0!==o&&void 0!==i)throw Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==o){let i=e.schema[o];return void 0===a?{schema:i,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(o)}`,errSchemaPath:`${e.errSchemaPath}/${o}`}:{schema:i[a],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(o)}${(0,t.getProperty)(a)}`,errSchemaPath:`${e.errSchemaPath}/${o}/${(0,r.escapeFragment)(a)}`}}if(void 0!==i){if(void 0===s||void 0===n||void 0===l)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:s,topSchemaRef:l,errSchemaPath:n}}throw Error('either "keyword" or "schema" must be passed')},e.extendSubschemaData=function(e,o,{dataProp:a,dataPropType:i,data:s,dataTypes:n,propertyName:l}){if(void 0!==s&&void 0!==a)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=o;if(void 0!==a){let{errorPath:s,dataPathArr:n,opts:l}=o;u(c.let("data",(0,t._)`${o.data}${(0,t.getProperty)(a)}`,!0)),e.errorPath=(0,t.str)`${s}${(0,r.getErrorPath)(a,i,l.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${a}`,e.dataPathArr=[...n,e.parentDataProperty]}function u(t){e.data=t,e.dataLevel=o.dataLevel+1,e.dataTypes=[],o.definedProperties=new Set,e.parentData=o.data,e.dataNames=[...o.dataNames,t]}void 0!==s&&(u(s instanceof t.Name?s:c.let("data",s,!0)),void 0!==l&&(e.propertyName=l)),n&&(e.dataTypes=n)},e.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:o,createErrors:a,allErrors:i}){void 0!==o&&(e.compositeRule=o),void 0!==a&&(e.createErrors=a),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}}),d0=c2((e,t)=>{t.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)){if((o=t.length)!=r.length)return!1;for(a=o;0!=a--;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((o=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(a=o;0!=a--;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=o;0!=a--;){var o,a,i,s=i[a];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}}),d1=c2((e,t)=>{var r=t.exports=function(e,t,o){"function"==typeof t&&(o=t,t={});var a="function"==typeof(o=t.cb||o)?o:o.pre||function(){};!function e(t,o,a,i,s,n,l,c,u,d){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var p in o(i,s,n,l,c,u,d),i){var h=i[p];if(Array.isArray(h)){if(p in r.arrayKeywords)for(var f=0;f<h.length;f++)e(t,o,a,h[f],s+"/"+p+"/"+f,n,s,p,i,f)}else if(p in r.propsKeywords){if(h&&"object"==typeof h)for(var m in h)e(t,o,a,h[m],s+"/"+p+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),n,s,p,i,m)}else(p in r.keywords||t.allKeys&&!(p in r.skipKeywords))&&e(t,o,a,h,s+"/"+p,n,s,p,i)}a(i,s,n,l,c,u,d)}}(t,a,o.post||function(){},e,"",e)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}}),d2=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=dF(),r=d0(),o=d1(),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);e.inlineRef=function(e,r=!0){return"boolean"==typeof e||(!0===r?!function e(t){for(let r in t){if(i.has(r))return!0;let o=t[r];if(Array.isArray(o)&&o.some(e)||"object"==typeof o&&e(o))return!0}return!1}(e):!!r&&function e(r){let o=0;for(let i in r)if("$ref"===i||(o++,!a.has(i)&&("object"==typeof r[i]&&(0,t.eachItem)(r[i],t=>o+=e(t)),o===1/0)))return 1/0;return o}(e)<=r)};let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function s(e,t="",r){return!1!==r&&(t=c(t)),n(e,e.parse(t))}function n(e,t){return e.serialize(t).split("#")[0]+"#"}e.getFullPath=s,e._getFullPath=n;let l=/#\/?$/;function c(e){return e?e.replace(l,""):""}e.normalizeId=c,e.resolveUrl=function(e,t,r){return r=c(r),e.resolve(t,r)};let u=/^[a-z_][-a-z0-9._]*$/i;e.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};let{schemaId:a,uriResolver:i}=this.opts,n=c(e[a]||t),l={"":n},d=s(i,n,!1),p={},h=new Set;return o(e,{allKeys:!0},(e,t,r,o)=>{if(void 0===o)return;let i=d+t,s=l[o];function n(t){let r=this.opts.uriResolver.resolve;if(t=c(s?r(s,t):t),h.has(t))throw m(t);h.add(t);let o=this.refs[t];return"string"==typeof o&&(o=this.refs[o]),"object"==typeof o?f(e,o.schema,t):t!==c(i)&&("#"===t[0]?(f(e,p[t],t),p[t]=e):this.refs[t]=i),t}function y(e){if("string"==typeof e){if(!u.test(e))throw Error(`invalid anchor "${e}"`);n.call(this,`#${e}`)}}"string"==typeof e[a]&&(s=n.call(this,e[a])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),l[t]=s}),p;function f(e,t,o){if(void 0!==t&&!r(e,t))throw m(o)}function m(e){return Error(`reference "${e}" resolves to more than one schema`)}}}),d9=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=dJ(),r=dZ(),o=dG(),a=dZ(),i=dW(),s=dY(),n=dQ(),l=dV(),c=dH(),u=d2(),d=dF(),p=dK();function h({gen:e,validateName:t,schema:r,schemaEnv:o,opts:a},i){var s;a.code.es5?e.func(t,(0,l._)`${c.default.data}, ${c.default.valCxt}`,o.$async,()=>{var t,o;e.code((0,l._)`"use strict"; ${f(r,a)}`),t=e,o=a,t.if(c.default.valCxt,()=>{t.var(c.default.instancePath,(0,l._)`${c.default.valCxt}.${c.default.instancePath}`),t.var(c.default.parentData,(0,l._)`${c.default.valCxt}.${c.default.parentData}`),t.var(c.default.parentDataProperty,(0,l._)`${c.default.valCxt}.${c.default.parentDataProperty}`),t.var(c.default.rootData,(0,l._)`${c.default.valCxt}.${c.default.rootData}`),o.dynamicRef&&t.var(c.default.dynamicAnchors,(0,l._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{t.var(c.default.instancePath,(0,l._)`""`),t.var(c.default.parentData,(0,l._)`undefined`),t.var(c.default.parentDataProperty,(0,l._)`undefined`),t.var(c.default.rootData,c.default.data),o.dynamicRef&&t.var(c.default.dynamicAnchors,(0,l._)`{}`)}),e.code(i)}):e.func(t,(0,l._)`${c.default.data}, ${(s=a,(0,l._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${s.dynamicRef?(0,l._)`, ${c.default.dynamicAnchors}={}`:l.nil}}={}`)}`,o.$async,()=>e.code(f(r,a)).code(i))}function f(e,t){let r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,l._)`/*# sourceURL=${r} */`:l.nil}function m({schema:e,self:t}){if("boolean"==typeof e)return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function y(e){return"boolean"!=typeof e.schema}function g(e){(0,d.checkUnknownRules)(e),function(e){let{schema:t,errSchemaPath:r,opts:o,self:a}=e;t.$ref&&o.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,a.RULES)&&a.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function v(e,t){if(e.opts.jtd)return _(e,[],!1,t);let o=(0,r.getSchemaTypes)(e.schema);_(e,o,!(0,r.coerceAndCheckDataType)(e,o),t)}function b({gen:e,schemaEnv:t,schema:r,errSchemaPath:o,opts:a}){let i=r.$comment;if(!0===a.$comment)e.code((0,l._)`${c.default.self}.logger.log(${i})`);else if("function"==typeof a.$comment){let r=(0,l.str)`${o}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,l._)`${c.default.self}.opts.$comment(${i}, ${r}, ${a}.schema)`)}}function _(e,t,r,i){var s,n,u,p;let{gen:h,schema:f,data:m,allErrors:y,opts:g,self:v}=e,{RULES:b}=v;if(f.$ref&&(g.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(f,b)))return void h.block(()=>R(e,"$ref",b.all.$ref.definition));function _(s){(0,o.shouldUseGroup)(f,s)&&(s.type?(h.if((0,a.checkDataType)(s.type,m,g.strictNumbers)),S(e,s),1===t.length&&t[0]===s.type&&r&&(h.else(),(0,a.reportTypeError)(e)),h.endIf()):S(e,s),y||h.if((0,l._)`${c.default.errors} === ${i||0}`))}g.jtd||(s=e,n=t,!s.schemaEnv.meta&&s.opts.strictTypes&&(function(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{$(e.dataTypes,t)||w(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){let r=[];for(let o of e.dataTypes)$(t,o)?r.push(o):t.includes("integer")&&"number"===o&&r.push("integer");e.dataTypes=r}(e,t)}}(s,n),s.opts.allowUnionTypes||(u=s,(p=n).length>1&&!(2===p.length&&p.includes("null"))&&w(u,"use allowUnionTypes to allow union type keyword")),function(e,t){let r=e.self.RULES.all;for(let a in r){let i=r[a];if("object"==typeof i&&(0,o.shouldUseRule)(e.schema,i)){let{type:r}=i.definition;r.length&&!r.some(e=>{var r,o;return r=t,o=e,r.includes(o)||"number"===o&&r.includes("integer")})&&w(e,`missing type "${r.join(",")}" for keyword "${a}"`)}}}(s,s.dataTypes))),h.block(()=>{for(let e of b.rules)_(e);_(b.post)})}function S(e,t){let{gen:r,schema:a,opts:{useDefaults:s}}=e;s&&(0,i.assignDefaults)(e,t.type),r.block(()=>{for(let r of t.rules)(0,o.shouldUseRule)(a,r)&&R(e,r.keyword,r.definition,t.type)})}function $(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function w(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}e.validateFunctionCode=function(e){y(e)&&(g(e),m(e))?function(e){let{schema:t,opts:r,gen:o}=e;h(e,()=>{r.$comment&&t.$comment&&b(e),function(e){let{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,d.checkStrictMode)(e,"default is ignored in the schema root")}(e),o.let(c.default.vErrors,null),o.let(c.default.errors,0),r.unevaluated&&function(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,l._)`${r}.evaluated`),t.if((0,l._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,l._)`${e.evaluated}.props`,(0,l._)`undefined`)),t.if((0,l._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,l._)`${e.evaluated}.items`,(0,l._)`undefined`))}(e),v(e),function(e){let{gen:t,schemaEnv:r,validateName:o,ValidationError:a,opts:i}=e;r.$async?t.if((0,l._)`${c.default.errors} === 0`,()=>t.return(c.default.data),()=>t.throw((0,l._)`new ${a}(${c.default.vErrors})`)):(t.assign((0,l._)`${o}.errors`,c.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:r,items:o}){r instanceof l.Name&&e.assign((0,l._)`${t}.props`,r),o instanceof l.Name&&e.assign((0,l._)`${t}.items`,o)}(e),t.return((0,l._)`${c.default.errors} === 0`))}(e)})}(e):h(e,()=>(0,t.topBoolOrEmptySchema)(e))};var E=class{constructor(e,t,r){if((0,s.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",T(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",c.default.errors))}result(e,t,r){this.failResult((0,l.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,l.not)(e),void 0,t)}fail(e){if(void 0===e){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,l._)`${t} !== undefined && (${(0,l.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=l.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=l.nil,t=l.nil){if(!this.$data)return;let{gen:r,schemaCode:o,schemaType:a,def:i}=this;r.if((0,l.or)((0,l._)`${o} === undefined`,t)),e!==l.nil&&r.assign(e,!0),(a.length||i.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==l.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:o,it:i}=this;return(0,l.or)(function(){if(r.length){if(!(t instanceof l.Name))throw Error("ajv implementation error");let e=Array.isArray(r)?r:[r];return(0,l._)`${(0,a.checkDataTypes)(e,t,i.opts.strictNumbers,a.DataType.Wrong)}`}return l.nil}(),function(){if(o.validateSchema){let r=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,l._)`!${r}(${t})`}return l.nil}())}subschema(e,r){let o=(0,n.getSubschema)(this.it,e);(0,n.extendSubschemaData)(o,this.it,e),(0,n.extendSubschemaMode)(o,e);let a={...this.it,...o,items:void 0,props:void 0};return!function(e,r){if(y(e)&&(g(e),m(e)))return function(e,t){var r;let o,{schema:a,gen:i,opts:s}=e;s.$comment&&a.$comment&&b(e),(o=(r=e).schema[r.opts.schemaId])&&(r.baseId=(0,u.resolveUrl)(r.opts.uriResolver,r.baseId,o)),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}(e);let n=i.const("_errs",c.default.errors);v(e,n),i.var(t,(0,l._)`${n} === ${c.default.errors}`)}(e,r);(0,t.boolOrEmptySchema)(e,r)}(a,r),a}mergeEvaluated(e,t){let{it:r,gen:o}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=d.mergeEvaluated.props(o,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=d.mergeEvaluated.items(o,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:o}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return o.if(t,()=>this.mergeEvaluated(e,l.Name)),!0}};function R(e,t,r,o){let a=new E(e,r,t);"code"in r?r.code(a,o):a.$data&&r.validate?(0,s.funcKeywordCode)(a,r):"macro"in r?(0,s.macroKeywordCode)(a,r):(r.compile||r.validate)&&(0,s.funcKeywordCode)(a,r)}e.KeywordCxt=E;let P=/^\/(?:[^~]|~0|~1)*$/,k=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function T(e,{dataLevel:t,dataNames:r,dataPathArr:o}){let a,i;if(""===e)return c.default.rootData;if("/"===e[0]){if(!P.test(e))throw Error(`Invalid JSON-pointer: ${e}`);a=e,i=c.default.rootData}else{let s=k.exec(e);if(!s)throw Error(`Invalid JSON-pointer: ${e}`);let l=+s[1];if("#"===(a=s[2])){if(l>=t)throw Error(n("property/index",l));return o[t-l]}if(l>t)throw Error(n("data",l));if(i=r[t-l],!a)return i}let s=i;for(let e of a.split("/"))e&&(i=(0,l._)`${i}${(0,l.getProperty)((0,d.unescapeJsonPointer)(e))}`,s=(0,l._)`${s} && ${i}`);return s;function n(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}e.getData=T}),d4=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}}),d5=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d2();e.default=class extends Error{constructor(e,r,o,a){super(a||`can't resolve reference ${o} from id ${r}`),this.missingRef=(0,t.resolveUrl)(e,r,o),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}}),d3=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=dV(),r=d4(),o=dH(),a=d2(),i=dF(),s=d9();var n=class{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!=(t=e.baseId)?t:(0,a.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}};function l(e){let i,n,l=u.call(this,e);if(l)return l;let c=(0,a.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:d,lines:p}=this.opts.code,{ownProperties:h}=this.opts,f=new t.CodeGen(this.scope,{es5:d,lines:p,ownProperties:h});e.$async&&(i=f.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName("validate");e.validateName=m;let y={gen:f,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:c,baseId:e.baseId||c,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this};try{this._compilations.add(e),(0,s.validateFunctionCode)(y),f.optimize(this.opts.code.optimize);let r=f.toString();n=`${f.scopeRefs(o.default.scope)}return ${r}`,this.opts.code.process&&(n=this.opts.code.process(n,e));let a=Function(`${o.default.self}`,`${o.default.scope}`,n)(this,this.scope.get());if(this.scope.value(m,{ref:a}),a.errors=null,a.schema=e.schema,a.schemaEnv=e,e.$async&&(a.$async=!0),!0===this.opts.code.source&&(a.source={validateName:m,validateCode:r,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:r}=y;a.evaluated={props:e instanceof t.Name?void 0:e,items:r instanceof t.Name?void 0:r,dynamicProps:e instanceof t.Name,dynamicItems:r instanceof t.Name},a.source&&(a.source.evaluated=(0,t.stringify)(a.evaluated))}return e.validate=a,e}catch(t){throw delete e.validate,delete e.validateName,n&&this.logger.error("Error compiling schema, function code:",n),t}finally{this._compilations.delete(e)}}function c(e){return(0,a.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:l.call(this,e)}function u(e){for(let o of this._compilations){var t,r;if(t=o,r=e,t.schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return o}}function d(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||p.call(this,e,t)}function p(e,t){let r=this.opts.uriResolver.parse(t),o=(0,a._getFullPath)(this.opts.uriResolver,r),i=(0,a.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&o===i)return f.call(this,r,e);let s=(0,a.normalizeId)(o),c=this.refs[s]||this.schemas[s];if("string"==typeof c){let t=p.call(this,e,c);if("object"!=typeof(null==t?void 0:t.schema))return;return f.call(this,r,t)}if("object"==typeof(null==c?void 0:c.schema)){if(c.validate||l.call(this,c),s===(0,a.normalizeId)(t)){let{schema:t}=c,{schemaId:r}=this.opts,o=t[r];return o&&(i=(0,a.resolveUrl)(this.opts.uriResolver,i,o)),new n({schema:t,schemaId:r,root:e,baseId:i})}return f.call(this,r,c)}}e.SchemaEnv=n,e.compileSchema=l,e.resolveRef=function(e,t,r){var o;r=(0,a.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=d.call(this,e,r);if(void 0===s){let a=null==(o=e.localRefs)?void 0:o[r],{schemaId:i}=this.opts;a&&(s=new n({schema:a,schemaId:i,root:e,baseId:t}))}if(void 0!==s)return e.refs[r]=c.call(this,s)},e.getCompilingSchema=u,e.resolveSchema=p;let h=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function f(e,{baseId:t,schema:r,root:o}){var s;let l;if((null==(s=e.fragment)?void 0:s[0])!=="/")return;for(let o of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;let e=r[(0,i.unescapeFragment)(o)];if(void 0===e)return;let s="object"==typeof(r=e)&&r[this.opts.schemaId];!h.has(o)&&s&&(t=(0,a.resolveUrl)(this.opts.uriResolver,t,s))}if("boolean"!=typeof r&&r.$ref&&!(0,i.schemaHasRulesButRef)(r,this.RULES)){let e=(0,a.resolveUrl)(this.opts.uriResolver,t,r.$ref);l=p.call(this,o,e)}let{schemaId:c}=this.opts;if((l=l||new n({schema:r,schemaId:c,root:o,baseId:t})).schema!==l.root.schema)return l}}),d6=c2((e,t)=>{t.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),d8=c2((e,t)=>{let r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),o=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function a(e){let t="",r=0,o=0;for(o=0;o<e.length;o++)if(48!==(r=e[o].charCodeAt(0))){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[o];break}for(o+=1;o<e.length;o++){if(!((r=e[o].charCodeAt(0))>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[o]}return t}function i(e){return e.length=0,!0}function s(e,t,r){if(e.length){let o=a(e);if(""===o)return r.error=!0,!1;t.push(o),e.length=0}return!0}function n(e){if(2>function(e,t){let r=0;for(let t=0;t<e.length;t++)":"===e[t]&&r++;return r}(e,":"))return{host:e,isIPV6:!1};let t=function(e){let t=0,r={error:!1,address:"",zone:""},o=[],n=[],l=!1,c=!1,u=s;for(let a=0;a<e.length;a++){let s=e[a];if("["!==s&&"]"!==s)if(":"===s){if(!0===l&&(c=!0),!u(n,o,r))break;if(++t>7){r.error=!0;break}a>0&&":"===e[a-1]&&(l=!0),o.push(":");continue}else if("%"===s){if(!u(n,o,r))break;u=i}else{n.push(s);continue}}return n.length&&(u===i?r.zone=n.join(""):c?o.push(n.join("")):o.push(a(n))),r.address=o.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:r}}}t.exports={nonSimpleDomain:RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u),recomposeAuthority:function(e){let t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let r=unescape(e.host);if(!o(r)){let t=n(r);r=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(r)}return("number"==typeof e.port||"string"==typeof e.port)&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){let r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){let t=e,r=[],o=-1,a=0;for(;a=t.length;){if(1===a)if("."===t)break;else if("/"===t){r.push("/");break}else{r.push(t);break}if(2===a){if("."===t[0]){if("."===t[1])break;else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===a&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}else if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(o=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,o)),t=t.slice(o)}return r.join("")},isIPv4:o,isUUID:r,normalizeIPv6:n,stringArrayToHexStripped:a}}),d7=c2((e,t)=>{let{isUUID:r}=d8(),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,a=["http","https","ws","wss","urn","urn:uuid"];function i(e){return!0===e.secure||!1!==e.secure&&!!e.scheme&&3===e.scheme.length&&("w"===e.scheme[0]||"W"===e.scheme[0])&&("s"===e.scheme[1]||"S"===e.scheme[1])&&("s"===e.scheme[2]||"S"===e.scheme[2])}function s(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function n(e){let t="https"===String(e.scheme).toLowerCase();return(e.port===(t?443:80)||""===e.port)&&(e.port=void 0),e.path||(e.path="/"),e}let l={scheme:"http",domainHost:!0,parse:s,serialize:n},c={scheme:"https",domainHost:l.domainHost,parse:s,serialize:n},u={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=i(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if((e.port===(i(e)?443:80)||""===e.port)&&(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},d={scheme:"wss",domainHost:u.domainHost,parse:u.parse,serialize:u.serialize},p={http:l,https:c,ws:u,wss:d,urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(o);if(r){let o=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let a=h(`${o}:${t.nid||e.nid}`);e.path=void 0,a&&(e=a.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){if(void 0===e.nid)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",o=e.nid.toLowerCase(),a=h(`${r}:${t.nid||o}`);a&&(e=a.serialize(e,t));let i=e,s=e.nss;return i.path=`${o||t.nid}:${s}`,t.skipEscape=!0,i},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){return e.uuid=e.nss,e.nss=void 0,t.tolerant||e.uuid&&r(e.uuid)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e){return e.nss=(e.uuid||"").toLowerCase(),e},skipNormalize:!0}};function h(e){return e&&(p[e]||p[e.toLowerCase()])||void 0}Object.setPrototypeOf(p,null),t.exports={wsIsSecure:i,SCHEMES:p,isValidSchemeName:function(e){return -1!==a.indexOf(e)},getSchemeHandler:h}}),pe=c2((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:a,normalizeComponentEncoding:i,isIPv4:s,nonSimpleDomain:n}=d8(),{SCHEMES:l,getSchemeHandler:c}=d7();function u(e,t,r,a){let i={};return a||(e=h(d(e,r),r),t=h(d(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(t.path?("/"===t.path[0]?i.path=o(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=o(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function d(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},i=Object.assign({},t),s=[],n=c(i.scheme||r.scheme);n&&n.serialize&&n.serialize(r,i),void 0!==r.path&&(i.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==i.reference&&r.scheme&&s.push(r.scheme,":");let l=a(r);if(void 0!==l&&("suffix"!==i.reference&&s.push("//"),s.push(l),r.path&&"/"!==r.path[0]&&s.push("/")),void 0!==r.path){let e=r.path;i.absolutePath||n&&n.absolutePath||(e=o(e)),void 0===l&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),s.push(e)}return void 0!==r.query&&s.push("?",r.query),void 0!==r.fragment&&s.push("#",r.fragment),s.join("")}let p=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function h(e,t){let o=Object.assign({},t),a={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;"suffix"===o.reference&&(e=o.scheme?o.scheme+":"+e:"//"+e);let l=e.match(p);if(l){if(a.scheme=l[1],a.userinfo=l[3],a.host=l[4],a.port=parseInt(l[5],10),a.path=l[6]||"",a.query=l[7],a.fragment=l[8],isNaN(a.port)&&(a.port=l[5]),a.host)if(!1===s(a.host)){let e=r(a.host);a.host=e.host.toLowerCase(),i=e.isIPV6}else i=!0;void 0!==a.scheme||void 0!==a.userinfo||void 0!==a.host||void 0!==a.port||void 0!==a.query||a.path?void 0===a.scheme?a.reference="relative":void 0===a.fragment?a.reference="absolute":a.reference="uri":a.reference="same-document",o.reference&&"suffix"!==o.reference&&o.reference!==a.reference&&(a.error=a.error||"URI is not a "+o.reference+" reference.");let t=c(o.scheme||a.scheme);if(!o.unicodeSupport&&(!t||!t.unicodeSupport)&&a.host&&(o.domainHost||t&&t.domainHost)&&!1===i&&n(a.host))try{a.host=URL.domainToASCII(a.host.toLowerCase())}catch(e){a.error=a.error||"Host's domain name can not be converted to ASCII: "+e}(!t||t&&!t.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==a.scheme&&(a.scheme=unescape(a.scheme)),void 0!==a.host&&(a.host=unescape(a.host))),a.path&&(a.path=escape(unescape(a.path))),a.fragment&&(a.fragment=encodeURI(decodeURIComponent(a.fragment)))),t&&t.parse&&t.parse(a,o)}else a.error=a.error||"URI can not be parsed.";return a}let f={SCHEMES:l,normalize:function(e,t){return"string"==typeof e?e=d(h(e,t),t):"object"==typeof e&&(e=h(d(e,t),t)),e},resolve:function(e,t,r){let o=r?Object.assign({scheme:"null"},r):{scheme:"null"},a=u(h(e,o),h(t,o),o,!0);return o.skipEscape=!0,d(a,o)},resolveComponent:u,equal:function(e,t,r){return"string"==typeof e?e=d(i(h(e=unescape(e),r),!0),{...r,skipEscape:!0}):"object"==typeof e&&(e=d(i(e,!0),{...r,skipEscape:!0})),"string"==typeof t?t=d(i(h(t=unescape(t),r),!0),{...r,skipEscape:!0}):"object"==typeof t&&(t=d(i(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:d,parse:h};t.exports=f,t.exports.default=f,t.exports.fastUri=f}),pt=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pe();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),pr=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=d9();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=dV();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});let o=d4(),a=d5(),i=dB(),s=d3(),n=dV(),l=d2(),c=dZ(),u=dF(),d=d6(),p=pt(),h=(e,t)=>new RegExp(e,t);h.code="new RegExp";let f=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};var v=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...function(e){var t,r,o,a,i,s,n,l,c,u,d,f,m,y,g,v,b,_,S,$,w,E,R,P,k;let T=e.strict,O=null==(t=e.code)?void 0:t.optimize,x=!0===O||void 0===O?1:O||0,j=null!=(o=null==(r=e.code)?void 0:r.regExp)?o:h,C=null!=(a=e.uriResolver)?a:p.default;return{strictSchema:null==(s=null!=(i=e.strictSchema)?i:T)||s,strictNumbers:null==(l=null!=(n=e.strictNumbers)?n:T)||l,strictTypes:null!=(u=null!=(c=e.strictTypes)?c:T)?u:"log",strictTuples:null!=(f=null!=(d=e.strictTuples)?d:T)?f:"log",strictRequired:null!=(y=null!=(m=e.strictRequired)?m:T)&&y,code:e.code?{...e.code,optimize:x,regExp:j}:{optimize:x,regExp:j},loopRequired:null!=(g=e.loopRequired)?g:200,loopEnum:null!=(v=e.loopEnum)?v:200,meta:null==(b=e.meta)||b,messages:null==(_=e.messages)||_,inlineRefs:null==(S=e.inlineRefs)||S,schemaId:null!=($=e.schemaId)?$:"$id",addUsedSchema:null==(w=e.addUsedSchema)||w,validateSchema:null==(E=e.validateSchema)||E,validateFormats:null==(R=e.validateFormats)||R,unicodeRegExp:null==(P=e.unicodeRegExp)||P,int32range:null==(k=e.int32range)||k,uriResolver:C}}(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new n.ValueScope({scope:{},prefixes:m,es5:t,lines:r}),this.logger=function(e){if(!1===e)return R;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}(e.logger);const o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),b.call(this,y,e,"NOT SUPPORTED"),b.call(this,g,e,"DEPRECATED","warn"),this._metaOpts=E.call(this),e.formats&&$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&w.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),S.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,o=d;"id"===r&&((o={...d}).id=o.$id,delete o.$id),t&&e&&this.addMetaSchema(o,o[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let o=r(t);return"$async"in r||(this.errors=r.errors),o}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return o.call(this,e,t);async function o(e,t){await i.call(this,e.$schema);let r=this._addSchema(e,t);return r.validate||s.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await o.call(this,{$ref:e},!0)}async function s(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return n.call(this,t),await l.call(this,t.missingSchema),s.call(this,e)}}function n({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){let r=await c.call(this,e);this.refs[e]||await i.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function c(e){let t=this._loading[e];if(t)return t;try{return await (this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,o=this.opts.validateSchema){let a;if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,r,o);return this}if("object"==typeof e){let{schemaId:t}=this.opts;if(void 0!==(a=e[t])&&"string"!=typeof a)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||a),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,o,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){let r;if("boolean"==typeof e)return!0;if(void 0!==(r=e.$schema)&&"string"!=typeof r)throw Error("$schema must be a string");if(!(r=r||this.opts.defaultMeta||this.defaultMeta()))return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(r,e);if(!o&&t){let e="schema is invalid: "+this.errorsText();if("log"===this.opts.validateSchema)this.logger.error(e);else throw Error(e)}return o}getSchema(e){let t;for(;"string"==typeof(t=_.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,o=new s.SchemaEnv({schema:{},schemaId:r});if(!(t=s.resolveSchema.call(this,o,e)))return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=_.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{this._cache.delete(e);let t=e[this.opts.schemaId];return t&&(t=(0,l.normalizeId)(t),delete this.schemas[t],delete this.refs[t]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else if("object"==typeof e&&void 0===t){if(Array.isArray(r=(t=e).keyword)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(k.call(this,r,t),!t)return(0,u.eachItem)(r,e=>T.call(this,e)),this;x.call(this,t);let o={...t,type:(0,c.getJSONTypes)(t.type),schemaType:(0,c.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(r,0===o.type.length?e=>T.call(this,e,o):e=>o.type.forEach(t=>T.call(this,e,o,t))),this}getKeyword(e){let t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;for(let r of(delete t.keywords[e],delete t.all[e],t.rules)){let t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){let r=this.RULES.all;for(let o of(e=JSON.parse(JSON.stringify(e)),t)){let t=o.split("/").slice(1),a=e;for(let e of t)a=a[e];for(let e in r){let t=r[e];if("object"!=typeof t)continue;let{$data:o}=t.definition,i=a[e];o&&i&&(a[e]=C(i))}}return e}_removeAllSchemas(e,t){for(let r in e){let o=e[r];(!t||t.test(r))&&("string"==typeof o?delete e[r]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[r]))}}_addSchema(e,t,r,o=this.opts.validateSchema,a=this.opts.addUsedSchema){let i,{schemaId:n}=this.opts;if("object"==typeof e)i=e[n];else if(this.opts.jtd)throw Error("schema must be object");else if("boolean"!=typeof e)throw Error("schema must be object or boolean");let c=this._cache.get(e);if(void 0!==c)return c;r=(0,l.normalizeId)(i||r);let u=l.getSchemaRefs.call(this,e,r);return c=new s.SchemaEnv({schema:e,schemaId:n,meta:t,baseId:r,localRefs:u}),this._cache.set(c.schema,c),a&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=c),o&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}};function b(e,t,r,o="error"){for(let a in e)a in t&&this.logger[o](`${r}: option ${a}. ${e[a]}`)}function _(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function S(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function $(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function w(e){if(Array.isArray(e))return void this.addVocabulary(e);for(let t in this.logger.warn("keywords option as map is deprecated, pass array"),e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function E(){let e={...this.opts};for(let t of f)delete e[t];return e}v.ValidationError=o.default,v.MissingRefError=a.default,e.default=v;let R={log(){},warn(){},error(){}},P=/^[a-z_$][a-z0-9_$:-]*$/i;function k(e,t){let{RULES:r}=this;if((0,u.eachItem)(e,e=>{if(r.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!P.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t||"validate"in t))throw Error('$data keyword must have "code" or "validate" function')}function T(e,t,r){var o;let a=null==t?void 0:t.post;if(r&&a)throw Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=a?i.post:i.rules.find(({type:e})=>e===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;let n={keyword:e,definition:{...t,type:(0,c.getJSONTypes)(t.type),schemaType:(0,c.getJSONTypes)(t.schemaType)}};t.before?O.call(this,s,n,t.before):s.rules.push(n),i.all[e]=n,null==(o=t.implements)||o.forEach(e=>this.addKeyword(e))}function O(e,t,r){let o=e.rules.findIndex(e=>e.keyword===r);o>=0?e.rules.splice(o,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function x(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=C(t)),e.validateSchema=this.compile(t,!0))}let j={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function C(e){return{anyOf:[e,j]}}}),po=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}}),pa=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=d5(),r=dX(),o=dV(),a=dH(),i=d3(),s=dF();function n(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,o._)`${r.scopeValue("wrapper",{ref:t})}.validate`}function l(e,t,i,n){let{gen:l,it:c}=e,{allErrors:u,schemaEnv:d,opts:p}=c,h=p.passContext?a.default.this:o.nil;function f(e){let t=(0,o._)`${e}.errors`;l.assign(a.default.vErrors,(0,o._)`${a.default.vErrors} === null ? ${t} : ${a.default.vErrors}.concat(${t})`),l.assign(a.default.errors,(0,o._)`${a.default.vErrors}.length`)}function m(e){var t;if(!c.opts.unevaluated)return;let r=null==(t=null==i?void 0:i.validate)?void 0:t.evaluated;if(!0!==c.props)if(r&&!r.dynamicProps)void 0!==r.props&&(c.props=s.mergeEvaluated.props(l,r.props,c.props));else{let t=l.var("props",(0,o._)`${e}.evaluated.props`);c.props=s.mergeEvaluated.props(l,t,c.props,o.Name)}if(!0!==c.items)if(r&&!r.dynamicItems)void 0!==r.items&&(c.items=s.mergeEvaluated.items(l,r.items,c.items));else{let t=l.var("items",(0,o._)`${e}.evaluated.items`);c.items=s.mergeEvaluated.items(l,t,c.items,o.Name)}}n?function(){if(!d.$async)throw Error("async schema referenced by sync schema");let a=l.let("valid");l.try(()=>{l.code((0,o._)`await ${(0,r.callValidateCode)(e,t,h)}`),m(t),u||l.assign(a,!0)},e=>{l.if((0,o._)`!(${e} instanceof ${c.ValidationError})`,()=>l.throw(e)),f(e),u||l.assign(a,!1)}),e.ok(a)}():e.result((0,r.callValidateCode)(e,t,h),()=>m(t),()=>f(t))}e.getValidate=n,e.callRef=l,e.default={keyword:"$ref",schemaType:"string",code(e){var r,a;let s,c,u,{gen:d,schema:p,it:h}=e,{baseId:f,schemaEnv:m,validateName:y,opts:g,self:v}=h,{root:b}=m;if(("#"===p||"#/"===p)&&f===b.baseId){if(m===b)return l(e,y,m,m.$async);let t=d.scopeValue("root",{ref:b});return l(e,(0,o._)`${t}.validate`,b,b.$async)}let _=i.resolveRef.call(v,b,f,p);if(void 0===_)throw new t.default(h.opts.uriResolver,f,p);return _ instanceof i.SchemaEnv?void l(e,n(e,r=_),r,r.$async):(a=_,s=d.scopeValue("schema",!0===g.code.source?{ref:a,code:(0,o.stringify)(a)}:{ref:a}),c=d.name("valid"),u=e.subschema({schema:a,dataTypes:[],schemaPath:o.nil,topSchemaRef:s,errSchemaPath:p},c),void(e.mergeEvaluated(u),e.ok(c)))}}}),pi=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=po(),r=pa();e.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default]}),ps=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV(),r=t.operators,o={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}};e.default={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must be ${o[e].okStr} ${r}`,params:({keyword:e,schemaCode:r})=>(0,t._)`{comparison: ${o[e].okStr}, limit: ${r}}`},code(e){let{keyword:r,data:a,schemaCode:i}=e;e.fail$data((0,t._)`${a} ${o[r].fail} ${i} || isNaN(${a})`)}}}),pn=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV();e.default={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:r,data:o,schemaCode:a,it:i}=e,s=i.opts.multipleOfPrecision,n=r.let("res"),l=s?(0,t._)`Math.abs(Math.round(${n}) - ${n}) > 1e-${s}`:(0,t._)`${n} !== parseInt(${n})`;e.fail$data((0,t._)`(${a} === 0 || (${n} = ${o}/${a}, ${l}))`)}}}),pl=c2(e=>{function t(e){let t,r=e.length,o=0,a=0;for(;a<r;)o++,(t=e.charCodeAt(a++))>=55296&&t<=56319&&a<r&&(64512&(t=e.charCodeAt(a)))==56320&&a++;return o}Object.defineProperty(e,"__esModule",{value:!0}),e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'}),pc=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV(),r=dF(),o=pl();e.default={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must NOT have ${"maxLength"===e?"more":"fewer"} than ${r} characters`,params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:a,data:i,schemaCode:s,it:n}=e,l="maxLength"===a?t.operators.GT:t.operators.LT,c=!1===n.opts.unicode?(0,t._)`${i}.length`:(0,t._)`${(0,r.useFunc)(e.gen,o.default)}(${i})`;e.fail$data((0,t._)`${c} ${l} ${s}`)}}}),pu=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dX(),r=dF(),o=dV();e.default={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,o.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,o._)`{pattern: ${e}}`},code(e){let{gen:a,data:i,$data:s,schema:n,schemaCode:l,it:c}=e,u=c.opts.unicodeRegExp?"u":"";if(s){let{regExp:t}=c.opts.code,s="new RegExp"===t.code?(0,o._)`new RegExp`:(0,r.useFunc)(a,t),n=a.let("valid");a.try(()=>a.assign(n,(0,o._)`${s}(${l}, ${u}).test(${i})`),()=>a.assign(n,!1)),e.fail$data((0,o._)`!${n}`)}else{let r=(0,t.usePattern)(e,n);e.fail$data((0,o._)`!${r}.test(${i})`)}}}}),pd=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV();e.default={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${r} properties`,params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:r,data:o,schemaCode:a}=e,i="maxProperties"===r?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${o}).length ${i} ${a}`)}}}),pp=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dX(),r=dV(),o=dF();e.default={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>(0,r.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,r._)`{missingProperty: ${e}}`},code(e){let{gen:a,schema:i,schemaCode:s,data:n,$data:l,it:c}=e,{opts:u}=c;if(!l&&0===i.length)return;let d=i.length>=u.loopRequired;if(c.allErrors?function(){if(d||l)e.block$data(r.nil,p);else for(let r of i)(0,t.checkReportMissingProp)(e,r)}():function(){let o=a.let("missing");if(d||l){let i=a.let("valid",!0);e.block$data(i,()=>{var l,c;return l=o,c=i,void(e.setParams({missingProperty:l}),a.forOf(l,s,()=>{a.assign(c,(0,t.propertyInData)(a,n,l,u.ownProperties)),a.if((0,r.not)(c),()=>{e.error(),a.break()})},r.nil))}),e.ok(i)}else a.if((0,t.checkMissingProp)(e,i,o)),(0,t.reportMissingProp)(e,o),a.else()}(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:r}=e.it;for(let e of i)if((null==t?void 0:t[e])===void 0&&!r.has(e)){let t=`required property "${e}" is not defined at "${c.schemaEnv.baseId+c.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(c,t,c.opts.strictRequired)}}function p(){a.forOf("prop",s,r=>{e.setParams({missingProperty:r}),a.if((0,t.noPropertyInData)(a,n,r,u.ownProperties),()=>e.error())})}}}}),ph=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV();e.default={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:r})=>(0,t.str)`must NOT have ${"maxItems"===e?"more":"fewer"} than ${r} items`,params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:r,data:o,schemaCode:a}=e,i="maxItems"===r?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${o}.length ${i} ${a}`)}}}),pf=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d0();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),pm=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dZ(),r=dV(),o=dF(),a=pf();e.default={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>(0,r.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,r._)`{i: ${e}, j: ${t}}`},code(e){let{gen:i,data:s,$data:n,schema:l,parentSchema:c,schemaCode:u,it:d}=e;if(!n&&!l)return;let p=i.let("valid"),h=c.items?(0,t.getSchemaTypes)(c.items):[];e.block$data(p,function(){let n=i.let("i",(0,r._)`${s}.length`),l=i.let("j");e.setParams({i:n,j:l}),i.assign(p,!0),i.if((0,r._)`${n} > 1`,()=>(h.length>0&&!h.some(e=>"object"===e||"array"===e)?function(o,a){let n=i.name("item"),l=(0,t.checkDataTypes)(h,n,d.opts.strictNumbers,t.DataType.Wrong),c=i.const("indices",(0,r._)`{}`);i.for((0,r._)`;${o}--;`,()=>{i.let(n,(0,r._)`${s}[${o}]`),i.if(l,(0,r._)`continue`),h.length>1&&i.if((0,r._)`typeof ${n} == "string"`,(0,r._)`${n} += "_"`),i.if((0,r._)`typeof ${c}[${n}] == "number"`,()=>{i.assign(a,(0,r._)`${c}[${n}]`),e.error(),i.assign(p,!1).break()}).code((0,r._)`${c}[${n}] = ${o}`)})}:function(t,n){let l=(0,o.useFunc)(i,a.default),c=i.name("outer");i.label(c).for((0,r._)`;${t}--;`,()=>i.for((0,r._)`${n} = ${t}; ${n}--;`,()=>i.if((0,r._)`${l}(${s}[${t}], ${s}[${n}])`,()=>{e.error(),i.assign(p,!1).break(c)})))})(n,l))},(0,r._)`${u} === false`),e.ok(p)}}}),py=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV(),r=dF(),o=pf();e.default={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:a,data:i,$data:s,schemaCode:n,schema:l}=e;s||l&&"object"==typeof l?e.fail$data((0,t._)`!${(0,r.useFunc)(a,o.default)}(${i}, ${n})`):e.fail((0,t._)`${l} !== ${i}`)}}}),pg=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV(),r=dF(),o=pf();e.default={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let a,i,{gen:s,data:n,$data:l,schema:c,schemaCode:u,it:d}=e;if(!l&&0===c.length)throw Error("enum must have non-empty array");let p=c.length>=d.opts.loopEnum,h=()=>null!=a?a:a=(0,r.useFunc)(s,o.default);if(p||l)i=s.let("valid"),e.block$data(i,function(){s.assign(i,!1),s.forOf("v",u,e=>s.if((0,t._)`${h()}(${n}, ${e})`,()=>s.assign(i,!0).break()))});else{if(!Array.isArray(c))throw Error("ajv implementation error");let e=s.const("vSchema",u);i=(0,t.or)(...c.map((r,o)=>{var a,i;let s;return a=e,"object"==typeof(s=c[i=o])&&null!==s?(0,t._)`${h()}(${n}, ${a}[${i}])`:(0,t._)`${n} === ${s}`}))}e.pass(i)}}}),pv=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ps(),r=pn(),o=pc(),a=pu(),i=pd(),s=pp(),n=ph(),l=pm(),c=py(),u=pg();e.default=[t.default,r.default,o.default,a.default,i.default,s.default,n.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,u.default]}),pb=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=dV(),r=dF();function o(e,o){let{gen:a,schema:i,data:s,keyword:n,it:l}=e;l.items=!0;let c=a.const("len",(0,t._)`${s}.length`);if(!1===i)e.setParams({len:o.length}),e.pass((0,t._)`${c} <= ${o.length}`);else if("object"==typeof i&&!(0,r.alwaysValidSchema)(l,i)){let i=a.var("valid",(0,t._)`${c} <= ${o.length}`);a.if((0,t.not)(i),()=>{var s;return s=i,void a.forRange("i",o.length,c,o=>{e.subschema({keyword:n,dataProp:o,dataPropType:r.Type.Num},s),l.allErrors||a.if((0,t.not)(s),()=>a.break())})}),e.ok(i)}}e.validateAdditionalItems=o,e.default={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:a}=e,{items:i}=t;Array.isArray(i)?o(e,i):(0,r.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas')}}}),p_=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=dV(),r=dF(),o=dX();function a(e,o,i=e.schema){let{gen:s,parentSchema:n,data:l,keyword:c,it:u}=e;(function(e){let{opts:t,errSchemaPath:a}=u,s=i.length,n=s===e.minItems&&(s===e.maxItems||!1===e[o]);if(t.strictTuples&&!n){let e=`"${c}" is ${s}-tuple, but minItems or maxItems/${o} are not specified or different at path "${a}"`;(0,r.checkStrictMode)(u,e,t.strictTuples)}})(n),u.opts.unevaluated&&i.length&&!0!==u.items&&(u.items=r.mergeEvaluated.items(s,i.length,u.items));let d=s.name("valid"),p=s.const("len",(0,t._)`${l}.length`);i.forEach((o,a)=>{(0,r.alwaysValidSchema)(u,o)||(s.if((0,t._)`${p} > ${a}`,()=>e.subschema({keyword:c,schemaProp:a,dataProp:a},d)),e.ok(d))})}e.validateTuple=a,e.default={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,"additionalItems",t);i.items=!0,(0,r.alwaysValidSchema)(i,t)||e.ok((0,o.validateArray)(e))}}}),pS=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p_();e.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,t.validateTuple)(e,"items")}}),p$=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV(),r=dF(),o=dX(),a=pb();e.default={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:i,it:s}=e,{prefixItems:n}=i;s.items=!0,(0,r.alwaysValidSchema)(s,t)||(n?(0,a.validateAdditionalItems)(e,n):e.ok((0,o.validateArray)(e)))}}}),pw=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV(),r=dF();e.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:r}})=>void 0===r?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${r} valid item(s)`,params:({params:{min:e,max:r}})=>void 0===r?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${r}}`},code(e){let o,a,{gen:i,schema:s,parentSchema:n,data:l,it:c}=e,{minContains:u,maxContains:d}=n;c.opts.next?(o=void 0===u?1:u,a=d):o=1;let p=i.const("len",(0,t._)`${l}.length`);if(e.setParams({min:o,max:a}),void 0===a&&0===o)return void(0,r.checkStrictMode)(c,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==a&&o>a){(0,r.checkStrictMode)(c,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,r.alwaysValidSchema)(c,s)){let r=(0,t._)`${p} >= ${o}`;void 0!==a&&(r=(0,t._)`${r} && ${p} <= ${a}`),e.pass(r);return}c.items=!0;let h=i.name("valid");function f(){let e=i.name("_valid"),r=i.let("count",0);m(e,()=>i.if(e,()=>{var e;return e=r,void(i.code((0,t._)`${e}++`),void 0===a?i.if((0,t._)`${e} >= ${o}`,()=>i.assign(h,!0).break()):(i.if((0,t._)`${e} > ${a}`,()=>i.assign(h,!1).break()),1===o?i.assign(h,!0):i.if((0,t._)`${e} >= ${o}`,()=>i.assign(h,!0))))}))}function m(t,o){i.forRange("i",0,p,a=>{e.subschema({keyword:"contains",dataProp:a,dataPropType:r.Type.Num,compositeRule:!0},t),o()})}void 0===a&&1===o?m(h,()=>i.if(h,()=>i.break())):0===o?(i.let(h,!0),void 0!==a&&i.if((0,t._)`${l}.length > 0`,f)):(i.let(h,!1),f()),e.result(h,()=>e.reset())}}}),pE=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=dV(),r=dF(),o=dX();e.error={message:({params:{property:e,depsCount:r,deps:o}})=>(0,t.str)`must have ${1===r?"property":"properties"} ${o} when property ${e} is present`,params:({params:{property:e,depsCount:r,deps:o,missingProperty:a}})=>(0,t._)`{property: ${e},
|
|
72
|
-
missingProperty: ${
|
|
73
|
-
depsCount: ${
|
|
74
|
-
deps: ${o}}`};let a={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){let[t,r]=function({schema:e}){let t={},r={};for(let o in e)"__proto__"!==o&&((Array.isArray(e[o])?t:r)[o]=e[o]);return[t,r]}(e);i(e,t),s(e,r)}};function i(e,r=e.schema){let{gen:a,data:s,it:n}=e;if(0===Object.keys(r).length)return;let l=a.let("missing");for(let i in r){let c=r[i];if(0===c.length)continue;let u=(0,o.propertyInData)(a,s,i,n.opts.ownProperties);e.setParams({property:i,depsCount:c.length,deps:c.join(", ")}),n.allErrors?a.if(u,()=>{for(let t of c)(0,o.checkReportMissingProp)(e,t)}):(a.if((0,t._)`${u} && (${(0,o.checkMissingProp)(e,c,l)})`),(0,o.reportMissingProp)(e,l),a.else())}}function s(e,t=e.schema){let{gen:a,data:i,keyword:n,it:l}=e,c=a.name("valid");for(let s in t)(0,r.alwaysValidSchema)(l,t[s])||(a.if((0,o.propertyInData)(a,i,s,l.opts.ownProperties),()=>{let t=e.subschema({keyword:n,schemaProp:s},c);e.mergeValidEvaluated(t,c)},()=>a.var(c,!0)),e.ok(c))}e.validatePropertyDeps=i,e.validateSchemaDeps=s,e.default=a}),pR=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV(),r=dF();e.default={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:o,schema:a,data:i,it:s}=e;if((0,r.alwaysValidSchema)(s,a))return;let n=o.name("valid");o.forIn("key",i,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},n),o.if((0,t.not)(n),()=>{e.error(!0),s.allErrors||o.break()})}),e.ok(n)}}}),pP=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dX(),r=dV(),o=dH(),a=dF();e.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>(0,r._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:i,schema:s,parentSchema:n,data:l,errsCount:c,it:u}=e;if(!c)throw Error("ajv implementation error");let{allErrors:d,opts:p}=u;if(u.props=!0,"all"!==p.removeAdditional&&(0,a.alwaysValidSchema)(u,s))return;let h=(0,t.allSchemaProperties)(n.properties),f=(0,t.allSchemaProperties)(n.patternProperties);function m(e){i.code((0,r._)`delete ${l}[${e}]`)}function y(t){if("all"===p.removeAdditional||p.removeAdditional&&!1===s)return void m(t);if(!1===s){e.setParams({additionalProperty:t}),e.error(),d||i.break();return}if("object"==typeof s&&!(0,a.alwaysValidSchema)(u,s)){let o=i.name("valid");"failing"===p.removeAdditional?(g(t,o,!1),i.if((0,r.not)(o),()=>{e.reset(),m(t)})):(g(t,o),d||i.if((0,r.not)(o),()=>i.break()))}}function g(t,r,o){let i={keyword:"additionalProperties",dataProp:t,dataPropType:a.Type.Str};!1===o&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}i.forIn("key",l,o=>{h.length||f.length?i.if(function(o){let s;if(h.length>8){let e=(0,a.schemaRefOrVal)(u,n.properties,"properties");s=(0,t.isOwnProperty)(i,e,o)}else s=h.length?(0,r.or)(...h.map(e=>(0,r._)`${o} === ${e}`)):r.nil;return f.length&&(s=(0,r.or)(s,...f.map(a=>(0,r._)`${(0,t.usePattern)(e,a)}.test(${o})`))),(0,r.not)(s)}(o),()=>y(o)):y(o)}),e.ok((0,r._)`${c} === ${o.default.errors}`)}}}),pk=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d9(),r=dX(),o=dF(),a=pP();e.default={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:i,schema:s,parentSchema:n,data:l,it:c}=e;"all"===c.opts.removeAdditional&&void 0===n.additionalProperties&&a.default.code(new t.KeywordCxt(c,a.default,"additionalProperties"));let u=(0,r.allSchemaProperties)(s);for(let e of u)c.definedProperties.add(e);c.opts.unevaluated&&u.length&&!0!==c.props&&(c.props=o.mergeEvaluated.props(i,(0,o.toHash)(u),c.props));let d=u.filter(e=>!(0,o.alwaysValidSchema)(c,s[e]));if(0===d.length)return;let p=i.name("valid");for(let t of d){var h;(h=t,c.opts.useDefaults&&!c.compositeRule&&void 0!==s[h].default)?f(t):(i.if((0,r.propertyInData)(i,l,t,c.opts.ownProperties)),f(t),c.allErrors||i.else().var(p,!0),i.endIf()),e.it.definedProperties.add(t),e.ok(p)}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}}}),pT=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dX(),r=dV(),o=dF(),a=dF();e.default={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:i,schema:s,data:n,parentSchema:l,it:c}=e,{opts:u}=c,d=(0,t.allSchemaProperties)(s),p=d.filter(e=>(0,o.alwaysValidSchema)(c,s[e]));if(0===d.length||p.length===d.length&&(!c.opts.unevaluated||!0===c.props))return;let h=u.strictSchema&&!u.allowMatchingProperties&&l.properties,f=i.name("valid");!0===c.props||c.props instanceof r.Name||(c.props=(0,a.evaluatedPropsToName)(i,c.props));let{props:m}=c;for(let e of d)h&&function(e){for(let t in h)new RegExp(e).test(t)&&(0,o.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}(e),c.allErrors?y(e):(i.var(f,!0),y(e),i.if(f));function y(o){i.forIn("key",n,s=>{i.if((0,r._)`${(0,t.usePattern)(e,o)}.test(${s})`,()=>{let t=p.includes(o);t||e.subschema({keyword:"patternProperties",schemaProp:o,dataProp:s,dataPropType:a.Type.Str},f),c.opts.unevaluated&&!0!==m?i.assign((0,r._)`${m}[${s}]`,!0):t||c.allErrors||i.if((0,r.not)(f),()=>i.break())})})}}}}),pO=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dF();e.default={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:r,schema:o,it:a}=e;if((0,t.alwaysValidSchema)(a,o))return void e.fail();let i=r.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}}}),px=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:dX().validateUnion,error:{message:"must match a schema in anyOf"}}}),pj=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV(),r=dF();e.default={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:o,schema:a,parentSchema:i,it:s}=e;if(!Array.isArray(a))throw Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;let n=o.let("valid",!1),l=o.let("passing",null),c=o.name("_valid");e.setParams({passing:l}),o.block(function(){a.forEach((a,i)=>{let u;(0,r.alwaysValidSchema)(s,a)?o.var(c,!0):u=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},c),i>0&&o.if((0,t._)`${c} && ${n}`).assign(n,!1).assign(l,(0,t._)`[${l}, ${i}]`).else(),o.if(c,()=>{o.assign(n,!0),o.assign(l,i),u&&e.mergeEvaluated(u,t.Name)})})}),e.result(n,()=>e.reset(),()=>e.error(!0))}}}),pC=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dF();e.default={keyword:"allOf",schemaType:"array",code(e){let{gen:r,schema:o,it:a}=e;if(!Array.isArray(o))throw Error("ajv implementation error");let i=r.name("valid");o.forEach((r,o)=>{if((0,t.alwaysValidSchema)(a,r))return;let s=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(s)})}}}),pN=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV(),r=dF();function o(e,t){let o=e.schema[t];return void 0!==o&&!(0,r.alwaysValidSchema)(e,o)}e.default={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let a,{gen:i,parentSchema:s,it:n}=e;void 0===s.then&&void 0===s.else&&(0,r.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let l=o(n,"then"),c=o(n,"else");if(!l&&!c)return;let u=i.let("valid",!0),d=i.name("_valid");if(a=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},d),e.mergeEvaluated(a),e.reset(),l&&c){let t=i.let("ifClause");e.setParams({ifClause:t}),i.if(d,p("then",t),p("else",t))}else l?i.if(d,p("then")):i.if((0,t.not)(d),p("else"));function p(r,o){return()=>{let a=e.subschema({keyword:r},d);i.assign(u,d),e.mergeValidEvaluated(a,u),o?i.assign(o,(0,t._)`${r}`):e.setParams({ifClause:r})}}e.pass(u,()=>e.error(!0))}}}),pI=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dF();e.default={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:r,it:o}){void 0===r.if&&(0,t.checkStrictMode)(o,`"${e}" without "if" is ignored`)}}}),pA=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pb(),r=pS(),o=p_(),a=p$(),i=pw(),s=pE(),n=pR(),l=pP(),c=pk(),u=pT(),d=pO(),p=px(),h=pj(),f=pC(),m=pN(),y=pI();e.default=function(e=!1){let g=[d.default,p.default,h.default,f.default,m.default,y.default,n.default,l.default,s.default,c.default,u.default];return e?g.push(r.default,a.default):g.push(t.default,o.default),g.push(i.default),g}}),pM=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV();e.default={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,r){let o,a,i,s,n,l,{gen:c,data:u,$data:d,schema:p,schemaCode:h,it:f}=e,{opts:m,errSchemaPath:y,schemaEnv:g,self:v}=f;m.validateFormats&&(d?(o=c.scopeValue("formats",{ref:v.formats,code:m.code.formats}),a=c.const("fDef",(0,t._)`${o}[${h}]`),i=c.let("fType"),s=c.let("format"),c.if((0,t._)`typeof ${a} == "object" && !(${a} instanceof RegExp)`,()=>c.assign(i,(0,t._)`${a}.type || "string"`).assign(s,(0,t._)`${a}.validate`),()=>c.assign(i,(0,t._)`"string"`).assign(s,a)),e.fail$data((0,t.or)(!1===m.strictSchema?t.nil:(0,t._)`${h} && !${s}`,(n=g.$async?(0,t._)`(${a}.async ? await ${s}(${u}) : ${s}(${u}))`:(0,t._)`${s}(${u})`,l=(0,t._)`(typeof ${s} == "function" ? ${n} : ${s}.test(${u}))`,(0,t._)`${s} && ${s} !== true && ${i} === ${r} && !${l}`)))):function(){var o;let a,i,s=v.formats[p];if(!s){if(!1===m.strictSchema)return v.logger.warn(n());throw Error(n());function n(){return`unknown format "${p}" ignored in schema at path "${y}"`}}if(!0===s)return;let[l,d,h]=(a=(o=s)instanceof RegExp?(0,t.regexpCode)(o):m.code.formats?(0,t._)`${m.code.formats}${(0,t.getProperty)(p)}`:void 0,i=c.scopeValue("formats",{key:p,ref:o,code:a}),"object"!=typeof o||o instanceof RegExp?["string",o,i]:[o.type||"string",o.validate,(0,t._)`${i}.validate`]);l===r&&e.pass(function(){if("object"==typeof s&&!(s instanceof RegExp)&&s.async){if(!g.$async)throw Error("async format in sync schema");return(0,t._)`await ${h}(${u})`}return"function"==typeof d?(0,t._)`${h}(${u})`:(0,t._)`${h}.test(${u})`}())}())}}}),pq=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[pM().default]}),pz=c2(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"]}),pL=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pi(),r=pv(),o=pA(),a=pq(),i=pz();e.default=[t.default,r.default,(0,o.default)(),a.default,i.metadataVocabulary,i.contentVocabulary]}),pD=c2(e=>{var t,r;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,(r=t||(e.DiscrError=t={})).Tag="tag",r.Mapping="mapping"}),pU=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV(),r=pD(),o=d3(),a=d5(),i=dF();e.default={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===r.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:r,tagName:o}})=>(0,t._)`{error: ${e}, tag: ${o}, tagValue: ${r}}`},code(e){let{gen:s,data:n,schema:l,parentSchema:c,it:u}=e,{oneOf:d}=c;if(!u.opts.discriminator)throw Error("discriminator: requires discriminator option");let p=l.propertyName;if("string"!=typeof p)throw Error("discriminator: requires propertyName");if(l.mapping)throw Error("discriminator: mapping is not supported");if(!d)throw Error("discriminator: requires oneOf keyword");let h=s.let("valid",!1),f=s.const("tag",(0,t._)`${n}${(0,t.getProperty)(p)}`);s.if((0,t._)`typeof ${f} == "string"`,()=>(function(){let n=function(){var e;let t={},r=n(c),s=!0;for(let t=0;t<d.length;t++){let c=d[t];if((null==c?void 0:c.$ref)&&!(0,i.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if((c=o.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e))instanceof o.SchemaEnv&&(c=c.schema),void 0===c)throw new a.default(u.opts.uriResolver,u.baseId,e)}let h=null==(e=null==c?void 0:c.properties)?void 0:e[p];if("object"!=typeof h)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);s=s&&(r||n(c)),function(e,t){if(e.const)l(e.const,t);else if(e.enum)for(let r of e.enum)l(r,t);else throw Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}(h,t)}if(!s)throw Error(`discriminator: "${p}" must be required`);return t;function n({required:e}){return Array.isArray(e)&&e.includes(p)}function l(e,r){if("string"!=typeof e||e in t)throw Error(`discriminator: "${p}" values must be unique strings`);t[e]=r}}();for(let r in s.if(!1),n)s.elseIf((0,t._)`${f} === ${r}`),s.assign(h,function(r){let o=s.name("valid"),a=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(a,t.Name),o}(n[r]));s.else(),e.error(!1,{discrError:r.DiscrError.Mapping,tag:f,tagName:p}),s.endIf()})(),()=>e.error(!1,{discrError:r.DiscrError.Tag,tag:f,tagName:p})),e.ok(h)}}}),pV=c2((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}}),pF=c2((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=pr(),o=pL(),a=pU(),i=pV(),s=["/properties"],n="http://json-schema.org/draft-07/schema";var l=class extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(i,s):i;this.addMetaSchema(e,n,!1),this.refs["http://json-schema.org/schema"]=n}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}};e.Ajv=l,t.exports=e=l,t.exports.Ajv=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var c=d9();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=dV();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=d4();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=d5();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})}),pH=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=dV(),r=dH(),o=d3(),a=pa();function i(e,i){let{gen:s,it:n}=e;n.schemaEnv.root.dynamicAnchors[i]=!0;let l=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(i)}`,c="#"===n.errSchemaPath?n.validateName:function(e){let{schemaEnv:t,schema:r,self:i}=e.it,{root:s,baseId:n,localRefs:l,meta:c}=t.root,{schemaId:u}=i.opts,d=new o.SchemaEnv({schema:r,schemaId:u,root:s,baseId:n,localRefs:l,meta:c});return o.compileSchema.call(i,d),(0,a.getValidate)(e,d)}(e);s.if((0,t._)`!${l}`,()=>s.assign(l,c))}e.dynamicAnchor=i,e.default={keyword:"$dynamicAnchor",schemaType:"string",code:e=>i(e,e.schema)}}),pK=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=dV(),r=dH(),o=pa();function a(e,a){let{gen:i,keyword:s,it:n}=e;if("#"!==a[0])throw Error(`"${s}" only supports hash fragment reference`);let l=a.slice(1);if(n.allErrors)c();else{let t=i.let("valid",!1);c(t),e.ok(t)}function c(e){if(n.schemaEnv.root.dynamicAnchors[l]){let o=i.let("_v",(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(l)}`);i.if(o,u(o,e),u(n.validateName,e))}else u(n.validateName,e)()}function u(t,r){return r?()=>i.block(()=>{(0,o.callRef)(e,t),i.let(r,!0)}):()=>(0,o.callRef)(e,t)}}e.dynamicRef=a,e.default={keyword:"$dynamicRef",schemaType:"string",code:e=>a(e,e.schema)}}),pJ=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pH(),r=dF();e.default={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,t.dynamicAnchor)(e,""):(0,r.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}}}),pB=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pK();e.default={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,t.dynamicRef)(e,e.schema)}}),pG=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pH(),r=pK(),o=pJ(),a=pB();e.default=[t.default,r.default,o.default,a.default]}),pZ=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pE();e.default={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}}),pW=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pE();e.default={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,t.validateSchemaDeps)(e)}}),pX=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dF();e.default={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:r,it:o}){void 0===r.contains&&(0,t.checkStrictMode)(o,`"${e}" without "contains" is ignored`)}}}),pY=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pZ(),r=pW(),o=pX();e.default=[t.default,r.default,o.default]}),pQ=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV(),r=dF(),o=dH();e.default={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:e})=>(0,t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:a,schema:i,data:s,errsCount:n,it:l}=e;if(!n)throw Error("ajv implementation error");let{allErrors:c,props:u}=l;function d(o){if(!1===i){e.setParams({unevaluatedProperty:o}),e.error(),c||a.break();return}if(!(0,r.alwaysValidSchema)(l,i)){let i=a.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:o,dataPropType:r.Type.Str},i),c||a.if((0,t.not)(i),()=>a.break())}}u instanceof t.Name?a.if((0,t._)`${u} !== true`,()=>a.forIn("key",s,e=>{var r,o;return a.if((r=u,o=e,(0,t._)`!${r} || !${r}[${o}]`),()=>d(e))})):!0!==u&&a.forIn("key",s,e=>void 0===u?d(e):a.if(function(e,r){let o=[];for(let a in e)!0===e[a]&&o.push((0,t._)`${r} !== ${a}`);return(0,t.and)(...o)}(u,e),()=>d(e))),l.props=!0,e.ok((0,t._)`${n} === ${o.default.errors}`)}}}),p0=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dV(),r=dF();e.default={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{gen:o,schema:a,data:i,it:s}=e,n=s.items||0;if(!0===n)return;let l=o.const("len",(0,t._)`${i}.length`);if(!1===a)e.setParams({len:n}),e.fail((0,t._)`${l} > ${n}`);else if("object"==typeof a&&!(0,r.alwaysValidSchema)(s,a)){let a=o.var("valid",(0,t._)`${l} <= ${n}`);o.if((0,t.not)(a),()=>{var i,c;return i=a,c=n,void o.forRange("i",c,l,a=>{e.subschema({keyword:"unevaluatedItems",dataProp:a,dataPropType:r.Type.Num},i),s.allErrors||o.if((0,t.not)(i),()=>o.break())})}),e.ok(a)}s.items=!0}}}),p1=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pQ(),r=p0();e.default=[t.default,r.default]}),p2=c2((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"}]}}}}}),p9=c2((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:"#"}}}}}),p4=c2((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:"#"}}}}),p5=c2((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:{}}}}}),p3=c2((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"}}}}),p6=c2((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}}}}),p8=c2((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:[]}}}}),p7=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=p2(),r=p9(),o=p4(),a=p5(),i=p3(),s=p6(),n=p8(),l=["/properties"];e.default=function(e){return[t,r,o,a,c(this,i),s,c(this,n)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function c(t,r){return e?t.$dataMetaSchema(r,l):r}}}),he=c2((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=pr(),o=pL(),a=pG(),i=pY(),s=p1(),n=pU(),l=p7(),c="https://json-schema.org/draft/2019-09/schema";var u=class extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(a.default),o.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(i.default),this.addVocabulary(s.default),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(l.default.call(this,e),this.refs["http://json-schema.org/schema"]=c)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};e.Ajv2019=u,t.exports=e=u,t.exports.Ajv2019=u,Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var d=d9();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var p=dV();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var h=d4();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return h.default}});var f=d5();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}),ht=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pi(),r=pv(),o=pA(),a=pG(),i=pY(),s=p1(),n=pq(),l=pz();e.default=[a.default,t.default,r.default,(0,o.default)(!0),n.default,l.metadataVocabulary,l.contentVocabulary,i.default,s.default]}),hr=c2((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}}}}),ho=c2((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"}}}}}),ha=c2((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"}}}}),hi=c2((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"}}}}),hs=c2((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"}}}}),hn=c2((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"}}}}),hl=c2((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}}}}),hc=c2((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:[]}}}}),hu=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hr(),r=ho(),o=ha(),a=hi(),i=hs(),s=hn(),n=hl(),l=hc(),c=["/properties"];e.default=function(e){return[t,r,o,a,i,u(this,s),n,u(this,l)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function u(t,r){return e?t.$dataMetaSchema(r,c):r}}}),hd=c2((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=pr(),o=ht(),a=pU(),i=hu(),s="https://json-schema.org/draft/2020-12/schema";var n=class extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(i.default.call(this,e),this.refs["http://json-schema.org/schema"]=s)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}};e.Ajv2020=n,t.exports=e=n,t.exports.Ajv2020=n,Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;var l=d9();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=dV();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var u=d4();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=d5();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}),hp=c2(e=>{function t(e,t){return{validate:e,compare:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:t(a,i),time:t(n(!0),l),"date-time":t(d(!0),p),"iso-time":t(n(),c),"iso-date-time":t(d(),h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return f.test(e)&&m.test(e)},"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:function(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},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:function(e){return y.lastIndex=0,y.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=v&&e>=g}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:b},double:{type:"number",validate:b},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,l),"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,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"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,h),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);let r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){var t;let a=r.exec(e);if(!a)return!1;let i=+a[1],s=+a[2],n=+a[3];return s>=1&&s<=12&&n>=1&&n<=(2===s&&(t=i)%4==0&&(t%100!=0||t%400==0)?29:o[s])}function i(e,t){if(e&&t)return e>t?1:e<t?-1:0}let s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function n(e){return function(t){let r=s.exec(t);if(!r)return!1;let o=+r[1],a=+r[2],i=+r[3],n=r[4],l="-"===r[5]?-1:1,c=+(r[6]||0),u=+(r[7]||0);if(c>23||u>59||e&&!n)return!1;if(o<=23&&a<=59&&i<60)return!0;let d=a-u*l,p=o-c*l-(d<0);return(23===p||-1===p)&&(59===d||-1===d)&&i<61}}function l(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),o=new Date("2020-01-01T"+t).valueOf();if(r&&o)return r-o}function c(e,t){if(!(e&&t))return;let r=s.exec(e),o=s.exec(t);if(r&&o)return(e=r[1]+r[2]+r[3])>(t=o[1]+o[2]+o[3])?1:e<t?-1:0}let u=/t|\s/i;function d(e){let t=n(e);return function(e){let r=e.split(u);return 2===r.length&&a(r[0])&&t(r[1])}}function p(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),o=new Date(t).valueOf();if(r&&o)return r-o}function h(e,t){if(!(e&&t))return;let[r,o]=e.split(u),[a,s]=t.split(u),n=i(r,a);if(void 0!==n)return n||l(o,s)}let f=/\/|:/,m=/^(?:[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,y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,g=-0x80000000,v=0x80000000-1;function b(){return!0}let _=/[^\\]\\Z/}),hh=c2(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=pF(),r=dV(),o=r.operators,a={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}};e.formatLimitDefinition={keyword:Object.keys(a),type:"string",schemaType:"string",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,r.str)`should be ${a[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,r._)`{comparison: ${a[e].okStr}, limit: ${t}}`},code(e){let o,i,{gen:s,data:n,schemaCode:l,keyword:c,it:u}=e,{opts:d,self:p}=u;if(!d.validateFormats)return;let h=new t.KeywordCxt(u,p.RULES.all.format.definition,"format");function f(e){return(0,r._)`${e}.compare(${n}, ${l}) ${a[c].fail} 0`}h.$data?(o=s.scopeValue("formats",{ref:p.formats,code:d.code.formats}),i=s.const("fmt",(0,r._)`${o}[${h.schemaCode}]`),e.fail$data((0,r.or)((0,r._)`typeof ${i} != "object"`,(0,r._)`${i} instanceof RegExp`,(0,r._)`typeof ${i}.compare != "function"`,f(i)))):function(){let t=h.schema,o=p.formats[t];if(!o||!0===o)return;if("object"!=typeof o||o instanceof RegExp||"function"!=typeof o.compare)throw Error(`"${c}": format "${t}" does not define "compare" function`);let a=s.scopeValue("formats",{key:t,ref:o,code:d.code.formats?(0,r._)`${d.code.formats}${(0,r.getProperty)(t)}`:void 0});e.fail$data(f(a))}()},dependencies:["format"]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}),hf=c2((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=hp(),o=hh(),a=dV(),i=new a.Name("fullFormats"),s=new a.Name("fastFormats"),n=(e,t={keywords:!0})=>{if(Array.isArray(t))return l(e,t,r.fullFormats,i),e;let[a,n]="fast"===t.mode?[r.fastFormats,s]:[r.fullFormats,i];return l(e,t.formats||r.formatNames,a,n),t.keywords&&(0,o.default)(e),e};function l(e,t,r,o){var i;for(let s of(null!=(i=e.opts.code).formats||(i.formats=(0,a._)`require("ajv-formats/dist/formats").${o}`),t))e.addFormat(s,r[s])}n.get=(e,t="full")=>{let o=("fast"===t?r.fastFormats:r.fullFormats)[e];if(!o)throw Error(`Unknown format "${e}"`);return o},t.exports=e=n,Object.defineProperty(e,"__esModule",{value:!0}),e.default=n}),hm=pF(),hy=he(),hg=hd();let hv=c9(hf(),1).default;function hb(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return hv(t),t}var h_=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=void 0!==e,this._ajv=e}get ajv(){return this._ajv??=hb(hg.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=function(e,t){if(!("$schema"in e)||"string"!=typeof e.$schema)return"2020-12";let r=e.$schema.replace(/#$/,"");if(c4.has(r))return"2020-12";if(c5.has(r))return"2019-09";if(c3.has(r)||c6.has(r))return"draft-7";throw 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}`)}(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");return"2020-12"===t?this.ajv:"2019-09"===t?this._ajv2019??=hb(hy.Ajv2019):this._ajvDraft7??=hb(hm.Ajv)}getValidator(e){let t=this._engineFor(e),r="$id"in e&&"string"==typeof e.$id?t.getSchema(e.$id)??t.compile(e):t.compile(e);return e=>r(e)?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(r.errors)}}};async function hS(e){return(await c).getRandomValues(new Uint8Array(e))}async function h$(e){let t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=256-256%t.length,o="";for(;o.length<e;)for(let a of(await hS(e-o.length)))a<r&&(o+=t[a%t.length]);return o}async function hw(e){return await h$(e)}async function hE(e){return btoa(String.fromCharCode(...new Uint8Array(await (await c).subtle.digest("SHA-256",new TextEncoder().encode(e))))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function hR(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await hw(e),r=await hE(t);return{code_verifier:t,code_challenge:r}}hm.Ajv,c=globalThis.crypto?.webcrypto??globalThis.crypto??Promise.resolve().then(i.t.bind(i,7598,19)).then(e=>e.webcrypto);class hP extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}function hk(e){}function hT(e,t,r){return 100===r&&97===e.charCodeAt(t+1)&&116===e.charCodeAt(t+2)&&97===e.charCodeAt(t+3)&&58===e.charCodeAt(t+4)}function hO(e,t,r){return 101===r&&118===e.charCodeAt(t+1)&&101===e.charCodeAt(t+2)&&110===e.charCodeAt(t+3)&&116===e.charCodeAt(t+4)&&58===e.charCodeAt(t+5)}class hx extends TransformStream{constructor({onError:e,onRetry:t,onComment:r,maxBufferSize:o}={}){let a;super({start(i){a=function(e){if("function"==typeof e)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=hk,onError:r=hk,onRetry:o=hk,onComment:a,maxBufferSize:i}=e,s=[],n=0,l=!0,c,u="",d=0,p,h=!1;function f(){void 0!==i&&(n+u.length<=i||(h=!0,s.length=0,n=0,c=void 0,u="",d=0,p=void 0,r(new hP(`Buffered data exceeded max buffer size of ${i} characters`,{type:"max-buffer-size-exceeded"}))))}function m(e){let r=0;if(-1===e.indexOf("\r")){let o=e.indexOf(`
|
|
75
|
-
`,
|
|
76
|
-
`,
|
|
77
|
-
`,
|
|
78
|
-
${
|
|
79
|
-
`,
|
|
80
|
-
`,
|
|
81
|
-
${
|
|
82
|
-
${
|
|
83
|
-
`)&&-1===e.indexOf("\r")){s.push(e),n+=e.length,f();return}s.push(e);let t=s.join("");s.length=0,n=0;let r=m(t);""!==r&&(s.push(r),n=r.length),f()},reset:function(e={}){if(e.consume&&s.length>0){let e=s.join("");y(e,0,e.length)}l=!0,c=void 0,u="",d=0,p=void 0,s.length=0,n=0,h=!1}}}({onEvent:e=>{i.enqueue(e)},onError(t){"function"==typeof e&&e(t),("terminate"===e||"max-buffer-size-exceeded"===t.type)&&i.error(t)},onRetry:t,onComment:r,maxBufferSize:o})},transform(e){a.feed(e)}})}}var hj=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](e){return ue(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return ue(this,e)}constructor(e){super(e),this.name=new.target.name,c7(this,new.target)}},hC=class extends hj{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.IssuerMismatchError"})}kind;expected;received;constructor(e,t,r){super(`Issuer mismatch in ${"metadata"===e?"authorization server metadata (RFC 8414 \xa73.3)":"authorization response (RFC 9207)"}: expected ${JSON.stringify(t)}, received ${JSON.stringify(r)}`),this.kind=e,this.expected=t,this.received=r}},hN=class extends hj{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.RegistrationRejectedError"})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},hI=class extends hj{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsecureTokenEndpointError"})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},hA=class extends hj{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.AuthorizationServerMismatchError"})}constructor(e,t){super(`Authorization server changed between redirect and callback (redirected to ${JSON.stringify(e)}, callback resolved ${JSON.stringify(t)}); refusing to send authorization_code/code_verifier to a different token endpoint`),this.recordedIssuer=e,this.currentIssuer=t}},hM=class extends hj{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsufficientScopeError"})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:""}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}};function hq(e,t,r){if(void 0!==e)return void 0===e.issuer?(r?.canPersistStamp!==!1&&console.warn("[mcp-sdk] SEP-2352: stored OAuth credential has no 'issuer' stamp (pre-upgrade storage or provider not round-tripping the value). SEP-2352 isolation is inactive for this read; ensure your provider round-trips the issuer field."),e):hz(e.issuer,t)?e:void 0}function hz(e,t){return e===t||e.endsWith("/")&&e.slice(0,-1)===t||t.endsWith("/")&&t.slice(0,-1)===e}async function hL(e,t,r){let{resourceMetadataUrl:o,scope:a}=hY(t.response);if(await hZ(e,{serverUrl:t.serverUrl,resourceMetadataUrl:o,scope:a,fetchFn:t.fetchFn,...r})!=="AUTHORIZED")throw new hD}var hD=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](e){return ue(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return ue(this,e)}constructor(e){super(e??"Unauthorized"),this.name="UnauthorizedError",c7(this,new.target)}};function hU(e){return e?.authorization_response_iss_parameter_supported===!0}function hV({iss:e,expectedIssuer:t,issParameterSupported:r}){if(void 0!==t){if(void 0===e){if(r)throw new hC("authorization_response",t,void 0);return}if(e!==t)throw new hC("authorization_response",t,e)}}function hF(...e){let t=new Set;for(let r of e)if(r)for(let e of r.split(/\s+/))e&&t.add(e);return t.size>0?[...t].join(" "):void 0}async function hH(e,t,r,o,a){if("string"==typeof e)return{authorizationCode:e,iss:t};let i=e.get("iss")??void 0,s=e.get("code");if(s)return{authorizationCode:s,iss:i};let n=(await r.discoveryState?.())?.authorizationServerMetadata;if(!n)try{n=(await h5(o,a)).authorizationServerMetadata}catch{n=void 0}if(!n)throw new hD("Authorization callback failed and the issuer could not be verified");hV({iss:i,expectedIssuer:n.issuer,issParameterSupported:hU(n)});let l=e.get("error");if(l)throw new ur(l,e.get("error_description")??l,e.get("error_uri")??void 0);throw new hD("Authorization callback contained neither `code` nor `error`")}let hK="code",hJ="S256";function hB(e){return"localhost"===e||"127.0.0.1"===e||"[::1]"===e||"::1"===e}async function hG(e){let t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{let e=nP.parse(JSON.parse(r));return ur.fromResponse(e)}catch(o){let e=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${o}. Raw body: ${r}`;return new ur(ut.ServerError,e)}}async function hZ(e,t){try{return await hW(e,t)}catch(r){if(r instanceof ur){if(r.code===ut.InvalidClient||r.code===ut.UnauthorizedClient)return await e.invalidateCredentials?.("client"),await e.invalidateCredentials?.("tokens"),await hW(e,t);else if(r.code===ut.InvalidGrant)return await e.invalidateCredentials?.("tokens"),await hW(e,t)}throw r}}async function hW(e,{serverUrl:t,authorizationCode:r,iss:o,scope:a,resourceMetadataUrl:i,fetchFn:s,skipIssuerMetadataValidation:n,forceReauthorization:l}){let c,u,d,p,h,f={...h=e.clientMetadata,grant_types:h.grant_types??(void 0===e.redirectUrl?void 0:["authorization_code","refresh_token"]),application_type:h.application_type??function(e){for(let t of e??[]){let e;try{e=new URL(t)}catch{continue}if("http:"!==e.protocol&&"https:"!==e.protocol||hB(e.hostname))return"native"}return"web"}(h.redirect_uris)},m=await e.discoveryState?.(),y=i;if(!y&&m?.resourceMetadataUrl&&(y=new URL(m.resourceMetadataUrl)),m?.authorizationServerUrl){if(u=m.authorizationServerUrl,c=m.resourceMetadata,d=m.authorizationServerMetadata??await h4(u,{fetchFn:s,skipIssuerValidation:n}),!c)try{c=await h0(t,{resourceMetadataUrl:y},s)}catch(e){if(e instanceof TypeError)throw e}(d!==m.authorizationServerMetadata||c!==m.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(u),resourceMetadataUrl:y?.toString(),resourceMetadata:c,authorizationServerMetadata:d})}else{let e=await h5(t,{resourceMetadataUrl:y,fetchFn:s,skipIssuerMetadataValidation:n});u=e.authorizationServerUrl,d=e.authorizationServerMetadata,c=e.resourceMetadata,p={authorizationServerUrl:String(u),resourceMetadataUrl:y?.toString(),resourceMetadata:c,authorizationServerMetadata:d}}let g=d?.issuer??String(u),v={issuer:g};if(await e.saveAuthorizationServerUrl?.(g),void 0!==r){let t=m?.authorizationServerMetadata?.issuer??m?.authorizationServerUrl;if(void 0===t){if(void 0!==e.saveDiscoveryState)throw new hA("discoveryState was not available on the callback leg; ensure your provider persists discoveryState alongside codeVerifier",g);console.warn("[mcp-sdk] OAuthClientProvider does not implement saveDiscoveryState()/discoveryState(); the SEP-2352 callback-leg authorization-server binding cannot be checked. Implement discoveryState (persist alongside codeVerifier) — see docs/migration/upgrade-to-v2.md \xa7SEP-2352.")}else if(!hz(t,g))throw new hA(t,g)}p&&await e.saveDiscoveryState?.(p);let b=await hX(t,e,c);b&&await e.saveResourceUrl?.(String(b));let _=function(e){let{requestedScope:t,resourceMetadata:r,authServerMetadata:o,clientMetadata:a}=e,i=t||r?.scopes_supported?.join(" ")||a.scope;return i&&o?.scopes_supported?.includes("offline_access")&&!i.split(" ").includes("offline_access")&&a.grant_types?.includes("refresh_token")&&(i=`${i} offline_access`),i}({requestedScope:a,resourceMetadata:c,authServerMetadata:d,clientMetadata:e.clientMetadata}),S=await Promise.resolve(e.clientInformation(v)),$=hq(S,g,{canPersistStamp:void 0!==e.saveClientInformation});if(void 0===$&&S?.issuer&&void 0===e.saveClientInformation)throw new hA(S.issuer,g);if($&&void 0===$.issuer&&($={...$,issuer:g},await e.saveClientInformation?.($,v)),!$){if(void 0!==r)throw Error("Existing OAuth client information is required when exchanging an authorization code");let t=d?.client_id_metadata_document_supported===!0,o=e.clientMetadataUrl;if(o&&!function(e){if(!e)return!1;try{let t=new URL(e);return"https:"===t.protocol&&"/"!==t.pathname}catch{return!1}}(o))throw new ur(ut.InvalidClientMetadata,`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${o}`);if(t&&o)$={client_id:o,issuer:g},await e.saveClientInformation?.($,v);else{if(!e.saveClientInformation)throw Error("OAuth client information must be saveable for dynamic registration");$={...await fe(u,{metadata:d,clientMetadata:f,scope:_,fetchFn:s}),issuer:g},await e.saveClientInformation($,v)}}let w=!e.redirectUrl;if(void 0!==r||w){void 0!==r&&hV({iss:o,expectedIssuer:d?.issuer,issParameterSupported:hU(d)});let t=await h7(e,u,{metadata:d,resource:b,authorizationCode:r,iss:o,scope:_,fetchFn:s});return await e.saveTokens({...t,issuer:g},v),"AUTHORIZED"}let E=hq(await e.tokens(v),g);if(E&&void 0===E.issuer&&(E={...E,issuer:g},await e.saveTokens(E,v)),E?.refresh_token&&!l)try{let t=await h8(u,{metadata:d,clientInformation:$,refreshToken:E.refresh_token,resource:b,addClientAuthentication:e.addClientAuthentication,fetchFn:s});return await e.saveTokens({...t,issuer:g},v),"AUTHORIZED"}catch(e){if(e instanceof hI||e instanceof ur&&e.code!==ut.ServerError)throw e}let R=e.state?await e.state():void 0,{authorizationUrl:P,codeVerifier:k}=await h3(u,{metadata:d,clientInformation:$,state:R,redirectUrl:e.redirectUrl,scope:_,resource:b});return await e.saveCodeVerifier(k),await e.redirectToAuthorization(P),"REDIRECT"}async function hX(e,t,r){let o,a=((o=new URL("string"==typeof e?e:e.href)).hash="",o);if(t.validateResourceURL)return await t.validateResourceURL(a,r?.resource);if(r){if(!function({requestedResource:e,configuredResource:t}){let r=new URL("string"==typeof e?e:e.href),o=new URL("string"==typeof t?t:t.href);if(r.origin!==o.origin||r.pathname.length<o.pathname.length)return!1;let a=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=o.pathname.endsWith("/")?o.pathname:o.pathname+"/";return a.startsWith(i)}({requestedResource:a,configuredResource:r.resource}))throw Error(`Protected resource ${r.resource} does not match expected ${a} (or origin)`);return new URL(r.resource)}}function hY(e){let t,r=e.headers.get("WWW-Authenticate");if(!r)return{};let[o,a]=r.split(" ");if(o?.toLowerCase()!=="bearer"||!a)return{};let i=hQ(e,"resource_metadata")||void 0;if(i)try{t=new URL(i)}catch{}let s=hQ(e,"scope")||void 0;return{resourceMetadataUrl:t,scope:s,error:hQ(e,"error")||void 0,errorDescription:hQ(e,"error_description")||void 0}}function hQ(e,t){let r=e.headers.get("WWW-Authenticate");if(!r)return null;let o=new RegExp(String.raw`${t}=(?:"([^"]+)"|([^\s,]+))`),a=r.match(o);if(a){let e=a[1]||a[2];if(e)return e}return null}async function h0(e,t,r=fetch){let o=await h9(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!o||404===o.status)throw await o?.text?.().catch(()=>{}),Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!o.ok)throw await o.text?.().catch(()=>{}),Error(`HTTP ${o.status} trying to load well-known OAuth protected resource metadata.`);return n_.parse(await o.json())}async function h1(e,t,r=fetch){try{return await r(e,{headers:t})}catch(e){throw e}}async function h2(e,t,r=fetch){return await h1(e,{"MCP-Protocol-Version":t},r)}async function h9(e,t,r,o){var a,i;let s,n=new URL(e),l=o?.protocolVersion??aA;o?.metadataUrl?s=new URL(o.metadataUrl):(s=new URL(function(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}(t,n.pathname),o?.metadataServerUrl??n)).search=n.search;let c=await h2(s,l,r);return!o?.metadataUrl&&(a=c,i=n.pathname,!a||"/"!==i&&(a.status>=400&&a.status<500||502===a.status))&&(c=await h2(new URL(`/.well-known/${t}`,n),l,r)),c}async function h4(e,{fetchFn:t=fetch,protocolVersion:r=aA,skipIssuerValidation:o=!1}={}){let a={"MCP-Protocol-Version":r,Accept:"application/json"};for(let{url:r,type:i}of function(e){let t="string"==typeof e?new URL(e):e,r="/"!==t.pathname,o=[];if(!r)return o.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"},{url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),o;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),o.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"},{url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"},{url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),o}(e)){let s=await h1(r,a,t);if(!s)continue;if(!s.ok){if(await s.text?.().catch(()=>{}),s.status>=400&&s.status<500||502===s.status)continue;throw Error(`HTTP ${s.status} trying to load ${"oauth"===i?"OAuth":"OpenID provider"} metadata from ${r}`)}let n="oauth"===i?nS.parse(await s.json()):nw.parse(await s.json());if(!o){let t="string"==typeof e?e:e.href;if(!(n.issuer===t||t.endsWith("/")&&n.issuer===t.slice(0,-1)))throw new hC("metadata",t,n.issuer)}return n}}async function h5(e,t){let r,o;try{(r=await h0(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn)).authorization_servers&&r.authorization_servers.length>0&&(o=r.authorization_servers[0])}catch(e){if(e instanceof TypeError)throw e}o||(o=String(new URL("/",e)));let a=await h4(o,{fetchFn:t?.fetchFn,skipIssuerValidation:t?.skipIssuerMetadataValidation});return{authorizationServerUrl:o,authorizationServerMetadata:a,resourceMetadata:r}}async function h3(e,{metadata:t,clientInformation:r,redirectUrl:o,scope:a,state:i,resource:s}){let n;if(t){if(n=new URL(t.authorization_endpoint),!t.response_types_supported.includes(hK))throw Error(`Incompatible auth server: does not support response type ${hK}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(hJ))throw Error(`Incompatible auth server: does not support code challenge method ${hJ}`)}else n=new URL("/authorize",e);let l=await hR(),c=l.code_verifier,u=l.code_challenge;return n.searchParams.set("response_type",hK),n.searchParams.set("client_id",r.client_id),n.searchParams.set("code_challenge",u),n.searchParams.set("code_challenge_method",hJ),n.searchParams.set("redirect_uri",String(o)),i&&n.searchParams.set("state",i),a&&n.searchParams.set("scope",a),a?.split(" ").includes("offline_access")&&n.searchParams.append("prompt","consent"),s&&n.searchParams.set("resource",s.href),{authorizationUrl:n,codeVerifier:c}}async function h6(e,{metadata:t,tokenRequestParams:r,clientInformation:o,addClientAuthentication:a,resource:i,fetchFn:s}){var n,l;let c,u=function(e){let t=new URL(String(e));if("https:"!==t.protocol&&!hB(t.hostname))throw new hI(t.href);return t}(t?.token_endpoint??new URL("/token",e)),d=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});i&&r.set("resource",i.href),a?await a(d,r,u,t):o&&function(e,t,r,o){let{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":var s,n,l,c,u=a,d=i,p=r;if(!d)throw Error("client_secret_basic authentication requires a client_secret");let h=btoa(`${u}:${d}`);p.set("Authorization",`Basic ${h}`);return;case"client_secret_post":s=a,n=i,(l=o).set("client_id",s),n&&l.set("client_secret",n);return;case"none":c=a,o.set("client_id",c);return;default:throw Error(`Unsupported client authentication method: ${e}`)}}((n=o,l=t?.token_endpoint_auth_methods_supported??[],c=void 0!==n.client_secret,"token_endpoint_auth_method"in n&&n.token_endpoint_auth_method&&["client_secret_basic","client_secret_post","none"].includes(n.token_endpoint_auth_method)&&(0===l.length||l.includes(n.token_endpoint_auth_method))?n.token_endpoint_auth_method:0===l.length?c?"client_secret_basic":"none":c&&l.includes("client_secret_basic")?"client_secret_basic":c&&l.includes("client_secret_post")?"client_secret_post":l.includes("none")?"none":c?"client_secret_post":"none"),o,d,r);let p=await (s??fetch)(u,{method:"POST",headers:d,body:r});if(!p.ok)throw await hG(p);let h=await p.json();try{return nE.parse(h)}catch(e){if("object"==typeof h&&null!==h&&"error"in h)throw await hG(JSON.stringify(h));throw e}}async function h8(e,{metadata:t,clientInformation:r,refreshToken:o,resource:a,addClientAuthentication:i,fetchFn:s}){return{refresh_token:o,...await h6(e,{metadata:t,tokenRequestParams:new URLSearchParams({grant_type:"refresh_token",refresh_token:o}),clientInformation:r,addClientAuthentication:i,resource:a,fetchFn:s})}}async function h7(e,t,{metadata:r,resource:o,authorizationCode:a,iss:i,scope:s,fetchFn:n}={}){let l;void 0!==a&&hV({iss:i,expectedIssuer:r?.issuer,issParameterSupported:hU(r)});let c=s??e.clientMetadata.scope;if(e.prepareTokenRequest&&(l=await e.prepareTokenRequest(c)),!l){if(!a)throw Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw Error("redirectUrl is required for authorization_code flow");l=new URLSearchParams({grant_type:"authorization_code",code:a,code_verifier:await e.codeVerifier(),redirect_uri:String(e.redirectUrl)})}let u=await e.clientInformation({issuer:r?.issuer??String(t)});return h6(t,{metadata:r,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:e.addClientAuthentication,resource:o,fetchFn:n})}async function fe(e,{metadata:t,clientMetadata:r,scope:o,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);let s={...r,...void 0===o?{}:{scope:o}},n=await (a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!n.ok)throw new hN({status:n.status,body:await n.text(),submittedMetadata:s});return nx.parse(await n.json())}let ft=new Set(["tools/list","prompts/list","resources/list","resources/templates/list","server/discover"]);var fr=class{_entries=new Map;_maxEntries;_stamp=0;_cappedSize=0;constructor(e){this._maxEntries=e?.maxEntries??512}get size(){return this._entries.size}get(e){return this._entries.get(fo(e))}set(e,t){let r=fo(e),o=ft.has(e.method),a=!this._entries.has(r);if(!o&&a&&this._maxEntries>0&&this._cappedSize>=this._maxEntries){for(let e of this._entries.keys())if(!ft.has(e.slice(0,e.indexOf("\0")))){this._entries.delete(e),this._cappedSize--;break}}let i=++this._stamp;return this._entries.set(r,{...t,stamp:i}),a&&!o&&this._cappedSize++,i}delete(e){this._entries.delete(fo(e))&&!ft.has(e.method)&&this._cappedSize--}evict(e){let t=`${e}\0`,r=ft.has(e);for(let e of this._entries.keys())e.startsWith(t)&&(this._entries.delete(e),!r&&this._cappedSize--)}clear(){this._entries.clear(),this._cappedSize=0}};function fo(e){return`${e.method}\0${JSON.stringify([e.partition??"",e.params??""])}`}function fa(e,t){return void 0===t?e:`${e}\0${t}`}var fi=class{_evictionGeneration=new Map;_toolIndex;_toolOutputValidatorIndex;_serverIdentity="";constructor(e,t,r=()=>{},o="",a=Date.now){this._store=e,this._isUserSupplied=t,this._reportError=r,this._cachePartition=o,this._now=a}now(){return this._now()}setServerIdentity(e){this._serverIdentity=e}_partitionFor(e){return JSON.stringify([this._serverIdentity,"public"===e?"":this._cachePartition])}async _probe(e,t){let r={method:e,params:t??""},o=this._partitionFor("private"),a=await this._store.get({...r,partition:o});if(void 0!==a)return a;let i=this._partitionFor("public");if(i===o)return;let s=await this._store.get({...r,partition:i});return s?.scope==="public"?s:void 0}async evict(e){this._evictionGeneration.set(e,(this._evictionGeneration.get(e)??0)+1),await this._deleteBoth(e,"")}async _deleteBoth(e,t){let r=this._partitionFor("private"),o=this._partitionFor("public");try{await this._store.delete({method:e,params:t,partition:r})}catch(e){this._reportError(e)}if(o!==r)try{await this._store.delete({method:e,params:t,partition:o})}catch(e){this._reportError(e)}}async evictKey(e,t){let r=fa(e,t),o=this._evictionGeneration.get(r);void 0!==o&&this._evictionGeneration.set(r,o+1),await this._deleteBoth(e,t)}captureGeneration(e,t){let r=fa(e,t),o=this._evictionGeneration.get(r)??0;return this._evictionGeneration.set(r,o),o}async write(e,t,r,o){if((this._evictionGeneration.get(fa(e,o?.params))??0)!==r)return;let a=o?.params??"",i=this._partitionFor("private"),s=this._partitionFor("public"),n=(o?.scope??"private")==="public"?s:i;try{await this._store.set({method:e,params:a,partition:n},{value:function(e){let t;try{t=JSON.stringify(e)}catch(e){throw TypeError(`cache value is not JSON-serializable: ${e instanceof Error?e.message:String(e)}`)}if("string"!=typeof t)throw TypeError("cache value is not JSON-serializable: it has no JSON representation");return t}(t),expiresAt:o?.expiresAt,scope:o?.scope})}catch(e){this._reportError(e)}if(s!==i)try{await this._store.delete({method:e,params:a,partition:n===i?s:i})}catch(e){this._reportError(e)}}async read(e,t){let r=await this._probe(e,t);if(r?.expiresAt!==void 0&&r.expiresAt>this.now())try{let e=JSON.parse(r.value);if("object"!=typeof e||null===e||Array.isArray(e))throw TypeError("cached document is not an object");return{value:e}}catch(r){this._reportError(r),await this._deleteBoth(e,t??"");return}}resetForReconnect(){this._isUserSupplied||this._store.clear(),this._evictionGeneration.clear(),this._toolIndex=void 0,this._toolOutputValidatorIndex=void 0,this._serverIdentity=""}async toolDefinition(e){let t=await this._probe("tools/list");if(void 0===t){this._toolIndex=void 0;return}if(this._toolIndex?.stamp!==t.stamp){let e=this._decodeListTools(t),r=new Map;if(void 0!==e)for(let t of e.tools)r.set(t.name,t);this._toolIndex={stamp:t.stamp,byName:r}}return this._toolIndex.byName.get(e)}async outputValidator(e,t){let r=await this._probe("tools/list");if(void 0===r){this._toolOutputValidatorIndex=void 0;return}if(this._toolOutputValidatorIndex?.stamp!==r.stamp){let e=this._decodeListTools(r)??{tools:[]},o=new Map;for(let r of e.tools){let e=t(r);void 0!==e&&o.set(r.name,e)}this._toolOutputValidatorIndex={stamp:r.stamp,byName:o}}return this._toolOutputValidatorIndex.byName.get(e)}_decodeListTools(e){try{let t=JSON.parse(e.value);if(!Array.isArray(t?.tools)||!t.tools.every(e=>null!==e&&"object"==typeof e))throw TypeError("cached tools/list document has a malformed tools array");return t}catch(e){this._reportError(e);return}}};let fs=Symbol.for("mcp.authSeamEscape");function fn(e){if("object"==typeof e&&null!==e||"function"==typeof e)try{Object.defineProperty(e,fs,{value:!0,configurable:!0})}catch{}return e}let fl=new Set([-32001,-32020,-32021]);function fc(e,t){let{code:r,message:o,data:a}=e;if(-32022===r){let e=function(e){if("object"!=typeof e||null===e)return;let t=e.supported;if(Array.isArray(t)&&0!==t.length&&t.every(e=>"string"==typeof e))return t}(a);if(void 0===e)return{kind:"legacy"};let r=new uz({supported:e,requested:function(e){if("object"!=typeof e||null===e)return;let t=e.requested;return"string"==typeof t?t:void 0}(a)??t.requestedVersion},o),i=uc(e),s=t.clientModernVersions.find(e=>i.includes(e));return void 0!==s?{kind:"corrective",version:s,error:r}:i.length>0?{kind:"error",error:r}:t.fallbackAvailable?{kind:"legacy"}:{kind:"error",error:r}}return fl.has(r),{kind:"legacy"}}function fu(e,t){var r,o;return"browser"===t.environment&&((r=e)instanceof TypeError||r instanceof Error&&"TypeError"===r.name)?{kind:"legacy"}:{kind:"error",error:new ua(uo.EraNegotiationFailed,`Version negotiation probe failed: ${(o=e)instanceof Error?o.message:String(o)}`,{cause:e})}}function fd(){let e=globalThis;return void 0!==e.window&&void 0!==e.document?"browser":"node"}function fp(e){return"stderr"in e&&"pid"in e?"stdio":"http"}var fh=class e{_pending;_probeCounter=0;_savedOnMessage;_savedOnError;_savedOnClose;_closeDelivered=!1;constructor(e){this._transport=e,this._savedOnMessage=e.onmessage,this._savedOnError=e.onerror,this._savedOnClose=e.onclose}static async open(t){let r=new e(t);t.onmessage=e=>{let t=r._pending;if(void 0!==t&&(u6(e)||u8(e))&&e.id===t.id){r._pending=void 0,u6(e)?t.resolve({kind:"response",result:e.result}):t.resolve({kind:"response",error:e.error});return}},t.onerror=e=>{r._savedOnError?.(e)},t.onclose=()=>{let e=r._pending;void 0!==e&&(r._pending=void 0,e.resolve({kind:"closed"})),r._closeDelivered=!0,r._savedOnClose?.()};try{await t.start()}catch(e){throw r.detach(),e}return r}async exchange(e,t){let r=`server-discover-probe-${++this._probeCounter}`;return new Promise(o=>{let a=!1,i=e=>{a||(a=!0,clearTimeout(s),this._pending?.id===r&&(this._pending=void 0),o(e))},s=setTimeout(()=>i({kind:"timeout"}),t);this._pending={id:r,resolve:i},this._transport.send(e(r)).catch(e=>i({kind:"send-error",error:e}))})}detach(){if(this._pending=void 0,this._transport.onmessage=this._savedOnMessage,this._transport.onerror=this._savedOnError,this._closeDelivered&&void 0!==this._savedOnClose){let e=this._savedOnClose,t=this._transport,r=!1,o=()=>{if(!r){r=!0;return}e()};t.onclose=o,ff.set(t,()=>{t.onclose===o&&(t.onclose=e)})}else this._transport.onclose=this._savedOnClose}release(){this.detach();let e=this._transport,t=e.start,r=!0;e.start=async function(){if(r){r=!1,e.start=t;return}return t.call(e)}}};let ff=new WeakMap;function fm(e){let t=ff.get(e);ff.delete(e),t?.()}async function fy(e,t){let r,o=e.probe.timeoutMs??t.defaultTimeoutMs,a=Math.max(0,e.probe.maxRetries??0),i="pin"===e.kind?[e.version]:e.modernVersions,s="auto"===e.kind&&e.fallbackAvailable,n=await fh.open(t.transport),l=async()=>{let r=i[0],l=!1,c=a;for(;;){let a=await n.exchange(e=>{var o,a,i;return o=r,a=t.clientInfo,i=t.capabilities,{jsonrpc:"2.0",id:e,method:"server/discover",params:{_meta:u1(o).outboundEnvelope({protocolVersion:o,clientInfo:a,clientCapabilities:i})}}},o);if("timeout"===a.kind&&c>0){c--;continue}let u=function(e,t){switch(e.kind){case"response":return void 0===e.error?{kind:"result",result:e.result}:{kind:"rpc-error",...e.error};case"send-error":{let t=e.error;if(("object"==typeof t&&null!==t||"function"==typeof t)&&!0===t[fs]||t instanceof hD||t instanceof Error&&"UnauthorizedError"===t.name)return{kind:"auth-required",error:t};if(t instanceof ui){let e=t.data?.text;return{kind:"http-error",status:t.data.status,body:"string"==typeof e?e:void 0,statusText:t.data.statusText}}return{kind:"network-error",error:t}}case"closed":return{kind:"closed"};case"timeout":return{kind:"timeout",timeoutMs:t}}}(a,o),d=function(e,t){switch(e.kind){case"result":return function(e,t){let r=u1(u0).validateResult("server/discover",e);if(!r.ok)return{kind:"legacy"};let o=r.value.supportedVersions,a=t.clientModernVersions.find(e=>o.includes(e));return void 0!==a?{kind:"modern",version:a,discover:r.value}:t.fallbackAvailable?{kind:"legacy"}:{kind:"error",error:new uz({supported:[...o],requested:t.requestedVersion})}}(e.result,t);case"rpc-error":return fc(e,t);case"http-error":return function(e,t){if(401===e.status||403===e.status){let t=403===e.status;return{kind:"error",error:new ui(t?uo.ClientHttpForbidden:uo.ClientHttpAuthentication,`Version negotiation failed: ${t?"the server denied access (HTTP 403)":"the server requires authorization (HTTP 401)"}`,{status:e.status,statusText:e.statusText,text:e.body})}}if(e.status>=500)return{kind:"error",error:new ui(uo.EraNegotiationFailed,`Version negotiation failed: the server answered the probe with HTTP ${e.status}`,{status:e.status,statusText:e.statusText,text:e.body})};let r=function(e){let t;if(void 0===e||""===e)return;try{t=JSON.parse(e)}catch{return}if("object"!=typeof t||null===t)return;let r=t.error;if("object"!=typeof r||null===r)return;let{code:o,message:a,data:i}=r;if("number"==typeof o)return{code:o,message:"string"==typeof a?a:"",data:i}}(e.body);return void 0!==r?fc(r,t):{kind:"legacy"}}(e,t);case"network-error":return fu(e.error,t);case"auth-required":return{kind:"error",error:e.error};case"closed":if("stdio"===t.transportKind)return{kind:"legacy"};return fu(Error("Connection closed during the version negotiation probe"),t);case"timeout":if("stdio"===t.transportKind)return{kind:"legacy"};return{kind:"error",error:new ua(uo.RequestTimeout,`Version negotiation probe timed out after ${e.timeoutMs}ms`,{timeout:e.timeoutMs})}}}(u,{clientModernVersions:i,requestedVersion:r,fallbackAvailable:s,environment:t.environment,transportKind:t.transportKind});switch(d.kind){case"modern":return{era:"modern",version:d.version,discover:d.discover};case"corrective":if(l)throw d.error;l=!0,r=d.version;continue;case"legacy":{let r="closed"===u.kind?"the connection closed during the server/discover probe":void 0;if("pin"===e.kind)throw new ua(uo.EraNegotiationFailed,void 0===r?`Version negotiation failed: the server did not offer pinned protocol version ${e.version} via server/discover (no fallback in pin mode)`:`Version negotiation failed: ${r} before the server offered pinned protocol version ${e.version} (no fallback in pin mode)`);if(!e.fallbackAvailable)throw new ua(uo.EraNegotiationFailed,void 0===r?"Version negotiation failed: the server gave no modern evidence and this client supports no pre-2026-07-28 protocol version to fall back to":`Version negotiation failed: ${r} and this client supports no pre-2026-07-28 protocol version to fall back to`);if(void 0!==r&&!0!==t.disposableProbe)throw new ua(uo.EraNegotiationFailed,`Version negotiation failed: ${r} (this transport probed in place — the disposable sibling probe requires the SDK's base StdioClientTransport)`);return{era:"legacy"}}case"error":throw d.error}}};try{r=await l()}catch(e){throw n.detach(),e}return n.release(),r}async function fg(e,t,r,o){let a,i,s=new t.constructor({...r,stderr:"ignore"}),n=t.close,l=!1,c=new Promise((e,t)=>{a=()=>t(fv())});t.close=async function(){return l=!0,a?.(),n.call(t)};try{let t=fy(e,{...o,transport:s,transportKind:"stdio",disposableProbe:!0});t.catch(()=>{}),i=await Promise.race([t,c])}finally{await fb(s),t.close=n}if(l)throw fv();return i}function fv(){return new ua(uo.EraNegotiationFailed,"Version negotiation failed: the transport was closed during the server/discover probe")}async function fb(e){try{let t=e._dispose;await ("function"==typeof t?t.call(e):e.close())}catch{}}function f_(e){let t=e._meta?.[aL];return dP.Implementation(t)?t:void 0}let fS={"notifications/tools/list_changed":["tools/list"],"notifications/prompts/list_changed":["prompts/list"],"notifications/resources/list_changed":["resources/list","resources/templates/list"]};var f$=class extends dC{_serverCapabilities;_serverVersion;_capabilities;_instructions;_jsonSchemaValidator;_cache;_defaultCacheTtlMs;_listMaxPages;_listChangedDebounceTimers=new Map;_listChangedConfig;_enforceStrictCapabilities;_versionNegotiation;_supportedProtocolVersionsOption;_inputRequiredDriverConfig;_listenState=new Map;_nextListenId=0;_autoOpenedSubscription;_discoverResult;_resetConnectionState(){if(this._negotiatedProtocolVersion=void 0,this._serverCapabilities=void 0,this._serverVersion=void 0,this._instructions=void 0,this._discoverResult=void 0,this._autoOpenedSubscription=void 0,this._listenState.size>0){let e=new ua(uo.ConnectionClosed,"subscriptions/listen: client reconnected or closed; subscription state from the previous connection was reset");for(let t of this._listenState.values())t.settle({cause:"remote",error:e})}for(let e of(this._listenState.clear(),this._listChangedDebounceTimers.values()))clearTimeout(e);this._listChangedDebounceTimers.clear(),this._cache.resetForReconnect()}async close(){try{await super.close()}finally{this._resetConnectionState()}}constructor(e,t){super(t),this._clientInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new h_,this._enforceStrictCapabilities=t?.enforceStrictCapabilities??!1,this._versionNegotiation=t?.versionNegotiation,this._supportedProtocolVersionsOption=t?.supportedProtocolVersions,this._inputRequiredDriverConfig=function(e){return{autoFulfill:e?.autoFulfill??!0,maxRounds:e?.maxRounds??10}}(t?.inputRequired),this._cache=new fi(t?.responseCacheStore??new fr,t?.responseCacheStore!==void 0,e=>this._reportStoreError(e),t?.cachePartition??""),this._defaultCacheTtlMs=t?.defaultCacheTtlMs??0,this._listMaxPages=t?.listMaxPages??64,t?.listChanged&&(this._listChangedConfig=t.listChanged)}buildContext(e,t){return e}_shouldDropInbound(e){if(void 0!==this._negotiatedProtocolVersion&&this._negotiatedProtocolVersion>=us&&a5.safeParse(e).success)return"drop"}_outboundMetaEnvelope(){let e=this._negotiatedProtocolVersion;if(void 0!==e)return this._wireCodec().outboundEnvelope({protocolVersion:e,clientInfo:this._clientInfo,clientCapabilities:this._capabilities})}_resolveNonCompleteResult(e,t){return this._inputRequiredDriverConfig.autoFulfill?function(e,t,r,o){let{codec:a,request:i,options:s,flowStartedAt:n}=o,l={inputRequests:r.inputRequests,...void 0!==r.requestState&&{requestState:r.requestState}};return d$({config:t,method:i.method,originalParams:i.params,firstPayload:l,flowStartedAt:n,signal:s?.signal,requestOptions:{...s?.timeout!==void 0&&{timeout:s.timeout},...s?.maxTotalTimeout!==void 0&&{maxTotalTimeout:s.maxTotalTimeout},...s?.onprogress!==void 0&&{onprogress:s.onprogress}},hooks:{dispatchInputRequest:(t,r,o)=>dM(e,a,t,r,o),retry:(e,t)=>o.retry(e,{...s?.signal!==void 0&&{signal:s.signal},...s?.onprogress!==void 0&&{onprogress:s.onprogress},...s?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:s.resetTimeoutOnProgress},...s?.headers!==void 0&&{headers:s.headers},...void 0!==t.timeout&&{timeout:t.timeout},...void 0!==t.maxTotalTimeout&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0})}})}({getRequestHandler:e=>this._getRequestHandler(e),buildContext:e=>this.buildContext(e,void 0),sessionId:this.transport?.sessionId},this._inputRequiredDriverConfig,e,t):Promise.reject(new ua(uo.UnsupportedResultType,`Unsupported result type 'input_required' for ${t.request.method}: multi-round-trip auto-fulfilment is not enabled on this instance — pass allowInputRequired: true to handle it manually, or enable inputRequired.autoFulfill`,{resultType:"input_required",method:t.request.method}))}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools","notifications/tools/list_changed",e.tools,async()=>(await this.listTools(void 0,{cacheMode:"refresh"})).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts","notifications/prompts/list_changed",e.prompts,async()=>(await this.listPrompts(void 0,{cacheMode:"refresh"})).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources","notifications/resources/list_changed",e.resources,async()=>(await this.listResources(void 0,{cacheMode:"refresh"})).resources)}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=function(e,t){let r={...e};for(let e in t){let o=t[e];if(void 0===o)continue;let a=r[e];r[e]=dN(a)&&dN(o)?{...a,...o}:o}return r}(this._capabilities,e)}setVersionNegotiation(e){if(this.transport)throw Error("Cannot configure version negotiation after connecting to transport");this._versionNegotiation=e}_wrapHandler(e,t){return"elicitation/create"===e?async(e,r)=>{let o=u1(this._negotiatedProtocolVersion),a=o.validateRequest("elicitation/create",e);if(a.ok||"not-in-era"!==a.reason||(a=o.validateInputRequest("elicitation/create",e)),!a.ok)throw new uA("not-in-era"===a.reason?uI.InternalError:uI.InvalidParams,"not-in-era"===a.reason?"No wire schema for elicitation/create in the resolved era":`Invalid elicitation request: ${a.message}`);let{params:i}=a.value;i.mode=i.mode??"form";let{supportsFormMode:s,supportsUrlMode:n}=function(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=void 0!==e.form,r=void 0!==e.url;return{supportsFormMode:t||!t&&!r,supportsUrlMode:r}}(this._capabilities.elicitation);if("form"===i.mode&&!s)throw new uA(uI.InvalidParams,"Client does not support form-mode elicitation requests");if("url"===i.mode&&!n)throw new uA(uI.InvalidParams,"Client does not support URL-mode elicitation requests");let l=await t(e,r),c=o.validateResult("elicitation/create",l);if(c.ok||"not-in-era"!==c.reason||(c=o.validateInputResponse("elicitation/create",l)),!c.ok)throw new uA("not-in-era"===c.reason?uI.InternalError:uI.InvalidParams,"not-in-era"===c.reason?"No wire schema for elicitation/create in the resolved era":`Invalid elicitation result: ${c.message}`);let u=c.value,d="form"===i.mode?i.requestedSchema:void 0;if("form"===i.mode&&"accept"===u.action&&u.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{!function e(t,r){if(t&&null!==r&&"object"==typeof r){if("object"===t.type&&t.properties&&"object"==typeof t.properties){let o=t.properties;for(let t of Object.keys(o)){let a=o[t];void 0===r[t]&&Object.prototype.hasOwnProperty.call(a,"default")&&(r[t]=a.default),void 0!==r[t]&&e(a,r[t])}}if(Array.isArray(t.anyOf))for(let o of t.anyOf)"boolean"!=typeof o&&e(o,r);if(Array.isArray(t.oneOf))for(let o of t.oneOf)"boolean"!=typeof o&&e(o,r)}}(d,u.content)}catch{}return u}:"sampling/createMessage"===e?async(e,r)=>{let o=u1(this._negotiatedProtocolVersion),a=o.validateRequest("sampling/createMessage",e);if(a.ok||"not-in-era"!==a.reason||(a=o.validateInputRequest("sampling/createMessage",e)),!a.ok)throw new uA("not-in-era"===a.reason?uI.InternalError:uI.InvalidParams,"not-in-era"===a.reason?"No wire schema for sampling/createMessage in the resolved era":`Invalid sampling request: ${a.message}`);let{params:i}=a.value,s=await t(e,r),n=!!(i.tools||i.toolChoice),l=o.samplingResultVariant(n,s);if(l.ok||"not-in-era"!==l.reason||(l=o.validateInputResponse("sampling/createMessage",s)),!l.ok)throw new uA("not-in-era"===l.reason?uI.InternalError:uI.InvalidParams,"not-in-era"===l.reason?"No result schema for sampling/createMessage in the resolved era":`Invalid sampling result: ${l.message}`);return l.value}:t}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new ua(uo.CapabilityNotSupported,`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(t?.prior!=null)return this._connectFromPrior(e,function(e){if("object"==typeof e&&null!==e&&("legacy"===e.kind&&!("supportedVersions"in e)&&!("discover"in e)||"modern"===e.kind&&iS.safeParse(e.discover).success))return e;throw new ua(uo.EraNegotiationFailed,"connect({ prior }): unrecognized prior — expected { kind: 'modern', discover } or { kind: 'legacy' }")}(t.prior),t);let r=function(e,t){let r=e?.mode??"legacy";if("legacy"===r)return{kind:"legacy"};let o=e?.probe??{};if("object"==typeof r){if(!(r.pin>=us))throw TypeError(`versionNegotiation: { pin: '${r.pin}' } is not a modern protocol revision — pinning is for 2026-07-28 and later; omit versionNegotiation (or use mode: 'legacy') for 2025-era servers.`);return{kind:"pin",version:r.pin,probe:o}}let a=t?uc(t):[];return{kind:"auto",modernVersions:a.length>0?a:[...un],fallbackAvailable:!t||ul(t).length>0,probe:o}}(this._versionNegotiation,this._supportedProtocolVersionsOption);return"legacy"!==r.kind?this._connectNegotiated(e,r,t):this._connectPlainLegacy(e,t)}async _connectPlainLegacy(e,t){if(await super.connect(e),void 0!==e.sessionId){let t=this._negotiatedProtocolVersion;void 0!==t&&e.setProtocolVersion?.(t);return}this._resetConnectionState(),await this._legacyHandshake(e,t)}async _legacyHandshake(e,t){let r=ul(this._supportedProtocolVersions);try{let o=r[0];if(void 0===o)throw new ua(uo.EraNegotiationFailed,"Cannot run the initialize handshake: supportedProtocolVersions contains no pre-2026-07-28 protocol version");let a=await this.request({method:"initialize",params:{protocolVersion:o,capabilities:this._capabilities,clientInfo:this._clientInfo}},t);if(void 0===a)throw Error(`Server sent invalid initialize result: ${a}`);if(!r.includes(a.protocolVersion))throw Error(`Server's protocol version is not supported: ${a.protocolVersion}`);this._serverCapabilities=a.capabilities,this._serverVersion=a.serverInfo,this._cache.setServerIdentity(this._deriveServerIdentity(e)),e.setProtocolVersion&&e.setProtocolVersion(a.protocolVersion),this._instructions=a.instructions,await this.notification({method:"notifications/initialized"}),this._negotiatedProtocolVersion=a.protocolVersion,this._listChangedConfig&&this._setupListChangedHandlers(this._listChangedConfig)}catch(e){throw this.close(),e}}async _connectNegotiated(e,t,r){let o;if(void 0!==e.sessionId){await super.connect(e);let t=this._negotiatedProtocolVersion;void 0!==t&&e.setProtocolVersion&&e.setProtocolVersion(t);return}this._resetConnectionState();try{let a=fp(e),i={clientInfo:this._clientInfo,capabilities:this._capabilities,environment:fd(),defaultTimeoutMs:r?.timeout??6e4},s="stdio"===a?function(e){let t=Object.getPrototypeOf(e);if(null===t||!Object.prototype.hasOwnProperty.call(t,"_dispose"))return;let r=e._serverParams;return"object"==typeof r&&null!==r&&"string"==typeof r.command?r:void 0}(e):void 0;o=void 0===s?await fy(t,{...i,transport:e,transportKind:a}):await fg(t,e,s,i)}catch(t){throw await e.close().catch(()=>{}),fm(e),t}if(fm(e),await super.connect(e),"legacy"===o.era)return void await this._legacyHandshake(e,r);if(this._serverCapabilities=o.discover.capabilities,this._serverVersion=f_(o.discover),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=o.discover.instructions,this._discoverResult=o.discover,this._negotiatedProtocolVersion=o.version,e.setProtocolVersion&&e.setProtocolVersion(o.version),this._listChangedConfig){let e=this._listChangedConfig,t=this._serverCapabilities,o={...e.tools&&t?.tools?.listChanged&&{tools:e.tools},...e.prompts&&t?.prompts?.listChanged&&{prompts:e.prompts},...e.resources&&t?.resources?.listChanged&&{resources:e.resources}},a=!0;try{this._setupListChangedHandlers(o)}catch(e){a=!1,this.onerror?.(e instanceof Error?e:Error(String(e)))}let i=a?{...o.tools&&{toolsListChanged:!0},...o.prompts&&{promptsListChanged:!0},...o.resources&&{resourcesListChanged:!0}}:{};if(Object.keys(i).length>0){let e=new AbortController,t=()=>e.abort(r?.signal?.reason);r?.signal?.aborted&&t(),r?.signal?.addEventListener("abort",t);try{this._autoOpenedSubscription=await this.listen(i,{timeout:r?.timeout,signal:e.signal})}catch(e){if(r?.signal?.aborted)throw await this.close().catch(()=>{}),e;this.onerror?.(e instanceof Error?e:Error(String(e)))}finally{r?.signal?.removeEventListener("abort",t)}}}}async _connectFromPrior(e,t,r){if("legacy"===t.kind)return this._connectPlainLegacy(e,r);let o=t.discover;this._resetConnectionState();let a=this._supportedProtocolVersionsOption,i=(a&&uc(a).length>0?uc(a):un).find(e=>o.supportedVersions.includes(e));if(void 0===i)throw new ua(uo.EraNegotiationFailed,"connect({ prior }) with a modern verdict requires a 2026-07-28+ mutual protocol version; the supplied DiscoverResult and this client's supportedProtocolVersions have no modern overlap. For a server known to be legacy, pass prior: { kind: 'legacy' } to skip the probe and initialize directly, or use versionNegotiation: { mode: 'auto' } to re-probe with legacy fallback.");if(await super.connect(e),this._discoverResult=o,this._serverCapabilities=o.capabilities,this._serverVersion=f_(o),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=o.instructions,this._negotiatedProtocolVersion=i,e.setProtocolVersion?.(i),this._listChangedConfig)try{this._setupListChangedHandlers(this._listChangedConfig)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}_deriveServerIdentity(e){let t=this._serverVersion;return void 0!==t?`${t.name}@${t.version}`:e.sessionId??`anonymous:${Date.now()}-${Math.random().toString(36).slice(2)}`}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}getProtocolEra(){let e=this._negotiatedProtocolVersion;if(void 0!==e)return e>=us?"modern":"legacy"}getInstructions(){return this._instructions}getDiscoverResult(){return this._discoverResult}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new ua(uo.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new ua(uo.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new ua(uo.CapabilityNotSupported,`Server does not support resources (required for ${e})`);if("resources/subscribe"===e&&!this._serverCapabilities.resources.subscribe)throw new ua(uo.CapabilityNotSupported,`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new ua(uo.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new ua(uo.CapabilityNotSupported,`Server does not support completions (required for ${e})`)}}assertNotificationCapability(e){if("notifications/roots/list_changed"===e&&!this._capabilities.roots?.listChanged)throw new ua(uo.CapabilityNotSupported,`Client does not support roots list changed notifications (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new ua(uo.CapabilityNotSupported,`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new ua(uo.CapabilityNotSupported,`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new ua(uo.CapabilityNotSupported,`Client does not support roots capability (required for ${e})`)}}async ping(e){return this.request({method:"ping"},e)}async discover(e){let t=await this._requestWithSchema({method:"server/discover"},iS,e);return this._discoverResult=t,t}async complete(e,t){return this.request({method:"completion/complete",params:e},t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},t)}async listPrompts(e,t){if(!this._serverCapabilities?.prompts&&!this._enforceStrictCapabilities)return console.debug("Client.listPrompts() called but server does not advertise prompts capability - returning empty list"),{prompts:[]};if(e?.cursor!==void 0)return this.request({method:"prompts/list",params:e},t);let r=await this._serveFromCache("prompts/list",void 0,t);return void 0!==r?r:this._listAllPages("prompts/list",e,t,(e,t)=>e.prompts.push(...t.prompts))}async listResources(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug("Client.listResources() called but server does not advertise resources capability - returning empty list"),{resources:[]};if(e?.cursor!==void 0)return this.request({method:"resources/list",params:e},t);let r=await this._serveFromCache("resources/list",void 0,t);return void 0!==r?r:this._listAllPages("resources/list",e,t,(e,t)=>e.resources.push(...t.resources))}async listResourceTemplates(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug("Client.listResourceTemplates() called but server does not advertise resources capability - returning empty list"),{resourceTemplates:[]};if(e?.cursor!==void 0)return this.request({method:"resources/templates/list",params:e},t);let r=await this._serveFromCache("resources/templates/list",void 0,t);return void 0!==r?r:this._listAllPages("resources/templates/list",e,t,(e,t)=>e.resourceTemplates.push(...t.resourceTemplates))}async _listAllPages(e,t,r,o,a){let i=r?.cacheMode==="bypass",s=this._cache.captureGeneration(e),n=await this.request({method:e,...t&&{params:{...t}}},r),l=n.nextCursor,c=new Set,u=1;for(;void 0!==l&&!c.has(l);){if(0!==this._listMaxPages&&u>=this._listMaxPages)throw new ua(uo.ListPaginationExceeded,`${e}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`,{method:e,listMaxPages:this._listMaxPages});c.add(l);let a=await this.request({method:e,params:{...t,cursor:l}},r);o(n,a),l=a.nextCursor,u++}return delete n.nextCursor,a?.(n),i||await this._cache.write(e,n,s,this._freshness(n)),n}_freshness(e,t){let r="number"==typeof e.ttlMs?e.ttlMs:this._defaultCacheTtlMs,o="public"===e.cacheScope?"public":"private";return{expiresAt:this._cache.now()+Math.min(Math.max(0,r),864e5),scope:o,params:t}}async _serveFromCache(e,t,r){if(r?.cacheMode==="bypass"||r?.cacheMode==="refresh")return;let o=await this._cache.read(e,t).catch(e=>void this._reportStoreError(e));if(void 0!==o){if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof ua?e:new ua(uo.RequestTimeout,String(e))}return o.value}}_reportStoreError(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}_compileOutputValidator(e){if(e.outputSchema)try{return{ok:!0,validator:this._jsonSchemaValidator.getValidator(e.outputSchema)}}catch(e){return{ok:!1,compileError:e}}}async _resolveXMcpHeaderScan(e,t){let r=t??await this._cache.toolDefinition(e);return void 0===r?void 0:da(r.inputSchema)}async readResource(e,t){let r=await this._serveFromCache("resources/read",e.uri,t);if(void 0!==r)return r;let o=this._cache.captureGeneration("resources/read",e.uri),a=await this.request({method:"resources/read",params:e},t);if(t?.cacheMode!=="bypass"){let r=this._freshness(a,e.uri);r.expiresAt>this._cache.now()?await this._cache.write("resources/read",a,o,r):t?.cacheMode==="refresh"&&await this._cache.evictKey("resources/read",e.uri)}return a}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},t)}async listen(e,t){let r,o,a,i,s;if(void 0===this.transport)throw new ua(uo.NotConnected,"Not connected");let n=this._negotiatedProtocolVersion;if(void 0===n||!(n>=us))throw new ua(uo.MethodNotSupportedByProtocolVersion,`subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${n??"none"}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`,{method:"subscriptions/listen",protocolVersion:n});if(t?.signal?.aborted){let e=t.signal.reason;throw e instanceof ua?e:new ua(uo.RequestTimeout,String(e))}let l=new AbortController,c=`listen:${this._nextListenId++}`,u="opening",d=new Promise((e,t)=>{a=e,i=t}),p=new Promise(e=>{s=e}),h=e=>{if("closed"===u)return;let n="opening"===u;if(void 0!==r&&(clearTimeout(r),r=void 0),"ack"in e){u="open",a(e.ack);return}u="closed",void 0!==o&&t?.signal?.removeEventListener("abort",o),this._listenState.delete(c),l.abort(),s(e.cause),n&&i(e.error??new ua(uo.ConnectionClosed,"subscriptions/listen closed before the server acknowledged"))},f=async()=>{l.abort(),await this.notification({method:"notifications/cancelled",params:{requestId:c}}).catch(()=>{})},m=async()=>{"closed"!==u&&(h({cause:"local"}),await f())};this._listenState.set(c,{settle:h});let y=t?.timeout??6e4;if(r=setTimeout(()=>{h({cause:"remote",error:new ua(uo.RequestTimeout,"subscriptions/listen ack timed out",{timeout:y})}),f().catch(()=>{})},y),t?.signal){let e=t.signal;o=()=>{if("closed"===u)return;let t=e.reason;h({cause:"local",error:t instanceof Error?t:Error(String(t??"Aborted"))}),f().catch(()=>{})},e.addEventListener("abort",o,{once:!0})}let g={jsonrpc:"2.0",id:c,method:"subscriptions/listen",params:{_meta:{...this._outboundMetaEnvelope()},notifications:e}};try{await this.transport.send(g,{requestSignal:l.signal,onRequestStreamEnd:()=>h({cause:"remote",error:Error("subscriptions/listen: stream ended")})})}catch(e){h({cause:"remote",error:e instanceof Error?e:Error(String(e))})}return{honoredFilter:await d,close:m,closed:p}}get autoOpenedSubscription(){return this._autoOpenedSubscription}_onnotification(e,t){let r=Object.hasOwn(fS,e.method)?fS[e.method]:void 0;if("notifications/resources/updated"===e.method){let t=e.params?.uri;"string"==typeof t&&this._cache.evictKey("resources/read",t)}else if(void 0!==r)for(let e of r)this._cache.evict(e);if("notifications/subscriptions/acknowledged"===e.method){let t=e.params?._meta?.[aU],r="string"==typeof t?this._listenState.get(t):void 0;if(void 0!==r){let t=this._wireCodec().validateNotification("notifications/subscriptions/acknowledged",e);r.settle({ack:t.ok?t.value.params.notifications:{}});return}}if("notifications/cancelled"===e.method){let t=e.params?.requestId,r="string"==typeof t?this._listenState.get(t):void 0;if(void 0!==r)return void r.settle({cause:"remote",error:Error("subscriptions/listen: server cancelled the subscription")})}super._onnotification(e,t)}_onresponse(e){let t=e.id,r="string"==typeof t?this._listenState.get(t):void 0;void 0!==r?u8(e)?r.settle({cause:"remote",error:uA.fromError(e.error.code,e.error.message,e.error.data)}):r.settle({cause:"graceful",error:new ua(uo.ConnectionClosed,"subscriptions/listen: server closed the subscription gracefully before acknowledging")}):super._onresponse(e)}_onclose(){if(this._listenState.size>0){let e=new ua(uo.ConnectionClosed,"Connection closed");for(let t of this._listenState.values())t.settle({cause:"remote",error:e});this._listenState.clear()}super._onclose()}async callTool(e,t){let r,o="modern"===this.getProtocolEra()&&"browser"!==fd(),a=async()=>{let r;if(!o)return t;try{r=await this._resolveXMcpHeaderScan(e.name,t?.toolDefinition)}catch(e){this._reportStoreError(e)}if(!r?.valid||0===r.declarations.length)return t;let a=function(e,t){let r={};for(let o of e){let e=function(e,t){let r=e;for(let e of t){if(null===r||"object"!=typeof r)return;r=r[e]}return r}(t,o.path);if(null==e)continue;let a=function(e){if("string"==typeof e)return e;if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e){if(!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e))return;return String(e)}}(e);void 0!==a&&(r[`Mcp-Param-${o.headerName}`]=dc(a))}return r}(r.declarations,e.arguments);return 0===Object.keys(a).length?t:{...t,headers:{...t?.headers,...a}}},i=t?.toolDefinition===void 0?await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)):this._compileOutputValidator(t.toolDefinition),s=()=>{if(void 0===i||i.ok)return;let t=i.compileError,r=(t instanceof Error?t.message:String(t)).slice(0,200);throw new uA(uI.InvalidParams,`Tool '${e.name}' has an invalid outputSchema: ${r}`)};s();try{r=await this.request({method:"tools/call",params:e},await a())}catch(c){let n=c instanceof uA&&-32020===c.code;if(!o||!n||t?.toolDefinition!==void 0)throw c;let l={signal:t?.signal,timeout:t?.timeout,cacheMode:"refresh"};await this._cache.evict("tools/list"),await this.listTools(void 0,l).catch(e=>this._reportStoreError(e)),i=await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)),s(),r=await this.request({method:"tools/call",params:e},await a())}let n=void 0!==i&&i.ok?i.validator:void 0;if(n){if(void 0===r.structuredContent&&!r.isError)throw new uA(uI.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(void 0!==r.structuredContent&&!r.isError)try{let e=n(r.structuredContent);if(!e.valid)throw new uA(uI.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)}catch(e){if(e instanceof uA)throw e;throw new uA(uI.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)}}return r}async listTools(e,t){if(!this._serverCapabilities?.tools&&!this._enforceStrictCapabilities)return console.debug("Client.listTools() called but server does not advertise tools capability - returning empty list"),{tools:[]};if(e?.cursor!==void 0){let r=await this.request({method:"tools/list",params:e},t);return this._excludeInvalidXMcpHeaderTools(r),r}let r=await this._serveFromCache("tools/list",void 0,t);return void 0!==r?r:this._listAllPages("tools/list",e,t,(e,t)=>e.tools.push(...t.tools),e=>this._excludeInvalidXMcpHeaderTools(e))}_excludeInvalidXMcpHeaderTools(e){if("modern"!==this.getProtocolEra()||!this.transport||"stdio"===fp(this.transport))return;let t=e.tools.filter(e=>{let t=da(e.inputSchema);return!!t.valid||(console.warn(`[mcp-sdk] excluding tool '${e.name}' from tools/list: invalid x-mcp-header declaration — ${t.reason}`),!1)});t.length!==e.tools.length&&(e.tools=t)}_setupListChangedHandler(e,t,r,o){let a=om(sv,r);if(!a.success)throw Error(`Invalid ${e} listChanged options: ${a.error.message}`);if("function"!=typeof r.onChanged)throw TypeError(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:i,debounceMs:s}=a.data,{onChanged:n}=r,l=async()=>{if(!i)return void n(null,null);try{n(null,await o())}catch(e){n(e instanceof Error?e:Error(String(e)),null)}},c=()=>{if(s){let t=this._listChangedDebounceTimers.get(e);t&&clearTimeout(t);let r=setTimeout(l,s);this._listChangedDebounceTimers.set(e,r)}else l()};this.setNotificationHandler(t,c)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};(class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](e){return ue(this,e)}static isInstance(e){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return ue(this,e)}constructor(e,t,r){super(`SSE error: ${t}`),this.code=e,this.event=r,c7(this,new.target)}});let fw={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},fE=new Set(["authorization","content-type","mcp-protocol-version","mcp-method","mcp-name","mcp-session-id"]);function fR(e,t){if("function"==typeof AbortSignal.any)return AbortSignal.any([e,t]);let r=new AbortController;if(e.aborted)return r.abort(e.reason),r.signal;if(t.aborted)return r.abort(t.reason),r.signal;let o=()=>{e.removeEventListener("abort",a),t.removeEventListener("abort",i)};function a(){o(),r.abort(e.reason)}function i(){o(),r.abort(t.reason)}return e.addEventListener("abort",a,{once:!0}),t.addEventListener("abort",i,{once:!0}),r.signal}var fP=class{_abortController;_url;_resourceMetadataUrl;_scope;_requestInit;_authProvider;_oauthProvider;_skipIssuerMetadataValidation;_fetch;_fetchWithInit;_sessionId;_reconnectionOptions;_protocolVersion;_onInsufficientScope;_maxStepUpRetries;_serverRetryMs;_reconnectionScheduler;_cancelReconnection;onclose;onerror;onmessage;hasPerRequestStream=!0;constructor(e,t){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._skipIssuerMetadataValidation=t?.skipIssuerMetadataValidation,function(e){return null!=e&&"function"==typeof e.tokens&&"function"==typeof e.clientInformation}(t?.authProvider)?(this._oauthProvider=t.authProvider,this._authProvider=function(e,t){return{token:async()=>(await e.tokens())?.access_token,onUnauthorized:async r=>hL(e,r,t)}}(t.authProvider,{skipIssuerMetadataValidation:t.skipIssuerMetadataValidation})):this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=function(e=fetch,t){return t?async(r,o)=>e(r,{...t,...o,headers:o?.headers?{...dL(t.headers),...dL(o.headers)}:t.headers}):e}(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._protocolVersion=t?.protocolVersion,this._reconnectionOptions=t?.reconnectionOptions??fw,this._reconnectionScheduler=t?.reconnectionScheduler,this._onInsufficientScope=t?.onInsufficientScope??"reauthorize",this._maxStepUpRetries=Math.max(0,t?.maxStepUpRetries??1)}async _stepUpAuthorize(e,t){try{return await this._stepUpAuthorizeInner(e,t)}catch(e){throw fn(e)}}async _stepUpAuthorizeInner(e,t){if("throw"===this._onInsufficientScope||!this._oauthProvider)throw new hM({requiredScope:e.scope,resourceMetadataUrl:e.resourceMetadataUrl,errorDescription:e.errorDescription});if(t>=this._maxStepUpRetries)throw new ui(uo.ClientHttpForbidden,`Server returned 403 insufficient_scope after step-up re-authorization (retry limit ${this._maxStepUpRetries} reached)`,{status:403,statusText:e.statusText??"Forbidden",text:e.text});e.resourceMetadataUrl&&(this._resourceMetadataUrl=e.resourceMetadataUrl);let r=await this._oauthProvider.tokens(),o=hF(this._scope,r?.scope,e.scope);this._scope=o;let a=function(e,t){if(!e)return!1;let r=new Set((t??"").split(/\s+/).filter(Boolean));for(let t of e.split(/\s+/))if(t&&!r.has(t))return!0;return!1}(o,r?.scope);return hZ(this._oauthProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:o,forceReauthorization:a,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})}async _commonHeaders(){let e,t={};try{e=await this._authProvider?.token()}catch(e){throw fn(e)}e&&(t.Authorization=`Bearer ${e}`),this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);let r=dL(this._requestInit?.headers);return new Headers({...t,...r})}_applyBodyDerivedHeaders(e,t){if(Array.isArray(t)||!a5.safeParse(t).success)return;let r=t.params?._meta?.[aq];if("string"!=typeof r)return;e.set("mcp-protocol-version",r),e.set("mcp-method",t.method);let o=t.params,a="resources/read"===t.method?"string"==typeof o?.uri?o.uri:void 0:"string"==typeof o?.name?o.name:void 0;void 0!==a&&e.set("mcp-name",dc(a))}_isModernEnvelopedRequest(e){if(Array.isArray(e)||!a5.safeParse(e).success)return!1;let t=e.params?._meta?.[aq];return"string"==typeof t&&t>=us}async _startOrAuthSse(e,t=!1,r=0){let{resumptionToken:o,requestSignal:a}=e,i=()=>this._abortController?.signal.aborted===!0||a?.aborted===!0;try{let i=await this._commonHeaders(),s=[...i.get("accept")?.split(",").map(e=>e.trim().toLowerCase())??[],"text/event-stream"];i.set("accept",[...new Set(s)].join(", ")),o&&i.set("last-event-id",o);let n=this._abortController?.signal,l=void 0!==a&&void 0!==n?fR(n,a):a??n,c=await (this._fetch??fetch)(this._url,{...this._requestInit,method:"GET",headers:i,signal:l});if(!c.ok){if(401===c.status&&this._authProvider){if(c.headers.has("www-authenticate")){let{resourceMetadataUrl:e,scope:t}=hY(c);this._resourceMetadataUrl=e,this._scope=hF(this._scope,t)}if(this._authProvider.onUnauthorized&&!t){try{await this._authProvider.onUnauthorized({response:c,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw fn(e)}return await c.text?.().catch(()=>{}),this._startOrAuthSse(e,!0,r)}if(await c.text?.().catch(()=>{}),t)throw fn(new ui(uo.ClientHttpAuthentication,"Server returned 401 after re-authentication",{status:401,statusText:c.statusText}));throw fn(new hD)}if(403===c.status){let{resourceMetadataUrl:o,scope:a,error:i,errorDescription:s}=hY(c);if("insufficient_scope"===i){let i=await c.text?.().catch(()=>null);if(await this._stepUpAuthorize({scope:a,resourceMetadataUrl:o,errorDescription:s,statusText:c.statusText,text:i},r)!=="AUTHORIZED")throw fn(new hD);return this._startOrAuthSse(e,t,r+1)}}if(await c.text?.().catch(()=>{}),405===c.status)return void e.onRequestStreamEnd?.();throw new ui(uo.ClientHttpFailedToOpenStream,`Failed to open SSE stream: ${c.statusText}`,{status:c.status,statusText:c.statusText})}this._handleSseStream(c.body,e,!0)}catch(e){throw i()||this.onerror?.(e),e}}_getNextReconnectionDelay(e){return void 0!==this._serverRetryMs?this._serverRetryMs:Math.min(this._reconnectionOptions.initialReconnectionDelay*Math.pow(this._reconnectionOptions.reconnectionDelayGrowFactor,e),this._reconnectionOptions.maxReconnectionDelay)}_scheduleReconnection(e,t=0){let r=this._reconnectionOptions.maxRetries;if(t>=r){this.onerror?.(Error(`Maximum reconnection attempts (${r}) exceeded.`)),e.onRequestStreamEnd?.();return}let o=this._getNextReconnectionDelay(t),a=()=>{this._cancelReconnection=void 0,this._abortController?.signal.aborted||e.requestSignal?.aborted||this._startOrAuthSse(e).catch(r=>{if(!(this._abortController?.signal.aborted||e.requestSignal?.aborted)){this.onerror?.(Error(`Failed to reconnect SSE stream: ${r instanceof Error?r.message:String(r)}`));try{this._scheduleReconnection(e,t+1)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}})};if(this._reconnectionScheduler){let e=this._reconnectionScheduler(a,o,t);this._cancelReconnection="function"==typeof e?e:void 0}else{let e=setTimeout(a,o);this._cancelReconnection=()=>clearTimeout(e)}}_handleSseStream(e,t,r){let o;if(!e)return void t.onRequestStreamEnd?.();let{onresumptiontoken:a,replayMessageId:i,requestSignal:s,onRequestStreamEnd:n}=t,l=()=>this._abortController?.signal.aborted===!0||s?.aborted===!0,c=!1,u=!1;(async()=>{try{let t=e.pipeThrough(new TextDecoderStream).pipeThrough(new hx({onRetry:e=>{this._serverRetryMs=e}})).getReader();for(;;){let{value:e,done:r}=await t.read();if(r)break;if((e.id&&(o=e.id,c=!0,a?.(e.id)),e.data)&&(!e.event||"message"===e.event))try{let t=a7.parse(JSON.parse(e.data));(u6(t)||u8(t))&&(u=!0,void 0!==i&&(t.id=i)),this.onmessage?.(t)}catch(e){this.onerror?.(e)}}(r||c)&&!u&&this._abortController&&!l()?this._scheduleReconnection({resumptionToken:o,onresumptiontoken:a,replayMessageId:i,requestSignal:s,onRequestStreamEnd:n},0):l()||n?.()}catch(e){if(l())return;if(this.onerror?.(Error(`SSE stream disconnected: ${e}`)),(r||c)&&!u&&this._abortController&&!l())try{this._scheduleReconnection({resumptionToken:o,onresumptiontoken:a,replayMessageId:i,requestSignal:s,onRequestStreamEnd:n},0)}catch(e){this.onerror?.(Error(`Failed to reconnect: ${e instanceof Error?e.message:String(e)}`)),n?.()}else n?.()}})()}async start(){if(this._abortController)throw Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e,t){if(!this._oauthProvider)throw new hD("finishAuth requires an OAuthClientProvider");let{authorizationCode:r,iss:o}=await hH(e,t,this._oauthProvider,this._url,{fetchFn:this._fetchWithInit,resourceMetadataUrl:this._resourceMetadataUrl});if(await hZ(this._oauthProvider,{serverUrl:this._url,authorizationCode:r,iss:o,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})!=="AUTHORIZED")throw new hD("Failed to authorize")}async close(){try{this._cancelReconnection?.()}finally{this._cancelReconnection=void 0,this._abortController?.abort(),this.onclose?.()}}async send(e,t){return this._send(e,t,!1)}async _send(e,t,r,o=0){try{let{resumptionToken:a,onresumptiontoken:i}=t||{};if(a)return void this._startOrAuthSse({resumptionToken:a,replayMessageId:a5.safeParse(e).success?e.id:void 0,requestSignal:t?.requestSignal}).catch(e=>this.onerror?.(e));let s=await this._commonHeaders();this._applyBodyDerivedHeaders(s,e);let n=Array.isArray(e)?e.some(e=>iy.safeParse(e).success):iy.safeParse(e).success;if(n&&s.delete("mcp-session-id"),t?.headers!==void 0)for(let[e,r]of Object.entries(t.headers))fE.has(e.toLowerCase())||s.set(e,r);s.set("content-type","application/json");let l=[...s.get("accept")?.split(",").map(e=>e.trim().toLowerCase())??[],"application/json","text/event-stream"];s.set("accept",[...new Set(l)].join(", "));let c=this._abortController?.signal,u=t?.requestSignal!==void 0&&void 0!==c?fR(c,t.requestSignal):t?.requestSignal??c,d={...this._requestInit,method:"POST",headers:s,body:JSON.stringify(e),signal:u},p=await (this._fetch??fetch)(this._url,d);if(n&&p.ok&&(this._sessionId=p.headers.get("mcp-session-id")||void 0),!p.ok){if(401===p.status&&this._authProvider){if(p.headers.has("www-authenticate")){let{resourceMetadataUrl:e,scope:t}=hY(p);this._resourceMetadataUrl=e,this._scope=hF(this._scope,t)}if(this._authProvider.onUnauthorized&&!r){try{await this._authProvider.onUnauthorized({response:p,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw fn(e)}return await p.text?.().catch(()=>{}),this._send(e,t,!0,o)}if(await p.text?.().catch(()=>{}),r)throw fn(new ui(uo.ClientHttpAuthentication,"Server returned 401 after re-authentication",{status:401,statusText:p.statusText}));throw fn(new hD)}let a=await p.text?.().catch(()=>null);if(403===p.status){let{resourceMetadataUrl:i,scope:s,error:n,errorDescription:l}=hY(p);if("insufficient_scope"===n){if(await this._stepUpAuthorize({scope:s,resourceMetadataUrl:i,errorDescription:l,statusText:p.statusText,text:a},o)!=="AUTHORIZED")throw fn(new hD);return this._send(e,t,r,o+1)}}if(400===p.status&&"string"==typeof a&&this._isModernEnvelopedRequest(e))try{let t=a7.parse(JSON.parse(a)),r=(Array.isArray(e)?e:[e]).filter(e=>a5.safeParse(e).success);if(u8(t)&&r.some(e=>e.id===t.id))return void this.onmessage?.(t)}catch{}throw new ui(uo.ClientHttpNotImplemented,`Error POSTing to endpoint: ${a}`,{status:p.status,statusText:p.statusText,text:a})}if(202===p.status){await p.text?.().catch(()=>{}),ib.safeParse(e).success&&this._startOrAuthSse({resumptionToken:void 0}).catch(e=>this.onerror?.(e));return}let h=(Array.isArray(e)?e:[e]).some(e=>"method"in e&&"id"in e&&void 0!==e.id),f=p.headers.get("content-type"),m=function(e){if(e)try{return dq.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();if(""===t||e.slice(t.length).includes(","))return;return t}}(f);if(h)if("text/event-stream"===m)this._handleSseStream(p.body,{onresumptiontoken:i,requestSignal:t?.requestSignal,onRequestStreamEnd:t?.onRequestStreamEnd},!1);else if("application/json"===m){let e=await p.json();for(let t of Array.isArray(e)?e.map(e=>a7.parse(e)):[a7.parse(e)])this.onmessage?.(t)}else throw await p.text?.().catch(()=>{}),new ua(uo.ClientHttpUnexpectedContent,`Unexpected content type: ${f}`,{contentType:f});else await p.text?.().catch(()=>{})}catch(e){throw t?.requestSignal?.aborted!==!0&&this.onerror?.(e),e}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),t={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},r=await (this._fetch??fetch)(this._url,t);if(await r.text?.().catch(()=>{}),!r.ok&&405!==r.status)throw new ui(uo.ClientHttpFailedToTerminateSession,`Failed to terminate session: ${r.statusText}`,{status:r.status,statusText:r.statusText});this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}};let fk=require("node:stream");var fT=i(6507);let fO="win32"===cH.platform?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];var fx=class{_process;_readBuffer;_serverParams;_stderrStream=null;onclose;onerror;onmessage;constructor(e){this._serverParams=e,this._readBuffer=new dz({maxBufferSize:e.maxBufferSize}),("pipe"===e.stderr||"overlapped"===e.stderr)&&(this._stderrStream=new fk.PassThrough)}async start(){if(this._process)throw Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,t)=>{this._process=fT(this._serverParams.command,this._serverParams.args??[],{env:{...function(){let e={};for(let t of fO){let r=cH.env[t];void 0!==r&&(r.startsWith("()")||(e[t]=r))}return e}(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:"win32"===cH.platform,cwd:this._serverParams.cwd}),this._process.on("error",e=>{t(e),this.onerror?.(e)}),this._process.on("spawn",()=>{e()}),this._process.on("close",e=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",e=>{this.onerror?.(e)}),this._process.stdout?.on("data",e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(e){this.onerror?.(e),this.close().catch(()=>{})}}),this._process.stdout?.on("error",e=>{this.onerror?.(e)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(null===e)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async _dispose(){let e=this._process;if(this._process=void 0,e&&null===e.exitCode&&null===e.signalCode){let t=new Promise(t=>e.once("exit",()=>t()));try{e.stdin?.end()}catch{}try{e.kill("SIGTERM")}catch{}if(await Promise.race([t,new Promise(e=>setTimeout(e,1e3).unref())]),null===e.exitCode&&null===e.signalCode)try{e.kill("SIGKILL")}catch{}await t}try{e?.stdout?.destroy()}catch{}try{e?.stdin?.destroy()}catch{}try{e?.stderr?.destroy()}catch{}this._readBuffer.clear()}async close(){if(this._process){let e=this._process;this._process=void 0;let t=new Promise(t=>{e.once("close",()=>{t()})});try{e.stdin?.end()}catch{}if(await Promise.race([t,new Promise(e=>setTimeout(e,2e3).unref())]),null===e.exitCode){try{e.kill("SIGTERM")}catch{}await Promise.race([t,new Promise(e=>setTimeout(e,2e3).unref())])}if(null===e.exitCode)try{e.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(e){return new Promise(t=>{if(!this._process?.stdin)throw new ua(uo.NotConnected,"Not connected");let r=JSON.stringify(e)+"\n";this._process.stdin.write(r)?t():this._process.stdin.once("drain",t)})}};let fj=e=>"env"in e&&"string"==typeof e.env,fC=e=>{let t={};return e.forEach(e=>{let r=e.name.trim();if(fj(e)){let o=process.env[e.env];if(void 0===o)throw Error(`Environment variable "${e.env}" is not set (required for header "${r}")`);t[r]=o}else t[r]=e.value.trim()}),t},fN=i(8330),fI={name:fN.name,version:fN.version},fA={capabilities:{sampling:{},elicitation:{form:{},url:{}},roots:{listChanged:!0}},versionNegotiation:{mode:"auto"}};async function fM({url:e,headers:t}){let r=new f$(fI,fA),o=t?fC(t):{},a=new fP(new URL(e),{...t?{requestInit:{headers:o}}:{},reconnectionOptions:{maxReconnectionDelay:3e4,initialReconnectionDelay:1e3,reconnectionDelayGrowFactor:1.5,maxRetries:2}});return await r.connect(a),r}async function fq(e){let{onStderrData:t,...r}=e,o=new f$(fI,fA),a=new fx({...r,stderr:r.stderr??"pipe"}),i=a.stderr;if(i){let e=t??(e=>{console.error(`[STDIO MCP Server stderr]: ${e}`)});i.on("data",e)}return await o.connect(a),{client:o,transport:a}}async function fz(e){try{return(await e.client.listTools()).tools.map(e=>e.name)}catch(e){return console.error("Failed to list stdio MCP tools:",e),[]}}async function fL(e,t,r){try{return await e.client.callTool({name:t,arguments:r})}catch(e){throw console.error(`Failed to call stdio MCP tool "${t}":`,e),e}}async function fD(e){try{await e.transport.close(),await e.client.close()}catch(e){throw console.error("Error disconnecting from stdio MCP server:",e),e}}function fU(e){if(e?.body===void 0||null===e.body)return[];let t=Array.isArray(e.body)?e.body:[e.body],r=[];for(let e of t)if("object"==typeof e&&null!==e&&"method"in e&&"tools/call"===e.method){let t=e.params;t&&"object"==typeof t&&"name"in t&&"string"==typeof t.name&&r.push(t.name)}return r}let fV="2026-01-26",fF="ui/initialize",fH="ui/notifications/initialized",fK="ui/request-display-mode",fJ="ui/open-link",fB="ui/update-model-context",fG="ui/message",fZ="notifications/message",fW="resources/read",fX="ui/notifications/host-context-changed",fY="ui/notifications/size-changed";function fQ(e){return!!e&&"object"==typeof e}function f0(e,t){return e instanceof Error&&e.message?e.message:t}function f1(e={}){let t=e.targetWindow??("undefined"==typeof window?null:window),r=e.requestTimeoutMs??15e3,o=e.connectionTimeoutMs??2e3,a=100,i=!1,s=!1,n={isConnected:!!t&&t.parent!==t,hostContext:null,hostCapabilities:null},l=new Set,c=new Map,u=e=>{if(e.isConnected!==n.isConnected||e.hostContext!==n.hostContext||e.hostCapabilities!==n.hostCapabilities)for(let t of(n=e,l))t(n)},d=e=>{var t,r;let o;u({isConnected:!0,hostContext:e.hostContext?(t=n.hostContext,r=e.hostContext,o={...t??{},...r},(t?.safeAreaInsets||r.safeAreaInsets)&&(o.safeAreaInsets={...t?.safeAreaInsets??{},...r.safeAreaInsets??{}}),(t?.containerDimensions||r.containerDimensions)&&(o.containerDimensions={...t?.containerDimensions??{},...r.containerDimensions??{}}),(t?.styles||r.styles)&&(o.styles={...t?.styles??{},...r.styles??{},variables:t?.styles?.variables||r.styles?.variables?{...t?.styles?.variables??{},...r.styles?.variables??{}}:void 0,css:t?.styles?.css||r.styles?.css?{...t?.styles?.css??{},...r.styles?.css??{}}:void 0}),o):n.hostContext,hostCapabilities:e.hostCapabilities?{...n.hostCapabilities??{},...e.hostCapabilities}:n.hostCapabilities})},p=e=>{if(!t||e.source!==t.parent||!fQ(e.data))return;s=!0,n.isConnected||u({...n,isConnected:!0});let r=e.data;if("id"in r&&null!=r.id&&"number"==typeof r.id){let e=c.get(r.id);e&&(clearTimeout(e.timeoutId),c.delete(r.id),fQ(r.error)?e.reject(Error("string"==typeof r.error.message?r.error.message:"MCP request failed")):e.resolve(r.result))}1===r.id&&fQ(r.result)&&d({hostContext:fQ(r.result.hostContext)?r.result.hostContext:void 0,hostCapabilities:fQ(r.result.hostCapabilities)?r.result.hostCapabilities:void 0}),r.method===fX&&fQ(r.params)&&d({hostContext:r.params}),"ui/hostContextChanged"===r.method&&fQ(r.params)&&fQ(r.params.hostContext)&&d({hostContext:r.params.hostContext})};t&&(t.addEventListener("message",p),t.parent!==t&&setTimeout(()=>{i||s||n.hostContext||u({...n,isConnected:!1})},o));let h=()=>{if(i)throw Error("MCP host bridge has been disposed");if(!t)throw Error("MCP host bridge requires a browser window");return t},f=(e,t)=>{h().parent.postMessage({jsonrpc:"2.0",method:e,params:t},"*")},m=(e,t={})=>{let o=h();return new Promise((i,s)=>{let n=a++,l=setTimeout(()=>{c.has(n)&&(c.delete(n),s(Error(`MCP request timed out: ${e}`)))},r);c.set(n,{resolve:i,reject:s,timeoutId:l}),o.parent.postMessage({jsonrpc:"2.0",id:n,method:e,params:t},"*")})},y=async(e,t)=>{let r;for(let o of e)try{return await m(o,t)}catch(t){r=t;let e=f0(t,"MCP request failed");if(!/method not found|unknown method/i.test(e))throw t}throw r instanceof Error?r:Error("MCP request failed")},g=async e=>{if(t?.open)return void t.open(e,"_blank","noopener,noreferrer");throw Error("Unable to open link without a browser window")};return{callTool:(e,t)=>m("tools/call",{name:e,arguments:t??{}}),requestDisplayMode:e=>y([fK,"ui/requestDisplayMode"],{mode:e}),async openLink(e){try{await y([fJ,"ui/openLink"],{url:e})}catch(r){if(!n.isConnected||!t)return void await g(e);throw Error(f0(r,"Failed to open link"))}},readResource:e=>m(fW,{uri:e}),sendMessage:e=>m(fG,e),updateModelContext:e=>m(fB,e),async logMessage(e){f(fZ,e)},async notifySizeChanged(e){f(fY,e)},getState:()=>n,getHostContext:()=>n.hostContext,getHostCapabilities:()=>n.hostCapabilities,isConnected:()=>n.isConnected,subscribe:e=>(l.add(e),()=>{l.delete(e)}),dispose(){if(!i){for(let[e,r]of(i=!0,t&&t.removeEventListener("message",p),c.entries()))clearTimeout(r.timeoutId),r.reject(Error("MCP host bridge has been disposed")),c.delete(e);l.clear()}}}}$().config()})(),s})());
|
|
55
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of t.seen.entries()){let a=o[1];if(r===o[0]){i(o);continue}if(t.external){let a=t.external.registry.get(o[0])?.id;if(r!==o[0]&&a){i(o);continue}}if(t.metadataRegistry.get(o[0])?.id||a.cycle){i(o);continue}a.count>1&&"ref"===t.reused&&i(o)}t.external&&(t.sharedDefsExtractedFor=t.external)}let o_=new Set(["type","properties","required","additionalProperties"]),oS=["oneOf","anyOf"];function o$(t){let r=t.additionalProperties;return void 0===r||!1===r||"object"!=typeof r||null===r?null:Object.keys(r).length?r:null}function ow(t){let r=[];for(let o of t){if("object"!=typeof o||"object"!==o.type)return null;for(let t in o)if(!o_.has(t))return null;r.push(o)}let o={},a=new Set;for(let t of r){for(let a in t.properties){if(Object.prototype.hasOwnProperty.call(o,a))continue;let t=[];for(let o of r){let r=o.properties?.[a]??o$(o);null!=r&&(t.some(t=>JSON.stringify(t)===JSON.stringify(r))||t.push(r))}ep(o,a,1===t.length?t[0]:ow(t)??{allOf:t})}for(let r of t.required??[])a.add(r)}let i={type:"object",properties:o};if(a.size&&(i.required=[...a]),r.every(t=>!1===t.additionalProperties))i.additionalProperties=!1;else{let t=[];for(let o of r){let r=o$(o);r&&!t.some(t=>JSON.stringify(t)===JSON.stringify(r))&&t.push(r)}1===t.length?i.additionalProperties=t[0]:t.length>1&&(i.additionalProperties={allOf:t})}return i}function oE(t,r){let o=t.seen.get(r);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let a=r=>{let o=t.seen.get(r);if(null===o.ref)return;let i=o.def??o.schema,s={...i},n=o.ref;if(o.ref=null,n){a(n);let o=t.seen.get(n),l=o.schema;if(l.$ref&&("draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target)?(i.allOf=i.allOf??[],i.allOf.push(l)):of(i,l),of(i,s),r._zod.parent===n)for(let t in i)"$ref"!==t&&"allOf"!==t&&(t in s||delete i[t]);if(l.$ref&&o.def)for(let t in i)"$ref"!==t&&"allOf"!==t&&t in o.def&&JSON.stringify(i[t])===JSON.stringify(o.def[t])&&delete i[t]}let l=r._zod.parent;if(l&&l!==n){a(l);let r=t.seen.get(l);if(r?.schema.$ref&&(i.$ref=r.schema.$ref,r.def))for(let t in i)"$ref"!==t&&"allOf"!==t&&t in r.def&&JSON.stringify(i[t])===JSON.stringify(r.def[t])&&delete i[t]}t.override({zodSchema:r,jsonSchema:i,path:o.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(let r of[...t.seen.entries()].reverse())a(r[0]);if("openapi-3.0"!==t.target)for(let r of t.seen.entries())!function t(r){let o=r.anyOf;if(!Array.isArray(o)||0===o.length||void 0!==r.type)return;let a=[];for(let r of o){if(!r||"object"!=typeof r)return;t(r);let o=Object.keys(r);if(1!==o.length||"type"!==o[0])return;let i=r.type;for(let t of Array.isArray(i)?i:[i]){if("string"!=typeof t)return;a.includes(t)||a.push(t)}}delete r.anyOf,r.type=1===a.length?a[0]:a}(r[1].def??r[1].schema);for(let r of t.deferred)r();if(t.intersections.length){let r=new Map;for(let o of t.seen.values())for(let t of[o.schema,o.def]){let o=t?.allOf;if(!Array.isArray(o))continue;let a=r.get(o);a?a.push(t):r.set(o,[t])}for(let o of t.intersections)for(let t of r.get(o)??[])!function(t){let r=t.allOf;if(!Array.isArray(r)||r.length<2)return;for(let r of o_)if(r in t)return;let o=r.filter(t=>oS.some(r=>Array.isArray(t[r]))),a=null;if(o.length){let t=o[0],i=oS.find(r=>Array.isArray(t[r]));if(1!==Object.keys(t).length)return;let s=r.filter(r=>r!==t),n=t[i].map(t=>ow([...s,t]));if(n.some(t=>!t))return;a={[i]:n}}else a=ow(r);a&&(delete t.allOf,of(t,a))}(t)}}let i={};if("draft-2020-12"===t.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===t.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===t.target?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let o=t.external.registry.get(r)?.id;if(!o)throw Error("Schema is missing an `id` property");i.$id=t.external.uri(o)}of(i,o.defId?o.schema:o.def??o.schema);let s=t.metadataRegistry.get(r)?.id;void 0!==s&&i.id===s&&delete i.id;let n=t.external?.defs??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(let r of t.seen.entries()){let t=r[1];t.def&&t.defId&&(t.def.id===t.defId&&delete t.def.id,ep(n,t.defId,t.def))}t.external&&(t.sharedEmitDoneFor=t.external),t.external||Object.keys(n).length>0&&("draft-2020-12"===t.target?i.$defs=n:i.definitions=n);try{let o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...r["~standard"],jsonSchema:{input:oR(r,"input",t.processors),output:oR(r,"output",t.processors)}},enumerable:!1,writable:!1}),o}catch(t){throw Error("Error converting schema to JSON.")}}let oR=(t,r,o={})=>a=>{let{libraryOptions:i,target:s}=a??{},n=om({...i??{},target:s,io:r,processors:o});return og(t,n),ob(n,t),oE(n,t)},oP=(t,r,o)=>{(void 0===t[r]||o>t[r])&&(t[r]=o)},ok=(t,r,o)=>{(void 0===t[r]||o<t[r])&&(t[r]=o)},oO=(t,r)=>{oP(t,"minimum",r),ok(t,"maximum",r)},oT=(t,r)=>{t.multipleOf??(t.multipleOf=[]),t.multipleOf.includes(r)||t.multipleOf.push(r)},ox=(t,r)=>{t.patterns??(t.patterns=new Set),t.patterns.add(r)},oj=(t,r)=>{t.mime=t.mime?t.mime.filter(t=>r.includes(t)):[...r]},oC=(t,r)=>{t.format=r,r.includes("int")&&(t.isInt=!0)},oN=(t,r)=>oP(t,"minimum",r.minimum),oI=(t,r)=>ok(t,"maximum",r.maximum),oA=t=>(r,o)=>{oC(r,o.format);let[a,i]=t[o.format];oP(r,"minimum",a),ok(r,"maximum",i)},oM={greater_than:(t,r)=>oP(t,r.inclusive?"minimum":"exclusiveMinimum",r.value),less_than:(t,r)=>ok(t,r.inclusive?"maximum":"exclusiveMaximum",r.value),multiple_of:(t,r)=>oT(t,r.value),number_format:oA(eT),bigint_format:oA(ex),min_length:oN,max_length:oI,length_equals:(t,r)=>oO(t,r.length),min_size:oN,max_size:oI,size_equals:(t,r)=>oO(t,r.size),string_format:(t,r)=>{oC(t,r.format),r.pattern&&ox(t,r.pattern),("base64"===r.format||"base64url"===r.format)&&(t.contentEncoding=r.format),(r.local||-1===r.precision)&&(t.laxFormat=!0)},mime_type:(t,r)=>oj(t,r.mime)};function oq(t){let r={},o=t._zod.def;for(let a of t._zod.traits.has("$ZodCheck")?[t,...o.checks??[]]:o.checks??[])oM[a._zod.def.check]?.(r,a._zod.def);let a=t._zod.bag;for(let t of(void 0!==a.minimum&&oP(r,"minimum",a.minimum),void 0!==a.exclusiveMinimum&&oP(r,"exclusiveMinimum",a.exclusiveMinimum),void 0!==a.maximum&&ok(r,"maximum",a.maximum),void 0!==a.exclusiveMaximum&&ok(r,"exclusiveMaximum",a.exclusiveMaximum),void 0!==a.multipleOf&&oT(r,a.multipleOf),void 0!==a.format&&(r.format??(r.format=a.format),a.format.includes("int")&&(r.isInt=!0)),a.mime&&oj(r,a.mime),a.patterns??[]))ox(r,t);return r}let oz={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},oL=new Map([[rf,/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/],[ry,/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/]]),oD=t=>oL.get(t)??t,oU=(t,r,o,a)=>{o.type="string";let{minimum:i,maximum:s,format:n,patterns:l,contentEncoding:c,laxFormat:u}=oq(t);if("number"==typeof i&&(o.minLength=i),"number"==typeof s&&(o.maxLength=s),n&&(o.format=oz[n]??n,""===o.format&&delete o.format,("time"===n||u)&&delete o.format),c&&(o.contentEncoding=c),l&&l.size>0){let t=[...l].map(oD);1===t.length?o.pattern=t[0].source:t.length>1&&(o.allOf=[...t.map(t=>({..."draft-07"===r.target||"draft-04"===r.target||"openapi-3.0"===r.target?{type:"string"}:{},pattern:t.source}))])}},oV=(t,r,o,a)=>{let{minimum:i,maximum:s,multipleOf:n,exclusiveMaximum:l,exclusiveMinimum:c,isInt:u}=oq(t);o.type=u?"integer":"number";let d="number"==typeof c&&c>=(i??-1/0),p="number"==typeof l&&l<=(s??1/0),h="draft-04"===r.target||"openapi-3.0"===r.target;if(d?h?(o.minimum=c,o.exclusiveMinimum=!0):o.exclusiveMinimum=c:"number"==typeof i&&(o.minimum=i),p?h?(o.maximum=l,o.exclusiveMaximum=!0):o.exclusiveMaximum=l:"number"==typeof s&&(o.maximum=s),n){let i=new Set;for(let s of n)Number.isFinite(s)&&0!==s?i.add(Math.abs(s)):oy(t,r,o,a,`A multipleOf divisor of ${s} cannot be represented in JSON Schema`);let[s,...l]=i;void 0!==s&&(o.multipleOf=s),l.length&&(o.allOf=[...o.allOf??[],...l.map(t=>({multipleOf:t}))])}},oF=(t,r,o,a)=>{o.type="boolean"},oH=(t,r,o,a)=>{"openapi-3.0"===r.target?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},oK=(t,r,o,a)=>{o.not={}},oJ=(t,r,o,a)=>{},oB=(t,r,o,a)=>{},oG=(t,r,o,a)=>{let i=ei(t._zod.def.entries);if(0===i.length){o.not={};return}i.every(t=>"number"==typeof t)&&(o.type="number"),i.every(t=>"string"==typeof t)&&(o.type="string"),o.enum=i},oZ=(t,r,o,a)=>{let i=t._zod.def;if(0===i.values.length){o.not={};return}let s=[];for(let n of i.values)if(void 0===n){if(oy(t,r,o,a,"Literal `undefined` cannot be represented in JSON Schema"))return}else if("bigint"==typeof n){if(oy(t,r,o,a,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(n))}else s.push(n);if(0===s.length);else if(1===s.length){let t=s[0];o.type=null===t?"null":typeof t,"draft-04"===r.target||"openapi-3.0"===r.target?o.enum=[t]:o.const=t}else s.every(t=>"number"==typeof t)&&(o.type="number"),s.every(t=>"string"==typeof t)&&(o.type="string"),s.every(t=>"boolean"==typeof t)&&(o.type="boolean"),s.every(t=>null===t)&&(o.type="null"),o.enum=s},oW=(t,r,o,a)=>{oy(t,r,o,a,"Custom types cannot be represented in JSON Schema")},oX=(t,r,o,a)=>{oy(t,r,o,a,"Transforms cannot be represented in JSON Schema")},oY=(t,r,o,a)=>{let i=t._zod.def,{minimum:s,maximum:n}=oq(t);"number"==typeof s&&(o.minItems=s),"number"==typeof n&&(o.maxItems=n),o.type="array",o.items=og(i.element,r,{...a,path:[...a.path,"items"]})};function oQ(t){let r=t._zod.def;return"pipe"===r.type&&r.in._zod.traits.has("$ZodTransform")?oQ(r.out):"catch"===r.type?oQ(r.innerType):t._zod.optin}let o0=(t,r,o,a)=>{let i=t._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&oy(t,r,o,a,"Symbol keys cannot be represented in JSON Schema"))return;for(let t in o.type="object",o.properties={},s)ep(o.properties,t,og(s[t],r,{...a,path:[...a.path,"properties",t]}));let n=[];for(let t of Object.keys(s)){let o=i.shape[t];("input"===r.io?void 0===oQ(o):void 0===o._zod.optout)&&n.push(t)}n.length>0&&(o.required=n),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=og(i.catchall,r,{...a,path:[...a.path,"additionalProperties"]})):"output"===r.io&&(o.additionalProperties=!1)},o1=(t,r,o,a)=>{let i=t._zod.def,s=!1===i.inclusive,n=i.options.map((t,o)=>og(t,r,{...a,path:[...a.path,s?"oneOf":"anyOf",o]}));s?o.oneOf=n:o.anyOf=n},o2=(t,r,o,a)=>{let i=t._zod.def,s=og(i.left,r,{...a,path:[...a.path,"allOf",0]}),n=og(i.right,r,{...a,path:[...a.path,"allOf",1]}),l=t=>"allOf"in t&&1===Object.keys(t).length,c=[...l(s)?s.allOf:[s],...l(n)?n.allOf:[n]];o.allOf=c,r.intersections.push(c)},o9=new WeakMap,o4=(t,r,o,a)=>{let i=t._zod.def;o.type="object";let s=i.keyType,n=oq(s).patterns;if("loose"===i.mode&&n&&n.size>0){let t=og(i.valueType,r,{...a,path:[...a.path,"patternProperties","*"]});for(let r of(o.patternProperties={},n))ep(o.patternProperties,oD(r).source,t)}else{if("draft-07"===r.target||"draft-2020-12"===r.target){o.propertyNames=og(i.keyType,r,{...a,path:[...a.path,"propertyNames"]});let s=o9.get(r);s||(s=[],o9.set(r,s),r.deferred.push(()=>(function(t){let r=new Map;for(let o of t.seen.values())o.def&&!r.has(o.schema)&&r.set(o.schema,o);let o=new Map;for(let a of o9.get(t)??[]){let i=t.seen.get(a),s=(i?.def??i?.schema)?.propertyNames;if(!s||!0===s||o.has(s))continue;let n=function t(r,o,a){if(o.$ref){if(a.has(o))return o;a.add(o);let i=r.get(o)?.def;if(!i)return o;let s=t(r,i,a);return s===i?o:s}for(let i of["anyOf","oneOf"]){let s=o[i];if(!Array.isArray(s))continue;let n=s.map(o=>t(r,o,a));n.some((t,r)=>t!==s[r])&&(o={...o,[i]:n})}let i=Array.isArray(o.type)?o.type:[o.type],s=!i.includes("string")&&i.some(t=>"number"===t||"integer"===t),n=o.enum??(void 0!==o.const?[o.const]:void 0);if(!s&&!n?.some(t=>"number"==typeof t))return o;let{minimum:l,maximum:c,exclusiveMinimum:u,exclusiveMaximum:d,multipleOf:p,format:h,id:f,...m}=o;return m.enum?m.enum=m.enum.map(t=>"number"==typeof t?String(t):t):"number"==typeof m.const&&(m.const=String(m.const)),s&&(m.type="string",n||(m.pattern=(i.includes("number")?t$:tS).source)),m}(r,s,new Set);n!==s&&o.set(s,n)}if(o.size)for(let r of t.seen.values())for(let t of[r.schema,r.def]){let r=t&&o.get(t.propertyNames);r&&(t.propertyNames=r)}})(r))),s.push(t)}o.additionalProperties=og(i.valueType,r,{...a,path:[...a.path,"additionalProperties"]})}let l=s._zod.values,c="input"===r.io&&void 0!==oQ(i.valueType);if(l&&!i.partial&&!c){let t=[...l].filter(t=>"string"==typeof t||"number"==typeof t);t.length>0&&(o.required=t.map(String))}},o5=(t,r,o,a)=>{let i=t._zod.def,s=og(i.innerType,r,a),n=r.seen.get(t);"openapi-3.0"===r.target?(n.ref=i.innerType,o.nullable=!0):o.anyOf=[s,{type:"null"}]},o3=(t,r,o,a)=>{let i=t._zod.def;og(i.innerType,r,a),r.seen.get(t).ref=i.innerType},o6=Symbol();function o8(t,r,o,a,i){let s=!1,n=JSON.stringify(t,(t,r)=>"bigint"!=typeof r?r:(s=!0,null));return s?(oy(r,o,a,i,"BigInt defaults cannot be represented in JSON Schema"),o6):JSON.parse(n)}let o7=(t,r,o,a)=>{let i=t._zod.def;og(i.innerType,r,a),r.seen.get(t).ref=i.innerType;let s=o8(i.defaultValue,t,r,o,a);s!==o6&&(o.default=s)},ae=(t,r,o,a)=>{let i=t._zod.def;if(og(i.innerType,r,a),r.seen.get(t).ref=i.innerType,"input"!==r.io)return;let s=o8(i.defaultValue,t,r,o,a);s!==o6&&(o._prefault=s)},at=(t,r,o,a)=>{let i,s=t._zod.def;og(s.innerType,r,a),r.seen.get(t).ref=s.innerType;try{i=s.catchValue(void 0)}catch{oy(t,r,o,a,"Dynamic catch values are not supported in JSON Schema");return}o.default=i},ar=(t,r,o,a)=>{let i=t._zod.def,s=i.in._zod.traits.has("$ZodTransform"),n="input"===r.io?s?i.out:i.in:i.out;og(n,r,a),r.seen.get(t).ref=n},ao=(t,r,o,a)=>{let i=t._zod.def;og(i.innerType,r,a),r.seen.get(t).ref=i.innerType,o.readOnly=!0},aa=(t,r,o,a)=>{let i=t._zod.def;og(i.innerType,r,a),r.seen.get(t).ref=i.innerType},ai=(t,r,o,a)=>{let i=t._zod.innerType;og(i,r,a),r.seen.get(t).ref=i},as={string:oU,number:oV,boolean:oF,bigint:(t,r,o,a)=>{oy(t,r,o,a,"BigInt cannot be represented in JSON Schema")},symbol:(t,r,o,a)=>{oy(t,r,o,a,"Symbols cannot be represented in JSON Schema")},null:oH,undefined:(t,r,o,a)=>{oy(t,r,o,a,"Undefined cannot be represented in JSON Schema")},void:(t,r,o,a)=>{oy(t,r,o,a,"Void cannot be represented in JSON Schema")},never:oK,any:oJ,unknown:oB,date:(t,r,o,a)=>{oy(t,r,o,a,"Date cannot be represented in JSON Schema")},enum:oG,literal:oZ,nan:(t,r,o,a)=>{oy(t,r,o,a,"NaN cannot be represented in JSON Schema")},template_literal:(t,r,o,a)=>{let i=t._zod.pattern;if(!i)throw Error("Pattern not found in template literal");o.type="string",o.pattern=i.source},file:(t,r,o,a)=>{o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:i,maximum:s,mime:n}=oq(t);void 0!==i&&(o.minLength=i),void 0!==s&&(o.maxLength=s),n&&(0===n.length?o.not={}:1===n.length?o.contentMediaType=n[0]:o.anyOf=n.map(t=>({contentMediaType:t})))},success:(t,r,o,a)=>{o.type="boolean"},custom:oW,function:(t,r,o,a)=>{oy(t,r,o,a,"Function types cannot be represented in JSON Schema")},transform:oX,map:(t,r,o,a)=>{oy(t,r,o,a,"Map cannot be represented in JSON Schema")},set:(t,r,o,a)=>{oy(t,r,o,a,"Set cannot be represented in JSON Schema")},array:oY,object:o0,union:o1,intersection:o2,tuple:(t,r,o,a)=>{let i=t._zod.def;o.type="array";let s="draft-2020-12"===r.target?"prefixItems":"items",n="draft-2020-12"===r.target||"openapi-3.0"===r.target?"items":"additionalItems",l=i.items.map((t,o)=>og(t,r,{...a,path:[...a.path,s,o]})),c=i.rest?og(i.rest,r,{...a,path:[...a.path,n,..."openapi-3.0"===r.target?[i.items.length]:[]]}):null,u=i.items.length;for(;u>0;){let t=i.items[u-1];if(!("input"===r.io?void 0!==oQ(t):"optional"===t._zod.optout))break;u--}let d=i.items.length,p=!i.rest;"draft-2020-12"===r.target?(o.prefixItems=l,p?o.items=!1:c&&(o.items=c)):"openapi-3.0"===r.target?(o.items={anyOf:l},c&&o.items.anyOf.push(c)):(o.items=l,p?o.additionalItems=!1:c&&(o.additionalItems=c)),u>0&&(o.minItems=u),p&&(o.maxItems=d);let{minimum:h,maximum:f}=oq(t);"number"==typeof h&&(o.minItems=h),"number"==typeof f&&(o.maxItems=f)},record:o4,nullable:o5,nonoptional:o3,default:o7,prefault:ae,catch:at,pipe:ar,readonly:ao,promise:(t,r,o,a)=>{let i=t._zod.def;og(i.innerType,r,a),r.seen.get(t).ref=i.innerType},optional:aa,lazy:ai};function an(t,r){if("_idmap"in t){let o=om({...r,processors:as}),a={};for(let r of t._idmap.entries()){let[t,a]=r;og(a,o)}let i={};for(let s of(o.external={registry:t,uri:r?.uri,defs:a},t._idmap.entries())){let[t,r]=s;ob(o,r),ep(i,t,oE(o,r))}return Object.keys(a).length>0&&(i.__shared={["draft-2020-12"===o.target?"$defs":"definitions"]:a}),{schemas:i}}let o=om({...r,processors:as});return og(t,o),ob(o,t),oE(o,t)}let al={get:function(){let t=this._zod;return t.message??(t.message=JSON.stringify(t.def,en,2)),t.message},set:function(t){this._zod.message=t},enumerable:!0,configurable:!0},ac={value:void 0,enumerable:!1},au=new WeakSet([Object.prototype,Error.prototype]),ad=(t,r)=>{t.name="$ZodError",ac.value=r,Object.defineProperty(t,"issues",ac),ac.value=void 0,Object.defineProperty(t,"message",al);let o=Object.getPrototypeOf(t);au.has(o)||(au.add(o),Object.defineProperty(o,"toString",{configurable:!0,enumerable:!1,get(){let t=()=>this.message;return Object.defineProperty(this,"toString",{value:t,configurable:!0,writable:!0}),t},set(t){Object.defineProperty(this,"toString",{value:t,configurable:!0,writable:!0})}}))},ap=eX("$ZodError",ad);function ah(t,r){return{callee:r?.callee??t,Err:r?.Err}}eX("$ZodError",ad,void 0,{Parent:Error});let af=t=>{let r=(o,a,i,s)=>{let n=i?{...i,async:!1}:{async:!1},l=o._zod.run({value:a,issues:[]},n);if(l instanceof Promise)throw new eY;if(l.issues.length){let o=new(s?.Err??t)(l.issues.map(t=>ez(t,n,e1())));throw eb(o,s?.callee??r),o}return l.value};return r},am=t=>{let r=async(o,a,i,s)=>{let n=i?{...i,async:!0}:{async:!0},l=o._zod.run({value:a,issues:[]},n);if(l instanceof Promise&&(l=await l),l.issues.length){let o=new(s?.Err??t)(l.issues.map(t=>ez(t,n,e1())));throw eb(o,s?.callee??r),o}return l.value};return r},ay=t=>(r,o,a)=>{let i=a?{...a,async:!1}:{async:!1},s=r._zod.run({value:o,issues:[]},i);if(s instanceof Promise)throw new eY;return s.issues.length?ag(t,s.issues,i):{success:!0,data:s.value}};function ag(t,r,o){let a;return{success:!1,get error(){return a||(a=new t(r.map(t=>ez(t,o,e1()))),r=void 0,o=void 0),a},set error(e){a=e,r=void 0,o=void 0}}}let av=t=>async(r,o,a)=>{let i=a?{...a,async:!0}:{async:!0},s=r._zod.run({value:o,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?ag(t,s.issues,i):{success:!0,data:s.value}},ab=Symbol.for("zod.compile.invalid"),a_=Symbol.for("zod.compile.fallback"),aS=async(t,r,o)=>{let a=o?{...o,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=t._zod.run({value:r,issues:[]},a);return i instanceof Promise&&(i=await i),0===i.issues.length},a$=new WeakSet([Object.prototype,Error.prototype]);function aw(t,r,o){Object.defineProperty(t,r,{configurable:!0,enumerable:!1,get(){let t=o(this);return Object.defineProperty(this,r,{value:t,configurable:!0,writable:!0}),t},set(t){Object.defineProperty(this,r,{value:t,configurable:!0,writable:!0})}})}let aE=eX("ZodError",(t,r)=>{ap.init(t,r),t.name="ZodError";let o=Object.getPrototypeOf(t);a$.has(o)||(a$.add(o),aw(o,"format",t=>r=>(function(t,r=t=>t.message){let o={_errors:[]},a=(t,i=[])=>{for(let s of t.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(t=>a({issues:t},[...i,...s.path]));else if("invalid_key"===s.code)a({issues:s.issues},[...i,...s.path]);else if("invalid_element"===s.code)a({issues:s.issues},[...i,...s.path]);else{let t=[...i,...s.path];if(0===t.length)o._errors.push(r(s));else{let a=o,i=0;for(;i<t.length;){let o=t[i],n=i===t.length-1;if("_errors"===o){n&&a._errors.push(r(s)),i++;continue}Object.prototype.hasOwnProperty.call(a,o)||Object.defineProperty(a,o,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let l=a[o];n&&l._errors.push(r(s)),a=l,i++}}}};return a(t),o})(t,r)),aw(o,"flatten",t=>r=>(function(t,r=t=>t.message){let o={},a=[];for(let n of t.issues)if(n.path.length>0){var i,s;(i=n.path[0],s=()=>[],!Object.prototype.hasOwnProperty.call(o,i)&&("__proto__"===i?Object.defineProperty(o,i,{value:s(),writable:!0,enumerable:!0,configurable:!0}):o[i]=s()),o[i]).push(r(n))}else a.push(r(n));return{formErrors:a,fieldErrors:o}})(t,r)),aw(o,"addIssue",t=>r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,en,2)}),aw(o,"addIssues",t=>r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,en,2)}),Object.defineProperty(o,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error}),aR=af(aE),aP=am(aE),ak=ay(aE),aO=av(aE),aT=(h=af(aE),f=(t,r,o,a)=>h(t,r,o?{...o,direction:"backward"}:{direction:"backward"},ah(f,a))),ax=(m=af(aE),y=(t,r,o,a)=>m(t,r,o,ah(y,a))),aj=(g=am(aE),v=async(t,r,o,a)=>{let i=o?{...o,direction:"backward"}:{direction:"backward"};return await g(t,r,i,ah(v,a))}),aC=(b=am(aE),_=async(t,r,o,a)=>await b(t,r,o,ah(_,a))),aN=(t,r,o)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return ay(aE)(t,r,a)},aI=(t,r,o)=>ay(aE)(t,r,o),aA=async(t,r,o)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return av(aE)(t,r,a)},aM=async(t,r,o)=>av(aE)(t,r,o);function aq(){e0.memoizer||e1({memoizer:e7})}let az=eX("ZodType",(t,r)=>(e0.localeError||e1({localeError:(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};function a(t,r){return"number"!==t||"number"!=typeof r||Number.isFinite(r)?o[t]??t:String(r)}return o=>{switch(o.code){case"invalid_type":{let t=a(o.expected),r=a(function(t){let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"nan":"number";case"object":if(null===t)return"null";if(Array.isArray(t))return"array";if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}return r}(o.input),o.input);return`Invalid input: expected ${t}, received ${r}`}case"invalid_value":if(1===o.values.length)return`Invalid input: expected ${eO(o.values[0])}`;return`Invalid option: expected one of ${es(o.values,"|")}`;case"too_big":{let r=o.exact?"exactly ":o.inclusive?"<=":"<",a=t[o.origin]??null;if(a)return`Too big: expected ${o.origin??"value"} to have ${r}${o.maximum.toString()} ${a.unit??"elements"}`;return`Too big: expected ${o.origin??"value"} to be ${r}${o.maximum.toString()}`}case"too_small":{let r=o.exact?"exactly ":o.inclusive?">=":">",a=t[o.origin]??null;if(a)return`Too small: expected ${o.origin} to have ${r}${o.minimum.toString()} ${a.unit}`;return`Too small: expected ${o.origin} to be ${r}${o.minimum.toString()}`}case"invalid_format":if("starts_with"===o.format)return`Invalid string: must start with "${o.prefix}"`;if("ends_with"===o.format)return`Invalid string: must end with "${o.suffix}"`;if("includes"===o.format)return`Invalid string: must include "${o.includes}"`;if("regex"===o.format)return`Invalid string: must match pattern ${o.pattern}`;return`Invalid ${r[o.format]??o.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${es(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":if(o.options&&Array.isArray(o.options)&&o.options.length>0){let t=o.options.map(t=>`'${t}'`).join(" | ");return`Invalid discriminator value. Expected ${t}`}if(!1===o.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}})()}),tB.init(t,r),t.def=r,t.type=r.type,t),{check(...t){let r=this.def;return this.clone(ev(r,{checks:[...r.checks??[],...t.map(t=>"function"==typeof t?{_zod:{check:t,def:{check:"custom"},onattach:[]}}:t)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,r){return eP(this,t,r)},brand(){return this},register(t,r){return t.add(this,r),this},refine(t,r){return this.check(function(t,r={}){return new iW({type:"custom",check:"custom",fn:t,...ek(r)})}(t,r))},superRefine(t,r){return this.check(function(t,r){var o;let a,i;return o=r=>(r.addIssue=t=>{"string"==typeof t?r.issues.push(eV(t,r.value,a._zod.def)):(t.fatal&&(t.continue=!1),t.code??(t.code="custom"),"input"in t||(t.input=r.value),t.inst??(t.inst=a),t.continue??(t.continue=!a._zod.def.abort),r.issues.push(eV(t)))},t(r.value,r)),(i=new tk({check:"custom",...ek(r)}))._zod.check=o,a=i}(t,r))},overwrite(t){return this.check(oh(t))},optional(){return iM(this)},exactOptional(){var t;return t=this,new iq({type:"optional",innerType:t})},nullable(){return iL(this)},nullish(){return iM(iL(this))},nonoptional(t){var r;return r=this,new iV({type:"nonoptional",innerType:r,...ek(t)})},array(){return ig(this)},or(t){return i$([this,t])},and(t){return iP(this,t)},transform(t){return iK(this,iI(t))},default(t){var r,o;return r=this,o=t,new iD({type:"default",innerType:r,get defaultValue(){return"function"==typeof o?o():ew(o)}})},prefault(t){var r,o;return r=this,o=t,new iU({type:"prefault",innerType:r,get defaultValue(){return"function"==typeof o?o():ew(o)}})},catch(t){return function(t,r){let o;return new iF({type:"catch",innerType:t,catchValue:"function"==typeof r?r:((o=()=>r)["~constantCatch"]=!0,o)})}(this,t)},pipe(t){return iK(this,t)},readonly(){var t;return t=this,new iB({type:"readonly",innerType:t})},describe(t){let r=this.clone();return r7.add(r,{description:t}),r},meta(...t){if(0===t.length)return r7.get(this);let r=this.clone();return r7.add(r,t[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...r){return 0===r.length?t(this):t(this,...r)},get"~standard"(){return eF(this,"~standard",{...tW(this),jsonSchema:{input:oR(this,"input"),output:oR(this,"output")}},!1)},set"~standard"(value){eF(this,"~standard",value)},parse:function t(r,o){return aR(this,r,o,{callee:t})},parseAsync:async function t(r,o){return await aP(this,r,o,{callee:t})},safeParse(t,r){return ak(this,t,r)},async safeParseAsync(t,r){return aO(this,t,r)},get spa(){return this?.safeParseAsync},set spa(value){eF(this,"spa",value)},validate(t,r){let o=this._zod.bag.validator;if(void 0!==o){if(o(t)!==ab)return!0;if(!0===o.definite&&void 0===r)return!1}return function(t,r,o){let a,i=o?{...o,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},s=t._zod.bag.fallbackRun;if(s?(i[a_]=!0,a=s({value:r,issues:[]},i)):a=t._zod.run({value:r,issues:[]},i),a instanceof Promise)throw new eY;return 0===a.issues.length}(this,t,r)},validateAsync(t,r){return aS(this,t,r)},encode:function t(r,o){return aT(this,r,o,{callee:t})},decode:function t(r,o){return ax(this,r,o,{callee:t})},encodeAsync:async function t(r,o){return await aj(this,r,o,{callee:t})},decodeAsync:async function t(r,o){return await aC(this,r,o,{callee:t})},safeEncode(t,r){return aN(this,t,r)},safeDecode(t,r){return aI(this,t,r)},async safeEncodeAsync(t,r){return aA(this,t,r)},async safeDecodeAsync(t,r){return aM(this,t,r)},toJSONSchema(t){return((t,r={})=>o=>{let a=om({...o,processors:r});return og(t,a),ob(a,t),oE(a,t)})(this,{})(t)},get description(){return r7.get(this)?.description},get _def(){return this._zod.def}}),aL=eX("_ZodString",(t,r)=>{tX.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>oU(t,r,o,a)},eH({format:t=>oq(t).format??null,minLength:t=>oq(t).minimum??null,maxLength:t=>oq(t).maximum??null},{regex(...t){return this.check(function(t,r){return new tz({check:"string_format",format:"regex",...ek(r),pattern:t})}(...t))},includes(...t){return this.check(function(t,r){return new tU({check:"string_format",format:"includes",...ek(r),includes:t})}(...t))},startsWith(...t){return this.check(function(t,r){return new tV({check:"string_format",format:"starts_with",...ek(r),prefix:t})}(...t))},endsWith(...t){return this.check(function(t,r){return new tF({check:"string_format",format:"ends_with",...ek(r),suffix:t})}(...t))},min(...t){return this.check(od(...t))},max(...t){return this.check(ou(...t))},length(...t){return this.check(op(...t))},nonempty(...t){return this.check(od(1,...t))},lowercase(t){return this.check(new tL({check:"string_format",format:"lowercase",...ek(t)}))},uppercase(t){return this.check(new tD({check:"string_format",format:"uppercase",...ek(t)}))},trim(){return this.check(oh(t=>t.trim()))},normalize(...t){return this.check(function(t){return oh(r=>r.normalize(t))}(...t))},toLowerCase(){return this.check(oh(t=>t.toLowerCase()))},toUpperCase(){return this.check(oh(t=>t.toUpperCase()))},slugify(){return this.check(oh(t=>t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}})),aD=eX("ZodString",(t,r)=>{tX.init(t,r),aL.init(t,r)},{email(t){return this.check(ot(aB,t))},url(t){return this.check(or(aW,t))},jwt(t){return this.check(new it({type:"string",format:"jwt",check:"string_format",abort:!1,...ek(t)}))},emoji(t){return this.check(new aX({type:"string",format:"emoji",check:"string_format",abort:!1,...ek(t)}))},guid(t){return this.check(new aG({type:"string",format:"guid",check:"string_format",abort:!1,...ek(t)}))},uuid(t){return this.check(new aZ({type:"string",format:"uuid",check:"string_format",abort:!1,...ek(t)}))},uuidv4(t){return this.check(new aZ({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ek(t)}))},uuidv6(t){return this.check(new aZ({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ek(t)}))},uuidv7(t){return this.check(new aZ({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ek(t)}))},nanoid(t){return this.check(new aY({type:"string",format:"nanoid",check:"string_format",abort:!1,...ek(t)}))},cuid(t){return this.check(new aQ({type:"string",format:"cuid",check:"string_format",abort:!1,...ek(t)}))},cuid2(t){return this.check(new a0({type:"string",format:"cuid2",check:"string_format",abort:!1,...ek(t)}))},ulid(t){return this.check(new a1({type:"string",format:"ulid",check:"string_format",abort:!1,...ek(t)}))},base64(t){return this.check(new a8({type:"string",format:"base64",check:"string_format",abort:!1,...ek(t)}))},base64url(t){return this.check(new a7({type:"string",format:"base64url",check:"string_format",abort:!1,...ek(t)}))},xid(t){return this.check(new a2({type:"string",format:"xid",check:"string_format",abort:!1,...ek(t)}))},ksuid(t){return this.check(new a9({type:"string",format:"ksuid",check:"string_format",abort:!1,...ek(t)}))},ipv4(t){return this.check(new a4({type:"string",format:"ipv4",check:"string_format",abort:!1,...ek(t)}))},ipv6(t){return this.check(new a5({type:"string",format:"ipv6",check:"string_format",abort:!1,...ek(t)}))},cidrv4(t){return this.check(new a3({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ek(t)}))},cidrv6(t){return this.check(new a6({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ek(t)}))},e164(t){return this.check(new ie({type:"string",format:"e164",check:"string_format",abort:!1,...ek(t)}))},datetime(t){return this.check(oo(aF,t))},date(t){return this.check(oa(aH,t))},time(t){return this.check(new aK({type:"string",format:"time",check:"string_format",precision:null,...ek(t)}))},duration(t){return this.check(new aJ({type:"string",format:"duration",check:"string_format",...ek(t)}))}});function aU(t){return new aD(oe({type:"string",...ek(t)}))}let aV=eX("ZodStringFormat",(t,r)=>{tY.init(t,r),aL.init(t,r)}),aF=eX("ZodISODateTime",(t,r)=>{ro.init(t,r),aV.init(t,r)}),aH=eX("ZodISODate",(t,r)=>{ra.init(t,r),aV.init(t,r)}),aK=eX("ZodISOTime",(t,r)=>{ri.init(t,r),aV.init(t,r)}),aJ=eX("ZodISODuration",(t,r)=>{rs.init(t,r),aV.init(t,r)}),aB=eX("ZodEmail",(t,r)=>{t1.init(t,r),aV.init(t,r)}),aG=eX("ZodGUID",(t,r)=>{tQ.init(t,r),aV.init(t,r)}),aZ=eX("ZodUUID",(t,r)=>{t0.init(t,r),aV.init(t,r)}),aW=eX("ZodURL",(t,r)=>{t5.init(t,r),aV.init(t,r)}),aX=eX("ZodEmoji",(t,r)=>{t3.init(t,r),aV.init(t,r)}),aY=eX("ZodNanoID",(t,r)=>{t6.init(t,r),aV.init(t,r)}),aQ=eX("ZodCUID",(t,r)=>{t8.init(t,r),aV.init(t,r)}),a0=eX("ZodCUID2",(t,r)=>{t7.init(t,r),aV.init(t,r)}),a1=eX("ZodULID",(t,r)=>{re.init(t,r),aV.init(t,r)}),a2=eX("ZodXID",(t,r)=>{rt.init(t,r),aV.init(t,r)}),a9=eX("ZodKSUID",(t,r)=>{rr.init(t,r),aV.init(t,r)}),a4=eX("ZodIPv4",(t,r)=>{rn.init(t,r),aV.init(t,r)}),a5=eX("ZodIPv6",(t,r)=>{ru.init(t,r),aV.init(t,r)}),a3=eX("ZodCIDRv4",(t,r)=>{rd.init(t,r),aV.init(t,r)}),a6=eX("ZodCIDRv6",(t,r)=>{rp.init(t,r),aV.init(t,r)}),a8=eX("ZodBase64",(t,r)=>{rm.init(t,r),aV.init(t,r)}),a7=eX("ZodBase64URL",(t,r)=>{rg.init(t,r),aV.init(t,r)}),ie=eX("ZodE164",(t,r)=>{rv.init(t,r),aV.init(t,r)}),it=eX("ZodJWT",(t,r)=>{rb.init(t,r),aV.init(t,r)}),ir=eX("ZodNumber",(t,r)=>{r_.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>oV(t,r,o,a),t.isFinite=!0},eH({minValue:t=>{let{minimum:r,exclusiveMinimum:o}=oq(t);return Math.max(r??-1/0,o??-1/0)},maxValue:t=>{let{maximum:r,exclusiveMaximum:o}=oq(t);return Math.min(r??1/0,o??1/0)},isInt:t=>{let{isInt:r,multipleOf:o}=oq(t);return!!r||!!o?.some(Number.isSafeInteger)},format:t=>oq(t).format??null},{gt(t,r){return this.check(on(t,r))},gte(t,r){return this.check(ol(t,r))},min(t,r){return this.check(ol(t,r))},lt(t,r){return this.check(oi(t,r))},lte(t,r){return this.check(os(t,r))},max(t,r){return this.check(os(t,r))},int(t){return this.check(ii(t))},safe(t){return this.check(ii(t))},positive(t){return this.check(on(0,t))},nonnegative(t){return this.check(ol(0,t))},negative(t){return this.check(oi(0,t))},nonpositive(t){return this.check(os(0,t))},multipleOf(t,r){return this.check(oc(t,r))},step(t,r){return this.check(oc(t,r))},finite(){return this}}));function io(t){return new ir(oe({type:"number",checks:[],...ek(t)}))}let ia=eX("ZodNumberFormat",(t,r)=>{rS.init(t,r),ir.init(t,r)});function ii(t){return new ia({type:"number",check:"number_format",abort:!1,format:"safeint",...ek(t)})}let is=eX("ZodBoolean",(t,r)=>{r$.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>oF(t,r,o,a)});function il(t){return new is({type:"boolean",...ek(t)})}let ic=eX("ZodNull",(t,r)=>{rw.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>oH(t,r,o,a)});function iu(t){return new ic({type:"null",...ek(t)})}let id=eX("ZodAny",(t,r)=>{rE.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>oJ(t,r,o,a)}),ip=eX("ZodUnknown",(t,r)=>{rR.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>oB(t,r,o,a)});function ih(){return new ip({type:"unknown"})}let im=eX("ZodNever",(t,r)=>{rP.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>oK(t,r,o,a)}),iy=eX("ZodArray",(t,r)=>{aq(),rO.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>oY(t,r,o,a),t.element=r.element},{min(t,r){return this.check(od(t,r))},nonempty(t){return this.check(od(1,t))},max(t,r){return this.check(ou(t,r))},length(t,r){return this.check(op(t,r))},unwrap(){return this.element}});function ig(t,r){return new iy({type:"array",element:t,...ek(r)})}let iv=eX("ZodObject",(t,r)=>{var o;let a,i;aq(),rI.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>o0(t,r,o,a),o="shape",(i=o in(a=Object.getPrototypeOf(t))?void 0:a)&&Object.defineProperty(i,o,{configurable:!0,get(){let t={configurable:!0,writable:!0,enumerable:!1,value:void 0};return Object.defineProperty(this,o,t),t.value=(t=>t._zod.def.shape)(this),Object.defineProperty(this,o,t),t.value},set(t){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!1,value:t})}})},{keyof(){return ix(Object.keys(this._zod.def.shape))},catchall(t){return this.clone(ev(this._zod.def,{catchall:t}))},passthrough(){return this.clone(ev(this._zod.def,{catchall:ih()}))},loose(){return this.clone(ev(this._zod.def,{catchall:ih()}))},strict(){return this.clone(ev(this._zod.def,{catchall:new im({type:"never",...ek(void 0)})}))},strip(){return this.clone(ev(this._zod.def,{catchall:void 0}))},extend(t){if(!e$(t))throw Error("Invalid input to extend: expected a plain object");let r=this._zod.def.checks;if(r&&r.length>0){let r=ef(this);for(let o of Reflect.ownKeys(t))if(void 0!==Object.getOwnPropertyDescriptor(r,o))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return eP(this,ev(this._zod.def,{shape:eC(this,t)}))},safeExtend(t){if(!e$(t))throw Error("Invalid input to safeExtend: expected a plain object");return eP(this,ev(this._zod.def,{shape:eC(this,t)}))},merge(t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(this._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};return eg(r,this,Reflect.ownKeys(ef(this))),eg(r,t,Reflect.ownKeys(ef(t))),eP(this,ev(this._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))},pick(t){return function(t,r){let o=t._zod.def,a=o.checks;if(a&&a.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return eg(i,t,ej(t,r)),eP(t,ev(o,{shape:i,checks:[]}))}(this,t)},omit(t){return function(t,r){let o=t._zod.def,a=o.checks;if(a&&a.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(ej(t,r)),s={};return eg(s,t,Reflect.ownKeys(ef(t)).filter(t=>!i.has(t))),eP(t,ev(o,{shape:s,checks:[]}))}(this,t)},partial(...t){return eN(iA,this,t[0])},exactPartial(...t){return eN(iq,this,t[0],"exactPartial")},required(...t){var r;let o,a;return o=(r=t[0])?new Set(ej(this,r)):void 0,eg(a={},this,Reflect.ownKeys(ef(this)),(t,r)=>o&&!o.has(r)?t:new iV({type:"nonoptional",innerType:t})),eP(this,ev(this._zod.def,{shape:a}))}});function ib(t,r){return new iv({type:"object",shape:t??{},...ek(r)})}function i_(t,r){return new iv({type:"object",shape:t,catchall:ih(),...ek(r)})}let iS=eX("ZodUnion",(t,r)=>{rM.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>o1(t,r,o,a),t.options=r.options});function i$(t,r){return new iS({type:"union",options:t,...ek(r)})}let iw=eX("ZodDiscriminatedUnion",(t,r)=>{iS.init(t,r),rq.init(t,r)});function iE(t,r,o){return new iw({type:"union",options:r,discriminator:t,...ek(o)})}let iR=eX("ZodIntersection",(t,r)=>{rz.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>o2(t,r,o,a)});function iP(t,r){return new iR({type:"intersection",left:t,right:r})}let ik=eX("ZodRecord",(t,r)=>{aq(),rD.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>o4(t,r,o,a),t.keyType=r.keyType,t.valueType=r.valueType});function iO(t,r,o){return new ik(r&&r._zod?{type:"record",keyType:t,valueType:r,...ek(o)}:{type:"record",keyType:aU(),valueType:t,...ek(r)})}let iT=eX("ZodEnum",(t,r)=>{rU.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>oG(t,r,o,a),t.enum=r.entries,t.options=[...t._zod.values];let o=new Set(Object.keys(r.entries));t.extract=(t,a)=>{let i={};for(let a of t)if(o.has(a))i[a]=r.entries[a];else throw Error(`Key ${a} not found in enum`);return new iT({...r,checks:[],...ek(a),entries:i})},t.exclude=(t,a)=>{let i={...r.entries};for(let r of t)if(o.has(r))delete i[r];else throw Error(`Key ${r} not found in enum`);return new iT({...r,checks:[],...ek(a),entries:i})}});function ix(t,r){return new iT({type:"enum",entries:Array.isArray(t)?Object.fromEntries(t.map(t=>[t,t])):t,...ek(r)})}let ij=eX("ZodLiteral",(t,r)=>{rV.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>oZ(t,r,o,a),t.values=new Set(r.values),Object.defineProperty(t,"value",{get(){if(r.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function iC(t,r){return new ij({type:"literal",values:Array.isArray(t)?t:[t],...ek(r)})}let iN=eX("ZodTransform",(t,r)=>{aq(),rF.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>oX(t,r,o,a),t._zod.parse=(o,a)=>{if("backward"===a.direction)throw new eQ(t.constructor.name);o.addIssue=a=>{"string"==typeof a?o.issues.push(eV(a,o.value,r)):(a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=o.value),a.inst??(a.inst=t),o.issues.push(eV(a)))};let i=r.transform(o.value,o);return i instanceof Promise?i.then(t=>(o.value=t,o)):(o.value=i,o)}});function iI(t){return new iN({type:"transform",transform:t})}let iA=eX("ZodOptional",(t,r)=>{rK.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>aa(t,r,o,a),t.unwrap=()=>t._zod.def.innerType});function iM(t){return new iA({type:"optional",innerType:t})}let iq=eX("ZodExactOptional",(t,r)=>{rJ.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>aa(t,r,o,a),t.unwrap=()=>t._zod.def.innerType}),iz=eX("ZodNullable",(t,r)=>{rB.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>o5(t,r,o,a),t.unwrap=()=>t._zod.def.innerType});function iL(t){return new iz({type:"nullable",innerType:t})}let iD=eX("ZodDefault",(t,r)=>{rG.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>o7(t,r,o,a),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap}),iU=eX("ZodPrefault",(t,r)=>{rW.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>ae(t,r,o,a),t.unwrap=()=>t._zod.def.innerType}),iV=eX("ZodNonOptional",(t,r)=>{rX.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>o3(t,r,o,a),t.unwrap=()=>t._zod.def.innerType}),iF=eX("ZodCatch",(t,r)=>{r0.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>at(t,r,o,a),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap}),iH=eX("ZodPipe",(t,r)=>{r1.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>ar(t,r,o,a),t.in=r.in,t.out=r.out});function iK(t,r){return new iH({type:"pipe",in:t,out:r})}let iJ=eX("ZodPreprocess",(t,r)=>{iH.init(t,r),r9.init(t,r)}),iB=eX("ZodReadonly",(t,r)=>{r4.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>ao(t,r,o,a),t.unwrap=()=>t._zod.def.innerType}),iG=eX("ZodLazy",(t,r)=>{r3.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>ai(t,r,o,a),t.unwrap=()=>t._zod.def.getter()});function iZ(t){return new iG({type:"lazy",getter:t})}let iW=eX("ZodCustom",(t,r)=>{r6.init(t,r),az.init(t,r),t._zod.processJSONSchema=(r,o,a)=>oW(t,r,o,a)});function iX(t,r){return new iJ({type:"pipe",in:iI(t),out:r})}j||(j={});let iY="2025-11-25",iQ=[iY,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],i0="io.modelcontextprotocol/protocolVersion",i1="io.modelcontextprotocol/clientInfo",i2="io.modelcontextprotocol/serverInfo",i9="io.modelcontextprotocol/clientCapabilities",i4="io.modelcontextprotocol/subscriptionId",i5="io.modelcontextprotocol/logLevel",i3=iZ(()=>i$([aU(),io(),il(),iu(),iO(aU(),i3),ig(i3)])),i6=iO(aU(),i3),i8=ig(i3),i7=i$([aU(),io().int()]),se=aU(),st=ib({ttl:io().optional()}),sr=ib({taskId:aU()}),so=i_({progressToken:i7.optional(),"io.modelcontextprotocol/related-task":sr.optional()}),sa=ib({_meta:so.optional()}),si=sa.extend({task:st.optional()}),ss=ib({method:aU(),params:sa.loose().optional()}),sn=ib({_meta:so.optional()}),sl=ib({method:aU(),params:sn.loose().optional()}),sc=i_({get[i2](){return sE.optional().catch(void 0)}}),su=i_({_meta:sc.optional()}),sd=i$([aU(),io().int()]),sp=ib({jsonrpc:iC("2.0"),id:sd,...ss.shape}).strict(),sh=ib({jsonrpc:iC("2.0"),...sl.shape}).strict(),sf=ib({jsonrpc:iC("2.0"),id:sd,result:su}).strict(),sm=ib({jsonrpc:iC("2.0"),id:sd.optional(),error:ib({code:io().int(),message:aU(),data:ih().optional()})}).strict(),sy=i$([sp,sh,sf,sm]),sg=i$([sf,sm]),sv=su.strict(),sb=sn.extend({requestId:sd.optional(),reason:aU().optional()}),s_=sl.extend({method:iC("notifications/cancelled"),params:sb}),sS=ib({src:aU(),mimeType:aU().optional(),sizes:ig(aU()).optional(),theme:ix(["light","dark"]).optional()}),s$=ib({icons:ig(sS).optional()}),sw=ib({name:aU(),title:aU().optional()}),sE=sw.extend({...sw.shape,...s$.shape,version:aU(),websiteUrl:aU().optional(),description:aU().optional()}),sR=iP(ib({applyDefaults:il().optional()}),i6),sP=iX(t=>t&&"object"==typeof t&&!Array.isArray(t)&&0===Object.keys(t).length?{form:{}}:t,iP(ib({form:sR.optional(),url:i6.optional()}),i6.optional())),sk=i_({list:i6.optional(),cancel:i6.optional(),requests:i_({sampling:i_({createMessage:i6.optional()}).optional(),elicitation:i_({create:i6.optional()}).optional()}).optional()}),sO=i_({list:i6.optional(),cancel:i6.optional(),requests:i_({tools:i_({call:i6.optional()}).optional()}).optional()}),sT=ib({experimental:iO(aU(),i6).optional(),sampling:ib({context:i6.optional(),tools:i6.optional()}).optional(),elicitation:sP.optional(),roots:ib({listChanged:il().optional()}).optional(),tasks:sk.optional(),extensions:iO(aU(),i6).optional()}),sx=sa.extend({protocolVersion:aU(),capabilities:sT,clientInfo:sE}),sj=ss.extend({method:iC("initialize"),params:sx}),sC=ib({experimental:iO(aU(),i6).optional(),logging:i6.optional(),completions:i6.optional(),prompts:ib({listChanged:il().optional()}).optional(),resources:ib({subscribe:il().optional(),listChanged:il().optional()}).optional(),tools:ib({listChanged:il().optional()}).optional(),tasks:sO.optional(),extensions:iO(aU(),i6).optional()}),sN=su.extend({protocolVersion:aU(),capabilities:sC,serverInfo:sE,instructions:aU().optional()}),sI=sl.extend({method:iC("notifications/initialized"),params:sn.optional()}),sA=ss.extend({method:iC("server/discover"),params:sa.optional()}),sM=su.extend({supportedVersions:ig(aU()),capabilities:sC,instructions:aU().optional()}),sq=ss.extend({method:iC("ping"),params:sa.optional()}),sz=ib({progress:io(),total:iM(io()),message:iM(aU())}),sL=ib({...sn.shape,...sz.shape,progressToken:i7}),sD=sl.extend({method:iC("notifications/progress"),params:sL}),sU=sa.extend({cursor:se.optional()}),sV=ss.extend({params:sU.optional()}),sF=su.extend({nextCursor:se.optional()}),sH=ib({uri:aU(),mimeType:iM(aU()),_meta:iO(aU(),ih()).optional()}),sK=sH.extend({text:aU()}),sJ=aU().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),sB=sH.extend({blob:sJ}),sG=ix(["user","assistant"]),sZ=ib({audience:ig(sG).optional(),priority:io().min(0).max(1).optional(),lastModified:oo(aF,{offset:!0}).optional()}),sW=ib({...sw.shape,...s$.shape,uri:aU(),description:iM(aU()),mimeType:iM(aU()),size:iM(io()),annotations:sZ.optional(),_meta:iM(i_({}))}),sX=ib({...sw.shape,...s$.shape,uriTemplate:aU(),description:iM(aU()),mimeType:iM(aU()),annotations:sZ.optional(),_meta:iM(i_({}))}),sY=sV.extend({method:iC("resources/list")}),sQ=sF.extend({resources:ig(sW)}),s0=sV.extend({method:iC("resources/templates/list")}),s1=sF.extend({resourceTemplates:ig(sX)}),s2=sa.extend({uri:aU()}),s9=ss.extend({method:iC("resources/read"),params:s2}),s4=su.extend({contents:ig(i$([sK,sB]))}),s5=sl.extend({method:iC("notifications/resources/list_changed"),params:sn.optional()}),s3=ss.extend({method:iC("resources/subscribe"),params:s2}),s6=ss.extend({method:iC("resources/unsubscribe"),params:s2}),s8=ib({toolsListChanged:il().optional(),promptsListChanged:il().optional(),resourcesListChanged:il().optional(),resourceSubscriptions:ig(aU()).optional()}),s7=sa.extend({notifications:s8}),ne=ss.extend({method:iC("subscriptions/listen"),params:s7}),nt=sn.extend({notifications:s8}),nr=sl.extend({method:iC("notifications/subscriptions/acknowledged"),params:nt}),no=sc.extend({[i4]:sd}),na=su.extend({_meta:no}),ni=sn.extend({uri:aU()}),ns=sl.extend({method:iC("notifications/resources/updated"),params:ni}),nn=ib({name:aU(),description:iM(aU()),required:iM(il())}),nl=ib({...sw.shape,...s$.shape,description:iM(aU()),arguments:iM(ig(nn)),_meta:iM(i_({}))}),nc=sV.extend({method:iC("prompts/list")}),nu=sF.extend({prompts:ig(nl)}),nd=sa.extend({name:aU(),arguments:iO(aU(),aU()).optional()}),np=ss.extend({method:iC("prompts/get"),params:nd}),nh=ib({type:iC("text"),text:aU(),annotations:sZ.optional(),_meta:iO(aU(),ih()).optional()}),nf=ib({type:iC("image"),data:sJ,mimeType:aU(),annotations:sZ.optional(),_meta:iO(aU(),ih()).optional()}),nm=ib({type:iC("audio"),data:sJ,mimeType:aU(),annotations:sZ.optional(),_meta:iO(aU(),ih()).optional()}),ny=ib({type:iC("tool_use"),name:aU(),id:aU(),input:iO(aU(),ih()),_meta:iO(aU(),ih()).optional()}),ng=ib({type:iC("resource"),resource:i$([sK,sB]),annotations:sZ.optional(),_meta:iO(aU(),ih()).optional()}),nv=sW.extend({type:iC("resource_link")}),nb=i$([nh,nf,nm,nv,ng]),n_=ib({role:sG,content:nb}),nS=su.extend({description:aU().optional(),messages:ig(n_)}),n$=sl.extend({method:iC("notifications/prompts/list_changed"),params:sn.optional()}),nw=ib({title:aU().optional(),readOnlyHint:il().optional(),destructiveHint:il().optional(),idempotentHint:il().optional(),openWorldHint:il().optional()}),nE=ib({taskSupport:ix(["required","optional","forbidden"]).optional()}),nR=ib({...sw.shape,...s$.shape,description:aU().optional(),inputSchema:ib({type:iC("object"),properties:iO(aU(),i3).optional(),required:ig(aU()).optional()}).catchall(ih()),outputSchema:i_({$schema:aU().optional()}).optional(),annotations:nw.optional(),execution:nE.optional(),_meta:iO(aU(),ih()).optional()}),nP=sV.extend({method:iC("tools/list")}),nk=sF.extend({tools:ig(nR)}),nO=su.extend({content:ig(nb).default([]),structuredContent:ih().optional(),isError:il().optional()}),nT=nO.or(su.extend({toolResult:ih()})),nx=si.extend({name:aU(),arguments:iO(aU(),ih()).optional()}),nj=ss.extend({method:iC("tools/call"),params:nx}),nC=sl.extend({method:iC("notifications/tools/list_changed"),params:sn.optional()}),nN=ib({autoRefresh:il().default(!0),debounceMs:io().int().nonnegative().default(300)}),nI=ix(["debug","info","notice","warning","error","critical","alert","emergency"]),nA=sa.extend({level:nI}),nM=ss.extend({method:iC("logging/setLevel"),params:nA}),nq=sn.extend({level:nI,logger:aU().optional(),data:ih()}),nz=sl.extend({method:iC("notifications/message"),params:nq}),nL=ib({name:aU().optional()}),nD=ib({hints:ig(nL).optional(),costPriority:io().min(0).max(1).optional(),speedPriority:io().min(0).max(1).optional(),intelligencePriority:io().min(0).max(1).optional()}),nU=ib({mode:ix(["auto","required","none"]).optional()}),nV=ib({type:iC("tool_result"),toolUseId:aU().describe("The unique identifier for the corresponding tool call."),content:ig(nb),structuredContent:ih().optional(),isError:il().optional(),_meta:iO(aU(),ih()).optional()}),nF=iE("type",[nh,nf,nm]),nH=iE("type",[nh,nf,nm,ny,nV]),nK=ib({role:sG,content:i$([nH,ig(nH)]),_meta:iO(aU(),ih()).optional()}),nJ=si.extend({messages:ig(nK),modelPreferences:nD.optional(),systemPrompt:aU().optional(),includeContext:ix(["none","thisServer","allServers"]).optional(),temperature:io().optional(),maxTokens:io().int(),stopSequences:ig(aU()).optional(),metadata:i6.optional(),tools:ig(nR).optional(),toolChoice:nU.optional()}),nB=ss.extend({method:iC("sampling/createMessage"),params:nJ}),nG=su.extend({model:aU(),stopReason:iM(ix(["endTurn","stopSequence","maxTokens"]).or(aU())),role:sG,content:nF}),nZ=su.extend({model:aU(),stopReason:iM(ix(["endTurn","stopSequence","maxTokens","toolUse"]).or(aU())),role:sG,content:i$([nH,ig(nH)])}),nW=ib({type:iC("boolean"),title:aU().optional(),description:aU().optional(),default:il().optional()}),nX=ib({type:iC("string"),title:aU().optional(),description:aU().optional(),minLength:io().optional(),maxLength:io().optional(),format:ix(["email","uri","date","date-time"]).optional(),default:aU().optional()}),nY=ib({type:ix(["number","integer"]),title:aU().optional(),description:aU().optional(),minimum:io().optional(),maximum:io().optional(),default:io().optional()}),nQ=ib({type:iC("string"),title:aU().optional(),description:aU().optional(),enum:ig(aU()),default:aU().optional()}),n0=ib({type:iC("string"),title:aU().optional(),description:aU().optional(),oneOf:ig(ib({const:aU(),title:aU()})),default:aU().optional()}),n1=ib({type:iC("string"),title:aU().optional(),description:aU().optional(),enum:ig(aU()),enumNames:ig(aU()).optional(),default:aU().optional()}),n2=i$([nQ,n0]),n9=ib({type:iC("array"),title:aU().optional(),description:aU().optional(),minItems:io().optional(),maxItems:io().optional(),items:ib({type:iC("string"),enum:ig(aU())}),default:ig(aU()).optional()}),n4=ib({type:iC("array"),title:aU().optional(),description:aU().optional(),minItems:io().optional(),maxItems:io().optional(),items:ib({anyOf:ig(ib({const:aU(),title:aU()}))}),default:ig(aU()).optional()}),n5=i$([n9,n4]),n3=i$([n1,n2,n5]),n6=i$([n3,nW,nX,nY]),n8=si.extend({mode:iC("form").optional(),message:aU(),requestedSchema:ib({type:iC("object"),properties:iO(aU(),n6),required:ig(aU()).optional()}).catchall(ih())}),n7=si.extend({mode:iC("url"),message:aU(),elicitationId:aU(),url:aU().url()}),le=i$([n8,n7]),lt=ss.extend({method:iC("elicitation/create"),params:le}),lr=sn.extend({elicitationId:aU()}),lo=sl.extend({method:iC("notifications/elicitation/complete"),params:lr}),la=su.extend({action:ix(["accept","decline","cancel"]),content:iX(t=>null===t?void 0:t,iO(aU(),i$([aU(),io(),il(),ig(aU())])).optional())}),li=ib({type:iC("ref/resource"),uri:aU()}),ls=ib({type:iC("ref/prompt"),name:aU()}),ln=sa.extend({ref:i$([ls,li]),argument:ib({name:aU(),value:aU()}),context:ib({arguments:iO(aU(),aU()).optional()}).optional()}),ll=ss.extend({method:iC("completion/complete"),params:ln}),lc=su.extend({completion:i_({values:ig(aU()).max(100),total:iM(io().int()),hasMore:iM(il())})}),lu=ib({uri:aU().startsWith("file://"),name:aU().optional(),_meta:iO(aU(),ih()).optional()}),ld=ss.extend({method:iC("roots/list"),params:sa.optional()}),lp=su.extend({roots:ig(lu)}),lh=sl.extend({method:iC("notifications/roots/list_changed"),params:sn.optional()}),lf=i_({ttl:io().optional(),pollInterval:io().optional()}),lm=ix(["working","input_required","completed","failed","cancelled"]),ly=ib({taskId:aU(),status:lm,ttl:i$([io(),iu()]),createdAt:aU(),lastUpdatedAt:aU(),pollInterval:iM(io()),statusMessage:iM(aU())}),lg=su.extend({task:ly}),lv=sn.merge(ly),lb=sl.extend({method:iC("notifications/tasks/status"),params:lv}),l_=ss.extend({method:iC("tasks/get"),params:sa.extend({taskId:aU()})}),lS=su.merge(ly),l$=ss.extend({method:iC("tasks/result"),params:sa.extend({taskId:aU()})}),lw=su.loose(),lE=sV.extend({method:iC("tasks/list")}),lR=sF.extend({tasks:ig(ly)}),lP=ss.extend({method:iC("tasks/cancel"),params:sa.extend({taskId:aU()})}),lk=su.merge(ly),lO=i$([sq,sj,sA,ll,nM,np,nc,sY,s0,s9,s3,s6,ne,nj,nP]),lT=i$([s_,sD,sI,lh]),lx=i$([sv,nG,nZ,la,lp]),lj=i$([sq,nB,lt,ld]),lC=i$([s_,sD,nz,ns,s5,nC,n$,nr,lo]),lN=i$([sv,sN,sM,lc,nS,nu,sQ,s1,s4,nO,nk,na]),lI=or(aW,void 0).superRefine((t,r)=>{if(!URL.canParse(t))return r.addIssue({code:"custom",message:"URL must be parseable",fatal:!0}),eG}).refine(t=>{let r=new URL(t);return"javascript:"!==r.protocol&&"data:"!==r.protocol&&"vbscript:"!==r.protocol},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),lA=i_({resource:aU().url(),authorization_servers:ig(lI).optional(),jwks_uri:aU().url().optional(),scopes_supported:ig(aU()).optional(),bearer_methods_supported:ig(aU()).optional(),resource_signing_alg_values_supported:ig(aU()).optional(),resource_name:aU().optional(),resource_documentation:aU().optional(),resource_policy_uri:aU().url().optional(),resource_tos_uri:aU().url().optional(),tls_client_certificate_bound_access_tokens:il().optional(),authorization_details_types_supported:ig(aU()).optional(),dpop_signing_alg_values_supported:ig(aU()).optional(),dpop_bound_access_tokens_required:il().optional()}),lM=i_({issuer:aU(),authorization_endpoint:lI,token_endpoint:lI,registration_endpoint:lI.optional(),scopes_supported:ig(aU()).optional(),response_types_supported:ig(aU()),response_modes_supported:ig(aU()).optional(),grant_types_supported:ig(aU()).optional(),token_endpoint_auth_methods_supported:ig(aU()).optional(),token_endpoint_auth_signing_alg_values_supported:ig(aU()).optional(),service_documentation:lI.optional(),revocation_endpoint:lI.optional(),revocation_endpoint_auth_methods_supported:ig(aU()).optional(),revocation_endpoint_auth_signing_alg_values_supported:ig(aU()).optional(),introspection_endpoint:aU().optional(),introspection_endpoint_auth_methods_supported:ig(aU()).optional(),introspection_endpoint_auth_signing_alg_values_supported:ig(aU()).optional(),code_challenge_methods_supported:ig(aU()).optional(),client_id_metadata_document_supported:il().optional(),authorization_response_iss_parameter_supported:il().optional().catch(void 0)}),lq=i_({issuer:aU(),authorization_endpoint:lI,token_endpoint:lI,userinfo_endpoint:lI.optional(),jwks_uri:lI,registration_endpoint:lI.optional(),scopes_supported:ig(aU()).optional(),response_types_supported:ig(aU()),response_modes_supported:ig(aU()).optional(),grant_types_supported:ig(aU()).optional(),acr_values_supported:ig(aU()).optional(),subject_types_supported:ig(aU()),id_token_signing_alg_values_supported:ig(aU()),id_token_encryption_alg_values_supported:ig(aU()).optional(),id_token_encryption_enc_values_supported:ig(aU()).optional(),userinfo_signing_alg_values_supported:ig(aU()).optional(),userinfo_encryption_alg_values_supported:ig(aU()).optional(),userinfo_encryption_enc_values_supported:ig(aU()).optional(),request_object_signing_alg_values_supported:ig(aU()).optional(),request_object_encryption_alg_values_supported:ig(aU()).optional(),request_object_encryption_enc_values_supported:ig(aU()).optional(),token_endpoint_auth_methods_supported:ig(aU()).optional(),token_endpoint_auth_signing_alg_values_supported:ig(aU()).optional(),display_values_supported:ig(aU()).optional(),claim_types_supported:ig(aU()).optional(),claims_supported:ig(aU()).optional(),service_documentation:aU().optional(),claims_locales_supported:ig(aU()).optional(),ui_locales_supported:ig(aU()).optional(),claims_parameter_supported:il().optional(),request_parameter_supported:il().optional(),request_uri_parameter_supported:il().optional(),require_request_uri_registration:il().optional(),op_policy_uri:lI.optional(),op_tos_uri:lI.optional(),client_id_metadata_document_supported:il().optional(),authorization_response_iss_parameter_supported:il().optional().catch(void 0)}),lz=ib({...lq.shape,...lM.pick({code_challenge_methods_supported:!0}).shape}),lL=ib({access_token:aU(),id_token:aU().optional(),token_type:aU(),expires_in:new ir(oe({type:"number",coerce:!0,checks:[],...ek(void 0)})).optional(),scope:aU().optional(),refresh_token:aU().optional()}).strip(),lD=ib({issued_token_type:iC("urn:ietf:params:oauth:token-type:id-jag"),access_token:aU(),token_type:aU().optional(),expires_in:io().optional(),scope:aU().optional()}).strip(),lU=ib({error:aU(),error_description:aU().optional(),error_uri:aU().optional()}),lV=lI.optional().or(iC("").transform(()=>void 0)),lF=ib({redirect_uris:ig(lI),token_endpoint_auth_method:aU().optional(),grant_types:ig(aU()).optional(),response_types:ig(aU()).optional(),application_type:aU().optional(),client_name:aU().optional(),client_uri:lI.optional(),logo_uri:lV,scope:aU().optional(),contacts:ig(aU()).optional(),tos_uri:lV,policy_uri:aU().optional(),jwks_uri:lI.optional(),jwks:new id({type:"any"}).optional(),software_id:aU().optional(),software_version:aU().optional(),software_statement:aU().optional()}).strip(),lH=ib({client_id:aU(),client_secret:aU().optional(),client_id_issued_at:io().optional(),client_secret_expires_at:io().optional()}).strip(),lK=lF.merge(lH),lJ=ib({error:aU(),error_description:aU().optional()}).strip(),lB=ib({token:aU(),token_type_hint:aU().optional()}).strip(),lG=Symbol.for("mcp.sdk.errorBrands");function lZ(t,r){let o=new Set,a=r;for(;"function"==typeof a;){let t=a.mcpBrand;Object.prototype.hasOwnProperty.call(a,"mcpBrand")&&"string"==typeof t&&o.add(t),a=Object.getPrototypeOf(a)}0!==o.size&&Object.defineProperty(t,lG,{value:o,enumerable:!1,configurable:!0})}function lW(t,r){try{if("object"==typeof r&&null!==r&&Object.prototype.hasOwnProperty.call(t,"mcpBrand")&&"string"==typeof t.mcpBrand&&Object.prototype.hasOwnProperty.call(r,lG)){let o=r[lG];if(o&&"function"==typeof o.has&&o.has(t.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(t,r)}(class t extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return lW(this,t)}static isInstance(t){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return lW(this,t)}constructor(t,r,o){super(r),this.code=t,this.errorUri=o,this.name="OAuthError",lZ(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}static fromResponse(r){return new t(r.error,r.error_description??r.error,r.error_uri)}});($={}).NotConnected="NOT_CONNECTED",$.AlreadyConnected="ALREADY_CONNECTED",$.NotInitialized="NOT_INITIALIZED",$.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",$.RequestTimeout="REQUEST_TIMEOUT",$.ConnectionClosed="CONNECTION_CLOSED",$.SendFailed="SEND_FAILED",$.InvalidResult="INVALID_RESULT",$.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",$.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",$.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",$.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",$.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",$.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",$.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",$.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",$.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",$.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",$.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION";var lX=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](t){return lW(this,t)}static isInstance(t){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return lW(this,t)}constructor(t,r,o){super(r),this.code=t,this.data=o,this.name="SdkError",lZ(this,new.target)}};(class extends lX{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(t,r,o){super(t,r,o),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}});let lY={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},lQ={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null};Object.keys(lY),Object.keys(lQ);Symbol("modelcontextprotocol.resultCacheHintFallback");let l0=((w={})[w.ParseError=-32700]="ParseError",w[w.InvalidRequest=-32600]="InvalidRequest",w[w.MethodNotFound=-32601]="MethodNotFound",w[w.InvalidParams=-32602]="InvalidParams",w[w.InternalError=-32603]="InternalError",w[w.ResourceNotFound=-32002]="ResourceNotFound",w[w.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",w[w.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",w[w.UrlElicitationRequired=-32042]="UrlElicitationRequired",w);var l1=class t extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return lW(this,t)}static isInstance(t){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return lW(this,t)}constructor(t,r,o){super(r),this.code=t,this.data=o,this.name="ProtocolError",lZ(this,new.target)}static fromError(r,o,a){return r===l0.UrlElicitationRequired&&a&&a.elicitations?new l9(a.elicitations,o):r===l0.UnsupportedProtocolVersion&&a&&Array.isArray(a.supported)&&"string"==typeof a.requested?new l4({supported:a.supported,requested:a.requested},o):(r===l0.InvalidParams||r===l0.ResourceNotFound)&&"string"==typeof a?.uri&&(r===l0.ResourceNotFound||1===Object.keys(a).length)?new l2(a.uri,o):r===l0.MissingRequiredClientCapability&&a&&null!==a.requiredCapabilities&&"object"==typeof a.requiredCapabilities&&!Array.isArray(a.requiredCapabilities)?new l5({requiredCapabilities:a.requiredCapabilities},o):new t(r,o,a)}},l2=class extends l1{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(t,r=`Resource not found: ${t}`){super(l0.InvalidParams,r,{uri:t})}get uri(){return this.data.uri}},l9=class extends l1{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(l0.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}},l4=class extends l1{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(t,r=`Unsupported protocol version: ${t.requested}`){super(l0.UnsupportedProtocolVersion,r,t)}get supported(){return this.data.supported}get requested(){return this.data.requested}},l5=class extends l1{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(t,r=`Missing required client capabilities: ${Object.keys(t.requiredCapabilities).join(", ")}`){super(l0.MissingRequiredClientCapability,r,t)}get requiredCapabilities(){return this.data.requiredCapabilities}};let l3={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},l6={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};Object.keys(l3),Object.keys(l6);var l8=((t,r)=>{let o={};for(var a in t)Q(o,a,{get:t[a],enumerable:!0});return r&&Q(o,Symbol.toStringTag,{value:"Module"}),o})({AnnotationsSchema:()=>sZ,AudioContentSchema:()=>nm,BaseMetadataSchema:()=>sw,BaseRequestParamsSchema:()=>sa,BlobResourceContentsSchema:()=>sB,BooleanSchemaSchema:()=>nW,CallToolRequestParamsSchema:()=>nx,CallToolRequestSchema:()=>nj,CallToolResultSchema:()=>nO,CancelTaskRequestSchema:()=>lP,CancelTaskResultSchema:()=>lk,CancelledNotificationParamsSchema:()=>sb,CancelledNotificationSchema:()=>s_,ClientCapabilitiesSchema:()=>sT,ClientNotificationSchema:()=>lT,ClientRequestSchema:()=>lO,ClientResultSchema:()=>lx,ClientTasksCapabilitySchema:()=>sk,CompatibilityCallToolResultSchema:()=>nT,CompleteRequestParamsSchema:()=>ln,CompleteRequestSchema:()=>ll,CompleteResultSchema:()=>lc,ContentBlockSchema:()=>nb,CreateMessageRequestParamsSchema:()=>nJ,CreateMessageRequestSchema:()=>nB,CreateMessageResultSchema:()=>nG,CreateMessageResultWithToolsSchema:()=>nZ,CreateTaskResultSchema:()=>lg,CursorSchema:()=>se,DiscoverRequestSchema:()=>sA,DiscoverResultSchema:()=>sM,ElicitRequestFormParamsSchema:()=>n8,ElicitRequestParamsSchema:()=>le,ElicitRequestSchema:()=>lt,ElicitRequestURLParamsSchema:()=>n7,ElicitResultSchema:()=>la,ElicitationCompleteNotificationParamsSchema:()=>lr,ElicitationCompleteNotificationSchema:()=>lo,EmbeddedResourceSchema:()=>ng,EmptyResultSchema:()=>sv,EnumSchemaSchema:()=>n3,GetPromptRequestParamsSchema:()=>nd,GetPromptRequestSchema:()=>np,GetPromptResultSchema:()=>nS,GetTaskPayloadRequestSchema:()=>l$,GetTaskPayloadResultSchema:()=>lw,GetTaskRequestSchema:()=>l_,GetTaskResultSchema:()=>lS,IconSchema:()=>sS,IconsSchema:()=>s$,ImageContentSchema:()=>nf,ImplementationSchema:()=>sE,InitializeRequestParamsSchema:()=>sx,InitializeRequestSchema:()=>sj,InitializeResultSchema:()=>sN,InitializedNotificationSchema:()=>sI,JSONArraySchema:()=>i8,JSONObjectSchema:()=>i6,JSONRPCErrorResponseSchema:()=>sm,JSONRPCMessageSchema:()=>sy,JSONRPCNotificationSchema:()=>sh,JSONRPCRequestSchema:()=>sp,JSONRPCResponseSchema:()=>sg,JSONRPCResultResponseSchema:()=>sf,JSONValueSchema:()=>i3,LegacyTitledEnumSchemaSchema:()=>n1,ListChangedOptionsBaseSchema:()=>nN,ListPromptsRequestSchema:()=>nc,ListPromptsResultSchema:()=>nu,ListResourceTemplatesRequestSchema:()=>s0,ListResourceTemplatesResultSchema:()=>s1,ListResourcesRequestSchema:()=>sY,ListResourcesResultSchema:()=>sQ,ListRootsRequestSchema:()=>ld,ListRootsResultSchema:()=>lp,ListTasksRequestSchema:()=>lE,ListTasksResultSchema:()=>lR,ListToolsRequestSchema:()=>nP,ListToolsResultSchema:()=>nk,LoggingLevelSchema:()=>nI,LoggingMessageNotificationParamsSchema:()=>nq,LoggingMessageNotificationSchema:()=>nz,ModelHintSchema:()=>nL,ModelPreferencesSchema:()=>nD,MultiSelectEnumSchemaSchema:()=>n5,NotificationSchema:()=>sl,NotificationsParamsSchema:()=>sn,NumberSchemaSchema:()=>nY,PaginatedRequestParamsSchema:()=>sU,PaginatedRequestSchema:()=>sV,PaginatedResultSchema:()=>sF,PingRequestSchema:()=>sq,PrimitiveSchemaDefinitionSchema:()=>n6,ProgressNotificationParamsSchema:()=>sL,ProgressNotificationSchema:()=>sD,ProgressSchema:()=>sz,ProgressTokenSchema:()=>i7,PromptArgumentSchema:()=>nn,PromptListChangedNotificationSchema:()=>n$,PromptMessageSchema:()=>n_,PromptReferenceSchema:()=>ls,PromptSchema:()=>nl,ReadResourceRequestParamsSchema:()=>s2,ReadResourceRequestSchema:()=>s9,ReadResourceResultSchema:()=>s4,RelatedTaskMetadataSchema:()=>sr,RequestIdSchema:()=>sd,RequestMetaSchema:()=>so,RequestSchema:()=>ss,ResourceContentsSchema:()=>sH,ResourceLinkSchema:()=>nv,ResourceListChangedNotificationSchema:()=>s5,ResourceRequestParamsSchema:()=>s2,ResourceSchema:()=>sW,ResourceTemplateReferenceSchema:()=>li,ResourceTemplateSchema:()=>sX,ResourceUpdatedNotificationParamsSchema:()=>ni,ResourceUpdatedNotificationSchema:()=>ns,ResultMetaObjectSchema:()=>sc,ResultSchema:()=>su,RoleSchema:()=>sG,RootSchema:()=>lu,RootsListChangedNotificationSchema:()=>lh,SamplingContentSchema:()=>nF,SamplingMessageContentBlockSchema:()=>nH,SamplingMessageSchema:()=>nK,ServerCapabilitiesSchema:()=>sC,ServerNotificationSchema:()=>lC,ServerRequestSchema:()=>lj,ServerResultSchema:()=>lN,ServerTasksCapabilitySchema:()=>sO,SetLevelRequestParamsSchema:()=>nA,SetLevelRequestSchema:()=>nM,SingleSelectEnumSchemaSchema:()=>n2,StringSchemaSchema:()=>nX,SubscribeRequestParamsSchema:()=>s2,SubscribeRequestSchema:()=>s3,SubscriptionFilterSchema:()=>s8,SubscriptionsAcknowledgedNotificationParamsSchema:()=>nt,SubscriptionsAcknowledgedNotificationSchema:()=>nr,SubscriptionsListenRequestParamsSchema:()=>s7,SubscriptionsListenRequestSchema:()=>ne,SubscriptionsListenResultMetaSchema:()=>no,SubscriptionsListenResultSchema:()=>na,TaskAugmentedRequestParamsSchema:()=>si,TaskCreationParamsSchema:()=>lf,TaskMetadataSchema:()=>st,TaskSchema:()=>ly,TaskStatusNotificationParamsSchema:()=>lv,TaskStatusNotificationSchema:()=>lb,TaskStatusSchema:()=>lm,TextContentSchema:()=>nh,TextResourceContentsSchema:()=>sK,TitledMultiSelectEnumSchemaSchema:()=>n4,TitledSingleSelectEnumSchemaSchema:()=>n0,ToolAnnotationsSchema:()=>nw,ToolChoiceSchema:()=>nU,ToolExecutionSchema:()=>nE,ToolListChangedNotificationSchema:()=>nC,ToolResultContentSchema:()=>nV,ToolSchema:()=>nR,ToolUseContentSchema:()=>ny,UnsubscribeRequestParamsSchema:()=>s2,UnsubscribeRequestSchema:()=>s6,UntitledMultiSelectEnumSchemaSchema:()=>n9,UntitledSingleSelectEnumSchemaSchema:()=>nQ});let l7=t=>"object"==typeof t&&null!==t&&!Array.isArray(t)&&"input_required"===t.resultType;function ce(t){return new Set(t.flatMap(t=>Object.keys(t.shape)))}function ct(t){if(null==t)return!1;let r=typeof t;return("object"===r||"function"===r)&&"~standard"in t&&"function"==typeof t["~standard"]?.validate}l0.InvalidRequest,l0.UnsupportedProtocolVersion,l0.InvalidParams,l0.MethodNotFound,l0.InvalidParams,l0.MissingRequiredClientCapability,l0.ParseError,l0.InvalidRequest,l0.MethodNotFound,l0.UnsupportedProtocolVersion,l0.MissingRequiredClientCapability;let cr=!1,co="draft-2020-12",ca=/\\\.\\d\{(\d+)\}/;function ci(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}let cs=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function cn(t){return cs.has(t)||t.startsWith("x-")}let cl=new Set(["$schema",...Object.keys(n8.shape.requestedSchema.shape)]),cc={string:ce([nX,nQ,n0,n1]),number:ce([nY]),integer:ce([nY]),boolean:ce([nW]),array:ce([n9,n4])},cu=new Set(nX.shape.format.unwrap().options),cd=Object.assign(function(t){let r=void 0!==t.inputRequests&&Object.keys(t.inputRequests).length>0,o="string"==typeof t.requestState;if(!r&&!o)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...void 0!==t.inputRequests&&{inputRequests:t.inputRequests},...void 0!==t.requestState&&{requestState:t.requestState}}},{elicit(t){try{return{method:"elicitation/create",params:function(t){var r;if(!ct(t.requestedSchema))return{...t,mode:"form",requestedSchema:t.requestedSchema};let o=t.requestedSchema["~standard"].vendor,a=function(t,r){let o={},a=[];for(let[i,s]of Object.entries(t))"properties"===i&&ci(s)?o[i]=Object.fromEntries(Object.entries(s).map(([t,o])=>[t,function(t,r,o,a){if(!ci(t))return t;let i="string"==typeof t.type&&Object.hasOwn(cc,t.type)?cc[t.type]:void 0;if(void 0===i)return t;let s={};for(let[l,c]of Object.entries(t))if(i.has(l)||cn(l))s[l]=c;else if("pattern"===l&&"string"===t.type&&"string"==typeof t.format)if(cu.has(t.format)){var n;"string"==typeof c&&(n=t.format,"zod"!==o||(function(t,r){let o;switch(t){case"email":o=[ot(aB,void 0)];break;case"uri":o=[or(aW,void 0)];break;case"date":o=[oa(aH,void 0)];break;case"date-time":let a,i;a=ca.exec(r),i=[void 0,-1,0],a&&i.push(Number(a[1])),o=[!1,!0].flatMap(t=>[!1,!0].flatMap(r=>i.map(o=>oo(aF,{local:t,offset:r,precision:o}))))}return new Set(o.map(t=>{let r;return r=an(t,{target:co,io:"input"}),"string"==typeof r.pattern?r.pattern:void 0}).filter(t=>void 0!==t))})(n,c).has(c))||a.push(`${r}.${l}`)}else s[l]=c;else a.push(`${r}.${l}`);return s}(o,`properties.${t}`,r,a)])):cl.has(i)?o[i]=s:cn(i)||a.push(i);if(a.length>0)throw new l1(l0.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${a.join(", ")}`);return o}(function(t){try{return function(t,r="input"){let o,a=t["~standard"];if(a.jsonSchema)o=a.jsonSchema[r]({target:co});else if("zod"===a.vendor){if(!("_zod"in t))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");cr||(cr=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),o=an(t,{target:co,io:r})}else throw Error(`Schema library "${a.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if("output"===r)return void 0!==o.type||!function t(r){if("properties"in r||"patternProperties"in r||"additionalProperties"in r||"required"in r)return!0;for(let o of["oneOf","anyOf","allOf"]){let a=r[o];if(Array.isArray(a)&&a.length>0)return a.every(r=>null!==r&&"object"==typeof r&&("object"===r.type||t(r)))}return!1}(o)?o:{type:"object",...o};if(void 0!==o.type&&"object"!==o.type)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(o.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...o}}(t,"input")}catch(r){let t=r instanceof Error?r.message:String(r);throw new l1(l0.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}(t.requestedSchema),o),i=(r=n8.shape.requestedSchema,ak(r,a));if(!i.success)throw new l1(l0.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${function(t,r){if(!ci(t.properties))return r;let o=Object.entries(t.properties).filter(([,t])=>!ak(n6,t).success).map(([t])=>`properties.${t}`);return o.length>0?o.join(", "):r}(a,i.error.message)}`);let s=function t(r,o,a=""){return Array.isArray(r)&&Array.isArray(o)?r.flatMap((r,i)=>t(r,o[i],`${a}[${i}]`)):ci(r)&&ci(o)?Object.entries(r).flatMap(([r,i])=>{let s=a?`${a}.${r}`:r;return Object.prototype.hasOwnProperty.call(o,r)?t(i,o[r],s):cn(r)?[]:[s]}):[]}(a,i.data);if(s.length>0)throw new l1(l0.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${s.join(", ")}`);let n=(i.data.required??[]).filter(t=>!Object.prototype.hasOwnProperty.call(i.data.properties,t));if(n.length>0)throw new l1(l0.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${n.join(", ")}`);return{...t,mode:"form",requestedSchema:i.data}}(t)}}catch(t){throw t instanceof l1?TypeError(t.message,{cause:t}):t}},elicitUrl:t=>({method:"elicitation/create",params:{...t,mode:"url"}}),createMessage:t=>({method:"sampling/createMessage",params:t}),listRoots:()=>({method:"roots/list"})});function cp(t,r,o){let a=ch(t,r);if("elicit"!==a.kind||"accept"!==a.action||void 0===a.content)return;if(void 0===o)return a.content;let i=o["~standard"].validate(a.content);if(i instanceof Promise)throw TypeError("acceptedContent(responses, key, schema) requires a synchronously-validating schema");return void 0===i.issues?i.value:void 0}function ch(t,r){if(void 0===t||"object"!=typeof t||null===t)return{kind:"missing"};let o=t[r];if(null===o||"object"!=typeof o||Array.isArray(o))return{kind:"missing"};if("accept"===o.action||"decline"===o.action||"cancel"===o.action){let t=o.content;return{kind:"elicit",action:o.action,...null!==t&&"object"==typeof t&&!Array.isArray(t)&&{content:t}}}return Array.isArray(o.roots)?{kind:"roots",roots:o.roots}:"string"==typeof o.role&&void 0!==o.content?{kind:"sampling",result:o}:{kind:"missing"}}let cf={},cm={};function cy(t,r){let o=t.slice(0,-6);cf[o]=r,cm[o]=t=>r.safeParse(t).success}for(let t of["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"])cy(t,l8[t]);for(let[t,r]of Object.entries({IdJagTokenExchangeResponseSchema:lD,OAuthClientInformationFullSchema:lK,OAuthClientInformationSchema:lH,OAuthClientMetadataSchema:lF,OAuthClientRegistrationErrorSchema:lJ,OAuthErrorResponseSchema:lU,OAuthMetadataSchema:lM,OAuthProtectedResourceMetadataSchema:lA,OAuthTokenRevocationRequestSchema:lB,OAuthTokensSchema:lL,OpenIdProviderDiscoveryMetadataSchema:lz,OpenIdProviderMetadataSchema:lq}))cy(t,r);Object.freeze(cf),Object.freeze(cm);E=void 0,()=>E;ea(t=>{var r=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,o=/\\([\u000b\u0020-\u00ff])/g,a=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function i(t){this.parameters=Object.create(null),this.type=t}t.parse=function(t){if(!t)throw TypeError("argument string is required");var s,n,l,c="object"==typeof t?function(t){var r;if("function"==typeof t.getHeader?r=t.getHeader("content-type"):"object"==typeof t.headers&&(r=t.headers&&t.headers["content-type"]),"string"!=typeof r)throw TypeError("content-type header is missing from object");return r}(t):t;if("string"!=typeof c)throw TypeError("argument string is required to be a string");var u=c.indexOf(";"),d=-1!==u?c.slice(0,u).trim():c.trim();if(!a.test(d))throw TypeError("invalid media type");var p=new i(d.toLowerCase());if(-1!==u){for(r.lastIndex=u;n=r.exec(c);){if(n.index!==u)throw TypeError("invalid parameter format");u+=n[0].length,s=n[1].toLowerCase(),34===(l=n[2]).charCodeAt(0)&&-1!==(l=l.slice(1,-1)).indexOf("\\")&&(l=l.replace(o,"$1")),p.parameters[s]=l}if(u!==c.length)throw TypeError("invalid parameter format")}return p}})();var cg=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;var r=class{};t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var o=class extends r{constructor(r){if(super(),!t.IDENTIFIER.test(r))throw Error("CodeGen: name must be a valid identifier");this.str=r}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};t.Name=o;var a=class extends r{constructor(t){super(),this._items="string"==typeof t?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return""===t||'""'===t}get str(){var t;return null!=(t=this._str)?t:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var t;return null!=(t=this._names)?t:this._names=this._items.reduce((t,r)=>(r instanceof o&&(t[r.str]=(t[r.str]||0)+1),t),{})}};function i(t,...r){let o=[t[0]],s=0;for(;s<r.length;)l(o,r[s]),o.push(t[++s]);return new a(o)}t._Code=a,t.nil=new a(""),t._=i;let s=new a("+");function n(t,...r){let i=[c(t[0])],u=0;for(;u<r.length;)i.push(s),l(i,r[u]),i.push(s,c(t[++u]));return function(t){let r=1;for(;r<t.length-1;){if(t[r]===s){var a,i;let s=(a=t[r-1],'""'===(i=t[r+1])?a:'""'===a?i:"string"==typeof a?i instanceof o||'"'!==a[a.length-1]?void 0:"string"!=typeof i?`${a.slice(0,-1)}${i}"`:'"'===i[0]?a.slice(0,-1)+i.slice(1):void 0:"string"!=typeof i||'"'!==i[0]||a instanceof o?void 0:`"${a}${i.slice(1)}`);if(void 0!==s){t.splice(r-1,3,s);continue}t[r++]="+"}r++}}(i),new a(i)}function l(t,r){var i;r instanceof a?t.push(...r._items):r instanceof o?t.push(r):t.push("number"==typeof(i=r)||"boolean"==typeof i||null===i?i:c(Array.isArray(i)?i.join(","):i))}function c(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=n,t.addCodeArg=l,t.strConcat=function(t,r){return r.emptyStr()?t:t.emptyStr()?r:n`${t}${r}`},t.stringify=function(t){return new a(c(t))},t.safeStringify=c,t.getProperty=function(r){return"string"==typeof r&&t.IDENTIFIER.test(r)?new a(`.${r}`):i`[${r}]`},t.getEsmExportName=function(r){if("string"==typeof r&&t.IDENTIFIER.test(r))return new a(`${r}`);throw Error(`CodeGen: invalid export name: ${r}, use explicit $id name mapping`)},t.regexpCode=function(t){return new a(t.toString())}}),cv=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;let r=cg();var o,a,i=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}};(o=a||(t.UsedValueState=a={}))[o.Started=0]="Started",o[o.Completed=1]="Completed",t.varKinds={const:new r.Name("const"),let:new r.Name("let"),var:new r.Name("var")};var s=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof r.Name?t:this.name(t)}name(t){return new r.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,o;if((null==(o=null==(r=this._parent)?void 0:r._prefixes)?void 0:o.has(t))||this._prefixes&&!this._prefixes.has(t))throw Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};t.Scope=s;var n=class extends r.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:o,itemIndex:a}){this.value=t,this.scopePath=(0,r._)`.${new r.Name(o)}[${a}]`}};t.ValueScopeName=n;let l=(0,r._)`\n`;var c=class extends s{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?l:r.nil}}get(){return this._scope}name(t){return new n(t,this._newName(t))}value(t,r){var o;if(void 0===r.ref)throw Error("CodeGen: ref must be passed in value");let a=this.toName(t),{prefix:i}=a,s=null!=(o=r.key)?o:r.ref,n=this._values[i];if(n){let t=n.get(s);if(t)return t}else n=this._values[i]=new Map;n.set(s,a);let l=this._scope[i]||(this._scope[i]=[]),c=l.length;return l[c]=r.ref,a.setValue(r,{property:i,itemIndex:c}),a}getValue(t,r){let o=this._values[t];if(o)return o.get(r)}scopeRefs(t,o=this._values){return this._reduceValues(o,o=>{if(void 0===o.scopePath)throw Error(`CodeGen: name "${o}" has no value`);return(0,r._)`${t}${o.scopePath}`})}scopeCode(t=this._values,r,o){return this._reduceValues(t,t=>{if(void 0===t.value)throw Error(`CodeGen: name "${t}" has no value`);return t.value.code},r,o)}_reduceValues(o,s,n={},l){let c=r.nil;for(let u in o){let d=o[u];if(!d)continue;let p=n[u]=n[u]||new Map;d.forEach(o=>{if(p.has(o))return;p.set(o,a.Started);let n=s(o);if(n){let a=this.opts.es5?t.varKinds.var:t.varKinds.const;c=(0,r._)`${c}${a} ${o} = ${n};${this.opts._n}`}else if(n=null==l?void 0:l(o))c=(0,r._)`${c}${n}${this.opts._n}`;else throw new i(o);p.set(o,a.Completed)})}return c}};t.ValueScope=c}),cb=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;let r=cg(),o=cv();var a=cg();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return a._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return a.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return a.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return a.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return a.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return a.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return a.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return a.Name}});var i=cv();Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),t.operators={GT:new r._Code(">"),GTE:new r._Code(">="),LT:new r._Code("<"),LTE:new r._Code("<="),EQ:new r._Code("==="),NEQ:new r._Code("!=="),NOT:new r._Code("!"),OR:new r._Code("||"),AND:new r._Code("&&"),ADD:new r._Code("+")};var s=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},n=class extends s{constructor(t,r,o){super(),this.varKind=t,this.name=r,this.rhs=o}render({es5:t,_n:r}){let a=t?o.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${a} ${this.name}${i};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=j(this.rhs,t,r)),this}get names(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}},l=class extends s{constructor(t,r,o){super(),this.lhs=t,this.rhs=r,this.sideEffects=o}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,o){if(!(this.lhs instanceof r.Name)||t[this.lhs.str]||this.sideEffects)return this.rhs=j(this.rhs,t,o),this}get names(){return x(this.lhs instanceof r.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends l{constructor(t,r,o,a){super(t,o,a),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},u=class extends s{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},d=class extends s{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},p=class extends s{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},h=class extends s{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=j(this.code,t,r),this}get names(){return this.code instanceof r._CodeOrName?this.code.names:{}}},f=class extends s{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,o)=>r+o.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let o=t[r].optimizeNodes();Array.isArray(o)?t.splice(r,1,...o):o?t[r]=o:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:o}=this,a=o.length;for(;a--;){let i=o[a];i.optimizeNames(t,r)||(function(t,r){for(let o in r)t[o]=(t[o]||0)-(r[o]||0)}(t,i.names),o.splice(a,1))}return o.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>T(t,r.names),{})}},m=class extends f{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},y=class extends f{},g=class extends m{};g.kind="else";var v=class t extends m{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let r=this.condition;if(!0===r)return this.nodes;let o=this.else;if(o){let t=o.optimizeNodes();o=this.else=Array.isArray(t)?new g(t):t}return o?!1===r?o instanceof t?o:o.nodes:this.nodes.length?this:new t(C(r),o instanceof t?[o]:o.nodes):!1!==r&&this.nodes.length?this:void 0}optimizeNames(t,r){var o;if(this.else=null==(o=this.else)?void 0:o.optimizeNames(t,r),super.optimizeNames(t,r)||this.else)return this.condition=j(this.condition,t,r),this}get names(){let t=super.names;return x(t,this.condition),this.else&&T(t,this.else.names),t}};v.kind="if";var b=class extends m{};b.kind="for";var _=class extends b{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=j(this.iteration,t,r),this}get names(){return T(super.names,this.iteration.names)}},S=class extends b{constructor(t,r,o,a){super(),this.varKind=t,this.name=r,this.from=o,this.to=a}render(t){let r=t.es5?o.varKinds.var:this.varKind,{name:a,from:i,to:s}=this;return`for(${r} ${a}=${i}; ${a}<${s}; ${a}++)`+super.render(t)}get names(){return x(x(super.names,this.from),this.to)}},$=class extends b{constructor(t,r,o,a){super(),this.loop=t,this.varKind=r,this.name=o,this.iterable=a}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=j(this.iterable,t,r),this}get names(){return T(super.names,this.iterable.names)}},w=class extends m{constructor(t,r,o){super(),this.name=t,this.args=r,this.async=o}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};w.kind="func";var E=class extends f{render(t){return"return "+super.render(t)}};E.kind="return";var R=class extends m{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),null==(t=this.catch)||t.optimizeNodes(),null==(r=this.finally)||r.optimizeNodes(),this}optimizeNames(t,r){var o,a;return super.optimizeNames(t,r),null==(o=this.catch)||o.optimizeNames(t,r),null==(a=this.finally)||a.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&T(t,this.catch.names),this.finally&&T(t,this.finally.names),t}},P=class extends m{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};P.kind="catch";var k=class extends m{render(t){return"finally"+super.render(t)}};k.kind="finally";var O=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?"\n":""},this._extScope=t,this._scope=new o.Scope({parent:t}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let o=this._extScope.value(t,r);return(this._values[o.prefix]||(this._values[o.prefix]=new Set)).add(o),o}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,o,a){let i=this._scope.toName(r);return void 0!==o&&a&&(this._constants[i.str]=o),this._leafNode(new n(t,i,o)),i}const(t,r,a){return this._def(o.varKinds.const,t,r,a)}let(t,r,a){return this._def(o.varKinds.let,t,r,a)}var(t,r,a){return this._def(o.varKinds.var,t,r,a)}assign(t,r,o){return this._leafNode(new l(t,r,o))}add(r,o){return this._leafNode(new c(r,t.operators.ADD,o))}code(t){return"function"==typeof t?t():t!==r.nil&&this._leafNode(new h(t)),this}object(...t){let o=["{"];for(let[a,i]of t)o.length>1&&o.push(","),o.push(a),(a!==i||this.opts.es5)&&(o.push(":"),(0,r.addCodeArg)(o,i));return o.push("}"),new r._Code(o)}if(t,r,o){if(this._blockNode(new v(t)),r&&o)this.code(r).else().code(o).endIf();else if(r)this.code(r).endIf();else if(o)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new v(t))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(v,g)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new _(t),r)}forRange(t,r,a,i,s=this.opts.es5?o.varKinds.var:o.varKinds.let){let n=this._scope.toName(t);return this._for(new S(s,n,r,a),()=>i(n))}forOf(t,a,i,s=o.varKinds.const){let n=this._scope.toName(t);if(this.opts.es5){let t=a instanceof r.Name?a:this.var("_arr",a);return this.forRange("_i",0,(0,r._)`${t}.length`,o=>{this.var(n,(0,r._)`${t}[${o}]`),i(n)})}return this._for(new $("of",s,n,a),()=>i(n))}forIn(t,a,i,s=this.opts.es5?o.varKinds.var:o.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,r._)`Object.keys(${a})`,i);let n=this._scope.toName(t);return this._for(new $("in",s,n,a),()=>i(n))}endFor(){return this._endBlockNode(b)}label(t){return this._leafNode(new u(t))}break(t){return this._leafNode(new d(t))}return(t){let r=new E;if(this._blockNode(r),this.code(t),1!==r.nodes.length)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(t,r,o){if(!r&&!o)throw Error('CodeGen: "try" without "catch" and "finally"');let a=new R;if(this._blockNode(a),this.code(t),r){let t=this.name("e");this._currNode=a.catch=new P(t),r(t)}return o&&(this._currNode=a.finally=new k,this.code(o)),this._endBlockNode(P,k)}throw(t){return this._leafNode(new p(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(void 0===r)throw Error("CodeGen: not in self-balancing block");let o=this._nodes.length-r;if(o<0||void 0!==t&&o!==t)throw Error(`CodeGen: wrong number of nodes: ${o} vs ${t} expected`);return this._nodes.length=r,this}func(t,o=r.nil,a,i){return this._blockNode(new w(t,o,a)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let o=this._currNode;if(o instanceof t||r&&o instanceof r)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof v))throw Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};function T(t,r){for(let o in r)t[o]=(t[o]||0)+(r[o]||0);return t}function x(t,o){return o instanceof r._CodeOrName?T(t,o.names):t}function j(t,o,a){var i;if(t instanceof r.Name)return s(t);if(!((i=t)instanceof r._Code&&i._items.some(t=>t instanceof r.Name&&1===o[t.str]&&void 0!==a[t.str])))return t;return new r._Code(t._items.reduce((t,o)=>(o instanceof r.Name&&(o=s(o)),o instanceof r._Code?t.push(...o._items):t.push(o),t),[]));function s(t){let r=a[t.str];return void 0===r||1!==o[t.str]?t:(delete o[t.str],r)}}function C(t){return"boolean"==typeof t||"number"==typeof t||null===t?!t:(0,r._)`!${M(t)}`}t.CodeGen=O,t.not=C;let N=A(t.operators.AND);t.and=function(...t){return t.reduce(N)};let I=A(t.operators.OR);function A(t){return(o,a)=>o===r.nil?a:a===r.nil?o:(0,r._)`${M(o)} ${t} ${M(a)}`}function M(t){return t instanceof r.Name?t:(0,r._)`(${t})`}t.or=function(...t){return t.reduce(I)}}),c_=ea(t=>{var r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;let a=cb(),i=cg();function s(t,r=t.schema){let{opts:o,self:a}=t;if(!o.strictSchema||"boolean"==typeof r)return;let i=a.RULES.keywords;for(let o in r)i[o]||f(t,`unknown keyword: "${o}"`)}function n(t,r){if("boolean"==typeof t)return!t;for(let o in t)if(r[o])return!0;return!1}function l(t){return"number"==typeof t?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}function c(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function u({mergeNames:t,mergeToName:r,mergeValues:o,resultToName:i}){return(s,n,l,c)=>{let u=void 0===l?n:l instanceof a.Name?(n instanceof a.Name?t(s,n,l):r(s,n,l),l):n instanceof a.Name?(r(s,l,n),n):o(n,l);return c!==a.Name||u instanceof a.Name?u:i(s,u)}}function d(t,r){if(!0===r)return t.var("props",!0);let o=t.var("props",(0,a._)`{}`);return void 0!==r&&p(t,o,r),o}function p(t,r,o){Object.keys(o).forEach(o=>t.assign((0,a._)`${r}${(0,a.getProperty)(o)}`,!0))}t.toHash=function(t){let r={};for(let o of t)r[o]=!0;return r},t.alwaysValidSchema=function(t,r){return"boolean"==typeof r?r:0===Object.keys(r).length||(s(t,r),!n(r,t.self.RULES.all))},t.checkUnknownRules=s,t.schemaHasRules=n,t.schemaHasRulesButRef=function(t,r){if("boolean"==typeof t)return!t;for(let o in t)if("$ref"!==o&&r.all[o])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:t,schemaPath:r},o,i,s){if(!s){if("number"==typeof o||"boolean"==typeof o)return o;if("string"==typeof o)return(0,a._)`${o}`}return(0,a._)`${t}${r}${(0,a.getProperty)(i)}`},t.unescapeFragment=function(t){return c(decodeURIComponent(t))},t.escapeFragment=function(t){return encodeURIComponent(l(t))},t.escapeJsonPointer=l,t.unescapeJsonPointer=c,t.eachItem=function(t,r){if(Array.isArray(t))for(let o of t)r(o);else r(t)},t.mergeEvaluated={props:u({mergeNames:(t,r,o)=>t.if((0,a._)`${o} !== true && ${r} !== undefined`,()=>{t.if((0,a._)`${r} === true`,()=>t.assign(o,!0),()=>t.assign(o,(0,a._)`${o} || {}`).code((0,a._)`Object.assign(${o}, ${r})`))}),mergeToName:(t,r,o)=>t.if((0,a._)`${o} !== true`,()=>{!0===r?t.assign(o,!0):(t.assign(o,(0,a._)`${o} || {}`),p(t,o,r))}),mergeValues:(t,r)=>!0===t||{...t,...r},resultToName:d}),items:u({mergeNames:(t,r,o)=>t.if((0,a._)`${o} !== true && ${r} !== undefined`,()=>t.assign(o,(0,a._)`${r} === true ? true : ${o} > ${r} ? ${o} : ${r}`)),mergeToName:(t,r,o)=>t.if((0,a._)`${o} !== true`,()=>t.assign(o,!0===r||(0,a._)`${o} > ${r} ? ${o} : ${r}`)),mergeValues:(t,r)=>!0===t||Math.max(t,r),resultToName:(t,r)=>t.var("items",r)})},t.evaluatedPropsToName=d,t.setEvaluated=p;let h={};function f(t,r,o=t.opts.strictSchema){if(o){if(r=`strict mode: ${r}`,!0===o)throw Error(r);t.self.logger.warn(r)}}t.useFunc=function(t,r){return t.scopeValue("func",{ref:r,code:h[r.code]||(h[r.code]=new i._Code(r.code))})},(o=r||(t.Type=r={}))[o.Num=0]="Num",o[o.Str=1]="Str",t.getErrorPath=function(t,o,i){if(t instanceof a.Name){let s=o===r.Num;return i?s?(0,a._)`"[" + ${t} + "]"`:(0,a._)`"['" + ${t} + "']"`:s?(0,a._)`"/" + ${t}`:(0,a._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return i?(0,a.getProperty)(t).toString():"/"+l(t)},t.checkStrictMode=f}),cS=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb();t.default={data:new r.Name("data"),valCxt:new r.Name("valCxt"),instancePath:new r.Name("instancePath"),parentData:new r.Name("parentData"),parentDataProperty:new r.Name("parentDataProperty"),rootData:new r.Name("rootData"),dynamicAnchors:new r.Name("dynamicAnchors"),vErrors:new r.Name("vErrors"),errors:new r.Name("errors"),this:new r.Name("this"),self:new r.Name("self"),scope:new r.Name("scope"),json:new r.Name("json"),jsonPos:new r.Name("jsonPos"),jsonLen:new r.Name("jsonLen"),jsonPart:new r.Name("jsonPart")}}),c$=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;let r=cb(),o=c_(),a=cS();function i(t,o){let i=t.const("err",o);t.if((0,r._)`${a.default.vErrors} === null`,()=>t.assign(a.default.vErrors,(0,r._)`[${i}]`),(0,r._)`${a.default.vErrors}.push(${i})`),t.code((0,r._)`${a.default.errors}++`)}function s(t,o){let{gen:a,validateName:i,schemaEnv:s}=t;s.$async?a.throw((0,r._)`new ${t.ValidationError}(${o})`):(a.assign((0,r._)`${i}.errors`,o),a.return(!1))}t.keywordError={message:({keyword:t})=>(0,r.str)`must pass "${t}" keyword validation`},t.keyword$DataError={message:({keyword:t,schemaType:o})=>o?(0,r.str)`"${t}" keyword must be ${o} ($data)`:(0,r.str)`"${t}" keyword is invalid ($data)`},t.reportError=function(o,a=t.keywordError,n,c){let{it:u}=o,{gen:d,compositeRule:p,allErrors:h}=u,f=l(o,a,n);(null!=c?c:p||h)?i(d,f):s(u,(0,r._)`[${f}]`)},t.reportExtraError=function(r,o=t.keywordError,n){let{it:c}=r,{gen:u,compositeRule:d,allErrors:p}=c;i(u,l(r,o,n)),d||p||s(c,a.default.vErrors)},t.resetErrorsCount=function(t,o){t.assign(a.default.errors,o),t.if((0,r._)`${a.default.vErrors} !== null`,()=>t.if(o,()=>t.assign((0,r._)`${a.default.vErrors}.length`,o),()=>t.assign(a.default.vErrors,null)))},t.extendErrors=function({gen:t,keyword:o,schemaValue:i,data:s,errsCount:n,it:l}){if(void 0===n)throw Error("ajv implementation error");let c=t.name("err");t.forRange("i",n,a.default.errors,n=>{t.const(c,(0,r._)`${a.default.vErrors}[${n}]`),t.if((0,r._)`${c}.instancePath === undefined`,()=>t.assign((0,r._)`${c}.instancePath`,(0,r.strConcat)(a.default.instancePath,l.errorPath))),t.assign((0,r._)`${c}.schemaPath`,(0,r.str)`${l.errSchemaPath}/${o}`),l.opts.verbose&&(t.assign((0,r._)`${c}.schema`,i),t.assign((0,r._)`${c}.data`,s))})};let n={keyword:new r.Name("keyword"),schemaPath:new r.Name("schemaPath"),params:new r.Name("params"),propertyName:new r.Name("propertyName"),message:new r.Name("message"),schema:new r.Name("schema"),parentSchema:new r.Name("parentSchema")};function l(t,i,s){let{createErrors:l}=t.it;return!1===l?(0,r._)`{}`:function(t,i,s={}){let{gen:l,it:c}=t,u=[function({errorPath:t},{instancePath:i}){let s=i?(0,r.str)`${t}${(0,o.getErrorPath)(i,o.Type.Str)}`:t;return[a.default.instancePath,(0,r.strConcat)(a.default.instancePath,s)]}(c,s),function({keyword:t,it:{errSchemaPath:a}},{schemaPath:i,parentSchema:s}){let l=s?a:(0,r.str)`${a}/${t}`;return i&&(l=(0,r.str)`${l}${(0,o.getErrorPath)(i,o.Type.Str)}`),[n.schemaPath,l]}(t,s)];return function(t,{params:o,message:i},s){let{keyword:l,data:c,schemaValue:u,it:d}=t,{opts:p,propertyName:h,topSchemaRef:f,schemaPath:m}=d;s.push([n.keyword,l],[n.params,"function"==typeof o?o(t):o||(0,r._)`{}`]),p.messages&&s.push([n.message,"function"==typeof i?i(t):i]),p.verbose&&s.push([n.schema,u],[n.parentSchema,(0,r._)`${f}${m}`],[a.default.data,c]),h&&s.push([n.propertyName,h])}(t,i,u),l.object(...u)}(t,i,s)}}),cw=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;let r=c$(),o=cb(),a=cS(),i={message:"boolean schema is false"};function s(t,o){let{gen:a,data:s}=t;(0,r.reportError)({gen:a,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t},i,void 0,o)}t.topBoolOrEmptySchema=function(t){let{gen:r,schema:i,validateName:n}=t;!1===i?s(t,!1):"object"==typeof i&&!0===i.$async?r.return(a.default.data):(r.assign((0,o._)`${n}.errors`,null),r.return(!0))},t.boolOrEmptySchema=function(t,r){let{gen:o,schema:a}=t;!1===a?(o.var(r,!1),s(t)):o.var(r,!0)}}),cE=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;let r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(t){return"string"==typeof t&&r.has(t)},t.getRules=function(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}}),cR=ea(t=>{function r(t,r){return r.rules.some(r=>o(t,r))}function o(t,r){var o;return void 0!==t[r.keyword]||(null==(o=r.definition.implements)?void 0:o.some(r=>void 0!==t[r]))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:t,self:o},a){let i=o.RULES.types[a];return i&&!0!==i&&r(t,i)},t.shouldUseGroup=r,t.shouldUseRule=o}),cP=ea(t=>{var r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;let a=cE(),i=cR(),s=c$(),n=cb(),l=c_();function c(t){let r=Array.isArray(t)?t:t?[t]:[];if(r.every(a.isJSONType))return r;throw Error("type must be JSONType or JSONType[]: "+r.join(","))}(o=r||(t.DataType=r={}))[o.Correct=0]="Correct",o[o.Wrong=1]="Wrong",t.getSchemaTypes=function(t){let r=c(t.type);if(r.includes("null")){if(!1===t.nullable)throw Error("type: null contradicts nullable: false")}else{if(!r.length&&void 0!==t.nullable)throw Error('"nullable" cannot be used without "type"');!0===t.nullable&&r.push("null")}return r},t.getJSONTypes=c,t.coerceAndCheckDataType=function(t,o){var a,s;let{gen:l,data:c,opts:d}=t,h=(a=o,(s=d.coerceTypes)?a.filter(t=>u.has(t)||"array"===s&&"array"===t):[]),m=o.length>0&&!(0===h.length&&1===o.length&&(0,i.schemaHasRulesForType)(t,o[0]));if(m){let a=p(o,c,d.strictNumbers,r.Wrong);l.if(a,()=>{h.length?function(t,r,o){let{gen:a,data:i,opts:s}=t,l=a.let("dataType",(0,n._)`typeof ${i}`),c=a.let("coerced",(0,n._)`undefined`);for(let t of("array"===s.coerceTypes&&a.if((0,n._)`${l} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>a.assign(i,(0,n._)`${i}[0]`).assign(l,(0,n._)`typeof ${i}`).if(p(r,i,s.strictNumbers),()=>a.assign(c,i))),a.if((0,n._)`${c} !== undefined`),o))(u.has(t)||"array"===t&&"array"===s.coerceTypes)&&function(t){switch(t){case"string":a.elseIf((0,n._)`${l} == "number" || ${l} == "boolean"`).assign(c,(0,n._)`"" + ${i}`).elseIf((0,n._)`${i} === null`).assign(c,(0,n._)`""`);return;case"number":a.elseIf((0,n._)`${l} == "boolean" || ${i} === null
|
|
56
|
+
|| (${l} == "string" && ${i} && ${i} == +${i})`).assign(c,(0,n._)`+${i}`);return;case"integer":a.elseIf((0,n._)`${l} === "boolean" || ${i} === null
|
|
57
|
+
|| (${l} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(c,(0,n._)`+${i}`);return;case"boolean":a.elseIf((0,n._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(c,!1).elseIf((0,n._)`${i} === "true" || ${i} === 1`).assign(c,!0);return;case"null":a.elseIf((0,n._)`${i} === "" || ${i} === 0 || ${i} === false`),a.assign(c,null);return;case"array":a.elseIf((0,n._)`${l} === "string" || ${l} === "number"
|
|
58
|
+
|| ${l} === "boolean" || ${i} === null`).assign(c,(0,n._)`[${i}]`)}}(t);a.else(),f(t),a.endIf(),a.if((0,n._)`${c} !== undefined`,()=>{a.assign(i,c),function({gen:t,parentData:r,parentDataProperty:o},a){t.if((0,n._)`${r} !== undefined`,()=>t.assign((0,n._)`${r}[${o}]`,a))}(t,c)})}(t,o,h):f(t)})}return m};let u=new Set(["string","number","integer","boolean","null"]);function d(t,o,a,i=r.Correct){let s,l=i===r.Correct?n.operators.EQ:n.operators.NEQ;switch(t){case"null":return(0,n._)`${o} ${l} null`;case"array":s=(0,n._)`Array.isArray(${o})`;break;case"object":s=(0,n._)`${o} && typeof ${o} == "object" && !Array.isArray(${o})`;break;case"integer":s=c((0,n._)`!(${o} % 1) && !isNaN(${o})`);break;case"number":s=c();break;default:return(0,n._)`typeof ${o} ${l} ${t}`}return i===r.Correct?s:(0,n.not)(s);function c(t=n.nil){return(0,n.and)((0,n._)`typeof ${o} == "number"`,t,a?(0,n._)`isFinite(${o})`:n.nil)}}function p(t,r,o,a){let i;if(1===t.length)return d(t[0],r,o,a);let s=(0,l.toHash)(t);if(s.array&&s.object){let t=(0,n._)`typeof ${r} != "object"`;i=s.null?t:(0,n._)`!${r} || ${t}`,delete s.null,delete s.array,delete s.object}else i=n.nil;for(let t in s.number&&delete s.integer,s)i=(0,n.and)(i,d(t,r,o,a));return i}t.checkDataType=d,t.checkDataTypes=p;let h={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:r})=>"string"==typeof t?(0,n._)`{type: ${t}}`:(0,n._)`{type: ${r}}`};function f(t){let r=function(t){let{gen:r,data:o,schema:a}=t,i=(0,l.schemaRefOrVal)(t,a,"type");return{gen:r,keyword:"type",data:o,schema:a.type,schemaCode:i,schemaValue:i,parentSchema:a,params:{},it:t}}(t);(0,s.reportError)(r,h)}t.reportTypeError=f}),ck=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;let r=cb(),o=c_();function a(t,a,i){let{gen:s,compositeRule:n,data:l,opts:c}=t;if(void 0===i)return;let u=(0,r._)`${l}${(0,r.getProperty)(a)}`;if(n)return void(0,o.checkStrictMode)(t,`default is ignored for: ${u}`);let d=(0,r._)`${u} === undefined`;"empty"===c.useDefaults&&(d=(0,r._)`${d} || ${u} === null || ${u} === ""`),s.if(d,(0,r._)`${u} = ${(0,r.stringify)(i)}`)}t.assignDefaults=function(t,r){let{properties:o,items:i}=t.schema;if("object"===r&&o)for(let r in o)a(t,r,o[r].default);else"array"===r&&Array.isArray(i)&&i.forEach((r,o)=>a(t,o,r.default))}}),cO=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;let r=cb(),o=c_(),a=cS(),i=c_();function s(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,r._)`Object.prototype.hasOwnProperty`})}function n(t,o,a){return(0,r._)`${s(t)}.call(${o}, ${a})`}function l(t,o,a,i){let s=(0,r._)`${o}${(0,r.getProperty)(a)} === undefined`;return i?(0,r.or)(s,(0,r.not)(n(t,o,a))):s}function c(t){return t?Object.keys(t).filter(t=>"__proto__"!==t):[]}t.checkReportMissingProp=function(t,o){let{gen:a,data:i,it:s}=t;a.if(l(a,i,o,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,r._)`${o}`},!0),t.error()})},t.checkMissingProp=function({gen:t,data:o,it:{opts:a}},i,s){return(0,r.or)(...i.map(i=>(0,r.and)(l(t,o,i,a.ownProperties),(0,r._)`${s} = ${i}`)))},t.reportMissingProp=function(t,r){t.setParams({missingProperty:r},!0),t.error()},t.hasPropFunc=s,t.isOwnProperty=n,t.propertyInData=function(t,o,a,i){let s=(0,r._)`${o}${(0,r.getProperty)(a)} !== undefined`;return i?(0,r._)`${s} && ${n(t,o,a)}`:s},t.noPropertyInData=l,t.allSchemaProperties=c,t.schemaProperties=function(t,r){return c(r).filter(a=>!(0,o.alwaysValidSchema)(t,r[a]))},t.callValidateCode=function({schemaCode:t,data:o,it:{gen:i,topSchemaRef:s,schemaPath:n,errorPath:l},it:c},u,d,p){let h=p?(0,r._)`${t}, ${o}, ${s}${n}`:o,f=[[a.default.instancePath,(0,r.strConcat)(a.default.instancePath,l)],[a.default.parentData,c.parentData],[a.default.parentDataProperty,c.parentDataProperty],[a.default.rootData,a.default.rootData]];c.opts.dynamicRef&&f.push([a.default.dynamicAnchors,a.default.dynamicAnchors]);let m=(0,r._)`${h}, ${i.object(...f)}`;return d!==r.nil?(0,r._)`${u}.call(${d}, ${m})`:(0,r._)`${u}(${m})`};let u=(0,r._)`new RegExp`;t.usePattern=function({gen:t,it:{opts:o}},a){let s=o.unicodeRegExp?"u":"",{regExp:n}=o.code,l=n(a,s);return t.scopeValue("pattern",{key:l.toString(),ref:l,code:(0,r._)`${"new RegExp"===n.code?u:(0,i.useFunc)(t,n)}(${a}, ${s})`})},t.validateArray=function(t){let{gen:a,data:i,keyword:s,it:n}=t,l=a.name("valid");if(n.allErrors){let t=a.let("valid",!0);return c(()=>a.assign(t,!1)),t}return a.var(l,!0),c(()=>a.break()),l;function c(n){let c=a.const("len",(0,r._)`${i}.length`);a.forRange("i",0,c,i=>{t.subschema({keyword:s,dataProp:i,dataPropType:o.Type.Num},l),a.if((0,r.not)(l),n)})}},t.validateUnion=function(t){let{gen:a,schema:i,keyword:s,it:n}=t;if(!Array.isArray(i))throw Error("ajv implementation error");if(i.some(t=>(0,o.alwaysValidSchema)(n,t))&&!n.opts.unevaluated)return;let l=a.let("valid",!1),c=a.name("_valid");a.block(()=>i.forEach((o,i)=>{let n=t.subschema({keyword:s,schemaProp:i,compositeRule:!0},c);a.assign(l,(0,r._)`${l} || ${c}`),t.mergeValidEvaluated(n,c)||a.if((0,r.not)(l))})),t.result(l,()=>t.reset(),()=>t.error(!0))}}),cT=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;let r=cb(),o=cS(),a=cO(),i=c$();function s(t){let{gen:o,data:a,it:i}=t;o.if(i.parentData,()=>o.assign(a,(0,r._)`${i.parentData}[${i.parentDataProperty}]`))}function n(t,o,a){if(void 0===a)throw Error(`keyword "${o}" failed to compile`);return t.scopeValue("keyword","function"==typeof a?{ref:a}:{ref:a,code:(0,r.stringify)(a)})}t.macroKeywordCode=function(t,o){let{gen:a,keyword:i,schema:s,parentSchema:l,it:c}=t,u=o.macro.call(c.self,s,l,c),d=n(a,i,u);!1!==c.opts.validateSchema&&c.self.validateSchema(u,!0);let p=a.name("valid");t.subschema({schema:u,schemaPath:r.nil,errSchemaPath:`${c.errSchemaPath}/${i}`,topSchemaRef:d,compositeRule:!0},p),t.pass(p,()=>t.error(!0))},t.funcKeywordCode=function(t,l){var c;let{gen:u,keyword:d,schema:p,parentSchema:h,$data:f,it:m}=t;!function({schemaEnv:t},r){if(r.async&&!t.$async)throw Error("async keyword in sync schema")}(m,l);let y=n(u,d,!f&&l.compile?l.compile.call(m.self,p,h,m):l.validate),g=u.let("valid");function v(i=l.async?(0,r._)`await `:r.nil){let s=m.opts.passContext?o.default.this:o.default.self,n=!("compile"in l&&!f||!1===l.schema);u.assign(g,(0,r._)`${i}${(0,a.callValidateCode)(t,y,s,n)}`,l.modifying)}function b(t){var o;u.if((0,r.not)(null!=(o=l.valid)?o:g),t)}t.block$data(g,function(){if(!1===l.errors)v(),l.modifying&&s(t),b(()=>t.error());else{let a,n,c=l.async?(a=u.let("ruleErrs",null),u.try(()=>v((0,r._)`await `),t=>u.assign(g,!1).if((0,r._)`${t} instanceof ${m.ValidationError}`,()=>u.assign(a,(0,r._)`${t}.errors`),()=>u.throw(t))),a):(n=(0,r._)`${y}.errors`,u.assign(n,null),v(r.nil),n);l.modifying&&s(t),b(()=>(function(t,a){let{gen:s}=t;s.if((0,r._)`Array.isArray(${a})`,()=>{s.assign(o.default.vErrors,(0,r._)`${o.default.vErrors} === null ? ${a} : ${o.default.vErrors}.concat(${a})`).assign(o.default.errors,(0,r._)`${o.default.vErrors}.length`),(0,i.extendErrors)(t)},()=>t.error())})(t,c))}}),t.ok(null!=(c=l.valid)?c:g)},t.validSchemaType=function(t,r,o=!1){return!r.length||r.some(r=>"array"===r?Array.isArray(t):"object"===r?t&&"object"==typeof t&&!Array.isArray(t):typeof t==r||o&&void 0===t)},t.validateKeywordUsage=function({schema:t,opts:r,self:o,errSchemaPath:a},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw Error("ajv implementation error");let n=i.dependencies;if(null==n?void 0:n.some(r=>!Object.prototype.hasOwnProperty.call(t,r)))throw Error(`parent schema must have dependencies of ${s}: ${n.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let t=`keyword "${s}" value is invalid at path "${a}": `+o.errorsText(i.validateSchema.errors);if("log"===r.validateSchema)o.logger.error(t);else throw Error(t)}}}),cx=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;let r=cb(),o=c_();t.getSubschema=function(t,{keyword:a,schemaProp:i,schema:s,schemaPath:n,errSchemaPath:l,topSchemaRef:c}){if(void 0!==a&&void 0!==s)throw Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==a){let s=t.schema[a];return void 0===i?{schema:s,schemaPath:(0,r._)`${t.schemaPath}${(0,r.getProperty)(a)}`,errSchemaPath:`${t.errSchemaPath}/${a}`}:{schema:s[i],schemaPath:(0,r._)`${t.schemaPath}${(0,r.getProperty)(a)}${(0,r.getProperty)(i)}`,errSchemaPath:`${t.errSchemaPath}/${a}/${(0,o.escapeFragment)(i)}`}}if(void 0!==s){if(void 0===n||void 0===l||void 0===c)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:n,topSchemaRef:c,errSchemaPath:l}}throw Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(t,a,{dataProp:i,dataPropType:s,data:n,dataTypes:l,propertyName:c}){if(void 0!==n&&void 0!==i)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:u}=a;if(void 0!==i){let{errorPath:n,dataPathArr:l,opts:c}=a;d(u.let("data",(0,r._)`${a.data}${(0,r.getProperty)(i)}`,!0)),t.errorPath=(0,r.str)`${n}${(0,o.getErrorPath)(i,s,c.jsPropertySyntax)}`,t.parentDataProperty=(0,r._)`${i}`,t.dataPathArr=[...l,t.parentDataProperty]}function d(r){t.data=r,t.dataLevel=a.dataLevel+1,t.dataTypes=[],a.definedProperties=new Set,t.parentData=a.data,t.dataNames=[...a.dataNames,r]}void 0!==n&&(d(n instanceof r.Name?n:u.let("data",n,!0)),void 0!==c&&(t.propertyName=c)),l&&(t.dataTypes=l)},t.extendSubschemaMode=function(t,{jtdDiscriminator:r,jtdMetadata:o,compositeRule:a,createErrors:i,allErrors:s}){void 0!==a&&(t.compositeRule=a),void 0!==i&&(t.createErrors=i),void 0!==s&&(t.allErrors=s),t.jtdDiscriminator=r,t.jtdMetadata=o}}),cj=ea((t,r)=>{r.exports=function t(r,o){if(r===o)return!0;if(r&&o&&"object"==typeof r&&"object"==typeof o){if(r.constructor!==o.constructor)return!1;if(Array.isArray(r)){if((a=r.length)!=o.length)return!1;for(i=a;0!=i--;)if(!t(r[i],o[i]))return!1;return!0}if(r.constructor===RegExp)return r.source===o.source&&r.flags===o.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===o.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===o.toString();if((a=(s=Object.keys(r)).length)!==Object.keys(o).length)return!1;for(i=a;0!=i--;)if(!Object.prototype.hasOwnProperty.call(o,s[i]))return!1;for(i=a;0!=i--;){var a,i,s,n=s[i];if(!t(r[n],o[n]))return!1}return!0}return r!=r&&o!=o}}),cC=ea((t,r)=>{var o=r.exports=function(t,r,a){"function"==typeof r&&(a=r,r={});var i="function"==typeof(a=r.cb||a)?a:a.pre||function(){};!function t(r,a,i,s,n,l,c,u,d,p){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var h in a(s,n,l,c,u,d,p),s){var f=s[h];if(Array.isArray(f)){if(h in o.arrayKeywords)for(var m=0;m<f.length;m++)t(r,a,i,f[m],n+"/"+h+"/"+m,l,n,h,s,m)}else if(h in o.propsKeywords){if(f&&"object"==typeof f)for(var y in f)t(r,a,i,f[y],n+"/"+h+"/"+y.replace(/~/g,"~0").replace(/\//g,"~1"),l,n,h,s,y)}else(h in o.keywords||r.allKeys&&!(h in o.skipKeywords))&&t(r,a,i,f,n+"/"+h,l,n,h,s)}i(s,n,l,c,u,d,p)}}(r,i,a.post||function(){},t,"",t)};o.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},o.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},o.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},o.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}}),cN=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;let r=c_(),o=cj(),a=cC(),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(t,o=!0){return"boolean"==typeof t||(!0===o?!function t(r){for(let o in r){if(s.has(o))return!0;let a=r[o];if(Array.isArray(a)&&a.some(t)||"object"==typeof a&&t(a))return!0}return!1}(t):!!o&&function t(o){let a=0;for(let s in o)if("$ref"===s||(a++,!i.has(s)&&("object"==typeof o[s]&&(0,r.eachItem)(o[s],r=>a+=t(r)),a===1/0)))return 1/0;return a}(t)<=o)};let s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function n(t,r="",o){return!1!==o&&(r=u(r)),l(t,t.parse(r))}function l(t,r){return t.serialize(r).split("#")[0]+"#"}t.getFullPath=n,t._getFullPath=l;let c=/#\/?$/;function u(t){return t?t.replace(c,""):""}t.normalizeId=u,t.resolveUrl=function(t,r,o){return o=u(o),t.resolve(r,o)};let d=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(t,r){if("boolean"==typeof t)return{};let{schemaId:i,uriResolver:s}=this.opts,l=u(t[i]||r),c={"":l},p=n(s,l,!1),h={},f=new Set;return a(t,{allKeys:!0},(t,r,o,a)=>{if(void 0===a)return;let s=p+r,n=c[a];function l(r){let o=this.opts.uriResolver.resolve;if(r=u(n?o(n,r):r),f.has(r))throw y(r);f.add(r);let a=this.refs[r];return"string"==typeof a&&(a=this.refs[a]),"object"==typeof a?m(t,a.schema,r):r!==u(s)&&("#"===r[0]?(m(t,h[r],r),h[r]=t):this.refs[r]=s),r}function g(t){if("string"==typeof t){if(!d.test(t))throw Error(`invalid anchor "${t}"`);l.call(this,`#${t}`)}}"string"==typeof t[i]&&(n=l.call(this,t[i])),g.call(this,t.$anchor),g.call(this,t.$dynamicAnchor),c[r]=n}),h;function m(t,r,a){if(void 0!==r&&!o(t,r))throw y(a)}function y(t){return Error(`reference "${t}" resolves to more than one schema`)}}}),cI=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;let r=cw(),o=cP(),a=cR(),i=cP(),s=ck(),n=cT(),l=cx(),c=cb(),u=cS(),d=cN(),p=c_(),h=c$();function f({gen:t,validateName:r,schema:o,schemaEnv:a,opts:i},s){var n;i.code.es5?t.func(r,(0,c._)`${u.default.data}, ${u.default.valCxt}`,a.$async,()=>{var r,a;t.code((0,c._)`"use strict"; ${m(o,i)}`),r=t,a=i,r.if(u.default.valCxt,()=>{r.var(u.default.instancePath,(0,c._)`${u.default.valCxt}.${u.default.instancePath}`),r.var(u.default.parentData,(0,c._)`${u.default.valCxt}.${u.default.parentData}`),r.var(u.default.parentDataProperty,(0,c._)`${u.default.valCxt}.${u.default.parentDataProperty}`),r.var(u.default.rootData,(0,c._)`${u.default.valCxt}.${u.default.rootData}`),a.dynamicRef&&r.var(u.default.dynamicAnchors,(0,c._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{r.var(u.default.instancePath,(0,c._)`""`),r.var(u.default.parentData,(0,c._)`undefined`),r.var(u.default.parentDataProperty,(0,c._)`undefined`),r.var(u.default.rootData,u.default.data),a.dynamicRef&&r.var(u.default.dynamicAnchors,(0,c._)`{}`)}),t.code(s)}):t.func(r,(0,c._)`${u.default.data}, ${(n=i,(0,c._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${n.dynamicRef?(0,c._)`, ${u.default.dynamicAnchors}={}`:c.nil}}={}`)}`,a.$async,()=>t.code(m(o,i)).code(s))}function m(t,r){let o="object"==typeof t&&t[r.schemaId];return o&&(r.code.source||r.code.process)?(0,c._)`/*# sourceURL=${o} */`:c.nil}function y({schema:t,self:r}){if("boolean"==typeof t)return!t;for(let o in t)if(r.RULES.all[o])return!0;return!1}function g(t){return"boolean"!=typeof t.schema}function v(t){(0,p.checkUnknownRules)(t),function(t){let{schema:r,errSchemaPath:o,opts:a,self:i}=t;r.$ref&&a.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(r,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${o}"`)}(t)}function b(t,r){if(t.opts.jtd)return S(t,[],!1,r);let a=(0,o.getSchemaTypes)(t.schema);S(t,a,!(0,o.coerceAndCheckDataType)(t,a),r)}function _({gen:t,schemaEnv:r,schema:o,errSchemaPath:a,opts:i}){let s=o.$comment;if(!0===i.$comment)t.code((0,c._)`${u.default.self}.logger.log(${s})`);else if("function"==typeof i.$comment){let o=(0,c.str)`${a}/$comment`,i=t.scopeValue("root",{ref:r.root});t.code((0,c._)`${u.default.self}.opts.$comment(${s}, ${o}, ${i}.schema)`)}}function S(t,r,o,s){var n,l,d,h;let{gen:f,schema:m,data:y,allErrors:g,opts:v,self:b}=t,{RULES:_}=b;if(m.$ref&&(v.ignoreKeywordsWithRef||!(0,p.schemaHasRulesButRef)(m,_)))return void f.block(()=>P(t,"$ref",_.all.$ref.definition));function S(n){(0,a.shouldUseGroup)(m,n)&&(n.type?(f.if((0,i.checkDataType)(n.type,y,v.strictNumbers)),$(t,n),1===r.length&&r[0]===n.type&&o&&(f.else(),(0,i.reportTypeError)(t)),f.endIf()):$(t,n),g||f.if((0,c._)`${u.default.errors} === ${s||0}`))}v.jtd||(n=t,l=r,!n.schemaEnv.meta&&n.opts.strictTypes&&(function(t,r){if(r.length){if(!t.dataTypes.length){t.dataTypes=r;return}r.forEach(r=>{w(t.dataTypes,r)||E(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),function(t,r){let o=[];for(let a of t.dataTypes)w(r,a)?o.push(a):r.includes("integer")&&"number"===a&&o.push("integer");t.dataTypes=o}(t,r)}}(n,l),n.opts.allowUnionTypes||(d=n,(h=l).length>1&&!(2===h.length&&h.includes("null"))&&E(d,"use allowUnionTypes to allow union type keyword")),function(t,r){let o=t.self.RULES.all;for(let i in o){let s=o[i];if("object"==typeof s&&(0,a.shouldUseRule)(t.schema,s)){let{type:o}=s.definition;o.length&&!o.some(t=>{var o,a;return o=r,a=t,o.includes(a)||"number"===a&&o.includes("integer")})&&E(t,`missing type "${o.join(",")}" for keyword "${i}"`)}}}(n,n.dataTypes))),f.block(()=>{for(let t of _.rules)S(t);S(_.post)})}function $(t,r){let{gen:o,schema:i,opts:{useDefaults:n}}=t;n&&(0,s.assignDefaults)(t,r.type),o.block(()=>{for(let o of r.rules)(0,a.shouldUseRule)(i,o)&&P(t,o.keyword,o.definition,r.type)})}function w(t,r){return t.includes(r)||"integer"===r&&t.includes("number")}function E(t,r){let o=t.schemaEnv.baseId+t.errSchemaPath;r+=` at "${o}" (strictTypes)`,(0,p.checkStrictMode)(t,r,t.opts.strictTypes)}t.validateFunctionCode=function(t){g(t)&&(v(t),y(t))?function(t){let{schema:r,opts:o,gen:a}=t;f(t,()=>{o.$comment&&r.$comment&&_(t),function(t){let{schema:r,opts:o}=t;void 0!==r.default&&o.useDefaults&&o.strictSchema&&(0,p.checkStrictMode)(t,"default is ignored in the schema root")}(t),a.let(u.default.vErrors,null),a.let(u.default.errors,0),o.unevaluated&&function(t){let{gen:r,validateName:o}=t;t.evaluated=r.const("evaluated",(0,c._)`${o}.evaluated`),r.if((0,c._)`${t.evaluated}.dynamicProps`,()=>r.assign((0,c._)`${t.evaluated}.props`,(0,c._)`undefined`)),r.if((0,c._)`${t.evaluated}.dynamicItems`,()=>r.assign((0,c._)`${t.evaluated}.items`,(0,c._)`undefined`))}(t),b(t),function(t){let{gen:r,schemaEnv:o,validateName:a,ValidationError:i,opts:s}=t;o.$async?r.if((0,c._)`${u.default.errors} === 0`,()=>r.return(u.default.data),()=>r.throw((0,c._)`new ${i}(${u.default.vErrors})`)):(r.assign((0,c._)`${a}.errors`,u.default.vErrors),s.unevaluated&&function({gen:t,evaluated:r,props:o,items:a}){o instanceof c.Name&&t.assign((0,c._)`${r}.props`,o),a instanceof c.Name&&t.assign((0,c._)`${r}.items`,a)}(t),r.return((0,c._)`${u.default.errors} === 0`))}(t)})}(t):f(t,()=>(0,r.topBoolOrEmptySchema)(t))};var R=class{constructor(t,r,o){if((0,n.validateKeywordUsage)(t,r,o),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=o,this.data=t.data,this.schema=t.schema[o],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(t,this.schema,o,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",T(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,n.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw Error(`${o} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:!1!==r.errors)&&(this.errsCount=t.gen.const("_errs",u.default.errors))}result(t,r,o){this.failResult((0,c.not)(t),r,o)}failResult(t,r,o){this.gen.if(t),o?o():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,c.not)(t),void 0,r)}fail(t){if(void 0===t){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,c._)`${r} !== undefined && (${(0,c.or)(this.invalid$data(),t)})`)}error(t,r,o){if(r){this.setParams(r),this._error(t,o),this.setParams({});return}this._error(t,o)}_error(t,r){(t?h.reportExtraError:h.reportError)(this,this.def.error,r)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(void 0===this.errsCount)throw Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,o=c.nil){this.gen.block(()=>{this.check$data(t,o),r()})}check$data(t=c.nil,r=c.nil){if(!this.$data)return;let{gen:o,schemaCode:a,schemaType:i,def:s}=this;o.if((0,c.or)((0,c._)`${a} === undefined`,r)),t!==c.nil&&o.assign(t,!0),(i.length||s.validateSchema)&&(o.elseIf(this.invalid$data()),this.$dataError(),t!==c.nil&&o.assign(t,!1)),o.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:o,def:a,it:s}=this;return(0,c.or)(function(){if(o.length){if(!(r instanceof c.Name))throw Error("ajv implementation error");let t=Array.isArray(o)?o:[o];return(0,c._)`${(0,i.checkDataTypes)(t,r,s.opts.strictNumbers,i.DataType.Wrong)}`}return c.nil}(),function(){if(a.validateSchema){let o=t.scopeValue("validate$data",{ref:a.validateSchema});return(0,c._)`!${o}(${r})`}return c.nil}())}subschema(t,o){let a=(0,l.getSubschema)(this.it,t);(0,l.extendSubschemaData)(a,this.it,t),(0,l.extendSubschemaMode)(a,t);let i={...this.it,...a,items:void 0,props:void 0};return!function(t,o){if(g(t)&&(v(t),y(t)))return function(t,r){var o;let a,{schema:i,gen:s,opts:n}=t;n.$comment&&i.$comment&&_(t),(a=(o=t).schema[o.opts.schemaId])&&(o.baseId=(0,d.resolveUrl)(o.opts.uriResolver,o.baseId,a)),function(t){if(t.schema.$async&&!t.schemaEnv.$async)throw Error("async schema in sync schema")}(t);let l=s.const("_errs",u.default.errors);b(t,l),s.var(r,(0,c._)`${l} === ${u.default.errors}`)}(t,o);(0,r.boolOrEmptySchema)(t,o)}(i,o),i}mergeEvaluated(t,r){let{it:o,gen:a}=this;o.opts.unevaluated&&(!0!==o.props&&void 0!==t.props&&(o.props=p.mergeEvaluated.props(a,t.props,o.props,r)),!0!==o.items&&void 0!==t.items&&(o.items=p.mergeEvaluated.items(a,t.items,o.items,r)))}mergeValidEvaluated(t,r){let{it:o,gen:a}=this;if(o.opts.unevaluated&&(!0!==o.props||!0!==o.items))return a.if(r,()=>this.mergeEvaluated(t,c.Name)),!0}};function P(t,r,o,a){let i=new R(t,o,r);"code"in o?o.code(i,a):i.$data&&o.validate?(0,n.funcKeywordCode)(i,o):"macro"in o?(0,n.macroKeywordCode)(i,o):(o.compile||o.validate)&&(0,n.funcKeywordCode)(i,o)}t.KeywordCxt=R;let k=/^\/(?:[^~]|~0|~1)*$/,O=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function T(t,{dataLevel:r,dataNames:o,dataPathArr:a}){let i,s;if(""===t)return u.default.rootData;if("/"===t[0]){if(!k.test(t))throw Error(`Invalid JSON-pointer: ${t}`);i=t,s=u.default.rootData}else{let n=O.exec(t);if(!n)throw Error(`Invalid JSON-pointer: ${t}`);let c=+n[1];if("#"===(i=n[2])){if(c>=r)throw Error(l("property/index",c));return a[r-c]}if(c>r)throw Error(l("data",c));if(s=o[r-c],!i)return s}let n=s;for(let t of i.split("/"))t&&(s=(0,c._)`${s}${(0,c.getProperty)((0,p.unescapeJsonPointer)(t))}`,n=(0,c._)`${n} && ${s}`);return n;function l(t,o){return`Cannot access ${t} ${o} levels up, current level is ${r}`}}t.getData=T}),cA=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}}),cM=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cN();t.default=class extends Error{constructor(t,o,a,i){super(i||`can't resolve reference ${a} from id ${o}`),this.missingRef=(0,r.resolveUrl)(t,o,a),this.missingSchema=(0,r.normalizeId)((0,r.getFullPath)(t,this.missingRef))}}}),cq=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;let r=cb(),o=cA(),a=cS(),i=cN(),s=c_(),n=cI();var l=class{constructor(t){var r;let o;this.refs={},this.dynamicAnchors={},"object"==typeof t.schema&&(o=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=null!=(r=t.baseId)?r:(0,i.normalizeId)(null==o?void 0:o[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=null==o?void 0:o.$async,this.refs={}}};function c(t){let s,l,c=d.call(this,t);if(c)return c;let u=(0,i.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:p,lines:h}=this.opts.code,{ownProperties:f}=this.opts,m=new r.CodeGen(this.scope,{es5:p,lines:h,ownProperties:f});t.$async&&(s=m.scopeValue("Error",{ref:o.default,code:(0,r._)`require("ajv/dist/runtime/validation_error").default`}));let y=m.scopeName("validate");t.validateName=y;let g={gen:m,allErrors:this.opts.allErrors,data:a.default.data,parentData:a.default.parentData,parentDataProperty:a.default.parentDataProperty,dataNames:[a.default.data],dataPathArr:[r.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:m.scopeValue("schema",!0===this.opts.code.source?{ref:t.schema,code:(0,r.stringify)(t.schema)}:{ref:t.schema}),validateName:y,ValidationError:s,schema:t.schema,schemaEnv:t,rootId:u,baseId:t.baseId||u,schemaPath:r.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,r._)`""`,opts:this.opts,self:this};try{this._compilations.add(t),(0,n.validateFunctionCode)(g),m.optimize(this.opts.code.optimize);let o=m.toString();l=`${m.scopeRefs(a.default.scope)}return ${o}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let i=Function(`${a.default.self}`,`${a.default.scope}`,l)(this,this.scope.get());if(this.scope.value(y,{ref:i}),i.errors=null,i.schema=t.schema,i.schemaEnv=t,t.$async&&(i.$async=!0),!0===this.opts.code.source&&(i.source={validateName:y,validateCode:o,scopeValues:m._values}),this.opts.unevaluated){let{props:t,items:o}=g;i.evaluated={props:t instanceof r.Name?void 0:t,items:o instanceof r.Name?void 0:o,dynamicProps:t instanceof r.Name,dynamicItems:o instanceof r.Name},i.source&&(i.source.evaluated=(0,r.stringify)(i.evaluated))}return t.validate=i,t}catch(r){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),r}finally{this._compilations.delete(t)}}function u(t){return(0,i.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:c.call(this,t)}function d(t){for(let a of this._compilations){var r,o;if(r=a,o=t,r.schema===o.schema&&r.root===o.root&&r.baseId===o.baseId)return a}}function p(t,r){let o;for(;"string"==typeof(o=this.refs[r]);)r=o;return o||this.schemas[r]||h.call(this,t,r)}function h(t,r){let o=this.opts.uriResolver.parse(r),a=(0,i._getFullPath)(this.opts.uriResolver,o),s=(0,i.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&a===s)return m.call(this,o,t);let n=(0,i.normalizeId)(a),u=this.refs[n]||this.schemas[n];if("string"==typeof u){let r=h.call(this,t,u);if("object"!=typeof(null==r?void 0:r.schema))return;return m.call(this,o,r)}if("object"==typeof(null==u?void 0:u.schema)){if(u.validate||c.call(this,u),n===(0,i.normalizeId)(r)){let{schema:r}=u,{schemaId:o}=this.opts,a=r[o];return a&&(s=(0,i.resolveUrl)(this.opts.uriResolver,s,a)),new l({schema:r,schemaId:o,root:t,baseId:s})}return m.call(this,o,u)}}t.SchemaEnv=l,t.compileSchema=c,t.resolveRef=function(t,r,o){var a;o=(0,i.resolveUrl)(this.opts.uriResolver,r,o);let s=t.refs[o];if(s)return s;let n=p.call(this,t,o);if(void 0===n){let i=null==(a=t.localRefs)?void 0:a[o],{schemaId:s}=this.opts;i&&(n=new l({schema:i,schemaId:s,root:t,baseId:r}))}if(void 0!==n)return t.refs[o]=u.call(this,n)},t.getCompilingSchema=d,t.resolveSchema=h;let f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function m(t,{baseId:r,schema:o,root:a}){var n;let c;if((null==(n=t.fragment)?void 0:n[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if("boolean"==typeof o)return;let t=o[(0,s.unescapeFragment)(a)];if(void 0===t)return;let n="object"==typeof(o=t)&&o[this.opts.schemaId];!f.has(a)&&n&&(r=(0,i.resolveUrl)(this.opts.uriResolver,r,n))}if("boolean"!=typeof o&&o.$ref&&!(0,s.schemaHasRulesButRef)(o,this.RULES)){let t=(0,i.resolveUrl)(this.opts.uriResolver,r,o.$ref);c=h.call(this,a,t)}let{schemaId:u}=this.opts;if((c=c||new l({schema:o,schemaId:u,root:a,baseId:r})).schema!==c.root.schema)return c}}),cz=ea((t,r)=>{r.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),cL=ea((t,r)=>{let o=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),a=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function i(t){let r="",o=0,a=0;for(a=0;a<t.length;a++)if(48!==(o=t[a].charCodeAt(0))){if(!(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102))return"";r+=t[a];break}for(a+=1;a<t.length;a++){if(!((o=t[a].charCodeAt(0))>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102))return"";r+=t[a]}return r}function s(t){return t.length=0,!0}function n(t,r,o){if(t.length){let a=i(t);if(""===a)return o.error=!0,!1;r.push(a),t.length=0}return!0}function l(t){if(2>function(t,r){let o=0;for(let r=0;r<t.length;r++)":"===t[r]&&o++;return o}(t,":"))return{host:t,isIPV6:!1};let r=function(t){let r=0,o={error:!1,address:"",zone:""},a=[],l=[],c=!1,u=!1,d=n;for(let i=0;i<t.length;i++){let n=t[i];if("["!==n&&"]"!==n)if(":"===n){if(!0===c&&(u=!0),!d(l,a,o))break;if(++r>7){o.error=!0;break}i>0&&":"===t[i-1]&&(c=!0),a.push(":");continue}else if("%"===n){if(!d(l,a,o))break;d=s}else{l.push(n);continue}}return l.length&&(d===s?o.zone=l.join(""):u?a.push(l.join("")):a.push(i(l))),o.address=a.join(""),o}(t);if(r.error)return{host:t,isIPV6:!1};{let t=r.address,o=r.address;return r.zone&&(t+="%"+r.zone,o+="%25"+r.zone),{host:t,isIPV6:!0,escapedHost:o}}}r.exports={nonSimpleDomain:RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u),recomposeAuthority:function(t){let r=[];if(void 0!==t.userinfo&&(r.push(t.userinfo),r.push("@")),void 0!==t.host){let o=unescape(t.host);if(!a(o)){let r=l(o);o=!0===r.isIPV6?`[${r.escapedHost}]`:t.host}r.push(o)}return("number"==typeof t.port||"string"==typeof t.port)&&(r.push(":"),r.push(String(t.port))),r.length?r.join(""):void 0},normalizeComponentEncoding:function(t,r){let o=!0!==r?escape:unescape;return void 0!==t.scheme&&(t.scheme=o(t.scheme)),void 0!==t.userinfo&&(t.userinfo=o(t.userinfo)),void 0!==t.host&&(t.host=o(t.host)),void 0!==t.path&&(t.path=o(t.path)),void 0!==t.query&&(t.query=o(t.query)),void 0!==t.fragment&&(t.fragment=o(t.fragment)),t},removeDotSegments:function(t){let r=t,o=[],a=-1,i=0;for(;i=r.length;){if(1===i)if("."===r)break;else if("/"===r){o.push("/");break}else{o.push(r);break}if(2===i){if("."===r[0]){if("."===r[1])break;else if("/"===r[1]){r=r.slice(2);continue}}else if("/"===r[0]&&("."===r[1]||"/"===r[1])){o.push("/");break}}else if(3===i&&"/.."===r){0!==o.length&&o.pop(),o.push("/");break}if("."===r[0]){if("."===r[1]){if("/"===r[2]){r=r.slice(3);continue}}else if("/"===r[1]){r=r.slice(2);continue}}else if("/"===r[0]&&"."===r[1]){if("/"===r[2]){r=r.slice(2);continue}else if("."===r[2]&&"/"===r[3]){r=r.slice(3),0!==o.length&&o.pop();continue}}if(-1===(a=r.indexOf("/",1))){o.push(r);break}o.push(r.slice(0,a)),r=r.slice(a)}return o.join("")},isIPv4:a,isUUID:o,normalizeIPv6:l,stringArrayToHexStripped:i}}),cD=ea((t,r)=>{let{isUUID:o}=cL(),a=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=["http","https","ws","wss","urn","urn:uuid"];function s(t){return!0===t.secure||!1!==t.secure&&!!t.scheme&&3===t.scheme.length&&("w"===t.scheme[0]||"W"===t.scheme[0])&&("s"===t.scheme[1]||"S"===t.scheme[1])&&("s"===t.scheme[2]||"S"===t.scheme[2])}function n(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function l(t){let r="https"===String(t.scheme).toLowerCase();return(t.port===(r?443:80)||""===t.port)&&(t.port=void 0),t.path||(t.path="/"),t}let c={scheme:"http",domainHost:!0,parse:n,serialize:l},u={scheme:"https",domainHost:c.domainHost,parse:n,serialize:l},d={scheme:"ws",domainHost:!0,parse:function(t){return t.secure=s(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(t){if((t.port===(s(t)?443:80)||""===t.port)&&(t.port=void 0),"boolean"==typeof t.secure&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[r,o]=t.resourceName.split("?");t.path=r&&"/"!==r?r:void 0,t.query=o,t.resourceName=void 0}return t.fragment=void 0,t}},p={scheme:"wss",domainHost:d.domainHost,parse:d.parse,serialize:d.serialize},h={http:c,https:u,ws:d,wss:p,urn:{scheme:"urn",parse:function(t,r){if(!t.path)return t.error="URN can not be parsed",t;let o=t.path.match(a);if(o){let a=r.scheme||t.scheme||"urn";t.nid=o[1].toLowerCase(),t.nss=o[2];let i=f(`${a}:${r.nid||t.nid}`);t.path=void 0,i&&(t=i.parse(t,r))}else t.error=t.error||"URN can not be parsed.";return t},serialize:function(t,r){if(void 0===t.nid)throw Error("URN without nid cannot be serialized");let o=r.scheme||t.scheme||"urn",a=t.nid.toLowerCase(),i=f(`${o}:${r.nid||a}`);i&&(t=i.serialize(t,r));let s=t,n=t.nss;return s.path=`${a||r.nid}:${n}`,r.skipEscape=!0,s},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(t,r){return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&o(t.uuid)||(t.error=t.error||"UUID is not valid."),t},serialize:function(t){return t.nss=(t.uuid||"").toLowerCase(),t},skipNormalize:!0}};function f(t){return t&&(h[t]||h[t.toLowerCase()])||void 0}Object.setPrototypeOf(h,null),r.exports={wsIsSecure:s,SCHEMES:h,isValidSchemeName:function(t){return -1!==i.indexOf(t)},getSchemeHandler:f}}),cU=ea((t,r)=>{let{normalizeIPv6:o,removeDotSegments:a,recomposeAuthority:i,normalizeComponentEncoding:s,isIPv4:n,nonSimpleDomain:l}=cL(),{SCHEMES:c,getSchemeHandler:u}=cD();function d(t,r,o,i){let s={};return i||(t=f(p(t,o),o),r=f(p(r,o),o)),!(o=o||{}).tolerant&&r.scheme?(s.scheme=r.scheme,s.userinfo=r.userinfo,s.host=r.host,s.port=r.port,s.path=a(r.path||""),s.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(s.userinfo=r.userinfo,s.host=r.host,s.port=r.port,s.path=a(r.path||""),s.query=r.query):(r.path?("/"===r.path[0]?s.path=a(r.path):(void 0===t.userinfo&&void 0===t.host&&void 0===t.port||t.path?t.path?s.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+r.path:s.path=r.path:s.path="/"+r.path,s.path=a(s.path)),s.query=r.query):(s.path=t.path,void 0!==r.query?s.query=r.query:s.query=t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=r.fragment,s}function p(t,r){let o={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},s=Object.assign({},r),n=[],l=u(s.scheme||o.scheme);l&&l.serialize&&l.serialize(o,s),void 0!==o.path&&(s.skipEscape?o.path=unescape(o.path):(o.path=escape(o.path),void 0!==o.scheme&&(o.path=o.path.split("%3A").join(":")))),"suffix"!==s.reference&&o.scheme&&n.push(o.scheme,":");let c=i(o);if(void 0!==c&&("suffix"!==s.reference&&n.push("//"),n.push(c),o.path&&"/"!==o.path[0]&&n.push("/")),void 0!==o.path){let t=o.path;s.absolutePath||l&&l.absolutePath||(t=a(t)),void 0===c&&"/"===t[0]&&"/"===t[1]&&(t="/%2F"+t.slice(2)),n.push(t)}return void 0!==o.query&&n.push("?",o.query),void 0!==o.fragment&&n.push("#",o.fragment),n.join("")}let h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function f(t,r){let a=Object.assign({},r),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1;"suffix"===a.reference&&(t=a.scheme?a.scheme+":"+t:"//"+t);let c=t.match(h);if(c){if(i.scheme=c[1],i.userinfo=c[3],i.host=c[4],i.port=parseInt(c[5],10),i.path=c[6]||"",i.query=c[7],i.fragment=c[8],isNaN(i.port)&&(i.port=c[5]),i.host)if(!1===n(i.host)){let t=o(i.host);i.host=t.host.toLowerCase(),s=t.isIPV6}else s=!0;void 0!==i.scheme||void 0!==i.userinfo||void 0!==i.host||void 0!==i.port||void 0!==i.query||i.path?void 0===i.scheme?i.reference="relative":void 0===i.fragment?i.reference="absolute":i.reference="uri":i.reference="same-document",a.reference&&"suffix"!==a.reference&&a.reference!==i.reference&&(i.error=i.error||"URI is not a "+a.reference+" reference.");let r=u(a.scheme||i.scheme);if(!a.unicodeSupport&&(!r||!r.unicodeSupport)&&i.host&&(a.domainHost||r&&r.domainHost)&&!1===s&&l(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(t){i.error=i.error||"Host's domain name can not be converted to ASCII: "+t}(!r||r&&!r.skipNormalize)&&(-1!==t.indexOf("%")&&(void 0!==i.scheme&&(i.scheme=unescape(i.scheme)),void 0!==i.host&&(i.host=unescape(i.host))),i.path&&(i.path=escape(unescape(i.path))),i.fragment&&(i.fragment=encodeURI(decodeURIComponent(i.fragment)))),r&&r.parse&&r.parse(i,a)}else i.error=i.error||"URI can not be parsed.";return i}let m={SCHEMES:c,normalize:function(t,r){return"string"==typeof t?t=p(f(t,r),r):"object"==typeof t&&(t=f(p(t,r),r)),t},resolve:function(t,r,o){let a=o?Object.assign({scheme:"null"},o):{scheme:"null"},i=d(f(t,a),f(r,a),a,!0);return a.skipEscape=!0,p(i,a)},resolveComponent:d,equal:function(t,r,o){return"string"==typeof t?t=p(s(f(t=unescape(t),o),!0),{...o,skipEscape:!0}):"object"==typeof t&&(t=p(s(t,!0),{...o,skipEscape:!0})),"string"==typeof r?r=p(s(f(r=unescape(r),o),!0),{...o,skipEscape:!0}):"object"==typeof r&&(r=p(s(r,!0),{...o,skipEscape:!0})),t.toLowerCase()===r.toLowerCase()},serialize:p,parse:f};r.exports=m,r.exports.default=m,r.exports.fastUri=m}),cV=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cU();r.code='require("ajv/dist/runtime/uri").default',t.default=r}),cF=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var r=cI();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return r.KeywordCxt}});var o=cb();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});let a=cA(),i=cM(),s=cE(),n=cq(),l=cb(),c=cN(),u=cP(),d=c_(),p=cz(),h=cV(),f=(t,r)=>new RegExp(t,r);f.code="new RegExp";let m=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},v={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};var b=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...function(t){var r,o,a,i,s,n,l,c,u,d,p,m,y,g,v,b,_,S,$,w,E,R,P,k,O;let T=t.strict,x=null==(r=t.code)?void 0:r.optimize,j=!0===x||void 0===x?1:x||0,C=null!=(a=null==(o=t.code)?void 0:o.regExp)?a:f,N=null!=(i=t.uriResolver)?i:h.default;return{strictSchema:null==(n=null!=(s=t.strictSchema)?s:T)||n,strictNumbers:null==(c=null!=(l=t.strictNumbers)?l:T)||c,strictTypes:null!=(d=null!=(u=t.strictTypes)?u:T)?d:"log",strictTuples:null!=(m=null!=(p=t.strictTuples)?p:T)?m:"log",strictRequired:null!=(g=null!=(y=t.strictRequired)?y:T)&&g,code:t.code?{...t.code,optimize:j,regExp:C}:{optimize:j,regExp:C},loopRequired:null!=(v=t.loopRequired)?v:200,loopEnum:null!=(b=t.loopEnum)?b:200,meta:null==(_=t.meta)||_,messages:null==(S=t.messages)||S,inlineRefs:null==($=t.inlineRefs)||$,schemaId:null!=(w=t.schemaId)?w:"$id",addUsedSchema:null==(E=t.addUsedSchema)||E,validateSchema:null==(R=t.validateSchema)||R,validateFormats:null==(P=t.validateFormats)||P,unicodeRegExp:null==(k=t.unicodeRegExp)||k,int32range:null==(O=t.int32range)||O,uriResolver:N}}(t)};const{es5:r,lines:o}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:r,lines:o}),this.logger=function(t){if(!1===t)return P;if(void 0===t)return console;if(t.log&&t.warn&&t.error)return t;throw Error("logger must implement log, warn and error methods")}(t.logger);const a=t.validateFormats;t.validateFormats=!1,this.RULES=(0,s.getRules)(),_.call(this,g,t,"NOT SUPPORTED"),_.call(this,v,t,"DEPRECATED","warn"),this._metaOpts=R.call(this),t.formats&&w.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&E.call(this,t.keywords),"object"==typeof t.meta&&this.addMetaSchema(t.meta),$.call(this),t.validateFormats=a}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:o}=this.opts,a=p;"id"===o&&((a={...p}).id=a.$id,delete a.$id),r&&t&&this.addMetaSchema(a,a[o],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta="object"==typeof t?t[r]||t:void 0}validate(t,r){let o;if("string"==typeof t){if(!(o=this.getSchema(t)))throw Error(`no schema with key or ref "${t}"`)}else o=this.compile(t);let a=o(r);return"$async"in o||(this.errors=o.errors),a}compile(t,r){let o=this._addSchema(t,r);return o.validate||this._compileSchemaEnv(o)}compileAsync(t,r){if("function"!=typeof this.opts.loadSchema)throw Error("options.loadSchema should be a function");let{loadSchema:o}=this.opts;return a.call(this,t,r);async function a(t,r){await s.call(this,t.$schema);let o=this._addSchema(t,r);return o.validate||n.call(this,o)}async function s(t){t&&!this.getSchema(t)&&await a.call(this,{$ref:t},!0)}async function n(t){try{return this._compileSchemaEnv(t)}catch(r){if(!(r instanceof i.default))throw r;return l.call(this,r),await c.call(this,r.missingSchema),n.call(this,t)}}function l({missingSchema:t,missingRef:r}){if(this.refs[t])throw Error(`AnySchema ${t} is loaded but ${r} cannot be resolved`)}async function c(t){let o=await u.call(this,t);this.refs[t]||await s.call(this,o.$schema),this.refs[t]||this.addSchema(o,t,r)}async function u(t){let r=this._loading[t];if(r)return r;try{return await (this._loading[t]=o(t))}finally{delete this._loading[t]}}}addSchema(t,r,o,a=this.opts.validateSchema){let i;if(Array.isArray(t)){for(let r of t)this.addSchema(r,void 0,o,a);return this}if("object"==typeof t){let{schemaId:r}=this.opts;if(void 0!==(i=t[r])&&"string"!=typeof i)throw Error(`schema ${r} must be string`)}return r=(0,c.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,o,r,a,!0),this}addMetaSchema(t,r,o=this.opts.validateSchema){return this.addSchema(t,r,!0,o),this}validateSchema(t,r){let o;if("boolean"==typeof t)return!0;if(void 0!==(o=t.$schema)&&"string"!=typeof o)throw Error("$schema must be a string");if(!(o=o||this.opts.defaultMeta||this.defaultMeta()))return this.logger.warn("meta-schema not available"),this.errors=null,!0;let a=this.validate(o,t);if(!a&&r){let t="schema is invalid: "+this.errorsText();if("log"===this.opts.validateSchema)this.logger.error(t);else throw Error(t)}return a}getSchema(t){let r;for(;"string"==typeof(r=S.call(this,t));)t=r;if(void 0===r){let{schemaId:o}=this.opts,a=new n.SchemaEnv({schema:{},schemaId:o});if(!(r=n.resolveSchema.call(this,a,t)))return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=S.call(this,t);return"object"==typeof r&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{this._cache.delete(t);let r=t[this.opts.schemaId];return r&&(r=(0,c.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let o;if("string"==typeof t)o=t,"object"==typeof r&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=o);else if("object"==typeof t&&void 0===r){if(Array.isArray(o=(r=t).keyword)&&!o.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(O.call(this,o,r),!r)return(0,d.eachItem)(o,t=>T.call(this,t)),this;j.call(this,r);let a={...r,type:(0,u.getJSONTypes)(r.type),schemaType:(0,u.getJSONTypes)(r.schemaType)};return(0,d.eachItem)(o,0===a.type.length?t=>T.call(this,t,a):t=>a.type.forEach(r=>T.call(this,t,a,r))),this}getKeyword(t){let r=this.RULES.all[t];return"object"==typeof r?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;for(let o of(delete r.keywords[t],delete r.all[t],r.rules)){let r=o.rules.findIndex(r=>r.keyword===t);r>=0&&o.rules.splice(r,1)}return this}addFormat(t,r){return"string"==typeof r&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:o="data"}={}){return t&&0!==t.length?t.map(t=>`${o}${t.instancePath} ${t.message}`).reduce((t,o)=>t+r+o):"No errors"}$dataMetaSchema(t,r){let o=this.RULES.all;for(let a of(t=JSON.parse(JSON.stringify(t)),r)){let r=a.split("/").slice(1),i=t;for(let t of r)i=i[t];for(let t in o){let r=o[t];if("object"!=typeof r)continue;let{$data:a}=r.definition,s=i[t];a&&s&&(i[t]=N(s))}}return t}_removeAllSchemas(t,r){for(let o in t){let a=t[o];(!r||r.test(o))&&("string"==typeof a?delete t[o]:a&&!a.meta&&(this._cache.delete(a.schema),delete t[o]))}}_addSchema(t,r,o,a=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:l}=this.opts;if("object"==typeof t)s=t[l];else if(this.opts.jtd)throw Error("schema must be object");else if("boolean"!=typeof t)throw Error("schema must be object or boolean");let u=this._cache.get(t);if(void 0!==u)return u;o=(0,c.normalizeId)(s||o);let d=c.getSchemaRefs.call(this,t,o);return u=new n.SchemaEnv({schema:t,schemaId:l,meta:r,baseId:o,localRefs:d}),this._cache.set(u.schema,u),i&&!o.startsWith("#")&&(o&&this._checkUnique(o),this.refs[o]=u),a&&this.validateSchema(t,!0),u}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):n.compileSchema.call(this,t),!t.validate)throw Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{n.compileSchema.call(this,t)}finally{this.opts=r}}};function _(t,r,o,a="error"){for(let i in t)i in r&&this.logger[a](`${o}: option ${i}. ${t[i]}`)}function S(t){return t=(0,c.normalizeId)(t),this.schemas[t]||this.refs[t]}function $(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let r in t)this.addSchema(t[r],r)}function w(){for(let t in this.opts.formats){let r=this.opts.formats[t];r&&this.addFormat(t,r)}}function E(t){if(Array.isArray(t))return void this.addVocabulary(t);for(let r in this.logger.warn("keywords option as map is deprecated, pass array"),t){let o=t[r];o.keyword||(o.keyword=r),this.addKeyword(o)}}function R(){let t={...this.opts};for(let r of m)delete t[r];return t}b.ValidationError=a.default,b.MissingRefError=i.default,t.default=b;let P={log(){},warn(){},error(){}},k=/^[a-z_$][a-z0-9_$:-]*$/i;function O(t,r){let{RULES:o}=this;if((0,d.eachItem)(t,t=>{if(o.keywords[t])throw Error(`Keyword ${t} is already defined`);if(!k.test(t))throw Error(`Keyword ${t} has invalid name`)}),r&&r.$data&&!("code"in r||"validate"in r))throw Error('$data keyword must have "code" or "validate" function')}function T(t,r,o){var a;let i=null==r?void 0:r.post;if(o&&i)throw Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,n=i?s.post:s.rules.find(({type:t})=>t===o);if(n||(n={type:o,rules:[]},s.rules.push(n)),s.keywords[t]=!0,!r)return;let l={keyword:t,definition:{...r,type:(0,u.getJSONTypes)(r.type),schemaType:(0,u.getJSONTypes)(r.schemaType)}};r.before?x.call(this,n,l,r.before):n.rules.push(l),s.all[t]=l,null==(a=r.implements)||a.forEach(t=>this.addKeyword(t))}function x(t,r,o){let a=t.rules.findIndex(t=>t.keyword===o);a>=0?t.rules.splice(a,0,r):(t.rules.push(r),this.logger.warn(`rule ${o} is not defined`))}function j(t){let{metaSchema:r}=t;void 0!==r&&(t.$data&&this.opts.$data&&(r=N(r)),t.validateSchema=this.compile(r,!0))}let C={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function N(t){return{anyOf:[t,C]}}}),cH=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}}),cK=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;let r=cM(),o=cO(),a=cb(),i=cS(),s=cq(),n=c_();function l(t,r){let{gen:o}=t;return r.validate?o.scopeValue("validate",{ref:r.validate}):(0,a._)`${o.scopeValue("wrapper",{ref:r})}.validate`}function c(t,r,s,l){let{gen:c,it:u}=t,{allErrors:d,schemaEnv:p,opts:h}=u,f=h.passContext?i.default.this:a.nil;function m(t){let r=(0,a._)`${t}.errors`;c.assign(i.default.vErrors,(0,a._)`${i.default.vErrors} === null ? ${r} : ${i.default.vErrors}.concat(${r})`),c.assign(i.default.errors,(0,a._)`${i.default.vErrors}.length`)}function y(t){var r;if(!u.opts.unevaluated)return;let o=null==(r=null==s?void 0:s.validate)?void 0:r.evaluated;if(!0!==u.props)if(o&&!o.dynamicProps)void 0!==o.props&&(u.props=n.mergeEvaluated.props(c,o.props,u.props));else{let r=c.var("props",(0,a._)`${t}.evaluated.props`);u.props=n.mergeEvaluated.props(c,r,u.props,a.Name)}if(!0!==u.items)if(o&&!o.dynamicItems)void 0!==o.items&&(u.items=n.mergeEvaluated.items(c,o.items,u.items));else{let r=c.var("items",(0,a._)`${t}.evaluated.items`);u.items=n.mergeEvaluated.items(c,r,u.items,a.Name)}}l?function(){if(!p.$async)throw Error("async schema referenced by sync schema");let i=c.let("valid");c.try(()=>{c.code((0,a._)`await ${(0,o.callValidateCode)(t,r,f)}`),y(r),d||c.assign(i,!0)},t=>{c.if((0,a._)`!(${t} instanceof ${u.ValidationError})`,()=>c.throw(t)),m(t),d||c.assign(i,!1)}),t.ok(i)}():t.result((0,o.callValidateCode)(t,r,f),()=>y(r),()=>m(r))}t.getValidate=l,t.callRef=c,t.default={keyword:"$ref",schemaType:"string",code(t){var o,i;let n,u,d,{gen:p,schema:h,it:f}=t,{baseId:m,schemaEnv:y,validateName:g,opts:v,self:b}=f,{root:_}=y;if(("#"===h||"#/"===h)&&m===_.baseId){if(y===_)return c(t,g,y,y.$async);let r=p.scopeValue("root",{ref:_});return c(t,(0,a._)`${r}.validate`,_,_.$async)}let S=s.resolveRef.call(b,_,m,h);if(void 0===S)throw new r.default(f.opts.uriResolver,m,h);return S instanceof s.SchemaEnv?void c(t,l(t,o=S),o,o.$async):(i=S,n=p.scopeValue("schema",!0===v.code.source?{ref:i,code:(0,a.stringify)(i)}:{ref:i}),u=p.name("valid"),d=t.subschema({schema:i,dataTypes:[],schemaPath:a.nil,topSchemaRef:n,errSchemaPath:h},u),void(t.mergeEvaluated(d),t.ok(u)))}}}),cJ=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cH(),o=cK();t.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,o.default]}),cB=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb(),o=r.operators,a={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}};t.default={keyword:Object.keys(a),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:t,schemaCode:o})=>(0,r.str)`must be ${a[t].okStr} ${o}`,params:({keyword:t,schemaCode:o})=>(0,r._)`{comparison: ${a[t].okStr}, limit: ${o}}`},code(t){let{keyword:o,data:i,schemaCode:s}=t;t.fail$data((0,r._)`${i} ${a[o].fail} ${s} || isNaN(${i})`)}}}),cG=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb();t.default={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:t})=>(0,r.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,r._)`{multipleOf: ${t}}`},code(t){let{gen:o,data:a,schemaCode:i,it:s}=t,n=s.opts.multipleOfPrecision,l=o.let("res"),c=n?(0,r._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${n}`:(0,r._)`${l} !== parseInt(${l})`;t.fail$data((0,r._)`(${i} === 0 || (${l} = ${a}/${i}, ${c}))`)}}}),cZ=ea(t=>{function r(t){let r,o=t.length,a=0,i=0;for(;i<o;)a++,(r=t.charCodeAt(i++))>=55296&&r<=56319&&i<o&&(64512&(r=t.charCodeAt(i)))==56320&&i++;return a}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'}),cW=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb(),o=c_(),a=cZ();t.default={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:t,schemaCode:o})=>(0,r.str)`must NOT have ${"maxLength"===t?"more":"fewer"} than ${o} characters`,params:({schemaCode:t})=>(0,r._)`{limit: ${t}}`},code(t){let{keyword:i,data:s,schemaCode:n,it:l}=t,c="maxLength"===i?r.operators.GT:r.operators.LT,u=!1===l.opts.unicode?(0,r._)`${s}.length`:(0,r._)`${(0,o.useFunc)(t.gen,a.default)}(${s})`;t.fail$data((0,r._)`${u} ${c} ${n}`)}}}),cX=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cO(),o=c_(),a=cb();t.default={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>(0,a.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,a._)`{pattern: ${t}}`},code(t){let{gen:i,data:s,$data:n,schema:l,schemaCode:c,it:u}=t,d=u.opts.unicodeRegExp?"u":"";if(n){let{regExp:r}=u.opts.code,n="new RegExp"===r.code?(0,a._)`new RegExp`:(0,o.useFunc)(i,r),l=i.let("valid");i.try(()=>i.assign(l,(0,a._)`${n}(${c}, ${d}).test(${s})`),()=>i.assign(l,!1)),t.fail$data((0,a._)`!${l}`)}else{let o=(0,r.usePattern)(t,l);t.fail$data((0,a._)`!${o}.test(${s})`)}}}}),cY=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb();t.default={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:t,schemaCode:o})=>(0,r.str)`must NOT have ${"maxProperties"===t?"more":"fewer"} than ${o} properties`,params:({schemaCode:t})=>(0,r._)`{limit: ${t}}`},code(t){let{keyword:o,data:a,schemaCode:i}=t,s="maxProperties"===o?r.operators.GT:r.operators.LT;t.fail$data((0,r._)`Object.keys(${a}).length ${s} ${i}`)}}}),cQ=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cO(),o=cb(),a=c_();t.default={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:t}})=>(0,o.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,o._)`{missingProperty: ${t}}`},code(t){let{gen:i,schema:s,schemaCode:n,data:l,$data:c,it:u}=t,{opts:d}=u;if(!c&&0===s.length)return;let p=s.length>=d.loopRequired;if(u.allErrors?function(){if(p||c)t.block$data(o.nil,h);else for(let o of s)(0,r.checkReportMissingProp)(t,o)}():function(){let a=i.let("missing");if(p||c){let s=i.let("valid",!0);t.block$data(s,()=>{var c,u;return c=a,u=s,void(t.setParams({missingProperty:c}),i.forOf(c,n,()=>{i.assign(u,(0,r.propertyInData)(i,l,c,d.ownProperties)),i.if((0,o.not)(u),()=>{t.error(),i.break()})},o.nil))}),t.ok(s)}else i.if((0,r.checkMissingProp)(t,s,a)),(0,r.reportMissingProp)(t,a),i.else()}(),d.strictRequired){let r=t.parentSchema.properties,{definedProperties:o}=t.it;for(let t of s)if((null==r?void 0:r[t])===void 0&&!o.has(t)){let r=`required property "${t}" is not defined at "${u.schemaEnv.baseId+u.errSchemaPath}" (strictRequired)`;(0,a.checkStrictMode)(u,r,u.opts.strictRequired)}}function h(){i.forOf("prop",n,o=>{t.setParams({missingProperty:o}),i.if((0,r.noPropertyInData)(i,l,o,d.ownProperties),()=>t.error())})}}}}),c0=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb();t.default={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:t,schemaCode:o})=>(0,r.str)`must NOT have ${"maxItems"===t?"more":"fewer"} than ${o} items`,params:({schemaCode:t})=>(0,r._)`{limit: ${t}}`},code(t){let{keyword:o,data:a,schemaCode:i}=t,s="maxItems"===o?r.operators.GT:r.operators.LT;t.fail$data((0,r._)`${a}.length ${s} ${i}`)}}}),c1=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cj();r.code='require("ajv/dist/runtime/equal").default',t.default=r}),c2=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cP(),o=cb(),a=c_(),i=c1();t.default={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:t,j:r}})=>(0,o.str)`must NOT have duplicate items (items ## ${r} and ${t} are identical)`,params:({params:{i:t,j:r}})=>(0,o._)`{i: ${t}, j: ${r}}`},code(t){let{gen:s,data:n,$data:l,schema:c,parentSchema:u,schemaCode:d,it:p}=t;if(!l&&!c)return;let h=s.let("valid"),f=u.items?(0,r.getSchemaTypes)(u.items):[];t.block$data(h,function(){let l=s.let("i",(0,o._)`${n}.length`),c=s.let("j");t.setParams({i:l,j:c}),s.assign(h,!0),s.if((0,o._)`${l} > 1`,()=>(f.length>0&&!f.some(t=>"object"===t||"array"===t)?function(a,i){let l=s.name("item"),c=(0,r.checkDataTypes)(f,l,p.opts.strictNumbers,r.DataType.Wrong),u=s.const("indices",(0,o._)`{}`);s.for((0,o._)`;${a}--;`,()=>{s.let(l,(0,o._)`${n}[${a}]`),s.if(c,(0,o._)`continue`),f.length>1&&s.if((0,o._)`typeof ${l} == "string"`,(0,o._)`${l} += "_"`),s.if((0,o._)`typeof ${u}[${l}] == "number"`,()=>{s.assign(i,(0,o._)`${u}[${l}]`),t.error(),s.assign(h,!1).break()}).code((0,o._)`${u}[${l}] = ${a}`)})}:function(r,l){let c=(0,a.useFunc)(s,i.default),u=s.name("outer");s.label(u).for((0,o._)`;${r}--;`,()=>s.for((0,o._)`${l} = ${r}; ${l}--;`,()=>s.if((0,o._)`${c}(${n}[${r}], ${n}[${l}])`,()=>{t.error(),s.assign(h,!1).break(u)})))})(l,c))},(0,o._)`${d} === false`),t.ok(h)}}}),c9=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb(),o=c_(),a=c1();t.default={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:t})=>(0,r._)`{allowedValue: ${t}}`},code(t){let{gen:i,data:s,$data:n,schemaCode:l,schema:c}=t;n||c&&"object"==typeof c?t.fail$data((0,r._)`!${(0,o.useFunc)(i,a.default)}(${s}, ${l})`):t.fail((0,r._)`${c} !== ${s}`)}}}),c4=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb(),o=c_(),a=c1();t.default={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,r._)`{allowedValues: ${t}}`},code(t){let i,s,{gen:n,data:l,$data:c,schema:u,schemaCode:d,it:p}=t;if(!c&&0===u.length)throw Error("enum must have non-empty array");let h=u.length>=p.opts.loopEnum,f=()=>null!=i?i:i=(0,o.useFunc)(n,a.default);if(h||c)s=n.let("valid"),t.block$data(s,function(){n.assign(s,!1),n.forOf("v",d,t=>n.if((0,r._)`${f()}(${l}, ${t})`,()=>n.assign(s,!0).break()))});else{if(!Array.isArray(u))throw Error("ajv implementation error");let t=n.const("vSchema",d);s=(0,r.or)(...u.map((o,a)=>{var i,s;let n;return i=t,"object"==typeof(n=u[s=a])&&null!==n?(0,r._)`${f()}(${l}, ${i}[${s}])`:(0,r._)`${l} === ${n}`}))}t.pass(s)}}}),c5=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cB(),o=cG(),a=cW(),i=cX(),s=cY(),n=cQ(),l=c0(),c=c2(),u=c9(),d=c4();t.default=[r.default,o.default,a.default,i.default,s.default,n.default,l.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,d.default]}),c3=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;let r=cb(),o=c_();function a(t,a){let{gen:i,schema:s,data:n,keyword:l,it:c}=t;c.items=!0;let u=i.const("len",(0,r._)`${n}.length`);if(!1===s)t.setParams({len:a.length}),t.pass((0,r._)`${u} <= ${a.length}`);else if("object"==typeof s&&!(0,o.alwaysValidSchema)(c,s)){let s=i.var("valid",(0,r._)`${u} <= ${a.length}`);i.if((0,r.not)(s),()=>{var n;return n=s,void i.forRange("i",a.length,u,a=>{t.subschema({keyword:l,dataProp:a,dataPropType:o.Type.Num},n),c.allErrors||i.if((0,r.not)(n),()=>i.break())})}),t.ok(s)}}t.validateAdditionalItems=a,t.default={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:t}})=>(0,r.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,r._)`{limit: ${t}}`},code(t){let{parentSchema:r,it:i}=t,{items:s}=r;Array.isArray(s)?a(t,s):(0,o.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas')}}}),c6=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;let r=cb(),o=c_(),a=cO();function i(t,a,s=t.schema){let{gen:n,parentSchema:l,data:c,keyword:u,it:d}=t;(function(t){let{opts:r,errSchemaPath:i}=d,n=s.length,l=n===t.minItems&&(n===t.maxItems||!1===t[a]);if(r.strictTuples&&!l){let t=`"${u}" is ${n}-tuple, but minItems or maxItems/${a} are not specified or different at path "${i}"`;(0,o.checkStrictMode)(d,t,r.strictTuples)}})(l),d.opts.unevaluated&&s.length&&!0!==d.items&&(d.items=o.mergeEvaluated.items(n,s.length,d.items));let p=n.name("valid"),h=n.const("len",(0,r._)`${c}.length`);s.forEach((a,i)=>{(0,o.alwaysValidSchema)(d,a)||(n.if((0,r._)`${h} > ${i}`,()=>t.subschema({keyword:u,schemaProp:i,dataProp:i},p)),t.ok(p))})}t.validateTuple=i,t.default={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:r,it:s}=t;if(Array.isArray(r))return i(t,"additionalItems",r);s.items=!0,(0,o.alwaysValidSchema)(s,r)||t.ok((0,a.validateArray)(t))}}}),c8=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=c6();t.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,r.validateTuple)(t,"items")}}),c7=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb(),o=c_(),a=cO(),i=c3();t.default={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:t}})=>(0,r.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,r._)`{limit: ${t}}`},code(t){let{schema:r,parentSchema:s,it:n}=t,{prefixItems:l}=s;n.items=!0,(0,o.alwaysValidSchema)(n,r)||(l?(0,i.validateAdditionalItems)(t,l):t.ok((0,a.validateArray)(t)))}}}),ue=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb(),o=c_();t.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:t,max:o}})=>void 0===o?(0,r.str)`must contain at least ${t} valid item(s)`:(0,r.str)`must contain at least ${t} and no more than ${o} valid item(s)`,params:({params:{min:t,max:o}})=>void 0===o?(0,r._)`{minContains: ${t}}`:(0,r._)`{minContains: ${t}, maxContains: ${o}}`},code(t){let a,i,{gen:s,schema:n,parentSchema:l,data:c,it:u}=t,{minContains:d,maxContains:p}=l;u.opts.next?(a=void 0===d?1:d,i=p):a=1;let h=s.const("len",(0,r._)`${c}.length`);if(t.setParams({min:a,max:i}),void 0===i&&0===a)return void(0,o.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==i&&a>i){(0,o.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,o.alwaysValidSchema)(u,n)){let o=(0,r._)`${h} >= ${a}`;void 0!==i&&(o=(0,r._)`${o} && ${h} <= ${i}`),t.pass(o);return}u.items=!0;let f=s.name("valid");function m(){let t=s.name("_valid"),o=s.let("count",0);y(t,()=>s.if(t,()=>{var t;return t=o,void(s.code((0,r._)`${t}++`),void 0===i?s.if((0,r._)`${t} >= ${a}`,()=>s.assign(f,!0).break()):(s.if((0,r._)`${t} > ${i}`,()=>s.assign(f,!1).break()),1===a?s.assign(f,!0):s.if((0,r._)`${t} >= ${a}`,()=>s.assign(f,!0))))}))}function y(r,a){s.forRange("i",0,h,i=>{t.subschema({keyword:"contains",dataProp:i,dataPropType:o.Type.Num,compositeRule:!0},r),a()})}void 0===i&&1===a?y(f,()=>s.if(f,()=>s.break())):0===a?(s.let(f,!0),void 0!==i&&s.if((0,r._)`${c}.length > 0`,m)):(s.let(f,!1),m()),t.result(f,()=>t.reset())}}}),ut=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;let r=cb(),o=c_(),a=cO();t.error={message:({params:{property:t,depsCount:o,deps:a}})=>(0,r.str)`must have ${1===o?"property":"properties"} ${a} when property ${t} is present`,params:({params:{property:t,depsCount:o,deps:a,missingProperty:i}})=>(0,r._)`{property: ${t},
|
|
59
|
+
missingProperty: ${i},
|
|
60
|
+
depsCount: ${o},
|
|
61
|
+
deps: ${a}}`};let i={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(t){let[r,o]=function({schema:t}){let r={},o={};for(let a in t)"__proto__"!==a&&((Array.isArray(t[a])?r:o)[a]=t[a]);return[r,o]}(t);s(t,r),n(t,o)}};function s(t,o=t.schema){let{gen:i,data:n,it:l}=t;if(0===Object.keys(o).length)return;let c=i.let("missing");for(let s in o){let u=o[s];if(0===u.length)continue;let d=(0,a.propertyInData)(i,n,s,l.opts.ownProperties);t.setParams({property:s,depsCount:u.length,deps:u.join(", ")}),l.allErrors?i.if(d,()=>{for(let r of u)(0,a.checkReportMissingProp)(t,r)}):(i.if((0,r._)`${d} && (${(0,a.checkMissingProp)(t,u,c)})`),(0,a.reportMissingProp)(t,c),i.else())}}function n(t,r=t.schema){let{gen:i,data:s,keyword:l,it:c}=t,u=i.name("valid");for(let n in r)(0,o.alwaysValidSchema)(c,r[n])||(i.if((0,a.propertyInData)(i,s,n,c.opts.ownProperties),()=>{let r=t.subschema({keyword:l,schemaProp:n},u);t.mergeValidEvaluated(r,u)},()=>i.var(u,!0)),t.ok(u))}t.validatePropertyDeps=s,t.validateSchemaDeps=n,t.default=i}),ur=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb(),o=c_();t.default={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:t})=>(0,r._)`{propertyName: ${t.propertyName}}`},code(t){let{gen:a,schema:i,data:s,it:n}=t;if((0,o.alwaysValidSchema)(n,i))return;let l=a.name("valid");a.forIn("key",s,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},l),a.if((0,r.not)(l),()=>{t.error(!0),n.allErrors||a.break()})}),t.ok(l)}}}),uo=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cO(),o=cb(),a=cS(),i=c_();t.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:t})=>(0,o._)`{additionalProperty: ${t.additionalProperty}}`},code(t){let{gen:s,schema:n,parentSchema:l,data:c,errsCount:u,it:d}=t;if(!u)throw Error("ajv implementation error");let{allErrors:p,opts:h}=d;if(d.props=!0,"all"!==h.removeAdditional&&(0,i.alwaysValidSchema)(d,n))return;let f=(0,r.allSchemaProperties)(l.properties),m=(0,r.allSchemaProperties)(l.patternProperties);function y(t){s.code((0,o._)`delete ${c}[${t}]`)}function g(r){if("all"===h.removeAdditional||h.removeAdditional&&!1===n)return void y(r);if(!1===n){t.setParams({additionalProperty:r}),t.error(),p||s.break();return}if("object"==typeof n&&!(0,i.alwaysValidSchema)(d,n)){let a=s.name("valid");"failing"===h.removeAdditional?(v(r,a,!1),s.if((0,o.not)(a),()=>{t.reset(),y(r)})):(v(r,a),p||s.if((0,o.not)(a),()=>s.break()))}}function v(r,o,a){let s={keyword:"additionalProperties",dataProp:r,dataPropType:i.Type.Str};!1===a&&Object.assign(s,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(s,o)}s.forIn("key",c,a=>{f.length||m.length?s.if(function(a){let n;if(f.length>8){let t=(0,i.schemaRefOrVal)(d,l.properties,"properties");n=(0,r.isOwnProperty)(s,t,a)}else n=f.length?(0,o.or)(...f.map(t=>(0,o._)`${a} === ${t}`)):o.nil;return m.length&&(n=(0,o.or)(n,...m.map(i=>(0,o._)`${(0,r.usePattern)(t,i)}.test(${a})`))),(0,o.not)(n)}(a),()=>g(a)):g(a)}),t.ok((0,o._)`${u} === ${a.default.errors}`)}}}),ua=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cI(),o=cO(),a=c_(),i=uo();t.default={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:s,schema:n,parentSchema:l,data:c,it:u}=t;"all"===u.opts.removeAdditional&&void 0===l.additionalProperties&&i.default.code(new r.KeywordCxt(u,i.default,"additionalProperties"));let d=(0,o.allSchemaProperties)(n);for(let t of d)u.definedProperties.add(t);u.opts.unevaluated&&d.length&&!0!==u.props&&(u.props=a.mergeEvaluated.props(s,(0,a.toHash)(d),u.props));let p=d.filter(t=>!(0,a.alwaysValidSchema)(u,n[t]));if(0===p.length)return;let h=s.name("valid");for(let r of p){var f;(f=r,u.opts.useDefaults&&!u.compositeRule&&void 0!==n[f].default)?m(r):(s.if((0,o.propertyInData)(s,c,r,u.opts.ownProperties)),m(r),u.allErrors||s.else().var(h,!0),s.endIf()),t.it.definedProperties.add(r),t.ok(h)}function m(r){t.subschema({keyword:"properties",schemaProp:r,dataProp:r},h)}}}}),ui=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cO(),o=cb(),a=c_(),i=c_();t.default={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:s,schema:n,data:l,parentSchema:c,it:u}=t,{opts:d}=u,p=(0,r.allSchemaProperties)(n),h=p.filter(t=>(0,a.alwaysValidSchema)(u,n[t]));if(0===p.length||h.length===p.length&&(!u.opts.unevaluated||!0===u.props))return;let f=d.strictSchema&&!d.allowMatchingProperties&&c.properties,m=s.name("valid");!0===u.props||u.props instanceof o.Name||(u.props=(0,i.evaluatedPropsToName)(s,u.props));let{props:y}=u;for(let t of p)f&&function(t){for(let r in f)new RegExp(t).test(r)&&(0,a.checkStrictMode)(u,`property ${r} matches pattern ${t} (use allowMatchingProperties)`)}(t),u.allErrors?g(t):(s.var(m,!0),g(t),s.if(m));function g(a){s.forIn("key",l,n=>{s.if((0,o._)`${(0,r.usePattern)(t,a)}.test(${n})`,()=>{let r=h.includes(a);r||t.subschema({keyword:"patternProperties",schemaProp:a,dataProp:n,dataPropType:i.Type.Str},m),u.opts.unevaluated&&!0!==y?s.assign((0,o._)`${y}[${n}]`,!0):r||u.allErrors||s.if((0,o.not)(m),()=>s.break())})})}}}}),us=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=c_();t.default={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:o,schema:a,it:i}=t;if((0,r.alwaysValidSchema)(i,a))return void t.fail();let s=o.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}}}),un=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:cO().validateUnion,error:{message:"must match a schema in anyOf"}}}),ul=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb(),o=c_();t.default={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:t})=>(0,r._)`{passingSchemas: ${t.passing}}`},code(t){let{gen:a,schema:i,parentSchema:s,it:n}=t;if(!Array.isArray(i))throw Error("ajv implementation error");if(n.opts.discriminator&&s.discriminator)return;let l=a.let("valid",!1),c=a.let("passing",null),u=a.name("_valid");t.setParams({passing:c}),a.block(function(){i.forEach((i,s)=>{let d;(0,o.alwaysValidSchema)(n,i)?a.var(u,!0):d=t.subschema({keyword:"oneOf",schemaProp:s,compositeRule:!0},u),s>0&&a.if((0,r._)`${u} && ${l}`).assign(l,!1).assign(c,(0,r._)`[${c}, ${s}]`).else(),a.if(u,()=>{a.assign(l,!0),a.assign(c,s),d&&t.mergeEvaluated(d,r.Name)})})}),t.result(l,()=>t.reset(),()=>t.error(!0))}}}),uc=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=c_();t.default={keyword:"allOf",schemaType:"array",code(t){let{gen:o,schema:a,it:i}=t;if(!Array.isArray(a))throw Error("ajv implementation error");let s=o.name("valid");a.forEach((o,a)=>{if((0,r.alwaysValidSchema)(i,o))return;let n=t.subschema({keyword:"allOf",schemaProp:a},s);t.ok(s),t.mergeEvaluated(n)})}}}),uu=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb(),o=c_();function a(t,r){let a=t.schema[r];return void 0!==a&&!(0,o.alwaysValidSchema)(t,a)}t.default={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:t})=>(0,r.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,r._)`{failingKeyword: ${t.ifClause}}`},code(t){let i,{gen:s,parentSchema:n,it:l}=t;void 0===n.then&&void 0===n.else&&(0,o.checkStrictMode)(l,'"if" without "then" and "else" is ignored');let c=a(l,"then"),u=a(l,"else");if(!c&&!u)return;let d=s.let("valid",!0),p=s.name("_valid");if(i=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},p),t.mergeEvaluated(i),t.reset(),c&&u){let r=s.let("ifClause");t.setParams({ifClause:r}),s.if(p,h("then",r),h("else",r))}else c?s.if(p,h("then")):s.if((0,r.not)(p),h("else"));function h(o,a){return()=>{let i=t.subschema({keyword:o},p);s.assign(d,p),t.mergeValidEvaluated(i,d),a?s.assign(a,(0,r._)`${o}`):t.setParams({ifClause:o})}}t.pass(d,()=>t.error(!0))}}}),ud=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=c_();t.default={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:o,it:a}){void 0===o.if&&(0,r.checkStrictMode)(a,`"${t}" without "if" is ignored`)}}}),up=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=c3(),o=c8(),a=c6(),i=c7(),s=ue(),n=ut(),l=ur(),c=uo(),u=ua(),d=ui(),p=us(),h=un(),f=ul(),m=uc(),y=uu(),g=ud();t.default=function(t=!1){let v=[p.default,h.default,f.default,m.default,y.default,g.default,l.default,c.default,n.default,u.default,d.default];return t?v.push(o.default,i.default):v.push(r.default,a.default),v.push(s.default),v}}),uh=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb();t.default={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>(0,r.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,r._)`{format: ${t}}`},code(t,o){let a,i,s,n,l,c,{gen:u,data:d,$data:p,schema:h,schemaCode:f,it:m}=t,{opts:y,errSchemaPath:g,schemaEnv:v,self:b}=m;y.validateFormats&&(p?(a=u.scopeValue("formats",{ref:b.formats,code:y.code.formats}),i=u.const("fDef",(0,r._)`${a}[${f}]`),s=u.let("fType"),n=u.let("format"),u.if((0,r._)`typeof ${i} == "object" && !(${i} instanceof RegExp)`,()=>u.assign(s,(0,r._)`${i}.type || "string"`).assign(n,(0,r._)`${i}.validate`),()=>u.assign(s,(0,r._)`"string"`).assign(n,i)),t.fail$data((0,r.or)(!1===y.strictSchema?r.nil:(0,r._)`${f} && !${n}`,(l=v.$async?(0,r._)`(${i}.async ? await ${n}(${d}) : ${n}(${d}))`:(0,r._)`${n}(${d})`,c=(0,r._)`(typeof ${n} == "function" ? ${l} : ${n}.test(${d}))`,(0,r._)`${n} && ${n} !== true && ${s} === ${o} && !${c}`)))):function(){var a;let i,s,n=b.formats[h];if(!n){if(!1===y.strictSchema)return b.logger.warn(l());throw Error(l());function l(){return`unknown format "${h}" ignored in schema at path "${g}"`}}if(!0===n)return;let[c,p,f]=(i=(a=n)instanceof RegExp?(0,r.regexpCode)(a):y.code.formats?(0,r._)`${y.code.formats}${(0,r.getProperty)(h)}`:void 0,s=u.scopeValue("formats",{key:h,ref:a,code:i}),"object"!=typeof a||a instanceof RegExp?["string",a,s]:[a.type||"string",a.validate,(0,r._)`${s}.validate`]);c===o&&t.pass(function(){if("object"==typeof n&&!(n instanceof RegExp)&&n.async){if(!v.$async)throw Error("async format in sync schema");return(0,r._)`await ${f}(${d})`}return"function"==typeof p?(0,r._)`${f}(${d})`:(0,r._)`${f}.test(${d})`}())}())}}}),uf=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=[uh().default]}),um=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),uy=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cJ(),o=c5(),a=up(),i=uf(),s=um();t.default=[r.default,o.default,(0,a.default)(),i.default,s.metadataVocabulary,s.contentVocabulary]}),ug=ea(t=>{var r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,(o=r||(t.DiscrError=r={})).Tag="tag",o.Mapping="mapping"}),uv=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb(),o=ug(),a=cq(),i=cM(),s=c_();t.default={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:t,tagName:r}})=>t===o.DiscrError.Tag?`tag "${r}" must be string`:`value of tag "${r}" must be in oneOf`,params:({params:{discrError:t,tag:o,tagName:a}})=>(0,r._)`{error: ${t}, tag: ${a}, tagValue: ${o}}`},code(t){let{gen:n,data:l,schema:c,parentSchema:u,it:d}=t,{oneOf:p}=u;if(!d.opts.discriminator)throw Error("discriminator: requires discriminator option");let h=c.propertyName;if("string"!=typeof h)throw Error("discriminator: requires propertyName");if(c.mapping)throw Error("discriminator: mapping is not supported");if(!p)throw Error("discriminator: requires oneOf keyword");let f=n.let("valid",!1),m=n.const("tag",(0,r._)`${l}${(0,r.getProperty)(h)}`);n.if((0,r._)`typeof ${m} == "string"`,()=>(function(){let l=function(){var t;let r={},o=l(u),n=!0;for(let r=0;r<p.length;r++){let u=p[r];if((null==u?void 0:u.$ref)&&!(0,s.schemaHasRulesButRef)(u,d.self.RULES)){let t=u.$ref;if((u=a.resolveRef.call(d.self,d.schemaEnv.root,d.baseId,t))instanceof a.SchemaEnv&&(u=u.schema),void 0===u)throw new i.default(d.opts.uriResolver,d.baseId,t)}let f=null==(t=null==u?void 0:u.properties)?void 0:t[h];if("object"!=typeof f)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${h}"`);n=n&&(o||l(u)),function(t,r){if(t.const)c(t.const,r);else if(t.enum)for(let o of t.enum)c(o,r);else throw Error(`discriminator: "properties/${h}" must have "const" or "enum"`)}(f,r)}if(!n)throw Error(`discriminator: "${h}" must be required`);return r;function l({required:t}){return Array.isArray(t)&&t.includes(h)}function c(t,o){if("string"!=typeof t||t in r)throw Error(`discriminator: "${h}" values must be unique strings`);r[t]=o}}();for(let o in n.if(!1),l)n.elseIf((0,r._)`${m} === ${o}`),n.assign(f,function(o){let a=n.name("valid"),i=t.subschema({keyword:"oneOf",schemaProp:o},a);return t.mergeEvaluated(i,r.Name),a}(l[o]));n.else(),t.error(!1,{discrError:o.DiscrError.Mapping,tag:m,tagName:h}),n.endIf()})(),()=>t.error(!1,{discrError:o.DiscrError.Tag,tag:m,tagName:h})),t.ok(f)}}}),ub=ea((t,r)=>{r.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}}),u_=ea((t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;let o=cF(),a=uy(),i=uv(),s=ub(),n=["/properties"],l="http://json-schema.org/draft-07/schema";var c=class extends o.default{_addVocabularies(){super._addVocabularies(),a.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(s,n):s;this.addMetaSchema(t,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}};t.Ajv=c,r.exports=t=c,r.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=cI();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=cb();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var p=cA();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return p.default}});var h=cM();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})}),uS=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.dynamicAnchor=void 0;let r=cb(),o=cS(),a=cq(),i=cK();function s(t,s){let{gen:n,it:l}=t;l.schemaEnv.root.dynamicAnchors[s]=!0;let c=(0,r._)`${o.default.dynamicAnchors}${(0,r.getProperty)(s)}`,u="#"===l.errSchemaPath?l.validateName:function(t){let{schemaEnv:r,schema:o,self:s}=t.it,{root:n,baseId:l,localRefs:c,meta:u}=r.root,{schemaId:d}=s.opts,p=new a.SchemaEnv({schema:o,schemaId:d,root:n,baseId:l,localRefs:c,meta:u});return a.compileSchema.call(s,p),(0,i.getValidate)(t,p)}(t);n.if((0,r._)`!${c}`,()=>n.assign(c,u))}t.dynamicAnchor=s,t.default={keyword:"$dynamicAnchor",schemaType:"string",code:t=>s(t,t.schema)}}),u$=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.dynamicRef=void 0;let r=cb(),o=cS(),a=cK();function i(t,i){let{gen:s,keyword:n,it:l}=t;if("#"!==i[0])throw Error(`"${n}" only supports hash fragment reference`);let c=i.slice(1);if(l.allErrors)u();else{let r=s.let("valid",!1);u(r),t.ok(r)}function u(t){if(l.schemaEnv.root.dynamicAnchors[c]){let a=s.let("_v",(0,r._)`${o.default.dynamicAnchors}${(0,r.getProperty)(c)}`);s.if(a,d(a,t),d(l.validateName,t))}else d(l.validateName,t)()}function d(r,o){return o?()=>s.block(()=>{(0,a.callRef)(t,r),s.let(o,!0)}):()=>(0,a.callRef)(t,r)}}t.dynamicRef=i,t.default={keyword:"$dynamicRef",schemaType:"string",code:t=>i(t,t.schema)}}),uw=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=uS(),o=c_();t.default={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){t.schema?(0,r.dynamicAnchor)(t,""):(0,o.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}}}),uE=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=u$();t.default={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,r.dynamicRef)(t,t.schema)}}),uR=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=uS(),o=u$(),a=uw(),i=uE();t.default=[r.default,o.default,a.default,i.default]}),uP=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=ut();t.default={keyword:"dependentRequired",type:"object",schemaType:"object",error:r.error,code:t=>(0,r.validatePropertyDeps)(t)}}),uk=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=ut();t.default={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,r.validateSchemaDeps)(t)}}),uO=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=c_();t.default={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:o,it:a}){void 0===o.contains&&(0,r.checkStrictMode)(a,`"${t}" without "contains" is ignored`)}}}),uT=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=uP(),o=uk(),a=uO();t.default=[r.default,o.default,a.default]}),ux=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb(),o=c_(),a=cS();t.default={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:t})=>(0,r._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},code(t){let{gen:i,schema:s,data:n,errsCount:l,it:c}=t;if(!l)throw Error("ajv implementation error");let{allErrors:u,props:d}=c;function p(a){if(!1===s){t.setParams({unevaluatedProperty:a}),t.error(),u||i.break();return}if(!(0,o.alwaysValidSchema)(c,s)){let s=i.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:a,dataPropType:o.Type.Str},s),u||i.if((0,r.not)(s),()=>i.break())}}d instanceof r.Name?i.if((0,r._)`${d} !== true`,()=>i.forIn("key",n,t=>{var o,a;return i.if((o=d,a=t,(0,r._)`!${o} || !${o}[${a}]`),()=>p(t))})):!0!==d&&i.forIn("key",n,t=>void 0===d?p(t):i.if(function(t,o){let a=[];for(let i in t)!0===t[i]&&a.push((0,r._)`${o} !== ${i}`);return(0,r.and)(...a)}(d,t),()=>p(t))),c.props=!0,t.ok((0,r._)`${l} === ${a.default.errors}`)}}}),uj=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cb(),o=c_();t.default={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:t}})=>(0,r.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,r._)`{limit: ${t}}`},code(t){let{gen:a,schema:i,data:s,it:n}=t,l=n.items||0;if(!0===l)return;let c=a.const("len",(0,r._)`${s}.length`);if(!1===i)t.setParams({len:l}),t.fail((0,r._)`${c} > ${l}`);else if("object"==typeof i&&!(0,o.alwaysValidSchema)(n,i)){let i=a.var("valid",(0,r._)`${c} <= ${l}`);a.if((0,r.not)(i),()=>{var s,u;return s=i,u=l,void a.forRange("i",u,c,i=>{t.subschema({keyword:"unevaluatedItems",dataProp:i,dataPropType:o.Type.Num},s),n.allErrors||a.if((0,r.not)(s),()=>a.break())})}),t.ok(i)}n.items=!0}}}),uC=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=ux(),o=uj();t.default=[r.default,o.default]}),uN=ea((t,r)=>{r.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"}]}}}}}),uI=ea((t,r)=>{r.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:"#"}}}}}),uA=ea((t,r)=>{r.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:"#"}}}}),uM=ea((t,r)=>{r.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:{}}}}}),uq=ea((t,r)=>{r.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"}}}}),uz=ea((t,r)=>{r.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}}}}),uL=ea((t,r)=>{r.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:[]}}}}),uD=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=uN(),o=uI(),a=uA(),i=uM(),s=uq(),n=uz(),l=uL(),c=["/properties"];t.default=function(t){return[r,o,a,i,u(this,s),n,u(this,l)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function u(r,o){return t?r.$dataMetaSchema(o,c):o}}}),uU=ea((t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2019=void 0;let o=cF(),a=uy(),i=uR(),s=uT(),n=uC(),l=uv(),c=uD(),u="https://json-schema.org/draft/2019-09/schema";var d=class extends o.default{constructor(t={}){super({...t,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(i.default),a.default.forEach(t=>this.addVocabulary(t)),this.addVocabulary(s.default),this.addVocabulary(n.default),this.opts.discriminator&&this.addKeyword(l.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:t,meta:r}=this.opts;r&&(c.default.call(this,t),this.refs["http://json-schema.org/schema"]=u)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}};t.Ajv2019=d,r.exports=t=d,r.exports.Ajv2019=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var p=cI();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return p.KeywordCxt}});var h=cb();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});var f=cA();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var m=cM();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})}),uV=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=cJ(),o=c5(),a=up(),i=uR(),s=uT(),n=uC(),l=uf(),c=um();t.default=[i.default,r.default,o.default,(0,a.default)(!0),l.default,c.metadataVocabulary,c.contentVocabulary,s.default,n.default]}),uF=ea((t,r)=>{r.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}}}}),uH=ea((t,r)=>{r.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"}}}}}),uK=ea((t,r)=>{r.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"}}}}),uJ=ea((t,r)=>{r.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"}}}}),uB=ea((t,r)=>{r.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"}}}}),uG=ea((t,r)=>{r.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"}}}}),uZ=ea((t,r)=>{r.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}}}}),uW=ea((t,r)=>{r.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:[]}}}}),uX=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=uF(),o=uH(),a=uK(),i=uJ(),s=uB(),n=uG(),l=uZ(),c=uW(),u=["/properties"];t.default=function(t){return[r,o,a,i,s,d(this,n),l,d(this,c)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function d(r,o){return t?r.$dataMetaSchema(o,u):o}}}),uY=ea((t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;let o=cF(),a=uV(),i=uv(),s=uX(),n="https://json-schema.org/draft/2020-12/schema";var l=class extends o.default{constructor(t={}){super({...t,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),a.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:t,meta:r}=this.opts;r&&(s.default.call(this,t),this.refs["http://json-schema.org/schema"]=n)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}};t.Ajv2020=l,r.exports=t=l,r.exports.Ajv2020=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var c=cI();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=cb();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=cA();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=cM();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})}),uQ=ea(t=>{function r(t,r){return{validate:t,compare:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:r(i,s),time:r(l(!0),c),"date-time":r(p(!0),h),"iso-time":r(l(),u),"iso-date-time":r(p(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(t){return m.test(t)&&y.test(t)},"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:function(t){if(S.test(t))return!1;try{return new RegExp(t),!0}catch(t){return!1}},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:function(t){return g.lastIndex=0,g.test(t)},int32:{type:"number",validate:function(t){return Number.isInteger(t)&&t<=b&&t>=v}},int64:{type:"number",validate:function(t){return Number.isInteger(t)}},float:{type:"number",validate:_},double:{type:"number",validate:_},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),"date-time":r(/^\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,h),"iso-time":r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":r(/^\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,f),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},t.formatNames=Object.keys(t.fullFormats);let o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,a=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(t){var r;let i=o.exec(t);if(!i)return!1;let s=+i[1],n=+i[2],l=+i[3];return n>=1&&n<=12&&l>=1&&l<=(2===n&&(r=s)%4==0&&(r%100!=0||r%400==0)?29:a[n])}function s(t,r){if(t&&r)return t>r?1:t<r?-1:0}let n=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(t){return function(r){let o=n.exec(r);if(!o)return!1;let a=+o[1],i=+o[2],s=+o[3],l=o[4],c="-"===o[5]?-1:1,u=+(o[6]||0),d=+(o[7]||0);if(u>23||d>59||t&&!l)return!1;if(a<=23&&i<=59&&s<60)return!0;let p=i-d*c,h=a-u*c-(p<0);return(23===h||-1===h)&&(59===p||-1===p)&&s<61}}function c(t,r){if(!(t&&r))return;let o=new Date("2020-01-01T"+t).valueOf(),a=new Date("2020-01-01T"+r).valueOf();if(o&&a)return o-a}function u(t,r){if(!(t&&r))return;let o=n.exec(t),a=n.exec(r);if(o&&a)return(t=o[1]+o[2]+o[3])>(r=a[1]+a[2]+a[3])?1:t<r?-1:0}let d=/t|\s/i;function p(t){let r=l(t);return function(t){let o=t.split(d);return 2===o.length&&i(o[0])&&r(o[1])}}function h(t,r){if(!(t&&r))return;let o=new Date(t).valueOf(),a=new Date(r).valueOf();if(o&&a)return o-a}function f(t,r){if(!(t&&r))return;let[o,a]=t.split(d),[i,n]=r.split(d),l=s(o,i);if(void 0!==l)return l||c(a,n)}let m=/\/|:/,y=/^(?:[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,g=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,v=-0x80000000,b=0x80000000-1;function _(){return!0}let S=/[^\\]\\Z/}),u0=ea(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;let r=u_(),o=cb(),a=o.operators,i={formatMaximum:{okStr:"<=",ok:a.LTE,fail:a.GT},formatMinimum:{okStr:">=",ok:a.GTE,fail:a.LT},formatExclusiveMaximum:{okStr:"<",ok:a.LT,fail:a.GTE},formatExclusiveMinimum:{okStr:">",ok:a.GT,fail:a.LTE}};t.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:{message:({keyword:t,schemaCode:r})=>(0,o.str)`should be ${i[t].okStr} ${r}`,params:({keyword:t,schemaCode:r})=>(0,o._)`{comparison: ${i[t].okStr}, limit: ${r}}`},code(t){let a,s,{gen:n,data:l,schemaCode:c,keyword:u,it:d}=t,{opts:p,self:h}=d;if(!p.validateFormats)return;let f=new r.KeywordCxt(d,h.RULES.all.format.definition,"format");function m(t){return(0,o._)`${t}.compare(${l}, ${c}) ${i[u].fail} 0`}f.$data?(a=n.scopeValue("formats",{ref:h.formats,code:p.code.formats}),s=n.const("fmt",(0,o._)`${a}[${f.schemaCode}]`),t.fail$data((0,o.or)((0,o._)`typeof ${s} != "object"`,(0,o._)`${s} instanceof RegExp`,(0,o._)`typeof ${s}.compare != "function"`,m(s)))):function(){let r=f.schema,a=h.formats[r];if(!a||!0===a)return;if("object"!=typeof a||a instanceof RegExp||"function"!=typeof a.compare)throw Error(`"${u}": format "${r}" does not define "compare" function`);let i=n.scopeValue("formats",{key:r,ref:a,code:p.code.formats?(0,o._)`${p.code.formats}${(0,o.getProperty)(r)}`:void 0});t.fail$data(m(i))}()},dependencies:["format"]},t.default=r=>(r.addKeyword(t.formatLimitDefinition),r)}),u1=ea((t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});let o=uQ(),a=u0(),i=cb(),s=new i.Name("fullFormats"),n=new i.Name("fastFormats"),l=(t,r={keywords:!0})=>{if(Array.isArray(r))return c(t,r,o.fullFormats,s),t;let[i,l]="fast"===r.mode?[o.fastFormats,n]:[o.fullFormats,s];return c(t,r.formats||o.formatNames,i,l),r.keywords&&(0,a.default)(t),t};function c(t,r,o,a){var s;for(let n of(null!=(s=t.opts.code).formats||(s.formats=(0,i._)`require("ajv-formats/dist/formats").${a}`),r))t.addFormat(n,o[n])}l.get=(t,r="full")=>{let a=("fast"===r?o.fastFormats:o.fullFormats)[t];if(!a)throw Error(`Unknown format "${t}"`);return a},r.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l}),u2=u_(),u9=uU(),u4=uY();((t,r,o,a)=>{if(r&&"object"==typeof r||"function"==typeof r)for(var i,s=et(r),n=0,l=s.length;n<l;n++)i=s[n],eo.call(t,i)||i===o||Q(t,i,{get:(t=>r[t]).bind(null,i),enumerable:!(a=ee(r,i))||a.enumerable});return t})(Q(null!=(S=u1())?Y(er(S)):{},"default",{value:S,enumerable:!0}),S).default;u2.Ajv;let u5=require("node:process"),u3=Symbol.for("mcp.completable");function u6(t,r){return Object.defineProperty(t,u3,{value:{complete:r},enumerable:!1,writable:!1,configurable:!1}),t}function u8(t){let r="";for(let o of t)r+=String.fromCodePoint(o);return btoa(r).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function u7(t){let r=atob(t.replaceAll("-","+").replaceAll("_","/")),o=new Uint8Array(r.length);for(let t=0;t<r.length;t++)o[t]=r.codePointAt(t);return o}function de(t){let r,o=globalThis.crypto?.subtle;if(void 0===o)throw TypeError("createRequestStateCodec requires the Web Crypto API (globalThis.crypto.subtle); see https://ts.sdk.modelcontextprotocol.io/v2/troubleshooting for the Node.js polyfill instructions");let a="string"==typeof t.key?new TextEncoder().encode(t.key):Uint8Array.from(t.key);if(a.byteLength<32)throw RangeError(`createRequestStateCodec: key must be at least 32 bytes (got ${a.byteLength})`);let i=t.ttlSeconds??600;if(!Number.isFinite(i))throw RangeError("createRequestStateCodec: ttlSeconds must be a finite number");let s=t.bind,n=()=>r??=o.importKey("raw",a,{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]),l=new TextEncoder,c=async t=>u8(new Uint8Array(await o.sign("HMAC",await n(),l.encode("mcp.requestState.bind:"+t))).slice(0,16));return{async mint(t,r){let a={p:t,exp:Math.floor(Date.now()/1e3)+i};if(void 0!==s){if(void 0===r)throw TypeError("createRequestStateCodec: mint() requires ctx when a bind callback is configured");a.b=await c(s(r))}let u=u8(l.encode(JSON.stringify(a)));return`v1.${u}.${u8(new Uint8Array(await o.sign("HMAC",await n(),l.encode("v1."+u))))}`},async verify(t,r){let a,i,u=t.lastIndexOf(".");if(!t.startsWith("v1.")||u<=3)throw Error("malformed");let d=t.slice(3,u);try{a=u7(t.slice(u+1))}catch{throw Error("malformed")}if(!await o.verify("HMAC",await n(),a,l.encode("v1."+d)))throw Error("mac");try{i=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(u7(d)))}catch{throw Error("malformed")}if("number"!=typeof i.exp||i.exp<Math.floor(Date.now()/1e3))throw Error("expired");if(void 0!==s){let t=await c(s(r));if(void 0===i.b||!function(t,r){if(t.length!==r.length)return!1;let o=0;for(let a=0;a<t.length;a++)o|=t.codePointAt(a)^r.codePointAt(a);return 0===o}(i.b,t))throw Error("bind")}else if(void 0!==i.b)throw Error("bind");return i.p}}}var dt=Object.create,dr=Object.defineProperty,da=Object.getOwnPropertyDescriptor,di=Object.getOwnPropertyNames,ds=Object.getPrototypeOf,dn=Object.prototype.hasOwnProperty,dl=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),dc=(t,r,o)=>(o=null!=t?dt(ds(t)):{},((t,r,o,a)=>{if(r&&"object"==typeof r||"function"==typeof r)for(var i,s=di(r),n=0,l=s.length;n<l;n++)i=s[n],dn.call(t,i)||i===o||dr(t,i,{get:(t=>r[t]).bind(null,i),enumerable:!(a=da(r,i))||a.enumerable});return t})(!r&&t&&t.__esModule?o:dr(o,"default",{value:t,enumerable:!0}),t));let du=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),dd=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),dp=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),dh=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]),df=Symbol.for("mcp.sdk.errorBrands");function dm(t,r){let o=new Set,a=r;for(;"function"==typeof a;){let t=a.mcpBrand;Object.prototype.hasOwnProperty.call(a,"mcpBrand")&&"string"==typeof t&&o.add(t),a=Object.getPrototypeOf(a)}0!==o.size&&Object.defineProperty(t,df,{value:o,enumerable:!1,configurable:!0})}function dy(t,r){try{if("object"==typeof r&&null!==r&&Object.prototype.hasOwnProperty.call(t,"mcpBrand")&&"string"==typeof t.mcpBrand&&Object.prototype.hasOwnProperty.call(r,df)){let o=r[df];if(o&&"function"==typeof o.has&&o.has(t.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(t,r)}let dg=((R={}).InvalidRequest="invalid_request",R.InvalidClient="invalid_client",R.InvalidGrant="invalid_grant",R.UnauthorizedClient="unauthorized_client",R.UnsupportedGrantType="unsupported_grant_type",R.InvalidScope="invalid_scope",R.AccessDenied="access_denied",R.ServerError="server_error",R.TemporarilyUnavailable="temporarily_unavailable",R.UnsupportedResponseType="unsupported_response_type",R.UnsupportedTokenType="unsupported_token_type",R.InvalidToken="invalid_token",R.MethodNotAllowed="method_not_allowed",R.TooManyRequests="too_many_requests",R.InvalidClientMetadata="invalid_client_metadata",R.InvalidRedirectUri="invalid_redirect_uri",R.InsufficientScope="insufficient_scope",R.InvalidTarget="invalid_target",R);var dv=class t extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return dy(this,t)}static isInstance(t){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return dy(this,t)}constructor(t,r,o){super(r),this.code=t,this.errorUri=o,this.name="OAuthError",dm(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}static fromResponse(r){return new t(r.error,r.error_description??r.error,r.error_uri)}};let db=((P={}).NotConnected="NOT_CONNECTED",P.AlreadyConnected="ALREADY_CONNECTED",P.NotInitialized="NOT_INITIALIZED",P.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",P.RequestTimeout="REQUEST_TIMEOUT",P.ConnectionClosed="CONNECTION_CLOSED",P.SendFailed="SEND_FAILED",P.InvalidResult="INVALID_RESULT",P.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",P.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",P.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",P.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",P.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",P.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",P.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",P.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",P.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",P.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",P.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",P);var d_=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](t){return dy(this,t)}static isInstance(t){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return dy(this,t)}constructor(t,r,o){super(r),this.code=t,this.data=o,this.name="SdkError",dm(this,new.target)}},dS=class extends d_{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(t,r,o){super(t,r,o),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};let d$="2026-07-28",dw=[d$];function dE(t){return t.filter(t=>!(t>=d$))}function dR(t){return t.filter(t=>t>=d$)}function dP(t){let r=t.structuredContent;return void 0===r||!("object"!=typeof r||null===r||Array.isArray(r))||t.content?.some(t=>"text"===t.type)?t:{...t,content:[...t.content??[],{type:"text",text:JSON.stringify(r)}]}}let dk=["task","inputRequests","requestState"];function dO(t){return null===t||"object"!=typeof t||Array.isArray(t)||void 0!==t.content||dk.some(r=>r in t)?t:{...t,content:[]}}function dT(){let t,r,o,a,s,n,l,c,u,d,p,h,f,m,y,g,v,b,_,S,$,w,E,R,P,k,O,T,x,j,C,N,I,A,M,q,z,L,D,U,V,F,H,K,J,B,G,Z,W,X,Y,Q,ee,et,er,eo,ea,ei,es,en,el,ec,eu,ed,ep,eh,ef,em,ey,eg,ev,eb,e_,eS,e$,ew,eE,eR,eP,ek,eO,eT,ex,ej,eC,eN,eI,eA,eM,eq,ez,eL,eD,eU,eV,eF,eH,eK,eJ,eB,eG,eZ,eW,eX,eY,eQ,e0,e1,e2,e9,e4,e5,e3,e6,e8,e7,te,tt,tr,to,ta,ti,ts,tn,tl,tc,tu,td,tp,th,tf,tm,ty,tg,tv,tb,t_,tS,t$,tw;return i??=(t=iZ(()=>i$([aU(),io(),il(),iu(),iO(aU(),t),ig(t)])),r=iO(aU(),t),o=i$([aU(),io().int()]),a=aU(),s=ib({ttl:io().optional()}),n=ib({taskId:aU()}),u=(c=ib({_meta:(l=i_({progressToken:o.optional(),"io.modelcontextprotocol/related-task":n.optional()})).optional()})).extend({task:s.optional()}),d=ib({method:aU(),params:c.loose().optional()}),p=ib({_meta:l.optional()}),h=ib({method:aU(),params:p.loose().optional()}),f=i_({_meta:l.optional()}),m=i$([aU(),io().int()]),y=f.strict(),g=p.extend({requestId:m.optional(),reason:aU().optional()}),v=h.extend({method:iC("notifications/cancelled"),params:g}),b=ib({src:aU(),mimeType:aU().optional(),sizes:ig(aU()).optional(),theme:ix(["light","dark"]).optional()}),_=ib({icons:ig(b).optional()}),$=(S=ib({name:aU(),title:aU().optional()})).extend({...S.shape,..._.shape,version:aU(),websiteUrl:aU().optional(),description:aU().optional()}),w=iP(ib({applyDefaults:il().optional()}),r),E=iX(t=>t&&"object"==typeof t&&!Array.isArray(t)&&0===Object.keys(t).length?{form:{}}:t,iP(ib({form:w.optional(),url:r.optional()}),r.optional())),R=i_({list:r.optional(),cancel:r.optional(),requests:i_({sampling:i_({createMessage:r.optional()}).optional(),elicitation:i_({create:r.optional()}).optional()}).optional()}),P=i_({list:r.optional(),cancel:r.optional(),requests:i_({tools:i_({call:r.optional()}).optional()}).optional()}),k=ib({experimental:iO(aU(),r).optional(),sampling:ib({context:r.optional(),tools:r.optional()}).optional(),elicitation:E.optional(),roots:ib({listChanged:il().optional()}).optional(),tasks:R.optional(),extensions:iO(aU(),r).optional()}),O=c.extend({protocolVersion:aU(),capabilities:k,clientInfo:$}),T=d.extend({method:iC("initialize"),params:O}),x=ib({experimental:iO(aU(),r).optional(),logging:r.optional(),completions:r.optional(),prompts:ib({listChanged:il().optional()}).optional(),resources:ib({subscribe:il().optional(),listChanged:il().optional()}).optional(),tools:ib({listChanged:il().optional()}).optional(),tasks:P.optional(),extensions:iO(aU(),r).optional()}),j=f.extend({protocolVersion:aU(),capabilities:x,serverInfo:$,instructions:aU().optional()}),C=h.extend({method:iC("notifications/initialized"),params:p.optional()}),N=d.extend({method:iC("ping"),params:c.optional()}),I=ib({progress:io(),total:iM(io()),message:iM(aU())}),A=ib({...p.shape,...I.shape,progressToken:o}),M=h.extend({method:iC("notifications/progress"),params:A}),q=c.extend({cursor:a.optional()}),z=d.extend({params:q.optional()}),L=f.extend({nextCursor:a.optional()}),U=(D=ib({uri:aU(),mimeType:iM(aU()),_meta:iO(aU(),ih()).optional()})).extend({text:aU()}),V=aU().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),F=D.extend({blob:V}),K=ib({audience:ig(H=ix(["user","assistant"])).optional(),priority:io().min(0).max(1).optional(),lastModified:oo(aF,{offset:!0}).optional()}),J=ib({...S.shape,..._.shape,uri:aU(),description:iM(aU()),mimeType:iM(aU()),size:iM(io()),annotations:K.optional(),_meta:iM(i_({}))}),B=ib({...S.shape,..._.shape,uriTemplate:aU(),description:iM(aU()),mimeType:iM(aU()),annotations:K.optional(),_meta:iM(i_({}))}),G=z.extend({method:iC("resources/list")}),Z=L.extend({resources:ig(J)}),W=z.extend({method:iC("resources/templates/list")}),X=L.extend({resourceTemplates:ig(B)}),Y=c.extend({uri:aU()}),Q=d.extend({method:iC("resources/read"),params:Y}),ee=f.extend({contents:ig(i$([U,F]))}),et=h.extend({method:iC("notifications/resources/list_changed"),params:p.optional()}),er=d.extend({method:iC("resources/subscribe"),params:Y}),eo=d.extend({method:iC("resources/unsubscribe"),params:Y}),ea=p.extend({uri:aU()}),ei=h.extend({method:iC("notifications/resources/updated"),params:ea}),es=ib({name:aU(),description:iM(aU()),required:iM(il())}),en=ib({...S.shape,..._.shape,description:iM(aU()),arguments:iM(ig(es)),_meta:iM(i_({}))}),el=z.extend({method:iC("prompts/list")}),ec=L.extend({prompts:ig(en)}),eu=c.extend({name:aU(),arguments:iO(aU(),aU()).optional()}),ed=d.extend({method:iC("prompts/get"),params:eu}),ep=ib({type:iC("text"),text:aU(),annotations:K.optional(),_meta:iO(aU(),ih()).optional()}),eh=ib({type:iC("image"),data:V,mimeType:aU(),annotations:K.optional(),_meta:iO(aU(),ih()).optional()}),ef=ib({type:iC("audio"),data:V,mimeType:aU(),annotations:K.optional(),_meta:iO(aU(),ih()).optional()}),em=ib({type:iC("tool_use"),name:aU(),id:aU(),input:iO(aU(),ih()),_meta:iO(aU(),ih()).optional()}),ey=ib({type:iC("resource"),resource:i$([U,F]),annotations:K.optional(),_meta:iO(aU(),ih()).optional()}),eb=ib({role:H,content:ev=i$([ep,eh,ef,eg=J.extend({type:iC("resource_link")}),ey])}),e_=f.extend({description:aU().optional(),messages:ig(eb)}),eS=h.extend({method:iC("notifications/prompts/list_changed"),params:p.optional()}),e$=ib({title:aU().optional(),readOnlyHint:il().optional(),destructiveHint:il().optional(),idempotentHint:il().optional(),openWorldHint:il().optional()}),ew=ib({taskSupport:ix(["required","optional","forbidden"]).optional()}),eE=ib({...S.shape,..._.shape,description:aU().optional(),inputSchema:ib({type:iC("object"),properties:iO(aU(),t).optional(),required:ig(aU()).optional()}).catchall(ih()),outputSchema:ib({type:iC("object"),properties:iO(aU(),t).optional(),required:ig(aU()).optional()}).catchall(ih()).optional(),annotations:e$.optional(),execution:ew.optional(),_meta:iO(aU(),ih()).optional()}),eR=z.extend({method:iC("tools/list")}),eP=L.extend({tools:ig(eE)}),ek=f.extend({content:ig(ev),structuredContent:iO(aU(),ih()).optional(),isError:il().optional()}),eO=u.extend({name:aU(),arguments:iO(aU(),ih()).optional()}),eT=d.extend({method:iC("tools/call"),params:eO}),ex=h.extend({method:iC("notifications/tools/list_changed"),params:p.optional()}),ej=ix(["debug","info","notice","warning","error","critical","alert","emergency"]),eC=c.extend({level:ej}),eN=d.extend({method:iC("logging/setLevel"),params:eC}),eI=p.extend({level:ej,logger:aU().optional(),data:ih()}),eA=h.extend({method:iC("notifications/message"),params:eI}),eM=ib({name:aU().optional()}),eq=ib({hints:ig(eM).optional(),costPriority:io().min(0).max(1).optional(),speedPriority:io().min(0).max(1).optional(),intelligencePriority:io().min(0).max(1).optional()}),ez=ib({mode:ix(["auto","required","none"]).optional()}),eL=ib({type:iC("tool_result"),toolUseId:aU().describe("The unique identifier for the corresponding tool call."),content:ig(ev),structuredContent:ib({}).loose().optional(),isError:il().optional(),_meta:iO(aU(),ih()).optional()}),eD=iE("type",[ep,eh,ef]),eV=ib({role:H,content:i$([eU=iE("type",[ep,eh,ef,em,eL]),ig(eU)]),_meta:iO(aU(),ih()).optional()}),eF=u.extend({messages:ig(eV),modelPreferences:eq.optional(),systemPrompt:aU().optional(),includeContext:ix(["none","thisServer","allServers"]).optional(),temperature:io().optional(),maxTokens:io().int(),stopSequences:ig(aU()).optional(),metadata:r.optional(),tools:ig(eE).optional(),toolChoice:ez.optional()}),eH=d.extend({method:iC("sampling/createMessage"),params:eF}),eK=f.extend({model:aU(),stopReason:iM(ix(["endTurn","stopSequence","maxTokens"]).or(aU())),role:H,content:eD}),eJ=f.extend({model:aU(),stopReason:iM(ix(["endTurn","stopSequence","maxTokens","toolUse"]).or(aU())),role:H,content:i$([eU,ig(eU)])}),eB=ib({type:iC("boolean"),title:aU().optional(),description:aU().optional(),default:il().optional()}),eG=ib({type:iC("string"),title:aU().optional(),description:aU().optional(),minLength:io().optional(),maxLength:io().optional(),format:ix(["email","uri","date","date-time"]).optional(),default:aU().optional()}),eZ=ib({type:ix(["number","integer"]),title:aU().optional(),description:aU().optional(),minimum:io().optional(),maximum:io().optional(),default:io().optional()}),eW=ib({type:iC("string"),title:aU().optional(),description:aU().optional(),enum:ig(aU()),default:aU().optional()}),eX=ib({type:iC("string"),title:aU().optional(),description:aU().optional(),oneOf:ig(ib({const:aU(),title:aU()})),default:aU().optional()}),eY=ib({type:iC("string"),title:aU().optional(),description:aU().optional(),enum:ig(aU()),enumNames:ig(aU()).optional(),default:aU().optional()}),eQ=i$([eW,eX]),e0=ib({type:iC("array"),title:aU().optional(),description:aU().optional(),minItems:io().optional(),maxItems:io().optional(),items:ib({type:iC("string"),enum:ig(aU())}),default:ig(aU()).optional()}),e2=i$([e0,e1=ib({type:iC("array"),title:aU().optional(),description:aU().optional(),minItems:io().optional(),maxItems:io().optional(),items:ib({anyOf:ig(ib({const:aU(),title:aU()}))}),default:ig(aU()).optional()})]),e9=i$([eY,eQ,e2]),e4=i$([e9,eB,eG,eZ]),e5=u.extend({mode:iC("form").optional(),message:aU(),requestedSchema:ib({type:iC("object"),properties:iO(aU(),e4),required:ig(aU()).optional()}).catchall(ih())}),e6=i$([e5,e3=u.extend({mode:iC("url"),message:aU(),elicitationId:aU(),url:aU().url()})]),e8=d.extend({method:iC("elicitation/create"),params:e6}),e7=p.extend({elicitationId:aU()}),te=h.extend({method:iC("notifications/elicitation/complete"),params:e7}),tt=f.extend({action:ix(["accept","decline","cancel"]),content:iX(t=>null===t?void 0:t,iO(aU(),i$([aU(),io(),il(),ig(aU())])).optional())}),tr=ib({type:iC("ref/resource"),uri:aU()}),to=ib({type:iC("ref/prompt"),name:aU()}),ta=c.extend({ref:i$([to,tr]),argument:ib({name:aU(),value:aU()}),context:ib({arguments:iO(aU(),aU()).optional()}).optional()}),ti=d.extend({method:iC("completion/complete"),params:ta}),ts=f.extend({completion:i_({values:ig(aU()).max(100),total:iM(io().int()),hasMore:iM(il())})}),tn=ib({uri:aU().startsWith("file://"),name:aU().optional(),_meta:iO(aU(),ih()).optional()}),tl=d.extend({method:iC("roots/list"),params:c.optional()}),tc=f.extend({roots:ig(tn)}),tu=h.extend({method:iC("notifications/roots/list_changed"),params:p.optional()}),td=i_({ttl:io().optional(),pollInterval:io().optional()}),tp=ix(["working","input_required","completed","failed","cancelled"]),th=ib({taskId:aU(),status:tp,ttl:i$([io(),iu()]),createdAt:aU(),lastUpdatedAt:aU(),pollInterval:iM(io()),statusMessage:iM(aU())}),tf=f.extend({task:th}),tm=p.merge(th),ty=h.extend({method:iC("notifications/tasks/status"),params:tm}),tg=d.extend({method:iC("tasks/get"),params:c.extend({taskId:aU()})}),tv=f.merge(th),tb=d.extend({method:iC("tasks/result"),params:c.extend({taskId:aU()})}),t_=f.loose(),tS=z.extend({method:iC("tasks/list")}),t$=L.extend({tasks:ig(th)}),tw=d.extend({method:iC("tasks/cancel"),params:c.extend({taskId:aU()})}),{JSONValueSchema:t,JSONObjectSchema:r,ProgressTokenSchema:o,CursorSchema:a,TaskMetadataSchema:s,RelatedTaskMetadataSchema:n,RequestMetaSchema:l,BaseRequestParamsSchema:c,TaskAugmentedRequestParamsSchema:u,RequestSchema:d,NotificationsParamsSchema:p,NotificationSchema:h,ResultSchema:f,RequestIdSchema:m,EmptyResultSchema:y,CancelledNotificationParamsSchema:g,CancelledNotificationSchema:v,IconSchema:b,IconsSchema:_,BaseMetadataSchema:S,ImplementationSchema:$,ClientTasksCapabilitySchema:R,ServerTasksCapabilitySchema:P,ClientCapabilitiesSchema:k,InitializeRequestParamsSchema:O,InitializeRequestSchema:T,ServerCapabilitiesSchema:x,InitializeResultSchema:j,InitializedNotificationSchema:C,PingRequestSchema:N,ProgressSchema:I,ProgressNotificationParamsSchema:A,ProgressNotificationSchema:M,PaginatedRequestParamsSchema:q,PaginatedRequestSchema:z,PaginatedResultSchema:L,ResourceContentsSchema:D,TextResourceContentsSchema:U,BlobResourceContentsSchema:F,RoleSchema:H,AnnotationsSchema:K,ResourceSchema:J,ResourceTemplateSchema:B,ListResourcesRequestSchema:G,ListResourcesResultSchema:Z,ListResourceTemplatesRequestSchema:W,ListResourceTemplatesResultSchema:X,ResourceRequestParamsSchema:Y,ReadResourceRequestParamsSchema:Y,ReadResourceRequestSchema:Q,ReadResourceResultSchema:ee,ResourceListChangedNotificationSchema:et,SubscribeRequestParamsSchema:Y,SubscribeRequestSchema:er,UnsubscribeRequestParamsSchema:Y,UnsubscribeRequestSchema:eo,ResourceUpdatedNotificationParamsSchema:ea,ResourceUpdatedNotificationSchema:ei,PromptArgumentSchema:es,PromptSchema:en,ListPromptsRequestSchema:el,ListPromptsResultSchema:ec,GetPromptRequestParamsSchema:eu,GetPromptRequestSchema:ed,TextContentSchema:ep,ImageContentSchema:eh,AudioContentSchema:ef,ToolUseContentSchema:em,EmbeddedResourceSchema:ey,ResourceLinkSchema:eg,ContentBlockSchema:ev,PromptMessageSchema:eb,GetPromptResultSchema:e_,PromptListChangedNotificationSchema:eS,ToolAnnotationsSchema:e$,ToolExecutionSchema:ew,ToolSchema:eE,ListToolsRequestSchema:eR,ListToolsResultSchema:eP,CallToolResultSchema:ek,CallToolRequestParamsSchema:eO,CallToolRequestSchema:eT,ToolListChangedNotificationSchema:ex,LoggingLevelSchema:ej,SetLevelRequestParamsSchema:eC,SetLevelRequestSchema:eN,LoggingMessageNotificationParamsSchema:eI,LoggingMessageNotificationSchema:eA,ModelHintSchema:eM,ModelPreferencesSchema:eq,ToolChoiceSchema:ez,ToolResultContentSchema:eL,SamplingContentSchema:eD,SamplingMessageContentBlockSchema:eU,SamplingMessageSchema:eV,CreateMessageRequestParamsSchema:eF,CreateMessageRequestSchema:eH,CreateMessageResultSchema:eK,CreateMessageResultWithToolsSchema:eJ,BooleanSchemaSchema:eB,StringSchemaSchema:eG,NumberSchemaSchema:eZ,UntitledSingleSelectEnumSchemaSchema:eW,TitledSingleSelectEnumSchemaSchema:eX,LegacyTitledEnumSchemaSchema:eY,SingleSelectEnumSchemaSchema:eQ,UntitledMultiSelectEnumSchemaSchema:e0,TitledMultiSelectEnumSchemaSchema:e1,MultiSelectEnumSchemaSchema:e2,EnumSchemaSchema:e9,PrimitiveSchemaDefinitionSchema:e4,ElicitRequestFormParamsSchema:e5,ElicitRequestURLParamsSchema:e3,ElicitRequestParamsSchema:e6,ElicitRequestSchema:e8,ElicitationCompleteNotificationParamsSchema:e7,ElicitationCompleteNotificationSchema:te,ElicitResultSchema:tt,ResourceTemplateReferenceSchema:tr,PromptReferenceSchema:to,CompleteRequestParamsSchema:ta,CompleteRequestSchema:ti,CompleteResultSchema:ts,RootSchema:tn,ListRootsRequestSchema:tl,ListRootsResultSchema:tc,RootsListChangedNotificationSchema:tu,TaskCreationParamsSchema:td,TaskStatusSchema:tp,TaskSchema:th,CreateTaskResultSchema:tf,TaskStatusNotificationParamsSchema:tm,TaskStatusNotificationSchema:ty,GetTaskRequestSchema:tg,GetTaskResultSchema:tv,GetTaskPayloadRequestSchema:tb,GetTaskPayloadResultSchema:t_,ListTasksRequestSchema:tS,ListTasksResultSchema:t$,CancelTaskRequestSchema:tw,CancelTaskResultSchema:f.merge(th),ClientRequestSchema:i$([N,T,ti,eN,ed,el,G,W,Q,er,eo,eT,eR,tg,tb,tS,tw]),ClientNotificationSchema:i$([v,M,C,tu,ty]),ClientResultSchema:i$([y,eK,eJ,tt,tc,tv,t$,tf]),ServerRequestSchema:i$([N,eH,e8,tl,tg,tb,tS,tw]),ServerNotificationSchema:i$([v,M,eA,ei,et,ex,eS,ty,te]),ServerResultSchema:i$([y,j,ts,e_,ec,Z,X,ee,ek,eP,tv,t$,tf]),CallToolResultWireSchema:ih().superRefine((t,r)=>{if(!("object"!=typeof t||null===t||Array.isArray(t))&&void 0===t.content){for(let o of dk)if(o in t)return void r.addIssue({code:"custom",message:`content is required when the body carries '${o}' — another result family cannot default into an empty tools/call success`})}}).transform(dO).pipe(ek)})}function dx(t){return"object"!==t.type}let dj=new Set(["const","enum","default","examples"]),dC=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function dN(t){return void 0!==t&&!("string"==typeof t&&t.startsWith("#"))}let dI={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},dA={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},dM={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};function dq(){if(l)return l;let t=dT();return l={requestSchemas:{ping:t.PingRequestSchema,initialize:t.InitializeRequestSchema,"completion/complete":t.CompleteRequestSchema,"logging/setLevel":t.SetLevelRequestSchema,"prompts/get":t.GetPromptRequestSchema,"prompts/list":t.ListPromptsRequestSchema,"resources/list":t.ListResourcesRequestSchema,"resources/templates/list":t.ListResourceTemplatesRequestSchema,"resources/read":t.ReadResourceRequestSchema,"resources/subscribe":t.SubscribeRequestSchema,"resources/unsubscribe":t.UnsubscribeRequestSchema,"tools/call":t.CallToolRequestSchema,"tools/list":t.ListToolsRequestSchema,"tasks/get":t.GetTaskRequestSchema,"tasks/result":t.GetTaskPayloadRequestSchema,"tasks/list":t.ListTasksRequestSchema,"tasks/cancel":t.CancelTaskRequestSchema,"sampling/createMessage":t.CreateMessageRequestSchema,"elicitation/create":t.ElicitRequestSchema,"roots/list":t.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":t.CancelledNotificationSchema,"notifications/progress":t.ProgressNotificationSchema,"notifications/initialized":t.InitializedNotificationSchema,"notifications/roots/list_changed":t.RootsListChangedNotificationSchema,"notifications/tasks/status":t.TaskStatusNotificationSchema,"notifications/message":t.LoggingMessageNotificationSchema,"notifications/resources/updated":t.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":t.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":t.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":t.PromptListChangedNotificationSchema,"notifications/elicitation/complete":t.ElicitationCompleteNotificationSchema},resultSchemas:{ping:t.EmptyResultSchema,initialize:t.InitializeResultSchema,"completion/complete":t.CompleteResultSchema,"logging/setLevel":t.EmptyResultSchema,"prompts/get":t.GetPromptResultSchema,"prompts/list":t.ListPromptsResultSchema,"resources/list":t.ListResourcesResultSchema,"resources/templates/list":t.ListResourceTemplatesResultSchema,"resources/read":t.ReadResourceResultSchema,"resources/subscribe":t.EmptyResultSchema,"resources/unsubscribe":t.EmptyResultSchema,"tools/call":t.CallToolResultWireSchema,"tools/list":t.ListToolsResultSchema,"sampling/createMessage":t.CreateMessageResultWithToolsSchema,"elicitation/create":t.ElicitResultSchema,"roots/list":t.ListRootsResultSchema}}}function dz(t){return Object.prototype.hasOwnProperty.call(dI,t)}function dL(t){return Object.prototype.hasOwnProperty.call(dA,t)}function dD(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}function dU(t,r){if(void 0===t)return{ok:!1,reason:"not-in-era"};let o=t.safeParse(r);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}Object.keys(dI),Object.keys(dA);let dV={ok:!1,reason:"not-in-era"};function dF(t){return dD(t)&&dD(t.outputSchema)&&dx(t.outputSchema)}let dH={era:"2025-11-25",hasRequestMethod:dz,hasNotificationMethod:dL,validateRequest:(t,r)=>dU(dz(t)?dq().requestSchemas[t]:void 0,r),validateResult:(t,r)=>dU(Object.prototype.hasOwnProperty.call(dM,t)?dq().resultSchemas[t]:void 0,r),validateNotification:(t,r)=>dU(dL(t)?dq().notificationSchemas[t]:void 0,r),hasInputRequestMethod:()=>!1,validateInputRequest:()=>dV,validateInputResponse:()=>dV,samplingResultVariant:(t,r)=>{let o=dT();return dU(t?o.CreateMessageResultWithToolsSchema:o.CreateMessageResultSchema,r)},outboundEnvelope:t=>void 0,validateEnvelopeMeta:t=>[],projectCallToolResult(t,r){let o=dP(t),a=o.structuredContent;if(void 0===a)return o;let i="object"!=typeof a||null===a||Array.isArray(a),s=void 0!==r&&dx(r);return i||s?{...o,structuredContent:{result:a}}:o},decodeResult(t,r){if(dD(r)&&"resultType"in r){let t={...r};return delete t.resultType,{kind:"complete",result:t}}return{kind:"complete",result:r}},encodeResult(t,r){if("tools/list"!==t)return r;let o=r.tools;return Array.isArray(o)&&o.some(t=>dF(t))?{...r,tools:o.map(t=>dF(t)?{...t,outputSchema:function(t){var r;let o="string"==typeof t.$schema?t.$schema:void 0;if(dN(t.$id))return{...void 0!==o&&{$schema:o},type:"object",properties:{result:t},required:["result"]};let a="string"==typeof(r=t.$schema)&&dd.has(r.replace(/#$/,""))&&!0!==t.$recursiveAnchor,i=(t,r)=>{if(Array.isArray(t))return t.map(t=>i(t,!1));if(null===t||"object"!=typeof t||!r&&dN(t.$id))return t;let o={},s=!1;for(let[n,l]of Object.entries(t))r?o[n]=i(l,!1):("$ref"===n||"$dynamicRef"===n)&&"string"==typeof l?o[n]="#"===l?"#/properties/result":l.startsWith("#/")?`#/properties/result${l.slice(1)}`:l:"$recursiveRef"===n&&"#"===l&&a?s=!0:dj.has(n)?o[n]=l:dC.has(n)?o[n]=i(l,!0):o[n]=i(l,!1);return s&&("$ref"in o?o.allOf=[...Array.isArray(o.allOf)?o.allOf:[],{$ref:"#/properties/result"}]:o.$ref="#/properties/result"),o};return{...void 0!==o&&{$schema:o},type:"object",properties:{result:i(t,!1)},required:["result"]}}(t.outputSchema)}:t)}:r},encodeErrorCode:t=>-32002===t?-32602:t,checkInboundEnvelope:t=>void 0};function dK(){return c??=function(){let t=iZ(()=>i$([aU(),io(),il(),iu(),iO(aU(),t),ig(t)])),r=iO(aU(),t),o=i$([aU(),io().int()]),a=aU(),i=i$([aU(),io().int()]),s=ix(["user","assistant"]),n=ix(["debug","info","notice","warning","error","critical","alert","emergency"]),l=aU().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),c=ib({ttl:io().optional()}),u=ib({taskId:aU()}),d=i_({progressToken:o.optional(),"io.modelcontextprotocol/related-task":u.optional()}),p=ib({_meta:d.optional()}),h=p.extend({task:c.optional()}),f=ib({_meta:d.optional()}),m=ib({method:aU(),params:f.loose().optional()}),y=ib({src:aU(),mimeType:aU().optional(),sizes:ig(aU()).optional(),theme:ix(["light","dark"]).optional()}),g=ib({icons:ig(y).optional()}),v=ib({name:aU(),title:aU().optional()}),b=v.extend({...v.shape,...g.shape,version:aU(),websiteUrl:aU().optional(),description:aU().optional()}),_=iP(ib({applyDefaults:il().optional()}),r),S=iX(t=>t&&"object"==typeof t&&!Array.isArray(t)&&0===Object.keys(t).length?{form:{}}:t,iP(ib({form:_.optional(),url:r.optional()}),r.optional())),$=i_({list:r.optional(),cancel:r.optional(),requests:i_({sampling:i_({createMessage:r.optional()}).optional(),elicitation:i_({create:r.optional()}).optional()}).optional()}),w=i_({list:r.optional(),cancel:r.optional(),requests:i_({tools:i_({call:r.optional()}).optional()}).optional()}),E=ib({experimental:iO(aU(),r).optional(),sampling:ib({context:r.optional(),tools:r.optional()}).optional(),elicitation:S.optional(),roots:ib({listChanged:il().optional()}).optional(),tasks:$.optional(),extensions:iO(aU(),r).optional()}),R=ib({experimental:iO(aU(),r).optional(),logging:r.optional(),completions:r.optional(),prompts:ib({listChanged:il().optional()}).optional(),resources:ib({subscribe:il().optional(),listChanged:il().optional()}).optional(),tools:ib({listChanged:il().optional()}).optional(),tasks:w.optional(),extensions:iO(aU(),r).optional()}),P=ib({progress:io(),total:iM(io()),message:iM(aU())}),k=ib({...f.shape,...P.shape,progressToken:o}),O=m.extend({method:iC("notifications/progress"),params:k}),T=f.extend({level:n,logger:aU().optional(),data:ih()}),x=m.extend({method:iC("notifications/message"),params:T}),j=ib({uri:aU(),mimeType:iM(aU()),_meta:iO(aU(),ih()).optional()}),C=j.extend({text:aU()}),N=j.extend({blob:l}),I=ib({audience:ig(s).optional(),priority:io().min(0).max(1).optional(),lastModified:oo(aF,{offset:!0}).optional()}),A=ib({...v.shape,...g.shape,uri:aU(),description:iM(aU()),mimeType:iM(aU()),size:iM(io()),annotations:I.optional(),_meta:iM(i_({}))}),M=ib({...v.shape,...g.shape,uriTemplate:aU(),description:iM(aU()),mimeType:iM(aU()),annotations:I.optional(),_meta:iM(i_({}))}),q=m.extend({method:iC("notifications/resources/list_changed"),params:f.optional()}),z=f.extend({uri:aU()}),L=m.extend({method:iC("notifications/resources/updated"),params:z}),D=ib({name:aU(),description:iM(aU()),required:iM(il())}),U=ib({...v.shape,...g.shape,description:iM(aU()),arguments:iM(ig(D)),_meta:iM(i_({}))}),V=m.extend({method:iC("notifications/prompts/list_changed"),params:f.optional()}),F=ib({type:iC("text"),text:aU(),annotations:I.optional(),_meta:iO(aU(),ih()).optional()}),H=ib({type:iC("image"),data:l,mimeType:aU(),annotations:I.optional(),_meta:iO(aU(),ih()).optional()}),K=ib({type:iC("audio"),data:l,mimeType:aU(),annotations:I.optional(),_meta:iO(aU(),ih()).optional()}),J=ib({type:iC("tool_use"),name:aU(),id:aU(),input:iO(aU(),ih()),_meta:iO(aU(),ih()).optional()}),B=ib({type:iC("resource"),resource:i$([C,N]),annotations:I.optional(),_meta:iO(aU(),ih()).optional()}),G=A.extend({type:iC("resource_link")}),Z=i$([F,H,K,G,B]),W=ib({role:s,content:Z}),X=ib({title:aU().optional(),readOnlyHint:il().optional(),destructiveHint:il().optional(),idempotentHint:il().optional(),openWorldHint:il().optional()}),Y=m.extend({method:iC("notifications/tools/list_changed"),params:f.optional()}),Q=ib({name:aU().optional()}),ee=ib({hints:ig(Q).optional(),costPriority:io().min(0).max(1).optional(),speedPriority:io().min(0).max(1).optional(),intelligencePriority:io().min(0).max(1).optional()}),et=ib({mode:ix(["auto","required","none"]).optional()}),er=ib({type:iC("boolean"),title:aU().optional(),description:aU().optional(),default:il().optional()}),eo=ib({type:iC("string"),title:aU().optional(),description:aU().optional(),minLength:io().optional(),maxLength:io().optional(),format:ix(["email","uri","date","date-time"]).optional(),default:aU().optional()}),ea=ib({type:ix(["number","integer"]),title:aU().optional(),description:aU().optional(),minimum:io().optional(),maximum:io().optional(),default:io().optional()}),ei=ib({type:iC("string"),title:aU().optional(),description:aU().optional(),enum:ig(aU()),default:aU().optional()}),es=ib({type:iC("string"),title:aU().optional(),description:aU().optional(),oneOf:ig(ib({const:aU(),title:aU()})),default:aU().optional()}),en=ib({type:iC("string"),title:aU().optional(),description:aU().optional(),enum:ig(aU()),enumNames:ig(aU()).optional(),default:aU().optional()}),el=i$([ei,es]),ec=ib({type:iC("array"),title:aU().optional(),description:aU().optional(),minItems:io().optional(),maxItems:io().optional(),items:ib({type:iC("string"),enum:ig(aU())}),default:ig(aU()).optional()}),eu=ib({type:iC("array"),title:aU().optional(),description:aU().optional(),minItems:io().optional(),maxItems:io().optional(),items:ib({anyOf:ig(ib({const:aU(),title:aU()}))}),default:ig(aU()).optional()}),ed=i$([ec,eu]),ep=i$([en,el,ed]),eh=i$([ep,er,eo,ea]),ef=h.extend({mode:iC("form").optional(),message:aU(),requestedSchema:ib({type:iC("object"),properties:iO(aU(),eh),required:ig(aU()).optional()}).catchall(ih())}),em=ib({type:iC("ref/resource"),uri:aU()}),ey=ib({type:iC("ref/prompt"),name:aU()}),eg=ib({uri:aU().startsWith("file://"),name:aU().optional(),_meta:iO(aU(),ih()).optional()}),ev=E.shape,eb=ib({experimental:ev.experimental,sampling:ev.sampling,elicitation:ev.elicitation,roots:ev.roots,extensions:ev.extensions}),e_=R.shape,eS=ib({experimental:e_.experimental,logging:e_.logging,completions:e_.completions,prompts:e_.prompts,resources:e_.resources,tools:e_.tools,extensions:e_.extensions}),e$=i_({progressToken:o.optional(),[i0]:aU(),[i1]:b.optional(),[i9]:eb,[i5]:n.optional()}),ew=ib({...v.shape,...g.shape,description:aU().optional(),inputSchema:i_({$schema:aU().optional(),type:iC("object")}),outputSchema:i_({$schema:aU().optional()}).optional(),annotations:X.optional(),_meta:iO(aU(),ih()).optional()}),eE=ib({type:iC("tool_result"),toolUseId:aU(),content:ig(Z),structuredContent:ih().optional(),isError:il().optional(),_meta:iO(aU(),ih()).optional()}),eR=i$([F,H,K,J,eE]),eP=ib({role:s,content:i$([eR,ig(eR)]),_meta:iO(aU(),ih()).optional()}),ek=aU(),eO=i_({[i2]:b.optional().catch(void 0)}),eT=eO.optional();function ex(t){return i_({_meta:eT,resultType:ek.default("complete"),...t})}let ej=ex({}),eC=ex({nextCursor:a.optional()}),eN=ex({content:ig(Z),structuredContent:ih().optional(),isError:il().optional()}),eI=ex({ttlMs:io().int().min(0),cacheScope:ix(["public","private"]),tools:ig(ew),nextCursor:a.optional()}),eA=ex({ttlMs:io().int().min(0),cacheScope:ix(["public","private"]),prompts:ig(U),nextCursor:a.optional()}),eM=ex({description:aU().optional(),messages:ig(W)}),eq=ex({ttlMs:io().int().min(0),cacheScope:ix(["public","private"]),resources:ig(A),nextCursor:a.optional()}),ez=ex({ttlMs:io().int().min(0),cacheScope:ix(["public","private"]),resourceTemplates:ig(M),nextCursor:a.optional()}),eL=ex({ttlMs:io().int().min(0),cacheScope:ix(["public","private"]),contents:ig(i$([C,N]))}),eD=ex({completion:ib({values:ig(aU()).max(100),total:io().int().optional(),hasMore:il().optional()}).loose()}),eU=ex({ttlMs:io().int().min(0),cacheScope:ix(["public","private"])}),eV=ex({ttlMs:io().int().min(0).catch(0),cacheScope:ix(["public","private"]).catch("private"),supportedVersions:ig(aU()),capabilities:eS,instructions:aU().optional()}),eF=ib({messages:ig(eP),modelPreferences:ee.optional(),systemPrompt:aU().optional(),includeContext:ix(["none","thisServer","allServers"]).optional(),temperature:io().optional(),maxTokens:io().int(),stopSequences:ig(aU()).optional(),metadata:r.optional(),tools:ig(ew).optional(),toolChoice:et.optional()}),eH=ib({method:iC("sampling/createMessage"),params:eF}),eK=ib({method:iC("roots/list"),params:ib({_meta:iO(aU(),ih()).optional()}).optional()}),eJ=ib({...eP.shape,model:aU(),stopReason:aU().optional()}),eB=ib({roots:ig(eg)}),eG=ib({action:ix(["accept","decline","cancel"]),content:iO(aU(),i$([aU(),io(),il(),ig(aU())])).optional()}),eZ=ib({mode:iC("url"),message:aU(),url:aU().url()}),eW=i$([ef,eZ]),eX=ib({method:iC("elicitation/create"),params:eW}),eY=i$([eH,eK,eX]),eQ=i$([eJ,eB,eG]),e0=iO(aU(),eY),e1=iO(aU(),eQ),e2=ex({inputRequests:e0.optional(),requestState:aU().optional()}),e9={inputResponses:e1.optional(),requestState:aU().optional()},e4=ib({_meta:e$,...e9}),e5=i_({progressToken:o.optional()});function e3(t,r){return ib({method:iC(t),params:ib({_meta:e$,...r})})}function e6(t,r){return ib({method:iC(t),params:ib({_meta:e5.optional(),...r}).optional()})}let e8={name:aU(),arguments:iO(aU(),ih()).optional(),...e9},e7={cursor:a.optional()},te=e3("tools/call",e8),tt=e3("tools/list",e7),tr=e3("prompts/list",e7),to=e3("prompts/get",{name:aU(),arguments:iO(aU(),aU()).optional(),...e9}),ta=e3("resources/list",e7),ti=e3("resources/templates/list",e7),ts=e3("resources/read",{uri:aU(),...e9}),tn={ref:i$([ey,em]),argument:ib({name:aU(),value:aU()}),context:ib({arguments:iO(aU(),aU()).optional()}).optional()},tl=e3("completion/complete",tn),tc=e3("server/discover",{}),tu=ib({toolsListChanged:il().optional(),promptsListChanged:il().optional(),resourcesListChanged:il().optional(),resourceSubscriptions:ig(aU()).optional()}),td={notifications:tu},tp=e3("subscriptions/listen",td),th=eO.extend({"io.modelcontextprotocol/subscriptionId":i}),tf=i_({_meta:th,resultType:ek.default("complete")}),tm={"tools/call":e6("tools/call",e8),"tools/list":e6("tools/list",e7),"prompts/get":e6("prompts/get",{name:aU(),arguments:iO(aU(),aU()).optional()}),"prompts/list":e6("prompts/list",e7),"resources/list":e6("resources/list",e7),"resources/templates/list":e6("resources/templates/list",e7),"resources/read":e6("resources/read",{uri:aU()}),"completion/complete":e6("completion/complete",tn),"server/discover":e6("server/discover",{}),"subscriptions/listen":e6("subscriptions/listen",td)};function ty(t){return i_({_meta:eT,...t})}let tg={"tools/call":ty({content:ig(Z),structuredContent:ih().optional(),isError:il().optional()}),"tools/list":ty({ttlMs:io().int().min(0),cacheScope:ix(["public","private"]),tools:ig(ew),nextCursor:a.optional()}),"prompts/get":ty({description:aU().optional(),messages:ig(W)}),"prompts/list":ty({ttlMs:io().int().min(0),cacheScope:ix(["public","private"]),prompts:ig(U),nextCursor:a.optional()}),"resources/list":ty({ttlMs:io().int().min(0),cacheScope:ix(["public","private"]),resources:ig(A),nextCursor:a.optional()}),"resources/templates/list":ty({ttlMs:io().int().min(0),cacheScope:ix(["public","private"]),resourceTemplates:ig(M),nextCursor:a.optional()}),"resources/read":ty({ttlMs:io().int().min(0),cacheScope:ix(["public","private"]),contents:ig(i$([C,N]))}),"completion/complete":ty({completion:ib({values:ig(aU()).max(100),total:io().int().optional(),hasMore:il().optional()}).loose()}),"server/discover":ty({ttlMs:io().int().min(0).catch(0),cacheScope:ix(["public","private"]).catch("private"),supportedVersions:ig(aU()),capabilities:eS,instructions:aU().optional()}),"subscriptions/listen":ty({})},tv=i_({"io.modelcontextprotocol/subscriptionId":i.optional()}),tb=ib({method:iC("notifications/subscriptions/acknowledged"),params:ib({_meta:tv.optional(),notifications:tu})}),t_=ib({_meta:tv.optional(),requestId:i,reason:aU().optional()}),tS=ib({method:iC("notifications/cancelled"),params:t_}),t$=t=>ib({jsonrpc:iC("2.0"),id:i$([aU(),io().int()]),result:t}).strict();return{JSONValueSchema:t,JSONObjectSchema:r,ProgressTokenSchema:o,CursorSchema:a,RequestIdSchema:i,RoleSchema:s,LoggingLevelSchema:n,TaskMetadataSchema:c,RelatedTaskMetadataSchema:u,RequestMetaSchema:d,BaseRequestParamsSchema:p,TaskAugmentedRequestParamsSchema:h,NotificationsParamsSchema:f,NotificationSchema:m,IconSchema:y,IconsSchema:g,BaseMetadataSchema:v,ImplementationSchema:b,ClientTasksCapabilitySchema:$,ServerTasksCapabilitySchema:w,ClientCapabilitiesSchema:E,ServerCapabilitiesSchema:R,ProgressSchema:P,ProgressNotificationParamsSchema:k,ProgressNotificationSchema:O,LoggingMessageNotificationParamsSchema:T,LoggingMessageNotificationSchema:x,ResourceContentsSchema:j,TextResourceContentsSchema:C,BlobResourceContentsSchema:N,AnnotationsSchema:I,ResourceSchema:A,ResourceTemplateSchema:M,ResourceListChangedNotificationSchema:q,ResourceUpdatedNotificationParamsSchema:z,ResourceUpdatedNotificationSchema:L,PromptArgumentSchema:D,PromptSchema:U,PromptListChangedNotificationSchema:V,TextContentSchema:F,ImageContentSchema:H,AudioContentSchema:K,ToolUseContentSchema:J,EmbeddedResourceSchema:B,ResourceLinkSchema:G,ContentBlockSchema:Z,PromptMessageSchema:W,ToolAnnotationsSchema:X,ToolListChangedNotificationSchema:Y,ModelHintSchema:Q,ModelPreferencesSchema:ee,ToolChoiceSchema:et,BooleanSchemaSchema:er,StringSchemaSchema:eo,NumberSchemaSchema:ea,UntitledSingleSelectEnumSchemaSchema:ei,TitledSingleSelectEnumSchemaSchema:es,LegacyTitledEnumSchemaSchema:en,SingleSelectEnumSchemaSchema:el,UntitledMultiSelectEnumSchemaSchema:ec,TitledMultiSelectEnumSchemaSchema:eu,MultiSelectEnumSchemaSchema:ed,EnumSchemaSchema:ep,PrimitiveSchemaDefinitionSchema:eh,ElicitRequestFormParamsSchema:ef,ResourceTemplateReferenceSchema:em,PromptReferenceSchema:ey,RootSchema:eg,ClientCapabilities2026Schema:eb,ServerCapabilities2026Schema:eS,RequestMetaEnvelopeSchema:e$,ToolSchema:ew,ToolResultContentSchema:eE,SamplingMessageContentBlockSchema:eR,SamplingMessageSchema:eP,ResultTypeSchema:ek,ResultMetaSchema:eO,ResultSchema:ej,PaginatedResultSchema:eC,CallToolResultSchema:eN,ListToolsResultSchema:eI,ListPromptsResultSchema:eA,GetPromptResultSchema:eM,ListResourcesResultSchema:eq,ListResourceTemplatesResultSchema:ez,ReadResourceResultSchema:eL,CompleteResultSchema:eD,CacheableResultSchema:eU,DiscoverResultSchema:eV,CreateMessageRequestParamsSchema:eF,CreateMessageRequestSchema:eH,ListRootsRequestSchema:eK,CreateMessageResultSchema:eJ,ListRootsResultSchema:eB,ElicitResultSchema:eG,ElicitRequestURLParamsSchema:eZ,ElicitRequestParamsSchema:eW,ElicitRequestSchema:eX,InputRequestSchema:eY,InputResponseSchema:eQ,InputRequestsSchema:e0,InputResponsesSchema:e1,InputRequiredResultSchema:e2,InputResponseRequestParamsSchema:e4,CallToolRequestSchema:te,ListToolsRequestSchema:tt,ListPromptsRequestSchema:tr,GetPromptRequestSchema:to,ListResourcesRequestSchema:ta,ListResourceTemplatesRequestSchema:ti,ReadResourceRequestSchema:ts,CompleteRequestSchema:tl,DiscoverRequestSchema:tc,SubscriptionFilterSchema:tu,SubscriptionsListenRequestSchema:tp,SubscriptionsListenResultMetaSchema:th,SubscriptionsListenResultSchema:tf,dispatchRequestSchemas:tm,dispatchResultSchemas:tg,NotificationMetaSchema:tv,SubscriptionsAcknowledgedNotificationSchema:tb,CancelledNotificationParamsSchema:t_,CancelledNotificationSchema:tS,notificationSchemas2026:{"notifications/cancelled":tS,"notifications/progress":O,"notifications/message":x,"notifications/resources/updated":L,"notifications/resources/list_changed":q,"notifications/tools/list_changed":Y,"notifications/prompts/list_changed":V,"notifications/subscriptions/acknowledged":tb},JSONRPCResultResponseSchema:t$(ej),CallToolResultResponseSchema:t$(i$([eN,e2])),ListToolsResultResponseSchema:t$(eI),ListPromptsResultResponseSchema:t$(eA),GetPromptResultResponseSchema:t$(i$([eM,e2])),ListResourcesResultResponseSchema:t$(eq),ListResourceTemplatesResultResponseSchema:t$(ez),ReadResourceResultResponseSchema:t$(i$([eL,e2])),CompleteResultResponseSchema:t$(eD),DiscoverResultResponseSchema:t$(eV)}}()}let dJ=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"],dB=Symbol("modelcontextprotocol.resultCacheHintFallback");function dG(t){return"number"==typeof t&&Number.isSafeInteger(t)&&t>=0}function dZ(t){return"public"===t||"private"===t}let dW=((k={})[k.ParseError=-32700]="ParseError",k[k.InvalidRequest=-32600]="InvalidRequest",k[k.MethodNotFound=-32601]="MethodNotFound",k[k.InvalidParams=-32602]="InvalidParams",k[k.InternalError=-32603]="InternalError",k[k.ResourceNotFound=-32002]="ResourceNotFound",k[k.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",k[k.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",k[k.UrlElicitationRequired=-32042]="UrlElicitationRequired",k);var dX=class t extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return dy(this,t)}static isInstance(t){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return dy(this,t)}constructor(t,r,o){super(r),this.code=t,this.data=o,this.name="ProtocolError",dm(this,new.target)}static fromError(r,o,a){return r===dW.UrlElicitationRequired&&a&&a.elicitations?new dQ(a.elicitations,o):r===dW.UnsupportedProtocolVersion&&a&&Array.isArray(a.supported)&&"string"==typeof a.requested?new d0({supported:a.supported,requested:a.requested},o):(r===dW.InvalidParams||r===dW.ResourceNotFound)&&"string"==typeof a?.uri&&(r===dW.ResourceNotFound||1===Object.keys(a).length)?new dY(a.uri,o):r===dW.MissingRequiredClientCapability&&a&&null!==a.requiredCapabilities&&"object"==typeof a.requiredCapabilities&&!Array.isArray(a.requiredCapabilities)?new d1({requiredCapabilities:a.requiredCapabilities},o):new t(r,o,a)}},dY=class extends dX{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(t,r=`Resource not found: ${t}`){super(dW.InvalidParams,r,{uri:t})}get uri(){return this.data.uri}},dQ=class extends dX{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(dW.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}},d0=class extends dX{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(t,r=`Unsupported protocol version: ${t.requested}`){super(dW.UnsupportedProtocolVersion,r,t)}get supported(){return this.data.supported}get requested(){return this.data.requested}},d1=class extends dX{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(t,r=`Missing required client capabilities: ${Object.keys(t.requiredCapabilities).join(", ")}`){super(dW.MissingRequiredClientCapability,r,t)}get requiredCapabilities(){return this.data.requiredCapabilities}};let d2=["tools/call","prompts/get","resources/read"],d9=["elicitation/create","sampling/createMessage","roots/list"];function d4(){if(u)return u;let t=dK();return u={request:{"elicitation/create":ib({method:iC("elicitation/create"),params:t.ElicitRequestParamsSchema}),"sampling/createMessage":ib({method:iC("sampling/createMessage"),params:t.CreateMessageRequestParamsSchema}),"roots/list":ib({method:iC("roots/list"),params:i_({}).optional()})},response:{"elicitation/create":t.ElicitResultSchema,"sampling/createMessage":t.CreateMessageResultSchema,"roots/list":t.ListRootsResultSchema}}}function d5(t){return d9.includes(t)}function d3(t){return d5(t)?d4().request[t]:void 0}let d6={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},d8={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function d7(t){return Object.prototype.hasOwnProperty.call(d6,t)}function pe(t){return Object.prototype.hasOwnProperty.call(d8,t)}function pt(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}function pr(t,r){if(void 0===t)return{ok:!1,reason:"not-in-era"};let o=t.safeParse(r);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}Object.keys(d6),Object.keys(d8);let po={ok:!1,reason:"not-in-era"},pa=[i0,i9],pi={era:"2026-07-28",hasRequestMethod:d7,hasNotificationMethod:pe,hasInputRequestMethod:t=>void 0!==d3(t),validateRequest:(t,r)=>pr(d7(t)?dK().dispatchRequestSchemas[t]:void 0,r),validateResult:(t,r)=>pr(Object.prototype.hasOwnProperty.call(d6,t)?dK().dispatchResultSchemas[t]:void 0,r),validateNotification:(t,r)=>pr(pe(t)?dK().notificationSchemas2026[t]:void 0,r),validateInputRequest:(t,r)=>pr(d3(t),r),validateInputResponse:(t,r)=>pr(d5(t)?d4().response[t]:void 0,r),samplingResultVariant:()=>po,outboundEnvelope:t=>({[i0]:t.protocolVersion,[i1]:t.clientInfo,[i9]:t.clientCapabilities,...void 0!==t.logLevel&&{[i5]:t.logLevel}}),validateEnvelopeMeta(t){let r=[];for(let o of pa)o in t||r.push({key:o,problem:"missing"});let o=dK().RequestMetaEnvelopeSchema.safeParse(t);if(!o.success)for(let t of o.error.issues){let o=t.path.map(String),a=o.length>0?o.join("."):"_meta";1===o.length&&r.some(t=>t.key===a&&"missing"===t.problem)||r.push({key:a,problem:t.message})}return r},projectCallToolResult:t=>dP(t),inputRequestSchema:d3,decodeResult(t,r){if(!pt(r))return{kind:"invalid",error:new d_(db.InvalidResult,`Invalid result for ${t}: not an object`,{method:t})};let o=r.resultType;if(void 0===o)return{kind:"invalid",error:new d_(db.InvalidResult,`Invalid result for ${t}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:t,violation:"missing-resultType"})};if("string"!=typeof o)return{kind:"invalid",error:new d_(db.InvalidResult,`Invalid result for ${t}: non-string resultType`,{method:t,resultType:o})};if("input_required"===o){let o=r.inputRequests,a=pt(o)?o:{},i=r.requestState;return 0===Object.keys(a).length&&"string"!=typeof i?{kind:"invalid",error:new d_(db.InvalidResult,`Invalid result for ${t}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:t,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:a,..."string"==typeof i&&{requestState:i}}}if("complete"!==o)return{kind:"invalid",error:new d_(db.UnsupportedResultType,`Unsupported result type '${o}' for ${t}`,{resultType:o,method:t})};let a=function(){if(d)return d;let t=dK();return d={"tools/call":t.CallToolResultSchema,"tools/list":t.ListToolsResultSchema,"prompts/get":t.GetPromptResultSchema,"prompts/list":t.ListPromptsResultSchema,"resources/list":t.ListResourcesResultSchema,"resources/templates/list":t.ListResourceTemplatesResultSchema,"resources/read":t.ReadResourceResultSchema,"completion/complete":t.CompleteResultSchema,"server/discover":t.DiscoverResultSchema}}(),i=Object.hasOwn(a,t)?a[t]:void 0;if(void 0!==i){let o=i.safeParse(r);if(!o.success)return{kind:"invalid",error:new d_(db.InvalidResult,`Invalid result for ${t}: ${o.error}`,{method:t})}}let s={...r};return delete s.resultType,{kind:"complete",result:s}},encodeResult:(t,r,o)=>(function(t,r){if(void 0===r)return t;let o=t._meta;return void 0===o?{...t,_meta:{[i2]:r}}:null===o||"object"!=typeof o||Array.isArray(o)||void 0!==o[i2]?t:{...t,_meta:{...o,[i2]:r}}})(function(t,r){var o,a;let i=r[dB];if("complete"!==r.resultType||!dJ.includes(t)){let t;return void 0===i?r:(t={...r},delete t[dB],t)}let s=dG(r.ttlMs)?r.ttlMs:void 0!==(o=i)&&dG(o.ttlMs)?o.ttlMs:0,n=dZ(r.cacheScope)?r.cacheScope:void 0!==(a=i)&&dZ(a.cacheScope)?a.cacheScope:"private",l={...r,ttlMs:s,cacheScope:n};return delete l[dB],l}(t,function(t,r){let o=r.resultType;if(void 0===o)return{...r,resultType:"complete"};if("complete"===o||d2.includes(t))return r;throw new dX(dW.InternalError,`Handler for ${t} returned resultType '${String(o)}', but results of ${t} only support 'complete' on protocol revision 2026-07-28`)}(t,function(t,r){let o=r,a=!1,i=()=>(a||(o={...o},a=!0),o),s=r.tools;"tools/list"===t&&Array.isArray(s)&&s.some(t=>pt(t)&&"execution"in t)&&(i().tools=s.map(t=>{if(!pt(t)||!("execution"in t))return t;let r={...t};return delete r.execution,r}));let n=r.capabilities;if(pt(n)&&"tasks"in n){let t={...n};delete t.tasks,i().capabilities=t}return o}(t,r))),o),encodeErrorCode:t=>-32002===t?-32602:t,checkInboundEnvelope(t){if(void 0===t.envelope)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let r=dK().RequestMetaEnvelopeSchema.safeParse(t.envelope);if(!r.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${r.error.issues.map(t=>t.message).join("; ")}`}},ps="2026-07-28";function pn(t){return void 0!==t&&t>=d$?pi:dH}function pl(t){return void 0!==t.revision?pn(t.revision).era:"modern"===t.era?pi.era:dH.era}function pc(t){return pd.some(r=>r.hasRequestMethod(t))}function pu(t){return pd.some(r=>r.hasNotificationMethod(t))}let pd=[dH,pi];var pp=((t,r)=>{let o={};for(var a in t)dr(o,a,{get:t[a],enumerable:!0});return r&&dr(o,Symbol.toStringTag,{value:"Module"}),o})({AnnotationsSchema:()=>sZ,AudioContentSchema:()=>nm,BaseMetadataSchema:()=>sw,BaseRequestParamsSchema:()=>sa,BlobResourceContentsSchema:()=>sB,BooleanSchemaSchema:()=>nW,CallToolRequestParamsSchema:()=>nx,CallToolRequestSchema:()=>nj,CallToolResultSchema:()=>nO,CancelTaskRequestSchema:()=>lP,CancelTaskResultSchema:()=>lk,CancelledNotificationParamsSchema:()=>sb,CancelledNotificationSchema:()=>s_,ClientCapabilitiesSchema:()=>sT,ClientNotificationSchema:()=>lT,ClientRequestSchema:()=>lO,ClientResultSchema:()=>lx,ClientTasksCapabilitySchema:()=>sk,CompatibilityCallToolResultSchema:()=>nT,CompleteRequestParamsSchema:()=>ln,CompleteRequestSchema:()=>ll,CompleteResultSchema:()=>lc,ContentBlockSchema:()=>nb,CreateMessageRequestParamsSchema:()=>nJ,CreateMessageRequestSchema:()=>nB,CreateMessageResultSchema:()=>nG,CreateMessageResultWithToolsSchema:()=>nZ,CreateTaskResultSchema:()=>lg,CursorSchema:()=>se,DiscoverRequestSchema:()=>sA,DiscoverResultSchema:()=>sM,ElicitRequestFormParamsSchema:()=>n8,ElicitRequestParamsSchema:()=>le,ElicitRequestSchema:()=>lt,ElicitRequestURLParamsSchema:()=>n7,ElicitResultSchema:()=>la,ElicitationCompleteNotificationParamsSchema:()=>lr,ElicitationCompleteNotificationSchema:()=>lo,EmbeddedResourceSchema:()=>ng,EmptyResultSchema:()=>sv,EnumSchemaSchema:()=>n3,GetPromptRequestParamsSchema:()=>nd,GetPromptRequestSchema:()=>np,GetPromptResultSchema:()=>nS,GetTaskPayloadRequestSchema:()=>l$,GetTaskPayloadResultSchema:()=>lw,GetTaskRequestSchema:()=>l_,GetTaskResultSchema:()=>lS,IconSchema:()=>sS,IconsSchema:()=>s$,ImageContentSchema:()=>nf,ImplementationSchema:()=>sE,InitializeRequestParamsSchema:()=>sx,InitializeRequestSchema:()=>sj,InitializeResultSchema:()=>sN,InitializedNotificationSchema:()=>sI,JSONArraySchema:()=>i8,JSONObjectSchema:()=>i6,JSONRPCErrorResponseSchema:()=>sm,JSONRPCMessageSchema:()=>sy,JSONRPCNotificationSchema:()=>sh,JSONRPCRequestSchema:()=>sp,JSONRPCResponseSchema:()=>sg,JSONRPCResultResponseSchema:()=>sf,JSONValueSchema:()=>i3,LegacyTitledEnumSchemaSchema:()=>n1,ListChangedOptionsBaseSchema:()=>nN,ListPromptsRequestSchema:()=>nc,ListPromptsResultSchema:()=>nu,ListResourceTemplatesRequestSchema:()=>s0,ListResourceTemplatesResultSchema:()=>s1,ListResourcesRequestSchema:()=>sY,ListResourcesResultSchema:()=>sQ,ListRootsRequestSchema:()=>ld,ListRootsResultSchema:()=>lp,ListTasksRequestSchema:()=>lE,ListTasksResultSchema:()=>lR,ListToolsRequestSchema:()=>nP,ListToolsResultSchema:()=>nk,LoggingLevelSchema:()=>nI,LoggingMessageNotificationParamsSchema:()=>nq,LoggingMessageNotificationSchema:()=>nz,ModelHintSchema:()=>nL,ModelPreferencesSchema:()=>nD,MultiSelectEnumSchemaSchema:()=>n5,NotificationSchema:()=>sl,NotificationsParamsSchema:()=>sn,NumberSchemaSchema:()=>nY,PaginatedRequestParamsSchema:()=>sU,PaginatedRequestSchema:()=>sV,PaginatedResultSchema:()=>sF,PingRequestSchema:()=>sq,PrimitiveSchemaDefinitionSchema:()=>n6,ProgressNotificationParamsSchema:()=>sL,ProgressNotificationSchema:()=>sD,ProgressSchema:()=>sz,ProgressTokenSchema:()=>i7,PromptArgumentSchema:()=>nn,PromptListChangedNotificationSchema:()=>n$,PromptMessageSchema:()=>n_,PromptReferenceSchema:()=>ls,PromptSchema:()=>nl,ReadResourceRequestParamsSchema:()=>s2,ReadResourceRequestSchema:()=>s9,ReadResourceResultSchema:()=>s4,RelatedTaskMetadataSchema:()=>sr,RequestIdSchema:()=>sd,RequestMetaSchema:()=>so,RequestSchema:()=>ss,ResourceContentsSchema:()=>sH,ResourceLinkSchema:()=>nv,ResourceListChangedNotificationSchema:()=>s5,ResourceRequestParamsSchema:()=>s2,ResourceSchema:()=>sW,ResourceTemplateReferenceSchema:()=>li,ResourceTemplateSchema:()=>sX,ResourceUpdatedNotificationParamsSchema:()=>ni,ResourceUpdatedNotificationSchema:()=>ns,ResultMetaObjectSchema:()=>sc,ResultSchema:()=>su,RoleSchema:()=>sG,RootSchema:()=>lu,RootsListChangedNotificationSchema:()=>lh,SamplingContentSchema:()=>nF,SamplingMessageContentBlockSchema:()=>nH,SamplingMessageSchema:()=>nK,ServerCapabilitiesSchema:()=>sC,ServerNotificationSchema:()=>lC,ServerRequestSchema:()=>lj,ServerResultSchema:()=>lN,ServerTasksCapabilitySchema:()=>sO,SetLevelRequestParamsSchema:()=>nA,SetLevelRequestSchema:()=>nM,SingleSelectEnumSchemaSchema:()=>n2,StringSchemaSchema:()=>nX,SubscribeRequestParamsSchema:()=>s2,SubscribeRequestSchema:()=>s3,SubscriptionFilterSchema:()=>s8,SubscriptionsAcknowledgedNotificationParamsSchema:()=>nt,SubscriptionsAcknowledgedNotificationSchema:()=>nr,SubscriptionsListenRequestParamsSchema:()=>s7,SubscriptionsListenRequestSchema:()=>ne,SubscriptionsListenResultMetaSchema:()=>no,SubscriptionsListenResultSchema:()=>na,TaskAugmentedRequestParamsSchema:()=>si,TaskCreationParamsSchema:()=>lf,TaskMetadataSchema:()=>st,TaskSchema:()=>ly,TaskStatusNotificationParamsSchema:()=>lv,TaskStatusNotificationSchema:()=>lb,TaskStatusSchema:()=>lm,TextContentSchema:()=>nh,TextResourceContentsSchema:()=>sK,TitledMultiSelectEnumSchemaSchema:()=>n4,TitledSingleSelectEnumSchemaSchema:()=>n0,ToolAnnotationsSchema:()=>nw,ToolChoiceSchema:()=>nU,ToolExecutionSchema:()=>nE,ToolListChangedNotificationSchema:()=>nC,ToolResultContentSchema:()=>nV,ToolSchema:()=>nR,ToolUseContentSchema:()=>ny,UnsubscribeRequestParamsSchema:()=>s2,UnsubscribeRequestSchema:()=>s6,UntitledMultiSelectEnumSchemaSchema:()=>n9,UntitledSingleSelectEnumSchemaSchema:()=>nQ});let ph=t=>sf.safeParse(t).success,pf=t=>sm.safeParse(t).success,pm=t=>"object"==typeof t&&null!==t&&!Array.isArray(t)&&"input_required"===t.resultType,py="x-mcp-header",pg=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,pv=new Set(["string","integer","boolean","number"]);function pb(t){let r=[],o=new Map,a=(t,i,s)=>{if(null===t||"object"!=typeof t)return;if(py in t){if(!s||0===i.length)return`${p$(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let a=t[py];if("string"!=typeof a||0===a.length)return`${p$(i)}: x-mcp-header MUST be a non-empty string`;if(!pg.test(a))return`${p$(i)}: x-mcp-header '${a}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let n="string"==typeof t.type?t.type:void 0;if(void 0===n||!pv.has(n))return`${p$(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${n??"<none>"}`;let l=a.toLowerCase(),c=o.get(l);if(void 0!==c)return`x-mcp-header '${a}' is not case-insensitively unique (also declared as '${c}')`;o.set(l,a),r.push({path:i,headerName:a,type:n})}let n=t.properties;if(null!==n&&"object"==typeof n)for(let[t,r]of Object.entries(n)){let o=a(r,[...i,t],s);if(void 0!==o)return o}for(let r of p_){let o=t[r];if(void 0!==o)for(let t of Array.isArray(o)?o:null!==o&&"object"==typeof o&&pS.has(r)?Object.values(o):[o]){let o=a(t,[...i,`<${r}>`],!1);if(void 0!==o)return o}}},i=a(t,[],!0);return void 0===i?{valid:!0,declarations:r}:{valid:!1,reason:i}}let p_=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],pS=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function p$(t){return 0===t.length?"<root>":t.join(".")}let pw="=?base64?";function pE(t){return!function(t){if(0===t.length||t.startsWith(pw)&&t.endsWith("?=")||t!==t.trim())return!0;for(let r=0;r<t.length;r++){let o=t.codePointAt(r);if(9!==o&&(!(o>=32)||!(o<=126)))return!0}return!1}(t)?t:`${pw}${function(t){let r=new TextEncoder().encode(t),o="";for(let t of r)o+=String.fromCodePoint(t);return btoa(o)}(t)}?=`}function pR(t){return new Set(t.flatMap(t=>Object.keys(t.shape)))}function pP(t){if(null==t)return!1;let r=typeof t;return("object"===r||"function"===r)&&"~standard"in t&&"function"==typeof t["~standard"]?.validate}dW.InvalidRequest,dW.UnsupportedProtocolVersion,dW.InvalidParams,dW.MethodNotFound,dW.InvalidParams,dW.MissingRequiredClientCapability,dW.ParseError,dW.InvalidRequest,dW.MethodNotFound,dW.UnsupportedProtocolVersion,dW.MissingRequiredClientCapability;let pk=!1,pO="draft-2020-12";async function pT(t,r){let o=await t["~standard"].validate(r);return o.issues&&o.issues.length>0?{success:!1,error:o.issues.map(t=>t.path?.length?`${t.path.map(t=>String("object"==typeof t?t.key:t)).join(".")}: ${t.message}`:t.message).join(", ")}:{success:!0,data:o.value}}let px=/\\\.\\d\{(\d+)\}/;function pj(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}let pC=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function pN(t){return pC.has(t)||t.startsWith("x-")}let pI=new Set(["$schema",...Object.keys(n8.shape.requestedSchema.shape)]),pA={string:pR([nX,nQ,n0,n1]),number:pR([nY]),integer:pR([nY]),boolean:pR([nW]),array:pR([n9,n4])},pM=new Set(nX.shape.format.unwrap().options);async function pq(t){let{config:r,method:o,originalParams:a,requestOptions:i,hooks:s,signal:n}=t,l=t.flowStartedAt??Date.now(),c=t.firstPayload,u=0;for(;;){let t;if((u+=1)>r.maxRounds){var d;throw new d_(db.InputRequiredRoundsExceeded,(d=r.maxRounds,`Multi-round-trip request '${o}' still required input after ${d} rounds (inputRequired.maxRounds)`),{rounds:r.maxRounds,lastResult:{inputRequests:c.inputRequests,...void 0!==c.requestState&&{requestState:c.requestState}}})}i.onprogress?.({progress:u,message:`Fulfilling input required by '${o}' (round ${u})`});let p=Object.entries(c.inputRequests??{});if(p.length>0){let r=function(t){let r=new AbortController,o=()=>r.abort(t?.reason);return t?.addEventListener("abort",o,{once:!0}),t?.aborted&&r.abort(t.reason),{signal:r.signal,abort:t=>r.abort(t),dispose:()=>t?.removeEventListener("abort",o)}}(n);try{let o=await Promise.all(p.map(async([t,o])=>{try{return[t,await s.dispatchInputRequest(t,o,r.signal)]}catch(t){throw r.abort(t),t}}));t=Object.fromEntries(o)}finally{r.dispose()}}else await function(t,r){return new Promise((t,o)=>{if(r?.aborted)return void o(r.reason instanceof d_?r.reason:new d_(db.RequestTimeout,String(r.reason)));let a=setTimeout(()=>{r?.removeEventListener("abort",i),t()},250),i=()=>{clearTimeout(a),o(r?.reason instanceof d_?r.reason:new d_(db.RequestTimeout,String(r?.reason)))};r?.addEventListener("abort",i,{once:!0})})}(0,n);let h={...void 0!==i.timeout&&{timeout:i.timeout}};if(void 0!==i.maxTotalTimeout){let t=Date.now()-l,r=i.maxTotalTimeout-t;if(r<=0)throw new d_(db.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:t});h.maxTotalTimeout=r}let f=await s.retry(function(t,r,o){let a=void 0!==r&&Object.keys(r).length>0;return a||void 0!==o?{...t,...a&&{inputResponses:r},...void 0!==o&&{requestState:o}}:t}(a,t,c.requestState),h);if(pm(f)){c={inputRequests:f.inputRequests??{},...void 0!==f.requestState&&{requestState:f.requestState}};continue}return f}}Object.assign(function(t){let r=void 0!==t.inputRequests&&Object.keys(t.inputRequests).length>0,o="string"==typeof t.requestState;if(!r&&!o)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...void 0!==t.inputRequests&&{inputRequests:t.inputRequests},...void 0!==t.requestState&&{requestState:t.requestState}}},{elicit(t){try{return{method:"elicitation/create",params:function(t){var r;if(!pP(t.requestedSchema))return{...t,mode:"form",requestedSchema:t.requestedSchema};let o=t.requestedSchema["~standard"].vendor,a=function(t,r){let o={},a=[];for(let[i,s]of Object.entries(t))"properties"===i&&pj(s)?o[i]=Object.fromEntries(Object.entries(s).map(([t,o])=>[t,function(t,r,o,a){if(!pj(t))return t;let i="string"==typeof t.type&&Object.hasOwn(pA,t.type)?pA[t.type]:void 0;if(void 0===i)return t;let s={};for(let[l,c]of Object.entries(t))if(i.has(l)||pN(l))s[l]=c;else if("pattern"===l&&"string"===t.type&&"string"==typeof t.format)if(pM.has(t.format)){var n;"string"==typeof c&&(n=t.format,"zod"!==o||(function(t,r){let o;switch(t){case"email":o=[ot(aB,void 0)];break;case"uri":o=[or(aW,void 0)];break;case"date":o=[oa(aH,void 0)];break;case"date-time":let a,i;a=px.exec(r),i=[void 0,-1,0],a&&i.push(Number(a[1])),o=[!1,!0].flatMap(t=>[!1,!0].flatMap(r=>i.map(o=>oo(aF,{local:t,offset:r,precision:o}))))}return new Set(o.map(t=>{let r;return r=an(t,{target:pO,io:"input"}),"string"==typeof r.pattern?r.pattern:void 0}).filter(t=>void 0!==t))})(n,c).has(c))||a.push(`${r}.${l}`)}else s[l]=c;else a.push(`${r}.${l}`);return s}(o,`properties.${t}`,r,a)])):pI.has(i)?o[i]=s:pN(i)||a.push(i);if(a.length>0)throw new dX(dW.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${a.join(", ")}`);return o}(function(t){try{return function(t,r="input"){let o,a=t["~standard"];if(a.jsonSchema)o=a.jsonSchema[r]({target:pO});else if("zod"===a.vendor){if(!("_zod"in t))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");pk||(pk=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),o=an(t,{target:pO,io:r})}else throw Error(`Schema library "${a.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if("output"===r)return void 0!==o.type||!function t(r){if("properties"in r||"patternProperties"in r||"additionalProperties"in r||"required"in r)return!0;for(let o of["oneOf","anyOf","allOf"]){let a=r[o];if(Array.isArray(a)&&a.length>0)return a.every(r=>null!==r&&"object"==typeof r&&("object"===r.type||t(r)))}return!1}(o)?o:{type:"object",...o};if(void 0!==o.type&&"object"!==o.type)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(o.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...o}}(t,"input")}catch(r){let t=r instanceof Error?r.message:String(r);throw new dX(dW.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}(t.requestedSchema),o),i=(r=n8.shape.requestedSchema,ak(r,a));if(!i.success)throw new dX(dW.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${function(t,r){if(!pj(t.properties))return r;let o=Object.entries(t.properties).filter(([,t])=>!ak(n6,t).success).map(([t])=>`properties.${t}`);return o.length>0?o.join(", "):r}(a,i.error.message)}`);let s=function t(r,o,a=""){return Array.isArray(r)&&Array.isArray(o)?r.flatMap((r,i)=>t(r,o[i],`${a}[${i}]`)):pj(r)&&pj(o)?Object.entries(r).flatMap(([r,i])=>{let s=a?`${a}.${r}`:r;return Object.prototype.hasOwnProperty.call(o,r)?t(i,o[r],s):pN(r)?[]:[s]}):[]}(a,i.data);if(s.length>0)throw new dX(dW.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${s.join(", ")}`);let n=(i.data.required??[]).filter(t=>!Object.prototype.hasOwnProperty.call(i.data.properties,t));if(n.length>0)throw new dX(dW.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${n.join(", ")}`);return{...t,mode:"form",requestedSchema:i.data}}(t)}}catch(t){throw t instanceof dX?TypeError(t.message,{cause:t}):t}},elicitUrl:t=>({method:"elicitation/create",params:{...t,mode:"url"}}),createMessage:t=>({method:"sampling/createMessage",params:t}),listRoots:()=>({method:"roots/list"})});let pz={},pL={};function pD(t,r){let o=t.slice(0,-6);pz[o]=r,pL[o]=t=>r.safeParse(t).success}for(let t of["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"])pD(t,pp[t]);for(let[t,r]of Object.entries({IdJagTokenExchangeResponseSchema:lD,OAuthClientInformationFullSchema:lK,OAuthClientInformationSchema:lH,OAuthClientMetadataSchema:lF,OAuthClientRegistrationErrorSchema:lJ,OAuthErrorResponseSchema:lU,OAuthMetadataSchema:lM,OAuthProtectedResourceMetadataSchema:lA,OAuthTokenRevocationRequestSchema:lB,OAuthTokensSchema:lL,OpenIdProviderDiscoveryMetadataSchema:lz,OpenIdProviderMetadataSchema:lq}))pD(t,r);Object.freeze(pz);let pU=Object.freeze(pL),pV=[i0,i1,i9,i5],pF=["inputResponses","requestState"];function pH(t,r){let o=t.params;if(!pG(o))return{message:t,lifted:{}};let a=o._meta,i=pG(a)?pV.filter(t=>t in a):[],s="request"===r?pF.filter(t=>t in o):[];if(0===i.length&&0===s.length)return{message:t,lifted:{}};let n={},l={...o};if(i.length>0&&pG(a)){let t={},r={...a};for(let o of i)t[o]=a[o],delete r[o];n.envelope=t,Object.keys(r).length>0?l._meta=r:delete l._meta}for(let t of s)"inputResponses"===t&&(n.inputResponses=l[t]),"requestState"===t&&(n.requestState=l[t]),delete l[t];return{message:{...t,params:l},lifted:n}}function pK(t,r){let o=t.validateResult(r,void 0);if(o.ok||"not-in-era"!==o.reason)return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let a=t.validateResult(r,o);return a.ok?{value:a.value}:{issues:[{message:"invalid"===a.reason?a.message:`not-in-era: ${r}`}]}}}}}let pJ=(O=void 0,()=>O);var pB=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(t){this._options=t,this._supportedProtocolVersions=t?.supportedProtocolVersions??iQ,this.setNotificationHandler("notifications/cancelled",t=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",t=>{this._onprogress(t)}),this.setRequestHandler("ping",t=>({}))}_shouldDropInbound(t){}_outboundMetaEnvelope(){}_envelopeOutbound(t){let r=this._outboundMetaEnvelope();if(void 0===r)return t;let o=t.params??{};return{...t,params:{...o,_meta:{...r,...o._meta}}}}_resolveNonCompleteResult(t,r){return Promise.reject(new d_(db.UnsupportedResultType,`Unsupported result type '${t.kind}' for ${r.request.method}`,{resultType:t.kind,method:r.request.method}))}_getRequestHandler(t){return this._requestHandlers.get(t)}async _oncancel(t){t.params.requestId&&this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,r,o,a,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(a,r),startTime:Date.now(),timeout:r,maxTotalTimeout:o,resetTimeoutOnProgress:i,onTimeout:a})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let o=Date.now()-r.startTime;if(r.maxTotalTimeout&&o>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),new d_(db.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:o});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(t){let r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}async connect(t){this._transport=t;let r=this.transport?.onclose;this._transport.onclose=()=>{try{r?.()}finally{this._onclose()}};let o=this.transport?.onerror;this._transport.onerror=t=>{o?.(t),this._onerror(t)};let a=this._transport?.onmessage;this._transport.onmessage=(t,r)=>{if(a?.(t,r),ph(t)||pf(t))this._onresponse(t);else if(sp.safeParse(t).success)this._onrequest(t,r);else sh.safeParse(t).success?this._onnotification(t,r):this._onerror(Error(`Unknown message type: ${JSON.stringify(t)}`))},t.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let t=this._responseHandlers;for(let t of(this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._timeoutInfo.values()))clearTimeout(t.timeoutId);this._timeoutInfo.clear();let r=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let o=new d_(db.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let r of t.values())r(o);for(let t of r.values())t.abort(o)}}_onerror(t){this.onerror?.(t)}_onnotification(t,r){let{message:o}=pH(t,"notification"),a=this._negotiatedWireCodec();if(r?.classification===void 0&&"drop"===this._shouldDropInbound(t))return;if(r?.classification!==void 0){let t=pl(r.classification);if(t!==a.era)return void this._onerror(Error(`Era mismatch on inbound notification '${o.method}': classified as ${t} but this instance serves ${a.era}`))}if(pu(o.method)&&!a.hasNotificationMethod(o.method))return;let i=this._notificationHandlers.get(o.method),s=this.fallbackNotificationHandler;(void 0!==i||void 0!==s)&&Promise.resolve().then(()=>void 0===i?s(o):i(o,a)).catch(t=>this._onerror(Error(`Uncaught error in notification handler: ${t}`)))}_onrequest(t,r){var o;let{message:a,lifted:i}=pH(t,"request"),s=this._negotiatedWireCodec();if(r?.classification===void 0&&"drop"===this._shouldDropInbound(t))return void this._onerror(Error(`Dropped inbound request '${t.method}': not servable on this connection's protocol era`));let n=this._transport,l=(t,r,o)=>{let i={jsonrpc:"2.0",id:a.id,error:{code:t,message:r,...void 0!==o&&{data:o}}};n?.send(i).catch(t=>this._onerror(Error(`Failed to send an error response: ${t}`)))};if(r?.classification!==void 0){let t=pl(r.classification);if(t!==s.era){this._onerror(Error(`Era mismatch on inbound request '${a.method}': classified as ${t} but this instance serves ${s.era}`));let o=r.classification.revision??t;l(dW.UnsupportedProtocolVersion,`Unsupported protocol version: ${o}`,{supported:this._supportedProtocolVersions,requested:o});return}}if(pc(a.method)&&!s.hasRequestMethod(a.method))return void l(dW.MethodNotFound,"Method not found");let c=this._requestHandlers.get(a.method)??this.fallbackRequestHandler;if(void 0===c)return void l(dW.MethodNotFound,"Method not found");let u=s.checkInboundEnvelope(i);if(void 0!==u)return void l(dW.InvalidParams,u);let d=(t,r)=>this._notificationViaCodec(this._resolveOutboundCodec(t.method),t,{...r,relatedRequestId:a.id}),p=(t,r,o)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(t.method),t,r,{...o,relatedRequestId:a.id}),h=new AbortController;this._requestHandlerAbortControllers.set(a.id,h);let f=void 0===i.inputResponses?void 0:function(t){let r={},o=[];if(!pZ(t))return{accepted:r,droppedKeys:o};for(let[a,i]of Object.entries(t)){if(!pZ(i)||"method"in i||"result"in i){o.push(a);continue}r[a]=i}return{accepted:r,droppedKeys:o}}(i.inputResponses),m={sessionId:n?.sessionId,mcpReq:{id:a.id,method:a.method,_meta:a.params?._meta,...void 0!==i.envelope&&{envelope:i.envelope},...void 0!==f&&{inputResponses:f.accepted},...void 0!==f&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:void 0===i.requestState?pJ:(o=i.requestState,()=>o),signal:h.signal,send:(t,r,o)=>{let a=this._resolveOutboundCodec(t.method);if(this._assertOutboundRequestInEra(a,t.method),pP(r))return p(t,r,o);let i=pK(a,t.method);if(void 0===i)throw TypeError(`'${t.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return p(t,i,r)},notify:d},http:r?.authInfo?{authInfo:r.authInfo}:void 0},y=this.buildContext(m,r);Promise.resolve().then(()=>c(a,y)).then(async t=>{let r;if(h.signal.aborted)return;try{r=s.encodeResult(a.method,t,this._outboundServerInfo())}catch(t){this._onerror(Error(`Failed to encode result for ${a.method}: ${t}`)),l(dW.InternalError,"Internal error");return}let o={result:r,jsonrpc:"2.0",id:a.id};await n?.send(o)},async t=>{if(h.signal.aborted)return;let r=Number.isSafeInteger(t.code)?t.code:dW.InternalError,o={jsonrpc:"2.0",id:a.id,error:{code:s.encodeErrorCode(r),message:t.message??"Internal error",...void 0!==t.data&&{data:t.data}}};await n?.send(o)}).catch(t=>this._onerror(Error(`Failed to send response: ${t}`))).finally(()=>{this._requestHandlerAbortControllers.get(a.id)===h&&this._requestHandlerAbortControllers.delete(a.id)})}_onprogress(t){let{progressToken:r,...o}=t.params,a=Number(r),i=this._progressHandlers.get(a);if(!i)return void this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));let s=this._responseHandlers.get(a),n=this._timeoutInfo.get(a);if(n&&s&&n.resetTimeoutOnProgress)try{this._resetTimeout(a)}catch(t){this._responseHandlers.delete(a),this._progressHandlers.delete(a),this._cleanupTimeout(a),s(t);return}i(o)}_onresponse(t){let r=Number(t.id),o=this._responseHandlers.get(r);void 0===o?this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`)):(this._responseHandlers.delete(r),this._cleanupTimeout(r),this._progressHandlers.delete(r),o(ph(t)?t:dX.fromError(t.error.code,t.error.message,t.error.data)))}get transport(){return this._transport}async close(){await this._transport?.close()}request(t,r,o){let a=this._resolveOutboundCodec(t.method);if(this._assertOutboundRequestInEra(a,t.method),pP(r))return this._requestWithSchemaViaCodec(a,t,r,o);let i=pK(a,t.method);if(void 0===i)throw TypeError(`'${t.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(a,t,i,r)}_negotiatedWireCodec(){return pn(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(t){if(void 0===this._negotiatedProtocolVersion){let r=function(t){switch(t){case"initialize":case"notifications/initialized":return pn(void 0);case"server/discover":return pn(ps);default:return}}(t);if(r)return r}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(t,r){if(pc(r)&&!t.hasRequestMethod(r))throw new d_(db.MethodNotSupportedByProtocolVersion,`Method '${r}' is not supported by the negotiated protocol version (wire era ${t.era})`,{method:r,era:t.era})}_requestWithSchema(t,r,o){let a=this._resolveOutboundCodec(t.method);return this._assertOutboundRequestInEra(a,t.method),this._requestWithSchemaViaCodec(a,t,r,o)}_requestWithSchemaViaCodec(t,r,o,a){let i,s,{relatedRequestId:n,resumptionToken:l,onresumptiontoken:c,headers:u}=a??{},d=Date.now();return new Promise((p,h)=>{let f=t=>{h(t)};if(!this._transport)return void f(Error("Not connected"));if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(r.method)}catch(t){f(t);return}if(a?.signal?.aborted){let t=a.signal.reason;throw t instanceof d_?t:new d_(db.RequestTimeout,String(t))}let m=t.era===ps&&!0===this._transport.hasPerRequestStream?new AbortController:void 0,y=this._requestMessageId++;s=y;let g={...r,jsonrpc:"2.0",id:y};a?.onprogress&&(this._progressHandlers.set(y,a.onprogress),g.params={...r.params,_meta:{...r.params?._meta,progressToken:y}});let v=this._envelopeOutbound(g),b=!1,_=t=>{b||(this._progressHandlers.delete(y),void 0===m?this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:y,reason:String(t)}}),{relatedRequestId:n,resumptionToken:l,onresumptiontoken:c}).catch(t=>this._onerror(Error(`Failed to send cancellation: ${t}`))):m.abort(),h(t instanceof d_?t:new d_(db.RequestTimeout,String(t))))};this._responseHandlers.set(y,i=>{let s;if(!a?.signal?.aborted){if(b=!0,i instanceof Error)return h(i);try{s=t.decodeResult(r.method,i.result)}catch(t){return h(t instanceof Error?t:Error(String(t)))}if("invalid"===s.kind)return h(s.error);if("input_required"===s.kind){var n;return a?.allowInputRequired===!0?p({resultType:"input_required",inputRequests:(n=s).inputRequests,...void 0!==n.requestState&&{requestState:n.requestState}}):p(this._resolveNonCompleteResult(s,{codec:t,request:r,resultSchema:o,options:a,flowStartedAt:d,retry:(a,i)=>this._requestWithSchemaViaCodec(t,void 0===a?{method:r.method}:{method:r.method,params:a},o,i)}))}pT(o,s.result).then(t=>{t.success?p(t.data):h(new d_(db.InvalidResult,`Invalid result for ${r.method}: ${t.error}`))},h)}}),i=()=>_(a?.signal?.reason),a?.signal?.addEventListener("abort",i,{once:!0});let S=a?.timeout??6e4;this._setupTimeout(y,S,a?.maxTotalTimeout,()=>_(new d_(db.RequestTimeout,"Request timed out",{timeout:S})),a?.resetTimeoutOnProgress??!1),this._transport.send(v,{relatedRequestId:n,resumptionToken:l,onresumptiontoken:c,headers:u,requestSignal:m?.signal}).catch(t=>{this._progressHandlers.delete(y),h(t)})}).finally(()=>{i&&a?.signal?.removeEventListener("abort",i),void 0!==s&&(this._responseHandlers.delete(s),this._cleanupTimeout(s))})}async notification(t,r){return this._notificationViaCodec(this._resolveOutboundCodec(t.method),t,r)}async _notificationViaCodec(t,r,o){if(!this._transport)throw new d_(db.NotConnected,"Not connected");if(pu(r.method)&&!t.hasNotificationMethod(r.method))throw new d_(db.MethodNotSupportedByProtocolVersion,`Notification '${r.method}' is not supported by the negotiated protocol version (wire era ${t.era})`,{method:r.method,era:t.era});this.assertNotificationCapability(r.method);let a=this._envelopeOutbound({jsonrpc:"2.0",...r});if((this._options?.debouncedNotificationMethods??[]).includes(r.method)&&!r.params&&!o?.relatedRequestId){if(this._pendingDebouncedNotifications.has(r.method))return;this._pendingDebouncedNotifications.add(r.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(r.method),this._transport&&this._transport?.send(a,o).catch(t=>this._onerror(t))});return}await this._transport.send(a,o)}setRequestHandler(t,r,o){let a;if(this.assertRequestHandlerCapability(t),"function"==typeof r){if(!pc(t))throw TypeError(`'${t}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);a=(o,a)=>{let i=this._negotiatedWireCodec(),s=i.validateRequest(t,o);if(s.ok||"not-in-era"!==s.reason||(s=i.validateInputRequest(t,o)),!s.ok){if("not-in-era"===s.reason)throw new dX(dW.InternalError,`No wire schema for ${t} in the resolved era`);throw Error(s.message)}return Promise.resolve(r(s.value,a))}}else if(o)a=async(a,i)=>{let s=await pT(r.params,{...a.params});if(!s.success)throw new dX(dW.InvalidParams,`Invalid params for ${t}: ${s.error}`);return o(s.data,i)};else throw TypeError("setRequestHandler: handler is required");this._requestHandlers.set(t,this._wrapHandler(t,a))}_wrapHandler(t,r){return r}_outboundServerInfo(){}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,r,o){if("function"==typeof r){if(!pu(t))throw TypeError(`'${t}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(t,(o,a)=>{let i=a.validateNotification(t,o);if(!i.ok){if("not-in-era"===i.reason)throw new dX(dW.InternalError,`No wire schema for ${t} in the resolved era`);throw Error(i.message)}return Promise.resolve(r(i.value))});return}if(!o)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(t,async a=>{let i=await pT(r.params,{...a.params});if(!i.success)throw new dX(dW.InvalidParams,`Invalid params for notification ${t}: ${i.error}`);await o(i.data,a)})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}};function pG(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}function pZ(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function pW(t){throw new d_(db.SendFailed,`ctx.mcpReq.${t} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}async function pX(t,r,o,a,i){var s;if(!pZ(a)||"string"!=typeof a.method)throw new d_(db.InvalidResult,`Invalid input request '${o}': each inputRequests entry must be an embedded request object with a method`,{key:o});let n=a.method;if(!r.hasInputRequestMethod(n))throw new d_(db.InvalidResult,`Invalid input request '${o}': '${n}' is not an embedded request the ${r.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:o,method:n});let l=t.getRequestHandler(n);if(void 0===l)throw new d_(db.CapabilityNotSupported,`Cannot fulfil input request '${o}': no handler is registered for '${n}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:o,method:n});let c=pZ(a.params)?a.params:void 0;return await l({jsonrpc:"2.0",id:o,method:n,...void 0!==c&&{params:c}},t.buildContext({sessionId:t.sessionId,mcpReq:{id:o,method:n,_meta:c?._meta,requestState:(s=void 0,()=>s),signal:i,send:()=>pW("send"),notify:()=>pW("notify")}}))}var pY=dc(dl(t=>{var r=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,o=/\\([\u000b\u0020-\u00ff])/g,a=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function i(t){this.parameters=Object.create(null),this.type=t}t.parse=function(t){if(!t)throw TypeError("argument string is required");var s,n,l,c="object"==typeof t?function(t){var r;if("function"==typeof t.getHeader?r=t.getHeader("content-type"):"object"==typeof t.headers&&(r=t.headers&&t.headers["content-type"]),"string"!=typeof r)throw TypeError("content-type header is missing from object");return r}(t):t;if("string"!=typeof c)throw TypeError("argument string is required to be a string");var u=c.indexOf(";"),d=-1!==u?c.slice(0,u).trim():c.trim();if(!a.test(d))throw TypeError("invalid media type");var p=new i(d.toLowerCase());if(-1!==u){for(r.lastIndex=u;n=r.exec(c);){if(n.index!==u)throw TypeError("invalid parameter format");u+=n[0].length,s=n[1].toLowerCase(),34===(l=n[2]).charCodeAt(0)&&-1!==(l=l.slice(1,-1)).indexOf("\\")&&(l=l.replace(o,"$1")),p.parameters[s]=l}if(u!==c.length)throw TypeError("invalid parameter format")}return p}})(),1),pQ=class{_buffer;_maxBufferSize;constructor(t){this._maxBufferSize=t?.maxBufferSize??0xa00000}append(t){if((this._buffer?.length??0)+t.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){for(;this._buffer;){let r=this._buffer.indexOf("\n");if(-1===r)break;let o=this._buffer.toString("utf8",0,r).replace(/\r$/,"");this._buffer=this._buffer.subarray(r+1);try{var t;return t=o,sy.parse(JSON.parse(t))}catch(t){if(t instanceof SyntaxError)continue;throw t}}return null}clear(){this._buffer=void 0}};function p0(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}var p1=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;var r=class{};t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var o=class extends r{constructor(r){if(super(),!t.IDENTIFIER.test(r))throw Error("CodeGen: name must be a valid identifier");this.str=r}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};t.Name=o;var a=class extends r{constructor(t){super(),this._items="string"==typeof t?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return""===t||'""'===t}get str(){var t;return null!=(t=this._str)?t:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var t;return null!=(t=this._names)?t:this._names=this._items.reduce((t,r)=>(r instanceof o&&(t[r.str]=(t[r.str]||0)+1),t),{})}};function i(t,...r){let o=[t[0]],s=0;for(;s<r.length;)l(o,r[s]),o.push(t[++s]);return new a(o)}t._Code=a,t.nil=new a(""),t._=i;let s=new a("+");function n(t,...r){let i=[c(t[0])],u=0;for(;u<r.length;)i.push(s),l(i,r[u]),i.push(s,c(t[++u]));return function(t){let r=1;for(;r<t.length-1;){if(t[r]===s){var a,i;let s=(a=t[r-1],'""'===(i=t[r+1])?a:'""'===a?i:"string"==typeof a?i instanceof o||'"'!==a[a.length-1]?void 0:"string"!=typeof i?`${a.slice(0,-1)}${i}"`:'"'===i[0]?a.slice(0,-1)+i.slice(1):void 0:"string"!=typeof i||'"'!==i[0]||a instanceof o?void 0:`"${a}${i.slice(1)}`);if(void 0!==s){t.splice(r-1,3,s);continue}t[r++]="+"}r++}}(i),new a(i)}function l(t,r){var i;r instanceof a?t.push(...r._items):r instanceof o?t.push(r):t.push("number"==typeof(i=r)||"boolean"==typeof i||null===i?i:c(Array.isArray(i)?i.join(","):i))}function c(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=n,t.addCodeArg=l,t.strConcat=function(t,r){return r.emptyStr()?t:t.emptyStr()?r:n`${t}${r}`},t.stringify=function(t){return new a(c(t))},t.safeStringify=c,t.getProperty=function(r){return"string"==typeof r&&t.IDENTIFIER.test(r)?new a(`.${r}`):i`[${r}]`},t.getEsmExportName=function(r){if("string"==typeof r&&t.IDENTIFIER.test(r))return new a(`${r}`);throw Error(`CodeGen: invalid export name: ${r}, use explicit $id name mapping`)},t.regexpCode=function(t){return new a(t.toString())}}),p2=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;let r=p1();var o,a,i=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}};(o=a||(t.UsedValueState=a={}))[o.Started=0]="Started",o[o.Completed=1]="Completed",t.varKinds={const:new r.Name("const"),let:new r.Name("let"),var:new r.Name("var")};var s=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof r.Name?t:this.name(t)}name(t){return new r.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,o;if((null==(o=null==(r=this._parent)?void 0:r._prefixes)?void 0:o.has(t))||this._prefixes&&!this._prefixes.has(t))throw Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};t.Scope=s;var n=class extends r.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:o,itemIndex:a}){this.value=t,this.scopePath=(0,r._)`.${new r.Name(o)}[${a}]`}};t.ValueScopeName=n;let l=(0,r._)`\n`;var c=class extends s{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?l:r.nil}}get(){return this._scope}name(t){return new n(t,this._newName(t))}value(t,r){var o;if(void 0===r.ref)throw Error("CodeGen: ref must be passed in value");let a=this.toName(t),{prefix:i}=a,s=null!=(o=r.key)?o:r.ref,n=this._values[i];if(n){let t=n.get(s);if(t)return t}else n=this._values[i]=new Map;n.set(s,a);let l=this._scope[i]||(this._scope[i]=[]),c=l.length;return l[c]=r.ref,a.setValue(r,{property:i,itemIndex:c}),a}getValue(t,r){let o=this._values[t];if(o)return o.get(r)}scopeRefs(t,o=this._values){return this._reduceValues(o,o=>{if(void 0===o.scopePath)throw Error(`CodeGen: name "${o}" has no value`);return(0,r._)`${t}${o.scopePath}`})}scopeCode(t=this._values,r,o){return this._reduceValues(t,t=>{if(void 0===t.value)throw Error(`CodeGen: name "${t}" has no value`);return t.value.code},r,o)}_reduceValues(o,s,n={},l){let c=r.nil;for(let u in o){let d=o[u];if(!d)continue;let p=n[u]=n[u]||new Map;d.forEach(o=>{if(p.has(o))return;p.set(o,a.Started);let n=s(o);if(n){let a=this.opts.es5?t.varKinds.var:t.varKinds.const;c=(0,r._)`${c}${a} ${o} = ${n};${this.opts._n}`}else if(n=null==l?void 0:l(o))c=(0,r._)`${c}${n}${this.opts._n}`;else throw new i(o);p.set(o,a.Completed)})}return c}};t.ValueScope=c}),p9=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;let r=p1(),o=p2();var a=p1();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return a._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return a.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return a.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return a.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return a.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return a.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return a.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return a.Name}});var i=p2();Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),t.operators={GT:new r._Code(">"),GTE:new r._Code(">="),LT:new r._Code("<"),LTE:new r._Code("<="),EQ:new r._Code("==="),NEQ:new r._Code("!=="),NOT:new r._Code("!"),OR:new r._Code("||"),AND:new r._Code("&&"),ADD:new r._Code("+")};var s=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},n=class extends s{constructor(t,r,o){super(),this.varKind=t,this.name=r,this.rhs=o}render({es5:t,_n:r}){let a=t?o.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${a} ${this.name}${i};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=j(this.rhs,t,r)),this}get names(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}},l=class extends s{constructor(t,r,o){super(),this.lhs=t,this.rhs=r,this.sideEffects=o}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,o){if(!(this.lhs instanceof r.Name)||t[this.lhs.str]||this.sideEffects)return this.rhs=j(this.rhs,t,o),this}get names(){return x(this.lhs instanceof r.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends l{constructor(t,r,o,a){super(t,o,a),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},u=class extends s{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},d=class extends s{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},p=class extends s{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},h=class extends s{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=j(this.code,t,r),this}get names(){return this.code instanceof r._CodeOrName?this.code.names:{}}},f=class extends s{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,o)=>r+o.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let o=t[r].optimizeNodes();Array.isArray(o)?t.splice(r,1,...o):o?t[r]=o:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:o}=this,a=o.length;for(;a--;){let i=o[a];i.optimizeNames(t,r)||(function(t,r){for(let o in r)t[o]=(t[o]||0)-(r[o]||0)}(t,i.names),o.splice(a,1))}return o.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>T(t,r.names),{})}},m=class extends f{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},y=class extends f{},g=class extends m{};g.kind="else";var v=class t extends m{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let r=this.condition;if(!0===r)return this.nodes;let o=this.else;if(o){let t=o.optimizeNodes();o=this.else=Array.isArray(t)?new g(t):t}return o?!1===r?o instanceof t?o:o.nodes:this.nodes.length?this:new t(C(r),o instanceof t?[o]:o.nodes):!1!==r&&this.nodes.length?this:void 0}optimizeNames(t,r){var o;if(this.else=null==(o=this.else)?void 0:o.optimizeNames(t,r),super.optimizeNames(t,r)||this.else)return this.condition=j(this.condition,t,r),this}get names(){let t=super.names;return x(t,this.condition),this.else&&T(t,this.else.names),t}};v.kind="if";var b=class extends m{};b.kind="for";var _=class extends b{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=j(this.iteration,t,r),this}get names(){return T(super.names,this.iteration.names)}},S=class extends b{constructor(t,r,o,a){super(),this.varKind=t,this.name=r,this.from=o,this.to=a}render(t){let r=t.es5?o.varKinds.var:this.varKind,{name:a,from:i,to:s}=this;return`for(${r} ${a}=${i}; ${a}<${s}; ${a}++)`+super.render(t)}get names(){return x(x(super.names,this.from),this.to)}},$=class extends b{constructor(t,r,o,a){super(),this.loop=t,this.varKind=r,this.name=o,this.iterable=a}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=j(this.iterable,t,r),this}get names(){return T(super.names,this.iterable.names)}},w=class extends m{constructor(t,r,o){super(),this.name=t,this.args=r,this.async=o}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};w.kind="func";var E=class extends f{render(t){return"return "+super.render(t)}};E.kind="return";var R=class extends m{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),null==(t=this.catch)||t.optimizeNodes(),null==(r=this.finally)||r.optimizeNodes(),this}optimizeNames(t,r){var o,a;return super.optimizeNames(t,r),null==(o=this.catch)||o.optimizeNames(t,r),null==(a=this.finally)||a.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&T(t,this.catch.names),this.finally&&T(t,this.finally.names),t}},P=class extends m{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};P.kind="catch";var k=class extends m{render(t){return"finally"+super.render(t)}};k.kind="finally";var O=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?"\n":""},this._extScope=t,this._scope=new o.Scope({parent:t}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let o=this._extScope.value(t,r);return(this._values[o.prefix]||(this._values[o.prefix]=new Set)).add(o),o}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,o,a){let i=this._scope.toName(r);return void 0!==o&&a&&(this._constants[i.str]=o),this._leafNode(new n(t,i,o)),i}const(t,r,a){return this._def(o.varKinds.const,t,r,a)}let(t,r,a){return this._def(o.varKinds.let,t,r,a)}var(t,r,a){return this._def(o.varKinds.var,t,r,a)}assign(t,r,o){return this._leafNode(new l(t,r,o))}add(r,o){return this._leafNode(new c(r,t.operators.ADD,o))}code(t){return"function"==typeof t?t():t!==r.nil&&this._leafNode(new h(t)),this}object(...t){let o=["{"];for(let[a,i]of t)o.length>1&&o.push(","),o.push(a),(a!==i||this.opts.es5)&&(o.push(":"),(0,r.addCodeArg)(o,i));return o.push("}"),new r._Code(o)}if(t,r,o){if(this._blockNode(new v(t)),r&&o)this.code(r).else().code(o).endIf();else if(r)this.code(r).endIf();else if(o)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new v(t))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(v,g)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new _(t),r)}forRange(t,r,a,i,s=this.opts.es5?o.varKinds.var:o.varKinds.let){let n=this._scope.toName(t);return this._for(new S(s,n,r,a),()=>i(n))}forOf(t,a,i,s=o.varKinds.const){let n=this._scope.toName(t);if(this.opts.es5){let t=a instanceof r.Name?a:this.var("_arr",a);return this.forRange("_i",0,(0,r._)`${t}.length`,o=>{this.var(n,(0,r._)`${t}[${o}]`),i(n)})}return this._for(new $("of",s,n,a),()=>i(n))}forIn(t,a,i,s=this.opts.es5?o.varKinds.var:o.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,r._)`Object.keys(${a})`,i);let n=this._scope.toName(t);return this._for(new $("in",s,n,a),()=>i(n))}endFor(){return this._endBlockNode(b)}label(t){return this._leafNode(new u(t))}break(t){return this._leafNode(new d(t))}return(t){let r=new E;if(this._blockNode(r),this.code(t),1!==r.nodes.length)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(t,r,o){if(!r&&!o)throw Error('CodeGen: "try" without "catch" and "finally"');let a=new R;if(this._blockNode(a),this.code(t),r){let t=this.name("e");this._currNode=a.catch=new P(t),r(t)}return o&&(this._currNode=a.finally=new k,this.code(o)),this._endBlockNode(P,k)}throw(t){return this._leafNode(new p(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(void 0===r)throw Error("CodeGen: not in self-balancing block");let o=this._nodes.length-r;if(o<0||void 0!==t&&o!==t)throw Error(`CodeGen: wrong number of nodes: ${o} vs ${t} expected`);return this._nodes.length=r,this}func(t,o=r.nil,a,i){return this._blockNode(new w(t,o,a)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let o=this._currNode;if(o instanceof t||r&&o instanceof r)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof v))throw Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};function T(t,r){for(let o in r)t[o]=(t[o]||0)+(r[o]||0);return t}function x(t,o){return o instanceof r._CodeOrName?T(t,o.names):t}function j(t,o,a){var i;if(t instanceof r.Name)return s(t);if(!((i=t)instanceof r._Code&&i._items.some(t=>t instanceof r.Name&&1===o[t.str]&&void 0!==a[t.str])))return t;return new r._Code(t._items.reduce((t,o)=>(o instanceof r.Name&&(o=s(o)),o instanceof r._Code?t.push(...o._items):t.push(o),t),[]));function s(t){let r=a[t.str];return void 0===r||1!==o[t.str]?t:(delete o[t.str],r)}}function C(t){return"boolean"==typeof t||"number"==typeof t||null===t?!t:(0,r._)`!${M(t)}`}t.CodeGen=O,t.not=C;let N=A(t.operators.AND);t.and=function(...t){return t.reduce(N)};let I=A(t.operators.OR);function A(t){return(o,a)=>o===r.nil?a:a===r.nil?o:(0,r._)`${M(o)} ${t} ${M(a)}`}function M(t){return t instanceof r.Name?t:(0,r._)`(${t})`}t.or=function(...t){return t.reduce(I)}}),p4=dl(t=>{var r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;let a=p9(),i=p1();function s(t,r=t.schema){let{opts:o,self:a}=t;if(!o.strictSchema||"boolean"==typeof r)return;let i=a.RULES.keywords;for(let o in r)i[o]||f(t,`unknown keyword: "${o}"`)}function n(t,r){if("boolean"==typeof t)return!t;for(let o in t)if(r[o])return!0;return!1}function l(t){return"number"==typeof t?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}function c(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function u({mergeNames:t,mergeToName:r,mergeValues:o,resultToName:i}){return(s,n,l,c)=>{let u=void 0===l?n:l instanceof a.Name?(n instanceof a.Name?t(s,n,l):r(s,n,l),l):n instanceof a.Name?(r(s,l,n),n):o(n,l);return c!==a.Name||u instanceof a.Name?u:i(s,u)}}function d(t,r){if(!0===r)return t.var("props",!0);let o=t.var("props",(0,a._)`{}`);return void 0!==r&&p(t,o,r),o}function p(t,r,o){Object.keys(o).forEach(o=>t.assign((0,a._)`${r}${(0,a.getProperty)(o)}`,!0))}t.toHash=function(t){let r={};for(let o of t)r[o]=!0;return r},t.alwaysValidSchema=function(t,r){return"boolean"==typeof r?r:0===Object.keys(r).length||(s(t,r),!n(r,t.self.RULES.all))},t.checkUnknownRules=s,t.schemaHasRules=n,t.schemaHasRulesButRef=function(t,r){if("boolean"==typeof t)return!t;for(let o in t)if("$ref"!==o&&r.all[o])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:t,schemaPath:r},o,i,s){if(!s){if("number"==typeof o||"boolean"==typeof o)return o;if("string"==typeof o)return(0,a._)`${o}`}return(0,a._)`${t}${r}${(0,a.getProperty)(i)}`},t.unescapeFragment=function(t){return c(decodeURIComponent(t))},t.escapeFragment=function(t){return encodeURIComponent(l(t))},t.escapeJsonPointer=l,t.unescapeJsonPointer=c,t.eachItem=function(t,r){if(Array.isArray(t))for(let o of t)r(o);else r(t)},t.mergeEvaluated={props:u({mergeNames:(t,r,o)=>t.if((0,a._)`${o} !== true && ${r} !== undefined`,()=>{t.if((0,a._)`${r} === true`,()=>t.assign(o,!0),()=>t.assign(o,(0,a._)`${o} || {}`).code((0,a._)`Object.assign(${o}, ${r})`))}),mergeToName:(t,r,o)=>t.if((0,a._)`${o} !== true`,()=>{!0===r?t.assign(o,!0):(t.assign(o,(0,a._)`${o} || {}`),p(t,o,r))}),mergeValues:(t,r)=>!0===t||{...t,...r},resultToName:d}),items:u({mergeNames:(t,r,o)=>t.if((0,a._)`${o} !== true && ${r} !== undefined`,()=>t.assign(o,(0,a._)`${r} === true ? true : ${o} > ${r} ? ${o} : ${r}`)),mergeToName:(t,r,o)=>t.if((0,a._)`${o} !== true`,()=>t.assign(o,!0===r||(0,a._)`${o} > ${r} ? ${o} : ${r}`)),mergeValues:(t,r)=>!0===t||Math.max(t,r),resultToName:(t,r)=>t.var("items",r)})},t.evaluatedPropsToName=d,t.setEvaluated=p;let h={};function f(t,r,o=t.opts.strictSchema){if(o){if(r=`strict mode: ${r}`,!0===o)throw Error(r);t.self.logger.warn(r)}}t.useFunc=function(t,r){return t.scopeValue("func",{ref:r,code:h[r.code]||(h[r.code]=new i._Code(r.code))})},(o=r||(t.Type=r={}))[o.Num=0]="Num",o[o.Str=1]="Str",t.getErrorPath=function(t,o,i){if(t instanceof a.Name){let s=o===r.Num;return i?s?(0,a._)`"[" + ${t} + "]"`:(0,a._)`"['" + ${t} + "']"`:s?(0,a._)`"/" + ${t}`:(0,a._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return i?(0,a.getProperty)(t).toString():"/"+l(t)},t.checkStrictMode=f}),p5=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9();t.default={data:new r.Name("data"),valCxt:new r.Name("valCxt"),instancePath:new r.Name("instancePath"),parentData:new r.Name("parentData"),parentDataProperty:new r.Name("parentDataProperty"),rootData:new r.Name("rootData"),dynamicAnchors:new r.Name("dynamicAnchors"),vErrors:new r.Name("vErrors"),errors:new r.Name("errors"),this:new r.Name("this"),self:new r.Name("self"),scope:new r.Name("scope"),json:new r.Name("json"),jsonPos:new r.Name("jsonPos"),jsonLen:new r.Name("jsonLen"),jsonPart:new r.Name("jsonPart")}}),p3=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;let r=p9(),o=p4(),a=p5();function i(t,o){let i=t.const("err",o);t.if((0,r._)`${a.default.vErrors} === null`,()=>t.assign(a.default.vErrors,(0,r._)`[${i}]`),(0,r._)`${a.default.vErrors}.push(${i})`),t.code((0,r._)`${a.default.errors}++`)}function s(t,o){let{gen:a,validateName:i,schemaEnv:s}=t;s.$async?a.throw((0,r._)`new ${t.ValidationError}(${o})`):(a.assign((0,r._)`${i}.errors`,o),a.return(!1))}t.keywordError={message:({keyword:t})=>(0,r.str)`must pass "${t}" keyword validation`},t.keyword$DataError={message:({keyword:t,schemaType:o})=>o?(0,r.str)`"${t}" keyword must be ${o} ($data)`:(0,r.str)`"${t}" keyword is invalid ($data)`},t.reportError=function(o,a=t.keywordError,n,c){let{it:u}=o,{gen:d,compositeRule:p,allErrors:h}=u,f=l(o,a,n);(null!=c?c:p||h)?i(d,f):s(u,(0,r._)`[${f}]`)},t.reportExtraError=function(r,o=t.keywordError,n){let{it:c}=r,{gen:u,compositeRule:d,allErrors:p}=c;i(u,l(r,o,n)),d||p||s(c,a.default.vErrors)},t.resetErrorsCount=function(t,o){t.assign(a.default.errors,o),t.if((0,r._)`${a.default.vErrors} !== null`,()=>t.if(o,()=>t.assign((0,r._)`${a.default.vErrors}.length`,o),()=>t.assign(a.default.vErrors,null)))},t.extendErrors=function({gen:t,keyword:o,schemaValue:i,data:s,errsCount:n,it:l}){if(void 0===n)throw Error("ajv implementation error");let c=t.name("err");t.forRange("i",n,a.default.errors,n=>{t.const(c,(0,r._)`${a.default.vErrors}[${n}]`),t.if((0,r._)`${c}.instancePath === undefined`,()=>t.assign((0,r._)`${c}.instancePath`,(0,r.strConcat)(a.default.instancePath,l.errorPath))),t.assign((0,r._)`${c}.schemaPath`,(0,r.str)`${l.errSchemaPath}/${o}`),l.opts.verbose&&(t.assign((0,r._)`${c}.schema`,i),t.assign((0,r._)`${c}.data`,s))})};let n={keyword:new r.Name("keyword"),schemaPath:new r.Name("schemaPath"),params:new r.Name("params"),propertyName:new r.Name("propertyName"),message:new r.Name("message"),schema:new r.Name("schema"),parentSchema:new r.Name("parentSchema")};function l(t,i,s){let{createErrors:l}=t.it;return!1===l?(0,r._)`{}`:function(t,i,s={}){let{gen:l,it:c}=t,u=[function({errorPath:t},{instancePath:i}){let s=i?(0,r.str)`${t}${(0,o.getErrorPath)(i,o.Type.Str)}`:t;return[a.default.instancePath,(0,r.strConcat)(a.default.instancePath,s)]}(c,s),function({keyword:t,it:{errSchemaPath:a}},{schemaPath:i,parentSchema:s}){let l=s?a:(0,r.str)`${a}/${t}`;return i&&(l=(0,r.str)`${l}${(0,o.getErrorPath)(i,o.Type.Str)}`),[n.schemaPath,l]}(t,s)];return function(t,{params:o,message:i},s){let{keyword:l,data:c,schemaValue:u,it:d}=t,{opts:p,propertyName:h,topSchemaRef:f,schemaPath:m}=d;s.push([n.keyword,l],[n.params,"function"==typeof o?o(t):o||(0,r._)`{}`]),p.messages&&s.push([n.message,"function"==typeof i?i(t):i]),p.verbose&&s.push([n.schema,u],[n.parentSchema,(0,r._)`${f}${m}`],[a.default.data,c]),h&&s.push([n.propertyName,h])}(t,i,u),l.object(...u)}(t,i,s)}}),p6=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;let r=p3(),o=p9(),a=p5(),i={message:"boolean schema is false"};function s(t,o){let{gen:a,data:s}=t;(0,r.reportError)({gen:a,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t},i,void 0,o)}t.topBoolOrEmptySchema=function(t){let{gen:r,schema:i,validateName:n}=t;!1===i?s(t,!1):"object"==typeof i&&!0===i.$async?r.return(a.default.data):(r.assign((0,o._)`${n}.errors`,null),r.return(!0))},t.boolOrEmptySchema=function(t,r){let{gen:o,schema:a}=t;!1===a?(o.var(r,!1),s(t)):o.var(r,!0)}}),p8=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;let r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(t){return"string"==typeof t&&r.has(t)},t.getRules=function(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}}),p7=dl(t=>{function r(t,r){return r.rules.some(r=>o(t,r))}function o(t,r){var o;return void 0!==t[r.keyword]||(null==(o=r.definition.implements)?void 0:o.some(r=>void 0!==t[r]))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:t,self:o},a){let i=o.RULES.types[a];return i&&!0!==i&&r(t,i)},t.shouldUseGroup=r,t.shouldUseRule=o}),he=dl(t=>{var r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;let a=p8(),i=p7(),s=p3(),n=p9(),l=p4();function c(t){let r=Array.isArray(t)?t:t?[t]:[];if(r.every(a.isJSONType))return r;throw Error("type must be JSONType or JSONType[]: "+r.join(","))}(o=r||(t.DataType=r={}))[o.Correct=0]="Correct",o[o.Wrong=1]="Wrong",t.getSchemaTypes=function(t){let r=c(t.type);if(r.includes("null")){if(!1===t.nullable)throw Error("type: null contradicts nullable: false")}else{if(!r.length&&void 0!==t.nullable)throw Error('"nullable" cannot be used without "type"');!0===t.nullable&&r.push("null")}return r},t.getJSONTypes=c,t.coerceAndCheckDataType=function(t,o){var a,s;let{gen:l,data:c,opts:d}=t,h=(a=o,(s=d.coerceTypes)?a.filter(t=>u.has(t)||"array"===s&&"array"===t):[]),m=o.length>0&&!(0===h.length&&1===o.length&&(0,i.schemaHasRulesForType)(t,o[0]));if(m){let a=p(o,c,d.strictNumbers,r.Wrong);l.if(a,()=>{h.length?function(t,r,o){let{gen:a,data:i,opts:s}=t,l=a.let("dataType",(0,n._)`typeof ${i}`),c=a.let("coerced",(0,n._)`undefined`);for(let t of("array"===s.coerceTypes&&a.if((0,n._)`${l} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>a.assign(i,(0,n._)`${i}[0]`).assign(l,(0,n._)`typeof ${i}`).if(p(r,i,s.strictNumbers),()=>a.assign(c,i))),a.if((0,n._)`${c} !== undefined`),o))(u.has(t)||"array"===t&&"array"===s.coerceTypes)&&function(t){switch(t){case"string":a.elseIf((0,n._)`${l} == "number" || ${l} == "boolean"`).assign(c,(0,n._)`"" + ${i}`).elseIf((0,n._)`${i} === null`).assign(c,(0,n._)`""`);return;case"number":a.elseIf((0,n._)`${l} == "boolean" || ${i} === null
|
|
62
|
+
|| (${l} == "string" && ${i} && ${i} == +${i})`).assign(c,(0,n._)`+${i}`);return;case"integer":a.elseIf((0,n._)`${l} === "boolean" || ${i} === null
|
|
63
|
+
|| (${l} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(c,(0,n._)`+${i}`);return;case"boolean":a.elseIf((0,n._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(c,!1).elseIf((0,n._)`${i} === "true" || ${i} === 1`).assign(c,!0);return;case"null":a.elseIf((0,n._)`${i} === "" || ${i} === 0 || ${i} === false`),a.assign(c,null);return;case"array":a.elseIf((0,n._)`${l} === "string" || ${l} === "number"
|
|
64
|
+
|| ${l} === "boolean" || ${i} === null`).assign(c,(0,n._)`[${i}]`)}}(t);a.else(),f(t),a.endIf(),a.if((0,n._)`${c} !== undefined`,()=>{a.assign(i,c),function({gen:t,parentData:r,parentDataProperty:o},a){t.if((0,n._)`${r} !== undefined`,()=>t.assign((0,n._)`${r}[${o}]`,a))}(t,c)})}(t,o,h):f(t)})}return m};let u=new Set(["string","number","integer","boolean","null"]);function d(t,o,a,i=r.Correct){let s,l=i===r.Correct?n.operators.EQ:n.operators.NEQ;switch(t){case"null":return(0,n._)`${o} ${l} null`;case"array":s=(0,n._)`Array.isArray(${o})`;break;case"object":s=(0,n._)`${o} && typeof ${o} == "object" && !Array.isArray(${o})`;break;case"integer":s=c((0,n._)`!(${o} % 1) && !isNaN(${o})`);break;case"number":s=c();break;default:return(0,n._)`typeof ${o} ${l} ${t}`}return i===r.Correct?s:(0,n.not)(s);function c(t=n.nil){return(0,n.and)((0,n._)`typeof ${o} == "number"`,t,a?(0,n._)`isFinite(${o})`:n.nil)}}function p(t,r,o,a){let i;if(1===t.length)return d(t[0],r,o,a);let s=(0,l.toHash)(t);if(s.array&&s.object){let t=(0,n._)`typeof ${r} != "object"`;i=s.null?t:(0,n._)`!${r} || ${t}`,delete s.null,delete s.array,delete s.object}else i=n.nil;for(let t in s.number&&delete s.integer,s)i=(0,n.and)(i,d(t,r,o,a));return i}t.checkDataType=d,t.checkDataTypes=p;let h={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:r})=>"string"==typeof t?(0,n._)`{type: ${t}}`:(0,n._)`{type: ${r}}`};function f(t){let r=function(t){let{gen:r,data:o,schema:a}=t,i=(0,l.schemaRefOrVal)(t,a,"type");return{gen:r,keyword:"type",data:o,schema:a.type,schemaCode:i,schemaValue:i,parentSchema:a,params:{},it:t}}(t);(0,s.reportError)(r,h)}t.reportTypeError=f}),ht=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;let r=p9(),o=p4();function a(t,a,i){let{gen:s,compositeRule:n,data:l,opts:c}=t;if(void 0===i)return;let u=(0,r._)`${l}${(0,r.getProperty)(a)}`;if(n)return void(0,o.checkStrictMode)(t,`default is ignored for: ${u}`);let d=(0,r._)`${u} === undefined`;"empty"===c.useDefaults&&(d=(0,r._)`${d} || ${u} === null || ${u} === ""`),s.if(d,(0,r._)`${u} = ${(0,r.stringify)(i)}`)}t.assignDefaults=function(t,r){let{properties:o,items:i}=t.schema;if("object"===r&&o)for(let r in o)a(t,r,o[r].default);else"array"===r&&Array.isArray(i)&&i.forEach((r,o)=>a(t,o,r.default))}}),hr=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;let r=p9(),o=p4(),a=p5(),i=p4();function s(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,r._)`Object.prototype.hasOwnProperty`})}function n(t,o,a){return(0,r._)`${s(t)}.call(${o}, ${a})`}function l(t,o,a,i){let s=(0,r._)`${o}${(0,r.getProperty)(a)} === undefined`;return i?(0,r.or)(s,(0,r.not)(n(t,o,a))):s}function c(t){return t?Object.keys(t).filter(t=>"__proto__"!==t):[]}t.checkReportMissingProp=function(t,o){let{gen:a,data:i,it:s}=t;a.if(l(a,i,o,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,r._)`${o}`},!0),t.error()})},t.checkMissingProp=function({gen:t,data:o,it:{opts:a}},i,s){return(0,r.or)(...i.map(i=>(0,r.and)(l(t,o,i,a.ownProperties),(0,r._)`${s} = ${i}`)))},t.reportMissingProp=function(t,r){t.setParams({missingProperty:r},!0),t.error()},t.hasPropFunc=s,t.isOwnProperty=n,t.propertyInData=function(t,o,a,i){let s=(0,r._)`${o}${(0,r.getProperty)(a)} !== undefined`;return i?(0,r._)`${s} && ${n(t,o,a)}`:s},t.noPropertyInData=l,t.allSchemaProperties=c,t.schemaProperties=function(t,r){return c(r).filter(a=>!(0,o.alwaysValidSchema)(t,r[a]))},t.callValidateCode=function({schemaCode:t,data:o,it:{gen:i,topSchemaRef:s,schemaPath:n,errorPath:l},it:c},u,d,p){let h=p?(0,r._)`${t}, ${o}, ${s}${n}`:o,f=[[a.default.instancePath,(0,r.strConcat)(a.default.instancePath,l)],[a.default.parentData,c.parentData],[a.default.parentDataProperty,c.parentDataProperty],[a.default.rootData,a.default.rootData]];c.opts.dynamicRef&&f.push([a.default.dynamicAnchors,a.default.dynamicAnchors]);let m=(0,r._)`${h}, ${i.object(...f)}`;return d!==r.nil?(0,r._)`${u}.call(${d}, ${m})`:(0,r._)`${u}(${m})`};let u=(0,r._)`new RegExp`;t.usePattern=function({gen:t,it:{opts:o}},a){let s=o.unicodeRegExp?"u":"",{regExp:n}=o.code,l=n(a,s);return t.scopeValue("pattern",{key:l.toString(),ref:l,code:(0,r._)`${"new RegExp"===n.code?u:(0,i.useFunc)(t,n)}(${a}, ${s})`})},t.validateArray=function(t){let{gen:a,data:i,keyword:s,it:n}=t,l=a.name("valid");if(n.allErrors){let t=a.let("valid",!0);return c(()=>a.assign(t,!1)),t}return a.var(l,!0),c(()=>a.break()),l;function c(n){let c=a.const("len",(0,r._)`${i}.length`);a.forRange("i",0,c,i=>{t.subschema({keyword:s,dataProp:i,dataPropType:o.Type.Num},l),a.if((0,r.not)(l),n)})}},t.validateUnion=function(t){let{gen:a,schema:i,keyword:s,it:n}=t;if(!Array.isArray(i))throw Error("ajv implementation error");if(i.some(t=>(0,o.alwaysValidSchema)(n,t))&&!n.opts.unevaluated)return;let l=a.let("valid",!1),c=a.name("_valid");a.block(()=>i.forEach((o,i)=>{let n=t.subschema({keyword:s,schemaProp:i,compositeRule:!0},c);a.assign(l,(0,r._)`${l} || ${c}`),t.mergeValidEvaluated(n,c)||a.if((0,r.not)(l))})),t.result(l,()=>t.reset(),()=>t.error(!0))}}),ho=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;let r=p9(),o=p5(),a=hr(),i=p3();function s(t){let{gen:o,data:a,it:i}=t;o.if(i.parentData,()=>o.assign(a,(0,r._)`${i.parentData}[${i.parentDataProperty}]`))}function n(t,o,a){if(void 0===a)throw Error(`keyword "${o}" failed to compile`);return t.scopeValue("keyword","function"==typeof a?{ref:a}:{ref:a,code:(0,r.stringify)(a)})}t.macroKeywordCode=function(t,o){let{gen:a,keyword:i,schema:s,parentSchema:l,it:c}=t,u=o.macro.call(c.self,s,l,c),d=n(a,i,u);!1!==c.opts.validateSchema&&c.self.validateSchema(u,!0);let p=a.name("valid");t.subschema({schema:u,schemaPath:r.nil,errSchemaPath:`${c.errSchemaPath}/${i}`,topSchemaRef:d,compositeRule:!0},p),t.pass(p,()=>t.error(!0))},t.funcKeywordCode=function(t,l){var c;let{gen:u,keyword:d,schema:p,parentSchema:h,$data:f,it:m}=t;!function({schemaEnv:t},r){if(r.async&&!t.$async)throw Error("async keyword in sync schema")}(m,l);let y=n(u,d,!f&&l.compile?l.compile.call(m.self,p,h,m):l.validate),g=u.let("valid");function v(i=l.async?(0,r._)`await `:r.nil){let s=m.opts.passContext?o.default.this:o.default.self,n=!("compile"in l&&!f||!1===l.schema);u.assign(g,(0,r._)`${i}${(0,a.callValidateCode)(t,y,s,n)}`,l.modifying)}function b(t){var o;u.if((0,r.not)(null!=(o=l.valid)?o:g),t)}t.block$data(g,function(){if(!1===l.errors)v(),l.modifying&&s(t),b(()=>t.error());else{let a,n,c=l.async?(a=u.let("ruleErrs",null),u.try(()=>v((0,r._)`await `),t=>u.assign(g,!1).if((0,r._)`${t} instanceof ${m.ValidationError}`,()=>u.assign(a,(0,r._)`${t}.errors`),()=>u.throw(t))),a):(n=(0,r._)`${y}.errors`,u.assign(n,null),v(r.nil),n);l.modifying&&s(t),b(()=>(function(t,a){let{gen:s}=t;s.if((0,r._)`Array.isArray(${a})`,()=>{s.assign(o.default.vErrors,(0,r._)`${o.default.vErrors} === null ? ${a} : ${o.default.vErrors}.concat(${a})`).assign(o.default.errors,(0,r._)`${o.default.vErrors}.length`),(0,i.extendErrors)(t)},()=>t.error())})(t,c))}}),t.ok(null!=(c=l.valid)?c:g)},t.validSchemaType=function(t,r,o=!1){return!r.length||r.some(r=>"array"===r?Array.isArray(t):"object"===r?t&&"object"==typeof t&&!Array.isArray(t):typeof t==r||o&&void 0===t)},t.validateKeywordUsage=function({schema:t,opts:r,self:o,errSchemaPath:a},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw Error("ajv implementation error");let n=i.dependencies;if(null==n?void 0:n.some(r=>!Object.prototype.hasOwnProperty.call(t,r)))throw Error(`parent schema must have dependencies of ${s}: ${n.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let t=`keyword "${s}" value is invalid at path "${a}": `+o.errorsText(i.validateSchema.errors);if("log"===r.validateSchema)o.logger.error(t);else throw Error(t)}}}),ha=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;let r=p9(),o=p4();t.getSubschema=function(t,{keyword:a,schemaProp:i,schema:s,schemaPath:n,errSchemaPath:l,topSchemaRef:c}){if(void 0!==a&&void 0!==s)throw Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==a){let s=t.schema[a];return void 0===i?{schema:s,schemaPath:(0,r._)`${t.schemaPath}${(0,r.getProperty)(a)}`,errSchemaPath:`${t.errSchemaPath}/${a}`}:{schema:s[i],schemaPath:(0,r._)`${t.schemaPath}${(0,r.getProperty)(a)}${(0,r.getProperty)(i)}`,errSchemaPath:`${t.errSchemaPath}/${a}/${(0,o.escapeFragment)(i)}`}}if(void 0!==s){if(void 0===n||void 0===l||void 0===c)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:n,topSchemaRef:c,errSchemaPath:l}}throw Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(t,a,{dataProp:i,dataPropType:s,data:n,dataTypes:l,propertyName:c}){if(void 0!==n&&void 0!==i)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:u}=a;if(void 0!==i){let{errorPath:n,dataPathArr:l,opts:c}=a;d(u.let("data",(0,r._)`${a.data}${(0,r.getProperty)(i)}`,!0)),t.errorPath=(0,r.str)`${n}${(0,o.getErrorPath)(i,s,c.jsPropertySyntax)}`,t.parentDataProperty=(0,r._)`${i}`,t.dataPathArr=[...l,t.parentDataProperty]}function d(r){t.data=r,t.dataLevel=a.dataLevel+1,t.dataTypes=[],a.definedProperties=new Set,t.parentData=a.data,t.dataNames=[...a.dataNames,r]}void 0!==n&&(d(n instanceof r.Name?n:u.let("data",n,!0)),void 0!==c&&(t.propertyName=c)),l&&(t.dataTypes=l)},t.extendSubschemaMode=function(t,{jtdDiscriminator:r,jtdMetadata:o,compositeRule:a,createErrors:i,allErrors:s}){void 0!==a&&(t.compositeRule=a),void 0!==i&&(t.createErrors=i),void 0!==s&&(t.allErrors=s),t.jtdDiscriminator=r,t.jtdMetadata=o}}),hi=dl((t,r)=>{r.exports=function t(r,o){if(r===o)return!0;if(r&&o&&"object"==typeof r&&"object"==typeof o){if(r.constructor!==o.constructor)return!1;if(Array.isArray(r)){if((a=r.length)!=o.length)return!1;for(i=a;0!=i--;)if(!t(r[i],o[i]))return!1;return!0}if(r.constructor===RegExp)return r.source===o.source&&r.flags===o.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===o.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===o.toString();if((a=(s=Object.keys(r)).length)!==Object.keys(o).length)return!1;for(i=a;0!=i--;)if(!Object.prototype.hasOwnProperty.call(o,s[i]))return!1;for(i=a;0!=i--;){var a,i,s,n=s[i];if(!t(r[n],o[n]))return!1}return!0}return r!=r&&o!=o}}),hs=dl((t,r)=>{var o=r.exports=function(t,r,a){"function"==typeof r&&(a=r,r={});var i="function"==typeof(a=r.cb||a)?a:a.pre||function(){};!function t(r,a,i,s,n,l,c,u,d,p){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var h in a(s,n,l,c,u,d,p),s){var f=s[h];if(Array.isArray(f)){if(h in o.arrayKeywords)for(var m=0;m<f.length;m++)t(r,a,i,f[m],n+"/"+h+"/"+m,l,n,h,s,m)}else if(h in o.propsKeywords){if(f&&"object"==typeof f)for(var y in f)t(r,a,i,f[y],n+"/"+h+"/"+y.replace(/~/g,"~0").replace(/\//g,"~1"),l,n,h,s,y)}else(h in o.keywords||r.allKeys&&!(h in o.skipKeywords))&&t(r,a,i,f,n+"/"+h,l,n,h,s)}i(s,n,l,c,u,d,p)}}(r,i,a.post||function(){},t,"",t)};o.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},o.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},o.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},o.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}}),hn=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;let r=p4(),o=hi(),a=hs(),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(t,o=!0){return"boolean"==typeof t||(!0===o?!function t(r){for(let o in r){if(s.has(o))return!0;let a=r[o];if(Array.isArray(a)&&a.some(t)||"object"==typeof a&&t(a))return!0}return!1}(t):!!o&&function t(o){let a=0;for(let s in o)if("$ref"===s||(a++,!i.has(s)&&("object"==typeof o[s]&&(0,r.eachItem)(o[s],r=>a+=t(r)),a===1/0)))return 1/0;return a}(t)<=o)};let s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function n(t,r="",o){return!1!==o&&(r=u(r)),l(t,t.parse(r))}function l(t,r){return t.serialize(r).split("#")[0]+"#"}t.getFullPath=n,t._getFullPath=l;let c=/#\/?$/;function u(t){return t?t.replace(c,""):""}t.normalizeId=u,t.resolveUrl=function(t,r,o){return o=u(o),t.resolve(r,o)};let d=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(t,r){if("boolean"==typeof t)return{};let{schemaId:i,uriResolver:s}=this.opts,l=u(t[i]||r),c={"":l},p=n(s,l,!1),h={},f=new Set;return a(t,{allKeys:!0},(t,r,o,a)=>{if(void 0===a)return;let s=p+r,n=c[a];function l(r){let o=this.opts.uriResolver.resolve;if(r=u(n?o(n,r):r),f.has(r))throw y(r);f.add(r);let a=this.refs[r];return"string"==typeof a&&(a=this.refs[a]),"object"==typeof a?m(t,a.schema,r):r!==u(s)&&("#"===r[0]?(m(t,h[r],r),h[r]=t):this.refs[r]=s),r}function g(t){if("string"==typeof t){if(!d.test(t))throw Error(`invalid anchor "${t}"`);l.call(this,`#${t}`)}}"string"==typeof t[i]&&(n=l.call(this,t[i])),g.call(this,t.$anchor),g.call(this,t.$dynamicAnchor),c[r]=n}),h;function m(t,r,a){if(void 0!==r&&!o(t,r))throw y(a)}function y(t){return Error(`reference "${t}" resolves to more than one schema`)}}}),hl=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;let r=p6(),o=he(),a=p7(),i=he(),s=ht(),n=ho(),l=ha(),c=p9(),u=p5(),d=hn(),p=p4(),h=p3();function f({gen:t,validateName:r,schema:o,schemaEnv:a,opts:i},s){var n;i.code.es5?t.func(r,(0,c._)`${u.default.data}, ${u.default.valCxt}`,a.$async,()=>{var r,a;t.code((0,c._)`"use strict"; ${m(o,i)}`),r=t,a=i,r.if(u.default.valCxt,()=>{r.var(u.default.instancePath,(0,c._)`${u.default.valCxt}.${u.default.instancePath}`),r.var(u.default.parentData,(0,c._)`${u.default.valCxt}.${u.default.parentData}`),r.var(u.default.parentDataProperty,(0,c._)`${u.default.valCxt}.${u.default.parentDataProperty}`),r.var(u.default.rootData,(0,c._)`${u.default.valCxt}.${u.default.rootData}`),a.dynamicRef&&r.var(u.default.dynamicAnchors,(0,c._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{r.var(u.default.instancePath,(0,c._)`""`),r.var(u.default.parentData,(0,c._)`undefined`),r.var(u.default.parentDataProperty,(0,c._)`undefined`),r.var(u.default.rootData,u.default.data),a.dynamicRef&&r.var(u.default.dynamicAnchors,(0,c._)`{}`)}),t.code(s)}):t.func(r,(0,c._)`${u.default.data}, ${(n=i,(0,c._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${n.dynamicRef?(0,c._)`, ${u.default.dynamicAnchors}={}`:c.nil}}={}`)}`,a.$async,()=>t.code(m(o,i)).code(s))}function m(t,r){let o="object"==typeof t&&t[r.schemaId];return o&&(r.code.source||r.code.process)?(0,c._)`/*# sourceURL=${o} */`:c.nil}function y({schema:t,self:r}){if("boolean"==typeof t)return!t;for(let o in t)if(r.RULES.all[o])return!0;return!1}function g(t){return"boolean"!=typeof t.schema}function v(t){(0,p.checkUnknownRules)(t),function(t){let{schema:r,errSchemaPath:o,opts:a,self:i}=t;r.$ref&&a.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(r,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${o}"`)}(t)}function b(t,r){if(t.opts.jtd)return S(t,[],!1,r);let a=(0,o.getSchemaTypes)(t.schema);S(t,a,!(0,o.coerceAndCheckDataType)(t,a),r)}function _({gen:t,schemaEnv:r,schema:o,errSchemaPath:a,opts:i}){let s=o.$comment;if(!0===i.$comment)t.code((0,c._)`${u.default.self}.logger.log(${s})`);else if("function"==typeof i.$comment){let o=(0,c.str)`${a}/$comment`,i=t.scopeValue("root",{ref:r.root});t.code((0,c._)`${u.default.self}.opts.$comment(${s}, ${o}, ${i}.schema)`)}}function S(t,r,o,s){var n,l,d,h;let{gen:f,schema:m,data:y,allErrors:g,opts:v,self:b}=t,{RULES:_}=b;if(m.$ref&&(v.ignoreKeywordsWithRef||!(0,p.schemaHasRulesButRef)(m,_)))return void f.block(()=>P(t,"$ref",_.all.$ref.definition));function S(n){(0,a.shouldUseGroup)(m,n)&&(n.type?(f.if((0,i.checkDataType)(n.type,y,v.strictNumbers)),$(t,n),1===r.length&&r[0]===n.type&&o&&(f.else(),(0,i.reportTypeError)(t)),f.endIf()):$(t,n),g||f.if((0,c._)`${u.default.errors} === ${s||0}`))}v.jtd||(n=t,l=r,!n.schemaEnv.meta&&n.opts.strictTypes&&(function(t,r){if(r.length){if(!t.dataTypes.length){t.dataTypes=r;return}r.forEach(r=>{w(t.dataTypes,r)||E(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),function(t,r){let o=[];for(let a of t.dataTypes)w(r,a)?o.push(a):r.includes("integer")&&"number"===a&&o.push("integer");t.dataTypes=o}(t,r)}}(n,l),n.opts.allowUnionTypes||(d=n,(h=l).length>1&&!(2===h.length&&h.includes("null"))&&E(d,"use allowUnionTypes to allow union type keyword")),function(t,r){let o=t.self.RULES.all;for(let i in o){let s=o[i];if("object"==typeof s&&(0,a.shouldUseRule)(t.schema,s)){let{type:o}=s.definition;o.length&&!o.some(t=>{var o,a;return o=r,a=t,o.includes(a)||"number"===a&&o.includes("integer")})&&E(t,`missing type "${o.join(",")}" for keyword "${i}"`)}}}(n,n.dataTypes))),f.block(()=>{for(let t of _.rules)S(t);S(_.post)})}function $(t,r){let{gen:o,schema:i,opts:{useDefaults:n}}=t;n&&(0,s.assignDefaults)(t,r.type),o.block(()=>{for(let o of r.rules)(0,a.shouldUseRule)(i,o)&&P(t,o.keyword,o.definition,r.type)})}function w(t,r){return t.includes(r)||"integer"===r&&t.includes("number")}function E(t,r){let o=t.schemaEnv.baseId+t.errSchemaPath;r+=` at "${o}" (strictTypes)`,(0,p.checkStrictMode)(t,r,t.opts.strictTypes)}t.validateFunctionCode=function(t){g(t)&&(v(t),y(t))?function(t){let{schema:r,opts:o,gen:a}=t;f(t,()=>{o.$comment&&r.$comment&&_(t),function(t){let{schema:r,opts:o}=t;void 0!==r.default&&o.useDefaults&&o.strictSchema&&(0,p.checkStrictMode)(t,"default is ignored in the schema root")}(t),a.let(u.default.vErrors,null),a.let(u.default.errors,0),o.unevaluated&&function(t){let{gen:r,validateName:o}=t;t.evaluated=r.const("evaluated",(0,c._)`${o}.evaluated`),r.if((0,c._)`${t.evaluated}.dynamicProps`,()=>r.assign((0,c._)`${t.evaluated}.props`,(0,c._)`undefined`)),r.if((0,c._)`${t.evaluated}.dynamicItems`,()=>r.assign((0,c._)`${t.evaluated}.items`,(0,c._)`undefined`))}(t),b(t),function(t){let{gen:r,schemaEnv:o,validateName:a,ValidationError:i,opts:s}=t;o.$async?r.if((0,c._)`${u.default.errors} === 0`,()=>r.return(u.default.data),()=>r.throw((0,c._)`new ${i}(${u.default.vErrors})`)):(r.assign((0,c._)`${a}.errors`,u.default.vErrors),s.unevaluated&&function({gen:t,evaluated:r,props:o,items:a}){o instanceof c.Name&&t.assign((0,c._)`${r}.props`,o),a instanceof c.Name&&t.assign((0,c._)`${r}.items`,a)}(t),r.return((0,c._)`${u.default.errors} === 0`))}(t)})}(t):f(t,()=>(0,r.topBoolOrEmptySchema)(t))};var R=class{constructor(t,r,o){if((0,n.validateKeywordUsage)(t,r,o),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=o,this.data=t.data,this.schema=t.schema[o],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(t,this.schema,o,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",T(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,n.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw Error(`${o} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:!1!==r.errors)&&(this.errsCount=t.gen.const("_errs",u.default.errors))}result(t,r,o){this.failResult((0,c.not)(t),r,o)}failResult(t,r,o){this.gen.if(t),o?o():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,c.not)(t),void 0,r)}fail(t){if(void 0===t){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,c._)`${r} !== undefined && (${(0,c.or)(this.invalid$data(),t)})`)}error(t,r,o){if(r){this.setParams(r),this._error(t,o),this.setParams({});return}this._error(t,o)}_error(t,r){(t?h.reportExtraError:h.reportError)(this,this.def.error,r)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(void 0===this.errsCount)throw Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,o=c.nil){this.gen.block(()=>{this.check$data(t,o),r()})}check$data(t=c.nil,r=c.nil){if(!this.$data)return;let{gen:o,schemaCode:a,schemaType:i,def:s}=this;o.if((0,c.or)((0,c._)`${a} === undefined`,r)),t!==c.nil&&o.assign(t,!0),(i.length||s.validateSchema)&&(o.elseIf(this.invalid$data()),this.$dataError(),t!==c.nil&&o.assign(t,!1)),o.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:o,def:a,it:s}=this;return(0,c.or)(function(){if(o.length){if(!(r instanceof c.Name))throw Error("ajv implementation error");let t=Array.isArray(o)?o:[o];return(0,c._)`${(0,i.checkDataTypes)(t,r,s.opts.strictNumbers,i.DataType.Wrong)}`}return c.nil}(),function(){if(a.validateSchema){let o=t.scopeValue("validate$data",{ref:a.validateSchema});return(0,c._)`!${o}(${r})`}return c.nil}())}subschema(t,o){let a=(0,l.getSubschema)(this.it,t);(0,l.extendSubschemaData)(a,this.it,t),(0,l.extendSubschemaMode)(a,t);let i={...this.it,...a,items:void 0,props:void 0};return!function(t,o){if(g(t)&&(v(t),y(t)))return function(t,r){var o;let a,{schema:i,gen:s,opts:n}=t;n.$comment&&i.$comment&&_(t),(a=(o=t).schema[o.opts.schemaId])&&(o.baseId=(0,d.resolveUrl)(o.opts.uriResolver,o.baseId,a)),function(t){if(t.schema.$async&&!t.schemaEnv.$async)throw Error("async schema in sync schema")}(t);let l=s.const("_errs",u.default.errors);b(t,l),s.var(r,(0,c._)`${l} === ${u.default.errors}`)}(t,o);(0,r.boolOrEmptySchema)(t,o)}(i,o),i}mergeEvaluated(t,r){let{it:o,gen:a}=this;o.opts.unevaluated&&(!0!==o.props&&void 0!==t.props&&(o.props=p.mergeEvaluated.props(a,t.props,o.props,r)),!0!==o.items&&void 0!==t.items&&(o.items=p.mergeEvaluated.items(a,t.items,o.items,r)))}mergeValidEvaluated(t,r){let{it:o,gen:a}=this;if(o.opts.unevaluated&&(!0!==o.props||!0!==o.items))return a.if(r,()=>this.mergeEvaluated(t,c.Name)),!0}};function P(t,r,o,a){let i=new R(t,o,r);"code"in o?o.code(i,a):i.$data&&o.validate?(0,n.funcKeywordCode)(i,o):"macro"in o?(0,n.macroKeywordCode)(i,o):(o.compile||o.validate)&&(0,n.funcKeywordCode)(i,o)}t.KeywordCxt=R;let k=/^\/(?:[^~]|~0|~1)*$/,O=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function T(t,{dataLevel:r,dataNames:o,dataPathArr:a}){let i,s;if(""===t)return u.default.rootData;if("/"===t[0]){if(!k.test(t))throw Error(`Invalid JSON-pointer: ${t}`);i=t,s=u.default.rootData}else{let n=O.exec(t);if(!n)throw Error(`Invalid JSON-pointer: ${t}`);let c=+n[1];if("#"===(i=n[2])){if(c>=r)throw Error(l("property/index",c));return a[r-c]}if(c>r)throw Error(l("data",c));if(s=o[r-c],!i)return s}let n=s;for(let t of i.split("/"))t&&(s=(0,c._)`${s}${(0,c.getProperty)((0,p.unescapeJsonPointer)(t))}`,n=(0,c._)`${n} && ${s}`);return n;function l(t,o){return`Cannot access ${t} ${o} levels up, current level is ${r}`}}t.getData=T}),hc=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}}),hu=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=hn();t.default=class extends Error{constructor(t,o,a,i){super(i||`can't resolve reference ${a} from id ${o}`),this.missingRef=(0,r.resolveUrl)(t,o,a),this.missingSchema=(0,r.normalizeId)((0,r.getFullPath)(t,this.missingRef))}}}),hd=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;let r=p9(),o=hc(),a=p5(),i=hn(),s=p4(),n=hl();var l=class{constructor(t){var r;let o;this.refs={},this.dynamicAnchors={},"object"==typeof t.schema&&(o=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=null!=(r=t.baseId)?r:(0,i.normalizeId)(null==o?void 0:o[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=null==o?void 0:o.$async,this.refs={}}};function c(t){let s,l,c=d.call(this,t);if(c)return c;let u=(0,i.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:p,lines:h}=this.opts.code,{ownProperties:f}=this.opts,m=new r.CodeGen(this.scope,{es5:p,lines:h,ownProperties:f});t.$async&&(s=m.scopeValue("Error",{ref:o.default,code:(0,r._)`require("ajv/dist/runtime/validation_error").default`}));let y=m.scopeName("validate");t.validateName=y;let g={gen:m,allErrors:this.opts.allErrors,data:a.default.data,parentData:a.default.parentData,parentDataProperty:a.default.parentDataProperty,dataNames:[a.default.data],dataPathArr:[r.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:m.scopeValue("schema",!0===this.opts.code.source?{ref:t.schema,code:(0,r.stringify)(t.schema)}:{ref:t.schema}),validateName:y,ValidationError:s,schema:t.schema,schemaEnv:t,rootId:u,baseId:t.baseId||u,schemaPath:r.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,r._)`""`,opts:this.opts,self:this};try{this._compilations.add(t),(0,n.validateFunctionCode)(g),m.optimize(this.opts.code.optimize);let o=m.toString();l=`${m.scopeRefs(a.default.scope)}return ${o}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let i=Function(`${a.default.self}`,`${a.default.scope}`,l)(this,this.scope.get());if(this.scope.value(y,{ref:i}),i.errors=null,i.schema=t.schema,i.schemaEnv=t,t.$async&&(i.$async=!0),!0===this.opts.code.source&&(i.source={validateName:y,validateCode:o,scopeValues:m._values}),this.opts.unevaluated){let{props:t,items:o}=g;i.evaluated={props:t instanceof r.Name?void 0:t,items:o instanceof r.Name?void 0:o,dynamicProps:t instanceof r.Name,dynamicItems:o instanceof r.Name},i.source&&(i.source.evaluated=(0,r.stringify)(i.evaluated))}return t.validate=i,t}catch(r){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),r}finally{this._compilations.delete(t)}}function u(t){return(0,i.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:c.call(this,t)}function d(t){for(let a of this._compilations){var r,o;if(r=a,o=t,r.schema===o.schema&&r.root===o.root&&r.baseId===o.baseId)return a}}function p(t,r){let o;for(;"string"==typeof(o=this.refs[r]);)r=o;return o||this.schemas[r]||h.call(this,t,r)}function h(t,r){let o=this.opts.uriResolver.parse(r),a=(0,i._getFullPath)(this.opts.uriResolver,o),s=(0,i.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&a===s)return m.call(this,o,t);let n=(0,i.normalizeId)(a),u=this.refs[n]||this.schemas[n];if("string"==typeof u){let r=h.call(this,t,u);if("object"!=typeof(null==r?void 0:r.schema))return;return m.call(this,o,r)}if("object"==typeof(null==u?void 0:u.schema)){if(u.validate||c.call(this,u),n===(0,i.normalizeId)(r)){let{schema:r}=u,{schemaId:o}=this.opts,a=r[o];return a&&(s=(0,i.resolveUrl)(this.opts.uriResolver,s,a)),new l({schema:r,schemaId:o,root:t,baseId:s})}return m.call(this,o,u)}}t.SchemaEnv=l,t.compileSchema=c,t.resolveRef=function(t,r,o){var a;o=(0,i.resolveUrl)(this.opts.uriResolver,r,o);let s=t.refs[o];if(s)return s;let n=p.call(this,t,o);if(void 0===n){let i=null==(a=t.localRefs)?void 0:a[o],{schemaId:s}=this.opts;i&&(n=new l({schema:i,schemaId:s,root:t,baseId:r}))}if(void 0!==n)return t.refs[o]=u.call(this,n)},t.getCompilingSchema=d,t.resolveSchema=h;let f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function m(t,{baseId:r,schema:o,root:a}){var n;let c;if((null==(n=t.fragment)?void 0:n[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if("boolean"==typeof o)return;let t=o[(0,s.unescapeFragment)(a)];if(void 0===t)return;let n="object"==typeof(o=t)&&o[this.opts.schemaId];!f.has(a)&&n&&(r=(0,i.resolveUrl)(this.opts.uriResolver,r,n))}if("boolean"!=typeof o&&o.$ref&&!(0,s.schemaHasRulesButRef)(o,this.RULES)){let t=(0,i.resolveUrl)(this.opts.uriResolver,r,o.$ref);c=h.call(this,a,t)}let{schemaId:u}=this.opts;if((c=c||new l({schema:o,schemaId:u,root:a,baseId:r})).schema!==c.root.schema)return c}}),hp=dl((t,r)=>{r.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),hh=dl((t,r)=>{let o=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),a=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function i(t){let r="",o=0,a=0;for(a=0;a<t.length;a++)if(48!==(o=t[a].charCodeAt(0))){if(!(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102))return"";r+=t[a];break}for(a+=1;a<t.length;a++){if(!((o=t[a].charCodeAt(0))>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102))return"";r+=t[a]}return r}function s(t){return t.length=0,!0}function n(t,r,o){if(t.length){let a=i(t);if(""===a)return o.error=!0,!1;r.push(a),t.length=0}return!0}function l(t){if(2>function(t,r){let o=0;for(let r=0;r<t.length;r++)":"===t[r]&&o++;return o}(t,":"))return{host:t,isIPV6:!1};let r=function(t){let r=0,o={error:!1,address:"",zone:""},a=[],l=[],c=!1,u=!1,d=n;for(let i=0;i<t.length;i++){let n=t[i];if("["!==n&&"]"!==n)if(":"===n){if(!0===c&&(u=!0),!d(l,a,o))break;if(++r>7){o.error=!0;break}i>0&&":"===t[i-1]&&(c=!0),a.push(":");continue}else if("%"===n){if(!d(l,a,o))break;d=s}else{l.push(n);continue}}return l.length&&(d===s?o.zone=l.join(""):u?a.push(l.join("")):a.push(i(l))),o.address=a.join(""),o}(t);if(r.error)return{host:t,isIPV6:!1};{let t=r.address,o=r.address;return r.zone&&(t+="%"+r.zone,o+="%25"+r.zone),{host:t,isIPV6:!0,escapedHost:o}}}r.exports={nonSimpleDomain:RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u),recomposeAuthority:function(t){let r=[];if(void 0!==t.userinfo&&(r.push(t.userinfo),r.push("@")),void 0!==t.host){let o=unescape(t.host);if(!a(o)){let r=l(o);o=!0===r.isIPV6?`[${r.escapedHost}]`:t.host}r.push(o)}return("number"==typeof t.port||"string"==typeof t.port)&&(r.push(":"),r.push(String(t.port))),r.length?r.join(""):void 0},normalizeComponentEncoding:function(t,r){let o=!0!==r?escape:unescape;return void 0!==t.scheme&&(t.scheme=o(t.scheme)),void 0!==t.userinfo&&(t.userinfo=o(t.userinfo)),void 0!==t.host&&(t.host=o(t.host)),void 0!==t.path&&(t.path=o(t.path)),void 0!==t.query&&(t.query=o(t.query)),void 0!==t.fragment&&(t.fragment=o(t.fragment)),t},removeDotSegments:function(t){let r=t,o=[],a=-1,i=0;for(;i=r.length;){if(1===i)if("."===r)break;else if("/"===r){o.push("/");break}else{o.push(r);break}if(2===i){if("."===r[0]){if("."===r[1])break;else if("/"===r[1]){r=r.slice(2);continue}}else if("/"===r[0]&&("."===r[1]||"/"===r[1])){o.push("/");break}}else if(3===i&&"/.."===r){0!==o.length&&o.pop(),o.push("/");break}if("."===r[0]){if("."===r[1]){if("/"===r[2]){r=r.slice(3);continue}}else if("/"===r[1]){r=r.slice(2);continue}}else if("/"===r[0]&&"."===r[1]){if("/"===r[2]){r=r.slice(2);continue}else if("."===r[2]&&"/"===r[3]){r=r.slice(3),0!==o.length&&o.pop();continue}}if(-1===(a=r.indexOf("/",1))){o.push(r);break}o.push(r.slice(0,a)),r=r.slice(a)}return o.join("")},isIPv4:a,isUUID:o,normalizeIPv6:l,stringArrayToHexStripped:i}}),hf=dl((t,r)=>{let{isUUID:o}=hh(),a=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=["http","https","ws","wss","urn","urn:uuid"];function s(t){return!0===t.secure||!1!==t.secure&&!!t.scheme&&3===t.scheme.length&&("w"===t.scheme[0]||"W"===t.scheme[0])&&("s"===t.scheme[1]||"S"===t.scheme[1])&&("s"===t.scheme[2]||"S"===t.scheme[2])}function n(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function l(t){let r="https"===String(t.scheme).toLowerCase();return(t.port===(r?443:80)||""===t.port)&&(t.port=void 0),t.path||(t.path="/"),t}let c={scheme:"http",domainHost:!0,parse:n,serialize:l},u={scheme:"https",domainHost:c.domainHost,parse:n,serialize:l},d={scheme:"ws",domainHost:!0,parse:function(t){return t.secure=s(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(t){if((t.port===(s(t)?443:80)||""===t.port)&&(t.port=void 0),"boolean"==typeof t.secure&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[r,o]=t.resourceName.split("?");t.path=r&&"/"!==r?r:void 0,t.query=o,t.resourceName=void 0}return t.fragment=void 0,t}},p={scheme:"wss",domainHost:d.domainHost,parse:d.parse,serialize:d.serialize},h={http:c,https:u,ws:d,wss:p,urn:{scheme:"urn",parse:function(t,r){if(!t.path)return t.error="URN can not be parsed",t;let o=t.path.match(a);if(o){let a=r.scheme||t.scheme||"urn";t.nid=o[1].toLowerCase(),t.nss=o[2];let i=f(`${a}:${r.nid||t.nid}`);t.path=void 0,i&&(t=i.parse(t,r))}else t.error=t.error||"URN can not be parsed.";return t},serialize:function(t,r){if(void 0===t.nid)throw Error("URN without nid cannot be serialized");let o=r.scheme||t.scheme||"urn",a=t.nid.toLowerCase(),i=f(`${o}:${r.nid||a}`);i&&(t=i.serialize(t,r));let s=t,n=t.nss;return s.path=`${a||r.nid}:${n}`,r.skipEscape=!0,s},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(t,r){return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&o(t.uuid)||(t.error=t.error||"UUID is not valid."),t},serialize:function(t){return t.nss=(t.uuid||"").toLowerCase(),t},skipNormalize:!0}};function f(t){return t&&(h[t]||h[t.toLowerCase()])||void 0}Object.setPrototypeOf(h,null),r.exports={wsIsSecure:s,SCHEMES:h,isValidSchemeName:function(t){return -1!==i.indexOf(t)},getSchemeHandler:f}}),hm=dl((t,r)=>{let{normalizeIPv6:o,removeDotSegments:a,recomposeAuthority:i,normalizeComponentEncoding:s,isIPv4:n,nonSimpleDomain:l}=hh(),{SCHEMES:c,getSchemeHandler:u}=hf();function d(t,r,o,i){let s={};return i||(t=f(p(t,o),o),r=f(p(r,o),o)),!(o=o||{}).tolerant&&r.scheme?(s.scheme=r.scheme,s.userinfo=r.userinfo,s.host=r.host,s.port=r.port,s.path=a(r.path||""),s.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(s.userinfo=r.userinfo,s.host=r.host,s.port=r.port,s.path=a(r.path||""),s.query=r.query):(r.path?("/"===r.path[0]?s.path=a(r.path):(void 0===t.userinfo&&void 0===t.host&&void 0===t.port||t.path?t.path?s.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+r.path:s.path=r.path:s.path="/"+r.path,s.path=a(s.path)),s.query=r.query):(s.path=t.path,void 0!==r.query?s.query=r.query:s.query=t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=r.fragment,s}function p(t,r){let o={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},s=Object.assign({},r),n=[],l=u(s.scheme||o.scheme);l&&l.serialize&&l.serialize(o,s),void 0!==o.path&&(s.skipEscape?o.path=unescape(o.path):(o.path=escape(o.path),void 0!==o.scheme&&(o.path=o.path.split("%3A").join(":")))),"suffix"!==s.reference&&o.scheme&&n.push(o.scheme,":");let c=i(o);if(void 0!==c&&("suffix"!==s.reference&&n.push("//"),n.push(c),o.path&&"/"!==o.path[0]&&n.push("/")),void 0!==o.path){let t=o.path;s.absolutePath||l&&l.absolutePath||(t=a(t)),void 0===c&&"/"===t[0]&&"/"===t[1]&&(t="/%2F"+t.slice(2)),n.push(t)}return void 0!==o.query&&n.push("?",o.query),void 0!==o.fragment&&n.push("#",o.fragment),n.join("")}let h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function f(t,r){let a=Object.assign({},r),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1;"suffix"===a.reference&&(t=a.scheme?a.scheme+":"+t:"//"+t);let c=t.match(h);if(c){if(i.scheme=c[1],i.userinfo=c[3],i.host=c[4],i.port=parseInt(c[5],10),i.path=c[6]||"",i.query=c[7],i.fragment=c[8],isNaN(i.port)&&(i.port=c[5]),i.host)if(!1===n(i.host)){let t=o(i.host);i.host=t.host.toLowerCase(),s=t.isIPV6}else s=!0;void 0!==i.scheme||void 0!==i.userinfo||void 0!==i.host||void 0!==i.port||void 0!==i.query||i.path?void 0===i.scheme?i.reference="relative":void 0===i.fragment?i.reference="absolute":i.reference="uri":i.reference="same-document",a.reference&&"suffix"!==a.reference&&a.reference!==i.reference&&(i.error=i.error||"URI is not a "+a.reference+" reference.");let r=u(a.scheme||i.scheme);if(!a.unicodeSupport&&(!r||!r.unicodeSupport)&&i.host&&(a.domainHost||r&&r.domainHost)&&!1===s&&l(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(t){i.error=i.error||"Host's domain name can not be converted to ASCII: "+t}(!r||r&&!r.skipNormalize)&&(-1!==t.indexOf("%")&&(void 0!==i.scheme&&(i.scheme=unescape(i.scheme)),void 0!==i.host&&(i.host=unescape(i.host))),i.path&&(i.path=escape(unescape(i.path))),i.fragment&&(i.fragment=encodeURI(decodeURIComponent(i.fragment)))),r&&r.parse&&r.parse(i,a)}else i.error=i.error||"URI can not be parsed.";return i}let m={SCHEMES:c,normalize:function(t,r){return"string"==typeof t?t=p(f(t,r),r):"object"==typeof t&&(t=f(p(t,r),r)),t},resolve:function(t,r,o){let a=o?Object.assign({scheme:"null"},o):{scheme:"null"},i=d(f(t,a),f(r,a),a,!0);return a.skipEscape=!0,p(i,a)},resolveComponent:d,equal:function(t,r,o){return"string"==typeof t?t=p(s(f(t=unescape(t),o),!0),{...o,skipEscape:!0}):"object"==typeof t&&(t=p(s(t,!0),{...o,skipEscape:!0})),"string"==typeof r?r=p(s(f(r=unescape(r),o),!0),{...o,skipEscape:!0}):"object"==typeof r&&(r=p(s(r,!0),{...o,skipEscape:!0})),t.toLowerCase()===r.toLowerCase()},serialize:p,parse:f};r.exports=m,r.exports.default=m,r.exports.fastUri=m}),hy=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=hm();r.code='require("ajv/dist/runtime/uri").default',t.default=r}),hg=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var r=hl();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return r.KeywordCxt}});var o=p9();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});let a=hc(),i=hu(),s=p8(),n=hd(),l=p9(),c=hn(),u=he(),d=p4(),p=hp(),h=hy(),f=(t,r)=>new RegExp(t,r);f.code="new RegExp";let m=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},v={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};var b=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...function(t){var r,o,a,i,s,n,l,c,u,d,p,m,y,g,v,b,_,S,$,w,E,R,P,k,O;let T=t.strict,x=null==(r=t.code)?void 0:r.optimize,j=!0===x||void 0===x?1:x||0,C=null!=(a=null==(o=t.code)?void 0:o.regExp)?a:f,N=null!=(i=t.uriResolver)?i:h.default;return{strictSchema:null==(n=null!=(s=t.strictSchema)?s:T)||n,strictNumbers:null==(c=null!=(l=t.strictNumbers)?l:T)||c,strictTypes:null!=(d=null!=(u=t.strictTypes)?u:T)?d:"log",strictTuples:null!=(m=null!=(p=t.strictTuples)?p:T)?m:"log",strictRequired:null!=(g=null!=(y=t.strictRequired)?y:T)&&g,code:t.code?{...t.code,optimize:j,regExp:C}:{optimize:j,regExp:C},loopRequired:null!=(v=t.loopRequired)?v:200,loopEnum:null!=(b=t.loopEnum)?b:200,meta:null==(_=t.meta)||_,messages:null==(S=t.messages)||S,inlineRefs:null==($=t.inlineRefs)||$,schemaId:null!=(w=t.schemaId)?w:"$id",addUsedSchema:null==(E=t.addUsedSchema)||E,validateSchema:null==(R=t.validateSchema)||R,validateFormats:null==(P=t.validateFormats)||P,unicodeRegExp:null==(k=t.unicodeRegExp)||k,int32range:null==(O=t.int32range)||O,uriResolver:N}}(t)};const{es5:r,lines:o}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:r,lines:o}),this.logger=function(t){if(!1===t)return P;if(void 0===t)return console;if(t.log&&t.warn&&t.error)return t;throw Error("logger must implement log, warn and error methods")}(t.logger);const a=t.validateFormats;t.validateFormats=!1,this.RULES=(0,s.getRules)(),_.call(this,g,t,"NOT SUPPORTED"),_.call(this,v,t,"DEPRECATED","warn"),this._metaOpts=R.call(this),t.formats&&w.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&E.call(this,t.keywords),"object"==typeof t.meta&&this.addMetaSchema(t.meta),$.call(this),t.validateFormats=a}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:o}=this.opts,a=p;"id"===o&&((a={...p}).id=a.$id,delete a.$id),r&&t&&this.addMetaSchema(a,a[o],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta="object"==typeof t?t[r]||t:void 0}validate(t,r){let o;if("string"==typeof t){if(!(o=this.getSchema(t)))throw Error(`no schema with key or ref "${t}"`)}else o=this.compile(t);let a=o(r);return"$async"in o||(this.errors=o.errors),a}compile(t,r){let o=this._addSchema(t,r);return o.validate||this._compileSchemaEnv(o)}compileAsync(t,r){if("function"!=typeof this.opts.loadSchema)throw Error("options.loadSchema should be a function");let{loadSchema:o}=this.opts;return a.call(this,t,r);async function a(t,r){await s.call(this,t.$schema);let o=this._addSchema(t,r);return o.validate||n.call(this,o)}async function s(t){t&&!this.getSchema(t)&&await a.call(this,{$ref:t},!0)}async function n(t){try{return this._compileSchemaEnv(t)}catch(r){if(!(r instanceof i.default))throw r;return l.call(this,r),await c.call(this,r.missingSchema),n.call(this,t)}}function l({missingSchema:t,missingRef:r}){if(this.refs[t])throw Error(`AnySchema ${t} is loaded but ${r} cannot be resolved`)}async function c(t){let o=await u.call(this,t);this.refs[t]||await s.call(this,o.$schema),this.refs[t]||this.addSchema(o,t,r)}async function u(t){let r=this._loading[t];if(r)return r;try{return await (this._loading[t]=o(t))}finally{delete this._loading[t]}}}addSchema(t,r,o,a=this.opts.validateSchema){let i;if(Array.isArray(t)){for(let r of t)this.addSchema(r,void 0,o,a);return this}if("object"==typeof t){let{schemaId:r}=this.opts;if(void 0!==(i=t[r])&&"string"!=typeof i)throw Error(`schema ${r} must be string`)}return r=(0,c.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,o,r,a,!0),this}addMetaSchema(t,r,o=this.opts.validateSchema){return this.addSchema(t,r,!0,o),this}validateSchema(t,r){let o;if("boolean"==typeof t)return!0;if(void 0!==(o=t.$schema)&&"string"!=typeof o)throw Error("$schema must be a string");if(!(o=o||this.opts.defaultMeta||this.defaultMeta()))return this.logger.warn("meta-schema not available"),this.errors=null,!0;let a=this.validate(o,t);if(!a&&r){let t="schema is invalid: "+this.errorsText();if("log"===this.opts.validateSchema)this.logger.error(t);else throw Error(t)}return a}getSchema(t){let r;for(;"string"==typeof(r=S.call(this,t));)t=r;if(void 0===r){let{schemaId:o}=this.opts,a=new n.SchemaEnv({schema:{},schemaId:o});if(!(r=n.resolveSchema.call(this,a,t)))return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=S.call(this,t);return"object"==typeof r&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{this._cache.delete(t);let r=t[this.opts.schemaId];return r&&(r=(0,c.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let o;if("string"==typeof t)o=t,"object"==typeof r&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=o);else if("object"==typeof t&&void 0===r){if(Array.isArray(o=(r=t).keyword)&&!o.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(O.call(this,o,r),!r)return(0,d.eachItem)(o,t=>T.call(this,t)),this;j.call(this,r);let a={...r,type:(0,u.getJSONTypes)(r.type),schemaType:(0,u.getJSONTypes)(r.schemaType)};return(0,d.eachItem)(o,0===a.type.length?t=>T.call(this,t,a):t=>a.type.forEach(r=>T.call(this,t,a,r))),this}getKeyword(t){let r=this.RULES.all[t];return"object"==typeof r?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;for(let o of(delete r.keywords[t],delete r.all[t],r.rules)){let r=o.rules.findIndex(r=>r.keyword===t);r>=0&&o.rules.splice(r,1)}return this}addFormat(t,r){return"string"==typeof r&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:o="data"}={}){return t&&0!==t.length?t.map(t=>`${o}${t.instancePath} ${t.message}`).reduce((t,o)=>t+r+o):"No errors"}$dataMetaSchema(t,r){let o=this.RULES.all;for(let a of(t=JSON.parse(JSON.stringify(t)),r)){let r=a.split("/").slice(1),i=t;for(let t of r)i=i[t];for(let t in o){let r=o[t];if("object"!=typeof r)continue;let{$data:a}=r.definition,s=i[t];a&&s&&(i[t]=N(s))}}return t}_removeAllSchemas(t,r){for(let o in t){let a=t[o];(!r||r.test(o))&&("string"==typeof a?delete t[o]:a&&!a.meta&&(this._cache.delete(a.schema),delete t[o]))}}_addSchema(t,r,o,a=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:l}=this.opts;if("object"==typeof t)s=t[l];else if(this.opts.jtd)throw Error("schema must be object");else if("boolean"!=typeof t)throw Error("schema must be object or boolean");let u=this._cache.get(t);if(void 0!==u)return u;o=(0,c.normalizeId)(s||o);let d=c.getSchemaRefs.call(this,t,o);return u=new n.SchemaEnv({schema:t,schemaId:l,meta:r,baseId:o,localRefs:d}),this._cache.set(u.schema,u),i&&!o.startsWith("#")&&(o&&this._checkUnique(o),this.refs[o]=u),a&&this.validateSchema(t,!0),u}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):n.compileSchema.call(this,t),!t.validate)throw Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{n.compileSchema.call(this,t)}finally{this.opts=r}}};function _(t,r,o,a="error"){for(let i in t)i in r&&this.logger[a](`${o}: option ${i}. ${t[i]}`)}function S(t){return t=(0,c.normalizeId)(t),this.schemas[t]||this.refs[t]}function $(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let r in t)this.addSchema(t[r],r)}function w(){for(let t in this.opts.formats){let r=this.opts.formats[t];r&&this.addFormat(t,r)}}function E(t){if(Array.isArray(t))return void this.addVocabulary(t);for(let r in this.logger.warn("keywords option as map is deprecated, pass array"),t){let o=t[r];o.keyword||(o.keyword=r),this.addKeyword(o)}}function R(){let t={...this.opts};for(let r of m)delete t[r];return t}b.ValidationError=a.default,b.MissingRefError=i.default,t.default=b;let P={log(){},warn(){},error(){}},k=/^[a-z_$][a-z0-9_$:-]*$/i;function O(t,r){let{RULES:o}=this;if((0,d.eachItem)(t,t=>{if(o.keywords[t])throw Error(`Keyword ${t} is already defined`);if(!k.test(t))throw Error(`Keyword ${t} has invalid name`)}),r&&r.$data&&!("code"in r||"validate"in r))throw Error('$data keyword must have "code" or "validate" function')}function T(t,r,o){var a;let i=null==r?void 0:r.post;if(o&&i)throw Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,n=i?s.post:s.rules.find(({type:t})=>t===o);if(n||(n={type:o,rules:[]},s.rules.push(n)),s.keywords[t]=!0,!r)return;let l={keyword:t,definition:{...r,type:(0,u.getJSONTypes)(r.type),schemaType:(0,u.getJSONTypes)(r.schemaType)}};r.before?x.call(this,n,l,r.before):n.rules.push(l),s.all[t]=l,null==(a=r.implements)||a.forEach(t=>this.addKeyword(t))}function x(t,r,o){let a=t.rules.findIndex(t=>t.keyword===o);a>=0?t.rules.splice(a,0,r):(t.rules.push(r),this.logger.warn(`rule ${o} is not defined`))}function j(t){let{metaSchema:r}=t;void 0!==r&&(t.$data&&this.opts.$data&&(r=N(r)),t.validateSchema=this.compile(r,!0))}let C={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function N(t){return{anyOf:[t,C]}}}),hv=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}}),hb=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;let r=hu(),o=hr(),a=p9(),i=p5(),s=hd(),n=p4();function l(t,r){let{gen:o}=t;return r.validate?o.scopeValue("validate",{ref:r.validate}):(0,a._)`${o.scopeValue("wrapper",{ref:r})}.validate`}function c(t,r,s,l){let{gen:c,it:u}=t,{allErrors:d,schemaEnv:p,opts:h}=u,f=h.passContext?i.default.this:a.nil;function m(t){let r=(0,a._)`${t}.errors`;c.assign(i.default.vErrors,(0,a._)`${i.default.vErrors} === null ? ${r} : ${i.default.vErrors}.concat(${r})`),c.assign(i.default.errors,(0,a._)`${i.default.vErrors}.length`)}function y(t){var r;if(!u.opts.unevaluated)return;let o=null==(r=null==s?void 0:s.validate)?void 0:r.evaluated;if(!0!==u.props)if(o&&!o.dynamicProps)void 0!==o.props&&(u.props=n.mergeEvaluated.props(c,o.props,u.props));else{let r=c.var("props",(0,a._)`${t}.evaluated.props`);u.props=n.mergeEvaluated.props(c,r,u.props,a.Name)}if(!0!==u.items)if(o&&!o.dynamicItems)void 0!==o.items&&(u.items=n.mergeEvaluated.items(c,o.items,u.items));else{let r=c.var("items",(0,a._)`${t}.evaluated.items`);u.items=n.mergeEvaluated.items(c,r,u.items,a.Name)}}l?function(){if(!p.$async)throw Error("async schema referenced by sync schema");let i=c.let("valid");c.try(()=>{c.code((0,a._)`await ${(0,o.callValidateCode)(t,r,f)}`),y(r),d||c.assign(i,!0)},t=>{c.if((0,a._)`!(${t} instanceof ${u.ValidationError})`,()=>c.throw(t)),m(t),d||c.assign(i,!1)}),t.ok(i)}():t.result((0,o.callValidateCode)(t,r,f),()=>y(r),()=>m(r))}t.getValidate=l,t.callRef=c,t.default={keyword:"$ref",schemaType:"string",code(t){var o,i;let n,u,d,{gen:p,schema:h,it:f}=t,{baseId:m,schemaEnv:y,validateName:g,opts:v,self:b}=f,{root:_}=y;if(("#"===h||"#/"===h)&&m===_.baseId){if(y===_)return c(t,g,y,y.$async);let r=p.scopeValue("root",{ref:_});return c(t,(0,a._)`${r}.validate`,_,_.$async)}let S=s.resolveRef.call(b,_,m,h);if(void 0===S)throw new r.default(f.opts.uriResolver,m,h);return S instanceof s.SchemaEnv?void c(t,l(t,o=S),o,o.$async):(i=S,n=p.scopeValue("schema",!0===v.code.source?{ref:i,code:(0,a.stringify)(i)}:{ref:i}),u=p.name("valid"),d=t.subschema({schema:i,dataTypes:[],schemaPath:a.nil,topSchemaRef:n,errSchemaPath:h},u),void(t.mergeEvaluated(d),t.ok(u)))}}}),h_=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=hv(),o=hb();t.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,o.default]}),hS=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9(),o=r.operators,a={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}};t.default={keyword:Object.keys(a),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:t,schemaCode:o})=>(0,r.str)`must be ${a[t].okStr} ${o}`,params:({keyword:t,schemaCode:o})=>(0,r._)`{comparison: ${a[t].okStr}, limit: ${o}}`},code(t){let{keyword:o,data:i,schemaCode:s}=t;t.fail$data((0,r._)`${i} ${a[o].fail} ${s} || isNaN(${i})`)}}}),h$=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9();t.default={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:t})=>(0,r.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,r._)`{multipleOf: ${t}}`},code(t){let{gen:o,data:a,schemaCode:i,it:s}=t,n=s.opts.multipleOfPrecision,l=o.let("res"),c=n?(0,r._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${n}`:(0,r._)`${l} !== parseInt(${l})`;t.fail$data((0,r._)`(${i} === 0 || (${l} = ${a}/${i}, ${c}))`)}}}),hw=dl(t=>{function r(t){let r,o=t.length,a=0,i=0;for(;i<o;)a++,(r=t.charCodeAt(i++))>=55296&&r<=56319&&i<o&&(64512&(r=t.charCodeAt(i)))==56320&&i++;return a}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'}),hE=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9(),o=p4(),a=hw();t.default={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:t,schemaCode:o})=>(0,r.str)`must NOT have ${"maxLength"===t?"more":"fewer"} than ${o} characters`,params:({schemaCode:t})=>(0,r._)`{limit: ${t}}`},code(t){let{keyword:i,data:s,schemaCode:n,it:l}=t,c="maxLength"===i?r.operators.GT:r.operators.LT,u=!1===l.opts.unicode?(0,r._)`${s}.length`:(0,r._)`${(0,o.useFunc)(t.gen,a.default)}(${s})`;t.fail$data((0,r._)`${u} ${c} ${n}`)}}}),hR=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=hr(),o=p4(),a=p9();t.default={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>(0,a.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,a._)`{pattern: ${t}}`},code(t){let{gen:i,data:s,$data:n,schema:l,schemaCode:c,it:u}=t,d=u.opts.unicodeRegExp?"u":"";if(n){let{regExp:r}=u.opts.code,n="new RegExp"===r.code?(0,a._)`new RegExp`:(0,o.useFunc)(i,r),l=i.let("valid");i.try(()=>i.assign(l,(0,a._)`${n}(${c}, ${d}).test(${s})`),()=>i.assign(l,!1)),t.fail$data((0,a._)`!${l}`)}else{let o=(0,r.usePattern)(t,l);t.fail$data((0,a._)`!${o}.test(${s})`)}}}}),hP=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9();t.default={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:t,schemaCode:o})=>(0,r.str)`must NOT have ${"maxProperties"===t?"more":"fewer"} than ${o} properties`,params:({schemaCode:t})=>(0,r._)`{limit: ${t}}`},code(t){let{keyword:o,data:a,schemaCode:i}=t,s="maxProperties"===o?r.operators.GT:r.operators.LT;t.fail$data((0,r._)`Object.keys(${a}).length ${s} ${i}`)}}}),hk=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=hr(),o=p9(),a=p4();t.default={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:t}})=>(0,o.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,o._)`{missingProperty: ${t}}`},code(t){let{gen:i,schema:s,schemaCode:n,data:l,$data:c,it:u}=t,{opts:d}=u;if(!c&&0===s.length)return;let p=s.length>=d.loopRequired;if(u.allErrors?function(){if(p||c)t.block$data(o.nil,h);else for(let o of s)(0,r.checkReportMissingProp)(t,o)}():function(){let a=i.let("missing");if(p||c){let s=i.let("valid",!0);t.block$data(s,()=>{var c,u;return c=a,u=s,void(t.setParams({missingProperty:c}),i.forOf(c,n,()=>{i.assign(u,(0,r.propertyInData)(i,l,c,d.ownProperties)),i.if((0,o.not)(u),()=>{t.error(),i.break()})},o.nil))}),t.ok(s)}else i.if((0,r.checkMissingProp)(t,s,a)),(0,r.reportMissingProp)(t,a),i.else()}(),d.strictRequired){let r=t.parentSchema.properties,{definedProperties:o}=t.it;for(let t of s)if((null==r?void 0:r[t])===void 0&&!o.has(t)){let r=`required property "${t}" is not defined at "${u.schemaEnv.baseId+u.errSchemaPath}" (strictRequired)`;(0,a.checkStrictMode)(u,r,u.opts.strictRequired)}}function h(){i.forOf("prop",n,o=>{t.setParams({missingProperty:o}),i.if((0,r.noPropertyInData)(i,l,o,d.ownProperties),()=>t.error())})}}}}),hO=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9();t.default={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:t,schemaCode:o})=>(0,r.str)`must NOT have ${"maxItems"===t?"more":"fewer"} than ${o} items`,params:({schemaCode:t})=>(0,r._)`{limit: ${t}}`},code(t){let{keyword:o,data:a,schemaCode:i}=t,s="maxItems"===o?r.operators.GT:r.operators.LT;t.fail$data((0,r._)`${a}.length ${s} ${i}`)}}}),hT=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=hi();r.code='require("ajv/dist/runtime/equal").default',t.default=r}),hx=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=he(),o=p9(),a=p4(),i=hT();t.default={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:t,j:r}})=>(0,o.str)`must NOT have duplicate items (items ## ${r} and ${t} are identical)`,params:({params:{i:t,j:r}})=>(0,o._)`{i: ${t}, j: ${r}}`},code(t){let{gen:s,data:n,$data:l,schema:c,parentSchema:u,schemaCode:d,it:p}=t;if(!l&&!c)return;let h=s.let("valid"),f=u.items?(0,r.getSchemaTypes)(u.items):[];t.block$data(h,function(){let l=s.let("i",(0,o._)`${n}.length`),c=s.let("j");t.setParams({i:l,j:c}),s.assign(h,!0),s.if((0,o._)`${l} > 1`,()=>(f.length>0&&!f.some(t=>"object"===t||"array"===t)?function(a,i){let l=s.name("item"),c=(0,r.checkDataTypes)(f,l,p.opts.strictNumbers,r.DataType.Wrong),u=s.const("indices",(0,o._)`{}`);s.for((0,o._)`;${a}--;`,()=>{s.let(l,(0,o._)`${n}[${a}]`),s.if(c,(0,o._)`continue`),f.length>1&&s.if((0,o._)`typeof ${l} == "string"`,(0,o._)`${l} += "_"`),s.if((0,o._)`typeof ${u}[${l}] == "number"`,()=>{s.assign(i,(0,o._)`${u}[${l}]`),t.error(),s.assign(h,!1).break()}).code((0,o._)`${u}[${l}] = ${a}`)})}:function(r,l){let c=(0,a.useFunc)(s,i.default),u=s.name("outer");s.label(u).for((0,o._)`;${r}--;`,()=>s.for((0,o._)`${l} = ${r}; ${l}--;`,()=>s.if((0,o._)`${c}(${n}[${r}], ${n}[${l}])`,()=>{t.error(),s.assign(h,!1).break(u)})))})(l,c))},(0,o._)`${d} === false`),t.ok(h)}}}),hj=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9(),o=p4(),a=hT();t.default={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:t})=>(0,r._)`{allowedValue: ${t}}`},code(t){let{gen:i,data:s,$data:n,schemaCode:l,schema:c}=t;n||c&&"object"==typeof c?t.fail$data((0,r._)`!${(0,o.useFunc)(i,a.default)}(${s}, ${l})`):t.fail((0,r._)`${c} !== ${s}`)}}}),hC=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9(),o=p4(),a=hT();t.default={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,r._)`{allowedValues: ${t}}`},code(t){let i,s,{gen:n,data:l,$data:c,schema:u,schemaCode:d,it:p}=t;if(!c&&0===u.length)throw Error("enum must have non-empty array");let h=u.length>=p.opts.loopEnum,f=()=>null!=i?i:i=(0,o.useFunc)(n,a.default);if(h||c)s=n.let("valid"),t.block$data(s,function(){n.assign(s,!1),n.forOf("v",d,t=>n.if((0,r._)`${f()}(${l}, ${t})`,()=>n.assign(s,!0).break()))});else{if(!Array.isArray(u))throw Error("ajv implementation error");let t=n.const("vSchema",d);s=(0,r.or)(...u.map((o,a)=>{var i,s;let n;return i=t,"object"==typeof(n=u[s=a])&&null!==n?(0,r._)`${f()}(${l}, ${i}[${s}])`:(0,r._)`${l} === ${n}`}))}t.pass(s)}}}),hN=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=hS(),o=h$(),a=hE(),i=hR(),s=hP(),n=hk(),l=hO(),c=hx(),u=hj(),d=hC();t.default=[r.default,o.default,a.default,i.default,s.default,n.default,l.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,d.default]}),hI=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;let r=p9(),o=p4();function a(t,a){let{gen:i,schema:s,data:n,keyword:l,it:c}=t;c.items=!0;let u=i.const("len",(0,r._)`${n}.length`);if(!1===s)t.setParams({len:a.length}),t.pass((0,r._)`${u} <= ${a.length}`);else if("object"==typeof s&&!(0,o.alwaysValidSchema)(c,s)){let s=i.var("valid",(0,r._)`${u} <= ${a.length}`);i.if((0,r.not)(s),()=>{var n;return n=s,void i.forRange("i",a.length,u,a=>{t.subschema({keyword:l,dataProp:a,dataPropType:o.Type.Num},n),c.allErrors||i.if((0,r.not)(n),()=>i.break())})}),t.ok(s)}}t.validateAdditionalItems=a,t.default={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:t}})=>(0,r.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,r._)`{limit: ${t}}`},code(t){let{parentSchema:r,it:i}=t,{items:s}=r;Array.isArray(s)?a(t,s):(0,o.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas')}}}),hA=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;let r=p9(),o=p4(),a=hr();function i(t,a,s=t.schema){let{gen:n,parentSchema:l,data:c,keyword:u,it:d}=t;(function(t){let{opts:r,errSchemaPath:i}=d,n=s.length,l=n===t.minItems&&(n===t.maxItems||!1===t[a]);if(r.strictTuples&&!l){let t=`"${u}" is ${n}-tuple, but minItems or maxItems/${a} are not specified or different at path "${i}"`;(0,o.checkStrictMode)(d,t,r.strictTuples)}})(l),d.opts.unevaluated&&s.length&&!0!==d.items&&(d.items=o.mergeEvaluated.items(n,s.length,d.items));let p=n.name("valid"),h=n.const("len",(0,r._)`${c}.length`);s.forEach((a,i)=>{(0,o.alwaysValidSchema)(d,a)||(n.if((0,r._)`${h} > ${i}`,()=>t.subschema({keyword:u,schemaProp:i,dataProp:i},p)),t.ok(p))})}t.validateTuple=i,t.default={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:r,it:s}=t;if(Array.isArray(r))return i(t,"additionalItems",r);s.items=!0,(0,o.alwaysValidSchema)(s,r)||t.ok((0,a.validateArray)(t))}}}),hM=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=hA();t.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,r.validateTuple)(t,"items")}}),hq=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9(),o=p4(),a=hr(),i=hI();t.default={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:t}})=>(0,r.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,r._)`{limit: ${t}}`},code(t){let{schema:r,parentSchema:s,it:n}=t,{prefixItems:l}=s;n.items=!0,(0,o.alwaysValidSchema)(n,r)||(l?(0,i.validateAdditionalItems)(t,l):t.ok((0,a.validateArray)(t)))}}}),hz=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9(),o=p4();t.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:t,max:o}})=>void 0===o?(0,r.str)`must contain at least ${t} valid item(s)`:(0,r.str)`must contain at least ${t} and no more than ${o} valid item(s)`,params:({params:{min:t,max:o}})=>void 0===o?(0,r._)`{minContains: ${t}}`:(0,r._)`{minContains: ${t}, maxContains: ${o}}`},code(t){let a,i,{gen:s,schema:n,parentSchema:l,data:c,it:u}=t,{minContains:d,maxContains:p}=l;u.opts.next?(a=void 0===d?1:d,i=p):a=1;let h=s.const("len",(0,r._)`${c}.length`);if(t.setParams({min:a,max:i}),void 0===i&&0===a)return void(0,o.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==i&&a>i){(0,o.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,o.alwaysValidSchema)(u,n)){let o=(0,r._)`${h} >= ${a}`;void 0!==i&&(o=(0,r._)`${o} && ${h} <= ${i}`),t.pass(o);return}u.items=!0;let f=s.name("valid");function m(){let t=s.name("_valid"),o=s.let("count",0);y(t,()=>s.if(t,()=>{var t;return t=o,void(s.code((0,r._)`${t}++`),void 0===i?s.if((0,r._)`${t} >= ${a}`,()=>s.assign(f,!0).break()):(s.if((0,r._)`${t} > ${i}`,()=>s.assign(f,!1).break()),1===a?s.assign(f,!0):s.if((0,r._)`${t} >= ${a}`,()=>s.assign(f,!0))))}))}function y(r,a){s.forRange("i",0,h,i=>{t.subschema({keyword:"contains",dataProp:i,dataPropType:o.Type.Num,compositeRule:!0},r),a()})}void 0===i&&1===a?y(f,()=>s.if(f,()=>s.break())):0===a?(s.let(f,!0),void 0!==i&&s.if((0,r._)`${c}.length > 0`,m)):(s.let(f,!1),m()),t.result(f,()=>t.reset())}}}),hL=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;let r=p9(),o=p4(),a=hr();t.error={message:({params:{property:t,depsCount:o,deps:a}})=>(0,r.str)`must have ${1===o?"property":"properties"} ${a} when property ${t} is present`,params:({params:{property:t,depsCount:o,deps:a,missingProperty:i}})=>(0,r._)`{property: ${t},
|
|
65
|
+
missingProperty: ${i},
|
|
66
|
+
depsCount: ${o},
|
|
67
|
+
deps: ${a}}`};let i={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(t){let[r,o]=function({schema:t}){let r={},o={};for(let a in t)"__proto__"!==a&&((Array.isArray(t[a])?r:o)[a]=t[a]);return[r,o]}(t);s(t,r),n(t,o)}};function s(t,o=t.schema){let{gen:i,data:n,it:l}=t;if(0===Object.keys(o).length)return;let c=i.let("missing");for(let s in o){let u=o[s];if(0===u.length)continue;let d=(0,a.propertyInData)(i,n,s,l.opts.ownProperties);t.setParams({property:s,depsCount:u.length,deps:u.join(", ")}),l.allErrors?i.if(d,()=>{for(let r of u)(0,a.checkReportMissingProp)(t,r)}):(i.if((0,r._)`${d} && (${(0,a.checkMissingProp)(t,u,c)})`),(0,a.reportMissingProp)(t,c),i.else())}}function n(t,r=t.schema){let{gen:i,data:s,keyword:l,it:c}=t,u=i.name("valid");for(let n in r)(0,o.alwaysValidSchema)(c,r[n])||(i.if((0,a.propertyInData)(i,s,n,c.opts.ownProperties),()=>{let r=t.subschema({keyword:l,schemaProp:n},u);t.mergeValidEvaluated(r,u)},()=>i.var(u,!0)),t.ok(u))}t.validatePropertyDeps=s,t.validateSchemaDeps=n,t.default=i}),hD=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9(),o=p4();t.default={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:t})=>(0,r._)`{propertyName: ${t.propertyName}}`},code(t){let{gen:a,schema:i,data:s,it:n}=t;if((0,o.alwaysValidSchema)(n,i))return;let l=a.name("valid");a.forIn("key",s,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},l),a.if((0,r.not)(l),()=>{t.error(!0),n.allErrors||a.break()})}),t.ok(l)}}}),hU=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=hr(),o=p9(),a=p5(),i=p4();t.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:t})=>(0,o._)`{additionalProperty: ${t.additionalProperty}}`},code(t){let{gen:s,schema:n,parentSchema:l,data:c,errsCount:u,it:d}=t;if(!u)throw Error("ajv implementation error");let{allErrors:p,opts:h}=d;if(d.props=!0,"all"!==h.removeAdditional&&(0,i.alwaysValidSchema)(d,n))return;let f=(0,r.allSchemaProperties)(l.properties),m=(0,r.allSchemaProperties)(l.patternProperties);function y(t){s.code((0,o._)`delete ${c}[${t}]`)}function g(r){if("all"===h.removeAdditional||h.removeAdditional&&!1===n)return void y(r);if(!1===n){t.setParams({additionalProperty:r}),t.error(),p||s.break();return}if("object"==typeof n&&!(0,i.alwaysValidSchema)(d,n)){let a=s.name("valid");"failing"===h.removeAdditional?(v(r,a,!1),s.if((0,o.not)(a),()=>{t.reset(),y(r)})):(v(r,a),p||s.if((0,o.not)(a),()=>s.break()))}}function v(r,o,a){let s={keyword:"additionalProperties",dataProp:r,dataPropType:i.Type.Str};!1===a&&Object.assign(s,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(s,o)}s.forIn("key",c,a=>{f.length||m.length?s.if(function(a){let n;if(f.length>8){let t=(0,i.schemaRefOrVal)(d,l.properties,"properties");n=(0,r.isOwnProperty)(s,t,a)}else n=f.length?(0,o.or)(...f.map(t=>(0,o._)`${a} === ${t}`)):o.nil;return m.length&&(n=(0,o.or)(n,...m.map(i=>(0,o._)`${(0,r.usePattern)(t,i)}.test(${a})`))),(0,o.not)(n)}(a),()=>g(a)):g(a)}),t.ok((0,o._)`${u} === ${a.default.errors}`)}}}),hV=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=hl(),o=hr(),a=p4(),i=hU();t.default={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:s,schema:n,parentSchema:l,data:c,it:u}=t;"all"===u.opts.removeAdditional&&void 0===l.additionalProperties&&i.default.code(new r.KeywordCxt(u,i.default,"additionalProperties"));let d=(0,o.allSchemaProperties)(n);for(let t of d)u.definedProperties.add(t);u.opts.unevaluated&&d.length&&!0!==u.props&&(u.props=a.mergeEvaluated.props(s,(0,a.toHash)(d),u.props));let p=d.filter(t=>!(0,a.alwaysValidSchema)(u,n[t]));if(0===p.length)return;let h=s.name("valid");for(let r of p){var f;(f=r,u.opts.useDefaults&&!u.compositeRule&&void 0!==n[f].default)?m(r):(s.if((0,o.propertyInData)(s,c,r,u.opts.ownProperties)),m(r),u.allErrors||s.else().var(h,!0),s.endIf()),t.it.definedProperties.add(r),t.ok(h)}function m(r){t.subschema({keyword:"properties",schemaProp:r,dataProp:r},h)}}}}),hF=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=hr(),o=p9(),a=p4(),i=p4();t.default={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:s,schema:n,data:l,parentSchema:c,it:u}=t,{opts:d}=u,p=(0,r.allSchemaProperties)(n),h=p.filter(t=>(0,a.alwaysValidSchema)(u,n[t]));if(0===p.length||h.length===p.length&&(!u.opts.unevaluated||!0===u.props))return;let f=d.strictSchema&&!d.allowMatchingProperties&&c.properties,m=s.name("valid");!0===u.props||u.props instanceof o.Name||(u.props=(0,i.evaluatedPropsToName)(s,u.props));let{props:y}=u;for(let t of p)f&&function(t){for(let r in f)new RegExp(t).test(r)&&(0,a.checkStrictMode)(u,`property ${r} matches pattern ${t} (use allowMatchingProperties)`)}(t),u.allErrors?g(t):(s.var(m,!0),g(t),s.if(m));function g(a){s.forIn("key",l,n=>{s.if((0,o._)`${(0,r.usePattern)(t,a)}.test(${n})`,()=>{let r=h.includes(a);r||t.subschema({keyword:"patternProperties",schemaProp:a,dataProp:n,dataPropType:i.Type.Str},m),u.opts.unevaluated&&!0!==y?s.assign((0,o._)`${y}[${n}]`,!0):r||u.allErrors||s.if((0,o.not)(m),()=>s.break())})})}}}}),hH=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p4();t.default={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:o,schema:a,it:i}=t;if((0,r.alwaysValidSchema)(i,a))return void t.fail();let s=o.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}}}),hK=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:hr().validateUnion,error:{message:"must match a schema in anyOf"}}}),hJ=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9(),o=p4();t.default={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:t})=>(0,r._)`{passingSchemas: ${t.passing}}`},code(t){let{gen:a,schema:i,parentSchema:s,it:n}=t;if(!Array.isArray(i))throw Error("ajv implementation error");if(n.opts.discriminator&&s.discriminator)return;let l=a.let("valid",!1),c=a.let("passing",null),u=a.name("_valid");t.setParams({passing:c}),a.block(function(){i.forEach((i,s)=>{let d;(0,o.alwaysValidSchema)(n,i)?a.var(u,!0):d=t.subschema({keyword:"oneOf",schemaProp:s,compositeRule:!0},u),s>0&&a.if((0,r._)`${u} && ${l}`).assign(l,!1).assign(c,(0,r._)`[${c}, ${s}]`).else(),a.if(u,()=>{a.assign(l,!0),a.assign(c,s),d&&t.mergeEvaluated(d,r.Name)})})}),t.result(l,()=>t.reset(),()=>t.error(!0))}}}),hB=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p4();t.default={keyword:"allOf",schemaType:"array",code(t){let{gen:o,schema:a,it:i}=t;if(!Array.isArray(a))throw Error("ajv implementation error");let s=o.name("valid");a.forEach((o,a)=>{if((0,r.alwaysValidSchema)(i,o))return;let n=t.subschema({keyword:"allOf",schemaProp:a},s);t.ok(s),t.mergeEvaluated(n)})}}}),hG=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9(),o=p4();function a(t,r){let a=t.schema[r];return void 0!==a&&!(0,o.alwaysValidSchema)(t,a)}t.default={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:t})=>(0,r.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,r._)`{failingKeyword: ${t.ifClause}}`},code(t){let i,{gen:s,parentSchema:n,it:l}=t;void 0===n.then&&void 0===n.else&&(0,o.checkStrictMode)(l,'"if" without "then" and "else" is ignored');let c=a(l,"then"),u=a(l,"else");if(!c&&!u)return;let d=s.let("valid",!0),p=s.name("_valid");if(i=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},p),t.mergeEvaluated(i),t.reset(),c&&u){let r=s.let("ifClause");t.setParams({ifClause:r}),s.if(p,h("then",r),h("else",r))}else c?s.if(p,h("then")):s.if((0,r.not)(p),h("else"));function h(o,a){return()=>{let i=t.subschema({keyword:o},p);s.assign(d,p),t.mergeValidEvaluated(i,d),a?s.assign(a,(0,r._)`${o}`):t.setParams({ifClause:o})}}t.pass(d,()=>t.error(!0))}}}),hZ=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p4();t.default={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:o,it:a}){void 0===o.if&&(0,r.checkStrictMode)(a,`"${t}" without "if" is ignored`)}}}),hW=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=hI(),o=hM(),a=hA(),i=hq(),s=hz(),n=hL(),l=hD(),c=hU(),u=hV(),d=hF(),p=hH(),h=hK(),f=hJ(),m=hB(),y=hG(),g=hZ();t.default=function(t=!1){let v=[p.default,h.default,f.default,m.default,y.default,g.default,l.default,c.default,n.default,u.default,d.default];return t?v.push(o.default,i.default):v.push(r.default,a.default),v.push(s.default),v}}),hX=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9();t.default={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>(0,r.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,r._)`{format: ${t}}`},code(t,o){let a,i,s,n,l,c,{gen:u,data:d,$data:p,schema:h,schemaCode:f,it:m}=t,{opts:y,errSchemaPath:g,schemaEnv:v,self:b}=m;y.validateFormats&&(p?(a=u.scopeValue("formats",{ref:b.formats,code:y.code.formats}),i=u.const("fDef",(0,r._)`${a}[${f}]`),s=u.let("fType"),n=u.let("format"),u.if((0,r._)`typeof ${i} == "object" && !(${i} instanceof RegExp)`,()=>u.assign(s,(0,r._)`${i}.type || "string"`).assign(n,(0,r._)`${i}.validate`),()=>u.assign(s,(0,r._)`"string"`).assign(n,i)),t.fail$data((0,r.or)(!1===y.strictSchema?r.nil:(0,r._)`${f} && !${n}`,(l=v.$async?(0,r._)`(${i}.async ? await ${n}(${d}) : ${n}(${d}))`:(0,r._)`${n}(${d})`,c=(0,r._)`(typeof ${n} == "function" ? ${l} : ${n}.test(${d}))`,(0,r._)`${n} && ${n} !== true && ${s} === ${o} && !${c}`)))):function(){var a;let i,s,n=b.formats[h];if(!n){if(!1===y.strictSchema)return b.logger.warn(l());throw Error(l());function l(){return`unknown format "${h}" ignored in schema at path "${g}"`}}if(!0===n)return;let[c,p,f]=(i=(a=n)instanceof RegExp?(0,r.regexpCode)(a):y.code.formats?(0,r._)`${y.code.formats}${(0,r.getProperty)(h)}`:void 0,s=u.scopeValue("formats",{key:h,ref:a,code:i}),"object"!=typeof a||a instanceof RegExp?["string",a,s]:[a.type||"string",a.validate,(0,r._)`${s}.validate`]);c===o&&t.pass(function(){if("object"==typeof n&&!(n instanceof RegExp)&&n.async){if(!v.$async)throw Error("async format in sync schema");return(0,r._)`await ${f}(${d})`}return"function"==typeof p?(0,r._)`${f}(${d})`:(0,r._)`${f}.test(${d})`}())}())}}}),hY=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=[hX().default]}),hQ=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),h0=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=h_(),o=hN(),a=hW(),i=hY(),s=hQ();t.default=[r.default,o.default,(0,a.default)(),i.default,s.metadataVocabulary,s.contentVocabulary]}),h1=dl(t=>{var r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,(o=r||(t.DiscrError=r={})).Tag="tag",o.Mapping="mapping"}),h2=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9(),o=h1(),a=hd(),i=hu(),s=p4();t.default={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:t,tagName:r}})=>t===o.DiscrError.Tag?`tag "${r}" must be string`:`value of tag "${r}" must be in oneOf`,params:({params:{discrError:t,tag:o,tagName:a}})=>(0,r._)`{error: ${t}, tag: ${a}, tagValue: ${o}}`},code(t){let{gen:n,data:l,schema:c,parentSchema:u,it:d}=t,{oneOf:p}=u;if(!d.opts.discriminator)throw Error("discriminator: requires discriminator option");let h=c.propertyName;if("string"!=typeof h)throw Error("discriminator: requires propertyName");if(c.mapping)throw Error("discriminator: mapping is not supported");if(!p)throw Error("discriminator: requires oneOf keyword");let f=n.let("valid",!1),m=n.const("tag",(0,r._)`${l}${(0,r.getProperty)(h)}`);n.if((0,r._)`typeof ${m} == "string"`,()=>(function(){let l=function(){var t;let r={},o=l(u),n=!0;for(let r=0;r<p.length;r++){let u=p[r];if((null==u?void 0:u.$ref)&&!(0,s.schemaHasRulesButRef)(u,d.self.RULES)){let t=u.$ref;if((u=a.resolveRef.call(d.self,d.schemaEnv.root,d.baseId,t))instanceof a.SchemaEnv&&(u=u.schema),void 0===u)throw new i.default(d.opts.uriResolver,d.baseId,t)}let f=null==(t=null==u?void 0:u.properties)?void 0:t[h];if("object"!=typeof f)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${h}"`);n=n&&(o||l(u)),function(t,r){if(t.const)c(t.const,r);else if(t.enum)for(let o of t.enum)c(o,r);else throw Error(`discriminator: "properties/${h}" must have "const" or "enum"`)}(f,r)}if(!n)throw Error(`discriminator: "${h}" must be required`);return r;function l({required:t}){return Array.isArray(t)&&t.includes(h)}function c(t,o){if("string"!=typeof t||t in r)throw Error(`discriminator: "${h}" values must be unique strings`);r[t]=o}}();for(let o in n.if(!1),l)n.elseIf((0,r._)`${m} === ${o}`),n.assign(f,function(o){let a=n.name("valid"),i=t.subschema({keyword:"oneOf",schemaProp:o},a);return t.mergeEvaluated(i,r.Name),a}(l[o]));n.else(),t.error(!1,{discrError:o.DiscrError.Mapping,tag:m,tagName:h}),n.endIf()})(),()=>t.error(!1,{discrError:o.DiscrError.Tag,tag:m,tagName:h})),t.ok(f)}}}),h9=dl((t,r)=>{r.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}}),h4=dl((t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;let o=hg(),a=h0(),i=h2(),s=h9(),n=["/properties"],l="http://json-schema.org/draft-07/schema";var c=class extends o.default{_addVocabularies(){super._addVocabularies(),a.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(s,n):s;this.addMetaSchema(t,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}};t.Ajv=c,r.exports=t=c,r.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=hl();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=p9();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var p=hc();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return p.default}});var h=hu();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})}),h5=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.dynamicAnchor=void 0;let r=p9(),o=p5(),a=hd(),i=hb();function s(t,s){let{gen:n,it:l}=t;l.schemaEnv.root.dynamicAnchors[s]=!0;let c=(0,r._)`${o.default.dynamicAnchors}${(0,r.getProperty)(s)}`,u="#"===l.errSchemaPath?l.validateName:function(t){let{schemaEnv:r,schema:o,self:s}=t.it,{root:n,baseId:l,localRefs:c,meta:u}=r.root,{schemaId:d}=s.opts,p=new a.SchemaEnv({schema:o,schemaId:d,root:n,baseId:l,localRefs:c,meta:u});return a.compileSchema.call(s,p),(0,i.getValidate)(t,p)}(t);n.if((0,r._)`!${c}`,()=>n.assign(c,u))}t.dynamicAnchor=s,t.default={keyword:"$dynamicAnchor",schemaType:"string",code:t=>s(t,t.schema)}}),h3=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.dynamicRef=void 0;let r=p9(),o=p5(),a=hb();function i(t,i){let{gen:s,keyword:n,it:l}=t;if("#"!==i[0])throw Error(`"${n}" only supports hash fragment reference`);let c=i.slice(1);if(l.allErrors)u();else{let r=s.let("valid",!1);u(r),t.ok(r)}function u(t){if(l.schemaEnv.root.dynamicAnchors[c]){let a=s.let("_v",(0,r._)`${o.default.dynamicAnchors}${(0,r.getProperty)(c)}`);s.if(a,d(a,t),d(l.validateName,t))}else d(l.validateName,t)()}function d(r,o){return o?()=>s.block(()=>{(0,a.callRef)(t,r),s.let(o,!0)}):()=>(0,a.callRef)(t,r)}}t.dynamicRef=i,t.default={keyword:"$dynamicRef",schemaType:"string",code:t=>i(t,t.schema)}}),h6=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=h5(),o=p4();t.default={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){t.schema?(0,r.dynamicAnchor)(t,""):(0,o.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}}}),h8=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=h3();t.default={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,r.dynamicRef)(t,t.schema)}}),h7=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=h5(),o=h3(),a=h6(),i=h8();t.default=[r.default,o.default,a.default,i.default]}),fe=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=hL();t.default={keyword:"dependentRequired",type:"object",schemaType:"object",error:r.error,code:t=>(0,r.validatePropertyDeps)(t)}}),ft=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=hL();t.default={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,r.validateSchemaDeps)(t)}}),fr=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p4();t.default={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:o,it:a}){void 0===o.contains&&(0,r.checkStrictMode)(a,`"${t}" without "contains" is ignored`)}}}),fo=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=fe(),o=ft(),a=fr();t.default=[r.default,o.default,a.default]}),fa=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9(),o=p4(),a=p5();t.default={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:t})=>(0,r._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},code(t){let{gen:i,schema:s,data:n,errsCount:l,it:c}=t;if(!l)throw Error("ajv implementation error");let{allErrors:u,props:d}=c;function p(a){if(!1===s){t.setParams({unevaluatedProperty:a}),t.error(),u||i.break();return}if(!(0,o.alwaysValidSchema)(c,s)){let s=i.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:a,dataPropType:o.Type.Str},s),u||i.if((0,r.not)(s),()=>i.break())}}d instanceof r.Name?i.if((0,r._)`${d} !== true`,()=>i.forIn("key",n,t=>{var o,a;return i.if((o=d,a=t,(0,r._)`!${o} || !${o}[${a}]`),()=>p(t))})):!0!==d&&i.forIn("key",n,t=>void 0===d?p(t):i.if(function(t,o){let a=[];for(let i in t)!0===t[i]&&a.push((0,r._)`${o} !== ${i}`);return(0,r.and)(...a)}(d,t),()=>p(t))),c.props=!0,t.ok((0,r._)`${l} === ${a.default.errors}`)}}}),fi=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=p9(),o=p4();t.default={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:t}})=>(0,r.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,r._)`{limit: ${t}}`},code(t){let{gen:a,schema:i,data:s,it:n}=t,l=n.items||0;if(!0===l)return;let c=a.const("len",(0,r._)`${s}.length`);if(!1===i)t.setParams({len:l}),t.fail((0,r._)`${c} > ${l}`);else if("object"==typeof i&&!(0,o.alwaysValidSchema)(n,i)){let i=a.var("valid",(0,r._)`${c} <= ${l}`);a.if((0,r.not)(i),()=>{var s,u;return s=i,u=l,void a.forRange("i",u,c,i=>{t.subschema({keyword:"unevaluatedItems",dataProp:i,dataPropType:o.Type.Num},s),n.allErrors||a.if((0,r.not)(s),()=>a.break())})}),t.ok(i)}n.items=!0}}}),fs=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=fa(),o=fi();t.default=[r.default,o.default]}),fn=dl((t,r)=>{r.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"}]}}}}}),fl=dl((t,r)=>{r.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:"#"}}}}}),fc=dl((t,r)=>{r.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:"#"}}}}),fu=dl((t,r)=>{r.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:{}}}}}),fd=dl((t,r)=>{r.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"}}}}),fp=dl((t,r)=>{r.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}}}}),fh=dl((t,r)=>{r.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:[]}}}}),ff=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=fn(),o=fl(),a=fc(),i=fu(),s=fd(),n=fp(),l=fh(),c=["/properties"];t.default=function(t){return[r,o,a,i,u(this,s),n,u(this,l)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function u(r,o){return t?r.$dataMetaSchema(o,c):o}}}),fm=dl((t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2019=void 0;let o=hg(),a=h0(),i=h7(),s=fo(),n=fs(),l=h2(),c=ff(),u="https://json-schema.org/draft/2019-09/schema";var d=class extends o.default{constructor(t={}){super({...t,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(i.default),a.default.forEach(t=>this.addVocabulary(t)),this.addVocabulary(s.default),this.addVocabulary(n.default),this.opts.discriminator&&this.addKeyword(l.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:t,meta:r}=this.opts;r&&(c.default.call(this,t),this.refs["http://json-schema.org/schema"]=u)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}};t.Ajv2019=d,r.exports=t=d,r.exports.Ajv2019=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var p=hl();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return p.KeywordCxt}});var h=p9();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});var f=hc();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var m=hu();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})}),fy=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=h_(),o=hN(),a=hW(),i=h7(),s=fo(),n=fs(),l=hY(),c=hQ();t.default=[i.default,r.default,o.default,(0,a.default)(!0),l.default,c.metadataVocabulary,c.contentVocabulary,s.default,n.default]}),fg=dl((t,r)=>{r.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}}}}),fv=dl((t,r)=>{r.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"}}}}}),fb=dl((t,r)=>{r.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"}}}}),f_=dl((t,r)=>{r.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"}}}}),fS=dl((t,r)=>{r.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"}}}}),f$=dl((t,r)=>{r.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"}}}}),fw=dl((t,r)=>{r.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}}}}),fE=dl((t,r)=>{r.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:[]}}}}),fR=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0});let r=fg(),o=fv(),a=fb(),i=f_(),s=fS(),n=f$(),l=fw(),c=fE(),u=["/properties"];t.default=function(t){return[r,o,a,i,s,d(this,n),l,d(this,c)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function d(r,o){return t?r.$dataMetaSchema(o,u):o}}}),fP=dl((t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;let o=hg(),a=fy(),i=h2(),s=fR(),n="https://json-schema.org/draft/2020-12/schema";var l=class extends o.default{constructor(t={}){super({...t,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),a.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:t,meta:r}=this.opts;r&&(s.default.call(this,t),this.refs["http://json-schema.org/schema"]=n)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}};t.Ajv2020=l,r.exports=t=l,r.exports.Ajv2020=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var c=hl();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=p9();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=hc();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=hu();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})}),fk=dl(t=>{function r(t,r){return{validate:t,compare:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:r(i,s),time:r(l(!0),c),"date-time":r(p(!0),h),"iso-time":r(l(),u),"iso-date-time":r(p(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(t){return m.test(t)&&y.test(t)},"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:function(t){if(S.test(t))return!1;try{return new RegExp(t),!0}catch(t){return!1}},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:function(t){return g.lastIndex=0,g.test(t)},int32:{type:"number",validate:function(t){return Number.isInteger(t)&&t<=b&&t>=v}},int64:{type:"number",validate:function(t){return Number.isInteger(t)}},float:{type:"number",validate:_},double:{type:"number",validate:_},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),"date-time":r(/^\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,h),"iso-time":r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":r(/^\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,f),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},t.formatNames=Object.keys(t.fullFormats);let o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,a=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(t){var r;let i=o.exec(t);if(!i)return!1;let s=+i[1],n=+i[2],l=+i[3];return n>=1&&n<=12&&l>=1&&l<=(2===n&&(r=s)%4==0&&(r%100!=0||r%400==0)?29:a[n])}function s(t,r){if(t&&r)return t>r?1:t<r?-1:0}let n=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(t){return function(r){let o=n.exec(r);if(!o)return!1;let a=+o[1],i=+o[2],s=+o[3],l=o[4],c="-"===o[5]?-1:1,u=+(o[6]||0),d=+(o[7]||0);if(u>23||d>59||t&&!l)return!1;if(a<=23&&i<=59&&s<60)return!0;let p=i-d*c,h=a-u*c-(p<0);return(23===h||-1===h)&&(59===p||-1===p)&&s<61}}function c(t,r){if(!(t&&r))return;let o=new Date("2020-01-01T"+t).valueOf(),a=new Date("2020-01-01T"+r).valueOf();if(o&&a)return o-a}function u(t,r){if(!(t&&r))return;let o=n.exec(t),a=n.exec(r);if(o&&a)return(t=o[1]+o[2]+o[3])>(r=a[1]+a[2]+a[3])?1:t<r?-1:0}let d=/t|\s/i;function p(t){let r=l(t);return function(t){let o=t.split(d);return 2===o.length&&i(o[0])&&r(o[1])}}function h(t,r){if(!(t&&r))return;let o=new Date(t).valueOf(),a=new Date(r).valueOf();if(o&&a)return o-a}function f(t,r){if(!(t&&r))return;let[o,a]=t.split(d),[i,n]=r.split(d),l=s(o,i);if(void 0!==l)return l||c(a,n)}let m=/\/|:/,y=/^(?:[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,g=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,v=-0x80000000,b=0x80000000-1;function _(){return!0}let S=/[^\\]\\Z/}),fO=dl(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;let r=h4(),o=p9(),a=o.operators,i={formatMaximum:{okStr:"<=",ok:a.LTE,fail:a.GT},formatMinimum:{okStr:">=",ok:a.GTE,fail:a.LT},formatExclusiveMaximum:{okStr:"<",ok:a.LT,fail:a.GTE},formatExclusiveMinimum:{okStr:">",ok:a.GT,fail:a.LTE}};t.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:{message:({keyword:t,schemaCode:r})=>(0,o.str)`should be ${i[t].okStr} ${r}`,params:({keyword:t,schemaCode:r})=>(0,o._)`{comparison: ${i[t].okStr}, limit: ${r}}`},code(t){let a,s,{gen:n,data:l,schemaCode:c,keyword:u,it:d}=t,{opts:p,self:h}=d;if(!p.validateFormats)return;let f=new r.KeywordCxt(d,h.RULES.all.format.definition,"format");function m(t){return(0,o._)`${t}.compare(${l}, ${c}) ${i[u].fail} 0`}f.$data?(a=n.scopeValue("formats",{ref:h.formats,code:p.code.formats}),s=n.const("fmt",(0,o._)`${a}[${f.schemaCode}]`),t.fail$data((0,o.or)((0,o._)`typeof ${s} != "object"`,(0,o._)`${s} instanceof RegExp`,(0,o._)`typeof ${s}.compare != "function"`,m(s)))):function(){let r=f.schema,a=h.formats[r];if(!a||!0===a)return;if("object"!=typeof a||a instanceof RegExp||"function"!=typeof a.compare)throw Error(`"${u}": format "${r}" does not define "compare" function`);let i=n.scopeValue("formats",{key:r,ref:a,code:p.code.formats?(0,o._)`${p.code.formats}${(0,o.getProperty)(r)}`:void 0});t.fail$data(m(i))}()},dependencies:["format"]},t.default=r=>(r.addKeyword(t.formatLimitDefinition),r)}),fT=dl((t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});let o=fk(),a=fO(),i=p9(),s=new i.Name("fullFormats"),n=new i.Name("fastFormats"),l=(t,r={keywords:!0})=>{if(Array.isArray(r))return c(t,r,o.fullFormats,s),t;let[i,l]="fast"===r.mode?[o.fastFormats,n]:[o.fullFormats,s];return c(t,r.formats||o.formatNames,i,l),r.keywords&&(0,a.default)(t),t};function c(t,r,o,a){var s;for(let n of(null!=(s=t.opts.code).formats||(s.formats=(0,i._)`require("ajv-formats/dist/formats").${a}`),r))t.addFormat(n,o[n])}l.get=(t,r="full")=>{let a=("fast"===r?o.fastFormats:o.fullFormats)[t];if(!a)throw Error(`Unknown format "${t}"`);return a},r.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l}),fx=h4(),fj=fm(),fC=fP();let fN=dc(fT(),1).default;function fI(t){let r=new t({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return fN(r),r}var fA=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(t){this._userAjv=void 0!==t,this._ajv=t}get ajv(){return this._ajv??=fI(fC.Ajv2020)}_engineFor(t){if(this._userAjv)return this.ajv;let r=function(t,r){if(!("$schema"in t)||"string"!=typeof t.$schema)return"2020-12";let o=t.$schema.replace(/#$/,"");if(du.has(o))return"2020-12";if(dd.has(o))return"2019-09";if(dp.has(o)||dh.has(o))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${t.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${r}`)}(t,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");return"2020-12"===r?this.ajv:"2019-09"===r?this._ajv2019??=fI(fj.Ajv2019):this._ajvDraft7??=fI(fx.Ajv)}getValidator(t){let r=this._engineFor(t),o="$id"in t&&"string"==typeof t.$id?r.getSchema(t.$id)??r.compile(t):r.compile(t);return t=>o(t)?{valid:!0,data:t,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:r.errorsText(o.errors)}}};async function fM(t){return(await p).getRandomValues(new Uint8Array(t))}async function fq(t){let r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",o=256-256%r.length,a="";for(;a.length<t;)for(let i of(await fM(t-a.length)))i<o&&(a+=r[i%r.length]);return a}async function fz(t){return await fq(t)}async function fL(t){return btoa(String.fromCharCode(...new Uint8Array(await (await p).subtle.digest("SHA-256",new TextEncoder().encode(t))))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function fD(t){if(t||(t=43),t<43||t>128)throw`Expected a length between 43 and 128. Received ${t}.`;let r=await fz(t),o=await fL(r);return{code_verifier:r,code_challenge:o}}fx.Ajv,p=globalThis.crypto?.webcrypto??globalThis.crypto??Promise.resolve().then(s.t.bind(s,7598,19)).then(t=>t.webcrypto);class fU extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}function fV(t){}function fF(t,r,o){return 100===o&&97===t.charCodeAt(r+1)&&116===t.charCodeAt(r+2)&&97===t.charCodeAt(r+3)&&58===t.charCodeAt(r+4)}function fH(t,r,o){return 101===o&&118===t.charCodeAt(r+1)&&101===t.charCodeAt(r+2)&&110===t.charCodeAt(r+3)&&116===t.charCodeAt(r+4)&&58===t.charCodeAt(r+5)}class fK extends TransformStream{constructor({onError:t,onRetry:r,onComment:o,maxBufferSize:a}={}){let i;super({start(s){i=function(t){if("function"==typeof t)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:r=fV,onError:o=fV,onRetry:a=fV,onComment:i,maxBufferSize:s}=t,n=[],l=0,c=!0,u,d="",p=0,h,f=!1;function m(){void 0!==s&&(l+d.length<=s||(f=!0,n.length=0,l=0,u=void 0,d="",p=0,h=void 0,o(new fU(`Buffered data exceeded max buffer size of ${s} characters`,{type:"max-buffer-size-exceeded"}))))}function y(t){let o=0;if(-1===t.indexOf("\r")){let a=t.indexOf(`
|
|
68
|
+
`,o);for(;-1!==a;){if(o===a){p>0&&r({id:u,event:h,data:d}),u=void 0,d="",p=0,h=void 0,o=a+1,a=t.indexOf(`
|
|
69
|
+
`,o);continue}let i=t.charCodeAt(o);if(fF(t,o,i)){let i=32===t.charCodeAt(o+5)?o+6:o+5,s=t.slice(i,a);if(0===p&&10===t.charCodeAt(a+1)){r({id:u,event:h,data:s}),u=void 0,d="",h=void 0,o=a+2,a=t.indexOf(`
|
|
70
|
+
`,o);continue}d=0===p?s:`${d}
|
|
71
|
+
${s}`,p++}else fH(t,o,i)?h=t.slice(32===t.charCodeAt(o+6)?o+7:o+6,a)||void 0:g(t,o,a);o=a+1,a=t.indexOf(`
|
|
72
|
+
`,o)}return t.slice(o)}for(;o<t.length;){let r=t.indexOf("\r",o),a=t.indexOf(`
|
|
73
|
+
`,o),i=-1;if(-1!==r&&-1!==a?i=r<a?r:a:-1!==r?i=r===t.length-1?-1:r:-1!==a&&(i=a),-1===i)break;g(t,o,i),o=i+1,13===t.charCodeAt(o-1)&&10===t.charCodeAt(o)&&o++}return t.slice(o)}function g(t,o,a){if(o===a)return void(p>0&&r({id:u,event:h,data:d}),u=void 0,d="",p=0,h=void 0);let s=t.charCodeAt(o);if(fF(t,o,s)){let r=32===t.charCodeAt(o+5)?o+6:o+5,i=t.slice(r,a);d=0===p?i:`${d}
|
|
74
|
+
${i}`,p++;return}if(fH(t,o,s)){h=t.slice(32===t.charCodeAt(o+6)?o+7:o+6,a)||void 0;return}if(105===s&&100===t.charCodeAt(o+1)&&58===t.charCodeAt(o+2)){let r=t.slice(32===t.charCodeAt(o+3)?o+4:o+3,a);u=r.includes("\0")?void 0:r;return}if(58===s){i&&i(t.slice(o,a).slice(32===t.charCodeAt(o+1)?2:1));return}let n=t.slice(o,a),l=n.indexOf(":");if(-1===l)return void v(n,"",n);let c=n.slice(0,l),f=32===n.charCodeAt(l+1)?2:1;v(c,n.slice(l+f),n)}function v(t,r,i){switch(t){case"event":h=r||void 0;break;case"data":d=0===p?r:`${d}
|
|
75
|
+
${r}`,p++;break;case"id":u=r.includes("\0")?void 0:r;break;case"retry":/^\d+$/.test(r)?a(parseInt(r,10)):o(new fU(`Invalid \`retry\` value: "${r}"`,{type:"invalid-retry",value:r,line:i}));break;default:o(new fU(`Unknown field "${t.length>20?`${t.slice(0,20)}\u2026`:t}"`,{type:"unknown-field",field:t,value:r,line:i}))}}return{feed:function(t){if(f)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,239===t.charCodeAt(0)&&187===t.charCodeAt(1)&&191===t.charCodeAt(2)&&(t=t.slice(3))),0===n.length){let r=y(t);""!==r&&(n.push(r),l=r.length),m();return}if(-1===t.indexOf(`
|
|
76
|
+
`)&&-1===t.indexOf("\r")){n.push(t),l+=t.length,m();return}n.push(t);let r=n.join("");n.length=0,l=0;let o=y(r);""!==o&&(n.push(o),l=o.length),m()},reset:function(t={}){if(t.consume&&n.length>0){let t=n.join("");g(t,0,t.length)}c=!0,u=void 0,d="",p=0,h=void 0,n.length=0,l=0,f=!1}}}({onEvent:t=>{s.enqueue(t)},onError(r){"function"==typeof t&&t(r),("terminate"===t||"max-buffer-size-exceeded"===r.type)&&s.error(r)},onRetry:r,onComment:o,maxBufferSize:a})},transform(t){i.feed(t)}})}}var fJ=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](t){return dy(this,t)}static isInstance(t){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return dy(this,t)}constructor(t){super(t),this.name=new.target.name,dm(this,new.target)}},fB=class extends fJ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.IssuerMismatchError"})}kind;expected;received;constructor(t,r,o){super(`Issuer mismatch in ${"metadata"===t?"authorization server metadata (RFC 8414 \xa73.3)":"authorization response (RFC 9207)"}: expected ${JSON.stringify(r)}, received ${JSON.stringify(o)}`),this.kind=t,this.expected=r,this.received=o}},fG=class extends fJ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.RegistrationRejectedError"})}status;body;submittedMetadata;constructor(t){super(`Dynamic Client Registration rejected (HTTP ${t.status}): ${t.body}`),this.status=t.status,this.body=t.body,this.submittedMetadata=t.submittedMetadata}},fZ=class extends fJ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsecureTokenEndpointError"})}tokenEndpoint;constructor(t){super(`Refusing to send credentials to non-https token endpoint '${t}'. OAuth token requests MUST use TLS (localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=t}},fW=class extends fJ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.AuthorizationServerMismatchError"})}constructor(t,r){super(`Authorization server changed between redirect and callback (redirected to ${JSON.stringify(t)}, callback resolved ${JSON.stringify(r)}); refusing to send authorization_code/code_verifier to a different token endpoint`),this.recordedIssuer=t,this.currentIssuer=r}},fX=class extends fJ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsufficientScopeError"})}requiredScope;resourceMetadataUrl;errorDescription;constructor(t){super(`Insufficient scope${t.requiredScope?`: required "${t.requiredScope}"`:""}`),this.requiredScope=t.requiredScope,this.resourceMetadataUrl=t.resourceMetadataUrl,this.errorDescription=t.errorDescription}};function fY(t,r,o){if(void 0!==t)return void 0===t.issuer?(o?.canPersistStamp!==!1&&console.warn("[mcp-sdk] SEP-2352: stored OAuth credential has no 'issuer' stamp (pre-upgrade storage or provider not round-tripping the value). SEP-2352 isolation is inactive for this read; ensure your provider round-trips the issuer field."),t):fQ(t.issuer,r)?t:void 0}function fQ(t,r){return t===r||t.endsWith("/")&&t.slice(0,-1)===r||r.endsWith("/")&&r.slice(0,-1)===t}async function f0(t,r,o){let{resourceMetadataUrl:a,scope:i}=mo(r.response);if(await me(t,{serverUrl:r.serverUrl,resourceMetadataUrl:a,scope:i,fetchFn:r.fetchFn,...o})!=="AUTHORIZED")throw new f1}var f1=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](t){return dy(this,t)}static isInstance(t){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return dy(this,t)}constructor(t){super(t??"Unauthorized"),this.name="UnauthorizedError",dm(this,new.target)}};function f2(t){return t?.authorization_response_iss_parameter_supported===!0}function f9({iss:t,expectedIssuer:r,issParameterSupported:o}){if(void 0!==r){if(void 0===t){if(o)throw new fB("authorization_response",r,void 0);return}if(t!==r)throw new fB("authorization_response",r,t)}}function f4(...t){let r=new Set;for(let o of t)if(o)for(let t of o.split(/\s+/))t&&r.add(t);return r.size>0?[...r].join(" "):void 0}async function f5(t,r,o,a,i){if("string"==typeof t)return{authorizationCode:t,iss:r};let s=t.get("iss")??void 0,n=t.get("code");if(n)return{authorizationCode:n,iss:s};let l=(await o.discoveryState?.())?.authorizationServerMetadata;if(!l)try{l=(await mu(a,i)).authorizationServerMetadata}catch{l=void 0}if(!l)throw new f1("Authorization callback failed and the issuer could not be verified");f9({iss:s,expectedIssuer:l.issuer,issParameterSupported:f2(l)});let c=t.get("error");if(c)throw new dv(c,t.get("error_description")??c,t.get("error_uri")??void 0);throw new f1("Authorization callback contained neither `code` nor `error`")}let f3="code",f6="S256";function f8(t){return"localhost"===t||"127.0.0.1"===t||"[::1]"===t||"::1"===t}async function f7(t){let r=t instanceof Response?t.status:void 0,o=t instanceof Response?await t.text():t;try{let t=lU.parse(JSON.parse(o));return dv.fromResponse(t)}catch(a){let t=`${r?`HTTP ${r}: `:""}Invalid OAuth error response: ${a}. Raw body: ${o}`;return new dv(dg.ServerError,t)}}async function me(t,r){try{return await mt(t,r)}catch(o){if(o instanceof dv){if(o.code===dg.InvalidClient||o.code===dg.UnauthorizedClient)return await t.invalidateCredentials?.("client"),await t.invalidateCredentials?.("tokens"),await mt(t,r);else if(o.code===dg.InvalidGrant)return await t.invalidateCredentials?.("tokens"),await mt(t,r)}throw o}}async function mt(t,{serverUrl:r,authorizationCode:o,iss:a,scope:i,resourceMetadataUrl:s,fetchFn:n,skipIssuerMetadataValidation:l,forceReauthorization:c}){let u,d,p,h,f,m={...f=t.clientMetadata,grant_types:f.grant_types??(void 0===t.redirectUrl?void 0:["authorization_code","refresh_token"]),application_type:f.application_type??function(t){for(let r of t??[]){let t;try{t=new URL(r)}catch{continue}if("http:"!==t.protocol&&"https:"!==t.protocol||f8(t.hostname))return"native"}return"web"}(f.redirect_uris)},y=await t.discoveryState?.(),g=s;if(!g&&y?.resourceMetadataUrl&&(g=new URL(y.resourceMetadataUrl)),y?.authorizationServerUrl){if(d=y.authorizationServerUrl,u=y.resourceMetadata,p=y.authorizationServerMetadata??await mc(d,{fetchFn:n,skipIssuerValidation:l}),!u)try{u=await mi(r,{resourceMetadataUrl:g},n)}catch(t){if(t instanceof TypeError)throw t}(p!==y.authorizationServerMetadata||u!==y.resourceMetadata)&&await t.saveDiscoveryState?.({authorizationServerUrl:String(d),resourceMetadataUrl:g?.toString(),resourceMetadata:u,authorizationServerMetadata:p})}else{let t=await mu(r,{resourceMetadataUrl:g,fetchFn:n,skipIssuerMetadataValidation:l});d=t.authorizationServerUrl,p=t.authorizationServerMetadata,u=t.resourceMetadata,h={authorizationServerUrl:String(d),resourceMetadataUrl:g?.toString(),resourceMetadata:u,authorizationServerMetadata:p}}let v=p?.issuer??String(d),b={issuer:v};if(await t.saveAuthorizationServerUrl?.(v),void 0!==o){let r=y?.authorizationServerMetadata?.issuer??y?.authorizationServerUrl;if(void 0===r){if(void 0!==t.saveDiscoveryState)throw new fW("discoveryState was not available on the callback leg; ensure your provider persists discoveryState alongside codeVerifier",v);console.warn("[mcp-sdk] OAuthClientProvider does not implement saveDiscoveryState()/discoveryState(); the SEP-2352 callback-leg authorization-server binding cannot be checked. Implement discoveryState (persist alongside codeVerifier) — see docs/migration/upgrade-to-v2.md \xa7SEP-2352.")}else if(!fQ(r,v))throw new fW(r,v)}h&&await t.saveDiscoveryState?.(h);let _=await mr(r,t,u);_&&await t.saveResourceUrl?.(String(_));let S=function(t){let{requestedScope:r,resourceMetadata:o,authServerMetadata:a,clientMetadata:i}=t,s=r||o?.scopes_supported?.join(" ")||i.scope;return s&&a?.scopes_supported?.includes("offline_access")&&!s.split(" ").includes("offline_access")&&i.grant_types?.includes("refresh_token")&&(s=`${s} offline_access`),s}({requestedScope:i,resourceMetadata:u,authServerMetadata:p,clientMetadata:t.clientMetadata}),$=await Promise.resolve(t.clientInformation(b)),w=fY($,v,{canPersistStamp:void 0!==t.saveClientInformation});if(void 0===w&&$?.issuer&&void 0===t.saveClientInformation)throw new fW($.issuer,v);if(w&&void 0===w.issuer&&(w={...w,issuer:v},await t.saveClientInformation?.(w,b)),!w){if(void 0!==o)throw Error("Existing OAuth client information is required when exchanging an authorization code");let r=p?.client_id_metadata_document_supported===!0,a=t.clientMetadataUrl;if(a&&!function(t){if(!t)return!1;try{let r=new URL(t);return"https:"===r.protocol&&"/"!==r.pathname}catch{return!1}}(a))throw new dv(dg.InvalidClientMetadata,`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${a}`);if(r&&a)w={client_id:a,issuer:v},await t.saveClientInformation?.(w,b);else{if(!t.saveClientInformation)throw Error("OAuth client information must be saveable for dynamic registration");w={...await mm(d,{metadata:p,clientMetadata:m,scope:S,fetchFn:n}),issuer:v},await t.saveClientInformation(w,b)}}let E=!t.redirectUrl;if(void 0!==o||E){void 0!==o&&f9({iss:a,expectedIssuer:p?.issuer,issParameterSupported:f2(p)});let r=await mf(t,d,{metadata:p,resource:_,authorizationCode:o,iss:a,scope:S,fetchFn:n});return await t.saveTokens({...r,issuer:v},b),"AUTHORIZED"}let R=fY(await t.tokens(b),v);if(R&&void 0===R.issuer&&(R={...R,issuer:v},await t.saveTokens(R,b)),R?.refresh_token&&!c)try{let r=await mh(d,{metadata:p,clientInformation:w,refreshToken:R.refresh_token,resource:_,addClientAuthentication:t.addClientAuthentication,fetchFn:n});return await t.saveTokens({...r,issuer:v},b),"AUTHORIZED"}catch(t){if(t instanceof fZ||t instanceof dv&&t.code!==dg.ServerError)throw t}let P=t.state?await t.state():void 0,{authorizationUrl:k,codeVerifier:O}=await md(d,{metadata:p,clientInformation:w,state:P,redirectUrl:t.redirectUrl,scope:S,resource:_});return await t.saveCodeVerifier(O),await t.redirectToAuthorization(k),"REDIRECT"}async function mr(t,r,o){let a,i=((a=new URL("string"==typeof t?t:t.href)).hash="",a);if(r.validateResourceURL)return await r.validateResourceURL(i,o?.resource);if(o){if(!function({requestedResource:t,configuredResource:r}){let o=new URL("string"==typeof t?t:t.href),a=new URL("string"==typeof r?r:r.href);if(o.origin!==a.origin||o.pathname.length<a.pathname.length)return!1;let i=o.pathname.endsWith("/")?o.pathname:o.pathname+"/",s=a.pathname.endsWith("/")?a.pathname:a.pathname+"/";return i.startsWith(s)}({requestedResource:i,configuredResource:o.resource}))throw Error(`Protected resource ${o.resource} does not match expected ${i} (or origin)`);return new URL(o.resource)}}function mo(t){let r,o=t.headers.get("WWW-Authenticate");if(!o)return{};let[a,i]=o.split(" ");if(a?.toLowerCase()!=="bearer"||!i)return{};let s=ma(t,"resource_metadata")||void 0;if(s)try{r=new URL(s)}catch{}let n=ma(t,"scope")||void 0;return{resourceMetadataUrl:r,scope:n,error:ma(t,"error")||void 0,errorDescription:ma(t,"error_description")||void 0}}function ma(t,r){let o=t.headers.get("WWW-Authenticate");if(!o)return null;let a=new RegExp(String.raw`${r}=(?:"([^"]+)"|([^\s,]+))`),i=o.match(a);if(i){let t=i[1]||i[2];if(t)return t}return null}async function mi(t,r,o=fetch){let a=await ml(t,"oauth-protected-resource",o,{protocolVersion:r?.protocolVersion,metadataUrl:r?.resourceMetadataUrl});if(!a||404===a.status)throw await a?.text?.().catch(()=>{}),Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!a.ok)throw await a.text?.().catch(()=>{}),Error(`HTTP ${a.status} trying to load well-known OAuth protected resource metadata.`);return lA.parse(await a.json())}async function ms(t,r,o=fetch){try{return await o(t,{headers:r})}catch(t){throw t}}async function mn(t,r,o=fetch){return await ms(t,{"MCP-Protocol-Version":r},o)}async function ml(t,r,o,a){var i,s;let n,l=new URL(t),c=a?.protocolVersion??iY;a?.metadataUrl?n=new URL(a.metadataUrl):(n=new URL(function(t,r="",o={}){return r.endsWith("/")&&(r=r.slice(0,-1)),o.prependPathname?`${r}/.well-known/${t}`:`/.well-known/${t}${r}`}(r,l.pathname),a?.metadataServerUrl??l)).search=l.search;let u=await mn(n,c,o);return!a?.metadataUrl&&(i=u,s=l.pathname,!i||"/"!==s&&(i.status>=400&&i.status<500||502===i.status))&&(u=await mn(new URL(`/.well-known/${r}`,l),c,o)),u}async function mc(t,{fetchFn:r=fetch,protocolVersion:o=iY,skipIssuerValidation:a=!1}={}){let i={"MCP-Protocol-Version":o,Accept:"application/json"};for(let{url:o,type:s}of function(t){let r="string"==typeof t?new URL(t):t,o="/"!==r.pathname,a=[];if(!o)return a.push({url:new URL("/.well-known/oauth-authorization-server",r.origin),type:"oauth"},{url:new URL("/.well-known/openid-configuration",r.origin),type:"oidc"}),a;let i=r.pathname;return i.endsWith("/")&&(i=i.slice(0,-1)),a.push({url:new URL(`/.well-known/oauth-authorization-server${i}`,r.origin),type:"oauth"},{url:new URL(`/.well-known/openid-configuration${i}`,r.origin),type:"oidc"},{url:new URL(`${i}/.well-known/openid-configuration`,r.origin),type:"oidc"}),a}(t)){let n=await ms(o,i,r);if(!n)continue;if(!n.ok){if(await n.text?.().catch(()=>{}),n.status>=400&&n.status<500||502===n.status)continue;throw Error(`HTTP ${n.status} trying to load ${"oauth"===s?"OAuth":"OpenID provider"} metadata from ${o}`)}let l="oauth"===s?lM.parse(await n.json()):lz.parse(await n.json());if(!a){let r="string"==typeof t?t:t.href;if(!(l.issuer===r||r.endsWith("/")&&l.issuer===r.slice(0,-1)))throw new fB("metadata",r,l.issuer)}return l}}async function mu(t,r){let o,a;try{(o=await mi(t,{resourceMetadataUrl:r?.resourceMetadataUrl},r?.fetchFn)).authorization_servers&&o.authorization_servers.length>0&&(a=o.authorization_servers[0])}catch(t){if(t instanceof TypeError)throw t}a||(a=String(new URL("/",t)));let i=await mc(a,{fetchFn:r?.fetchFn,skipIssuerValidation:r?.skipIssuerMetadataValidation});return{authorizationServerUrl:a,authorizationServerMetadata:i,resourceMetadata:o}}async function md(t,{metadata:r,clientInformation:o,redirectUrl:a,scope:i,state:s,resource:n}){let l;if(r){if(l=new URL(r.authorization_endpoint),!r.response_types_supported.includes(f3))throw Error(`Incompatible auth server: does not support response type ${f3}`);if(r.code_challenge_methods_supported&&!r.code_challenge_methods_supported.includes(f6))throw Error(`Incompatible auth server: does not support code challenge method ${f6}`)}else l=new URL("/authorize",t);let c=await fD(),u=c.code_verifier,d=c.code_challenge;return l.searchParams.set("response_type",f3),l.searchParams.set("client_id",o.client_id),l.searchParams.set("code_challenge",d),l.searchParams.set("code_challenge_method",f6),l.searchParams.set("redirect_uri",String(a)),s&&l.searchParams.set("state",s),i&&l.searchParams.set("scope",i),i?.split(" ").includes("offline_access")&&l.searchParams.append("prompt","consent"),n&&l.searchParams.set("resource",n.href),{authorizationUrl:l,codeVerifier:u}}async function mp(t,{metadata:r,tokenRequestParams:o,clientInformation:a,addClientAuthentication:i,resource:s,fetchFn:n}){var l,c;let u,d=function(t){let r=new URL(String(t));if("https:"!==r.protocol&&!f8(r.hostname))throw new fZ(r.href);return r}(r?.token_endpoint??new URL("/token",t)),p=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});s&&o.set("resource",s.href),i?await i(p,o,d,r):a&&function(t,r,o,a){let{client_id:i,client_secret:s}=r;switch(t){case"client_secret_basic":var n,l,c,u,d=i,p=s,h=o;if(!p)throw Error("client_secret_basic authentication requires a client_secret");let f=btoa(`${d}:${p}`);h.set("Authorization",`Basic ${f}`);return;case"client_secret_post":n=i,l=s,(c=a).set("client_id",n),l&&c.set("client_secret",l);return;case"none":u=i,a.set("client_id",u);return;default:throw Error(`Unsupported client authentication method: ${t}`)}}((l=a,c=r?.token_endpoint_auth_methods_supported??[],u=void 0!==l.client_secret,"token_endpoint_auth_method"in l&&l.token_endpoint_auth_method&&["client_secret_basic","client_secret_post","none"].includes(l.token_endpoint_auth_method)&&(0===c.length||c.includes(l.token_endpoint_auth_method))?l.token_endpoint_auth_method:0===c.length?u?"client_secret_basic":"none":u&&c.includes("client_secret_basic")?"client_secret_basic":u&&c.includes("client_secret_post")?"client_secret_post":c.includes("none")?"none":u?"client_secret_post":"none"),a,p,o);let h=await (n??fetch)(d,{method:"POST",headers:p,body:o});if(!h.ok)throw await f7(h);let f=await h.json();try{return lL.parse(f)}catch(t){if("object"==typeof f&&null!==f&&"error"in f)throw await f7(JSON.stringify(f));throw t}}async function mh(t,{metadata:r,clientInformation:o,refreshToken:a,resource:i,addClientAuthentication:s,fetchFn:n}){return{refresh_token:a,...await mp(t,{metadata:r,tokenRequestParams:new URLSearchParams({grant_type:"refresh_token",refresh_token:a}),clientInformation:o,addClientAuthentication:s,resource:i,fetchFn:n})}}async function mf(t,r,{metadata:o,resource:a,authorizationCode:i,iss:s,scope:n,fetchFn:l}={}){let c;void 0!==i&&f9({iss:s,expectedIssuer:o?.issuer,issParameterSupported:f2(o)});let u=n??t.clientMetadata.scope;if(t.prepareTokenRequest&&(c=await t.prepareTokenRequest(u)),!c){if(!i)throw Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!t.redirectUrl)throw Error("redirectUrl is required for authorization_code flow");c=new URLSearchParams({grant_type:"authorization_code",code:i,code_verifier:await t.codeVerifier(),redirect_uri:String(t.redirectUrl)})}let d=await t.clientInformation({issuer:o?.issuer??String(r)});return mp(r,{metadata:o,tokenRequestParams:c,clientInformation:d??void 0,addClientAuthentication:t.addClientAuthentication,resource:a,fetchFn:l})}async function mm(t,{metadata:r,clientMetadata:o,scope:a,fetchFn:i}){let s;if(r){if(!r.registration_endpoint)throw Error("Incompatible auth server: does not support dynamic client registration");s=new URL(r.registration_endpoint)}else s=new URL("/register",t);let n={...o,...void 0===a?{}:{scope:a}},l=await (i??fetch)(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!l.ok)throw new fG({status:l.status,body:await l.text(),submittedMetadata:n});return lK.parse(await l.json())}let my=new Set(["tools/list","prompts/list","resources/list","resources/templates/list","server/discover"]);var mg=class{_entries=new Map;_maxEntries;_stamp=0;_cappedSize=0;constructor(t){this._maxEntries=t?.maxEntries??512}get size(){return this._entries.size}get(t){return this._entries.get(mv(t))}set(t,r){let o=mv(t),a=my.has(t.method),i=!this._entries.has(o);if(!a&&i&&this._maxEntries>0&&this._cappedSize>=this._maxEntries){for(let t of this._entries.keys())if(!my.has(t.slice(0,t.indexOf("\0")))){this._entries.delete(t),this._cappedSize--;break}}let s=++this._stamp;return this._entries.set(o,{...r,stamp:s}),i&&!a&&this._cappedSize++,s}delete(t){this._entries.delete(mv(t))&&!my.has(t.method)&&this._cappedSize--}evict(t){let r=`${t}\0`,o=my.has(t);for(let t of this._entries.keys())t.startsWith(r)&&(this._entries.delete(t),!o&&this._cappedSize--)}clear(){this._entries.clear(),this._cappedSize=0}};function mv(t){return`${t.method}\0${JSON.stringify([t.partition??"",t.params??""])}`}function mb(t,r){return void 0===r?t:`${t}\0${r}`}var m_=class{_evictionGeneration=new Map;_toolIndex;_toolOutputValidatorIndex;_serverIdentity="";constructor(t,r,o=()=>{},a="",i=Date.now){this._store=t,this._isUserSupplied=r,this._reportError=o,this._cachePartition=a,this._now=i}now(){return this._now()}setServerIdentity(t){this._serverIdentity=t}_partitionFor(t){return JSON.stringify([this._serverIdentity,"public"===t?"":this._cachePartition])}async _probe(t,r){let o={method:t,params:r??""},a=this._partitionFor("private"),i=await this._store.get({...o,partition:a});if(void 0!==i)return i;let s=this._partitionFor("public");if(s===a)return;let n=await this._store.get({...o,partition:s});return n?.scope==="public"?n:void 0}async evict(t){this._evictionGeneration.set(t,(this._evictionGeneration.get(t)??0)+1),await this._deleteBoth(t,"")}async _deleteBoth(t,r){let o=this._partitionFor("private"),a=this._partitionFor("public");try{await this._store.delete({method:t,params:r,partition:o})}catch(t){this._reportError(t)}if(a!==o)try{await this._store.delete({method:t,params:r,partition:a})}catch(t){this._reportError(t)}}async evictKey(t,r){let o=mb(t,r),a=this._evictionGeneration.get(o);void 0!==a&&this._evictionGeneration.set(o,a+1),await this._deleteBoth(t,r)}captureGeneration(t,r){let o=mb(t,r),a=this._evictionGeneration.get(o)??0;return this._evictionGeneration.set(o,a),a}async write(t,r,o,a){if((this._evictionGeneration.get(mb(t,a?.params))??0)!==o)return;let i=a?.params??"",s=this._partitionFor("private"),n=this._partitionFor("public"),l=(a?.scope??"private")==="public"?n:s;try{await this._store.set({method:t,params:i,partition:l},{value:function(t){let r;try{r=JSON.stringify(t)}catch(t){throw TypeError(`cache value is not JSON-serializable: ${t instanceof Error?t.message:String(t)}`)}if("string"!=typeof r)throw TypeError("cache value is not JSON-serializable: it has no JSON representation");return r}(r),expiresAt:a?.expiresAt,scope:a?.scope})}catch(t){this._reportError(t)}if(n!==s)try{await this._store.delete({method:t,params:i,partition:l===s?n:s})}catch(t){this._reportError(t)}}async read(t,r){let o=await this._probe(t,r);if(o?.expiresAt!==void 0&&o.expiresAt>this.now())try{let t=JSON.parse(o.value);if("object"!=typeof t||null===t||Array.isArray(t))throw TypeError("cached document is not an object");return{value:t}}catch(o){this._reportError(o),await this._deleteBoth(t,r??"");return}}resetForReconnect(){this._isUserSupplied||this._store.clear(),this._evictionGeneration.clear(),this._toolIndex=void 0,this._toolOutputValidatorIndex=void 0,this._serverIdentity=""}async toolDefinition(t){let r=await this._probe("tools/list");if(void 0===r){this._toolIndex=void 0;return}if(this._toolIndex?.stamp!==r.stamp){let t=this._decodeListTools(r),o=new Map;if(void 0!==t)for(let r of t.tools)o.set(r.name,r);this._toolIndex={stamp:r.stamp,byName:o}}return this._toolIndex.byName.get(t)}async outputValidator(t,r){let o=await this._probe("tools/list");if(void 0===o){this._toolOutputValidatorIndex=void 0;return}if(this._toolOutputValidatorIndex?.stamp!==o.stamp){let t=this._decodeListTools(o)??{tools:[]},a=new Map;for(let o of t.tools){let t=r(o);void 0!==t&&a.set(o.name,t)}this._toolOutputValidatorIndex={stamp:o.stamp,byName:a}}return this._toolOutputValidatorIndex.byName.get(t)}_decodeListTools(t){try{let r=JSON.parse(t.value);if(!Array.isArray(r?.tools)||!r.tools.every(t=>null!==t&&"object"==typeof t))throw TypeError("cached tools/list document has a malformed tools array");return r}catch(t){this._reportError(t);return}}};let mS=Symbol.for("mcp.authSeamEscape");function m$(t){if("object"==typeof t&&null!==t||"function"==typeof t)try{Object.defineProperty(t,mS,{value:!0,configurable:!0})}catch{}return t}let mw=new Set([-32001,-32020,-32021]);function mE(t,r){let{code:o,message:a,data:i}=t;if(-32022===o){let t=function(t){if("object"!=typeof t||null===t)return;let r=t.supported;if(Array.isArray(r)&&0!==r.length&&r.every(t=>"string"==typeof t))return r}(i);if(void 0===t)return{kind:"legacy"};let o=new d0({supported:t,requested:function(t){if("object"!=typeof t||null===t)return;let r=t.requested;return"string"==typeof r?r:void 0}(i)??r.requestedVersion},a),s=dR(t),n=r.clientModernVersions.find(t=>s.includes(t));return void 0!==n?{kind:"corrective",version:n,error:o}:s.length>0?{kind:"error",error:o}:r.fallbackAvailable?{kind:"legacy"}:{kind:"error",error:o}}return mw.has(o),{kind:"legacy"}}function mR(t,r){var o,a;return"browser"===r.environment&&((o=t)instanceof TypeError||o instanceof Error&&"TypeError"===o.name)?{kind:"legacy"}:{kind:"error",error:new d_(db.EraNegotiationFailed,`Version negotiation probe failed: ${(a=t)instanceof Error?a.message:String(a)}`,{cause:t})}}function mP(){let t=globalThis;return void 0!==t.window&&void 0!==t.document?"browser":"node"}function mk(t){return"stderr"in t&&"pid"in t?"stdio":"http"}var mO=class t{_pending;_probeCounter=0;_savedOnMessage;_savedOnError;_savedOnClose;_closeDelivered=!1;constructor(t){this._transport=t,this._savedOnMessage=t.onmessage,this._savedOnError=t.onerror,this._savedOnClose=t.onclose}static async open(r){let o=new t(r);r.onmessage=t=>{let r=o._pending;if(void 0!==r&&(ph(t)||pf(t))&&t.id===r.id){o._pending=void 0,ph(t)?r.resolve({kind:"response",result:t.result}):r.resolve({kind:"response",error:t.error});return}},r.onerror=t=>{o._savedOnError?.(t)},r.onclose=()=>{let t=o._pending;void 0!==t&&(o._pending=void 0,t.resolve({kind:"closed"})),o._closeDelivered=!0,o._savedOnClose?.()};try{await r.start()}catch(t){throw o.detach(),t}return o}async exchange(t,r){let o=`server-discover-probe-${++this._probeCounter}`;return new Promise(a=>{let i=!1,s=t=>{i||(i=!0,clearTimeout(n),this._pending?.id===o&&(this._pending=void 0),a(t))},n=setTimeout(()=>s({kind:"timeout"}),r);this._pending={id:o,resolve:s},this._transport.send(t(o)).catch(t=>s({kind:"send-error",error:t}))})}detach(){if(this._pending=void 0,this._transport.onmessage=this._savedOnMessage,this._transport.onerror=this._savedOnError,this._closeDelivered&&void 0!==this._savedOnClose){let t=this._savedOnClose,r=this._transport,o=!1,a=()=>{if(!o){o=!0;return}t()};r.onclose=a,mT.set(r,()=>{r.onclose===a&&(r.onclose=t)})}else this._transport.onclose=this._savedOnClose}release(){this.detach();let t=this._transport,r=t.start,o=!0;t.start=async function(){if(o){o=!1,t.start=r;return}return r.call(t)}}};let mT=new WeakMap;function mx(t){let r=mT.get(t);mT.delete(t),r?.()}async function mj(t,r){let o,a=t.probe.timeoutMs??r.defaultTimeoutMs,i=Math.max(0,t.probe.maxRetries??0),s="pin"===t.kind?[t.version]:t.modernVersions,n="auto"===t.kind&&t.fallbackAvailable,l=await mO.open(r.transport),c=async()=>{let o=s[0],c=!1,u=i;for(;;){let i=await l.exchange(t=>{var a,i,s;return a=o,i=r.clientInfo,s=r.capabilities,{jsonrpc:"2.0",id:t,method:"server/discover",params:{_meta:pn(a).outboundEnvelope({protocolVersion:a,clientInfo:i,clientCapabilities:s})}}},a);if("timeout"===i.kind&&u>0){u--;continue}let d=function(t,r){switch(t.kind){case"response":return void 0===t.error?{kind:"result",result:t.result}:{kind:"rpc-error",...t.error};case"send-error":{let r=t.error;if(("object"==typeof r&&null!==r||"function"==typeof r)&&!0===r[mS]||r instanceof f1||r instanceof Error&&"UnauthorizedError"===r.name)return{kind:"auth-required",error:r};if(r instanceof dS){let t=r.data?.text;return{kind:"http-error",status:r.data.status,body:"string"==typeof t?t:void 0,statusText:r.data.statusText}}return{kind:"network-error",error:r}}case"closed":return{kind:"closed"};case"timeout":return{kind:"timeout",timeoutMs:r}}}(i,a),p=function(t,r){switch(t.kind){case"result":return function(t,r){let o=pn(ps).validateResult("server/discover",t);if(!o.ok)return{kind:"legacy"};let a=o.value.supportedVersions,i=r.clientModernVersions.find(t=>a.includes(t));return void 0!==i?{kind:"modern",version:i,discover:o.value}:r.fallbackAvailable?{kind:"legacy"}:{kind:"error",error:new d0({supported:[...a],requested:r.requestedVersion})}}(t.result,r);case"rpc-error":return mE(t,r);case"http-error":return function(t,r){if(401===t.status||403===t.status){let r=403===t.status;return{kind:"error",error:new dS(r?db.ClientHttpForbidden:db.ClientHttpAuthentication,`Version negotiation failed: ${r?"the server denied access (HTTP 403)":"the server requires authorization (HTTP 401)"}`,{status:t.status,statusText:t.statusText,text:t.body})}}if(t.status>=500)return{kind:"error",error:new dS(db.EraNegotiationFailed,`Version negotiation failed: the server answered the probe with HTTP ${t.status}`,{status:t.status,statusText:t.statusText,text:t.body})};let o=function(t){let r;if(void 0===t||""===t)return;try{r=JSON.parse(t)}catch{return}if("object"!=typeof r||null===r)return;let o=r.error;if("object"!=typeof o||null===o)return;let{code:a,message:i,data:s}=o;if("number"==typeof a)return{code:a,message:"string"==typeof i?i:"",data:s}}(t.body);return void 0!==o?mE(o,r):{kind:"legacy"}}(t,r);case"network-error":return mR(t.error,r);case"auth-required":return{kind:"error",error:t.error};case"closed":if("stdio"===r.transportKind)return{kind:"legacy"};return mR(Error("Connection closed during the version negotiation probe"),r);case"timeout":if("stdio"===r.transportKind)return{kind:"legacy"};return{kind:"error",error:new d_(db.RequestTimeout,`Version negotiation probe timed out after ${t.timeoutMs}ms`,{timeout:t.timeoutMs})}}}(d,{clientModernVersions:s,requestedVersion:o,fallbackAvailable:n,environment:r.environment,transportKind:r.transportKind});switch(p.kind){case"modern":return{era:"modern",version:p.version,discover:p.discover};case"corrective":if(c)throw p.error;c=!0,o=p.version;continue;case"legacy":{let o="closed"===d.kind?"the connection closed during the server/discover probe":void 0;if("pin"===t.kind)throw new d_(db.EraNegotiationFailed,void 0===o?`Version negotiation failed: the server did not offer pinned protocol version ${t.version} via server/discover (no fallback in pin mode)`:`Version negotiation failed: ${o} before the server offered pinned protocol version ${t.version} (no fallback in pin mode)`);if(!t.fallbackAvailable)throw new d_(db.EraNegotiationFailed,void 0===o?"Version negotiation failed: the server gave no modern evidence and this client supports no pre-2026-07-28 protocol version to fall back to":`Version negotiation failed: ${o} and this client supports no pre-2026-07-28 protocol version to fall back to`);if(void 0!==o&&!0!==r.disposableProbe)throw new d_(db.EraNegotiationFailed,`Version negotiation failed: ${o} (this transport probed in place — the disposable sibling probe requires the SDK's base StdioClientTransport)`);return{era:"legacy"}}case"error":throw p.error}}};try{o=await c()}catch(t){throw l.detach(),t}return l.release(),o}async function mC(t,r,o,a){let i,s,n=new r.constructor({...o,stderr:"ignore"}),l=r.close,c=!1,u=new Promise((t,r)=>{i=()=>r(mN())});r.close=async function(){return c=!0,i?.(),l.call(r)};try{let r=mj(t,{...a,transport:n,transportKind:"stdio",disposableProbe:!0});r.catch(()=>{}),s=await Promise.race([r,u])}finally{await mI(n),r.close=l}if(c)throw mN();return s}function mN(){return new d_(db.EraNegotiationFailed,"Version negotiation failed: the transport was closed during the server/discover probe")}async function mI(t){try{let r=t._dispose;await ("function"==typeof r?r.call(t):t.close())}catch{}}function mA(t){let r=t._meta?.[i2];return pU.Implementation(r)?r:void 0}let mM={"notifications/tools/list_changed":["tools/list"],"notifications/prompts/list_changed":["prompts/list"],"notifications/resources/list_changed":["resources/list","resources/templates/list"]};var mq=class extends pB{_serverCapabilities;_serverVersion;_capabilities;_instructions;_jsonSchemaValidator;_cache;_defaultCacheTtlMs;_listMaxPages;_listChangedDebounceTimers=new Map;_listChangedConfig;_enforceStrictCapabilities;_versionNegotiation;_supportedProtocolVersionsOption;_inputRequiredDriverConfig;_listenState=new Map;_nextListenId=0;_autoOpenedSubscription;_discoverResult;_resetConnectionState(){if(this._negotiatedProtocolVersion=void 0,this._serverCapabilities=void 0,this._serverVersion=void 0,this._instructions=void 0,this._discoverResult=void 0,this._autoOpenedSubscription=void 0,this._listenState.size>0){let t=new d_(db.ConnectionClosed,"subscriptions/listen: client reconnected or closed; subscription state from the previous connection was reset");for(let r of this._listenState.values())r.settle({cause:"remote",error:t})}for(let t of(this._listenState.clear(),this._listChangedDebounceTimers.values()))clearTimeout(t);this._listChangedDebounceTimers.clear(),this._cache.resetForReconnect()}async close(){try{await super.close()}finally{this._resetConnectionState()}}constructor(t,r){super(r),this._clientInfo=t,this._capabilities=r?.capabilities?{...r.capabilities}:{},this._jsonSchemaValidator=r?.jsonSchemaValidator??new fA,this._enforceStrictCapabilities=r?.enforceStrictCapabilities??!1,this._versionNegotiation=r?.versionNegotiation,this._supportedProtocolVersionsOption=r?.supportedProtocolVersions,this._inputRequiredDriverConfig=function(t){return{autoFulfill:t?.autoFulfill??!0,maxRounds:t?.maxRounds??10}}(r?.inputRequired),this._cache=new m_(r?.responseCacheStore??new mg,r?.responseCacheStore!==void 0,t=>this._reportStoreError(t),r?.cachePartition??""),this._defaultCacheTtlMs=r?.defaultCacheTtlMs??0,this._listMaxPages=r?.listMaxPages??64,r?.listChanged&&(this._listChangedConfig=r.listChanged)}buildContext(t,r){return t}_shouldDropInbound(t){if(void 0!==this._negotiatedProtocolVersion&&this._negotiatedProtocolVersion>=d$&&sp.safeParse(t).success)return"drop"}_outboundMetaEnvelope(){let t=this._negotiatedProtocolVersion;if(void 0!==t)return this._wireCodec().outboundEnvelope({protocolVersion:t,clientInfo:this._clientInfo,clientCapabilities:this._capabilities})}_resolveNonCompleteResult(t,r){return this._inputRequiredDriverConfig.autoFulfill?function(t,r,o,a){let{codec:i,request:s,options:n,flowStartedAt:l}=a,c={inputRequests:o.inputRequests,...void 0!==o.requestState&&{requestState:o.requestState}};return pq({config:r,method:s.method,originalParams:s.params,firstPayload:c,flowStartedAt:l,signal:n?.signal,requestOptions:{...n?.timeout!==void 0&&{timeout:n.timeout},...n?.maxTotalTimeout!==void 0&&{maxTotalTimeout:n.maxTotalTimeout},...n?.onprogress!==void 0&&{onprogress:n.onprogress}},hooks:{dispatchInputRequest:(r,o,a)=>pX(t,i,r,o,a),retry:(t,r)=>a.retry(t,{...n?.signal!==void 0&&{signal:n.signal},...n?.onprogress!==void 0&&{onprogress:n.onprogress},...n?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:n.resetTimeoutOnProgress},...n?.headers!==void 0&&{headers:n.headers},...void 0!==r.timeout&&{timeout:r.timeout},...void 0!==r.maxTotalTimeout&&{maxTotalTimeout:r.maxTotalTimeout},allowInputRequired:!0})}})}({getRequestHandler:t=>this._getRequestHandler(t),buildContext:t=>this.buildContext(t,void 0),sessionId:this.transport?.sessionId},this._inputRequiredDriverConfig,t,r):Promise.reject(new d_(db.UnsupportedResultType,`Unsupported result type 'input_required' for ${r.request.method}: multi-round-trip auto-fulfilment is not enabled on this instance — pass allowInputRequired: true to handle it manually, or enable inputRequired.autoFulfill`,{resultType:"input_required",method:r.request.method}))}_setupListChangedHandlers(t){t.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools","notifications/tools/list_changed",t.tools,async()=>(await this.listTools(void 0,{cacheMode:"refresh"})).tools),t.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts","notifications/prompts/list_changed",t.prompts,async()=>(await this.listPrompts(void 0,{cacheMode:"refresh"})).prompts),t.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources","notifications/resources/list_changed",t.resources,async()=>(await this.listResources(void 0,{cacheMode:"refresh"})).resources)}registerCapabilities(t){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=function(t,r){let o={...t};for(let t in r){let a=r[t];if(void 0===a)continue;let i=o[t];o[t]=pG(i)&&pG(a)?{...i,...a}:a}return o}(this._capabilities,t)}setVersionNegotiation(t){if(this.transport)throw Error("Cannot configure version negotiation after connecting to transport");this._versionNegotiation=t}_wrapHandler(t,r){return"elicitation/create"===t?async(t,o)=>{let a=pn(this._negotiatedProtocolVersion),i=a.validateRequest("elicitation/create",t);if(i.ok||"not-in-era"!==i.reason||(i=a.validateInputRequest("elicitation/create",t)),!i.ok)throw new dX("not-in-era"===i.reason?dW.InternalError:dW.InvalidParams,"not-in-era"===i.reason?"No wire schema for elicitation/create in the resolved era":`Invalid elicitation request: ${i.message}`);let{params:s}=i.value;s.mode=s.mode??"form";let{supportsFormMode:n,supportsUrlMode:l}=function(t){if(!t)return{supportsFormMode:!1,supportsUrlMode:!1};let r=void 0!==t.form,o=void 0!==t.url;return{supportsFormMode:r||!r&&!o,supportsUrlMode:o}}(this._capabilities.elicitation);if("form"===s.mode&&!n)throw new dX(dW.InvalidParams,"Client does not support form-mode elicitation requests");if("url"===s.mode&&!l)throw new dX(dW.InvalidParams,"Client does not support URL-mode elicitation requests");let c=await r(t,o),u=a.validateResult("elicitation/create",c);if(u.ok||"not-in-era"!==u.reason||(u=a.validateInputResponse("elicitation/create",c)),!u.ok)throw new dX("not-in-era"===u.reason?dW.InternalError:dW.InvalidParams,"not-in-era"===u.reason?"No wire schema for elicitation/create in the resolved era":`Invalid elicitation result: ${u.message}`);let d=u.value,p="form"===s.mode?s.requestedSchema:void 0;if("form"===s.mode&&"accept"===d.action&&d.content&&p&&this._capabilities.elicitation?.form?.applyDefaults)try{!function t(r,o){if(r&&null!==o&&"object"==typeof o){if("object"===r.type&&r.properties&&"object"==typeof r.properties){let a=r.properties;for(let r of Object.keys(a)){let i=a[r];void 0===o[r]&&Object.prototype.hasOwnProperty.call(i,"default")&&(o[r]=i.default),void 0!==o[r]&&t(i,o[r])}}if(Array.isArray(r.anyOf))for(let a of r.anyOf)"boolean"!=typeof a&&t(a,o);if(Array.isArray(r.oneOf))for(let a of r.oneOf)"boolean"!=typeof a&&t(a,o)}}(p,d.content)}catch{}return d}:"sampling/createMessage"===t?async(t,o)=>{let a=pn(this._negotiatedProtocolVersion),i=a.validateRequest("sampling/createMessage",t);if(i.ok||"not-in-era"!==i.reason||(i=a.validateInputRequest("sampling/createMessage",t)),!i.ok)throw new dX("not-in-era"===i.reason?dW.InternalError:dW.InvalidParams,"not-in-era"===i.reason?"No wire schema for sampling/createMessage in the resolved era":`Invalid sampling request: ${i.message}`);let{params:s}=i.value,n=await r(t,o),l=!!(s.tools||s.toolChoice),c=a.samplingResultVariant(l,n);if(c.ok||"not-in-era"!==c.reason||(c=a.validateInputResponse("sampling/createMessage",n)),!c.ok)throw new dX("not-in-era"===c.reason?dW.InternalError:dW.InvalidParams,"not-in-era"===c.reason?"No result schema for sampling/createMessage in the resolved era":`Invalid sampling result: ${c.message}`);return c.value}:r}assertCapability(t,r){if(!this._serverCapabilities?.[t])throw new d_(db.CapabilityNotSupported,`Server does not support ${t} (required for ${r})`)}async connect(t,r){if(r?.prior!=null)return this._connectFromPrior(t,function(t){if("object"==typeof t&&null!==t&&("legacy"===t.kind&&!("supportedVersions"in t)&&!("discover"in t)||"modern"===t.kind&&sM.safeParse(t.discover).success))return t;throw new d_(db.EraNegotiationFailed,"connect({ prior }): unrecognized prior — expected { kind: 'modern', discover } or { kind: 'legacy' }")}(r.prior),r);let o=function(t,r){let o=t?.mode??"legacy";if("legacy"===o)return{kind:"legacy"};let a=t?.probe??{};if("object"==typeof o){if(!(o.pin>=d$))throw TypeError(`versionNegotiation: { pin: '${o.pin}' } is not a modern protocol revision — pinning is for 2026-07-28 and later; omit versionNegotiation (or use mode: 'legacy') for 2025-era servers.`);return{kind:"pin",version:o.pin,probe:a}}let i=r?dR(r):[];return{kind:"auto",modernVersions:i.length>0?i:[...dw],fallbackAvailable:!r||dE(r).length>0,probe:a}}(this._versionNegotiation,this._supportedProtocolVersionsOption);return"legacy"!==o.kind?this._connectNegotiated(t,o,r):this._connectPlainLegacy(t,r)}async _connectPlainLegacy(t,r){if(await super.connect(t),void 0!==t.sessionId){let r=this._negotiatedProtocolVersion;void 0!==r&&t.setProtocolVersion?.(r);return}this._resetConnectionState(),await this._legacyHandshake(t,r)}async _legacyHandshake(t,r){let o=dE(this._supportedProtocolVersions);try{let a=o[0];if(void 0===a)throw new d_(db.EraNegotiationFailed,"Cannot run the initialize handshake: supportedProtocolVersions contains no pre-2026-07-28 protocol version");let i=await this.request({method:"initialize",params:{protocolVersion:a,capabilities:this._capabilities,clientInfo:this._clientInfo}},r);if(void 0===i)throw Error(`Server sent invalid initialize result: ${i}`);if(!o.includes(i.protocolVersion))throw Error(`Server's protocol version is not supported: ${i.protocolVersion}`);this._serverCapabilities=i.capabilities,this._serverVersion=i.serverInfo,this._cache.setServerIdentity(this._deriveServerIdentity(t)),t.setProtocolVersion&&t.setProtocolVersion(i.protocolVersion),this._instructions=i.instructions,await this.notification({method:"notifications/initialized"}),this._negotiatedProtocolVersion=i.protocolVersion,this._listChangedConfig&&this._setupListChangedHandlers(this._listChangedConfig)}catch(t){throw this.close(),t}}async _connectNegotiated(t,r,o){let a;if(void 0!==t.sessionId){await super.connect(t);let r=this._negotiatedProtocolVersion;void 0!==r&&t.setProtocolVersion&&t.setProtocolVersion(r);return}this._resetConnectionState();try{let i=mk(t),s={clientInfo:this._clientInfo,capabilities:this._capabilities,environment:mP(),defaultTimeoutMs:o?.timeout??6e4},n="stdio"===i?function(t){let r=Object.getPrototypeOf(t);if(null===r||!Object.prototype.hasOwnProperty.call(r,"_dispose"))return;let o=t._serverParams;return"object"==typeof o&&null!==o&&"string"==typeof o.command?o:void 0}(t):void 0;a=void 0===n?await mj(r,{...s,transport:t,transportKind:i}):await mC(r,t,n,s)}catch(r){throw await t.close().catch(()=>{}),mx(t),r}if(mx(t),await super.connect(t),"legacy"===a.era)return void await this._legacyHandshake(t,o);if(this._serverCapabilities=a.discover.capabilities,this._serverVersion=mA(a.discover),this._cache.setServerIdentity(this._deriveServerIdentity(t)),this._instructions=a.discover.instructions,this._discoverResult=a.discover,this._negotiatedProtocolVersion=a.version,t.setProtocolVersion&&t.setProtocolVersion(a.version),this._listChangedConfig){let t=this._listChangedConfig,r=this._serverCapabilities,a={...t.tools&&r?.tools?.listChanged&&{tools:t.tools},...t.prompts&&r?.prompts?.listChanged&&{prompts:t.prompts},...t.resources&&r?.resources?.listChanged&&{resources:t.resources}},i=!0;try{this._setupListChangedHandlers(a)}catch(t){i=!1,this.onerror?.(t instanceof Error?t:Error(String(t)))}let s=i?{...a.tools&&{toolsListChanged:!0},...a.prompts&&{promptsListChanged:!0},...a.resources&&{resourcesListChanged:!0}}:{};if(Object.keys(s).length>0){let t=new AbortController,r=()=>t.abort(o?.signal?.reason);o?.signal?.aborted&&r(),o?.signal?.addEventListener("abort",r);try{this._autoOpenedSubscription=await this.listen(s,{timeout:o?.timeout,signal:t.signal})}catch(t){if(o?.signal?.aborted)throw await this.close().catch(()=>{}),t;this.onerror?.(t instanceof Error?t:Error(String(t)))}finally{o?.signal?.removeEventListener("abort",r)}}}}async _connectFromPrior(t,r,o){if("legacy"===r.kind)return this._connectPlainLegacy(t,o);let a=r.discover;this._resetConnectionState();let i=this._supportedProtocolVersionsOption,s=(i&&dR(i).length>0?dR(i):dw).find(t=>a.supportedVersions.includes(t));if(void 0===s)throw new d_(db.EraNegotiationFailed,"connect({ prior }) with a modern verdict requires a 2026-07-28+ mutual protocol version; the supplied DiscoverResult and this client's supportedProtocolVersions have no modern overlap. For a server known to be legacy, pass prior: { kind: 'legacy' } to skip the probe and initialize directly, or use versionNegotiation: { mode: 'auto' } to re-probe with legacy fallback.");if(await super.connect(t),this._discoverResult=a,this._serverCapabilities=a.capabilities,this._serverVersion=mA(a),this._cache.setServerIdentity(this._deriveServerIdentity(t)),this._instructions=a.instructions,this._negotiatedProtocolVersion=s,t.setProtocolVersion?.(s),this._listChangedConfig)try{this._setupListChangedHandlers(this._listChangedConfig)}catch(t){this.onerror?.(t instanceof Error?t:Error(String(t)))}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}_deriveServerIdentity(t){let r=this._serverVersion;return void 0!==r?`${r.name}@${r.version}`:t.sessionId??`anonymous:${Date.now()}-${Math.random().toString(36).slice(2)}`}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}getProtocolEra(){let t=this._negotiatedProtocolVersion;if(void 0!==t)return t>=d$?"modern":"legacy"}getInstructions(){return this._instructions}getDiscoverResult(){return this._discoverResult}assertCapabilityForMethod(t){switch(t){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new d_(db.CapabilityNotSupported,`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new d_(db.CapabilityNotSupported,`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new d_(db.CapabilityNotSupported,`Server does not support resources (required for ${t})`);if("resources/subscribe"===t&&!this._serverCapabilities.resources.subscribe)throw new d_(db.CapabilityNotSupported,`Server does not support resource subscriptions (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new d_(db.CapabilityNotSupported,`Server does not support tools (required for ${t})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new d_(db.CapabilityNotSupported,`Server does not support completions (required for ${t})`)}}assertNotificationCapability(t){if("notifications/roots/list_changed"===t&&!this._capabilities.roots?.listChanged)throw new d_(db.CapabilityNotSupported,`Client does not support roots list changed notifications (required for ${t})`)}assertRequestHandlerCapability(t){switch(t){case"sampling/createMessage":if(!this._capabilities.sampling)throw new d_(db.CapabilityNotSupported,`Client does not support sampling capability (required for ${t})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new d_(db.CapabilityNotSupported,`Client does not support elicitation capability (required for ${t})`);break;case"roots/list":if(!this._capabilities.roots)throw new d_(db.CapabilityNotSupported,`Client does not support roots capability (required for ${t})`)}}async ping(t){return this.request({method:"ping"},t)}async discover(t){let r=await this._requestWithSchema({method:"server/discover"},sM,t);return this._discoverResult=r,r}async complete(t,r){return this.request({method:"completion/complete",params:t},r)}async setLoggingLevel(t,r){return this.request({method:"logging/setLevel",params:{level:t}},r)}async getPrompt(t,r){return this.request({method:"prompts/get",params:t},r)}async listPrompts(t,r){if(!this._serverCapabilities?.prompts&&!this._enforceStrictCapabilities)return console.debug("Client.listPrompts() called but server does not advertise prompts capability - returning empty list"),{prompts:[]};if(t?.cursor!==void 0)return this.request({method:"prompts/list",params:t},r);let o=await this._serveFromCache("prompts/list",void 0,r);return void 0!==o?o:this._listAllPages("prompts/list",t,r,(t,r)=>t.prompts.push(...r.prompts))}async listResources(t,r){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug("Client.listResources() called but server does not advertise resources capability - returning empty list"),{resources:[]};if(t?.cursor!==void 0)return this.request({method:"resources/list",params:t},r);let o=await this._serveFromCache("resources/list",void 0,r);return void 0!==o?o:this._listAllPages("resources/list",t,r,(t,r)=>t.resources.push(...r.resources))}async listResourceTemplates(t,r){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug("Client.listResourceTemplates() called but server does not advertise resources capability - returning empty list"),{resourceTemplates:[]};if(t?.cursor!==void 0)return this.request({method:"resources/templates/list",params:t},r);let o=await this._serveFromCache("resources/templates/list",void 0,r);return void 0!==o?o:this._listAllPages("resources/templates/list",t,r,(t,r)=>t.resourceTemplates.push(...r.resourceTemplates))}async _listAllPages(t,r,o,a,i){let s=o?.cacheMode==="bypass",n=this._cache.captureGeneration(t),l=await this.request({method:t,...r&&{params:{...r}}},o),c=l.nextCursor,u=new Set,d=1;for(;void 0!==c&&!u.has(c);){if(0!==this._listMaxPages&&d>=this._listMaxPages)throw new d_(db.ListPaginationExceeded,`${t}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`,{method:t,listMaxPages:this._listMaxPages});u.add(c);let i=await this.request({method:t,params:{...r,cursor:c}},o);a(l,i),c=i.nextCursor,d++}return delete l.nextCursor,i?.(l),s||await this._cache.write(t,l,n,this._freshness(l)),l}_freshness(t,r){let o="number"==typeof t.ttlMs?t.ttlMs:this._defaultCacheTtlMs,a="public"===t.cacheScope?"public":"private";return{expiresAt:this._cache.now()+Math.min(Math.max(0,o),864e5),scope:a,params:r}}async _serveFromCache(t,r,o){if(o?.cacheMode==="bypass"||o?.cacheMode==="refresh")return;let a=await this._cache.read(t,r).catch(t=>void this._reportStoreError(t));if(void 0!==a){if(o?.signal?.aborted){let t=o.signal.reason;throw t instanceof d_?t:new d_(db.RequestTimeout,String(t))}return a.value}}_reportStoreError(t){this.onerror?.(t instanceof Error?t:Error(String(t)))}_compileOutputValidator(t){if(t.outputSchema)try{return{ok:!0,validator:this._jsonSchemaValidator.getValidator(t.outputSchema)}}catch(t){return{ok:!1,compileError:t}}}async _resolveXMcpHeaderScan(t,r){let o=r??await this._cache.toolDefinition(t);return void 0===o?void 0:pb(o.inputSchema)}async readResource(t,r){let o=await this._serveFromCache("resources/read",t.uri,r);if(void 0!==o)return o;let a=this._cache.captureGeneration("resources/read",t.uri),i=await this.request({method:"resources/read",params:t},r);if(r?.cacheMode!=="bypass"){let o=this._freshness(i,t.uri);o.expiresAt>this._cache.now()?await this._cache.write("resources/read",i,a,o):r?.cacheMode==="refresh"&&await this._cache.evictKey("resources/read",t.uri)}return i}async subscribeResource(t,r){return this.request({method:"resources/subscribe",params:t},r)}async unsubscribeResource(t,r){return this.request({method:"resources/unsubscribe",params:t},r)}async listen(t,r){let o,a,i,s,n;if(void 0===this.transport)throw new d_(db.NotConnected,"Not connected");let l=this._negotiatedProtocolVersion;if(void 0===l||!(l>=d$))throw new d_(db.MethodNotSupportedByProtocolVersion,`subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${l??"none"}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`,{method:"subscriptions/listen",protocolVersion:l});if(r?.signal?.aborted){let t=r.signal.reason;throw t instanceof d_?t:new d_(db.RequestTimeout,String(t))}let c=new AbortController,u=`listen:${this._nextListenId++}`,d="opening",p=new Promise((t,r)=>{i=t,s=r}),h=new Promise(t=>{n=t}),f=t=>{if("closed"===d)return;let l="opening"===d;if(void 0!==o&&(clearTimeout(o),o=void 0),"ack"in t){d="open",i(t.ack);return}d="closed",void 0!==a&&r?.signal?.removeEventListener("abort",a),this._listenState.delete(u),c.abort(),n(t.cause),l&&s(t.error??new d_(db.ConnectionClosed,"subscriptions/listen closed before the server acknowledged"))},m=async()=>{c.abort(),await this.notification({method:"notifications/cancelled",params:{requestId:u}}).catch(()=>{})},y=async()=>{"closed"!==d&&(f({cause:"local"}),await m())};this._listenState.set(u,{settle:f});let g=r?.timeout??6e4;if(o=setTimeout(()=>{f({cause:"remote",error:new d_(db.RequestTimeout,"subscriptions/listen ack timed out",{timeout:g})}),m().catch(()=>{})},g),r?.signal){let t=r.signal;a=()=>{if("closed"===d)return;let r=t.reason;f({cause:"local",error:r instanceof Error?r:Error(String(r??"Aborted"))}),m().catch(()=>{})},t.addEventListener("abort",a,{once:!0})}let v={jsonrpc:"2.0",id:u,method:"subscriptions/listen",params:{_meta:{...this._outboundMetaEnvelope()},notifications:t}};try{await this.transport.send(v,{requestSignal:c.signal,onRequestStreamEnd:()=>f({cause:"remote",error:Error("subscriptions/listen: stream ended")})})}catch(t){f({cause:"remote",error:t instanceof Error?t:Error(String(t))})}return{honoredFilter:await p,close:y,closed:h}}get autoOpenedSubscription(){return this._autoOpenedSubscription}_onnotification(t,r){let o=Object.hasOwn(mM,t.method)?mM[t.method]:void 0;if("notifications/resources/updated"===t.method){let r=t.params?.uri;"string"==typeof r&&this._cache.evictKey("resources/read",r)}else if(void 0!==o)for(let t of o)this._cache.evict(t);if("notifications/subscriptions/acknowledged"===t.method){let r=t.params?._meta?.[i4],o="string"==typeof r?this._listenState.get(r):void 0;if(void 0!==o){let r=this._wireCodec().validateNotification("notifications/subscriptions/acknowledged",t);o.settle({ack:r.ok?r.value.params.notifications:{}});return}}if("notifications/cancelled"===t.method){let r=t.params?.requestId,o="string"==typeof r?this._listenState.get(r):void 0;if(void 0!==o)return void o.settle({cause:"remote",error:Error("subscriptions/listen: server cancelled the subscription")})}super._onnotification(t,r)}_onresponse(t){let r=t.id,o="string"==typeof r?this._listenState.get(r):void 0;void 0!==o?pf(t)?o.settle({cause:"remote",error:dX.fromError(t.error.code,t.error.message,t.error.data)}):o.settle({cause:"graceful",error:new d_(db.ConnectionClosed,"subscriptions/listen: server closed the subscription gracefully before acknowledging")}):super._onresponse(t)}_onclose(){if(this._listenState.size>0){let t=new d_(db.ConnectionClosed,"Connection closed");for(let r of this._listenState.values())r.settle({cause:"remote",error:t});this._listenState.clear()}super._onclose()}async callTool(t,r){let o,a="modern"===this.getProtocolEra()&&"browser"!==mP(),i=async()=>{let o;if(!a)return r;try{o=await this._resolveXMcpHeaderScan(t.name,r?.toolDefinition)}catch(t){this._reportStoreError(t)}if(!o?.valid||0===o.declarations.length)return r;let i=function(t,r){let o={};for(let a of t){let t=function(t,r){let o=t;for(let t of r){if(null===o||"object"!=typeof o)return;o=o[t]}return o}(r,a.path);if(null==t)continue;let i=function(t){if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t){if(!Number.isFinite(t)||Number.isInteger(t)&&!Number.isSafeInteger(t))return;return String(t)}}(t);void 0!==i&&(o[`Mcp-Param-${a.headerName}`]=pE(i))}return o}(o.declarations,t.arguments);return 0===Object.keys(i).length?r:{...r,headers:{...r?.headers,...i}}},s=r?.toolDefinition===void 0?await this._cache.outputValidator(t.name,t=>this._compileOutputValidator(t)).catch(t=>void this._reportStoreError(t)):this._compileOutputValidator(r.toolDefinition),n=()=>{if(void 0===s||s.ok)return;let r=s.compileError,o=(r instanceof Error?r.message:String(r)).slice(0,200);throw new dX(dW.InvalidParams,`Tool '${t.name}' has an invalid outputSchema: ${o}`)};n();try{o=await this.request({method:"tools/call",params:t},await i())}catch(u){let l=u instanceof dX&&-32020===u.code;if(!a||!l||r?.toolDefinition!==void 0)throw u;let c={signal:r?.signal,timeout:r?.timeout,cacheMode:"refresh"};await this._cache.evict("tools/list"),await this.listTools(void 0,c).catch(t=>this._reportStoreError(t)),s=await this._cache.outputValidator(t.name,t=>this._compileOutputValidator(t)).catch(t=>void this._reportStoreError(t)),n(),o=await this.request({method:"tools/call",params:t},await i())}let l=void 0!==s&&s.ok?s.validator:void 0;if(l){if(void 0===o.structuredContent&&!o.isError)throw new dX(dW.InvalidRequest,`Tool ${t.name} has an output schema but did not return structured content`);if(void 0!==o.structuredContent&&!o.isError)try{let t=l(o.structuredContent);if(!t.valid)throw new dX(dW.InvalidParams,`Structured content does not match the tool's output schema: ${t.errorMessage}`)}catch(t){if(t instanceof dX)throw t;throw new dX(dW.InvalidParams,`Failed to validate structured content: ${t instanceof Error?t.message:String(t)}`)}}return o}async listTools(t,r){if(!this._serverCapabilities?.tools&&!this._enforceStrictCapabilities)return console.debug("Client.listTools() called but server does not advertise tools capability - returning empty list"),{tools:[]};if(t?.cursor!==void 0){let o=await this.request({method:"tools/list",params:t},r);return this._excludeInvalidXMcpHeaderTools(o),o}let o=await this._serveFromCache("tools/list",void 0,r);return void 0!==o?o:this._listAllPages("tools/list",t,r,(t,r)=>t.tools.push(...r.tools),t=>this._excludeInvalidXMcpHeaderTools(t))}_excludeInvalidXMcpHeaderTools(t){if("modern"!==this.getProtocolEra()||!this.transport||"stdio"===mk(this.transport))return;let r=t.tools.filter(t=>{let r=pb(t.inputSchema);return!!r.valid||(console.warn(`[mcp-sdk] excluding tool '${t.name}' from tools/list: invalid x-mcp-header declaration — ${r.reason}`),!1)});r.length!==t.tools.length&&(t.tools=r)}_setupListChangedHandler(t,r,o,a){let i=ak(nN,o);if(!i.success)throw Error(`Invalid ${t} listChanged options: ${i.error.message}`);if("function"!=typeof o.onChanged)throw TypeError(`Invalid ${t} listChanged options: onChanged must be a function`);let{autoRefresh:s,debounceMs:n}=i.data,{onChanged:l}=o,c=async()=>{if(!s)return void l(null,null);try{l(null,await a())}catch(t){l(t instanceof Error?t:Error(String(t)),null)}},u=()=>{if(n){let r=this._listChangedDebounceTimers.get(t);r&&clearTimeout(r);let o=setTimeout(c,n);this._listChangedDebounceTimers.set(t,o)}else c()};this.setNotificationHandler(r,u)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};(class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](t){return dy(this,t)}static isInstance(t){if("function"!=typeof this)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return dy(this,t)}constructor(t,r,o){super(`SSE error: ${r}`),this.code=t,this.event=o,dm(this,new.target)}});let mz={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},mL=new Set(["authorization","content-type","mcp-protocol-version","mcp-method","mcp-name","mcp-session-id"]);function mD(t,r){if("function"==typeof AbortSignal.any)return AbortSignal.any([t,r]);let o=new AbortController;if(t.aborted)return o.abort(t.reason),o.signal;if(r.aborted)return o.abort(r.reason),o.signal;let a=()=>{t.removeEventListener("abort",i),r.removeEventListener("abort",s)};function i(){a(),o.abort(t.reason)}function s(){a(),o.abort(r.reason)}return t.addEventListener("abort",i,{once:!0}),r.addEventListener("abort",s,{once:!0}),o.signal}var mU=class{_abortController;_url;_resourceMetadataUrl;_scope;_requestInit;_authProvider;_oauthProvider;_skipIssuerMetadataValidation;_fetch;_fetchWithInit;_sessionId;_reconnectionOptions;_protocolVersion;_onInsufficientScope;_maxStepUpRetries;_serverRetryMs;_reconnectionScheduler;_cancelReconnection;onclose;onerror;onmessage;hasPerRequestStream=!0;constructor(t,r){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._skipIssuerMetadataValidation=r?.skipIssuerMetadataValidation,function(t){return null!=t&&"function"==typeof t.tokens&&"function"==typeof t.clientInformation}(r?.authProvider)?(this._oauthProvider=r.authProvider,this._authProvider=function(t,r){return{token:async()=>(await t.tokens())?.access_token,onUnauthorized:async o=>f0(t,o,r)}}(r.authProvider,{skipIssuerMetadataValidation:r.skipIssuerMetadataValidation})):this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=function(t=fetch,r){return r?async(o,a)=>t(o,{...r,...a,headers:a?.headers?{...p0(r.headers),...p0(a.headers)}:r.headers}):t}(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._protocolVersion=r?.protocolVersion,this._reconnectionOptions=r?.reconnectionOptions??mz,this._reconnectionScheduler=r?.reconnectionScheduler,this._onInsufficientScope=r?.onInsufficientScope??"reauthorize",this._maxStepUpRetries=Math.max(0,r?.maxStepUpRetries??1)}async _stepUpAuthorize(t,r){try{return await this._stepUpAuthorizeInner(t,r)}catch(t){throw m$(t)}}async _stepUpAuthorizeInner(t,r){if("throw"===this._onInsufficientScope||!this._oauthProvider)throw new fX({requiredScope:t.scope,resourceMetadataUrl:t.resourceMetadataUrl,errorDescription:t.errorDescription});if(r>=this._maxStepUpRetries)throw new dS(db.ClientHttpForbidden,`Server returned 403 insufficient_scope after step-up re-authorization (retry limit ${this._maxStepUpRetries} reached)`,{status:403,statusText:t.statusText??"Forbidden",text:t.text});t.resourceMetadataUrl&&(this._resourceMetadataUrl=t.resourceMetadataUrl);let o=await this._oauthProvider.tokens(),a=f4(this._scope,o?.scope,t.scope);this._scope=a;let i=function(t,r){if(!t)return!1;let o=new Set((r??"").split(/\s+/).filter(Boolean));for(let r of t.split(/\s+/))if(r&&!o.has(r))return!0;return!1}(a,o?.scope);return me(this._oauthProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:a,forceReauthorization:i,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})}async _commonHeaders(){let t,r={};try{t=await this._authProvider?.token()}catch(t){throw m$(t)}t&&(r.Authorization=`Bearer ${t}`),this._sessionId&&(r["mcp-session-id"]=this._sessionId),this._protocolVersion&&(r["mcp-protocol-version"]=this._protocolVersion);let o=p0(this._requestInit?.headers);return new Headers({...r,...o})}_applyBodyDerivedHeaders(t,r){if(Array.isArray(r)||!sp.safeParse(r).success)return;let o=r.params?._meta?.[i0];if("string"!=typeof o)return;t.set("mcp-protocol-version",o),t.set("mcp-method",r.method);let a=r.params,i="resources/read"===r.method?"string"==typeof a?.uri?a.uri:void 0:"string"==typeof a?.name?a.name:void 0;void 0!==i&&t.set("mcp-name",pE(i))}_isModernEnvelopedRequest(t){if(Array.isArray(t)||!sp.safeParse(t).success)return!1;let r=t.params?._meta?.[i0];return"string"==typeof r&&r>=d$}async _startOrAuthSse(t,r=!1,o=0){let{resumptionToken:a,requestSignal:i}=t,s=()=>this._abortController?.signal.aborted===!0||i?.aborted===!0;try{let s=await this._commonHeaders(),n=[...s.get("accept")?.split(",").map(t=>t.trim().toLowerCase())??[],"text/event-stream"];s.set("accept",[...new Set(n)].join(", ")),a&&s.set("last-event-id",a);let l=this._abortController?.signal,c=void 0!==i&&void 0!==l?mD(l,i):i??l,u=await (this._fetch??fetch)(this._url,{...this._requestInit,method:"GET",headers:s,signal:c});if(!u.ok){if(401===u.status&&this._authProvider){if(u.headers.has("www-authenticate")){let{resourceMetadataUrl:t,scope:r}=mo(u);this._resourceMetadataUrl=t,this._scope=f4(this._scope,r)}if(this._authProvider.onUnauthorized&&!r){try{await this._authProvider.onUnauthorized({response:u,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(t){throw m$(t)}return await u.text?.().catch(()=>{}),this._startOrAuthSse(t,!0,o)}if(await u.text?.().catch(()=>{}),r)throw m$(new dS(db.ClientHttpAuthentication,"Server returned 401 after re-authentication",{status:401,statusText:u.statusText}));throw m$(new f1)}if(403===u.status){let{resourceMetadataUrl:a,scope:i,error:s,errorDescription:n}=mo(u);if("insufficient_scope"===s){let s=await u.text?.().catch(()=>null);if(await this._stepUpAuthorize({scope:i,resourceMetadataUrl:a,errorDescription:n,statusText:u.statusText,text:s},o)!=="AUTHORIZED")throw m$(new f1);return this._startOrAuthSse(t,r,o+1)}}if(await u.text?.().catch(()=>{}),405===u.status)return void t.onRequestStreamEnd?.();throw new dS(db.ClientHttpFailedToOpenStream,`Failed to open SSE stream: ${u.statusText}`,{status:u.status,statusText:u.statusText})}this._handleSseStream(u.body,t,!0)}catch(t){throw s()||this.onerror?.(t),t}}_getNextReconnectionDelay(t){return void 0!==this._serverRetryMs?this._serverRetryMs:Math.min(this._reconnectionOptions.initialReconnectionDelay*Math.pow(this._reconnectionOptions.reconnectionDelayGrowFactor,t),this._reconnectionOptions.maxReconnectionDelay)}_scheduleReconnection(t,r=0){let o=this._reconnectionOptions.maxRetries;if(r>=o){this.onerror?.(Error(`Maximum reconnection attempts (${o}) exceeded.`)),t.onRequestStreamEnd?.();return}let a=this._getNextReconnectionDelay(r),i=()=>{this._cancelReconnection=void 0,this._abortController?.signal.aborted||t.requestSignal?.aborted||this._startOrAuthSse(t).catch(o=>{if(!(this._abortController?.signal.aborted||t.requestSignal?.aborted)){this.onerror?.(Error(`Failed to reconnect SSE stream: ${o instanceof Error?o.message:String(o)}`));try{this._scheduleReconnection(t,r+1)}catch(t){this.onerror?.(t instanceof Error?t:Error(String(t)))}}})};if(this._reconnectionScheduler){let t=this._reconnectionScheduler(i,a,r);this._cancelReconnection="function"==typeof t?t:void 0}else{let t=setTimeout(i,a);this._cancelReconnection=()=>clearTimeout(t)}}_handleSseStream(t,r,o){let a;if(!t)return void r.onRequestStreamEnd?.();let{onresumptiontoken:i,replayMessageId:s,requestSignal:n,onRequestStreamEnd:l}=r,c=()=>this._abortController?.signal.aborted===!0||n?.aborted===!0,u=!1,d=!1;(async()=>{try{let r=t.pipeThrough(new TextDecoderStream).pipeThrough(new fK({onRetry:t=>{this._serverRetryMs=t}})).getReader();for(;;){let{value:t,done:o}=await r.read();if(o)break;if((t.id&&(a=t.id,u=!0,i?.(t.id)),t.data)&&(!t.event||"message"===t.event))try{let r=sy.parse(JSON.parse(t.data));(ph(r)||pf(r))&&(d=!0,void 0!==s&&(r.id=s)),this.onmessage?.(r)}catch(t){this.onerror?.(t)}}(o||u)&&!d&&this._abortController&&!c()?this._scheduleReconnection({resumptionToken:a,onresumptiontoken:i,replayMessageId:s,requestSignal:n,onRequestStreamEnd:l},0):c()||l?.()}catch(t){if(c())return;if(this.onerror?.(Error(`SSE stream disconnected: ${t}`)),(o||u)&&!d&&this._abortController&&!c())try{this._scheduleReconnection({resumptionToken:a,onresumptiontoken:i,replayMessageId:s,requestSignal:n,onRequestStreamEnd:l},0)}catch(t){this.onerror?.(Error(`Failed to reconnect: ${t instanceof Error?t.message:String(t)}`)),l?.()}else l?.()}})()}async start(){if(this._abortController)throw Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t,r){if(!this._oauthProvider)throw new f1("finishAuth requires an OAuthClientProvider");let{authorizationCode:o,iss:a}=await f5(t,r,this._oauthProvider,this._url,{fetchFn:this._fetchWithInit,resourceMetadataUrl:this._resourceMetadataUrl});if(await me(this._oauthProvider,{serverUrl:this._url,authorizationCode:o,iss:a,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})!=="AUTHORIZED")throw new f1("Failed to authorize")}async close(){try{this._cancelReconnection?.()}finally{this._cancelReconnection=void 0,this._abortController?.abort(),this.onclose?.()}}async send(t,r){return this._send(t,r,!1)}async _send(t,r,o,a=0){try{let{resumptionToken:i,onresumptiontoken:s}=r||{};if(i)return void this._startOrAuthSse({resumptionToken:i,replayMessageId:sp.safeParse(t).success?t.id:void 0,requestSignal:r?.requestSignal}).catch(t=>this.onerror?.(t));let n=await this._commonHeaders();this._applyBodyDerivedHeaders(n,t);let l=Array.isArray(t)?t.some(t=>sj.safeParse(t).success):sj.safeParse(t).success;if(l&&n.delete("mcp-session-id"),r?.headers!==void 0)for(let[t,o]of Object.entries(r.headers))mL.has(t.toLowerCase())||n.set(t,o);n.set("content-type","application/json");let c=[...n.get("accept")?.split(",").map(t=>t.trim().toLowerCase())??[],"application/json","text/event-stream"];n.set("accept",[...new Set(c)].join(", "));let u=this._abortController?.signal,d=r?.requestSignal!==void 0&&void 0!==u?mD(u,r.requestSignal):r?.requestSignal??u,p={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:d},h=await (this._fetch??fetch)(this._url,p);if(l&&h.ok&&(this._sessionId=h.headers.get("mcp-session-id")||void 0),!h.ok){if(401===h.status&&this._authProvider){if(h.headers.has("www-authenticate")){let{resourceMetadataUrl:t,scope:r}=mo(h);this._resourceMetadataUrl=t,this._scope=f4(this._scope,r)}if(this._authProvider.onUnauthorized&&!o){try{await this._authProvider.onUnauthorized({response:h,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(t){throw m$(t)}return await h.text?.().catch(()=>{}),this._send(t,r,!0,a)}if(await h.text?.().catch(()=>{}),o)throw m$(new dS(db.ClientHttpAuthentication,"Server returned 401 after re-authentication",{status:401,statusText:h.statusText}));throw m$(new f1)}let i=await h.text?.().catch(()=>null);if(403===h.status){let{resourceMetadataUrl:s,scope:n,error:l,errorDescription:c}=mo(h);if("insufficient_scope"===l){if(await this._stepUpAuthorize({scope:n,resourceMetadataUrl:s,errorDescription:c,statusText:h.statusText,text:i},a)!=="AUTHORIZED")throw m$(new f1);return this._send(t,r,o,a+1)}}if(400===h.status&&"string"==typeof i&&this._isModernEnvelopedRequest(t))try{let r=sy.parse(JSON.parse(i)),o=(Array.isArray(t)?t:[t]).filter(t=>sp.safeParse(t).success);if(pf(r)&&o.some(t=>t.id===r.id))return void this.onmessage?.(r)}catch{}throw new dS(db.ClientHttpNotImplemented,`Error POSTing to endpoint: ${i}`,{status:h.status,statusText:h.statusText,text:i})}if(202===h.status){await h.text?.().catch(()=>{}),sI.safeParse(t).success&&this._startOrAuthSse({resumptionToken:void 0}).catch(t=>this.onerror?.(t));return}let f=(Array.isArray(t)?t:[t]).some(t=>"method"in t&&"id"in t&&void 0!==t.id),m=h.headers.get("content-type"),y=function(t){if(t)try{return pY.parse(t).type}catch{let r=(t.split(";",1)[0]??"").trim().toLowerCase();if(""===r||t.slice(r.length).includes(","))return;return r}}(m);if(f)if("text/event-stream"===y)this._handleSseStream(h.body,{onresumptiontoken:s,requestSignal:r?.requestSignal,onRequestStreamEnd:r?.onRequestStreamEnd},!1);else if("application/json"===y){let t=await h.json();for(let r of Array.isArray(t)?t.map(t=>sy.parse(t)):[sy.parse(t)])this.onmessage?.(r)}else throw await h.text?.().catch(()=>{}),new d_(db.ClientHttpUnexpectedContent,`Unexpected content type: ${m}`,{contentType:m});else await h.text?.().catch(()=>{})}catch(t){throw r?.requestSignal?.aborted!==!0&&this.onerror?.(t),t}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let t=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},o=await (this._fetch??fetch)(this._url,r);if(await o.text?.().catch(()=>{}),!o.ok&&405!==o.status)throw new dS(db.ClientHttpFailedToTerminateSession,`Failed to terminate session: ${o.statusText}`,{status:o.status,statusText:o.statusText});this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,r){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:r?.onresumptiontoken})}};let mV=require("node:stream");var mF=s(6507);let mH="win32"===u5.platform?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];var mK=class{_process;_readBuffer;_serverParams;_stderrStream=null;onclose;onerror;onmessage;constructor(t){this._serverParams=t,this._readBuffer=new pQ({maxBufferSize:t.maxBufferSize}),("pipe"===t.stderr||"overlapped"===t.stderr)&&(this._stderrStream=new mV.PassThrough)}async start(){if(this._process)throw Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,r)=>{this._process=mF(this._serverParams.command,this._serverParams.args??[],{env:{...function(){let t={};for(let r of mH){let o=u5.env[r];void 0!==o&&(o.startsWith("()")||(t[r]=o))}return t}(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:"win32"===u5.platform,cwd:this._serverParams.cwd}),this._process.on("error",t=>{r(t),this.onerror?.(t)}),this._process.on("spawn",()=>{t()}),this._process.on("close",t=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",t=>{this.onerror?.(t)}),this._process.stdout?.on("data",t=>{try{this._readBuffer.append(t),this.processReadBuffer()}catch(t){this.onerror?.(t),this.close().catch(()=>{})}}),this._process.stdout?.on("error",t=>{this.onerror?.(t)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(null===t)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async _dispose(){let t=this._process;if(this._process=void 0,t&&null===t.exitCode&&null===t.signalCode){let r=new Promise(r=>t.once("exit",()=>r()));try{t.stdin?.end()}catch{}try{t.kill("SIGTERM")}catch{}if(await Promise.race([r,new Promise(t=>setTimeout(t,1e3).unref())]),null===t.exitCode&&null===t.signalCode)try{t.kill("SIGKILL")}catch{}await r}try{t?.stdout?.destroy()}catch{}try{t?.stdin?.destroy()}catch{}try{t?.stderr?.destroy()}catch{}this._readBuffer.clear()}async close(){if(this._process){let t=this._process;this._process=void 0;let r=new Promise(r=>{t.once("close",()=>{r()})});try{t.stdin?.end()}catch{}if(await Promise.race([r,new Promise(t=>setTimeout(t,2e3).unref())]),null===t.exitCode){try{t.kill("SIGTERM")}catch{}await Promise.race([r,new Promise(t=>setTimeout(t,2e3).unref())])}if(null===t.exitCode)try{t.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(t){return new Promise(r=>{if(!this._process?.stdin)throw new d_(db.NotConnected,"Not connected");let o=JSON.stringify(t)+"\n";this._process.stdin.write(o)?r():this._process.stdin.once("drain",r)})}};let mJ=t=>"env"in t&&"string"==typeof t.env,mB=t=>{let r={};return t.forEach(t=>{let o=t.name.trim();if(mJ(t)){let a=process.env[t.env];if(void 0===a)throw Error(`Environment variable "${t.env}" is not set (required for header "${o}")`);r[o]=a}else r[o]=t.value.trim()}),r},mG=s(8330),mZ={name:mG.name,version:mG.version},mW={capabilities:{sampling:{},elicitation:{form:{},url:{}},roots:{listChanged:!0}},versionNegotiation:{mode:"auto"}};async function mX({url:t,headers:r}){let o=new mq(mZ,mW),a=r?mB(r):{},i=new mU(new URL(t),{...r?{requestInit:{headers:a}}:{},reconnectionOptions:{maxReconnectionDelay:3e4,initialReconnectionDelay:1e3,reconnectionDelayGrowFactor:1.5,maxRetries:2}});return await o.connect(i),o}async function mY(t){let{onStderrData:r,...o}=t,a=new mq(mZ,mW),i=new mK({...o,stderr:o.stderr??"pipe"}),s=i.stderr;if(s){let t=r??(t=>{console.error(`[STDIO MCP Server stderr]: ${t}`)});s.on("data",t)}return await a.connect(i),{client:a,transport:i}}async function mQ(t){try{return(await t.client.listTools()).tools.map(t=>t.name)}catch(t){return console.error("Failed to list stdio MCP tools:",t),[]}}async function m0(t,r,o){try{return await t.client.callTool({name:r,arguments:o})}catch(t){throw console.error(`Failed to call stdio MCP tool "${r}":`,t),t}}async function m1(t){try{await t.transport.close(),await t.client.close()}catch(t){throw console.error("Error disconnecting from stdio MCP server:",t),t}}function m2(t){if(t?.body===void 0||null===t.body)return[];let r=Array.isArray(t.body)?t.body:[t.body],o=[];for(let t of r)if("object"==typeof t&&null!==t&&"method"in t&&"tools/call"===t.method){let r=t.params;r&&"object"==typeof r&&"name"in r&&"string"==typeof r.name&&o.push(r.name)}return o}let m9="2026-01-26",m4="ui/initialize",m5="ui/notifications/initialized",m3="ui/request-display-mode",m6="ui/open-link",m8="ui/update-model-context",m7="ui/message",ye="notifications/message",yt="resources/read",yr="ui/notifications/host-context-changed",yo="ui/notifications/size-changed";function ya(t){return!!t&&"object"==typeof t}function yi(t,r){return t instanceof Error&&t.message?t.message:r}function ys(t={}){let r=t.targetWindow??("undefined"==typeof window?null:window),o=t.requestTimeoutMs??15e3,a=t.connectionTimeoutMs??2e3,i=100,s=!1,n=!1,l={isConnected:!!r&&r.parent!==r,hostContext:null,hostCapabilities:null},c=new Set,u=new Map,d=t=>{if(t.isConnected!==l.isConnected||t.hostContext!==l.hostContext||t.hostCapabilities!==l.hostCapabilities)for(let r of(l=t,c))r(l)},p=t=>{var r,o;let a;d({isConnected:!0,hostContext:t.hostContext?(r=l.hostContext,o=t.hostContext,a={...r??{},...o},(r?.safeAreaInsets||o.safeAreaInsets)&&(a.safeAreaInsets={...r?.safeAreaInsets??{},...o.safeAreaInsets??{}}),(r?.containerDimensions||o.containerDimensions)&&(a.containerDimensions={...r?.containerDimensions??{},...o.containerDimensions??{}}),(r?.styles||o.styles)&&(a.styles={...r?.styles??{},...o.styles??{},variables:r?.styles?.variables||o.styles?.variables?{...r?.styles?.variables??{},...o.styles?.variables??{}}:void 0,css:r?.styles?.css||o.styles?.css?{...r?.styles?.css??{},...o.styles?.css??{}}:void 0}),a):l.hostContext,hostCapabilities:t.hostCapabilities?{...l.hostCapabilities??{},...t.hostCapabilities}:l.hostCapabilities})},h=t=>{if(!r||t.source!==r.parent||!ya(t.data))return;n=!0,l.isConnected||d({...l,isConnected:!0});let o=t.data;if("id"in o&&null!=o.id&&"number"==typeof o.id){let t=u.get(o.id);t&&(clearTimeout(t.timeoutId),u.delete(o.id),ya(o.error)?t.reject(Error("string"==typeof o.error.message?o.error.message:"MCP request failed")):t.resolve(o.result))}1===o.id&&ya(o.result)&&p({hostContext:ya(o.result.hostContext)?o.result.hostContext:void 0,hostCapabilities:ya(o.result.hostCapabilities)?o.result.hostCapabilities:void 0}),o.method===yr&&ya(o.params)&&p({hostContext:o.params}),"ui/hostContextChanged"===o.method&&ya(o.params)&&ya(o.params.hostContext)&&p({hostContext:o.params.hostContext})};r&&(r.addEventListener("message",h),r.parent!==r&&setTimeout(()=>{s||n||l.hostContext||d({...l,isConnected:!1})},a));let f=()=>{if(s)throw Error("MCP host bridge has been disposed");if(!r)throw Error("MCP host bridge requires a browser window");return r},m=(t,r)=>{f().parent.postMessage({jsonrpc:"2.0",method:t,params:r},"*")},y=(t,r={})=>{let a=f();return new Promise((s,n)=>{let l=i++,c=setTimeout(()=>{u.has(l)&&(u.delete(l),n(Error(`MCP request timed out: ${t}`)))},o);u.set(l,{resolve:s,reject:n,timeoutId:c}),a.parent.postMessage({jsonrpc:"2.0",id:l,method:t,params:r},"*")})},g=async(t,r)=>{let o;for(let a of t)try{return await y(a,r)}catch(r){o=r;let t=yi(r,"MCP request failed");if(!/method not found|unknown method/i.test(t))throw r}throw o instanceof Error?o:Error("MCP request failed")},v=async t=>{if(r?.open)return void r.open(t,"_blank","noopener,noreferrer");throw Error("Unable to open link without a browser window")};return{callTool:(t,r)=>y("tools/call",{name:t,arguments:r??{}}),requestDisplayMode:t=>g([m3,"ui/requestDisplayMode"],{mode:t}),async openLink(t){try{await g([m6,"ui/openLink"],{url:t})}catch(o){if(!l.isConnected||!r)return void await v(t);throw Error(yi(o,"Failed to open link"))}},readResource:t=>y(yt,{uri:t}),sendMessage:t=>y(m7,t),updateModelContext:t=>y(m8,t),async logMessage(t){m(ye,t)},async notifySizeChanged(t){m(yo,t)},getState:()=>l,getHostContext:()=>l.hostContext,getHostCapabilities:()=>l.hostCapabilities,isConnected:()=>l.isConnected,subscribe:t=>(c.add(t),()=>{c.delete(t)}),dispose(){if(!s){for(let[t,o]of(s=!0,r&&r.removeEventListener("message",h),u.entries()))clearTimeout(o.timeoutId),o.reject(Error("MCP host bridge has been disposed")),u.delete(t);c.clear()}}}}N().config()})(),n})());
|