xmcp 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,()=>(()=>{var e={3985:function(e,t,n){var r=n(9627);e.exports=function(e,t){return new Promise(function(n,o){var i,s=t||{};function a(e){o(e||Error("Aborted"))}function c(e,t){e.bail?a(e):i.retry(e)?s.onRetry&&s.onRetry(e,t):o(i.mainError())}"randomize"in s||(s.randomize=!0),(i=r.operation(s)).attempt(function(t){var r;try{r=e(a,t)}catch(e){c(e,t);return}Promise.resolve(r).then(n).catch(function(e){c(e,t)})})})}},9627:function(e,t,n){e.exports=n(853)},853:function(e,t,n){var r=n(6971);t.operation=function(e){return new r(t.timeouts(e),{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},t.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<t.retries;o++)r.push(this.createTimeout(o,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(o,t)),r.sort(function(e,t){return e-t}),r},t.createTimeout=function(e,t){var n=Math.round((t.randomize?Math.random()+1:1)*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return Math.min(n,t.maxTimeout)},t.wrap=function(e,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var o in r=[],e)"function"==typeof e[o]&&r.push(o);for(var i=0;i<r.length;i++){var s=r[i],a=e[s];e[s]=(function(r){var o=t.operation(n),i=Array.prototype.slice.call(arguments,1),s=i.pop();i.push(function(e){o.retry(e)||(e&&(arguments[0]=o.mainError()),s.apply(this,arguments))}),o.attempt(function(){r.apply(e,i)})}).bind(e,a),e[s].options=n}}},6971:function(e){function t(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}e.exports=t,t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},t.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(void 0===n)if(!this._cachedTimeouts)return!1;else this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0},t.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},t.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},t.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},t.prototype.start=t.prototype.try,t.prototype.errors=function(){return this._errors},t.prototype.attempts=function(){return this._attempts},t.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var o=this._errors[r],i=o.message,s=(e[i]||0)+1;e[i]=s,s>=n&&(t=o,n=s)}return t}},3389:function(e,t,n){"use strict";let r=n(9858),o=process.env;function i(e){return"string"==typeof e?!!o[e]:"env"in e?o[e.env]&&o[e.env].includes(e.includes):"any"in e?e.any.some(function(e){return!!o[e]}):Object.keys(e).every(function(t){return o[t]===e[t]})}Object.defineProperty(t,"_vendors",{value:r.map(function(e){return e.constant})}),t.name=null,t.isPR=null,t.id=null,"false"!==o.CI&&r.forEach(function(e){let n=(Array.isArray(e.env)?e.env:[e.env]).every(function(e){return i(e)});t[e.constant]=n,n&&(t.name=e.name,t.isPR=function(e){switch(typeof e.pr){case"string":return!!o[e.pr];case"object":if("env"in e.pr)if("any"in e.pr)return e.pr.any.some(function(t){return o[e.pr.env]===t});else return e.pr.env in o&&o[e.pr.env]!==e.pr.ne;if("any"in e.pr)return e.pr.any.some(function(e){return!!o[e]});return i(e.pr);default:return null}}(e),t.id=e.constant)}),t.isCI=!!("false"!==o.CI&&(o.BUILD_ID||o.BUILD_NUMBER||o.CI||o.CI_APP_ID||o.CI_BUILD_ID||o.CI_BUILD_NUMBER||o.CI_NAME||o.CONTINUOUS_INTEGRATION||o.RUN_ID||t.name))},9858:function(e){"use strict";e.exports=JSON.parse('[{"name":"Agola CI","constant":"AGOLA","env":"AGOLA_GIT_REF","pr":"AGOLA_PULL_REQUEST_ID"},{"name":"Appcircle","constant":"APPCIRCLE","env":"AC_APPCIRCLE","pr":{"env":"AC_GIT_PR","ne":"false"}},{"name":"AppVeyor","constant":"APPVEYOR","env":"APPVEYOR","pr":"APPVEYOR_PULL_REQUEST_NUMBER"},{"name":"AWS CodeBuild","constant":"CODEBUILD","env":"CODEBUILD_BUILD_ARN","pr":{"env":"CODEBUILD_WEBHOOK_EVENT","any":["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{"name":"Azure Pipelines","constant":"AZURE_PIPELINES","env":"TF_BUILD","pr":{"BUILD_REASON":"PullRequest"}},{"name":"Bamboo","constant":"BAMBOO","env":"bamboo_planKey"},{"name":"Bitbucket Pipelines","constant":"BITBUCKET","env":"BITBUCKET_COMMIT","pr":"BITBUCKET_PR_ID"},{"name":"Bitrise","constant":"BITRISE","env":"BITRISE_IO","pr":"BITRISE_PULL_REQUEST"},{"name":"Buddy","constant":"BUDDY","env":"BUDDY_WORKSPACE_ID","pr":"BUDDY_EXECUTION_PULL_REQUEST_ID"},{"name":"Buildkite","constant":"BUILDKITE","env":"BUILDKITE","pr":{"env":"BUILDKITE_PULL_REQUEST","ne":"false"}},{"name":"CircleCI","constant":"CIRCLE","env":"CIRCLECI","pr":"CIRCLE_PULL_REQUEST"},{"name":"Cirrus CI","constant":"CIRRUS","env":"CIRRUS_CI","pr":"CIRRUS_PR"},{"name":"Cloudflare Pages","constant":"CLOUDFLARE_PAGES","env":"CF_PAGES"},{"name":"Cloudflare Workers","constant":"CLOUDFLARE_WORKERS","env":"WORKERS_CI"},{"name":"Codefresh","constant":"CODEFRESH","env":"CF_BUILD_ID","pr":{"any":["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{"name":"Codemagic","constant":"CODEMAGIC","env":"CM_BUILD_ID","pr":"CM_PULL_REQUEST"},{"name":"Codeship","constant":"CODESHIP","env":{"CI_NAME":"codeship"}},{"name":"Drone","constant":"DRONE","env":"DRONE","pr":{"DRONE_BUILD_EVENT":"pull_request"}},{"name":"dsari","constant":"DSARI","env":"DSARI"},{"name":"Earthly","constant":"EARTHLY","env":"EARTHLY_CI"},{"name":"Expo Application Services","constant":"EAS","env":"EAS_BUILD"},{"name":"Gerrit","constant":"GERRIT","env":"GERRIT_PROJECT"},{"name":"Gitea Actions","constant":"GITEA_ACTIONS","env":"GITEA_ACTIONS"},{"name":"GitHub Actions","constant":"GITHUB_ACTIONS","env":"GITHUB_ACTIONS","pr":{"GITHUB_EVENT_NAME":"pull_request"}},{"name":"GitLab CI","constant":"GITLAB","env":"GITLAB_CI","pr":"CI_MERGE_REQUEST_ID"},{"name":"GoCD","constant":"GOCD","env":"GO_PIPELINE_LABEL"},{"name":"Google Cloud Build","constant":"GOOGLE_CLOUD_BUILD","env":"BUILDER_OUTPUT"},{"name":"Harness CI","constant":"HARNESS","env":"HARNESS_BUILD_ID"},{"name":"Heroku","constant":"HEROKU","env":{"env":"NODE","includes":"/app/.heroku/node/bin/node"}},{"name":"Hudson","constant":"HUDSON","env":"HUDSON_URL"},{"name":"Jenkins","constant":"JENKINS","env":["JENKINS_URL","BUILD_ID"],"pr":{"any":["ghprbPullId","CHANGE_ID"]}},{"name":"LayerCI","constant":"LAYERCI","env":"LAYERCI","pr":"LAYERCI_PULL_REQUEST"},{"name":"Magnum CI","constant":"MAGNUM","env":"MAGNUM"},{"name":"Netlify CI","constant":"NETLIFY","env":"NETLIFY","pr":{"env":"PULL_REQUEST","ne":"false"}},{"name":"Nevercode","constant":"NEVERCODE","env":"NEVERCODE","pr":{"env":"NEVERCODE_PULL_REQUEST","ne":"false"}},{"name":"Prow","constant":"PROW","env":"PROW_JOB_ID"},{"name":"ReleaseHub","constant":"RELEASEHUB","env":"RELEASE_BUILD_ID"},{"name":"Render","constant":"RENDER","env":"RENDER","pr":{"IS_PULL_REQUEST":"true"}},{"name":"Sail CI","constant":"SAIL","env":"SAILCI","pr":"SAIL_PULL_REQUEST_NUMBER"},{"name":"Screwdriver","constant":"SCREWDRIVER","env":"SCREWDRIVER","pr":{"env":"SD_PULL_REQUEST","ne":"false"}},{"name":"Semaphore","constant":"SEMAPHORE","env":"SEMAPHORE","pr":"PULL_REQUEST_NUMBER"},{"name":"Sourcehut","constant":"SOURCEHUT","env":{"CI_NAME":"sourcehut"}},{"name":"Strider CD","constant":"STRIDER","env":"STRIDER"},{"name":"TaskCluster","constant":"TASKCLUSTER","env":["TASK_ID","RUN_ID"]},{"name":"TeamCity","constant":"TEAMCITY","env":"TEAMCITY_VERSION"},{"name":"Travis CI","constant":"TRAVIS","env":"TRAVIS","pr":{"env":"TRAVIS_PULL_REQUEST","ne":"false"}},{"name":"Vela","constant":"VELA","env":"VELA","pr":{"VELA_PULL_REQUEST":"1"}},{"name":"Vercel","constant":"VERCEL","env":{"any":["NOW_BUILDER","VERCEL"]},"pr":"VERCEL_GIT_PULL_REQUEST_ID"},{"name":"Visual Studio App Center","constant":"APPCENTER","env":"APPCENTER_BUILD_ID"},{"name":"Woodpecker","constant":"WOODPECKER","env":{"CI":"woodpecker"},"pr":{"CI_BUILD_EVENT":"pull_request"}},{"name":"Xcode Cloud","constant":"XCODE_CLOUD","env":"CI_XCODE_PROJECT","pr":"CI_PULL_REQUEST_NUMBER"},{"name":"Xcode Server","constant":"XCODE_SERVER","env":"XCS"}]')}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";let e,t,r,o,i=require("fs"),s=require("path");var a=n.n(s);let c=require("crypto"),u=require("os");var l=n.n(u);let m=require("node:fs");function E(){return e??=function(){try{return m.statSync("/.dockerenv"),!0}catch{return!1}}()||function(){try{return m.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}()||function(){try{return m.readFileSync("/proc/self/mountinfo","utf8").includes("/docker/containers/")}catch{return!1}}()}var p=n(3389),_=n.n(p);let{isCI:f,name:h}=_();function I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let T="telemetry.enabled",y="telemetry.notifiedAt",R="telemetry.anonymousId",v="telemetry.salt";class d{isEnvTelemetryDisabled(){let e=this.XMCP_TELEMETRY_DISABLED;return"string"==typeof e&&"true"===e.toLowerCase()}ensureConfig(){try{let e=a().dirname(this.configPath);if((0,i.existsSync)(e)||(0,i.mkdirSync)(e,{recursive:!0}),(0,i.existsSync)(this.configPath)){let e=(0,i.readFileSync)(this.configPath,"utf-8");this.config=JSON.parse(e)}else this.config={}}catch(e){this.config={}}}get(e,t){if(!this.config)return t;let n=this.config[e];return void 0!==n?n:t}set(e,t){if(this.config){this.config[e]=t;try{(0,i.writeFileSync)(this.configPath,JSON.stringify(this.config,null,2),"utf-8")}catch(e){}}}notify(){this.isDisabled||!this.config||!this.get(y,"")&&(this.set(y,Date.now().toString()),f||(console.log(""),console.log("xmcp collects anonymous usage data to improve the framework."),console.log(" No personal information is collected."),console.log(" You can learn more and opt-out by visiting: https://xmcp.dev/telemetry"),console.log(" Or disable with: npx xmcp telemetry disable"),console.log("")))}get anonymousId(){this.notify();let e=this.get(R);if(e)return e;let t=(0,c.randomBytes)(32).toString("hex");return this.set(R,t),t}get salt(){let e=this.get(v);if(e)return e;let t=(0,c.randomBytes)(16).toString("hex");return this.set(v,t),t}get isDisabled(){return!!(!this.config||this.isEnvTelemetryDisabled())||!1===this.get(T,!0)}get isEnabled(){return!this.isEnvTelemetryDisabled()&&!!this.config&&!1!==this.get(T,!0)}setEnabled(e){return this.set(T,!!e),this.configPath}oneWayHash(e){let t=(0,c.createHash)("sha256");return t.update(this.salt),t.update(e),t.digest("hex")}clear(){try{(0,i.existsSync)(this.configPath)&&(0,i.unlinkSync)(this.configPath)}catch(e){}}get configFilePath(){return this.configPath}constructor(){I(this,"configPath",void 0),I(this,"config",null),I(this,"XMCP_TELEMETRY_DISABLED",void 0),this.configPath=function(){if(f||E())return a().join(l().tmpdir(),".xmcp-cache","telemetry.json");let e=a().join(l().homedir(),"win32"===process.platform?"AppData/Local/xmcp":".config/xmcp");return a().join(e,"telemetry.json")}(),this.XMCP_TELEMETRY_DISABLED=process.env.XMCP_TELEMETRY_DISABLED,this.ensureConfig()}}let S=require("node:process"),C=require("node:os");function L(){return void 0===r&&(r=(()=>{try{return m.statSync("/run/.containerenv"),!0}catch{return!1}})()||(void 0===t&&(t=function(){try{return m.statSync("/.dockerenv"),!0}catch{return!1}}()||function(){try{return m.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}()),t)),r}let U=()=>{if("linux"!==S.platform)return!1;if(C.release().toLowerCase().includes("microsoft"))return!L();try{return!!m.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")&&!L()}catch{return!1}},D=S.env.__IS_WSL_TEST__?U:U(),{isCI:g,name:A}=_();var P=n(3985),O=n.n(P);async function N(e,t){let n=t?.signal,r=t?.swallowErrors??!0;!n&&"timeout"in AbortSignal&&(n=AbortSignal.timeout(5e3));try{let t;if(t=process.env?.XMCP_DEBUG_TELEMETRY,"string"==typeof t&&"true"===t.toLowerCase())try{console.log("[telemetry] Sending payload",JSON.stringify(e,null,2))}catch(e){console.log("[telemetry] Sending payload (unable to stringify)")}await O()(async()=>{let t,r=await fetch("https://telemetry.xmcp.dev/api/telemetry/events",{method:"POST",body:JSON.stringify(e),headers:{"content-type":"application/json"},signal:n}),o=await r.text();try{t=JSON.parse(o)}catch(e){}if(!r.ok){let e=Error(`HTTP ${r.status}: ${r.statusText}`);throw e.response=r,e.responseData=t,e}},{minTimeout:500,retries:1,factor:1})}catch(e){if(!r)throw e}}async function B(){try{let e=a().join(process.cwd(),"package.json"),t=JSON.parse((0,i.readFileSync)(e,"utf-8"));return`${t.name||"unknown"}@${t.version||"0.0.0"}`}catch(e){return process.cwd()}}async function b(e){return e(await B())}!async function(){let[e,t]=process.argv.slice(2);e&&t||(console.error("Usage: detached-flush <mode> <distDir>"),process.exit(1));let n=a().join(t,"_events.json");if((0,i.existsSync)(n))try{var r,s;let e=(0,i.readFileSync)(n,"utf-8"),{sessionId:t,events:a}=JSON.parse(e);if(0===a.length)return;let c=new d;if(c.isDisabled){try{(0,i.unlinkSync)(n)}catch(e){}return}let u=await b(c.oneWayHash.bind(c)),m=function(){if(o)return o;let e=l().cpus()||[];return o={platform:l().platform(),systemRelease:l().release(),arch:l().arch(),cpuCores:e.length,cpuModel:e.length?e[0].model:null,cpuSpeed:e.length?e[0].speed:null,memoryTotal:Math.trunc(l().totalmem()/1048576),isDocker:E(),isWsl:D,isCI:g,ciName:g&&A||null}}(),p=(r={anonymousId:c.anonymousId,projectHash:u,sessionId:t},s=a.map(e=>({eventName:e.eventName,timestamp:e.timestamp??new Date().toISOString(),fields:e.fields})),{context:r,meta:m,events:s});await N(p,{swallowErrors:!1}),(0,i.unlinkSync)(n)}catch(e){}}()})(),{}})());
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("zod"));else if("function"==typeof define&&define.amd)define(["zod"],t);else{var r="object"==typeof exports?t(require("zod")):t(e.zod);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,e=>(()=>{var t={9454:function(e,t,r){"use strict";var n=r(181).Buffer,i=r(181).SlowBuffer;function o(e,t){if(!n.isBuffer(e)||!n.isBuffer(t)||e.length!==t.length)return!1;for(var r=0,i=0;i<e.length;i++)r|=e[i]^t[i];return 0===r}e.exports=o,o.install=function(){n.prototype.equal=i.prototype.equal=function(e){return o(this,e)}};var s=n.prototype.equal,a=i.prototype.equal;o.restore=function(){n.prototype.equal=s,i.prototype.equal=a}},8583:function(e,t,r){let n=r(9896),i=r(6928),o=r(857),s=r(6982),a=r(4519).version,l=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function u(e){console.log(`[dotenv@${a}][DEBUG] ${e}`)}function c(e){console.log(`[dotenv@${a}] ${e}`)}function f(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)n.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=i.resolve(process.cwd(),".env.vault");return n.existsSync(t)?t:null}function h(e){return"~"===e[0]?i.join(o.homedir(),e.slice(1)):e}let d={configDotenv:function(e){let t,r=i.resolve(process.cwd(),".env"),o="utf8",s=!!(e&&e.debug),a=!e||!("quiet"in e)||e.quiet;e&&e.encoding?o=e.encoding:s&&u("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 f={};for(let r of l)try{let t=d.parse(n.readFileSync(r,{encoding:o}));d.populate(f,t,e)}catch(e){s&&u(`Failed to load ${r} ${e.message}`),t=e}let p=process.env;if(e&&null!=e.processEnv&&(p=e.processEnv),d.populate(p,f,e),s||!a){let e=Object.keys(f).length,r=[];for(let e of l)try{let t=i.relative(process.cwd(),e);r.push(t)}catch(r){s&&u(`Failed to load ${e} ${r.message}`),t=r}c(`injecting env (${e}) from ${r.join(",")}`)}return t?{parsed:f,error:t}:{parsed:f}},_configVault:function(e){let t=!!(e&&e.debug),r=!e||!("quiet"in e)||e.quiet;(t||!r)&&c("Loading env from encrypted .env.vault");let n=d._parseVault(e),i=process.env;return e&&null!=e.processEnv&&(i=e.processEnv),d.populate(i,n,e),{parsed:n}},_parseVault:function(e){let t,r=p(e=e||{});e.path=r;let n=d.configDotenv(e);if(!n.parsed){let e=Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);throw e.code="MISSING_DATA",e}let i=f(e).split(","),o=i.length;for(let e=0;e<o;e++)try{let r=i[e].trim(),o=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 n=r.password;if(!n){let e=Error("INVALID_DOTENV_KEY: Missing key part");throw e.code="INVALID_DOTENV_KEY",e}let i=r.searchParams.get("environment");if(!i){let e=Error("INVALID_DOTENV_KEY: Missing environment part");throw e.code="INVALID_DOTENV_KEY",e}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let e=Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw e.code="NOT_FOUND_DOTENV_ENVIRONMENT",e}return{ciphertext:s,key:n}}(n,r);t=d.decrypt(o.ciphertext,o.key);break}catch(t){if(e+1>=o)throw t}return d.parse(t)},config:function(e){if(0===f(e).length)return d.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@${a}][WARN] ${r}`),d.configDotenv(e)}return d._configVault(e)},decrypt:function(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let e=s.createDecipheriv("aes-256-gcm",r,i);return e.setAuthTag(o),`${e.update(n)}${e.final()}`}catch(n){let e=n instanceof RangeError,t="Invalid key length"===n.message,r="Unsupported state or unable to authenticate data"===n.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 n}},parse:function(e){let t,r={},n=e.toString();for(n=n.replace(/\r\n?/mg,"\n");null!=(t=l.exec(n));){let e=t[1],n=t[2]||"",i=(n=n.trim())[0];n=n.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),'"'===i&&(n=(n=n.replace(/\\n/g,"\n")).replace(/\\r/g,"\r")),r[e]=n}return r},populate:function(e,t,r={}){let n=!!(r&&r.debug),i=!!(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===i&&(e[r]=t[r]),n&&(!0===i?u(`"${r}" is already defined and WAS overwritten`):u(`"${r}" is already defined and was NOT overwritten`))):e[r]=t[r]}};e.exports.configDotenv=d.configDotenv,e.exports._configVault=d._configVault,e.exports._parseVault=d._parseVault,e.exports.config=d.config,e.exports.decrypt=d.decrypt,e.exports.parse=d.parse,e.exports.populate=d.populate,e.exports=d},9053:function(e,t,r){"use strict";var n=r(6608).Buffer,i=r(2188);function o(e){if(n.isBuffer(e))return e;if("string"==typeof e)return n.from(e,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function s(e,t,r){for(var n=0;t+n<r&&0===e[t+n];)++n;return e[t+n]>=128&&--n,n}e.exports={derToJose:function(e,t){e=o(e);var r=i(t),s=r+1,a=e.length,l=0;if(48!==e[l++])throw Error('Could not find expected "seq"');var u=e[l++];if(129===u&&(u=e[l++]),a-l<u)throw Error('"seq" specified length of "'+u+'", only "'+(a-l)+'" remaining');if(2!==e[l++])throw Error('Could not find expected "int" for "r"');var c=e[l++];if(a-l-2<c)throw Error('"r" specified length of "'+c+'", only "'+(a-l-2)+'" available');if(s<c)throw Error('"r" specified length of "'+c+'", max of "'+s+'" is acceptable');var f=l;if(l+=c,2!==e[l++])throw Error('Could not find expected "int" for "s"');var p=e[l++];if(a-l!==p)throw Error('"s" specified length of "'+p+'", expected "'+(a-l)+'"');if(s<p)throw Error('"s" specified length of "'+p+'", max of "'+s+'" is acceptable');var h=l;if((l+=p)!==a)throw Error('Expected to consume entire buffer, but "'+(a-l)+'" bytes remain');var d=r-c,m=r-p,E=n.allocUnsafe(d+c+m+p);for(l=0;l<d;++l)E[l]=0;e.copy(E,l,f+Math.max(-d,0),f+c),l=r;for(var y=l;l<y+m;++l)E[l]=0;return e.copy(E,l,h+Math.max(-m,0),h+p),E=(E=E.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(e,t){e=o(e);var r=i(t),a=e.length;if(a!==2*r)throw TypeError('"'+t+'" signatures must be "'+2*r+'" bytes, saw "'+a+'"');var l=s(e,0,r),u=s(e,r,e.length),c=r-l,f=r-u,p=2+c+1+1+f,h=p<128,d=n.allocUnsafe((h?2:3)+p),m=0;return d[m++]=48,h?d[m++]=p:(d[m++]=129,d[m++]=255&p),d[m++]=2,d[m++]=c,l<0?(d[m++]=0,m+=e.copy(d,m,0,r)):m+=e.copy(d,m,l,r),d[m++]=2,d[m++]=f,u<0?(d[m++]=0,e.copy(d,m,r)):e.copy(d,m,r+u),d}}},2188:function(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+'"')}},7661:function(e,t,r){var n=r(1525);e.exports=function(e,t){t=t||{};var r=n.decode(e,t);if(!r)return null;var i=r.payload;if("string"==typeof i)try{var o=JSON.parse(i);null!==o&&"object"==typeof o&&(i=o)}catch(e){}return!0===t.complete?{header:r.header,payload:i,signature:r.signature}:i}},7619:function(e,t,r){e.exports={decode:r(7661),verify:r(7014),sign:r(3418),JsonWebTokenError:r(6430),NotBeforeError:r(9387),TokenExpiredError:r(7147)}},6430:function(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},9387:function(e,t,r){var n=r(6430),i=function(e,t){n.call(this,e),this.name="NotBeforeError",this.date=t};i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},7147:function(e,t,r){var n=r(6430),i=function(e,t){n.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},8050:function(e,t,r){e.exports=r(3895).satisfies(process.version,">=15.7.0")},5582:function(e,t,r){e.exports=r(3895).satisfies(process.version,"^6.12.0 || >=8.0.0")},5612:function(e,t,r){e.exports=r(3895).satisfies(process.version,">=16.9.0")},3742:function(e,t,r){var n=r(3866);e.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if("string"==typeof e){var i=n(e);if(void 0===i)return;return Math.floor(r+i/1e3)}if("number"==typeof e)return r+e}},9572:function(e,t,r){let n=r(8050),i=r(5612),o={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 a=o[r];if(!a)throw Error(`Unknown key type "${r}".`);if(!a.includes(e))throw Error(`"alg" parameter for "${r}" key type must be one of: ${a.join(", ")}.`);if(n)switch(r){case"ec":let l=t.asymmetricKeyDetails.namedCurve,u=s[e];if(l!==u)throw Error(`"alg" parameter "${e}" requires curve "${u}".`);break;case"rsa-pss":if(i){let r=parseInt(e.slice(-3),10),{hashAlgorithm:n,mgf1HashAlgorithm:i,saltLength:o}=t.asymmetricKeyDetails;if(n!==`sha${r}`||i!==n)throw Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(void 0!==o&&o>r>>3)throw Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}}}},3418:function(e,t,r){let n=r(3742),i=r(5582),o=r(9572),s=r(1525),a=r(5357),l=r(6782),u=r(5250),c=r(8094),f=r(6052),p=r(1251),h=r(8430),{KeyObject:d,createSecretKey:m,createPrivateKey:E}=r(6982),y=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];i&&y.splice(3,0,"PS256","PS384","PS512");let v={expiresIn:{isValid:function(e){return u(e)||p(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return u(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:a.bind(null,y),message:'"algorithm" must be a valid string enum value'},header:{isValid:f,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'}},g={iat:{isValid:c,message:'"iat" should be a number of seconds'},exp:{isValid:c,message:'"exp" should be a number of seconds'},nbf:{isValid:c,message:'"nbf" should be a number of seconds'}};function b(e,t,r,n){if(!f(r))throw Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(i){let o=e[i];if(!o){if(!t)throw Error('"'+i+'" is not allowed in "'+n+'"');return}if(!o.isValid(r[i]))throw Error(o.message)})}let S={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},$=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];e.exports=function(e,t,r,i){var a,l;"function"==typeof r?(i=r,r={}):r=r||{};let u="object"==typeof e&&!Buffer.isBuffer(e),c=Object.assign({alg:r.algorithm||"HS256",typ:u?"JWT":void 0,kid:r.keyid},r.header);function f(e){if(i)return i(e);throw e}if(!t&&"none"!==r.algorithm)return f(Error("secretOrPrivateKey must have a value"));if(null!=t&&!(t instanceof d))try{t=E(t)}catch(e){try{t=m("string"==typeof t?Buffer.from(t):t)}catch(e){return f(Error("secretOrPrivateKey is not valid key material"))}}if(c.alg.startsWith("HS")&&"secret"!==t.type)return f(Error(`secretOrPrivateKey must be a symmetric key when using ${c.alg}`));if(/^(?:RS|PS|ES)/.test(c.alg)){if("private"!==t.type)return f(Error(`secretOrPrivateKey must be an asymmetric key when using ${c.alg}`));if(!r.allowInsecureKeySizes&&!c.alg.startsWith("ES")&&void 0!==t.asymmetricKeyDetails&&t.asymmetricKeyDetails.modulusLength<2048)return f(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${c.alg}`))}if(void 0===e)return f(Error("payload is required"));if(u){try{a=e,b(g,!0,a,"payload")}catch(e){return f(e)}r.mutatePayload||(e=Object.assign({},e))}else{let t=$.filter(function(e){return void 0!==r[e]});if(t.length>0)return f(Error("invalid "+t.join(",")+" option for "+typeof e+" payload"))}if(void 0!==e.exp&&void 0!==r.expiresIn)return f(Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(void 0!==e.nbf&&void 0!==r.notBefore)return f(Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{l=r,b(v,!1,l,"options")}catch(e){return f(e)}if(!r.allowInvalidAsymmetricKeyTypes)try{o(c.alg,t)}catch(e){return f(e)}let p=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:u&&(e.iat=p),void 0!==r.notBefore){try{e.nbf=n(r.notBefore,p)}catch(e){return f(e)}if(void 0===e.nbf)return f(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=n(r.expiresIn,p)}catch(e){return f(e)}if(void 0===e.exp)return f(Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(S).forEach(function(t){let n=S[t];if(void 0!==r[t]){if(void 0!==e[n])return f(Error('Bad "options.'+t+'" option. The payload already has an "'+n+'" property.'));e[n]=r[t]}});let y=r.encoding||"utf8";if("function"==typeof i)i=i&&h(i),s.createSign({header:c,privateKey:t,payload:e,encoding:y}).once("error",i).once("done",function(e){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(c.alg)&&e.length<256)return i(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${c.alg}`));i(null,e)});else{let n=s.sign({header:c,payload:e,secret:t,encoding:y});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(c.alg)&&n.length<256)throw Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${c.alg}`);return n}}},7014:function(e,t,r){let n=r(6430),i=r(9387),o=r(7147),s=r(7661),a=r(3742),l=r(9572),u=r(5582),c=r(1525),{KeyObject:f,createSecretKey:p,createPublicKey:h}=r(6982),d=["RS256","RS384","RS512"],m=["ES256","ES384","ES512"],E=["RS256","RS384","RS512"],y=["HS256","HS384","HS512"];u&&(d.splice(d.length,0,"PS256","PS384","PS512"),E.splice(E.length,0,"PS256","PS384","PS512")),e.exports=function(e,t,r,u){let v,g,b;if("function"!=typeof r||u||(u=r,r={}),r||(r={}),r=Object.assign({},r),v=u||function(e,t){if(e)throw e;return t},r.clockTimestamp&&"number"!=typeof r.clockTimestamp)return v(new n("clockTimestamp must be a number"));if(void 0!==r.nonce&&("string"!=typeof r.nonce||""===r.nonce.trim()))return v(new n("nonce must be a non-empty string"));if(void 0!==r.allowInvalidAsymmetricKeyTypes&&"boolean"!=typeof r.allowInvalidAsymmetricKeyTypes)return v(new n("allowInvalidAsymmetricKeyTypes must be a boolean"));let S=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return v(new n("jwt must be provided"));if("string"!=typeof e)return v(new n("jwt must be a string"));let $=e.split(".");if(3!==$.length)return v(new n("jwt malformed"));try{g=s(e,{complete:!0})}catch(e){return v(e)}if(!g)return v(new n("invalid token"));let w=g.header;if("function"==typeof t){if(!u)return v(new n("verify must be called asynchronous if secret or public key is provided as a callback"));b=t}else b=function(e,r){return r(null,t)};return b(w,function(t,s){let u;if(t)return v(new n("error in secret or public key callback: "+t.message));let b=""!==$[2].trim();if(!b&&s)return v(new n("jwt signature is required"));if(b&&!s)return v(new n("secret or public key must be provided"));if(!b&&!r.algorithms)return v(new n('please specify "none" in "algorithms" to verify unsigned tokens'));if(null!=s&&!(s instanceof f))try{s=h(s)}catch(e){try{s=p("string"==typeof s?Buffer.from(s):s)}catch(e){return v(new n("secretOrPublicKey is not valid key material"))}}if(r.algorithms||("secret"===s.type?r.algorithms=y:["rsa","rsa-pss"].includes(s.asymmetricKeyType)?r.algorithms=E:"ec"===s.asymmetricKeyType?r.algorithms=m:r.algorithms=d),-1===r.algorithms.indexOf(g.header.alg))return v(new n("invalid algorithm"));if(w.alg.startsWith("HS")&&"secret"!==s.type)return v(new n(`secretOrPublicKey must be a symmetric key when using ${w.alg}`));if(/^(?:RS|PS|ES)/.test(w.alg)&&"public"!==s.type)return v(new n(`secretOrPublicKey must be an asymmetric key when using ${w.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{l(w.alg,s)}catch(e){return v(e)}try{u=c.verify(e,g.header.alg,s)}catch(e){return v(e)}if(!u)return v(new n("invalid signature"));let I=g.payload;if(void 0!==I.nbf&&!r.ignoreNotBefore){if("number"!=typeof I.nbf)return v(new n("invalid nbf value"));if(I.nbf>S+(r.clockTolerance||0))return v(new i("jwt not active",new Date(1e3*I.nbf)))}if(void 0!==I.exp&&!r.ignoreExpiration){if("number"!=typeof I.exp)return v(new n("invalid exp value"));if(S>=I.exp+(r.clockTolerance||0))return v(new o("jwt expired",new Date(1e3*I.exp)))}if(r.audience){let e=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(I.aud)?I.aud:[I.aud]).some(function(t){return e.some(function(e){return e instanceof RegExp?e.test(t):e===t})}))return v(new n("jwt audience invalid. expected: "+e.join(" or ")))}if(r.issuer&&("string"==typeof r.issuer&&I.iss!==r.issuer||Array.isArray(r.issuer)&&-1===r.issuer.indexOf(I.iss)))return v(new n("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&I.sub!==r.subject)return v(new n("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&I.jti!==r.jwtid)return v(new n("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&I.nonce!==r.nonce)return v(new n("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if("number"!=typeof I.iat)return v(new n("iat required when maxAge is specified"));let e=a(r.maxAge,I.iat);if(void 0===e)return v(new n('"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 o("maxAge exceeded",new Date(1e3*e)))}return!0===r.complete?v(null,{header:w,payload:I,signature:g.signature}):v(null,I)})}},3569:function(e,t,r){var n,i=r(6608).Buffer,o=r(6982),s=r(9053),a=r(9023),l="secret must be a string or buffer",u="key must be a string or a buffer",c="function"==typeof o.createPublicKey;function f(e){if(!i.isBuffer(e)&&"string"!=typeof e&&(!c||"object"!=typeof e||"string"!=typeof e.type||"string"!=typeof e.asymmetricKeyType||"function"!=typeof e.export))throw m(u)}function p(e){if(!i.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 d(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(a.format.bind(a,e).apply(null,t))}function E(e){var t;return t=e,i.isBuffer(t)||"string"==typeof t||(e=JSON.stringify(e)),e}function y(e){return function(t,r){!function(e){if(!i.isBuffer(e)){if("string"!=typeof e){if(!c||"object"!=typeof e||"secret"!==e.type||"function"!=typeof e.export)throw m(l)}}}(r),t=E(t);var n=o.createHmac("sha"+e,r);return h((n.update(t),n.digest("base64")))}}c&&(u+=" or a KeyObject",l+="or a KeyObject");var v="timingSafeEqual"in o?function(e,t){return e.byteLength===t.byteLength&&o.timingSafeEqual(e,t)}:function(e,t){return n||(n=r(9454)),n(e,t)};function g(e){return function(t,r,n){var o=y(e)(t,n);return v(i.from(r),i.from(o))}}function b(e){return function(t,r){p(r),t=E(t);var n=o.createSign("RSA-SHA"+e);return h((n.update(t),n.sign(r,"base64")))}}function S(e){return function(t,r,n){f(n),t=E(t),r=d(r);var i=o.createVerify("RSA-SHA"+e);return i.update(t),i.verify(n,r,"base64")}}function $(e){return function(t,r){p(r),t=E(t);var n=o.createSign("RSA-SHA"+e);return h((n.update(t),n.sign({key:r,padding:o.constants.RSA_PKCS1_PSS_PADDING,saltLength:o.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}function w(e){return function(t,r,n){f(n),t=E(t),r=d(r);var i=o.createVerify("RSA-SHA"+e);return i.update(t),i.verify({key:n,padding:o.constants.RSA_PKCS1_PSS_PADDING,saltLength:o.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function I(e){var t=b(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,n,i){return t(r,n=s.joseToDer(n,"ES"+e).toString("base64"),i)}}function O(){return function(){return""}}function A(){return function(e,t){return""===t}}e.exports=function(e){var t=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i);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(),n=t[2];return{sign:({hs:y,rs:b,ps:$,es:I,none:O})[r](n),verify:({hs:g,rs:S,ps:w,es:R,none:A})[r](n)}}},1525:function(e,t,r){var n=r(4397),i=r(169);t.ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],t.sign=n.sign,t.verify=i.verify,t.decode=i.decode,t.isValid=i.isValid,t.createSign=function(e){return new n(e)},t.createVerify=function(e){return new i(e)}},1882:function(e,t,r){var n=r(6608).Buffer,i=r(2203);function o(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=n.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=n.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(o,i),o.prototype.write=function(e){this.buffer=n.concat([this.buffer,n.from(e)]),this.emit("data",e)},o.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},e.exports=o},4397:function(e,t,r){var n=r(6608).Buffer,i=r(1882),o=r(3569),s=r(2203),a=r(7265),l=r(9023);function u(e,t){return n.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(e){var t,r,n,i=e.header,s=e.payload,c=e.secret||e.privateKey,f=e.encoding,p=o(i.alg),h=(t=(t=f)||"utf8",r=u(a(i),"binary"),n=u(a(s),t),l.format("%s.%s",r,n)),d=p.sign(h,c);return l.format("%s.%s",h,d)}function f(e){var t=new i(e.secret||e.privateKey||e.key);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=t,this.payload=new i(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(f,s),f.prototype.sign=function(){try{var e=c({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")}},f.sign=c,e.exports=f},7265:function(e,t,r){var n=r(181).Buffer;e.exports=function(e){return"string"==typeof e?e:"number"==typeof e||n.isBuffer(e)?e.toString():JSON.stringify(e)}},169:function(e,t,r){var n=r(6608).Buffer,i=r(1882),o=r(3569),s=r(2203),a=r(7265),l=r(9023),u=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function c(e){var t=e.split(".",1)[0],r=n.from(t,"base64").toString("binary");if("[object Object]"===Object.prototype.toString.call(r))return r;try{return JSON.parse(r)}catch(e){return}}function f(e){return e.split(".")[2]}function p(e){return u.test(e)&&!!c(e)}function h(e,t,r){if(!t){var n=Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}var i=f(e=a(e)),s=e.split(".",2).join(".");return o(t).verify(s,i,r)}function d(e,t){if(t=t||{},!p(e=a(e)))return null;var r,i,o=c(e);if(!o)return null;var s=(r=r||"utf8",i=e.split(".")[1],n.from(i,"base64").toString(r));return("JWT"===o.typ||t.json)&&(s=JSON.parse(s,t.encoding)),{header:o,payload:s,signature:f(e)}}function m(e){var t=new i((e=e||{}).secret||e.publicKey||e.key);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=t,this.signature=new i(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=d(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=d,m.isValid=p,m.verify=h,e.exports=m},5357:function(e){var t,r,n=1/0,i=0/0,o=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=/^(?:0|[1-9]\d*)$/,c=parseInt;function f(e){return e!=e}var p=Object.prototype,h=p.hasOwnProperty,d=p.toString,m=p.propertyIsEnumerable,E=(t=Object.keys,r=Object,function(e){return t(r(e))}),y=Math.max,v=Array.isArray;function g(e){var t,r,n;return null!=e&&"number"==typeof(t=e.length)&&t>-1&&t%1==0&&t<=0x1fffffffffffff&&"[object Function]"!=(n=b(r=e)?d.call(r):"")&&"[object GeneratorFunction]"!=n}function b(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=g(e)?e:function(e){return e?function(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}(g(e)?function(e,t){var r,n,i,o,s=v(e)||S(n=r=e)&&g(n)&&h.call(r,"callee")&&(!m.call(r,"callee")||"[object Arguments]"==d.call(r))?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],a=s.length,l=!!a;for(var c in e){h.call(e,c)&&!(l&&("length"==c||(i=c,(o=null==(o=a)?0x1fffffffffffff:o)&&("number"==typeof i||u.test(i))&&i>-1&&i%1==0&&i<o)))&&s.push(c)}return s}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||p))return E(e);var t,r,n=[];for(var i in Object(e))h.call(e,i)&&"constructor"!=i&&n.push(i);return n}(e),function(t){return e[t]}):[]}(e),r=r&&!$?(R=(I=(w=r)?(w=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||S(t)&&"[object Symbol]"==d.call(t))return i;if(b(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=b(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=a.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):s.test(e)?i:+e}(w))===n||w===-n?(w<0?-1:1)*17976931348623157e292:w==w?w:0:0===w?w:0)%1,I==I?R?I-R:I:0):0;var w,I,R,O,A=e.length;return r<0&&(r=y(A+r,0)),"string"==typeof(O=e)||!v(O)&&S(O)&&"[object String]"==d.call(O)?r<=A&&e.indexOf(t,r)>-1:!!A&&function(e,t,r){if(t!=t){for(var n=e.length,i=r+-1;++i<n;)if(f(e[i],i,e))return i;return -1}for(var o=r-1,s=e.length;++o<s;)if(e[o]===t)return o;return -1}(e,t,r)>-1}},6782:function(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:function(e){var t=1/0,r=0/0,n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,l=Object.prototype.toString;function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var c,f,p;return"number"==typeof e&&e==(p=(f=(c=e)?(c=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(u(e)){var t,c="function"==typeof e.valueOf?e.valueOf():e;e=u(c)?c+"":c}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var f=o.test(e);return f||s.test(e)?a(e.slice(2),f?2:8):i.test(e)?r:+e}(c))===t||c===-t?(c<0?-1:1)*17976931348623157e292:c==c?c:0:0===c?c:0)%1,f==f?p?f-p:f:0)}},8094:function(e){var t=Object.prototype.toString;e.exports=function(e){return"number"==typeof e||!!e&&"object"==typeof e&&"[object Number]"==t.call(e)}},6052:function(e){var t,r,n=Object.prototype,i=Function.prototype.toString,o=n.hasOwnProperty,s=i.call(Object),a=n.toString,l=(t=Object.getPrototypeOf,r=Object,function(e){return t(r(e))});e.exports=function(e){if(!(e&&"object"==typeof e)||"[object Object]"!=a.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=o.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&i.call(r)==s}},1251:function(e){var t=Object.prototype.toString,r=Array.isArray;e.exports=function(e){var n;return"string"==typeof e||!r(e)&&!!(n=e)&&"object"==typeof n&&"[object String]"==t.call(e)}},8430:function(e){var t=1/0,r=0/0,n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,l=Object.prototype.toString;function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var c,f,p,h,d=2,m=e;if("function"!=typeof m)throw TypeError("Expected a function");return p=(f=(c=d)?(c=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(u(e)){var t,c="function"==typeof e.valueOf?e.valueOf():e;e=u(c)?c+"":c}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var f=o.test(e);return f||s.test(e)?a(e.slice(2),f?2:8):i.test(e)?r:+e}(c))===t||c===-t?(c<0?-1:1)*17976931348623157e292:c==c?c:0:0===c?c:0)%1,d=f==f?p?f-p:f:0,function(){return--d>0&&(h=m.apply(this,arguments)),d<=1&&(m=void 0),h}}},3866:function(e){function t(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}e.exports=function(e,r){r=r||{};var n,i,o,s,a=typeof e;if("string"===a&&e.length>0){var l=e;if(!((l=String(l)).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(l);if(u){var c=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*c;case"weeks":case"week":case"w":return 6048e5*c;case"days":case"day":case"d":return 864e5*c;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*c;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*c;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:break}}}return}if("number"===a&&isFinite(e)){return r.long?(i=Math.abs(n=e))>=864e5?t(n,i,864e5,"day"):i>=36e5?t(n,i,36e5,"hour"):i>=6e4?t(n,i,6e4,"minute"):i>=1e3?t(n,i,1e3,"second"):n+" ms":(s=Math.abs(o=e))>=864e5?Math.round(o/864e5)+"d":s>=36e5?Math.round(o/36e5)+"h":s>=6e4?Math.round(o/6e4)+"m":s>=1e3?Math.round(o/1e3)+"s":o+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},6608:function(e,t,r){var n=r(181),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},8610:function(e,t,r){"use strict";let n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof i)if(!!t.loose===e.loose)return e;else e=e.value;u("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){let t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.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 c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new f(e.value,t).test(this.value):""===e.operator?""===e.value||new f(this.value,t).test(e.semver):!((t=o(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=i;let o=r(4621),{safeRe:s,t:a}=r(152),l=r(5461),u=r(674),c=r(2398),f=r(2069)},2069:function(e,t,r){"use strict";let n=/\s+/g;class i{constructor(e,t){if(t=s(t),e instanceof i)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else return new i(e.raw,t);if(e instanceof a)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(n," "),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=>!y(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&&E))+":"+e,r=o.get(t);if(r)return r;let n=this.options.loose,i=n?c[f.HYPHENRANGELOOSE]:c[f.HYPHENRANGE];l("hyphen replace",e=e.replace(i,T(this.options.includePrerelease))),l("comparator trim",e=e.replace(c[f.COMPARATORTRIM],p)),l("tilde trim",e=e.replace(c[f.TILDETRIM],h)),l("caret trim",e=e.replace(c[f.CARETTRIM],d));let s=e.split(" ").map(e=>b(e,this.options)).join(" ").split(/\s+/).map(e=>x(e,this.options));n&&(s=s.filter(e=>(l("loose invalid filter",e,this.options),!!e.match(c[f.COMPARATORLOOSE])))),l("range list",s);let u=new Map;for(let e of s.map(e=>new a(e,this.options))){if(y(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");let v=[...u.values()];return o.set(t,v),v}intersects(e,t){if(!(e instanceof i))throw TypeError("a Range is required");return this.set.some(r=>g(r,t)&&e.set.some(e=>g(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 u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(L(this.set[t],e,this.options))return!0;return!1}}e.exports=i;let o=new(r(2044)),s=r(4621),a=r(8610),l=r(674),u=r(2398),{safeRe:c,t:f,comparatorTrimReplace:p,tildeTrimReplace:h,caretTrimReplace:d}=r(152),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:E}=r(5076),y=e=>"<0.0.0-0"===e.value,v=e=>""===e.value,g=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(e=>i.intersects(e,t)),i=n.pop();return r},b=(e,t)=>(l("comp",e=e.replace(c[f.BUILD],""),t),l("caret",e=I(e,t)),l("tildes",e=$(e,t)),l("xrange",e=O(e,t)),l("stars",e=N(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?c[f.TILDELOOSE]:c[f.TILDE];return e.replace(r,(t,r,n,i,o)=>{let s;return l("tilde",e,t,r,n,i,o),S(r)?s="":S(n)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:S(i)?s=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(l("replaceTilde pr",o),s=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):s=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,l("tilde return",s),s})},I=(e,t)=>e.trim().split(/\s+/).map(e=>R(e,t)).join(" "),R=(e,t)=>{l("caret",e,t);let r=t.loose?c[f.CARETLOOSE]:c[f.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,i,o,s)=>{let a;return l("caret",e,t,r,i,o,s),S(r)?a="":S(i)?a=`>=${r}.0.0${n} <${+r+1}.0.0-0`:S(o)?a="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:s?(l("replaceCaret pr",s),a="0"===r?"0"===i?`>=${r}.${i}.${o}-${s} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${s} <${+r+1}.0.0-0`):(l("no pr"),a="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),l("caret return",a),a})},O=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map(e=>A(e,t)).join(" ")),A=(e,t)=>{e=e.trim();let r=t.loose?c[f.XRANGELOOSE]:c[f.XRANGE];return e.replace(r,(r,n,i,o,s,a)=>{l("xRange",e,r,n,i,o,s,a);let u=S(i),c=u||S(o),f=c||S(s);return"="===n&&f&&(n=""),a=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(c&&(o=0),s=0,">"===n?(n=">=",c?(i=+i+1,o=0):o=+o+1,s=0):"<="===n&&(n="<",c?i=+i+1:o=+o+1),"<"===n&&(a="-0"),r=`${n+i}.${o}.${s}${a}`):c?r=`>=${i}.0.0${a} <${+i+1}.0.0-0`:f&&(r=`>=${i}.${o}.0${a} <${i}.${+o+1}.0-0`),l("xRange return",r),r})},N=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[f.STAR],"")),x=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?f.GTE0PRE:f.GTE0],"")),T=e=>(t,r,n,i,o,s,a,l,u,c,f,p)=>(r=S(n)?"":S(i)?`>=${n}.0.0${e?"-0":""}`:S(o)?`>=${n}.${i}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`,l=S(u)?"":S(c)?`<${+u+1}.0.0-0`:S(f)?`<${u}.${+c+1}.0-0`:p?`<=${u}.${c}.${f}-${p}`:e?`<${u}.${c}.${+f+1}-0`:`<=${l}`,`${r} ${l}`.trim()),L=(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!==a.ANY&&e[r].semver.prerelease.length>0){let n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},2398:function(e,t,r){"use strict";let n=r(674),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=r(5076),{safeRe:s,t:a}=r(152),l=r(4621),{compareIdentifiers:u}=r(9101);class c{constructor(e,t){if(t=l(t),e instanceof c)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>i)throw TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?s[a.LOOSE]:s[a.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>o||this.major<0)throw TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>o||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<o)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(n("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return(e instanceof c||(e=new c(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 c||(e=new c(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],i=e.prerelease[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return -1;else if(r===i)continue;else return u(r,i)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(n("build compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return -1;else if(r===i)continue;else return u(r,i)}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[a.PRERELEASELOOSE]:s[a.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 n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},5608:function(e,t,r){"use strict";let n=r(6802);e.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},5461:function(e,t,r){"use strict";let n=r(8271),i=r(733),o=r(1686),s=r(6479),a=r(7257),l=r(5850);e.exports=(e,t,r,u)=>{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 n(e,r,u);case"!=":return i(e,r,u);case">":return o(e,r,u);case">=":return s(e,r,u);case"<":return a(e,r,u);case"<=":return l(e,r,u);default:throw TypeError(`Invalid operator: ${t}`)}}},7771:function(e,t,r){"use strict";let n=r(2398),i=r(6802),{safeRe:o,t:s}=r(152);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let n,i=t.includePrerelease?o[s.COERCERTLFULL]:o[s.COERCERTL];for(;(n=i.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),i.lastIndex=n.index+n[1].length+n[2].length;i.lastIndex=-1}else r=e.match(t.includePrerelease?o[s.COERCEFULL]:o[s.COERCE]);if(null===r)return null;let a=r[2],l=r[3]||"0",u=r[4]||"0",c=t.includePrerelease&&r[5]?`-${r[5]}`:"",f=t.includePrerelease&&r[6]?`+${r[6]}`:"";return i(`${a}.${l}.${u}${c}${f}`,t)}},8767:function(e,t,r){"use strict";let n=r(2398);e.exports=(e,t,r)=>{let i=new n(e,r),o=new n(t,r);return i.compare(o)||i.compareBuild(o)}},6293:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t)=>n(e,t,!0)},6958:function(e,t,r){"use strict";let n=r(2398);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},3086:function(e,t,r){"use strict";let n=r(6802);e.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),o=r.compare(i);if(0===o)return null;let s=o>0,a=s?r:i,l=s?i:r,u=!!a.prerelease.length;if(l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(a))return l.minor&&!l.patch?"minor":"patch"}let c=u?"pre":"";return r.major!==i.major?c+"major":r.minor!==i.minor?c+"minor":r.patch!==i.patch?c+"patch":"prerelease"}},8271:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t,r)=>0===n(e,t,r)},1686:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t,r)=>n(e,t,r)>0},6479:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t,r)=>n(e,t,r)>=0},3625:function(e,t,r){"use strict";let n=r(2398);e.exports=(e,t,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,o).version}catch(e){return null}}},7257:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t,r)=>0>n(e,t,r)},5850:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t,r)=>0>=n(e,t,r)},7744:function(e,t,r){"use strict";let n=r(2398);e.exports=(e,t)=>new n(e,t).major},4812:function(e,t,r){"use strict";let n=r(2398);e.exports=(e,t)=>new n(e,t).minor},733:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t,r)=>0!==n(e,t,r)},6802:function(e,t,r){"use strict";let n=r(2398);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},8643:function(e,t,r){"use strict";let n=r(2398);e.exports=(e,t)=>new n(e,t).patch},9283:function(e,t,r){"use strict";let n=r(6802);e.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},7032:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t,r)=>n(t,e,r)},9839:function(e,t,r){"use strict";let n=r(8767);e.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))},4056:function(e,t,r){"use strict";let n=r(2069);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},7697:function(e,t,r){"use strict";let n=r(8767);e.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))},6807:function(e,t,r){"use strict";let n=r(6802);e.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}},3895:function(e,t,r){"use strict";let n=r(152),i=r(5076),o=r(2398),s=r(9101),a=r(6802),l=r(6807),u=r(5608),c=r(3625),f=r(3086),p=r(7744),h=r(4812),d=r(8643),m=r(9283),E=r(6958),y=r(7032),v=r(6293),g=r(8767),b=r(7697),S=r(9839),$=r(1686),w=r(7257),I=r(8271),R=r(733),O=r(6479),A=r(5850),N=r(5461),x=r(7771),T=r(8610),L=r(2069),j=r(4056),P=r(6613),D=r(7114),_=r(1008),k=r(203),C=r(5372),M=r(4713),K=r(4497),V=r(9272),U=r(3490);e.exports={parse:a,valid:l,clean:u,inc:c,diff:f,major:p,minor:h,patch:d,prerelease:m,compare:E,rcompare:y,compareLoose:v,compareBuild:g,sort:b,rsort:S,gt:$,lt:w,eq:I,neq:R,gte:O,lte:A,cmp:N,coerce:x,Comparator:T,Range:L,satisfies:j,toComparators:P,maxSatisfying:D,minSatisfying:_,minVersion:k,validRange:C,outside:M,gtr:K,ltr:V,intersects:U,simplifyRange:r(4039),subset:r(22),SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}},5076:function(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:function(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:function(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 n=t.test(e),i=t.test(r);return n&&i&&(e*=1,r*=1),e===r?0:n&&!i?-1:i&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},2044:function(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:function(e){"use strict";let t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},152:function(e,t,r){"use strict";let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:o}=r(5076),s=r(674),a=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],f=t.t={},p=0,h="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",o],[h,i]],m=(e,t,r)=>{let n=(e=>{for(let[t,r]of d)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=p++;s(e,i,t),f[e]=i,u[i]=t,c[i]=n,a[i]=new RegExp(t,r?"g":void 0),l[i]=new RegExp(n,r?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),m("MAINVERSION",`(${u[f.NUMERICIDENTIFIER]})\\.(${u[f.NUMERICIDENTIFIER]})\\.(${u[f.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${u[f.NUMERICIDENTIFIERLOOSE]})\\.(${u[f.NUMERICIDENTIFIERLOOSE]})\\.(${u[f.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${u[f.NONNUMERICIDENTIFIER]}|${u[f.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${u[f.NONNUMERICIDENTIFIER]}|${u[f.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${u[f.PRERELEASEIDENTIFIER]}(?:\\.${u[f.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${u[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[f.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${h}+`),m("BUILD",`(?:\\+(${u[f.BUILDIDENTIFIER]}(?:\\.${u[f.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${u[f.MAINVERSION]}${u[f.PRERELEASE]}?${u[f.BUILD]}?`),m("FULL",`^${u[f.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${u[f.MAINVERSIONLOOSE]}${u[f.PRERELEASELOOSE]}?${u[f.BUILD]}?`),m("LOOSE",`^${u[f.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${u[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${u[f.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${u[f.XRANGEIDENTIFIER]})(?:\\.(${u[f.XRANGEIDENTIFIER]})(?:\\.(${u[f.XRANGEIDENTIFIER]})(?:${u[f.PRERELEASE]})?${u[f.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${u[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[f.XRANGEIDENTIFIERLOOSE]})(?:${u[f.PRERELEASELOOSE]})?${u[f.BUILD]}?)?)?`),m("XRANGE",`^${u[f.GTLT]}\\s*${u[f.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${u[f.GTLT]}\\s*${u[f.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),m("COERCE",`${u[f.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",u[f.COERCEPLAIN]+`(?:${u[f.PRERELEASE]})?`+`(?:${u[f.BUILD]})?`+"(?:$|[^\\d])"),m("COERCERTL",u[f.COERCE],!0),m("COERCERTLFULL",u[f.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${u[f.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${u[f.LONETILDE]}${u[f.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${u[f.LONETILDE]}${u[f.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${u[f.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${u[f.LONECARET]}${u[f.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${u[f.LONECARET]}${u[f.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${u[f.GTLT]}\\s*(${u[f.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${u[f.GTLT]}\\s*(${u[f.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${u[f.GTLT]}\\s*(${u[f.LOOSEPLAIN]}|${u[f.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${u[f.XRANGEPLAIN]})\\s+-\\s+(${u[f.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${u[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[f.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},4497:function(e,t,r){"use strict";let n=r(4713);e.exports=(e,t,r)=>n(e,t,">",r)},3490:function(e,t,r){"use strict";let n=r(2069);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},9272:function(e,t,r){"use strict";let n=r(4713);e.exports=(e,t,r)=>n(e,t,"<",r)},7114:function(e,t,r){"use strict";let n=r(2398),i=r(2069);e.exports=(e,t,r)=>{let o=null,s=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(!o||-1===s.compare(e))&&(s=new n(o=e,r))}),o}},1008:function(e,t,r){"use strict";let n=r(2398),i=r(2069);e.exports=(e,t,r)=>{let o=null,s=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(!o||1===s.compare(e))&&(s=new n(o=e,r))}),o}},203:function(e,t,r){"use strict";let n=r(2398),i=r(2069),o=r(1686);e.exports=(e,t)=>{e=new i(e,t);let r=new n("0.0.0");if(e.test(r)||(r=new n("0.0.0-0"),e.test(r)))return r;r=null;for(let t=0;t<e.set.length;++t){let i=e.set[t],s=null;i.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":(!s||o(t,s))&&(s=t);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),s&&(!r||o(r,s))&&(r=s)}return r&&e.test(r)?r:null}},4713:function(e,t,r){"use strict";let n=r(2398),i=r(8610),{ANY:o}=i,s=r(2069),a=r(4056),l=r(1686),u=r(7257),c=r(5850),f=r(6479);e.exports=(e,t,r,p)=>{let h,d,m,E,y;switch(e=new n(e,p),t=new s(t,p),r){case">":h=l,d=c,m=u,E=">",y=">=";break;case"<":h=u,d=f,m=l,E="<",y="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,p))return!1;for(let r=0;r<t.set.length;++r){let n=t.set[r],s=null,a=null;if(n.forEach(e=>{e.semver===o&&(e=new i(">=0.0.0")),s=s||e,a=a||e,h(e.semver,s.semver,p)?s=e:m(e.semver,a.semver,p)&&(a=e)}),s.operator===E||s.operator===y||(!a.operator||a.operator===E)&&d(e,a.semver)||a.operator===y&&m(e,a.semver))return!1}return!0}},4039:function(e,t,r){"use strict";let n=r(4056),i=r(6958);e.exports=(e,t,r)=>{let o=[],s=null,a=null,l=e.sort((e,t)=>i(e,t,r));for(let e of l)n(e,t,r)?(a=e,s||(s=e)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);let u=[];for(let[e,t]of o)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");let c=u.join(" || "),f="string"==typeof t.raw?t.raw:String(t);return c.length<f.length?c:t}},22:function(e,t,r){"use strict";let n=r(2069),i=r(8610),{ANY:o}=i,s=r(4056),a=r(6958),l=[new i(">=0.0.0-0")],u=[new i(">=0.0.0")],c=(e,t,r)=>{let n,i,c,h,d,m,E;if(e===t)return!0;if(1===e.length&&e[0].semver===o)if(1===t.length&&t[0].semver===o)return!0;else e=r.includePrerelease?l:u;if(1===t.length&&t[0].semver===o)if(r.includePrerelease)return!0;else t=u;let y=new Set;for(let t of e)">"===t.operator||">="===t.operator?n=f(n,t,r):"<"===t.operator||"<="===t.operator?i=p(i,t,r):y.add(t.semver);if(y.size>1)return null;if(n&&i&&((c=a(n.semver,i.semver,r))>0||0===c&&(">="!==n.operator||"<="!==i.operator)))return null;for(let e of y){if(n&&!s(e,String(n),r)||i&&!s(e,String(i),r))return null;for(let n of t)if(!s(e,String(n),r))return!1;return!0}let v=!!i&&!r.includePrerelease&&!!i.semver.prerelease.length&&i.semver,g=!!n&&!r.includePrerelease&&!!n.semver.prerelease.length&&n.semver;for(let e of(v&&1===v.prerelease.length&&"<"===i.operator&&0===v.prerelease[0]&&(v=!1),t)){if(E=E||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,n){if(g&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===g.major&&e.semver.minor===g.minor&&e.semver.patch===g.patch&&(g=!1),">"===e.operator||">="===e.operator){if((h=f(n,e,r))===e&&h!==n)return!1}else if(">="===n.operator&&!s(n.semver,String(e),r))return!1}if(i){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((d=p(i,e,r))===e&&d!==i)return!1}else if("<="===i.operator&&!s(i.semver,String(e),r))return!1}if(!e.operator&&(i||n)&&0!==c)return!1}return(!n||!m||!!i||0===c)&&(!i||!E||!!n||0===c)&&!g&&!v&&!0},f=(e,t,r)=>{if(!e)return t;let n=a(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,r)=>{if(!e)return t;let n=a(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;e:for(let n of e.set){for(let e of t.set){let t=c(n,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},6613:function(e,t,r){"use strict";let n=r(2069);e.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},5372:function(e,t,r){"use strict";let n=r(2069);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},181:function(e){"use strict";e.exports=require("buffer")},6982:function(e){"use strict";e.exports=require("crypto")},9896:function(e){"use strict";e.exports=require("fs")},857:function(e){"use strict";e.exports=require("os")},6928:function(e){"use strict";e.exports=require("path")},2203:function(e){"use strict";e.exports=require("stream")},9023:function(e){"use strict";e.exports=require("util")},2741:function(t){"use strict";t.exports=e},4519:function(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}}')}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={exports:{}};return t[e](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{createContext:()=>d,jwtAuthMiddleware:()=>f,apiKeyAuthMiddleware:()=>l,completable:()=>E});var e,t=n(8583),r=n.n(t),o=n(2741);let s=o.z.object({apiKey:o.z.string().optional(),headerName:o.z.string().optional(),validateApiKey:o.z.function().args(o.z.string()).returns(o.z.promise(o.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"}),a="Unauthorized: Missing or invalid API key";function l(e){let t=s.safeParse(e);if(!t.success){let r="apiKey"in e,n="validateApiKey"in e;if(r&&n)throw Error("'apiKey' and 'validateApiKey' are mutually exclusive - provide only one");if(r||n)throw Error(`Invalid configuration: ${t.error.message}`);throw Error("Either 'apiKey' or 'validateApiKey' must be provided")}let r=e.headerName??"x-api-key",n="apiKey"in e?e.apiKey:void 0,i="validateApiKey"in e?e.validateApiKey:void 0;return async(t,o,s)=>{let l=t.header(r);!l||"apiKey"in e&&l!==n||i&&!await i(l)?o.status(401).json({error:a}):s()}}var u=n(7619),c=n.n(u);function f(e){return(t,r,n)=>{let i=t.header("Authorization");if(!i||!i.startsWith("Bearer "))return void r.status(401).json({error:"Unauthorized: Missing or malformed Authorization header"});let o=i.slice(7).trim();if(!o)return void r.status(401).json({error:"Unauthorized: Missing access token"});try{let{secret:r,...i}=e;t.user=c().verify(o,r,i),n()}catch(e){r.status(401).json({error:"Unauthorized: Invalid or expired token"})}}}let p=require("async_hooks"),h=e=>globalThis[e];function d({name:e}){let t=Symbol.for(`xmcp-context-${e}`);if(h(t))return h(t);let r=new p.AsyncLocalStorage,n={provider:(e,t)=>r.run(e,t),getContext:()=>{let t=r.getStore();if(!t)throw Error(`getContext() can only be used within the ${e} context.`);return t},setContext:t=>{let n=r.getStore();if(!n)throw Error(`setContext() can only be used within the ${e} context.`);Object.assign(n,t)}};return globalThis[t]=n,n}(e||(e={})).Completable="McpCompletable";class m extends o.ZodType{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}function E(e,t){return m.create(e,{...e._def,complete:t})}m.create=(t,r)=>new m({type:t,typeName:e.Completable,complete:r.complete,...function(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{var o,s;let{message:a}=e;return"invalid_enum_value"===t.code?{message:null!=a?a:i.defaultError}:void 0===i.data?{message:null!=(o=null!=a?a:n)?o:i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:null!=(s=null!=a?a:r)?s:i.defaultError}},description:i}}(r)}),r().config()})(),i})());
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("zod"));else if("function"==typeof define&&define.amd)define(["zod"],t);else{var r="object"==typeof exports?t(require("zod")):t(e.zod);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,e=>(()=>{var t={9454:function(e,t,r){"use strict";var n=r(181).Buffer,i=r(181).SlowBuffer;function o(e,t){if(!n.isBuffer(e)||!n.isBuffer(t)||e.length!==t.length)return!1;for(var r=0,i=0;i<e.length;i++)r|=e[i]^t[i];return 0===r}e.exports=o,o.install=function(){n.prototype.equal=i.prototype.equal=function(e){return o(this,e)}};var s=n.prototype.equal,a=i.prototype.equal;o.restore=function(){n.prototype.equal=s,i.prototype.equal=a}},8583:function(e,t,r){let n=r(9896),i=r(6928),o=r(857),s=r(6982),a=r(4519).version,l=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function u(e){console.log(`[dotenv@${a}][DEBUG] ${e}`)}function c(e){console.log(`[dotenv@${a}] ${e}`)}function f(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)n.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=i.resolve(process.cwd(),".env.vault");return n.existsSync(t)?t:null}function h(e){return"~"===e[0]?i.join(o.homedir(),e.slice(1)):e}let d={configDotenv:function(e){let t,r=i.resolve(process.cwd(),".env"),o="utf8",s=!!(e&&e.debug),a=!e||!("quiet"in e)||e.quiet;e&&e.encoding?o=e.encoding:s&&u("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 f={};for(let r of l)try{let t=d.parse(n.readFileSync(r,{encoding:o}));d.populate(f,t,e)}catch(e){s&&u(`Failed to load ${r} ${e.message}`),t=e}let p=process.env;if(e&&null!=e.processEnv&&(p=e.processEnv),d.populate(p,f,e),s||!a){let e=Object.keys(f).length,r=[];for(let e of l)try{let t=i.relative(process.cwd(),e);r.push(t)}catch(r){s&&u(`Failed to load ${e} ${r.message}`),t=r}c(`injecting env (${e}) from ${r.join(",")}`)}return t?{parsed:f,error:t}:{parsed:f}},_configVault:function(e){let t=!!(e&&e.debug),r=!e||!("quiet"in e)||e.quiet;(t||!r)&&c("Loading env from encrypted .env.vault");let n=d._parseVault(e),i=process.env;return e&&null!=e.processEnv&&(i=e.processEnv),d.populate(i,n,e),{parsed:n}},_parseVault:function(e){let t,r=p(e=e||{});e.path=r;let n=d.configDotenv(e);if(!n.parsed){let e=Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);throw e.code="MISSING_DATA",e}let i=f(e).split(","),o=i.length;for(let e=0;e<o;e++)try{let r=i[e].trim(),o=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 n=r.password;if(!n){let e=Error("INVALID_DOTENV_KEY: Missing key part");throw e.code="INVALID_DOTENV_KEY",e}let i=r.searchParams.get("environment");if(!i){let e=Error("INVALID_DOTENV_KEY: Missing environment part");throw e.code="INVALID_DOTENV_KEY",e}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let e=Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw e.code="NOT_FOUND_DOTENV_ENVIRONMENT",e}return{ciphertext:s,key:n}}(n,r);t=d.decrypt(o.ciphertext,o.key);break}catch(t){if(e+1>=o)throw t}return d.parse(t)},config:function(e){if(0===f(e).length)return d.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@${a}][WARN] ${r}`),d.configDotenv(e)}return d._configVault(e)},decrypt:function(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let e=s.createDecipheriv("aes-256-gcm",r,i);return e.setAuthTag(o),`${e.update(n)}${e.final()}`}catch(n){let e=n instanceof RangeError,t="Invalid key length"===n.message,r="Unsupported state or unable to authenticate data"===n.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 n}},parse:function(e){let t,r={},n=e.toString();for(n=n.replace(/\r\n?/mg,"\n");null!=(t=l.exec(n));){let e=t[1],n=t[2]||"",i=(n=n.trim())[0];n=n.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),'"'===i&&(n=(n=n.replace(/\\n/g,"\n")).replace(/\\r/g,"\r")),r[e]=n}return r},populate:function(e,t,r={}){let n=!!(r&&r.debug),i=!!(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===i&&(e[r]=t[r]),n&&(!0===i?u(`"${r}" is already defined and WAS overwritten`):u(`"${r}" is already defined and was NOT overwritten`))):e[r]=t[r]}};e.exports.configDotenv=d.configDotenv,e.exports._configVault=d._configVault,e.exports._parseVault=d._parseVault,e.exports.config=d.config,e.exports.decrypt=d.decrypt,e.exports.parse=d.parse,e.exports.populate=d.populate,e.exports=d},9053:function(e,t,r){"use strict";var n=r(6608).Buffer,i=r(2188);function o(e){if(n.isBuffer(e))return e;if("string"==typeof e)return n.from(e,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function s(e,t,r){for(var n=0;t+n<r&&0===e[t+n];)++n;return e[t+n]>=128&&--n,n}e.exports={derToJose:function(e,t){e=o(e);var r=i(t),s=r+1,a=e.length,l=0;if(48!==e[l++])throw Error('Could not find expected "seq"');var u=e[l++];if(129===u&&(u=e[l++]),a-l<u)throw Error('"seq" specified length of "'+u+'", only "'+(a-l)+'" remaining');if(2!==e[l++])throw Error('Could not find expected "int" for "r"');var c=e[l++];if(a-l-2<c)throw Error('"r" specified length of "'+c+'", only "'+(a-l-2)+'" available');if(s<c)throw Error('"r" specified length of "'+c+'", max of "'+s+'" is acceptable');var f=l;if(l+=c,2!==e[l++])throw Error('Could not find expected "int" for "s"');var p=e[l++];if(a-l!==p)throw Error('"s" specified length of "'+p+'", expected "'+(a-l)+'"');if(s<p)throw Error('"s" specified length of "'+p+'", max of "'+s+'" is acceptable');var h=l;if((l+=p)!==a)throw Error('Expected to consume entire buffer, but "'+(a-l)+'" bytes remain');var d=r-c,m=r-p,E=n.allocUnsafe(d+c+m+p);for(l=0;l<d;++l)E[l]=0;e.copy(E,l,f+Math.max(-d,0),f+c),l=r;for(var y=l;l<y+m;++l)E[l]=0;return e.copy(E,l,h+Math.max(-m,0),h+p),E=(E=E.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(e,t){e=o(e);var r=i(t),a=e.length;if(a!==2*r)throw TypeError('"'+t+'" signatures must be "'+2*r+'" bytes, saw "'+a+'"');var l=s(e,0,r),u=s(e,r,e.length),c=r-l,f=r-u,p=2+c+1+1+f,h=p<128,d=n.allocUnsafe((h?2:3)+p),m=0;return d[m++]=48,h?d[m++]=p:(d[m++]=129,d[m++]=255&p),d[m++]=2,d[m++]=c,l<0?(d[m++]=0,m+=e.copy(d,m,0,r)):m+=e.copy(d,m,l,r),d[m++]=2,d[m++]=f,u<0?(d[m++]=0,e.copy(d,m,r)):e.copy(d,m,r+u),d}}},2188:function(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+'"')}},7661:function(e,t,r){var n=r(1525);e.exports=function(e,t){t=t||{};var r=n.decode(e,t);if(!r)return null;var i=r.payload;if("string"==typeof i)try{var o=JSON.parse(i);null!==o&&"object"==typeof o&&(i=o)}catch(e){}return!0===t.complete?{header:r.header,payload:i,signature:r.signature}:i}},7619:function(e,t,r){e.exports={decode:r(7661),verify:r(7014),sign:r(3418),JsonWebTokenError:r(6430),NotBeforeError:r(9387),TokenExpiredError:r(7147)}},6430:function(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},9387:function(e,t,r){var n=r(6430),i=function(e,t){n.call(this,e),this.name="NotBeforeError",this.date=t};i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},7147:function(e,t,r){var n=r(6430),i=function(e,t){n.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},8050:function(e,t,r){e.exports=r(3895).satisfies(process.version,">=15.7.0")},5582:function(e,t,r){e.exports=r(3895).satisfies(process.version,"^6.12.0 || >=8.0.0")},5612:function(e,t,r){e.exports=r(3895).satisfies(process.version,">=16.9.0")},3742:function(e,t,r){var n=r(3866);e.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if("string"==typeof e){var i=n(e);if(void 0===i)return;return Math.floor(r+i/1e3)}if("number"==typeof e)return r+e}},9572:function(e,t,r){let n=r(8050),i=r(5612),o={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 a=o[r];if(!a)throw Error(`Unknown key type "${r}".`);if(!a.includes(e))throw Error(`"alg" parameter for "${r}" key type must be one of: ${a.join(", ")}.`);if(n)switch(r){case"ec":let l=t.asymmetricKeyDetails.namedCurve,u=s[e];if(l!==u)throw Error(`"alg" parameter "${e}" requires curve "${u}".`);break;case"rsa-pss":if(i){let r=parseInt(e.slice(-3),10),{hashAlgorithm:n,mgf1HashAlgorithm:i,saltLength:o}=t.asymmetricKeyDetails;if(n!==`sha${r}`||i!==n)throw Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(void 0!==o&&o>r>>3)throw Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}}}},3418:function(e,t,r){let n=r(3742),i=r(5582),o=r(9572),s=r(1525),a=r(5357),l=r(6782),u=r(5250),c=r(8094),f=r(6052),p=r(1251),h=r(8430),{KeyObject:d,createSecretKey:m,createPrivateKey:E}=r(6982),y=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];i&&y.splice(3,0,"PS256","PS384","PS512");let v={expiresIn:{isValid:function(e){return u(e)||p(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return u(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:a.bind(null,y),message:'"algorithm" must be a valid string enum value'},header:{isValid:f,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'}},g={iat:{isValid:c,message:'"iat" should be a number of seconds'},exp:{isValid:c,message:'"exp" should be a number of seconds'},nbf:{isValid:c,message:'"nbf" should be a number of seconds'}};function b(e,t,r,n){if(!f(r))throw Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(i){let o=e[i];if(!o){if(!t)throw Error('"'+i+'" is not allowed in "'+n+'"');return}if(!o.isValid(r[i]))throw Error(o.message)})}let S={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},$=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];e.exports=function(e,t,r,i){var a,l;"function"==typeof r?(i=r,r={}):r=r||{};let u="object"==typeof e&&!Buffer.isBuffer(e),c=Object.assign({alg:r.algorithm||"HS256",typ:u?"JWT":void 0,kid:r.keyid},r.header);function f(e){if(i)return i(e);throw e}if(!t&&"none"!==r.algorithm)return f(Error("secretOrPrivateKey must have a value"));if(null!=t&&!(t instanceof d))try{t=E(t)}catch(e){try{t=m("string"==typeof t?Buffer.from(t):t)}catch(e){return f(Error("secretOrPrivateKey is not valid key material"))}}if(c.alg.startsWith("HS")&&"secret"!==t.type)return f(Error(`secretOrPrivateKey must be a symmetric key when using ${c.alg}`));if(/^(?:RS|PS|ES)/.test(c.alg)){if("private"!==t.type)return f(Error(`secretOrPrivateKey must be an asymmetric key when using ${c.alg}`));if(!r.allowInsecureKeySizes&&!c.alg.startsWith("ES")&&void 0!==t.asymmetricKeyDetails&&t.asymmetricKeyDetails.modulusLength<2048)return f(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${c.alg}`))}if(void 0===e)return f(Error("payload is required"));if(u){try{a=e,b(g,!0,a,"payload")}catch(e){return f(e)}r.mutatePayload||(e=Object.assign({},e))}else{let t=$.filter(function(e){return void 0!==r[e]});if(t.length>0)return f(Error("invalid "+t.join(",")+" option for "+typeof e+" payload"))}if(void 0!==e.exp&&void 0!==r.expiresIn)return f(Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(void 0!==e.nbf&&void 0!==r.notBefore)return f(Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{l=r,b(v,!1,l,"options")}catch(e){return f(e)}if(!r.allowInvalidAsymmetricKeyTypes)try{o(c.alg,t)}catch(e){return f(e)}let p=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:u&&(e.iat=p),void 0!==r.notBefore){try{e.nbf=n(r.notBefore,p)}catch(e){return f(e)}if(void 0===e.nbf)return f(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=n(r.expiresIn,p)}catch(e){return f(e)}if(void 0===e.exp)return f(Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(S).forEach(function(t){let n=S[t];if(void 0!==r[t]){if(void 0!==e[n])return f(Error('Bad "options.'+t+'" option. The payload already has an "'+n+'" property.'));e[n]=r[t]}});let y=r.encoding||"utf8";if("function"==typeof i)i=i&&h(i),s.createSign({header:c,privateKey:t,payload:e,encoding:y}).once("error",i).once("done",function(e){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(c.alg)&&e.length<256)return i(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${c.alg}`));i(null,e)});else{let n=s.sign({header:c,payload:e,secret:t,encoding:y});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(c.alg)&&n.length<256)throw Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${c.alg}`);return n}}},7014:function(e,t,r){let n=r(6430),i=r(9387),o=r(7147),s=r(7661),a=r(3742),l=r(9572),u=r(5582),c=r(1525),{KeyObject:f,createSecretKey:p,createPublicKey:h}=r(6982),d=["RS256","RS384","RS512"],m=["ES256","ES384","ES512"],E=["RS256","RS384","RS512"],y=["HS256","HS384","HS512"];u&&(d.splice(d.length,0,"PS256","PS384","PS512"),E.splice(E.length,0,"PS256","PS384","PS512")),e.exports=function(e,t,r,u){let v,g,b;if("function"!=typeof r||u||(u=r,r={}),r||(r={}),r=Object.assign({},r),v=u||function(e,t){if(e)throw e;return t},r.clockTimestamp&&"number"!=typeof r.clockTimestamp)return v(new n("clockTimestamp must be a number"));if(void 0!==r.nonce&&("string"!=typeof r.nonce||""===r.nonce.trim()))return v(new n("nonce must be a non-empty string"));if(void 0!==r.allowInvalidAsymmetricKeyTypes&&"boolean"!=typeof r.allowInvalidAsymmetricKeyTypes)return v(new n("allowInvalidAsymmetricKeyTypes must be a boolean"));let S=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return v(new n("jwt must be provided"));if("string"!=typeof e)return v(new n("jwt must be a string"));let $=e.split(".");if(3!==$.length)return v(new n("jwt malformed"));try{g=s(e,{complete:!0})}catch(e){return v(e)}if(!g)return v(new n("invalid token"));let w=g.header;if("function"==typeof t){if(!u)return v(new n("verify must be called asynchronous if secret or public key is provided as a callback"));b=t}else b=function(e,r){return r(null,t)};return b(w,function(t,s){let u;if(t)return v(new n("error in secret or public key callback: "+t.message));let b=""!==$[2].trim();if(!b&&s)return v(new n("jwt signature is required"));if(b&&!s)return v(new n("secret or public key must be provided"));if(!b&&!r.algorithms)return v(new n('please specify "none" in "algorithms" to verify unsigned tokens'));if(null!=s&&!(s instanceof f))try{s=h(s)}catch(e){try{s=p("string"==typeof s?Buffer.from(s):s)}catch(e){return v(new n("secretOrPublicKey is not valid key material"))}}if(r.algorithms||("secret"===s.type?r.algorithms=y:["rsa","rsa-pss"].includes(s.asymmetricKeyType)?r.algorithms=E:"ec"===s.asymmetricKeyType?r.algorithms=m:r.algorithms=d),-1===r.algorithms.indexOf(g.header.alg))return v(new n("invalid algorithm"));if(w.alg.startsWith("HS")&&"secret"!==s.type)return v(new n(`secretOrPublicKey must be a symmetric key when using ${w.alg}`));if(/^(?:RS|PS|ES)/.test(w.alg)&&"public"!==s.type)return v(new n(`secretOrPublicKey must be an asymmetric key when using ${w.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{l(w.alg,s)}catch(e){return v(e)}try{u=c.verify(e,g.header.alg,s)}catch(e){return v(e)}if(!u)return v(new n("invalid signature"));let I=g.payload;if(void 0!==I.nbf&&!r.ignoreNotBefore){if("number"!=typeof I.nbf)return v(new n("invalid nbf value"));if(I.nbf>S+(r.clockTolerance||0))return v(new i("jwt not active",new Date(1e3*I.nbf)))}if(void 0!==I.exp&&!r.ignoreExpiration){if("number"!=typeof I.exp)return v(new n("invalid exp value"));if(S>=I.exp+(r.clockTolerance||0))return v(new o("jwt expired",new Date(1e3*I.exp)))}if(r.audience){let e=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(I.aud)?I.aud:[I.aud]).some(function(t){return e.some(function(e){return e instanceof RegExp?e.test(t):e===t})}))return v(new n("jwt audience invalid. expected: "+e.join(" or ")))}if(r.issuer&&("string"==typeof r.issuer&&I.iss!==r.issuer||Array.isArray(r.issuer)&&-1===r.issuer.indexOf(I.iss)))return v(new n("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&I.sub!==r.subject)return v(new n("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&I.jti!==r.jwtid)return v(new n("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&I.nonce!==r.nonce)return v(new n("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if("number"!=typeof I.iat)return v(new n("iat required when maxAge is specified"));let e=a(r.maxAge,I.iat);if(void 0===e)return v(new n('"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 o("maxAge exceeded",new Date(1e3*e)))}return!0===r.complete?v(null,{header:w,payload:I,signature:g.signature}):v(null,I)})}},3569:function(e,t,r){var n,i=r(6608).Buffer,o=r(6982),s=r(9053),a=r(9023),l="secret must be a string or buffer",u="key must be a string or a buffer",c="function"==typeof o.createPublicKey;function f(e){if(!i.isBuffer(e)&&"string"!=typeof e&&(!c||"object"!=typeof e||"string"!=typeof e.type||"string"!=typeof e.asymmetricKeyType||"function"!=typeof e.export))throw m(u)}function p(e){if(!i.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 d(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(a.format.bind(a,e).apply(null,t))}function E(e){var t;return t=e,i.isBuffer(t)||"string"==typeof t||(e=JSON.stringify(e)),e}function y(e){return function(t,r){!function(e){if(!i.isBuffer(e)){if("string"!=typeof e){if(!c||"object"!=typeof e||"secret"!==e.type||"function"!=typeof e.export)throw m(l)}}}(r),t=E(t);var n=o.createHmac("sha"+e,r);return h((n.update(t),n.digest("base64")))}}c&&(u+=" or a KeyObject",l+="or a KeyObject");var v="timingSafeEqual"in o?function(e,t){return e.byteLength===t.byteLength&&o.timingSafeEqual(e,t)}:function(e,t){return n||(n=r(9454)),n(e,t)};function g(e){return function(t,r,n){var o=y(e)(t,n);return v(i.from(r),i.from(o))}}function b(e){return function(t,r){p(r),t=E(t);var n=o.createSign("RSA-SHA"+e);return h((n.update(t),n.sign(r,"base64")))}}function S(e){return function(t,r,n){f(n),t=E(t),r=d(r);var i=o.createVerify("RSA-SHA"+e);return i.update(t),i.verify(n,r,"base64")}}function $(e){return function(t,r){p(r),t=E(t);var n=o.createSign("RSA-SHA"+e);return h((n.update(t),n.sign({key:r,padding:o.constants.RSA_PKCS1_PSS_PADDING,saltLength:o.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}function w(e){return function(t,r,n){f(n),t=E(t),r=d(r);var i=o.createVerify("RSA-SHA"+e);return i.update(t),i.verify({key:n,padding:o.constants.RSA_PKCS1_PSS_PADDING,saltLength:o.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function I(e){var t=b(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,n,i){return t(r,n=s.joseToDer(n,"ES"+e).toString("base64"),i)}}function O(){return function(){return""}}function A(){return function(e,t){return""===t}}e.exports=function(e){var t=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i);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(),n=t[2];return{sign:({hs:y,rs:b,ps:$,es:I,none:O})[r](n),verify:({hs:g,rs:S,ps:w,es:R,none:A})[r](n)}}},1525:function(e,t,r){var n=r(4397),i=r(169);t.ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],t.sign=n.sign,t.verify=i.verify,t.decode=i.decode,t.isValid=i.isValid,t.createSign=function(e){return new n(e)},t.createVerify=function(e){return new i(e)}},1882:function(e,t,r){var n=r(6608).Buffer,i=r(2203);function o(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=n.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=n.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(o,i),o.prototype.write=function(e){this.buffer=n.concat([this.buffer,n.from(e)]),this.emit("data",e)},o.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},e.exports=o},4397:function(e,t,r){var n=r(6608).Buffer,i=r(1882),o=r(3569),s=r(2203),a=r(7265),l=r(9023);function u(e,t){return n.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(e){var t,r,n,i=e.header,s=e.payload,c=e.secret||e.privateKey,f=e.encoding,p=o(i.alg),h=(t=(t=f)||"utf8",r=u(a(i),"binary"),n=u(a(s),t),l.format("%s.%s",r,n)),d=p.sign(h,c);return l.format("%s.%s",h,d)}function f(e){var t=new i(e.secret||e.privateKey||e.key);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=t,this.payload=new i(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(f,s),f.prototype.sign=function(){try{var e=c({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")}},f.sign=c,e.exports=f},7265:function(e,t,r){var n=r(181).Buffer;e.exports=function(e){return"string"==typeof e?e:"number"==typeof e||n.isBuffer(e)?e.toString():JSON.stringify(e)}},169:function(e,t,r){var n=r(6608).Buffer,i=r(1882),o=r(3569),s=r(2203),a=r(7265),l=r(9023),u=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function c(e){var t=e.split(".",1)[0],r=n.from(t,"base64").toString("binary");if("[object Object]"===Object.prototype.toString.call(r))return r;try{return JSON.parse(r)}catch(e){return}}function f(e){return e.split(".")[2]}function p(e){return u.test(e)&&!!c(e)}function h(e,t,r){if(!t){var n=Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}var i=f(e=a(e)),s=e.split(".",2).join(".");return o(t).verify(s,i,r)}function d(e,t){if(t=t||{},!p(e=a(e)))return null;var r,i,o=c(e);if(!o)return null;var s=(r=r||"utf8",i=e.split(".")[1],n.from(i,"base64").toString(r));return("JWT"===o.typ||t.json)&&(s=JSON.parse(s,t.encoding)),{header:o,payload:s,signature:f(e)}}function m(e){var t=new i((e=e||{}).secret||e.publicKey||e.key);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=t,this.signature=new i(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=d(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=d,m.isValid=p,m.verify=h,e.exports=m},5357:function(e){var t,r,n=1/0,i=0/0,o=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=/^(?:0|[1-9]\d*)$/,c=parseInt;function f(e){return e!=e}var p=Object.prototype,h=p.hasOwnProperty,d=p.toString,m=p.propertyIsEnumerable,E=(t=Object.keys,r=Object,function(e){return t(r(e))}),y=Math.max,v=Array.isArray;function g(e){var t,r,n;return null!=e&&"number"==typeof(t=e.length)&&t>-1&&t%1==0&&t<=0x1fffffffffffff&&"[object Function]"!=(n=b(r=e)?d.call(r):"")&&"[object GeneratorFunction]"!=n}function b(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=g(e)?e:function(e){return e?function(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}(g(e)?function(e,t){var r,n,i,o,s=v(e)||S(n=r=e)&&g(n)&&h.call(r,"callee")&&(!m.call(r,"callee")||"[object Arguments]"==d.call(r))?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],a=s.length,l=!!a;for(var c in e){h.call(e,c)&&!(l&&("length"==c||(i=c,(o=null==(o=a)?0x1fffffffffffff:o)&&("number"==typeof i||u.test(i))&&i>-1&&i%1==0&&i<o)))&&s.push(c)}return s}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||p))return E(e);var t,r,n=[];for(var i in Object(e))h.call(e,i)&&"constructor"!=i&&n.push(i);return n}(e),function(t){return e[t]}):[]}(e),r=r&&!$?(R=(I=(w=r)?(w=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||S(t)&&"[object Symbol]"==d.call(t))return i;if(b(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=b(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=a.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):s.test(e)?i:+e}(w))===n||w===-n?(w<0?-1:1)*17976931348623157e292:w==w?w:0:0===w?w:0)%1,I==I?R?I-R:I:0):0;var w,I,R,O,A=e.length;return r<0&&(r=y(A+r,0)),"string"==typeof(O=e)||!v(O)&&S(O)&&"[object String]"==d.call(O)?r<=A&&e.indexOf(t,r)>-1:!!A&&function(e,t,r){if(t!=t){for(var n=e.length,i=r+-1;++i<n;)if(f(e[i],i,e))return i;return -1}for(var o=r-1,s=e.length;++o<s;)if(e[o]===t)return o;return -1}(e,t,r)>-1}},6782:function(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:function(e){var t=1/0,r=0/0,n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,l=Object.prototype.toString;function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var c,f,p;return"number"==typeof e&&e==(p=(f=(c=e)?(c=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(u(e)){var t,c="function"==typeof e.valueOf?e.valueOf():e;e=u(c)?c+"":c}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var f=o.test(e);return f||s.test(e)?a(e.slice(2),f?2:8):i.test(e)?r:+e}(c))===t||c===-t?(c<0?-1:1)*17976931348623157e292:c==c?c:0:0===c?c:0)%1,f==f?p?f-p:f:0)}},8094:function(e){var t=Object.prototype.toString;e.exports=function(e){return"number"==typeof e||!!e&&"object"==typeof e&&"[object Number]"==t.call(e)}},6052:function(e){var t,r,n=Object.prototype,i=Function.prototype.toString,o=n.hasOwnProperty,s=i.call(Object),a=n.toString,l=(t=Object.getPrototypeOf,r=Object,function(e){return t(r(e))});e.exports=function(e){if(!(e&&"object"==typeof e)||"[object Object]"!=a.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=o.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&i.call(r)==s}},1251:function(e){var t=Object.prototype.toString,r=Array.isArray;e.exports=function(e){var n;return"string"==typeof e||!r(e)&&!!(n=e)&&"object"==typeof n&&"[object String]"==t.call(e)}},8430:function(e){var t=1/0,r=0/0,n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,l=Object.prototype.toString;function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var c,f,p,h,d=2,m=e;if("function"!=typeof m)throw TypeError("Expected a function");return p=(f=(c=d)?(c=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(u(e)){var t,c="function"==typeof e.valueOf?e.valueOf():e;e=u(c)?c+"":c}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var f=o.test(e);return f||s.test(e)?a(e.slice(2),f?2:8):i.test(e)?r:+e}(c))===t||c===-t?(c<0?-1:1)*17976931348623157e292:c==c?c:0:0===c?c:0)%1,d=f==f?p?f-p:f:0,function(){return--d>0&&(h=m.apply(this,arguments)),d<=1&&(m=void 0),h}}},3866:function(e){function t(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}e.exports=function(e,r){r=r||{};var n,i,o,s,a=typeof e;if("string"===a&&e.length>0){var l=e;if(!((l=String(l)).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(l);if(u){var c=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*c;case"weeks":case"week":case"w":return 6048e5*c;case"days":case"day":case"d":return 864e5*c;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*c;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*c;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:break}}}return}if("number"===a&&isFinite(e)){return r.long?(i=Math.abs(n=e))>=864e5?t(n,i,864e5,"day"):i>=36e5?t(n,i,36e5,"hour"):i>=6e4?t(n,i,6e4,"minute"):i>=1e3?t(n,i,1e3,"second"):n+" ms":(s=Math.abs(o=e))>=864e5?Math.round(o/864e5)+"d":s>=36e5?Math.round(o/36e5)+"h":s>=6e4?Math.round(o/6e4)+"m":s>=1e3?Math.round(o/1e3)+"s":o+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},6608:function(e,t,r){var n=r(181),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},8610:function(e,t,r){"use strict";let n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof i)if(!!t.loose===e.loose)return e;else e=e.value;u("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){let t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.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 c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new f(e.value,t).test(this.value):""===e.operator?""===e.value||new f(this.value,t).test(e.semver):!((t=o(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=i;let o=r(4621),{safeRe:s,t:a}=r(152),l=r(5461),u=r(674),c=r(2398),f=r(2069)},2069:function(e,t,r){"use strict";let n=/\s+/g;class i{constructor(e,t){if(t=s(t),e instanceof i)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else return new i(e.raw,t);if(e instanceof a)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(n," "),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=>!y(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&&E))+":"+e,r=o.get(t);if(r)return r;let n=this.options.loose,i=n?c[f.HYPHENRANGELOOSE]:c[f.HYPHENRANGE];l("hyphen replace",e=e.replace(i,T(this.options.includePrerelease))),l("comparator trim",e=e.replace(c[f.COMPARATORTRIM],p)),l("tilde trim",e=e.replace(c[f.TILDETRIM],h)),l("caret trim",e=e.replace(c[f.CARETTRIM],d));let s=e.split(" ").map(e=>b(e,this.options)).join(" ").split(/\s+/).map(e=>x(e,this.options));n&&(s=s.filter(e=>(l("loose invalid filter",e,this.options),!!e.match(c[f.COMPARATORLOOSE])))),l("range list",s);let u=new Map;for(let e of s.map(e=>new a(e,this.options))){if(y(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");let v=[...u.values()];return o.set(t,v),v}intersects(e,t){if(!(e instanceof i))throw TypeError("a Range is required");return this.set.some(r=>g(r,t)&&e.set.some(e=>g(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 u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(L(this.set[t],e,this.options))return!0;return!1}}e.exports=i;let o=new(r(2044)),s=r(4621),a=r(8610),l=r(674),u=r(2398),{safeRe:c,t:f,comparatorTrimReplace:p,tildeTrimReplace:h,caretTrimReplace:d}=r(152),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:E}=r(5076),y=e=>"<0.0.0-0"===e.value,v=e=>""===e.value,g=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(e=>i.intersects(e,t)),i=n.pop();return r},b=(e,t)=>(l("comp",e=e.replace(c[f.BUILD],""),t),l("caret",e=I(e,t)),l("tildes",e=$(e,t)),l("xrange",e=O(e,t)),l("stars",e=N(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?c[f.TILDELOOSE]:c[f.TILDE];return e.replace(r,(t,r,n,i,o)=>{let s;return l("tilde",e,t,r,n,i,o),S(r)?s="":S(n)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:S(i)?s=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(l("replaceTilde pr",o),s=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):s=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,l("tilde return",s),s})},I=(e,t)=>e.trim().split(/\s+/).map(e=>R(e,t)).join(" "),R=(e,t)=>{l("caret",e,t);let r=t.loose?c[f.CARETLOOSE]:c[f.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,i,o,s)=>{let a;return l("caret",e,t,r,i,o,s),S(r)?a="":S(i)?a=`>=${r}.0.0${n} <${+r+1}.0.0-0`:S(o)?a="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:s?(l("replaceCaret pr",s),a="0"===r?"0"===i?`>=${r}.${i}.${o}-${s} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${s} <${+r+1}.0.0-0`):(l("no pr"),a="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),l("caret return",a),a})},O=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map(e=>A(e,t)).join(" ")),A=(e,t)=>{e=e.trim();let r=t.loose?c[f.XRANGELOOSE]:c[f.XRANGE];return e.replace(r,(r,n,i,o,s,a)=>{l("xRange",e,r,n,i,o,s,a);let u=S(i),c=u||S(o),f=c||S(s);return"="===n&&f&&(n=""),a=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(c&&(o=0),s=0,">"===n?(n=">=",c?(i=+i+1,o=0):o=+o+1,s=0):"<="===n&&(n="<",c?i=+i+1:o=+o+1),"<"===n&&(a="-0"),r=`${n+i}.${o}.${s}${a}`):c?r=`>=${i}.0.0${a} <${+i+1}.0.0-0`:f&&(r=`>=${i}.${o}.0${a} <${i}.${+o+1}.0-0`),l("xRange return",r),r})},N=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[f.STAR],"")),x=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?f.GTE0PRE:f.GTE0],"")),T=e=>(t,r,n,i,o,s,a,l,u,c,f,p)=>(r=S(n)?"":S(i)?`>=${n}.0.0${e?"-0":""}`:S(o)?`>=${n}.${i}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`,l=S(u)?"":S(c)?`<${+u+1}.0.0-0`:S(f)?`<${u}.${+c+1}.0-0`:p?`<=${u}.${c}.${f}-${p}`:e?`<${u}.${c}.${+f+1}-0`:`<=${l}`,`${r} ${l}`.trim()),L=(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!==a.ANY&&e[r].semver.prerelease.length>0){let n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},2398:function(e,t,r){"use strict";let n=r(674),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=r(5076),{safeRe:s,t:a}=r(152),l=r(4621),{compareIdentifiers:u}=r(9101);class c{constructor(e,t){if(t=l(t),e instanceof c)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>i)throw TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?s[a.LOOSE]:s[a.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>o||this.major<0)throw TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>o||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<o)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(n("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return(e instanceof c||(e=new c(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 c||(e=new c(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],i=e.prerelease[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return -1;else if(r===i)continue;else return u(r,i)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(n("build compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return -1;else if(r===i)continue;else return u(r,i)}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[a.PRERELEASELOOSE]:s[a.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 n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},5608:function(e,t,r){"use strict";let n=r(6802);e.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},5461:function(e,t,r){"use strict";let n=r(8271),i=r(733),o=r(1686),s=r(6479),a=r(7257),l=r(5850);e.exports=(e,t,r,u)=>{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 n(e,r,u);case"!=":return i(e,r,u);case">":return o(e,r,u);case">=":return s(e,r,u);case"<":return a(e,r,u);case"<=":return l(e,r,u);default:throw TypeError(`Invalid operator: ${t}`)}}},7771:function(e,t,r){"use strict";let n=r(2398),i=r(6802),{safeRe:o,t:s}=r(152);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let n,i=t.includePrerelease?o[s.COERCERTLFULL]:o[s.COERCERTL];for(;(n=i.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),i.lastIndex=n.index+n[1].length+n[2].length;i.lastIndex=-1}else r=e.match(t.includePrerelease?o[s.COERCEFULL]:o[s.COERCE]);if(null===r)return null;let a=r[2],l=r[3]||"0",u=r[4]||"0",c=t.includePrerelease&&r[5]?`-${r[5]}`:"",f=t.includePrerelease&&r[6]?`+${r[6]}`:"";return i(`${a}.${l}.${u}${c}${f}`,t)}},8767:function(e,t,r){"use strict";let n=r(2398);e.exports=(e,t,r)=>{let i=new n(e,r),o=new n(t,r);return i.compare(o)||i.compareBuild(o)}},6293:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t)=>n(e,t,!0)},6958:function(e,t,r){"use strict";let n=r(2398);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},3086:function(e,t,r){"use strict";let n=r(6802);e.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),o=r.compare(i);if(0===o)return null;let s=o>0,a=s?r:i,l=s?i:r,u=!!a.prerelease.length;if(l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(a))return l.minor&&!l.patch?"minor":"patch"}let c=u?"pre":"";return r.major!==i.major?c+"major":r.minor!==i.minor?c+"minor":r.patch!==i.patch?c+"patch":"prerelease"}},8271:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t,r)=>0===n(e,t,r)},1686:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t,r)=>n(e,t,r)>0},6479:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t,r)=>n(e,t,r)>=0},3625:function(e,t,r){"use strict";let n=r(2398);e.exports=(e,t,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,o).version}catch(e){return null}}},7257:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t,r)=>0>n(e,t,r)},5850:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t,r)=>0>=n(e,t,r)},7744:function(e,t,r){"use strict";let n=r(2398);e.exports=(e,t)=>new n(e,t).major},4812:function(e,t,r){"use strict";let n=r(2398);e.exports=(e,t)=>new n(e,t).minor},733:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t,r)=>0!==n(e,t,r)},6802:function(e,t,r){"use strict";let n=r(2398);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},8643:function(e,t,r){"use strict";let n=r(2398);e.exports=(e,t)=>new n(e,t).patch},9283:function(e,t,r){"use strict";let n=r(6802);e.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},7032:function(e,t,r){"use strict";let n=r(6958);e.exports=(e,t,r)=>n(t,e,r)},9839:function(e,t,r){"use strict";let n=r(8767);e.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))},4056:function(e,t,r){"use strict";let n=r(2069);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},7697:function(e,t,r){"use strict";let n=r(8767);e.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))},6807:function(e,t,r){"use strict";let n=r(6802);e.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}},3895:function(e,t,r){"use strict";let n=r(152),i=r(5076),o=r(2398),s=r(9101),a=r(6802),l=r(6807),u=r(5608),c=r(3625),f=r(3086),p=r(7744),h=r(4812),d=r(8643),m=r(9283),E=r(6958),y=r(7032),v=r(6293),g=r(8767),b=r(7697),S=r(9839),$=r(1686),w=r(7257),I=r(8271),R=r(733),O=r(6479),A=r(5850),N=r(5461),x=r(7771),T=r(8610),L=r(2069),j=r(4056),P=r(6613),D=r(7114),_=r(1008),k=r(203),C=r(5372),M=r(4713),K=r(4497),V=r(9272),U=r(3490);e.exports={parse:a,valid:l,clean:u,inc:c,diff:f,major:p,minor:h,patch:d,prerelease:m,compare:E,rcompare:y,compareLoose:v,compareBuild:g,sort:b,rsort:S,gt:$,lt:w,eq:I,neq:R,gte:O,lte:A,cmp:N,coerce:x,Comparator:T,Range:L,satisfies:j,toComparators:P,maxSatisfying:D,minSatisfying:_,minVersion:k,validRange:C,outside:M,gtr:K,ltr:V,intersects:U,simplifyRange:r(4039),subset:r(22),SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}},5076:function(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:function(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:function(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 n=t.test(e),i=t.test(r);return n&&i&&(e*=1,r*=1),e===r?0:n&&!i?-1:i&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},2044:function(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:function(e){"use strict";let t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},152:function(e,t,r){"use strict";let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:o}=r(5076),s=r(674),a=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],f=t.t={},p=0,h="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",o],[h,i]],m=(e,t,r)=>{let n=(e=>{for(let[t,r]of d)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=p++;s(e,i,t),f[e]=i,u[i]=t,c[i]=n,a[i]=new RegExp(t,r?"g":void 0),l[i]=new RegExp(n,r?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),m("MAINVERSION",`(${u[f.NUMERICIDENTIFIER]})\\.(${u[f.NUMERICIDENTIFIER]})\\.(${u[f.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${u[f.NUMERICIDENTIFIERLOOSE]})\\.(${u[f.NUMERICIDENTIFIERLOOSE]})\\.(${u[f.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${u[f.NONNUMERICIDENTIFIER]}|${u[f.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${u[f.NONNUMERICIDENTIFIER]}|${u[f.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${u[f.PRERELEASEIDENTIFIER]}(?:\\.${u[f.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${u[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[f.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${h}+`),m("BUILD",`(?:\\+(${u[f.BUILDIDENTIFIER]}(?:\\.${u[f.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${u[f.MAINVERSION]}${u[f.PRERELEASE]}?${u[f.BUILD]}?`),m("FULL",`^${u[f.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${u[f.MAINVERSIONLOOSE]}${u[f.PRERELEASELOOSE]}?${u[f.BUILD]}?`),m("LOOSE",`^${u[f.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${u[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${u[f.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${u[f.XRANGEIDENTIFIER]})(?:\\.(${u[f.XRANGEIDENTIFIER]})(?:\\.(${u[f.XRANGEIDENTIFIER]})(?:${u[f.PRERELEASE]})?${u[f.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${u[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[f.XRANGEIDENTIFIERLOOSE]})(?:${u[f.PRERELEASELOOSE]})?${u[f.BUILD]}?)?)?`),m("XRANGE",`^${u[f.GTLT]}\\s*${u[f.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${u[f.GTLT]}\\s*${u[f.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),m("COERCE",`${u[f.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",u[f.COERCEPLAIN]+`(?:${u[f.PRERELEASE]})?`+`(?:${u[f.BUILD]})?`+"(?:$|[^\\d])"),m("COERCERTL",u[f.COERCE],!0),m("COERCERTLFULL",u[f.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${u[f.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${u[f.LONETILDE]}${u[f.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${u[f.LONETILDE]}${u[f.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${u[f.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${u[f.LONECARET]}${u[f.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${u[f.LONECARET]}${u[f.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${u[f.GTLT]}\\s*(${u[f.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${u[f.GTLT]}\\s*(${u[f.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${u[f.GTLT]}\\s*(${u[f.LOOSEPLAIN]}|${u[f.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${u[f.XRANGEPLAIN]})\\s+-\\s+(${u[f.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${u[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[f.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},4497:function(e,t,r){"use strict";let n=r(4713);e.exports=(e,t,r)=>n(e,t,">",r)},3490:function(e,t,r){"use strict";let n=r(2069);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},9272:function(e,t,r){"use strict";let n=r(4713);e.exports=(e,t,r)=>n(e,t,"<",r)},7114:function(e,t,r){"use strict";let n=r(2398),i=r(2069);e.exports=(e,t,r)=>{let o=null,s=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(!o||-1===s.compare(e))&&(s=new n(o=e,r))}),o}},1008:function(e,t,r){"use strict";let n=r(2398),i=r(2069);e.exports=(e,t,r)=>{let o=null,s=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(!o||1===s.compare(e))&&(s=new n(o=e,r))}),o}},203:function(e,t,r){"use strict";let n=r(2398),i=r(2069),o=r(1686);e.exports=(e,t)=>{e=new i(e,t);let r=new n("0.0.0");if(e.test(r)||(r=new n("0.0.0-0"),e.test(r)))return r;r=null;for(let t=0;t<e.set.length;++t){let i=e.set[t],s=null;i.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":(!s||o(t,s))&&(s=t);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),s&&(!r||o(r,s))&&(r=s)}return r&&e.test(r)?r:null}},4713:function(e,t,r){"use strict";let n=r(2398),i=r(8610),{ANY:o}=i,s=r(2069),a=r(4056),l=r(1686),u=r(7257),c=r(5850),f=r(6479);e.exports=(e,t,r,p)=>{let h,d,m,E,y;switch(e=new n(e,p),t=new s(t,p),r){case">":h=l,d=c,m=u,E=">",y=">=";break;case"<":h=u,d=f,m=l,E="<",y="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,p))return!1;for(let r=0;r<t.set.length;++r){let n=t.set[r],s=null,a=null;if(n.forEach(e=>{e.semver===o&&(e=new i(">=0.0.0")),s=s||e,a=a||e,h(e.semver,s.semver,p)?s=e:m(e.semver,a.semver,p)&&(a=e)}),s.operator===E||s.operator===y||(!a.operator||a.operator===E)&&d(e,a.semver)||a.operator===y&&m(e,a.semver))return!1}return!0}},4039:function(e,t,r){"use strict";let n=r(4056),i=r(6958);e.exports=(e,t,r)=>{let o=[],s=null,a=null,l=e.sort((e,t)=>i(e,t,r));for(let e of l)n(e,t,r)?(a=e,s||(s=e)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);let u=[];for(let[e,t]of o)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");let c=u.join(" || "),f="string"==typeof t.raw?t.raw:String(t);return c.length<f.length?c:t}},22:function(e,t,r){"use strict";let n=r(2069),i=r(8610),{ANY:o}=i,s=r(4056),a=r(6958),l=[new i(">=0.0.0-0")],u=[new i(">=0.0.0")],c=(e,t,r)=>{let n,i,c,h,d,m,E;if(e===t)return!0;if(1===e.length&&e[0].semver===o)if(1===t.length&&t[0].semver===o)return!0;else e=r.includePrerelease?l:u;if(1===t.length&&t[0].semver===o)if(r.includePrerelease)return!0;else t=u;let y=new Set;for(let t of e)">"===t.operator||">="===t.operator?n=f(n,t,r):"<"===t.operator||"<="===t.operator?i=p(i,t,r):y.add(t.semver);if(y.size>1)return null;if(n&&i&&((c=a(n.semver,i.semver,r))>0||0===c&&(">="!==n.operator||"<="!==i.operator)))return null;for(let e of y){if(n&&!s(e,String(n),r)||i&&!s(e,String(i),r))return null;for(let n of t)if(!s(e,String(n),r))return!1;return!0}let v=!!i&&!r.includePrerelease&&!!i.semver.prerelease.length&&i.semver,g=!!n&&!r.includePrerelease&&!!n.semver.prerelease.length&&n.semver;for(let e of(v&&1===v.prerelease.length&&"<"===i.operator&&0===v.prerelease[0]&&(v=!1),t)){if(E=E||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,n){if(g&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===g.major&&e.semver.minor===g.minor&&e.semver.patch===g.patch&&(g=!1),">"===e.operator||">="===e.operator){if((h=f(n,e,r))===e&&h!==n)return!1}else if(">="===n.operator&&!s(n.semver,String(e),r))return!1}if(i){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((d=p(i,e,r))===e&&d!==i)return!1}else if("<="===i.operator&&!s(i.semver,String(e),r))return!1}if(!e.operator&&(i||n)&&0!==c)return!1}return(!n||!m||!!i||0===c)&&(!i||!E||!!n||0===c)&&!g&&!v&&!0},f=(e,t,r)=>{if(!e)return t;let n=a(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,r)=>{if(!e)return t;let n=a(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;e:for(let n of e.set){for(let e of t.set){let t=c(n,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},6613:function(e,t,r){"use strict";let n=r(2069);e.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},5372:function(e,t,r){"use strict";let n=r(2069);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},181:function(e){"use strict";e.exports=require("buffer")},6982:function(e){"use strict";e.exports=require("crypto")},9896:function(e){"use strict";e.exports=require("fs")},857:function(e){"use strict";e.exports=require("os")},6928:function(e){"use strict";e.exports=require("path")},2203:function(e){"use strict";e.exports=require("stream")},9023:function(e){"use strict";e.exports=require("util")},2741:function(t){"use strict";t.exports=e},4519:function(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}}')}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={exports:{}};return t[e](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{createContext:()=>m,jwtAuthMiddleware:()=>f,apiKeyAuthMiddleware:()=>l,completable:()=>y});var e,t=n(8583),r=n.n(t),o=n(2741);let s=o.z.object({apiKey:o.z.string().optional(),headerName:o.z.string().optional(),validateApiKey:o.z.function().args(o.z.string()).returns(o.z.promise(o.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"}),a="Unauthorized: Missing or invalid API key";function l(e){let t=s.safeParse(e);if(!t.success){let r="apiKey"in e,n="validateApiKey"in e;if(r&&n)throw Error("'apiKey' and 'validateApiKey' are mutually exclusive - provide only one");if(r||n)throw Error(`Invalid configuration: ${t.error.message}`);throw Error("Either 'apiKey' or 'validateApiKey' must be provided")}let r=e.headerName??"x-api-key",n="apiKey"in e?e.apiKey:void 0,i="validateApiKey"in e?e.validateApiKey:void 0;return async(t,o,s)=>{let l=t.header(r);!l||"apiKey"in e&&l!==n||i&&!await i(l)?o.status(401).json({error:a}):s()}}var u=n(7619),c=n.n(u);function f(e){return(t,r,n)=>{let i=t.header("Authorization");if(!i||!i.startsWith("Bearer "))return void r.status(401).json({error:"Unauthorized: Missing or malformed Authorization header"});let o=i.slice(7).trim();if(!o)return void r.status(401).json({error:"Unauthorized: Missing access token"});try{let{secret:r,...i}=e;t.user=c().verify(o,r,i),n()}catch(e){r.status(401).json({error:"Unauthorized: Invalid or expired token"})}}}let p=require("async_hooks"),h=(e,t)=>{globalThis[e]=t},d=e=>globalThis[e];function m({name:e}){let t=Symbol.for(`xmcp-context-${e}`),r=Symbol.for(`xmcp-context-${e}-fallback-store`);if(d(t))return d(t);let n=new p.AsyncLocalStorage,i=globalThis[r]??{current:null};h(r,i);let o={provider:(e,t)=>(i.current=e,n.run(e,t)),getContext:()=>{let t=n.getStore();if(t)return t;if(i.current)return i.current;throw Error(`getContext() can only be used within the ${e} context.`)},setContext:t=>{let r=n.getStore()??i.current;if(!r)throw Error(`setContext() can only be used within the ${e} context.`);Object.assign(r,t)}};return h(t,o),o}(e||(e={})).Completable="McpCompletable";class E extends o.ZodType{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}function y(e,t){return E.create(e,{...e._def,complete:t})}E.create=(t,r)=>new E({type:t,typeName:e.Completable,complete:r.complete,...function(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{var o,s;let{message:a}=e;return"invalid_enum_value"===t.code?{message:null!=a?a:i.defaultError}:void 0===i.data?{message:null!=(o=null!=a?a:n)?o:i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:null!=(s=null!=a?a:r)?s:i.defaultError}},description:i}}(r)}),r().config()})(),i})());