UNPKG

chaite

Version:

core for chatgpt-plugin and karin-plugin-chatgpt

1,233 lines (1,191 loc) 139 kB
import { i as __require, t as __commonJS } from "../../rolldown-runtime-DVriDoez.mjs"; import { a as require_buffer_equal_constant_time, i as require_ecdsa_sig_formatter, o as require_safe_buffer } from "../@google/genai/index.mjs-BrdPnzXZ.mjs"; import { i as require_ms } from "../@anthropic-ai/sdk/index.mjs-sKjldQtK.mjs"; //#region node_modules/.pnpm/jws@3.2.2/node_modules/jws/lib/data-stream.js var require_data_stream = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/jws@3.2.2/node_modules/jws/lib/data-stream.js": ((exports, module) => { var Buffer$5 = require_safe_buffer().Buffer; var Stream$2 = __require("stream"); var util$3 = __require("util"); function DataStream$2(data) { this.buffer = null; this.writable = true; this.readable = true; if (!data) { this.buffer = Buffer$5.alloc(0); return this; } if (typeof data.pipe === "function") { this.buffer = Buffer$5.alloc(0); data.pipe(this); return this; } if (data.length || typeof data === "object") { this.buffer = data; this.writable = false; process.nextTick(function() { this.emit("end", data); this.readable = false; this.emit("close"); }.bind(this)); return this; } throw new TypeError("Unexpected data type (" + typeof data + ")"); } util$3.inherits(DataStream$2, Stream$2); DataStream$2.prototype.write = function write(data) { this.buffer = Buffer$5.concat([this.buffer, Buffer$5.from(data)]); this.emit("data", data); }; DataStream$2.prototype.end = function end(data) { if (data) this.write(data); this.emit("end", data); this.emit("close"); this.writable = false; this.readable = false; }; module.exports = DataStream$2; }) }); //#endregion //#region node_modules/.pnpm/jwa@1.4.1/node_modules/jwa/index.js var require_jwa = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/jwa@1.4.1/node_modules/jwa/index.js": ((exports, module) => { var bufferEqual = require_buffer_equal_constant_time(); var Buffer$4 = require_safe_buffer().Buffer; var crypto = __require("crypto"); var formatEcdsa = require_ecdsa_sig_formatter(); var util$2 = __require("util"); var MSG_INVALID_ALGORITHM = "\"%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\"."; var MSG_INVALID_SECRET = "secret must be a string or buffer"; var MSG_INVALID_VERIFIER_KEY = "key must be a string or a buffer"; var MSG_INVALID_SIGNER_KEY = "key must be a string, a buffer or an object"; var supportsKeyObjects = typeof crypto.createPublicKey === "function"; if (supportsKeyObjects) { MSG_INVALID_VERIFIER_KEY += " or a KeyObject"; MSG_INVALID_SECRET += "or a KeyObject"; } function checkIsPublicKey(key) { if (Buffer$4.isBuffer(key)) return; if (typeof key === "string") return; if (!supportsKeyObjects) throw typeError(MSG_INVALID_VERIFIER_KEY); if (typeof key !== "object") throw typeError(MSG_INVALID_VERIFIER_KEY); if (typeof key.type !== "string") throw typeError(MSG_INVALID_VERIFIER_KEY); if (typeof key.asymmetricKeyType !== "string") throw typeError(MSG_INVALID_VERIFIER_KEY); if (typeof key.export !== "function") throw typeError(MSG_INVALID_VERIFIER_KEY); } function checkIsPrivateKey(key) { if (Buffer$4.isBuffer(key)) return; if (typeof key === "string") return; if (typeof key === "object") return; throw typeError(MSG_INVALID_SIGNER_KEY); } function checkIsSecretKey(key) { if (Buffer$4.isBuffer(key)) return; if (typeof key === "string") return key; if (!supportsKeyObjects) throw typeError(MSG_INVALID_SECRET); if (typeof key !== "object") throw typeError(MSG_INVALID_SECRET); if (key.type !== "secret") throw typeError(MSG_INVALID_SECRET); if (typeof key.export !== "function") throw typeError(MSG_INVALID_SECRET); } function fromBase64(base64) { return base64.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); } function toBase64(base64url$1) { base64url$1 = base64url$1.toString(); var padding = 4 - base64url$1.length % 4; if (padding !== 4) for (var i = 0; i < padding; ++i) base64url$1 += "="; return base64url$1.replace(/\-/g, "+").replace(/_/g, "/"); } function typeError(template) { var args = [].slice.call(arguments, 1); var errMsg = util$2.format.bind(util$2, template).apply(null, args); return new TypeError(errMsg); } function bufferOrString(obj) { return Buffer$4.isBuffer(obj) || typeof obj === "string"; } function normalizeInput(thing) { if (!bufferOrString(thing)) thing = JSON.stringify(thing); return thing; } function createHmacSigner(bits) { return function sign(thing, secret) { checkIsSecretKey(secret); thing = normalizeInput(thing); var hmac = crypto.createHmac("sha" + bits, secret); return fromBase64((hmac.update(thing), hmac.digest("base64"))); }; } function createHmacVerifier(bits) { return function verify(thing, signature, secret) { var computedSig = createHmacSigner(bits)(thing, secret); return bufferEqual(Buffer$4.from(signature), Buffer$4.from(computedSig)); }; } function createKeySigner(bits) { return function sign(thing, privateKey) { checkIsPrivateKey(privateKey); thing = normalizeInput(thing); var signer = crypto.createSign("RSA-SHA" + bits); return fromBase64((signer.update(thing), signer.sign(privateKey, "base64"))); }; } function createKeyVerifier(bits) { return function verify(thing, signature, publicKey) { checkIsPublicKey(publicKey); thing = normalizeInput(thing); signature = toBase64(signature); var verifier = crypto.createVerify("RSA-SHA" + bits); verifier.update(thing); return verifier.verify(publicKey, signature, "base64"); }; } function createPSSKeySigner(bits) { return function sign(thing, privateKey) { checkIsPrivateKey(privateKey); thing = normalizeInput(thing); var signer = crypto.createSign("RSA-SHA" + bits); return fromBase64((signer.update(thing), signer.sign({ key: privateKey, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST }, "base64"))); }; } function createPSSKeyVerifier(bits) { return function verify(thing, signature, publicKey) { checkIsPublicKey(publicKey); thing = normalizeInput(thing); signature = toBase64(signature); var verifier = crypto.createVerify("RSA-SHA" + bits); verifier.update(thing); return verifier.verify({ key: publicKey, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST }, signature, "base64"); }; } function createECDSASigner(bits) { var inner = createKeySigner(bits); return function sign() { var signature = inner.apply(null, arguments); signature = formatEcdsa.derToJose(signature, "ES" + bits); return signature; }; } function createECDSAVerifer(bits) { var inner = createKeyVerifier(bits); return function verify(thing, signature, publicKey) { signature = formatEcdsa.joseToDer(signature, "ES" + bits).toString("base64"); return inner(thing, signature, publicKey); }; } function createNoneSigner() { return function sign() { return ""; }; } function createNoneVerifier() { return function verify(thing, signature) { return signature === ""; }; } module.exports = function jwa$2(algorithm) { var signerFactories = { hs: createHmacSigner, rs: createKeySigner, ps: createPSSKeySigner, es: createECDSASigner, none: createNoneSigner }; var verifierFactories = { hs: createHmacVerifier, rs: createKeyVerifier, ps: createPSSKeyVerifier, es: createECDSAVerifer, none: createNoneVerifier }; var match = algorithm.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i); if (!match) throw typeError(MSG_INVALID_ALGORITHM, algorithm); var algo = (match[1] || match[3]).toLowerCase(); var bits = match[2]; return { sign: signerFactories[algo](bits), verify: verifierFactories[algo](bits) }; }; }) }); //#endregion //#region node_modules/.pnpm/jws@3.2.2/node_modules/jws/lib/tostring.js var require_tostring = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/jws@3.2.2/node_modules/jws/lib/tostring.js": ((exports, module) => { var Buffer$3 = __require("buffer").Buffer; module.exports = function toString$2(obj) { if (typeof obj === "string") return obj; if (typeof obj === "number" || Buffer$3.isBuffer(obj)) return obj.toString(); return JSON.stringify(obj); }; }) }); //#endregion //#region node_modules/.pnpm/jws@3.2.2/node_modules/jws/lib/sign-stream.js var require_sign_stream = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/jws@3.2.2/node_modules/jws/lib/sign-stream.js": ((exports, module) => { var Buffer$2 = require_safe_buffer().Buffer; var DataStream$1 = require_data_stream(); var jwa$1 = require_jwa(); var Stream$1 = __require("stream"); var toString$1 = require_tostring(); var util$1 = __require("util"); function base64url(string, encoding) { return Buffer$2.from(string, encoding).toString("base64").replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); } function jwsSecuredInput(header, payload, encoding) { encoding = encoding || "utf8"; var encodedHeader = base64url(toString$1(header), "binary"); var encodedPayload = base64url(toString$1(payload), encoding); return util$1.format("%s.%s", encodedHeader, encodedPayload); } function jwsSign(opts) { var header = opts.header; var payload = opts.payload; var secretOrKey = opts.secret || opts.privateKey; var encoding = opts.encoding; var algo = jwa$1(header.alg); var securedInput = jwsSecuredInput(header, payload, encoding); var signature = algo.sign(securedInput, secretOrKey); return util$1.format("%s.%s", securedInput, signature); } function SignStream$1(opts) { var secretStream = new DataStream$1(opts.secret || opts.privateKey || opts.key); this.readable = true; this.header = opts.header; this.encoding = opts.encoding; this.secret = this.privateKey = this.key = secretStream; this.payload = new DataStream$1(opts.payload); this.secret.once("close", function() { if (!this.payload.writable && this.readable) this.sign(); }.bind(this)); this.payload.once("close", function() { if (!this.secret.writable && this.readable) this.sign(); }.bind(this)); } util$1.inherits(SignStream$1, Stream$1); SignStream$1.prototype.sign = function sign() { try { var signature = jwsSign({ header: this.header, payload: this.payload.buffer, secret: this.secret.buffer, encoding: this.encoding }); this.emit("done", signature); this.emit("data", signature); this.emit("end"); this.readable = false; return signature; } catch (e) { this.readable = false; this.emit("error", e); this.emit("close"); } }; SignStream$1.sign = jwsSign; module.exports = SignStream$1; }) }); //#endregion //#region node_modules/.pnpm/jws@3.2.2/node_modules/jws/lib/verify-stream.js var require_verify_stream = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/jws@3.2.2/node_modules/jws/lib/verify-stream.js": ((exports, module) => { var Buffer$1 = require_safe_buffer().Buffer; var DataStream = require_data_stream(); var jwa = require_jwa(); var Stream = __require("stream"); var toString = require_tostring(); var util = __require("util"); var JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/; function isObject$3(thing) { return Object.prototype.toString.call(thing) === "[object Object]"; } function safeJsonParse(thing) { if (isObject$3(thing)) return thing; try { return JSON.parse(thing); } catch (e) { return; } } function headerFromJWS(jwsSig) { var encodedHeader = jwsSig.split(".", 1)[0]; return safeJsonParse(Buffer$1.from(encodedHeader, "base64").toString("binary")); } function securedInputFromJWS(jwsSig) { return jwsSig.split(".", 2).join("."); } function signatureFromJWS(jwsSig) { return jwsSig.split(".")[2]; } function payloadFromJWS(jwsSig, encoding) { encoding = encoding || "utf8"; var payload = jwsSig.split(".")[1]; return Buffer$1.from(payload, "base64").toString(encoding); } function isValidJws(string) { return JWS_REGEX.test(string) && !!headerFromJWS(string); } function jwsVerify(jwsSig, algorithm, secretOrKey) { if (!algorithm) { var err = /* @__PURE__ */ new Error("Missing algorithm parameter for jws.verify"); err.code = "MISSING_ALGORITHM"; throw err; } jwsSig = toString(jwsSig); var signature = signatureFromJWS(jwsSig); var securedInput = securedInputFromJWS(jwsSig); return jwa(algorithm).verify(securedInput, signature, secretOrKey); } function jwsDecode(jwsSig, opts) { opts = opts || {}; jwsSig = toString(jwsSig); if (!isValidJws(jwsSig)) return null; var header = headerFromJWS(jwsSig); if (!header) return null; var payload = payloadFromJWS(jwsSig); if (header.typ === "JWT" || opts.json) payload = JSON.parse(payload, opts.encoding); return { header, payload, signature: signatureFromJWS(jwsSig) }; } function VerifyStream$1(opts) { opts = opts || {}; var secretStream = new DataStream(opts.secret || opts.publicKey || opts.key); this.readable = true; this.algorithm = opts.algorithm; this.encoding = opts.encoding; this.secret = this.publicKey = this.key = secretStream; this.signature = new DataStream(opts.signature); this.secret.once("close", function() { if (!this.signature.writable && this.readable) this.verify(); }.bind(this)); this.signature.once("close", function() { if (!this.secret.writable && this.readable) this.verify(); }.bind(this)); } util.inherits(VerifyStream$1, Stream); VerifyStream$1.prototype.verify = function verify() { try { var valid$2 = jwsVerify(this.signature.buffer, this.algorithm, this.key.buffer); var obj = jwsDecode(this.signature.buffer, this.encoding); this.emit("done", valid$2, obj); this.emit("data", valid$2); this.emit("end"); this.readable = false; return valid$2; } catch (e) { this.readable = false; this.emit("error", e); this.emit("close"); } }; VerifyStream$1.decode = jwsDecode; VerifyStream$1.isValid = isValidJws; VerifyStream$1.verify = jwsVerify; module.exports = VerifyStream$1; }) }); //#endregion //#region node_modules/.pnpm/jws@3.2.2/node_modules/jws/index.js var require_jws = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/jws@3.2.2/node_modules/jws/index.js": ((exports) => { var SignStream = require_sign_stream(); var VerifyStream = require_verify_stream(); var ALGORITHMS = [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" ]; exports.ALGORITHMS = ALGORITHMS; exports.sign = SignStream.sign; exports.verify = VerifyStream.verify; exports.decode = VerifyStream.decode; exports.isValid = VerifyStream.isValid; exports.createSign = function createSign(opts) { return new SignStream(opts); }; exports.createVerify = function createVerify(opts) { return new VerifyStream(opts); }; }) }); //#endregion //#region node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/decode.js var require_decode = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/decode.js": ((exports, module) => { var jws$2 = require_jws(); module.exports = function(jwt, options) { options = options || {}; var decoded = jws$2.decode(jwt, options); if (!decoded) return null; var payload = decoded.payload; if (typeof payload === "string") try { var obj = JSON.parse(payload); if (obj !== null && typeof obj === "object") payload = obj; } catch (e) {} if (options.complete === true) return { header: decoded.header, payload, signature: decoded.signature }; return payload; }; }) }); //#endregion //#region node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/lib/JsonWebTokenError.js var require_JsonWebTokenError = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/lib/JsonWebTokenError.js": ((exports, module) => { var JsonWebTokenError$3 = function(message, error) { Error.call(this, message); if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor); this.name = "JsonWebTokenError"; this.message = message; if (error) this.inner = error; }; JsonWebTokenError$3.prototype = Object.create(Error.prototype); JsonWebTokenError$3.prototype.constructor = JsonWebTokenError$3; module.exports = JsonWebTokenError$3; }) }); //#endregion //#region node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/lib/NotBeforeError.js var require_NotBeforeError = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/lib/NotBeforeError.js": ((exports, module) => { var JsonWebTokenError$2 = require_JsonWebTokenError(); var NotBeforeError$1 = function(message, date) { JsonWebTokenError$2.call(this, message); this.name = "NotBeforeError"; this.date = date; }; NotBeforeError$1.prototype = Object.create(JsonWebTokenError$2.prototype); NotBeforeError$1.prototype.constructor = NotBeforeError$1; module.exports = NotBeforeError$1; }) }); //#endregion //#region node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/lib/TokenExpiredError.js var require_TokenExpiredError = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/lib/TokenExpiredError.js": ((exports, module) => { var JsonWebTokenError$1 = require_JsonWebTokenError(); var TokenExpiredError$1 = function(message, expiredAt) { JsonWebTokenError$1.call(this, message); this.name = "TokenExpiredError"; this.expiredAt = expiredAt; }; TokenExpiredError$1.prototype = Object.create(JsonWebTokenError$1.prototype); TokenExpiredError$1.prototype.constructor = TokenExpiredError$1; module.exports = TokenExpiredError$1; }) }); //#endregion //#region node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/lib/timespan.js var require_timespan = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/lib/timespan.js": ((exports, module) => { var ms = require_ms(); module.exports = function(time, iat) { var timestamp = iat || Math.floor(Date.now() / 1e3); if (typeof time === "string") { var milliseconds = ms(time); if (typeof milliseconds === "undefined") return; return Math.floor(timestamp + milliseconds / 1e3); } else if (typeof time === "number") return timestamp + time; else return; }; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js var require_constants = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js": ((exports, module) => { const SEMVER_SPEC_VERSION = "2.0.0"; const MAX_LENGTH$2 = 256; const MAX_SAFE_INTEGER$2 = Number.MAX_SAFE_INTEGER || 9007199254740991; const MAX_SAFE_COMPONENT_LENGTH$1 = 16; const MAX_SAFE_BUILD_LENGTH$1 = MAX_LENGTH$2 - 6; const RELEASE_TYPES = [ "major", "premajor", "minor", "preminor", "patch", "prepatch", "prerelease" ]; module.exports = { MAX_LENGTH: MAX_LENGTH$2, MAX_SAFE_COMPONENT_LENGTH: MAX_SAFE_COMPONENT_LENGTH$1, MAX_SAFE_BUILD_LENGTH: MAX_SAFE_BUILD_LENGTH$1, MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$2, RELEASE_TYPES, SEMVER_SPEC_VERSION, FLAG_INCLUDE_PRERELEASE: 1, FLAG_LOOSE: 2 }; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js var require_debug = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js": ((exports, module) => { const debug$4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {}; module.exports = debug$4; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js var require_re = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js": ((exports, module) => { const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH: MAX_LENGTH$1 } = require_constants(); const debug$3 = require_debug(); exports = module.exports = {}; const re$4 = exports.re = []; const safeRe = exports.safeRe = []; const src$1 = exports.src = []; const safeSrc = exports.safeSrc = []; const t$4 = exports.t = {}; let R = 0; const LETTERDASHNUMBER = "[a-zA-Z0-9-]"; const safeRegexReplacements = [ ["\\s", 1], ["\\d", MAX_LENGTH$1], [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] ]; const makeSafeRegex = (value) => { for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); return value; }; const createToken = (name, value, isGlobal) => { const safe = makeSafeRegex(value); const index = R++; debug$3(name, index, value); t$4[name] = index; src$1[index] = value; safeSrc[index] = safe; re$4[index] = new RegExp(value, isGlobal ? "g" : void 0); safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); }; createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); createToken("MAINVERSION", `(${src$1[t$4.NUMERICIDENTIFIER]})\\.(${src$1[t$4.NUMERICIDENTIFIER]})\\.(${src$1[t$4.NUMERICIDENTIFIER]})`); createToken("MAINVERSIONLOOSE", `(${src$1[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src$1[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src$1[t$4.NUMERICIDENTIFIERLOOSE]})`); createToken("PRERELEASEIDENTIFIER", `(?:${src$1[t$4.NUMERICIDENTIFIER]}|${src$1[t$4.NONNUMERICIDENTIFIER]})`); createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src$1[t$4.NUMERICIDENTIFIERLOOSE]}|${src$1[t$4.NONNUMERICIDENTIFIER]})`); createToken("PRERELEASE", `(?:-(${src$1[t$4.PRERELEASEIDENTIFIER]}(?:\\.${src$1[t$4.PRERELEASEIDENTIFIER]})*))`); createToken("PRERELEASELOOSE", `(?:-?(${src$1[t$4.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src$1[t$4.PRERELEASEIDENTIFIERLOOSE]})*))`); createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); createToken("BUILD", `(?:\\+(${src$1[t$4.BUILDIDENTIFIER]}(?:\\.${src$1[t$4.BUILDIDENTIFIER]})*))`); createToken("FULLPLAIN", `v?${src$1[t$4.MAINVERSION]}${src$1[t$4.PRERELEASE]}?${src$1[t$4.BUILD]}?`); createToken("FULL", `^${src$1[t$4.FULLPLAIN]}$`); createToken("LOOSEPLAIN", `[v=\\s]*${src$1[t$4.MAINVERSIONLOOSE]}${src$1[t$4.PRERELEASELOOSE]}?${src$1[t$4.BUILD]}?`); createToken("LOOSE", `^${src$1[t$4.LOOSEPLAIN]}$`); createToken("GTLT", "((?:<|>)?=?)"); createToken("XRANGEIDENTIFIERLOOSE", `${src$1[t$4.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); createToken("XRANGEIDENTIFIER", `${src$1[t$4.NUMERICIDENTIFIER]}|x|X|\\*`); createToken("XRANGEPLAIN", `[v=\\s]*(${src$1[t$4.XRANGEIDENTIFIER]})(?:\\.(${src$1[t$4.XRANGEIDENTIFIER]})(?:\\.(${src$1[t$4.XRANGEIDENTIFIER]})(?:${src$1[t$4.PRERELEASE]})?${src$1[t$4.BUILD]}?)?)?`); createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src$1[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src$1[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src$1[t$4.XRANGEIDENTIFIERLOOSE]})(?:${src$1[t$4.PRERELEASELOOSE]})?${src$1[t$4.BUILD]}?)?)?`); createToken("XRANGE", `^${src$1[t$4.GTLT]}\\s*${src$1[t$4.XRANGEPLAIN]}$`); createToken("XRANGELOOSE", `^${src$1[t$4.GTLT]}\\s*${src$1[t$4.XRANGEPLAINLOOSE]}$`); createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`); createToken("COERCE", `${src$1[t$4.COERCEPLAIN]}(?:$|[^\\d])`); createToken("COERCEFULL", src$1[t$4.COERCEPLAIN] + `(?:${src$1[t$4.PRERELEASE]})?(?:${src$1[t$4.BUILD]})?(?:$|[^\\d])`); createToken("COERCERTL", src$1[t$4.COERCE], true); createToken("COERCERTLFULL", src$1[t$4.COERCEFULL], true); createToken("LONETILDE", "(?:~>?)"); createToken("TILDETRIM", `(\\s*)${src$1[t$4.LONETILDE]}\\s+`, true); exports.tildeTrimReplace = "$1~"; createToken("TILDE", `^${src$1[t$4.LONETILDE]}${src$1[t$4.XRANGEPLAIN]}$`); createToken("TILDELOOSE", `^${src$1[t$4.LONETILDE]}${src$1[t$4.XRANGEPLAINLOOSE]}$`); createToken("LONECARET", "(?:\\^)"); createToken("CARETTRIM", `(\\s*)${src$1[t$4.LONECARET]}\\s+`, true); exports.caretTrimReplace = "$1^"; createToken("CARET", `^${src$1[t$4.LONECARET]}${src$1[t$4.XRANGEPLAIN]}$`); createToken("CARETLOOSE", `^${src$1[t$4.LONECARET]}${src$1[t$4.XRANGEPLAINLOOSE]}$`); createToken("COMPARATORLOOSE", `^${src$1[t$4.GTLT]}\\s*(${src$1[t$4.LOOSEPLAIN]})$|^$`); createToken("COMPARATOR", `^${src$1[t$4.GTLT]}\\s*(${src$1[t$4.FULLPLAIN]})$|^$`); createToken("COMPARATORTRIM", `(\\s*)${src$1[t$4.GTLT]}\\s*(${src$1[t$4.LOOSEPLAIN]}|${src$1[t$4.XRANGEPLAIN]})`, true); exports.comparatorTrimReplace = "$1$2$3"; createToken("HYPHENRANGE", `^\\s*(${src$1[t$4.XRANGEPLAIN]})\\s+-\\s+(${src$1[t$4.XRANGEPLAIN]})\\s*$`); createToken("HYPHENRANGELOOSE", `^\\s*(${src$1[t$4.XRANGEPLAINLOOSE]})\\s+-\\s+(${src$1[t$4.XRANGEPLAINLOOSE]})\\s*$`); createToken("STAR", "(<|>)?=?\\s*\\*"); createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js var require_parse_options = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js": ((exports, module) => { const looseOption = Object.freeze({ loose: true }); const emptyOpts = Object.freeze({}); const parseOptions$3 = (options) => { if (!options) return emptyOpts; if (typeof options !== "object") return looseOption; return options; }; module.exports = parseOptions$3; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js var require_identifiers = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js": ((exports, module) => { const numeric = /^[0-9]+$/; const compareIdentifiers$1 = (a, b) => { const anum = numeric.test(a); const bnum = numeric.test(b); if (anum && bnum) { a = +a; b = +b; } return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; }; const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a); module.exports = { compareIdentifiers: compareIdentifiers$1, rcompareIdentifiers }; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js var require_semver$1 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js": ((exports, module) => { const debug$2 = require_debug(); const { MAX_LENGTH, MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1 } = require_constants(); const { safeRe: re$3, safeSrc: src, t: t$3 } = require_re(); const parseOptions$2 = require_parse_options(); const { compareIdentifiers } = require_identifiers(); var SemVer$15 = class SemVer$15 { constructor(version, options) { options = parseOptions$2(options); if (version instanceof SemVer$15) if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version; else version = version.version; else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`); if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`); debug$2("SemVer", version, options); this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; const m = version.trim().match(options.loose ? re$3[t$3.LOOSE] : re$3[t$3.FULL]); if (!m) throw new TypeError(`Invalid Version: ${version}`); this.raw = version; this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; if (this.major > MAX_SAFE_INTEGER$1 || this.major < 0) throw new TypeError("Invalid major version"); if (this.minor > MAX_SAFE_INTEGER$1 || this.minor < 0) throw new TypeError("Invalid minor version"); if (this.patch > MAX_SAFE_INTEGER$1 || this.patch < 0) throw new TypeError("Invalid patch version"); if (!m[4]) this.prerelease = []; else this.prerelease = m[4].split(".").map((id) => { if (/^[0-9]+$/.test(id)) { const num = +id; if (num >= 0 && num < MAX_SAFE_INTEGER$1) return num; } return id; }); this.build = m[5] ? m[5].split(".") : []; this.format(); } format() { this.version = `${this.major}.${this.minor}.${this.patch}`; if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`; return this.version; } toString() { return this.version; } compare(other) { debug$2("SemVer.compare", this.version, this.options, other); if (!(other instanceof SemVer$15)) { if (typeof other === "string" && other === this.version) return 0; other = new SemVer$15(other, this.options); } if (other.version === this.version) return 0; return this.compareMain(other) || this.comparePre(other); } compareMain(other) { if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options); return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); } comparePre(other) { if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options); if (this.prerelease.length && !other.prerelease.length) return -1; else if (!this.prerelease.length && other.prerelease.length) return 1; else if (!this.prerelease.length && !other.prerelease.length) return 0; let i = 0; do { const a = this.prerelease[i]; const b = other.prerelease[i]; debug$2("prerelease compare", i, a, b); if (a === void 0 && b === void 0) return 0; else if (b === void 0) return 1; else if (a === void 0) return -1; else if (a === b) continue; else return compareIdentifiers(a, b); } while (++i); } compareBuild(other) { if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options); let i = 0; do { const a = this.build[i]; const b = other.build[i]; debug$2("build compare", i, a, b); if (a === void 0 && b === void 0) return 0; else if (b === void 0) return 1; else if (a === void 0) return -1; else if (a === b) continue; else return compareIdentifiers(a, b); } while (++i); } inc(release, identifier, identifierBase) { if (release.startsWith("pre")) { if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty"); if (identifier) { const r = /* @__PURE__ */ new RegExp(`^${this.options.loose ? src[t$3.PRERELEASELOOSE] : src[t$3.PRERELEASE]}$`); const match = `-${identifier}`.match(r); if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`); } } switch (release) { case "premajor": this.prerelease.length = 0; this.patch = 0; this.minor = 0; this.major++; this.inc("pre", identifier, identifierBase); break; case "preminor": this.prerelease.length = 0; this.patch = 0; this.minor++; this.inc("pre", identifier, identifierBase); break; case "prepatch": this.prerelease.length = 0; this.inc("patch", identifier, identifierBase); this.inc("pre", identifier, identifierBase); break; case "prerelease": if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase); this.inc("pre", identifier, identifierBase); break; case "release": if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`); this.prerelease.length = 0; break; case "major": if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++; this.minor = 0; this.patch = 0; this.prerelease = []; break; case "minor": if (this.patch !== 0 || this.prerelease.length === 0) this.minor++; this.patch = 0; this.prerelease = []; break; case "patch": if (this.prerelease.length === 0) this.patch++; this.prerelease = []; break; case "pre": { const base = Number(identifierBase) ? 1 : 0; if (this.prerelease.length === 0) this.prerelease = [base]; else { let i = this.prerelease.length; while (--i >= 0) if (typeof this.prerelease[i] === "number") { this.prerelease[i]++; i = -2; } if (i === -1) { if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists"); this.prerelease.push(base); } } if (identifier) { let prerelease$2 = [identifier, base]; if (identifierBase === false) prerelease$2 = [identifier]; if (compareIdentifiers(this.prerelease[0], identifier) === 0) { if (isNaN(this.prerelease[1])) this.prerelease = prerelease$2; } else this.prerelease = prerelease$2; } break; } default: throw new Error(`invalid increment argument: ${release}`); } this.raw = this.format(); if (this.build.length) this.raw += `+${this.build.join(".")}`; return this; } }; module.exports = SemVer$15; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js var require_parse = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js": ((exports, module) => { const SemVer$14 = require_semver$1(); const parse$6 = (version, options, throwErrors = false) => { if (version instanceof SemVer$14) return version; try { return new SemVer$14(version, options); } catch (er) { if (!throwErrors) return null; throw er; } }; module.exports = parse$6; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/valid.js var require_valid$1 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/valid.js": ((exports, module) => { const parse$5 = require_parse(); const valid$1 = (version, options) => { const v = parse$5(version, options); return v ? v.version : null; }; module.exports = valid$1; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/clean.js var require_clean = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/clean.js": ((exports, module) => { const parse$4 = require_parse(); const clean$1 = (version, options) => { const s = parse$4(version.trim().replace(/^[=v]+/, ""), options); return s ? s.version : null; }; module.exports = clean$1; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/inc.js var require_inc = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/inc.js": ((exports, module) => { const SemVer$13 = require_semver$1(); const inc$1 = (version, release, options, identifier, identifierBase) => { if (typeof options === "string") { identifierBase = identifier; identifier = options; options = void 0; } try { return new SemVer$13(version instanceof SemVer$13 ? version.version : version, options).inc(release, identifier, identifierBase).version; } catch (er) { return null; } }; module.exports = inc$1; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/diff.js var require_diff = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/diff.js": ((exports, module) => { const parse$3 = require_parse(); const diff$1 = (version1, version2) => { const v1 = parse$3(version1, null, true); const v2 = parse$3(version2, null, true); const comparison = v1.compare(v2); if (comparison === 0) return null; const v1Higher = comparison > 0; const highVersion = v1Higher ? v1 : v2; const lowVersion = v1Higher ? v2 : v1; const highHasPre = !!highVersion.prerelease.length; if (!!lowVersion.prerelease.length && !highHasPre) { if (!lowVersion.patch && !lowVersion.minor) return "major"; if (lowVersion.compareMain(highVersion) === 0) { if (lowVersion.minor && !lowVersion.patch) return "minor"; return "patch"; } } const prefix = highHasPre ? "pre" : ""; if (v1.major !== v2.major) return prefix + "major"; if (v1.minor !== v2.minor) return prefix + "minor"; if (v1.patch !== v2.patch) return prefix + "patch"; return "prerelease"; }; module.exports = diff$1; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/major.js var require_major = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/major.js": ((exports, module) => { const SemVer$12 = require_semver$1(); const major$1 = (a, loose) => new SemVer$12(a, loose).major; module.exports = major$1; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/minor.js var require_minor = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/minor.js": ((exports, module) => { const SemVer$11 = require_semver$1(); const minor$1 = (a, loose) => new SemVer$11(a, loose).minor; module.exports = minor$1; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/patch.js var require_patch = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/patch.js": ((exports, module) => { const SemVer$10 = require_semver$1(); const patch$1 = (a, loose) => new SemVer$10(a, loose).patch; module.exports = patch$1; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/prerelease.js var require_prerelease = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/prerelease.js": ((exports, module) => { const parse$2 = require_parse(); const prerelease$1 = (version, options) => { const parsed = parse$2(version, options); return parsed && parsed.prerelease.length ? parsed.prerelease : null; }; module.exports = prerelease$1; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js var require_compare = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js": ((exports, module) => { const SemVer$9 = require_semver$1(); const compare$11 = (a, b, loose) => new SemVer$9(a, loose).compare(new SemVer$9(b, loose)); module.exports = compare$11; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rcompare.js var require_rcompare = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rcompare.js": ((exports, module) => { const compare$10 = require_compare(); const rcompare$1 = (a, b, loose) => compare$10(b, a, loose); module.exports = rcompare$1; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-loose.js var require_compare_loose = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-loose.js": ((exports, module) => { const compare$9 = require_compare(); const compareLoose$1 = (a, b) => compare$9(a, b, true); module.exports = compareLoose$1; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js var require_compare_build = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js": ((exports, module) => { const SemVer$8 = require_semver$1(); const compareBuild$3 = (a, b, loose) => { const versionA = new SemVer$8(a, loose); const versionB = new SemVer$8(b, loose); return versionA.compare(versionB) || versionA.compareBuild(versionB); }; module.exports = compareBuild$3; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/sort.js var require_sort = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/sort.js": ((exports, module) => { const compareBuild$2 = require_compare_build(); const sort$1 = (list, loose) => list.sort((a, b) => compareBuild$2(a, b, loose)); module.exports = sort$1; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rsort.js var require_rsort = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rsort.js": ((exports, module) => { const compareBuild$1 = require_compare_build(); const rsort$1 = (list, loose) => list.sort((a, b) => compareBuild$1(b, a, loose)); module.exports = rsort$1; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js var require_gt = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js": ((exports, module) => { const compare$8 = require_compare(); const gt$4 = (a, b, loose) => compare$8(a, b, loose) > 0; module.exports = gt$4; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js var require_lt = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js": ((exports, module) => { const compare$7 = require_compare(); const lt$3 = (a, b, loose) => compare$7(a, b, loose) < 0; module.exports = lt$3; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js var require_eq = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js": ((exports, module) => { const compare$6 = require_compare(); const eq$2 = (a, b, loose) => compare$6(a, b, loose) === 0; module.exports = eq$2; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js var require_neq = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js": ((exports, module) => { const compare$5 = require_compare(); const neq$2 = (a, b, loose) => compare$5(a, b, loose) !== 0; module.exports = neq$2; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js var require_gte = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js": ((exports, module) => { const compare$4 = require_compare(); const gte$3 = (a, b, loose) => compare$4(a, b, loose) >= 0; module.exports = gte$3; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js var require_lte = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js": ((exports, module) => { const compare$3 = require_compare(); const lte$3 = (a, b, loose) => compare$3(a, b, loose) <= 0; module.exports = lte$3; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/cmp.js var require_cmp = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/cmp.js": ((exports, module) => { const eq$1 = require_eq(); const neq$1 = require_neq(); const gt$3 = require_gt(); const gte$2 = require_gte(); const lt$2 = require_lt(); const lte$2 = require_lte(); const cmp$2 = (a, op, b, loose) => { switch (op) { case "===": if (typeof a === "object") a = a.version; if (typeof b === "object") b = b.version; return a === b; case "!==": if (typeof a === "object") a = a.version; if (typeof b === "object") b = b.version; return a !== b; case "": case "=": case "==": return eq$1(a, b, loose); case "!=": return neq$1(a, b, loose); case ">": return gt$3(a, b, loose); case ">=": return gte$2(a, b, loose); case "<": return lt$2(a, b, loose); case "<=": return lte$2(a, b, loose); default: throw new TypeError(`Invalid operator: ${op}`); } }; module.exports = cmp$2; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/coerce.js var require_coerce = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/coerce.js": ((exports, module) => { const SemVer$7 = require_semver$1(); const parse$1 = require_parse(); const { safeRe: re$2, t: t$2 } = require_re(); const coerce$1 = (version, options) => { if (version instanceof SemVer$7) return version; if (typeof version === "number") version = String(version); if (typeof version !== "string") return null; options = options || {}; let match = null; if (!options.rtl) match = version.match(options.includePrerelease ? re$2[t$2.COERCEFULL] : re$2[t$2.COERCE]); else { const coerceRtlRegex = options.includePrerelease ? re$2[t$2.COERCERTLFULL] : re$2[t$2.COERCERTL]; let next; while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) { if (!match || next.index + next[0].length !== match.index + match[0].length) match = next; coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length; } coerceRtlRegex.lastIndex = -1; } if (match === null) return null; const major$2 = match[2]; return parse$1(`${major$2}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options); }; module.exports = coerce$1; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/lrucache.js var require_lrucache = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/lrucache.js": ((exports, module) => { var LRUCache = class { constructor() { this.max = 1e3; this.map = /* @__PURE__ */ new Map(); } get(key) { const value = this.map.get(key); if (value === void 0) return; else { this.map.delete(key); this.map.set(key, value); return value; } } delete(key) { return this.map.delete(key); } set(key, value) { if (!this.delete(key) && value !== void 0) { if (this.map.size >= this.max) { const firstKey = this.map.keys().next().value; this.delete(firstKey); } this.map.set(key, value); } return this; } }; module.exports = LRUCache; }) }); //#endregion //#region node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js var require_range = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js": ((exports, module) => { const SPACE_CHARACTERS = /\s+/g; var Range$11 = class Range$11 { constructor(range, options) { options = parseOptions$1(options); if (range instanceof Range$11) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range; else return new Range$11(range.raw, options); if (range instanceof Comparator$4) { this.raw = range.value; this.set = [[range]]; this.formatted = void 0; return this; } this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; this.raw = range.trim().replace(SPACE_CHARACTERS, " "); this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length); if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`); if (this.set.length > 1) { const first = this.set[0]; this.set = this.set.filter((c) => !isNullSet(c[0])); if (this.set.length === 0) this.set = [first]; else if (this.set.length > 1) { for (const c of this.set) if (c.length === 1 && isAny(c[0])) { this.set = [c]; break; } } } this.formatted = void 0; } get range() { if (this.formatted === void 0) { this.formatted = ""; for (let i = 0; i < this.set.length; i++) { if (i > 0) this.formatted += "||"; const comps = this.set[i]; for (let k = 0; k < comps.length; k++) { if (k > 0) this.formatted += " "; this.formatted += comps[k].toString().trim(); } } } return this.formatted; } format() { return this.range; } toString() { return this.range; } parseRange(range) { const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range; const cached = cache.get(memoKey); if (cached) return cached; const loose = this.options.loose; const hr = loose ? re$1[t$1.HYPHENRANGELOOSE] : re$1[t$1.HYPHENRANGE]; range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); debug$1("hyphen replace", range); range = range.replace(re$1[t$1.COMPARATORTRIM], comparatorTrimReplace); debug$1("comparator trim", range); range = range.replace(re$1[t$1.TILDETRIM], tildeTrimReplace); debug$1("tilde trim", range); range = range.replace(re$1[t$1.CARETTRIM], caretTrimReplace); debug$1("caret trim", range); let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)); if (loose) rangeList = rangeList.filter((comp) => { debug$1("loose invalid filter", comp, this.options); return !!comp.match(re$1[t$1.COMPARATORLOOSE]); }); debug$1("range list", rangeList); const rangeMap = /* @__PURE__ */ new Map(); const comparators = rangeList.map((comp) => new Comparator$4(comp, this.options)); for (const comp of comparators) { if (isNullSet(comp)) return [comp]; rangeMap.set(comp.value, comp); } if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete(""); const result = [...rangeMap.values()]; cac