From 76cb9c2a39d477a64824a985ade40507e3bbade1 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Fri, 13 Feb 2026 21:34:48 -0800 Subject: feat(vanilla): add testing infrastructure and tests (NK-wjnczv) --- .../node_modules/vite/dist/node/chunks/build.js | 4 + .../node_modules/vite/dist/node/chunks/build2.js | 5538 +++ .../node_modules/vite/dist/node/chunks/chunk.js | 48 + .../node_modules/vite/dist/node/chunks/config.js | 35978 +++++++++++++++++++ .../node_modules/vite/dist/node/chunks/config2.js | 4 + vanilla/node_modules/vite/dist/node/chunks/dist.js | 6758 ++++ vanilla/node_modules/vite/dist/node/chunks/lib.js | 377 + .../node_modules/vite/dist/node/chunks/logger.js | 329 + .../dist/node/chunks/moduleRunnerTransport.d.ts | 96 + .../vite/dist/node/chunks/optimizer.js | 4 + .../vite/dist/node/chunks/postcss-import.js | 479 + .../node_modules/vite/dist/node/chunks/preview.js | 4 + .../node_modules/vite/dist/node/chunks/server.js | 4 + 13 files changed, 49623 insertions(+) create mode 100644 vanilla/node_modules/vite/dist/node/chunks/build.js create mode 100644 vanilla/node_modules/vite/dist/node/chunks/build2.js create mode 100644 vanilla/node_modules/vite/dist/node/chunks/chunk.js create mode 100644 vanilla/node_modules/vite/dist/node/chunks/config.js create mode 100644 vanilla/node_modules/vite/dist/node/chunks/config2.js create mode 100644 vanilla/node_modules/vite/dist/node/chunks/dist.js create mode 100644 vanilla/node_modules/vite/dist/node/chunks/lib.js create mode 100644 vanilla/node_modules/vite/dist/node/chunks/logger.js create mode 100644 vanilla/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts create mode 100644 vanilla/node_modules/vite/dist/node/chunks/optimizer.js create mode 100644 vanilla/node_modules/vite/dist/node/chunks/postcss-import.js create mode 100644 vanilla/node_modules/vite/dist/node/chunks/preview.js create mode 100644 vanilla/node_modules/vite/dist/node/chunks/server.js (limited to 'vanilla/node_modules/vite/dist/node/chunks') diff --git a/vanilla/node_modules/vite/dist/node/chunks/build.js b/vanilla/node_modules/vite/dist/node/chunks/build.js new file mode 100644 index 0000000..cd247f6 --- /dev/null +++ b/vanilla/node_modules/vite/dist/node/chunks/build.js @@ -0,0 +1,4 @@ +import "./logger.js"; +import { A as toOutputFilePathInCss, C as onRollupLog, D as resolveBuilderOptions, E as resolveBuildPlugins, M as toOutputFilePathInJS, N as toOutputFilePathWithoutRuntime, O as resolveLibFilename, S as injectEnvironmentToHooks, T as resolveBuildOutputs, _ as build, b as createBuilder, g as BuildEnvironment, j as toOutputFilePathInHtml, k as resolveUserExternal, v as buildEnvironmentOptionsDefaults, w as resolveBuildEnvironmentOptions, x as createToImportMetaURLBasedRelativeRuntime, y as builderOptionsDefaults } from "./config.js"; + +export { createBuilder, resolveBuildPlugins }; \ No newline at end of file diff --git a/vanilla/node_modules/vite/dist/node/chunks/build2.js b/vanilla/node_modules/vite/dist/node/chunks/build2.js new file mode 100644 index 0000000..c7ecfa3 --- /dev/null +++ b/vanilla/node_modules/vite/dist/node/chunks/build2.js @@ -0,0 +1,5538 @@ +import { i as __require, t as __commonJSMin } from "./chunk.js"; +import { t as require_lib } from "./lib.js"; + +//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.6/node_modules/postcss-modules/build/fs.js +var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getFileSystem = getFileSystem; + exports.setFileSystem = setFileSystem; + let fileSystem = { + readFile: () => { + throw Error("readFile not implemented"); + }, + writeFile: () => { + throw Error("writeFile not implemented"); + } + }; + function setFileSystem(fs) { + fileSystem.readFile = fs.readFile; + fileSystem.writeFile = fs.writeFile; + } + function getFileSystem() { + return fileSystem; + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.6/node_modules/postcss-modules/build/unquote.js +var require_unquote = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = unquote; + const reg = /['"]/; + function unquote(str$1) { + if (!str$1) return ""; + if (reg.test(str$1.charAt(0))) str$1 = str$1.substr(1); + if (reg.test(str$1.charAt(str$1.length - 1))) str$1 = str$1.substr(0, str$1.length - 1); + return str$1; + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.6/node_modules/icss-utils/src/replaceValueSymbols.js +var require_replaceValueSymbols = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const matchValueName = /[$]?[\w-]+/g; + const replaceValueSymbols$2 = (value, replacements) => { + let matches; + while (matches = matchValueName.exec(value)) { + const replacement = replacements[matches[0]]; + if (replacement) { + value = value.slice(0, matches.index) + replacement + value.slice(matchValueName.lastIndex); + matchValueName.lastIndex -= matches[0].length - replacement.length; + } + } + return value; + }; + module.exports = replaceValueSymbols$2; +})); + +//#endregion +//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.6/node_modules/icss-utils/src/replaceSymbols.js +var require_replaceSymbols = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const replaceValueSymbols$1 = require_replaceValueSymbols(); + const replaceSymbols$1 = (css, replacements) => { + css.walk((node) => { + if (node.type === "decl" && node.value) node.value = replaceValueSymbols$1(node.value.toString(), replacements); + else if (node.type === "rule" && node.selector) node.selector = replaceValueSymbols$1(node.selector.toString(), replacements); + else if (node.type === "atrule" && node.params) node.params = replaceValueSymbols$1(node.params.toString(), replacements); + }); + }; + module.exports = replaceSymbols$1; +})); + +//#endregion +//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.6/node_modules/icss-utils/src/extractICSS.js +var require_extractICSS = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const importPattern = /^:import\(("[^"]*"|'[^']*'|[^"']+)\)$/; + const balancedQuotes = /^("[^"]*"|'[^']*'|[^"']+)$/; + const getDeclsObject = (rule) => { + const object = {}; + rule.walkDecls((decl) => { + const before = decl.raws.before ? decl.raws.before.trim() : ""; + object[before + decl.prop] = decl.value; + }); + return object; + }; + /** + * + * @param {string} css + * @param {boolean} removeRules + * @param {'auto' | 'rule' | 'at-rule'} mode + */ + const extractICSS$2 = (css, removeRules = true, mode = "auto") => { + const icssImports = {}; + const icssExports = {}; + function addImports(node, path$2) { + const unquoted = path$2.replace(/'|"/g, ""); + icssImports[unquoted] = Object.assign(icssImports[unquoted] || {}, getDeclsObject(node)); + if (removeRules) node.remove(); + } + function addExports(node) { + Object.assign(icssExports, getDeclsObject(node)); + if (removeRules) node.remove(); + } + css.each((node) => { + if (node.type === "rule" && mode !== "at-rule") { + if (node.selector.slice(0, 7) === ":import") { + const matches = importPattern.exec(node.selector); + if (matches) addImports(node, matches[1]); + } + if (node.selector === ":export") addExports(node); + } + if (node.type === "atrule" && mode !== "rule") { + if (node.name === "icss-import") { + const matches = balancedQuotes.exec(node.params); + if (matches) addImports(node, matches[1]); + } + if (node.name === "icss-export") addExports(node); + } + }); + return { + icssImports, + icssExports + }; + }; + module.exports = extractICSS$2; +})); + +//#endregion +//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.6/node_modules/icss-utils/src/createICSSRules.js +var require_createICSSRules = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const createImports = (imports, postcss, mode = "rule") => { + return Object.keys(imports).map((path$2) => { + const aliases = imports[path$2]; + const declarations = Object.keys(aliases).map((key) => postcss.decl({ + prop: key, + value: aliases[key], + raws: { before: "\n " } + })); + const hasDeclarations = declarations.length > 0; + const rule = mode === "rule" ? postcss.rule({ + selector: `:import('${path$2}')`, + raws: { after: hasDeclarations ? "\n" : "" } + }) : postcss.atRule({ + name: "icss-import", + params: `'${path$2}'`, + raws: { after: hasDeclarations ? "\n" : "" } + }); + if (hasDeclarations) rule.append(declarations); + return rule; + }); + }; + const createExports = (exports$1, postcss, mode = "rule") => { + const declarations = Object.keys(exports$1).map((key) => postcss.decl({ + prop: key, + value: exports$1[key], + raws: { before: "\n " } + })); + if (declarations.length === 0) return []; + const rule = mode === "rule" ? postcss.rule({ + selector: `:export`, + raws: { after: "\n" } + }) : postcss.atRule({ + name: "icss-export", + raws: { after: "\n" } + }); + rule.append(declarations); + return [rule]; + }; + const createICSSRules$1 = (imports, exports$1, postcss, mode) => [...createImports(imports, postcss, mode), ...createExports(exports$1, postcss, mode)]; + module.exports = createICSSRules$1; +})); + +//#endregion +//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.6/node_modules/icss-utils/src/index.js +var require_src$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const replaceValueSymbols = require_replaceValueSymbols(); + const replaceSymbols = require_replaceSymbols(); + const extractICSS$1 = require_extractICSS(); + const createICSSRules = require_createICSSRules(); + module.exports = { + replaceValueSymbols, + replaceSymbols, + extractICSS: extractICSS$1, + createICSSRules + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.6/node_modules/postcss-modules/build/Parser.js +var require_Parser = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = void 0; + var _icssUtils = require_src$4(); + const importRegexp = /^:import\((.+)\)$/; + var Parser$1 = class { + constructor(pathFetcher, trace) { + this.pathFetcher = pathFetcher; + this.plugin = this.plugin.bind(this); + this.exportTokens = {}; + this.translations = {}; + this.trace = trace; + } + plugin() { + const parser$1 = this; + return { + postcssPlugin: "css-modules-parser", + async OnceExit(css) { + await Promise.all(parser$1.fetchAllImports(css)); + parser$1.linkImportedSymbols(css); + return parser$1.extractExports(css); + } + }; + } + fetchAllImports(css) { + let imports = []; + css.each((node) => { + if (node.type == "rule" && node.selector.match(importRegexp)) imports.push(this.fetchImport(node, css.source.input.from, imports.length)); + }); + return imports; + } + linkImportedSymbols(css) { + (0, _icssUtils.replaceSymbols)(css, this.translations); + } + extractExports(css) { + css.each((node) => { + if (node.type == "rule" && node.selector == ":export") this.handleExport(node); + }); + } + handleExport(exportNode) { + exportNode.each((decl) => { + if (decl.type == "decl") { + Object.keys(this.translations).forEach((translation) => { + decl.value = decl.value.replace(translation, this.translations[translation]); + }); + this.exportTokens[decl.prop] = decl.value; + } + }); + exportNode.remove(); + } + async fetchImport(importNode, relativeTo, depNr) { + const file = importNode.selector.match(importRegexp)[1]; + const depTrace = this.trace + String.fromCharCode(depNr); + const exports$1 = await this.pathFetcher(file, relativeTo, depTrace); + try { + importNode.each((decl) => { + if (decl.type == "decl") this.translations[decl.prop] = exports$1[decl.value]; + }); + importNode.remove(); + } catch (err) { + console.log(err); + } + } + }; + exports.default = Parser$1; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.6/node_modules/postcss-modules/build/saveJSON.js +var require_saveJSON = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = saveJSON; + var _fs$2 = require_fs(); + function saveJSON(cssFile, json) { + return new Promise((resolve, reject) => { + const { writeFile } = (0, _fs$2.getFileSystem)(); + writeFile(`${cssFile}.json`, JSON.stringify(json), (e) => e ? reject(e) : resolve(json)); + }); + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/lodash.camelcase@4.3.0/node_modules/lodash.camelcase/index.js +var require_lodash = /* @__PURE__ */ __commonJSMin(((exports, module) => { + /** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + /** Used as references for various `Number` constants. */ + var INFINITY = Infinity; + /** `Object#toString` result references. */ + var symbolTag = "[object Symbol]"; + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + /** Used to compose unicode character classes. */ + var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f\\ufe20-\\ufe23", rsComboSymbolsRange = "\\u20d0-\\u20f0", rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + /** Used to compose unicode capture groups. */ + var rsApos = "['’]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboMarksRange + rsComboSymbolsRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d"; + /** Used to compose unicode regexes. */ + var rsLowerMisc = "(?:" + rsLower + "|" + rsMisc + ")", rsUpperMisc = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptLowerContr = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptUpperContr = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [ + rsNonAstral, + rsRegional, + rsSurrPair + ].join("|") + ")" + rsOptVar + reOptMod + ")*", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [ + rsDingbat, + rsRegional, + rsSurrPair + ].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [ + rsNonAstral + rsCombo + "?", + rsCombo, + rsRegional, + rsSurrPair, + rsAstral + ].join("|") + ")"; + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, "g"); + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, "g"); + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + "?" + rsLower + "+" + rsOptLowerContr + "(?=" + [ + rsBreak, + rsUpper, + "$" + ].join("|") + ")", + rsUpperMisc + "+" + rsOptUpperContr + "(?=" + [ + rsBreak, + rsUpper + rsLowerMisc, + "$" + ].join("|") + ")", + rsUpper + "?" + rsLowerMisc + "+" + rsOptLowerContr, + rsUpper + "+" + rsOptUpperContr, + rsDigits, + rsEmoji + ].join("|"), "g"); + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + "]"); + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + "À": "A", + "Á": "A", + "Â": "A", + "Ã": "A", + "Ä": "A", + "Å": "A", + "à": "a", + "á": "a", + "â": "a", + "ã": "a", + "ä": "a", + "å": "a", + "Ç": "C", + "ç": "c", + "Ð": "D", + "ð": "d", + "È": "E", + "É": "E", + "Ê": "E", + "Ë": "E", + "è": "e", + "é": "e", + "ê": "e", + "ë": "e", + "Ì": "I", + "Í": "I", + "Î": "I", + "Ï": "I", + "ì": "i", + "í": "i", + "î": "i", + "ï": "i", + "Ñ": "N", + "ñ": "n", + "Ò": "O", + "Ó": "O", + "Ô": "O", + "Õ": "O", + "Ö": "O", + "Ø": "O", + "ò": "o", + "ó": "o", + "ô": "o", + "õ": "o", + "ö": "o", + "ø": "o", + "Ù": "U", + "Ú": "U", + "Û": "U", + "Ü": "U", + "ù": "u", + "ú": "u", + "û": "u", + "ü": "u", + "Ý": "Y", + "ý": "y", + "ÿ": "y", + "Æ": "Ae", + "æ": "ae", + "Þ": "Th", + "þ": "th", + "ß": "ss", + "Ā": "A", + "Ă": "A", + "Ą": "A", + "ā": "a", + "ă": "a", + "ą": "a", + "Ć": "C", + "Ĉ": "C", + "Ċ": "C", + "Č": "C", + "ć": "c", + "ĉ": "c", + "ċ": "c", + "č": "c", + "Ď": "D", + "Đ": "D", + "ď": "d", + "đ": "d", + "Ē": "E", + "Ĕ": "E", + "Ė": "E", + "Ę": "E", + "Ě": "E", + "ē": "e", + "ĕ": "e", + "ė": "e", + "ę": "e", + "ě": "e", + "Ĝ": "G", + "Ğ": "G", + "Ġ": "G", + "Ģ": "G", + "ĝ": "g", + "ğ": "g", + "ġ": "g", + "ģ": "g", + "Ĥ": "H", + "Ħ": "H", + "ĥ": "h", + "ħ": "h", + "Ĩ": "I", + "Ī": "I", + "Ĭ": "I", + "Į": "I", + "İ": "I", + "ĩ": "i", + "ī": "i", + "ĭ": "i", + "į": "i", + "ı": "i", + "Ĵ": "J", + "ĵ": "j", + "Ķ": "K", + "ķ": "k", + "ĸ": "k", + "Ĺ": "L", + "Ļ": "L", + "Ľ": "L", + "Ŀ": "L", + "Ł": "L", + "ĺ": "l", + "ļ": "l", + "ľ": "l", + "ŀ": "l", + "ł": "l", + "Ń": "N", + "Ņ": "N", + "Ň": "N", + "Ŋ": "N", + "ń": "n", + "ņ": "n", + "ň": "n", + "ŋ": "n", + "Ō": "O", + "Ŏ": "O", + "Ő": "O", + "ō": "o", + "ŏ": "o", + "ő": "o", + "Ŕ": "R", + "Ŗ": "R", + "Ř": "R", + "ŕ": "r", + "ŗ": "r", + "ř": "r", + "Ś": "S", + "Ŝ": "S", + "Ş": "S", + "Š": "S", + "ś": "s", + "ŝ": "s", + "ş": "s", + "š": "s", + "Ţ": "T", + "Ť": "T", + "Ŧ": "T", + "ţ": "t", + "ť": "t", + "ŧ": "t", + "Ũ": "U", + "Ū": "U", + "Ŭ": "U", + "Ů": "U", + "Ű": "U", + "Ų": "U", + "ũ": "u", + "ū": "u", + "ŭ": "u", + "ů": "u", + "ű": "u", + "ų": "u", + "Ŵ": "W", + "ŵ": "w", + "Ŷ": "Y", + "ŷ": "y", + "Ÿ": "Y", + "Ź": "Z", + "Ż": "Z", + "Ž": "Z", + "ź": "z", + "ż": "z", + "ž": "z", + "IJ": "IJ", + "ij": "ij", + "Œ": "Oe", + "œ": "oe", + "ʼn": "'n", + "ſ": "ss" + }; + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == "object" && global && global.Object === Object && global; + /** Detect free variable `self`. */ + var freeSelf = typeof self == "object" && self && self.Object === Object && self; + /** Used as a reference to the global object. */ + var root$1 = freeGlobal || freeSelf || Function("return this")(); + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, length = array ? array.length : 0; + if (initAccum && length) accumulator = array[++index]; + while (++index < length) accumulator = iteratee(accumulator, array[index], index, array); + return accumulator; + } + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string$1) { + return string$1.split(""); + } + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string$1) { + return string$1.match(reAsciiWord) || []; + } + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? void 0 : object[key]; + }; + } + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string$1) { + return reHasUnicode.test(string$1); + } + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string$1) { + return reHasUnicodeWord.test(string$1); + } + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string$1) { + return hasUnicode(string$1) ? unicodeToArray(string$1) : asciiToArray(string$1); + } + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string$1) { + return string$1.match(reUnicode) || []; + } + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string$1) { + return string$1.match(reUnicodeWord) || []; + } + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = Object.prototype.toString; + /** Built-in value references. */ + var Symbol$1 = root$1.Symbol; + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0; + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, length = array.length; + if (start < 0) start = -start > length ? 0 : length + start; + end = end > length ? length : end; + if (end < 0) end += length; + length = start > end ? 0 : end - start >>> 0; + start >>>= 0; + var result = Array(length); + while (++index < length) result[index] = array[index + start]; + return result; + } + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + if (typeof value == "string") return value; + if (isSymbol(value)) return symbolToString ? symbolToString.call(value) : ""; + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; + } + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === void 0 ? length : end; + return !start && end >= length ? array : baseSlice(array, start, end); + } + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ + function createCaseFirst(methodName) { + return function(string$1) { + string$1 = toString(string$1); + var strSymbols = hasUnicode(string$1) ? stringToArray(string$1) : void 0; + var chr = strSymbols ? strSymbols[0] : string$1.charAt(0); + var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string$1.slice(1); + return chr[methodName]() + trailing; + }; + } + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string$1) { + return arrayReduce(words(deburr(string$1).replace(reApos, "")), callback, ""); + }; + } + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; + } + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + return value == null ? "" : baseToString(value); + } + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word$1, index) { + word$1 = word$1.toLowerCase(); + return result + (index ? capitalize(word$1) : word$1); + }); + /** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ + function capitalize(string$1) { + return upperFirst(toString(string$1).toLowerCase()); + } + /** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string$1) { + string$1 = toString(string$1); + return string$1 && string$1.replace(reLatin, deburrLetter).replace(reComboMark, ""); + } + /** + * Converts the first character of `string` to upper case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.upperFirst('fred'); + * // => 'Fred' + * + * _.upperFirst('FRED'); + * // => 'FRED' + */ + var upperFirst = createCaseFirst("toUpperCase"); + /** + * Splits `string` into an array of its words. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {RegExp|string} [pattern] The pattern to match words. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the words of `string`. + * @example + * + * _.words('fred, barney, & pebbles'); + * // => ['fred', 'barney', 'pebbles'] + * + * _.words('fred, barney, & pebbles', /[^, ]+/g); + * // => ['fred', 'barney', '&', 'pebbles'] + */ + function words(string$1, pattern, guard) { + string$1 = toString(string$1); + pattern = guard ? void 0 : pattern; + if (pattern === void 0) return hasUnicodeWord(string$1) ? unicodeWords(string$1) : asciiWords(string$1); + return string$1.match(pattern) || []; + } + module.exports = camelCase; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.6/node_modules/postcss-modules/build/localsConvention.js +var require_localsConvention = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.makeLocalsConventionReducer = makeLocalsConventionReducer; + var _lodash = _interopRequireDefault$22(require_lodash()); + function _interopRequireDefault$22(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function dashesCamelCase(string$1) { + return string$1.replace(/-+(\w)/g, (_, firstLetter) => firstLetter.toUpperCase()); + } + function makeLocalsConventionReducer(localsConvention, inputFile) { + const isFunc = typeof localsConvention === "function"; + return (tokens$1, [className$1, value]) => { + if (isFunc) { + const convention = localsConvention(className$1, value, inputFile); + tokens$1[convention] = value; + return tokens$1; + } + switch (localsConvention) { + case "camelCase": + tokens$1[className$1] = value; + tokens$1[(0, _lodash.default)(className$1)] = value; + break; + case "camelCaseOnly": + tokens$1[(0, _lodash.default)(className$1)] = value; + break; + case "dashes": + tokens$1[className$1] = value; + tokens$1[dashesCamelCase(className$1)] = value; + break; + case "dashesOnly": + tokens$1[dashesCamelCase(className$1)] = value; + break; + } + return tokens$1; + }; + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.6/node_modules/postcss-modules/build/FileSystemLoader.js +var require_FileSystemLoader = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = void 0; + var _postcss$1 = _interopRequireDefault$21(__require("postcss")); + var _path = _interopRequireDefault$21(__require("path")); + var _Parser$1 = _interopRequireDefault$21(require_Parser()); + var _fs$1 = require_fs(); + function _interopRequireDefault$21(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var Core = class Core { + constructor(plugins) { + this.plugins = plugins || Core.defaultPlugins; + } + async load(sourceString, sourcePath, trace, pathFetcher) { + const parser$1 = new _Parser$1.default(pathFetcher, trace); + const plugins = this.plugins.concat([parser$1.plugin()]); + return { + injectableSource: (await (0, _postcss$1.default)(plugins).process(sourceString, { from: sourcePath })).css, + exportTokens: parser$1.exportTokens + }; + } + }; + const traceKeySorter = (a, b) => { + if (a.length < b.length) return a < b.substring(0, a.length) ? -1 : 1; + if (a.length > b.length) return a.substring(0, b.length) <= b ? -1 : 1; + return a < b ? -1 : 1; + }; + var FileSystemLoader = class { + constructor(root$2, plugins, fileResolve) { + if (root$2 === "/" && process.platform === "win32") { + const cwdDrive = process.cwd().slice(0, 3); + if (!/^[A-Za-z]:\\$/.test(cwdDrive)) throw new Error(`Failed to obtain root from "${process.cwd()}".`); + root$2 = cwdDrive; + } + this.root = root$2; + this.fileResolve = fileResolve; + this.sources = {}; + this.traces = {}; + this.importNr = 0; + this.core = new Core(plugins); + this.tokensByFile = {}; + this.fs = (0, _fs$1.getFileSystem)(); + } + async fetch(_newPath, relativeTo, _trace) { + const newPath = _newPath.replace(/^["']|["']$/g, ""); + const trace = _trace || String.fromCharCode(this.importNr++); + const useFileResolve = typeof this.fileResolve === "function"; + const fileResolvedPath = useFileResolve ? await this.fileResolve(newPath, relativeTo) : await Promise.resolve(); + if (fileResolvedPath && !_path.default.isAbsolute(fileResolvedPath)) throw new Error("The returned path from the \"fileResolve\" option must be absolute."); + const relativeDir = _path.default.dirname(relativeTo); + const rootRelativePath = fileResolvedPath || _path.default.resolve(relativeDir, newPath); + let fileRelativePath = fileResolvedPath || _path.default.resolve(_path.default.resolve(this.root, relativeDir), newPath); + if (!useFileResolve && newPath[0] !== "." && !_path.default.isAbsolute(newPath)) try { + fileRelativePath = __require.resolve(newPath); + } catch (e) {} + const tokens$1 = this.tokensByFile[fileRelativePath]; + if (tokens$1) return tokens$1; + return new Promise((resolve, reject) => { + this.fs.readFile(fileRelativePath, "utf-8", async (err, source) => { + if (err) reject(err); + const { injectableSource, exportTokens } = await this.core.load(source, rootRelativePath, trace, this.fetch.bind(this)); + this.sources[fileRelativePath] = injectableSource; + this.traces[trace] = fileRelativePath; + this.tokensByFile[fileRelativePath] = exportTokens; + resolve(exportTokens); + }); + }); + } + get finalSource() { + const traces = this.traces; + const sources = this.sources; + let written = /* @__PURE__ */ new Set(); + return Object.keys(traces).sort(traceKeySorter).map((key) => { + const filename = traces[key]; + if (written.has(filename)) return null; + written.add(filename); + return sources[filename]; + }).join(""); + } + }; + exports.default = FileSystemLoader; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.6/node_modules/postcss-modules-extract-imports/src/topologicalSort.js +var require_topologicalSort = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const PERMANENT_MARKER = 2; + const TEMPORARY_MARKER = 1; + function createError(node, graph) { + const er = /* @__PURE__ */ new Error("Nondeterministic import's order"); + er.nodes = [node, graph[node].find((relatedNode) => graph[relatedNode].indexOf(node) > -1)]; + return er; + } + function walkGraph(node, graph, state, result, strict) { + if (state[node] === PERMANENT_MARKER) return; + if (state[node] === TEMPORARY_MARKER) { + if (strict) return createError(node, graph); + return; + } + state[node] = TEMPORARY_MARKER; + const children = graph[node]; + const length = children.length; + for (let i$1 = 0; i$1 < length; ++i$1) { + const error = walkGraph(children[i$1], graph, state, result, strict); + if (error instanceof Error) return error; + } + state[node] = PERMANENT_MARKER; + result.push(node); + } + function topologicalSort$1(graph, strict) { + const result = []; + const state = {}; + const nodes = Object.keys(graph); + const length = nodes.length; + for (let i$1 = 0; i$1 < length; ++i$1) { + const er = walkGraph(nodes[i$1], graph, state, result, strict); + if (er instanceof Error) return er; + } + return result; + } + module.exports = topologicalSort$1; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.6/node_modules/postcss-modules-extract-imports/src/index.js +var require_src$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const topologicalSort = require_topologicalSort(); + const matchImports$1 = /^(.+?)\s+from\s+(?:"([^"]+)"|'([^']+)'|(global))$/; + const icssImport = /^:import\((?:"([^"]+)"|'([^']+)')\)/; + const VISITED_MARKER = 1; + /** + * :import('G') {} + * + * Rule + * composes: ... from 'A' + * composes: ... from 'B' + + * Rule + * composes: ... from 'A' + * composes: ... from 'A' + * composes: ... from 'C' + * + * Results in: + * + * graph: { + * G: [], + * A: [], + * B: ['A'], + * C: ['A'], + * } + */ + function addImportToGraph(importId, parentId, graph, visited) { + const siblingsId = parentId + "_siblings"; + const visitedId = parentId + "_" + importId; + if (visited[visitedId] !== VISITED_MARKER) { + if (!Array.isArray(visited[siblingsId])) visited[siblingsId] = []; + const siblings = visited[siblingsId]; + if (Array.isArray(graph[importId])) graph[importId] = graph[importId].concat(siblings); + else graph[importId] = siblings.slice(); + visited[visitedId] = VISITED_MARKER; + siblings.push(importId); + } + } + module.exports = (options = {}) => { + let importIndex = 0; + const createImportedName = typeof options.createImportedName !== "function" ? (importName) => `i__imported_${importName.replace(/\W/g, "_")}_${importIndex++}` : options.createImportedName; + const failOnWrongOrder = options.failOnWrongOrder; + return { + postcssPlugin: "postcss-modules-extract-imports", + prepare() { + const graph = {}; + const visited = {}; + const existingImports = {}; + const importDecls = {}; + const imports = {}; + return { Once(root$2, postcss) { + root$2.walkRules((rule) => { + const matches = icssImport.exec(rule.selector); + if (matches) { + const [, doubleQuotePath, singleQuotePath] = matches; + const importPath = doubleQuotePath || singleQuotePath; + addImportToGraph(importPath, "root", graph, visited); + existingImports[importPath] = rule; + } + }); + root$2.walkDecls(/^composes$/, (declaration) => { + const multiple = declaration.value.split(","); + const values = []; + multiple.forEach((value) => { + const matches = value.trim().match(matchImports$1); + if (!matches) { + values.push(value); + return; + } + let tmpSymbols; + let [, symbols, doubleQuotePath, singleQuotePath, global$1] = matches; + if (global$1) tmpSymbols = symbols.split(/\s+/).map((s) => `global(${s})`); + else { + const importPath = doubleQuotePath || singleQuotePath; + let parent = declaration.parent; + let parentIndexes = ""; + while (parent.type !== "root") { + parentIndexes = parent.parent.index(parent) + "_" + parentIndexes; + parent = parent.parent; + } + const { selector: selector$1 } = declaration.parent; + addImportToGraph(importPath, `_${parentIndexes}${selector$1}`, graph, visited); + importDecls[importPath] = declaration; + imports[importPath] = imports[importPath] || {}; + tmpSymbols = symbols.split(/\s+/).map((s) => { + if (!imports[importPath][s]) imports[importPath][s] = createImportedName(s, importPath); + return imports[importPath][s]; + }); + } + values.push(tmpSymbols.join(" ")); + }); + declaration.value = values.join(", "); + }); + const importsOrder = topologicalSort(graph, failOnWrongOrder); + if (importsOrder instanceof Error) throw importDecls[importsOrder.nodes.find((importPath) => importDecls.hasOwnProperty(importPath))].error("Failed to resolve order of composed modules " + importsOrder.nodes.map((importPath) => "`" + importPath + "`").join(", ") + ".", { + plugin: "postcss-modules-extract-imports", + word: "composes" + }); + let lastImportRule; + importsOrder.forEach((path$2) => { + const importedSymbols = imports[path$2]; + let rule = existingImports[path$2]; + if (!rule && importedSymbols) { + rule = postcss.rule({ + selector: `:import("${path$2}")`, + raws: { after: "\n" } + }); + if (lastImportRule) root$2.insertAfter(lastImportRule, rule); + else root$2.prepend(rule); + } + lastImportRule = rule; + if (!importedSymbols) return; + Object.keys(importedSymbols).forEach((importedSymbol) => { + rule.append(postcss.decl({ + value: importedSymbol, + prop: importedSymbols[importedSymbol], + raws: { before: "\n " } + })); + }); + }); + } }; + } + }; + }; + module.exports.postcss = true; +})); + +//#endregion +//#region ../../node_modules/.pnpm/loader-utils@3.3.1/node_modules/loader-utils/lib/hash/wasm-hash.js +var require_wasm_hash = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const MAX_SHORT_STRING$1 = Math.floor(65472 / 4) & -4; + var WasmHash = class { + /** + * @param {WebAssembly.Instance} instance wasm instance + * @param {WebAssembly.Instance[]} instancesPool pool of instances + * @param {number} chunkSize size of data chunks passed to wasm + * @param {number} digestSize size of digest returned by wasm + */ + constructor(instance, instancesPool, chunkSize, digestSize) { + const exports$1 = instance.exports; + exports$1.init(); + this.exports = exports$1; + this.mem = Buffer.from(exports$1.memory.buffer, 0, 65536); + this.buffered = 0; + this.instancesPool = instancesPool; + this.chunkSize = chunkSize; + this.digestSize = digestSize; + } + reset() { + this.buffered = 0; + this.exports.init(); + } + /** + * @param {Buffer | string} data data + * @param {BufferEncoding=} encoding encoding + * @returns {this} itself + */ + update(data, encoding) { + if (typeof data === "string") { + while (data.length > MAX_SHORT_STRING$1) { + this._updateWithShortString(data.slice(0, MAX_SHORT_STRING$1), encoding); + data = data.slice(MAX_SHORT_STRING$1); + } + this._updateWithShortString(data, encoding); + return this; + } + this._updateWithBuffer(data); + return this; + } + /** + * @param {string} data data + * @param {BufferEncoding=} encoding encoding + * @returns {void} + */ + _updateWithShortString(data, encoding) { + const { exports: exports$1, buffered, mem, chunkSize } = this; + let endPos; + if (data.length < 70) if (!encoding || encoding === "utf-8" || encoding === "utf8") { + endPos = buffered; + for (let i$1 = 0; i$1 < data.length; i$1++) { + const cc = data.charCodeAt(i$1); + if (cc < 128) mem[endPos++] = cc; + else if (cc < 2048) { + mem[endPos] = cc >> 6 | 192; + mem[endPos + 1] = cc & 63 | 128; + endPos += 2; + } else { + endPos += mem.write(data.slice(i$1), endPos, encoding); + break; + } + } + } else if (encoding === "latin1") { + endPos = buffered; + for (let i$1 = 0; i$1 < data.length; i$1++) { + const cc = data.charCodeAt(i$1); + mem[endPos++] = cc; + } + } else endPos = buffered + mem.write(data, buffered, encoding); + else endPos = buffered + mem.write(data, buffered, encoding); + if (endPos < chunkSize) this.buffered = endPos; + else { + const l = endPos & ~(this.chunkSize - 1); + exports$1.update(l); + const newBuffered = endPos - l; + this.buffered = newBuffered; + if (newBuffered > 0) mem.copyWithin(0, l, endPos); + } + } + /** + * @param {Buffer} data data + * @returns {void} + */ + _updateWithBuffer(data) { + const { exports: exports$1, buffered, mem } = this; + const length = data.length; + if (buffered + length < this.chunkSize) { + data.copy(mem, buffered, 0, length); + this.buffered += length; + } else { + const l = buffered + length & ~(this.chunkSize - 1); + if (l > 65536) { + let i$1 = 65536 - buffered; + data.copy(mem, buffered, 0, i$1); + exports$1.update(65536); + const stop = l - buffered - 65536; + while (i$1 < stop) { + data.copy(mem, 0, i$1, i$1 + 65536); + exports$1.update(65536); + i$1 += 65536; + } + data.copy(mem, 0, i$1, l - buffered); + exports$1.update(l - buffered - i$1); + } else { + data.copy(mem, buffered, 0, l - buffered); + exports$1.update(l); + } + const newBuffered = length + buffered - l; + this.buffered = newBuffered; + if (newBuffered > 0) data.copy(mem, 0, length - newBuffered, length); + } + } + digest(type) { + const { exports: exports$1, buffered, mem, digestSize } = this; + exports$1.final(buffered); + this.instancesPool.push(this); + const hex$1 = mem.toString("latin1", 0, digestSize); + if (type === "hex") return hex$1; + if (type === "binary" || !type) return Buffer.from(hex$1, "hex"); + return Buffer.from(hex$1, "hex").toString(type); + } + }; + const create$2 = (wasmModule, instancesPool, chunkSize, digestSize) => { + if (instancesPool.length > 0) { + const old = instancesPool.pop(); + old.reset(); + return old; + } else return new WasmHash(new WebAssembly.Instance(wasmModule), instancesPool, chunkSize, digestSize); + }; + module.exports = create$2; + module.exports.MAX_SHORT_STRING = MAX_SHORT_STRING$1; +})); + +//#endregion +//#region ../../node_modules/.pnpm/loader-utils@3.3.1/node_modules/loader-utils/lib/hash/xxhash64.js +var require_xxhash64 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const create$1 = require_wasm_hash(); + const xxhash64 = new WebAssembly.Module(Buffer.from("AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrUIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqwYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEACfyACIAE1AgBCh5Wvr5i23puef36FQheJQs/W077Sx6vZQn5C+fPd8Zn2masWfCECIAFBBGoLIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAiACQh2IhUL5893xmfaZqxZ+IgIgAkIgiIUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL", "base64")); + module.exports = create$1.bind(null, xxhash64, [], 32, 16); +})); + +//#endregion +//#region ../../node_modules/.pnpm/loader-utils@3.3.1/node_modules/loader-utils/lib/hash/BatchedHash.js +var require_BatchedHash = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const MAX_SHORT_STRING = require_wasm_hash().MAX_SHORT_STRING; + var BatchedHash$1 = class { + constructor(hash$1) { + this.string = void 0; + this.encoding = void 0; + this.hash = hash$1; + } + /** + * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} + * @param {string|Buffer} data data + * @param {string=} inputEncoding data encoding + * @returns {this} updated hash + */ + update(data, inputEncoding) { + if (this.string !== void 0) { + if (typeof data === "string" && inputEncoding === this.encoding && this.string.length + data.length < MAX_SHORT_STRING) { + this.string += data; + return this; + } + this.hash.update(this.string, this.encoding); + this.string = void 0; + } + if (typeof data === "string") if (data.length < MAX_SHORT_STRING && (!inputEncoding || !inputEncoding.startsWith("ba"))) { + this.string = data; + this.encoding = inputEncoding; + } else this.hash.update(data, inputEncoding); + else this.hash.update(data); + return this; + } + /** + * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} + * @param {string=} encoding encoding of the return value + * @returns {string|Buffer} digest + */ + digest(encoding) { + if (this.string !== void 0) this.hash.update(this.string, this.encoding); + return this.hash.digest(encoding); + } + }; + module.exports = BatchedHash$1; +})); + +//#endregion +//#region ../../node_modules/.pnpm/loader-utils@3.3.1/node_modules/loader-utils/lib/hash/md4.js +var require_md4 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const create = require_wasm_hash(); + const md4 = new WebAssembly.Module(Buffer.from("AGFzbQEAAAABCAJgAX8AYAAAAwUEAQAAAAUDAQABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwciBARpbml0AAAGdXBkYXRlAAIFZmluYWwAAwZtZW1vcnkCAAqFEAQmAEGBxpS6BiQBQYnXtv5+JAJB/rnrxXkkA0H2qMmBASQEQQAkAAvMCgEYfyMBIQojAiEGIwMhByMEIQgDQCAAIAVLBEAgBSgCCCINIAcgBiAFKAIEIgsgCCAHIAUoAgAiDCAKIAggBiAHIAhzcXNqakEDdyIDIAYgB3Nxc2pqQQd3IgEgAyAGc3FzampBC3chAiAFKAIUIg8gASACIAUoAhAiCSADIAEgBSgCDCIOIAYgAyACIAEgA3Nxc2pqQRN3IgQgASACc3FzampBA3ciAyACIARzcXNqakEHdyEBIAUoAiAiEiADIAEgBSgCHCIRIAQgAyAFKAIYIhAgAiAEIAEgAyAEc3FzampBC3ciAiABIANzcXNqakETdyIEIAEgAnNxc2pqQQN3IQMgBSgCLCIVIAQgAyAFKAIoIhQgAiAEIAUoAiQiEyABIAIgAyACIARzcXNqakEHdyIBIAMgBHNxc2pqQQt3IgIgASADc3FzampBE3chBCAPIBAgCSAVIBQgEyAFKAI4IhYgAiAEIAUoAjQiFyABIAIgBSgCMCIYIAMgASAEIAEgAnNxc2pqQQN3IgEgAiAEc3FzampBB3ciAiABIARzcXNqakELdyIDIAkgAiAMIAEgBSgCPCIJIAQgASADIAEgAnNxc2pqQRN3IgEgAiADcnEgAiADcXJqakGZ84nUBWpBA3ciAiABIANycSABIANxcmpqQZnzidQFakEFdyIEIAEgAnJxIAEgAnFyaiASakGZ84nUBWpBCXciAyAPIAQgCyACIBggASADIAIgBHJxIAIgBHFyampBmfOJ1AVqQQ13IgEgAyAEcnEgAyAEcXJqakGZ84nUBWpBA3ciAiABIANycSABIANxcmpqQZnzidQFakEFdyIEIAEgAnJxIAEgAnFyampBmfOJ1AVqQQl3IgMgECAEIAIgFyABIAMgAiAEcnEgAiAEcXJqakGZ84nUBWpBDXciASADIARycSADIARxcmogDWpBmfOJ1AVqQQN3IgIgASADcnEgASADcXJqakGZ84nUBWpBBXciBCABIAJycSABIAJxcmpqQZnzidQFakEJdyIDIBEgBCAOIAIgFiABIAMgAiAEcnEgAiAEcXJqakGZ84nUBWpBDXciASADIARycSADIARxcmpqQZnzidQFakEDdyICIAEgA3JxIAEgA3FyampBmfOJ1AVqQQV3IgQgASACcnEgASACcXJqakGZ84nUBWpBCXciAyAMIAIgAyAJIAEgAyACIARycSACIARxcmpqQZnzidQFakENdyIBcyAEc2pqQaHX5/YGakEDdyICIAQgASACcyADc2ogEmpBodfn9gZqQQl3IgRzIAFzampBodfn9gZqQQt3IgMgAiADIBggASADIARzIAJzampBodfn9gZqQQ93IgFzIARzaiANakGh1+f2BmpBA3ciAiAUIAQgASACcyADc2pqQaHX5/YGakEJdyIEcyABc2pqQaHX5/YGakELdyIDIAsgAiADIBYgASADIARzIAJzampBodfn9gZqQQ93IgFzIARzampBodfn9gZqQQN3IgIgEyAEIAEgAnMgA3NqakGh1+f2BmpBCXciBHMgAXNqakGh1+f2BmpBC3chAyAKIA4gAiADIBcgASADIARzIAJzampBodfn9gZqQQ93IgFzIARzampBodfn9gZqQQN3IgJqIQogBiAJIAEgESADIAIgFSAEIAEgAnMgA3NqakGh1+f2BmpBCXciBHMgAXNqakGh1+f2BmpBC3ciAyAEcyACc2pqQaHX5/YGakEPd2ohBiADIAdqIQcgBCAIaiEIIAVBQGshBQwBCwsgCiQBIAYkAiAHJAMgCCQECw0AIAAQASMAIABqJAAL/wQCA38BfiMAIABqrUIDhiEEIABByABqQUBxIgJBCGshAyAAIgFBAWohACABQYABOgAAA0AgACACSUEAIABBB3EbBEAgAEEAOgAAIABBAWohAAwBCwsDQCAAIAJJBEAgAEIANwMAIABBCGohAAwBCwsgAyAENwMAIAIQAUEAIwGtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEIIwKtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEQIwOtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEYIwStIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAAs=", "base64")); + module.exports = create.bind(null, md4, [], 64, 32); +})); + +//#endregion +//#region ../../node_modules/.pnpm/loader-utils@3.3.1/node_modules/loader-utils/lib/hash/BulkUpdateDecorator.js +var require_BulkUpdateDecorator = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const BULK_SIZE = 2e3; + const digestCaches = {}; + var BulkUpdateDecorator$1 = class { + /** + * @param {Hash | function(): Hash} hashOrFactory function to create a hash + * @param {string=} hashKey key for caching + */ + constructor(hashOrFactory, hashKey) { + this.hashKey = hashKey; + if (typeof hashOrFactory === "function") { + this.hashFactory = hashOrFactory; + this.hash = void 0; + } else { + this.hashFactory = void 0; + this.hash = hashOrFactory; + } + this.buffer = ""; + } + /** + * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} + * @param {string|Buffer} data data + * @param {string=} inputEncoding data encoding + * @returns {this} updated hash + */ + update(data, inputEncoding) { + if (inputEncoding !== void 0 || typeof data !== "string" || data.length > BULK_SIZE) { + if (this.hash === void 0) this.hash = this.hashFactory(); + if (this.buffer.length > 0) { + this.hash.update(this.buffer); + this.buffer = ""; + } + this.hash.update(data, inputEncoding); + } else { + this.buffer += data; + if (this.buffer.length > BULK_SIZE) { + if (this.hash === void 0) this.hash = this.hashFactory(); + this.hash.update(this.buffer); + this.buffer = ""; + } + } + return this; + } + /** + * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} + * @param {string=} encoding encoding of the return value + * @returns {string|Buffer} digest + */ + digest(encoding) { + let digestCache; + const buffer = this.buffer; + if (this.hash === void 0) { + const cacheKey = `${this.hashKey}-${encoding}`; + digestCache = digestCaches[cacheKey]; + if (digestCache === void 0) digestCache = digestCaches[cacheKey] = /* @__PURE__ */ new Map(); + const cacheEntry = digestCache.get(buffer); + if (cacheEntry !== void 0) return cacheEntry; + this.hash = this.hashFactory(); + } + if (buffer.length > 0) this.hash.update(buffer); + const digestResult = this.hash.digest(encoding); + if (digestCache !== void 0) digestCache.set(buffer, digestResult); + return digestResult; + } + }; + module.exports = BulkUpdateDecorator$1; +})); + +//#endregion +//#region ../../node_modules/.pnpm/loader-utils@3.3.1/node_modules/loader-utils/lib/getHashDigest.js +var require_getHashDigest = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const baseEncodeTables = { + 26: "abcdefghijklmnopqrstuvwxyz", + 32: "123456789abcdefghjkmnpqrstuvwxyz", + 36: "0123456789abcdefghijklmnopqrstuvwxyz", + 49: "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", + 52: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + 58: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", + 62: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + 64: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_" + }; + /** + * @param {Uint32Array} uint32Array Treated as a long base-0x100000000 number, little endian + * @param {number} divisor The divisor + * @return {number} Modulo (remainder) of the division + */ + function divmod32(uint32Array, divisor) { + let carry = 0; + for (let i$1 = uint32Array.length - 1; i$1 >= 0; i$1--) { + const value = carry * 4294967296 + uint32Array[i$1]; + carry = value % divisor; + uint32Array[i$1] = Math.floor(value / divisor); + } + return carry; + } + function encodeBufferToBase(buffer, base, length) { + const encodeTable = baseEncodeTables[base]; + if (!encodeTable) throw new Error("Unknown encoding base" + base); + const limit = Math.ceil(buffer.length * 8 / Math.log2(base)); + length = Math.min(length, limit); + const uint32Array = new Uint32Array(Math.ceil(buffer.length / 4)); + buffer.copy(Buffer.from(uint32Array.buffer)); + let output = ""; + for (let i$1 = 0; i$1 < length; i$1++) output = encodeTable[divmod32(uint32Array, base)] + output; + return output; + } + let crypto = void 0; + let createXXHash64 = void 0; + let createMd4 = void 0; + let BatchedHash = void 0; + let BulkUpdateDecorator = void 0; + function getHashDigest$1(buffer, algorithm, digestType, maxLength) { + algorithm = algorithm || "xxhash64"; + maxLength = maxLength || 9999; + let hash$1; + if (algorithm === "xxhash64") { + if (createXXHash64 === void 0) { + createXXHash64 = require_xxhash64(); + if (BatchedHash === void 0) BatchedHash = require_BatchedHash(); + } + hash$1 = new BatchedHash(createXXHash64()); + } else if (algorithm === "md4") { + if (createMd4 === void 0) { + createMd4 = require_md4(); + if (BatchedHash === void 0) BatchedHash = require_BatchedHash(); + } + hash$1 = new BatchedHash(createMd4()); + } else if (algorithm === "native-md4") { + if (typeof crypto === "undefined") { + crypto = __require("crypto"); + if (BulkUpdateDecorator === void 0) BulkUpdateDecorator = require_BulkUpdateDecorator(); + } + hash$1 = new BulkUpdateDecorator(() => crypto.createHash("md4"), "md4"); + } else { + if (typeof crypto === "undefined") { + crypto = __require("crypto"); + if (BulkUpdateDecorator === void 0) BulkUpdateDecorator = require_BulkUpdateDecorator(); + } + hash$1 = new BulkUpdateDecorator(() => crypto.createHash(algorithm), algorithm); + } + hash$1.update(buffer); + if (digestType === "base26" || digestType === "base32" || digestType === "base36" || digestType === "base49" || digestType === "base52" || digestType === "base58" || digestType === "base62" || digestType === "base64safe") return encodeBufferToBase(hash$1.digest(), digestType === "base64safe" ? 64 : digestType.substr(4), maxLength); + return hash$1.digest(digestType || "hex").substr(0, maxLength); + } + module.exports = getHashDigest$1; +})); + +//#endregion +//#region ../../node_modules/.pnpm/loader-utils@3.3.1/node_modules/loader-utils/lib/interpolateName.js +var require_interpolateName = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const path$1 = __require("path"); + const getHashDigest = require_getHashDigest(); + function interpolateName$1(loaderContext, name, options = {}) { + let filename; + const hasQuery = loaderContext.resourceQuery && loaderContext.resourceQuery.length > 1; + if (typeof name === "function") filename = name(loaderContext.resourcePath, hasQuery ? loaderContext.resourceQuery : void 0); + else filename = name || "[hash].[ext]"; + const context = options.context; + const content = options.content; + const regExp = options.regExp; + let ext = "bin"; + let basename = "file"; + let directory = ""; + let folder = ""; + let query = ""; + if (loaderContext.resourcePath) { + const parsed = path$1.parse(loaderContext.resourcePath); + let resourcePath = loaderContext.resourcePath; + if (parsed.ext) ext = parsed.ext.substr(1); + if (parsed.dir) { + basename = parsed.name; + resourcePath = parsed.dir + path$1.sep; + } + if (typeof context !== "undefined") { + directory = path$1.relative(context, resourcePath + "_").replace(/\\/g, "/").replace(/\.\.(\/)?/g, "_$1"); + directory = directory.substr(0, directory.length - 1); + } else directory = resourcePath.replace(/\\/g, "/").replace(/\.\.(\/)?/g, "_$1"); + if (directory.length <= 1) directory = ""; + else folder = path$1.basename(directory); + } + if (loaderContext.resourceQuery && loaderContext.resourceQuery.length > 1) { + query = loaderContext.resourceQuery; + const hashIdx = query.indexOf("#"); + if (hashIdx >= 0) query = query.substr(0, hashIdx); + } + let url = filename; + if (content) url = url.replace(/\[(?:([^[:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*(?:safe)?))?(?::(\d+))?\]/gi, (all, hashType, digestType, maxLength) => getHashDigest(content, hashType, digestType, parseInt(maxLength, 10))); + url = url.replace(/\[ext\]/gi, () => ext).replace(/\[name\]/gi, () => basename).replace(/\[path\]/gi, () => directory).replace(/\[folder\]/gi, () => folder).replace(/\[query\]/gi, () => query); + if (regExp && loaderContext.resourcePath) { + const match = loaderContext.resourcePath.match(new RegExp(regExp)); + match && match.forEach((matched, i$1) => { + url = url.replace(new RegExp("\\[" + i$1 + "\\]", "ig"), matched); + }); + } + if (typeof loaderContext.options === "object" && typeof loaderContext.options.customInterpolateName === "function") url = loaderContext.options.customInterpolateName.call(loaderContext, url, name, options); + return url; + } + module.exports = interpolateName$1; +})); + +//#endregion +//#region ../../node_modules/.pnpm/generic-names@4.0.0/node_modules/generic-names/index.js +var require_generic_names = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var interpolateName = require_interpolateName(); + var path = __require("path"); + /** + * @param {string} pattern + * @param {object} options + * @param {string} options.context + * @param {string} options.hashPrefix + * @return {function} + */ + module.exports = function createGenerator(pattern, options) { + options = options || {}; + var context = options && typeof options.context === "string" ? options.context : process.cwd(); + var hashPrefix = options && typeof options.hashPrefix === "string" ? options.hashPrefix : ""; + /** + * @param {string} localName Usually a class name + * @param {string} filepath Absolute path + * @return {string} + */ + return function generate(localName, filepath) { + var name = pattern.replace(/\[local\]/gi, localName); + return interpolateName({ resourcePath: filepath }, name, { + content: hashPrefix + path.relative(context, filepath).replace(/\\/g, "/") + "\0" + localName, + context + }).replace(new RegExp("[^a-zA-Z0-9\\-_\xA0-￿]", "g"), "-").replace(/^((-?[0-9])|--)/, "_$1"); + }; + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/util/unesc.js +var require_unesc = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = unesc; + /** + * + * @param {string} str + * @returns {[string, number]|undefined} + */ + function gobbleHex(str$1) { + var lower = str$1.toLowerCase(); + var hex$1 = ""; + var spaceTerminated = false; + for (var i$1 = 0; i$1 < 6 && lower[i$1] !== void 0; i$1++) { + var code = lower.charCodeAt(i$1); + var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57; + spaceTerminated = code === 32; + if (!valid) break; + hex$1 += lower[i$1]; + } + if (hex$1.length === 0) return; + var codePoint = parseInt(hex$1, 16); + if (codePoint >= 55296 && codePoint <= 57343 || codePoint === 0 || codePoint > 1114111) return ["�", hex$1.length + (spaceTerminated ? 1 : 0)]; + return [String.fromCodePoint(codePoint), hex$1.length + (spaceTerminated ? 1 : 0)]; + } + var CONTAINS_ESCAPE = /\\/; + function unesc(str$1) { + if (!CONTAINS_ESCAPE.test(str$1)) return str$1; + var ret = ""; + for (var i$1 = 0; i$1 < str$1.length; i$1++) { + if (str$1[i$1] === "\\") { + var gobbled = gobbleHex(str$1.slice(i$1 + 1, i$1 + 7)); + if (gobbled !== void 0) { + ret += gobbled[0]; + i$1 += gobbled[1]; + continue; + } + if (str$1[i$1 + 1] === "\\") { + ret += "\\"; + i$1++; + continue; + } + if (str$1.length === i$1 + 1) ret += str$1[i$1]; + continue; + } + ret += str$1[i$1]; + } + return ret; + } + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/util/getProp.js +var require_getProp = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = getProp; + function getProp(obj) { + for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) props[_key - 1] = arguments[_key]; + while (props.length > 0) { + var prop = props.shift(); + if (!obj[prop]) return; + obj = obj[prop]; + } + return obj; + } + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/util/ensureObject.js +var require_ensureObject = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = ensureObject; + function ensureObject(obj) { + for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) props[_key - 1] = arguments[_key]; + while (props.length > 0) { + var prop = props.shift(); + if (!obj[prop]) obj[prop] = {}; + obj = obj[prop]; + } + } + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/util/stripComments.js +var require_stripComments = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = stripComments; + function stripComments(str$1) { + var s = ""; + var commentStart = str$1.indexOf("/*"); + var lastEnd = 0; + while (commentStart >= 0) { + s = s + str$1.slice(lastEnd, commentStart); + var commentEnd = str$1.indexOf("*/", commentStart + 2); + if (commentEnd < 0) return s; + lastEnd = commentEnd + 2; + commentStart = str$1.indexOf("/*", lastEnd); + } + s = s + str$1.slice(lastEnd); + return s; + } + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/util/index.js +var require_util = /* @__PURE__ */ __commonJSMin(((exports) => { + exports.__esModule = true; + exports.unesc = exports.stripComments = exports.getProp = exports.ensureObject = void 0; + var _unesc$1 = _interopRequireDefault$20(require_unesc()); + exports.unesc = _unesc$1["default"]; + var _getProp = _interopRequireDefault$20(require_getProp()); + exports.getProp = _getProp["default"]; + var _ensureObject = _interopRequireDefault$20(require_ensureObject()); + exports.ensureObject = _ensureObject["default"]; + var _stripComments = _interopRequireDefault$20(require_stripComments()); + exports.stripComments = _stripComments["default"]; + function _interopRequireDefault$20(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/node.js +var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _util$3 = require_util(); + function _defineProperties$6(target, props) { + for (var i$1 = 0; i$1 < props.length; i$1++) { + var descriptor = props[i$1]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass$6(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties$6(Constructor.prototype, protoProps); + if (staticProps) _defineProperties$6(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + var cloneNode = function cloneNode$1(obj, parent) { + if (typeof obj !== "object" || obj === null) return obj; + var cloned = new obj.constructor(); + for (var i$1 in obj) { + if (!obj.hasOwnProperty(i$1)) continue; + var value = obj[i$1]; + if (i$1 === "parent" && typeof value === "object") { + if (parent) cloned[i$1] = parent; + } else if (value instanceof Array) cloned[i$1] = value.map(function(j) { + return cloneNode$1(j, cloned); + }); + else cloned[i$1] = cloneNode$1(value, cloned); + } + return cloned; + }; + var Node = /* @__PURE__ */ function() { + function Node$1(opts) { + if (opts === void 0) opts = {}; + Object.assign(this, opts); + this.spaces = this.spaces || {}; + this.spaces.before = this.spaces.before || ""; + this.spaces.after = this.spaces.after || ""; + } + var _proto = Node$1.prototype; + _proto.remove = function remove() { + if (this.parent) this.parent.removeChild(this); + this.parent = void 0; + return this; + }; + _proto.replaceWith = function replaceWith() { + if (this.parent) { + for (var index in arguments) this.parent.insertBefore(this, arguments[index]); + this.remove(); + } + return this; + }; + _proto.next = function next() { + return this.parent.at(this.parent.index(this) + 1); + }; + _proto.prev = function prev() { + return this.parent.at(this.parent.index(this) - 1); + }; + _proto.clone = function clone(overrides) { + if (overrides === void 0) overrides = {}; + var cloned = cloneNode(this); + for (var name in overrides) cloned[name] = overrides[name]; + return cloned; + }; + _proto.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) { + if (!this.raws) this.raws = {}; + var originalValue = this[name]; + var originalEscaped = this.raws[name]; + this[name] = originalValue + value; + if (originalEscaped || valueEscaped !== value) this.raws[name] = (originalEscaped || originalValue) + valueEscaped; + else delete this.raws[name]; + }; + _proto.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) { + if (!this.raws) this.raws = {}; + this[name] = value; + this.raws[name] = valueEscaped; + }; + _proto.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) { + this[name] = value; + if (this.raws) delete this.raws[name]; + }; + _proto.isAtPosition = function isAtPosition(line, column) { + if (this.source && this.source.start && this.source.end) { + if (this.source.start.line > line) return false; + if (this.source.end.line < line) return false; + if (this.source.start.line === line && this.source.start.column > column) return false; + if (this.source.end.line === line && this.source.end.column < column) return false; + return true; + } + }; + _proto.stringifyProperty = function stringifyProperty(name) { + return this.raws && this.raws[name] || this[name]; + }; + _proto.valueToString = function valueToString() { + return String(this.stringifyProperty("value")); + }; + _proto.toString = function toString$1() { + return [ + this.rawSpaceBefore, + this.valueToString(), + this.rawSpaceAfter + ].join(""); + }; + _createClass$6(Node$1, [{ + key: "rawSpaceBefore", + get: function get() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before; + if (rawSpace === void 0) rawSpace = this.spaces && this.spaces.before; + return rawSpace || ""; + }, + set: function set(raw) { + (0, _util$3.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.before = raw; + } + }, { + key: "rawSpaceAfter", + get: function get() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after; + if (rawSpace === void 0) rawSpace = this.spaces.after; + return rawSpace || ""; + }, + set: function set(raw) { + (0, _util$3.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.after = raw; + } + }]); + return Node$1; + }(); + exports["default"] = Node; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/types.js +var require_types = /* @__PURE__ */ __commonJSMin(((exports) => { + exports.__esModule = true; + exports.UNIVERSAL = exports.TAG = exports.STRING = exports.SELECTOR = exports.ROOT = exports.PSEUDO = exports.NESTING = exports.ID = exports.COMMENT = exports.COMBINATOR = exports.CLASS = exports.ATTRIBUTE = void 0; + var TAG = "tag"; + exports.TAG = TAG; + var STRING = "string"; + exports.STRING = STRING; + var SELECTOR = "selector"; + exports.SELECTOR = SELECTOR; + var ROOT = "root"; + exports.ROOT = ROOT; + var PSEUDO = "pseudo"; + exports.PSEUDO = PSEUDO; + var NESTING = "nesting"; + exports.NESTING = NESTING; + var ID$1 = "id"; + exports.ID = ID$1; + var COMMENT = "comment"; + exports.COMMENT = COMMENT; + var COMBINATOR = "combinator"; + exports.COMBINATOR = COMBINATOR; + var CLASS = "class"; + exports.CLASS = CLASS; + var ATTRIBUTE = "attribute"; + exports.ATTRIBUTE = ATTRIBUTE; + var UNIVERSAL = "universal"; + exports.UNIVERSAL = UNIVERSAL; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/container.js +var require_container = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _node$7 = _interopRequireDefault$19(require_node$1()); + var types$1 = _interopRequireWildcard$3(require_types()); + function _getRequireWildcardCache$3(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = /* @__PURE__ */ new WeakMap(); + var cacheNodeInterop = /* @__PURE__ */ new WeakMap(); + return (_getRequireWildcardCache$3 = function _getRequireWildcardCache$4(nodeInterop$1) { + return nodeInterop$1 ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + function _interopRequireWildcard$3(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) return obj; + if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { "default": obj }; + var cache = _getRequireWildcardCache$3(nodeInterop); + if (cache && cache.has(obj)) return cache.get(obj); + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); + else newObj[key] = obj[key]; + } + newObj["default"] = obj; + if (cache) cache.set(obj, newObj); + return newObj; + } + function _interopRequireDefault$19(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (it) return (it = it.call(o)).next.bind(it); + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i$1 = 0; + return function() { + if (i$1 >= o.length) return { done: true }; + return { + done: false, + value: o[i$1++] + }; + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i$1 = 0, arr2 = new Array(len); i$1 < len; i$1++) arr2[i$1] = arr[i$1]; + return arr2; + } + function _defineProperties$5(target, props) { + for (var i$1 = 0; i$1 < props.length; i$1++) { + var descriptor = props[i$1]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass$5(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties$5(Constructor.prototype, protoProps); + if (staticProps) _defineProperties$5(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _inheritsLoose$13(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf$13(subClass, superClass); + } + function _setPrototypeOf$13(o, p) { + _setPrototypeOf$13 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf$14(o$1, p$1) { + o$1.__proto__ = p$1; + return o$1; + }; + return _setPrototypeOf$13(o, p); + } + var Container = /* @__PURE__ */ function(_Node) { + _inheritsLoose$13(Container$1, _Node); + function Container$1(opts) { + var _this = _Node.call(this, opts) || this; + if (!_this.nodes) _this.nodes = []; + return _this; + } + var _proto = Container$1.prototype; + _proto.append = function append(selector$1) { + selector$1.parent = this; + this.nodes.push(selector$1); + return this; + }; + _proto.prepend = function prepend(selector$1) { + selector$1.parent = this; + this.nodes.unshift(selector$1); + for (var id$1 in this.indexes) this.indexes[id$1]++; + return this; + }; + _proto.at = function at$1(index) { + return this.nodes[index]; + }; + _proto.index = function index(child) { + if (typeof child === "number") return child; + return this.nodes.indexOf(child); + }; + _proto.removeChild = function removeChild(child) { + child = this.index(child); + this.at(child).parent = void 0; + this.nodes.splice(child, 1); + var index; + for (var id$1 in this.indexes) { + index = this.indexes[id$1]; + if (index >= child) this.indexes[id$1] = index - 1; + } + return this; + }; + _proto.removeAll = function removeAll() { + for (var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step; !(_step = _iterator()).done;) { + var node = _step.value; + node.parent = void 0; + } + this.nodes = []; + return this; + }; + _proto.empty = function empty() { + return this.removeAll(); + }; + _proto.insertAfter = function insertAfter(oldNode, newNode) { + var _this$nodes; + newNode.parent = this; + var oldIndex = this.index(oldNode); + var resetNode = []; + for (var i$1 = 2; i$1 < arguments.length; i$1++) resetNode.push(arguments[i$1]); + (_this$nodes = this.nodes).splice.apply(_this$nodes, [ + oldIndex + 1, + 0, + newNode + ].concat(resetNode)); + newNode.parent = this; + var index; + for (var id$1 in this.indexes) { + index = this.indexes[id$1]; + if (oldIndex < index) this.indexes[id$1] = index + arguments.length - 1; + } + return this; + }; + _proto.insertBefore = function insertBefore(oldNode, newNode) { + var _this$nodes2; + newNode.parent = this; + var oldIndex = this.index(oldNode); + var resetNode = []; + for (var i$1 = 2; i$1 < arguments.length; i$1++) resetNode.push(arguments[i$1]); + (_this$nodes2 = this.nodes).splice.apply(_this$nodes2, [ + oldIndex, + 0, + newNode + ].concat(resetNode)); + newNode.parent = this; + var index; + for (var id$1 in this.indexes) { + index = this.indexes[id$1]; + if (index >= oldIndex) this.indexes[id$1] = index + arguments.length - 1; + } + return this; + }; + _proto._findChildAtPosition = function _findChildAtPosition(line, col) { + var found = void 0; + this.each(function(node) { + if (node.atPosition) { + var foundChild = node.atPosition(line, col); + if (foundChild) { + found = foundChild; + return false; + } + } else if (node.isAtPosition(line, col)) { + found = node; + return false; + } + }); + return found; + }; + _proto.atPosition = function atPosition(line, col) { + if (this.isAtPosition(line, col)) return this._findChildAtPosition(line, col) || this; + else return; + }; + _proto._inferEndPosition = function _inferEndPosition() { + if (this.last && this.last.source && this.last.source.end) { + this.source = this.source || {}; + this.source.end = this.source.end || {}; + Object.assign(this.source.end, this.last.source.end); + } + }; + _proto.each = function each(callback) { + if (!this.lastEach) this.lastEach = 0; + if (!this.indexes) this.indexes = {}; + this.lastEach++; + var id$1 = this.lastEach; + this.indexes[id$1] = 0; + if (!this.length) return; + var index, result; + while (this.indexes[id$1] < this.length) { + index = this.indexes[id$1]; + result = callback(this.at(index), index); + if (result === false) break; + this.indexes[id$1] += 1; + } + delete this.indexes[id$1]; + if (result === false) return false; + }; + _proto.walk = function walk(callback) { + return this.each(function(node, i$1) { + var result = callback(node, i$1); + if (result !== false && node.length) result = node.walk(callback); + if (result === false) return false; + }); + }; + _proto.walkAttributes = function walkAttributes(callback) { + var _this2 = this; + return this.walk(function(selector$1) { + if (selector$1.type === types$1.ATTRIBUTE) return callback.call(_this2, selector$1); + }); + }; + _proto.walkClasses = function walkClasses(callback) { + var _this3 = this; + return this.walk(function(selector$1) { + if (selector$1.type === types$1.CLASS) return callback.call(_this3, selector$1); + }); + }; + _proto.walkCombinators = function walkCombinators(callback) { + var _this4 = this; + return this.walk(function(selector$1) { + if (selector$1.type === types$1.COMBINATOR) return callback.call(_this4, selector$1); + }); + }; + _proto.walkComments = function walkComments(callback) { + var _this5 = this; + return this.walk(function(selector$1) { + if (selector$1.type === types$1.COMMENT) return callback.call(_this5, selector$1); + }); + }; + _proto.walkIds = function walkIds(callback) { + var _this6 = this; + return this.walk(function(selector$1) { + if (selector$1.type === types$1.ID) return callback.call(_this6, selector$1); + }); + }; + _proto.walkNesting = function walkNesting(callback) { + var _this7 = this; + return this.walk(function(selector$1) { + if (selector$1.type === types$1.NESTING) return callback.call(_this7, selector$1); + }); + }; + _proto.walkPseudos = function walkPseudos(callback) { + var _this8 = this; + return this.walk(function(selector$1) { + if (selector$1.type === types$1.PSEUDO) return callback.call(_this8, selector$1); + }); + }; + _proto.walkTags = function walkTags(callback) { + var _this9 = this; + return this.walk(function(selector$1) { + if (selector$1.type === types$1.TAG) return callback.call(_this9, selector$1); + }); + }; + _proto.walkUniversals = function walkUniversals(callback) { + var _this10 = this; + return this.walk(function(selector$1) { + if (selector$1.type === types$1.UNIVERSAL) return callback.call(_this10, selector$1); + }); + }; + _proto.split = function split(callback) { + var _this11 = this; + var current = []; + return this.reduce(function(memo, node, index) { + var split$1 = callback.call(_this11, node); + current.push(node); + if (split$1) { + memo.push(current); + current = []; + } else if (index === _this11.length - 1) memo.push(current); + return memo; + }, []); + }; + _proto.map = function map(callback) { + return this.nodes.map(callback); + }; + _proto.reduce = function reduce(callback, memo) { + return this.nodes.reduce(callback, memo); + }; + _proto.every = function every(callback) { + return this.nodes.every(callback); + }; + _proto.some = function some(callback) { + return this.nodes.some(callback); + }; + _proto.filter = function filter(callback) { + return this.nodes.filter(callback); + }; + _proto.sort = function sort(callback) { + return this.nodes.sort(callback); + }; + _proto.toString = function toString$1() { + return this.map(String).join(""); + }; + _createClass$5(Container$1, [ + { + key: "first", + get: function get() { + return this.at(0); + } + }, + { + key: "last", + get: function get() { + return this.at(this.length - 1); + } + }, + { + key: "length", + get: function get() { + return this.nodes.length; + } + } + ]); + return Container$1; + }(_node$7["default"]); + exports["default"] = Container; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/root.js +var require_root = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _container$2 = _interopRequireDefault$18(require_container()); + var _types$13 = require_types(); + function _interopRequireDefault$18(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + function _defineProperties$4(target, props) { + for (var i$1 = 0; i$1 < props.length; i$1++) { + var descriptor = props[i$1]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass$4(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties$4(Constructor.prototype, protoProps); + if (staticProps) _defineProperties$4(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _inheritsLoose$12(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf$12(subClass, superClass); + } + function _setPrototypeOf$12(o, p) { + _setPrototypeOf$12 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf$14(o$1, p$1) { + o$1.__proto__ = p$1; + return o$1; + }; + return _setPrototypeOf$12(o, p); + } + var Root = /* @__PURE__ */ function(_Container) { + _inheritsLoose$12(Root$1, _Container); + function Root$1(opts) { + var _this = _Container.call(this, opts) || this; + _this.type = _types$13.ROOT; + return _this; + } + var _proto = Root$1.prototype; + _proto.toString = function toString$1() { + var str$1 = this.reduce(function(memo, selector$1) { + memo.push(String(selector$1)); + return memo; + }, []).join(","); + return this.trailingComma ? str$1 + "," : str$1; + }; + _proto.error = function error(message, options) { + if (this._error) return this._error(message, options); + else return new Error(message); + }; + _createClass$4(Root$1, [{ + key: "errorGenerator", + set: function set(handler) { + this._error = handler; + } + }]); + return Root$1; + }(_container$2["default"]); + exports["default"] = Root; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/selector.js +var require_selector = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _container$1 = _interopRequireDefault$17(require_container()); + var _types$12 = require_types(); + function _interopRequireDefault$17(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + function _inheritsLoose$11(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf$11(subClass, superClass); + } + function _setPrototypeOf$11(o, p) { + _setPrototypeOf$11 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf$14(o$1, p$1) { + o$1.__proto__ = p$1; + return o$1; + }; + return _setPrototypeOf$11(o, p); + } + var Selector = /* @__PURE__ */ function(_Container) { + _inheritsLoose$11(Selector$1, _Container); + function Selector$1(opts) { + var _this = _Container.call(this, opts) || this; + _this.type = _types$12.SELECTOR; + return _this; + } + return Selector$1; + }(_container$1["default"]); + exports["default"] = Selector; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/cssesc@3.0.0/node_modules/cssesc/cssesc.js +/*! https://mths.be/cssesc v3.0.0 by @mathias */ +var require_cssesc = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var hasOwnProperty$1 = {}.hasOwnProperty; + var merge = function merge$1(options, defaults) { + if (!options) return defaults; + var result = {}; + for (var key in defaults) result[key] = hasOwnProperty$1.call(options, key) ? options[key] : defaults[key]; + return result; + }; + var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/; + var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/; + var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g; + var cssesc = function cssesc$1(string$1, options) { + options = merge(options, cssesc$1.options); + if (options.quotes != "single" && options.quotes != "double") options.quotes = "single"; + var quote = options.quotes == "double" ? "\"" : "'"; + var isIdentifier$1 = options.isIdentifier; + var firstChar = string$1.charAt(0); + var output = ""; + var counter = 0; + var length = string$1.length; + while (counter < length) { + var character = string$1.charAt(counter++); + var codePoint = character.charCodeAt(); + var value = void 0; + if (codePoint < 32 || codePoint > 126) { + if (codePoint >= 55296 && codePoint <= 56319 && counter < length) { + var extra = string$1.charCodeAt(counter++); + if ((extra & 64512) == 56320) codePoint = ((codePoint & 1023) << 10) + (extra & 1023) + 65536; + else counter--; + } + value = "\\" + codePoint.toString(16).toUpperCase() + " "; + } else if (options.escapeEverything) if (regexAnySingleEscape.test(character)) value = "\\" + character; + else value = "\\" + codePoint.toString(16).toUpperCase() + " "; + else if (/[\t\n\f\r\x0B]/.test(character)) value = "\\" + codePoint.toString(16).toUpperCase() + " "; + else if (character == "\\" || !isIdentifier$1 && (character == "\"" && quote == character || character == "'" && quote == character) || isIdentifier$1 && regexSingleEscape.test(character)) value = "\\" + character; + else value = character; + output += value; + } + if (isIdentifier$1) { + if (/^-[-\d]/.test(output)) output = "\\-" + output.slice(1); + else if (/\d/.test(firstChar)) output = "\\3" + firstChar + " " + output.slice(1); + } + output = output.replace(regexExcessiveSpaces, function($0, $1, $2) { + if ($1 && $1.length % 2) return $0; + return ($1 || "") + $2; + }); + if (!isIdentifier$1 && options.wrap) return quote + output + quote; + return output; + }; + cssesc.options = { + "escapeEverything": false, + "isIdentifier": false, + "quotes": "single", + "wrap": false + }; + cssesc.version = "3.0.0"; + module.exports = cssesc; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/className.js +var require_className = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _cssesc$2 = _interopRequireDefault$16(require_cssesc()); + var _util$2 = require_util(); + var _node$6 = _interopRequireDefault$16(require_node$1()); + var _types$11 = require_types(); + function _interopRequireDefault$16(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + function _defineProperties$3(target, props) { + for (var i$1 = 0; i$1 < props.length; i$1++) { + var descriptor = props[i$1]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass$3(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties$3(Constructor.prototype, protoProps); + if (staticProps) _defineProperties$3(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _inheritsLoose$10(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf$10(subClass, superClass); + } + function _setPrototypeOf$10(o, p) { + _setPrototypeOf$10 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf$14(o$1, p$1) { + o$1.__proto__ = p$1; + return o$1; + }; + return _setPrototypeOf$10(o, p); + } + var ClassName = /* @__PURE__ */ function(_Node) { + _inheritsLoose$10(ClassName$1, _Node); + function ClassName$1(opts) { + var _this = _Node.call(this, opts) || this; + _this.type = _types$11.CLASS; + _this._constructed = true; + return _this; + } + var _proto = ClassName$1.prototype; + _proto.valueToString = function valueToString() { + return "." + _Node.prototype.valueToString.call(this); + }; + _createClass$3(ClassName$1, [{ + key: "value", + get: function get() { + return this._value; + }, + set: function set(v) { + if (this._constructed) { + var escaped = (0, _cssesc$2["default"])(v, { isIdentifier: true }); + if (escaped !== v) { + (0, _util$2.ensureObject)(this, "raws"); + this.raws.value = escaped; + } else if (this.raws) delete this.raws.value; + } + this._value = v; + } + }]); + return ClassName$1; + }(_node$6["default"]); + exports["default"] = ClassName; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/comment.js +var require_comment = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _node$5 = _interopRequireDefault$15(require_node$1()); + var _types$10 = require_types(); + function _interopRequireDefault$15(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + function _inheritsLoose$9(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf$9(subClass, superClass); + } + function _setPrototypeOf$9(o, p) { + _setPrototypeOf$9 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf$14(o$1, p$1) { + o$1.__proto__ = p$1; + return o$1; + }; + return _setPrototypeOf$9(o, p); + } + var Comment = /* @__PURE__ */ function(_Node) { + _inheritsLoose$9(Comment$1, _Node); + function Comment$1(opts) { + var _this = _Node.call(this, opts) || this; + _this.type = _types$10.COMMENT; + return _this; + } + return Comment$1; + }(_node$5["default"]); + exports["default"] = Comment; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/id.js +var require_id = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _node$4 = _interopRequireDefault$14(require_node$1()); + var _types$9 = require_types(); + function _interopRequireDefault$14(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + function _inheritsLoose$8(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf$8(subClass, superClass); + } + function _setPrototypeOf$8(o, p) { + _setPrototypeOf$8 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf$14(o$1, p$1) { + o$1.__proto__ = p$1; + return o$1; + }; + return _setPrototypeOf$8(o, p); + } + var ID = /* @__PURE__ */ function(_Node) { + _inheritsLoose$8(ID$2, _Node); + function ID$2(opts) { + var _this = _Node.call(this, opts) || this; + _this.type = _types$9.ID; + return _this; + } + var _proto = ID$2.prototype; + _proto.valueToString = function valueToString() { + return "#" + _Node.prototype.valueToString.call(this); + }; + return ID$2; + }(_node$4["default"]); + exports["default"] = ID; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/namespace.js +var require_namespace = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _cssesc$1 = _interopRequireDefault$13(require_cssesc()); + var _util$1 = require_util(); + var _node$3 = _interopRequireDefault$13(require_node$1()); + function _interopRequireDefault$13(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + function _defineProperties$2(target, props) { + for (var i$1 = 0; i$1 < props.length; i$1++) { + var descriptor = props[i$1]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass$2(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties$2(Constructor.prototype, protoProps); + if (staticProps) _defineProperties$2(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _inheritsLoose$7(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf$7(subClass, superClass); + } + function _setPrototypeOf$7(o, p) { + _setPrototypeOf$7 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf$14(o$1, p$1) { + o$1.__proto__ = p$1; + return o$1; + }; + return _setPrototypeOf$7(o, p); + } + var Namespace = /* @__PURE__ */ function(_Node) { + _inheritsLoose$7(Namespace$1, _Node); + function Namespace$1() { + return _Node.apply(this, arguments) || this; + } + var _proto = Namespace$1.prototype; + _proto.qualifiedName = function qualifiedName(value) { + if (this.namespace) return this.namespaceString + "|" + value; + else return value; + }; + _proto.valueToString = function valueToString() { + return this.qualifiedName(_Node.prototype.valueToString.call(this)); + }; + _createClass$2(Namespace$1, [ + { + key: "namespace", + get: function get() { + return this._namespace; + }, + set: function set(namespace) { + if (namespace === true || namespace === "*" || namespace === "&") { + this._namespace = namespace; + if (this.raws) delete this.raws.namespace; + return; + } + var escaped = (0, _cssesc$1["default"])(namespace, { isIdentifier: true }); + this._namespace = namespace; + if (escaped !== namespace) { + (0, _util$1.ensureObject)(this, "raws"); + this.raws.namespace = escaped; + } else if (this.raws) delete this.raws.namespace; + } + }, + { + key: "ns", + get: function get() { + return this._namespace; + }, + set: function set(namespace) { + this.namespace = namespace; + } + }, + { + key: "namespaceString", + get: function get() { + if (this.namespace) { + var ns = this.stringifyProperty("namespace"); + if (ns === true) return ""; + else return ns; + } else return ""; + } + } + ]); + return Namespace$1; + }(_node$3["default"]); + exports["default"] = Namespace; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/tag.js +var require_tag = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _namespace$2 = _interopRequireDefault$12(require_namespace()); + var _types$8 = require_types(); + function _interopRequireDefault$12(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + function _inheritsLoose$6(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf$6(subClass, superClass); + } + function _setPrototypeOf$6(o, p) { + _setPrototypeOf$6 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf$14(o$1, p$1) { + o$1.__proto__ = p$1; + return o$1; + }; + return _setPrototypeOf$6(o, p); + } + var Tag = /* @__PURE__ */ function(_Namespace) { + _inheritsLoose$6(Tag$1, _Namespace); + function Tag$1(opts) { + var _this = _Namespace.call(this, opts) || this; + _this.type = _types$8.TAG; + return _this; + } + return Tag$1; + }(_namespace$2["default"]); + exports["default"] = Tag; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/string.js +var require_string = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _node$2 = _interopRequireDefault$11(require_node$1()); + var _types$7 = require_types(); + function _interopRequireDefault$11(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + function _inheritsLoose$5(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf$5(subClass, superClass); + } + function _setPrototypeOf$5(o, p) { + _setPrototypeOf$5 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf$14(o$1, p$1) { + o$1.__proto__ = p$1; + return o$1; + }; + return _setPrototypeOf$5(o, p); + } + var String$1 = /* @__PURE__ */ function(_Node) { + _inheritsLoose$5(String$2, _Node); + function String$2(opts) { + var _this = _Node.call(this, opts) || this; + _this.type = _types$7.STRING; + return _this; + } + return String$2; + }(_node$2["default"]); + exports["default"] = String$1; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/pseudo.js +var require_pseudo = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _container = _interopRequireDefault$10(require_container()); + var _types$6 = require_types(); + function _interopRequireDefault$10(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + function _inheritsLoose$4(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf$4(subClass, superClass); + } + function _setPrototypeOf$4(o, p) { + _setPrototypeOf$4 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf$14(o$1, p$1) { + o$1.__proto__ = p$1; + return o$1; + }; + return _setPrototypeOf$4(o, p); + } + var Pseudo = /* @__PURE__ */ function(_Container) { + _inheritsLoose$4(Pseudo$1, _Container); + function Pseudo$1(opts) { + var _this = _Container.call(this, opts) || this; + _this.type = _types$6.PSEUDO; + return _this; + } + var _proto = Pseudo$1.prototype; + _proto.toString = function toString$1() { + var params = this.length ? "(" + this.map(String).join(",") + ")" : ""; + return [ + this.rawSpaceBefore, + this.stringifyProperty("value"), + params, + this.rawSpaceAfter + ].join(""); + }; + return Pseudo$1; + }(_container["default"]); + exports["default"] = Pseudo; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/node.js +var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => { + /** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + module.exports = __require("util").deprecate; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/attribute.js +var require_attribute = /* @__PURE__ */ __commonJSMin(((exports) => { + exports.__esModule = true; + exports["default"] = void 0; + exports.unescapeValue = unescapeValue; + var _cssesc = _interopRequireDefault$9(require_cssesc()); + var _unesc = _interopRequireDefault$9(require_unesc()); + var _namespace$1 = _interopRequireDefault$9(require_namespace()); + var _types$5 = require_types(); + var _CSSESC_QUOTE_OPTIONS; + function _interopRequireDefault$9(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + function _defineProperties$1(target, props) { + for (var i$1 = 0; i$1 < props.length; i$1++) { + var descriptor = props[i$1]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass$1(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); + if (staticProps) _defineProperties$1(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _inheritsLoose$3(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf$3(subClass, superClass); + } + function _setPrototypeOf$3(o, p) { + _setPrototypeOf$3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf$14(o$1, p$1) { + o$1.__proto__ = p$1; + return o$1; + }; + return _setPrototypeOf$3(o, p); + } + var deprecate = require_node(); + var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/; + var warnOfDeprecatedValueAssignment = deprecate(function() {}, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. Call attribute.setValue() instead."); + var warnOfDeprecatedQuotedAssignment = deprecate(function() {}, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."); + var warnOfDeprecatedConstructor = deprecate(function() {}, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now."); + function unescapeValue(value) { + var deprecatedUsage = false; + var quoteMark = null; + var unescaped = value; + var m = unescaped.match(WRAPPED_IN_QUOTES); + if (m) { + quoteMark = m[1]; + unescaped = m[2]; + } + unescaped = (0, _unesc["default"])(unescaped); + if (unescaped !== value) deprecatedUsage = true; + return { + deprecatedUsage, + unescaped, + quoteMark + }; + } + function handleDeprecatedContructorOpts(opts) { + if (opts.quoteMark !== void 0) return opts; + if (opts.value === void 0) return opts; + warnOfDeprecatedConstructor(); + var _unescapeValue = unescapeValue(opts.value), quoteMark = _unescapeValue.quoteMark, unescaped = _unescapeValue.unescaped; + if (!opts.raws) opts.raws = {}; + if (opts.raws.value === void 0) opts.raws.value = opts.value; + opts.value = unescaped; + opts.quoteMark = quoteMark; + return opts; + } + var Attribute = /* @__PURE__ */ function(_Namespace) { + _inheritsLoose$3(Attribute$1, _Namespace); + function Attribute$1(opts) { + var _this; + if (opts === void 0) opts = {}; + _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this; + _this.type = _types$5.ATTRIBUTE; + _this.raws = _this.raws || {}; + Object.defineProperty(_this.raws, "unquoted", { + get: deprecate(function() { + return _this.value; + }, "attr.raws.unquoted is deprecated. Call attr.value instead."), + set: deprecate(function() { + return _this.value; + }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.") + }); + _this._constructed = true; + return _this; + } + /** + * Returns the Attribute's value quoted such that it would be legal to use + * in the value of a css file. The original value's quotation setting + * used for stringification is left unchanged. See `setValue(value, options)` + * if you want to control the quote settings of a new value for the attribute. + * + * You can also change the quotation used for the current value by setting quoteMark. + * + * Options: + * * quoteMark {'"' | "'" | null} - Use this value to quote the value. If this + * option is not set, the original value for quoteMark will be used. If + * indeterminate, a double quote is used. The legal values are: + * * `null` - the value will be unquoted and characters will be escaped as necessary. + * * `'` - the value will be quoted with a single quote and single quotes are escaped. + * * `"` - the value will be quoted with a double quote and double quotes are escaped. + * * preferCurrentQuoteMark {boolean} - if true, prefer the source quote mark + * over the quoteMark option value. + * * smart {boolean} - if true, will select a quote mark based on the value + * and the other options specified here. See the `smartQuoteMark()` + * method. + **/ + var _proto = Attribute$1.prototype; + _proto.getQuotedValue = function getQuotedValue(options) { + if (options === void 0) options = {}; + var cssescopts = CSSESC_QUOTE_OPTIONS[this._determineQuoteMark(options)]; + return (0, _cssesc["default"])(this._value, cssescopts); + }; + _proto._determineQuoteMark = function _determineQuoteMark(options) { + return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options); + }; + _proto.setValue = function setValue(value, options) { + if (options === void 0) options = {}; + this._value = value; + this._quoteMark = this._determineQuoteMark(options); + this._syncRawValue(); + }; + _proto.smartQuoteMark = function smartQuoteMark(options) { + var v = this.value; + var numSingleQuotes = v.replace(/[^']/g, "").length; + var numDoubleQuotes = v.replace(/[^"]/g, "").length; + if (numSingleQuotes + numDoubleQuotes === 0) { + var escaped = (0, _cssesc["default"])(v, { isIdentifier: true }); + if (escaped === v) return Attribute$1.NO_QUOTE; + else { + var pref = this.preferredQuoteMark(options); + if (pref === Attribute$1.NO_QUOTE) { + var quote = this.quoteMark || options.quoteMark || Attribute$1.DOUBLE_QUOTE; + var opts = CSSESC_QUOTE_OPTIONS[quote]; + if ((0, _cssesc["default"])(v, opts).length < escaped.length) return quote; + } + return pref; + } + } else if (numDoubleQuotes === numSingleQuotes) return this.preferredQuoteMark(options); + else if (numDoubleQuotes < numSingleQuotes) return Attribute$1.DOUBLE_QUOTE; + else return Attribute$1.SINGLE_QUOTE; + }; + _proto.preferredQuoteMark = function preferredQuoteMark(options) { + var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark; + if (quoteMark === void 0) quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark; + if (quoteMark === void 0) quoteMark = Attribute$1.DOUBLE_QUOTE; + return quoteMark; + }; + _proto._syncRawValue = function _syncRawValue() { + var rawValue = (0, _cssesc["default"])(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]); + if (rawValue === this._value) { + if (this.raws) delete this.raws.value; + } else this.raws.value = rawValue; + }; + _proto._handleEscapes = function _handleEscapes(prop, value) { + if (this._constructed) { + var escaped = (0, _cssesc["default"])(value, { isIdentifier: true }); + if (escaped !== value) this.raws[prop] = escaped; + else delete this.raws[prop]; + } + }; + _proto._spacesFor = function _spacesFor(name) { + var attrSpaces = { + before: "", + after: "" + }; + var spaces = this.spaces[name] || {}; + var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {}; + return Object.assign(attrSpaces, spaces, rawSpaces); + }; + _proto._stringFor = function _stringFor(name, spaceName, concat) { + if (spaceName === void 0) spaceName = name; + if (concat === void 0) concat = defaultAttrConcat; + var attrSpaces = this._spacesFor(spaceName); + return concat(this.stringifyProperty(name), attrSpaces); + }; + _proto.offsetOf = function offsetOf(name) { + var count = 1; + var attributeSpaces = this._spacesFor("attribute"); + count += attributeSpaces.before.length; + if (name === "namespace" || name === "ns") return this.namespace ? count : -1; + if (name === "attributeNS") return count; + count += this.namespaceString.length; + if (this.namespace) count += 1; + if (name === "attribute") return count; + count += this.stringifyProperty("attribute").length; + count += attributeSpaces.after.length; + var operatorSpaces = this._spacesFor("operator"); + count += operatorSpaces.before.length; + var operator = this.stringifyProperty("operator"); + if (name === "operator") return operator ? count : -1; + count += operator.length; + count += operatorSpaces.after.length; + var valueSpaces = this._spacesFor("value"); + count += valueSpaces.before.length; + var value = this.stringifyProperty("value"); + if (name === "value") return value ? count : -1; + count += value.length; + count += valueSpaces.after.length; + var insensitiveSpaces = this._spacesFor("insensitive"); + count += insensitiveSpaces.before.length; + if (name === "insensitive") return this.insensitive ? count : -1; + return -1; + }; + _proto.toString = function toString$1() { + var _this2 = this; + var selector$1 = [this.rawSpaceBefore, "["]; + selector$1.push(this._stringFor("qualifiedAttribute", "attribute")); + if (this.operator && (this.value || this.value === "")) { + selector$1.push(this._stringFor("operator")); + selector$1.push(this._stringFor("value")); + selector$1.push(this._stringFor("insensitiveFlag", "insensitive", function(attrValue, attrSpaces) { + if (attrValue.length > 0 && !_this2.quoted && attrSpaces.before.length === 0 && !(_this2.spaces.value && _this2.spaces.value.after)) attrSpaces.before = " "; + return defaultAttrConcat(attrValue, attrSpaces); + })); + } + selector$1.push("]"); + selector$1.push(this.rawSpaceAfter); + return selector$1.join(""); + }; + _createClass$1(Attribute$1, [ + { + key: "quoted", + get: function get() { + var qm = this.quoteMark; + return qm === "'" || qm === "\""; + }, + set: function set(value) { + warnOfDeprecatedQuotedAssignment(); + } + }, + { + key: "quoteMark", + get: function get() { + return this._quoteMark; + }, + set: function set(quoteMark) { + if (!this._constructed) { + this._quoteMark = quoteMark; + return; + } + if (this._quoteMark !== quoteMark) { + this._quoteMark = quoteMark; + this._syncRawValue(); + } + } + }, + { + key: "qualifiedAttribute", + get: function get() { + return this.qualifiedName(this.raws.attribute || this.attribute); + } + }, + { + key: "insensitiveFlag", + get: function get() { + return this.insensitive ? "i" : ""; + } + }, + { + key: "value", + get: function get() { + return this._value; + }, + set: function set(v) { + if (this._constructed) { + var _unescapeValue2 = unescapeValue(v), deprecatedUsage = _unescapeValue2.deprecatedUsage, unescaped = _unescapeValue2.unescaped, quoteMark = _unescapeValue2.quoteMark; + if (deprecatedUsage) warnOfDeprecatedValueAssignment(); + if (unescaped === this._value && quoteMark === this._quoteMark) return; + this._value = unescaped; + this._quoteMark = quoteMark; + this._syncRawValue(); + } else this._value = v; + } + }, + { + key: "insensitive", + get: function get() { + return this._insensitive; + }, + set: function set(insensitive) { + if (!insensitive) { + this._insensitive = false; + if (this.raws && (this.raws.insensitiveFlag === "I" || this.raws.insensitiveFlag === "i")) this.raws.insensitiveFlag = void 0; + } + this._insensitive = insensitive; + } + }, + { + key: "attribute", + get: function get() { + return this._attribute; + }, + set: function set(name) { + this._handleEscapes("attribute", name); + this._attribute = name; + } + } + ]); + return Attribute$1; + }(_namespace$1["default"]); + exports["default"] = Attribute; + Attribute.NO_QUOTE = null; + Attribute.SINGLE_QUOTE = "'"; + Attribute.DOUBLE_QUOTE = "\""; + var CSSESC_QUOTE_OPTIONS = (_CSSESC_QUOTE_OPTIONS = { + "'": { + quotes: "single", + wrap: true + }, + "\"": { + quotes: "double", + wrap: true + } + }, _CSSESC_QUOTE_OPTIONS[null] = { isIdentifier: true }, _CSSESC_QUOTE_OPTIONS); + function defaultAttrConcat(attrValue, attrSpaces) { + return "" + attrSpaces.before + attrValue + attrSpaces.after; + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/universal.js +var require_universal = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _namespace = _interopRequireDefault$8(require_namespace()); + var _types$4 = require_types(); + function _interopRequireDefault$8(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + function _inheritsLoose$2(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf$2(subClass, superClass); + } + function _setPrototypeOf$2(o, p) { + _setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf$14(o$1, p$1) { + o$1.__proto__ = p$1; + return o$1; + }; + return _setPrototypeOf$2(o, p); + } + var Universal = /* @__PURE__ */ function(_Namespace) { + _inheritsLoose$2(Universal$1, _Namespace); + function Universal$1(opts) { + var _this = _Namespace.call(this, opts) || this; + _this.type = _types$4.UNIVERSAL; + _this.value = "*"; + return _this; + } + return Universal$1; + }(_namespace["default"]); + exports["default"] = Universal; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/combinator.js +var require_combinator = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _node$1 = _interopRequireDefault$7(require_node$1()); + var _types$3 = require_types(); + function _interopRequireDefault$7(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + function _inheritsLoose$1(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf$1(subClass, superClass); + } + function _setPrototypeOf$1(o, p) { + _setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf$14(o$1, p$1) { + o$1.__proto__ = p$1; + return o$1; + }; + return _setPrototypeOf$1(o, p); + } + var Combinator = /* @__PURE__ */ function(_Node) { + _inheritsLoose$1(Combinator$1, _Node); + function Combinator$1(opts) { + var _this = _Node.call(this, opts) || this; + _this.type = _types$3.COMBINATOR; + return _this; + } + return Combinator$1; + }(_node$1["default"]); + exports["default"] = Combinator; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/nesting.js +var require_nesting = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _node = _interopRequireDefault$6(require_node$1()); + var _types$2 = require_types(); + function _interopRequireDefault$6(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf$14(o$1, p$1) { + o$1.__proto__ = p$1; + return o$1; + }; + return _setPrototypeOf(o, p); + } + var Nesting = /* @__PURE__ */ function(_Node) { + _inheritsLoose(Nesting$1, _Node); + function Nesting$1(opts) { + var _this = _Node.call(this, opts) || this; + _this.type = _types$2.NESTING; + _this.value = "&"; + return _this; + } + return Nesting$1; + }(_node["default"]); + exports["default"] = Nesting; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/sortAscending.js +var require_sortAscending = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = sortAscending; + function sortAscending(list) { + return list.sort(function(a, b) { + return a - b; + }); + } + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/tokenTypes.js +var require_tokenTypes = /* @__PURE__ */ __commonJSMin(((exports) => { + exports.__esModule = true; + exports.word = exports.tilde = exports.tab = exports.str = exports.space = exports.slash = exports.singleQuote = exports.semicolon = exports.plus = exports.pipe = exports.openSquare = exports.openParenthesis = exports.newline = exports.greaterThan = exports.feed = exports.equals = exports.doubleQuote = exports.dollar = exports.cr = exports.comment = exports.comma = exports.combinator = exports.colon = exports.closeSquare = exports.closeParenthesis = exports.caret = exports.bang = exports.backslash = exports.at = exports.asterisk = exports.ampersand = void 0; + var ampersand = 38; + exports.ampersand = ampersand; + var asterisk = 42; + exports.asterisk = asterisk; + var at = 64; + exports.at = at; + var comma = 44; + exports.comma = comma; + var colon = 58; + exports.colon = colon; + var semicolon = 59; + exports.semicolon = semicolon; + var openParenthesis = 40; + exports.openParenthesis = openParenthesis; + var closeParenthesis = 41; + exports.closeParenthesis = closeParenthesis; + var openSquare = 91; + exports.openSquare = openSquare; + var closeSquare = 93; + exports.closeSquare = closeSquare; + var dollar = 36; + exports.dollar = dollar; + var tilde = 126; + exports.tilde = tilde; + var caret = 94; + exports.caret = caret; + var plus = 43; + exports.plus = plus; + var equals = 61; + exports.equals = equals; + var pipe = 124; + exports.pipe = pipe; + var greaterThan = 62; + exports.greaterThan = greaterThan; + var space = 32; + exports.space = space; + var singleQuote = 39; + exports.singleQuote = singleQuote; + var doubleQuote = 34; + exports.doubleQuote = doubleQuote; + var slash = 47; + exports.slash = slash; + var bang = 33; + exports.bang = bang; + var backslash = 92; + exports.backslash = backslash; + var cr = 13; + exports.cr = cr; + var feed = 12; + exports.feed = feed; + var newline = 10; + exports.newline = newline; + var tab = 9; + exports.tab = tab; + var str = singleQuote; + exports.str = str; + var comment$1 = -1; + exports.comment = comment$1; + var word = -2; + exports.word = word; + var combinator$1 = -3; + exports.combinator = combinator$1; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/tokenize.js +var require_tokenize = /* @__PURE__ */ __commonJSMin(((exports) => { + exports.__esModule = true; + exports.FIELDS = void 0; + exports["default"] = tokenize; + var t = _interopRequireWildcard$2(require_tokenTypes()); + var _unescapable, _wordDelimiters; + function _getRequireWildcardCache$2(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = /* @__PURE__ */ new WeakMap(); + var cacheNodeInterop = /* @__PURE__ */ new WeakMap(); + return (_getRequireWildcardCache$2 = function _getRequireWildcardCache$4(nodeInterop$1) { + return nodeInterop$1 ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + function _interopRequireWildcard$2(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) return obj; + if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { "default": obj }; + var cache = _getRequireWildcardCache$2(nodeInterop); + if (cache && cache.has(obj)) return cache.get(obj); + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); + else newObj[key] = obj[key]; + } + newObj["default"] = obj; + if (cache) cache.set(obj, newObj); + return newObj; + } + var unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable); + var wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters); + var hex = {}; + var hexChars = "0123456789abcdefABCDEF"; + for (var i = 0; i < hexChars.length; i++) hex[hexChars.charCodeAt(i)] = true; + /** + * Returns the last index of the bar css word + * @param {string} css The string in which the word begins + * @param {number} start The index into the string where word's first letter occurs + */ + function consumeWord(css, start) { + var next = start; + var code; + do { + code = css.charCodeAt(next); + if (wordDelimiters[code]) return next - 1; + else if (code === t.backslash) next = consumeEscape(css, next) + 1; + else next++; + } while (next < css.length); + return next - 1; + } + /** + * Returns the last index of the escape sequence + * @param {string} css The string in which the sequence begins + * @param {number} start The index into the string where escape character (`\`) occurs. + */ + function consumeEscape(css, start) { + var next = start; + var code = css.charCodeAt(next + 1); + if (unescapable[code]) {} else if (hex[code]) { + var hexDigits = 0; + do { + next++; + hexDigits++; + code = css.charCodeAt(next + 1); + } while (hex[code] && hexDigits < 6); + if (hexDigits < 6 && code === t.space) next++; + } else next++; + return next; + } + var FIELDS = { + TYPE: 0, + START_LINE: 1, + START_COL: 2, + END_LINE: 3, + END_COL: 4, + START_POS: 5, + END_POS: 6 + }; + exports.FIELDS = FIELDS; + function tokenize(input) { + var tokens$1 = []; + var css = input.css.valueOf(); + var length = css.length; + var offset = -1; + var line = 1; + var start = 0; + var end = 0; + var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType; + function unclosed(what, fix) { + if (input.safe) { + css += fix; + next = css.length - 1; + } else throw input.error("Unclosed " + what, line, start - offset, start); + } + while (start < length) { + code = css.charCodeAt(start); + if (code === t.newline) { + offset = start; + line += 1; + } + switch (code) { + case t.space: + case t.tab: + case t.newline: + case t.cr: + case t.feed: + next = start; + do { + next += 1; + code = css.charCodeAt(next); + if (code === t.newline) { + offset = next; + line += 1; + } + } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed); + tokenType = t.space; + endLine = line; + endColumn = next - offset - 1; + end = next; + break; + case t.plus: + case t.greaterThan: + case t.tilde: + case t.pipe: + next = start; + do { + next += 1; + code = css.charCodeAt(next); + } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe); + tokenType = t.combinator; + endLine = line; + endColumn = start - offset; + end = next; + break; + case t.asterisk: + case t.ampersand: + case t.bang: + case t.comma: + case t.equals: + case t.dollar: + case t.caret: + case t.openSquare: + case t.closeSquare: + case t.colon: + case t.semicolon: + case t.openParenthesis: + case t.closeParenthesis: + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + case t.singleQuote: + case t.doubleQuote: + quote = code === t.singleQuote ? "'" : "\""; + next = start; + do { + escaped = false; + next = css.indexOf(quote, next + 1); + if (next === -1) unclosed("quote", quote); + escapePos = next; + while (css.charCodeAt(escapePos - 1) === t.backslash) { + escapePos -= 1; + escaped = !escaped; + } + } while (escaped); + tokenType = t.str; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + default: + if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) { + next = css.indexOf("*/", start + 2) + 1; + if (next === 0) unclosed("comment", "*/"); + content = css.slice(start, next + 1); + lines = content.split("\n"); + last = lines.length - 1; + if (last > 0) { + nextLine = line + last; + nextOffset = next - lines[last].length; + } else { + nextLine = line; + nextOffset = offset; + } + tokenType = t.comment; + line = nextLine; + endLine = nextLine; + endColumn = next - nextOffset; + } else if (code === t.slash) { + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + } else { + next = consumeWord(css, start); + tokenType = t.word; + endLine = line; + endColumn = next - offset; + } + end = next + 1; + break; + } + tokens$1.push([ + tokenType, + line, + start - offset, + endLine, + endColumn, + start, + end + ]); + if (nextOffset) { + offset = nextOffset; + nextOffset = null; + } + start = end; + } + return tokens$1; + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/parser.js +var require_parser = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _root$1 = _interopRequireDefault$5(require_root()); + var _selector$1 = _interopRequireDefault$5(require_selector()); + var _className$1 = _interopRequireDefault$5(require_className()); + var _comment$1 = _interopRequireDefault$5(require_comment()); + var _id$1 = _interopRequireDefault$5(require_id()); + var _tag$1 = _interopRequireDefault$5(require_tag()); + var _string$1 = _interopRequireDefault$5(require_string()); + var _pseudo$1 = _interopRequireDefault$5(require_pseudo()); + var _attribute$1 = _interopRequireWildcard$1(require_attribute()); + var _universal$1 = _interopRequireDefault$5(require_universal()); + var _combinator$1 = _interopRequireDefault$5(require_combinator()); + var _nesting$1 = _interopRequireDefault$5(require_nesting()); + var _sortAscending = _interopRequireDefault$5(require_sortAscending()); + var _tokenize = _interopRequireWildcard$1(require_tokenize()); + var tokens = _interopRequireWildcard$1(require_tokenTypes()); + var types = _interopRequireWildcard$1(require_types()); + var _util = require_util(); + var _WHITESPACE_TOKENS, _Object$assign; + function _getRequireWildcardCache$1(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = /* @__PURE__ */ new WeakMap(); + var cacheNodeInterop = /* @__PURE__ */ new WeakMap(); + return (_getRequireWildcardCache$1 = function _getRequireWildcardCache$4(nodeInterop$1) { + return nodeInterop$1 ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + function _interopRequireWildcard$1(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) return obj; + if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { "default": obj }; + var cache = _getRequireWildcardCache$1(nodeInterop); + if (cache && cache.has(obj)) return cache.get(obj); + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); + else newObj[key] = obj[key]; + } + newObj["default"] = obj; + if (cache) cache.set(obj, newObj); + return newObj; + } + function _interopRequireDefault$5(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + function _defineProperties(target, props) { + for (var i$1 = 0; i$1 < props.length; i$1++) { + var descriptor = props[i$1]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + var WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS); + var WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign)); + function tokenStart(token) { + return { + line: token[_tokenize.FIELDS.START_LINE], + column: token[_tokenize.FIELDS.START_COL] + }; + } + function tokenEnd(token) { + return { + line: token[_tokenize.FIELDS.END_LINE], + column: token[_tokenize.FIELDS.END_COL] + }; + } + function getSource(startLine, startColumn, endLine, endColumn) { + return { + start: { + line: startLine, + column: startColumn + }, + end: { + line: endLine, + column: endColumn + } + }; + } + function getTokenSource(token) { + return getSource(token[_tokenize.FIELDS.START_LINE], token[_tokenize.FIELDS.START_COL], token[_tokenize.FIELDS.END_LINE], token[_tokenize.FIELDS.END_COL]); + } + function getTokenSourceSpan(startToken, endToken) { + if (!startToken) return; + return getSource(startToken[_tokenize.FIELDS.START_LINE], startToken[_tokenize.FIELDS.START_COL], endToken[_tokenize.FIELDS.END_LINE], endToken[_tokenize.FIELDS.END_COL]); + } + function unescapeProp(node, prop) { + var value = node[prop]; + if (typeof value !== "string") return; + if (value.indexOf("\\") !== -1) { + (0, _util.ensureObject)(node, "raws"); + node[prop] = (0, _util.unesc)(value); + if (node.raws[prop] === void 0) node.raws[prop] = value; + } + return node; + } + function indexesOf(array, item) { + var i$1 = -1; + var indexes = []; + while ((i$1 = array.indexOf(item, i$1 + 1)) !== -1) indexes.push(i$1); + return indexes; + } + function uniqs() { + var list = Array.prototype.concat.apply([], arguments); + return list.filter(function(item, i$1) { + return i$1 === list.indexOf(item); + }); + } + var Parser = /* @__PURE__ */ function() { + function Parser$2(rule, options) { + if (options === void 0) options = {}; + this.rule = rule; + this.options = Object.assign({ + lossy: false, + safe: false + }, options); + this.position = 0; + this.css = typeof this.rule === "string" ? this.rule : this.rule.selector; + this.tokens = (0, _tokenize["default"])({ + css: this.css, + error: this._errorGenerator(), + safe: this.options.safe + }); + var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]); + this.root = new _root$1["default"]({ source: rootSource }); + this.root.errorGenerator = this._errorGenerator(); + var selector$1 = new _selector$1["default"]({ + source: { start: { + line: 1, + column: 1 + } }, + sourceIndex: 0 + }); + this.root.append(selector$1); + this.current = selector$1; + this.loop(); + } + var _proto = Parser$2.prototype; + _proto._errorGenerator = function _errorGenerator() { + var _this = this; + return function(message, errorOptions) { + if (typeof _this.rule === "string") return new Error(message); + return _this.rule.error(message, errorOptions); + }; + }; + _proto.attribute = function attribute$1() { + var attr = []; + var startingToken = this.currToken; + this.position++; + while (this.position < this.tokens.length && this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { + attr.push(this.currToken); + this.position++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) return this.expected("closing square bracket", this.currToken[_tokenize.FIELDS.START_POS]); + var len = attr.length; + var node = { + source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]), + sourceIndex: startingToken[_tokenize.FIELDS.START_POS] + }; + if (len === 1 && !~[tokens.word].indexOf(attr[0][_tokenize.FIELDS.TYPE])) return this.expected("attribute", attr[0][_tokenize.FIELDS.START_POS]); + var pos = 0; + var spaceBefore = ""; + var commentBefore = ""; + var lastAdded = null; + var spaceAfterMeaningfulToken = false; + while (pos < len) { + var token = attr[pos]; + var content = this.content(token); + var next = attr[pos + 1]; + switch (token[_tokenize.FIELDS.TYPE]) { + case tokens.space: + spaceAfterMeaningfulToken = true; + if (this.options.lossy) break; + if (lastAdded) { + (0, _util.ensureObject)(node, "spaces", lastAdded); + var prevContent = node.spaces[lastAdded].after || ""; + node.spaces[lastAdded].after = prevContent + content; + var existingComment = (0, _util.getProp)(node, "raws", "spaces", lastAdded, "after") || null; + if (existingComment) node.raws.spaces[lastAdded].after = existingComment + content; + } else { + spaceBefore = spaceBefore + content; + commentBefore = commentBefore + content; + } + break; + case tokens.asterisk: + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = "operator"; + } else if ((!node.namespace || lastAdded === "namespace" && !spaceAfterMeaningfulToken) && next) { + if (spaceBefore) { + (0, _util.ensureObject)(node, "spaces", "attribute"); + node.spaces.attribute.before = spaceBefore; + spaceBefore = ""; + } + if (commentBefore) { + (0, _util.ensureObject)(node, "raws", "spaces", "attribute"); + node.raws.spaces.attribute.before = spaceBefore; + commentBefore = ""; + } + node.namespace = (node.namespace || "") + content; + if ((0, _util.getProp)(node, "raws", "namespace") || null) node.raws.namespace += content; + lastAdded = "namespace"; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.dollar: if (lastAdded === "value") { + var oldRawValue = (0, _util.getProp)(node, "raws", "value"); + node.value += "$"; + if (oldRawValue) node.raws.value = oldRawValue + "$"; + break; + } + case tokens.caret: + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = "operator"; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.combinator: + if (content === "~" && next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = "operator"; + } + if (content !== "|") { + spaceAfterMeaningfulToken = false; + break; + } + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = "operator"; + } else if (!node.namespace && !node.attribute) node.namespace = true; + spaceAfterMeaningfulToken = false; + break; + case tokens.word: + if (next && this.content(next) === "|" && attr[pos + 2] && attr[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals && !node.operator && !node.namespace) { + node.namespace = content; + lastAdded = "namespace"; + } else if (!node.attribute || lastAdded === "attribute" && !spaceAfterMeaningfulToken) { + if (spaceBefore) { + (0, _util.ensureObject)(node, "spaces", "attribute"); + node.spaces.attribute.before = spaceBefore; + spaceBefore = ""; + } + if (commentBefore) { + (0, _util.ensureObject)(node, "raws", "spaces", "attribute"); + node.raws.spaces.attribute.before = commentBefore; + commentBefore = ""; + } + node.attribute = (node.attribute || "") + content; + if ((0, _util.getProp)(node, "raws", "attribute") || null) node.raws.attribute += content; + lastAdded = "attribute"; + } else if (!node.value && node.value !== "" || lastAdded === "value" && !(spaceAfterMeaningfulToken || node.quoteMark)) { + var _unescaped = (0, _util.unesc)(content); + var _oldRawValue = (0, _util.getProp)(node, "raws", "value") || ""; + var oldValue = node.value || ""; + node.value = oldValue + _unescaped; + node.quoteMark = null; + if (_unescaped !== content || _oldRawValue) { + (0, _util.ensureObject)(node, "raws"); + node.raws.value = (_oldRawValue || oldValue) + content; + } + lastAdded = "value"; + } else { + var insensitive = content === "i" || content === "I"; + if ((node.value || node.value === "") && (node.quoteMark || spaceAfterMeaningfulToken)) { + node.insensitive = insensitive; + if (!insensitive || content === "I") { + (0, _util.ensureObject)(node, "raws"); + node.raws.insensitiveFlag = content; + } + lastAdded = "insensitive"; + if (spaceBefore) { + (0, _util.ensureObject)(node, "spaces", "insensitive"); + node.spaces.insensitive.before = spaceBefore; + spaceBefore = ""; + } + if (commentBefore) { + (0, _util.ensureObject)(node, "raws", "spaces", "insensitive"); + node.raws.spaces.insensitive.before = commentBefore; + commentBefore = ""; + } + } else if (node.value || node.value === "") { + lastAdded = "value"; + node.value += content; + if (node.raws.value) node.raws.value += content; + } + } + spaceAfterMeaningfulToken = false; + break; + case tokens.str: + if (!node.attribute || !node.operator) return this.error("Expected an attribute followed by an operator preceding the string.", { index: token[_tokenize.FIELDS.START_POS] }); + var _unescapeValue = (0, _attribute$1.unescapeValue)(content), unescaped = _unescapeValue.unescaped, quoteMark = _unescapeValue.quoteMark; + node.value = unescaped; + node.quoteMark = quoteMark; + lastAdded = "value"; + (0, _util.ensureObject)(node, "raws"); + node.raws.value = content; + spaceAfterMeaningfulToken = false; + break; + case tokens.equals: + if (!node.attribute) return this.expected("attribute", token[_tokenize.FIELDS.START_POS], content); + if (node.value) return this.error("Unexpected \"=\" found; an operator was already defined.", { index: token[_tokenize.FIELDS.START_POS] }); + node.operator = node.operator ? node.operator + content : content; + lastAdded = "operator"; + spaceAfterMeaningfulToken = false; + break; + case tokens.comment: + if (lastAdded) if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === "insensitive") { + var lastComment = (0, _util.getProp)(node, "spaces", lastAdded, "after") || ""; + var rawLastComment = (0, _util.getProp)(node, "raws", "spaces", lastAdded, "after") || lastComment; + (0, _util.ensureObject)(node, "raws", "spaces", lastAdded); + node.raws.spaces[lastAdded].after = rawLastComment + content; + } else { + var lastValue = node[lastAdded] || ""; + var rawLastValue = (0, _util.getProp)(node, "raws", lastAdded) || lastValue; + (0, _util.ensureObject)(node, "raws"); + node.raws[lastAdded] = rawLastValue + content; + } + else commentBefore = commentBefore + content; + break; + default: return this.error("Unexpected \"" + content + "\" found.", { index: token[_tokenize.FIELDS.START_POS] }); + } + pos++; + } + unescapeProp(node, "attribute"); + unescapeProp(node, "namespace"); + this.newNode(new _attribute$1["default"](node)); + this.position++; + }; + _proto.parseWhitespaceEquivalentTokens = function parseWhitespaceEquivalentTokens(stopPosition) { + if (stopPosition < 0) stopPosition = this.tokens.length; + var startPosition = this.position; + var nodes = []; + var space$1 = ""; + var lastComment = void 0; + do + if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) { + if (!this.options.lossy) space$1 += this.content(); + } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.comment) { + var spaces = {}; + if (space$1) { + spaces.before = space$1; + space$1 = ""; + } + lastComment = new _comment$1["default"]({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], + spaces + }); + nodes.push(lastComment); + } + while (++this.position < stopPosition); + if (space$1) { + if (lastComment) lastComment.spaces.after = space$1; + else if (!this.options.lossy) { + var firstToken = this.tokens[startPosition]; + var lastToken = this.tokens[this.position - 1]; + nodes.push(new _string$1["default"]({ + value: "", + source: getSource(firstToken[_tokenize.FIELDS.START_LINE], firstToken[_tokenize.FIELDS.START_COL], lastToken[_tokenize.FIELDS.END_LINE], lastToken[_tokenize.FIELDS.END_COL]), + sourceIndex: firstToken[_tokenize.FIELDS.START_POS], + spaces: { + before: space$1, + after: "" + } + })); + } + } + return nodes; + }; + _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) { + var _this2 = this; + if (requiredSpace === void 0) requiredSpace = false; + var space$1 = ""; + var rawSpace = ""; + nodes.forEach(function(n) { + var spaceBefore = _this2.lossySpace(n.spaces.before, requiredSpace); + var rawSpaceBefore = _this2.lossySpace(n.rawSpaceBefore, requiredSpace); + space$1 += spaceBefore + _this2.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0); + rawSpace += spaceBefore + n.value + _this2.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0); + }); + if (rawSpace === space$1) rawSpace = void 0; + return { + space: space$1, + rawSpace + }; + }; + _proto.isNamedCombinator = function isNamedCombinator(position) { + if (position === void 0) position = this.position; + return this.tokens[position + 0] && this.tokens[position + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][_tokenize.FIELDS.TYPE] === tokens.slash; + }; + _proto.namedCombinator = function namedCombinator() { + if (this.isNamedCombinator()) { + var nameRaw = this.content(this.tokens[this.position + 1]); + var name = (0, _util.unesc)(nameRaw).toLowerCase(); + var raws = {}; + if (name !== nameRaw) raws.value = "/" + nameRaw + "/"; + var node = new _combinator$1["default"]({ + value: "/" + name + "/", + source: getSource(this.currToken[_tokenize.FIELDS.START_LINE], this.currToken[_tokenize.FIELDS.START_COL], this.tokens[this.position + 2][_tokenize.FIELDS.END_LINE], this.tokens[this.position + 2][_tokenize.FIELDS.END_COL]), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], + raws + }); + this.position = this.position + 3; + return node; + } else this.unexpected(); + }; + _proto.combinator = function combinator$2() { + var _this3 = this; + if (this.content() === "|") return this.namespace(); + var nextSigTokenPos = this.locateNextMeaningfulToken(this.position); + if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.comma || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + if (nodes.length > 0) { + var last = this.current.last; + if (last) { + var _this$convertWhitespa = this.convertWhitespaceNodesToSpace(nodes), space$1 = _this$convertWhitespa.space, rawSpace = _this$convertWhitespa.rawSpace; + if (rawSpace !== void 0) last.rawSpaceAfter += rawSpace; + last.spaces.after += space$1; + } else nodes.forEach(function(n) { + return _this3.newNode(n); + }); + } + return; + } + var firstToken = this.currToken; + var spaceOrDescendantSelectorNodes = void 0; + if (nextSigTokenPos > this.position) spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + var node; + if (this.isNamedCombinator()) node = this.namedCombinator(); + else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.combinator) { + node = new _combinator$1["default"]({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS] + }); + this.position++; + } else if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) {} else if (!spaceOrDescendantSelectorNodes) this.unexpected(); + if (node) { + if (spaceOrDescendantSelectorNodes) { + var _this$convertWhitespa2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes), _space = _this$convertWhitespa2.space, _rawSpace = _this$convertWhitespa2.rawSpace; + node.spaces.before = _space; + node.rawSpaceBefore = _rawSpace; + } + } else { + var _this$convertWhitespa3 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true), _space2 = _this$convertWhitespa3.space, _rawSpace2 = _this$convertWhitespa3.rawSpace; + if (!_rawSpace2) _rawSpace2 = _space2; + var spaces = {}; + var raws = { spaces: {} }; + if (_space2.endsWith(" ") && _rawSpace2.endsWith(" ")) { + spaces.before = _space2.slice(0, _space2.length - 1); + raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1); + } else if (_space2.startsWith(" ") && _rawSpace2.startsWith(" ")) { + spaces.after = _space2.slice(1); + raws.spaces.after = _rawSpace2.slice(1); + } else raws.value = _rawSpace2; + node = new _combinator$1["default"]({ + value: " ", + source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]), + sourceIndex: firstToken[_tokenize.FIELDS.START_POS], + spaces, + raws + }); + } + if (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.space) { + node.spaces.after = this.optionalSpace(this.content()); + this.position++; + } + return this.newNode(node); + }; + _proto.comma = function comma$1() { + if (this.position === this.tokens.length - 1) { + this.root.trailingComma = true; + this.position++; + return; + } + this.current._inferEndPosition(); + var selector$1 = new _selector$1["default"]({ + source: { start: tokenStart(this.tokens[this.position + 1]) }, + sourceIndex: this.tokens[this.position + 1][_tokenize.FIELDS.START_POS] + }); + this.current.parent.append(selector$1); + this.current = selector$1; + this.position++; + }; + _proto.comment = function comment$2() { + var current = this.currToken; + this.newNode(new _comment$1["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.error = function error(message, opts) { + throw this.root.error(message, opts); + }; + _proto.missingBackslash = function missingBackslash() { + return this.error("Expected a backslash preceding the semicolon.", { index: this.currToken[_tokenize.FIELDS.START_POS] }); + }; + _proto.missingParenthesis = function missingParenthesis() { + return this.expected("opening parenthesis", this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.missingSquareBracket = function missingSquareBracket() { + return this.expected("opening square bracket", this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.unexpected = function unexpected() { + return this.error("Unexpected '" + this.content() + "'. Escaping special characters with \\ may help.", this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.unexpectedPipe = function unexpectedPipe() { + return this.error("Unexpected '|'.", this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.namespace = function namespace() { + var before = this.prevToken && this.content(this.prevToken) || true; + if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.word) { + this.position++; + return this.word(before); + } else if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.asterisk) { + this.position++; + return this.universal(before); + } + this.unexpectedPipe(); + }; + _proto.nesting = function nesting$1() { + if (this.nextToken) { + if (this.content(this.nextToken) === "|") { + this.position++; + return; + } + } + var current = this.currToken; + this.newNode(new _nesting$1["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.parentheses = function parentheses() { + var last = this.current.last; + var unbalanced = 1; + this.position++; + if (last && last.type === types.PSEUDO) { + var selector$1 = new _selector$1["default"]({ + source: { start: tokenStart(this.tokens[this.position]) }, + sourceIndex: this.tokens[this.position][_tokenize.FIELDS.START_POS] + }); + var cache = this.current; + last.append(selector$1); + this.current = selector$1; + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) unbalanced++; + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) unbalanced--; + if (unbalanced) this.parse(); + else { + this.current.source.end = tokenEnd(this.currToken); + this.current.parent.source.end = tokenEnd(this.currToken); + this.position++; + } + } + this.current = cache; + } else { + var parenStart = this.currToken; + var parenValue = "("; + var parenEnd; + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) unbalanced++; + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) unbalanced--; + parenEnd = this.currToken; + parenValue += this.parseParenthesisToken(this.currToken); + this.position++; + } + if (last) last.appendToPropertyAndEscape("value", parenValue, parenValue); + else this.newNode(new _string$1["default"]({ + value: parenValue, + source: getSource(parenStart[_tokenize.FIELDS.START_LINE], parenStart[_tokenize.FIELDS.START_COL], parenEnd[_tokenize.FIELDS.END_LINE], parenEnd[_tokenize.FIELDS.END_COL]), + sourceIndex: parenStart[_tokenize.FIELDS.START_POS] + })); + } + if (unbalanced) return this.expected("closing parenthesis", this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.pseudo = function pseudo$1() { + var _this4 = this; + var pseudoStr = ""; + var startingToken = this.currToken; + while (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.colon) { + pseudoStr += this.content(); + this.position++; + } + if (!this.currToken) return this.expected(["pseudo-class", "pseudo-element"], this.position - 1); + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.word) this.splitWord(false, function(first, length) { + pseudoStr += first; + _this4.newNode(new _pseudo$1["default"]({ + value: pseudoStr, + source: getTokenSourceSpan(startingToken, _this4.currToken), + sourceIndex: startingToken[_tokenize.FIELDS.START_POS] + })); + if (length > 1 && _this4.nextToken && _this4.nextToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) _this4.error("Misplaced parenthesis.", { index: _this4.nextToken[_tokenize.FIELDS.START_POS] }); + }); + else return this.expected(["pseudo-class", "pseudo-element"], this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.space = function space$1() { + var content = this.content(); + if (this.position === 0 || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function(node) { + return node.type === "comment"; + })) { + this.spaces = this.optionalSpace(content); + this.position++; + } else if (this.position === this.tokens.length - 1 || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + this.current.last.spaces.after = this.optionalSpace(content); + this.position++; + } else this.combinator(); + }; + _proto.string = function string$1() { + var current = this.currToken; + this.newNode(new _string$1["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.universal = function universal$1(namespace) { + var nextToken = this.nextToken; + if (nextToken && this.content(nextToken) === "|") { + this.position++; + return this.namespace(); + } + var current = this.currToken; + this.newNode(new _universal$1["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + }), namespace); + this.position++; + }; + _proto.splitWord = function splitWord(namespace, firstCallback) { + var _this5 = this; + var nextToken = this.nextToken; + var word$1 = this.content(); + while (nextToken && ~[ + tokens.dollar, + tokens.caret, + tokens.equals, + tokens.word + ].indexOf(nextToken[_tokenize.FIELDS.TYPE])) { + this.position++; + var current = this.content(); + word$1 += current; + if (current.lastIndexOf("\\") === current.length - 1) { + var next = this.nextToken; + if (next && next[_tokenize.FIELDS.TYPE] === tokens.space) { + word$1 += this.requiredSpace(this.content(next)); + this.position++; + } + } + nextToken = this.nextToken; + } + var hasClass = indexesOf(word$1, ".").filter(function(i$1) { + var escapedDot = word$1[i$1 - 1] === "\\"; + var isKeyframesPercent = /^\d+\.\d+%$/.test(word$1); + return !escapedDot && !isKeyframesPercent; + }); + var hasId = indexesOf(word$1, "#").filter(function(i$1) { + return word$1[i$1 - 1] !== "\\"; + }); + var interpolations = indexesOf(word$1, "#{"); + if (interpolations.length) hasId = hasId.filter(function(hashIndex) { + return !~interpolations.indexOf(hashIndex); + }); + var indices = (0, _sortAscending["default"])(uniqs([0].concat(hasClass, hasId))); + indices.forEach(function(ind, i$1) { + var index = indices[i$1 + 1] || word$1.length; + var value = word$1.slice(ind, index); + if (i$1 === 0 && firstCallback) return firstCallback.call(_this5, value, indices.length); + var node; + var current$1 = _this5.currToken; + var sourceIndex = current$1[_tokenize.FIELDS.START_POS] + indices[i$1]; + var source = getSource(current$1[1], current$1[2] + ind, current$1[3], current$1[2] + (index - 1)); + if (~hasClass.indexOf(ind)) { + var classNameOpts = { + value: value.slice(1), + source, + sourceIndex + }; + node = new _className$1["default"](unescapeProp(classNameOpts, "value")); + } else if (~hasId.indexOf(ind)) { + var idOpts = { + value: value.slice(1), + source, + sourceIndex + }; + node = new _id$1["default"](unescapeProp(idOpts, "value")); + } else { + var tagOpts = { + value, + source, + sourceIndex + }; + unescapeProp(tagOpts, "value"); + node = new _tag$1["default"](tagOpts); + } + _this5.newNode(node, namespace); + namespace = null; + }); + this.position++; + }; + _proto.word = function word$1(namespace) { + var nextToken = this.nextToken; + if (nextToken && this.content(nextToken) === "|") { + this.position++; + return this.namespace(); + } + return this.splitWord(namespace); + }; + _proto.loop = function loop() { + while (this.position < this.tokens.length) this.parse(true); + this.current._inferEndPosition(); + return this.root; + }; + _proto.parse = function parse(throwOnParenthesis) { + switch (this.currToken[_tokenize.FIELDS.TYPE]) { + case tokens.space: + this.space(); + break; + case tokens.comment: + this.comment(); + break; + case tokens.openParenthesis: + this.parentheses(); + break; + case tokens.closeParenthesis: + if (throwOnParenthesis) this.missingParenthesis(); + break; + case tokens.openSquare: + this.attribute(); + break; + case tokens.dollar: + case tokens.caret: + case tokens.equals: + case tokens.word: + this.word(); + break; + case tokens.colon: + this.pseudo(); + break; + case tokens.comma: + this.comma(); + break; + case tokens.asterisk: + this.universal(); + break; + case tokens.ampersand: + this.nesting(); + break; + case tokens.slash: + case tokens.combinator: + this.combinator(); + break; + case tokens.str: + this.string(); + break; + case tokens.closeSquare: this.missingSquareBracket(); + case tokens.semicolon: this.missingBackslash(); + default: this.unexpected(); + } + }; + _proto.expected = function expected(description, index, found) { + if (Array.isArray(description)) { + var last = description.pop(); + description = description.join(", ") + " or " + last; + } + var an = /^[aeiou]/.test(description[0]) ? "an" : "a"; + if (!found) return this.error("Expected " + an + " " + description + ".", { index }); + return this.error("Expected " + an + " " + description + ", found \"" + found + "\" instead.", { index }); + }; + _proto.requiredSpace = function requiredSpace(space$1) { + return this.options.lossy ? " " : space$1; + }; + _proto.optionalSpace = function optionalSpace(space$1) { + return this.options.lossy ? "" : space$1; + }; + _proto.lossySpace = function lossySpace(space$1, required) { + if (this.options.lossy) return required ? " " : ""; + else return space$1; + }; + _proto.parseParenthesisToken = function parseParenthesisToken(token) { + var content = this.content(token); + if (token[_tokenize.FIELDS.TYPE] === tokens.space) return this.requiredSpace(content); + else return content; + }; + _proto.newNode = function newNode(node, namespace) { + if (namespace) { + if (/^ +$/.test(namespace)) { + if (!this.options.lossy) this.spaces = (this.spaces || "") + namespace; + namespace = true; + } + node.namespace = namespace; + unescapeProp(node, "namespace"); + } + if (this.spaces) { + node.spaces.before = this.spaces; + this.spaces = ""; + } + return this.current.append(node); + }; + _proto.content = function content(token) { + if (token === void 0) token = this.currToken; + return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]); + }; + /** + * returns the index of the next non-whitespace, non-comment token. + * returns -1 if no meaningful token is found. + */ + _proto.locateNextMeaningfulToken = function locateNextMeaningfulToken(startPosition) { + if (startPosition === void 0) startPosition = this.position + 1; + var searchPosition = startPosition; + while (searchPosition < this.tokens.length) if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][_tokenize.FIELDS.TYPE]]) { + searchPosition++; + continue; + } else return searchPosition; + return -1; + }; + _createClass(Parser$2, [ + { + key: "currToken", + get: function get() { + return this.tokens[this.position]; + } + }, + { + key: "nextToken", + get: function get() { + return this.tokens[this.position + 1]; + } + }, + { + key: "prevToken", + get: function get() { + return this.tokens[this.position - 1]; + } + } + ]); + return Parser$2; + }(); + exports["default"] = Parser; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/processor.js +var require_processor = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _parser = _interopRequireDefault$4(require_parser()); + function _interopRequireDefault$4(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + var Processor = /* @__PURE__ */ function() { + function Processor$1(func, options) { + this.func = func || function noop() {}; + this.funcRes = null; + this.options = options; + } + var _proto = Processor$1.prototype; + _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule, options) { + if (options === void 0) options = {}; + if (Object.assign({}, this.options, options).updateSelector === false) return false; + else return typeof rule !== "string"; + }; + _proto._isLossy = function _isLossy(options) { + if (options === void 0) options = {}; + if (Object.assign({}, this.options, options).lossless === false) return true; + else return false; + }; + _proto._root = function _root$2(rule, options) { + if (options === void 0) options = {}; + return new _parser["default"](rule, this._parseOptions(options)).root; + }; + _proto._parseOptions = function _parseOptions(options) { + return { lossy: this._isLossy(options) }; + }; + _proto._run = function _run(rule, options) { + var _this = this; + if (options === void 0) options = {}; + return new Promise(function(resolve, reject) { + try { + var root$2 = _this._root(rule, options); + Promise.resolve(_this.func(root$2)).then(function(transform) { + var string$1 = void 0; + if (_this._shouldUpdateSelector(rule, options)) { + string$1 = root$2.toString(); + rule.selector = string$1; + } + return { + transform, + root: root$2, + string: string$1 + }; + }).then(resolve, reject); + } catch (e) { + reject(e); + return; + } + }); + }; + _proto._runSync = function _runSync(rule, options) { + if (options === void 0) options = {}; + var root$2 = this._root(rule, options); + var transform = this.func(root$2); + if (transform && typeof transform.then === "function") throw new Error("Selector processor returned a promise to a synchronous call."); + var string$1 = void 0; + if (options.updateSelector && typeof rule !== "string") { + string$1 = root$2.toString(); + rule.selector = string$1; + } + return { + transform, + root: root$2, + string: string$1 + }; + }; + _proto.ast = function ast(rule, options) { + return this._run(rule, options).then(function(result) { + return result.root; + }); + }; + _proto.astSync = function astSync(rule, options) { + return this._runSync(rule, options).root; + }; + _proto.transform = function transform(rule, options) { + return this._run(rule, options).then(function(result) { + return result.transform; + }); + }; + _proto.transformSync = function transformSync(rule, options) { + return this._runSync(rule, options).transform; + }; + _proto.process = function process$1(rule, options) { + return this._run(rule, options).then(function(result) { + return result.string || result.root.toString(); + }); + }; + _proto.processSync = function processSync(rule, options) { + var result = this._runSync(rule, options); + return result.string || result.root.toString(); + }; + return Processor$1; + }(); + exports["default"] = Processor; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/constructors.js +var require_constructors = /* @__PURE__ */ __commonJSMin(((exports) => { + exports.__esModule = true; + exports.universal = exports.tag = exports.string = exports.selector = exports.root = exports.pseudo = exports.nesting = exports.id = exports.comment = exports.combinator = exports.className = exports.attribute = void 0; + var _attribute = _interopRequireDefault$3(require_attribute()); + var _className = _interopRequireDefault$3(require_className()); + var _combinator = _interopRequireDefault$3(require_combinator()); + var _comment = _interopRequireDefault$3(require_comment()); + var _id = _interopRequireDefault$3(require_id()); + var _nesting = _interopRequireDefault$3(require_nesting()); + var _pseudo = _interopRequireDefault$3(require_pseudo()); + var _root = _interopRequireDefault$3(require_root()); + var _selector = _interopRequireDefault$3(require_selector()); + var _string = _interopRequireDefault$3(require_string()); + var _tag = _interopRequireDefault$3(require_tag()); + var _universal = _interopRequireDefault$3(require_universal()); + function _interopRequireDefault$3(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + var attribute = function attribute$1(opts) { + return new _attribute["default"](opts); + }; + exports.attribute = attribute; + var className = function className$1(opts) { + return new _className["default"](opts); + }; + exports.className = className; + var combinator = function combinator$2(opts) { + return new _combinator["default"](opts); + }; + exports.combinator = combinator; + var comment = function comment$2(opts) { + return new _comment["default"](opts); + }; + exports.comment = comment; + var id = function id$1(opts) { + return new _id["default"](opts); + }; + exports.id = id; + var nesting = function nesting$1(opts) { + return new _nesting["default"](opts); + }; + exports.nesting = nesting; + var pseudo = function pseudo$1(opts) { + return new _pseudo["default"](opts); + }; + exports.pseudo = pseudo; + var root = function root$2(opts) { + return new _root["default"](opts); + }; + exports.root = root; + var selector = function selector$1(opts) { + return new _selector["default"](opts); + }; + exports.selector = selector; + var string = function string$1(opts) { + return new _string["default"](opts); + }; + exports.string = string; + var tag = function tag$1(opts) { + return new _tag["default"](opts); + }; + exports.tag = tag; + var universal = function universal$1(opts) { + return new _universal["default"](opts); + }; + exports.universal = universal; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/guards.js +var require_guards = /* @__PURE__ */ __commonJSMin(((exports) => { + exports.__esModule = true; + exports.isComment = exports.isCombinator = exports.isClassName = exports.isAttribute = void 0; + exports.isContainer = isContainer; + exports.isIdentifier = void 0; + exports.isNamespace = isNamespace; + exports.isNesting = void 0; + exports.isNode = isNode; + exports.isPseudo = void 0; + exports.isPseudoClass = isPseudoClass; + exports.isPseudoElement = isPseudoElement; + exports.isUniversal = exports.isTag = exports.isString = exports.isSelector = exports.isRoot = void 0; + var _types$1 = require_types(); + var _IS_TYPE; + var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types$1.ATTRIBUTE] = true, _IS_TYPE[_types$1.CLASS] = true, _IS_TYPE[_types$1.COMBINATOR] = true, _IS_TYPE[_types$1.COMMENT] = true, _IS_TYPE[_types$1.ID] = true, _IS_TYPE[_types$1.NESTING] = true, _IS_TYPE[_types$1.PSEUDO] = true, _IS_TYPE[_types$1.ROOT] = true, _IS_TYPE[_types$1.SELECTOR] = true, _IS_TYPE[_types$1.STRING] = true, _IS_TYPE[_types$1.TAG] = true, _IS_TYPE[_types$1.UNIVERSAL] = true, _IS_TYPE); + function isNode(node) { + return typeof node === "object" && IS_TYPE[node.type]; + } + function isNodeType(type, node) { + return isNode(node) && node.type === type; + } + var isAttribute = isNodeType.bind(null, _types$1.ATTRIBUTE); + exports.isAttribute = isAttribute; + var isClassName = isNodeType.bind(null, _types$1.CLASS); + exports.isClassName = isClassName; + var isCombinator = isNodeType.bind(null, _types$1.COMBINATOR); + exports.isCombinator = isCombinator; + var isComment = isNodeType.bind(null, _types$1.COMMENT); + exports.isComment = isComment; + var isIdentifier = isNodeType.bind(null, _types$1.ID); + exports.isIdentifier = isIdentifier; + var isNesting = isNodeType.bind(null, _types$1.NESTING); + exports.isNesting = isNesting; + var isPseudo = isNodeType.bind(null, _types$1.PSEUDO); + exports.isPseudo = isPseudo; + var isRoot = isNodeType.bind(null, _types$1.ROOT); + exports.isRoot = isRoot; + var isSelector = isNodeType.bind(null, _types$1.SELECTOR); + exports.isSelector = isSelector; + var isString = isNodeType.bind(null, _types$1.STRING); + exports.isString = isString; + var isTag = isNodeType.bind(null, _types$1.TAG); + exports.isTag = isTag; + var isUniversal = isNodeType.bind(null, _types$1.UNIVERSAL); + exports.isUniversal = isUniversal; + function isPseudoElement(node) { + return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after" || node.value.toLowerCase() === ":first-letter" || node.value.toLowerCase() === ":first-line"); + } + function isPseudoClass(node) { + return isPseudo(node) && !isPseudoElement(node); + } + function isContainer(node) { + return !!(isNode(node) && node.walk); + } + function isNamespace(node) { + return isAttribute(node) || isTag(node); + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/selectors/index.js +var require_selectors = /* @__PURE__ */ __commonJSMin(((exports) => { + exports.__esModule = true; + var _types = require_types(); + Object.keys(_types).forEach(function(key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _types[key]) return; + exports[key] = _types[key]; + }); + var _constructors = require_constructors(); + Object.keys(_constructors).forEach(function(key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _constructors[key]) return; + exports[key] = _constructors[key]; + }); + var _guards = require_guards(); + Object.keys(_guards).forEach(function(key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _guards[key]) return; + exports[key] = _guards[key]; + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-selector-parser@7.1.0/node_modules/postcss-selector-parser/dist/index.js +var require_dist = /* @__PURE__ */ __commonJSMin(((exports, module) => { + exports.__esModule = true; + exports["default"] = void 0; + var _processor = _interopRequireDefault$2(require_processor()); + var selectors = _interopRequireWildcard(require_selectors()); + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = /* @__PURE__ */ new WeakMap(); + var cacheNodeInterop = /* @__PURE__ */ new WeakMap(); + return (_getRequireWildcardCache = function _getRequireWildcardCache$4(nodeInterop$1) { + return nodeInterop$1 ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) return obj; + if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { "default": obj }; + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) return cache.get(obj); + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); + else newObj[key] = obj[key]; + } + newObj["default"] = obj; + if (cache) cache.set(obj, newObj); + return newObj; + } + function _interopRequireDefault$2(obj) { + return obj && obj.__esModule ? obj : { "default": obj }; + } + var parser = function parser$1(processor) { + return new _processor["default"](processor); + }; + Object.assign(parser, selectors); + var _default = parser; + exports["default"] = _default; + module.exports = exports.default; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-modules-local-by-default@4.2.0_postcss@8.5.6/node_modules/postcss-modules-local-by-default/src/index.js +var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const selectorParser$1 = require_dist(); + const valueParser = require_lib(); + const { extractICSS } = require_src$4(); + const IGNORE_FILE_MARKER = "cssmodules-pure-no-check"; + const IGNORE_NEXT_LINE_MARKER = "cssmodules-pure-ignore"; + const isSpacing = (node) => node.type === "combinator" && node.value === " "; + const isPureCheckDisabled = (root$2) => { + for (const node of root$2.nodes) { + if (node.type !== "comment") return false; + if (node.text.trim().startsWith(IGNORE_FILE_MARKER)) return true; + } + return false; + }; + function getIgnoreComment(node) { + if (!node.parent) return; + const indexInParent = node.parent.index(node); + for (let i$1 = indexInParent - 1; i$1 >= 0; i$1--) { + const prevNode = node.parent.nodes[i$1]; + if (prevNode.type === "comment") { + if (prevNode.text.trimStart().startsWith(IGNORE_NEXT_LINE_MARKER)) return prevNode; + } else break; + } + } + function normalizeNodeArray(nodes) { + const array = []; + nodes.forEach((x) => { + if (Array.isArray(x)) normalizeNodeArray(x).forEach((item) => { + array.push(item); + }); + else if (x) array.push(x); + }); + if (array.length > 0 && isSpacing(array[array.length - 1])) array.pop(); + return array; + } + const isPureSelectorSymbol = Symbol("is-pure-selector"); + function localizeNode(rule, mode, localAliasMap) { + const transform = (node, context) => { + if (context.ignoreNextSpacing && !isSpacing(node)) throw new Error("Missing whitespace after " + context.ignoreNextSpacing); + if (context.enforceNoSpacing && isSpacing(node)) throw new Error("Missing whitespace before " + context.enforceNoSpacing); + let newNodes; + switch (node.type) { + case "root": { + let resultingGlobal; + context.hasPureGlobals = false; + newNodes = node.nodes.map((n) => { + const nContext = { + global: context.global, + lastWasSpacing: true, + hasLocals: false, + explicit: false + }; + n = transform(n, nContext); + if (typeof resultingGlobal === "undefined") resultingGlobal = nContext.global; + else if (resultingGlobal !== nContext.global) throw new Error("Inconsistent rule global/local result in rule \"" + node + "\" (multiple selectors must result in the same mode for the rule)"); + if (!nContext.hasLocals) context.hasPureGlobals = true; + return n; + }); + context.global = resultingGlobal; + node.nodes = normalizeNodeArray(newNodes); + break; + } + case "selector": + newNodes = node.map((childNode) => transform(childNode, context)); + node = node.clone(); + node.nodes = normalizeNodeArray(newNodes); + break; + case "combinator": + if (isSpacing(node)) { + if (context.ignoreNextSpacing) { + context.ignoreNextSpacing = false; + context.lastWasSpacing = false; + context.enforceNoSpacing = false; + return null; + } + context.lastWasSpacing = true; + return node; + } + break; + case "pseudo": { + let childContext; + const isNested = !!node.length; + const isScoped = node.value === ":local" || node.value === ":global"; + if (node.value === ":import" || node.value === ":export") context.hasLocals = true; + else if (isNested) { + if (isScoped) { + if (node.nodes.length === 0) throw new Error(`${node.value}() can't be empty`); + if (context.inside) throw new Error(`A ${node.value} is not allowed inside of a ${context.inside}(...)`); + childContext = { + global: node.value === ":global", + inside: node.value, + hasLocals: false, + explicit: true + }; + newNodes = node.map((childNode) => transform(childNode, childContext)).reduce((acc, next) => acc.concat(next.nodes), []); + if (newNodes.length) { + const { before, after } = node.spaces; + const first = newNodes[0]; + const last = newNodes[newNodes.length - 1]; + first.spaces = { + before, + after: first.spaces.after + }; + last.spaces = { + before: last.spaces.before, + after + }; + } + node = newNodes; + break; + } else { + childContext = { + global: context.global, + inside: context.inside, + lastWasSpacing: true, + hasLocals: false, + explicit: context.explicit + }; + newNodes = node.map((childNode) => { + const newContext = { + ...childContext, + enforceNoSpacing: false + }; + const result = transform(childNode, newContext); + childContext.global = newContext.global; + childContext.hasLocals = newContext.hasLocals; + return result; + }); + node = node.clone(); + node.nodes = normalizeNodeArray(newNodes); + if (childContext.hasLocals) context.hasLocals = true; + } + break; + } else if (isScoped) { + if (context.inside) throw new Error(`A ${node.value} is not allowed inside of a ${context.inside}(...)`); + const addBackSpacing = !!node.spaces.before; + context.ignoreNextSpacing = context.lastWasSpacing ? node.value : false; + context.enforceNoSpacing = context.lastWasSpacing ? false : node.value; + context.global = node.value === ":global"; + context.explicit = true; + return addBackSpacing ? selectorParser$1.combinator({ value: " " }) : null; + } + break; + } + case "id": + case "class": { + if (!node.value) throw new Error("Invalid class or id selector syntax"); + if (context.global) break; + const isImportedValue = localAliasMap.has(node.value); + if (!isImportedValue || isImportedValue && context.explicit) { + const innerNode = node.clone(); + innerNode.spaces = { + before: "", + after: "" + }; + node = selectorParser$1.pseudo({ + value: ":local", + nodes: [innerNode], + spaces: node.spaces + }); + context.hasLocals = true; + } + break; + } + case "nesting": if (node.value === "&") context.hasLocals = rule.parent[isPureSelectorSymbol]; + } + context.lastWasSpacing = false; + context.ignoreNextSpacing = false; + context.enforceNoSpacing = false; + return node; + }; + const rootContext = { + global: mode === "global", + hasPureGlobals: false + }; + rootContext.selector = selectorParser$1((root$2) => { + transform(root$2, rootContext); + }).processSync(rule, { + updateSelector: false, + lossless: true + }); + return rootContext; + } + function localizeDeclNode(node, context) { + switch (node.type) { + case "word": + if (context.localizeNextItem) { + if (!context.localAliasMap.has(node.value)) { + node.value = ":local(" + node.value + ")"; + context.localizeNextItem = false; + } + } + break; + case "function": + if (context.options && context.options.rewriteUrl && node.value.toLowerCase() === "url") node.nodes.map((nestedNode) => { + if (nestedNode.type !== "string" && nestedNode.type !== "word") return; + let newUrl = context.options.rewriteUrl(context.global, nestedNode.value); + switch (nestedNode.type) { + case "string": + if (nestedNode.quote === "'") newUrl = newUrl.replace(/(\\)/g, "\\$1").replace(/'/g, "\\'"); + if (nestedNode.quote === "\"") newUrl = newUrl.replace(/(\\)/g, "\\$1").replace(/"/g, "\\\""); + break; + case "word": + newUrl = newUrl.replace(/("|'|\)|\\)/g, "\\$1"); + break; + } + nestedNode.value = newUrl; + }); + break; + } + return node; + } + const specialKeywords = [ + "none", + "inherit", + "initial", + "revert", + "revert-layer", + "unset" + ]; + function localizeDeclarationValues(localize, declaration, context) { + const valueNodes = valueParser(declaration.value); + valueNodes.walk((node, index, nodes) => { + if (node.type === "function" && (node.value.toLowerCase() === "var" || node.value.toLowerCase() === "env")) return false; + if (node.type === "word" && specialKeywords.includes(node.value.toLowerCase())) return; + nodes[index] = localizeDeclNode(node, { + options: context.options, + global: context.global, + localizeNextItem: localize && !context.global, + localAliasMap: context.localAliasMap + }); + }); + declaration.value = valueNodes.toString(); + } + const validIdent = /^-?([a-z\u0080-\uFFFF_]|(\\[^\r\n\f])|-(?![0-9]))((\\[^\r\n\f])|[a-z\u0080-\uFFFF_0-9-])*$/i; + const animationKeywords = { + $normal: 1, + $reverse: 1, + $alternate: 1, + "$alternate-reverse": 1, + $forwards: 1, + $backwards: 1, + $both: 1, + $infinite: 1, + $paused: 1, + $running: 1, + $ease: 1, + "$ease-in": 1, + "$ease-out": 1, + "$ease-in-out": 1, + $linear: 1, + "$step-end": 1, + "$step-start": 1, + $none: Infinity, + $initial: Infinity, + $inherit: Infinity, + $unset: Infinity, + $revert: Infinity, + "$revert-layer": Infinity + }; + function localizeDeclaration(declaration, context) { + if (/animation(-name)?$/i.test(declaration.prop)) { + let parsedAnimationKeywords = {}; + declaration.value = valueParser(declaration.value).walk((node) => { + if (node.type === "div") { + parsedAnimationKeywords = {}; + return; + } else if (node.type === "function" && node.value.toLowerCase() === "local" && node.nodes.length === 1) { + node.type = "word"; + node.value = node.nodes[0].value; + return localizeDeclNode(node, { + options: context.options, + global: context.global, + localizeNextItem: true, + localAliasMap: context.localAliasMap + }); + } else if (node.type === "function") { + if (node.value.toLowerCase() === "global" && node.nodes.length === 1) { + node.type = "word"; + node.value = node.nodes[0].value; + } + return false; + } else if (node.type !== "word") return; + const value = node.type === "word" ? node.value.toLowerCase() : null; + let shouldParseAnimationName = false; + if (value && validIdent.test(value)) if ("$" + value in animationKeywords) { + parsedAnimationKeywords["$" + value] = "$" + value in parsedAnimationKeywords ? parsedAnimationKeywords["$" + value] + 1 : 0; + shouldParseAnimationName = parsedAnimationKeywords["$" + value] >= animationKeywords["$" + value]; + } else shouldParseAnimationName = true; + return localizeDeclNode(node, { + options: context.options, + global: context.global, + localizeNextItem: shouldParseAnimationName && !context.global, + localAliasMap: context.localAliasMap + }); + }).toString(); + return; + } + if (/url\(/i.test(declaration.value)) return localizeDeclarationValues(false, declaration, context); + } + const isPureSelector = (context, rule) => { + if (!rule.parent || rule.type === "root") return !context.hasPureGlobals; + if (rule.type === "rule" && rule[isPureSelectorSymbol]) return rule[isPureSelectorSymbol] || isPureSelector(context, rule.parent); + return !context.hasPureGlobals || isPureSelector(context, rule.parent); + }; + const isNodeWithoutDeclarations = (rule) => { + if (rule.nodes.length > 0) return !rule.nodes.every((item) => item.type === "rule" || item.type === "atrule" && !isNodeWithoutDeclarations(item)); + return true; + }; + module.exports = (options = {}) => { + if (options && options.mode && options.mode !== "global" && options.mode !== "local" && options.mode !== "pure") throw new Error("options.mode must be either \"global\", \"local\" or \"pure\" (default \"local\")"); + const pureMode = options && options.mode === "pure"; + const globalMode = options && options.mode === "global"; + return { + postcssPlugin: "postcss-modules-local-by-default", + prepare() { + const localAliasMap = /* @__PURE__ */ new Map(); + return { Once(root$2) { + const { icssImports } = extractICSS(root$2, false); + const enforcePureMode = pureMode && !isPureCheckDisabled(root$2); + Object.keys(icssImports).forEach((key) => { + Object.keys(icssImports[key]).forEach((prop) => { + localAliasMap.set(prop, icssImports[key][prop]); + }); + }); + root$2.walkAtRules((atRule) => { + if (/keyframes$/i.test(atRule.name)) { + const globalMatch = /^\s*:global\s*\((.+)\)\s*$/.exec(atRule.params); + const localMatch = /^\s*:local\s*\((.+)\)\s*$/.exec(atRule.params); + let globalKeyframes = globalMode; + if (globalMatch) { + if (enforcePureMode) { + const ignoreComment = getIgnoreComment(atRule); + if (!ignoreComment) throw atRule.error("@keyframes :global(...) is not allowed in pure mode"); + else ignoreComment.remove(); + } + atRule.params = globalMatch[1]; + globalKeyframes = true; + } else if (localMatch) { + atRule.params = localMatch[0]; + globalKeyframes = false; + } else if (atRule.params && !globalMode && !localAliasMap.has(atRule.params)) atRule.params = ":local(" + atRule.params + ")"; + atRule.walkDecls((declaration) => { + localizeDeclaration(declaration, { + localAliasMap, + options, + global: globalKeyframes + }); + }); + } else if (/scope$/i.test(atRule.name)) { + if (atRule.params) { + const ignoreComment = pureMode ? getIgnoreComment(atRule) : void 0; + if (ignoreComment) ignoreComment.remove(); + atRule.params = atRule.params.split("to").map((item) => { + const selector$1 = item.trim().slice(1, -1).trim(); + const context = localizeNode(selector$1, options.mode, localAliasMap); + context.options = options; + context.localAliasMap = localAliasMap; + if (enforcePureMode && context.hasPureGlobals && !ignoreComment) throw atRule.error("Selector in at-rule\"" + selector$1 + "\" is not pure (pure selectors must contain at least one local class or id)"); + return `(${context.selector})`; + }).join(" to "); + } + atRule.nodes.forEach((declaration) => { + if (declaration.type === "decl") localizeDeclaration(declaration, { + localAliasMap, + options, + global: globalMode + }); + }); + } else if (atRule.nodes) atRule.nodes.forEach((declaration) => { + if (declaration.type === "decl") localizeDeclaration(declaration, { + localAliasMap, + options, + global: globalMode + }); + }); + }); + root$2.walkRules((rule) => { + if (rule.parent && rule.parent.type === "atrule" && /keyframes$/i.test(rule.parent.name)) return; + const context = localizeNode(rule, options.mode, localAliasMap); + context.options = options; + context.localAliasMap = localAliasMap; + const ignoreComment = enforcePureMode ? getIgnoreComment(rule) : void 0; + const isNotPure = enforcePureMode && !isPureSelector(context, rule); + if (isNotPure && isNodeWithoutDeclarations(rule) && !ignoreComment) throw rule.error("Selector \"" + rule.selector + "\" is not pure (pure selectors must contain at least one local class or id)"); + else if (ignoreComment) ignoreComment.remove(); + if (pureMode) rule[isPureSelectorSymbol] = !isNotPure; + rule.selector = context.selector; + if (rule.nodes) rule.nodes.forEach((declaration) => localizeDeclaration(declaration, context)); + }); + } }; + } + }; + }; + module.exports.postcss = true; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-modules-scope@3.2.1_postcss@8.5.6/node_modules/postcss-modules-scope/src/index.js +var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const selectorParser = require_dist(); + const hasOwnProperty = Object.prototype.hasOwnProperty; + function isNestedRule(rule) { + if (!rule.parent || rule.parent.type === "root") return false; + if (rule.parent.type === "rule") return true; + return isNestedRule(rule.parent); + } + function getSingleLocalNamesForComposes(root$2, rule) { + if (isNestedRule(rule)) throw new Error(`composition is not allowed in nested rule \n\n${rule}`); + return root$2.nodes.map((node) => { + if (node.type !== "selector" || node.nodes.length !== 1) throw new Error(`composition is only allowed when selector is single :local class name not in "${root$2}"`); + node = node.nodes[0]; + if (node.type !== "pseudo" || node.value !== ":local" || node.nodes.length !== 1) throw new Error("composition is only allowed when selector is single :local class name not in \"" + root$2 + "\", \"" + node + "\" is weird"); + node = node.first; + if (node.type !== "selector" || node.length !== 1) throw new Error("composition is only allowed when selector is single :local class name not in \"" + root$2 + "\", \"" + node + "\" is weird"); + node = node.first; + if (node.type !== "class") throw new Error("composition is only allowed when selector is single :local class name not in \"" + root$2 + "\", \"" + node + "\" is weird"); + return node.value; + }); + } + const unescapeRegExp = new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)", "ig"); + function unescape(str$1) { + return str$1.replace(unescapeRegExp, (_, escaped, escapedWhitespace) => { + const high = "0x" + escaped - 65536; + return high !== high || escapedWhitespace ? escaped : high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320); + }); + } + const plugin = (options = {}) => { + const generateScopedName = options && options.generateScopedName || plugin.generateScopedName; + const generateExportEntry = options && options.generateExportEntry || plugin.generateExportEntry; + const exportGlobals = options && options.exportGlobals; + return { + postcssPlugin: "postcss-modules-scope", + Once(root$2, { rule }) { + const exports$1 = Object.create(null); + function exportScopedName(name, rawName, node) { + const scopedName = generateScopedName(rawName ? rawName : name, root$2.source.input.from, root$2.source.input.css, node); + const { key, value } = generateExportEntry(rawName ? rawName : name, scopedName, root$2.source.input.from, root$2.source.input.css, node); + exports$1[key] = exports$1[key] || []; + if (exports$1[key].indexOf(value) < 0) exports$1[key].push(value); + return scopedName; + } + function localizeNode$1(node) { + switch (node.type) { + case "selector": + node.nodes = node.map((item) => localizeNode$1(item)); + return node; + case "class": return selectorParser.className({ value: exportScopedName(node.value, node.raws && node.raws.value ? node.raws.value : null, node) }); + case "id": return selectorParser.id({ value: exportScopedName(node.value, node.raws && node.raws.value ? node.raws.value : null, node) }); + case "attribute": if (node.attribute === "class" && node.operator === "=") return selectorParser.attribute({ + attribute: node.attribute, + operator: node.operator, + quoteMark: "'", + value: exportScopedName(node.value, null, null) + }); + } + throw new Error(`${node.type} ("${node}") is not allowed in a :local block`); + } + function traverseNode(node) { + switch (node.type) { + case "pseudo": if (node.value === ":local") { + if (node.nodes.length !== 1) throw new Error("Unexpected comma (\",\") in :local block"); + const selector$1 = localizeNode$1(node.first); + selector$1.first.spaces = node.spaces; + const nextNode = node.next(); + if (nextNode && nextNode.type === "combinator" && nextNode.value === " " && /\\[A-F0-9]{1,6}$/.test(selector$1.last.value)) selector$1.last.spaces.after = " "; + node.replaceWith(selector$1); + return; + } + case "root": + case "selector": + node.each((item) => traverseNode(item)); + break; + case "id": + case "class": + if (exportGlobals) exports$1[node.value] = [node.value]; + break; + } + return node; + } + const importedNames = {}; + root$2.walkRules(/^:import\(.+\)$/, (rule$1) => { + rule$1.walkDecls((decl) => { + importedNames[decl.prop] = true; + }); + }); + root$2.walkRules((rule$1) => { + let parsedSelector = selectorParser().astSync(rule$1); + rule$1.selector = traverseNode(parsedSelector.clone()).toString(); + rule$1.walkDecls(/^(composes|compose-with)$/i, (decl) => { + const localNames = getSingleLocalNamesForComposes(parsedSelector, decl.parent); + decl.value.split(",").forEach((value) => { + value.trim().split(/\s+/).forEach((className$1) => { + const global$1 = /^global\(([^)]+)\)$/.exec(className$1); + if (global$1) localNames.forEach((exportedName) => { + exports$1[exportedName].push(global$1[1]); + }); + else if (hasOwnProperty.call(importedNames, className$1)) localNames.forEach((exportedName) => { + exports$1[exportedName].push(className$1); + }); + else if (hasOwnProperty.call(exports$1, className$1)) localNames.forEach((exportedName) => { + exports$1[className$1].forEach((item) => { + exports$1[exportedName].push(item); + }); + }); + else throw decl.error(`referenced class name "${className$1}" in ${decl.prop} not found`); + }); + }); + decl.remove(); + }); + rule$1.walkDecls((decl) => { + if (!/:local\s*\((.+?)\)/.test(decl.value)) return; + let tokens$1 = decl.value.split(/(,|'[^']*'|"[^"]*")/); + tokens$1 = tokens$1.map((token, idx) => { + if (idx === 0 || tokens$1[idx - 1] === ",") { + let result = token; + const localMatch = /:local\s*\((.+?)\)/.exec(token); + if (localMatch) { + const input = localMatch.input; + const matchPattern = localMatch[0]; + const matchVal = localMatch[1]; + const newVal = exportScopedName(matchVal); + result = input.replace(matchPattern, newVal); + } else return token; + return result; + } else return token; + }); + decl.value = tokens$1.join(""); + }); + }); + root$2.walkAtRules(/keyframes$/i, (atRule) => { + const localMatch = /^\s*:local\s*\((.+?)\)\s*$/.exec(atRule.params); + if (!localMatch) return; + atRule.params = exportScopedName(localMatch[1]); + }); + root$2.walkAtRules(/scope$/i, (atRule) => { + if (atRule.params) atRule.params = atRule.params.split("to").map((item) => { + const selector$1 = item.trim().slice(1, -1).trim(); + if (!/^\s*:local\s*\((.+?)\)\s*$/.exec(selector$1)) return `(${selector$1})`; + return `(${traverseNode(selectorParser().astSync(selector$1)).toString()})`; + }).join(" to "); + }); + const exportedNames = Object.keys(exports$1); + if (exportedNames.length > 0) { + const exportRule = rule({ selector: ":export" }); + exportedNames.forEach((exportedName) => exportRule.append({ + prop: exportedName, + value: exports$1[exportedName].join(" "), + raws: { before: "\n " } + })); + root$2.append(exportRule); + } + } + }; + }; + plugin.postcss = true; + plugin.generateScopedName = function(name, path$2) { + return `_${path$2.replace(/\.[^./\\]+$/, "").replace(/[\W_]+/g, "_").replace(/^_|_$/g, "")}__${name}`.trim(); + }; + plugin.generateExportEntry = function(name, scopedName) { + return { + key: unescape(name), + value: unescape(scopedName) + }; + }; + module.exports = plugin; +})); + +//#endregion +//#region ../../node_modules/.pnpm/string-hash@1.1.3/node_modules/string-hash/index.js +var require_string_hash = /* @__PURE__ */ __commonJSMin(((exports, module) => { + function hash(str$1) { + var hash$1 = 5381, i$1 = str$1.length; + while (i$1) hash$1 = hash$1 * 33 ^ str$1.charCodeAt(--i$1); + return hash$1 >>> 0; + } + module.exports = hash; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-modules-values@4.0.0_postcss@8.5.6/node_modules/postcss-modules-values/src/index.js +var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const ICSSUtils = require_src$4(); + const matchImports = /^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/; + const matchValueDefinition = /(?:\s+|^)([\w-]+):?(.*?)$/; + const matchImport = /^([\w-]+)(?:\s+as\s+([\w-]+))?/; + module.exports = (options) => { + let importIndex = 0; + const createImportedName = options && options.createImportedName || ((importName) => `i__const_${importName.replace(/\W/g, "_")}_${importIndex++}`); + return { + postcssPlugin: "postcss-modules-values", + prepare(result) { + const importAliases = []; + const definitions = {}; + return { Once(root$2, postcss) { + root$2.walkAtRules(/value/i, (atRule) => { + const matches = atRule.params.match(matchImports); + if (matches) { + let [, aliases, path$2] = matches; + if (definitions[path$2]) path$2 = definitions[path$2]; + const imports = aliases.replace(/^\(\s*([\s\S]+)\s*\)$/, "$1").split(/\s*,\s*/).map((alias) => { + const tokens$1 = matchImport.exec(alias); + if (tokens$1) { + const [, theirName, myName = theirName] = tokens$1; + const importedName = createImportedName(myName); + definitions[myName] = importedName; + return { + theirName, + importedName + }; + } else throw new Error(`@import statement "${alias}" is invalid!`); + }); + importAliases.push({ + path: path$2, + imports + }); + atRule.remove(); + return; + } + if (atRule.params.indexOf("@value") !== -1) result.warn("Invalid value definition: " + atRule.params); + let [, key, value] = `${atRule.params}${atRule.raws.between}`.match(matchValueDefinition); + const normalizedValue = value.replace(/\/\*((?!\*\/).*?)\*\//g, ""); + if (normalizedValue.length === 0) { + result.warn("Invalid value definition: " + atRule.params); + atRule.remove(); + return; + } + if (!/^\s+$/.test(normalizedValue)) value = value.trim(); + definitions[key] = ICSSUtils.replaceValueSymbols(value, definitions); + atRule.remove(); + }); + if (!Object.keys(definitions).length) return; + ICSSUtils.replaceSymbols(root$2, definitions); + const exportDeclarations = Object.keys(definitions).map((key) => postcss.decl({ + value: definitions[key], + prop: key, + raws: { before: "\n " } + })); + if (exportDeclarations.length > 0) { + const exportRule = postcss.rule({ + selector: ":export", + raws: { after: "\n" } + }); + exportRule.append(exportDeclarations); + root$2.prepend(exportRule); + } + importAliases.reverse().forEach(({ path: path$2, imports }) => { + const importRule = postcss.rule({ + selector: `:import(${path$2})`, + raws: { after: "\n" } + }); + imports.forEach(({ theirName, importedName }) => { + importRule.append({ + value: theirName, + prop: importedName, + raws: { before: "\n " } + }); + }); + root$2.prepend(importRule); + }); + } }; + } + }; + }; + module.exports.postcss = true; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.6/node_modules/postcss-modules/build/scoping.js +var require_scoping = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.behaviours = void 0; + exports.getDefaultPlugins = getDefaultPlugins; + exports.getDefaultScopeBehaviour = getDefaultScopeBehaviour; + exports.getScopedNameGenerator = getScopedNameGenerator; + var _postcssModulesExtractImports = _interopRequireDefault$1(require_src$3()); + var _genericNames = _interopRequireDefault$1(require_generic_names()); + var _postcssModulesLocalByDefault = _interopRequireDefault$1(require_src$2()); + var _postcssModulesScope = _interopRequireDefault$1(require_src$1()); + var _stringHash = _interopRequireDefault$1(require_string_hash()); + var _postcssModulesValues = _interopRequireDefault$1(require_src()); + function _interopRequireDefault$1(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + const behaviours = { + LOCAL: "local", + GLOBAL: "global" + }; + exports.behaviours = behaviours; + function getDefaultPlugins({ behaviour, generateScopedName, exportGlobals }) { + const scope = (0, _postcssModulesScope.default)({ + generateScopedName, + exportGlobals + }); + return { + [behaviours.LOCAL]: [ + _postcssModulesValues.default, + (0, _postcssModulesLocalByDefault.default)({ mode: "local" }), + _postcssModulesExtractImports.default, + scope + ], + [behaviours.GLOBAL]: [ + _postcssModulesValues.default, + (0, _postcssModulesLocalByDefault.default)({ mode: "global" }), + _postcssModulesExtractImports.default, + scope + ] + }[behaviour]; + } + function isValidBehaviour(behaviour) { + return Object.keys(behaviours).map((key) => behaviours[key]).indexOf(behaviour) > -1; + } + function getDefaultScopeBehaviour(scopeBehaviour) { + return scopeBehaviour && isValidBehaviour(scopeBehaviour) ? scopeBehaviour : behaviours.LOCAL; + } + function generateScopedNameDefault(name, filename, css) { + const i$1 = css.indexOf(`.${name}`); + const lineNumber = css.substr(0, i$1).split(/[\r\n]/).length; + return `_${name}_${(0, _stringHash.default)(css).toString(36).substr(0, 5)}_${lineNumber}`; + } + function getScopedNameGenerator(generateScopedName, hashPrefix) { + const scopedNameGenerator = generateScopedName || generateScopedNameDefault; + if (typeof scopedNameGenerator === "function") return scopedNameGenerator; + return (0, _genericNames.default)(scopedNameGenerator, { + context: process.cwd(), + hashPrefix + }); + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.6/node_modules/postcss-modules/build/pluginFactory.js +var require_pluginFactory = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.makePlugin = makePlugin; + var _postcss = _interopRequireDefault(__require("postcss")); + var _unquote = _interopRequireDefault(require_unquote()); + var _Parser = _interopRequireDefault(require_Parser()); + var _saveJSON = _interopRequireDefault(require_saveJSON()); + var _localsConvention = require_localsConvention(); + var _FileSystemLoader = _interopRequireDefault(require_FileSystemLoader()); + var _scoping = require_scoping(); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + const PLUGIN_NAME = "postcss-modules"; + function isGlobalModule(globalModules, inputFile) { + return globalModules.some((regex) => inputFile.match(regex)); + } + function getDefaultPluginsList(opts, inputFile) { + const globalModulesList = opts.globalModulePaths || null; + const exportGlobals = opts.exportGlobals || false; + const defaultBehaviour = (0, _scoping.getDefaultScopeBehaviour)(opts.scopeBehaviour); + const generateScopedName = (0, _scoping.getScopedNameGenerator)(opts.generateScopedName, opts.hashPrefix); + if (globalModulesList && isGlobalModule(globalModulesList, inputFile)) return (0, _scoping.getDefaultPlugins)({ + behaviour: _scoping.behaviours.GLOBAL, + generateScopedName, + exportGlobals + }); + return (0, _scoping.getDefaultPlugins)({ + behaviour: defaultBehaviour, + generateScopedName, + exportGlobals + }); + } + function getLoader(opts, plugins) { + const root$2 = typeof opts.root === "undefined" ? "/" : opts.root; + return typeof opts.Loader === "function" ? new opts.Loader(root$2, plugins, opts.resolve) : new _FileSystemLoader.default(root$2, plugins, opts.resolve); + } + function isOurPlugin(plugin$1) { + return plugin$1.postcssPlugin === PLUGIN_NAME; + } + function makePlugin(opts) { + return { + postcssPlugin: PLUGIN_NAME, + async OnceExit(css, { result }) { + const getJSON = opts.getJSON || _saveJSON.default; + const inputFile = css.source.input.file; + const pluginList = getDefaultPluginsList(opts, inputFile); + const resultPluginIndex = result.processor.plugins.findIndex((plugin$1) => isOurPlugin(plugin$1)); + if (resultPluginIndex === -1) throw new Error("Plugin missing from options."); + const loader = getLoader(opts, [...result.processor.plugins.slice(0, resultPluginIndex), ...pluginList]); + const fetcher = async (file, relativeTo, depTrace) => { + const unquoteFile = (0, _unquote.default)(file); + return loader.fetch.call(loader, unquoteFile, relativeTo, depTrace); + }; + const parser$1 = new _Parser.default(fetcher); + await (0, _postcss.default)([...pluginList, parser$1.plugin()]).process(css, { from: inputFile }); + const out = loader.finalSource; + if (out) css.prepend(out); + if (opts.localsConvention) { + const reducer = (0, _localsConvention.makeLocalsConventionReducer)(opts.localsConvention, inputFile); + parser$1.exportTokens = Object.entries(parser$1.exportTokens).reduce(reducer, {}); + } + result.messages.push({ + type: "export", + plugin: "postcss-modules", + exportTokens: parser$1.exportTokens + }); + return getJSON(css.source.input.file, parser$1.exportTokens, result.opts.to); + } + }; + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.6/node_modules/postcss-modules/build/index.js +var require_build = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var _fs = __require("fs"); + var _fs2 = require_fs(); + var _pluginFactory = require_pluginFactory(); + (0, _fs2.setFileSystem)({ + readFile: _fs.readFile, + writeFile: _fs.writeFile + }); + module.exports = (opts = {}) => (0, _pluginFactory.makePlugin)(opts); + module.exports.postcss = true; +})); + +//#endregion +export default require_build(); + +export { }; \ No newline at end of file diff --git a/vanilla/node_modules/vite/dist/node/chunks/chunk.js b/vanilla/node_modules/vite/dist/node/chunks/chunk.js new file mode 100644 index 0000000..f92a15e --- /dev/null +++ b/vanilla/node_modules/vite/dist/node/chunks/chunk.js @@ -0,0 +1,48 @@ +import { createRequire } from "node:module"; + +//#region rolldown:runtime +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res); +var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports); +var __export = (all, symbols) => { + let target = {}; + for (var name in all) { + __defProp(target, name, { + get: all[name], + enumerable: true + }); + } + if (symbols) { + __defProp(target, Symbol.toStringTag, { value: "Module" }); + } + return target; +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { + key = keys[i]; + if (!__hasOwnProp.call(to, key) && key !== except) { + __defProp(to, key, { + get: ((k) => from[k]).bind(null, key), + enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable + }); + } + } + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { + value: mod, + enumerable: true +}) : target, mod)); +var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __toDynamicImportESM = (isNodeMode) => (mod) => __toESM(mod.default, isNodeMode); +var __require = /* @__PURE__ */ createRequire(import.meta.url); + +//#endregion +export { __toCommonJS as a, __require as i, __esmMin as n, __toDynamicImportESM as o, __export as r, __toESM as s, __commonJSMin as t }; \ No newline at end of file diff --git a/vanilla/node_modules/vite/dist/node/chunks/config.js b/vanilla/node_modules/vite/dist/node/chunks/config.js new file mode 100644 index 0000000..2b39a20 --- /dev/null +++ b/vanilla/node_modules/vite/dist/node/chunks/config.js @@ -0,0 +1,35978 @@ +import { a as __toCommonJS, i as __require, n as __esmMin, o as __toDynamicImportESM, r as __export, s as __toESM, t as __commonJSMin } from "./chunk.js"; +import { A as OPTIMIZABLE_ENTRY_RE, C as ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR, D as JS_TYPES_RE, E as FS_PREFIX, F as defaultAllowedOrigins, I as loopbackHosts, L as wildcardHosts, M as SPECIAL_QUERY_RE, N as VERSION, O as KNOWN_ASSET_TYPES, P as VITE_PACKAGE_DIR, R as require_picocolors, S as ENV_PUBLIC_PATH, T as ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET, _ as DEFAULT_SERVER_CONDITIONS, a as CLIENT_ENTRY, b as DEV_PROD_CONDITION, c as DEFAULT_ASSETS_INLINE_LIMIT, d as DEFAULT_CLIENT_MAIN_FIELDS, f as DEFAULT_CONFIG_FILES, g as DEFAULT_PREVIEW_PORT, h as DEFAULT_EXTERNAL_CONDITIONS, i as CLIENT_DIR, j as ROLLUP_HOOKS, k as METADATA_FILENAME, l as DEFAULT_ASSETS_RE, m as DEFAULT_EXTENSIONS, n as createLogger, o as CLIENT_PUBLIC_PATH, p as DEFAULT_DEV_PORT, r as printServerUrls, s as CSS_LANGS_RE, t as LogLevels, u as DEFAULT_CLIENT_CONDITIONS, v as DEFAULT_SERVER_MAIN_FIELDS, w as ERR_OPTIMIZE_DEPS_PROCESSING_ERROR, x as ENV_ENTRY, y as DEP_VERSION_RE } from "./logger.js"; +import { builtinModules, createRequire } from "node:module"; +import { parseAst, parseAstAsync } from "rollup/parseAst"; +import * as fs$1 from "node:fs"; +import fs, { existsSync, promises, readFileSync } from "node:fs"; +import path, { basename, dirname, extname, isAbsolute, join, normalize, posix, relative, resolve, sep } from "node:path"; +import fsp, { constants } from "node:fs/promises"; +import { URL as URL$1, fileURLToPath, pathToFileURL } from "node:url"; +import { format, formatWithOptions, inspect, promisify, stripVTControlCharacters } from "node:util"; +import { performance as performance$1 } from "node:perf_hooks"; +import crypto from "node:crypto"; +import picomatch from "picomatch"; +import esbuild, { build, formatMessages, transform } from "esbuild"; +import os from "node:os"; +import net from "node:net"; +import childProcess, { exec, execFile, execSync } from "node:child_process"; +import { promises as promises$1 } from "node:dns"; +import { isatty } from "node:tty"; +import path$1, { basename as basename$1, dirname as dirname$1, extname as extname$1, isAbsolute as isAbsolute$1, join as join$1, posix as posix$1, relative as relative$1, resolve as resolve$1, sep as sep$1, win32 } from "path"; +import { existsSync as existsSync$1, readFileSync as readFileSync$1, readdirSync, statSync } from "fs"; +import { fdir } from "fdir"; +import { gzip } from "node:zlib"; +import readline from "node:readline"; +import { createRequire as createRequire$1 } from "module"; +import { MessageChannel, Worker } from "node:worker_threads"; +import isModuleSyncConditionEnabled from "#module-sync-enabled"; +import assert from "node:assert"; +import process$1 from "node:process"; +import v8 from "node:v8"; +import { escapePath, glob, globSync, isDynamicPattern } from "tinyglobby"; +import { Buffer as Buffer$1 } from "node:buffer"; +import { EventEmitter } from "node:events"; +import { STATUS_CODES, createServer, get } from "node:http"; +import { createServer as createServer$1, get as get$1 } from "node:https"; +import { ESModulesEvaluator, ModuleRunner, createNodeImportMeta } from "vite/module-runner"; +import zlib from "zlib"; +import * as qs from "node:querystring"; + +//#region src/shared/constants.ts +/** +* Prefix for resolved Ids that are not valid browser import specifiers +*/ +const VALID_ID_PREFIX = `/@id/`; +/** +* Plugins that use 'virtual modules' (e.g. for helper functions), prefix the +* module ID with `\0`, a convention from the rollup ecosystem. +* This prevents other plugins from trying to process the id (like node resolution), +* and core features like sourcemaps can use this info to differentiate between +* virtual modules and regular files. +* `\0` is not a permitted char in import URLs so we have to replace them during +* import analysis. The id will be decoded back before entering the plugins pipeline. +* These encoded virtual ids are also prefixed by the VALID_ID_PREFIX, so virtual +* modules in the browser end up encoded as `/@id/__x00__{id}` +*/ +const NULL_BYTE_PLACEHOLDER = `__x00__`; +let SOURCEMAPPING_URL = "sourceMa"; +SOURCEMAPPING_URL += "ppingURL"; +const MODULE_RUNNER_SOURCEMAPPING_SOURCE = "//# sourceMappingSource=vite-generated"; +const ERR_OUTDATED_OPTIMIZED_DEP = "ERR_OUTDATED_OPTIMIZED_DEP"; + +//#endregion +//#region src/shared/utils.ts +const isWindows = typeof process !== "undefined" && process.platform === "win32"; +/** +* Prepend `/@id/` and replace null byte so the id is URL-safe. +* This is prepended to resolved ids that are not valid browser +* import specifiers by the importAnalysis plugin. +*/ +function wrapId(id) { + return id.startsWith(VALID_ID_PREFIX) ? id : VALID_ID_PREFIX + id.replace("\0", NULL_BYTE_PLACEHOLDER); +} +/** +* Undo {@link wrapId}'s `/@id/` and null byte replacements. +*/ +function unwrapId(id) { + return id.startsWith(VALID_ID_PREFIX) ? id.slice(VALID_ID_PREFIX.length).replace(NULL_BYTE_PLACEHOLDER, "\0") : id; +} +const windowsSlashRE = /\\/g; +function slash(p) { + return p.replace(windowsSlashRE, "/"); +} +const postfixRE = /[?#].*$/; +function cleanUrl(url$3) { + return url$3.replace(postfixRE, ""); +} +function splitFileAndPostfix(path$13) { + const file = cleanUrl(path$13); + return { + file, + postfix: path$13.slice(file.length) + }; +} +function withTrailingSlash(path$13) { + if (path$13[path$13.length - 1] !== "/") return `${path$13}/`; + return path$13; +} +function promiseWithResolvers() { + let resolve$4; + let reject; + return { + promise: new Promise((_resolve, _reject) => { + resolve$4 = _resolve; + reject = _reject; + }), + resolve: resolve$4, + reject + }; +} + +//#endregion +//#region src/module-runner/importMetaResolver.ts +const customizationHookNamespace = "vite-module-runner:import-meta-resolve/v1/"; +const customizationHooksModule = ` + +export async function resolve(specifier, context, nextResolve) { + if (specifier.startsWith(${JSON.stringify(customizationHookNamespace)})) { + const data = specifier.slice(${JSON.stringify(customizationHookNamespace)}.length) + const [parsedSpecifier, parsedImporter] = JSON.parse(data) + specifier = parsedSpecifier + context.parentURL = parsedImporter + } + return nextResolve(specifier, context) +} + +`; +function customizationHookResolve(specifier, context, nextResolve) { + if (specifier.startsWith(customizationHookNamespace)) { + const data = specifier.slice(42); + const [parsedSpecifier, parsedImporter] = JSON.parse(data); + specifier = parsedSpecifier; + context.parentURL = parsedImporter; + } + return nextResolve(specifier, context); +} +async function createImportMetaResolver() { + let module$1; + try { + module$1 = (await import("node:module")).Module; + } catch { + return; + } + if (!module$1) return; + if (module$1.registerHooks) { + module$1.registerHooks({ resolve: customizationHookResolve }); + return importMetaResolveWithCustomHook; + } + if (!module$1.register) return; + try { + const hookModuleContent = `data:text/javascript,${encodeURI(customizationHooksModule)}`; + module$1.register(hookModuleContent); + } catch (e$1) { + if ("code" in e$1 && e$1.code === "ERR_NETWORK_IMPORT_DISALLOWED") return; + throw e$1; + } + return importMetaResolveWithCustomHook; +} +function importMetaResolveWithCustomHook(specifier, importer) { + return import.meta.resolve(`${customizationHookNamespace}${JSON.stringify([specifier, importer])}`); +} +const importMetaResolveWithCustomHookString = ` + + (() => { + const resolve = 'resolve' + return (specifier, importer) => + import.meta[resolve]( + \`${customizationHookNamespace}\${JSON.stringify([specifier, importer])}\`, + ) + })() + +`; + +//#endregion +//#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +var comma = ",".charCodeAt(0); +var semicolon = ";".charCodeAt(0); +var chars$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +var intToChar = new Uint8Array(64); +var charToInt = new Uint8Array(128); +for (let i$1 = 0; i$1 < chars$1.length; i$1++) { + const c = chars$1.charCodeAt(i$1); + intToChar[i$1] = c; + charToInt[c] = i$1; +} +function decodeInteger(reader, relative$3) { + let value$1 = 0; + let shift = 0; + let integer = 0; + do { + integer = charToInt[reader.next()]; + value$1 |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value$1 & 1; + value$1 >>>= 1; + if (shouldNegate) value$1 = -2147483648 | -value$1; + return relative$3 + value$1; +} +function encodeInteger(builder, num, relative$3) { + let delta = num - relative$3; + delta = delta < 0 ? -delta << 1 | 1 : delta << 1; + do { + let clamped = delta & 31; + delta >>>= 5; + if (delta > 0) clamped |= 32; + builder.write(intToChar[clamped]); + } while (delta > 0); + return num; +} +function hasMoreVlq(reader, max) { + if (reader.pos >= max) return false; + return reader.peek() !== comma; +} +var bufLength = 1024 * 16; +var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) { + return Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString(); +} } : { decode(buf) { + let out = ""; + for (let i$1 = 0; i$1 < buf.length; i$1++) out += String.fromCharCode(buf[i$1]); + return out; +} }; +var StringWriter = class { + constructor() { + this.pos = 0; + this.out = ""; + this.buffer = new Uint8Array(bufLength); + } + write(v) { + const { buffer } = this; + buffer[this.pos++] = v; + if (this.pos === bufLength) { + this.out += td.decode(buffer); + this.pos = 0; + } + } + flush() { + const { buffer, out, pos } = this; + return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; + } +}; +var StringReader = class { + constructor(buffer) { + this.pos = 0; + this.buffer = buffer; + } + next() { + return this.buffer.charCodeAt(this.pos++); + } + peek() { + return this.buffer.charCodeAt(this.pos); + } + indexOf(char) { + const { buffer, pos } = this; + const idx = buffer.indexOf(char, pos); + return idx === -1 ? buffer.length : idx; + } +}; +function decode(mappings) { + const { length } = mappings; + const reader = new StringReader(mappings); + const decoded = []; + let genColumn = 0; + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + do { + const semi = reader.indexOf(";"); + const line = []; + let sorted = true; + let lastCol = 0; + genColumn = 0; + while (reader.pos < semi) { + let seg; + genColumn = decodeInteger(reader, genColumn); + if (genColumn < lastCol) sorted = false; + lastCol = genColumn; + if (hasMoreVlq(reader, semi)) { + sourcesIndex = decodeInteger(reader, sourcesIndex); + sourceLine = decodeInteger(reader, sourceLine); + sourceColumn = decodeInteger(reader, sourceColumn); + if (hasMoreVlq(reader, semi)) { + namesIndex = decodeInteger(reader, namesIndex); + seg = [ + genColumn, + sourcesIndex, + sourceLine, + sourceColumn, + namesIndex + ]; + } else seg = [ + genColumn, + sourcesIndex, + sourceLine, + sourceColumn + ]; + } else seg = [genColumn]; + line.push(seg); + reader.pos++; + } + if (!sorted) sort(line); + decoded.push(line); + reader.pos = semi + 1; + } while (reader.pos <= length); + return decoded; +} +function sort(line) { + line.sort(sortComparator$1); +} +function sortComparator$1(a, b) { + return a[0] - b[0]; +} +function encode$1(decoded) { + const writer = new StringWriter(); + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + for (let i$1 = 0; i$1 < decoded.length; i$1++) { + const line = decoded[i$1]; + if (i$1 > 0) writer.write(semicolon); + if (line.length === 0) continue; + let genColumn = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + if (j > 0) writer.write(comma); + genColumn = encodeInteger(writer, segment[0], genColumn); + if (segment.length === 1) continue; + sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); + sourceLine = encodeInteger(writer, segment[2], sourceLine); + sourceColumn = encodeInteger(writer, segment[3], sourceColumn); + if (segment.length === 4) continue; + namesIndex = encodeInteger(writer, segment[4], namesIndex); + } + } + return writer.flush(); +} + +//#endregion +//#region ../../node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs +const schemeRegex = /^[\w+.-]+:\/\//; +/** +* Matches the parts of a URL: +* 1. Scheme, including ":", guaranteed. +* 2. User/password, including "@", optional. +* 3. Host, guaranteed. +* 4. Port, including ":", optional. +* 5. Path, including "/", optional. +* 6. Query, including "?", optional. +* 7. Hash, including "#", optional. +*/ +const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; +/** +* File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start +* with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). +* +* 1. Host, optional. +* 2. Path, which may include "/", guaranteed. +* 3. Query, including "?", optional. +* 4. Hash, including "#", optional. +*/ +const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; +function isAbsoluteUrl(input) { + return schemeRegex.test(input); +} +function isSchemeRelativeUrl(input) { + return input.startsWith("//"); +} +function isAbsolutePath(input) { + return input.startsWith("/"); +} +function isFileUrl(input) { + return input.startsWith("file:"); +} +function isRelative(input) { + return /^[.?#]/.test(input); +} +function parseAbsoluteUrl(input) { + const match = urlRegex.exec(input); + return makeUrl(match[1], match[2] || "", match[3], match[4] || "", match[5] || "/", match[6] || "", match[7] || ""); +} +function parseFileUrl(input) { + const match = fileRegex.exec(input); + const path$13 = match[2]; + return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path$13) ? path$13 : "/" + path$13, match[3] || "", match[4] || ""); +} +function makeUrl(scheme, user, host, port, path$13, query, hash$1) { + return { + scheme, + user, + host, + port, + path: path$13, + query, + hash: hash$1, + type: 7 + }; +} +function parseUrl$3(input) { + if (isSchemeRelativeUrl(input)) { + const url$4 = parseAbsoluteUrl("http:" + input); + url$4.scheme = ""; + url$4.type = 6; + return url$4; + } + if (isAbsolutePath(input)) { + const url$4 = parseAbsoluteUrl("http://foo.com" + input); + url$4.scheme = ""; + url$4.host = ""; + url$4.type = 5; + return url$4; + } + if (isFileUrl(input)) return parseFileUrl(input); + if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input); + const url$3 = parseAbsoluteUrl("http://foo.com/" + input); + url$3.scheme = ""; + url$3.host = ""; + url$3.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1; + return url$3; +} +function stripPathFilename(path$13) { + if (path$13.endsWith("/..")) return path$13; + const index = path$13.lastIndexOf("/"); + return path$13.slice(0, index + 1); +} +function mergePaths(url$3, base) { + normalizePath$4(base, base.type); + if (url$3.path === "/") url$3.path = base.path; + else url$3.path = stripPathFilename(base.path) + url$3.path; +} +/** +* The path can have empty directories "//", unneeded parents "foo/..", or current directory +* "foo/.". We need to normalize to a standard representation. +*/ +function normalizePath$4(url$3, type) { + const rel = type <= 4; + const pieces = url$3.path.split("/"); + let pointer = 1; + let positive = 0; + let addTrailingSlash = false; + for (let i$1 = 1; i$1 < pieces.length; i$1++) { + const piece = pieces[i$1]; + if (!piece) { + addTrailingSlash = true; + continue; + } + addTrailingSlash = false; + if (piece === ".") continue; + if (piece === "..") { + if (positive) { + addTrailingSlash = true; + positive--; + pointer--; + } else if (rel) pieces[pointer++] = piece; + continue; + } + pieces[pointer++] = piece; + positive++; + } + let path$13 = ""; + for (let i$1 = 1; i$1 < pointer; i$1++) path$13 += "/" + pieces[i$1]; + if (!path$13 || addTrailingSlash && !path$13.endsWith("/..")) path$13 += "/"; + url$3.path = path$13; +} +/** +* Attempts to resolve `input` URL/path relative to `base`. +*/ +function resolve$3(input, base) { + if (!input && !base) return ""; + const url$3 = parseUrl$3(input); + let inputType = url$3.type; + if (base && inputType !== 7) { + const baseUrl = parseUrl$3(base); + const baseType = baseUrl.type; + switch (inputType) { + case 1: url$3.hash = baseUrl.hash; + case 2: url$3.query = baseUrl.query; + case 3: + case 4: mergePaths(url$3, baseUrl); + case 5: + url$3.user = baseUrl.user; + url$3.host = baseUrl.host; + url$3.port = baseUrl.port; + case 6: url$3.scheme = baseUrl.scheme; + } + if (baseType > inputType) inputType = baseType; + } + normalizePath$4(url$3, inputType); + const queryHash = url$3.query + url$3.hash; + switch (inputType) { + case 2: + case 3: return queryHash; + case 4: { + const path$13 = url$3.path.slice(1); + if (!path$13) return queryHash || "."; + if (isRelative(base || input) && !isRelative(path$13)) return "./" + path$13 + queryHash; + return path$13 + queryHash; + } + case 5: return url$3.path + queryHash; + default: return url$3.scheme + "//" + url$3.user + url$3.host + url$3.port + url$3.path + queryHash; + } +} + +//#endregion +//#region ../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs +function stripFilename(path$13) { + if (!path$13) return ""; + const index = path$13.lastIndexOf("/"); + return path$13.slice(0, index + 1); +} +function resolver(mapUrl, sourceRoot) { + const from = stripFilename(mapUrl); + const prefix = sourceRoot ? sourceRoot + "/" : ""; + return (source) => resolve$3(prefix + (source || ""), from); +} +var COLUMN$1 = 0; +var SOURCES_INDEX$1 = 1; +var SOURCE_LINE$1 = 2; +var SOURCE_COLUMN$1 = 3; +var NAMES_INDEX$1 = 4; +function maybeSort(mappings, owned) { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) return mappings; + if (!owned) mappings = mappings.slice(); + for (let i$1 = unsortedIndex; i$1 < mappings.length; i$1 = nextUnsortedSegmentLine(mappings, i$1 + 1)) mappings[i$1] = sortSegments(mappings[i$1], owned); + return mappings; +} +function nextUnsortedSegmentLine(mappings, start) { + for (let i$1 = start; i$1 < mappings.length; i$1++) if (!isSorted(mappings[i$1])) return i$1; + return mappings.length; +} +function isSorted(line) { + for (let j = 1; j < line.length; j++) if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) return false; + return true; +} +function sortSegments(line, owned) { + if (!owned) line = line.slice(); + return line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[COLUMN$1] - b[COLUMN$1]; +} +var found = false; +function binarySearch(haystack, needle, low, high) { + while (low <= high) { + const mid = low + (high - low >> 1); + const cmp = haystack[mid][COLUMN$1] - needle; + if (cmp === 0) { + found = true; + return mid; + } + if (cmp < 0) low = mid + 1; + else high = mid - 1; + } + found = false; + return low - 1; +} +function upperBound(haystack, needle, index) { + for (let i$1 = index + 1; i$1 < haystack.length; index = i$1++) if (haystack[i$1][COLUMN$1] !== needle) break; + return index; +} +function lowerBound(haystack, needle, index) { + for (let i$1 = index - 1; i$1 >= 0; index = i$1--) if (haystack[i$1][COLUMN$1] !== needle) break; + return index; +} +function memoizedState() { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1 + }; +} +function memoizedBinarySearch(haystack, needle, state, key) { + const { lastKey, lastNeedle, lastIndex } = state; + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle; + return lastIndex; + } + if (needle >= lastNeedle) low = lastIndex === -1 ? 0 : lastIndex; + else high = lastIndex; + } + state.lastKey = key; + state.lastNeedle = needle; + return state.lastIndex = binarySearch(haystack, needle, low, high); +} +function parse$14(map$1) { + return typeof map$1 === "string" ? JSON.parse(map$1) : map$1; +} +var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)"; +var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)"; +var LEAST_UPPER_BOUND = -1; +var GREATEST_LOWER_BOUND = 1; +var TraceMap = class { + constructor(map$1, mapUrl) { + const isString$1 = typeof map$1 === "string"; + if (!isString$1 && map$1._decodedMemo) return map$1; + const parsed = parse$14(map$1); + const { version: version$2, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version$2; + this.file = file; + this.names = names || []; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0; + const resolve$4 = resolver(mapUrl, sourceRoot); + this.resolvedSources = sources.map(resolve$4); + const { mappings } = parsed; + if (typeof mappings === "string") { + this._encoded = mappings; + this._decoded = void 0; + } else if (Array.isArray(mappings)) { + this._encoded = void 0; + this._decoded = maybeSort(mappings, isString$1); + } else if (parsed.sections) throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); + else throw new Error(`invalid source map: ${JSON.stringify(parsed)}`); + this._decodedMemo = memoizedState(); + this._bySources = void 0; + this._bySourceMemos = void 0; + } +}; +function cast$1(map$1) { + return map$1; +} +function encodedMappings(map$1) { + var _a, _b; + return (_b = (_a = cast$1(map$1))._encoded) != null ? _b : _a._encoded = encode$1(cast$1(map$1)._decoded); +} +function decodedMappings(map$1) { + var _a; + return (_a = cast$1(map$1))._decoded || (_a._decoded = decode(cast$1(map$1)._encoded)); +} +function traceSegment(map$1, line, column) { + const decoded = decodedMappings(map$1); + if (line >= decoded.length) return null; + const segments = decoded[line]; + const index = traceSegmentInternal(segments, cast$1(map$1)._decodedMemo, line, column, GREATEST_LOWER_BOUND); + return index === -1 ? null : segments[index]; +} +function originalPositionFor(map$1, needle) { + let { line, column, bias } = needle; + line--; + if (line < 0) throw new Error(LINE_GTR_ZERO); + if (column < 0) throw new Error(COL_GTR_EQ_ZERO); + const decoded = decodedMappings(map$1); + if (line >= decoded.length) return OMapping(null, null, null, null); + const segments = decoded[line]; + const index = traceSegmentInternal(segments, cast$1(map$1)._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); + if (index === -1) return OMapping(null, null, null, null); + const segment = segments[index]; + if (segment.length === 1) return OMapping(null, null, null, null); + const { names, resolvedSources } = map$1; + return OMapping(resolvedSources[segment[SOURCES_INDEX$1]], segment[SOURCE_LINE$1] + 1, segment[SOURCE_COLUMN$1], segment.length === 5 ? names[segment[NAMES_INDEX$1]] : null); +} +function decodedMap(map$1) { + return clone(map$1, decodedMappings(map$1)); +} +function encodedMap(map$1) { + return clone(map$1, encodedMappings(map$1)); +} +function clone(map$1, mappings) { + return { + version: map$1.version, + file: map$1.file, + names: map$1.names, + sourceRoot: map$1.sourceRoot, + sources: map$1.sources, + sourcesContent: map$1.sourcesContent, + mappings, + ignoreList: map$1.ignoreList || map$1.x_google_ignoreList + }; +} +function OMapping(source, line, column, name) { + return { + source, + line, + column, + name + }; +} +function traceSegmentInternal(segments, memo, line, column, bias) { + let index = memoizedBinarySearch(segments, column, memo, line); + if (found) index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); + else if (bias === LEAST_UPPER_BOUND) index++; + if (index === -1 || index === segments.length) return -1; + return index; +} + +//#endregion +//#region ../../node_modules/.pnpm/@jridgewell+gen-mapping@0.3.12/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs +var SetArray = class { + constructor() { + this._indexes = { __proto__: null }; + this.array = []; + } +}; +function cast(set) { + return set; +} +function get$2(setarr, key) { + return cast(setarr)._indexes[key]; +} +function put(setarr, key) { + const index = get$2(setarr, key); + if (index !== void 0) return index; + const { array, _indexes: indexes } = cast(setarr); + return indexes[key] = array.push(key) - 1; +} +function remove(setarr, key) { + const index = get$2(setarr, key); + if (index === void 0) return; + const { array, _indexes: indexes } = cast(setarr); + for (let i$1 = index + 1; i$1 < array.length; i$1++) { + const k = array[i$1]; + array[i$1 - 1] = k; + indexes[k]--; + } + indexes[key] = void 0; + array.pop(); +} +var COLUMN = 0; +var SOURCES_INDEX = 1; +var SOURCE_LINE = 2; +var SOURCE_COLUMN = 3; +var NAMES_INDEX = 4; +var NO_NAME = -1; +var GenMapping = class { + constructor({ file, sourceRoot } = {}) { + this._names = new SetArray(); + this._sources = new SetArray(); + this._sourcesContent = []; + this._mappings = []; + this.file = file; + this.sourceRoot = sourceRoot; + this._ignoreList = new SetArray(); + } +}; +function cast2(map$1) { + return map$1; +} +var maybeAddSegment = (map$1, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + return addSegmentInternal(true, map$1, genLine, genColumn, source, sourceLine, sourceColumn, name, content); +}; +function setSourceContent(map$1, source, content) { + const { _sources: sources, _sourcesContent: sourcesContent } = cast2(map$1); + const index = put(sources, source); + sourcesContent[index] = content; +} +function setIgnore(map$1, source, ignore = true) { + const { _sources: sources, _sourcesContent: sourcesContent, _ignoreList: ignoreList } = cast2(map$1); + const index = put(sources, source); + if (index === sourcesContent.length) sourcesContent[index] = null; + if (ignore) put(ignoreList, index); + else remove(ignoreList, index); +} +function toDecodedMap(map$1) { + const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, _ignoreList: ignoreList } = cast2(map$1); + removeEmptyFinalLines(mappings); + return { + version: 3, + file: map$1.file || void 0, + names: names.array, + sourceRoot: map$1.sourceRoot || void 0, + sources: sources.array, + sourcesContent, + mappings, + ignoreList: ignoreList.array + }; +} +function toEncodedMap(map$1) { + const decoded = toDecodedMap(map$1); + return Object.assign({}, decoded, { mappings: encode$1(decoded.mappings) }); +} +function addSegmentInternal(skipable, map$1, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { + const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names } = cast2(map$1); + const line = getIndex(mappings, genLine); + const index = getColumnIndex(line, genColumn); + if (!source) { + if (skipable && skipSourceless(line, index)) return; + return insert(line, index, [genColumn]); + } + assert$2(sourceLine); + assert$2(sourceColumn); + const sourcesIndex = put(sources, source); + const namesIndex = name ? put(names, name) : NO_NAME; + if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null; + if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) return; + return insert(line, index, name ? [ + genColumn, + sourcesIndex, + sourceLine, + sourceColumn, + namesIndex + ] : [ + genColumn, + sourcesIndex, + sourceLine, + sourceColumn + ]); +} +function assert$2(_val) {} +function getIndex(arr, index) { + for (let i$1 = arr.length; i$1 <= index; i$1++) arr[i$1] = []; + return arr[index]; +} +function getColumnIndex(line, genColumn) { + let index = line.length; + for (let i$1 = index - 1; i$1 >= 0; index = i$1--) if (genColumn >= line[i$1][COLUMN]) break; + return index; +} +function insert(array, index, value$1) { + for (let i$1 = array.length; i$1 > index; i$1--) array[i$1] = array[i$1 - 1]; + array[index] = value$1; +} +function removeEmptyFinalLines(mappings) { + const { length } = mappings; + let len = length; + for (let i$1 = len - 1; i$1 >= 0; len = i$1, i$1--) if (mappings[i$1].length > 0) break; + if (len < length) mappings.length = len; +} +function skipSourceless(line, index) { + if (index === 0) return true; + return line[index - 1].length === 1; +} +function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { + if (index === 0) return false; + const prev = line[index - 1]; + if (prev.length === 1) return false; + return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME); +} + +//#endregion +//#region ../../node_modules/.pnpm/@jridgewell+remapping@2.3.5/node_modules/@jridgewell/remapping/dist/remapping.mjs +var SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false); +var EMPTY_SOURCES = []; +function SegmentObject(source, line, column, name, content, ignore) { + return { + source, + line, + column, + name, + content, + ignore + }; +} +function Source(map$1, sources, source, content, ignore) { + return { + map: map$1, + sources, + source, + content, + ignore + }; +} +function MapSource(map$1, sources) { + return Source(map$1, sources, "", null, false); +} +function OriginalSource(source, content, ignore) { + return Source(null, EMPTY_SOURCES, source, content, ignore); +} +function traceMappings(tree) { + const gen = new GenMapping({ file: tree.map.file }); + const { sources: rootSources, map: map$1 } = tree; + const rootNames = map$1.names; + const rootMappings = decodedMappings(map$1); + for (let i$1 = 0; i$1 < rootMappings.length; i$1++) { + const segments = rootMappings[i$1]; + for (let j = 0; j < segments.length; j++) { + const segment = segments[j]; + const genCol = segment[0]; + let traced = SOURCELESS_MAPPING; + if (segment.length !== 1) { + const source2 = rootSources[segment[1]]; + traced = originalPositionFor$1(source2, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : ""); + if (traced == null) continue; + } + const { column, line, name, content, source, ignore } = traced; + maybeAddSegment(gen, i$1, genCol, source, line, column, name); + if (source && content != null) setSourceContent(gen, source, content); + if (ignore) setIgnore(gen, source, true); + } + } + return gen; +} +function originalPositionFor$1(source, line, column, name) { + if (!source.map) return SegmentObject(source.source, line, column, name, source.content, source.ignore); + const segment = traceSegment(source.map, line, column); + if (segment == null) return null; + if (segment.length === 1) return SOURCELESS_MAPPING; + return originalPositionFor$1(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name); +} +function asArray(value$1) { + if (Array.isArray(value$1)) return value$1; + return [value$1]; +} +function buildSourceMapTree(input, loader$1) { + const maps = asArray(input).map((m) => new TraceMap(m, "")); + const map$1 = maps.pop(); + for (let i$1 = 0; i$1 < maps.length; i$1++) if (maps[i$1].sources.length > 1) throw new Error(`Transformation map ${i$1} must have exactly one source file. +Did you specify these with the most recent transformation maps first?`); + let tree = build$2(map$1, loader$1, "", 0); + for (let i$1 = maps.length - 1; i$1 >= 0; i$1--) tree = MapSource(maps[i$1], [tree]); + return tree; +} +function build$2(map$1, loader$1, importer, importerDepth) { + const { resolvedSources, sourcesContent, ignoreList } = map$1; + const depth = importerDepth + 1; + return MapSource(map$1, resolvedSources.map((sourceFile, i$1) => { + const ctx = { + importer, + depth, + source: sourceFile || "", + content: void 0, + ignore: void 0 + }; + const sourceMap = loader$1(ctx.source, ctx); + const { source, content, ignore } = ctx; + if (sourceMap) return build$2(new TraceMap(sourceMap, source), loader$1, source, depth); + return OriginalSource(source, content !== void 0 ? content : sourcesContent ? sourcesContent[i$1] : null, ignore !== void 0 ? ignore : ignoreList ? ignoreList.includes(i$1) : false); + })); +} +var SourceMap$1 = class { + constructor(map$1, options$1) { + const out = options$1.decodedMappings ? toDecodedMap(map$1) : toEncodedMap(map$1); + this.version = out.version; + this.file = out.file; + this.mappings = out.mappings; + this.names = out.names; + this.ignoreList = out.ignoreList; + this.sourceRoot = out.sourceRoot; + this.sources = out.sources; + if (!options$1.excludeContent) this.sourcesContent = out.sourcesContent; + } + toString() { + return JSON.stringify(this); + } +}; +function remapping(input, loader$1, options$1) { + const opts = typeof options$1 === "object" ? options$1 : { + excludeContent: !!options$1, + decodedMappings: false + }; + return new SourceMap$1(traceMappings(buildSourceMapTree(input, loader$1)), opts); +} + +//#endregion +//#region ../../node_modules/.pnpm/obug@1.0.2_ms@2.1.3/node_modules/obug/dist/core.js +function coerce(value$1) { + if (value$1 instanceof Error) return value$1.stack || value$1.message; + return value$1; +} +function selectColor(colors$36, namespace) { + let hash$1 = 0; + for (let i$1 = 0; i$1 < namespace.length; i$1++) { + hash$1 = (hash$1 << 5) - hash$1 + namespace.charCodeAt(i$1); + hash$1 |= 0; + } + return colors$36[Math.abs(hash$1) % colors$36.length]; +} +function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; + while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) if (template[templateIndex] === "*") { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; + } else { + searchIndex++; + templateIndex++; + } + else if (starIndex !== -1) { + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; + } else return false; + while (templateIndex < template.length && template[templateIndex] === "*") templateIndex++; + return templateIndex === template.length; +} +function humanize(value$1) { + if (value$1 >= 1e3) return `${(value$1 / 1e3).toFixed(1)}s`; + return `${value$1}ms`; +} +function setup(useColors$1, colors$36, log$3, load$2, save$1, formatArgs$1, init$2) { + const createDebug$1 = (namespace) => { + let prevTime; + let enableOverride; + let namespacesCache; + let enabledCache; + const debug$18 = (...args) => { + if (!debug$18.enabled) return; + const curr = Date.now(); + debug$18.diff = curr - (prevTime || curr); + debug$18.prev = prevTime; + debug$18.curr = curr; + prevTime = curr; + args[0] = coerce(args[0]); + if (typeof args[0] !== "string") args.unshift("%O"); + let index = 0; + args[0] = args[0].replace(/%([a-z%])/gi, (match, format$3) => { + if (match === "%%") return "%"; + index++; + const formatter = createDebug$1.formatters[format$3]; + if (typeof formatter === "function") { + const value$1 = args[index]; + match = formatter.call(debug$18, value$1); + args.splice(index, 1); + index--; + } + return match; + }); + createDebug$1.formatArgs.call(debug$18, args); + (debug$18.log || createDebug$1.log).apply(debug$18, args); + }; + function extend(namespace$1, delimiter = ":") { + const newDebug = createDebug$1(this.namespace + delimiter + namespace$1); + newDebug.log = this.log; + return newDebug; + } + debug$18.namespace = namespace; + debug$18.useColors = useColors$1; + debug$18.color = selectColor(colors$36, namespace); + debug$18.extend = extend; + debug$18.log = log$3; + Object.defineProperty(debug$18, "enabled", { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride != null) return enableOverride; + if (namespacesCache !== createDebug$1.namespaces) { + namespacesCache = createDebug$1.namespaces; + enabledCache = createDebug$1.enabled(namespace); + } + return enabledCache; + }, + set: (v) => { + enableOverride = v; + } + }); + init$2 && init$2(debug$18); + return debug$18; + }; + function enable(namespaces) { + save$1(namespaces); + createDebug$1.namespaces = namespaces; + createDebug$1.names = []; + createDebug$1.skips = []; + const split = namespaces.trim().replace(/\s+/g, ",").split(",").filter(Boolean); + for (const ns of split) if (ns[0] === "-") createDebug$1.skips.push(ns.slice(1)); + else createDebug$1.names.push(ns); + } + function disable() { + const namespaces = [...createDebug$1.names, ...createDebug$1.skips.map((namespace) => `-${namespace}`)].join(","); + createDebug$1.enable(""); + return namespaces; + } + function enabled(name) { + for (const skip of createDebug$1.skips) if (matchesTemplate(name, skip)) return false; + for (const ns of createDebug$1.names) if (matchesTemplate(name, ns)) return true; + return false; + } + createDebug$1.namespaces = ""; + createDebug$1.formatters = {}; + createDebug$1.enable = enable; + createDebug$1.disable = disable; + createDebug$1.enabled = enabled; + createDebug$1.names = []; + createDebug$1.skips = []; + createDebug$1.selectColor = (ns) => selectColor(colors$36, ns); + createDebug$1.formatArgs = formatArgs$1; + createDebug$1.log = log$3; + createDebug$1.enable(load$2()); + return createDebug$1; +} +var init_core = __esmMin((() => {})); + +//#endregion +//#region ../../node_modules/.pnpm/obug@1.0.2_ms@2.1.3/node_modules/obug/dist/node.js +var node_exports = /* @__PURE__ */ __export({ + createDebug: () => createDebug, + default: () => node_default, + formatArgs: () => formatArgs, + log: () => log$2, + "module.exports": () => createDebug +}); +function log$2(...args) { + process.stderr.write(`${formatWithOptions(inspectOpts, ...args)}\n`); +} +function load$1() { + return process.env.DEBUG || ""; +} +function save(namespaces) { + if (namespaces) process.env.DEBUG = namespaces; + else delete process.env.DEBUG; +} +function useColors() { + return "colors" in inspectOpts ? Boolean(inspectOpts.colors) : isatty(process.stderr.fd); +} +function formatArgs(args) { + const { namespace: name, useColors: useColors$1 } = this; + if (useColors$1) { + const c = this.color; + const colorCode = `\u001B[3${c < 8 ? c : `8;5;${c}`}`; + const prefix = ` ${colorCode};1m${name} \u001B[0m`; + args[0] = prefix + args[0].split("\n").join(`\n${prefix}`); + args.push(`${colorCode}m+${humanize$1(this.diff)}\u001B[0m`); + } else args[0] = `${getDate()}${name} ${args[0]}`; +} +function getDate() { + if (inspectOpts.hideDate) return ""; + return `${(/* @__PURE__ */ new Date()).toISOString()} `; +} +function init$1(debug$18) { + debug$18.inspectOpts = Object.assign({}, inspectOpts); +} +var require$1, colors$35, inspectOpts, humanize$1, createDebug, node_default; +var init_node = __esmMin((() => { + init_core(); + require$1 = createRequire(import.meta.url); + colors$35 = process.stderr.getColorDepth && process.stderr.getColorDepth() > 2 ? [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ] : [ + 6, + 2, + 3, + 4, + 5, + 1 + ]; + inspectOpts = Object.keys(process.env).filter((key) => { + return /^debug_/i.test(key); + }).reduce((obj, key) => { + const prop = key.slice(6).toLowerCase().replace(/_([a-z])/g, (_, k) => k.toUpperCase()); + let value$1 = process.env[key]; + if (value$1 === "null") value$1 = null; + else if (/^yes|on|true|enabled$/i.test(value$1)) value$1 = true; + else if (/^no|off|false|disabled$/i.test(value$1)) value$1 = false; + else value$1 = Number(value$1); + obj[prop] = value$1; + return obj; + }, {}); + ; + try { + humanize$1 = require$1("ms"); + } catch (_unused) { + humanize$1 = humanize; + } + createDebug = setup(useColors(), colors$35, log$2, load$1, save, formatArgs, init$1); + createDebug.inspectOpts = inspectOpts; + createDebug.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); + }; + createDebug.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return inspect(v, this.inspectOpts); + }; + node_default = createDebug; + createDebug.default = createDebug; + createDebug.debug = createDebug; +})); + +//#endregion +//#region ../../node_modules/.pnpm/estree-walker@2.0.2/node_modules/estree-walker/dist/esm/estree-walker.js +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef {{ +skip: () => void; +remove: () => void; +replace: (node: BaseNode) => void; +}} WalkerContext */ +var WalkerBase$1 = class { + constructor() { + /** @type {boolean} */ + this.should_skip = false; + /** @type {boolean} */ + this.should_remove = false; + /** @type {BaseNode | null} */ + this.replacement = null; + /** @type {WalkerContext} */ + this.context = { + skip: () => this.should_skip = true, + remove: () => this.should_remove = true, + replace: (node) => this.replacement = node + }; + } + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + * @param {BaseNode} node + */ + replace(parent, prop, index, node) { + if (parent) if (index !== null) parent[prop][index] = node; + else parent[prop] = node; + } + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + */ + remove(parent, prop, index) { + if (parent) if (index !== null) parent[prop].splice(index, 1); + else delete parent[prop]; + } +}; +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./walker.js').WalkerContext} WalkerContext */ +/** @typedef {( +* this: WalkerContext, +* node: BaseNode, +* parent: BaseNode, +* key: string, +* index: number +* ) => void} SyncHandler */ +var SyncWalker$1 = class extends WalkerBase$1 { + /** + * + * @param {SyncHandler} enter + * @param {SyncHandler} leave + */ + constructor(enter, leave) { + super(); + /** @type {SyncHandler} */ + this.enter = enter; + /** @type {SyncHandler} */ + this.leave = leave; + } + /** + * + * @param {BaseNode} node + * @param {BaseNode} parent + * @param {string} [prop] + * @param {number} [index] + * @returns {BaseNode} + */ + visit(node, parent, prop, index) { + if (node) { + if (this.enter) { + const _should_skip = this.should_skip; + const _should_remove = this.should_remove; + const _replacement = this.replacement; + this.should_skip = false; + this.should_remove = false; + this.replacement = null; + this.enter.call(this.context, node, parent, prop, index); + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + if (this.should_remove) this.remove(parent, prop, index); + const skipped = this.should_skip; + const removed = this.should_remove; + this.should_skip = _should_skip; + this.should_remove = _should_remove; + this.replacement = _replacement; + if (skipped) return node; + if (removed) return null; + } + for (const key in node) { + const value$1 = node[key]; + if (typeof value$1 !== "object") continue; + else if (Array.isArray(value$1)) { + for (let i$1 = 0; i$1 < value$1.length; i$1 += 1) if (value$1[i$1] !== null && typeof value$1[i$1].type === "string") { + if (!this.visit(value$1[i$1], node, key, i$1)) i$1--; + } + } else if (value$1 !== null && typeof value$1.type === "string") this.visit(value$1, node, key, null); + } + if (this.leave) { + const _replacement = this.replacement; + const _should_remove = this.should_remove; + this.replacement = null; + this.should_remove = false; + this.leave.call(this.context, node, parent, prop, index); + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + if (this.should_remove) this.remove(parent, prop, index); + const removed = this.should_remove; + this.replacement = _replacement; + this.should_remove = _should_remove; + if (removed) return null; + } + } + return node; + } +}; +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./sync.js').SyncHandler} SyncHandler */ +/** @typedef { import('./async.js').AsyncHandler} AsyncHandler */ +/** +* +* @param {BaseNode} ast +* @param {{ +* enter?: SyncHandler +* leave?: SyncHandler +* }} walker +* @returns {BaseNode} +*/ +function walk$2(ast, { enter, leave }) { + return new SyncWalker$1(enter, leave).visit(ast, null); +} + +//#endregion +//#region ../../node_modules/.pnpm/@rollup+pluginutils@5.3.0_rollup@4.43.0/node_modules/@rollup/pluginutils/dist/es/index.js +const extractors = { + ArrayPattern(names, param) { + for (const element of param.elements) if (element) extractors[element.type](names, element); + }, + AssignmentPattern(names, param) { + extractors[param.left.type](names, param.left); + }, + Identifier(names, param) { + names.push(param.name); + }, + MemberExpression() {}, + ObjectPattern(names, param) { + for (const prop of param.properties) if (prop.type === "RestElement") extractors.RestElement(names, prop); + else extractors[prop.value.type](names, prop.value); + }, + RestElement(names, param) { + extractors[param.argument.type](names, param.argument); + } +}; +const extractAssignedNames = function extractAssignedNames$1(param) { + const names = []; + extractors[param.type](names, param); + return names; +}; +const blockDeclarations = { + const: true, + let: true +}; +var Scope = class { + constructor(options$1 = {}) { + this.parent = options$1.parent; + this.isBlockScope = !!options$1.block; + this.declarations = Object.create(null); + if (options$1.params) options$1.params.forEach((param) => { + extractAssignedNames(param).forEach((name) => { + this.declarations[name] = true; + }); + }); + } + addDeclaration(node, isBlockDeclaration, isVar) { + if (!isBlockDeclaration && this.isBlockScope) this.parent.addDeclaration(node, isBlockDeclaration, isVar); + else if (node.id) extractAssignedNames(node.id).forEach((name) => { + this.declarations[name] = true; + }); + } + contains(name) { + return this.declarations[name] || (this.parent ? this.parent.contains(name) : false); + } +}; +const attachScopes = function attachScopes$1(ast, propertyName = "scope") { + let scope = new Scope(); + walk$2(ast, { + enter(n$2, parent) { + const node = n$2; + if (/(?:Function|Class)Declaration/.test(node.type)) scope.addDeclaration(node, false, false); + if (node.type === "VariableDeclaration") { + const { kind } = node; + const isBlockDeclaration = blockDeclarations[kind]; + node.declarations.forEach((declaration) => { + scope.addDeclaration(declaration, isBlockDeclaration, true); + }); + } + let newScope; + if (node.type.includes("Function")) { + const func = node; + newScope = new Scope({ + parent: scope, + block: false, + params: func.params + }); + if (func.type === "FunctionExpression" && func.id) newScope.addDeclaration(func, false, false); + } + if (/For(?:In|Of)?Statement/.test(node.type)) newScope = new Scope({ + parent: scope, + block: true + }); + if (node.type === "BlockStatement" && !parent.type.includes("Function")) newScope = new Scope({ + parent: scope, + block: true + }); + if (node.type === "CatchClause") newScope = new Scope({ + parent: scope, + params: node.param ? [node.param] : [], + block: true + }); + if (newScope) { + Object.defineProperty(node, propertyName, { + value: newScope, + configurable: true + }); + scope = newScope; + } + }, + leave(n$2) { + if (n$2[propertyName]) scope = scope.parent; + } + }); + return scope; +}; +function isArray(arg) { + return Array.isArray(arg); +} +function ensureArray(thing) { + if (isArray(thing)) return thing; + if (thing == null) return []; + return [thing]; +} +const normalizePathRegExp = new RegExp(`\\${win32.sep}`, "g"); +const normalizePath$3 = function normalizePath$5(filename) { + return filename.replace(normalizePathRegExp, posix$1.sep); +}; +function getMatcherString$1(id, resolutionBase) { + if (resolutionBase === false || isAbsolute$1(id) || id.startsWith("**")) return normalizePath$3(id); + const basePath = normalizePath$3(resolve$1(resolutionBase || "")).replace(/[-^$*+?.()|[\]{}]/g, "\\$&"); + return posix$1.join(basePath, normalizePath$3(id)); +} +const createFilter$2 = function createFilter$3(include, exclude, options$1) { + const resolutionBase = options$1 && options$1.resolve; + const getMatcher = (id) => id instanceof RegExp ? id : { test: (what) => { + return picomatch(getMatcherString$1(id, resolutionBase), { dot: true })(what); + } }; + const includeMatchers = ensureArray(include).map(getMatcher); + const excludeMatchers = ensureArray(exclude).map(getMatcher); + if (!includeMatchers.length && !excludeMatchers.length) return (id) => typeof id === "string" && !id.includes("\0"); + return function result(id) { + if (typeof id !== "string") return false; + if (id.includes("\0")) return false; + const pathId = normalizePath$3(id); + for (let i$1 = 0; i$1 < excludeMatchers.length; ++i$1) { + const matcher = excludeMatchers[i$1]; + if (matcher instanceof RegExp) matcher.lastIndex = 0; + if (matcher.test(pathId)) return false; + } + for (let i$1 = 0; i$1 < includeMatchers.length; ++i$1) { + const matcher = includeMatchers[i$1]; + if (matcher instanceof RegExp) matcher.lastIndex = 0; + if (matcher.test(pathId)) return true; + } + return !includeMatchers.length; + }; +}; +const forbiddenIdentifiers = new Set(`break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl`.split(" ")); +forbiddenIdentifiers.add(""); +const makeLegalIdentifier = function makeLegalIdentifier$1(str) { + let identifier = str.replace(/-(\w)/g, (_, letter) => letter.toUpperCase()).replace(/[^$_a-zA-Z0-9]/g, "_"); + if (/\d/.test(identifier[0]) || forbiddenIdentifiers.has(identifier)) identifier = `_${identifier}`; + return identifier || "_"; +}; +function stringify$4(obj) { + return (JSON.stringify(obj) || "undefined").replace(/[\u2028\u2029]/g, (char) => `\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`); +} +function serializeArray(arr, indent, baseIndent) { + let output = "["; + const separator = indent ? `\n${baseIndent}${indent}` : ""; + for (let i$1 = 0; i$1 < arr.length; i$1++) { + const key = arr[i$1]; + output += `${i$1 > 0 ? "," : ""}${separator}${serialize(key, indent, baseIndent + indent)}`; + } + return `${output}${indent ? `\n${baseIndent}` : ""}]`; +} +function serializeObject(obj, indent, baseIndent) { + let output = "{"; + const separator = indent ? `\n${baseIndent}${indent}` : ""; + const entries = Object.entries(obj); + for (let i$1 = 0; i$1 < entries.length; i$1++) { + const [key, value$1] = entries[i$1]; + const stringKey = makeLegalIdentifier(key) === key ? key : stringify$4(key); + output += `${i$1 > 0 ? "," : ""}${separator}${stringKey}:${indent ? " " : ""}${serialize(value$1, indent, baseIndent + indent)}`; + } + return `${output}${indent ? `\n${baseIndent}` : ""}}`; +} +function serialize(obj, indent, baseIndent) { + if (typeof obj === "object" && obj !== null) { + if (Array.isArray(obj)) return serializeArray(obj, indent, baseIndent); + if (obj instanceof Date) return `new Date(${obj.getTime()})`; + if (obj instanceof RegExp) return obj.toString(); + return serializeObject(obj, indent, baseIndent); + } + if (typeof obj === "number") { + if (obj === Infinity) return "Infinity"; + if (obj === -Infinity) return "-Infinity"; + if (obj === 0) return 1 / obj === Infinity ? "0" : "-0"; + if (obj !== obj) return "NaN"; + } + if (typeof obj === "symbol") { + const key = Symbol.keyFor(obj); + if (key !== void 0) return `Symbol.for(${stringify$4(key)})`; + } + if (typeof obj === "bigint") return `${obj}n`; + return stringify$4(obj); +} +const hasStringIsWellFormed = "isWellFormed" in String.prototype; +function isWellFormedString(input) { + if (hasStringIsWellFormed) return input.isWellFormed(); + return !/\p{Surrogate}/u.test(input); +} +const dataToEsm = function dataToEsm$1(data, options$1 = {}) { + var _a, _b; + const t$1 = options$1.compact ? "" : "indent" in options$1 ? options$1.indent : " "; + const _ = options$1.compact ? "" : " "; + const n$2 = options$1.compact ? "" : "\n"; + const declarationType = options$1.preferConst ? "const" : "var"; + if (options$1.namedExports === false || typeof data !== "object" || Array.isArray(data) || data instanceof Date || data instanceof RegExp || data === null) { + const code = serialize(data, options$1.compact ? null : t$1, ""); + return `export default${_ || (/^[{[\-\/]/.test(code) ? "" : " ")}${code};`; + } + let maxUnderbarPrefixLength = 0; + for (const key of Object.keys(data)) { + const underbarPrefixLength = (_b = (_a = /^(_+)/.exec(key)) === null || _a === void 0 ? void 0 : _a[0].length) !== null && _b !== void 0 ? _b : 0; + if (underbarPrefixLength > maxUnderbarPrefixLength) maxUnderbarPrefixLength = underbarPrefixLength; + } + const arbitraryNamePrefix = `${"_".repeat(maxUnderbarPrefixLength + 1)}arbitrary`; + let namedExportCode = ""; + const defaultExportRows = []; + const arbitraryNameExportRows = []; + for (const [key, value$1] of Object.entries(data)) if (key === makeLegalIdentifier(key)) { + if (options$1.objectShorthand) defaultExportRows.push(key); + else defaultExportRows.push(`${key}:${_}${key}`); + namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value$1, options$1.compact ? null : t$1, "")};${n$2}`; + } else { + defaultExportRows.push(`${stringify$4(key)}:${_}${serialize(value$1, options$1.compact ? null : t$1, "")}`); + if (options$1.includeArbitraryNames && isWellFormedString(key)) { + const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`; + namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value$1, options$1.compact ? null : t$1, "")};${n$2}`; + arbitraryNameExportRows.push(`${variableName} as ${JSON.stringify(key)}`); + } + } + const arbitraryExportCode = arbitraryNameExportRows.length > 0 ? `export${_}{${n$2}${t$1}${arbitraryNameExportRows.join(`,${n$2}${t$1}`)}${n$2}};${n$2}` : ""; + const defaultExportCode = `export default${_}{${n$2}${t$1}${defaultExportRows.join(`,${n$2}${t$1}`)}${n$2}};${n$2}`; + return `${namedExportCode}${arbitraryExportCode}${defaultExportCode}`; +}; + +//#endregion +//#region src/shared/builtin.ts +function createIsBuiltin(builtins) { + const plainBuiltinsSet = new Set(builtins.filter((builtin) => typeof builtin === "string")); + const regexBuiltins = builtins.filter((builtin) => typeof builtin !== "string"); + return (id) => plainBuiltinsSet.has(id) || regexBuiltins.some((regexp) => regexp.test(id)); +} + +//#endregion +//#region src/node/packages.ts +let pnp; +if (process.versions.pnp) try { + pnp = createRequire( + /** #__KEEP__ */ + import.meta.url + )("pnpapi"); +} catch {} +function invalidatePackageData(packageCache, pkgPath) { + const pkgDir = normalizePath(path.dirname(pkgPath)); + packageCache.forEach((pkg, cacheKey) => { + if (pkg.dir === pkgDir) packageCache.delete(cacheKey); + }); +} +function resolvePackageData(pkgName, basedir, preserveSymlinks = false, packageCache) { + if (pnp) { + const cacheKey = getRpdCacheKey(pkgName, basedir, preserveSymlinks); + if (packageCache?.has(cacheKey)) return packageCache.get(cacheKey); + try { + const pkg = pnp.resolveToUnqualified(pkgName, basedir, { considerBuiltins: false }); + if (!pkg) return null; + const pkgData = loadPackageData(path.join(pkg, "package.json")); + packageCache?.set(cacheKey, pkgData); + return pkgData; + } catch { + return null; + } + } + const originalBasedir = basedir; + while (basedir) { + if (packageCache) { + const cached = getRpdCache(packageCache, pkgName, basedir, originalBasedir, preserveSymlinks); + if (cached) return cached; + } + const pkg = path.join(basedir, "node_modules", pkgName, "package.json"); + try { + if (fs.existsSync(pkg)) { + const pkgData = loadPackageData(preserveSymlinks ? pkg : safeRealpathSync(pkg)); + if (packageCache) setRpdCache(packageCache, pkgData, pkgName, basedir, originalBasedir, preserveSymlinks); + return pkgData; + } + } catch {} + const nextBasedir = path.dirname(basedir); + if (nextBasedir === basedir) break; + basedir = nextBasedir; + } + return null; +} +function findNearestPackageData(basedir, packageCache) { + const originalBasedir = basedir; + while (basedir) { + if (packageCache) { + const cached = getFnpdCache(packageCache, basedir, originalBasedir); + if (cached) return cached; + } + const pkgPath = path.join(basedir, "package.json"); + if (tryStatSync(pkgPath)?.isFile()) try { + const pkgData = loadPackageData(pkgPath); + if (packageCache) setFnpdCache(packageCache, pkgData, basedir, originalBasedir); + return pkgData; + } catch {} + const nextBasedir = path.dirname(basedir); + if (nextBasedir === basedir) break; + basedir = nextBasedir; + } + return null; +} +function findNearestMainPackageData(basedir, packageCache) { + const nearestPackage = findNearestPackageData(basedir, packageCache); + return nearestPackage && (nearestPackage.data.name ? nearestPackage : findNearestMainPackageData(path.dirname(nearestPackage.dir), packageCache)); +} +function loadPackageData(pkgPath) { + const data = JSON.parse(stripBomTag(fs.readFileSync(pkgPath, "utf-8"))); + const pkgDir = normalizePath(path.dirname(pkgPath)); + const { sideEffects } = data; + let hasSideEffects; + if (typeof sideEffects === "boolean") hasSideEffects = () => sideEffects; + else if (Array.isArray(sideEffects)) if (sideEffects.length <= 0) hasSideEffects = () => false; + else hasSideEffects = createFilter(sideEffects.map((sideEffect) => { + if (sideEffect.includes("/")) return sideEffect; + return `**/${sideEffect}`; + }), null, { resolve: pkgDir }); + else hasSideEffects = () => null; + const resolvedCache = {}; + return { + dir: pkgDir, + data, + hasSideEffects, + setResolvedCache(key, entry, options$1) { + resolvedCache[getResolveCacheKey(key, options$1)] = entry; + }, + getResolvedCache(key, options$1) { + return resolvedCache[getResolveCacheKey(key, options$1)]; + } + }; +} +function getResolveCacheKey(key, options$1) { + return [ + key, + options$1.isRequire ? "1" : "0", + options$1.conditions.join("_"), + options$1.extensions.join("_"), + options$1.mainFields.join("_") + ].join("|"); +} +function findNearestNodeModules(basedir) { + while (basedir) { + const pkgPath = path.join(basedir, "node_modules"); + if (tryStatSync(pkgPath)?.isDirectory()) return pkgPath; + const nextBasedir = path.dirname(basedir); + if (nextBasedir === basedir) break; + basedir = nextBasedir; + } + return null; +} +function watchPackageDataPlugin(packageCache) { + const watchQueue = /* @__PURE__ */ new Set(); + const watchedDirs = /* @__PURE__ */ new Set(); + const watchFileStub = (id) => { + watchQueue.add(id); + }; + let watchFile = watchFileStub; + const setPackageData = packageCache.set.bind(packageCache); + packageCache.set = (id, pkg) => { + if (!isInNodeModules(pkg.dir) && !watchedDirs.has(pkg.dir)) { + watchedDirs.add(pkg.dir); + watchFile(path.join(pkg.dir, "package.json")); + } + return setPackageData(id, pkg); + }; + return { + name: "vite:watch-package-data", + buildStart() { + watchFile = this.addWatchFile.bind(this); + watchQueue.forEach(watchFile); + watchQueue.clear(); + }, + buildEnd() { + watchFile = watchFileStub; + }, + watchChange(id) { + if (id.endsWith("/package.json")) invalidatePackageData(packageCache, path.normalize(id)); + } + }; +} +/** +* Get cached `resolvePackageData` value based on `basedir`. When one is found, +* and we've already traversed some directories between `basedir` and `originalBasedir`, +* we cache the value for those in-between directories as well. +* +* This makes it so the fs is only read once for a shared `basedir`. +*/ +function getRpdCache(packageCache, pkgName, basedir, originalBasedir, preserveSymlinks) { + const cacheKey = getRpdCacheKey(pkgName, basedir, preserveSymlinks); + const pkgData = packageCache.get(cacheKey); + if (pkgData) { + traverseBetweenDirs(originalBasedir, basedir, (dir) => { + packageCache.set(getRpdCacheKey(pkgName, dir, preserveSymlinks), pkgData); + }); + return pkgData; + } +} +function setRpdCache(packageCache, pkgData, pkgName, basedir, originalBasedir, preserveSymlinks) { + packageCache.set(getRpdCacheKey(pkgName, basedir, preserveSymlinks), pkgData); + traverseBetweenDirs(originalBasedir, basedir, (dir) => { + packageCache.set(getRpdCacheKey(pkgName, dir, preserveSymlinks), pkgData); + }); +} +function getRpdCacheKey(pkgName, basedir, preserveSymlinks) { + return `rpd_${pkgName}_${basedir}_${preserveSymlinks}`; +} +/** +* Get cached `findNearestPackageData` value based on `basedir`. When one is found, +* and we've already traversed some directories between `basedir` and `originalBasedir`, +* we cache the value for those in-between directories as well. +* +* This makes it so the fs is only read once for a shared `basedir`. +*/ +function getFnpdCache(packageCache, basedir, originalBasedir) { + const cacheKey = getFnpdCacheKey(basedir); + const pkgData = packageCache.get(cacheKey); + if (pkgData) { + traverseBetweenDirs(originalBasedir, basedir, (dir) => { + packageCache.set(getFnpdCacheKey(dir), pkgData); + }); + return pkgData; + } +} +function setFnpdCache(packageCache, pkgData, basedir, originalBasedir) { + packageCache.set(getFnpdCacheKey(basedir), pkgData); + traverseBetweenDirs(originalBasedir, basedir, (dir) => { + packageCache.set(getFnpdCacheKey(dir), pkgData); + }); +} +function getFnpdCacheKey(basedir) { + return `fnpd_${basedir}`; +} +/** +* Traverse between `longerDir` (inclusive) and `shorterDir` (exclusive) and call `cb` for each dir. +* @param longerDir Longer dir path, e.g. `/User/foo/bar/baz` +* @param shorterDir Shorter dir path, e.g. `/User/foo` +*/ +function traverseBetweenDirs(longerDir, shorterDir, cb) { + while (longerDir !== shorterDir) { + cb(longerDir); + longerDir = path.dirname(longerDir); + } +} + +//#endregion +//#region src/node/utils.ts +var import_picocolors$33 = /* @__PURE__ */ __toESM(require_picocolors(), 1); +init_node(); +const createFilter = createFilter$2; +const replaceSlashOrColonRE = /[/:]/g; +const replaceDotRE = /\./g; +const replaceNestedIdRE = /\s*>\s*/g; +const replaceHashRE = /#/g; +const flattenId = (id) => { + return limitFlattenIdLength(id.replace(replaceSlashOrColonRE, "_").replace(replaceDotRE, "__").replace(replaceNestedIdRE, "___").replace(replaceHashRE, "____")); +}; +const FLATTEN_ID_HASH_LENGTH = 8; +const FLATTEN_ID_MAX_FILE_LENGTH = 170; +const limitFlattenIdLength = (id, limit = FLATTEN_ID_MAX_FILE_LENGTH) => { + if (id.length <= limit) return id; + return id.slice(0, limit - (FLATTEN_ID_HASH_LENGTH + 1)) + "_" + getHash(id); +}; +const normalizeId = (id) => id.replace(replaceNestedIdRE, " > "); +const NODE_BUILTIN_NAMESPACE = "node:"; +const BUN_BUILTIN_NAMESPACE = "bun:"; +const nodeBuiltins = builtinModules.filter((id) => !id.includes(":")); +const isBuiltinCache = /* @__PURE__ */ new WeakMap(); +function isBuiltin(builtins, id) { + let isBuiltin$1 = isBuiltinCache.get(builtins); + if (!isBuiltin$1) { + isBuiltin$1 = createIsBuiltin(builtins); + isBuiltinCache.set(builtins, isBuiltin$1); + } + return isBuiltin$1(id); +} +const nodeLikeBuiltins = [ + ...nodeBuiltins, + /* @__PURE__ */ new RegExp(`^${NODE_BUILTIN_NAMESPACE}`), + /* @__PURE__ */ new RegExp(`^${BUN_BUILTIN_NAMESPACE}`) +]; +function isNodeLikeBuiltin(id) { + return isBuiltin(nodeLikeBuiltins, id); +} +function isNodeBuiltin(id) { + if (id.startsWith(NODE_BUILTIN_NAMESPACE)) return true; + return nodeBuiltins.includes(id); +} +function isInNodeModules(id) { + return id.includes("node_modules"); +} +function moduleListContains(moduleList, id) { + return moduleList?.some((m) => m === id || id.startsWith(withTrailingSlash(m))); +} +function isOptimizable(id, optimizeDeps$1) { + const { extensions: extensions$1 } = optimizeDeps$1; + return OPTIMIZABLE_ENTRY_RE.test(id) || (extensions$1?.some((ext) => id.endsWith(ext)) ?? false); +} +const bareImportRE = /^(?![a-zA-Z]:)[\w@](?!.*:\/\/)/; +const deepImportRE = /^([^@][^/]*)\/|^(@[^/]+\/[^/]+)\//; +const _dirname = path.dirname(fileURLToPath( + /** #__KEEP__ */ + import.meta.url +)); +const rollupVersion = resolvePackageData("rollup", _dirname, true)?.data.version ?? ""; +const filter = process.env.VITE_DEBUG_FILTER; +const DEBUG = process.env.DEBUG; +function createDebugger(namespace, options$1 = {}) { + const log$3 = node_default(namespace); + const { onlyWhenFocused, depth } = options$1; + if (depth && log$3.inspectOpts && log$3.inspectOpts.depth == null) log$3.inspectOpts.depth = options$1.depth; + let enabled = log$3.enabled; + if (enabled && onlyWhenFocused) enabled = !!DEBUG?.includes(typeof onlyWhenFocused === "string" ? onlyWhenFocused : namespace); + if (enabled) return (...args) => { + if (!filter || args.some((a) => a?.includes?.(filter))) log$3(...args); + }; +} +function testCaseInsensitiveFS() { + if (!CLIENT_ENTRY.endsWith("client.mjs")) throw new Error(`cannot test case insensitive FS, CLIENT_ENTRY const doesn't contain client.mjs`); + if (!fs.existsSync(CLIENT_ENTRY)) throw new Error("cannot test case insensitive FS, CLIENT_ENTRY does not point to an existing file: " + CLIENT_ENTRY); + return fs.existsSync(CLIENT_ENTRY.replace("client.mjs", "cLiEnT.mjs")); +} +const isCaseInsensitiveFS = testCaseInsensitiveFS(); +const VOLUME_RE = /^[A-Z]:/i; +function normalizePath(id) { + return path.posix.normalize(isWindows ? slash(id) : id); +} +function fsPathFromId(id) { + const fsPath = normalizePath(id.startsWith(FS_PREFIX) ? id.slice(FS_PREFIX.length) : id); + return fsPath[0] === "/" || VOLUME_RE.test(fsPath) ? fsPath : `/${fsPath}`; +} +function fsPathFromUrl(url$3) { + return fsPathFromId(cleanUrl(url$3)); +} +/** +* Check if dir is a parent of file +* +* Warning: parameters are not validated, only works with normalized absolute paths +* +* @param dir - normalized absolute path +* @param file - normalized absolute path +* @returns true if dir is a parent of file +*/ +function isParentDirectory(dir, file) { + dir = withTrailingSlash(dir); + return file.startsWith(dir) || isCaseInsensitiveFS && file.toLowerCase().startsWith(dir.toLowerCase()); +} +/** +* Check if 2 file name are identical +* +* Warning: parameters are not validated, only works with normalized absolute paths +* +* @param file1 - normalized absolute path +* @param file2 - normalized absolute path +* @returns true if both files url are identical +*/ +function isSameFilePath(file1, file2) { + return file1 === file2 || isCaseInsensitiveFS && file1.toLowerCase() === file2.toLowerCase(); +} +const externalRE = /^([a-z]+:)?\/\//; +const isExternalUrl = (url$3) => externalRE.test(url$3); +const dataUrlRE = /^\s*data:/i; +const isDataUrl = (url$3) => dataUrlRE.test(url$3); +const virtualModuleRE = /^virtual-module:.*/; +const virtualModulePrefix = "virtual-module:"; +const knownJsSrcRE = /\.(?:[jt]sx?|m[jt]s|vue|marko|svelte|astro|imba|mdx)(?:$|\?)/; +const isJSRequest = (url$3) => { + url$3 = cleanUrl(url$3); + if (knownJsSrcRE.test(url$3)) return true; + if (!path.extname(url$3) && url$3[url$3.length - 1] !== "/") return true; + return false; +}; +const isCSSRequest = (request) => CSS_LANGS_RE.test(request); +const importQueryRE = /(\?|&)import=?(?:&|$)/; +const directRequestRE$1 = /(\?|&)direct=?(?:&|$)/; +const internalPrefixes = [ + FS_PREFIX, + VALID_ID_PREFIX, + CLIENT_PUBLIC_PATH, + ENV_PUBLIC_PATH +]; +const InternalPrefixRE = /* @__PURE__ */ new RegExp(`^(?:${internalPrefixes.join("|")})`); +const trailingSeparatorRE = /[?&]$/; +const isImportRequest = (url$3) => importQueryRE.test(url$3); +const isInternalRequest = (url$3) => InternalPrefixRE.test(url$3); +function removeImportQuery(url$3) { + return url$3.replace(importQueryRE, "$1").replace(trailingSeparatorRE, ""); +} +function removeDirectQuery(url$3) { + return url$3.replace(directRequestRE$1, "$1").replace(trailingSeparatorRE, ""); +} +const urlRE = /(\?|&)url(?:&|$)/; +const rawRE = /(\?|&)raw(?:&|$)/; +function removeUrlQuery(url$3) { + return url$3.replace(urlRE, "$1").replace(trailingSeparatorRE, ""); +} +function injectQuery(url$3, queryToInject) { + const { file, postfix } = splitFileAndPostfix(url$3); + return `${isWindows ? slash(file) : file}?${queryToInject}${postfix[0] === "?" ? `&${postfix.slice(1)}` : postfix}`; +} +const timestampRE = /\bt=\d{13}&?\b/; +function removeTimestampQuery(url$3) { + return url$3.replace(timestampRE, "").replace(trailingSeparatorRE, ""); +} +async function asyncReplace(input, re, replacer) { + let match; + let remaining = input; + let rewritten = ""; + while (match = re.exec(remaining)) { + rewritten += remaining.slice(0, match.index); + rewritten += await replacer(match); + remaining = remaining.slice(match.index + match[0].length); + } + rewritten += remaining; + return rewritten; +} +function timeFrom(start, subtract = 0) { + const time = performance$1.now() - start - subtract; + const timeString = (time.toFixed(2) + `ms`).padEnd(5, " "); + if (time < 10) return import_picocolors$33.default.green(timeString); + else if (time < 50) return import_picocolors$33.default.yellow(timeString); + else return import_picocolors$33.default.red(timeString); +} +/** +* pretty url for logging. +*/ +function prettifyUrl(url$3, root) { + url$3 = removeTimestampQuery(url$3); + const isAbsoluteFile = url$3.startsWith(root); + if (isAbsoluteFile || url$3.startsWith(FS_PREFIX)) { + const file = path.posix.relative(root, isAbsoluteFile ? url$3 : fsPathFromId(url$3)); + return import_picocolors$33.default.dim(file); + } else return import_picocolors$33.default.dim(url$3); +} +function isObject(value$1) { + return Object.prototype.toString.call(value$1) === "[object Object]"; +} +function isDefined(value$1) { + return value$1 != null; +} +function tryStatSync(file) { + try { + return fs.statSync(file, { throwIfNoEntry: false }); + } catch {} +} +function lookupFile(dir, fileNames) { + while (dir) { + for (const fileName of fileNames) { + const fullPath = path.join(dir, fileName); + if (tryStatSync(fullPath)?.isFile()) return fullPath; + } + const parentDir$1 = path.dirname(dir); + if (parentDir$1 === dir) return; + dir = parentDir$1; + } +} +function isFilePathESM(filePath, packageCache) { + if (/\.m[jt]s$/.test(filePath)) return true; + else if (/\.c[jt]s$/.test(filePath)) return false; + else try { + return findNearestPackageData(path.dirname(filePath), packageCache)?.data.type === "module"; + } catch { + return false; + } +} +const splitRE = /\r?\n/g; +const range = 2; +function pad$1(source, n$2 = 2) { + return source.split(splitRE).map((l) => ` `.repeat(n$2) + l).join(`\n`); +} +function posToNumber(source, pos) { + if (typeof pos === "number") return pos; + const lines = source.split(splitRE); + const { line, column } = pos; + let start = 0; + for (let i$1 = 0; i$1 < line - 1 && i$1 < lines.length; i$1++) start += lines[i$1].length + 1; + return start + column; +} +function numberToPos(source, offset$1) { + if (typeof offset$1 !== "number") return offset$1; + if (offset$1 > source.length) throw new Error(`offset is longer than source length! offset ${offset$1} > length ${source.length}`); + const lines = source.slice(0, offset$1).split(splitRE); + return { + line: lines.length, + column: lines[lines.length - 1].length + }; +} +const MAX_DISPLAY_LEN = 120; +const ELLIPSIS = "..."; +function generateCodeFrame(source, start = 0, end) { + start = Math.max(posToNumber(source, start), 0); + end = Math.min(end !== void 0 ? posToNumber(source, end) : start, source.length); + const lastPosLine = end !== void 0 ? numberToPos(source, end).line : numberToPos(source, start).line + range; + const lineNumberWidth = Math.max(3, String(lastPosLine).length + 1); + const lines = source.split(splitRE); + let count = 0; + const res = []; + for (let i$1 = 0; i$1 < lines.length; i$1++) { + count += lines[i$1].length; + if (count >= start) { + for (let j = i$1 - range; j <= i$1 + range || end > count; j++) { + if (j < 0 || j >= lines.length) continue; + const line = j + 1; + const lineLength = lines[j].length; + const pad$2 = Math.max(start - (count - lineLength), 0); + const underlineLength = Math.max(1, end > count ? lineLength - pad$2 : end - start); + let displayLine = lines[j]; + let underlinePad = pad$2; + if (lineLength > MAX_DISPLAY_LEN) { + let startIdx = 0; + if (j === i$1) { + if (underlineLength > MAX_DISPLAY_LEN) startIdx = pad$2; + else { + const center = pad$2 + Math.floor(underlineLength / 2); + startIdx = Math.max(0, center - Math.floor(MAX_DISPLAY_LEN / 2)); + } + underlinePad = Math.max(0, pad$2 - startIdx) + (startIdx > 0 ? 3 : 0); + } + const prefix = startIdx > 0 ? ELLIPSIS : ""; + const suffix = lineLength - startIdx > MAX_DISPLAY_LEN ? ELLIPSIS : ""; + const sliceLen = MAX_DISPLAY_LEN - prefix.length - suffix.length; + displayLine = prefix + displayLine.slice(startIdx, startIdx + sliceLen) + suffix; + } + res.push(`${line}${" ".repeat(lineNumberWidth - String(line).length)}| ${displayLine}`); + if (j === i$1) { + const underline = "^".repeat(Math.min(underlineLength, MAX_DISPLAY_LEN)); + res.push(`${" ".repeat(lineNumberWidth)}| ` + " ".repeat(underlinePad) + underline); + } else if (j > i$1) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + const underline = "^".repeat(Math.min(length, MAX_DISPLAY_LEN)); + res.push(`${" ".repeat(lineNumberWidth)}| ` + underline); + } + count += lineLength + 1; + } + } + break; + } + count++; + } + return res.join("\n"); +} +function isFileReadable(filename) { + if (!tryStatSync(filename)) return false; + try { + fs.accessSync(filename, fs.constants.R_OK); + return true; + } catch { + return false; + } +} +const splitFirstDirRE = /(.+?)[\\/](.+)/; +/** +* Delete every file and subdirectory. **The given directory must exist.** +* Pass an optional `skip` array to preserve files under the root directory. +*/ +function emptyDir(dir, skip) { + const skipInDir = []; + let nested = null; + if (skip?.length) for (const file of skip) if (path.dirname(file) !== ".") { + const matched = splitFirstDirRE.exec(file); + if (matched) { + nested ??= /* @__PURE__ */ new Map(); + const [, nestedDir, skipPath] = matched; + let nestedSkip = nested.get(nestedDir); + if (!nestedSkip) { + nestedSkip = []; + nested.set(nestedDir, nestedSkip); + } + if (!nestedSkip.includes(skipPath)) nestedSkip.push(skipPath); + } + } else skipInDir.push(file); + for (const file of fs.readdirSync(dir)) { + if (skipInDir.includes(file)) continue; + if (nested?.has(file)) emptyDir(path.resolve(dir, file), nested.get(file)); + else fs.rmSync(path.resolve(dir, file), { + recursive: true, + force: true + }); + } +} +function copyDir(srcDir, destDir) { + fs.mkdirSync(destDir, { recursive: true }); + for (const file of fs.readdirSync(srcDir)) { + const srcFile = path.resolve(srcDir, file); + if (srcFile === destDir) continue; + const destFile = path.resolve(destDir, file); + if (fs.statSync(srcFile).isDirectory()) copyDir(srcFile, destFile); + else fs.copyFileSync(srcFile, destFile); + } +} +const ERR_SYMLINK_IN_RECURSIVE_READDIR = "ERR_SYMLINK_IN_RECURSIVE_READDIR"; +async function recursiveReaddir(dir) { + if (!fs.existsSync(dir)) return []; + let dirents; + try { + dirents = await fsp.readdir(dir, { withFileTypes: true }); + } catch (e$1) { + if (e$1.code === "EACCES") return []; + throw e$1; + } + if (dirents.some((dirent) => dirent.isSymbolicLink())) { + const err$2 = /* @__PURE__ */ new Error("Symbolic links are not supported in recursiveReaddir"); + err$2.code = ERR_SYMLINK_IN_RECURSIVE_READDIR; + throw err$2; + } + return (await Promise.all(dirents.map((dirent) => { + const res = path.resolve(dir, dirent.name); + return dirent.isDirectory() ? recursiveReaddir(res) : normalizePath(res); + }))).flat(1); +} +let safeRealpathSync = isWindows ? windowsSafeRealPathSync : fs.realpathSync.native; +const windowsNetworkMap = /* @__PURE__ */ new Map(); +function windowsMappedRealpathSync(path$13) { + const realPath = fs.realpathSync.native(path$13); + if (realPath.startsWith("\\\\")) { + for (const [network, volume] of windowsNetworkMap) if (realPath.startsWith(network)) return realPath.replace(network, volume); + } + return realPath; +} +const parseNetUseRE = /^\w* +(\w:) +([^ ]+)\s/; +let firstSafeRealPathSyncRun = false; +function windowsSafeRealPathSync(path$13) { + if (!firstSafeRealPathSyncRun) { + optimizeSafeRealPathSync(); + firstSafeRealPathSyncRun = true; + } + return fs.realpathSync(path$13); +} +function optimizeSafeRealPathSync() { + try { + fs.realpathSync.native(path.resolve("./")); + } catch (error$1) { + if (error$1.message.includes("EISDIR: illegal operation on a directory")) { + safeRealpathSync = fs.realpathSync; + return; + } + } + exec("net use", (error$1, stdout) => { + if (error$1) return; + const lines = stdout.split("\n"); + for (const line of lines) { + const m = parseNetUseRE.exec(line); + if (m) windowsNetworkMap.set(m[2], m[1]); + } + if (windowsNetworkMap.size === 0) safeRealpathSync = fs.realpathSync.native; + else safeRealpathSync = windowsMappedRealpathSync; + }); +} +function ensureWatchedFile(watcher, file, root) { + if (file && !file.startsWith(withTrailingSlash(root)) && !file.includes("\0") && fs.existsSync(file)) watcher.add(path.resolve(file)); +} +function joinSrcset(ret) { + return ret.map(({ url: url$3, descriptor }) => url$3 + (descriptor ? ` ${descriptor}` : "")).join(", "); +} +/** +This regex represents a loose rule of an “image candidate string” and "image set options". + +@see https://html.spec.whatwg.org/multipage/images.html#srcset-attribute +@see https://drafts.csswg.org/css-images-4/#image-set-notation + +The Regex has named capturing groups `url` and `descriptor`. +The `url` group can be: +* any CSS function +* CSS string (single or double-quoted) +* URL string (unquoted) +The `descriptor` is anything after the space and before the comma. +*/ +const imageCandidateRegex = /(?:^|\s|(?<=,))(?[\w-]+\([^)]*\)|"[^"]*"|'[^']*'|[^,]\S*[^,])\s*(?:\s(?\w[^,]+))?(?:,|$)/g; +const escapedSpaceCharacters = /(?: |\\t|\\n|\\f|\\r)+/g; +function parseSrcset(string) { + const matches$2 = string.trim().replace(escapedSpaceCharacters, " ").replace(/\r?\n/, "").replace(/,\s+/, ", ").replaceAll(/\s+/g, " ").matchAll(imageCandidateRegex); + return Array.from(matches$2, ({ groups: groups$1 }) => ({ + url: groups$1?.url?.trim() ?? "", + descriptor: groups$1?.descriptor?.trim() ?? "" + })).filter(({ url: url$3 }) => !!url$3); +} +function processSrcSet(srcs, replacer) { + return Promise.all(parseSrcset(srcs).map(async ({ url: url$3, descriptor }) => ({ + url: await replacer({ + url: url$3, + descriptor + }), + descriptor + }))).then(joinSrcset); +} +function processSrcSetSync(srcs, replacer) { + return joinSrcset(parseSrcset(srcs).map(({ url: url$3, descriptor }) => ({ + url: replacer({ + url: url$3, + descriptor + }), + descriptor + }))); +} +const windowsDriveRE = /^[A-Z]:/; +const replaceWindowsDriveRE = /^([A-Z]):\//; +const linuxAbsolutePathRE = /^\/[^/]/; +function escapeToLinuxLikePath(path$13) { + if (windowsDriveRE.test(path$13)) return path$13.replace(replaceWindowsDriveRE, "/windows/$1/"); + if (linuxAbsolutePathRE.test(path$13)) return `/linux${path$13}`; + return path$13; +} +const revertWindowsDriveRE = /^\/windows\/([A-Z])\//; +function unescapeToLinuxLikePath(path$13) { + if (path$13.startsWith("/linux/")) return path$13.slice(6); + if (path$13.startsWith("/windows/")) return path$13.replace(revertWindowsDriveRE, "$1:/"); + return path$13; +} +const nullSourceMap = { + names: [], + sources: [], + mappings: "", + version: 3 +}; +/** +* Combines multiple sourcemaps into a single sourcemap. +* Note that the length of sourcemapList must be 2. +*/ +function combineSourcemaps(filename, sourcemapList) { + if (sourcemapList.length === 0 || sourcemapList.every((m) => m.sources.length === 0)) return { ...nullSourceMap }; + sourcemapList = sourcemapList.map((sourcemap) => { + const newSourcemaps = { ...sourcemap }; + newSourcemaps.sources = sourcemap.sources.map((source) => source ? escapeToLinuxLikePath(source) : null); + if (sourcemap.sourceRoot) newSourcemaps.sourceRoot = escapeToLinuxLikePath(sourcemap.sourceRoot); + return newSourcemaps; + }); + const escapedFilename = escapeToLinuxLikePath(filename); + let map$1; + let mapIndex = 1; + if (sourcemapList.slice(0, -1).find((m) => m.sources.length !== 1) === void 0) map$1 = remapping(sourcemapList, () => null); + else map$1 = remapping(sourcemapList[0], function loader$1(sourcefile) { + if (sourcefile === escapedFilename && sourcemapList[mapIndex]) return sourcemapList[mapIndex++]; + else return null; + }); + if (!map$1.file) delete map$1.file; + map$1.sources = map$1.sources.map((source) => source ? unescapeToLinuxLikePath(source) : source); + map$1.file = filename; + return map$1; +} +function unique(arr) { + return Array.from(new Set(arr)); +} +/** +* Returns resolved localhost address when `dns.lookup` result differs from DNS +* +* `dns.lookup` result is same when defaultResultOrder is `verbatim`. +* Even if defaultResultOrder is `ipv4first`, `dns.lookup` result maybe same. +* For example, when IPv6 is not supported on that machine/network. +*/ +async function getLocalhostAddressIfDiffersFromDNS() { + const [nodeResult, dnsResult] = await Promise.all([promises$1.lookup("localhost"), promises$1.lookup("localhost", { verbatim: true })]); + return nodeResult.family === dnsResult.family && nodeResult.address === dnsResult.address ? void 0 : nodeResult.address; +} +function diffDnsOrderChange(oldUrls, newUrls) { + return !(oldUrls === newUrls || oldUrls && newUrls && arrayEqual(oldUrls.local, newUrls.local) && arrayEqual(oldUrls.network, newUrls.network)); +} +async function resolveHostname(optionsHost) { + let host; + if (optionsHost === void 0 || optionsHost === false) host = "localhost"; + else if (optionsHost === true) host = void 0; + else host = optionsHost; + let name = host === void 0 || wildcardHosts.has(host) ? "localhost" : host; + if (host === "localhost") { + const localhostAddr = await getLocalhostAddressIfDiffersFromDNS(); + if (localhostAddr) name = localhostAddr; + } + return { + host, + name + }; +} +function extractHostnamesFromCerts(certs) { + const certList = certs ? arraify(certs) : []; + if (certList.length === 0) return []; + return unique(certList.map((cert) => { + try { + return new crypto.X509Certificate(cert); + } catch { + return null; + } + }).flatMap((cert) => cert?.subjectAltName ? extractHostnamesFromSubjectAltName(cert.subjectAltName) : [])); +} +function resolveServerUrls(server, options$1, hostname, httpsOptions, config$2) { + const address = server.address(); + const isAddressInfo = (x) => x?.address; + if (!isAddressInfo(address)) return { + local: [], + network: [] + }; + const local = []; + const network = []; + const protocol = options$1.https ? "https" : "http"; + const port = address.port; + const base = config$2.rawBase === "./" || config$2.rawBase === "" ? "/" : config$2.rawBase; + if (hostname.host !== void 0 && !wildcardHosts.has(hostname.host)) { + let hostnameName = hostname.name; + if (hostnameName.includes(":")) hostnameName = `[${hostnameName}]`; + const address$1 = `${protocol}://${hostnameName}:${port}${base}`; + if (loopbackHosts.has(hostname.host)) local.push(address$1); + else network.push(address$1); + } else Object.values(os.networkInterfaces()).flatMap((nInterface) => nInterface ?? []).filter((detail) => detail.address && detail.family === "IPv4").forEach((detail) => { + let host = detail.address.replace("127.0.0.1", hostname.name); + if (host.includes(":")) host = `[${host}]`; + const url$3 = `${protocol}://${host}:${port}${base}`; + if (detail.address.includes("127.0.0.1")) local.push(url$3); + else network.push(url$3); + }); + const hostnamesFromCert = extractHostnamesFromCerts(httpsOptions?.cert); + if (hostnamesFromCert.length > 0) { + const existings = new Set([...local, ...network]); + local.push(...hostnamesFromCert.map((hostname$1) => `${protocol}://${hostname$1}:${port}${base}`).filter((url$3) => !existings.has(url$3))); + } + return { + local, + network + }; +} +function extractHostnamesFromSubjectAltName(subjectAltName) { + const hostnames = []; + let remaining = subjectAltName; + while (remaining) { + const nameEndIndex = remaining.indexOf(":"); + const name = remaining.slice(0, nameEndIndex); + remaining = remaining.slice(nameEndIndex + 1); + if (!remaining) break; + const isQuoted = remaining[0] === "\""; + let value$1; + if (isQuoted) { + const endQuoteIndex = remaining.indexOf("\"", 1); + value$1 = JSON.parse(remaining.slice(0, endQuoteIndex + 1)); + remaining = remaining.slice(endQuoteIndex + 1); + } else { + const maybeEndIndex = remaining.indexOf(","); + const endIndex = maybeEndIndex === -1 ? remaining.length : maybeEndIndex; + value$1 = remaining.slice(0, endIndex); + remaining = remaining.slice(endIndex); + } + remaining = remaining.slice(1).trimStart(); + if (name === "DNS" && value$1 !== "[::1]" && !(value$1.startsWith("*.") && net.isIPv4(value$1.slice(2)))) hostnames.push(value$1.replace("*", "vite")); + } + return hostnames; +} +function arraify(target) { + return Array.isArray(target) ? target : [target]; +} +const multilineCommentsRE = /\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g; +const singlelineCommentsRE = /\/\/.*/g; +const requestQuerySplitRE = /\?(?!.*[/|}])/; +const requestQueryMaybeEscapedSplitRE = /\\?\?(?!.*[/|}])/; +const blankReplacer = (match) => " ".repeat(match.length); +function getHash(text, length = 8) { + const h = crypto.hash("sha256", text, "hex").substring(0, length); + if (length <= 64) return h; + return h.padEnd(length, "_"); +} +function emptyCssComments(raw) { + return raw.replace(multilineCommentsRE, blankReplacer); +} +function backwardCompatibleWorkerPlugins(plugins$1) { + if (Array.isArray(plugins$1)) return plugins$1; + if (typeof plugins$1 === "function") return plugins$1(); + return []; +} +function deepClone(value$1) { + if (Array.isArray(value$1)) return value$1.map((v) => deepClone(v)); + if (isObject(value$1)) { + const cloned = {}; + for (const key in value$1) cloned[key] = deepClone(value$1[key]); + return cloned; + } + if (typeof value$1 === "function") return value$1; + if (value$1 instanceof RegExp) return new RegExp(value$1); + if (typeof value$1 === "object" && value$1 != null) throw new Error("Cannot deep clone non-plain object"); + return value$1; +} +function mergeWithDefaultsRecursively(defaults, values) { + const merged = defaults; + for (const key in values) { + const value$1 = values[key]; + if (value$1 === void 0) continue; + const existing = merged[key]; + if (existing === void 0) { + merged[key] = value$1; + continue; + } + if (isObject(existing) && isObject(value$1)) { + merged[key] = mergeWithDefaultsRecursively(existing, value$1); + continue; + } + merged[key] = value$1; + } + return merged; +} +const environmentPathRE = /^environments\.[^.]+$/; +function mergeWithDefaults(defaults, values) { + return mergeWithDefaultsRecursively(deepClone(defaults), values); +} +function mergeConfigRecursively(defaults, overrides, rootPath) { + const merged = { ...defaults }; + for (const key in overrides) { + const value$1 = overrides[key]; + if (value$1 == null) continue; + const existing = merged[key]; + if (existing == null) { + merged[key] = value$1; + continue; + } + if (key === "alias" && (rootPath === "resolve" || rootPath === "")) { + merged[key] = mergeAlias(existing, value$1); + continue; + } else if (key === "assetsInclude" && rootPath === "") { + merged[key] = [].concat(existing, value$1); + continue; + } else if (((key === "noExternal" || key === "external") && (rootPath === "ssr" || rootPath === "resolve") || key === "allowedHosts" && rootPath === "server") && (existing === true || value$1 === true)) { + merged[key] = true; + continue; + } else if (key === "plugins" && rootPath === "worker") { + merged[key] = () => [...backwardCompatibleWorkerPlugins(existing), ...backwardCompatibleWorkerPlugins(value$1)]; + continue; + } else if (key === "server" && rootPath === "server.hmr") { + merged[key] = value$1; + continue; + } + if (Array.isArray(existing) || Array.isArray(value$1)) { + merged[key] = [...arraify(existing), ...arraify(value$1)]; + continue; + } + if (isObject(existing) && isObject(value$1)) { + merged[key] = mergeConfigRecursively(existing, value$1, rootPath && !environmentPathRE.test(rootPath) ? `${rootPath}.${key}` : key); + continue; + } + merged[key] = value$1; + } + return merged; +} +function mergeConfig(defaults, overrides, isRoot = true) { + if (typeof defaults === "function" || typeof overrides === "function") throw new Error(`Cannot merge config in form of callback`); + return mergeConfigRecursively(defaults, overrides, isRoot ? "" : "."); +} +function mergeAlias(a, b) { + if (!a) return b; + if (!b) return a; + if (isObject(a) && isObject(b)) return { + ...a, + ...b + }; + return [...normalizeAlias(b), ...normalizeAlias(a)]; +} +function normalizeAlias(o$1 = []) { + return Array.isArray(o$1) ? o$1.map(normalizeSingleAlias) : Object.keys(o$1).map((find$1) => normalizeSingleAlias({ + find: find$1, + replacement: o$1[find$1] + })); +} +function normalizeSingleAlias({ find: find$1, replacement, customResolver }) { + if (typeof find$1 === "string" && find$1.endsWith("/") && replacement.endsWith("/")) { + find$1 = find$1.slice(0, find$1.length - 1); + replacement = replacement.slice(0, replacement.length - 1); + } + const alias$2 = { + find: find$1, + replacement + }; + if (customResolver) alias$2.customResolver = customResolver; + return alias$2; +} +/** +* Transforms transpiled code result where line numbers aren't altered, +* so we can skip sourcemap generation during dev +*/ +function transformStableResult(s, id, config$2) { + return { + code: s.toString(), + map: config$2.command === "build" && config$2.build.sourcemap ? s.generateMap({ + hires: "boundary", + source: id + }) : null + }; +} +async function asyncFlatten(arr) { + do + arr = (await Promise.all(arr)).flat(Infinity); + while (arr.some((v) => v?.then)); + return arr; +} +function stripBomTag(content) { + if (content.charCodeAt(0) === 65279) return content.slice(1); + return content; +} +const windowsDrivePathPrefixRE = /^[A-Za-z]:[/\\]/; +/** +* path.isAbsolute also returns true for drive relative paths on windows (e.g. /something) +* this function returns false for them but true for absolute paths (e.g. C:/something) +*/ +const isNonDriveRelativeAbsolutePath = (p) => { + if (!isWindows) return p[0] === "/"; + return windowsDrivePathPrefixRE.test(p); +}; +/** +* Determine if a file is being requested with the correct case, to ensure +* consistent behavior between dev and prod and across operating systems. +*/ +function shouldServeFile(filePath, root) { + if (!isCaseInsensitiveFS) return true; + return hasCorrectCase(filePath, root); +} +/** +* Note that we can't use realpath here, because we don't want to follow +* symlinks. +*/ +function hasCorrectCase(file, assets) { + if (file === assets) return true; + const parent = path.dirname(file); + if (fs.readdirSync(parent).includes(path.basename(file))) return hasCorrectCase(parent, assets); + return false; +} +function joinUrlSegments(a, b) { + if (!a || !b) return a || b || ""; + if (a.endsWith("/")) a = a.substring(0, a.length - 1); + if (b[0] !== "/") b = "/" + b; + return a + b; +} +function removeLeadingSlash(str) { + return str[0] === "/" ? str.slice(1) : str; +} +function stripBase(path$13, base) { + if (path$13 === base) return "/"; + const devBase = withTrailingSlash(base); + return path$13.startsWith(devBase) ? path$13.slice(devBase.length - 1) : path$13; +} +function arrayEqual(a, b) { + if (a === b) return true; + if (a.length !== b.length) return false; + for (let i$1 = 0; i$1 < a.length; i$1++) if (a[i$1] !== b[i$1]) return false; + return true; +} +function evalValue(rawValue) { + return new Function(` + var console, exports, global, module, process, require + return (\n${rawValue}\n) + `)(); +} +function getNpmPackageName(importPath) { + const parts = importPath.split("/"); + if (parts[0][0] === "@") { + if (!parts[1]) return null; + return `${parts[0]}/${parts[1]}`; + } else return parts[0]; +} +function getPkgName(name) { + return name[0] === "@" ? name.split("/")[1] : name; +} +const escapeRegexRE$1 = /[-/\\^$*+?.()|[\]{}]/g; +function escapeRegex(str) { + return str.replace(escapeRegexRE$1, "\\$&"); +} +function getPackageManagerCommand(type = "install") { + const packageManager = process.env.npm_config_user_agent?.split(" ")[0].split("/")[0] || "npm"; + switch (type) { + case "install": return packageManager === "npm" ? "npm install" : `${packageManager} add`; + case "uninstall": return packageManager === "npm" ? "npm uninstall" : `${packageManager} remove`; + case "update": return packageManager === "yarn" ? "yarn upgrade" : `${packageManager} update`; + default: throw new TypeError(`Unknown command type: ${type}`); + } +} +function isDevServer(server) { + return "pluginContainer" in server; +} +function createSerialPromiseQueue() { + let previousTask; + return { async run(f$1) { + const thisTask = f$1(); + const depTasks = Promise.all([previousTask, thisTask]); + previousTask = depTasks; + const [, result] = await depTasks; + if (previousTask === depTasks) previousTask = void 0; + return result; + } }; +} +function sortObjectKeys(obj) { + const sorted = {}; + for (const key of Object.keys(obj).sort()) sorted[key] = obj[key]; + return sorted; +} +function displayTime(time) { + if (time < 1e3) return `${time}ms`; + time = time / 1e3; + if (time < 60) return `${time.toFixed(2)}s`; + const mins = Math.floor(time / 60); + const seconds = Math.round(time % 60); + if (seconds === 60) return `${mins + 1}m`; + return `${mins}m${seconds < 1 ? "" : ` ${seconds}s`}`; +} +/** +* Encodes the URI path portion (ignores part after ? or #) +*/ +function encodeURIPath(uri) { + if (uri.startsWith("data:")) return uri; + const filePath = cleanUrl(uri); + const postfix = filePath !== uri ? uri.slice(filePath.length) : ""; + return encodeURI(filePath) + postfix; +} +/** +* Like `encodeURIPath`, but only replacing `%` as `%25`. This is useful for environments +* that can handle un-encoded URIs, where `%` is the only ambiguous character. +*/ +function partialEncodeURIPath(uri) { + if (uri.startsWith("data:")) return uri; + const filePath = cleanUrl(uri); + const postfix = filePath !== uri ? uri.slice(filePath.length) : ""; + return filePath.replaceAll("%", "%25") + postfix; +} +function decodeURIIfPossible(input) { + try { + return decodeURI(input); + } catch { + return; + } +} +const sigtermCallbacks = /* @__PURE__ */ new Set(); +const parentSigtermCallback = async (signal, exitCode) => { + await Promise.all([...sigtermCallbacks].map((cb) => cb(signal, exitCode))); +}; +const setupSIGTERMListener = (callback) => { + if (sigtermCallbacks.size === 0) { + process.once("SIGTERM", parentSigtermCallback); + if (process.env.CI !== "true") process.stdin.on("end", parentSigtermCallback); + } + sigtermCallbacks.add(callback); +}; +const teardownSIGTERMListener = (callback) => { + sigtermCallbacks.delete(callback); + if (sigtermCallbacks.size === 0) { + process.off("SIGTERM", parentSigtermCallback); + if (process.env.CI !== "true") process.stdin.off("end", parentSigtermCallback); + } +}; +function getServerUrlByHost(resolvedUrls, host) { + if (typeof host === "string") { + const matchedUrl = [...resolvedUrls?.local ?? [], ...resolvedUrls?.network ?? []].find((url$3) => url$3.includes(host)); + if (matchedUrl) return matchedUrl; + } + return resolvedUrls?.local[0] ?? resolvedUrls?.network[0]; +} +let lastDateNow = 0; +/** +* Similar to `Date.now()`, but strictly monotonically increasing. +* +* This function will never return the same value. +* Thus, the value may differ from the actual time. +* +* related: https://github.com/vitejs/vite/issues/19804 +*/ +function monotonicDateNow() { + const now = Date.now(); + if (now > lastDateNow) { + lastDateNow = now; + return lastDateNow; + } + lastDateNow++; + return lastDateNow; +} + +//#endregion +//#region src/node/plugin.ts +async function resolveEnvironmentPlugins(environment) { + const environmentPlugins = []; + for (const plugin of environment.getTopLevelConfig().plugins) { + if (plugin.applyToEnvironment) { + const applied = await plugin.applyToEnvironment(environment); + if (!applied) continue; + if (applied !== true) { + environmentPlugins.push(...(await asyncFlatten(arraify(applied))).filter(Boolean)); + continue; + } + } + environmentPlugins.push(plugin); + } + return environmentPlugins; +} +/** +* @experimental +*/ +function perEnvironmentPlugin(name, applyToEnvironment) { + return { + name, + applyToEnvironment + }; +} + +//#endregion +//#region ../../node_modules/.pnpm/commondir@1.0.1/node_modules/commondir/index.js +var require_commondir = /* @__PURE__ */ __commonJSMin(((exports, module) => { + var path$12 = __require("path"); + module.exports = function(basedir, relfiles) { + if (relfiles) var files = relfiles.map(function(r$1) { + return path$12.resolve(basedir, r$1); + }); + else var files = basedir; + var res = files.slice(1).reduce(function(ps, file) { + if (!file.match(/^([A-Za-z]:)?\/|\\/)) throw new Error("relative path without a basedir"); + var xs = file.split(/\/+|\\+/); + for (var i$1 = 0; ps[i$1] === xs[i$1] && i$1 < Math.min(ps.length, xs.length); i$1++); + return ps.slice(0, i$1); + }, files[0].split(/\/+|\\+/)); + return res.length > 1 ? res.join("/") : "/"; + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +var BitSet = class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + add(n$2) { + this.bits[n$2 >> 5] |= 1 << (n$2 & 31); + } + has(n$2) { + return !!(this.bits[n$2 >> 5] & 1 << (n$2 & 31)); + } +}; +var Chunk = class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + this.intro = ""; + this.outro = ""; + this.content = content; + this.storeName = false; + this.edited = false; + this.previous = null; + this.next = null; + } + appendLeft(content) { + this.outro += content; + } + appendRight(content) { + this.intro = this.intro + content; + } + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + return chunk; + } + contains(index) { + return this.start < index && index < this.end; + } + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ""; + this.outro = ""; + } + this.storeName = storeName; + this.edited = true; + return this; + } + prependLeft(content) { + this.outro = content + this.outro; + } + prependRight(content) { + this.intro = content + this.intro; + } + reset() { + this.intro = ""; + this.outro = ""; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + split(index) { + const sliceIndex = index - this.start; + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + this.original = originalBefore; + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ""; + this.end = index; + if (this.edited) { + newChunk.edit("", false); + this.content = ""; + } else this.content = originalBefore; + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + return newChunk; + } + toString() { + return this.intro + this.content + this.outro; + } + trimEnd(rx) { + this.outro = this.outro.replace(rx, ""); + if (this.outro.length) return true; + const trimmed = this.content.replace(rx, ""); + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit("", void 0, true); + if (this.edited) this.edit(trimmed, this.storeName, true); + } + return true; + } else { + this.edit("", void 0, true); + this.intro = this.intro.replace(rx, ""); + if (this.intro.length) return true; + } + } + trimStart(rx) { + this.intro = this.intro.replace(rx, ""); + if (this.intro.length) return true; + const trimmed = this.content.replace(rx, ""); + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) newChunk.edit(trimmed, this.storeName, true); + this.edit("", void 0, true); + } + return true; + } else { + this.edit("", void 0, true); + this.outro = this.outro.replace(rx, ""); + if (this.outro.length) return true; + } + } +}; +function getBtoa() { + if (typeof globalThis !== "undefined" && typeof globalThis.btoa === "function") return (str) => globalThis.btoa(unescape(encodeURIComponent(str))); + else if (typeof Buffer === "function") return (str) => Buffer.from(str, "utf-8").toString("base64"); + else return () => { + throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported."); + }; +} +const btoa$1 = /* @__PURE__ */ getBtoa(); +var SourceMap = class { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode$1(properties.mappings); + if (typeof properties.x_google_ignoreList !== "undefined") this.x_google_ignoreList = properties.x_google_ignoreList; + if (typeof properties.debugId !== "undefined") this.debugId = properties.debugId; + } + toString() { + return JSON.stringify(this); + } + toUrl() { + return "data:application/json;charset=utf-8;base64," + btoa$1(this.toString()); + } +}; +function guessIndent(code) { + const lines = code.split("\n"); + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); + if (tabbed.length === 0 && spaced.length === 0) return null; + if (tabbed.length >= spaced.length) return " "; + const min$1 = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + return new Array(min$1 + 1).join(" "); +} +function getRelativePath(from, to) { + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); + fromParts.pop(); + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + if (fromParts.length) { + let i$1 = fromParts.length; + while (i$1--) fromParts[i$1] = ".."; + } + return fromParts.concat(toParts).join("/"); +} +const toString$1 = Object.prototype.toString; +function isObject$2(thing) { + return toString$1.call(thing) === "[object Object]"; +} +function getLocator(source) { + const originalLines = source.split("\n"); + const lineOffsets = []; + for (let i$1 = 0, pos = 0; i$1 < originalLines.length; i$1++) { + lineOffsets.push(pos); + pos += originalLines[i$1].length + 1; + } + return function locate(index) { + let i$1 = 0; + let j = lineOffsets.length; + while (i$1 < j) { + const m = i$1 + j >> 1; + if (index < lineOffsets[m]) j = m; + else i$1 = m + 1; + } + const line = i$1 - 1; + return { + line, + column: index - lineOffsets[line] + }; + }; +} +const wordRegex = /\w/; +var Mappings = class { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + const contentLengthMinusOne = content.length - 1; + let contentLineEnd = content.indexOf("\n", 0); + let previousContentLineEnd = -1; + while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { + const segment$1 = [ + this.generatedCodeColumn, + sourceIndex, + loc.line, + loc.column + ]; + if (nameIndex >= 0) segment$1.push(nameIndex); + this.rawSegments.push(segment$1); + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf("\n", contentLineEnd + 1); + } + const segment = [ + this.generatedCodeColumn, + sourceIndex, + loc.line, + loc.column + ]; + if (nameIndex >= 0) segment.push(nameIndex); + this.rawSegments.push(segment); + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + this.pending = null; + } + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first$2 = true; + let charInHiresBoundary = false; + while (originalCharIndex < chunk.end) { + if (original[originalCharIndex] === "\n") { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first$2 = true; + charInHiresBoundary = false; + } else { + if (this.hires || first$2 || sourcemapLocations.has(originalCharIndex)) { + const segment = [ + this.generatedCodeColumn, + sourceIndex, + loc.line, + loc.column + ]; + if (this.hires === "boundary") if (wordRegex.test(original[originalCharIndex])) { + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + else this.rawSegments.push(segment); + } + loc.column += 1; + this.generatedCodeColumn += 1; + first$2 = false; + } + originalCharIndex += 1; + } + this.pending = null; + } + advance(str) { + if (!str) return; + const lines = str.split("\n"); + if (lines.length > 1) { + for (let i$1 = 0; i$1 < lines.length - 1; i$1++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + this.generatedCodeColumn += lines[lines.length - 1].length; + } +}; +const n$1 = "\n"; +const warned = { + insertLeft: false, + insertRight: false, + storeName: false +}; +var MagicString = class MagicString { + constructor(string, options$1 = {}) { + const chunk = new Chunk(0, string.length, string); + Object.defineProperties(this, { + original: { + writable: true, + value: string + }, + outro: { + writable: true, + value: "" + }, + intro: { + writable: true, + value: "" + }, + firstChunk: { + writable: true, + value: chunk + }, + lastChunk: { + writable: true, + value: chunk + }, + lastSearchedChunk: { + writable: true, + value: chunk + }, + byStart: { + writable: true, + value: {} + }, + byEnd: { + writable: true, + value: {} + }, + filename: { + writable: true, + value: options$1.filename + }, + indentExclusionRanges: { + writable: true, + value: options$1.indentExclusionRanges + }, + sourcemapLocations: { + writable: true, + value: new BitSet() + }, + storedNames: { + writable: true, + value: {} + }, + indentStr: { + writable: true, + value: void 0 + }, + ignoreList: { + writable: true, + value: options$1.ignoreList + }, + offset: { + writable: true, + value: options$1.offset || 0 + } + }); + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + append(content) { + if (typeof content !== "string") throw new TypeError("outro content must be a string"); + this.outro += content; + return this; + } + appendLeft(index, content) { + index = index + this.offset; + if (typeof content !== "string") throw new TypeError("inserted content must be a string"); + this._split(index); + const chunk = this.byEnd[index]; + if (chunk) chunk.appendLeft(content); + else this.intro += content; + return this; + } + appendRight(index, content) { + index = index + this.offset; + if (typeof content !== "string") throw new TypeError("inserted content must be a string"); + this._split(index); + const chunk = this.byStart[index]; + if (chunk) chunk.appendRight(content); + else this.outro += content; + return this; + } + clone() { + const cloned = new MagicString(this.original, { + filename: this.filename, + offset: this.offset + }); + let originalChunk = this.firstChunk; + let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone(); + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + clonedChunk = nextClonedChunk; + } + originalChunk = nextOriginalChunk; + } + cloned.lastChunk = clonedChunk; + if (this.indentExclusionRanges) cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + cloned.intro = this.intro; + cloned.outro = this.outro; + return cloned; + } + generateDecodedMap(options$1) { + options$1 = options$1 || {}; + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options$1.hires); + const locate = getLocator(this.original); + if (this.intro) mappings.advance(this.intro); + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + if (chunk.intro.length) mappings.advance(chunk.intro); + if (chunk.edited) mappings.addEdit(sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1); + else mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + if (this.outro) mappings.advance(this.outro); + return { + file: options$1.file ? options$1.file.split(/[/\\]/).pop() : void 0, + sources: [options$1.source ? getRelativePath(options$1.file || "", options$1.source) : options$1.file || ""], + sourcesContent: options$1.includeContent ? [this.original] : void 0, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : void 0 + }; + } + generateMap(options$1) { + return new SourceMap(this.generateDecodedMap(options$1)); + } + _ensureindentStr() { + if (this.indentStr === void 0) this.indentStr = guessIndent(this.original); + } + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? " " : this.indentStr; + } + indent(indentStr, options$1) { + const pattern = /^[^\r\n]/gm; + if (isObject$2(indentStr)) { + options$1 = indentStr; + indentStr = void 0; + } + if (indentStr === void 0) { + this._ensureindentStr(); + indentStr = this.indentStr || " "; + } + if (indentStr === "") return this; + options$1 = options$1 || {}; + const isExcluded = {}; + if (options$1.exclude) (typeof options$1.exclude[0] === "number" ? [options$1.exclude] : options$1.exclude).forEach((exclusion) => { + for (let i$1 = exclusion[0]; i$1 < exclusion[1]; i$1 += 1) isExcluded[i$1] = true; + }); + let shouldIndentNextCharacter = options$1.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; + this.intro = this.intro.replace(pattern, replacer); + let charIndex = 0; + let chunk = this.firstChunk; + while (chunk) { + const end = chunk.end; + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + if (chunk.content.length) shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === "\n"; + } + } else { + charIndex = chunk.start; + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + if (char === "\n") shouldIndentNextCharacter = true; + else if (char !== "\r" && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + if (charIndex === chunk.start) chunk.prependRight(indentStr); + else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + charIndex += 1; + } + } + charIndex = chunk.end; + chunk = chunk.next; + } + this.outro = this.outro.replace(pattern, replacer); + return this; + } + insert() { + throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)"); + } + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"); + warned.insertLeft = true; + } + return this.appendLeft(index, content); + } + insertRight(index, content) { + if (!warned.insertRight) { + console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"); + warned.insertRight = true; + } + return this.prependRight(index, content); + } + move(start, end, index) { + start = start + this.offset; + end = end + this.offset; + index = index + this.offset; + if (index >= start && index <= end) throw new Error("Cannot move a selection inside itself"); + this._split(start); + this._split(end); + this._split(index); + const first$2 = this.byStart[start]; + const last = this.byEnd[end]; + const oldLeft = first$2.previous; + const oldRight = last.next; + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + if (newLeft) newLeft.next = first$2; + if (newRight) newRight.previous = last; + if (!first$2.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first$2.previous; + this.lastChunk.next = null; + } + first$2.previous = newLeft; + last.next = newRight || null; + if (!newLeft) this.firstChunk = first$2; + if (!newRight) this.lastChunk = last; + return this; + } + overwrite(start, end, content, options$1) { + options$1 = options$1 || {}; + return this.update(start, end, content, { + ...options$1, + overwrite: !options$1.contentOnly + }); + } + update(start, end, content, options$1) { + start = start + this.offset; + end = end + this.offset; + if (typeof content !== "string") throw new TypeError("replacement content must be a string"); + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + if (end > this.original.length) throw new Error("end is out of bounds"); + if (start === end) throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead"); + this._split(start); + this._split(end); + if (options$1 === true) { + if (!warned.storeName) { + console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"); + warned.storeName = true; + } + options$1 = { storeName: true }; + } + const storeName = options$1 !== void 0 ? options$1.storeName : false; + const overwrite = options$1 !== void 0 ? options$1.overwrite : false; + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true + }); + } + const first$2 = this.byStart[start]; + const last = this.byEnd[end]; + if (first$2) { + let chunk = first$2; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) throw new Error("Cannot overwrite across a split point"); + chunk = chunk.next; + chunk.edit("", false); + } + first$2.edit(content, storeName, !overwrite); + } else { + const newChunk = new Chunk(start, end, "").edit(content, storeName); + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + prepend(content) { + if (typeof content !== "string") throw new TypeError("outro content must be a string"); + this.intro = content + this.intro; + return this; + } + prependLeft(index, content) { + index = index + this.offset; + if (typeof content !== "string") throw new TypeError("inserted content must be a string"); + this._split(index); + const chunk = this.byEnd[index]; + if (chunk) chunk.prependLeft(content); + else this.intro = content + this.intro; + return this; + } + prependRight(index, content) { + index = index + this.offset; + if (typeof content !== "string") throw new TypeError("inserted content must be a string"); + this._split(index); + const chunk = this.byStart[index]; + if (chunk) chunk.prependRight(content); + else this.outro = content + this.outro; + return this; + } + remove(start, end) { + start = start + this.offset; + end = end + this.offset; + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + if (start === end) return this; + if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds"); + if (start > end) throw new Error("end must be greater than start"); + this._split(start); + this._split(end); + let chunk = this.byStart[start]; + while (chunk) { + chunk.intro = ""; + chunk.outro = ""; + chunk.edit(""); + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + reset(start, end) { + start = start + this.offset; + end = end + this.offset; + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + if (start === end) return this; + if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds"); + if (start > end) throw new Error("end must be greater than start"); + this._split(start); + this._split(end); + let chunk = this.byStart[start]; + while (chunk) { + chunk.reset(); + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while (chunk = chunk.previous); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ""; + } + lastLine() { + let lineIndex = this.outro.lastIndexOf(n$1); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n$1); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n$1); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n$1); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while (chunk = chunk.previous); + lineIndex = this.intro.lastIndexOf(n$1); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + slice(start = 0, end = this.original.length - this.offset) { + start = start + this.offset; + end = end + this.offset; + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + let result = ""; + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + if (chunk.start < end && chunk.end >= end) return result; + chunk = chunk.next; + } + if (chunk && chunk.edited && chunk.start !== start) throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) result += chunk.intro; + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + result += chunk.content.slice(sliceStart, sliceEnd); + if (chunk.outro && (!containsEnd || chunk.end === end)) result += chunk.outro; + if (containsEnd) break; + chunk = chunk.next; + } + return result; + } + snip(start, end) { + const clone$1 = this.clone(); + clone$1.remove(0, start); + clone$1.remove(end, clone$1.original.length); + return clone$1; + } + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + let chunk = this.lastSearchedChunk; + let previousChunk = chunk; + const searchForward = index > chunk.end; + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + if (chunk === previousChunk) return; + previousChunk = chunk; + } + } + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + const loc = getLocator(this.original)(index); + throw new Error(`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`); + } + const newChunk = chunk.split(index); + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + if (chunk === this.lastChunk) this.lastChunk = newChunk; + this.lastSearchedChunk = chunk; + return true; + } + toString() { + let str = this.intro; + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + return str + this.outro; + } + isEmpty() { + let chunk = this.firstChunk; + do + if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim()) return false; + while (chunk = chunk.next); + return true; + } + length() { + let chunk = this.firstChunk; + let length = 0; + do + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + while (chunk = chunk.next); + return length; + } + trimLines() { + return this.trim("[\\r\\n]"); + } + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + trimEndAborted(charType) { + const rx = /* @__PURE__ */ new RegExp((charType || "\\s") + "+$"); + this.outro = this.outro.replace(rx, ""); + if (this.outro.length) return true; + let chunk = this.lastChunk; + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + if (chunk.end !== end) { + if (this.lastChunk === chunk) this.lastChunk = chunk.next; + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + return false; + } + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = /* @__PURE__ */ new RegExp("^" + (charType || "\\s") + "+"); + this.intro = this.intro.replace(rx, ""); + if (this.intro.length) return true; + let chunk = this.firstChunk; + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + if (chunk.end !== end) { + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + return false; + } + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + hasChanged() { + return this.original !== this.toString(); + } + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === "string") return replacement.replace(/\$(\$|&|\d+)/g, (_, i$1) => { + if (i$1 === "$") return "$"; + if (i$1 === "&") return match[0]; + if (+i$1 < match.length) return match[+i$1]; + return `$${i$1}`; + }); + else return replacement(...match, match.index, str, match.groups); + } + function matchAll$1(re, str) { + let match; + const matches$2 = []; + while (match = re.exec(str)) matches$2.push(match); + return matches$2; + } + if (searchValue.global) matchAll$1(searchValue, this.original).forEach((match) => { + if (match.index != null) { + const replacement$1 = getReplacement(match, this.original); + if (replacement$1 !== match[0]) this.overwrite(match.index, match.index + match[0].length, replacement$1); + } + }); + else { + const match = this.original.match(searchValue); + if (match && match.index != null) { + const replacement$1 = getReplacement(match, this.original); + if (replacement$1 !== match[0]) this.overwrite(match.index, match.index + match[0].length, replacement$1); + } + } + return this; + } + _replaceString(string, replacement) { + const { original } = this; + const index = original.indexOf(string); + if (index !== -1) { + if (typeof replacement === "function") replacement = replacement(string, index, original); + if (string !== replacement) this.overwrite(index, index + string.length, replacement); + } + return this; + } + replace(searchValue, replacement) { + if (typeof searchValue === "string") return this._replaceString(searchValue, replacement); + return this._replaceRegexp(searchValue, replacement); + } + _replaceAllString(string, replacement) { + const { original } = this; + const stringLength = string.length; + for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) { + const previous = original.slice(index, index + stringLength); + let _replacement = replacement; + if (typeof replacement === "function") _replacement = replacement(previous, index, original); + if (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement); + } + return this; + } + replaceAll(searchValue, replacement) { + if (typeof searchValue === "string") return this._replaceAllString(searchValue, replacement); + if (!searchValue.global) throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument"); + return this._replaceRegexp(searchValue, replacement); + } +}; + +//#endregion +//#region ../../node_modules/.pnpm/is-reference@1.2.1/node_modules/is-reference/dist/is-reference.js +var require_is_reference = /* @__PURE__ */ __commonJSMin(((exports, module) => { + (function(global$1, factory) { + typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global$1 = global$1 || self, global$1.isReference = factory()); + })(exports, (function() { + "use strict"; + function isReference$1(node, parent) { + if (node.type === "MemberExpression") return !node.computed && isReference$1(node.object, node); + if (node.type === "Identifier") { + if (!parent) return true; + switch (parent.type) { + case "MemberExpression": return parent.computed || node === parent.object; + case "MethodDefinition": return parent.computed; + case "FieldDefinition": return parent.computed || node === parent.value; + case "Property": return parent.computed || node === parent.value; + case "ExportSpecifier": + case "ImportSpecifier": return node === parent.local; + case "LabeledStatement": + case "BreakStatement": + case "ContinueStatement": return false; + default: return true; + } + } + return false; + } + return isReference$1; + })); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@rollup+plugin-commonjs@29.0.0_rollup@4.43.0/node_modules/@rollup/plugin-commonjs/dist/es/index.js +var import_commondir = /* @__PURE__ */ __toESM(require_commondir(), 1); +var import_is_reference = /* @__PURE__ */ __toESM(require_is_reference(), 1); +var version$1 = "29.0.0"; +var peerDependencies = { rollup: "^2.68.0||^3.0.0||^4.0.0" }; +function tryParse(parse$15, code, id) { + try { + return parse$15(code, { allowReturnOutsideFunction: true }); + } catch (err$2) { + err$2.message += ` in ${id}`; + throw err$2; + } +} +const firstpassGlobal = /\b(?:require|module|exports|global)\b/; +const firstpassNoGlobal = /\b(?:require|module|exports)\b/; +function hasCjsKeywords(code, ignoreGlobal) { + return (ignoreGlobal ? firstpassNoGlobal : firstpassGlobal).test(code); +} +function analyzeTopLevelStatements(parse$15, code, id) { + const ast = tryParse(parse$15, code, id); + let isEsModule = false; + let hasDefaultExport = false; + let hasNamedExports = false; + for (const node of ast.body) switch (node.type) { + case "ExportDefaultDeclaration": + isEsModule = true; + hasDefaultExport = true; + break; + case "ExportNamedDeclaration": + isEsModule = true; + if (node.declaration) hasNamedExports = true; + else for (const specifier of node.specifiers) if (specifier.exported.name === "default") hasDefaultExport = true; + else hasNamedExports = true; + break; + case "ExportAllDeclaration": + isEsModule = true; + if (node.exported && node.exported.name === "default") hasDefaultExport = true; + else hasNamedExports = true; + break; + case "ImportDeclaration": + isEsModule = true; + break; + } + return { + isEsModule, + hasDefaultExport, + hasNamedExports, + ast + }; +} +function deconflict(scopes, globals, identifier) { + let i$1 = 1; + let deconflicted = makeLegalIdentifier(identifier); + const hasConflicts = () => scopes.some((scope) => scope.contains(deconflicted)) || globals.has(deconflicted); + while (hasConflicts()) { + deconflicted = makeLegalIdentifier(`${identifier}_${i$1}`); + i$1 += 1; + } + for (const scope of scopes) scope.declarations[deconflicted] = true; + return deconflicted; +} +function getName(id) { + const name = makeLegalIdentifier(basename$1(id, extname$1(id))); + if (name !== "index") return name; + return makeLegalIdentifier(basename$1(dirname$1(id))); +} +function normalizePathSlashes(path$13) { + return path$13.replace(/\\/g, "/"); +} +const getVirtualPathForDynamicRequirePath = (path$13, commonDir) => `/${normalizePathSlashes(relative$1(commonDir, path$13))}`; +function capitalize(name) { + return name[0].toUpperCase() + name.slice(1); +} +function getStrictRequiresFilter({ strictRequires }) { + switch (strictRequires) { + case void 0: + case true: return { + strictRequiresFilter: () => true, + detectCyclesAndConditional: false + }; + case "auto": + case "debug": + case null: return { + strictRequiresFilter: () => false, + detectCyclesAndConditional: true + }; + case false: return { + strictRequiresFilter: () => false, + detectCyclesAndConditional: false + }; + default: + if (typeof strictRequires === "string" || Array.isArray(strictRequires)) return { + strictRequiresFilter: createFilter$2(strictRequires), + detectCyclesAndConditional: false + }; + throw new Error("Unexpected value for \"strictRequires\" option."); + } +} +function getPackageEntryPoint(dirPath) { + let entryPoint = "index.js"; + try { + if (existsSync$1(join$1(dirPath, "package.json"))) entryPoint = JSON.parse(readFileSync$1(join$1(dirPath, "package.json"), { encoding: "utf8" })).main || entryPoint; + } catch (ignored) {} + return entryPoint; +} +function isDirectory$1(path$13) { + try { + if (statSync(path$13).isDirectory()) return true; + } catch (ignored) {} + return false; +} +function getDynamicRequireModules(patterns, dynamicRequireRoot) { + const dynamicRequireModules = /* @__PURE__ */ new Map(); + const dirNames = /* @__PURE__ */ new Set(); + for (const pattern of !patterns || Array.isArray(patterns) ? patterns || [] : [patterns]) { + const isNegated = pattern.startsWith("!"); + const modifyMap = (targetPath, resolvedPath) => isNegated ? dynamicRequireModules.delete(targetPath) : dynamicRequireModules.set(targetPath, resolvedPath); + for (const path$13 of new fdir().withBasePath().withDirs().glob(isNegated ? pattern.substr(1) : pattern).crawl(relative$1(".", dynamicRequireRoot)).sync().sort((a, b) => a.localeCompare(b, "en"))) { + const resolvedPath = resolve$1(path$13); + const requirePath = normalizePathSlashes(resolvedPath); + if (isDirectory$1(resolvedPath)) { + dirNames.add(resolvedPath); + const modulePath = resolve$1(join$1(resolvedPath, getPackageEntryPoint(path$13))); + modifyMap(requirePath, modulePath); + modifyMap(normalizePathSlashes(modulePath), modulePath); + } else { + dirNames.add(dirname$1(resolvedPath)); + modifyMap(requirePath, resolvedPath); + } + } + } + return { + commonDir: dirNames.size ? (0, import_commondir.default)([...dirNames, dynamicRequireRoot]) : null, + dynamicRequireModules + }; +} +const FAILED_REQUIRE_ERROR = `throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');`; +const COMMONJS_REQUIRE_EXPORT = "commonjsRequire"; +const CREATE_COMMONJS_REQUIRE_EXPORT = "createCommonjsRequire"; +function getDynamicModuleRegistry(isDynamicRequireModulesEnabled, dynamicRequireModules, commonDir, ignoreDynamicRequires) { + if (!isDynamicRequireModulesEnabled) return `export function ${COMMONJS_REQUIRE_EXPORT}(path) { + ${FAILED_REQUIRE_ERROR} +}`; + return `${[...dynamicRequireModules.values()].map((id, index) => `import ${id.endsWith(".json") ? `json${index}` : `{ __require as require${index} }`} from ${JSON.stringify(id)};`).join("\n")} + +var dynamicModules; + +function getDynamicModules() { + return dynamicModules || (dynamicModules = { +${[...dynamicRequireModules.keys()].map((id, index) => `\t\t${JSON.stringify(getVirtualPathForDynamicRequirePath(id, commonDir))}: ${id.endsWith(".json") ? `function () { return json${index}; }` : `require${index}`}`).join(",\n")} + }); +} + +export function ${CREATE_COMMONJS_REQUIRE_EXPORT}(originalModuleDir) { + function handleRequire(path) { + var resolvedPath = commonjsResolve(path, originalModuleDir); + if (resolvedPath !== null) { + return getDynamicModules()[resolvedPath](); + } + ${ignoreDynamicRequires ? "return require(path);" : FAILED_REQUIRE_ERROR} + } + handleRequire.resolve = function (path) { + var resolvedPath = commonjsResolve(path, originalModuleDir); + if (resolvedPath !== null) { + return resolvedPath; + } + return require.resolve(path); + } + return handleRequire; +} + +function commonjsResolve (path, originalModuleDir) { + var shouldTryNodeModules = isPossibleNodeModulesPath(path); + path = normalize(path); + var relPath; + if (path[0] === '/') { + originalModuleDir = ''; + } + var modules = getDynamicModules(); + var checkedExtensions = ['', '.js', '.json']; + while (true) { + if (!shouldTryNodeModules) { + relPath = normalize(originalModuleDir + '/' + path); + } else { + relPath = normalize(originalModuleDir + '/node_modules/' + path); + } + + if (relPath.endsWith('/..')) { + break; // Travelled too far up, avoid infinite loop + } + + for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) { + var resolvedPath = relPath + checkedExtensions[extensionIndex]; + if (modules[resolvedPath]) { + return resolvedPath; + } + } + if (!shouldTryNodeModules) break; + var nextDir = normalize(originalModuleDir + '/..'); + if (nextDir === originalModuleDir) break; + originalModuleDir = nextDir; + } + return null; +} + +function isPossibleNodeModulesPath (modulePath) { + var c0 = modulePath[0]; + if (c0 === '/' || c0 === '\\\\') return false; + var c1 = modulePath[1], c2 = modulePath[2]; + if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) || + (c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false; + if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false; + return true; +} + +function normalize (path) { + path = path.replace(/\\\\/g, '/'); + var parts = path.split('/'); + var slashed = parts[0] === ''; + for (var i = 1; i < parts.length; i++) { + if (parts[i] === '.' || parts[i] === '') { + parts.splice(i--, 1); + } + } + for (var i = 1; i < parts.length; i++) { + if (parts[i] !== '..') continue; + if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') { + parts.splice(--i, 2); + i--; + } + } + path = parts.join('/'); + if (slashed && path[0] !== '/') path = '/' + path; + else if (path.length === 0) path = '.'; + return path; +}`; +} +const isWrappedId = (id, suffix) => id.endsWith(suffix); +const wrapId$1 = (id, suffix) => `\0${id}${suffix}`; +const unwrapId$1 = (wrappedId, suffix) => wrappedId.slice(1, -suffix.length); +const PROXY_SUFFIX = "?commonjs-proxy"; +const WRAPPED_SUFFIX = "?commonjs-wrapped"; +const EXTERNAL_SUFFIX = "?commonjs-external"; +const EXPORTS_SUFFIX = "?commonjs-exports"; +const MODULE_SUFFIX = "?commonjs-module"; +const ENTRY_SUFFIX = "?commonjs-entry"; +const ES_IMPORT_SUFFIX = "?commonjs-es-import"; +const DYNAMIC_MODULES_ID = "\0commonjs-dynamic-modules"; +const HELPERS_ID = "\0commonjsHelpers.js"; +const IS_WRAPPED_COMMONJS = "withRequireFunction"; +const HELPERS = ` +export var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +export function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +export function getDefaultExportFromNamespaceIfPresent (n) { + return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n; +} + +export function getDefaultExportFromNamespaceIfNotNamed (n) { + return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n; +} + +export function getAugmentedNamespace(n) { + if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n; + var f = n.default; + if (typeof f == "function") { + var a = function a () { + var isInstance = false; + try { + isInstance = this instanceof a; + } catch {} + if (isInstance) { + return Reflect.construct(f, arguments, this.constructor); + } + return f.apply(this, arguments); + }; + a.prototype = f.prototype; + } else a = {}; + Object.defineProperty(a, '__esModule', {value: true}); + Object.keys(n).forEach(function (k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function () { + return n[k]; + } + }); + }); + return a; +} +`; +function getHelpersModule() { + return HELPERS; +} +function getUnknownRequireProxy(id, requireReturnsDefault) { + if (requireReturnsDefault === true || id.endsWith(".json")) return `export { default } from ${JSON.stringify(id)};`; + const name = getName(id); + const exported = requireReturnsDefault === "auto" ? `import { getDefaultExportFromNamespaceIfNotNamed } from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(${name});` : requireReturnsDefault === "preferred" ? `import { getDefaultExportFromNamespaceIfPresent } from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(${name});` : !requireReturnsDefault ? `import { getAugmentedNamespace } from "${HELPERS_ID}"; export default /*@__PURE__*/getAugmentedNamespace(${name});` : `export default ${name};`; + return `import * as ${name} from ${JSON.stringify(id)}; ${exported}`; +} +async function getStaticRequireProxy(id, requireReturnsDefault, loadModule) { + const name = getName(id); + const { meta: { commonjs: commonjsMeta } } = await loadModule({ id }); + if (!commonjsMeta) return getUnknownRequireProxy(id, requireReturnsDefault); + if (commonjsMeta.isCommonJS) return `export { __moduleExports as default } from ${JSON.stringify(id)};`; + if (!requireReturnsDefault) return `import { getAugmentedNamespace } from "${HELPERS_ID}"; import * as ${name} from ${JSON.stringify(id)}; export default /*@__PURE__*/getAugmentedNamespace(${name});`; + if (requireReturnsDefault !== true && (requireReturnsDefault === "namespace" || !commonjsMeta.hasDefaultExport || requireReturnsDefault === "auto" && commonjsMeta.hasNamedExports)) return `import * as ${name} from ${JSON.stringify(id)}; export default ${name};`; + return `export { default } from ${JSON.stringify(id)};`; +} +function getEntryProxy(id, defaultIsModuleExports, getModuleInfo, shebang) { + const { meta: { commonjs: commonjsMeta }, hasDefaultExport } = getModuleInfo(id); + if (!commonjsMeta || commonjsMeta.isCommonJS !== IS_WRAPPED_COMMONJS) { + const stringifiedId = JSON.stringify(id); + let code = `export * from ${stringifiedId};`; + if (hasDefaultExport) code += `export { default } from ${stringifiedId};`; + return shebang + code; + } + const result = getEsImportProxy(id, defaultIsModuleExports, true); + return { + ...result, + code: shebang + result.code + }; +} +function getEsImportProxy(id, defaultIsModuleExports, moduleSideEffects) { + const name = getName(id); + const exportsName = `${name}Exports`; + const requireModule = `require${capitalize(name)}`; + let code = `import { getDefaultExportFromCjs } from "${HELPERS_ID}";\nimport { __require as ${requireModule} } from ${JSON.stringify(id)};\nvar ${exportsName} = ${moduleSideEffects ? "" : "/*@__PURE__*/ "}${requireModule}();\nexport { ${exportsName} as __moduleExports };`; + if (defaultIsModuleExports === true) code += `\nexport { ${exportsName} as default };`; + else if (defaultIsModuleExports === false) code += `\nexport default ${exportsName}.default;`; + else code += `\nexport default /*@__PURE__*/getDefaultExportFromCjs(${exportsName});`; + return { + code, + syntheticNamedExports: "__moduleExports" + }; +} +function getExternalBuiltinRequireProxy(id) { + return `import { createRequire } from 'node:module'; +const require = createRequire(import.meta.url); +export function __require() { return require(${JSON.stringify(id)}); }`; +} +function getCandidatesForExtension(resolved, extension$1) { + return [resolved + extension$1, `${resolved}${sep$1}index${extension$1}`]; +} +function getCandidates(resolved, extensions$1) { + return extensions$1.reduce((paths, extension$1) => paths.concat(getCandidatesForExtension(resolved, extension$1)), [resolved]); +} +function resolveExtensions(importee, importer, extensions$1) { + if (importee[0] !== "." || !importer) return void 0; + const candidates = getCandidates(resolve$1(dirname$1(importer), importee), extensions$1); + for (let i$1 = 0; i$1 < candidates.length; i$1 += 1) try { + if (statSync(candidates[i$1]).isFile()) return { id: candidates[i$1] }; + } catch (err$2) {} +} +function getResolveId(extensions$1, isPossibleCjsId) { + const currentlyResolving = /* @__PURE__ */ new Map(); + return { + currentlyResolving, + async resolveId(importee, importer, resolveOptions) { + if (resolveOptions.custom?.["node-resolve"]?.isRequire) return null; + const currentlyResolvingForParent = currentlyResolving.get(importer); + if (currentlyResolvingForParent && currentlyResolvingForParent.has(importee)) { + this.warn({ + code: "THIS_RESOLVE_WITHOUT_OPTIONS", + message: "It appears a plugin has implemented a \"resolveId\" hook that uses \"this.resolve\" without forwarding the third \"options\" parameter of \"resolveId\". This is problematic as it can lead to wrong module resolutions especially for the node-resolve plugin and in certain cases cause early exit errors for the commonjs plugin.\nIn rare cases, this warning can appear if the same file is both imported and required from the same mixed ES/CommonJS module, in which case it can be ignored.", + url: "https://rollupjs.org/guide/en/#resolveid" + }); + return null; + } + if (isWrappedId(importee, WRAPPED_SUFFIX)) return unwrapId$1(importee, WRAPPED_SUFFIX); + if (importee.endsWith(ENTRY_SUFFIX) || isWrappedId(importee, MODULE_SUFFIX) || isWrappedId(importee, EXPORTS_SUFFIX) || isWrappedId(importee, PROXY_SUFFIX) || isWrappedId(importee, ES_IMPORT_SUFFIX) || isWrappedId(importee, EXTERNAL_SUFFIX) || importee.startsWith(HELPERS_ID) || importee === DYNAMIC_MODULES_ID) return importee; + if (importer) { + if (importer === DYNAMIC_MODULES_ID || isWrappedId(importer, PROXY_SUFFIX) || isWrappedId(importer, ES_IMPORT_SUFFIX) || importer.endsWith(ENTRY_SUFFIX)) return importee; + if (isWrappedId(importer, EXTERNAL_SUFFIX)) { + if (!await this.resolve(importee, importer, Object.assign({ skipSelf: true }, resolveOptions))) return null; + return { + id: importee, + external: true + }; + } + } + if (importee.startsWith("\0")) return null; + const resolved = await this.resolve(importee, importer, Object.assign({ skipSelf: true }, resolveOptions)) || resolveExtensions(importee, importer, extensions$1); + if (!resolved || resolved.external || resolved.id.endsWith(ENTRY_SUFFIX) || isWrappedId(resolved.id, ES_IMPORT_SUFFIX) || !isPossibleCjsId(resolved.id)) return resolved; + const moduleInfo = await this.load(resolved); + const { meta: { commonjs: commonjsMeta } } = moduleInfo; + if (commonjsMeta) { + const { isCommonJS } = commonjsMeta; + if (isCommonJS) { + if (resolveOptions.isEntry) { + moduleInfo.moduleSideEffects = true; + return resolved.id + ENTRY_SUFFIX; + } + if (isCommonJS === IS_WRAPPED_COMMONJS) return { + id: wrapId$1(resolved.id, ES_IMPORT_SUFFIX), + meta: { commonjs: { resolved } } + }; + } + } + return resolved; + } + }; +} +function getRequireResolver(extensions$1, detectCyclesAndConditional, currentlyResolving, requireNodeBuiltins) { + const knownCjsModuleTypes = Object.create(null); + const requiredIds = Object.create(null); + const unconditionallyRequiredIds = Object.create(null); + const dependencies = Object.create(null); + const getDependencies = (id) => dependencies[id] || (dependencies[id] = /* @__PURE__ */ new Set()); + const isCyclic = (id) => { + const dependenciesToCheck = new Set(getDependencies(id)); + for (const dependency of dependenciesToCheck) { + if (dependency === id) return true; + for (const childDependency of getDependencies(dependency)) dependenciesToCheck.add(childDependency); + } + return false; + }; + const fullyAnalyzedModules = Object.create(null); + const getTypeForFullyAnalyzedModule = (id) => { + const knownType = knownCjsModuleTypes[id]; + if (knownType !== true || !detectCyclesAndConditional || fullyAnalyzedModules[id]) return knownType; + if (isCyclic(id)) return knownCjsModuleTypes[id] = IS_WRAPPED_COMMONJS; + return knownType; + }; + const setInitialParentType = (id, initialCommonJSType) => { + if (fullyAnalyzedModules[id]) return; + knownCjsModuleTypes[id] = initialCommonJSType; + if (detectCyclesAndConditional && knownCjsModuleTypes[id] === true && requiredIds[id] && !unconditionallyRequiredIds[id]) knownCjsModuleTypes[id] = IS_WRAPPED_COMMONJS; + }; + const analyzeRequiredModule = async (parentId, resolved, isConditional, loadModule) => { + const childId = resolved.id; + requiredIds[childId] = true; + if (!(isConditional || knownCjsModuleTypes[parentId] === IS_WRAPPED_COMMONJS)) unconditionallyRequiredIds[childId] = true; + getDependencies(parentId).add(childId); + if (!isCyclic(childId)) await loadModule(resolved); + }; + const getTypeForImportedModule = async (resolved, loadModule) => { + if (resolved.id in knownCjsModuleTypes) return knownCjsModuleTypes[resolved.id]; + const { meta: { commonjs: commonjs$1 } } = await loadModule(resolved); + return commonjs$1 && commonjs$1.isCommonJS || false; + }; + return { + getWrappedIds: () => Object.keys(knownCjsModuleTypes).filter((id) => knownCjsModuleTypes[id] === IS_WRAPPED_COMMONJS), + isRequiredId: (id) => requiredIds[id], + async shouldTransformCachedModule({ id: parentId, resolvedSources, meta: { commonjs: parentMeta } }) { + if (!(parentMeta && parentMeta.isCommonJS)) knownCjsModuleTypes[parentId] = false; + if (isWrappedId(parentId, ES_IMPORT_SUFFIX)) return false; + const parentRequires = parentMeta && parentMeta.requires; + if (parentRequires) { + setInitialParentType(parentId, parentMeta.initialCommonJSType); + await Promise.all(parentRequires.map(({ resolved, isConditional }) => analyzeRequiredModule(parentId, resolved, isConditional, this.load))); + if (getTypeForFullyAnalyzedModule(parentId) !== parentMeta.isCommonJS) return true; + for (const { resolved: { id } } of parentRequires) if (getTypeForFullyAnalyzedModule(id) !== parentMeta.isRequiredCommonJS[id]) return true; + fullyAnalyzedModules[parentId] = true; + for (const { resolved: { id } } of parentRequires) fullyAnalyzedModules[id] = true; + } + const parentRequireSet = new Set((parentRequires || []).map(({ resolved: { id } }) => id)); + return (await Promise.all(Object.keys(resolvedSources).map((source) => resolvedSources[source]).filter(({ id, external }) => !(external || parentRequireSet.has(id))).map(async (resolved) => { + if (isWrappedId(resolved.id, ES_IMPORT_SUFFIX)) return await getTypeForImportedModule((await this.load(resolved)).meta.commonjs.resolved, this.load) !== IS_WRAPPED_COMMONJS; + return await getTypeForImportedModule(resolved, this.load) === IS_WRAPPED_COMMONJS; + }))).some((shouldTransform) => shouldTransform); + }, + resolveRequireSourcesAndUpdateMeta: (rollupContext) => async (parentId, isParentCommonJS, parentMeta, sources) => { + parentMeta.initialCommonJSType = isParentCommonJS; + parentMeta.requires = []; + parentMeta.isRequiredCommonJS = Object.create(null); + setInitialParentType(parentId, isParentCommonJS); + const currentlyResolvingForParent = currentlyResolving.get(parentId) || /* @__PURE__ */ new Set(); + currentlyResolving.set(parentId, currentlyResolvingForParent); + const requireTargets = await Promise.all(sources.map(async ({ source, isConditional }) => { + if (source.startsWith("\0")) return { + id: source, + allowProxy: false + }; + currentlyResolvingForParent.add(source); + const resolved = await rollupContext.resolve(source, parentId, { + skipSelf: false, + custom: { "node-resolve": { isRequire: true } } + }) || resolveExtensions(source, parentId, extensions$1); + currentlyResolvingForParent.delete(source); + if (!resolved) return { + id: wrapId$1(source, EXTERNAL_SUFFIX), + allowProxy: false + }; + const childId = resolved.id; + if (resolved.external) return { + id: wrapId$1(childId, EXTERNAL_SUFFIX), + allowProxy: false + }; + parentMeta.requires.push({ + resolved, + isConditional + }); + await analyzeRequiredModule(parentId, resolved, isConditional, rollupContext.load); + return { + id: childId, + allowProxy: true + }; + })); + parentMeta.isCommonJS = getTypeForFullyAnalyzedModule(parentId); + fullyAnalyzedModules[parentId] = true; + return requireTargets.map(({ id: dependencyId, allowProxy }, index) => { + let isCommonJS = parentMeta.isRequiredCommonJS[dependencyId] = getTypeForFullyAnalyzedModule(dependencyId); + const isExternalWrapped = isWrappedId(dependencyId, EXTERNAL_SUFFIX); + let resolvedDependencyId = dependencyId; + if (requireNodeBuiltins === true) { + if (parentMeta.isCommonJS === IS_WRAPPED_COMMONJS && !allowProxy && isExternalWrapped) { + if (unwrapId$1(dependencyId, EXTERNAL_SUFFIX).startsWith("node:")) { + isCommonJS = IS_WRAPPED_COMMONJS; + parentMeta.isRequiredCommonJS[dependencyId] = isCommonJS; + } + } else if (isExternalWrapped && !allowProxy) { + const actualExternalId = unwrapId$1(dependencyId, EXTERNAL_SUFFIX); + if (actualExternalId.startsWith("node:")) resolvedDependencyId = actualExternalId; + } + } + const isWrappedCommonJS = isCommonJS === IS_WRAPPED_COMMONJS; + fullyAnalyzedModules[dependencyId] = true; + const moduleInfo = isWrappedCommonJS && !isExternalWrapped ? rollupContext.getModuleInfo(dependencyId) : null; + return { + wrappedModuleSideEffects: !isWrappedCommonJS ? false : moduleInfo?.moduleSideEffects ?? true, + source: sources[index].source, + id: allowProxy ? wrapId$1(resolvedDependencyId, isWrappedCommonJS ? WRAPPED_SUFFIX : PROXY_SUFFIX) : resolvedDependencyId, + isCommonJS + }; + }); + }, + isCurrentlyResolving(source, parentId) { + const currentlyResolvingForParent = currentlyResolving.get(parentId); + return currentlyResolvingForParent && currentlyResolvingForParent.has(source); + } + }; +} +function validateVersion(actualVersion, peerDependencyVersion, name) { + const versionRegexp = /\^(\d+\.\d+\.\d+)/g; + let minMajor = Infinity; + let minMinor = Infinity; + let minPatch = Infinity; + let foundVersion; + while (foundVersion = versionRegexp.exec(peerDependencyVersion)) { + const [foundMajor, foundMinor, foundPatch] = foundVersion[1].split(".").map(Number); + if (foundMajor < minMajor) { + minMajor = foundMajor; + minMinor = foundMinor; + minPatch = foundPatch; + } + } + if (!actualVersion) throw new Error(`Insufficient ${name} version: "@rollup/plugin-commonjs" requires at least ${name}@${minMajor}.${minMinor}.${minPatch}.`); + const [major, minor, patch] = actualVersion.split(".").map(Number); + if (major < minMajor || major === minMajor && (minor < minMinor || minor === minMinor && patch < minPatch)) throw new Error(`Insufficient ${name} version: "@rollup/plugin-commonjs" requires at least ${name}@${minMajor}.${minMinor}.${minPatch} but found ${name}@${actualVersion}.`); +} +const operators = { + "==": (x) => equals(x.left, x.right, false), + "!=": (x) => not(operators["=="](x)), + "===": (x) => equals(x.left, x.right, true), + "!==": (x) => not(operators["==="](x)), + "!": (x) => isFalsy(x.argument), + "&&": (x) => isTruthy(x.left) && isTruthy(x.right), + "||": (x) => isTruthy(x.left) || isTruthy(x.right) +}; +function not(value$1) { + return value$1 === null ? value$1 : !value$1; +} +function equals(a, b, strict) { + if (a.type !== b.type) return null; + if (a.type === "Literal") return strict ? a.value === b.value : a.value == b.value; + return null; +} +function isTruthy(node) { + if (!node) return false; + if (node.type === "Literal") return !!node.value; + if (node.type === "ParenthesizedExpression") return isTruthy(node.expression); + if (node.operator in operators) return operators[node.operator](node); + return null; +} +function isFalsy(node) { + return not(isTruthy(node)); +} +function getKeypath(node) { + const parts = []; + while (node.type === "MemberExpression") { + if (node.computed) return null; + parts.unshift(node.property.name); + node = node.object; + } + if (node.type !== "Identifier") return null; + const { name } = node; + parts.unshift(name); + return { + name, + keypath: parts.join(".") + }; +} +const KEY_COMPILED_ESM = "__esModule"; +function getDefineCompiledEsmType(node) { + const definedPropertyWithExports = getDefinePropertyCallName(node, "exports"); + const definedProperty = definedPropertyWithExports || getDefinePropertyCallName(node, "module.exports"); + if (definedProperty && definedProperty.key === KEY_COMPILED_ESM) return isTruthy(definedProperty.value) ? definedPropertyWithExports ? "exports" : "module" : false; + return false; +} +function getDefinePropertyCallName(node, targetName) { + const { callee: { object, property } } = node; + if (!object || object.type !== "Identifier" || object.name !== "Object") return; + if (!property || property.type !== "Identifier" || property.name !== "defineProperty") return; + if (node.arguments.length !== 3) return; + const targetNames = targetName.split("."); + const [target, key, value$1] = node.arguments; + if (targetNames.length === 1) { + if (target.type !== "Identifier" || target.name !== targetNames[0]) return; + } + if (targetNames.length === 2) { + if (target.type !== "MemberExpression" || target.object.name !== targetNames[0] || target.property.name !== targetNames[1]) return; + } + if (value$1.type !== "ObjectExpression" || !value$1.properties) return; + const valueProperty = value$1.properties.find((p) => p.key && p.key.name === "value"); + if (!valueProperty || !valueProperty.value) return; + return { + key: key.value, + value: valueProperty.value + }; +} +function isShorthandProperty(parent) { + return parent && parent.type === "Property" && parent.shorthand; +} +function wrapCode(magicString, uses, moduleName, exportsName, indentExclusionRanges) { + const args = []; + const passedArgs = []; + if (uses.module) { + args.push("module"); + passedArgs.push(moduleName); + } + if (uses.exports) { + args.push("exports"); + passedArgs.push(uses.module ? `${moduleName}.exports` : exportsName); + } + magicString.trim().indent(" ", { exclude: indentExclusionRanges }).prepend(`(function (${args.join(", ")}) {\n`).append(` \n} (${passedArgs.join(", ")}));`); +} +function rewriteExportsAndGetExportsBlock(magicString, moduleName, exportsName, exportedExportsName, wrapped, moduleExportsAssignments, firstTopLevelModuleExportsAssignment, exportsAssignmentsByName, topLevelAssignments, defineCompiledEsmExpressions, deconflictedExportNames, code, HELPERS_NAME, exportMode, defaultIsModuleExports, usesRequireWrapper, requireName) { + const exports$1 = []; + const exportDeclarations = []; + if (usesRequireWrapper) getExportsWhenUsingRequireWrapper(magicString, wrapped, exportMode, exports$1, moduleExportsAssignments, exportsAssignmentsByName, moduleName, exportsName, requireName, defineCompiledEsmExpressions); + else if (exportMode === "replace") getExportsForReplacedModuleExports(magicString, exports$1, exportDeclarations, moduleExportsAssignments, firstTopLevelModuleExportsAssignment, exportsName, defaultIsModuleExports, HELPERS_NAME); + else { + if (exportMode === "module") { + exportDeclarations.push(`var ${exportedExportsName} = ${moduleName}.exports`); + exports$1.push(`${exportedExportsName} as __moduleExports`); + } else exports$1.push(`${exportsName} as __moduleExports`); + if (wrapped) exportDeclarations.push(getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME)); + else getExports(magicString, exports$1, exportDeclarations, moduleExportsAssignments, exportsAssignmentsByName, deconflictedExportNames, topLevelAssignments, moduleName, exportsName, exportedExportsName, defineCompiledEsmExpressions, HELPERS_NAME, defaultIsModuleExports, exportMode); + } + if (exports$1.length) exportDeclarations.push(`export { ${exports$1.join(", ")} }`); + return `\n\n${exportDeclarations.join(";\n")};`; +} +function getExportsWhenUsingRequireWrapper(magicString, wrapped, exportMode, exports$1, moduleExportsAssignments, exportsAssignmentsByName, moduleName, exportsName, requireName, defineCompiledEsmExpressions) { + exports$1.push(`${requireName} as __require`); + if (wrapped) return; + if (exportMode === "replace") rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName); + else { + rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, `${moduleName}.exports`); + for (const [exportName, { nodes }] of exportsAssignmentsByName) for (const { node, type } of nodes) magicString.overwrite(node.start, node.left.end, `${exportMode === "module" && type === "module" ? `${moduleName}.exports` : exportsName}.${exportName}`); + replaceDefineCompiledEsmExpressionsAndGetIfRestorable(defineCompiledEsmExpressions, magicString, exportMode, moduleName, exportsName); + } +} +function getExportsForReplacedModuleExports(magicString, exports$1, exportDeclarations, moduleExportsAssignments, firstTopLevelModuleExportsAssignment, exportsName, defaultIsModuleExports, HELPERS_NAME) { + for (const { left } of moduleExportsAssignments) magicString.overwrite(left.start, left.end, exportsName); + magicString.prependRight(firstTopLevelModuleExportsAssignment.left.start, "var "); + exports$1.push(`${exportsName} as __moduleExports`); + exportDeclarations.push(getDefaultExportDeclaration(exportsName, defaultIsModuleExports, HELPERS_NAME)); +} +function getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME) { + return `export default ${defaultIsModuleExports === true ? exportedExportsName : defaultIsModuleExports === false ? `${exportedExportsName}.default` : `/*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${exportedExportsName})`}`; +} +function getExports(magicString, exports$1, exportDeclarations, moduleExportsAssignments, exportsAssignmentsByName, deconflictedExportNames, topLevelAssignments, moduleName, exportsName, exportedExportsName, defineCompiledEsmExpressions, HELPERS_NAME, defaultIsModuleExports, exportMode) { + let deconflictedDefaultExportName; + for (const { left } of moduleExportsAssignments) magicString.overwrite(left.start, left.end, `${moduleName}.exports`); + for (const [exportName, { nodes }] of exportsAssignmentsByName) { + const deconflicted = deconflictedExportNames[exportName]; + let needsDeclaration = true; + for (const { node, type } of nodes) { + let replacement = `${deconflicted} = ${exportMode === "module" && type === "module" ? `${moduleName}.exports` : exportsName}.${exportName}`; + if (needsDeclaration && topLevelAssignments.has(node)) { + replacement = `var ${replacement}`; + needsDeclaration = false; + } + magicString.overwrite(node.start, node.left.end, replacement); + } + if (needsDeclaration) magicString.prepend(`var ${deconflicted};\n`); + if (exportName === "default") deconflictedDefaultExportName = deconflicted; + else exports$1.push(exportName === deconflicted ? exportName : `${deconflicted} as ${exportName}`); + } + const isRestorableCompiledEsm = replaceDefineCompiledEsmExpressionsAndGetIfRestorable(defineCompiledEsmExpressions, magicString, exportMode, moduleName, exportsName); + if (defaultIsModuleExports === false || defaultIsModuleExports === "auto" && isRestorableCompiledEsm && moduleExportsAssignments.length === 0) exports$1.push(`${deconflictedDefaultExportName || exportedExportsName} as default`); + else if (defaultIsModuleExports === true || !isRestorableCompiledEsm && moduleExportsAssignments.length === 0) exports$1.push(`${exportedExportsName} as default`); + else exportDeclarations.push(getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME)); +} +function rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName) { + for (const { left } of moduleExportsAssignments) magicString.overwrite(left.start, left.end, exportsName); +} +function replaceDefineCompiledEsmExpressionsAndGetIfRestorable(defineCompiledEsmExpressions, magicString, exportMode, moduleName, exportsName) { + let isRestorableCompiledEsm = false; + for (const { node, type } of defineCompiledEsmExpressions) { + isRestorableCompiledEsm = true; + const moduleExportsExpression = node.type === "CallExpression" ? node.arguments[0] : node.left.object; + magicString.overwrite(moduleExportsExpression.start, moduleExportsExpression.end, exportMode === "module" && type === "module" ? `${moduleName}.exports` : exportsName); + } + return isRestorableCompiledEsm; +} +function isRequireExpression(node, scope) { + if (!node) return false; + if (node.type !== "CallExpression") return false; + if (node.arguments.length === 0) return false; + return isRequire(node.callee, scope); +} +function isRequire(node, scope) { + return node.type === "Identifier" && node.name === "require" && !scope.contains("require") || node.type === "MemberExpression" && isModuleRequire(node, scope); +} +function isModuleRequire({ object, property }, scope) { + return object.type === "Identifier" && object.name === "module" && property.type === "Identifier" && property.name === "require" && !scope.contains("module"); +} +function hasDynamicArguments(node) { + return node.arguments.length > 1 || node.arguments[0].type !== "Literal" && (node.arguments[0].type !== "TemplateLiteral" || node.arguments[0].expressions.length > 0); +} +const reservedMethod = { + resolve: true, + cache: true, + main: true +}; +function isNodeRequirePropertyAccess(parent) { + return parent && parent.property && reservedMethod[parent.property.name]; +} +function getRequireStringArg(node) { + return node.arguments[0].type === "Literal" ? node.arguments[0].value : node.arguments[0].quasis[0].value.cooked; +} +function getRequireHandlers() { + const requireExpressions = []; + function addRequireExpression(sourceId, node, scope, usesReturnValue, isInsideTryBlock, isInsideConditional, toBeRemoved) { + requireExpressions.push({ + sourceId, + node, + scope, + usesReturnValue, + isInsideTryBlock, + isInsideConditional, + toBeRemoved + }); + } + async function rewriteRequireExpressionsAndGetImportBlock(magicString, topLevelDeclarations, reassignedNames, helpersName, dynamicRequireName, moduleName, exportsName, id, exportMode, resolveRequireSourcesAndUpdateMeta, needsRequireWrapper, isEsModule, isDynamicRequireModulesEnabled, getIgnoreTryCatchRequireStatementMode, commonjsMeta) { + const imports = []; + imports.push(`import * as ${helpersName} from "${HELPERS_ID}"`); + if (dynamicRequireName) imports.push(`import { ${isDynamicRequireModulesEnabled ? CREATE_COMMONJS_REQUIRE_EXPORT : COMMONJS_REQUIRE_EXPORT} as ${dynamicRequireName} } from "${DYNAMIC_MODULES_ID}"`); + if (exportMode === "module") imports.push(`import { __module as ${moduleName} } from ${JSON.stringify(wrapId$1(id, MODULE_SUFFIX))}`, `var ${exportsName} = ${moduleName}.exports`); + else if (exportMode === "exports") imports.push(`import { __exports as ${exportsName} } from ${JSON.stringify(wrapId$1(id, EXPORTS_SUFFIX))}`); + const requiresBySource = collectSources(requireExpressions); + processRequireExpressions(imports, await resolveRequireSourcesAndUpdateMeta(id, needsRequireWrapper ? IS_WRAPPED_COMMONJS : !isEsModule, commonjsMeta, Object.keys(requiresBySource).map((source) => { + return { + source, + isConditional: requiresBySource[source].every((require$2) => require$2.isInsideConditional) + }; + })), requiresBySource, getIgnoreTryCatchRequireStatementMode, magicString); + return imports.length ? `${imports.join(";\n")};\n\n` : ""; + } + return { + addRequireExpression, + rewriteRequireExpressionsAndGetImportBlock + }; +} +function collectSources(requireExpressions) { + const requiresBySource = Object.create(null); + for (const requireExpression of requireExpressions) { + const { sourceId } = requireExpression; + if (!requiresBySource[sourceId]) requiresBySource[sourceId] = []; + requiresBySource[sourceId].push(requireExpression); + } + return requiresBySource; +} +function processRequireExpressions(imports, requireTargets, requiresBySource, getIgnoreTryCatchRequireStatementMode, magicString) { + const generateRequireName = getGenerateRequireName(); + for (const { source, id: resolvedId, isCommonJS, wrappedModuleSideEffects } of requireTargets) { + const requires = requiresBySource[source]; + const name = generateRequireName(requires); + let usesRequired = false; + let needsImport = false; + for (const { node, usesReturnValue, toBeRemoved, isInsideTryBlock } of requires) { + const { canConvertRequire, shouldRemoveRequire } = isInsideTryBlock && isWrappedId(resolvedId, EXTERNAL_SUFFIX) ? getIgnoreTryCatchRequireStatementMode(source) : { + canConvertRequire: true, + shouldRemoveRequire: false + }; + if (shouldRemoveRequire) if (usesReturnValue) magicString.overwrite(node.start, node.end, "undefined"); + else magicString.remove(toBeRemoved.start, toBeRemoved.end); + else if (canConvertRequire) { + needsImport = true; + if (isCommonJS === IS_WRAPPED_COMMONJS) magicString.overwrite(node.start, node.end, `${wrappedModuleSideEffects ? "" : "/*@__PURE__*/ "}${name}()`); + else if (usesReturnValue) { + usesRequired = true; + magicString.overwrite(node.start, node.end, name); + } else magicString.remove(toBeRemoved.start, toBeRemoved.end); + } + } + if (needsImport) if (isCommonJS === IS_WRAPPED_COMMONJS) imports.push(`import { __require as ${name} } from ${JSON.stringify(resolvedId)}`); + else imports.push(`import ${usesRequired ? `${name} from ` : ""}${JSON.stringify(resolvedId)}`); + } +} +function getGenerateRequireName() { + let uid = 0; + return (requires) => { + let name; + const hasNameConflict = ({ scope }) => scope.contains(name); + do { + name = `require$$${uid}`; + uid += 1; + } while (requires.some(hasNameConflict)); + return name; + }; +} +const exportsPattern = /^(?:module\.)?exports(?:\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/; +const functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/; +async function transformCommonjs(parse$15, code, id, isEsModule, ignoreGlobal, ignoreRequire, ignoreDynamicRequires, getIgnoreTryCatchRequireStatementMode, sourceMap, isDynamicRequireModulesEnabled, dynamicRequireModules, commonDir, astCache, defaultIsModuleExports, needsRequireWrapper, resolveRequireSourcesAndUpdateMeta, isRequired, checkDynamicRequire, commonjsMeta) { + const ast = astCache || tryParse(parse$15, code, id); + const magicString = new MagicString(code); + const uses = { + module: false, + exports: false, + global: false, + require: false + }; + const virtualDynamicRequirePath = isDynamicRequireModulesEnabled && getVirtualPathForDynamicRequirePath(dirname$1(id), commonDir); + let scope = attachScopes(ast, "scope"); + let lexicalDepth = 0; + let programDepth = 0; + let classBodyDepth = 0; + let currentTryBlockEnd = null; + let shouldWrap = false; + const globals = /* @__PURE__ */ new Set(); + let currentConditionalNodeEnd = null; + const conditionalNodes = /* @__PURE__ */ new Set(); + const { addRequireExpression, rewriteRequireExpressionsAndGetImportBlock } = getRequireHandlers(); + const reassignedNames = /* @__PURE__ */ new Set(); + const topLevelDeclarations = []; + const skippedNodes = /* @__PURE__ */ new Set(); + const moduleAccessScopes = new Set([scope]); + const exportsAccessScopes = new Set([scope]); + const moduleExportsAssignments = []; + let firstTopLevelModuleExportsAssignment = null; + const exportsAssignmentsByName = /* @__PURE__ */ new Map(); + const topLevelAssignments = /* @__PURE__ */ new Set(); + const topLevelDefineCompiledEsmExpressions = []; + const replacedGlobal = []; + const replacedThis = []; + const replacedDynamicRequires = []; + const importedVariables = /* @__PURE__ */ new Set(); + const indentExclusionRanges = []; + walk$2(ast, { + enter(node, parent) { + if (skippedNodes.has(node)) { + this.skip(); + return; + } + if (currentTryBlockEnd !== null && node.start > currentTryBlockEnd) currentTryBlockEnd = null; + if (currentConditionalNodeEnd !== null && node.start > currentConditionalNodeEnd) currentConditionalNodeEnd = null; + if (currentConditionalNodeEnd === null && conditionalNodes.has(node)) currentConditionalNodeEnd = node.end; + programDepth += 1; + if (node.scope) ({scope} = node); + if (functionType.test(node.type)) lexicalDepth += 1; + if (sourceMap) { + magicString.addSourcemapLocation(node.start); + magicString.addSourcemapLocation(node.end); + } + switch (node.type) { + case "AssignmentExpression": + if (node.left.type === "MemberExpression") { + const flattened = getKeypath(node.left); + if (!flattened || scope.contains(flattened.name)) return; + const exportsPatternMatch = exportsPattern.exec(flattened.keypath); + if (!exportsPatternMatch || flattened.keypath === "exports") return; + const [, exportName] = exportsPatternMatch; + uses[flattened.name] = true; + if (flattened.keypath === "module.exports") { + moduleExportsAssignments.push(node); + if (programDepth > 3) moduleAccessScopes.add(scope); + else if (!firstTopLevelModuleExportsAssignment) firstTopLevelModuleExportsAssignment = node; + } else if (exportName === KEY_COMPILED_ESM) if (programDepth > 3) shouldWrap = true; + else topLevelDefineCompiledEsmExpressions.push({ + node, + type: flattened.name + }); + else { + const exportsAssignments = exportsAssignmentsByName.get(exportName) || { + nodes: [], + scopes: /* @__PURE__ */ new Set() + }; + exportsAssignments.nodes.push({ + node, + type: flattened.name + }); + exportsAssignments.scopes.add(scope); + exportsAccessScopes.add(scope); + exportsAssignmentsByName.set(exportName, exportsAssignments); + if (programDepth <= 3) topLevelAssignments.add(node); + } + skippedNodes.add(node.left); + } else for (const name of extractAssignedNames(node.left)) reassignedNames.add(name); + return; + case "CallExpression": { + const defineCompiledEsmType = getDefineCompiledEsmType(node); + if (defineCompiledEsmType) { + if (programDepth === 3 && parent.type === "ExpressionStatement") { + skippedNodes.add(node.arguments[0]); + topLevelDefineCompiledEsmExpressions.push({ + node, + type: defineCompiledEsmType + }); + } else shouldWrap = true; + return; + } + if (isDynamicRequireModulesEnabled && node.callee.object && isRequire(node.callee.object, scope) && node.callee.property.name === "resolve") { + checkDynamicRequire(node.start); + uses.require = true; + replacedDynamicRequires.push(node.callee.object); + skippedNodes.add(node.callee); + return; + } + if (!isRequireExpression(node, scope)) { + const keypath = getKeypath(node.callee); + if (keypath && importedVariables.has(keypath.name)) currentConditionalNodeEnd = Infinity; + return; + } + skippedNodes.add(node.callee); + uses.require = true; + if (hasDynamicArguments(node)) { + if (isDynamicRequireModulesEnabled) checkDynamicRequire(node.start); + if (!ignoreDynamicRequires) replacedDynamicRequires.push(node.callee); + return; + } + const requireStringArg = getRequireStringArg(node); + if (!ignoreRequire(requireStringArg)) { + addRequireExpression(requireStringArg, node, scope, parent.type !== "ExpressionStatement", currentTryBlockEnd !== null, currentConditionalNodeEnd !== null, parent.type === "ExpressionStatement" && (!currentConditionalNodeEnd || currentTryBlockEnd !== null && currentTryBlockEnd < currentConditionalNodeEnd) ? parent : node); + if (parent.type === "VariableDeclarator" && parent.id.type === "Identifier") for (const name of extractAssignedNames(parent.id)) importedVariables.add(name); + } + return; + } + case "ClassBody": + classBodyDepth += 1; + return; + case "ConditionalExpression": + case "IfStatement": + if (isFalsy(node.test)) skippedNodes.add(node.consequent); + else if (isTruthy(node.test)) { + if (node.alternate) skippedNodes.add(node.alternate); + } else { + conditionalNodes.add(node.consequent); + if (node.alternate) conditionalNodes.add(node.alternate); + } + return; + case "ArrowFunctionExpression": + case "FunctionDeclaration": + case "FunctionExpression": + if (currentConditionalNodeEnd === null && !(parent.type === "CallExpression" && parent.callee === node)) currentConditionalNodeEnd = node.end; + return; + case "Identifier": { + const { name } = node; + if (!(0, import_is_reference.default)(node, parent) || scope.contains(name) || parent.type === "PropertyDefinition" && parent.key === node) return; + switch (name) { + case "require": + uses.require = true; + if (isNodeRequirePropertyAccess(parent)) return; + if (!ignoreDynamicRequires) { + if (isShorthandProperty(parent)) { + skippedNodes.add(parent.value); + magicString.prependRight(node.start, "require: "); + } + replacedDynamicRequires.push(node); + } + return; + case "module": + case "exports": + shouldWrap = true; + uses[name] = true; + return; + case "global": + uses.global = true; + if (!ignoreGlobal) replacedGlobal.push(node); + return; + case "define": + magicString.overwrite(node.start, node.end, "undefined", { storeName: true }); + return; + default: + globals.add(name); + return; + } + } + case "LogicalExpression": + if (node.operator === "&&") { + if (isFalsy(node.left)) skippedNodes.add(node.right); + else if (!isTruthy(node.left)) conditionalNodes.add(node.right); + } else if (node.operator === "||") { + if (isTruthy(node.left)) skippedNodes.add(node.right); + else if (!isFalsy(node.left)) conditionalNodes.add(node.right); + } + return; + case "MemberExpression": + if (!isDynamicRequireModulesEnabled && isModuleRequire(node, scope)) { + uses.require = true; + replacedDynamicRequires.push(node); + skippedNodes.add(node.object); + skippedNodes.add(node.property); + } + return; + case "ReturnStatement": + if (lexicalDepth === 0) shouldWrap = true; + return; + case "ThisExpression": + if (lexicalDepth === 0 && !classBodyDepth) { + uses.global = true; + if (!ignoreGlobal) replacedThis.push(node); + } + return; + case "TryStatement": + if (currentTryBlockEnd === null) currentTryBlockEnd = node.block.end; + if (currentConditionalNodeEnd === null) currentConditionalNodeEnd = node.end; + return; + case "UnaryExpression": + if (node.operator === "typeof") { + const flattened = getKeypath(node.argument); + if (!flattened) return; + if (scope.contains(flattened.name)) return; + if (!isEsModule && (flattened.keypath === "module.exports" || flattened.keypath === "module" || flattened.keypath === "exports")) magicString.overwrite(node.start, node.end, `'object'`, { storeName: false }); + } + return; + case "VariableDeclaration": + if (!scope.parent) topLevelDeclarations.push(node); + return; + case "TemplateElement": if (node.value.raw.includes("\n")) indentExclusionRanges.push([node.start, node.end]); + } + }, + leave(node) { + programDepth -= 1; + if (node.scope) scope = scope.parent; + if (functionType.test(node.type)) lexicalDepth -= 1; + if (node.type === "ClassBody") classBodyDepth -= 1; + } + }); + const nameBase = getName(id); + const exportsName = deconflict([...exportsAccessScopes], globals, nameBase); + const moduleName = deconflict([...moduleAccessScopes], globals, `${nameBase}Module`); + const requireName = deconflict([scope], globals, `require${capitalize(nameBase)}`); + const isRequiredName = deconflict([scope], globals, `hasRequired${capitalize(nameBase)}`); + const helpersName = deconflict([scope], globals, "commonjsHelpers"); + const dynamicRequireName = replacedDynamicRequires.length > 0 && deconflict([scope], globals, isDynamicRequireModulesEnabled ? CREATE_COMMONJS_REQUIRE_EXPORT : COMMONJS_REQUIRE_EXPORT); + const deconflictedExportNames = Object.create(null); + for (const [exportName, { scopes }] of exportsAssignmentsByName) deconflictedExportNames[exportName] = deconflict([...scopes], globals, exportName); + for (const node of replacedGlobal) magicString.overwrite(node.start, node.end, `${helpersName}.commonjsGlobal`, { storeName: true }); + for (const node of replacedThis) magicString.overwrite(node.start, node.end, exportsName, { storeName: true }); + for (const node of replacedDynamicRequires) magicString.overwrite(node.start, node.end, isDynamicRequireModulesEnabled ? `${dynamicRequireName}(${JSON.stringify(virtualDynamicRequirePath)})` : dynamicRequireName, { + contentOnly: true, + storeName: true + }); + shouldWrap = !isEsModule && (shouldWrap || uses.exports && moduleExportsAssignments.length > 0); + if (!(shouldWrap || isRequired || needsRequireWrapper || uses.module || uses.exports || uses.require || topLevelDefineCompiledEsmExpressions.length > 0) && (ignoreGlobal || !uses.global)) return { meta: { commonjs: { isCommonJS: false } } }; + let leadingComment = ""; + if (code.startsWith("/*")) { + const commentEnd = code.indexOf("*/", 2) + 2; + leadingComment = `${code.slice(0, commentEnd)}\n`; + magicString.remove(0, commentEnd).trim(); + } + let shebang = ""; + if (code.startsWith("#!")) { + const shebangEndPosition = code.indexOf("\n") + 1; + shebang = code.slice(0, shebangEndPosition); + magicString.remove(0, shebangEndPosition).trim(); + } + const exportMode = isEsModule ? "none" : shouldWrap ? uses.module ? "module" : "exports" : firstTopLevelModuleExportsAssignment ? exportsAssignmentsByName.size === 0 && topLevelDefineCompiledEsmExpressions.length === 0 ? "replace" : "module" : moduleExportsAssignments.length === 0 ? "exports" : "module"; + const exportedExportsName = exportMode === "module" ? deconflict([], globals, `${nameBase}Exports`) : exportsName; + const importBlock = await rewriteRequireExpressionsAndGetImportBlock(magicString, topLevelDeclarations, reassignedNames, helpersName, dynamicRequireName, moduleName, exportsName, id, exportMode, resolveRequireSourcesAndUpdateMeta, needsRequireWrapper, isEsModule, isDynamicRequireModulesEnabled, getIgnoreTryCatchRequireStatementMode, commonjsMeta); + const usesRequireWrapper = commonjsMeta.isCommonJS === IS_WRAPPED_COMMONJS; + const exportBlock = isEsModule ? "" : rewriteExportsAndGetExportsBlock(magicString, moduleName, exportsName, exportedExportsName, shouldWrap, moduleExportsAssignments, firstTopLevelModuleExportsAssignment, exportsAssignmentsByName, topLevelAssignments, topLevelDefineCompiledEsmExpressions, deconflictedExportNames, code, helpersName, exportMode, defaultIsModuleExports, usesRequireWrapper, requireName); + if (shouldWrap) wrapCode(magicString, uses, moduleName, exportsName, indentExclusionRanges); + if (usesRequireWrapper) { + magicString.trim().indent(" ", { exclude: indentExclusionRanges }); + const exported = exportMode === "module" ? `${moduleName}.exports` : exportsName; + magicString.prepend(`var ${isRequiredName}; + +function ${requireName} () { +\tif (${isRequiredName}) return ${exported}; +\t${isRequiredName} = 1; +`).append(` +\treturn ${exported}; +}`); + if (exportMode === "replace") magicString.prepend(`var ${exportsName};\n`); + } + magicString.trim().prepend(shebang + leadingComment + importBlock).append(exportBlock); + return { + code: magicString.toString(), + map: sourceMap ? magicString.generateMap() : null, + syntheticNamedExports: isEsModule || usesRequireWrapper ? false : "__moduleExports", + meta: { commonjs: { + ...commonjsMeta, + shebang + } } + }; +} +const PLUGIN_NAME = "commonjs"; +function commonjs(options$1 = {}) { + const { ignoreGlobal, ignoreDynamicRequires, requireReturnsDefault: requireReturnsDefaultOption, defaultIsModuleExports: defaultIsModuleExportsOption, esmExternals, requireNodeBuiltins = false } = options$1; + const extensions$1 = options$1.extensions || [".js"]; + const filter$1 = createFilter$2(options$1.include, options$1.exclude); + const isPossibleCjsId = (id) => { + const extName = extname$1(id); + return extName === ".cjs" || extensions$1.includes(extName) && filter$1(id); + }; + const { strictRequiresFilter, detectCyclesAndConditional } = getStrictRequiresFilter(options$1); + const getRequireReturnsDefault = typeof requireReturnsDefaultOption === "function" ? requireReturnsDefaultOption : () => requireReturnsDefaultOption; + let esmExternalIds; + const isEsmExternal = typeof esmExternals === "function" ? esmExternals : Array.isArray(esmExternals) ? (esmExternalIds = new Set(esmExternals), (id) => esmExternalIds.has(id)) : () => esmExternals; + const getDefaultIsModuleExports = typeof defaultIsModuleExportsOption === "function" ? defaultIsModuleExportsOption : () => typeof defaultIsModuleExportsOption === "boolean" ? defaultIsModuleExportsOption : "auto"; + const dynamicRequireRoot = typeof options$1.dynamicRequireRoot === "string" ? resolve$1(options$1.dynamicRequireRoot) : process.cwd(); + const { commonDir, dynamicRequireModules } = getDynamicRequireModules(options$1.dynamicRequireTargets, dynamicRequireRoot); + const isDynamicRequireModulesEnabled = dynamicRequireModules.size > 0; + const ignoreRequire = typeof options$1.ignore === "function" ? options$1.ignore : Array.isArray(options$1.ignore) ? (id) => options$1.ignore.includes(id) : () => false; + const getIgnoreTryCatchRequireStatementMode = (id) => { + const mode = typeof options$1.ignoreTryCatch === "function" ? options$1.ignoreTryCatch(id) : Array.isArray(options$1.ignoreTryCatch) ? options$1.ignoreTryCatch.includes(id) : typeof options$1.ignoreTryCatch !== "undefined" ? options$1.ignoreTryCatch : true; + return { + canConvertRequire: mode !== "remove" && mode !== true, + shouldRemoveRequire: mode === "remove" + }; + }; + const { currentlyResolving, resolveId } = getResolveId(extensions$1, isPossibleCjsId); + const sourceMap = options$1.sourceMap !== false; + let requireResolver; + function transformAndCheckExports(code, id) { + const normalizedId = normalizePathSlashes(id); + const { isEsModule, hasDefaultExport, hasNamedExports, ast } = analyzeTopLevelStatements(this.parse, code, id); + const commonjsMeta = this.getModuleInfo(id).meta.commonjs || {}; + if (hasDefaultExport) commonjsMeta.hasDefaultExport = true; + if (hasNamedExports) commonjsMeta.hasNamedExports = true; + if (!dynamicRequireModules.has(normalizedId) && (!(hasCjsKeywords(code, ignoreGlobal) || requireResolver.isRequiredId(id)) || isEsModule && !options$1.transformMixedEsModules)) { + commonjsMeta.isCommonJS = false; + return { meta: { commonjs: commonjsMeta } }; + } + const needsRequireWrapper = !isEsModule && (dynamicRequireModules.has(normalizedId) || strictRequiresFilter(id)); + const checkDynamicRequire = (position) => { + const normalizedDynamicRequireRoot = normalizePathSlashes(dynamicRequireRoot); + if (normalizedId.indexOf(normalizedDynamicRequireRoot) !== 0) this.error({ + code: "DYNAMIC_REQUIRE_OUTSIDE_ROOT", + normalizedId, + normalizedDynamicRequireRoot, + message: `"${normalizedId}" contains dynamic require statements but it is not within the current dynamicRequireRoot "${normalizedDynamicRequireRoot}". You should set dynamicRequireRoot to "${dirname$1(normalizedId)}" or one of its parent directories.` + }, position); + }; + return transformCommonjs(this.parse, code, id, isEsModule, ignoreGlobal || isEsModule, ignoreRequire, ignoreDynamicRequires && !isDynamicRequireModulesEnabled, getIgnoreTryCatchRequireStatementMode, sourceMap, isDynamicRequireModulesEnabled, dynamicRequireModules, commonDir, ast, getDefaultIsModuleExports(id), needsRequireWrapper, requireResolver.resolveRequireSourcesAndUpdateMeta(this), requireResolver.isRequiredId(id), checkDynamicRequire, commonjsMeta); + } + return { + name: PLUGIN_NAME, + version: version$1, + options(rawOptions) { + const plugins$1 = Array.isArray(rawOptions.plugins) ? [...rawOptions.plugins] : rawOptions.plugins ? [rawOptions.plugins] : []; + plugins$1.unshift({ + name: "commonjs--resolver", + resolveId + }); + return { + ...rawOptions, + plugins: plugins$1 + }; + }, + buildStart({ plugins: plugins$1 }) { + validateVersion(this.meta.rollupVersion, peerDependencies.rollup, "rollup"); + const nodeResolve = plugins$1.find(({ name }) => name === "node-resolve"); + if (nodeResolve) validateVersion(nodeResolve.version, "^13.0.6", "@rollup/plugin-node-resolve"); + if (options$1.namedExports != null) this.warn("The namedExports option from \"@rollup/plugin-commonjs\" is deprecated. Named exports are now handled automatically."); + requireResolver = getRequireResolver(extensions$1, detectCyclesAndConditional, currentlyResolving, requireNodeBuiltins); + }, + buildEnd() { + if (options$1.strictRequires === "debug") { + const wrappedIds = requireResolver.getWrappedIds(); + if (wrappedIds.length) this.warn({ + code: "WRAPPED_IDS", + ids: wrappedIds, + message: `The commonjs plugin automatically wrapped the following files:\n[\n${wrappedIds.map((id) => `\t${JSON.stringify(relative$1(process.cwd(), id))}`).join(",\n")}\n]` + }); + else this.warn({ + code: "WRAPPED_IDS", + ids: wrappedIds, + message: "The commonjs plugin did not wrap any files." + }); + } + }, + async load(id) { + if (id === HELPERS_ID) return getHelpersModule(); + if (isWrappedId(id, MODULE_SUFFIX)) { + const name = getName(unwrapId$1(id, MODULE_SUFFIX)); + return { + code: `var ${name} = {exports: {}}; export {${name} as __module}`, + meta: { commonjs: { isCommonJS: false } } + }; + } + if (isWrappedId(id, EXPORTS_SUFFIX)) { + const name = getName(unwrapId$1(id, EXPORTS_SUFFIX)); + return { + code: `var ${name} = {}; export {${name} as __exports}`, + meta: { commonjs: { isCommonJS: false } } + }; + } + if (isWrappedId(id, EXTERNAL_SUFFIX)) { + const actualId = unwrapId$1(id, EXTERNAL_SUFFIX); + if (requireNodeBuiltins === true && actualId.startsWith("node:")) return getExternalBuiltinRequireProxy(actualId); + return getUnknownRequireProxy(actualId, isEsmExternal(actualId) ? getRequireReturnsDefault(actualId) : true); + } + if (id.endsWith(ENTRY_SUFFIX)) { + const acutalId = id.slice(0, -15); + const { meta: { commonjs: commonjsMeta } } = this.getModuleInfo(acutalId); + const shebang = commonjsMeta?.shebang ?? ""; + return getEntryProxy(acutalId, getDefaultIsModuleExports(acutalId), this.getModuleInfo, shebang); + } + if (isWrappedId(id, ES_IMPORT_SUFFIX)) { + const actualId = unwrapId$1(id, ES_IMPORT_SUFFIX); + return getEsImportProxy(actualId, getDefaultIsModuleExports(actualId), (await this.load({ id: actualId })).moduleSideEffects); + } + if (id === DYNAMIC_MODULES_ID) return getDynamicModuleRegistry(isDynamicRequireModulesEnabled, dynamicRequireModules, commonDir, ignoreDynamicRequires); + if (isWrappedId(id, PROXY_SUFFIX)) { + const actualId = unwrapId$1(id, PROXY_SUFFIX); + return getStaticRequireProxy(actualId, getRequireReturnsDefault(actualId), this.load); + } + return null; + }, + shouldTransformCachedModule(...args) { + return requireResolver.shouldTransformCachedModule.call(this, ...args); + }, + transform(code, id) { + if (!isPossibleCjsId(id)) return null; + try { + return transformAndCheckExports.call(this, code, id); + } catch (err$2) { + return this.error(err$2, err$2.pos); + } + } + }; +} + +//#endregion +//#region src/node/environment.ts +/** +* Creates a function that hides the complexities of a WeakMap with an initial value +* to implement object metadata. Used by plugins to implement cross hooks per +* environment metadata +* +* @experimental +*/ +function perEnvironmentState(initial) { + const stateMap = /* @__PURE__ */ new WeakMap(); + return function(context) { + const { environment } = context; + let state = stateMap.get(environment); + if (!state) { + state = initial(environment); + stateMap.set(environment, state); + } + return state; + }; +} + +//#endregion +//#region src/node/plugins/reporter.ts +var import_picocolors$32 = /* @__PURE__ */ __toESM(require_picocolors(), 1); +const groups = [ + { + name: "Assets", + color: import_picocolors$32.default.green + }, + { + name: "CSS", + color: import_picocolors$32.default.magenta + }, + { + name: "JS", + color: import_picocolors$32.default.cyan + } +]; +const COMPRESSIBLE_ASSETS_RE = /\.(?:html|json|svg|txt|xml|xhtml|wasm)$/; +function buildReporterPlugin(config$2) { + const compress = promisify(gzip); + const numberFormatter = new Intl.NumberFormat("en", { + maximumFractionDigits: 2, + minimumFractionDigits: 2 + }); + const displaySize = (bytes) => { + return `${numberFormatter.format(bytes / 1e3)} kB`; + }; + const tty = process.stdout.isTTY && !process.env.CI; + const shouldLogInfo = LogLevels[config$2.logLevel || "info"] >= LogLevels.info; + const modulesReporter = shouldLogInfo ? perEnvironmentState((environment) => { + let hasTransformed = false; + let transformedCount = 0; + const logTransform = throttle((id) => { + writeLine(`transforming (${transformedCount}) ${import_picocolors$32.default.dim(path.relative(config$2.root, id))}`); + }); + return { + reset() { + transformedCount = 0; + }, + register(id) { + transformedCount++; + if (!tty) { + if (!hasTransformed) config$2.logger.info(`transforming...`); + } else { + if (id.includes(`?`)) return; + logTransform(id); + } + hasTransformed = true; + }, + log() { + if (tty) clearLine$1(); + environment.logger.info(`${import_picocolors$32.default.green(`✓`)} ${transformedCount} modules transformed.`); + } + }; + }) : void 0; + const chunksReporter = perEnvironmentState((environment) => { + let hasRenderedChunk = false; + let hasCompressChunk = false; + let chunkCount = 0; + let compressedCount = 0; + async function getCompressedSize(code) { + if (environment.config.consumer !== "client" || !environment.config.build.reportCompressedSize) return null; + if (shouldLogInfo && !hasCompressChunk) { + if (!tty) config$2.logger.info("computing gzip size..."); + else writeLine("computing gzip size (0)..."); + hasCompressChunk = true; + } + const compressed = await compress(typeof code === "string" ? code : Buffer.from(code)); + compressedCount++; + if (shouldLogInfo && tty) writeLine(`computing gzip size (${compressedCount})...`); + return compressed.length; + } + return { + reset() { + chunkCount = 0; + compressedCount = 0; + }, + register() { + chunkCount++; + if (shouldLogInfo) { + if (!tty) { + if (!hasRenderedChunk) environment.logger.info("rendering chunks..."); + } else writeLine(`rendering chunks (${chunkCount})...`); + hasRenderedChunk = true; + } + }, + async log(output, outDir) { + const chunkLimit = environment.config.build.chunkSizeWarningLimit; + let hasLargeChunks = false; + if (shouldLogInfo) { + const entries = (await Promise.all(Object.values(output).map(async (chunk) => { + if (chunk.type === "chunk") return { + name: chunk.fileName, + group: "JS", + size: Buffer.byteLength(chunk.code), + compressedSize: await getCompressedSize(chunk.code), + mapSize: chunk.map ? Buffer.byteLength(chunk.map.toString()) : null + }; + else { + if (chunk.fileName.endsWith(".map")) return null; + const isCSS = chunk.fileName.endsWith(".css"); + const isCompressible = isCSS || COMPRESSIBLE_ASSETS_RE.test(chunk.fileName); + return { + name: chunk.fileName, + group: isCSS ? "CSS" : "Assets", + size: Buffer.byteLength(chunk.source), + mapSize: null, + compressedSize: isCompressible ? await getCompressedSize(chunk.source) : null + }; + } + }))).filter(isDefined); + if (tty) clearLine$1(); + let longest = 0; + let biggestSize = 0; + let biggestMap = 0; + let biggestCompressSize = 0; + for (const entry of entries) { + if (entry.name.length > longest) longest = entry.name.length; + if (entry.size > biggestSize) biggestSize = entry.size; + if (entry.mapSize && entry.mapSize > biggestMap) biggestMap = entry.mapSize; + if (entry.compressedSize && entry.compressedSize > biggestCompressSize) biggestCompressSize = entry.compressedSize; + } + const sizePad = displaySize(biggestSize).length; + const mapPad = displaySize(biggestMap).length; + const compressPad = displaySize(biggestCompressSize).length; + const relativeOutDir = normalizePath(path.relative(config$2.root, path.resolve(config$2.root, outDir ?? environment.config.build.outDir))); + const assetsDir = path.join(environment.config.build.assetsDir, "/"); + for (const group of groups) { + const filtered = entries.filter((e$1) => e$1.group === group.name); + if (!filtered.length) continue; + for (const entry of filtered.sort((a, z) => a.size - z.size)) { + const isLarge = group.name === "JS" && entry.size / 1e3 > chunkLimit; + if (isLarge) hasLargeChunks = true; + const sizeColor = isLarge ? import_picocolors$32.default.yellow : import_picocolors$32.default.dim; + let log$3 = import_picocolors$32.default.dim(withTrailingSlash(relativeOutDir)); + log$3 += !config$2.build.lib && entry.name.startsWith(withTrailingSlash(assetsDir)) ? import_picocolors$32.default.dim(assetsDir) + group.color(entry.name.slice(assetsDir.length).padEnd(longest + 2 - assetsDir.length)) : group.color(entry.name.padEnd(longest + 2)); + log$3 += import_picocolors$32.default.bold(sizeColor(displaySize(entry.size).padStart(sizePad))); + if (entry.compressedSize) log$3 += import_picocolors$32.default.dim(` │ gzip: ${displaySize(entry.compressedSize).padStart(compressPad)}`); + if (entry.mapSize) log$3 += import_picocolors$32.default.dim(` │ map: ${displaySize(entry.mapSize).padStart(mapPad)}`); + config$2.logger.info(log$3); + } + } + } else hasLargeChunks = Object.values(output).some((chunk) => { + return chunk.type === "chunk" && chunk.code.length / 1e3 > chunkLimit; + }); + if (hasLargeChunks && environment.config.build.minify && !config$2.build.lib && environment.config.consumer === "client") environment.logger.warn(import_picocolors$32.default.yellow(`\n(!) Some chunks are larger than ${chunkLimit} kB after minification. Consider:\n- Using dynamic import() to code-split the application\n- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks\n- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.`)); + } + }; + }); + return { + name: "vite:reporter", + sharedDuringBuild: true, + perEnvironmentStartEndDuringDev: true, + ...modulesReporter ? { + transform(_, id) { + modulesReporter(this).register(id); + }, + buildStart() { + modulesReporter(this).reset(); + }, + buildEnd() { + modulesReporter(this).log(); + } + } : {}, + renderStart() { + chunksReporter(this).reset(); + }, + renderChunk(_, chunk, options$1) { + if (!options$1.inlineDynamicImports) for (const id of chunk.moduleIds) { + const module$1 = this.getModuleInfo(id); + if (!module$1) continue; + if (module$1.importers.length && module$1.dynamicImporters.length) { + if (module$1.dynamicImporters.some((id$1) => !isInNodeModules(id$1) && chunk.moduleIds.includes(id$1))) this.warn(`\n(!) ${module$1.id} is dynamically imported by ${module$1.dynamicImporters.join(", ")} but also statically imported by ${module$1.importers.join(", ")}, dynamic import will not move module into another chunk.\n`); + } + } + chunksReporter(this).register(); + }, + generateBundle() { + if (shouldLogInfo && tty) clearLine$1(); + }, + async writeBundle({ dir }, output) { + await chunksReporter(this).log(output, dir); + } + }; +} +function writeLine(output) { + clearLine$1(); + if (output.length < process.stdout.columns) process.stdout.write(output); + else process.stdout.write(output.substring(0, process.stdout.columns - 1)); +} +function clearLine$1() { + process.stdout.clearLine(0); + process.stdout.cursorTo(0); +} +function throttle(fn) { + let timerHandle = null; + return (...args) => { + if (timerHandle) return; + fn(...args); + timerHandle = setTimeout(() => { + timerHandle = null; + }, 100); + }; +} + +//#endregion +//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/util.js +const POSIX_SEP_RE = new RegExp("\\" + path.posix.sep, "g"); +const NATIVE_SEP_RE = new RegExp("\\" + path.sep, "g"); +/** @type {Map}*/ +const PATTERN_REGEX_CACHE = /* @__PURE__ */ new Map(); +const GLOB_ALL_PATTERN = `**/*`; +const TS_EXTENSIONS = [ + ".ts", + ".tsx", + ".mts", + ".cts" +]; +const TSJS_EXTENSIONS = TS_EXTENSIONS.concat([ + ".js", + ".jsx", + ".mjs", + ".cjs" +]); +const TS_EXTENSIONS_RE_GROUP = `\\.(?:${TS_EXTENSIONS.map((ext) => ext.substring(1)).join("|")})`; +const TSJS_EXTENSIONS_RE_GROUP = `\\.(?:${TSJS_EXTENSIONS.map((ext) => ext.substring(1)).join("|")})`; +const IS_POSIX = path.posix.sep === path.sep; +/** +* @template T +* @returns {{resolve:(result:T)=>void, reject:(error:any)=>void, promise: Promise}} +*/ +function makePromise() { + let resolve$4, reject; + return { + promise: new Promise((res, rej) => { + resolve$4 = res; + reject = rej; + }), + resolve: resolve$4, + reject + }; +} +/** +* @param {string} filename +* @param {import('./cache.js').TSConfckCache} [cache] +* @returns {Promise} +*/ +async function resolveTSConfigJson(filename, cache$1) { + if (path.extname(filename) !== ".json") return; + const tsconfig = path.resolve(filename); + if (cache$1 && (cache$1.hasParseResult(tsconfig) || cache$1.hasParseResult(filename))) return tsconfig; + return promises.stat(tsconfig).then((stat$4) => { + if (stat$4.isFile() || stat$4.isFIFO()) return tsconfig; + else throw new Error(`${filename} exists but is not a regular file.`); + }); +} +/** +* +* @param {string} dir an absolute directory path +* @returns {boolean} if dir path includes a node_modules segment +*/ +const isInNodeModules$1 = IS_POSIX ? (dir) => dir.includes("/node_modules/") : (dir) => dir.match(/[/\\]node_modules[/\\]/); +/** +* convert posix separator to native separator +* +* eg. +* windows: C:/foo/bar -> c:\foo\bar +* linux: /foo/bar -> /foo/bar +* +* @param {string} filename with posix separators +* @returns {string} filename with native separators +*/ +const posix2native = IS_POSIX ? (filename) => filename : (filename) => filename.replace(POSIX_SEP_RE, path.sep); +/** +* convert native separator to posix separator +* +* eg. +* windows: C:\foo\bar -> c:/foo/bar +* linux: /foo/bar -> /foo/bar +* +* @param {string} filename - filename with native separators +* @returns {string} filename with posix separators +*/ +const native2posix = IS_POSIX ? (filename) => filename : (filename) => filename.replace(NATIVE_SEP_RE, path.posix.sep); +/** +* converts params to native separator, resolves path and converts native back to posix +* +* needed on windows to handle posix paths in tsconfig +* +* @param dir {string|null} directory to resolve from +* @param filename {string} filename or pattern to resolve +* @returns string +*/ +const resolve2posix = IS_POSIX ? (dir, filename) => dir ? path.resolve(dir, filename) : path.resolve(filename) : (dir, filename) => native2posix(dir ? path.resolve(posix2native(dir), posix2native(filename)) : path.resolve(posix2native(filename))); +/** +* +* @param {import('./public.d.ts').TSConfckParseResult} result +* @param {import('./public.d.ts').TSConfckParseOptions} [options] +* @returns {string[]} +*/ +function resolveReferencedTSConfigFiles(result, options$1) { + const dir = path.dirname(result.tsconfigFile); + return result.tsconfig.references.map((ref) => { + return resolve2posix(dir, ref.path.endsWith(".json") ? ref.path : path.join(ref.path, options$1?.configName ?? "tsconfig.json")); + }); +} +/** +* @param {string} filename +* @param {import('./public.d.ts').TSConfckParseResult} result +* @returns {import('./public.d.ts').TSConfckParseResult} +*/ +function resolveSolutionTSConfig(filename, result) { + if (result.referenced && (result.tsconfig.compilerOptions?.allowJs ? TSJS_EXTENSIONS : TS_EXTENSIONS).some((ext) => filename.endsWith(ext)) && !isIncluded(filename, result)) { + const solutionTSConfig = result.referenced.find((referenced) => isIncluded(filename, referenced)); + if (solutionTSConfig) return solutionTSConfig; + } + return result; +} +/** +* +* @param {string} filename +* @param {import('./public.d.ts').TSConfckParseResult} result +* @returns {boolean} +*/ +function isIncluded(filename, result) { + const dir = native2posix(path.dirname(result.tsconfigFile)); + const files = (result.tsconfig.files || []).map((file) => resolve2posix(dir, file)); + const absoluteFilename = resolve2posix(null, filename); + if (files.includes(filename)) return true; + const allowJs = result.tsconfig.compilerOptions?.allowJs; + if (isGlobMatch(absoluteFilename, dir, result.tsconfig.include || (result.tsconfig.files ? [] : [GLOB_ALL_PATTERN]), allowJs)) return !isGlobMatch(absoluteFilename, dir, result.tsconfig.exclude || [], allowJs); + return false; +} +/** +* test filenames agains glob patterns in tsconfig +* +* @param filename {string} posix style abolute path to filename to test +* @param dir {string} posix style absolute path to directory of tsconfig containing patterns +* @param patterns {string[]} glob patterns to match against +* @param allowJs {boolean} allowJs setting in tsconfig to include js extensions in checks +* @returns {boolean} true when at least one pattern matches filename +*/ +function isGlobMatch(filename, dir, patterns, allowJs) { + const extensions$1 = allowJs ? TSJS_EXTENSIONS : TS_EXTENSIONS; + return patterns.some((pattern) => { + let lastWildcardIndex = pattern.length; + let hasWildcard = false; + let hasExtension = false; + let hasSlash = false; + let lastSlashIndex = -1; + for (let i$1 = pattern.length - 1; i$1 > -1; i$1--) { + const c = pattern[i$1]; + if (!hasWildcard) { + if (c === "*" || c === "?") { + lastWildcardIndex = i$1; + hasWildcard = true; + } + } + if (!hasSlash) { + if (c === ".") hasExtension = true; + else if (c === "/") { + lastSlashIndex = i$1; + hasSlash = true; + } + } + if (hasWildcard && hasSlash) break; + } + if (!hasExtension && (!hasWildcard || lastWildcardIndex < lastSlashIndex)) { + pattern += `${pattern.endsWith("/") ? "" : "/"}${GLOB_ALL_PATTERN}`; + lastWildcardIndex = pattern.length - 1; + hasWildcard = true; + } + if (lastWildcardIndex < pattern.length - 1 && !filename.endsWith(pattern.slice(lastWildcardIndex + 1))) return false; + if (pattern.endsWith("*") && !extensions$1.some((ext) => filename.endsWith(ext))) return false; + if (pattern === GLOB_ALL_PATTERN) return filename.startsWith(`${dir}/`); + const resolvedPattern = resolve2posix(dir, pattern); + let firstWildcardIndex = -1; + for (let i$1 = 0; i$1 < resolvedPattern.length; i$1++) if (resolvedPattern[i$1] === "*" || resolvedPattern[i$1] === "?") { + firstWildcardIndex = i$1; + hasWildcard = true; + break; + } + if (firstWildcardIndex > 1 && !filename.startsWith(resolvedPattern.slice(0, firstWildcardIndex - 1))) return false; + if (!hasWildcard) return filename === resolvedPattern; + else if (firstWildcardIndex + GLOB_ALL_PATTERN.length === resolvedPattern.length - (pattern.length - 1 - lastWildcardIndex) && resolvedPattern.slice(firstWildcardIndex, firstWildcardIndex + GLOB_ALL_PATTERN.length) === GLOB_ALL_PATTERN) return true; + if (PATTERN_REGEX_CACHE.has(resolvedPattern)) return PATTERN_REGEX_CACHE.get(resolvedPattern).test(filename); + const regex = pattern2regex(resolvedPattern, allowJs); + PATTERN_REGEX_CACHE.set(resolvedPattern, regex); + return regex.test(filename); + }); +} +/** +* @param {string} resolvedPattern +* @param {boolean} allowJs +* @returns {RegExp} +*/ +function pattern2regex(resolvedPattern, allowJs) { + let regexStr = "^"; + for (let i$1 = 0; i$1 < resolvedPattern.length; i$1++) { + const char = resolvedPattern[i$1]; + if (char === "?") { + regexStr += "[^\\/]"; + continue; + } + if (char === "*") { + if (resolvedPattern[i$1 + 1] === "*" && resolvedPattern[i$1 + 2] === "/") { + i$1 += 2; + regexStr += "(?:[^\\/]*\\/)*"; + continue; + } + regexStr += "[^\\/]*"; + continue; + } + if ("/.+^${}()|[]\\".includes(char)) regexStr += `\\`; + regexStr += char; + } + if (resolvedPattern.endsWith("*")) regexStr += allowJs ? TSJS_EXTENSIONS_RE_GROUP : TS_EXTENSIONS_RE_GROUP; + regexStr += "$"; + return new RegExp(regexStr); +} +/** +* replace tokens like ${configDir} +* @param {import('./public.d.ts').TSConfckParseResult} result +*/ +function replaceTokens(result) { + if (result.tsconfig) result.tsconfig = JSON.parse(JSON.stringify(result.tsconfig).replaceAll(/"\${configDir}/g, `"${native2posix(path.dirname(result.tsconfigFile))}`)); +} + +//#endregion +//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/find.js +/** +* find the closest tsconfig.json file +* +* @param {string} filename - path to file to find tsconfig for (absolute or relative to cwd) +* @param {import('./public.d.ts').TSConfckFindOptions} [options] - options +* @returns {Promise} absolute path to closest tsconfig.json or null if not found +*/ +async function find(filename, options$1) { + let dir = path.dirname(path.resolve(filename)); + if (options$1?.ignoreNodeModules && isInNodeModules$1(dir)) return null; + const cache$1 = options$1?.cache; + const configName = options$1?.configName ?? "tsconfig.json"; + if (cache$1?.hasConfigPath(dir, configName)) return cache$1.getConfigPath(dir, configName); + const { promise, resolve: resolve$4, reject } = makePromise(); + if (options$1?.root && !path.isAbsolute(options$1.root)) options$1.root = path.resolve(options$1.root); + findUp(dir, { + promise, + resolve: resolve$4, + reject + }, options$1); + return promise; +} +/** +* +* @param {string} dir +* @param {{promise:Promise,resolve:(result:string|null)=>void,reject:(err:any)=>void}} madePromise +* @param {import('./public.d.ts').TSConfckFindOptions} [options] - options +*/ +function findUp(dir, { resolve: resolve$4, reject, promise }, options$1) { + const { cache: cache$1, root, configName } = options$1 ?? {}; + if (cache$1) if (cache$1.hasConfigPath(dir, configName)) { + let cached; + try { + cached = cache$1.getConfigPath(dir, configName); + } catch (e$1) { + reject(e$1); + return; + } + if (cached?.then) cached.then(resolve$4).catch(reject); + else resolve$4(cached); + } else cache$1.setConfigPath(dir, promise, configName); + const tsconfig = path.join(dir, options$1?.configName ?? "tsconfig.json"); + fs.stat(tsconfig, (err$2, stats) => { + if (stats && (stats.isFile() || stats.isFIFO())) resolve$4(tsconfig); + else if (err$2?.code !== "ENOENT") reject(err$2); + else { + let parent; + if (root === dir || (parent = path.dirname(dir)) === dir) resolve$4(null); + else findUp(parent, { + promise, + resolve: resolve$4, + reject + }, options$1); + } + }); +} + +//#endregion +//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/to-json.js +/** +* convert content of tsconfig.json to regular json +* +* @param {string} tsconfigJson - content of tsconfig.json +* @returns {string} content as regular json, comments and dangling commas have been replaced with whitespace +*/ +function toJson(tsconfigJson) { + const stripped = stripDanglingComma(stripJsonComments(stripBom(tsconfigJson))); + if (stripped.trim() === "") return "{}"; + else return stripped; +} +/** +* replace dangling commas from pseudo-json string with single space +* implementation heavily inspired by strip-json-comments +* +* @param {string} pseudoJson +* @returns {string} +*/ +function stripDanglingComma(pseudoJson) { + let insideString = false; + let offset$1 = 0; + let result = ""; + let danglingCommaPos = null; + for (let i$1 = 0; i$1 < pseudoJson.length; i$1++) { + const currentCharacter = pseudoJson[i$1]; + if (currentCharacter === "\"") { + if (!isEscaped(pseudoJson, i$1)) insideString = !insideString; + } + if (insideString) { + danglingCommaPos = null; + continue; + } + if (currentCharacter === ",") { + danglingCommaPos = i$1; + continue; + } + if (danglingCommaPos) { + if (currentCharacter === "}" || currentCharacter === "]") { + result += pseudoJson.slice(offset$1, danglingCommaPos) + " "; + offset$1 = danglingCommaPos + 1; + danglingCommaPos = null; + } else if (!currentCharacter.match(/\s/)) danglingCommaPos = null; + } + } + return result + pseudoJson.substring(offset$1); +} +/** +* +* @param {string} jsonString +* @param {number} quotePosition +* @returns {boolean} +*/ +function isEscaped(jsonString, quotePosition) { + let index = quotePosition - 1; + let backslashCount = 0; + while (jsonString[index] === "\\") { + index -= 1; + backslashCount += 1; + } + return Boolean(backslashCount % 2); +} +/** +* +* @param {string} string +* @param {number?} start +* @param {number?} end +*/ +function strip(string, start, end) { + return string.slice(start, end).replace(/\S/g, " "); +} +const singleComment = Symbol("singleComment"); +const multiComment = Symbol("multiComment"); +/** +* @param {string} jsonString +* @returns {string} +*/ +function stripJsonComments(jsonString) { + let isInsideString = false; + /** @type {false | symbol} */ + let isInsideComment = false; + let offset$1 = 0; + let result = ""; + for (let index = 0; index < jsonString.length; index++) { + const currentCharacter = jsonString[index]; + const nextCharacter = jsonString[index + 1]; + if (!isInsideComment && currentCharacter === "\"") { + if (!isEscaped(jsonString, index)) isInsideString = !isInsideString; + } + if (isInsideString) continue; + if (!isInsideComment && currentCharacter + nextCharacter === "//") { + result += jsonString.slice(offset$1, index); + offset$1 = index; + isInsideComment = singleComment; + index++; + } else if (isInsideComment === singleComment && currentCharacter + nextCharacter === "\r\n") { + index++; + isInsideComment = false; + result += strip(jsonString, offset$1, index); + offset$1 = index; + } else if (isInsideComment === singleComment && currentCharacter === "\n") { + isInsideComment = false; + result += strip(jsonString, offset$1, index); + offset$1 = index; + } else if (!isInsideComment && currentCharacter + nextCharacter === "/*") { + result += jsonString.slice(offset$1, index); + offset$1 = index; + isInsideComment = multiComment; + index++; + } else if (isInsideComment === multiComment && currentCharacter + nextCharacter === "*/") { + index++; + isInsideComment = false; + result += strip(jsonString, offset$1, index + 1); + offset$1 = index + 1; + } + } + return result + (isInsideComment ? strip(jsonString.slice(offset$1)) : jsonString.slice(offset$1)); +} +/** +* @param {string} string +* @returns {string} +*/ +function stripBom(string) { + if (string.charCodeAt(0) === 65279) return string.slice(1); + return string; +} + +//#endregion +//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/parse.js +const not_found_result = { + tsconfigFile: null, + tsconfig: {} +}; +/** +* parse the closest tsconfig.json file +* +* @param {string} filename - path to a tsconfig .json or a source file or directory (absolute or relative to cwd) +* @param {import('./public.d.ts').TSConfckParseOptions} [options] - options +* @returns {Promise} +* @throws {TSConfckParseError} +*/ +async function parse$13(filename, options$1) { + /** @type {import('./cache.js').TSConfckCache} */ + const cache$1 = options$1?.cache; + if (cache$1?.hasParseResult(filename)) return getParsedDeep(filename, cache$1, options$1); + const { resolve: resolve$4, reject, promise } = makePromise(); + cache$1?.setParseResult(filename, promise, true); + try { + let tsconfigFile = await resolveTSConfigJson(filename, cache$1) || await find(filename, options$1); + if (!tsconfigFile) { + resolve$4(not_found_result); + return promise; + } + let result; + if (filename !== tsconfigFile && cache$1?.hasParseResult(tsconfigFile)) result = await getParsedDeep(tsconfigFile, cache$1, options$1); + else { + result = await parseFile$1(tsconfigFile, cache$1, filename === tsconfigFile); + await Promise.all([parseExtends(result, cache$1), parseReferences(result, options$1)]); + } + replaceTokens(result); + resolve$4(resolveSolutionTSConfig(filename, result)); + } catch (e$1) { + reject(e$1); + } + return promise; +} +/** +* ensure extends and references are parsed +* +* @param {string} filename - cached file +* @param {import('./cache.js').TSConfckCache} cache - cache +* @param {import('./public.d.ts').TSConfckParseOptions} options - options +*/ +async function getParsedDeep(filename, cache$1, options$1) { + const result = await cache$1.getParseResult(filename); + if (result.tsconfig.extends && !result.extended || result.tsconfig.references && !result.referenced) { + const promise = Promise.all([parseExtends(result, cache$1), parseReferences(result, options$1)]).then(() => result); + cache$1.setParseResult(filename, promise, true); + return promise; + } + return result; +} +/** +* +* @param {string} tsconfigFile - path to tsconfig file +* @param {import('./cache.js').TSConfckCache} [cache] - cache +* @param {boolean} [skipCache] - skip cache +* @returns {Promise} +*/ +async function parseFile$1(tsconfigFile, cache$1, skipCache) { + if (!skipCache && cache$1?.hasParseResult(tsconfigFile) && !cache$1.getParseResult(tsconfigFile)._isRootFile_) return cache$1.getParseResult(tsconfigFile); + const promise = promises.readFile(tsconfigFile, "utf-8").then(toJson).then((json) => { + const parsed = JSON.parse(json); + applyDefaults(parsed, tsconfigFile); + return { + tsconfigFile, + tsconfig: normalizeTSConfig(parsed, path.dirname(tsconfigFile)) + }; + }).catch((e$1) => { + throw new TSConfckParseError(`parsing ${tsconfigFile} failed: ${e$1}`, "PARSE_FILE", tsconfigFile, e$1); + }); + if (!skipCache && (!cache$1?.hasParseResult(tsconfigFile) || !cache$1.getParseResult(tsconfigFile)._isRootFile_)) cache$1?.setParseResult(tsconfigFile, promise); + return promise; +} +/** +* normalize to match the output of ts.parseJsonConfigFileContent +* +* @param {any} tsconfig - typescript tsconfig output +* @param {string} dir - directory +*/ +function normalizeTSConfig(tsconfig, dir) { + const baseUrl = tsconfig.compilerOptions?.baseUrl; + if (baseUrl && !baseUrl.startsWith("${") && !path.isAbsolute(baseUrl)) tsconfig.compilerOptions.baseUrl = resolve2posix(dir, baseUrl); + return tsconfig; +} +/** +* +* @param {import('./public.d.ts').TSConfckParseResult} result +* @param {import('./public.d.ts').TSConfckParseOptions} [options] +* @returns {Promise} +*/ +async function parseReferences(result, options$1) { + if (!result.tsconfig.references) return; + const referencedFiles = resolveReferencedTSConfigFiles(result, options$1); + const referenced = await Promise.all(referencedFiles.map((file) => parseFile$1(file, options$1?.cache))); + await Promise.all(referenced.map((ref) => parseExtends(ref, options$1?.cache))); + referenced.forEach((ref) => { + ref.solution = result; + replaceTokens(ref); + }); + result.referenced = referenced; +} +/** +* @param {import('./public.d.ts').TSConfckParseResult} result +* @param {import('./cache.js').TSConfckCache}[cache] +* @returns {Promise} +*/ +async function parseExtends(result, cache$1) { + if (!result.tsconfig.extends) return; + /** @type {import('./public.d.ts').TSConfckParseResult[]} */ + const extended = [{ + tsconfigFile: result.tsconfigFile, + tsconfig: JSON.parse(JSON.stringify(result.tsconfig)) + }]; + let pos = 0; + /** @type {string[]} */ + const extendsPath = []; + let currentBranchDepth = 0; + while (pos < extended.length) { + const extending = extended[pos]; + extendsPath.push(extending.tsconfigFile); + if (extending.tsconfig.extends) { + currentBranchDepth += 1; + /** @type {string[]} */ + let resolvedExtends; + if (!Array.isArray(extending.tsconfig.extends)) resolvedExtends = [resolveExtends(extending.tsconfig.extends, extending.tsconfigFile)]; + else resolvedExtends = extending.tsconfig.extends.reverse().map((ex) => resolveExtends(ex, extending.tsconfigFile)); + const circularExtends = resolvedExtends.find((tsconfigFile) => extendsPath.includes(tsconfigFile)); + if (circularExtends) throw new TSConfckParseError(`Circular dependency in "extends": ${extendsPath.concat([circularExtends]).join(" -> ")}`, "EXTENDS_CIRCULAR", result.tsconfigFile); + extended.splice(pos + 1, 0, ...await Promise.all(resolvedExtends.map((file) => parseFile$1(file, cache$1)))); + } else { + extendsPath.splice(-currentBranchDepth); + currentBranchDepth = 0; + } + pos = pos + 1; + } + result.extended = extended; + for (const ext of result.extended.slice(1)) extendTSConfig(result, ext); +} +/** +* +* @param {string} extended +* @param {string} from +* @returns {string} +*/ +function resolveExtends(extended, from) { + if ([".", ".."].includes(extended)) extended = extended + "/tsconfig.json"; + const req$4 = createRequire$1(from); + let error$1; + try { + return req$4.resolve(extended); + } catch (e$1) { + error$1 = e$1; + } + if (extended[0] !== "." && !path.isAbsolute(extended)) try { + return req$4.resolve(`${extended}/tsconfig.json`); + } catch (e$1) { + error$1 = e$1; + } + throw new TSConfckParseError(`failed to resolve "extends":"${extended}" in ${from}`, "EXTENDS_RESOLVE", from, error$1); +} +const EXTENDABLE_KEYS = [ + "compilerOptions", + "files", + "include", + "exclude", + "watchOptions", + "compileOnSave", + "typeAcquisition", + "buildOptions" +]; +/** +* +* @param {import('./public.d.ts').TSConfckParseResult} extending +* @param {import('./public.d.ts').TSConfckParseResult} extended +* @returns void +*/ +function extendTSConfig(extending, extended) { + const extendingConfig = extending.tsconfig; + const extendedConfig = extended.tsconfig; + const relativePath = native2posix(path.relative(path.dirname(extending.tsconfigFile), path.dirname(extended.tsconfigFile))); + for (const key of Object.keys(extendedConfig).filter((key$1) => EXTENDABLE_KEYS.includes(key$1))) if (key === "compilerOptions") { + if (!extendingConfig.compilerOptions) extendingConfig.compilerOptions = {}; + for (const option of Object.keys(extendedConfig.compilerOptions)) { + if (Object.prototype.hasOwnProperty.call(extendingConfig.compilerOptions, option)) continue; + extendingConfig.compilerOptions[option] = rebaseRelative(option, extendedConfig.compilerOptions[option], relativePath); + } + } else if (extendingConfig[key] === void 0) if (key === "watchOptions") { + extendingConfig.watchOptions = {}; + for (const option of Object.keys(extendedConfig.watchOptions)) extendingConfig.watchOptions[option] = rebaseRelative(option, extendedConfig.watchOptions[option], relativePath); + } else extendingConfig[key] = rebaseRelative(key, extendedConfig[key], relativePath); +} +const REBASE_KEYS = [ + "files", + "include", + "exclude", + "baseUrl", + "rootDir", + "rootDirs", + "typeRoots", + "outDir", + "outFile", + "declarationDir", + "excludeDirectories", + "excludeFiles" +]; +/** @typedef {string | string[]} PathValue */ +/** +* +* @param {string} key +* @param {PathValue} value +* @param {string} prependPath +* @returns {PathValue} +*/ +function rebaseRelative(key, value$1, prependPath) { + if (!REBASE_KEYS.includes(key)) return value$1; + if (Array.isArray(value$1)) return value$1.map((x) => rebasePath(x, prependPath)); + else return rebasePath(value$1, prependPath); +} +/** +* +* @param {string} value +* @param {string} prependPath +* @returns {string} +*/ +function rebasePath(value$1, prependPath) { + if (path.isAbsolute(value$1) || value$1.startsWith("${configDir}")) return value$1; + else return path.posix.normalize(path.posix.join(prependPath, value$1)); +} +var TSConfckParseError = class TSConfckParseError extends Error { + /** + * error code + * @type {string} + */ + code; + /** + * error cause + * @type { Error | undefined} + */ + cause; + /** + * absolute path of tsconfig file where the error happened + * @type {string} + */ + tsconfigFile; + /** + * + * @param {string} message - error message + * @param {string} code - error code + * @param {string} tsconfigFile - path to tsconfig file + * @param {Error?} cause - cause of this error + */ + constructor(message, code, tsconfigFile, cause) { + super(message); + Object.setPrototypeOf(this, TSConfckParseError.prototype); + this.name = TSConfckParseError.name; + this.code = code; + this.cause = cause; + this.tsconfigFile = tsconfigFile; + } +}; +/** +* +* @param {any} tsconfig +* @param {string} tsconfigFile +*/ +function applyDefaults(tsconfig, tsconfigFile) { + if (isJSConfig(tsconfigFile)) tsconfig.compilerOptions = { + ...DEFAULT_JSCONFIG_COMPILER_OPTIONS, + ...tsconfig.compilerOptions + }; +} +const DEFAULT_JSCONFIG_COMPILER_OPTIONS = { + allowJs: true, + maxNodeModuleJsDepth: 2, + allowSyntheticDefaultImports: true, + skipLibCheck: true, + noEmit: true +}; +/** +* @param {string} configFileName +*/ +function isJSConfig(configFileName) { + return path.basename(configFileName) === "jsconfig.json"; +} + +//#endregion +//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/parse-native.js +/** @typedef TSDiagnosticError { +code: number; +category: number; +messageText: string; +start?: number; +} TSDiagnosticError */ + +//#endregion +//#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/cache.js +/** @template T */ +var TSConfckCache = class { + /** + * clear cache, use this if you have a long running process and tsconfig files have been added,changed or deleted + */ + clear() { + this.#configPaths.clear(); + this.#parsed.clear(); + } + /** + * has cached closest config for files in dir + * @param {string} dir + * @param {string} [configName=tsconfig.json] + * @returns {boolean} + */ + hasConfigPath(dir, configName = "tsconfig.json") { + return this.#configPaths.has(`${dir}/${configName}`); + } + /** + * get cached closest tsconfig for files in dir + * @param {string} dir + * @param {string} [configName=tsconfig.json] + * @returns {Promise|string|null} + * @throws {unknown} if cached value is an error + */ + getConfigPath(dir, configName = "tsconfig.json") { + const key = `${dir}/${configName}`; + const value$1 = this.#configPaths.get(key); + if (value$1 == null || value$1.length || value$1.then) return value$1; + else throw value$1; + } + /** + * has parsed tsconfig for file + * @param {string} file + * @returns {boolean} + */ + hasParseResult(file) { + return this.#parsed.has(file); + } + /** + * get parsed tsconfig for file + * @param {string} file + * @returns {Promise|T} + * @throws {unknown} if cached value is an error + */ + getParseResult(file) { + const value$1 = this.#parsed.get(file); + if (value$1.then || value$1.tsconfig) return value$1; + else throw value$1; + } + /** + * @internal + * @private + * @param file + * @param {boolean} isRootFile a flag to check if current file which involking the parse() api, used to distinguish the normal cache which only parsed by parseFile() + * @param {Promise} result + */ + setParseResult(file, result, isRootFile = false) { + Object.defineProperty(result, "_isRootFile_", { + value: isRootFile, + writable: false, + enumerable: false, + configurable: false + }); + this.#parsed.set(file, result); + result.then((parsed) => { + if (this.#parsed.get(file) === result) this.#parsed.set(file, parsed); + }).catch((e$1) => { + if (this.#parsed.get(file) === result) this.#parsed.set(file, e$1); + }); + } + /** + * @internal + * @private + * @param {string} dir + * @param {Promise} configPath + * @param {string} [configName=tsconfig.json] + */ + setConfigPath(dir, configPath, configName = "tsconfig.json") { + const key = `${dir}/${configName}`; + this.#configPaths.set(key, configPath); + configPath.then((path$13) => { + if (this.#configPaths.get(key) === configPath) this.#configPaths.set(key, path$13); + }).catch((e$1) => { + if (this.#configPaths.get(key) === configPath) this.#configPaths.set(key, e$1); + }); + } + /** + * map directories to their closest tsconfig.json + * @internal + * @private + * @type{Map|string|null)>} + */ + #configPaths = /* @__PURE__ */ new Map(); + /** + * map files to their parsed tsconfig result + * @internal + * @private + * @type {Map|T)> } + */ + #parsed = /* @__PURE__ */ new Map(); +}; + +//#endregion +//#region src/node/plugins/esbuild.ts +var import_picocolors$31 = /* @__PURE__ */ __toESM(require_picocolors(), 1); +const debug$17 = createDebugger("vite:esbuild"); +const IIFE_BEGIN_RE = /(?:const|var)\s+\S+\s*=\s*\(?function\([^()]*\)\s*\{\s*"use strict";/; +const validExtensionRE = /\.\w+$/; +const jsxExtensionsRE = /\.(?:j|t)sx\b/; +const defaultEsbuildSupported = { + "dynamic-import": true, + "import-meta": true +}; +async function transformWithEsbuild(code, filename, options$1, inMap, config$2, watcher) { + let loader$1 = options$1?.loader; + if (!loader$1) { + const ext = path.extname(validExtensionRE.test(filename) ? filename : cleanUrl(filename)).slice(1); + if (ext === "cjs" || ext === "mjs") loader$1 = "js"; + else if (ext === "cts" || ext === "mts") loader$1 = "ts"; + else loader$1 = ext; + } + let tsconfigRaw = options$1?.tsconfigRaw; + if (typeof tsconfigRaw !== "string") { + const meaningfulFields = [ + "alwaysStrict", + "experimentalDecorators", + "importsNotUsedAsValues", + "jsx", + "jsxFactory", + "jsxFragmentFactory", + "jsxImportSource", + "preserveValueImports", + "target", + "useDefineForClassFields", + "verbatimModuleSyntax" + ]; + const compilerOptionsForFile = {}; + if (loader$1 === "ts" || loader$1 === "tsx") try { + const { tsconfig: loadedTsconfig, tsconfigFile } = await loadTsconfigJsonForFile(filename, config$2); + if (watcher && tsconfigFile && config$2) ensureWatchedFile(watcher, tsconfigFile, config$2.root); + const loadedCompilerOptions = loadedTsconfig.compilerOptions ?? {}; + for (const field of meaningfulFields) if (field in loadedCompilerOptions) compilerOptionsForFile[field] = loadedCompilerOptions[field]; + } catch (e$1) { + if (e$1 instanceof TSConfckParseError) { + if (watcher && e$1.tsconfigFile && config$2) ensureWatchedFile(watcher, e$1.tsconfigFile, config$2.root); + } + throw e$1; + } + const compilerOptions = { + ...compilerOptionsForFile, + ...tsconfigRaw?.compilerOptions + }; + if (compilerOptions.useDefineForClassFields === void 0 && compilerOptions.target === void 0) compilerOptions.useDefineForClassFields = false; + if (options$1) { + if (options$1.jsx) compilerOptions.jsx = void 0; + if (options$1.jsxFactory) compilerOptions.jsxFactory = void 0; + if (options$1.jsxFragment) compilerOptions.jsxFragmentFactory = void 0; + if (options$1.jsxImportSource) compilerOptions.jsxImportSource = void 0; + } + tsconfigRaw = { + ...tsconfigRaw, + compilerOptions + }; + } + const resolvedOptions = { + sourcemap: true, + sourcefile: filename, + ...options$1, + loader: loader$1, + tsconfigRaw + }; + delete resolvedOptions.include; + delete resolvedOptions.exclude; + delete resolvedOptions.jsxInject; + try { + const result = await transform(code, resolvedOptions); + let map$1; + if (inMap && resolvedOptions.sourcemap) { + const nextMap = JSON.parse(result.map); + nextMap.sourcesContent = []; + map$1 = combineSourcemaps(filename, [nextMap, inMap]); + } else map$1 = resolvedOptions.sourcemap && resolvedOptions.sourcemap !== "inline" ? JSON.parse(result.map) : { mappings: "" }; + return { + ...result, + map: map$1 + }; + } catch (e$1) { + debug$17?.(`esbuild error with options used: `, resolvedOptions); + if (e$1.errors) { + e$1.frame = ""; + e$1.errors.forEach((m) => { + if (m.text === "Experimental decorators are not currently enabled" || m.text === "Parameter decorators only work when experimental decorators are enabled") m.text += ". Vite 5 now uses esbuild 0.18 and you need to enable them by adding \"experimentalDecorators\": true in your \"tsconfig.json\" file."; + e$1.frame += `\n` + prettifyMessage(m, code); + }); + e$1.loc = e$1.errors[0].location; + } + throw e$1; + } +} +function esbuildPlugin(config$2) { + const { jsxInject, include, exclude, ...esbuildTransformOptions } = config$2.esbuild; + const filter$1 = createFilter(include || /\.(m?ts|[jt]sx)$/, exclude || /\.js$/); + const transformOptions = { + target: "esnext", + ...esbuildTransformOptions, + minify: false, + minifyIdentifiers: false, + minifySyntax: false, + minifyWhitespace: false, + treeShaking: false, + keepNames: false, + supported: { + ...defaultEsbuildSupported, + ...esbuildTransformOptions.supported + } + }; + let server; + return { + name: "vite:esbuild", + configureServer(_server) { + server = _server; + }, + async transform(code, id) { + if (filter$1(id) || filter$1(cleanUrl(id))) { + const result = await transformWithEsbuild(code, id, transformOptions, void 0, config$2, server?.watcher); + if (result.warnings.length) result.warnings.forEach((m) => { + this.warn(prettifyMessage(m, code)); + }); + if (jsxInject && jsxExtensionsRE.test(id)) result.code = jsxInject + ";" + result.code; + return { + code: result.code, + map: result.map + }; + } + } + }; +} +const rollupToEsbuildFormatMap = { + es: "esm", + cjs: "cjs", + iife: void 0 +}; +const injectEsbuildHelpers = (esbuildCode, format$3) => { + const contentIndex = format$3 === "iife" ? Math.max(esbuildCode.search(IIFE_BEGIN_RE), 0) : format$3 === "umd" ? esbuildCode.indexOf(`(function(`) : 0; + if (contentIndex > 0) { + const esbuildHelpers = esbuildCode.slice(0, contentIndex); + return esbuildCode.slice(contentIndex).replace("\"use strict\";", (m) => m + esbuildHelpers); + } + return esbuildCode; +}; +const buildEsbuildPlugin = () => { + return { + name: "vite:esbuild-transpile", + applyToEnvironment(environment) { + return environment.config.esbuild !== false; + }, + async renderChunk(code, chunk, opts) { + if (opts.__vite_skip_esbuild__) return null; + const config$2 = this.environment.config; + const options$1 = resolveEsbuildTranspileOptions(config$2, opts.format); + if (!options$1) return null; + const res = await transformWithEsbuild(code, chunk.fileName, options$1, void 0, config$2); + if (config$2.build.lib) res.code = injectEsbuildHelpers(res.code, opts.format); + return res; + } + }; +}; +function resolveEsbuildTranspileOptions(config$2, format$3) { + const target = config$2.build.target; + const minify = config$2.build.minify === "esbuild"; + if ((!target || target === "esnext") && !minify) return null; + const isEsLibBuild = config$2.build.lib && format$3 === "es"; + const esbuildOptions = config$2.esbuild || {}; + const options$1 = { + ...esbuildOptions, + loader: "js", + target: target || void 0, + format: rollupToEsbuildFormatMap[format$3], + supported: { + ...defaultEsbuildSupported, + ...esbuildOptions.supported + } + }; + if (!minify) return { + ...options$1, + minify: false, + minifyIdentifiers: false, + minifySyntax: false, + minifyWhitespace: false, + treeShaking: false + }; + if (options$1.minifyIdentifiers != null || options$1.minifySyntax != null || options$1.minifyWhitespace != null) if (isEsLibBuild) return { + ...options$1, + minify: false, + minifyIdentifiers: options$1.minifyIdentifiers ?? true, + minifySyntax: options$1.minifySyntax ?? true, + minifyWhitespace: false, + treeShaking: true + }; + else return { + ...options$1, + minify: false, + minifyIdentifiers: options$1.minifyIdentifiers ?? true, + minifySyntax: options$1.minifySyntax ?? true, + minifyWhitespace: options$1.minifyWhitespace ?? true, + treeShaking: true + }; + if (isEsLibBuild) return { + ...options$1, + minify: false, + minifyIdentifiers: true, + minifySyntax: true, + minifyWhitespace: false, + treeShaking: true + }; + else return { + ...options$1, + minify: true, + treeShaking: true + }; +} +function prettifyMessage(m, code) { + let res = import_picocolors$31.default.yellow(m.text); + if (m.location) res += `\n` + generateCodeFrame(code, m.location); + return res + `\n`; +} +let globalTSConfckCache; +const tsconfckCacheMap = /* @__PURE__ */ new WeakMap(); +function getTSConfckCache(config$2) { + if (!config$2) return globalTSConfckCache ??= new TSConfckCache(); + let cache$1 = tsconfckCacheMap.get(config$2); + if (!cache$1) { + cache$1 = new TSConfckCache(); + tsconfckCacheMap.set(config$2, cache$1); + } + return cache$1; +} +async function loadTsconfigJsonForFile(filename, config$2) { + const { tsconfig, tsconfigFile } = await parse$13(filename, { + cache: getTSConfckCache(config$2), + ignoreNodeModules: true + }); + return { + tsconfigFile, + tsconfig + }; +} +async function reloadOnTsconfigChange(server, changedFile) { + if (changedFile.endsWith(".json")) { + const cache$1 = getTSConfckCache(server.config); + if (changedFile.endsWith("/tsconfig.json") || cache$1.hasParseResult(changedFile)) { + server.config.logger.info(`changed tsconfig file detected: ${changedFile} - Clearing cache and forcing full-reload to ensure TypeScript is compiled with updated config values.`, { + clear: server.config.clearScreen, + timestamp: true + }); + for (const environment of Object.values(server.environments)) environment.moduleGraph.invalidateAll(); + cache$1.clear(); + for (const environment of Object.values(server.environments)) environment.hot.send({ + type: "full-reload", + path: "*" + }); + } + } +} + +//#endregion +//#region ../../node_modules/.pnpm/artichokie@0.4.2/node_modules/artichokie/dist/index.js +const AsyncFunction = async function() {}.constructor; +const codeToDataUrl = (code) => `data:application/javascript,${encodeURIComponent(code + "\n//# sourceURL=[worker-eval(artichokie)]")}`; +const viteSsrDynamicImport = "__vite_ssr_dynamic_import__"; +const stackBlitzImport = "𝐢𝐦𝐩𝐨𝐫𝐭"; +var Worker$1 = class { + /** @internal */ + _isModule; + /** @internal */ + _code; + /** @internal */ + _parentFunctions; + /** @internal */ + _max; + /** @internal */ + _pool; + /** @internal */ + _idlePool; + /** @internal */ + _queue; + constructor(fn, options$1 = {}) { + this._isModule = options$1.type === "module"; + this._code = genWorkerCode(fn, this._isModule, 5 * 1e3, options$1.parentFunctions ?? {}); + this._parentFunctions = options$1.parentFunctions ?? {}; + const defaultMax = Math.max(1, (os.availableParallelism?.() ?? os.cpus().length) - 1); + this._max = options$1.max || defaultMax; + this._pool = []; + this._idlePool = []; + this._queue = []; + } + async run(...args) { + const worker = await this._getAvailableWorker(); + return new Promise((resolve$4, reject) => { + worker.currentResolve = resolve$4; + worker.currentReject = reject; + worker.postMessage({ args }); + }); + } + stop() { + this._pool.forEach((w) => w.unref()); + this._queue.forEach(([, reject]) => reject(/* @__PURE__ */ new Error("Main worker pool stopped before a worker was available."))); + this._pool = []; + this._idlePool = []; + this._queue = []; + } + /** @internal */ + _createWorker(parentFunctionSyncMessagePort, parentFunctionAsyncMessagePort, lockState) { + const options$1 = { + workerData: [ + parentFunctionSyncMessagePort, + parentFunctionAsyncMessagePort, + lockState + ], + transferList: [parentFunctionSyncMessagePort, parentFunctionAsyncMessagePort] + }; + if (this._isModule) return new Worker(new URL(codeToDataUrl(this._code)), options$1); + return new Worker(this._code, { + ...options$1, + eval: true + }); + } + /** @internal */ + async _getAvailableWorker() { + if (this._idlePool.length) return this._idlePool.shift(); + if (this._pool.length < this._max) { + const parentFunctionResponder = createParentFunctionResponder(this._parentFunctions); + const worker = this._createWorker(parentFunctionResponder.workerPorts.sync, parentFunctionResponder.workerPorts.async, parentFunctionResponder.lockState); + worker.on("message", async (args) => { + if ("result" in args) { + worker.currentResolve?.(args.result); + worker.currentResolve = null; + } else { + if (args.error instanceof ReferenceError) args.error.message += ". Maybe you forgot to pass the function to parentFunction?"; + worker.currentReject?.(args.error); + worker.currentReject = null; + } + this._assignDoneWorker(worker); + }); + worker.on("error", (err$2) => { + worker.currentReject?.(err$2); + worker.currentReject = null; + parentFunctionResponder.close(); + }); + worker.on("exit", (code) => { + const i$1 = this._pool.indexOf(worker); + if (i$1 > -1) this._pool.splice(i$1, 1); + if (code !== 0 && worker.currentReject) { + worker.currentReject(/* @__PURE__ */ new Error(`Worker stopped with non-0 exit code ${code}`)); + worker.currentReject = null; + parentFunctionResponder.close(); + } + }); + this._pool.push(worker); + return worker; + } + let resolve$4; + let reject; + const onWorkerAvailablePromise = new Promise((r$1, rj) => { + resolve$4 = r$1; + reject = rj; + }); + this._queue.push([resolve$4, reject]); + return onWorkerAvailablePromise; + } + /** @internal */ + _assignDoneWorker(worker) { + if (this._queue.length) { + const [resolve$4] = this._queue.shift(); + resolve$4(worker); + return; + } + this._idlePool.push(worker); + } +}; +function createParentFunctionResponder(parentFunctions) { + const lockState = new Int32Array(new SharedArrayBuffer(4)); + const unlock = () => { + Atomics.store(lockState, 0, 0); + Atomics.notify(lockState, 0); + }; + const parentFunctionSyncMessageChannel = new MessageChannel(); + const parentFunctionAsyncMessageChannel = new MessageChannel(); + const parentFunctionSyncMessagePort = parentFunctionSyncMessageChannel.port1; + const parentFunctionAsyncMessagePort = parentFunctionAsyncMessageChannel.port1; + const syncResponse = (data) => { + parentFunctionSyncMessagePort.postMessage(data); + unlock(); + }; + parentFunctionSyncMessagePort.on("message", async (args) => { + let syncResult; + try { + syncResult = parentFunctions[args.name](...args.args); + } catch (error$1) { + syncResponse({ + id: args.id, + error: error$1 + }); + return; + } + if (!(typeof syncResult === "object" && syncResult !== null && "then" in syncResult && typeof syncResult.then === "function")) { + syncResponse({ + id: args.id, + result: syncResult + }); + return; + } + syncResponse({ + id: args.id, + isAsync: true + }); + try { + const result = await syncResult; + parentFunctionAsyncMessagePort.postMessage({ + id: args.id, + result + }); + } catch (error$1) { + parentFunctionAsyncMessagePort.postMessage({ + id: args.id, + error: error$1 + }); + } + }); + parentFunctionSyncMessagePort.unref(); + return { + close: () => { + parentFunctionSyncMessagePort.close(); + parentFunctionAsyncMessagePort.close(); + }, + lockState, + workerPorts: { + sync: parentFunctionSyncMessageChannel.port2, + async: parentFunctionAsyncMessageChannel.port2 + } + }; +} +function genWorkerCode(fn, isModule, waitTimeout, parentFunctions) { + const createLock = (performance$2, lockState) => { + return { + lock: () => { + Atomics.store(lockState, 0, 1); + }, + waitUnlock: () => { + let utilizationBefore; + while (true) { + const status$1 = Atomics.wait(lockState, 0, 1, waitTimeout); + if (status$1 === "timed-out") { + if (utilizationBefore === void 0) { + utilizationBefore = performance$2.eventLoopUtilization(); + continue; + } + utilizationBefore = performance$2.eventLoopUtilization(utilizationBefore); + if (utilizationBefore.utilization > .9) continue; + throw new Error(status$1); + } + break; + } + } + }; + }; + const createParentFunctionRequester = (syncPort, asyncPort, receive, lock) => { + let id = 0; + const resolvers = /* @__PURE__ */ new Map(); + const call$1 = (key) => (...args) => { + id++; + lock.lock(); + syncPort.postMessage({ + id, + name: key, + args + }); + lock.waitUnlock(); + const resArgs = receive(syncPort).message; + if (resArgs.isAsync) { + let resolve$4, reject; + const promise = new Promise((res, rej) => { + resolve$4 = res; + reject = rej; + }); + resolvers.set(id, { + resolve: resolve$4, + reject + }); + return promise; + } + if ("error" in resArgs) throw resArgs.error; + else return resArgs.result; + }; + asyncPort.on("message", (args) => { + const id$1 = args.id; + if (resolvers.has(id$1)) { + const { resolve: resolve$4, reject } = resolvers.get(id$1); + resolvers.delete(id$1); + if ("result" in args) resolve$4(args.result); + else reject(args.error); + } + }); + return { call: call$1 }; + }; + const fnString = fn.toString().replaceAll(stackBlitzImport, "import").replaceAll(viteSsrDynamicImport, "import"); + return ` +${isModule ? "import { parentPort, receiveMessageOnPort, workerData } from 'worker_threads'" : "const { parentPort, receiveMessageOnPort, workerData } = require('worker_threads')"} +${isModule ? "import { performance } from 'node:perf_hooks'" : "const { performance } = require('node:perf_hooks')"} +const [parentFunctionSyncMessagePort, parentFunctionAsyncMessagePort, lockState] = workerData +const waitTimeout = ${waitTimeout} +const createLock = ${createLock.toString()} +const parentFunctionRequester = (${createParentFunctionRequester.toString()})( + parentFunctionSyncMessagePort, + parentFunctionAsyncMessagePort, + receiveMessageOnPort, + createLock(performance, lockState) +) + +const doWorkPromise = (async () => { + ${Object.keys(parentFunctions).map((key) => `const ${key} = parentFunctionRequester.call(${JSON.stringify(key)});`).join("\n")} + return await (${fnString})() +})() +let doWork + +parentPort.on('message', async (args) => { + doWork ||= await doWorkPromise + + try { + const res = await doWork(...args.args) + parentPort.postMessage({ result: res }) + } catch (e) { + parentPort.postMessage({ error: e }) + } +}) + `; +} +const importRe = /\bimport\s*\(/g; +const internalImportName = "__artichokie_local_import__"; +var FakeWorker = class { + /** @internal */ + _fn; + constructor(fn, options$1 = {}) { + const declareRequire = options$1.type !== "module"; + const argsAndCode = genFakeWorkerArgsAndCode(fn, declareRequire, options$1.parentFunctions ?? {}); + const localImport = (specifier) => import(specifier); + const args = [ + ...declareRequire ? [createRequire(import.meta.url)] : [], + localImport, + options$1.parentFunctions + ]; + this._fn = new AsyncFunction(...argsAndCode)(...args); + } + async run(...args) { + try { + return await (await this._fn)(...args); + } catch (err$2) { + if (err$2 instanceof ReferenceError) err$2.message += ". Maybe you forgot to pass the function to parentFunction?"; + throw err$2; + } + } + stop() {} +}; +function genFakeWorkerArgsAndCode(fn, declareRequire, parentFunctions) { + const fnString = fn.toString().replace(importRe, `${internalImportName}(`).replaceAll(stackBlitzImport, internalImportName).replaceAll(viteSsrDynamicImport, internalImportName); + return [ + ...declareRequire ? ["require"] : [], + internalImportName, + "parentFunctions", + ` +${Object.keys(parentFunctions).map((key) => `const ${key} = parentFunctions[${JSON.stringify(key)}];`).join("\n")} +return await (${fnString})() + ` + ]; +} +var WorkerWithFallback = class { + /** @internal */ + _disableReal; + /** @internal */ + _realWorker; + /** @internal */ + _fakeWorker; + /** @internal */ + _shouldUseFake; + constructor(fn, options$1) { + this._disableReal = options$1.max !== void 0 && options$1.max <= 0; + this._realWorker = new Worker$1(fn, options$1); + this._fakeWorker = new FakeWorker(fn, options$1); + this._shouldUseFake = options$1.shouldUseFake; + } + async run(...args) { + const useFake = this._disableReal || this._shouldUseFake(...args); + return this[useFake ? "_fakeWorker" : "_realWorker"].run(...args); + } + stop() { + this._realWorker.stop(); + this._fakeWorker.stop(); + } +}; + +//#endregion +//#region ../../node_modules/.pnpm/resolve.exports@2.0.3/node_modules/resolve.exports/dist/index.mjs +function e(e$1, n$2, r$1) { + throw new Error(r$1 ? `No known conditions for "${n$2}" specifier in "${e$1}" package` : `Missing "${n$2}" specifier in "${e$1}" package`); +} +function n(n$2, i$1, o$1, f$1) { + let s, u, l = r(n$2, o$1), c = function(e$1) { + let n$3 = new Set(["default", ...e$1.conditions || []]); + return e$1.unsafe || n$3.add(e$1.require ? "require" : "import"), e$1.unsafe || n$3.add(e$1.browser ? "browser" : "node"), n$3; + }(f$1 || {}), a = i$1[l]; + if (void 0 === a) { + let e$1, n$3, r$1, t$1; + for (t$1 in i$1) n$3 && t$1.length < n$3.length || ("/" === t$1[t$1.length - 1] && l.startsWith(t$1) ? (u = l.substring(t$1.length), n$3 = t$1) : t$1.length > 1 && (r$1 = t$1.indexOf("*", 1), ~r$1 && (e$1 = RegExp("^" + t$1.substring(0, r$1) + "(.*)" + t$1.substring(1 + r$1) + "$").exec(l), e$1 && e$1[1] && (u = e$1[1], n$3 = t$1)))); + a = i$1[n$3]; + } + return a || e(n$2, l), s = t(a, c), s || e(n$2, l, 1), u && function(e$1, n$3) { + let r$1, t$1 = 0, i$2 = e$1.length, o$2 = /[*]/g, f$2 = /[/]$/; + for (; t$1 < i$2; t$1++) e$1[t$1] = o$2.test(r$1 = e$1[t$1]) ? r$1.replace(o$2, n$3) : f$2.test(r$1) ? r$1 + n$3 : r$1; + }(s, u), s; +} +function r(e$1, n$2, r$1) { + if (e$1 === n$2 || "." === n$2) return "."; + let t$1 = e$1 + "/", i$1 = t$1.length, o$1 = n$2.slice(0, i$1) === t$1, f$1 = o$1 ? n$2.slice(i$1) : n$2; + return "#" === f$1[0] ? f$1 : o$1 || !r$1 ? "./" === f$1.slice(0, 2) ? f$1 : "./" + f$1 : f$1; +} +function t(e$1, n$2, r$1) { + if (e$1) { + if ("string" == typeof e$1) return r$1 && r$1.add(e$1), [e$1]; + let i$1, o$1; + if (Array.isArray(e$1)) { + for (o$1 = r$1 || /* @__PURE__ */ new Set(), i$1 = 0; i$1 < e$1.length; i$1++) t(e$1[i$1], n$2, o$1); + if (!r$1 && o$1.size) return [...o$1]; + } else for (i$1 in e$1) if (n$2.has(i$1)) return t(e$1[i$1], n$2, r$1); + } +} +function o(e$1, r$1, t$1) { + let i$1, o$1 = e$1.exports; + if (o$1) { + if ("string" == typeof o$1) o$1 = { ".": o$1 }; + else for (i$1 in o$1) { + "." !== i$1[0] && (o$1 = { ".": o$1 }); + break; + } + return n(e$1.name, o$1, r$1 || ".", t$1); + } +} +function f(e$1, r$1, t$1) { + if (e$1.imports) return n(e$1.name, e$1.imports, r$1, t$1); +} + +//#endregion +//#region ../../node_modules/.pnpm/ufo@1.6.1/node_modules/ufo/dist/index.mjs +const HASH_RE = /#/g; +const AMPERSAND_RE = /&/g; +const SLASH_RE = /\//g; +const EQUAL_RE = /=/g; +const PLUS_RE = /\+/g; +const ENC_CARET_RE = /%5e/gi; +const ENC_BACKTICK_RE = /%60/gi; +const ENC_PIPE_RE = /%7c/gi; +const ENC_SPACE_RE = /%20/gi; +function encode(text) { + return encodeURI("" + text).replace(ENC_PIPE_RE, "|"); +} +function encodeQueryValue(input) { + return encode(typeof input === "string" ? input : JSON.stringify(input)).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CARET_RE, "^").replace(SLASH_RE, "%2F"); +} +function encodeQueryKey(text) { + return encodeQueryValue(text).replace(EQUAL_RE, "%3D"); +} +function encodeQueryItem(key, value$1) { + if (typeof value$1 === "number" || typeof value$1 === "boolean") value$1 = String(value$1); + if (!value$1) return encodeQueryKey(key); + if (Array.isArray(value$1)) return value$1.map((_value) => `${encodeQueryKey(key)}=${encodeQueryValue(_value)}`).join("&"); + return `${encodeQueryKey(key)}=${encodeQueryValue(value$1)}`; +} +function stringifyQuery(query) { + return Object.keys(query).filter((k) => query[k] !== void 0).map((k) => encodeQueryItem(k, query[k])).filter(Boolean).join("&"); +} +const protocolRelative = Symbol.for("ufo:protocolRelative"); + +//#endregion +//#region ../../node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.mjs +const BUILTIN_MODULES = new Set(builtinModules); +function clearImports(imports) { + return (imports || "").replace(/\/\/[^\n]*\n|\/\*.*\*\//g, "").replace(/\s+/g, " "); +} +function getImportNames(cleanedImports) { + const topLevelImports = cleanedImports.replace(/{[^}]*}/, ""); + return { + namespacedImport: topLevelImports.match(/\* as \s*(\S*)/)?.[1], + defaultImport: topLevelImports.split(",").find((index) => !/[*{}]/.test(index))?.trim() || void 0 + }; +} +/** +* @typedef ErrnoExceptionFields +* @property {number | undefined} [errnode] +* @property {string | undefined} [code] +* @property {string | undefined} [path] +* @property {string | undefined} [syscall] +* @property {string | undefined} [url] +* +* @typedef {Error & ErrnoExceptionFields} ErrnoException +*/ +const own$1 = {}.hasOwnProperty; +const classRegExp = /^([A-Z][a-z\d]*)+$/; +const kTypes = new Set([ + "string", + "function", + "number", + "object", + "Function", + "Object", + "boolean", + "bigint", + "symbol" +]); +const codes$1 = {}; +/** +* Create a list string in the form like 'A and B' or 'A, B, ..., and Z'. +* We cannot use Intl.ListFormat because it's not available in +* --without-intl builds. +* +* @param {Array} array +* An array of strings. +* @param {string} [type] +* The list type to be inserted before the last element. +* @returns {string} +*/ +function formatList(array, type = "and") { + return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array[array.length - 1]}`; +} +/** @type {Map} */ +const messages = /* @__PURE__ */ new Map(); +const nodeInternalPrefix = "__node_internal_"; +/** @type {number} */ +let userStackTraceLimit; +codes$1.ERR_INVALID_ARG_TYPE = createError( + "ERR_INVALID_ARG_TYPE", + /** + * @param {string} name + * @param {Array | string} expected + * @param {unknown} actual + */ + (name, expected, actual) => { + assert(typeof name === "string", "'name' must be a string"); + if (!Array.isArray(expected)) expected = [expected]; + let message = "The "; + if (name.endsWith(" argument")) message += `${name} `; + else { + const type = name.includes(".") ? "property" : "argument"; + message += `"${name}" ${type} `; + } + message += "must be "; + /** @type {Array} */ + const types = []; + /** @type {Array} */ + const instances = []; + /** @type {Array} */ + const other = []; + for (const value$1 of expected) { + assert(typeof value$1 === "string", "All expected entries have to be of type string"); + if (kTypes.has(value$1)) types.push(value$1.toLowerCase()); + else if (classRegExp.exec(value$1) === null) { + assert(value$1 !== "object", "The value \"object\" should be written as \"Object\""); + other.push(value$1); + } else instances.push(value$1); + } + if (instances.length > 0) { + const pos = types.indexOf("object"); + if (pos !== -1) { + types.slice(pos, 1); + instances.push("Object"); + } + } + if (types.length > 0) { + message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(types, "or")}`; + if (instances.length > 0 || other.length > 0) message += " or "; + } + if (instances.length > 0) { + message += `an instance of ${formatList(instances, "or")}`; + if (other.length > 0) message += " or "; + } + if (other.length > 0) if (other.length > 1) message += `one of ${formatList(other, "or")}`; + else { + if (other[0].toLowerCase() !== other[0]) message += "an "; + message += `${other[0]}`; + } + message += `. Received ${determineSpecificType(actual)}`; + return message; + }, + TypeError +); +codes$1.ERR_INVALID_MODULE_SPECIFIER = createError( + "ERR_INVALID_MODULE_SPECIFIER", + /** + * @param {string} request + * @param {string} reason + * @param {string} [base] + */ + (request, reason, base = void 0) => { + return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`; + }, + TypeError +); +codes$1.ERR_INVALID_PACKAGE_CONFIG = createError( + "ERR_INVALID_PACKAGE_CONFIG", + /** + * @param {string} path + * @param {string} [base] + * @param {string} [message] + */ + (path$13, base, message) => { + return `Invalid package config ${path$13}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`; + }, + Error +); +codes$1.ERR_INVALID_PACKAGE_TARGET = createError( + "ERR_INVALID_PACKAGE_TARGET", + /** + * @param {string} packagePath + * @param {string} key + * @param {unknown} target + * @param {boolean} [isImport=false] + * @param {string} [base] + */ + (packagePath, key, target, isImport = false, base = void 0) => { + const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./"); + if (key === ".") { + assert(isImport === false); + return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? "; targets must start with \"./\"" : ""}`; + } + return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? "; targets must start with \"./\"" : ""}`; + }, + Error +); +codes$1.ERR_MODULE_NOT_FOUND = createError( + "ERR_MODULE_NOT_FOUND", + /** + * @param {string} path + * @param {string} base + * @param {boolean} [exactUrl] + */ + (path$13, base, exactUrl = false) => { + return `Cannot find ${exactUrl ? "module" : "package"} '${path$13}' imported from ${base}`; + }, + Error +); +codes$1.ERR_NETWORK_IMPORT_DISALLOWED = createError("ERR_NETWORK_IMPORT_DISALLOWED", "import of '%s' by %s is not supported: %s", Error); +codes$1.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError( + "ERR_PACKAGE_IMPORT_NOT_DEFINED", + /** + * @param {string} specifier + * @param {string} packagePath + * @param {string} base + */ + (specifier, packagePath, base) => { + return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ""} imported from ${base}`; + }, + TypeError +); +codes$1.ERR_PACKAGE_PATH_NOT_EXPORTED = createError( + "ERR_PACKAGE_PATH_NOT_EXPORTED", + /** + * @param {string} packagePath + * @param {string} subpath + * @param {string} [base] + */ + (packagePath, subpath, base = void 0) => { + if (subpath === ".") return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`; + return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`; + }, + Error +); +codes$1.ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", "Directory import '%s' is not supported resolving ES modules imported from %s", Error); +codes$1.ERR_UNSUPPORTED_RESOLVE_REQUEST = createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", "Failed to resolve module specifier \"%s\" from \"%s\": Invalid relative URL or base scheme is not hierarchical.", TypeError); +codes$1.ERR_UNKNOWN_FILE_EXTENSION = createError( + "ERR_UNKNOWN_FILE_EXTENSION", + /** + * @param {string} extension + * @param {string} path + */ + (extension$1, path$13) => { + return `Unknown file extension "${extension$1}" for ${path$13}`; + }, + TypeError +); +codes$1.ERR_INVALID_ARG_VALUE = createError( + "ERR_INVALID_ARG_VALUE", + /** + * @param {string} name + * @param {unknown} value + * @param {string} [reason='is invalid'] + */ + (name, value$1, reason = "is invalid") => { + let inspected = inspect(value$1); + if (inspected.length > 128) inspected = `${inspected.slice(0, 128)}...`; + return `The ${name.includes(".") ? "property" : "argument"} '${name}' ${reason}. Received ${inspected}`; + }, + TypeError +); +/** +* Utility function for registering the error codes. Only used here. Exported +* *only* to allow for testing. +* @param {string} sym +* @param {MessageFunction | string} value +* @param {ErrorConstructor} constructor +* @returns {new (...parameters: Array) => Error} +*/ +function createError(sym, value$1, constructor) { + messages.set(sym, value$1); + return makeNodeErrorWithCode(constructor, sym); +} +/** +* @param {ErrorConstructor} Base +* @param {string} key +* @returns {ErrorConstructor} +*/ +function makeNodeErrorWithCode(Base, key) { + return NodeError; + /** + * @param {Array} parameters + */ + function NodeError(...parameters) { + const limit = Error.stackTraceLimit; + if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0; + const error$1 = new Base(); + if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit; + const message = getMessage(key, parameters, error$1); + Object.defineProperties(error$1, { + message: { + value: message, + enumerable: false, + writable: true, + configurable: true + }, + toString: { + value() { + return `${this.name} [${key}]: ${this.message}`; + }, + enumerable: false, + writable: true, + configurable: true + } + }); + captureLargerStackTrace(error$1); + error$1.code = key; + return error$1; + } +} +/** +* @returns {boolean} +*/ +function isErrorStackTraceLimitWritable() { + try { + if (v8.startupSnapshot.isBuildingSnapshot()) return false; + } catch {} + const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit"); + if (desc === void 0) return Object.isExtensible(Error); + return own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0; +} +/** +* This function removes unnecessary frames from Node.js core errors. +* @template {(...parameters: unknown[]) => unknown} T +* @param {T} wrappedFunction +* @returns {T} +*/ +function hideStackFrames(wrappedFunction) { + const hidden = nodeInternalPrefix + wrappedFunction.name; + Object.defineProperty(wrappedFunction, "name", { value: hidden }); + return wrappedFunction; +} +const captureLargerStackTrace = hideStackFrames( + /** + * @param {Error} error + * @returns {Error} + */ + function(error$1) { + const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable(); + if (stackTraceLimitIsWritable) { + userStackTraceLimit = Error.stackTraceLimit; + Error.stackTraceLimit = Number.POSITIVE_INFINITY; + } + Error.captureStackTrace(error$1); + if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit; + return error$1; + } +); +/** +* @param {string} key +* @param {Array} parameters +* @param {Error} self +* @returns {string} +*/ +function getMessage(key, parameters, self$1) { + const message = messages.get(key); + assert(message !== void 0, "expected `message` to be found"); + if (typeof message === "function") { + assert(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`); + return Reflect.apply(message, self$1, parameters); + } + const regex = /%[dfijoOs]/g; + let expectedLength = 0; + while (regex.exec(message) !== null) expectedLength++; + assert(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`); + if (parameters.length === 0) return message; + parameters.unshift(message); + return Reflect.apply(format, null, parameters); +} +/** +* Determine the specific type of a value for type-mismatch errors. +* @param {unknown} value +* @returns {string} +*/ +function determineSpecificType(value$1) { + if (value$1 === null || value$1 === void 0) return String(value$1); + if (typeof value$1 === "function" && value$1.name) return `function ${value$1.name}`; + if (typeof value$1 === "object") { + if (value$1.constructor && value$1.constructor.name) return `an instance of ${value$1.constructor.name}`; + return `${inspect(value$1, { depth: -1 })}`; + } + let inspected = inspect(value$1, { colors: false }); + if (inspected.length > 28) inspected = `${inspected.slice(0, 25)}...`; + return `type ${typeof value$1} (${inspected})`; +} +const ESM_STATIC_IMPORT_RE = /(?<=\s|^|;|\})import\s*(?:[\s"']*(?[\p{L}\p{M}\w\t\n\r $*,/{}@.]+)from\s*)?["']\s*(?(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][\s;]*/gmu; +const TYPE_RE = /^\s*?type\s/; +function parseStaticImport(matched) { + const cleanedImports = clearImports(matched.imports); + const namedImports = {}; + const _matches = cleanedImports.match(/{([^}]*)}/)?.[1]?.split(",") || []; + for (const namedImport of _matches) { + const _match = namedImport.match(/^\s*(\S*) as (\S*)\s*$/); + const source = _match?.[1] || namedImport.trim(); + const importName = _match?.[2] || source; + if (source && !TYPE_RE.test(source)) namedImports[source] = importName; + } + const { namespacedImport, defaultImport } = getImportNames(cleanedImports); + return { + ...matched, + defaultImport, + namespacedImport, + namedImports + }; +} +const ESM_RE = /(?:[\s;]|^)(?:import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m; +const COMMENT_RE = /\/\*.+?\*\/|\/\/.*(?=[nr])/g; +function hasESMSyntax(code, opts = {}) { + if (opts.stripComments) code = code.replace(COMMENT_RE, ""); + return ESM_RE.test(code); +} + +//#endregion +//#region ../../node_modules/.pnpm/@rolldown+pluginutils@1.0.0-beta.52/node_modules/@rolldown/pluginutils/dist/simple-filters.js +/** +* Constructs a RegExp that matches the exact string specified. +* +* This is useful for plugin hook filters. +* +* @param str the string to match. +* @param flags flags for the RegExp. +* +* @example +* ```ts +* import { exactRegex } from '@rolldown/pluginutils'; +* const plugin = { +* name: 'plugin', +* resolveId: { +* filter: { id: exactRegex('foo') }, +* handler(id) {} // will only be called for `foo` +* } +* } +* ``` +*/ +function exactRegex(str, flags) { + return new RegExp(`^${escapeRegex$1(str)}$`, flags); +} +/** +* Constructs a RegExp that matches a value that has the specified prefix. +* +* This is useful for plugin hook filters. +* +* @param str the string to match. +* @param flags flags for the RegExp. +* +* @example +* ```ts +* import { prefixRegex } from '@rolldown/pluginutils'; +* const plugin = { +* name: 'plugin', +* resolveId: { +* filter: { id: prefixRegex('foo') }, +* handler(id) {} // will only be called for IDs starting with `foo` +* } +* } +* ``` +*/ +function prefixRegex(str, flags) { + return new RegExp(`^${escapeRegex$1(str)}`, flags); +} +const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g; +function escapeRegex$1(str) { + return str.replace(escapeRegexRE, "\\$&"); +} + +//#endregion +//#region ../../node_modules/.pnpm/es-module-lexer@1.7.0/node_modules/es-module-lexer/dist/lexer.js +var ImportType; +(function(A$1) { + A$1[A$1.Static = 1] = "Static", A$1[A$1.Dynamic = 2] = "Dynamic", A$1[A$1.ImportMeta = 3] = "ImportMeta", A$1[A$1.StaticSourcePhase = 4] = "StaticSourcePhase", A$1[A$1.DynamicSourcePhase = 5] = "DynamicSourcePhase", A$1[A$1.StaticDeferPhase = 6] = "StaticDeferPhase", A$1[A$1.DynamicDeferPhase = 7] = "DynamicDeferPhase"; +})(ImportType || (ImportType = {})); +const A = 1 === new Uint8Array(new Uint16Array([1]).buffer)[0]; +function parse(E$1, g = "@") { + if (!C) return init.then((() => parse(E$1))); + const I = E$1.length + 1, w = (C.__heap_base.value || C.__heap_base) + 4 * I - C.memory.buffer.byteLength; + w > 0 && C.memory.grow(Math.ceil(w / 65536)); + const K = C.sa(I - 1); + if ((A ? B : Q)(E$1, new Uint16Array(C.memory.buffer, K, I)), !C.parse()) throw Object.assign(/* @__PURE__ */ new Error(`Parse error ${g}:${E$1.slice(0, C.e()).split("\n").length}:${C.e() - E$1.lastIndexOf("\n", C.e() - 1)}`), { idx: C.e() }); + const o$1 = [], D = []; + for (; C.ri();) { + const A$1 = C.is(), Q$1 = C.ie(), B$1 = C.it(), g$1 = C.ai(), I$1 = C.id(), w$1 = C.ss(), K$1 = C.se(); + let D$1; + C.ip() && (D$1 = k(E$1.slice(-1 === I$1 ? A$1 - 1 : A$1, -1 === I$1 ? Q$1 + 1 : Q$1))), o$1.push({ + n: D$1, + t: B$1, + s: A$1, + e: Q$1, + ss: w$1, + se: K$1, + d: I$1, + a: g$1 + }); + } + for (; C.re();) { + const A$1 = C.es(), Q$1 = C.ee(), B$1 = C.els(), g$1 = C.ele(), I$1 = E$1.slice(A$1, Q$1), w$1 = I$1[0], K$1 = B$1 < 0 ? void 0 : E$1.slice(B$1, g$1), o$2 = K$1 ? K$1[0] : ""; + D.push({ + s: A$1, + e: Q$1, + ls: B$1, + le: g$1, + n: "\"" === w$1 || "'" === w$1 ? k(I$1) : I$1, + ln: "\"" === o$2 || "'" === o$2 ? k(K$1) : K$1 + }); + } + function k(A$1) { + try { + return (0, eval)(A$1); + } catch (A$2) {} + } + return [ + o$1, + D, + !!C.f(), + !!C.ms() + ]; +} +function Q(A$1, Q$1) { + const B$1 = A$1.length; + let C$1 = 0; + for (; C$1 < B$1;) { + const B$2 = A$1.charCodeAt(C$1); + Q$1[C$1++] = (255 & B$2) << 8 | B$2 >>> 8; + } +} +function B(A$1, Q$1) { + const B$1 = A$1.length; + let C$1 = 0; + for (; C$1 < B$1;) Q$1[C$1] = A$1.charCodeAt(C$1++); +} +let C; +const E = () => { + return A$1 = "AGFzbQEAAAABKwhgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gA39/fwADMTAAAQECAgICAgICAgICAgICAgICAgIAAwMDBAQAAAUAAAAAAAMDAwAGAAAABwAGAgUEBQFwAQEBBQMBAAEGDwJ/AUHA8gALfwBBwPIACwd6FQZtZW1vcnkCAAJzYQAAAWUAAwJpcwAEAmllAAUCc3MABgJzZQAHAml0AAgCYWkACQJpZAAKAmlwAAsCZXMADAJlZQANA2VscwAOA2VsZQAPAnJpABACcmUAEQFmABICbXMAEwVwYXJzZQAUC19faGVhcF9iYXNlAwEKzkQwaAEBf0EAIAA2AoAKQQAoAtwJIgEgAEEBdGoiAEEAOwEAQQAgAEECaiIANgKECkEAIAA2AogKQQBBADYC4AlBAEEANgLwCUEAQQA2AugJQQBBADYC5AlBAEEANgL4CUEAQQA2AuwJIAEL0wEBA39BACgC8AkhBEEAQQAoAogKIgU2AvAJQQAgBDYC9AlBACAFQSRqNgKICiAEQSBqQeAJIAQbIAU2AgBBACgC1AkhBEEAKALQCSEGIAUgATYCACAFIAA2AgggBSACIAJBAmpBACAGIANGIgAbIAQgA0YiBBs2AgwgBSADNgIUIAVBADYCECAFIAI2AgQgBUEANgIgIAVBA0EBQQIgABsgBBs2AhwgBUEAKALQCSADRiICOgAYAkACQCACDQBBACgC1AkgA0cNAQtBAEEBOgCMCgsLXgEBf0EAKAL4CSIEQRBqQeQJIAQbQQAoAogKIgQ2AgBBACAENgL4CUEAIARBFGo2AogKQQBBAToAjAogBEEANgIQIAQgAzYCDCAEIAI2AgggBCABNgIEIAQgADYCAAsIAEEAKAKQCgsVAEEAKALoCSgCAEEAKALcCWtBAXULHgEBf0EAKALoCSgCBCIAQQAoAtwJa0EBdUF/IAAbCxUAQQAoAugJKAIIQQAoAtwJa0EBdQseAQF/QQAoAugJKAIMIgBBACgC3AlrQQF1QX8gABsLCwBBACgC6AkoAhwLHgEBf0EAKALoCSgCECIAQQAoAtwJa0EBdUF/IAAbCzsBAX8CQEEAKALoCSgCFCIAQQAoAtAJRw0AQX8PCwJAIABBACgC1AlHDQBBfg8LIABBACgC3AlrQQF1CwsAQQAoAugJLQAYCxUAQQAoAuwJKAIAQQAoAtwJa0EBdQsVAEEAKALsCSgCBEEAKALcCWtBAXULHgEBf0EAKALsCSgCCCIAQQAoAtwJa0EBdUF/IAAbCx4BAX9BACgC7AkoAgwiAEEAKALcCWtBAXVBfyAAGwslAQF/QQBBACgC6AkiAEEgakHgCSAAGygCACIANgLoCSAAQQBHCyUBAX9BAEEAKALsCSIAQRBqQeQJIAAbKAIAIgA2AuwJIABBAEcLCABBAC0AlAoLCABBAC0AjAoL3Q0BBX8jAEGA0ABrIgAkAEEAQQE6AJQKQQBBACgC2Ak2ApwKQQBBACgC3AlBfmoiATYCsApBACABQQAoAoAKQQF0aiICNgK0CkEAQQA6AIwKQQBBADsBlgpBAEEAOwGYCkEAQQA6AKAKQQBBADYCkApBAEEAOgD8CUEAIABBgBBqNgKkCkEAIAA2AqgKQQBBADoArAoCQAJAAkACQANAQQAgAUECaiIDNgKwCiABIAJPDQECQCADLwEAIgJBd2pBBUkNAAJAAkACQAJAAkAgAkGbf2oOBQEICAgCAAsgAkEgRg0EIAJBL0YNAyACQTtGDQIMBwtBAC8BmAoNASADEBVFDQEgAUEEakGCCEEKEC8NARAWQQAtAJQKDQFBAEEAKAKwCiIBNgKcCgwHCyADEBVFDQAgAUEEakGMCEEKEC8NABAXC0EAQQAoArAKNgKcCgwBCwJAIAEvAQQiA0EqRg0AIANBL0cNBBAYDAELQQEQGQtBACgCtAohAkEAKAKwCiEBDAALC0EAIQIgAyEBQQAtAPwJDQIMAQtBACABNgKwCkEAQQA6AJQKCwNAQQAgAUECaiIDNgKwCgJAAkACQAJAAkACQAJAIAFBACgCtApPDQAgAy8BACICQXdqQQVJDQYCQAJAAkACQAJAAkACQAJAAkACQCACQWBqDgoQDwYPDw8PBQECAAsCQAJAAkACQCACQaB/ag4KCxISAxIBEhISAgALIAJBhX9qDgMFEQYJC0EALwGYCg0QIAMQFUUNECABQQRqQYIIQQoQLw0QEBYMEAsgAxAVRQ0PIAFBBGpBjAhBChAvDQ8QFwwPCyADEBVFDQ4gASkABELsgISDsI7AOVINDiABLwEMIgNBd2oiAUEXSw0MQQEgAXRBn4CABHFFDQwMDQtBAEEALwGYCiIBQQFqOwGYCkEAKAKkCiABQQN0aiIBQQE2AgAgAUEAKAKcCjYCBAwNC0EALwGYCiIDRQ0JQQAgA0F/aiIDOwGYCkEALwGWCiICRQ0MQQAoAqQKIANB//8DcUEDdGooAgBBBUcNDAJAIAJBAnRBACgCqApqQXxqKAIAIgMoAgQNACADQQAoApwKQQJqNgIEC0EAIAJBf2o7AZYKIAMgAUEEajYCDAwMCwJAQQAoApwKIgEvAQBBKUcNAEEAKALwCSIDRQ0AIAMoAgQgAUcNAEEAQQAoAvQJIgM2AvAJAkAgA0UNACADQQA2AiAMAQtBAEEANgLgCQtBAEEALwGYCiIDQQFqOwGYCkEAKAKkCiADQQN0aiIDQQZBAkEALQCsChs2AgAgAyABNgIEQQBBADoArAoMCwtBAC8BmAoiAUUNB0EAIAFBf2oiATsBmApBACgCpAogAUH//wNxQQN0aigCAEEERg0EDAoLQScQGgwJC0EiEBoMCAsgAkEvRw0HAkACQCABLwEEIgFBKkYNACABQS9HDQEQGAwKC0EBEBkMCQsCQAJAAkACQEEAKAKcCiIBLwEAIgMQG0UNAAJAAkAgA0FVag4EAAkBAwkLIAFBfmovAQBBK0YNAwwICyABQX5qLwEAQS1GDQIMBwsgA0EpRw0BQQAoAqQKQQAvAZgKIgJBA3RqKAIEEBxFDQIMBgsgAUF+ai8BAEFQakH//wNxQQpPDQULQQAvAZgKIQILAkACQCACQf//A3EiAkUNACADQeYARw0AQQAoAqQKIAJBf2pBA3RqIgQoAgBBAUcNACABQX5qLwEAQe8ARw0BIAQoAgRBlghBAxAdRQ0BDAULIANB/QBHDQBBACgCpAogAkEDdGoiAigCBBAeDQQgAigCAEEGRg0ECyABEB8NAyADRQ0DIANBL0ZBAC0AoApBAEdxDQMCQEEAKAL4CSICRQ0AIAEgAigCAEkNACABIAIoAgRNDQQLIAFBfmohAUEAKALcCSECAkADQCABQQJqIgQgAk0NAUEAIAE2ApwKIAEvAQAhAyABQX5qIgQhASADECBFDQALIARBAmohBAsCQCADQf//A3EQIUUNACAEQX5qIQECQANAIAFBAmoiAyACTQ0BQQAgATYCnAogAS8BACEDIAFBfmoiBCEBIAMQIQ0ACyAEQQJqIQMLIAMQIg0EC0EAQQE6AKAKDAcLQQAoAqQKQQAvAZgKIgFBA3QiA2pBACgCnAo2AgRBACABQQFqOwGYCkEAKAKkCiADakEDNgIACxAjDAULQQAtAPwJQQAvAZYKQQAvAZgKcnJFIQIMBwsQJEEAQQA6AKAKDAMLECVBACECDAULIANBoAFHDQELQQBBAToArAoLQQBBACgCsAo2ApwKC0EAKAKwCiEBDAALCyAAQYDQAGokACACCxoAAkBBACgC3AkgAEcNAEEBDwsgAEF+ahAmC/4KAQZ/QQBBACgCsAoiAEEMaiIBNgKwCkEAKAL4CSECQQEQKSEDAkACQAJAAkACQAJAAkACQAJAQQAoArAKIgQgAUcNACADEChFDQELAkACQAJAAkACQAJAAkAgA0EqRg0AIANB+wBHDQFBACAEQQJqNgKwCkEBECkhA0EAKAKwCiEEA0ACQAJAIANB//8DcSIDQSJGDQAgA0EnRg0AIAMQLBpBACgCsAohAwwBCyADEBpBAEEAKAKwCkECaiIDNgKwCgtBARApGgJAIAQgAxAtIgNBLEcNAEEAQQAoArAKQQJqNgKwCkEBECkhAwsgA0H9AEYNA0EAKAKwCiIFIARGDQ8gBSEEIAVBACgCtApNDQAMDwsLQQAgBEECajYCsApBARApGkEAKAKwCiIDIAMQLRoMAgtBAEEAOgCUCgJAAkACQAJAAkACQCADQZ9/ag4MAgsEAQsDCwsLCwsFAAsgA0H2AEYNBAwKC0EAIARBDmoiAzYCsAoCQAJAAkBBARApQZ9/ag4GABICEhIBEgtBACgCsAoiBSkAAkLzgOSD4I3AMVINESAFLwEKECFFDRFBACAFQQpqNgKwCkEAECkaC0EAKAKwCiIFQQJqQbIIQQ4QLw0QIAUvARAiAkF3aiIBQRdLDQ1BASABdEGfgIAEcUUNDQwOC0EAKAKwCiIFKQACQuyAhIOwjsA5Ug0PIAUvAQoiAkF3aiIBQRdNDQYMCgtBACAEQQpqNgKwCkEAECkaQQAoArAKIQQLQQAgBEEQajYCsAoCQEEBECkiBEEqRw0AQQBBACgCsApBAmo2ArAKQQEQKSEEC0EAKAKwCiEDIAQQLBogA0EAKAKwCiIEIAMgBBACQQBBACgCsApBfmo2ArAKDwsCQCAEKQACQuyAhIOwjsA5Ug0AIAQvAQoQIEUNAEEAIARBCmo2ArAKQQEQKSEEQQAoArAKIQMgBBAsGiADQQAoArAKIgQgAyAEEAJBAEEAKAKwCkF+ajYCsAoPC0EAIARBBGoiBDYCsAoLQQAgBEEGajYCsApBAEEAOgCUCkEBECkhBEEAKAKwCiEDIAQQLCEEQQAoArAKIQIgBEHf/wNxIgFB2wBHDQNBACACQQJqNgKwCkEBECkhBUEAKAKwCiEDQQAhBAwEC0EAQQE6AIwKQQBBACgCsApBAmo2ArAKC0EBECkhBEEAKAKwCiEDAkAgBEHmAEcNACADQQJqQawIQQYQLw0AQQAgA0EIajYCsAogAEEBEClBABArIAJBEGpB5AkgAhshAwNAIAMoAgAiA0UNBSADQgA3AgggA0EQaiEDDAALC0EAIANBfmo2ArAKDAMLQQEgAXRBn4CABHFFDQMMBAtBASEECwNAAkACQCAEDgIAAQELIAVB//8DcRAsGkEBIQQMAQsCQAJAQQAoArAKIgQgA0YNACADIAQgAyAEEAJBARApIQQCQCABQdsARw0AIARBIHJB/QBGDQQLQQAoArAKIQMCQCAEQSxHDQBBACADQQJqNgKwCkEBECkhBUEAKAKwCiEDIAVBIHJB+wBHDQILQQAgA0F+ajYCsAoLIAFB2wBHDQJBACACQX5qNgKwCg8LQQAhBAwACwsPCyACQaABRg0AIAJB+wBHDQQLQQAgBUEKajYCsApBARApIgVB+wBGDQMMAgsCQCACQVhqDgMBAwEACyACQaABRw0CC0EAIAVBEGo2ArAKAkBBARApIgVBKkcNAEEAQQAoArAKQQJqNgKwCkEBECkhBQsgBUEoRg0BC0EAKAKwCiEBIAUQLBpBACgCsAoiBSABTQ0AIAQgAyABIAUQAkEAQQAoArAKQX5qNgKwCg8LIAQgA0EAQQAQAkEAIARBDGo2ArAKDwsQJQuFDAEKf0EAQQAoArAKIgBBDGoiATYCsApBARApIQJBACgCsAohAwJAAkACQAJAAkACQAJAAkAgAkEuRw0AQQAgA0ECajYCsAoCQEEBECkiAkHkAEYNAAJAIAJB8wBGDQAgAkHtAEcNB0EAKAKwCiICQQJqQZwIQQYQLw0HAkBBACgCnAoiAxAqDQAgAy8BAEEuRg0ICyAAIAAgAkEIakEAKALUCRABDwtBACgCsAoiAkECakGiCEEKEC8NBgJAQQAoApwKIgMQKg0AIAMvAQBBLkYNBwtBACEEQQAgAkEMajYCsApBASEFQQUhBkEBECkhAkEAIQdBASEIDAILQQAoArAKIgIpAAJC5YCYg9CMgDlSDQUCQEEAKAKcCiIDECoNACADLwEAQS5GDQYLQQAhBEEAIAJBCmo2ArAKQQIhCEEHIQZBASEHQQEQKSECQQEhBQwBCwJAAkACQAJAIAJB8wBHDQAgAyABTQ0AIANBAmpBoghBChAvDQACQCADLwEMIgRBd2oiB0EXSw0AQQEgB3RBn4CABHENAgsgBEGgAUYNAQtBACEHQQchBkEBIQQgAkHkAEYNAQwCC0EAIQRBACADQQxqIgI2ArAKQQEhBUEBECkhCQJAQQAoArAKIgYgAkYNAEHmACECAkAgCUHmAEYNAEEFIQZBACEHQQEhCCAJIQIMBAtBACEHQQEhCCAGQQJqQawIQQYQLw0EIAYvAQgQIEUNBAtBACEHQQAgAzYCsApBByEGQQEhBEEAIQVBACEIIAkhAgwCCyADIABBCmpNDQBBACEIQeQAIQICQCADKQACQuWAmIPQjIA5Ug0AAkACQCADLwEKIgRBd2oiB0EXSw0AQQEgB3RBn4CABHENAQtBACEIIARBoAFHDQELQQAhBUEAIANBCmo2ArAKQSohAkEBIQdBAiEIQQEQKSIJQSpGDQRBACADNgKwCkEBIQRBACEHQQAhCCAJIQIMAgsgAyEGQQAhBwwCC0EAIQVBACEICwJAIAJBKEcNAEEAKAKkCkEALwGYCiICQQN0aiIDQQAoArAKNgIEQQAgAkEBajsBmAogA0EFNgIAQQAoApwKLwEAQS5GDQRBAEEAKAKwCiIDQQJqNgKwCkEBECkhAiAAQQAoArAKQQAgAxABAkACQCAFDQBBACgC8AkhAQwBC0EAKALwCSIBIAY2AhwLQQBBAC8BlgoiA0EBajsBlgpBACgCqAogA0ECdGogATYCAAJAIAJBIkYNACACQSdGDQBBAEEAKAKwCkF+ajYCsAoPCyACEBpBAEEAKAKwCkECaiICNgKwCgJAAkACQEEBEClBV2oOBAECAgACC0EAQQAoArAKQQJqNgKwCkEBECkaQQAoAvAJIgMgAjYCBCADQQE6ABggA0EAKAKwCiICNgIQQQAgAkF+ajYCsAoPC0EAKALwCSIDIAI2AgQgA0EBOgAYQQBBAC8BmApBf2o7AZgKIANBACgCsApBAmo2AgxBAEEALwGWCkF/ajsBlgoPC0EAQQAoArAKQX5qNgKwCg8LAkAgBEEBcyACQfsAR3INAEEAKAKwCiECQQAvAZgKDQUDQAJAAkACQCACQQAoArQKTw0AQQEQKSICQSJGDQEgAkEnRg0BIAJB/QBHDQJBAEEAKAKwCkECajYCsAoLQQEQKSEDQQAoArAKIQICQCADQeYARw0AIAJBAmpBrAhBBhAvDQcLQQAgAkEIajYCsAoCQEEBECkiAkEiRg0AIAJBJ0cNBwsgACACQQAQKw8LIAIQGgtBAEEAKAKwCkECaiICNgKwCgwACwsCQAJAIAJBWWoOBAMBAQMACyACQSJGDQILQQAoArAKIQYLIAYgAUcNAEEAIABBCmo2ArAKDwsgAkEqRyAHcQ0DQQAvAZgKQf//A3ENA0EAKAKwCiECQQAoArQKIQEDQCACIAFPDQECQAJAIAIvAQAiA0EnRg0AIANBIkcNAQsgACADIAgQKw8LQQAgAkECaiICNgKwCgwACwsQJQsPC0EAIAJBfmo2ArAKDwtBAEEAKAKwCkF+ajYCsAoLRwEDf0EAKAKwCkECaiEAQQAoArQKIQECQANAIAAiAkF+aiABTw0BIAJBAmohACACLwEAQXZqDgQBAAABAAsLQQAgAjYCsAoLmAEBA39BAEEAKAKwCiIBQQJqNgKwCiABQQZqIQFBACgCtAohAgNAAkACQAJAIAFBfGogAk8NACABQX5qLwEAIQMCQAJAIAANACADQSpGDQEgA0F2ag4EAgQEAgQLIANBKkcNAwsgAS8BAEEvRw0CQQAgAUF+ajYCsAoMAQsgAUF+aiEBC0EAIAE2ArAKDwsgAUECaiEBDAALC4gBAQR/QQAoArAKIQFBACgCtAohAgJAAkADQCABIgNBAmohASADIAJPDQEgAS8BACIEIABGDQICQCAEQdwARg0AIARBdmoOBAIBAQIBCyADQQRqIQEgAy8BBEENRw0AIANBBmogASADLwEGQQpGGyEBDAALC0EAIAE2ArAKECUPC0EAIAE2ArAKC2wBAX8CQAJAIABBX2oiAUEFSw0AQQEgAXRBMXENAQsgAEFGakH//wNxQQZJDQAgAEEpRyAAQVhqQf//A3FBB0lxDQACQCAAQaV/ag4EAQAAAQALIABB/QBHIABBhX9qQf//A3FBBElxDwtBAQsuAQF/QQEhAQJAIABBpglBBRAdDQAgAEGWCEEDEB0NACAAQbAJQQIQHSEBCyABC0YBA39BACEDAkAgACACQQF0IgJrIgRBAmoiAEEAKALcCSIFSQ0AIAAgASACEC8NAAJAIAAgBUcNAEEBDwsgBBAmIQMLIAMLgwEBAn9BASEBAkACQAJAAkACQAJAIAAvAQAiAkFFag4EBQQEAQALAkAgAkGbf2oOBAMEBAIACyACQSlGDQQgAkH5AEcNAyAAQX5qQbwJQQYQHQ8LIABBfmovAQBBPUYPCyAAQX5qQbQJQQQQHQ8LIABBfmpByAlBAxAdDwtBACEBCyABC7QDAQJ/QQAhAQJAAkACQAJAAkACQAJAAkACQAJAIAAvAQBBnH9qDhQAAQIJCQkJAwkJBAUJCQYJBwkJCAkLAkACQCAAQX5qLwEAQZd/ag4EAAoKAQoLIABBfGpByghBAhAdDwsgAEF8akHOCEEDEB0PCwJAAkACQCAAQX5qLwEAQY1/ag4DAAECCgsCQCAAQXxqLwEAIgJB4QBGDQAgAkHsAEcNCiAAQXpqQeUAECcPCyAAQXpqQeMAECcPCyAAQXxqQdQIQQQQHQ8LIABBfGpB3AhBBhAdDwsgAEF+ai8BAEHvAEcNBiAAQXxqLwEAQeUARw0GAkAgAEF6ai8BACICQfAARg0AIAJB4wBHDQcgAEF4akHoCEEGEB0PCyAAQXhqQfQIQQIQHQ8LIABBfmpB+AhBBBAdDwtBASEBIABBfmoiAEHpABAnDQQgAEGACUEFEB0PCyAAQX5qQeQAECcPCyAAQX5qQYoJQQcQHQ8LIABBfmpBmAlBBBAdDwsCQCAAQX5qLwEAIgJB7wBGDQAgAkHlAEcNASAAQXxqQe4AECcPCyAAQXxqQaAJQQMQHSEBCyABCzQBAX9BASEBAkAgAEF3akH//wNxQQVJDQAgAEGAAXJBoAFGDQAgAEEuRyAAEChxIQELIAELMAEBfwJAAkAgAEF3aiIBQRdLDQBBASABdEGNgIAEcQ0BCyAAQaABRg0AQQAPC0EBC04BAn9BACEBAkACQCAALwEAIgJB5QBGDQAgAkHrAEcNASAAQX5qQfgIQQQQHQ8LIABBfmovAQBB9QBHDQAgAEF8akHcCEEGEB0hAQsgAQveAQEEf0EAKAKwCiEAQQAoArQKIQECQAJAAkADQCAAIgJBAmohACACIAFPDQECQAJAAkAgAC8BACIDQaR/ag4FAgMDAwEACyADQSRHDQIgAi8BBEH7AEcNAkEAIAJBBGoiADYCsApBAEEALwGYCiICQQFqOwGYCkEAKAKkCiACQQN0aiICQQQ2AgAgAiAANgIEDwtBACAANgKwCkEAQQAvAZgKQX9qIgA7AZgKQQAoAqQKIABB//8DcUEDdGooAgBBA0cNAwwECyACQQRqIQAMAAsLQQAgADYCsAoLECULC3ABAn8CQAJAA0BBAEEAKAKwCiIAQQJqIgE2ArAKIABBACgCtApPDQECQAJAAkAgAS8BACIBQaV/ag4CAQIACwJAIAFBdmoOBAQDAwQACyABQS9HDQIMBAsQLhoMAQtBACAAQQRqNgKwCgwACwsQJQsLNQEBf0EAQQE6APwJQQAoArAKIQBBAEEAKAK0CkECajYCsApBACAAQQAoAtwJa0EBdTYCkAoLQwECf0EBIQECQCAALwEAIgJBd2pB//8DcUEFSQ0AIAJBgAFyQaABRg0AQQAhASACEChFDQAgAkEuRyAAECpyDwsgAQs9AQJ/QQAhAgJAQQAoAtwJIgMgAEsNACAALwEAIAFHDQACQCADIABHDQBBAQ8LIABBfmovAQAQICECCyACC2gBAn9BASEBAkACQCAAQV9qIgJBBUsNAEEBIAJ0QTFxDQELIABB+P8DcUEoRg0AIABBRmpB//8DcUEGSQ0AAkAgAEGlf2oiAkEDSw0AIAJBAUcNAQsgAEGFf2pB//8DcUEESSEBCyABC5wBAQN/QQAoArAKIQECQANAAkACQCABLwEAIgJBL0cNAAJAIAEvAQIiAUEqRg0AIAFBL0cNBBAYDAILIAAQGQwBCwJAAkAgAEUNACACQXdqIgFBF0sNAUEBIAF0QZ+AgARxRQ0BDAILIAIQIUUNAwwBCyACQaABRw0CC0EAQQAoArAKIgNBAmoiATYCsAogA0EAKAK0CkkNAAsLIAILMQEBf0EAIQECQCAALwEAQS5HDQAgAEF+ai8BAEEuRw0AIABBfGovAQBBLkYhAQsgAQumBAEBfwJAIAFBIkYNACABQSdGDQAQJQ8LQQAoArAKIQMgARAaIAAgA0ECakEAKAKwCkEAKALQCRABAkAgAkEBSA0AQQAoAvAJQQRBBiACQQFGGzYCHAtBAEEAKAKwCkECajYCsAoCQAJAAkACQEEAECkiAUHhAEYNACABQfcARg0BQQAoArAKIQEMAgtBACgCsAoiAUECakHACEEKEC8NAUEGIQIMAgtBACgCsAoiAS8BAkHpAEcNACABLwEEQfQARw0AQQQhAiABLwEGQegARg0BC0EAIAFBfmo2ArAKDwtBACABIAJBAXRqNgKwCgJAQQEQKUH7AEYNAEEAIAE2ArAKDwtBACgCsAoiACECA0BBACACQQJqNgKwCgJAAkACQEEBECkiAkEiRg0AIAJBJ0cNAUEnEBpBAEEAKAKwCkECajYCsApBARApIQIMAgtBIhAaQQBBACgCsApBAmo2ArAKQQEQKSECDAELIAIQLCECCwJAIAJBOkYNAEEAIAE2ArAKDwtBAEEAKAKwCkECajYCsAoCQEEBECkiAkEiRg0AIAJBJ0YNAEEAIAE2ArAKDwsgAhAaQQBBACgCsApBAmo2ArAKAkACQEEBECkiAkEsRg0AIAJB/QBGDQFBACABNgKwCg8LQQBBACgCsApBAmo2ArAKQQEQKUH9AEYNAEEAKAKwCiECDAELC0EAKALwCSIBIAA2AhAgAUEAKAKwCkECajYCDAttAQJ/AkACQANAAkAgAEH//wNxIgFBd2oiAkEXSw0AQQEgAnRBn4CABHENAgsgAUGgAUYNASAAIQIgARAoDQJBACECQQBBACgCsAoiAEECajYCsAogAC8BAiIADQAMAgsLIAAhAgsgAkH//wNxC6sBAQR/AkACQEEAKAKwCiICLwEAIgNB4QBGDQAgASEEIAAhBQwBC0EAIAJBBGo2ArAKQQEQKSECQQAoArAKIQUCQAJAIAJBIkYNACACQSdGDQAgAhAsGkEAKAKwCiEEDAELIAIQGkEAQQAoArAKQQJqIgQ2ArAKC0EBECkhA0EAKAKwCiECCwJAIAIgBUYNACAFIARBACAAIAAgAUYiAhtBACABIAIbEAILIAMLcgEEf0EAKAKwCiEAQQAoArQKIQECQAJAA0AgAEECaiECIAAgAU8NAQJAAkAgAi8BACIDQaR/ag4CAQQACyACIQAgA0F2ag4EAgEBAgELIABBBGohAAwACwtBACACNgKwChAlQQAPC0EAIAI2ArAKQd0AC0kBA39BACEDAkAgAkUNAAJAA0AgAC0AACIEIAEtAAAiBUcNASABQQFqIQEgAEEBaiEAIAJBf2oiAg0ADAILCyAEIAVrIQMLIAMLC+wBAgBBgAgLzgEAAHgAcABvAHIAdABtAHAAbwByAHQAZgBvAHIAZQB0AGEAbwB1AHIAYwBlAHIAbwBtAHUAbgBjAHQAaQBvAG4AcwBzAGUAcgB0AHYAbwB5AGkAZQBkAGUAbABlAGMAbwBuAHQAaQBuAGkAbgBzAHQAYQBuAHQAeQBiAHIAZQBhAHIAZQB0AHUAcgBkAGUAYgB1AGcAZwBlAGEAdwBhAGkAdABoAHIAdwBoAGkAbABlAGkAZgBjAGEAdABjAGYAaQBuAGEAbABsAGUAbABzAABB0AkLEAEAAAACAAAAAAQAAEA5AAA=", "undefined" != typeof Buffer ? Buffer.from(A$1, "base64") : Uint8Array.from(atob(A$1), ((A$2) => A$2.charCodeAt(0))); + var A$1; +}; +const init = WebAssembly.compile(E()).then(WebAssembly.instantiate).then((({ exports: A$1 }) => { + C = A$1; +})); + +//#endregion +//#region ../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js +var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const path$11 = __require("path"); + const fs$11 = __require("fs"); + const os$4 = __require("os"); + const url$2 = __require("url"); + const fsReadFileAsync = fs$11.promises.readFile; + /** @type {(name: string, sync: boolean) => string[]} */ + function getDefaultSearchPlaces(name, sync$3) { + return [ + "package.json", + `.${name}rc.json`, + `.${name}rc.js`, + `.${name}rc.cjs`, + ...sync$3 ? [] : [`.${name}rc.mjs`], + `.config/${name}rc`, + `.config/${name}rc.json`, + `.config/${name}rc.js`, + `.config/${name}rc.cjs`, + ...sync$3 ? [] : [`.config/${name}rc.mjs`], + `${name}.config.js`, + `${name}.config.cjs`, + ...sync$3 ? [] : [`${name}.config.mjs`] + ]; + } + /** + * @type {(p: string) => string} + * + * see #17 + * On *nix, if cwd is not under homedir, + * the last path will be '', ('/build' -> '') + * but it should be '/' actually. + * And on Windows, this will never happen. ('C:\build' -> 'C:') + */ + function parentDir(p) { + return path$11.dirname(p) || path$11.sep; + } + /** @type {import('./index').LoaderSync} */ + const jsonLoader = (_, content) => JSON.parse(content); + const requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require; + /** @type {import('./index').LoadersSync} */ + const defaultLoadersSync = Object.freeze({ + ".js": requireFunc, + ".json": requireFunc, + ".cjs": requireFunc, + noExt: jsonLoader + }); + module.exports.defaultLoadersSync = defaultLoadersSync; + /** @type {import('./index').Loader} */ + const dynamicImport = async (id) => { + try { + return (await import(url$2.pathToFileURL(id).href)).default; + } catch (e$1) { + try { + return requireFunc(id); + } catch (requireE) { + if (requireE.code === "ERR_REQUIRE_ESM" || requireE instanceof SyntaxError && requireE.toString().includes("Cannot use import statement outside a module")) throw e$1; + throw requireE; + } + } + }; + /** @type {import('./index').Loaders} */ + const defaultLoaders = Object.freeze({ + ".js": dynamicImport, + ".mjs": dynamicImport, + ".cjs": dynamicImport, + ".json": jsonLoader, + noExt: jsonLoader + }); + module.exports.defaultLoaders = defaultLoaders; + /** + * @param {string} name + * @param {import('./index').Options | import('./index').OptionsSync} options + * @param {boolean} sync + * @returns {Required} + */ + function getOptions(name, options$1, sync$3) { + /** @type {Required} */ + const conf = { + stopDir: os$4.homedir(), + searchPlaces: getDefaultSearchPlaces(name, sync$3), + ignoreEmptySearchPlaces: true, + cache: true, + transform: (x) => x, + packageProp: [name], + ...options$1, + loaders: { + ...sync$3 ? defaultLoadersSync : defaultLoaders, + ...options$1.loaders + } + }; + conf.searchPlaces.forEach((place) => { + const key = path$11.extname(place) || "noExt"; + const loader$1 = conf.loaders[key]; + if (!loader$1) throw new Error(`Missing loader for extension "${place}"`); + if (typeof loader$1 !== "function") throw new Error(`Loader for extension "${place}" is not a function: Received ${typeof loader$1}.`); + }); + return conf; + } + /** @type {(props: string | string[], obj: Record) => unknown} */ + function getPackageProp(props, obj) { + if (typeof props === "string" && props in obj) return obj[props]; + return (Array.isArray(props) ? props : props.split(".")).reduce((acc, prop) => acc === void 0 ? acc : acc[prop], obj) || null; + } + /** @param {string} filepath */ + function validateFilePath(filepath) { + if (!filepath) throw new Error("load must pass a non-empty string"); + } + /** @type {(loader: import('./index').Loader, ext: string) => void} */ + function validateLoader(loader$1, ext) { + if (!loader$1) throw new Error(`No loader specified for extension "${ext}"`); + if (typeof loader$1 !== "function") throw new Error("loader is not a function"); + } + /** @type {(enableCache: boolean) => (c: Map, filepath: string, res: T) => T} */ + const makeEmplace = (enableCache) => (c, filepath, res) => { + if (enableCache) c.set(filepath, res); + return res; + }; + /** @type {import('./index').lilconfig} */ + module.exports.lilconfig = function lilconfig(name, options$1) { + const { ignoreEmptySearchPlaces, loaders, packageProp, searchPlaces, stopDir, transform: transform$2, cache: cache$1 } = getOptions(name, options$1 ?? {}, false); + const searchCache = /* @__PURE__ */ new Map(); + const loadCache = /* @__PURE__ */ new Map(); + const emplace = makeEmplace(cache$1); + return { + async search(searchFrom = process.cwd()) { + /** @type {import('./index').LilconfigResult} */ + const result = { + config: null, + filepath: "" + }; + /** @type {Set} */ + const visited = /* @__PURE__ */ new Set(); + let dir = searchFrom; + dirLoop: while (true) { + if (cache$1) { + const r$1 = searchCache.get(dir); + if (r$1 !== void 0) { + for (const p of visited) searchCache.set(p, r$1); + return r$1; + } + visited.add(dir); + } + for (const searchPlace of searchPlaces) { + const filepath = path$11.join(dir, searchPlace); + try { + await fs$11.promises.access(filepath); + } catch { + continue; + } + const content = String(await fsReadFileAsync(filepath)); + const loaderKey = path$11.extname(searchPlace) || "noExt"; + const loader$1 = loaders[loaderKey]; + if (searchPlace === "package.json") { + const maybeConfig = getPackageProp(packageProp, await loader$1(filepath, content)); + if (maybeConfig != null) { + result.config = maybeConfig; + result.filepath = filepath; + break dirLoop; + } + continue; + } + const isEmpty = content.trim() === ""; + if (isEmpty && ignoreEmptySearchPlaces) continue; + if (isEmpty) { + result.isEmpty = true; + result.config = void 0; + } else { + validateLoader(loader$1, loaderKey); + result.config = await loader$1(filepath, content); + } + result.filepath = filepath; + break dirLoop; + } + if (dir === stopDir || dir === parentDir(dir)) break dirLoop; + dir = parentDir(dir); + } + const transformed = result.filepath === "" && result.config === null ? transform$2(null) : transform$2(result); + if (cache$1) for (const p of visited) searchCache.set(p, transformed); + return transformed; + }, + async load(filepath) { + validateFilePath(filepath); + const absPath = path$11.resolve(process.cwd(), filepath); + if (cache$1 && loadCache.has(absPath)) return loadCache.get(absPath); + const { base, ext } = path$11.parse(absPath); + const loaderKey = ext || "noExt"; + const loader$1 = loaders[loaderKey]; + validateLoader(loader$1, loaderKey); + const content = String(await fsReadFileAsync(absPath)); + if (base === "package.json") return emplace(loadCache, absPath, transform$2({ + config: getPackageProp(packageProp, await loader$1(absPath, content)), + filepath: absPath + })); + /** @type {import('./index').LilconfigResult} */ + const result = { + config: null, + filepath: absPath + }; + const isEmpty = content.trim() === ""; + if (isEmpty && ignoreEmptySearchPlaces) return emplace(loadCache, absPath, transform$2({ + config: void 0, + filepath: absPath, + isEmpty: true + })); + result.config = isEmpty ? void 0 : await loader$1(absPath, content); + return emplace(loadCache, absPath, transform$2(isEmpty ? { + ...result, + isEmpty, + config: void 0 + } : result)); + }, + clearLoadCache() { + if (cache$1) loadCache.clear(); + }, + clearSearchCache() { + if (cache$1) searchCache.clear(); + }, + clearCaches() { + if (cache$1) { + loadCache.clear(); + searchCache.clear(); + } + } + }; + }; + /** @type {import('./index').lilconfigSync} */ + module.exports.lilconfigSync = function lilconfigSync(name, options$1) { + const { ignoreEmptySearchPlaces, loaders, packageProp, searchPlaces, stopDir, transform: transform$2, cache: cache$1 } = getOptions(name, options$1 ?? {}, true); + const searchCache = /* @__PURE__ */ new Map(); + const loadCache = /* @__PURE__ */ new Map(); + const emplace = makeEmplace(cache$1); + return { + search(searchFrom = process.cwd()) { + /** @type {import('./index').LilconfigResult} */ + const result = { + config: null, + filepath: "" + }; + /** @type {Set} */ + const visited = /* @__PURE__ */ new Set(); + let dir = searchFrom; + dirLoop: while (true) { + if (cache$1) { + const r$1 = searchCache.get(dir); + if (r$1 !== void 0) { + for (const p of visited) searchCache.set(p, r$1); + return r$1; + } + visited.add(dir); + } + for (const searchPlace of searchPlaces) { + const filepath = path$11.join(dir, searchPlace); + try { + fs$11.accessSync(filepath); + } catch { + continue; + } + const loaderKey = path$11.extname(searchPlace) || "noExt"; + const loader$1 = loaders[loaderKey]; + const content = String(fs$11.readFileSync(filepath)); + if (searchPlace === "package.json") { + const maybeConfig = getPackageProp(packageProp, loader$1(filepath, content)); + if (maybeConfig != null) { + result.config = maybeConfig; + result.filepath = filepath; + break dirLoop; + } + continue; + } + const isEmpty = content.trim() === ""; + if (isEmpty && ignoreEmptySearchPlaces) continue; + if (isEmpty) { + result.isEmpty = true; + result.config = void 0; + } else { + validateLoader(loader$1, loaderKey); + result.config = loader$1(filepath, content); + } + result.filepath = filepath; + break dirLoop; + } + if (dir === stopDir || dir === parentDir(dir)) break dirLoop; + dir = parentDir(dir); + } + const transformed = result.filepath === "" && result.config === null ? transform$2(null) : transform$2(result); + if (cache$1) for (const p of visited) searchCache.set(p, transformed); + return transformed; + }, + load(filepath) { + validateFilePath(filepath); + const absPath = path$11.resolve(process.cwd(), filepath); + if (cache$1 && loadCache.has(absPath)) return loadCache.get(absPath); + const { base, ext } = path$11.parse(absPath); + const loaderKey = ext || "noExt"; + const loader$1 = loaders[loaderKey]; + validateLoader(loader$1, loaderKey); + const content = String(fs$11.readFileSync(absPath)); + if (base === "package.json") return transform$2({ + config: getPackageProp(packageProp, loader$1(absPath, content)), + filepath: absPath + }); + const result = { + config: null, + filepath: absPath + }; + const isEmpty = content.trim() === ""; + if (isEmpty && ignoreEmptySearchPlaces) return emplace(loadCache, absPath, transform$2({ + filepath: absPath, + config: void 0, + isEmpty: true + })); + result.config = isEmpty ? void 0 : loader$1(absPath, content); + return emplace(loadCache, absPath, transform$2(isEmpty ? { + ...result, + isEmpty, + config: void 0 + } : result)); + }, + clearLoadCache() { + if (cache$1) loadCache.clear(); + }, + clearSearchCache() { + if (cache$1) searchCache.clear(); + }, + clearCaches() { + if (cache$1) { + loadCache.clear(); + searchCache.clear(); + } + } + }; + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_yaml@2.8.1/node_modules/postcss-load-config/src/req.js +var require_req = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { createRequire: createRequire$2 } = __require("node:module"); + const { fileURLToPath: fileURLToPath$1, pathToFileURL: pathToFileURL$1 } = __require("node:url"); + const TS_EXT_RE = /\.[mc]?ts$/; + let tsx; + let jiti; + let importError = []; + /** + * @param {string} name + * @param {string} rootFile + * @returns {Promise} + */ + async function req$3(name, rootFile = fileURLToPath$1(import.meta.url)) { + let url$3 = createRequire$2(rootFile).resolve(name); + try { + return (await import(`${pathToFileURL$1(url$3)}?t=${Date.now()}`)).default; + } catch (err$2) { + if (!TS_EXT_RE.test(url$3)) + /* c8 ignore start */ + throw err$2; + } + if (tsx === void 0) try { + tsx = await import("tsx/cjs/api"); + } catch (error$1) { + importError.push(error$1); + } + if (tsx) { + let loaded = tsx.require(name, rootFile); + return loaded && "__esModule" in loaded ? loaded.default : loaded; + } + if (jiti === void 0) try { + jiti = (await import("jiti")).default; + } catch (error$1) { + importError.push(error$1); + } + if (jiti) return jiti(rootFile, { interopDefault: true })(name); + throw new Error(`'tsx' or 'jiti' is required for the TypeScript configuration files. Make sure it is installed\nError: ${importError.map((error$1) => error$1.message).join("\n")}`); + } + module.exports = req$3; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_yaml@2.8.1/node_modules/postcss-load-config/src/options.js +var require_options = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const req$2 = require_req(); + /** + * Load Options + * + * @private + * @method options + * + * @param {Object} config PostCSS Config + * + * @return {Promise} options PostCSS Options + */ + async function options(config$2, file) { + if (config$2.parser && typeof config$2.parser === "string") try { + config$2.parser = await req$2(config$2.parser, file); + } catch (err$2) { + throw new Error(`Loading PostCSS Parser failed: ${err$2.message}\n\n(@${file})`); + } + if (config$2.syntax && typeof config$2.syntax === "string") try { + config$2.syntax = await req$2(config$2.syntax, file); + } catch (err$2) { + throw new Error(`Loading PostCSS Syntax failed: ${err$2.message}\n\n(@${file})`); + } + if (config$2.stringifier && typeof config$2.stringifier === "string") try { + config$2.stringifier = await req$2(config$2.stringifier, file); + } catch (err$2) { + throw new Error(`Loading PostCSS Stringifier failed: ${err$2.message}\n\n(@${file})`); + } + return config$2; + } + module.exports = options; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_yaml@2.8.1/node_modules/postcss-load-config/src/plugins.js +var require_plugins = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const req$1 = require_req(); + /** + * Plugin Loader + * + * @private + * @method load + * + * @param {String} plugin PostCSS Plugin Name + * @param {Object} options PostCSS Plugin Options + * + * @return {Promise} PostCSS Plugin + */ + async function load(plugin, options$1, file) { + try { + if (options$1 === null || options$1 === void 0 || Object.keys(options$1).length === 0) return await req$1(plugin, file); + else return (await req$1(plugin, file))(options$1); + } catch (err$2) { + throw new Error(`Loading PostCSS Plugin failed: ${err$2.message}\n\n(@${file})`); + } + } + /** + * Load Plugins + * + * @private + * @method plugins + * + * @param {Object} config PostCSS Config Plugins + * + * @return {Promise} plugins PostCSS Plugins + */ + async function plugins(config$2, file) { + let list = []; + if (Array.isArray(config$2.plugins)) list = config$2.plugins.filter(Boolean); + else { + list = Object.entries(config$2.plugins).filter(([, options$1]) => { + return options$1 !== false; + }).map(([plugin, options$1]) => { + return load(plugin, options$1, file); + }); + list = await Promise.all(list); + } + if (list.length && list.length > 0) list.forEach((plugin, i$1) => { + if (plugin.default) plugin = plugin.default; + if (plugin.postcss === true) plugin = plugin(); + else if (plugin.postcss) plugin = plugin.postcss; + if (!(typeof plugin === "object" && Array.isArray(plugin.plugins) || typeof plugin === "object" && plugin.postcssPlugin || typeof plugin === "function")) throw new TypeError(`Invalid PostCSS Plugin found at: plugins[${i$1}]\n\n(@${file})`); + }); + return list; + } + module.exports = plugins; +})); + +//#endregion +//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_yaml@2.8.1/node_modules/postcss-load-config/src/index.js +var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const { resolve: resolve$2 } = __require("node:path"); + const config$1 = require_src$1(); + const loadOptions = require_options(); + const loadPlugins = require_plugins(); + const req = require_req(); + const interopRequireDefault = (obj) => obj && obj.__esModule ? obj : { default: obj }; + /** + * Process the result from cosmiconfig + * + * @param {Object} ctx Config Context + * @param {Object} result Cosmiconfig result + * + * @return {Promise} PostCSS Config + */ + async function processResult(ctx, result) { + let file = result.filepath || ""; + let projectConfig = interopRequireDefault(result.config).default || {}; + if (typeof projectConfig === "function") projectConfig = projectConfig(ctx); + else projectConfig = Object.assign({}, projectConfig, ctx); + if (!projectConfig.plugins) projectConfig.plugins = []; + let res = { + file, + options: await loadOptions(projectConfig, file), + plugins: await loadPlugins(projectConfig, file) + }; + delete projectConfig.plugins; + return res; + } + /** + * Builds the Config Context + * + * @param {Object} ctx Config Context + * + * @return {Object} Config Context + */ + function createContext(ctx) { + /** + * @type {Object} + * + * @prop {String} cwd=process.cwd() Config search start location + * @prop {String} env=process.env.NODE_ENV Config Enviroment, will be set to `development` by `postcss-load-config` if `process.env.NODE_ENV` is `undefined` + */ + ctx = Object.assign({ + cwd: process.cwd(), + env: process.env.NODE_ENV + }, ctx); + if (!ctx.env) process.env.NODE_ENV = "development"; + return ctx; + } + async function loader(filepath) { + return req(filepath); + } + let yaml; + async function yamlLoader(_, content) { + if (!yaml) try { + yaml = await import("yaml"); + } catch (e$1) { + /* c8 ignore start */ + throw new Error(`'yaml' is required for the YAML configuration files. Make sure it is installed\nError: ${e$1.message}`); + } + return yaml.parse(content); + } + /** @return {import('lilconfig').Options} */ + const withLoaders = (options$1 = {}) => { + let moduleName = "postcss"; + return { + ...options$1, + loaders: { + ...options$1.loaders, + ".cjs": loader, + ".cts": loader, + ".js": loader, + ".mjs": loader, + ".mts": loader, + ".ts": loader, + ".yaml": yamlLoader, + ".yml": yamlLoader + }, + searchPlaces: [ + ...options$1.searchPlaces || [], + "package.json", + `.${moduleName}rc`, + `.${moduleName}rc.json`, + `.${moduleName}rc.yaml`, + `.${moduleName}rc.yml`, + `.${moduleName}rc.ts`, + `.${moduleName}rc.cts`, + `.${moduleName}rc.mts`, + `.${moduleName}rc.js`, + `.${moduleName}rc.cjs`, + `.${moduleName}rc.mjs`, + `${moduleName}.config.ts`, + `${moduleName}.config.cts`, + `${moduleName}.config.mts`, + `${moduleName}.config.js`, + `${moduleName}.config.cjs`, + `${moduleName}.config.mjs` + ] + }; + }; + /** + * Load Config + * + * @method rc + * + * @param {Object} ctx Config Context + * @param {String} path Config Path + * @param {Object} options Config Options + * + * @return {Promise} config PostCSS Config + */ + function rc(ctx, path$13, options$1) { + /** + * @type {Object} The full Config Context + */ + ctx = createContext(ctx); + /** + * @type {String} `process.cwd()` + */ + path$13 = path$13 ? resolve$2(path$13) : process.cwd(); + return config$1.lilconfig("postcss", withLoaders(options$1)).search(path$13).then((result) => { + if (!result) throw new Error(`No PostCSS Config found in: ${path$13}`); + return processResult(ctx, result); + }); + } + /** + * Autoload Config for PostCSS + * + * @author Michael Ciniawsky @michael-ciniawsky + * @license MIT + * + * @module postcss-load-config + * @version 2.1.0 + * + * @requires comsiconfig + * @requires ./options + * @requires ./plugins + */ + module.exports = rc; +})); + +//#endregion +//#region ../../node_modules/.pnpm/convert-source-map@2.0.0/node_modules/convert-source-map/index.js +var require_convert_source_map = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "commentRegex", { get: function getCommentRegex() { + return /^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/gm; + } }); + Object.defineProperty(exports, "mapFileCommentRegex", { get: function getMapFileCommentRegex() { + return /(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/gm; + } }); + var decodeBase64; + if (typeof Buffer !== "undefined") if (typeof Buffer.from === "function") decodeBase64 = decodeBase64WithBufferFrom; + else decodeBase64 = decodeBase64WithNewBuffer; + else decodeBase64 = decodeBase64WithAtob; + function decodeBase64WithBufferFrom(base64) { + return Buffer.from(base64, "base64").toString(); + } + function decodeBase64WithNewBuffer(base64) { + if (typeof value === "number") throw new TypeError("The value to decode must not be of type number."); + return new Buffer(base64, "base64").toString(); + } + function decodeBase64WithAtob(base64) { + return decodeURIComponent(escape(atob(base64))); + } + function stripComment(sm) { + return sm.split(",").pop(); + } + function readFromFileMap(sm, read) { + var r$1 = exports.mapFileCommentRegex.exec(sm); + var filename = r$1[1] || r$1[2]; + try { + var sm = read(filename); + if (sm != null && typeof sm.catch === "function") return sm.catch(throwError); + else return sm; + } catch (e$1) { + throwError(e$1); + } + function throwError(e$1) { + throw new Error("An error occurred while trying to read the map file at " + filename + "\n" + e$1.stack); + } + } + function Converter(sm, opts) { + opts = opts || {}; + if (opts.hasComment) sm = stripComment(sm); + if (opts.encoding === "base64") sm = decodeBase64(sm); + else if (opts.encoding === "uri") sm = decodeURIComponent(sm); + if (opts.isJSON || opts.encoding) sm = JSON.parse(sm); + this.sourcemap = sm; + } + Converter.prototype.toJSON = function(space) { + return JSON.stringify(this.sourcemap, null, space); + }; + if (typeof Buffer !== "undefined") if (typeof Buffer.from === "function") Converter.prototype.toBase64 = encodeBase64WithBufferFrom; + else Converter.prototype.toBase64 = encodeBase64WithNewBuffer; + else Converter.prototype.toBase64 = encodeBase64WithBtoa; + function encodeBase64WithBufferFrom() { + var json = this.toJSON(); + return Buffer.from(json, "utf8").toString("base64"); + } + function encodeBase64WithNewBuffer() { + var json = this.toJSON(); + if (typeof json === "number") throw new TypeError("The json to encode must not be of type number."); + return new Buffer(json, "utf8").toString("base64"); + } + function encodeBase64WithBtoa() { + var json = this.toJSON(); + return btoa(unescape(encodeURIComponent(json))); + } + Converter.prototype.toURI = function() { + var json = this.toJSON(); + return encodeURIComponent(json); + }; + Converter.prototype.toComment = function(options$1) { + var encoding, content, data; + if (options$1 != null && options$1.encoding === "uri") { + encoding = ""; + content = this.toURI(); + } else { + encoding = ";base64"; + content = this.toBase64(); + } + data = "sourceMappingURL=data:application/json;charset=utf-8" + encoding + "," + content; + return options$1 != null && options$1.multiline ? "/*# " + data + " */" : "//# " + data; + }; + Converter.prototype.toObject = function() { + return JSON.parse(this.toJSON()); + }; + Converter.prototype.addProperty = function(key, value$1) { + if (this.sourcemap.hasOwnProperty(key)) throw new Error("property \"" + key + "\" already exists on the sourcemap, use set property instead"); + return this.setProperty(key, value$1); + }; + Converter.prototype.setProperty = function(key, value$1) { + this.sourcemap[key] = value$1; + return this; + }; + Converter.prototype.getProperty = function(key) { + return this.sourcemap[key]; + }; + exports.fromObject = function(obj) { + return new Converter(obj); + }; + exports.fromJSON = function(json) { + return new Converter(json, { isJSON: true }); + }; + exports.fromURI = function(uri) { + return new Converter(uri, { encoding: "uri" }); + }; + exports.fromBase64 = function(base64) { + return new Converter(base64, { encoding: "base64" }); + }; + exports.fromComment = function(comment) { + var m, encoding; + comment = comment.replace(/^\/\*/g, "//").replace(/\*\/$/g, ""); + m = exports.commentRegex.exec(comment); + encoding = m && m[4] || "uri"; + return new Converter(comment, { + encoding, + hasComment: true + }); + }; + function makeConverter(sm) { + return new Converter(sm, { isJSON: true }); + } + exports.fromMapFileComment = function(comment, read) { + if (typeof read === "string") throw new Error("String directory paths are no longer supported with `fromMapFileComment`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading"); + var sm = readFromFileMap(comment, read); + if (sm != null && typeof sm.then === "function") return sm.then(makeConverter); + else return makeConverter(sm); + }; + exports.fromSource = function(content) { + var m = content.match(exports.commentRegex); + return m ? exports.fromComment(m.pop()) : null; + }; + exports.fromMapFileSource = function(content, read) { + if (typeof read === "string") throw new Error("String directory paths are no longer supported with `fromMapFileSource`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading"); + var m = content.match(exports.mapFileCommentRegex); + return m ? exports.fromMapFileComment(m.pop(), read) : null; + }; + exports.removeComments = function(src) { + return src.replace(exports.commentRegex, ""); + }; + exports.removeMapFileComments = function(src) { + return src.replace(exports.mapFileCommentRegex, ""); + }; + exports.generateMapFileComment = function(file, options$1) { + var data = "sourceMappingURL=" + file; + return options$1 && options$1.multiline ? "/*# " + data + " */" : "//# " + data; + }; +})); + +//#endregion +//#region src/node/server/sourcemap.ts +var import_convert_source_map$2 = /* @__PURE__ */ __toESM(require_convert_source_map(), 1); +const debug$16 = createDebugger("vite:sourcemap", { onlyWhenFocused: true }); +const virtualSourceRE = /^(?:dep:|browser-external:|virtual:)|\0/; +async function computeSourceRoute(map$1, file) { + let sourceRoot; + try { + sourceRoot = await fsp.realpath(path.resolve(path.dirname(file), map$1.sourceRoot || "")); + } catch {} + return sourceRoot; +} +async function injectSourcesContent(map$1, file, logger) { + let sourceRootPromise; + const missingSources = []; + const sourcesContent = map$1.sourcesContent || []; + const sourcesContentPromises = []; + for (let index = 0; index < map$1.sources.length; index++) { + const sourcePath = map$1.sources[index]; + if (sourcesContent[index] == null && sourcePath && !virtualSourceRE.test(sourcePath)) sourcesContentPromises.push((async () => { + sourceRootPromise ??= computeSourceRoute(map$1, file); + const sourceRoot = await sourceRootPromise; + let resolvedSourcePath = cleanUrl(decodeURI(sourcePath)); + if (sourceRoot) resolvedSourcePath = path.resolve(sourceRoot, resolvedSourcePath); + sourcesContent[index] = await fsp.readFile(resolvedSourcePath, "utf-8").catch(() => { + missingSources.push(resolvedSourcePath); + return null; + }); + })()); + } + await Promise.all(sourcesContentPromises); + map$1.sourcesContent = sourcesContent; + if (missingSources.length) { + logger.warnOnce(`Sourcemap for "${file}" points to missing source files`); + debug$16?.(`Missing sources:\n ` + missingSources.join(`\n `)); + } +} +function genSourceMapUrl(map$1) { + if (typeof map$1 !== "string") map$1 = JSON.stringify(map$1); + return `data:application/json;base64,${Buffer.from(map$1).toString("base64")}`; +} +function getCodeWithSourcemap(type, code, map$1) { + if (debug$16) code += `\n/*${JSON.stringify(map$1, null, 2).replace(/\*\//g, "*\\/")}*/\n`; + if (type === "js") code += `\n//# sourceMappingURL=${genSourceMapUrl(map$1)}`; + else if (type === "css") code += `\n/*# sourceMappingURL=${genSourceMapUrl(map$1)} */`; + return code; +} +function applySourcemapIgnoreList(map$1, sourcemapPath, sourcemapIgnoreList, logger) { + let { x_google_ignoreList } = map$1; + if (x_google_ignoreList === void 0) x_google_ignoreList = []; + for (let sourcesIndex = 0; sourcesIndex < map$1.sources.length; ++sourcesIndex) { + const sourcePath = map$1.sources[sourcesIndex]; + if (!sourcePath) continue; + const ignoreList = sourcemapIgnoreList(path.isAbsolute(sourcePath) ? sourcePath : path.resolve(path.dirname(sourcemapPath), sourcePath), sourcemapPath); + if (logger && typeof ignoreList !== "boolean") logger.warn("sourcemapIgnoreList function must return a boolean."); + if (ignoreList && !x_google_ignoreList.includes(sourcesIndex)) x_google_ignoreList.push(sourcesIndex); + } + if (x_google_ignoreList.length > 0) { + if (!map$1.x_google_ignoreList) map$1.x_google_ignoreList = x_google_ignoreList; + } +} +async function extractSourcemapFromFile(code, filePath) { + const map$1 = (import_convert_source_map$2.fromSource(code) || await import_convert_source_map$2.fromMapFileSource(code, createConvertSourceMapReadMap(filePath)))?.toObject(); + if (map$1) return { + code: code.replace(import_convert_source_map$2.default.mapFileCommentRegex, blankReplacer), + map: map$1 + }; +} +function createConvertSourceMapReadMap(originalFileName) { + return (filename) => { + return fsp.readFile(path.resolve(path.dirname(originalFileName), filename), "utf-8"); + }; +} + +//#endregion +//#region src/node/publicDir.ts +const publicFilesMap = /* @__PURE__ */ new WeakMap(); +async function initPublicFiles(config$2) { + let fileNames; + try { + fileNames = await recursiveReaddir(config$2.publicDir); + } catch (e$1) { + if (e$1.code === ERR_SYMLINK_IN_RECURSIVE_READDIR) return; + throw e$1; + } + const publicFiles = new Set(fileNames.map((fileName) => fileName.slice(config$2.publicDir.length))); + publicFilesMap.set(config$2, publicFiles); + return publicFiles; +} +function getPublicFiles(config$2) { + return publicFilesMap.get(config$2); +} +function checkPublicFile(url$3, config$2) { + const { publicDir } = config$2; + if (!publicDir || url$3[0] !== "/") return; + const fileName = cleanUrl(url$3); + const publicFiles = getPublicFiles(config$2); + if (publicFiles) return publicFiles.has(fileName) ? normalizePath(path.join(publicDir, fileName)) : void 0; + const publicFile = normalizePath(path.join(publicDir, fileName)); + if (!publicFile.startsWith(withTrailingSlash(publicDir))) return; + return tryStatSync(publicFile)?.isFile() ? publicFile : void 0; +} + +//#endregion +//#region ../../node_modules/.pnpm/@rollup+plugin-alias@5.1.1_rollup@4.43.0/node_modules/@rollup/plugin-alias/dist/es/index.js +function matches$1(pattern, importee) { + if (pattern instanceof RegExp) return pattern.test(importee); + if (importee.length < pattern.length) return false; + if (importee === pattern) return true; + return importee.startsWith(pattern + "/"); +} +function getEntries({ entries, customResolver }) { + if (!entries) return []; + const resolverFunctionFromOptions = resolveCustomResolver(customResolver); + if (Array.isArray(entries)) return entries.map((entry) => { + return { + find: entry.find, + replacement: entry.replacement, + resolverFunction: resolveCustomResolver(entry.customResolver) || resolverFunctionFromOptions + }; + }); + return Object.entries(entries).map(([key, value$1]) => { + return { + find: key, + replacement: value$1, + resolverFunction: resolverFunctionFromOptions + }; + }); +} +function getHookFunction(hook) { + if (typeof hook === "function") return hook; + if (hook && "handler" in hook && typeof hook.handler === "function") return hook.handler; + return null; +} +function resolveCustomResolver(customResolver) { + if (typeof customResolver === "function") return customResolver; + if (customResolver) return getHookFunction(customResolver.resolveId); + return null; +} +function alias(options$1 = {}) { + const entries = getEntries(options$1); + if (entries.length === 0) return { + name: "alias", + resolveId: () => null + }; + return { + name: "alias", + async buildStart(inputOptions) { + await Promise.all([...Array.isArray(options$1.entries) ? options$1.entries : [], options$1].map(({ customResolver }) => { + var _a; + return customResolver && ((_a = getHookFunction(customResolver.buildStart)) === null || _a === void 0 ? void 0 : _a.call(this, inputOptions)); + })); + }, + resolveId(importee, importer, resolveOptions) { + const matchedEntry = entries.find((entry) => matches$1(entry.find, importee)); + if (!matchedEntry) return null; + const updatedId = importee.replace(matchedEntry.find, matchedEntry.replacement); + if (matchedEntry.resolverFunction) return matchedEntry.resolverFunction.call(this, updatedId, importer, resolveOptions); + return this.resolve(updatedId, importer, Object.assign({ skipSelf: true }, resolveOptions)).then((resolved) => { + if (resolved) return resolved; + if (!path$1.isAbsolute(updatedId)) this.warn(`rewrote ${importee} to ${updatedId} but was not an abolute path and was not handled by other plugins. This will lead to duplicated modules for the same path. To avoid duplicating modules, you should resolve to an absolute path.`); + return { id: updatedId }; + }); + } + }; +} + +//#endregion +//#region ../../node_modules/.pnpm/mrmime@2.0.1/node_modules/mrmime/index.mjs +const mimes = { + "3g2": "video/3gpp2", + "3gp": "video/3gpp", + "3gpp": "video/3gpp", + "3mf": "model/3mf", + "aac": "audio/aac", + "ac": "application/pkix-attr-cert", + "adp": "audio/adpcm", + "adts": "audio/aac", + "ai": "application/postscript", + "aml": "application/automationml-aml+xml", + "amlx": "application/automationml-amlx+zip", + "amr": "audio/amr", + "apng": "image/apng", + "appcache": "text/cache-manifest", + "appinstaller": "application/appinstaller", + "appx": "application/appx", + "appxbundle": "application/appxbundle", + "asc": "application/pgp-keys", + "atom": "application/atom+xml", + "atomcat": "application/atomcat+xml", + "atomdeleted": "application/atomdeleted+xml", + "atomsvc": "application/atomsvc+xml", + "au": "audio/basic", + "avci": "image/avci", + "avcs": "image/avcs", + "avif": "image/avif", + "aw": "application/applixware", + "bdoc": "application/bdoc", + "bin": "application/octet-stream", + "bmp": "image/bmp", + "bpk": "application/octet-stream", + "btf": "image/prs.btif", + "btif": "image/prs.btif", + "buffer": "application/octet-stream", + "ccxml": "application/ccxml+xml", + "cdfx": "application/cdfx+xml", + "cdmia": "application/cdmi-capability", + "cdmic": "application/cdmi-container", + "cdmid": "application/cdmi-domain", + "cdmio": "application/cdmi-object", + "cdmiq": "application/cdmi-queue", + "cer": "application/pkix-cert", + "cgm": "image/cgm", + "cjs": "application/node", + "class": "application/java-vm", + "coffee": "text/coffeescript", + "conf": "text/plain", + "cpl": "application/cpl+xml", + "cpt": "application/mac-compactpro", + "crl": "application/pkix-crl", + "css": "text/css", + "csv": "text/csv", + "cu": "application/cu-seeme", + "cwl": "application/cwl", + "cww": "application/prs.cww", + "davmount": "application/davmount+xml", + "dbk": "application/docbook+xml", + "deb": "application/octet-stream", + "def": "text/plain", + "deploy": "application/octet-stream", + "dib": "image/bmp", + "disposition-notification": "message/disposition-notification", + "dist": "application/octet-stream", + "distz": "application/octet-stream", + "dll": "application/octet-stream", + "dmg": "application/octet-stream", + "dms": "application/octet-stream", + "doc": "application/msword", + "dot": "application/msword", + "dpx": "image/dpx", + "drle": "image/dicom-rle", + "dsc": "text/prs.lines.tag", + "dssc": "application/dssc+der", + "dtd": "application/xml-dtd", + "dump": "application/octet-stream", + "dwd": "application/atsc-dwd+xml", + "ear": "application/java-archive", + "ecma": "application/ecmascript", + "elc": "application/octet-stream", + "emf": "image/emf", + "eml": "message/rfc822", + "emma": "application/emma+xml", + "emotionml": "application/emotionml+xml", + "eps": "application/postscript", + "epub": "application/epub+zip", + "exe": "application/octet-stream", + "exi": "application/exi", + "exp": "application/express", + "exr": "image/aces", + "ez": "application/andrew-inset", + "fdf": "application/fdf", + "fdt": "application/fdt+xml", + "fits": "image/fits", + "g3": "image/g3fax", + "gbr": "application/rpki-ghostbusters", + "geojson": "application/geo+json", + "gif": "image/gif", + "glb": "model/gltf-binary", + "gltf": "model/gltf+json", + "gml": "application/gml+xml", + "gpx": "application/gpx+xml", + "gram": "application/srgs", + "grxml": "application/srgs+xml", + "gxf": "application/gxf", + "gz": "application/gzip", + "h261": "video/h261", + "h263": "video/h263", + "h264": "video/h264", + "heic": "image/heic", + "heics": "image/heic-sequence", + "heif": "image/heif", + "heifs": "image/heif-sequence", + "hej2": "image/hej2k", + "held": "application/atsc-held+xml", + "hjson": "application/hjson", + "hlp": "application/winhlp", + "hqx": "application/mac-binhex40", + "hsj2": "image/hsj2", + "htm": "text/html", + "html": "text/html", + "ics": "text/calendar", + "ief": "image/ief", + "ifb": "text/calendar", + "iges": "model/iges", + "igs": "model/iges", + "img": "application/octet-stream", + "in": "text/plain", + "ini": "text/plain", + "ink": "application/inkml+xml", + "inkml": "application/inkml+xml", + "ipfix": "application/ipfix", + "iso": "application/octet-stream", + "its": "application/its+xml", + "jade": "text/jade", + "jar": "application/java-archive", + "jhc": "image/jphc", + "jls": "image/jls", + "jp2": "image/jp2", + "jpe": "image/jpeg", + "jpeg": "image/jpeg", + "jpf": "image/jpx", + "jpg": "image/jpeg", + "jpg2": "image/jp2", + "jpgm": "image/jpm", + "jpgv": "video/jpeg", + "jph": "image/jph", + "jpm": "image/jpm", + "jpx": "image/jpx", + "js": "text/javascript", + "json": "application/json", + "json5": "application/json5", + "jsonld": "application/ld+json", + "jsonml": "application/jsonml+json", + "jsx": "text/jsx", + "jt": "model/jt", + "jxl": "image/jxl", + "jxr": "image/jxr", + "jxra": "image/jxra", + "jxrs": "image/jxrs", + "jxs": "image/jxs", + "jxsc": "image/jxsc", + "jxsi": "image/jxsi", + "jxss": "image/jxss", + "kar": "audio/midi", + "ktx": "image/ktx", + "ktx2": "image/ktx2", + "less": "text/less", + "lgr": "application/lgr+xml", + "list": "text/plain", + "litcoffee": "text/coffeescript", + "log": "text/plain", + "lostxml": "application/lost+xml", + "lrf": "application/octet-stream", + "m1v": "video/mpeg", + "m21": "application/mp21", + "m2a": "audio/mpeg", + "m2t": "video/mp2t", + "m2ts": "video/mp2t", + "m2v": "video/mpeg", + "m3a": "audio/mpeg", + "m4a": "audio/mp4", + "m4p": "application/mp4", + "m4s": "video/iso.segment", + "ma": "application/mathematica", + "mads": "application/mads+xml", + "maei": "application/mmt-aei+xml", + "man": "text/troff", + "manifest": "text/cache-manifest", + "map": "application/json", + "mar": "application/octet-stream", + "markdown": "text/markdown", + "mathml": "application/mathml+xml", + "mb": "application/mathematica", + "mbox": "application/mbox", + "md": "text/markdown", + "mdx": "text/mdx", + "me": "text/troff", + "mesh": "model/mesh", + "meta4": "application/metalink4+xml", + "metalink": "application/metalink+xml", + "mets": "application/mets+xml", + "mft": "application/rpki-manifest", + "mid": "audio/midi", + "midi": "audio/midi", + "mime": "message/rfc822", + "mj2": "video/mj2", + "mjp2": "video/mj2", + "mjs": "text/javascript", + "mml": "text/mathml", + "mods": "application/mods+xml", + "mov": "video/quicktime", + "mp2": "audio/mpeg", + "mp21": "application/mp21", + "mp2a": "audio/mpeg", + "mp3": "audio/mpeg", + "mp4": "video/mp4", + "mp4a": "audio/mp4", + "mp4s": "application/mp4", + "mp4v": "video/mp4", + "mpd": "application/dash+xml", + "mpe": "video/mpeg", + "mpeg": "video/mpeg", + "mpf": "application/media-policy-dataset+xml", + "mpg": "video/mpeg", + "mpg4": "video/mp4", + "mpga": "audio/mpeg", + "mpp": "application/dash-patch+xml", + "mrc": "application/marc", + "mrcx": "application/marcxml+xml", + "ms": "text/troff", + "mscml": "application/mediaservercontrol+xml", + "msh": "model/mesh", + "msi": "application/octet-stream", + "msix": "application/msix", + "msixbundle": "application/msixbundle", + "msm": "application/octet-stream", + "msp": "application/octet-stream", + "mtl": "model/mtl", + "mts": "video/mp2t", + "musd": "application/mmt-usd+xml", + "mxf": "application/mxf", + "mxmf": "audio/mobile-xmf", + "mxml": "application/xv+xml", + "n3": "text/n3", + "nb": "application/mathematica", + "nq": "application/n-quads", + "nt": "application/n-triples", + "obj": "model/obj", + "oda": "application/oda", + "oga": "audio/ogg", + "ogg": "audio/ogg", + "ogv": "video/ogg", + "ogx": "application/ogg", + "omdoc": "application/omdoc+xml", + "onepkg": "application/onenote", + "onetmp": "application/onenote", + "onetoc": "application/onenote", + "onetoc2": "application/onenote", + "opf": "application/oebps-package+xml", + "opus": "audio/ogg", + "otf": "font/otf", + "owl": "application/rdf+xml", + "oxps": "application/oxps", + "p10": "application/pkcs10", + "p7c": "application/pkcs7-mime", + "p7m": "application/pkcs7-mime", + "p7s": "application/pkcs7-signature", + "p8": "application/pkcs8", + "pdf": "application/pdf", + "pfr": "application/font-tdpfr", + "pgp": "application/pgp-encrypted", + "pkg": "application/octet-stream", + "pki": "application/pkixcmp", + "pkipath": "application/pkix-pkipath", + "pls": "application/pls+xml", + "png": "image/png", + "prc": "model/prc", + "prf": "application/pics-rules", + "provx": "application/provenance+xml", + "ps": "application/postscript", + "pskcxml": "application/pskc+xml", + "pti": "image/prs.pti", + "qt": "video/quicktime", + "raml": "application/raml+yaml", + "rapd": "application/route-apd+xml", + "rdf": "application/rdf+xml", + "relo": "application/p2p-overlay+xml", + "rif": "application/reginfo+xml", + "rl": "application/resource-lists+xml", + "rld": "application/resource-lists-diff+xml", + "rmi": "audio/midi", + "rnc": "application/relax-ng-compact-syntax", + "rng": "application/xml", + "roa": "application/rpki-roa", + "roff": "text/troff", + "rq": "application/sparql-query", + "rs": "application/rls-services+xml", + "rsat": "application/atsc-rsat+xml", + "rsd": "application/rsd+xml", + "rsheet": "application/urc-ressheet+xml", + "rss": "application/rss+xml", + "rtf": "text/rtf", + "rtx": "text/richtext", + "rusd": "application/route-usd+xml", + "s3m": "audio/s3m", + "sbml": "application/sbml+xml", + "scq": "application/scvp-cv-request", + "scs": "application/scvp-cv-response", + "sdp": "application/sdp", + "senmlx": "application/senml+xml", + "sensmlx": "application/sensml+xml", + "ser": "application/java-serialized-object", + "setpay": "application/set-payment-initiation", + "setreg": "application/set-registration-initiation", + "sgi": "image/sgi", + "sgm": "text/sgml", + "sgml": "text/sgml", + "shex": "text/shex", + "shf": "application/shf+xml", + "shtml": "text/html", + "sieve": "application/sieve", + "sig": "application/pgp-signature", + "sil": "audio/silk", + "silo": "model/mesh", + "siv": "application/sieve", + "slim": "text/slim", + "slm": "text/slim", + "sls": "application/route-s-tsid+xml", + "smi": "application/smil+xml", + "smil": "application/smil+xml", + "snd": "audio/basic", + "so": "application/octet-stream", + "spdx": "text/spdx", + "spp": "application/scvp-vp-response", + "spq": "application/scvp-vp-request", + "spx": "audio/ogg", + "sql": "application/sql", + "sru": "application/sru+xml", + "srx": "application/sparql-results+xml", + "ssdl": "application/ssdl+xml", + "ssml": "application/ssml+xml", + "stk": "application/hyperstudio", + "stl": "model/stl", + "stpx": "model/step+xml", + "stpxz": "model/step-xml+zip", + "stpz": "model/step+zip", + "styl": "text/stylus", + "stylus": "text/stylus", + "svg": "image/svg+xml", + "svgz": "image/svg+xml", + "swidtag": "application/swid+xml", + "t": "text/troff", + "t38": "image/t38", + "td": "application/urc-targetdesc+xml", + "tei": "application/tei+xml", + "teicorpus": "application/tei+xml", + "text": "text/plain", + "tfi": "application/thraud+xml", + "tfx": "image/tiff-fx", + "tif": "image/tiff", + "tiff": "image/tiff", + "toml": "application/toml", + "tr": "text/troff", + "trig": "application/trig", + "ts": "video/mp2t", + "tsd": "application/timestamped-data", + "tsv": "text/tab-separated-values", + "ttc": "font/collection", + "ttf": "font/ttf", + "ttl": "text/turtle", + "ttml": "application/ttml+xml", + "txt": "text/plain", + "u3d": "model/u3d", + "u8dsn": "message/global-delivery-status", + "u8hdr": "message/global-headers", + "u8mdn": "message/global-disposition-notification", + "u8msg": "message/global", + "ubj": "application/ubjson", + "uri": "text/uri-list", + "uris": "text/uri-list", + "urls": "text/uri-list", + "vcard": "text/vcard", + "vrml": "model/vrml", + "vtt": "text/vtt", + "vxml": "application/voicexml+xml", + "war": "application/java-archive", + "wasm": "application/wasm", + "wav": "audio/wav", + "weba": "audio/webm", + "webm": "video/webm", + "webmanifest": "application/manifest+json", + "webp": "image/webp", + "wgsl": "text/wgsl", + "wgt": "application/widget", + "wif": "application/watcherinfo+xml", + "wmf": "image/wmf", + "woff": "font/woff", + "woff2": "font/woff2", + "wrl": "model/vrml", + "wsdl": "application/wsdl+xml", + "wspolicy": "application/wspolicy+xml", + "x3d": "model/x3d+xml", + "x3db": "model/x3d+fastinfoset", + "x3dbz": "model/x3d+binary", + "x3dv": "model/x3d-vrml", + "x3dvz": "model/x3d+vrml", + "x3dz": "model/x3d+xml", + "xaml": "application/xaml+xml", + "xav": "application/xcap-att+xml", + "xca": "application/xcap-caps+xml", + "xcs": "application/calendar+xml", + "xdf": "application/xcap-diff+xml", + "xdssc": "application/dssc+xml", + "xel": "application/xcap-el+xml", + "xenc": "application/xenc+xml", + "xer": "application/patch-ops-error+xml", + "xfdf": "application/xfdf", + "xht": "application/xhtml+xml", + "xhtml": "application/xhtml+xml", + "xhvml": "application/xv+xml", + "xlf": "application/xliff+xml", + "xm": "audio/xm", + "xml": "text/xml", + "xns": "application/xcap-ns+xml", + "xop": "application/xop+xml", + "xpl": "application/xproc+xml", + "xsd": "application/xml", + "xsf": "application/prs.xsf+xml", + "xsl": "application/xml", + "xslt": "application/xml", + "xspf": "application/xspf+xml", + "xvm": "application/xv+xml", + "xvml": "application/xv+xml", + "yaml": "text/yaml", + "yang": "application/yang", + "yin": "application/yin+xml", + "yml": "text/yaml", + "zip": "application/zip" +}; +function lookup(extn) { + let tmp = ("" + extn).trim().toLowerCase(); + let idx = tmp.lastIndexOf("."); + return mimes[!~idx ? tmp : tmp.substring(++idx)]; +} + +//#endregion +//#region src/node/plugins/asset.ts +var import_picocolors$30 = /* @__PURE__ */ __toESM(require_picocolors(), 1); +const assetUrlRE = /__VITE_ASSET__([\w$]+)__(?:\$_(.*?)__)?/g; +const jsSourceMapRE = /\.[cm]?js\.map$/; +const noInlineRE = /[?&]no-inline\b/; +const inlineRE$3 = /[?&]inline\b/; +const assetCache = /* @__PURE__ */ new WeakMap(); +/** a set of referenceId for entry CSS assets for each environment */ +const cssEntriesMap = /* @__PURE__ */ new WeakMap(); +function registerCustomMime() { + mimes.ico = "image/x-icon"; + mimes.cur = "image/x-icon"; + mimes.flac = "audio/flac"; + mimes.eot = "application/vnd.ms-fontobject"; +} +function renderAssetUrlInJS(pluginContext, chunk, opts, code) { + const { environment } = pluginContext; + const toRelativeRuntime = createToImportMetaURLBasedRelativeRuntime(opts.format, environment.config.isWorker); + let match; + let s; + assetUrlRE.lastIndex = 0; + while (match = assetUrlRE.exec(code)) { + s ||= new MagicString(code); + const [full, referenceId, postfix = ""] = match; + const file = pluginContext.getFileName(referenceId); + chunk.viteMetadata.importedAssets.add(cleanUrl(file)); + const replacement = toOutputFilePathInJS(environment, file + postfix, "asset", chunk.fileName, "js", toRelativeRuntime); + const replacementString = typeof replacement === "string" ? JSON.stringify(encodeURIPath(replacement)).slice(1, -1) : `"+${replacement.runtime}+"`; + s.update(match.index, match.index + full.length, replacementString); + } + const publicAssetUrlMap = publicAssetUrlCache.get(environment.getTopLevelConfig()); + publicAssetUrlRE.lastIndex = 0; + while (match = publicAssetUrlRE.exec(code)) { + s ||= new MagicString(code); + const [full, hash$1] = match; + const replacement = toOutputFilePathInJS(environment, publicAssetUrlMap.get(hash$1).slice(1), "public", chunk.fileName, "js", toRelativeRuntime); + const replacementString = typeof replacement === "string" ? JSON.stringify(encodeURIPath(replacement)).slice(1, -1) : `"+${replacement.runtime}+"`; + s.update(match.index, match.index + full.length, replacementString); + } + return s; +} +/** +* Also supports loading plain strings with import text from './foo.txt?raw' +*/ +function assetPlugin(config$2) { + registerCustomMime(); + return { + name: "vite:asset", + perEnvironmentStartEndDuringDev: true, + buildStart() { + assetCache.set(this.environment, /* @__PURE__ */ new Map()); + cssEntriesMap.set(this.environment, /* @__PURE__ */ new Map()); + }, + resolveId: { handler(id) { + if (!config$2.assetsInclude(cleanUrl(id)) && !urlRE.test(id)) return; + if (checkPublicFile(id, config$2)) return id; + } }, + load: { + filter: { id: { exclude: /^\0/ } }, + async handler(id) { + if (rawRE.test(id)) { + const file = checkPublicFile(id, config$2) || cleanUrl(id); + this.addWatchFile(file); + return `export default ${JSON.stringify(await fsp.readFile(file, "utf-8"))}`; + } + if (!urlRE.test(id) && !config$2.assetsInclude(cleanUrl(id))) return; + id = removeUrlQuery(id); + let url$3 = await fileToUrl$1(this, id); + if (!url$3.startsWith("data:") && this.environment.mode === "dev") { + const mod = this.environment.moduleGraph.getModuleById(id); + if (mod && mod.lastHMRTimestamp > 0) url$3 = injectQuery(url$3, `t=${mod.lastHMRTimestamp}`); + } + return { + code: `export default ${JSON.stringify(encodeURIPath(url$3))}`, + moduleSideEffects: config$2.command === "build" && this.getModuleInfo(id)?.isEntry ? "no-treeshake" : false, + meta: config$2.command === "build" ? { "vite:asset": true } : void 0 + }; + } + }, + renderChunk(code, chunk, opts) { + const s = renderAssetUrlInJS(this, chunk, opts, code); + if (s) return { + code: s.toString(), + map: this.environment.config.build.sourcemap ? s.generateMap({ hires: "boundary" }) : null + }; + else return null; + }, + generateBundle(_, bundle) { + let importedFiles; + for (const file in bundle) { + const chunk = bundle[file]; + if (chunk.type === "chunk" && chunk.isEntry && chunk.moduleIds.length === 1 && config$2.assetsInclude(chunk.moduleIds[0]) && this.getModuleInfo(chunk.moduleIds[0])?.meta["vite:asset"]) { + if (!importedFiles) { + importedFiles = /* @__PURE__ */ new Set(); + for (const file$1 in bundle) { + const chunk$1 = bundle[file$1]; + if (chunk$1.type === "chunk") { + for (const importedFile of chunk$1.imports) importedFiles.add(importedFile); + for (const importedFile of chunk$1.dynamicImports) importedFiles.add(importedFile); + } + } + } + if (!importedFiles.has(file)) delete bundle[file]; + } + } + if (config$2.command === "build" && !this.environment.config.build.emitAssets) { + for (const file in bundle) if (bundle[file].type === "asset" && !file.endsWith("ssr-manifest.json") && !jsSourceMapRE.test(file)) delete bundle[file]; + } + } + }; +} +async function fileToUrl$1(pluginContext, id) { + const { environment } = pluginContext; + if (environment.config.command === "serve") return fileToDevUrl(environment, id); + else return fileToBuiltUrl(pluginContext, id); +} +async function fileToDevUrl(environment, id, skipBase = false) { + const config$2 = environment.getTopLevelConfig(); + const publicFile = checkPublicFile(id, config$2); + if (inlineRE$3.test(id)) { + const file = publicFile || cleanUrl(id); + return assetToDataURL(environment, file, await fsp.readFile(file)); + } + const cleanedId = cleanUrl(id); + if (cleanedId.endsWith(".svg")) { + const file = publicFile || cleanedId; + const content = await fsp.readFile(file); + if (shouldInline(environment, file, id, content, void 0, void 0)) return assetToDataURL(environment, file, content); + } + let rtn; + if (publicFile) rtn = id; + else if (id.startsWith(withTrailingSlash(config$2.root))) rtn = "/" + path.posix.relative(config$2.root, id); + else rtn = path.posix.join(FS_PREFIX, id); + if (skipBase) return rtn; + return joinUrlSegments(joinUrlSegments(config$2.server.origin ?? "", config$2.decodedBase), removeLeadingSlash(rtn)); +} +function getPublicAssetFilename(hash$1, config$2) { + return publicAssetUrlCache.get(config$2)?.get(hash$1); +} +const publicAssetUrlCache = /* @__PURE__ */ new WeakMap(); +const publicAssetUrlRE = /__VITE_PUBLIC_ASSET__([a-z\d]{8})__/g; +function publicFileToBuiltUrl(url$3, config$2) { + if (config$2.command !== "build") return joinUrlSegments(config$2.decodedBase, url$3); + const hash$1 = getHash(url$3); + let cache$1 = publicAssetUrlCache.get(config$2); + if (!cache$1) { + cache$1 = /* @__PURE__ */ new Map(); + publicAssetUrlCache.set(config$2, cache$1); + } + if (!cache$1.get(hash$1)) cache$1.set(hash$1, url$3); + return `__VITE_PUBLIC_ASSET__${hash$1}__`; +} +const GIT_LFS_PREFIX = Buffer$1.from("version https://git-lfs.github.com"); +function isGitLfsPlaceholder(content) { + if (content.length < GIT_LFS_PREFIX.length) return false; + return GIT_LFS_PREFIX.compare(content, 0, GIT_LFS_PREFIX.length) === 0; +} +/** +* Register an asset to be emitted as part of the bundle (if necessary) +* and returns the resolved public URL +*/ +async function fileToBuiltUrl(pluginContext, id, skipPublicCheck = false, forceInline) { + const environment = pluginContext.environment; + const topLevelConfig = environment.getTopLevelConfig(); + if (!skipPublicCheck) { + const publicFile = checkPublicFile(id, topLevelConfig); + if (publicFile) if (inlineRE$3.test(id)) id = publicFile; + else return publicFileToBuiltUrl(id, topLevelConfig); + } + const cache$1 = assetCache.get(environment); + const cached = cache$1.get(id); + if (cached) return cached; + let { file, postfix } = splitFileAndPostfix(id); + const content = await fsp.readFile(file); + let url$3; + if (shouldInline(environment, file, id, content, pluginContext, forceInline)) url$3 = assetToDataURL(environment, file, content); + else { + const originalFileName = normalizePath(path.relative(environment.config.root, file)); + const referenceId = pluginContext.emitFile({ + type: "asset", + name: path.basename(file), + originalFileName, + source: content + }); + if (environment.config.command === "build" && noInlineRE.test(postfix)) postfix = postfix.replace(noInlineRE, "").replace(/^&/, "?"); + url$3 = `__VITE_ASSET__${referenceId}__${postfix ? `$_${postfix}__` : ``}`; + } + cache$1.set(id, url$3); + return url$3; +} +async function urlToBuiltUrl(pluginContext, url$3, importer, forceInline) { + const topLevelConfig = pluginContext.environment.getTopLevelConfig(); + if (checkPublicFile(url$3, topLevelConfig)) return publicFileToBuiltUrl(url$3, topLevelConfig); + return fileToBuiltUrl(pluginContext, normalizePath(url$3[0] === "/" ? path.join(topLevelConfig.root, url$3) : path.join(path.dirname(importer), url$3)), true, forceInline); +} +function shouldInline(environment, file, id, content, buildPluginContext, forceInline) { + if (noInlineRE.test(id)) return false; + if (inlineRE$3.test(id)) return true; + if (buildPluginContext) { + if (environment.config.build.lib) return true; + if (buildPluginContext.getModuleInfo(id)?.isEntry) return false; + } + if (forceInline !== void 0) return forceInline; + if (file.endsWith(".html")) return false; + if (file.endsWith(".svg") && id.includes("#")) return false; + let limit; + const { assetsInlineLimit } = environment.config.build; + if (typeof assetsInlineLimit === "function") { + const userShouldInline = assetsInlineLimit(file, content); + if (userShouldInline != null) return userShouldInline; + limit = DEFAULT_ASSETS_INLINE_LIMIT; + } else limit = Number(assetsInlineLimit); + return content.length < limit && !isGitLfsPlaceholder(content); +} +function assetToDataURL(environment, file, content) { + if (environment.config.build.lib && isGitLfsPlaceholder(content)) environment.logger.warn(import_picocolors$30.default.yellow(`Inlined file ${file} was not downloaded via Git LFS`)); + if (file.endsWith(".svg")) return svgToDataURL(content); + else return `data:${lookup(file) ?? "application/octet-stream"};base64,${content.toString("base64")}`; +} +const nestedQuotesRE = /"[^"']*'[^"]*"|'[^'"]*"[^']*'/; +function svgToDataURL(content) { + const stringContent = content.toString(); + if (stringContent.includes("\s+<").replaceAll("\"", "'").replaceAll("%", "%25").replaceAll("#", "%23").replaceAll("<", "%3c").replaceAll(">", "%3e").replaceAll(/\s+/g, "%20"); +} + +//#endregion +//#region src/node/plugins/json.ts +/** +* https://github.com/rollup/plugins/blob/master/packages/json/src/index.js +* +* This source code is licensed under the MIT license found in the +* LICENSE file at +* https://github.com/rollup/plugins/blob/master/LICENSE +*/ +const jsonExtRE = /\.json(?:$|\?)(?!commonjs-(?:proxy|external))/; +const jsonObjRE = /^\s*\{/; +const jsonLangRE = new RegExp(`\\.(?:json|json5)(?:$|\\?)`); +const isJSONRequest = (request) => jsonLangRE.test(request); +function jsonPlugin(options$1, isBuild) { + return { + name: "vite:json", + transform: { + filter: { id: { + include: jsonExtRE, + exclude: SPECIAL_QUERY_RE + } }, + handler(json, id) { + if (inlineRE$3.test(id) || noInlineRE.test(id)) this.warn("\nUsing ?inline or ?no-inline for JSON imports will have no effect.\nPlease use ?url&inline or ?url&no-inline to control JSON file inlining behavior.\n"); + json = stripBomTag(json); + try { + if (options$1.stringify !== false) { + if (options$1.namedExports && jsonObjRE.test(json)) { + const parsed = JSON.parse(json); + const keys = Object.keys(parsed); + let code = ""; + let defaultObjectCode = "{\n"; + for (const key of keys) if (key === makeLegalIdentifier(key)) { + code += `export const ${key} = ${serializeValue(parsed[key])};\n`; + defaultObjectCode += ` ${key},\n`; + } else defaultObjectCode += ` ${JSON.stringify(key)}: ${serializeValue(parsed[key])},\n`; + defaultObjectCode += "}"; + code += `export default ${defaultObjectCode};\n`; + return { + code, + map: { mappings: "" } + }; + } + if (options$1.stringify === true || json.length > 10 * 1e3) { + if (isBuild) json = JSON.stringify(JSON.parse(json)); + return { + code: `export default /* #__PURE__ */ JSON.parse(${JSON.stringify(json)})`, + map: { mappings: "" } + }; + } + } + return { + code: dataToEsm(JSON.parse(json), { + preferConst: true, + namedExports: options$1.namedExports + }), + map: { mappings: "" } + }; + } catch (e$1) { + const position = extractJsonErrorPosition(e$1.message, json.length); + const msg = position ? `, invalid JSON syntax found at position ${position}` : `.`; + this.error(`Failed to parse JSON file` + msg, position); + } + } + } + }; +} +function serializeValue(value$1) { + const valueAsString = JSON.stringify(value$1); + if (typeof value$1 === "object" && value$1 != null && valueAsString.length > 10 * 1e3) return `/* #__PURE__ */ JSON.parse(${JSON.stringify(valueAsString)})`; + return valueAsString; +} +function extractJsonErrorPosition(errorMessage, inputLength) { + if (errorMessage.startsWith("Unexpected end of JSON input")) return inputLength - 1; + const errorMessageList = /at position (\d+)/.exec(errorMessage); + return errorMessageList ? Math.max(parseInt(errorMessageList[1], 10) - 1, 0) : void 0; +} + +//#endregion +//#region src/node/plugins/optimizedDeps.ts +var import_picocolors$29 = /* @__PURE__ */ __toESM(require_picocolors(), 1); +const debug$15 = createDebugger("vite:optimize-deps"); +function optimizedDepsPlugin() { + return { + name: "vite:optimized-deps", + applyToEnvironment(environment) { + return !isDepOptimizationDisabled(environment.config.optimizeDeps); + }, + resolveId(id) { + if (this.environment.depsOptimizer?.isOptimizedDepFile(id)) return id; + }, + async load(id) { + const environment = this.environment; + const depsOptimizer = environment.depsOptimizer; + if (depsOptimizer?.isOptimizedDepFile(id)) { + const metadata = depsOptimizer.metadata; + const file = cleanUrl(id); + const versionMatch = DEP_VERSION_RE.exec(id); + const browserHash = versionMatch ? versionMatch[1].split("=")[1] : void 0; + const info = optimizedDepInfoFromFile(metadata, file); + if (info) { + if (browserHash && info.browserHash !== browserHash && !environment.config.optimizeDeps.ignoreOutdatedRequests) throwOutdatedRequest(id); + try { + await info.processing; + } catch { + throwProcessingError(id); + } + const newMetadata = depsOptimizer.metadata; + if (metadata !== newMetadata) { + const currentInfo = optimizedDepInfoFromFile(newMetadata, file); + if (info.browserHash !== currentInfo?.browserHash && !environment.config.optimizeDeps.ignoreOutdatedRequests) throwOutdatedRequest(id); + } + } + debug$15?.(`load ${import_picocolors$29.default.cyan(file)}`); + try { + return await fsp.readFile(file, "utf-8"); + } catch { + if (browserHash && !environment.config.optimizeDeps.ignoreOutdatedRequests) throwOutdatedRequest(id); + throwFileNotFoundInOptimizedDep(id); + } + } + } + }; +} +function throwProcessingError(id) { + const err$2 = /* @__PURE__ */ new Error(`Something unexpected happened while optimizing "${id}". The current page should have reloaded by now`); + err$2.code = ERR_OPTIMIZE_DEPS_PROCESSING_ERROR; + throw err$2; +} +function throwOutdatedRequest(id) { + const err$2 = /* @__PURE__ */ new Error(`There is a new version of the pre-bundle for "${id}", a page reload is going to ask for it.`); + err$2.code = ERR_OUTDATED_OPTIMIZED_DEP; + throw err$2; +} +function throwFileNotFoundInOptimizedDep(id) { + const err$2 = /* @__PURE__ */ new Error(`The file does not exist at "${id}" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to \`optimizeDeps.exclude\`.`); + err$2.code = ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR; + throw err$2; +} + +//#endregion +//#region ../../node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.json +var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = { + "name": "dotenv", + "version": "17.2.3", + "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 tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000", + "test:coverage": "tap run tests/**/*.js --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 } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.js +var require_main$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { + const fs$10 = __require("fs"); + const path$10 = __require("path"); + const os$3 = __require("os"); + const crypto$2 = __require("crypto"); + const version = require_package().version; + const TIPS = [ + "🔐 encrypt with Dotenvx: https://dotenvx.com", + "🔐 prevent committing .env to code: https://dotenvx.com/precommit", + "🔐 prevent building .env in docker: https://dotenvx.com/prebuild", + "📡 add observability to secrets: https://dotenvx.com/ops", + "👥 sync secrets across teammates & machines: https://dotenvx.com/ops", + "🗂️ backup and recover secrets: https://dotenvx.com/ops", + "✅ audit secrets and track compliance: https://dotenvx.com/ops", + "🔄 add secrets lifecycle management: https://dotenvx.com/ops", + "🔑 add access controls to secrets: https://dotenvx.com/ops", + "🛠️ run anywhere with `dotenvx run -- yourcommand`", + "⚙️ specify custom .env file path with { path: '/custom/path/.env' }", + "⚙️ enable debug logging with { debug: true }", + "⚙️ override existing env vars with { override: true }", + "⚙️ suppress all logs with { quiet: true }", + "⚙️ write to custom object with { processEnv: myObject }", + "⚙️ load multiple .env files with { path: ['.env.local', '.env'] }" + ]; + function _getRandomTip() { + return TIPS[Math.floor(Math.random() * TIPS.length)]; + } + function parseBoolean(value$1) { + if (typeof value$1 === "string") return ![ + "false", + "0", + "no", + "off", + "" + ].includes(value$1.toLowerCase()); + return Boolean(value$1); + } + function supportsAnsi() { + return process.stdout.isTTY; + } + function dim(text) { + return supportsAnsi() ? `\x1b[2m${text}\x1b[0m` : text; + } + const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm; + function parse$12(src) { + const obj = {}; + let lines = src.toString(); + lines = lines.replace(/\r\n?/gm, "\n"); + let match; + while ((match = LINE.exec(lines)) != null) { + const key = match[1]; + let value$1 = match[2] || ""; + value$1 = value$1.trim(); + const maybeQuote = value$1[0]; + value$1 = value$1.replace(/^(['"`])([\s\S]*)\1$/gm, "$2"); + if (maybeQuote === "\"") { + value$1 = value$1.replace(/\\n/g, "\n"); + value$1 = value$1.replace(/\\r/g, "\r"); + } + obj[key] = value$1; + } + return obj; + } + function _parseVault(options$1) { + options$1 = options$1 || {}; + const vaultPath = _vaultPath(options$1); + options$1.path = vaultPath; + const result = DotenvModule.configDotenv(options$1); + if (!result.parsed) { + const err$2 = /* @__PURE__ */ new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`); + err$2.code = "MISSING_DATA"; + throw err$2; + } + const keys = _dotenvKey(options$1).split(","); + const length = keys.length; + let decrypted; + for (let i$1 = 0; i$1 < length; i$1++) try { + const attrs = _instructions(result, keys[i$1].trim()); + decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key); + break; + } catch (error$1) { + if (i$1 + 1 >= length) throw error$1; + } + return DotenvModule.parse(decrypted); + } + function _warn(message) { + console.error(`[dotenv@${version}][WARN] ${message}`); + } + function _debug(message) { + console.log(`[dotenv@${version}][DEBUG] ${message}`); + } + function _log(message) { + console.log(`[dotenv@${version}] ${message}`); + } + function _dotenvKey(options$1) { + if (options$1 && options$1.DOTENV_KEY && options$1.DOTENV_KEY.length > 0) return options$1.DOTENV_KEY; + if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) return process.env.DOTENV_KEY; + return ""; + } + function _instructions(result, dotenvKey) { + let uri; + try { + uri = new URL(dotenvKey); + } catch (error$1) { + if (error$1.code === "ERR_INVALID_URL") { + const err$2 = /* @__PURE__ */ new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development"); + err$2.code = "INVALID_DOTENV_KEY"; + throw err$2; + } + throw error$1; + } + const key = uri.password; + if (!key) { + const err$2 = /* @__PURE__ */ new Error("INVALID_DOTENV_KEY: Missing key part"); + err$2.code = "INVALID_DOTENV_KEY"; + throw err$2; + } + const environment = uri.searchParams.get("environment"); + if (!environment) { + const err$2 = /* @__PURE__ */ new Error("INVALID_DOTENV_KEY: Missing environment part"); + err$2.code = "INVALID_DOTENV_KEY"; + throw err$2; + } + const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`; + const ciphertext = result.parsed[environmentKey]; + if (!ciphertext) { + const err$2 = /* @__PURE__ */ new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`); + err$2.code = "NOT_FOUND_DOTENV_ENVIRONMENT"; + throw err$2; + } + return { + ciphertext, + key + }; + } + function _vaultPath(options$1) { + let possibleVaultPath = null; + if (options$1 && options$1.path && options$1.path.length > 0) if (Array.isArray(options$1.path)) { + for (const filepath of options$1.path) if (fs$10.existsSync(filepath)) possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`; + } else possibleVaultPath = options$1.path.endsWith(".vault") ? options$1.path : `${options$1.path}.vault`; + else possibleVaultPath = path$10.resolve(process.cwd(), ".env.vault"); + if (fs$10.existsSync(possibleVaultPath)) return possibleVaultPath; + return null; + } + function _resolveHome(envPath) { + return envPath[0] === "~" ? path$10.join(os$3.homedir(), envPath.slice(1)) : envPath; + } + function _configVault(options$1) { + const debug$18 = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options$1 && options$1.debug); + const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options$1 && options$1.quiet); + if (debug$18 || !quiet) _log("Loading env from encrypted .env.vault"); + const parsed = DotenvModule._parseVault(options$1); + let processEnv = process.env; + if (options$1 && options$1.processEnv != null) processEnv = options$1.processEnv; + DotenvModule.populate(processEnv, parsed, options$1); + return { parsed }; + } + function configDotenv(options$1) { + const dotenvPath = path$10.resolve(process.cwd(), ".env"); + let encoding = "utf8"; + let processEnv = process.env; + if (options$1 && options$1.processEnv != null) processEnv = options$1.processEnv; + let debug$18 = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options$1 && options$1.debug); + let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options$1 && options$1.quiet); + if (options$1 && options$1.encoding) encoding = options$1.encoding; + else if (debug$18) _debug("No encoding is specified. UTF-8 is used by default"); + let optionPaths = [dotenvPath]; + if (options$1 && options$1.path) if (!Array.isArray(options$1.path)) optionPaths = [_resolveHome(options$1.path)]; + else { + optionPaths = []; + for (const filepath of options$1.path) optionPaths.push(_resolveHome(filepath)); + } + let lastError; + const parsedAll = {}; + for (const path$13 of optionPaths) try { + const parsed = DotenvModule.parse(fs$10.readFileSync(path$13, { encoding })); + DotenvModule.populate(parsedAll, parsed, options$1); + } catch (e$1) { + if (debug$18) _debug(`Failed to load ${path$13} ${e$1.message}`); + lastError = e$1; + } + const populated = DotenvModule.populate(processEnv, parsedAll, options$1); + debug$18 = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug$18); + quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet); + if (debug$18 || !quiet) { + const keysCount = Object.keys(populated).length; + const shortPaths = []; + for (const filePath of optionPaths) try { + const relative$3 = path$10.relative(process.cwd(), filePath); + shortPaths.push(relative$3); + } catch (e$1) { + if (debug$18) _debug(`Failed to load ${filePath} ${e$1.message}`); + lastError = e$1; + } + _log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim(`-- tip: ${_getRandomTip()}`)}`); + } + if (lastError) return { + parsed: parsedAll, + error: lastError + }; + else return { parsed: parsedAll }; + } + function config(options$1) { + if (_dotenvKey(options$1).length === 0) return DotenvModule.configDotenv(options$1); + const vaultPath = _vaultPath(options$1); + if (!vaultPath) { + _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`); + return DotenvModule.configDotenv(options$1); + } + return DotenvModule._configVault(options$1); + } + function decrypt(encrypted, keyStr) { + const key = Buffer.from(keyStr.slice(-64), "hex"); + let ciphertext = Buffer.from(encrypted, "base64"); + const nonce = ciphertext.subarray(0, 12); + const authTag = ciphertext.subarray(-16); + ciphertext = ciphertext.subarray(12, -16); + try { + const aesgcm = crypto$2.createDecipheriv("aes-256-gcm", key, nonce); + aesgcm.setAuthTag(authTag); + return `${aesgcm.update(ciphertext)}${aesgcm.final()}`; + } catch (error$1) { + const isRange = error$1 instanceof RangeError; + const invalidKeyLength = error$1.message === "Invalid key length"; + const decryptionFailed = error$1.message === "Unsupported state or unable to authenticate data"; + if (isRange || invalidKeyLength) { + const err$2 = /* @__PURE__ */ new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)"); + err$2.code = "INVALID_DOTENV_KEY"; + throw err$2; + } else if (decryptionFailed) { + const err$2 = /* @__PURE__ */ new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY"); + err$2.code = "DECRYPTION_FAILED"; + throw err$2; + } else throw error$1; + } + } + function populate(processEnv, parsed, options$1 = {}) { + const debug$18 = Boolean(options$1 && options$1.debug); + const override = Boolean(options$1 && options$1.override); + const populated = {}; + if (typeof parsed !== "object") { + const err$2 = /* @__PURE__ */ new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate"); + err$2.code = "OBJECT_REQUIRED"; + throw err$2; + } + for (const key of Object.keys(parsed)) if (Object.prototype.hasOwnProperty.call(processEnv, key)) { + if (override === true) { + processEnv[key] = parsed[key]; + populated[key] = parsed[key]; + } + if (debug$18) if (override === true) _debug(`"${key}" is already defined and WAS overwritten`); + else _debug(`"${key}" is already defined and was NOT overwritten`); + } else { + processEnv[key] = parsed[key]; + populated[key] = parsed[key]; + } + return populated; + } + const DotenvModule = { + configDotenv, + _configVault, + _parseVault, + config, + decrypt, + parse: parse$12, + populate + }; + module.exports.configDotenv = DotenvModule.configDotenv; + module.exports._configVault = DotenvModule._configVault; + module.exports._parseVault = DotenvModule._parseVault; + module.exports.config = DotenvModule.config; + module.exports.decrypt = DotenvModule.decrypt; + module.exports.parse = DotenvModule.parse; + module.exports.populate = DotenvModule.populate; + module.exports = DotenvModule; +})); + +//#endregion +//#region ../../node_modules/.pnpm/dotenv-expand@12.0.3_patch_hash=49330a663821151418e003e822a82a6a61d2f0f8a6e3cab00c1c94815a112889/node_modules/dotenv-expand/lib/main.js +var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => { + function _resolveEscapeSequences(value$1) { + return value$1.replace(/\\\$/g, "$"); + } + function expandValue(value$1, processEnv, runningParsed) { + const env$1 = { + ...runningParsed, + ...processEnv + }; + const regex = /(? normalizePath(path.join(envDir, file))); + return []; +} +function loadEnv(mode, envDir, prefixes = "VITE_") { + const start = performance.now(); + const getTime = () => `${(performance.now() - start).toFixed(2)}ms`; + if (mode === "local") throw new Error("\"local\" cannot be used as a mode name because it conflicts with the .local postfix for .env files."); + prefixes = arraify(prefixes); + const env$1 = {}; + const envFiles = getEnvFilesForMode(mode, envDir); + debug$14?.(`loading env files: %O`, envFiles); + const parsed = Object.fromEntries(envFiles.flatMap((filePath) => { + if (!tryStatSync(filePath)?.isFile()) return []; + return Object.entries((0, import_main.parse)(fs.readFileSync(filePath))); + })); + debug$14?.(`env files loaded in ${getTime()}`); + if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === void 0) process.env.VITE_USER_NODE_ENV = parsed.NODE_ENV; + if (parsed.BROWSER && process.env.BROWSER === void 0) process.env.BROWSER = parsed.BROWSER; + if (parsed.BROWSER_ARGS && process.env.BROWSER_ARGS === void 0) process.env.BROWSER_ARGS = parsed.BROWSER_ARGS; + (0, import_main$1.expand)({ + parsed, + processEnv: { ...process.env } + }); + for (const [key, value$1] of Object.entries(parsed)) if (prefixes.some((prefix) => key.startsWith(prefix))) env$1[key] = value$1; + for (const key in process.env) if (prefixes.some((prefix) => key.startsWith(prefix))) env$1[key] = process.env[key]; + debug$14?.(`using resolved env: %O`, env$1); + return env$1; +} +function resolveEnvPrefix({ envPrefix = "VITE_" }) { + envPrefix = arraify(envPrefix); + if (envPrefix.includes("")) throw new Error(`envPrefix option contains value '', which could lead unexpected exposure of sensitive information.`); + return envPrefix; +} + +//#endregion +//#region src/node/deprecations.ts +var import_picocolors$28 = /* @__PURE__ */ __toESM(require_picocolors(), 1); +const docsURL = "https://vite.dev"; +const deprecationCode = { + removePluginHookSsrArgument: "changes/this-environment-in-hooks", + removePluginHookHandleHotUpdate: "changes/hotupdate-hook", + removeServerModuleGraph: "changes/per-environment-apis", + removeServerReloadModule: "changes/per-environment-apis", + removeServerPluginContainer: "changes/per-environment-apis", + removeServerHot: "changes/per-environment-apis", + removeServerTransformRequest: "changes/per-environment-apis", + removeServerWarmupRequest: "changes/per-environment-apis", + removeSsrLoadModule: "changes/ssr-using-modulerunner" +}; +const deprecationMessages = { + removePluginHookSsrArgument: "Plugin hook `options.ssr` is replaced with `this.environment.config.consumer === 'server'`.", + removePluginHookHandleHotUpdate: "Plugin hook `handleHotUpdate()` is replaced with `hotUpdate()`.", + removeServerModuleGraph: "The `server.moduleGraph` is replaced with `this.environment.moduleGraph`.", + removeServerReloadModule: "The `server.reloadModule` is replaced with `environment.reloadModule`.", + removeServerPluginContainer: "The `server.pluginContainer` is replaced with `this.environment.pluginContainer`.", + removeServerHot: "The `server.hot` is replaced with `this.environment.hot`.", + removeServerTransformRequest: "The `server.transformRequest` is replaced with `this.environment.transformRequest`.", + removeServerWarmupRequest: "The `server.warmupRequest` is replaced with `this.environment.warmupRequest`.", + removeSsrLoadModule: "The `server.ssrLoadModule` is replaced with Environment Runner." +}; +let _ignoreDeprecationWarnings = false; +function isFutureDeprecationEnabled(config$2, type) { + return !!config$2.future?.[type]; +} +/** +* Warn about future deprecations. +*/ +function warnFutureDeprecation(config$2, type, extraMessage, stacktrace = true) { + if (_ignoreDeprecationWarnings || !config$2.future || config$2.future[type] !== "warn") return; + let msg = `[vite future] ${deprecationMessages[type]}`; + if (extraMessage) msg += ` ${extraMessage}`; + msg = import_picocolors$28.default.yellow(msg); + const docs = `${docsURL}/changes/${deprecationCode[type].toLowerCase()}`; + msg += import_picocolors$28.default.gray(`\n ${stacktrace ? "├" : "└"}─── `) + import_picocolors$28.default.underline(docs) + "\n"; + if (stacktrace) { + const stack = (/* @__PURE__ */ new Error()).stack; + if (stack) { + let stacks = stack.split("\n").slice(3).filter((i$1) => !i$1.includes("/node_modules/vite/dist/")); + if (stacks.length === 0) stacks.push("No stack trace found."); + stacks = stacks.map((i$1, idx) => ` ${idx === stacks.length - 1 ? "└" : "│"} ${i$1.trim()}`); + msg += import_picocolors$28.default.dim(stacks.join("\n")) + "\n"; + } + } + config$2.logger.warnOnce(msg); +} +function ignoreDeprecationWarnings(fn) { + const before = _ignoreDeprecationWarnings; + _ignoreDeprecationWarnings = true; + const ret = fn(); + _ignoreDeprecationWarnings = before; + return ret; +} + +//#endregion +//#region src/node/server/middlewares/error.ts +var import_picocolors$27 = /* @__PURE__ */ __toESM(require_picocolors(), 1); +function prepareError(err$2) { + return { + message: stripVTControlCharacters(err$2.message), + stack: stripVTControlCharacters(cleanStack(err$2.stack || "")), + id: err$2.id, + frame: stripVTControlCharacters(err$2.frame || ""), + plugin: err$2.plugin, + pluginCode: err$2.pluginCode?.toString(), + loc: err$2.loc + }; +} +function buildErrorMessage(err$2, args = [], includeStack = true) { + if (err$2.plugin) args.push(` Plugin: ${import_picocolors$27.default.magenta(err$2.plugin)}`); + const loc = err$2.loc ? `:${err$2.loc.line}:${err$2.loc.column}` : ""; + if (err$2.id) args.push(` File: ${import_picocolors$27.default.cyan(err$2.id)}${loc}`); + if (err$2.frame) args.push(import_picocolors$27.default.yellow(pad$1(err$2.frame))); + if (includeStack && err$2.stack) args.push(pad$1(cleanStack(err$2.stack))); + return args.join("\n"); +} +function cleanStack(stack) { + return stack.split(/\n/).filter((l) => /^\s*at/.test(l)).join("\n"); +} +function logError(server, err$2) { + const msg = buildErrorMessage(err$2, [import_picocolors$27.default.red(`Internal server error: ${err$2.message}`)]); + server.config.logger.error(msg, { + clear: true, + timestamp: true, + error: err$2 + }); + server.environments.client.hot.send({ + type: "error", + err: prepareError(err$2) + }); +} +function errorMiddleware(server, allowNext = false) { + return function viteErrorMiddleware(err$2, _req, res, next) { + logError(server, err$2); + if (allowNext) next(); + else { + res.statusCode = 500; + res.end(` + + + + + Error +