UNPKG

nuxi

Version:
792 lines (791 loc) 31.6 kB
import { t as __commonJSMin } from "./chunk-Vs_PY4HZ.mjs"; //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/constants.js var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => { const SEMVER_SPEC_VERSION = "2.0.0"; const MAX_LENGTH = 256; const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; module.exports = { MAX_LENGTH, MAX_SAFE_COMPONENT_LENGTH: 16, MAX_SAFE_BUILD_LENGTH: MAX_LENGTH - 6, MAX_SAFE_INTEGER, RELEASE_TYPES: [ "major", "premajor", "minor", "preminor", "patch", "prepatch", "prerelease" ], SEMVER_SPEC_VERSION, FLAG_INCLUDE_PRERELEASE: 1, FLAG_LOOSE: 2 }; })); //#endregion //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/debug.js var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => { module.exports = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {}; })); //#endregion //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/re.js var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => { const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants(); const debug = require_debug(); exports = module.exports = {}; const re = exports.re = []; const safeRe = exports.safeRe = []; const src = exports.src = []; const safeSrc = exports.safeSrc = []; const t = exports.t = {}; let R = 0; const LETTERDASHNUMBER = "[a-zA-Z0-9-]"; const safeRegexReplacements = [ ["\\s", 1], ["\\d", MAX_LENGTH], [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(name, index, value); t[name] = index; src[index] = value; safeSrc[index] = safe; re[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[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`); createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`); createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`); createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`); createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`); createToken("FULL", `^${src[t.FULLPLAIN]}$`); createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`); createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`); createToken("GTLT", "((?:<|>)?=?)"); createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`); createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`); createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.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[t.COERCEPLAIN]}(?:$|[^\\d])`); createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`); createToken("COERCERTL", src[t.COERCE], true); createToken("COERCERTLFULL", src[t.COERCEFULL], true); createToken("LONETILDE", "(?:~>?)"); createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true); exports.tildeTrimReplace = "$1~"; createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); createToken("LONECARET", "(?:\\^)"); createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true); exports.caretTrimReplace = "$1^"; createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); exports.comparatorTrimReplace = "$1$2$3"; createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`); createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.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.8.0/node_modules/semver/internal/parse-options.js var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => { const looseOption = Object.freeze({ loose: true }); const emptyOpts = Object.freeze({}); const parseOptions = (options) => { if (!options) return emptyOpts; if (typeof options !== "object") return looseOption; return options; }; module.exports = parseOptions; })); //#endregion //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/identifiers.js var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => { const numeric = /^[0-9]+$/; const compareIdentifiers = (a, b) => { if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1; 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(b, a); module.exports = { compareIdentifiers, rcompareIdentifiers }; })); //#endregion //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/semver.js var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => { const debug = require_debug(); const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants(); const { safeRe: re, t } = require_re(); const parseOptions = require_parse_options(); const { compareIdentifiers } = require_identifiers(); module.exports = class SemVer { constructor(version, options) { options = parseOptions(options); if (version instanceof SemVer) 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("SemVer", version, options); this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.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 || this.major < 0) throw new TypeError("Invalid major version"); if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version"); if (this.patch > MAX_SAFE_INTEGER || 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) 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("SemVer.compare", this.version, this.options, other); if (!(other instanceof SemVer)) { if (typeof other === "string" && other === this.version) return 0; other = new SemVer(other, this.options); } if (other.version === this.version) return 0; return this.compareMain(other) || this.comparePre(other); } compareMain(other) { if (!(other instanceof SemVer)) other = new SemVer(other, this.options); if (this.major < other.major) return -1; if (this.major > other.major) return 1; if (this.minor < other.minor) return -1; if (this.minor > other.minor) return 1; if (this.patch < other.patch) return -1; if (this.patch > other.patch) return 1; return 0; } comparePre(other) { if (!(other instanceof SemVer)) other = new SemVer(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("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)) other = new SemVer(other, this.options); let i = 0; do { const a = this.build[i]; const b = other.build[i]; debug("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 match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]); 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 = [identifier, base]; if (identifierBase === false) prerelease = [identifier]; if (compareIdentifiers(this.prerelease[0], identifier) === 0) { if (isNaN(this.prerelease[1])) this.prerelease = prerelease; } else this.prerelease = prerelease; } break; } default: throw new Error(`invalid increment argument: ${release}`); } this.raw = this.format(); if (this.build.length) this.raw += `+${this.build.join(".")}`; return this; } }; })); //#endregion //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare.js var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => { const SemVer = require_semver(); const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)); module.exports = compare; })); //#endregion //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gt.js var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => { const compare = require_compare(); const gt = (a, b, loose) => compare(a, b, loose) > 0; module.exports = gt; })); //#endregion //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lt.js var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => { const compare = require_compare(); const lt = (a, b, loose) => compare(a, b, loose) < 0; module.exports = lt; })); //#endregion //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/eq.js var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => { const compare = require_compare(); const eq = (a, b, loose) => compare(a, b, loose) === 0; module.exports = eq; })); //#endregion //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/neq.js var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => { const compare = require_compare(); const neq = (a, b, loose) => compare(a, b, loose) !== 0; module.exports = neq; })); //#endregion //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gte.js var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => { const compare = require_compare(); const gte = (a, b, loose) => compare(a, b, loose) >= 0; module.exports = gte; })); //#endregion //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lte.js var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => { const compare = require_compare(); const lte = (a, b, loose) => compare(a, b, loose) <= 0; module.exports = lte; })); //#endregion //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/cmp.js var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => { const eq = require_eq(); const neq = require_neq(); const gt = require_gt(); const gte = require_gte(); const lt = require_lt(); const lte = require_lte(); const cmp = (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(a, b, loose); case "!=": return neq(a, b, loose); case ">": return gt(a, b, loose); case ">=": return gte(a, b, loose); case "<": return lt(a, b, loose); case "<=": return lte(a, b, loose); default: throw new TypeError(`Invalid operator: ${op}`); } }; module.exports = cmp; })); //#endregion //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/lrucache.js var require_lrucache = /* @__PURE__ */ __commonJSMin(((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.8.0/node_modules/semver/classes/range.js var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => { const SPACE_CHARACTERS = /\s+/g; module.exports = class Range { constructor(range, options) { options = parseOptions(options); if (range instanceof Range) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range; else return new Range(range.raw, options); if (range instanceof Comparator) { 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[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); debug("hyphen replace", range); range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); debug("comparator trim", range); range = range.replace(re[t.TILDETRIM], tildeTrimReplace); debug("tilde trim", range); range = range.replace(re[t.CARETTRIM], caretTrimReplace); debug("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("loose invalid filter", comp, this.options); return !!comp.match(re[t.COMPARATORLOOSE]); }); debug("range list", rangeList); const rangeMap = /* @__PURE__ */ new Map(); const comparators = rangeList.map((comp) => new Comparator(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()]; cache.set(memoKey, result); return result; } intersects(range, options) { if (!(range instanceof Range)) throw new TypeError("a Range is required"); return this.set.some((thisComparators) => { return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { return rangeComparators.every((rangeComparator) => { return thisComparator.intersects(rangeComparator, options); }); }); }); }); } test(version) { if (!version) return false; if (typeof version === "string") try { version = new SemVer(version, this.options); } catch (er) { return false; } for (let i = 0; i < this.set.length; i++) if (testSet(this.set[i], version, this.options)) return true; return false; } }; const cache = new (require_lrucache())(); const parseOptions = require_parse_options(); const Comparator = require_comparator(); const debug = require_debug(); const SemVer = require_semver(); const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re(); const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants(); const isNullSet = (c) => c.value === "<0.0.0-0"; const isAny = (c) => c.value === ""; const isSatisfiable = (comparators, options) => { let result = true; const remainingComparators = comparators.slice(); let testComparator = remainingComparators.pop(); while (result && remainingComparators.length) { result = remainingComparators.every((otherComparator) => { return testComparator.intersects(otherComparator, options); }); testComparator = remainingComparators.pop(); } return result; }; const parseComparator = (comp, options) => { comp = comp.replace(re[t.BUILD], ""); debug("comp", comp, options); comp = replaceCarets(comp, options); debug("caret", comp); comp = replaceTildes(comp, options); debug("tildes", comp); comp = replaceXRanges(comp, options); debug("xrange", comp); comp = replaceStars(comp, options); debug("stars", comp); return comp; }; const isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; const replaceTildes = (comp, options) => { return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" "); }; const replaceTilde = (comp, options) => { const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; return comp.replace(r, (_, M, m, p, pr) => { debug("tilde", comp, _, M, m, p, pr); let ret; if (isX(M)) ret = ""; else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`; else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`; else if (pr) { debug("replaceTilde pr", pr); ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; } else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; debug("tilde return", ret); return ret; }); }; const replaceCarets = (comp, options) => { return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" "); }; const replaceCaret = (comp, options) => { debug("caret", comp, options); const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; const z = options.includePrerelease ? "-0" : ""; return comp.replace(r, (_, M, m, p, pr) => { debug("caret", comp, _, M, m, p, pr); let ret; if (isX(M)) ret = ""; else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`; else if (pr) { debug("replaceCaret pr", pr); if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`; else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; } else { debug("no pr"); if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`; else ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`; else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; } debug("caret return", ret); return ret; }); }; const replaceXRanges = (comp, options) => { debug("replaceXRanges", comp, options); return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" "); }; const replaceXRange = (comp, options) => { comp = comp.trim(); const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; return comp.replace(r, (ret, gtlt, M, m, p, pr) => { debug("xRange", comp, ret, gtlt, M, m, p, pr); const xM = isX(M); const xm = xM || isX(m); const xp = xm || isX(p); const anyX = xp; if (gtlt === "=" && anyX) gtlt = ""; pr = options.includePrerelease ? "-0" : ""; if (xM) if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0"; else ret = "*"; else if (gtlt && anyX) { if (xm) m = 0; p = 0; if (gtlt === ">") { gtlt = ">="; if (xm) { M = +M + 1; m = 0; p = 0; } else { m = +m + 1; p = 0; } } else if (gtlt === "<=") { gtlt = "<"; if (xm) M = +M + 1; else m = +m + 1; } if (gtlt === "<") pr = "-0"; ret = `${gtlt + M}.${m}.${p}${pr}`; } else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`; debug("xRange return", ret); return ret; }); }; const replaceStars = (comp, options) => { debug("replaceStars", comp, options); return comp.trim().replace(re[t.STAR], ""); }; const replaceGTE0 = (comp, options) => { debug("replaceGTE0", comp, options); return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], ""); }; const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => { if (isX(fM)) from = ""; else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`; else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; else if (fpr) from = `>=${from}`; else from = `>=${from}${incPr ? "-0" : ""}`; if (isX(tM)) to = ""; else if (isX(tm)) to = `<${+tM + 1}.0.0-0`; else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`; else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`; else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`; else to = `<=${to}`; return `${from} ${to}`.trim(); }; const testSet = (set, version, options) => { for (let i = 0; i < set.length; i++) if (!set[i].test(version)) return false; if (version.prerelease.length && !options.includePrerelease) { for (let i = 0; i < set.length; i++) { debug(set[i].semver); if (set[i].semver === Comparator.ANY) continue; if (set[i].semver.prerelease.length > 0) { const allowed = set[i].semver; if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true; } } return false; } return true; }; })); //#endregion //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/comparator.js var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => { const ANY = Symbol("SemVer ANY"); module.exports = class Comparator { static get ANY() { return ANY; } constructor(comp, options) { options = parseOptions(options); if (comp instanceof Comparator) if (comp.loose === !!options.loose) return comp; else comp = comp.value; comp = comp.trim().split(/\s+/).join(" "); debug("comparator", comp, options); this.options = options; this.loose = !!options.loose; this.parse(comp); if (this.semver === ANY) this.value = ""; else this.value = this.operator + this.semver.version; debug("comp", this); } parse(comp) { const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; const m = comp.match(r); if (!m) throw new TypeError(`Invalid comparator: ${comp}`); this.operator = m[1] !== void 0 ? m[1] : ""; if (this.operator === "=") this.operator = ""; if (!m[2]) this.semver = ANY; else this.semver = new SemVer(m[2], this.options.loose); } toString() { return this.value; } test(version) { debug("Comparator.test", version, this.options.loose); if (this.semver === ANY || version === ANY) return true; if (typeof version === "string") try { version = new SemVer(version, this.options); } catch (er) { return false; } return cmp(version, this.operator, this.semver, this.options); } intersects(comp, options) { if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required"); if (this.operator === "") { if (this.value === "") return true; return new Range(comp.value, options).test(this.value); } else if (comp.operator === "") { if (comp.value === "") return true; return new Range(this.value, options).test(comp.semver); } options = parseOptions(options); if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false; if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false; if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true; if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true; if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true; if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true; if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true; return false; } }; const parseOptions = require_parse_options(); const { safeRe: re, t } = require_re(); const cmp = require_cmp(); const debug = require_debug(); const SemVer = require_semver(); const Range = require_range(); })); //#endregion //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/satisfies.js var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => { const Range = require_range(); const satisfies = (version, range, options) => { try { range = new Range(range, options); } catch (er) { return false; } return range.test(version); }; module.exports = satisfies; })); //#endregion export { require_lte as a, require_eq as c, require_compare as d, require_semver as f, require_constants as h, require_cmp as i, require_lt as l, require_re as m, require_comparator as n, require_gte as o, require_identifiers as p, require_range as r, require_neq as s, require_satisfies as t, require_gt as u };