vite 7.1.5 → 7.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -93,32 +93,30 @@ function withTrailingSlash(path$13) {
93
93
  if (path$13[path$13.length - 1] !== "/") return `${path$13}/`;
94
94
  return path$13;
95
95
  }
96
- const AsyncFunction$1 = async function() {}.constructor;
97
96
  function promiseWithResolvers() {
98
97
  let resolve$4;
99
98
  let reject;
100
- const promise = new Promise((_resolve, _reject) => {
101
- resolve$4 = _resolve;
102
- reject = _reject;
103
- });
104
99
  return {
105
- promise,
100
+ promise: new Promise((_resolve, _reject) => {
101
+ resolve$4 = _resolve;
102
+ reject = _reject;
103
+ }),
106
104
  resolve: resolve$4,
107
105
  reject
108
106
  };
109
107
  }
110
108
 
111
109
  //#endregion
112
- //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
113
- const comma$1 = ",".charCodeAt(0);
114
- const semicolon$1 = ";".charCodeAt(0);
115
- const chars$2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
116
- const intToChar$1 = new Uint8Array(64);
117
- const charToInt$1 = new Uint8Array(128);
118
- for (let i$1 = 0; i$1 < 64; i$1++) {
119
- const c = chars$2.charCodeAt(i$1);
120
- intToChar$1[i$1] = c;
121
- charToInt$1[c] = i$1;
110
+ //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
111
+ var comma = ",".charCodeAt(0);
112
+ var semicolon = ";".charCodeAt(0);
113
+ var chars$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
114
+ var intToChar = new Uint8Array(64);
115
+ var charToInt = new Uint8Array(128);
116
+ for (let i$1 = 0; i$1 < chars$1.length; i$1++) {
117
+ const c = chars$1.charCodeAt(i$1);
118
+ intToChar[i$1] = c;
119
+ charToInt[c] = i$1;
122
120
  }
123
121
  function decodeInteger(reader, relative$3) {
124
122
  let value$1 = 0;
@@ -126,7 +124,7 @@ function decodeInteger(reader, relative$3) {
126
124
  let integer = 0;
127
125
  do {
128
126
  const c = reader.next();
129
- integer = charToInt$1[c];
127
+ integer = charToInt[c];
130
128
  value$1 |= (integer & 31) << shift;
131
129
  shift += 5;
132
130
  } while (integer & 32);
@@ -135,47 +133,46 @@ function decodeInteger(reader, relative$3) {
135
133
  if (shouldNegate) value$1 = -2147483648 | -value$1;
136
134
  return relative$3 + value$1;
137
135
  }
138
- function encodeInteger$1(builder, num, relative$3) {
136
+ function encodeInteger(builder, num, relative$3) {
139
137
  let delta = num - relative$3;
140
138
  delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
141
139
  do {
142
140
  let clamped = delta & 31;
143
141
  delta >>>= 5;
144
142
  if (delta > 0) clamped |= 32;
145
- builder.write(intToChar$1[clamped]);
143
+ builder.write(intToChar[clamped]);
146
144
  } while (delta > 0);
147
145
  return num;
148
146
  }
149
147
  function hasMoreVlq(reader, max) {
150
148
  if (reader.pos >= max) return false;
151
- return reader.peek() !== comma$1;
149
+ return reader.peek() !== comma;
152
150
  }
153
- const bufLength$1 = 1024 * 16;
154
- const td$1 = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
155
- const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
156
- return out.toString();
151
+ var bufLength = 1024 * 16;
152
+ var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
153
+ return Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString();
157
154
  } } : { decode(buf) {
158
155
  let out = "";
159
156
  for (let i$1 = 0; i$1 < buf.length; i$1++) out += String.fromCharCode(buf[i$1]);
160
157
  return out;
161
158
  } };
162
- var StringWriter$1 = class {
159
+ var StringWriter = class {
163
160
  constructor() {
164
161
  this.pos = 0;
165
162
  this.out = "";
166
- this.buffer = new Uint8Array(bufLength$1);
163
+ this.buffer = new Uint8Array(bufLength);
167
164
  }
168
165
  write(v) {
169
166
  const { buffer } = this;
170
167
  buffer[this.pos++] = v;
171
- if (this.pos === bufLength$1) {
172
- this.out += td$1.decode(buffer);
168
+ if (this.pos === bufLength) {
169
+ this.out += td.decode(buffer);
173
170
  this.pos = 0;
174
171
  }
175
172
  }
176
173
  flush() {
177
174
  const { buffer, out, pos } = this;
178
- return pos > 0 ? out + td$1.decode(buffer.subarray(0, pos)) : out;
175
+ return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
179
176
  }
180
177
  };
181
178
  var StringReader = class {
@@ -250,27 +247,27 @@ function sort(line) {
250
247
  function sortComparator$1(a, b) {
251
248
  return a[0] - b[0];
252
249
  }
253
- function encode$2(decoded) {
254
- const writer = new StringWriter$1();
250
+ function encode$1(decoded) {
251
+ const writer = new StringWriter();
255
252
  let sourcesIndex = 0;
256
253
  let sourceLine = 0;
257
254
  let sourceColumn = 0;
258
255
  let namesIndex = 0;
259
256
  for (let i$1 = 0; i$1 < decoded.length; i$1++) {
260
257
  const line = decoded[i$1];
261
- if (i$1 > 0) writer.write(semicolon$1);
258
+ if (i$1 > 0) writer.write(semicolon);
262
259
  if (line.length === 0) continue;
263
260
  let genColumn = 0;
264
261
  for (let j = 0; j < line.length; j++) {
265
262
  const segment = line[j];
266
- if (j > 0) writer.write(comma$1);
267
- genColumn = encodeInteger$1(writer, segment[0], genColumn);
263
+ if (j > 0) writer.write(comma);
264
+ genColumn = encodeInteger(writer, segment[0], genColumn);
268
265
  if (segment.length === 1) continue;
269
- sourcesIndex = encodeInteger$1(writer, segment[1], sourcesIndex);
270
- sourceLine = encodeInteger$1(writer, segment[2], sourceLine);
271
- sourceColumn = encodeInteger$1(writer, segment[3], sourceColumn);
266
+ sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
267
+ sourceLine = encodeInteger(writer, segment[2], sourceLine);
268
+ sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
272
269
  if (segment.length === 4) continue;
273
- namesIndex = encodeInteger$1(writer, segment[4], namesIndex);
270
+ namesIndex = encodeInteger(writer, segment[4], namesIndex);
274
271
  }
275
272
  }
276
273
  return writer.flush();
@@ -442,7 +439,7 @@ function resolve$3(input, base) {
442
439
  }
443
440
 
444
441
  //#endregion
445
- //#region ../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.30/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
442
+ //#region ../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
446
443
  function stripFilename(path$13) {
447
444
  if (!path$13) return "";
448
445
  const index = path$13.lastIndexOf("/");
@@ -567,7 +564,7 @@ function cast$1(map$1) {
567
564
  }
568
565
  function encodedMappings(map$1) {
569
566
  var _a, _b;
570
- return (_b = (_a = cast$1(map$1))._encoded) != null ? _b : _a._encoded = encode$2(cast$1(map$1)._decoded);
567
+ return (_b = (_a = cast$1(map$1))._encoded) != null ? _b : _a._encoded = encode$1(cast$1(map$1)._decoded);
571
568
  }
572
569
  function decodedMappings(map$1) {
573
570
  var _a;
@@ -647,8 +644,7 @@ function put(setarr, key) {
647
644
  const index = get$2(setarr, key);
648
645
  if (index !== void 0) return index;
649
646
  const { array, _indexes: indexes } = cast(setarr);
650
- const length = array.push(key);
651
- return indexes[key] = length - 1;
647
+ return indexes[key] = array.push(key) - 1;
652
648
  }
653
649
  function remove(setarr, key) {
654
650
  const index = get$2(setarr, key);
@@ -713,7 +709,7 @@ function toDecodedMap(map$1) {
713
709
  }
714
710
  function toEncodedMap(map$1) {
715
711
  const decoded = toDecodedMap(map$1);
716
- return Object.assign({}, decoded, { mappings: encode$2(decoded.mappings) });
712
+ return Object.assign({}, decoded, { mappings: encode$1(decoded.mappings) });
717
713
  }
718
714
  function addSegmentInternal(skipable, map$1, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
719
715
  const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names } = cast2(map$1);
@@ -767,8 +763,7 @@ function removeEmptyFinalLines(mappings) {
767
763
  }
768
764
  function skipSourceless(line, index) {
769
765
  if (index === 0) return true;
770
- const prev = line[index - 1];
771
- return prev.length === 1;
766
+ return line[index - 1].length === 1;
772
767
  }
773
768
  function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
774
769
  if (index === 0) return false;
@@ -940,8 +935,7 @@ var require_ms$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ms@2.1
940
935
  var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
941
936
  if (!match) return;
942
937
  var n$2 = parseFloat(match[1]);
943
- var type = (match[2] || "ms").toLowerCase();
944
- switch (type) {
938
+ switch ((match[2] || "ms").toLowerCase()) {
945
939
  case "years":
946
940
  case "year":
947
941
  case "yrs":
@@ -973,7 +967,7 @@ var require_ms$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ms@2.1
973
967
  case "msecs":
974
968
  case "msec":
975
969
  case "ms": return n$2;
976
- default: return void 0;
970
+ default: return;
977
971
  }
978
972
  }
979
973
  /**
@@ -1016,8 +1010,8 @@ var require_ms$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ms@2.1
1016
1010
  }) });
1017
1011
 
1018
1012
  //#endregion
1019
- //#region ../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/common.js
1020
- var require_common$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/common.js": ((exports, module) => {
1013
+ //#region ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js
1014
+ var require_common$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js": ((exports, module) => {
1021
1015
  /**
1022
1016
  * This is the common logic for both the Node.js and web browser
1023
1017
  * implementations of `debug()`.
@@ -1076,8 +1070,7 @@ var require_common$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/de
1076
1070
  if (!debug$19.enabled) return;
1077
1071
  const self$1 = debug$19;
1078
1072
  const curr = Number(/* @__PURE__ */ new Date());
1079
- const ms = curr - (prevTime$1 || curr);
1080
- self$1.diff = ms;
1073
+ self$1.diff = curr - (prevTime$1 || curr);
1081
1074
  self$1.prev = prevTime$1;
1082
1075
  self$1.curr = curr;
1083
1076
  prevTime$1 = curr;
@@ -1097,8 +1090,7 @@ var require_common$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/de
1097
1090
  return match;
1098
1091
  });
1099
1092
  createDebug$1.formatArgs.call(self$1, args);
1100
- const logFn = self$1.log || createDebug$1.log;
1101
- logFn.apply(self$1, args);
1093
+ (self$1.log || createDebug$1.log).apply(self$1, args);
1102
1094
  }
1103
1095
  debug$19.namespace = namespace;
1104
1096
  debug$19.useColors = createDebug$1.useColors();
@@ -1221,8 +1213,8 @@ var require_common$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/de
1221
1213
  }) });
1222
1214
 
1223
1215
  //#endregion
1224
- //#region ../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/node.js
1225
- var require_node$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/node.js": ((exports, module) => {
1216
+ //#region ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js
1217
+ var require_node$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js": ((exports, module) => {
1226
1218
  /**
1227
1219
  * Module dependencies.
1228
1220
  */
@@ -1568,8 +1560,7 @@ var SyncWalker$1 = class extends WalkerBase$1 {
1568
1560
  * @returns {BaseNode}
1569
1561
  */
1570
1562
  function walk$2(ast, { enter, leave }) {
1571
- const instance = new SyncWalker$1(enter, leave);
1572
- return instance.visit(ast, null);
1563
+ return new SyncWalker$1(enter, leave).visit(ast, null);
1573
1564
  }
1574
1565
 
1575
1566
  //#endregion
@@ -1668,8 +1659,7 @@ const attachScopes = function attachScopes$1(ast, propertyName = "scope") {
1668
1659
  }
1669
1660
  },
1670
1661
  leave(n$2) {
1671
- const node = n$2;
1672
- if (node[propertyName]) scope = scope.parent;
1662
+ if (n$2[propertyName]) scope = scope.parent;
1673
1663
  }
1674
1664
  });
1675
1665
  return scope;
@@ -1695,9 +1685,7 @@ const createFilter$2 = function createFilter$3(include, exclude, options$1) {
1695
1685
  const resolutionBase = options$1 && options$1.resolve;
1696
1686
  const getMatcher = (id) => id instanceof RegExp ? id : { test: (what) => {
1697
1687
  const pattern = getMatcherString$1(id, resolutionBase);
1698
- const fn = picomatch(pattern, { dot: true });
1699
- const result = fn(what);
1700
- return result;
1688
+ return picomatch(pattern, { dot: true })(what);
1701
1689
  } };
1702
1690
  const includeMatchers = ensureArray(include).map(getMatcher);
1703
1691
  const excludeMatchers = ensureArray(exclude).map(getMatcher);
@@ -1719,9 +1707,7 @@ const createFilter$2 = function createFilter$3(include, exclude, options$1) {
1719
1707
  return !includeMatchers.length;
1720
1708
  };
1721
1709
  };
1722
- const reservedWords = "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";
1723
- const builtins = "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";
1724
- const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(" "));
1710
+ 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(" "));
1725
1711
  forbiddenIdentifiers.add("");
1726
1712
  const makeLegalIdentifier = function makeLegalIdentifier$1(str) {
1727
1713
  let identifier = str.replace(/-(\w)/g, (_, letter) => letter.toUpperCase()).replace(/[^$_a-zA-Z0-9]/g, "_");
@@ -1784,8 +1770,7 @@ const dataToEsm = function dataToEsm$1(data, options$1 = {}) {
1784
1770
  const declarationType = options$1.preferConst ? "const" : "var";
1785
1771
  if (options$1.namedExports === false || typeof data !== "object" || Array.isArray(data) || data instanceof Date || data instanceof RegExp || data === null) {
1786
1772
  const code = serialize(data, options$1.compact ? null : t$1, "");
1787
- const magic = _ || (/^[{[\-\/]/.test(code) ? "" : " ");
1788
- return `export default${magic}${code};`;
1773
+ return `export default${_ || (/^[{[\-\/]/.test(code) ? "" : " ")}${code};`;
1789
1774
  }
1790
1775
  let maxUnderbarPrefixLength = 0;
1791
1776
  for (const key of Object.keys(data)) {
@@ -1902,7 +1887,7 @@ function loadPackageData(pkgPath) {
1902
1887
  }
1903
1888
  else hasSideEffects = () => null;
1904
1889
  const resolvedCache = {};
1905
- const pkg = {
1890
+ return {
1906
1891
  dir: pkgDir,
1907
1892
  data,
1908
1893
  hasSideEffects,
@@ -1913,7 +1898,6 @@ function loadPackageData(pkgPath) {
1913
1898
  return resolvedCache[getResolveCacheKey(key, options$1)];
1914
1899
  }
1915
1900
  };
1916
- return pkg;
1917
1901
  }
1918
1902
  function getResolveCacheKey(key, options$1) {
1919
1903
  return [
@@ -2038,8 +2022,7 @@ const replaceDotRE = /\./g;
2038
2022
  const replaceNestedIdRE = /\s*>\s*/g;
2039
2023
  const replaceHashRE = /#/g;
2040
2024
  const flattenId = (id) => {
2041
- const flatId = limitFlattenIdLength(id.replace(replaceSlashOrColonRE, "_").replace(replaceDotRE, "__").replace(replaceNestedIdRE, "___").replace(replaceHashRE, "____"));
2042
- return flatId;
2025
+ return limitFlattenIdLength(id.replace(replaceSlashOrColonRE, "_").replace(replaceDotRE, "__").replace(replaceNestedIdRE, "___").replace(replaceHashRE, "____"));
2043
2026
  };
2044
2027
  const FLATTEN_ID_HASH_LENGTH = 8;
2045
2028
  const FLATTEN_ID_MAX_FILE_LENGTH = 170;
@@ -2052,17 +2035,17 @@ const NODE_BUILTIN_NAMESPACE = "node:";
2052
2035
  const BUN_BUILTIN_NAMESPACE = "bun:";
2053
2036
  const nodeBuiltins = builtinModules.filter((id) => !id.includes(":"));
2054
2037
  const isBuiltinCache = /* @__PURE__ */ new WeakMap();
2055
- function isBuiltin(builtins$1, id) {
2056
- let isBuiltin$1 = isBuiltinCache.get(builtins$1);
2038
+ function isBuiltin(builtins, id) {
2039
+ let isBuiltin$1 = isBuiltinCache.get(builtins);
2057
2040
  if (!isBuiltin$1) {
2058
- isBuiltin$1 = createIsBuiltin(builtins$1);
2059
- isBuiltinCache.set(builtins$1, isBuiltin$1);
2041
+ isBuiltin$1 = createIsBuiltin(builtins);
2042
+ isBuiltinCache.set(builtins, isBuiltin$1);
2060
2043
  }
2061
2044
  return isBuiltin$1(id);
2062
2045
  }
2063
- function createIsBuiltin(builtins$1) {
2064
- const plainBuiltinsSet = new Set(builtins$1.filter((builtin) => typeof builtin === "string"));
2065
- const regexBuiltins = builtins$1.filter((builtin) => typeof builtin !== "string");
2046
+ function createIsBuiltin(builtins) {
2047
+ const plainBuiltinsSet = new Set(builtins.filter((builtin) => typeof builtin === "string"));
2048
+ const regexBuiltins = builtins.filter((builtin) => typeof builtin !== "string");
2066
2049
  return (id) => plainBuiltinsSet.has(id) || regexBuiltins.some((regexp) => regexp.test(id));
2067
2050
  }
2068
2051
  const nodeLikeBuiltins = [
@@ -2105,10 +2088,7 @@ function createDebugger(namespace, options$1 = {}) {
2105
2088
  const { onlyWhenFocused, depth } = options$1;
2106
2089
  if (depth && log$4.inspectOpts && log$4.inspectOpts.depth == null) log$4.inspectOpts.depth = options$1.depth;
2107
2090
  let enabled$1 = log$4.enabled;
2108
- if (enabled$1 && onlyWhenFocused) {
2109
- const ns = typeof onlyWhenFocused === "string" ? onlyWhenFocused : namespace;
2110
- enabled$1 = !!DEBUG?.includes(ns);
2111
- }
2091
+ if (enabled$1 && onlyWhenFocused) enabled$1 = !!DEBUG?.includes(typeof onlyWhenFocused === "string" ? onlyWhenFocused : namespace);
2112
2092
  if (enabled$1) return (...args) => {
2113
2093
  if (!filter || args.some((a) => a?.includes?.(filter))) log$4(...args);
2114
2094
  };
@@ -2194,8 +2174,7 @@ function removeUrlQuery(url$3) {
2194
2174
  }
2195
2175
  function injectQuery(url$3, queryToInject) {
2196
2176
  const { file, postfix } = splitFileAndPostfix(url$3);
2197
- const normalizedFile = isWindows ? slash(file) : file;
2198
- return `${normalizedFile}?${queryToInject}${postfix[0] === "?" ? `&${postfix.slice(1)}` : postfix}`;
2177
+ return `${isWindows ? slash(file) : file}?${queryToInject}${postfix[0] === "?" ? `&${postfix.slice(1)}` : postfix}`;
2199
2178
  }
2200
2179
  const timestampRE = /\bt=\d{13}&?\b/;
2201
2180
  function removeTimestampQuery(url$3) {
@@ -2257,8 +2236,7 @@ function isFilePathESM(filePath, packageCache) {
2257
2236
  if (/\.m[jt]s$/.test(filePath)) return true;
2258
2237
  else if (/\.c[jt]s$/.test(filePath)) return false;
2259
2238
  else try {
2260
- const pkg = findNearestPackageData(path.dirname(filePath), packageCache);
2261
- return pkg?.data.type === "module";
2239
+ return findNearestPackageData(path.dirname(filePath), packageCache)?.data.type === "module";
2262
2240
  } catch {
2263
2241
  return false;
2264
2242
  }
@@ -2266,8 +2244,7 @@ function isFilePathESM(filePath, packageCache) {
2266
2244
  const splitRE = /\r?\n/g;
2267
2245
  const range = 2;
2268
2246
  function pad$1(source, n$2 = 2) {
2269
- const lines = source.split(splitRE);
2270
- return lines.map((l) => ` `.repeat(n$2) + l).join(`\n`);
2247
+ return source.split(splitRE).map((l) => ` `.repeat(n$2) + l).join(`\n`);
2271
2248
  }
2272
2249
  function posToNumber(source, pos) {
2273
2250
  if (typeof pos === "number") return pos;
@@ -2386,8 +2363,7 @@ function copyDir(srcDir, destDir) {
2386
2363
  const srcFile = path.resolve(srcDir, file);
2387
2364
  if (srcFile === destDir) continue;
2388
2365
  const destFile = path.resolve(destDir, file);
2389
- const stat$4 = fs.statSync(srcFile);
2390
- if (stat$4.isDirectory()) copyDir(srcFile, destFile);
2366
+ if (fs.statSync(srcFile).isDirectory()) copyDir(srcFile, destFile);
2391
2367
  else fs.copyFileSync(srcFile, destFile);
2392
2368
  }
2393
2369
  }
@@ -2406,11 +2382,10 @@ async function recursiveReaddir(dir) {
2406
2382
  err$2.code = ERR_SYMLINK_IN_RECURSIVE_READDIR;
2407
2383
  throw err$2;
2408
2384
  }
2409
- const files = await Promise.all(dirents.map((dirent) => {
2385
+ return (await Promise.all(dirents.map((dirent) => {
2410
2386
  const res = path.resolve(dir, dirent.name);
2411
2387
  return dirent.isDirectory() ? recursiveReaddir(res) : normalizePath(res);
2412
- }));
2413
- return files.flat(1);
2388
+ }))).flat(1);
2414
2389
  }
2415
2390
  let safeRealpathSync = isWindows ? windowsSafeRealPathSync : fs.realpathSync.native;
2416
2391
  const windowsNetworkMap = /* @__PURE__ */ new Map();
@@ -2531,8 +2506,7 @@ function combineSourcemaps(filename, sourcemapList) {
2531
2506
  const escapedFilename = escapeToLinuxLikePath(filename);
2532
2507
  let map$1;
2533
2508
  let mapIndex = 1;
2534
- const useArrayInterface = sourcemapList.slice(0, -1).find((m$2) => m$2.sources.length !== 1) === void 0;
2535
- if (useArrayInterface) map$1 = remapping(sourcemapList, () => null);
2509
+ if (sourcemapList.slice(0, -1).find((m$2) => m$2.sources.length !== 1) === void 0) map$1 = remapping(sourcemapList, () => null);
2536
2510
  else map$1 = remapping(sourcemapList[0], function loader$1(sourcefile) {
2537
2511
  if (sourcefile === escapedFilename && sourcemapList[mapIndex]) return sourcemapList[mapIndex++];
2538
2512
  else return null;
@@ -2554,8 +2528,7 @@ function unique(arr) {
2554
2528
  */
2555
2529
  async function getLocalhostAddressIfDiffersFromDNS() {
2556
2530
  const [nodeResult, dnsResult] = await Promise.all([promises$1.lookup("localhost"), promises$1.lookup("localhost", { verbatim: true })]);
2557
- const isSame = nodeResult.family === dnsResult.family && nodeResult.address === dnsResult.address;
2558
- return isSame ? void 0 : nodeResult.address;
2531
+ return nodeResult.family === dnsResult.family && nodeResult.address === dnsResult.address ? void 0 : nodeResult.address;
2559
2532
  }
2560
2533
  function diffDnsOrderChange(oldUrls, newUrls) {
2561
2534
  return !(oldUrls === newUrls || oldUrls && newUrls && arrayEqual(oldUrls.local, newUrls.local) && arrayEqual(oldUrls.network, newUrls.network));
@@ -2650,8 +2623,7 @@ function getHash(text, length = 8) {
2650
2623
  return h$2.padEnd(length, "_");
2651
2624
  }
2652
2625
  const requireResolveFromRootWithFallback = (root, id) => {
2653
- const found$1 = resolvePackageData(id, root) || resolvePackageData(id, _dirname);
2654
- if (!found$1) {
2626
+ if (!(resolvePackageData(id, root) || resolvePackageData(id, _dirname))) {
2655
2627
  const error$1 = /* @__PURE__ */ new Error(`${JSON.stringify(id)} not found.`);
2656
2628
  error$1.code = "MODULE_NOT_FOUND";
2657
2629
  throw error$1;
@@ -2841,11 +2813,10 @@ function arrayEqual(a, b) {
2841
2813
  return true;
2842
2814
  }
2843
2815
  function evalValue(rawValue) {
2844
- const fn = new Function(`
2816
+ return new Function(`
2845
2817
  var console, exports, global, module, process, require
2846
2818
  return (\n${rawValue}\n)
2847
- `);
2848
- return fn();
2819
+ `)();
2849
2820
  }
2850
2821
  function getNpmPackageName(importPath) {
2851
2822
  const parts = importPath.split("/");
@@ -2993,8 +2964,8 @@ function perEnvironmentPlugin(name, applyToEnvironment) {
2993
2964
  var require_commondir = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/commondir@1.0.1/node_modules/commondir/index.js": ((exports, module) => {
2994
2965
  var path$12 = __require("path");
2995
2966
  module.exports = function(basedir, relfiles) {
2996
- if (relfiles) var files = relfiles.map(function(r$2) {
2997
- return path$12.resolve(basedir, r$2);
2967
+ if (relfiles) var files = relfiles.map(function(r$1) {
2968
+ return path$12.resolve(basedir, r$1);
2998
2969
  });
2999
2970
  else var files = basedir;
3000
2971
  var res = files.slice(1).reduce(function(ps, file) {
@@ -3008,84 +2979,7 @@ var require_commondir = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/c
3008
2979
  }) });
3009
2980
 
3010
2981
  //#endregion
3011
- //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
3012
- var comma = ",".charCodeAt(0);
3013
- var semicolon = ";".charCodeAt(0);
3014
- var chars$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
3015
- var intToChar = new Uint8Array(64);
3016
- var charToInt = new Uint8Array(128);
3017
- for (let i$1 = 0; i$1 < chars$1.length; i$1++) {
3018
- const c = chars$1.charCodeAt(i$1);
3019
- intToChar[i$1] = c;
3020
- charToInt[c] = i$1;
3021
- }
3022
- function encodeInteger(builder, num, relative$3) {
3023
- let delta = num - relative$3;
3024
- delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
3025
- do {
3026
- let clamped = delta & 31;
3027
- delta >>>= 5;
3028
- if (delta > 0) clamped |= 32;
3029
- builder.write(intToChar[clamped]);
3030
- } while (delta > 0);
3031
- return num;
3032
- }
3033
- var bufLength = 1024 * 16;
3034
- var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
3035
- const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
3036
- return out.toString();
3037
- } } : { decode(buf) {
3038
- let out = "";
3039
- for (let i$1 = 0; i$1 < buf.length; i$1++) out += String.fromCharCode(buf[i$1]);
3040
- return out;
3041
- } };
3042
- var StringWriter = class {
3043
- constructor() {
3044
- this.pos = 0;
3045
- this.out = "";
3046
- this.buffer = new Uint8Array(bufLength);
3047
- }
3048
- write(v) {
3049
- const { buffer } = this;
3050
- buffer[this.pos++] = v;
3051
- if (this.pos === bufLength) {
3052
- this.out += td.decode(buffer);
3053
- this.pos = 0;
3054
- }
3055
- }
3056
- flush() {
3057
- const { buffer, out, pos } = this;
3058
- return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
3059
- }
3060
- };
3061
- function encode$1(decoded) {
3062
- const writer = new StringWriter();
3063
- let sourcesIndex = 0;
3064
- let sourceLine = 0;
3065
- let sourceColumn = 0;
3066
- let namesIndex = 0;
3067
- for (let i$1 = 0; i$1 < decoded.length; i$1++) {
3068
- const line = decoded[i$1];
3069
- if (i$1 > 0) writer.write(semicolon);
3070
- if (line.length === 0) continue;
3071
- let genColumn = 0;
3072
- for (let j = 0; j < line.length; j++) {
3073
- const segment = line[j];
3074
- if (j > 0) writer.write(comma);
3075
- genColumn = encodeInteger(writer, segment[0], genColumn);
3076
- if (segment.length === 1) continue;
3077
- sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
3078
- sourceLine = encodeInteger(writer, segment[2], sourceLine);
3079
- sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
3080
- if (segment.length === 4) continue;
3081
- namesIndex = encodeInteger(writer, segment[4], namesIndex);
3082
- }
3083
- }
3084
- return writer.flush();
3085
- }
3086
-
3087
- //#endregion
3088
- //#region ../../node_modules/.pnpm/magic-string@0.30.18/node_modules/magic-string/dist/magic-string.es.mjs
2982
+ //#region ../../node_modules/.pnpm/magic-string@0.30.19/node_modules/magic-string/dist/magic-string.es.mjs
3089
2983
  var BitSet = class BitSet {
3090
2984
  constructor(arg) {
3091
2985
  this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
@@ -3540,6 +3434,7 @@ var MagicString = class MagicString {
3540
3434
  else mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
3541
3435
  if (chunk.outro.length) mappings.advance(chunk.outro);
3542
3436
  });
3437
+ if (this.outro) mappings.advance(this.outro);
3543
3438
  return {
3544
3439
  file: options$1.file ? options$1.file.split(/[/\\]/).pop() : void 0,
3545
3440
  sources: [options$1.source ? getRelativePath(options$1.file || "", options$1.source) : options$1.file || ""],
@@ -3576,12 +3471,9 @@ var MagicString = class MagicString {
3576
3471
  if (indentStr === "") return this;
3577
3472
  options$1 = options$1 || {};
3578
3473
  const isExcluded = {};
3579
- if (options$1.exclude) {
3580
- const exclusions = typeof options$1.exclude[0] === "number" ? [options$1.exclude] : options$1.exclude;
3581
- exclusions.forEach((exclusion) => {
3582
- for (let i$1 = exclusion[0]; i$1 < exclusion[1]; i$1 += 1) isExcluded[i$1] = true;
3583
- });
3584
- }
3474
+ if (options$1.exclude) (typeof options$1.exclude[0] === "number" ? [options$1.exclude] : options$1.exclude).forEach((exclusion) => {
3475
+ for (let i$1 = exclusion[0]; i$1 < exclusion[1]; i$1 += 1) isExcluded[i$1] = true;
3476
+ });
3585
3477
  let shouldIndentNextCharacter = options$1.indentStart !== false;
3586
3478
  const replacer = (match) => {
3587
3479
  if (shouldIndentNextCharacter) return `${indentStr}${match}`;
@@ -3966,8 +3858,7 @@ var MagicString = class MagicString {
3966
3858
  if (typeof replacement === "string") return replacement.replace(/\$(\$|&|\d+)/g, (_, i$1) => {
3967
3859
  if (i$1 === "$") return "$";
3968
3860
  if (i$1 === "&") return match[0];
3969
- const num = +i$1;
3970
- if (num < match.length) return match[+i$1];
3861
+ if (+i$1 < match.length) return match[+i$1];
3971
3862
  return `$${i$1}`;
3972
3863
  });
3973
3864
  else return replacement(...match, match.index, str, match.groups);
@@ -3978,15 +3869,13 @@ var MagicString = class MagicString {
3978
3869
  while (match = re.exec(str)) matches$2.push(match);
3979
3870
  return matches$2;
3980
3871
  }
3981
- if (searchValue.global) {
3982
- const matches$2 = matchAll$1(searchValue, this.original);
3983
- matches$2.forEach((match) => {
3984
- if (match.index != null) {
3985
- const replacement$1 = getReplacement(match, this.original);
3986
- if (replacement$1 !== match[0]) this.overwrite(match.index, match.index + match[0].length, replacement$1);
3987
- }
3988
- });
3989
- } else {
3872
+ if (searchValue.global) matchAll$1(searchValue, this.original).forEach((match) => {
3873
+ if (match.index != null) {
3874
+ const replacement$1 = getReplacement(match, this.original);
3875
+ if (replacement$1 !== match[0]) this.overwrite(match.index, match.index + match[0].length, replacement$1);
3876
+ }
3877
+ });
3878
+ else {
3990
3879
  const match = this.original.match(searchValue);
3991
3880
  if (match && match.index != null) {
3992
3881
  const replacement$1 = getReplacement(match, this.original);
@@ -3998,7 +3887,10 @@ var MagicString = class MagicString {
3998
3887
  _replaceString(string, replacement) {
3999
3888
  const { original } = this;
4000
3889
  const index = original.indexOf(string);
4001
- if (index !== -1) this.overwrite(index, index + string.length, replacement);
3890
+ if (index !== -1) {
3891
+ if (typeof replacement === "function") replacement = replacement(string, index, original);
3892
+ if (string !== replacement) this.overwrite(index, index + string.length, replacement);
3893
+ }
4002
3894
  return this;
4003
3895
  }
4004
3896
  replace(searchValue, replacement) {
@@ -4010,7 +3902,9 @@ var MagicString = class MagicString {
4010
3902
  const stringLength = string.length;
4011
3903
  for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
4012
3904
  const previous = original.slice(index, index + stringLength);
4013
- if (previous !== replacement) this.overwrite(index, index + stringLength, replacement);
3905
+ let _replacement = replacement;
3906
+ if (typeof replacement === "function") _replacement = replacement(previous, index, original);
3907
+ if (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement);
4014
3908
  }
4015
3909
  return this;
4016
3910
  }
@@ -4067,8 +3961,7 @@ function tryParse(parse$17, code, id) {
4067
3961
  const firstpassGlobal = /\b(?:require|module|exports|global)\b/;
4068
3962
  const firstpassNoGlobal = /\b(?:require|module|exports)\b/;
4069
3963
  function hasCjsKeywords(code, ignoreGlobal) {
4070
- const firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;
4071
- return firstpass.test(code);
3964
+ return (ignoreGlobal ? firstpassNoGlobal : firstpassGlobal).test(code);
4072
3965
  }
4073
3966
  function analyzeTopLevelStatements(parse$17, code, id) {
4074
3967
  const ast = tryParse(parse$17, code, id);
@@ -4404,18 +4297,15 @@ function resolveExtensions(importee, importer, extensions$1) {
4404
4297
  const resolved = resolve$1(dirname$1(importer), importee);
4405
4298
  const candidates = getCandidates(resolved, extensions$1);
4406
4299
  for (let i$1 = 0; i$1 < candidates.length; i$1 += 1) try {
4407
- const stats = statSync(candidates[i$1]);
4408
- if (stats.isFile()) return { id: candidates[i$1] };
4300
+ if (statSync(candidates[i$1]).isFile()) return { id: candidates[i$1] };
4409
4301
  } catch (err$2) {}
4410
- return void 0;
4411
4302
  }
4412
4303
  function getResolveId(extensions$1, isPossibleCjsId) {
4413
4304
  const currentlyResolving = /* @__PURE__ */ new Map();
4414
4305
  return {
4415
4306
  currentlyResolving,
4416
4307
  async resolveId(importee, importer, resolveOptions) {
4417
- const customOptions = resolveOptions.custom;
4418
- if (customOptions?.["node-resolve"]?.isRequire) return null;
4308
+ if (resolveOptions.custom?.["node-resolve"]?.isRequire) return null;
4419
4309
  const currentlyResolvingForParent = currentlyResolving.get(importer);
4420
4310
  if (currentlyResolvingForParent && currentlyResolvingForParent.has(importee)) {
4421
4311
  this.warn({
@@ -4814,8 +4704,7 @@ function collectSources(requireExpressions) {
4814
4704
  for (const requireExpression of requireExpressions) {
4815
4705
  const { sourceId } = requireExpression;
4816
4706
  if (!requiresBySource[sourceId]) requiresBySource[sourceId] = [];
4817
- const requires = requiresBySource[sourceId];
4818
- requires.push(requireExpression);
4707
+ requiresBySource[sourceId].push(requireExpression);
4819
4708
  }
4820
4709
  return requiresBySource;
4821
4710
  }
@@ -4961,8 +4850,7 @@ async function transformCommonjs(parse$17, code, id, isEsModule, ignoreGlobal, i
4961
4850
  if (isDynamicRequireModulesEnabled && node.callee.object && isRequire(node.callee.object, scope) && node.callee.property.name === "resolve") {
4962
4851
  checkDynamicRequire(node.start);
4963
4852
  uses.require = true;
4964
- const requireNode = node.callee.object;
4965
- replacedDynamicRequires.push(requireNode);
4853
+ replacedDynamicRequires.push(node.callee.object);
4966
4854
  skippedNodes.add(node.callee);
4967
4855
  return;
4968
4856
  }
@@ -4980,9 +4868,7 @@ async function transformCommonjs(parse$17, code, id, isEsModule, ignoreGlobal, i
4980
4868
  }
4981
4869
  const requireStringArg = getRequireStringArg(node);
4982
4870
  if (!ignoreRequire(requireStringArg)) {
4983
- const usesReturnValue = parent.type !== "ExpressionStatement";
4984
- const toBeRemoved = parent.type === "ExpressionStatement" && (!currentConditionalNodeEnd || currentTryBlockEnd !== null && currentTryBlockEnd < currentConditionalNodeEnd) ? parent : node;
4985
- addRequireExpression(requireStringArg, node, scope, usesReturnValue, currentTryBlockEnd !== null, currentConditionalNodeEnd !== null, toBeRemoved);
4871
+ addRequireExpression(requireStringArg, node, scope, parent.type !== "ExpressionStatement", currentTryBlockEnd !== null, currentConditionalNodeEnd !== null, parent.type === "ExpressionStatement" && (!currentConditionalNodeEnd || currentTryBlockEnd !== null && currentTryBlockEnd < currentConditionalNodeEnd) ? parent : node);
4986
4872
  if (parent.type === "VariableDeclarator" && parent.id.type === "Identifier") for (const name of extractAssignedNames(parent.id)) importedVariables.add(name);
4987
4873
  }
4988
4874
  return;
@@ -5478,8 +5364,7 @@ function buildReporterPlugin(config$2) {
5478
5364
  const module$1 = this.getModuleInfo(id);
5479
5365
  if (!module$1) continue;
5480
5366
  if (module$1.importers.length && module$1.dynamicImporters.length) {
5481
- const detectedIneffectiveDynamicImport = module$1.dynamicImporters.some((id$1) => !isInNodeModules(id$1) && chunk.moduleIds.includes(id$1));
5482
- if (detectedIneffectiveDynamicImport) 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`);
5367
+ 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`);
5483
5368
  }
5484
5369
  }
5485
5370
  chunksReporter(this).register();
@@ -5525,13 +5410,12 @@ const TS_EXTENSIONS = [
5525
5410
  ".mts",
5526
5411
  ".cts"
5527
5412
  ];
5528
- const JS_EXTENSIONS = [
5413
+ const TSJS_EXTENSIONS = TS_EXTENSIONS.concat([
5529
5414
  ".js",
5530
5415
  ".jsx",
5531
5416
  ".mjs",
5532
5417
  ".cjs"
5533
- ];
5534
- const TSJS_EXTENSIONS = TS_EXTENSIONS.concat(JS_EXTENSIONS);
5418
+ ]);
5535
5419
  const TS_EXTENSIONS_RE_GROUP = `\\.(?:${TS_EXTENSIONS.map((ext) => ext.substring(1)).join("|")})`;
5536
5420
  const TSJS_EXTENSIONS_RE_GROUP = `\\.(?:${TSJS_EXTENSIONS.map((ext) => ext.substring(1)).join("|")})`;
5537
5421
  const IS_POSIX = path.posix.sep === path.sep;
@@ -5541,12 +5425,11 @@ const IS_POSIX = path.posix.sep === path.sep;
5541
5425
  */
5542
5426
  function makePromise() {
5543
5427
  let resolve$4, reject;
5544
- const promise = new Promise((res, rej) => {
5545
- resolve$4 = res;
5546
- reject = rej;
5547
- });
5548
5428
  return {
5549
- promise,
5429
+ promise: new Promise((res, rej) => {
5430
+ resolve$4 = res;
5431
+ reject = rej;
5432
+ }),
5550
5433
  resolve: resolve$4,
5551
5434
  reject
5552
5435
  };
@@ -5622,9 +5505,7 @@ function resolveReferencedTSConfigFiles(result, options$1) {
5622
5505
  * @returns {import('./public.d.ts').TSConfckParseResult}
5623
5506
  */
5624
5507
  function resolveSolutionTSConfig(filename, result) {
5625
- const allowJs = result.tsconfig.compilerOptions?.allowJs;
5626
- const extensions$1 = allowJs ? TSJS_EXTENSIONS : TS_EXTENSIONS;
5627
- if (result.referenced && extensions$1.some((ext) => filename.endsWith(ext)) && !isIncluded(filename, result)) {
5508
+ if (result.referenced && (result.tsconfig.compilerOptions?.allowJs ? TSJS_EXTENSIONS : TS_EXTENSIONS).some((ext) => filename.endsWith(ext)) && !isIncluded(filename, result)) {
5628
5509
  const solutionTSConfig = result.referenced.find((referenced) => isIncluded(filename, referenced));
5629
5510
  if (solutionTSConfig) return solutionTSConfig;
5630
5511
  }
@@ -5642,11 +5523,7 @@ function isIncluded(filename, result) {
5642
5523
  const absoluteFilename = resolve2posix(null, filename);
5643
5524
  if (files.includes(filename)) return true;
5644
5525
  const allowJs = result.tsconfig.compilerOptions?.allowJs;
5645
- const isIncluded$1 = isGlobMatch(absoluteFilename, dir, result.tsconfig.include || (result.tsconfig.files ? [] : [GLOB_ALL_PATTERN]), allowJs);
5646
- if (isIncluded$1) {
5647
- const isExcluded = isGlobMatch(absoluteFilename, dir, result.tsconfig.exclude || [], allowJs);
5648
- return !isExcluded;
5649
- }
5526
+ if (isGlobMatch(absoluteFilename, dir, result.tsconfig.include || (result.tsconfig.files ? [] : [GLOB_ALL_PATTERN]), allowJs)) return !isGlobMatch(absoluteFilename, dir, result.tsconfig.exclude || [], allowJs);
5650
5527
  return false;
5651
5528
  }
5652
5529
  /**
@@ -5803,19 +5680,6 @@ function findUp(dir, { resolve: resolve$4, reject, promise }, options$1) {
5803
5680
  });
5804
5681
  }
5805
5682
 
5806
- //#endregion
5807
- //#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.2/node_modules/tsconfck/src/find-all.js
5808
- /**
5809
- * @typedef WalkState
5810
- * @interface
5811
- * @property {string[]} files - files
5812
- * @property {number} calls - number of ongoing calls
5813
- * @property {(dir: string)=>boolean} skip - function to skip dirs
5814
- * @property {boolean} err - error flag
5815
- * @property {string[]} configNames - config file names
5816
- */
5817
- const sep$3 = path.sep;
5818
-
5819
5683
  //#endregion
5820
5684
  //#region ../../node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.2/node_modules/tsconfck/src/to-json.js
5821
5685
  /**
@@ -5844,8 +5708,7 @@ function stripDanglingComma(pseudoJson) {
5844
5708
  for (let i$1 = 0; i$1 < pseudoJson.length; i$1++) {
5845
5709
  const currentCharacter = pseudoJson[i$1];
5846
5710
  if (currentCharacter === "\"") {
5847
- const escaped$1 = isEscaped(pseudoJson, i$1);
5848
- if (!escaped$1) insideString = !insideString;
5711
+ if (!isEscaped(pseudoJson, i$1)) insideString = !insideString;
5849
5712
  }
5850
5713
  if (insideString) {
5851
5714
  danglingCommaPos = null;
@@ -5905,8 +5768,7 @@ function stripJsonComments(jsonString) {
5905
5768
  const currentCharacter = jsonString[index];
5906
5769
  const nextCharacter = jsonString[index + 1];
5907
5770
  if (!isInsideComment && currentCharacter === "\"") {
5908
- const escaped$1 = isEscaped(jsonString, index);
5909
- if (!escaped$1) isInsideString = !isInsideString;
5771
+ if (!isEscaped(jsonString, index)) isInsideString = !isInsideString;
5910
5772
  }
5911
5773
  if (isInsideString) continue;
5912
5774
  if (!isInsideComment && currentCharacter + nextCharacter === "//") {
@@ -6450,8 +6312,7 @@ async function transformWithEsbuild(code, filename, options$1, inMap, config$2,
6450
6312
  }
6451
6313
  }
6452
6314
  function esbuildPlugin(config$2) {
6453
- const options$1 = config$2.esbuild;
6454
- const { jsxInject, include, exclude,...esbuildTransformOptions } = options$1;
6315
+ const { jsxInject, include, exclude,...esbuildTransformOptions } = config$2.esbuild;
6455
6316
  const filter$1 = createFilter(include || /\.(m?ts|[jt]sx)$/, exclude || /\.js$/);
6456
6317
  const transformOptions = {
6457
6318
  target: "esnext",
@@ -6494,6 +6355,14 @@ const rollupToEsbuildFormatMap = {
6494
6355
  cjs: "cjs",
6495
6356
  iife: void 0
6496
6357
  };
6358
+ const injectEsbuildHelpers = (esbuildCode, format$3) => {
6359
+ const contentIndex = format$3 === "iife" ? Math.max(esbuildCode.search(IIFE_BEGIN_RE), 0) : format$3 === "umd" ? esbuildCode.indexOf(`(function(`) : 0;
6360
+ if (contentIndex > 0) {
6361
+ const esbuildHelpers = esbuildCode.slice(0, contentIndex);
6362
+ return esbuildCode.slice(contentIndex).replace("\"use strict\";", (m$2) => m$2 + esbuildHelpers);
6363
+ }
6364
+ return esbuildCode;
6365
+ };
6497
6366
  const buildEsbuildPlugin = () => {
6498
6367
  return {
6499
6368
  name: "vite:esbuild-transpile",
@@ -6506,14 +6375,7 @@ const buildEsbuildPlugin = () => {
6506
6375
  const options$1 = resolveEsbuildTranspileOptions(config$2, opts.format);
6507
6376
  if (!options$1) return null;
6508
6377
  const res = await transformWithEsbuild(code, chunk.fileName, options$1, void 0, config$2);
6509
- if (config$2.build.lib) {
6510
- const esbuildCode = res.code;
6511
- const contentIndex = opts.format === "iife" ? Math.max(esbuildCode.search(IIFE_BEGIN_RE), 0) : opts.format === "umd" ? esbuildCode.indexOf(`(function(`) : 0;
6512
- if (contentIndex > 0) {
6513
- const esbuildHelpers = esbuildCode.slice(0, contentIndex);
6514
- res.code = esbuildCode.slice(contentIndex).replace(`"use strict";`, `"use strict";` + esbuildHelpers);
6515
- }
6516
- }
6378
+ if (config$2.build.lib) res.code = injectEsbuildHelpers(res.code, opts.format);
6517
6379
  return res;
6518
6380
  }
6519
6381
  };
@@ -6714,8 +6576,8 @@ var Worker$1 = class {
6714
6576
  }
6715
6577
  let resolve$4;
6716
6578
  let reject;
6717
- const onWorkerAvailablePromise = new Promise((r$2, rj) => {
6718
- resolve$4 = r$2;
6579
+ const onWorkerAvailablePromise = new Promise((r$1, rj) => {
6580
+ resolve$4 = r$1;
6719
6581
  reject = rj;
6720
6582
  });
6721
6583
  this._queue.push([resolve$4, reject]);
@@ -6982,7 +6844,7 @@ function terserPlugin(config$2) {
6982
6844
  }
6983
6845
  }, {
6984
6846
  shouldUseFake(_terserPath, _code, options$1) {
6985
- return !!(typeof options$1.mangle === "object" && (options$1.mangle.nth_identifier?.get || typeof options$1.mangle.properties === "object" && options$1.mangle.properties.nth_identifier?.get) || typeof options$1.format?.comments === "function" || typeof options$1.output?.comments === "function");
6847
+ return !!(typeof options$1.mangle === "object" && (options$1.mangle.nth_identifier?.get || typeof options$1.mangle.properties === "object" && options$1.mangle.properties.nth_identifier?.get) || typeof options$1.format?.comments === "function" || typeof options$1.output?.comments === "function" || options$1.nameCache);
6986
6848
  },
6987
6849
  max: maxWorkers
6988
6850
  });
@@ -7560,8 +7422,7 @@ function assetPlugin(config$2) {
7560
7422
  },
7561
7423
  resolveId: { handler(id) {
7562
7424
  if (!config$2.assetsInclude(cleanUrl(id)) && !urlRE.test(id)) return;
7563
- const publicFile = checkPublicFile(id, config$2);
7564
- if (publicFile) return id;
7425
+ if (checkPublicFile(id, config$2)) return id;
7565
7426
  } },
7566
7427
  load: {
7567
7428
  filter: { id: { exclude: /^\0/ } },
@@ -7726,10 +7587,7 @@ function shouldInline(environment, file, id, content, buildPluginContext, forceI
7726
7587
  function assetToDataURL(environment, file, content) {
7727
7588
  if (environment.config.build.lib && isGitLfsPlaceholder(content)) environment.logger.warn(import_picocolors$30.default.yellow(`Inlined file ${file} was not downloaded via Git LFS`));
7728
7589
  if (file.endsWith(".svg")) return svgToDataURL(content);
7729
- else {
7730
- const mimeType = lookup(file) ?? "application/octet-stream";
7731
- return `data:${mimeType};base64,${content.toString("base64")}`;
7732
- }
7590
+ else return `data:${lookup(file) ?? "application/octet-stream"};base64,${content.toString("base64")}`;
7733
7591
  }
7734
7592
  const nestedQuotesRE = /"[^"']*'[^"]*"|'[^'"]*"[^']*'/;
7735
7593
  function svgToDataURL(content) {
@@ -7831,8 +7689,7 @@ function manifestPlugin() {
7831
7689
  }
7832
7690
  state.outputCount++;
7833
7691
  const output = buildOptions.rollupOptions.output;
7834
- const outputLength = Array.isArray(output) ? output.length : 1;
7835
- if (state.outputCount >= outputLength) this.emitFile({
7692
+ if (state.outputCount >= (Array.isArray(output) ? output.length : 1)) this.emitFile({
7836
7693
  fileName: typeof buildOptions.manifest === "string" ? buildOptions.manifest : ".vite/manifest.json",
7837
7694
  type: "asset",
7838
7695
  source: JSON.stringify(sortObjectKeys(manifest), void 0, 2)
@@ -7875,8 +7732,7 @@ function dataURIPlugin() {
7875
7732
  if (!match) return;
7876
7733
  const [, mime, format$3, data] = match;
7877
7734
  if (mime !== "text/javascript") throw new Error(`data URI with non-JavaScript mime type is not supported. If you're using legacy JavaScript MIME types (such as 'application/javascript'), please use 'text/javascript' instead.`);
7878
- const base64 = format$3 && base64RE.test(format$3.substring(1));
7879
- const content = base64 ? Buffer.from(data, "base64").toString("utf-8") : data;
7735
+ const content = format$3 && base64RE.test(format$3.substring(1)) ? Buffer.from(data, "base64").toString("utf-8") : data;
7880
7736
  resolved.set(id, content);
7881
7737
  return dataUriPrefix + id;
7882
7738
  },
@@ -7986,8 +7842,8 @@ var require_convert_source_map = /* @__PURE__ */ __commonJS({ "../../node_module
7986
7842
  return sm.split(",").pop();
7987
7843
  }
7988
7844
  function readFromFileMap(sm, read) {
7989
- var r$2 = exports.mapFileCommentRegex.exec(sm);
7990
- var filename = r$2[1] || r$2[2];
7845
+ var r$1 = exports.mapFileCommentRegex.exec(sm);
7846
+ var filename = r$1[1] || r$1[2];
7991
7847
  try {
7992
7848
  var sm = read(filename);
7993
7849
  if (sm != null && typeof sm.catch === "function") return sm.catch(throwError);
@@ -8109,7 +7965,7 @@ var require_convert_source_map = /* @__PURE__ */ __commonJS({ "../../node_module
8109
7965
  }) });
8110
7966
 
8111
7967
  //#endregion
8112
- //#region ../../node_modules/.pnpm/@rolldown+pluginutils@1.0.0-beta.35/node_modules/@rolldown/pluginutils/dist/index.js
7968
+ //#region ../../node_modules/.pnpm/@rolldown+pluginutils@1.0.0-beta.38/node_modules/@rolldown/pluginutils/dist/index.mjs
8113
7969
  /**
8114
7970
  * Constructs a RegExp that matches the exact string specified.
8115
7971
  *
@@ -8287,12 +8143,7 @@ var require_src$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/lilco
8287
8143
  /** @type {import('./index').Loader} */
8288
8144
  const dynamicImport = async (id) => {
8289
8145
  try {
8290
- const fileUrl = url$2.pathToFileURL(id).href;
8291
- const mod = await import(
8292
- /* webpackIgnore: true */
8293
- fileUrl
8294
- );
8295
- return mod.default;
8146
+ return (await import(url$2.pathToFileURL(id).href)).default;
8296
8147
  } catch (e$1) {
8297
8148
  try {
8298
8149
  return requireFunc(id);
@@ -8377,10 +8228,10 @@ var require_src$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/lilco
8377
8228
  let dir = searchFrom;
8378
8229
  dirLoop: while (true) {
8379
8230
  if (cache$1) {
8380
- const r$2 = searchCache.get(dir);
8381
- if (r$2 !== void 0) {
8382
- for (const p of visited) searchCache.set(p, r$2);
8383
- return r$2;
8231
+ const r$1 = searchCache.get(dir);
8232
+ if (r$1 !== void 0) {
8233
+ for (const p of visited) searchCache.set(p, r$1);
8234
+ return r$1;
8384
8235
  }
8385
8236
  visited.add(dir);
8386
8237
  }
@@ -8489,10 +8340,10 @@ var require_src$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/lilco
8489
8340
  let dir = searchFrom;
8490
8341
  dirLoop: while (true) {
8491
8342
  if (cache$1) {
8492
- const r$2 = searchCache.get(dir);
8493
- if (r$2 !== void 0) {
8494
- for (const p of visited) searchCache.set(p, r$2);
8495
- return r$2;
8343
+ const r$1 = searchCache.get(dir);
8344
+ if (r$1 !== void 0) {
8345
+ for (const p of visited) searchCache.set(p, r$1);
8346
+ return r$1;
8496
8347
  }
8497
8348
  visited.add(dir);
8498
8349
  }
@@ -8929,8 +8780,7 @@ function alias(options$1 = {}) {
8929
8780
  //#region src/node/plugins/json.ts
8930
8781
  const jsonExtRE = /\.json(?:$|\?)(?!commonjs-(?:proxy|external))/;
8931
8782
  const jsonObjRE = /^\s*\{/;
8932
- const jsonLangs = `\\.(?:json|json5)(?:$|\\?)`;
8933
- const jsonLangRE = new RegExp(jsonLangs);
8783
+ const jsonLangRE = new RegExp(`\\.(?:json|json5)(?:$|\\?)`);
8934
8784
  const isJSONRequest = (request) => jsonLangRE.test(request);
8935
8785
  function jsonPlugin(options$1, isBuild) {
8936
8786
  return {
@@ -8998,40 +8848,40 @@ function extractJsonErrorPosition(errorMessage, inputLength) {
8998
8848
 
8999
8849
  //#endregion
9000
8850
  //#region ../../node_modules/.pnpm/resolve.exports@2.0.3/node_modules/resolve.exports/dist/index.mjs
9001
- function e(e$1, n$2, r$2) {
9002
- throw new Error(r$2 ? `No known conditions for "${n$2}" specifier in "${e$1}" package` : `Missing "${n$2}" specifier in "${e$1}" package`);
8851
+ function e(e$1, n$2, r$1) {
8852
+ throw new Error(r$1 ? `No known conditions for "${n$2}" specifier in "${e$1}" package` : `Missing "${n$2}" specifier in "${e$1}" package`);
9003
8853
  }
9004
8854
  function n(n$2, i$1, o$1, f$1) {
9005
- let s$2, u, l = r$1(n$2, o$1), c = function(e$1) {
8855
+ let s$2, u, l = r(n$2, o$1), c = function(e$1) {
9006
8856
  let n$3 = new Set(["default", ...e$1.conditions || []]);
9007
8857
  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;
9008
8858
  }(f$1 || {}), a = i$1[l];
9009
8859
  if (void 0 === a) {
9010
- let e$1, n$3, r$2, t$1;
9011
- 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$2 = t$1.indexOf("*", 1), ~r$2 && (e$1 = RegExp("^" + t$1.substring(0, r$2) + "(.*)" + t$1.substring(1 + r$2) + "$").exec(l), e$1 && e$1[1] && (u = e$1[1], n$3 = t$1))));
8860
+ let e$1, n$3, r$1, t$1;
8861
+ 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))));
9012
8862
  a = i$1[n$3];
9013
8863
  }
9014
8864
  return a || e(n$2, l), s$2 = t(a, c), s$2 || e(n$2, l, 1), u && function(e$1, n$3) {
9015
- let r$2, t$1 = 0, i$2 = e$1.length, o$2 = /[*]/g, f$2 = /[/]$/;
9016
- for (; t$1 < i$2; t$1++) e$1[t$1] = o$2.test(r$2 = e$1[t$1]) ? r$2.replace(o$2, n$3) : f$2.test(r$2) ? r$2 + n$3 : r$2;
8865
+ let r$1, t$1 = 0, i$2 = e$1.length, o$2 = /[*]/g, f$2 = /[/]$/;
8866
+ 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;
9017
8867
  }(s$2, u), s$2;
9018
8868
  }
9019
- function r$1(e$1, n$2, r$2) {
8869
+ function r(e$1, n$2, r$1) {
9020
8870
  if (e$1 === n$2 || "." === n$2) return ".";
9021
8871
  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;
9022
- return "#" === f$1[0] ? f$1 : o$1 || !r$2 ? "./" === f$1.slice(0, 2) ? f$1 : "./" + f$1 : f$1;
8872
+ return "#" === f$1[0] ? f$1 : o$1 || !r$1 ? "./" === f$1.slice(0, 2) ? f$1 : "./" + f$1 : f$1;
9023
8873
  }
9024
- function t(e$1, n$2, r$2) {
8874
+ function t(e$1, n$2, r$1) {
9025
8875
  if (e$1) {
9026
- if ("string" == typeof e$1) return r$2 && r$2.add(e$1), [e$1];
8876
+ if ("string" == typeof e$1) return r$1 && r$1.add(e$1), [e$1];
9027
8877
  let i$1, o$1;
9028
8878
  if (Array.isArray(e$1)) {
9029
- for (o$1 = r$2 || /* @__PURE__ */ new Set(), i$1 = 0; i$1 < e$1.length; i$1++) t(e$1[i$1], n$2, o$1);
9030
- if (!r$2 && o$1.size) return [...o$1];
9031
- } else for (i$1 in e$1) if (n$2.has(i$1)) return t(e$1[i$1], n$2, r$2);
8879
+ 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);
8880
+ if (!r$1 && o$1.size) return [...o$1];
8881
+ } else for (i$1 in e$1) if (n$2.has(i$1)) return t(e$1[i$1], n$2, r$1);
9032
8882
  }
9033
8883
  }
9034
- function o(e$1, r$2, t$1) {
8884
+ function o(e$1, r$1, t$1) {
9035
8885
  let i$1, o$1 = e$1.exports;
9036
8886
  if (o$1) {
9037
8887
  if ("string" == typeof o$1) o$1 = { ".": o$1 };
@@ -9039,16 +8889,15 @@ function o(e$1, r$2, t$1) {
9039
8889
  "." !== i$1[0] && (o$1 = { ".": o$1 });
9040
8890
  break;
9041
8891
  }
9042
- return n(e$1.name, o$1, r$2 || ".", t$1);
8892
+ return n(e$1.name, o$1, r$1 || ".", t$1);
9043
8893
  }
9044
8894
  }
9045
- function f(e$1, r$2, t$1) {
9046
- if (e$1.imports) return n(e$1.name, e$1.imports, r$2, t$1);
8895
+ function f(e$1, r$1, t$1) {
8896
+ if (e$1.imports) return n(e$1.name, e$1.imports, r$1, t$1);
9047
8897
  }
9048
8898
 
9049
8899
  //#endregion
9050
8900
  //#region ../../node_modules/.pnpm/ufo@1.6.1/node_modules/ufo/dist/index.mjs
9051
- const r = String.fromCharCode;
9052
8901
  const HASH_RE = /#/g;
9053
8902
  const AMPERSAND_RE = /&/g;
9054
8903
  const SLASH_RE = /\//g;
@@ -9296,8 +9145,7 @@ codes$1.ERR_INVALID_ARG_VALUE = createError(
9296
9145
  (name, value$1, reason = "is invalid") => {
9297
9146
  let inspected = inspect(value$1);
9298
9147
  if (inspected.length > 128) inspected = `${inspected.slice(0, 128)}...`;
9299
- const type = name.includes(".") ? "property" : "argument";
9300
- return `The ${type} '${name}' ${reason}. Received ${inspected}`;
9148
+ return `The ${name.includes(".") ? "property" : "argument"} '${name}' ${reason}. Received ${inspected}`;
9301
9149
  },
9302
9150
  TypeError
9303
9151
  );
@@ -9425,13 +9273,6 @@ function determineSpecificType(value$1) {
9425
9273
  if (inspected.length > 28) inspected = `${inspected.slice(0, 25)}...`;
9426
9274
  return `type ${typeof value$1} (${inspected})`;
9427
9275
  }
9428
- const hasOwnProperty$1 = {}.hasOwnProperty;
9429
- const { ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1 } = codes$1;
9430
- const { ERR_UNKNOWN_FILE_EXTENSION } = codes$1;
9431
- const hasOwnProperty$2 = {}.hasOwnProperty;
9432
- const RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
9433
- const { ERR_INVALID_MODULE_SPECIFIER, ERR_INVALID_PACKAGE_CONFIG, ERR_INVALID_PACKAGE_TARGET, ERR_MODULE_NOT_FOUND, ERR_PACKAGE_IMPORT_NOT_DEFINED, ERR_PACKAGE_PATH_NOT_EXPORTED, ERR_UNSUPPORTED_DIR_IMPORT, ERR_UNSUPPORTED_RESOLVE_REQUEST } = codes$1;
9434
- const own = {}.hasOwnProperty;
9435
9276
  const ESM_STATIC_IMPORT_RE = /(?<=\s|^|;|\})import\s*(?:[\s"']*(?<imports>[\p{L}\p{M}\w\t\n\r $*,/{}@.]+)from\s*)?["']\s*(?<specifier>(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][\s;]*/gmu;
9436
9277
  const TYPE_RE = /^\s*?type\s/;
9437
9278
  function parseStaticImport(matched) {
@@ -9505,8 +9346,7 @@ function esbuildDepPlugin(environment, qualified, external) {
9505
9346
  let _importer;
9506
9347
  if (resolveDir) _importer = normalizePath(path.join(resolveDir, "*"));
9507
9348
  else _importer = importer in qualified ? qualified[importer] : importer;
9508
- const resolver$1 = kind.startsWith("require") ? _resolveRequire : _resolve;
9509
- return resolver$1(environment, id, _importer);
9349
+ return (kind.startsWith("require") ? _resolveRequire : _resolve)(environment, id, _importer);
9510
9350
  };
9511
9351
  const resolveResult = (id, resolved) => {
9512
9352
  if (resolved.startsWith(browserExternalId)) return {
@@ -9732,8 +9572,7 @@ var BaseEnvironment = class extends PartialEnvironment {
9732
9572
  //#endregion
9733
9573
  //#region ../../node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js
9734
9574
  var require_js_tokens = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js": ((exports, module) => {
9735
- var HashbangComment, Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace, jsTokens$1;
9736
- RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]?|[^\/[\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/uy;
9575
+ var HashbangComment, Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]?|[^\/[\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/uy, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace;
9737
9576
  Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;
9738
9577
  Identifier = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/uy;
9739
9578
  StringLiteral = /(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y;
@@ -9753,7 +9592,7 @@ var require_js_tokens = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/j
9753
9592
  KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;
9754
9593
  KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/;
9755
9594
  Newline = RegExp(LineTerminatorSequence.source);
9756
- module.exports = jsTokens$1 = function* (input, { jsx = false } = {}) {
9595
+ module.exports = function* (input, { jsx = false } = {}) {
9757
9596
  var braces$2, firstCodePoint, isExpression, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack;
9758
9597
  ({length} = input);
9759
9598
  lastIndex = 0;
@@ -10106,7 +9945,6 @@ var require_js_tokens = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/j
10106
9945
  value: firstCodePoint
10107
9946
  };
10108
9947
  }
10109
- return void 0;
10110
9948
  };
10111
9949
  }) });
10112
9950
 
@@ -10300,8 +10138,7 @@ async function parseImportGlob(code, importer, root, resolveId, logger) {
10300
10138
  } catch {
10301
10139
  return [];
10302
10140
  }
10303
- const matches$2 = Array.from(cleanCode.matchAll(importGlobRE));
10304
- const tasks = matches$2.map(async (match, index) => {
10141
+ const tasks = Array.from(cleanCode.matchAll(importGlobRE)).map(async (match, index) => {
10305
10142
  const start = match.index;
10306
10143
  const err$2 = (msg) => {
10307
10144
  const e$1 = /* @__PURE__ */ new Error(`Invalid glob import syntax: ${msg}`);
@@ -10402,24 +10239,23 @@ async function transformGlobImport(code, id, root, resolveId, restoreQueryExtens
10402
10239
  if (!options$1.base && isRelative$1) throw new Error("In virtual modules, all globs must start with '/'");
10403
10240
  const importPath$1 = `/${relative$2(root, file)}`;
10404
10241
  let filePath$1 = options$1.base ? `${relative$2(posix.join(root, options$1.base), file)}` : importPath$1;
10405
- if (options$1.base && filePath$1[0] !== ".") filePath$1 = `./${filePath$1}`;
10242
+ if (options$1.base && !filePath$1.startsWith("./") && !filePath$1.startsWith("../")) filePath$1 = `./${filePath$1}`;
10406
10243
  return {
10407
10244
  filePath: filePath$1,
10408
10245
  importPath: importPath$1
10409
10246
  };
10410
10247
  }
10411
10248
  let importPath = relative$2(dir, file);
10412
- if (importPath[0] !== ".") importPath = `./${importPath}`;
10249
+ if (!importPath.startsWith("./") && !importPath.startsWith("../")) importPath = `./${importPath}`;
10413
10250
  let filePath;
10414
10251
  if (options$1.base) {
10415
- const resolvedBasePath = options$1.base[0] === "/" ? root : dir;
10416
- filePath = relative$2(posix.join(resolvedBasePath, options$1.base), file);
10417
- if (filePath[0] !== ".") filePath = `./${filePath}`;
10252
+ filePath = relative$2(posix.join(options$1.base[0] === "/" ? root : dir, options$1.base), file);
10253
+ if (!filePath.startsWith("./") && !filePath.startsWith("../")) filePath = `./${filePath}`;
10418
10254
  if (options$1.base[0] === "/") importPath = `/${relative$2(root, file)}`;
10419
10255
  } else if (isRelative$1) filePath = importPath;
10420
10256
  else {
10421
10257
  filePath = relative$2(root, file);
10422
- if (filePath[0] !== ".") filePath = `/${filePath}`;
10258
+ if (!filePath.startsWith("./") && !filePath.startsWith("../")) filePath = `/${filePath}`;
10423
10259
  }
10424
10260
  return {
10425
10261
  filePath,
@@ -10704,11 +10540,10 @@ async function globEntries(patterns, environment) {
10704
10540
  cwd: environment.config.root,
10705
10541
  ignore: [`**/${environment.config.build.outDir}/**`, ...environment.config.optimizeDeps.entries ? [] : [`**/__tests__/**`, `**/coverage/**`]]
10706
10542
  };
10707
- const results = await Promise.all([glob(nodeModulesPatterns, sharedOptions), glob(regularPatterns, {
10543
+ return (await Promise.all([glob(nodeModulesPatterns, sharedOptions), glob(regularPatterns, {
10708
10544
  ...sharedOptions,
10709
10545
  ignore: [...sharedOptions.ignore, "**/node_modules/**"]
10710
- })]);
10711
- return results.flat();
10546
+ })])).flat();
10712
10547
  }
10713
10548
  const scriptRE = /(<script(?:\s+[a-z_:][-\w:]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^"'<>=\s]+))?)*\s*>)(.*?)<\/script>/gis;
10714
10549
  const commentRE$1 = /<!--.*?-->/gs;
@@ -10725,8 +10560,7 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
10725
10560
  const resolve$4 = async (id, importer) => {
10726
10561
  const key = id + (importer && path.dirname(importer));
10727
10562
  if (seen$1.has(key)) return seen$1.get(key);
10728
- const resolved = await resolveId(id, importer);
10729
- const res = resolved?.id;
10563
+ const res = (await resolveId(id, importer))?.id;
10730
10564
  seen$1.set(key, res);
10731
10565
  return res;
10732
10566
  };
@@ -10746,8 +10580,7 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
10746
10580
  let transpiledContents;
10747
10581
  if (loader$1 !== "js") transpiledContents = (await transform(contents, { loader: loader$1 })).code;
10748
10582
  else transpiledContents = contents;
10749
- const result = await transformGlobImport(transpiledContents, id, environment.config.root, resolve$4);
10750
- return result?.s.toString() || transpiledContents;
10583
+ return (await transformGlobImport(transpiledContents, id, environment.config.root, resolve$4))?.s.toString() || transpiledContents;
10751
10584
  };
10752
10585
  return {
10753
10586
  name: "vite:dep-scan",
@@ -10824,8 +10657,7 @@ function esbuildScanPlugin(environment, depImports, missing, entries) {
10824
10657
  let isModule = svelteModuleRE.test(openTag);
10825
10658
  if (!isModule) {
10826
10659
  const contextMatch = svelteScriptModuleRE.exec(openTag);
10827
- const context = contextMatch && (contextMatch[1] || contextMatch[2] || contextMatch[3]);
10828
- isModule = context === "module";
10660
+ isModule = (contextMatch && (contextMatch[1] || contextMatch[2] || contextMatch[3])) === "module";
10829
10661
  }
10830
10662
  if (!isModule) {
10831
10663
  addedImport = true;
@@ -11256,17 +11088,13 @@ function runOptimizeDeps(environment, depsInfo) {
11256
11088
  needsInterop: false,
11257
11089
  browserHash: metadata.browserHash
11258
11090
  });
11259
- } else {
11260
- const output = meta.outputs[o$1];
11261
- if (output.bytes === 93) {
11262
- const jsMapPath = path.resolve(o$1);
11263
- const jsPath = jsMapPath.slice(0, -4);
11264
- if (fs.existsSync(jsPath) && fs.existsSync(jsMapPath)) {
11265
- const map$1 = JSON.parse(fs.readFileSync(jsMapPath, "utf-8"));
11266
- if (map$1.sources.length === 0) {
11267
- const js = fs.readFileSync(jsPath, "utf-8");
11268
- fs.writeFileSync(jsPath, js.slice(0, js.lastIndexOf("//# sourceMappingURL=")));
11269
- }
11091
+ } else if (meta.outputs[o$1].bytes === 93) {
11092
+ const jsMapPath = path.resolve(o$1);
11093
+ const jsPath = jsMapPath.slice(0, -4);
11094
+ if (fs.existsSync(jsPath) && fs.existsSync(jsMapPath)) {
11095
+ if (JSON.parse(fs.readFileSync(jsMapPath, "utf-8")).sources.length === 0) {
11096
+ const js = fs.readFileSync(jsPath, "utf-8");
11097
+ fs.writeFileSync(jsPath, js.slice(0, js.lastIndexOf("//# sourceMappingURL=")));
11270
11098
  }
11271
11099
  }
11272
11100
  }
@@ -11326,32 +11154,31 @@ async function prepareEsbuildOptimizerRun(environment, depsInfo, processingCache
11326
11154
  const plugins$1 = [...pluginsFromConfig];
11327
11155
  if (external.length) plugins$1.push(esbuildCjsExternalPlugin(external, platform$2));
11328
11156
  plugins$1.push(esbuildDepPlugin(environment, flatIdDeps, external));
11329
- const context = await esbuild.context({
11330
- absWorkingDir: process.cwd(),
11331
- entryPoints: Object.keys(flatIdDeps),
11332
- bundle: true,
11333
- platform: platform$2,
11334
- define: define$1,
11335
- format: "esm",
11336
- banner: platform$2 === "node" ? { js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);` } : void 0,
11337
- target: ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET,
11338
- external,
11339
- logLevel: "error",
11340
- splitting: true,
11341
- sourcemap: true,
11342
- outdir: processingCacheDir,
11343
- ignoreAnnotations: true,
11344
- metafile: true,
11345
- plugins: plugins$1,
11346
- charset: "utf8",
11347
- ...esbuildOptions,
11348
- supported: {
11349
- ...defaultEsbuildSupported,
11350
- ...esbuildOptions.supported
11351
- }
11352
- });
11353
11157
  return {
11354
- context,
11158
+ context: await esbuild.context({
11159
+ absWorkingDir: process.cwd(),
11160
+ entryPoints: Object.keys(flatIdDeps),
11161
+ bundle: true,
11162
+ platform: platform$2,
11163
+ define: define$1,
11164
+ format: "esm",
11165
+ banner: platform$2 === "node" ? { js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);` } : void 0,
11166
+ target: ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET,
11167
+ external,
11168
+ logLevel: "error",
11169
+ splitting: true,
11170
+ sourcemap: true,
11171
+ outdir: processingCacheDir,
11172
+ ignoreAnnotations: true,
11173
+ metafile: true,
11174
+ plugins: plugins$1,
11175
+ charset: "utf8",
11176
+ ...esbuildOptions,
11177
+ supported: {
11178
+ ...defaultEsbuildSupported,
11179
+ ...esbuildOptions.supported
11180
+ }
11181
+ }),
11355
11182
  idToExports
11356
11183
  };
11357
11184
  }
@@ -11512,12 +11339,11 @@ async function extractExportsData(environment, filePath) {
11512
11339
  usedJsxLoader = true;
11513
11340
  }
11514
11341
  const [, exports$1, , hasModuleSyntax] = parseResult;
11515
- const exportsData = {
11342
+ return {
11516
11343
  hasModuleSyntax,
11517
11344
  exports: exports$1.map((e$1) => e$1.n),
11518
11345
  jsxLoader: usedJsxLoader
11519
11346
  };
11520
- return exportsData;
11521
11347
  }
11522
11348
  function needsInterop(environment, id, exportsData, output) {
11523
11349
  if (environment.config.optimizeDeps.needsInterop?.includes(id)) return true;
@@ -11618,9 +11444,8 @@ function getLockfileHash(environment) {
11618
11444
  function getDepHash(environment) {
11619
11445
  const lockfileHash = getLockfileHash(environment);
11620
11446
  const configHash = getConfigHash(environment);
11621
- const hash$1 = getHash(lockfileHash + configHash);
11622
11447
  return {
11623
- hash: hash$1,
11448
+ hash: getHash(lockfileHash + configHash),
11624
11449
  lockfileHash,
11625
11450
  configHash
11626
11451
  };
@@ -11788,10 +11613,7 @@ function resolvePlugin(resolveOptions) {
11788
11613
  if (resolveOpts.custom?.["vite:import-glob"]?.isSubImportsPattern) return normalizePath(path.join(root, id));
11789
11614
  }
11790
11615
  let res;
11791
- if (asSrc && depsOptimizer?.isOptimizedDepUrl(id)) {
11792
- const optimizedPath = id.startsWith(FS_PREFIX) ? fsPathFromId(id) : normalizePath(path.resolve(root, id.slice(1)));
11793
- return optimizedPath;
11794
- }
11616
+ if (asSrc && depsOptimizer?.isOptimizedDepUrl(id)) return id.startsWith(FS_PREFIX) ? fsPathFromId(id) : normalizePath(path.resolve(root, id.slice(1)));
11795
11617
  if (asSrc && id.startsWith(FS_PREFIX)) {
11796
11618
  res = fsPathFromId(id);
11797
11619
  debug$12?.(`[@fs] ${import_picocolors$25.default.cyan(id)} -> ${import_picocolors$25.default.dim(res)}`);
@@ -11925,8 +11747,7 @@ function resolveSubpathImports(id, importer, options$1) {
11925
11747
  }
11926
11748
  function ensureVersionQuery(resolved, id, options$1, depsOptimizer) {
11927
11749
  if (!options$1.isBuild && !options$1.scan && depsOptimizer && !(resolved === normalizedClientEntry$1 || resolved === normalizedEnvEntry$1)) {
11928
- const isNodeModule = isInNodeModules(id) || isInNodeModules(resolved);
11929
- if (isNodeModule && !DEP_VERSION_RE.test(resolved)) {
11750
+ if ((isInNodeModules(id) || isInNodeModules(resolved)) && !DEP_VERSION_RE.test(resolved)) {
11930
11751
  const versionHash = depsOptimizer.metadata.browserHash;
11931
11752
  if (versionHash && isOptimizable(resolved, depsOptimizer.options)) resolved = injectQuery(resolved, `v=${versionHash}`);
11932
11753
  }
@@ -12045,8 +11866,7 @@ function tryNodeResolve(id, importer, options$1, depsOptimizer, externalize) {
12045
11866
  if (!isInNodeModules(resolved) || !depsOptimizer || options$1.scan) return { id: resolved };
12046
11867
  const isJsType = isOptimizable(resolved, depsOptimizer.options);
12047
11868
  const exclude = depsOptimizer.options.exclude;
12048
- const skipOptimization = depsOptimizer.options.noDiscovery || !isJsType || importer && isInNodeModules(importer) || exclude?.includes(pkgId) || exclude?.includes(id) || SPECIAL_QUERY_RE.test(resolved);
12049
- if (skipOptimization) {
11869
+ if (depsOptimizer.options.noDiscovery || !isJsType || importer && isInNodeModules(importer) || exclude?.includes(pkgId) || exclude?.includes(id) || SPECIAL_QUERY_RE.test(resolved)) {
12050
11870
  const versionHash = depsOptimizer.metadata.browserHash;
12051
11871
  if (versionHash && isJsType) resolved = injectQuery(resolved, `v=${versionHash}`);
12052
11872
  } else {
@@ -12126,15 +11946,13 @@ function packageEntryFailure(id, details) {
12126
11946
  throw err$2;
12127
11947
  }
12128
11948
  function resolveExportsOrImports(pkg, key, options$1, type, externalize) {
12129
- const rawConditions = externalize ? options$1.externalConditions : options$1.conditions;
12130
- const conditions = rawConditions.map((condition) => {
11949
+ const conditions = (externalize ? options$1.externalConditions : options$1.conditions).map((condition) => {
12131
11950
  if (condition === DEV_PROD_CONDITION) return options$1.isProduction ? "production" : "development";
12132
11951
  return condition;
12133
11952
  });
12134
11953
  if (options$1.isRequire) conditions.push("require");
12135
11954
  else conditions.push("import");
12136
- const fn = type === "imports" ? f : o;
12137
- const result = fn(pkg, key, {
11955
+ const result = (type === "imports" ? f : o)(pkg, key, {
12138
11956
  conditions,
12139
11957
  unsafe: true
12140
11958
  });
@@ -12227,8 +12045,7 @@ function equalWithoutSuffix(path$13, key, suffix) {
12227
12045
  return key.endsWith(suffix) && key.slice(0, -suffix.length) === path$13;
12228
12046
  }
12229
12047
  function tryResolveRealFile(file, preserveSymlinks) {
12230
- const stat$4 = tryStatSync(file);
12231
- if (stat$4?.isFile()) return getRealPath(file, preserveSymlinks);
12048
+ if (tryStatSync(file)?.isFile()) return getRealPath(file, preserveSymlinks);
12232
12049
  }
12233
12050
  function tryResolveRealFileWithExtensions(filePath, extensions$1, preserveSymlinks) {
12234
12051
  for (const ext of extensions$1) {
@@ -12249,8 +12066,7 @@ function getRealPath(resolved, preserveSymlinks) {
12249
12066
  return normalizePath(resolved);
12250
12067
  }
12251
12068
  function isDirectory(path$13) {
12252
- const stat$4 = tryStatSync(path$13);
12253
- return stat$4?.isDirectory() ?? false;
12069
+ return tryStatSync(path$13)?.isDirectory() ?? false;
12254
12070
  }
12255
12071
 
12256
12072
  //#endregion
@@ -12264,12 +12080,10 @@ function optimizedDepsPlugin() {
12264
12080
  return !isDepOptimizationDisabled(environment.config.optimizeDeps);
12265
12081
  },
12266
12082
  resolveId(id) {
12267
- const environment = this.environment;
12268
- if (environment.depsOptimizer?.isOptimizedDepFile(id)) return id;
12083
+ if (this.environment.depsOptimizer?.isOptimizedDepFile(id)) return id;
12269
12084
  },
12270
12085
  async load(id) {
12271
- const environment = this.environment;
12272
- const depsOptimizer = environment.depsOptimizer;
12086
+ const depsOptimizer = this.environment.depsOptimizer;
12273
12087
  if (depsOptimizer?.isOptimizedDepFile(id)) {
12274
12088
  const metadata = depsOptimizer.metadata;
12275
12089
  const file = cleanUrl(id);
@@ -12386,8 +12200,7 @@ var require_main$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/dote
12386
12200
  const path$10 = __require("path");
12387
12201
  const os$3 = __require("os");
12388
12202
  const crypto$2 = __require("crypto");
12389
- const packageJson = require_package();
12390
- const version = packageJson.version;
12203
+ const version = require_package().version;
12391
12204
  const TIPS = [
12392
12205
  "🔐 encrypt with Dotenvx: https://dotenvx.com",
12393
12206
  "🔐 prevent committing .env to code: https://dotenvx.com/precommit",
@@ -12676,18 +12489,17 @@ var require_main = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/dotenv
12676
12489
  seen$1.add(result);
12677
12490
  const [template, bracedExpression, unbracedExpression] = match;
12678
12491
  const expression = bracedExpression || unbracedExpression;
12679
- const opRegex = /(:\+|\+|:-|-)/;
12680
- const opMatch = expression.match(opRegex);
12492
+ const opMatch = expression.match(/(:\+|\+|:-|-)/);
12681
12493
  const splitter = opMatch ? opMatch[0] : null;
12682
- const r$2 = expression.split(splitter);
12494
+ const r$1 = expression.split(splitter);
12683
12495
  let defaultValue;
12684
12496
  let value$2;
12685
- const key = r$2.shift();
12497
+ const key = r$1.shift();
12686
12498
  if ([":+", "+"].includes(splitter)) {
12687
- defaultValue = env$1[key] ? r$2.join(splitter) : "";
12499
+ defaultValue = env$1[key] ? r$1.join(splitter) : "";
12688
12500
  value$2 = null;
12689
12501
  } else {
12690
- defaultValue = r$2.join(splitter);
12502
+ defaultValue = r$1.join(splitter);
12691
12503
  value$2 = env$1[key];
12692
12504
  }
12693
12505
  if (value$2) if (seen$1.has(value$2)) result = result.replace(template, defaultValue);
@@ -12937,8 +12749,7 @@ var require_ms = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ms@2.0.0
12937
12749
  var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
12938
12750
  if (!match) return;
12939
12751
  var n$2 = parseFloat(match[1]);
12940
- var type = (match[2] || "ms").toLowerCase();
12941
- switch (type) {
12752
+ switch ((match[2] || "ms").toLowerCase()) {
12942
12753
  case "years":
12943
12754
  case "year":
12944
12755
  case "yrs":
@@ -12967,7 +12778,7 @@ var require_ms = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ms@2.0.0
12967
12778
  case "msecs":
12968
12779
  case "msec":
12969
12780
  case "ms": return n$2;
12970
- default: return void 0;
12781
+ default: return;
12971
12782
  }
12972
12783
  }
12973
12784
  /**
@@ -13060,8 +12871,7 @@ var require_debug$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/deb
13060
12871
  if (!debug$19.enabled) return;
13061
12872
  var self$1 = debug$19;
13062
12873
  var curr = +/* @__PURE__ */ new Date();
13063
- var ms = curr - (prevTime || curr);
13064
- self$1.diff = ms;
12874
+ self$1.diff = curr - (prevTime || curr);
13065
12875
  self$1.prev = prevTime;
13066
12876
  self$1.curr = curr;
13067
12877
  prevTime = curr;
@@ -13083,8 +12893,7 @@ var require_debug$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/deb
13083
12893
  return match;
13084
12894
  });
13085
12895
  exports.formatArgs.call(self$1, args);
13086
- var logFn = debug$19.log || exports.log || console.log.bind(console);
13087
- logFn.apply(self$1, args);
12896
+ (debug$19.log || exports.log || console.log.bind(console)).apply(self$1, args);
13088
12897
  }
13089
12898
  debug$19.namespace = namespace;
13090
12899
  debug$19.enabled = exports.enabled(namespace);
@@ -13235,8 +13044,7 @@ var require_node = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/debug@
13235
13044
  */
13236
13045
  function formatArgs(args) {
13237
13046
  var name = this.namespace;
13238
- var useColors$2 = this.useColors;
13239
- if (useColors$2) {
13047
+ if (this.useColors) {
13240
13048
  var c = this.color;
13241
13049
  var prefix = " \x1B[3" + c + ";1m" + name + " \x1B[0m";
13242
13050
  args[0] = prefix + args[0].split("\n").join("\n" + prefix);
@@ -13276,22 +13084,19 @@ var require_node = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/debug@
13276
13084
  */
13277
13085
  function createWritableStdioStream(fd$1) {
13278
13086
  var stream$3;
13279
- var tty_wrap = process.binding("tty_wrap");
13280
- switch (tty_wrap.guessHandleType(fd$1)) {
13087
+ switch (process.binding("tty_wrap").guessHandleType(fd$1)) {
13281
13088
  case "TTY":
13282
13089
  stream$3 = new tty.WriteStream(fd$1);
13283
13090
  stream$3._type = "tty";
13284
13091
  if (stream$3._handle && stream$3._handle.unref) stream$3._handle.unref();
13285
13092
  break;
13286
13093
  case "FILE":
13287
- var fs$12 = __require("fs");
13288
- stream$3 = new fs$12.SyncWriteStream(fd$1, { autoClose: false });
13094
+ stream$3 = new (__require("fs")).SyncWriteStream(fd$1, { autoClose: false });
13289
13095
  stream$3._type = "fs";
13290
13096
  break;
13291
13097
  case "PIPE":
13292
13098
  case "TCP":
13293
- var net$2 = __require("net");
13294
- stream$3 = new net$2.Socket({
13099
+ stream$3 = new (__require("net")).Socket({
13295
13100
  fd: fd$1,
13296
13101
  readable: false,
13297
13102
  writable: true
@@ -13540,7 +13345,6 @@ var require_on_finished = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
13540
13345
  var socket = msg.socket;
13541
13346
  if (typeof msg.finished === "boolean") return Boolean(msg.finished || socket && !socket.writable);
13542
13347
  if (typeof msg.complete === "boolean") return Boolean(msg.upgrade || !socket || !socket.readable || msg.complete && !msg.readable);
13543
- return void 0;
13544
13348
  }
13545
13349
  /**
13546
13350
  * Attach a finished listener to the message.
@@ -13656,7 +13460,7 @@ var require_parseurl = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/pa
13656
13460
  */
13657
13461
  function parseurl(req$4) {
13658
13462
  var url$3 = req$4.url;
13659
- if (url$3 === void 0) return void 0;
13463
+ if (url$3 === void 0) return;
13660
13464
  var parsed = req$4._parsedUrl;
13661
13465
  if (fresh(url$3, parsed)) return parsed;
13662
13466
  parsed = fastparse(url$3);
@@ -13954,8 +13758,7 @@ var require_finalhandler = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
13954
13758
  * @private
13955
13759
  */
13956
13760
  function createHtmlDocument(message) {
13957
- var body = escapeHtml$2(message).replace(NEWLINE_REGEXP, "<br>").replace(DOUBLE_SPACE_REGEXP, " &nbsp;");
13958
- return "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>" + body + "</pre>\n</body>\n</html>\n";
13761
+ return "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>" + escapeHtml$2(message).replace(NEWLINE_REGEXP, "<br>").replace(DOUBLE_SPACE_REGEXP, " &nbsp;") + "</pre>\n</body>\n</html>\n";
13959
13762
  }
13960
13763
  /**
13961
13764
  * Module exports.
@@ -14010,7 +13813,7 @@ var require_finalhandler = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
14010
13813
  * @private
14011
13814
  */
14012
13815
  function getErrorHeaders(err$2) {
14013
- if (!err$2.headers || typeof err$2.headers !== "object") return void 0;
13816
+ if (!err$2.headers || typeof err$2.headers !== "object") return;
14014
13817
  var headers = Object.create(null);
14015
13818
  var keys = Object.keys(err$2.headers);
14016
13819
  for (var i$1 = 0; i$1 < keys.length; i$1++) {
@@ -14046,7 +13849,6 @@ var require_finalhandler = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
14046
13849
  function getErrorStatusCode(err$2) {
14047
13850
  if (typeof err$2.status === "number" && err$2.status >= 400 && err$2.status < 600) return err$2.status;
14048
13851
  if (typeof err$2.statusCode === "number" && err$2.statusCode >= 400 && err$2.statusCode < 600) return err$2.statusCode;
14049
- return void 0;
14050
13852
  }
14051
13853
  /**
14052
13854
  * Get resource name for the request.
@@ -14359,7 +14161,7 @@ var require_connect = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/con
14359
14161
  * @private
14360
14162
  */
14361
14163
  function getProtohost(url$3) {
14362
- if (url$3.length === 0 || url$3[0] === "/") return void 0;
14164
+ if (url$3.length === 0 || url$3[0] === "/") return;
14363
14165
  var fqdnIndex = url$3.indexOf("://");
14364
14166
  return fqdnIndex !== -1 && url$3.lastIndexOf("?", fqdnIndex) === -1 ? url$3.substr(0, url$3.indexOf("/", 3 + fqdnIndex)) : void 0;
14365
14167
  }
@@ -14383,10 +14185,9 @@ var require_object_assign = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
14383
14185
  if (Object.getOwnPropertyNames(test1)[0] === "5") return false;
14384
14186
  var test2 = {};
14385
14187
  for (var i$1 = 0; i$1 < 10; i$1++) test2["_" + String.fromCharCode(i$1)] = i$1;
14386
- var order2 = Object.getOwnPropertyNames(test2).map(function(n$2) {
14188
+ if (Object.getOwnPropertyNames(test2).map(function(n$2) {
14387
14189
  return test2[n$2];
14388
- });
14389
- if (order2.join("") !== "0123456789") return false;
14190
+ }).join("") !== "0123456789") return false;
14390
14191
  var test3 = {};
14391
14192
  "abcdefghijklmnopqrst".split("").forEach(function(letter) {
14392
14193
  test3[letter] = letter;
@@ -14610,8 +14411,8 @@ var require_lib$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cors@
14610
14411
  }
14611
14412
  }
14612
14413
  function cors(options$1, req$4, res, next) {
14613
- var headers = [], method = req$4.method && req$4.method.toUpperCase && req$4.method.toUpperCase();
14614
- if (method === "OPTIONS") {
14414
+ var headers = [];
14415
+ if ((req$4.method && req$4.method.toUpperCase && req$4.method.toUpperCase()) === "OPTIONS") {
14615
14416
  headers.push(configureOrigin(options$1, req$4));
14616
14417
  headers.push(configureCredentials(options$1, req$4));
14617
14418
  headers.push(configureMethods(options$1, req$4));
@@ -15013,8 +14814,7 @@ var require_anymatch = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/an
15013
14814
  const negatedGlobs = mtchers.filter((item) => typeof item === "string" && item.charAt(0) === BANG$1).map((item) => item.slice(1)).map((item) => picomatch$1(item, opts));
15014
14815
  const patterns = mtchers.filter((item) => typeof item !== "string" || typeof item === "string" && item.charAt(0) !== BANG$1).map((matcher) => createPattern(matcher, opts));
15015
14816
  if (testString == null) return (testString$1, ri = false) => {
15016
- const returnIndex$1 = typeof ri === "boolean" ? ri : false;
15017
- return matchPatterns(patterns, negatedGlobs, testString$1, returnIndex$1);
14817
+ return matchPatterns(patterns, negatedGlobs, testString$1, typeof ri === "boolean" ? ri : false);
15018
14818
  };
15019
14819
  return matchPatterns(patterns, negatedGlobs, testString, returnIndex);
15020
14820
  };
@@ -15158,8 +14958,7 @@ var require_glob_parent = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
15158
14958
  * @returns {string}
15159
14959
  */
15160
14960
  module.exports = function globParent$1(str, opts) {
15161
- var options$1 = Object.assign({ flipBackslashes: true }, opts);
15162
- if (options$1.flipBackslashes && isWin32 && str.indexOf(slash$1) < 0) str = str.replace(backslash, slash$1);
14961
+ if (Object.assign({ flipBackslashes: true }, opts).flipBackslashes && isWin32 && str.indexOf(slash$1) < 0) str = str.replace(backslash, slash$1);
15163
14962
  if (enclosure.test(str)) str += slash$1;
15164
14963
  str += "a";
15165
14964
  do
@@ -15337,8 +15136,7 @@ var require_to_regex_range = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
15337
15136
  state.maxLen = String(state.max).length;
15338
15137
  }
15339
15138
  if (a < 0) {
15340
- let newMin = b < 0 ? Math.abs(b) : 1;
15341
- negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
15139
+ negatives = splitToPatterns(b < 0 ? Math.abs(b) : 1, Math.abs(a), state, opts);
15342
15140
  a = state.a = 0;
15343
15141
  }
15344
15142
  if (b >= 0) positives = splitToPatterns(a, b, state, opts);
@@ -15354,8 +15152,7 @@ var require_to_regex_range = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
15354
15152
  let onlyNegative = filterPatterns(neg, pos, "-", false, options$1) || [];
15355
15153
  let onlyPositive = filterPatterns(pos, neg, "", false, options$1) || [];
15356
15154
  let intersected = filterPatterns(neg, pos, "-?", true, options$1) || [];
15357
- let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
15358
- return subpatterns.join("|");
15155
+ return onlyNegative.concat(intersected).concat(onlyPositive).join("|");
15359
15156
  }
15360
15157
  function splitToRanges(min$1, max) {
15361
15158
  let nines = 1;
@@ -15556,15 +15353,10 @@ var require_fill_range = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
15556
15353
  });
15557
15354
  let start = String.fromCharCode(a);
15558
15355
  if (a === b) return start;
15559
- let stop = String.fromCharCode(b);
15560
- return `[${start}-${stop}]`;
15356
+ return `[${start}-${String.fromCharCode(b)}]`;
15561
15357
  };
15562
15358
  const toRegex = (start, end, options$1) => {
15563
- if (Array.isArray(start)) {
15564
- let wrap$1 = options$1.wrap === true;
15565
- let prefix = options$1.capture ? "" : "?:";
15566
- return wrap$1 ? `(${prefix}${start.join("|")})` : start.join("|");
15567
- }
15359
+ if (Array.isArray(start)) return options$1.wrap === true ? `(${options$1.capture ? "" : "?:"}${start.join("|")})` : start.join("|");
15568
15360
  return toRegexRange(start, end, options$1);
15569
15361
  };
15570
15362
  const rangeError = (...args) => {
@@ -15663,9 +15455,7 @@ var require_compile = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/bra
15663
15455
  const utils$1 = require_utils();
15664
15456
  const compile$1 = (ast, options$1 = {}) => {
15665
15457
  const walk$3 = (node, parent = {}) => {
15666
- const invalidBlock = utils$1.isInvalidBrace(parent);
15667
- const invalidNode = node.invalid === true && options$1.escapeInvalid === true;
15668
- const invalid = invalidBlock === true || invalidNode === true;
15458
+ const invalid = utils$1.isInvalidBrace(parent) === true || (node.invalid === true && options$1.escapeInvalid === true) === true;
15669
15459
  const prefix = options$1.escapeInvalid === true ? "\\" : "";
15670
15460
  let output = "";
15671
15461
  if (node.isOpen === true) return prefix + node.value;
@@ -15984,12 +15774,11 @@ var require_parse$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/bra
15984
15774
  */
15985
15775
  if (value$1 === CHAR_LEFT_CURLY_BRACE) {
15986
15776
  depth++;
15987
- const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
15988
15777
  const brace = {
15989
15778
  type: "brace",
15990
15779
  open: true,
15991
15780
  close: false,
15992
- dollar,
15781
+ dollar: prev.value && prev.value.slice(-1) === "$" || block.dollar === true,
15993
15782
  depth,
15994
15783
  commas: 0,
15995
15784
  ranges: 0,
@@ -16031,8 +15820,7 @@ var require_parse$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/bra
16031
15820
  if (value$1 === CHAR_COMMA && depth > 0) {
16032
15821
  if (block.ranges > 0) {
16033
15822
  block.ranges = 0;
16034
- const open$2 = block.nodes.shift();
16035
- block.nodes = [open$2, {
15823
+ block.nodes = [block.nodes.shift(), {
16036
15824
  type: "text",
16037
15825
  value: stringify$1(block)
16038
15826
  }];
@@ -16747,12 +16535,8 @@ var require_nodefs_handler = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
16747
16535
  const setFsWatchFileListener = (path$13, fullPath, options$1, handlers) => {
16748
16536
  const { listener: listener$1, rawEmitter } = handlers;
16749
16537
  let cont = FsWatchFileInstances.get(fullPath);
16750
- let listeners = /* @__PURE__ */ new Set();
16751
- let rawEmitters = /* @__PURE__ */ new Set();
16752
16538
  const copts = cont && cont.options;
16753
16539
  if (copts && (copts.persistent < options$1.persistent || copts.interval > options$1.interval)) {
16754
- cont.listeners;
16755
- cont.rawEmitters;
16756
16540
  fs$8.unwatchFile(fullPath);
16757
16541
  cont = void 0;
16758
16542
  }
@@ -16809,8 +16593,7 @@ var require_nodefs_handler = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
16809
16593
  const opts = this.fsw.options;
16810
16594
  const directory = sysPath$2.dirname(path$13);
16811
16595
  const basename$3 = sysPath$2.basename(path$13);
16812
- const parent = this.fsw._getWatchedDir(directory);
16813
- parent.add(basename$3);
16596
+ this.fsw._getWatchedDir(directory).add(basename$3);
16814
16597
  const absolutePath = sysPath$2.resolve(path$13);
16815
16598
  const options$1 = { persistent: opts.persistent };
16816
16599
  if (!listener$1) listener$1 = EMPTY_FN$2;
@@ -17069,9 +16852,7 @@ var require_fsevents_handler = /* @__PURE__ */ __commonJS({ "../../node_modules/
17069
16852
  if (fsevents) {
17070
16853
  const mtch = process.version.match(/v(\d+)\.(\d+)/);
17071
16854
  if (mtch && mtch[1] && mtch[2]) {
17072
- const maj$1 = Number.parseInt(mtch[1], 10);
17073
- const min$1 = Number.parseInt(mtch[2], 10);
17074
- if (maj$1 === 8 && min$1 < 16) fsevents = void 0;
16855
+ if (Number.parseInt(mtch[1], 10) === 8 && Number.parseInt(mtch[2], 10) < 16) fsevents = void 0;
17075
16856
  }
17076
16857
  }
17077
16858
  const { EV_ADD: EV_ADD$1, EV_CHANGE: EV_CHANGE$1, EV_ADD_DIR: EV_ADD_DIR$1, EV_UNLINK: EV_UNLINK$1, EV_ERROR: EV_ERROR$1, STR_DATA, STR_END: STR_END$1, FSEVENT_CREATED, FSEVENT_MODIFIED, FSEVENT_DELETED, FSEVENT_MOVED, FSEVENT_UNKNOWN, FSEVENT_FLAG_MUST_SCAN_SUBDIRS, FSEVENT_TYPE_FILE, FSEVENT_TYPE_DIRECTORY, FSEVENT_TYPE_SYMLINK, ROOT_GLOBSTAR, DIR_SUFFIX, DOT_SLASH, FUNCTION_TYPE: FUNCTION_TYPE$1, EMPTY_FN: EMPTY_FN$1, IDENTITY_FN } = require_constants$1();
@@ -17115,8 +16896,7 @@ var require_fsevents_handler = /* @__PURE__ */ __commonJS({ "../../node_modules/
17115
16896
  * @returns {{stop: Function}} new fsevents instance
17116
16897
  */
17117
16898
  const createFSEventsInstance = (path$13, callback) => {
17118
- const stop = fsevents.watch(path$13, callback);
17119
- return { stop };
16899
+ return { stop: fsevents.watch(path$13, callback) };
17120
16900
  };
17121
16901
  /**
17122
16902
  * Instantiates the fsevents interface or binds listeners to an existing one covering
@@ -17553,14 +17333,12 @@ var require_chokidar = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ch
17553
17333
  const { stats } = entry;
17554
17334
  if (stats && stats.isSymbolicLink()) return this.filterDir(entry);
17555
17335
  const resolvedPath = this.entryPath(entry);
17556
- const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ? this.globFilter(resolvedPath) : true;
17557
- return matchesGlob && this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
17336
+ return (this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ? this.globFilter(resolvedPath) : true) && this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
17558
17337
  }
17559
17338
  getDirParts(path$13) {
17560
17339
  if (!this.hasGlob) return [];
17561
17340
  const parts = [];
17562
- const expandedPath = path$13.includes(BRACE_START) ? braces.expand(path$13) : [path$13];
17563
- expandedPath.forEach((path$14) => {
17341
+ (path$13.includes(BRACE_START) ? braces.expand(path$13) : [path$13]).forEach((path$14) => {
17564
17342
  parts.push(sysPath.relative(this.watchPath, path$14).split(SLASH_OR_BACK_SLASH_RE));
17565
17343
  });
17566
17344
  return parts;
@@ -17612,8 +17390,7 @@ var require_chokidar = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ch
17612
17390
  if (undef(opts, "disableGlobbing")) opts.disableGlobbing = false;
17613
17391
  opts.enableBinaryInterval = opts.binaryInterval !== opts.interval;
17614
17392
  if (undef(opts, "useFsEvents")) opts.useFsEvents = !opts.usePolling;
17615
- const canUseFsEvents = FsEventsHandler.canUse();
17616
- if (!canUseFsEvents) opts.useFsEvents = false;
17393
+ if (!FsEventsHandler.canUse()) opts.useFsEvents = false;
17617
17394
  if (undef(opts, "usePolling") && !opts.useFsEvents) opts.usePolling = isMacos;
17618
17395
  if (isIBMi) opts.usePolling = true;
17619
17396
  const envPoll = process.env.CHOKIDAR_USEPOLLING;
@@ -17825,8 +17602,7 @@ var require_chokidar = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ch
17825
17602
  return this;
17826
17603
  }
17827
17604
  if (event === EV_CHANGE) {
17828
- const isThrottled = !this._throttle(EV_CHANGE, path$13, 50);
17829
- if (isThrottled) return this;
17605
+ if (!this._throttle(EV_CHANGE, path$13, 50)) return this;
17830
17606
  }
17831
17607
  if (opts.alwaysStat && val1 === void 0 && (event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE)) {
17832
17608
  const fullPath = opts.cwd ? sysPath.join(opts.cwd, path$13) : path$13;
@@ -17910,8 +17686,7 @@ var require_chokidar = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ch
17910
17686
  const now$1 = Number(/* @__PURE__ */ new Date());
17911
17687
  if (prevStat && curStat.size !== prevStat.size) this._pendingWrites.get(path$13).lastChange = now$1;
17912
17688
  const pw = this._pendingWrites.get(path$13);
17913
- const df = now$1 - pw.lastChange;
17914
- if (df >= threshold) {
17689
+ if (now$1 - pw.lastChange >= threshold) {
17915
17690
  this._pendingWrites.delete(path$13);
17916
17691
  awfEmit(void 0, curStat);
17917
17692
  } else timeoutHandler = setTimeout(awaitWriteFinish, this.options.awaitWriteFinish.pollInterval, curStat);
@@ -17983,8 +17758,7 @@ var require_chokidar = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ch
17983
17758
  */
17984
17759
  _hasReadPermissions(stats) {
17985
17760
  if (this.options.ignorePermissionErrors) return true;
17986
- const md = stats && Number.parseInt(stats.mode, 10);
17987
- const st = md & 511;
17761
+ const st = (stats && Number.parseInt(stats.mode, 10)) & 511;
17988
17762
  const it = Number.parseInt(st.toString(8)[0], 10);
17989
17763
  return Boolean(4 & it);
17990
17764
  }
@@ -18002,9 +17776,7 @@ var require_chokidar = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ch
18002
17776
  isDirectory$2 = isDirectory$2 != null ? isDirectory$2 : this._watched.has(path$13) || this._watched.has(fullPath);
18003
17777
  if (!this._throttle("remove", path$13, 100)) return;
18004
17778
  if (!isDirectory$2 && !this.options.useFsEvents && this._watched.size === 1) this.add(directory, item, true);
18005
- const wp = this._getWatchedDir(path$13);
18006
- const nestedDirectoryChildren = wp.getChildren();
18007
- nestedDirectoryChildren.forEach((nested) => this._remove(path$13, nested));
17779
+ this._getWatchedDir(path$13).getChildren().forEach((nested) => this._remove(path$13, nested));
18008
17780
  const parent = this._getWatchedDir(directory);
18009
17781
  const wasTracked = parent.has(item);
18010
17782
  parent.remove(item);
@@ -18012,8 +17784,7 @@ var require_chokidar = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ch
18012
17784
  let relPath = path$13;
18013
17785
  if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path$13);
18014
17786
  if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
18015
- const event = this._pendingWrites.get(relPath).cancelWait();
18016
- if (event === EV_ADD) return;
17787
+ if (this._pendingWrites.get(relPath).cancelWait() === EV_ADD) return;
18017
17788
  }
18018
17789
  this._watched.delete(path$13);
18019
17790
  this._watched.delete(fullPath);
@@ -18076,7 +17847,6 @@ var require_chokidar = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ch
18076
17847
  return stream$3;
18077
17848
  }
18078
17849
  };
18079
- exports.FSWatcher = FSWatcher;
18080
17850
  /**
18081
17851
  * Instantiates watcher with paths to be tracked.
18082
17852
  * @param {String|Array<String>} paths file/directory paths and/or globs
@@ -18132,23 +17902,23 @@ var require_parse$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/she
18132
17902
  var mult = 4294967296;
18133
17903
  for (var i = 0; i < 4; i++) TOKEN += (mult * Math.random()).toString(16);
18134
17904
  var startsWithToken = /* @__PURE__ */ new RegExp("^" + TOKEN);
18135
- function matchAll(s$2, r$2) {
18136
- var origIndex = r$2.lastIndex;
17905
+ function matchAll(s$2, r$1) {
17906
+ var origIndex = r$1.lastIndex;
18137
17907
  var matches$2 = [];
18138
17908
  var matchObj;
18139
- while (matchObj = r$2.exec(s$2)) {
17909
+ while (matchObj = r$1.exec(s$2)) {
18140
17910
  matches$2.push(matchObj);
18141
- if (r$2.lastIndex === matchObj.index) r$2.lastIndex += 1;
17911
+ if (r$1.lastIndex === matchObj.index) r$1.lastIndex += 1;
18142
17912
  }
18143
- r$2.lastIndex = origIndex;
17913
+ r$1.lastIndex = origIndex;
18144
17914
  return matches$2;
18145
17915
  }
18146
17916
  function getVar(env$1, pre, key) {
18147
- var r$2 = typeof env$1 === "function" ? env$1(key) : env$1[key];
18148
- if (typeof r$2 === "undefined" && key != "") r$2 = "";
18149
- else if (typeof r$2 === "undefined") r$2 = "$";
18150
- if (typeof r$2 === "object") return pre + TOKEN + JSON.stringify(r$2) + TOKEN;
18151
- return pre + r$2;
17917
+ var r$1 = typeof env$1 === "function" ? env$1(key) : env$1[key];
17918
+ if (typeof r$1 === "undefined" && key != "") r$1 = "";
17919
+ else if (typeof r$1 === "undefined") r$1 = "$";
17920
+ if (typeof r$1 === "object") return pre + TOKEN + JSON.stringify(r$1) + TOKEN;
17921
+ return pre + r$1;
18152
17922
  }
18153
17923
  function parseInternal(string, env$1, opts) {
18154
17924
  if (!opts) opts = {};
@@ -18161,7 +17931,7 @@ var require_parse$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/she
18161
17931
  var commented = false;
18162
17932
  return matches$2.map(function(match) {
18163
17933
  var s$2 = match[0];
18164
- if (!s$2 || commented) return void 0;
17934
+ if (!s$2 || commented) return;
18165
17935
  if (controlRE.test(s$2)) return { op: s$2 };
18166
17936
  var quote = false;
18167
17937
  var esc = false;
@@ -18384,12 +18154,11 @@ var require_guess = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/launc
18384
18154
  }
18385
18155
  }
18386
18156
  } else if (process.platform === "win32") {
18387
- const output = childProcess$2.execSync("powershell -NoProfile -Command \"[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\\"select executablepath from win32_process where executablepath is not null\\\" | % { $_.ExecutablePath }\"", { stdio: [
18157
+ const runningProcesses = childProcess$2.execSync("powershell -NoProfile -Command \"[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\\"select executablepath from win32_process where executablepath is not null\\\" | % { $_.ExecutablePath }\"", { stdio: [
18388
18158
  "pipe",
18389
18159
  "pipe",
18390
18160
  "ignore"
18391
- ] }).toString();
18392
- const runningProcesses = output.split("\r\n");
18161
+ ] }).toString().split("\r\n");
18393
18162
  for (let i$1 = 0; i$1 < runningProcesses.length; i$1++) {
18394
18163
  const fullProcessPath = runningProcesses[i$1].trim();
18395
18164
  const shortProcessName = path$8.basename(fullProcessPath);
@@ -18419,8 +18188,7 @@ var require_guess = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/launc
18419
18188
  var require_get_args = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/launch-editor@2.11.1/node_modules/launch-editor/get-args.js": ((exports, module) => {
18420
18189
  const path$7 = __require("path");
18421
18190
  module.exports = function getArgumentsForPosition$1(editor, fileName, lineNumber, columnNumber = 1) {
18422
- const editorBasename = path$7.basename(editor).replace(/\.(exe|cmd|bat)$/i, "");
18423
- switch (editorBasename) {
18191
+ switch (path$7.basename(editor).replace(/\.(exe|cmd|bat)$/i, "")) {
18424
18192
  case "atom":
18425
18193
  case "Atom":
18426
18194
  case "Atom Beta":
@@ -18538,12 +18306,10 @@ var require_launch_editor = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
18538
18306
  if (file.startsWith("file://")) file = __require("url").fileURLToPath(file);
18539
18307
  const fileName = file.replace(positionRE, "");
18540
18308
  const match = file.match(positionRE);
18541
- const lineNumber = match && match[1];
18542
- const columnNumber = match && match[3];
18543
18309
  return {
18544
18310
  fileName,
18545
- lineNumber,
18546
- columnNumber
18311
+ lineNumber: match && match[1],
18312
+ columnNumber: match && match[3]
18547
18313
  };
18548
18314
  }
18549
18315
  let _childProcess = null;
@@ -18726,8 +18492,7 @@ function ssrRewriteStacktrace(stack, moduleGraph) {
18726
18492
  return stack.split("\n").map((line) => {
18727
18493
  return line.replace(/^ {4}at (?:(\S.*?)\s\()?(.+?):(\d+)(?::(\d+))?\)?/, (input, varName, id, line$1, column) => {
18728
18494
  if (!id) return input;
18729
- const mod = moduleGraph.getModuleById(id);
18730
- const rawSourceMap = mod?.transformResult?.map;
18495
+ const rawSourceMap = moduleGraph.getModuleById(id)?.transformResult?.map;
18731
18496
  if (!rawSourceMap) return input;
18732
18497
  const traced = new TraceMap(rawSourceMap);
18733
18498
  const pos = originalPositionFor(traced, {
@@ -18736,8 +18501,7 @@ function ssrRewriteStacktrace(stack, moduleGraph) {
18736
18501
  });
18737
18502
  if (!pos.source) return input;
18738
18503
  const trimmedVarName = varName?.trim();
18739
- const sourceFile = path.resolve(path.dirname(id), pos.source);
18740
- const source = `${sourceFile}:${pos.line}:${pos.column + 1}`;
18504
+ const source = `${path.resolve(path.dirname(id), pos.source)}:${pos.line}:${pos.column + 1}`;
18741
18505
  if (!trimmedVarName || trimmedVarName === "eval") return ` at ${source}`;
18742
18506
  else return ` at ${trimmedVarName} (${source})`;
18743
18507
  });
@@ -19094,8 +18858,7 @@ function isNode(value$1) {
19094
18858
  * @returns {Node | null}
19095
18859
  */
19096
18860
  function walk(ast, { enter, leave }) {
19097
- const instance = new SyncWalker(enter, leave);
19098
- return instance.visit(ast, null);
18861
+ return new SyncWalker(enter, leave).visit(ast, null);
19099
18862
  }
19100
18863
 
19101
18864
  //#endregion
@@ -19216,17 +18979,14 @@ async function ssrTransformScript(code, inMap, url$3, originalCode) {
19216
18979
  defineExport(exportedAs, binding || local);
19217
18980
  }
19218
18981
  }
19219
- if (node.type === "ExportDefaultDeclaration") {
19220
- const expressionTypes = ["FunctionExpression", "ClassExpression"];
19221
- if ("id" in node.declaration && node.declaration.id && !expressionTypes.includes(node.declaration.type)) {
19222
- const { name } = node.declaration.id;
19223
- s$2.remove(node.start, node.start + 15);
19224
- defineExport("default", name);
19225
- } else {
19226
- const name = `__vite_ssr_export_default__`;
19227
- s$2.update(node.start, node.start + 14, `const ${name} =`);
19228
- defineExport("default", name);
19229
- }
18982
+ if (node.type === "ExportDefaultDeclaration") if ("id" in node.declaration && node.declaration.id && !["FunctionExpression", "ClassExpression"].includes(node.declaration.type)) {
18983
+ const { name } = node.declaration.id;
18984
+ s$2.remove(node.start, node.start + 15);
18985
+ defineExport("default", name);
18986
+ } else {
18987
+ const name = `__vite_ssr_export_default__`;
18988
+ s$2.update(node.start, node.start + 14, `const ${name} =`);
18989
+ defineExport("default", name);
19230
18990
  }
19231
18991
  if (node.type === "ExportAllDeclaration") {
19232
18992
  const importId = reExportImportIdMap.get(node);
@@ -19485,8 +19245,7 @@ const wslDrivesMountPoint = (() => {
19485
19245
  };
19486
19246
  })();
19487
19247
  const powerShellPathFromWsl = async () => {
19488
- const mountPoint = await wslDrivesMountPoint();
19489
- return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
19248
+ return `${await wslDrivesMountPoint()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
19490
19249
  };
19491
19250
  const powerShellPath = async () => {
19492
19251
  if (is_wsl_default) return powerShellPathFromWsl();
@@ -19526,8 +19285,7 @@ async function defaultBrowserId() {
19526
19285
  "com.apple.LaunchServices/com.apple.launchservices.secure",
19527
19286
  "LSHandlers"
19528
19287
  ]);
19529
- const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
19530
- return match?.groups.id ?? "com.apple.Safari";
19288
+ return /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout)?.groups.id ?? "com.apple.Safari";
19531
19289
  }
19532
19290
 
19533
19291
  //#endregion
@@ -19535,11 +19293,10 @@ async function defaultBrowserId() {
19535
19293
  const execFileAsync$2 = promisify(execFile);
19536
19294
  async function runAppleScript(script, { humanReadableOutput = true } = {}) {
19537
19295
  if (process$1.platform !== "darwin") throw new Error("macOS only");
19538
- const outputArguments = humanReadableOutput ? [] : ["-ss"];
19539
19296
  const { stdout } = await execFileAsync$2("osascript", [
19540
19297
  "-e",
19541
19298
  script,
19542
- outputArguments
19299
+ humanReadableOutput ? [] : ["-ss"]
19543
19300
  ]);
19544
19301
  return stdout.trim();
19545
19302
  }
@@ -19614,9 +19371,8 @@ const titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x
19614
19371
  async function defaultBrowser() {
19615
19372
  if (process$1.platform === "darwin") {
19616
19373
  const id = await defaultBrowserId();
19617
- const name = await bundleName(id);
19618
19374
  return {
19619
- name,
19375
+ name: await bundleName(id),
19620
19376
  id
19621
19377
  };
19622
19378
  }
@@ -19627,9 +19383,8 @@ async function defaultBrowser() {
19627
19383
  "x-scheme-handler/http"
19628
19384
  ]);
19629
19385
  const id = stdout.trim();
19630
- const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
19631
19386
  return {
19632
- name,
19387
+ name: titleize(id.replace(/.desktop$/, "").replace("-", " ")),
19633
19388
  id
19634
19389
  };
19635
19390
  }
@@ -19764,8 +19519,7 @@ const baseOpen = async (options$1) => {
19764
19519
  await fsp.access(localXdgOpenPath, constants.X_OK);
19765
19520
  exeLocalXdgOpen = true;
19766
19521
  } catch {}
19767
- const useSystemXdgOpen = process$1.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
19768
- command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
19522
+ command = process$1.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
19769
19523
  }
19770
19524
  if (appArguments.length > 0) cliArguments.push(...appArguments);
19771
19525
  if (!options$1.wait) {
@@ -19900,8 +19654,7 @@ var require_mode = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe@
19900
19654
  var g = parseInt("010", 8);
19901
19655
  var o$1 = parseInt("001", 8);
19902
19656
  var ug = u | g;
19903
- var ret = mod & o$1 || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
19904
- return ret;
19657
+ return mod & o$1 || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
19905
19658
  }
19906
19659
  }) });
19907
19660
 
@@ -20009,8 +19762,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
20009
19762
  for (let j = 0; j < pathExt.length; j++) {
20010
19763
  const cur = p + pathExt[j];
20011
19764
  try {
20012
- const is = isexe.sync(cur, { pathExt: pathExtExe });
20013
- if (is) if (opt.all) found$1.push(cur);
19765
+ if (isexe.sync(cur, { pathExt: pathExtExe })) if (opt.all) found$1.push(cur);
20014
19766
  else return cur;
20015
19767
  } catch (ex) {}
20016
19768
  }
@@ -20028,8 +19780,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
20028
19780
  var require_path_key = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js": ((exports, module) => {
20029
19781
  const pathKey = (options$1 = {}) => {
20030
19782
  const environment = options$1.env || process.env;
20031
- const platform$2 = options$1.platform || process.platform;
20032
- if (platform$2 !== "win32") return "PATH";
19783
+ if ((options$1.platform || process.platform) !== "win32") return "PATH";
20033
19784
  return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
20034
19785
  };
20035
19786
  module.exports = pathKey;
@@ -20157,12 +19908,11 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cross
20157
19908
  parsed.command = path$2.normalize(parsed.command);
20158
19909
  parsed.command = escape$1.command(parsed.command);
20159
19910
  parsed.args = parsed.args.map((arg) => escape$1.argument(arg, needsDoubleEscapeMetaChars));
20160
- const shellCommand = [parsed.command].concat(parsed.args).join(" ");
20161
19911
  parsed.args = [
20162
19912
  "/d",
20163
19913
  "/s",
20164
19914
  "/c",
20165
- `"${shellCommand}"`
19915
+ `"${[parsed.command].concat(parsed.args).join(" ")}"`
20166
19916
  ];
20167
19917
  parsed.command = process.env.comspec || "cmd.exe";
20168
19918
  parsed.options.windowsVerbatimArguments = true;
@@ -20273,12 +20023,11 @@ function openBrowser(url$3, opt, logger) {
20273
20023
  }
20274
20024
  function executeNodeScript(scriptPath, url$3, logger) {
20275
20025
  const extraArgs = process.argv.slice(2);
20276
- const child = (0, import_cross_spawn.default)(process.execPath, [
20026
+ (0, import_cross_spawn.default)(process.execPath, [
20277
20027
  scriptPath,
20278
20028
  ...extraArgs,
20279
20029
  url$3
20280
- ], { stdio: "inherit" });
20281
- child.on("close", (code) => {
20030
+ ], { stdio: "inherit" }).on("close", (code) => {
20282
20031
  if (code !== 0) logger.error(import_picocolors$19.default.red(`\nThe script specified as BROWSER environment variable failed.\n\n${import_picocolors$19.default.cyan(scriptPath)} exited with code ${code}.`), { error: null });
20283
20032
  });
20284
20033
  }
@@ -20294,8 +20043,7 @@ const supportedChromiumBrowsers = [
20294
20043
  ];
20295
20044
  async function startBrowserProcess(browser, browserArgs, url$3, logger) {
20296
20045
  const preferredOSXBrowser = browser === "google chrome" ? "Google Chrome" : browser;
20297
- const shouldTryOpenChromeWithJXA = process.platform === "darwin" && (!preferredOSXBrowser || supportedChromiumBrowsers.includes(preferredOSXBrowser));
20298
- if (shouldTryOpenChromeWithJXA) try {
20046
+ if (process.platform === "darwin" && (!preferredOSXBrowser || supportedChromiumBrowsers.includes(preferredOSXBrowser))) try {
20299
20047
  const ps = await execAsync("ps cax");
20300
20048
  const openedBrowser = preferredOSXBrowser && ps.includes(preferredOSXBrowser) ? preferredOSXBrowser : supportedChromiumBrowsers.find((b) => ps.includes(b));
20301
20049
  if (openedBrowser) {
@@ -20451,13 +20199,12 @@ function resolveChokidarOptions(options$1, resolvedOutDirs, emptyOutDir, cacheDi
20451
20199
  ...arraify(ignoredList || [])
20452
20200
  ];
20453
20201
  if (emptyOutDir) ignored.push(...[...resolvedOutDirs].map((outDir) => escapePath(outDir) + "/**"));
20454
- const resolvedWatchOptions = {
20202
+ return {
20455
20203
  ignored,
20456
20204
  ignoreInitial: true,
20457
20205
  ignorePermissionErrors: true,
20458
20206
  ...otherOptions
20459
20207
  };
20460
- return resolvedWatchOptions;
20461
20208
  }
20462
20209
  var NoopWatcher = class extends EventEmitter {
20463
20210
  constructor(options$1) {
@@ -20717,10 +20464,7 @@ var require_permessage_deflate = /* @__PURE__ */ __commonJS({ "../../node_module
20717
20464
  this._deflate = null;
20718
20465
  this._inflate = null;
20719
20466
  this.params = null;
20720
- if (!zlibLimiter) {
20721
- const concurrency = this._options.concurrencyLimit !== void 0 ? this._options.concurrencyLimit : 10;
20722
- zlibLimiter = new Limiter(concurrency);
20723
- }
20467
+ if (!zlibLimiter) zlibLimiter = new Limiter(this._options.concurrencyLimit !== void 0 ? this._options.concurrencyLimit : 10);
20724
20468
  }
20725
20469
  /**
20726
20470
  * @type {String}
@@ -21521,8 +21265,7 @@ var require_receiver = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ws
21521
21265
  * @private
21522
21266
  */
21523
21267
  decompress(data, cb) {
21524
- const perMessageDeflate = this._extensions[PerMessageDeflate$3.extensionName];
21525
- perMessageDeflate.decompress(data, this._fin, (err$2, buf) => {
21268
+ this._extensions[PerMessageDeflate$3.extensionName].decompress(data, this._fin, (err$2, buf) => {
21526
21269
  if (err$2) return cb(err$2);
21527
21270
  if (buf.length) {
21528
21271
  this._messageLength += buf.length;
@@ -22078,8 +21821,7 @@ var require_sender = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ws@8
22078
21821
  this._state = DEFLATING;
22079
21822
  perMessageDeflate.compress(data, options$1.fin, (_, buf) => {
22080
21823
  if (this._socket.destroyed) {
22081
- const err$2 = /* @__PURE__ */ new Error("The socket was closed while data was being compressed");
22082
- callCallbacks(this, err$2, cb);
21824
+ callCallbacks(this, /* @__PURE__ */ new Error("The socket was closed while data was being compressed"), cb);
22083
21825
  return;
22084
21826
  }
22085
21827
  this._bufferedBytes -= options$1[kByteLength];
@@ -22762,8 +22504,7 @@ var require_websocket = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/w
22762
22504
  close(code, data) {
22763
22505
  if (this.readyState === WebSocket$2.CLOSED) return;
22764
22506
  if (this.readyState === WebSocket$2.CONNECTING) {
22765
- const msg = "WebSocket was closed before the connection was established";
22766
- abortHandshake$1(this, this._req, msg);
22507
+ abortHandshake$1(this, this._req, "WebSocket was closed before the connection was established");
22767
22508
  return;
22768
22509
  }
22769
22510
  if (this.readyState === WebSocket$2.CLOSING) {
@@ -22892,8 +22633,7 @@ var require_websocket = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/w
22892
22633
  terminate() {
22893
22634
  if (this.readyState === WebSocket$2.CLOSED) return;
22894
22635
  if (this.readyState === WebSocket$2.CONNECTING) {
22895
- const msg = "WebSocket was closed before the connection was established";
22896
- abortHandshake$1(this, this._req, msg);
22636
+ abortHandshake$1(this, this._req, "WebSocket was closed before the connection was established");
22897
22637
  return;
22898
22638
  }
22899
22639
  if (this._socket) {
@@ -23200,29 +22940,25 @@ var require_websocket = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/w
23200
22940
  const secWebSocketExtensions = res.headers["sec-websocket-extensions"];
23201
22941
  if (secWebSocketExtensions !== void 0) {
23202
22942
  if (!perMessageDeflate) {
23203
- const message = "Server sent a Sec-WebSocket-Extensions header but no extension was requested";
23204
- abortHandshake$1(websocket, socket, message);
22943
+ abortHandshake$1(websocket, socket, "Server sent a Sec-WebSocket-Extensions header but no extension was requested");
23205
22944
  return;
23206
22945
  }
23207
22946
  let extensions$1;
23208
22947
  try {
23209
22948
  extensions$1 = parse$3(secWebSocketExtensions);
23210
22949
  } catch (err$2) {
23211
- const message = "Invalid Sec-WebSocket-Extensions header";
23212
- abortHandshake$1(websocket, socket, message);
22950
+ abortHandshake$1(websocket, socket, "Invalid Sec-WebSocket-Extensions header");
23213
22951
  return;
23214
22952
  }
23215
22953
  const extensionNames = Object.keys(extensions$1);
23216
22954
  if (extensionNames.length !== 1 || extensionNames[0] !== PerMessageDeflate$1.extensionName) {
23217
- const message = "Server indicated an extension that was not requested";
23218
- abortHandshake$1(websocket, socket, message);
22955
+ abortHandshake$1(websocket, socket, "Server indicated an extension that was not requested");
23219
22956
  return;
23220
22957
  }
23221
22958
  try {
23222
22959
  perMessageDeflate.accept(extensions$1[PerMessageDeflate$1.extensionName]);
23223
22960
  } catch (err$2) {
23224
- const message = "Invalid Sec-WebSocket-Extensions header";
23225
- abortHandshake$1(websocket, socket, message);
22961
+ abortHandshake$1(websocket, socket, "Invalid Sec-WebSocket-Extensions header");
23226
22962
  return;
23227
22963
  }
23228
22964
  websocket._extensions[PerMessageDeflate$1.extensionName] = perMessageDeflate;
@@ -23814,8 +23550,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJS({ "../../node_modules/
23814
23550
  shouldHandle(req$4) {
23815
23551
  if (this.options.path) {
23816
23552
  const index = req$4.url.indexOf("?");
23817
- const pathname = index !== -1 ? req$4.url.slice(0, index) : req$4.url;
23818
- if (pathname !== this.options.path) return false;
23553
+ if ((index !== -1 ? req$4.url.slice(0, index) : req$4.url) !== this.options.path) return false;
23819
23554
  }
23820
23555
  return true;
23821
23556
  }
@@ -23834,23 +23569,19 @@ var require_websocket_server = /* @__PURE__ */ __commonJS({ "../../node_modules/
23834
23569
  const upgrade = req$4.headers.upgrade;
23835
23570
  const version$2 = +req$4.headers["sec-websocket-version"];
23836
23571
  if (req$4.method !== "GET") {
23837
- const message = "Invalid HTTP method";
23838
- abortHandshakeOrEmitwsClientError(this, req$4, socket, 405, message);
23572
+ abortHandshakeOrEmitwsClientError(this, req$4, socket, 405, "Invalid HTTP method");
23839
23573
  return;
23840
23574
  }
23841
23575
  if (upgrade === void 0 || upgrade.toLowerCase() !== "websocket") {
23842
- const message = "Invalid Upgrade header";
23843
- abortHandshakeOrEmitwsClientError(this, req$4, socket, 400, message);
23576
+ abortHandshakeOrEmitwsClientError(this, req$4, socket, 400, "Invalid Upgrade header");
23844
23577
  return;
23845
23578
  }
23846
23579
  if (key === void 0 || !keyRegex.test(key)) {
23847
- const message = "Missing or invalid Sec-WebSocket-Key header";
23848
- abortHandshakeOrEmitwsClientError(this, req$4, socket, 400, message);
23580
+ abortHandshakeOrEmitwsClientError(this, req$4, socket, 400, "Missing or invalid Sec-WebSocket-Key header");
23849
23581
  return;
23850
23582
  }
23851
23583
  if (version$2 !== 13 && version$2 !== 8) {
23852
- const message = "Missing or invalid Sec-WebSocket-Version header";
23853
- abortHandshakeOrEmitwsClientError(this, req$4, socket, 400, message, { "Sec-WebSocket-Version": "13, 8" });
23584
+ abortHandshakeOrEmitwsClientError(this, req$4, socket, 400, "Missing or invalid Sec-WebSocket-Version header", { "Sec-WebSocket-Version": "13, 8" });
23854
23585
  return;
23855
23586
  }
23856
23587
  if (!this.shouldHandle(req$4)) {
@@ -23862,8 +23593,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJS({ "../../node_modules/
23862
23593
  if (secWebSocketProtocol !== void 0) try {
23863
23594
  protocols = subprotocol.parse(secWebSocketProtocol);
23864
23595
  } catch (err$2) {
23865
- const message = "Invalid Sec-WebSocket-Protocol header";
23866
- abortHandshakeOrEmitwsClientError(this, req$4, socket, 400, message);
23596
+ abortHandshakeOrEmitwsClientError(this, req$4, socket, 400, "Invalid Sec-WebSocket-Protocol header");
23867
23597
  return;
23868
23598
  }
23869
23599
  const secWebSocketExtensions = req$4.headers["sec-websocket-extensions"];
@@ -23877,8 +23607,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJS({ "../../node_modules/
23877
23607
  extensions$1[PerMessageDeflate.extensionName] = perMessageDeflate;
23878
23608
  }
23879
23609
  } catch (err$2) {
23880
- const message = "Invalid or unacceptable Sec-WebSocket-Extensions header";
23881
- abortHandshakeOrEmitwsClientError(this, req$4, socket, 400, message);
23610
+ abortHandshakeOrEmitwsClientError(this, req$4, socket, 400, "Invalid or unacceptable Sec-WebSocket-Extensions header");
23882
23611
  return;
23883
23612
  }
23884
23613
  }
@@ -23916,12 +23645,11 @@ var require_websocket_server = /* @__PURE__ */ __commonJS({ "../../node_modules/
23916
23645
  if (!socket.readable || !socket.writable) return socket.destroy();
23917
23646
  if (socket[kWebSocket]) throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");
23918
23647
  if (this._state > RUNNING) return abortHandshake(socket, 503);
23919
- const digest = createHash("sha1").update(key + GUID).digest("base64");
23920
23648
  const headers = [
23921
23649
  "HTTP/1.1 101 Switching Protocols",
23922
23650
  "Upgrade: websocket",
23923
23651
  "Connection: Upgrade",
23924
- `Sec-WebSocket-Accept: ${digest}`
23652
+ `Sec-WebSocket-Accept: ${createHash("sha1").update(key + GUID).digest("base64")}`
23925
23653
  ];
23926
23654
  const ws = new this.options.WebSocket(null, void 0, this.options);
23927
23655
  if (protocols.size) {
@@ -24137,8 +23865,7 @@ function hasValidToken(config$2, url$3) {
24137
23865
  const token = url$3.searchParams.get("token");
24138
23866
  if (!token) return false;
24139
23867
  try {
24140
- const isValidToken = crypto.timingSafeEqual(Buffer.from(token), Buffer.from(config$2.webSocketToken));
24141
- return isValidToken;
23868
+ return crypto.timingSafeEqual(Buffer.from(token), Buffer.from(config$2.webSocketToken));
24142
23869
  } catch {}
24143
23870
  return false;
24144
23871
  }
@@ -24164,8 +23891,7 @@ function createWebSocketServer(server, config$2, httpsOptions) {
24164
23891
  const hmr = isObject(config$2.server.hmr) && config$2.server.hmr;
24165
23892
  const hmrServer = hmr && hmr.server;
24166
23893
  const hmrPort = hmr && hmr.port;
24167
- const portsAreCompatible = !hmrPort || hmrPort === config$2.server.port;
24168
- const wsServer = hmrServer || portsAreCompatible && server;
23894
+ const wsServer = hmrServer || (!hmrPort || hmrPort === config$2.server.port) && server;
24169
23895
  let hmrServerWsListener;
24170
23896
  const customListeners = /* @__PURE__ */ new Map();
24171
23897
  const clientsMap = /* @__PURE__ */ new WeakMap();
@@ -24173,8 +23899,7 @@ function createWebSocketServer(server, config$2, httpsOptions) {
24173
23899
  const host = hmr && hmr.host || void 0;
24174
23900
  const allowedHosts = config$2.server.allowedHosts === true ? config$2.server.allowedHosts : Object.freeze([...config$2.server.allowedHosts]);
24175
23901
  const shouldHandle = (req$4) => {
24176
- const protocol = req$4.headers["sec-websocket-protocol"];
24177
- if (protocol === "vite-ping") return true;
23902
+ if (req$4.headers["sec-websocket-protocol"] === "vite-ping") return true;
24178
23903
  if (allowedHosts !== true && !isHostAllowed(req$4.headers.host, allowedHosts)) return false;
24179
23904
  if (config$2.legacy?.skipWebSocketTokenCheck) return true;
24180
23905
  if (req$4.headers.origin) {
@@ -24374,7 +24099,6 @@ function baseMiddleware(rawBase, middlewareMode) {
24374
24099
  //#region ../../node_modules/.pnpm/http-proxy-3@1.21.0/node_modules/http-proxy-3/dist/lib/http-proxy/common.js
24375
24100
  var require_common = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/http-proxy-3@1.21.0/node_modules/http-proxy-3/dist/lib/http-proxy/common.js": ((exports) => {
24376
24101
  Object.defineProperty(exports, "__esModule", { value: true });
24377
- exports.isSSL = void 0;
24378
24102
  exports.setupOutgoing = setupOutgoing;
24379
24103
  exports.setupSocket = setupSocket;
24380
24104
  exports.getPort = getPort;
@@ -24553,7 +24277,6 @@ var require_web_outgoing = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
24553
24277
  };
24554
24278
  })();
24555
24279
  Object.defineProperty(exports, "__esModule", { value: true });
24556
- exports.OUTGOING_PASSES = void 0;
24557
24280
  exports.removeChunked = removeChunked;
24558
24281
  exports.setConnection = setConnection;
24559
24282
  exports.setRedirectHostRewrite = setRedirectHostRewrite;
@@ -24622,8 +24345,8 @@ var require_web_outgoing = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
24622
24345
  }) });
24623
24346
 
24624
24347
  //#endregion
24625
- //#region ../../node_modules/.pnpm/follow-redirects@1.15.9_debug@4.4.1/node_modules/follow-redirects/debug.js
24626
- var require_debug = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/follow-redirects@1.15.9_debug@4.4.1/node_modules/follow-redirects/debug.js": ((exports, module) => {
24348
+ //#region ../../node_modules/.pnpm/follow-redirects@1.15.9_debug@4.4.3/node_modules/follow-redirects/debug.js
24349
+ var require_debug = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/follow-redirects@1.15.9_debug@4.4.3/node_modules/follow-redirects/debug.js": ((exports, module) => {
24627
24350
  var debug$7;
24628
24351
  module.exports = function() {
24629
24352
  if (!debug$7) {
@@ -24637,8 +24360,8 @@ var require_debug = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/follo
24637
24360
  }) });
24638
24361
 
24639
24362
  //#endregion
24640
- //#region ../../node_modules/.pnpm/follow-redirects@1.15.9_debug@4.4.1/node_modules/follow-redirects/index.js
24641
- var require_follow_redirects = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/follow-redirects@1.15.9_debug@4.4.1/node_modules/follow-redirects/index.js": ((exports, module) => {
24363
+ //#region ../../node_modules/.pnpm/follow-redirects@1.15.9_debug@4.4.3/node_modules/follow-redirects/index.js
24364
+ var require_follow_redirects = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/follow-redirects@1.15.9_debug@4.4.3/node_modules/follow-redirects/index.js": ((exports, module) => {
24642
24365
  var url = __require("url");
24643
24366
  var URL$2 = url.URL;
24644
24367
  var http$3 = __require("http");
@@ -24915,16 +24638,14 @@ var require_follow_redirects = /* @__PURE__ */ __commonJS({ "../../node_modules/
24915
24638
  spreadUrlObject(redirectUrl, this._options);
24916
24639
  if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
24917
24640
  if (isFunction(beforeRedirect)) {
24918
- var responseDetails = {
24641
+ beforeRedirect(this._options, {
24919
24642
  headers: response.headers,
24920
24643
  statusCode
24921
- };
24922
- var requestDetails = {
24644
+ }, {
24923
24645
  url: currentUrl,
24924
24646
  method,
24925
24647
  headers: requestHeaders
24926
- };
24927
- beforeRedirect(this._options, responseDetails, requestDetails);
24648
+ });
24928
24649
  this._sanitizeOptions(this._options);
24929
24650
  }
24930
24651
  this._performRequest();
@@ -25114,7 +24835,6 @@ var require_web_incoming = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
25114
24835
  };
25115
24836
  })();
25116
24837
  Object.defineProperty(exports, "__esModule", { value: true });
25117
- exports.WEB_PASSES = void 0;
25118
24838
  exports.deleteLength = deleteLength;
25119
24839
  exports.timeout = timeout;
25120
24840
  exports.XHeaders = XHeaders$1;
@@ -25178,8 +24898,7 @@ var require_web_incoming = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
25178
24898
  proxyReq.destroy();
25179
24899
  });
25180
24900
  res.on("close", () => {
25181
- const aborted = !res.writableFinished;
25182
- if (aborted) proxyReq.destroy();
24901
+ if (!res.writableFinished) proxyReq.destroy();
25183
24902
  });
25184
24903
  const proxyError = createErrorHandler(proxyReq, options$1.target);
25185
24904
  req$4.on("error", proxyError);
@@ -25263,7 +24982,6 @@ var require_ws_incoming = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
25263
24982
  return mod && mod.__esModule ? mod : { "default": mod };
25264
24983
  };
25265
24984
  Object.defineProperty(exports, "__esModule", { value: true });
25266
- exports.WS_PASSES = void 0;
25267
24985
  exports.numOpenSockets = numOpenSockets;
25268
24986
  exports.checkMethodAndHeader = checkMethodAndHeader;
25269
24987
  exports.XHeaders = XHeaders;
@@ -25271,8 +24989,7 @@ var require_ws_incoming = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
25271
24989
  const http$1 = __importStar$1(__require("node:http"));
25272
24990
  const https$1 = __importStar$1(__require("node:https"));
25273
24991
  const common = __importStar$1(require_common());
25274
- const debug_1$1 = __importDefault$1(require_node$1());
25275
- const log$1 = (0, debug_1$1.default)("http-proxy-3:ws-incoming");
24992
+ const log$1 = (0, __importDefault$1(require_node$1()).default)("http-proxy-3:ws-incoming");
25276
24993
  function createSocketCounter(name) {
25277
24994
  let sockets = /* @__PURE__ */ new Set();
25278
24995
  return ({ add, rm } = {}) => {
@@ -25430,7 +25147,6 @@ var require_http_proxy = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
25430
25147
  return mod && mod.__esModule ? mod : { "default": mod };
25431
25148
  };
25432
25149
  Object.defineProperty(exports, "__esModule", { value: true });
25433
- exports.ProxyServer = void 0;
25434
25150
  const http = __importStar(__require("node:http"));
25435
25151
  const https = __importStar(__require("node:https"));
25436
25152
  const web_incoming_1 = require_web_incoming();
@@ -25824,8 +25540,7 @@ var require_etag = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/etag@1
25824
25540
  function entitytag(entity) {
25825
25541
  if (entity.length === 0) return "\"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk\"";
25826
25542
  var hash$1 = crypto$1.createHash("sha1").update(entity, "utf8").digest("base64").substring(0, 27);
25827
- var len = typeof entity === "string" ? Buffer.byteLength(entity, "utf8") : entity.length;
25828
- return "\"" + len.toString(16) + "-" + hash$1 + "\"";
25543
+ return "\"" + (typeof entity === "string" ? Buffer.byteLength(entity, "utf8") : entity.length).toString(16) + "-" + hash$1 + "\"";
25829
25544
  }
25830
25545
  /**
25831
25546
  * Create a simple ETag.
@@ -25864,8 +25579,7 @@ var require_etag = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/etag@1
25864
25579
  */
25865
25580
  function stattag(stat$4) {
25866
25581
  var mtime = stat$4.mtime.getTime().toString(16);
25867
- var size = stat$4.size.toString(16);
25868
- return "\"" + size + "-" + mtime + "\"";
25582
+ return "\"" + stat$4.size.toString(16) + "-" + mtime + "\"";
25869
25583
  }
25870
25584
  }) });
25871
25585
 
@@ -26167,12 +25881,9 @@ function serveStaticMiddleware(server) {
26167
25881
  const url$3 = new URL(req$4.url, "http://example.com");
26168
25882
  const pathname = decodeURI(url$3.pathname);
26169
25883
  let redirectedPathname;
26170
- for (const { find: find$1, replacement } of server.config.resolve.alias) {
26171
- const matches$2 = typeof find$1 === "string" ? pathname.startsWith(find$1) : find$1.test(pathname);
26172
- if (matches$2) {
26173
- redirectedPathname = pathname.replace(find$1, replacement);
26174
- break;
26175
- }
25884
+ for (const { find: find$1, replacement } of server.config.resolve.alias) if (typeof find$1 === "string" ? pathname.startsWith(find$1) : find$1.test(pathname)) {
25885
+ redirectedPathname = pathname.replace(find$1, replacement);
25886
+ break;
26176
25887
  }
26177
25888
  if (redirectedPathname) {
26178
25889
  if (redirectedPathname.startsWith(withTrailingSlash(dir))) redirectedPathname = redirectedPathname.slice(dir.length);
@@ -26203,8 +25914,7 @@ function serveRawFsMiddleware(server) {
26203
25914
  return function viteServeRawFsMiddleware(req$4, res, next) {
26204
25915
  if (req$4.url.startsWith(FS_PREFIX)) {
26205
25916
  const url$3 = new URL(req$4.url, "http://example.com");
26206
- const pathname = decodeURI(url$3.pathname);
26207
- let newPathname = pathname.slice(FS_PREFIX.length);
25917
+ let newPathname = decodeURI(url$3.pathname).slice(FS_PREFIX.length);
26208
25918
  if (isWindows) newPathname = newPathname.replace(/^[A-Z]:/i, "");
26209
25919
  url$3.pathname = encodeURI(newPathname);
26210
25920
  req$4.url = url$3.href.slice(url$3.origin.length);
@@ -26265,8 +25975,7 @@ Refer to docs https://vite.dev/config/server-options.html#server-fs-allow for co
26265
25975
  res.end();
26266
25976
  }
26267
25977
  function renderRestrictedErrorHTML(msg) {
26268
- const html = String.raw;
26269
- return html`
25978
+ return String.raw`
26270
25979
  <body>
26271
25980
  <h1>403 Restricted</h1>
26272
25981
  <p>${(0, import_escape_html$1.default)(msg).replace(/\n/g, "<br/>")}</p>
@@ -26651,9 +26360,7 @@ const inlineImportRE = /(?<!(?<!\.\.)\.)\bimport\s*\(("(?:[^"]|(?<=\\)")*"|'(?:[
26651
26360
  const htmlLangRE = /\.(?:html|htm)$/;
26652
26361
  const spaceRe = /[\t\n\f\r ]/;
26653
26362
  const importMapRE = /[ \t]*<script[^>]*type\s*=\s*(?:"importmap"|'importmap'|importmap)[^>]*>.*?<\/script>/is;
26654
- const moduleScriptRE = /[ \t]*<script[^>]*type\s*=\s*(?:"module"|'module'|module)[^>]*>/i;
26655
- const modulePreloadLinkRE = /[ \t]*<link[^>]*rel\s*=\s*(?:"modulepreload"|'modulepreload'|modulepreload)[\s\S]*?\/>/i;
26656
- const importMapAppendRE = new RegExp([moduleScriptRE, modulePreloadLinkRE].map((r$2) => r$2.source).join("|"), "i");
26363
+ const importMapAppendRE = new RegExp([/[ \t]*<script[^>]*type\s*=\s*(?:"module"|'module'|module)[^>]*>/i, /[ \t]*<link[^>]*rel\s*=\s*(?:"modulepreload"|'modulepreload'|modulepreload)[\s\S]*?\/>/i].map((r$1) => r$1.source).join("|"), "i");
26657
26364
  const isHTMLProxy = (id) => isHtmlProxyRE.test(id);
26658
26365
  const isHTMLRequest = (request) => htmlLangRE.test(request);
26659
26366
  const htmlProxyMap = /* @__PURE__ */ new WeakMap();
@@ -26674,8 +26381,7 @@ function htmlInlineProxyPlugin(config$2) {
26674
26381
  const proxyMatch = htmlProxyRE$1.exec(id);
26675
26382
  if (proxyMatch) {
26676
26383
  const index = Number(proxyMatch[1]);
26677
- const file = cleanUrl(id);
26678
- const url$3 = file.replace(normalizePath(config$2.root), "");
26384
+ const url$3 = cleanUrl(id).replace(normalizePath(config$2.root), "");
26679
26385
  const result = htmlProxyMap.get(config$2).get(url$3)?.[index];
26680
26386
  if (result) return {
26681
26387
  ...result,
@@ -26711,7 +26417,7 @@ function traverseNodes(node, visitor) {
26711
26417
  if (nodeIsElement(node) || node.nodeName === "#document" || node.nodeName === "#document-fragment") node.childNodes.forEach((childNode) => traverseNodes(childNode, visitor));
26712
26418
  }
26713
26419
  async function traverseHtml(html, filePath, warn, visitor) {
26714
- const { parse: parse$17 } = await import("./dep-sDKrrA4S.js");
26420
+ const { parse: parse$17 } = await import("./dep-CCSnTAeo.js");
26715
26421
  const warnings = {};
26716
26422
  const ast = parse$17(html, {
26717
26423
  scriptingEnabled: false,
@@ -26767,7 +26473,7 @@ function removeViteIgnoreAttr(s$2, sourceCodeLocation) {
26767
26473
  * Format parse5 @type {ParserError} to @type {RollupError}
26768
26474
  */
26769
26475
  function formatParseError(parserError, id, html) {
26770
- const formattedError = {
26476
+ return {
26771
26477
  code: parserError.code,
26772
26478
  message: `parse5 error code ${parserError.code}`,
26773
26479
  frame: generateCodeFrame(html, parserError.startOffset, parserError.endOffset),
@@ -26777,7 +26483,6 @@ function formatParseError(parserError, id, html) {
26777
26483
  column: parserError.startCol
26778
26484
  }
26779
26485
  };
26780
- return formattedError;
26781
26486
  }
26782
26487
  function handleParseError(parserError, html, filePath, warnings) {
26783
26488
  switch (parserError.code) {
@@ -26820,8 +26525,7 @@ function buildHtmlPlugin(config$2) {
26820
26525
  const lineStartOffset = startOffset - node.sourceCodeLocation.startCol;
26821
26526
  let isLineEmpty = false;
26822
26527
  try {
26823
- const line = s$2.slice(Math.max(0, lineStartOffset), startOffset);
26824
- isLineEmpty = !line.trim();
26528
+ isLineEmpty = !s$2.slice(Math.max(0, lineStartOffset), startOffset).trim();
26825
26529
  } catch {}
26826
26530
  return isLineEmpty ? lineStartOffset : startOffset;
26827
26531
  };
@@ -26872,8 +26576,7 @@ function buildHtmlPlugin(config$2) {
26872
26576
  js += `\nimport ${JSON.stringify(url$3)}`;
26873
26577
  shouldRemove = true;
26874
26578
  } else if (node.childNodes.length) {
26875
- const scriptNode = node.childNodes.pop();
26876
- const contents = scriptNode.value;
26579
+ const contents = node.childNodes.pop().value;
26877
26580
  const filePath = id.replace(normalizePath(config$2.root), "");
26878
26581
  addToHTMLProxyCache(config$2, filePath, inlineModuleIndex, { code: contents });
26879
26582
  js += `\nimport "${id}?html-proxy&index=${inlineModuleIndex}.js"`;
@@ -26917,8 +26620,7 @@ function buildHtmlPlugin(config$2) {
26917
26620
  });
26918
26621
  js += importExpression;
26919
26622
  } else {
26920
- const isNoInlineLink = node.nodeName === "link" && attr.attributes.rel && parseRelAttr(attr.attributes.rel).some((v) => noInlineLinkRels.has(v));
26921
- const shouldInline$1 = isNoInlineLink ? false : void 0;
26623
+ const shouldInline$1 = node.nodeName === "link" && attr.attributes.rel && parseRelAttr(attr.attributes.rel).some((v) => noInlineLinkRels.has(v)) ? false : void 0;
26922
26624
  assetUrlsPromises.push((async () => {
26923
26625
  const processedUrl = await processAssetUrl(url$3, shouldInline$1);
26924
26626
  if (processedUrl !== url$3) overwriteAttrValue(s$2, attr.location, partialEncodeURIPath(processedUrl));
@@ -27016,8 +26718,7 @@ function buildHtmlPlugin(config$2) {
27016
26718
  if (seenChunks.has(chunk.fileName)) return [];
27017
26719
  seenChunks.add(chunk.fileName);
27018
26720
  if (analyzedImportedCssFiles.has(chunk)) {
27019
- const files$1 = analyzedImportedCssFiles.get(chunk);
27020
- const additionals = files$1.filter((file) => !seenCss.has(file));
26721
+ const additionals = analyzedImportedCssFiles.get(chunk).filter((file) => !seenCss.has(file));
27021
26722
  additionals.forEach((file) => seenCss.add(file));
27022
26723
  return additionals;
27023
26724
  }
@@ -27126,10 +26827,9 @@ function parseRelAttr(attr) {
27126
26827
  function findNeedTransformStyleAttribute(node) {
27127
26828
  const attr = node.attrs.find((prop) => prop.prefix === void 0 && prop.name === "style" && (prop.value.includes("url(") || prop.value.includes("image-set(")));
27128
26829
  if (!attr) return void 0;
27129
- const location$1 = node.sourceCodeLocation?.attrs?.["style"];
27130
26830
  return {
27131
26831
  attr,
27132
- location: location$1
26832
+ location: node.sourceCodeLocation?.attrs?.["style"]
27133
26833
  };
27134
26834
  }
27135
26835
  function extractImportExpressionFromClassicScript(scriptTextNode) {
@@ -27416,8 +27116,7 @@ function cachedTransformMiddleware(server) {
27416
27116
  if (ifNoneMatch) {
27417
27117
  const moduleByEtag = environment.moduleGraph.getModuleByEtag(ifNoneMatch);
27418
27118
  if (moduleByEtag?.transformResult?.etag === ifNoneMatch && moduleByEtag.url === req$4.url) {
27419
- const maybeMixedEtag = isCSSRequest(req$4.url);
27420
- if (!maybeMixedEtag) {
27119
+ if (!isCSSRequest(req$4.url)) {
27421
27120
  debugCache?.(`[304] ${prettifyUrl(req$4.url, server.config.root)}`);
27422
27121
  res.statusCode = 304;
27423
27122
  return res.end();
@@ -27446,35 +27145,31 @@ function transformMiddleware(server) {
27446
27145
  }
27447
27146
  const withoutQuery = cleanUrl(url$3);
27448
27147
  try {
27449
- const isSourceMap = withoutQuery.endsWith(".map");
27450
- if (isSourceMap) {
27451
- const depsOptimizer = environment.depsOptimizer;
27452
- if (depsOptimizer?.isOptimizedDepUrl(url$3)) {
27453
- const sourcemapPath = url$3.startsWith(FS_PREFIX) ? fsPathFromId(url$3) : normalizePath(path.resolve(server.config.root, url$3.slice(1)));
27454
- try {
27455
- const map$1 = JSON.parse(await fsp.readFile(sourcemapPath, "utf-8"));
27456
- applySourcemapIgnoreList(map$1, sourcemapPath, server.config.server.sourcemapIgnoreList, server.config.logger);
27457
- return send(req$4, res, JSON.stringify(map$1), "json", { headers: server.config.server.headers });
27458
- } catch {
27459
- const dummySourceMap = {
27460
- version: 3,
27461
- file: sourcemapPath.replace(/\.map$/, ""),
27462
- sources: [],
27463
- sourcesContent: [],
27464
- names: [],
27465
- mappings: ";;;;;;;;;"
27466
- };
27467
- return send(req$4, res, JSON.stringify(dummySourceMap), "json", {
27468
- cacheControl: "no-cache",
27469
- headers: server.config.server.headers
27470
- });
27471
- }
27472
- } else {
27473
- const originalUrl = url$3.replace(/\.map($|\?)/, "$1");
27474
- const map$1 = (await environment.moduleGraph.getModuleByUrl(originalUrl))?.transformResult?.map;
27475
- if (map$1) return send(req$4, res, JSON.stringify(map$1), "json", { headers: server.config.server.headers });
27476
- else return next();
27148
+ if (withoutQuery.endsWith(".map")) if (environment.depsOptimizer?.isOptimizedDepUrl(url$3)) {
27149
+ const sourcemapPath = url$3.startsWith(FS_PREFIX) ? fsPathFromId(url$3) : normalizePath(path.resolve(server.config.root, url$3.slice(1)));
27150
+ try {
27151
+ const map$1 = JSON.parse(await fsp.readFile(sourcemapPath, "utf-8"));
27152
+ applySourcemapIgnoreList(map$1, sourcemapPath, server.config.server.sourcemapIgnoreList, server.config.logger);
27153
+ return send(req$4, res, JSON.stringify(map$1), "json", { headers: server.config.server.headers });
27154
+ } catch {
27155
+ const dummySourceMap = {
27156
+ version: 3,
27157
+ file: sourcemapPath.replace(/\.map$/, ""),
27158
+ sources: [],
27159
+ sourcesContent: [],
27160
+ names: [],
27161
+ mappings: ";;;;;;;;;"
27162
+ };
27163
+ return send(req$4, res, JSON.stringify(dummySourceMap), "json", {
27164
+ cacheControl: "no-cache",
27165
+ headers: server.config.server.headers
27166
+ });
27477
27167
  }
27168
+ } else {
27169
+ const originalUrl = url$3.replace(/\.map($|\?)/, "$1");
27170
+ const map$1 = (await environment.moduleGraph.getModuleByUrl(originalUrl))?.transformResult?.map;
27171
+ if (map$1) return send(req$4, res, JSON.stringify(map$1), "json", { headers: server.config.server.headers });
27172
+ else return next();
27478
27173
  }
27479
27174
  if (publicDirInRoot && url$3.startsWith(publicPath)) warnAboutExplicitPublicPathInUrl(url$3);
27480
27175
  if (req$4.headers["sec-fetch-dest"] === "script" || isJSRequest(url$3) || isImportRequest(url$3) || isCSSRequest(url$3) || isHTMLProxy(url$3)) {
@@ -27629,8 +27324,7 @@ const processNodeUrl = (url$3, useSrcSetReplacer, config$2, htmlPath, originalUr
27629
27324
  }
27630
27325
  return url$4;
27631
27326
  };
27632
- const processedUrl = useSrcSetReplacer ? processSrcSetSync(url$3, ({ url: url$4 }) => replacer(url$4)) : replacer(url$3);
27633
- return processedUrl;
27327
+ return useSrcSetReplacer ? processSrcSetSync(url$3, ({ url: url$4 }) => replacer(url$4)) : replacer(url$3);
27634
27328
  };
27635
27329
  const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl }) => {
27636
27330
  const { config: config$2, watcher } = server;
@@ -27643,8 +27337,7 @@ const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl
27643
27337
  proxyModulePath = htmlPath;
27644
27338
  proxyModuleUrl = proxyModulePath;
27645
27339
  } else {
27646
- const validPath = `${htmlPath}${trailingSlash ? "index.html" : ""}`;
27647
- proxyModulePath = `\0${validPath}`;
27340
+ proxyModulePath = `\0${`${htmlPath}${trailingSlash ? "index.html" : ""}`}`;
27648
27341
  proxyModuleUrl = wrapId(proxyModulePath);
27649
27342
  }
27650
27343
  proxyModuleUrl = joinUrlSegments(decodedBase, proxyModuleUrl);
@@ -27957,9 +27650,9 @@ function mapIterator(iterable, transform$2) {
27957
27650
  return this;
27958
27651
  },
27959
27652
  next() {
27960
- const r$2 = iterable.next();
27961
- return r$2.done ? r$2 : {
27962
- value: transform$2(r$2.value),
27653
+ const r$1 = iterable.next();
27654
+ return r$1.done ? r$1 : {
27655
+ value: transform$2(r$1.value),
27963
27656
  done: false
27964
27657
  };
27965
27658
  }
@@ -28008,7 +27701,7 @@ var ModuleGraph = class {
28008
27701
  getModulesByFile(file) {
28009
27702
  const clientModules = this._client.getModulesByFile(file);
28010
27703
  const ssrModules = this._ssr.getModulesByFile(file);
28011
- if (!clientModules && !ssrModules) return void 0;
27704
+ if (!clientModules && !ssrModules) return;
28012
27705
  const result = /* @__PURE__ */ new Set();
28013
27706
  if (clientModules) for (const mod of clientModules) result.add(this.getBackwardCompatibleBrowserModuleNode(mod));
28014
27707
  if (ssrModules) {
@@ -28089,8 +27782,7 @@ var DualWeakMap = class {
28089
27782
  const k1 = key1 ?? this.undefinedKey;
28090
27783
  const k2 = key2 ?? this.undefinedKey;
28091
27784
  if (!this.map.has(k1)) this.map.set(k1, /* @__PURE__ */ new Map());
28092
- const m$2 = this.map.get(k1);
28093
- m$2.set(k2, value$1);
27785
+ this.map.get(k1).set(k2, value$1);
28094
27786
  }
28095
27787
  };
28096
27788
  function createBackwardCompatibleModuleSet(moduleGraph, prop, module$1) {
@@ -28233,8 +27925,7 @@ function hasWorkspacePackageJSON(root) {
28233
27925
  const path$13 = join(root, "package.json");
28234
27926
  if (!isFileReadable(path$13)) return false;
28235
27927
  try {
28236
- const content = JSON.parse(fs.readFileSync(path$13, "utf-8")) || {};
28237
- return !!content.workspaces;
27928
+ return !!(JSON.parse(fs.readFileSync(path$13, "utf-8")) || {}).workspaces;
28238
27929
  } catch {
28239
27930
  return false;
28240
27931
  }
@@ -28284,8 +27975,7 @@ function hostValidationMiddleware(allowedHosts, isPreview) {
28284
27975
  allowedHosts: Object.freeze([...allowedHosts]),
28285
27976
  generateErrorMessage(hostname) {
28286
27977
  const hostnameWithQuotes = JSON.stringify(hostname);
28287
- const optionName = `${isPreview ? "preview" : "server"}.allowedHosts`;
28288
- return `Blocked request. This host (${hostnameWithQuotes}) is not allowed.\nTo allow this host, add ${hostnameWithQuotes} to \`${optionName}\` in vite.config.js.`;
27978
+ return `Blocked request. This host (${hostnameWithQuotes}) is not allowed.\nTo allow this host, add ${hostnameWithQuotes} to \`${`${isPreview ? "preview" : "server"}.allowedHosts`}\` in vite.config.js.`;
28289
27979
  }
28290
27980
  });
28291
27981
  }
@@ -28335,8 +28025,7 @@ async function _createServer(inlineConfig = {}, options$1) {
28335
28025
  const publicFiles = await initPublicFilesPromise;
28336
28026
  const { publicDir } = config$2;
28337
28027
  if (httpServer) setClientErrorHandler(httpServer, config$2.logger);
28338
- const watchEnabled = serverConfig.watch !== null;
28339
- const watcher = watchEnabled ? import_chokidar.watch([
28028
+ const watcher = serverConfig.watch !== null ? import_chokidar.watch([
28340
28029
  root,
28341
28030
  ...config$2.configFileDependencies,
28342
28031
  ...getEnvFilesForMode(config$2.mode, config$2.envDir),
@@ -28406,13 +28095,11 @@ async function _createServer(inlineConfig = {}, options$1) {
28406
28095
  },
28407
28096
  transformRequest(url$3, options$2) {
28408
28097
  warnFutureDeprecation(config$2, "removeServerTransformRequest");
28409
- const environment = server.environments[options$2?.ssr ? "ssr" : "client"];
28410
- return environment.transformRequest(url$3);
28098
+ return server.environments[options$2?.ssr ? "ssr" : "client"].transformRequest(url$3);
28411
28099
  },
28412
28100
  warmupRequest(url$3, options$2) {
28413
28101
  warnFutureDeprecation(config$2, "removeServerWarmupRequest");
28414
- const environment = server.environments[options$2?.ssr ? "ssr" : "client"];
28415
- return environment.warmupRequest(url$3);
28102
+ return server.environments[options$2?.ssr ? "ssr" : "client"].warmupRequest(url$3);
28416
28103
  },
28417
28104
  transformIndexHtml(url$3, html, originalUrl) {
28418
28105
  return devHtmlTransformFn(server, url$3, html, originalUrl);
@@ -28453,8 +28140,7 @@ async function _createServer(inlineConfig = {}, options$1) {
28453
28140
  if (url$3) {
28454
28141
  const path$13 = typeof options$2.open === "string" ? new URL(options$2.open, url$3).href : url$3;
28455
28142
  if (server.config.server.preTransformRequests) setTimeout(() => {
28456
- const getMethod = path$13.startsWith("https:") ? get$1 : get;
28457
- getMethod(path$13, { headers: { Accept: "text/html" } }, (res) => {
28143
+ (path$13.startsWith("https:") ? get$1 : get)(path$13, { headers: { Accept: "text/html" } }, (res) => {
28458
28144
  res.on("end", () => {});
28459
28145
  }).on("error", () => {}).end();
28460
28146
  }, 0);
@@ -28524,8 +28210,7 @@ async function _createServer(inlineConfig = {}, options$1) {
28524
28210
  publicFiles[isUnlink ? "delete" : "add"](path$13);
28525
28211
  if (!isUnlink) {
28526
28212
  const clientModuleGraph = server.environments.client.moduleGraph;
28527
- const moduleWithSamePath = await clientModuleGraph.getModuleByUrl(path$13);
28528
- const etag$1 = moduleWithSamePath?.transformResult?.etag;
28213
+ const etag$1 = (await clientModuleGraph.getModuleByUrl(path$13))?.transformResult?.etag;
28529
28214
  if (etag$1) clientModuleGraph.etagToModuleMap.delete(etag$1);
28530
28215
  }
28531
28216
  }
@@ -28618,13 +28303,12 @@ async function startServer(server, hostname, inlinePort) {
28618
28303
  const configPort = inlinePort ?? options$1.port;
28619
28304
  const port = (!configPort || configPort === server._configServerPort ? server._currentServerPort : configPort) ?? DEFAULT_DEV_PORT;
28620
28305
  server._configServerPort = configPort;
28621
- const serverPort = await httpServerStart(httpServer, {
28306
+ server._currentServerPort = await httpServerStart(httpServer, {
28622
28307
  port,
28623
28308
  strictPort: options$1.strictPort,
28624
28309
  host: hostname.host,
28625
28310
  logger: server.config.logger
28626
28311
  });
28627
- server._currentServerPort = serverPort;
28628
28312
  }
28629
28313
  function createServerCloseFn(server) {
28630
28314
  if (!server) return () => Promise.resolve();
@@ -28790,12 +28474,10 @@ const normalizeHotChannel = (channel, enableHmr, normalizeClient = true) => {
28790
28474
  message: "invokeHandlers is not set",
28791
28475
  stack: (/* @__PURE__ */ new Error()).stack
28792
28476
  } };
28793
- const data = payload.data;
28794
- const { name, data: args } = data;
28477
+ const { name, data: args } = payload.data;
28795
28478
  try {
28796
28479
  const invokeHandler = invokeHandlers[name];
28797
- const result = await invokeHandler(...args);
28798
- return { result };
28480
+ return { result: await invokeHandler(...args) };
28799
28481
  } catch (error$1) {
28800
28482
  return { error: {
28801
28483
  name: error$1.name,
@@ -28813,7 +28495,7 @@ const normalizeHotChannel = (channel, enableHmr, normalizeClient = true) => {
28813
28495
  return;
28814
28496
  }
28815
28497
  const listenerWithNormalizedClient = (data, client) => {
28816
- const normalizedClient = { send: (...args) => {
28498
+ fn(data, { send: (...args) => {
28817
28499
  let payload;
28818
28500
  if (typeof args[0] === "string") payload = {
28819
28501
  type: "custom",
@@ -28822,8 +28504,7 @@ const normalizeHotChannel = (channel, enableHmr, normalizeClient = true) => {
28822
28504
  };
28823
28505
  else payload = args[0];
28824
28506
  client.send(payload);
28825
- } };
28826
- fn(data, normalizedClient);
28507
+ } });
28827
28508
  };
28828
28509
  normalizedListenerMap.set(fn, listenerWithNormalizedClient);
28829
28510
  channel.on?.(event, listenerWithNormalizedClient);
@@ -29038,10 +28719,9 @@ async function handleHMRUpdate(type, file, server) {
29038
28719
  });
29039
28720
  }
29040
28721
  }
29041
- const hotUpdateEnvironments = server.config.server.hotUpdateEnvironments ?? ((server$1, hmr$1) => {
28722
+ await (server.config.server.hotUpdateEnvironments ?? ((server$1, hmr$1) => {
29042
28723
  return Promise.all(Object.values(server$1.environments).map((environment) => hmr$1(environment)));
29043
- });
29044
- await hotUpdateEnvironments(server, hmr);
28724
+ }))(server, hmr);
29045
28725
  }
29046
28726
  function updateModules(environment, file, modules, timestamp, firstInvalidatedBy) {
29047
28727
  const { hot } = environment;
@@ -29130,9 +28810,8 @@ function propagateUpdate(node, traversedModules, boundaries, currentChain = [nod
29130
28810
  for (const importer of node.importers) {
29131
28811
  const subChain = currentChain.concat(importer);
29132
28812
  if (importer.acceptedHmrDeps.has(node)) {
29133
- const boundary = importer;
29134
28813
  boundaries.push({
29135
- boundary,
28814
+ boundary: importer,
29136
28815
  acceptedVia: node,
29137
28816
  isWithinCircularImport: isNodeWithinCircularImports(importer, subChain)
29138
28817
  });
@@ -29287,9 +28966,8 @@ async function readModifiedFile(file) {
29287
28966
  if (!content) {
29288
28967
  const mtime = (await fsp.stat(file)).mtimeMs;
29289
28968
  for (let n$2 = 0; n$2 < 10; n$2++) {
29290
- await new Promise((r$2) => setTimeout(r$2, 10));
29291
- const newMtime = (await fsp.stat(file)).mtimeMs;
29292
- if (newMtime !== mtime) break;
28969
+ await new Promise((r$1) => setTimeout(r$1, 10));
28970
+ if ((await fsp.stat(file)).mtimeMs !== mtime) break;
29293
28971
  }
29294
28972
  return await fsp.readFile(file, "utf-8");
29295
28973
  } else return content;
@@ -29435,10 +29113,9 @@ function definePlugin(config$2) {
29435
29113
  };
29436
29114
  }
29437
29115
  async function replaceDefine(environment, code, id, define$1) {
29438
- const esbuildOptions = environment.config.esbuild || {};
29439
29116
  const result = await transform(code, {
29440
29117
  loader: "js",
29441
- charset: esbuildOptions.charset ?? "utf8",
29118
+ charset: (environment.config.esbuild || {}).charset ?? "utf8",
29442
29119
  platform: "neutral",
29443
29120
  define: define$1,
29444
29121
  sourcefile: id,
@@ -29640,7 +29317,8 @@ function webWorkerPlugin(config$2) {
29640
29317
  else if (inlineRE$1.test(id)) {
29641
29318
  const chunk = await bundleWorkerEntry(config$2, id);
29642
29319
  const jsContent = `const jsContent = ${JSON.stringify(chunk.code)};`;
29643
- const code = workerConstructor === "Worker" ? `${jsContent}
29320
+ return {
29321
+ code: workerConstructor === "Worker" ? `${jsContent}
29644
29322
  const blob = typeof self !== "undefined" && self.Blob && new Blob([${workerType === "classic" ? `'(self.URL || self.webkitURL).revokeObjectURL(self.location.href);',` : `'URL.revokeObjectURL(import.meta.url);',`}jsContent], { type: "text/javascript;charset=utf-8" });
29645
29323
  export default function WorkerWrapper(options) {
29646
29324
  let objURL;
@@ -29665,9 +29343,7 @@ function webWorkerPlugin(config$2) {
29665
29343
  ${workerTypeOption}
29666
29344
  );
29667
29345
  }
29668
- `;
29669
- return {
29670
- code,
29346
+ `,
29671
29347
  map: { mappings: "" }
29672
29348
  };
29673
29349
  } else urlCode = JSON.stringify(await workerFileToUrl(config$2, id));
@@ -29707,9 +29383,7 @@ function webWorkerPlugin(config$2) {
29707
29383
  else if (workerType === "ignore") if (isBuild) injectEnv = "";
29708
29384
  else {
29709
29385
  const environment = this.environment;
29710
- const moduleGraph = environment.mode === "dev" ? environment.moduleGraph : void 0;
29711
- const module$1 = moduleGraph?.getModuleById(ENV_ENTRY);
29712
- injectEnv = module$1?.transformResult?.code || "";
29386
+ injectEnv = ((environment.mode === "dev" ? environment.moduleGraph : void 0)?.getModuleById(ENV_ENTRY))?.transformResult?.code || "";
29713
29387
  }
29714
29388
  if (injectEnv) {
29715
29389
  const s$2 = new MagicString(raw);
@@ -29736,8 +29410,7 @@ function webWorkerPlugin(config$2) {
29736
29410
  let match;
29737
29411
  s$2 = new MagicString(code);
29738
29412
  workerAssetUrlRE.lastIndex = 0;
29739
- const workerMap = workerCache.get(config$2.mainConfig || config$2);
29740
- const { fileNameHash } = workerMap;
29413
+ const { fileNameHash } = workerCache.get(config$2.mainConfig || config$2);
29741
29414
  while (match = workerAssetUrlRE.exec(code)) {
29742
29415
  const [full, hash$1] = match;
29743
29416
  const filename = fileNameHash.get(hash$1);
@@ -29754,8 +29427,7 @@ function webWorkerPlugin(config$2) {
29754
29427
  workerMap.assets.forEach((asset) => {
29755
29428
  const duplicateAsset = bundle[asset.fileName];
29756
29429
  if (duplicateAsset) {
29757
- const content = duplicateAsset.type === "asset" ? duplicateAsset.source : duplicateAsset.code;
29758
- if (isSameContent(content, asset.source)) return;
29430
+ if (isSameContent(duplicateAsset.type === "asset" ? duplicateAsset.source : duplicateAsset.code, asset.source)) return;
29759
29431
  }
29760
29432
  this.emitFile({
29761
29433
  type: "asset",
@@ -29800,8 +29472,7 @@ function preAliasPlugin(config$2) {
29800
29472
  if (resolved && !depsOptimizer.isOptimizedDepFile(resolved.id)) {
29801
29473
  const optimizeDeps$1 = depsOptimizer.options;
29802
29474
  const resolvedId = cleanUrl(resolved.id);
29803
- const isVirtual = resolvedId === id || resolvedId.includes("\0");
29804
- if (!isVirtual && fs.existsSync(resolvedId) && !moduleListContains(optimizeDeps$1.exclude, id) && path.isAbsolute(resolvedId) && (isInNodeModules(resolvedId) || optimizeDeps$1.include?.includes(id)) && isOptimizable(resolvedId, optimizeDeps$1) && (!ssr || optimizeAliasReplacementForSSR(resolvedId, optimizeDeps$1))) {
29475
+ if (!(resolvedId === id || resolvedId.includes("\0")) && fs.existsSync(resolvedId) && !moduleListContains(optimizeDeps$1.exclude, id) && path.isAbsolute(resolvedId) && (isInNodeModules(resolvedId) || optimizeDeps$1.include?.includes(id)) && isOptimizable(resolvedId, optimizeDeps$1) && (!ssr || optimizeAliasReplacementForSSR(resolvedId, optimizeDeps$1))) {
29805
29476
  const optimizedInfo = depsOptimizer.registerMissingImport(id, resolvedId);
29806
29477
  return { id: depsOptimizer.getOptimizedDepId(optimizedInfo) };
29807
29478
  }
@@ -29861,9 +29532,7 @@ function extractImportedBindings(id, source, importSpec, importedBindings) {
29861
29532
  bindings = /* @__PURE__ */ new Set();
29862
29533
  importedBindings.set(id, bindings);
29863
29534
  }
29864
- const isDynamic = importSpec.d > -1;
29865
- const isMeta = importSpec.d === -2;
29866
- if (isDynamic || isMeta) {
29535
+ if (importSpec.d > -1 || importSpec.d === -2) {
29867
29536
  bindings.add("*");
29868
29537
  return;
29869
29538
  }
@@ -30087,8 +29756,7 @@ function importAnalysisPlugin(config$2) {
30087
29756
  }
30088
29757
  } else if (!importer.startsWith(withTrailingSlash(clientDir))) {
30089
29758
  if (!isInNodeModules(importer)) {
30090
- const hasViteIgnore = hasViteIgnoreRE.test(source.slice(dynamicIndex + 1, end));
30091
- if (!hasViteIgnore) this.warn(`\n` + import_picocolors$8.default.cyan(importerModule.file) + `\n` + import_picocolors$8.default.reset(generateCodeFrame(source, start, end)) + import_picocolors$8.default.yellow(`\nThe above dynamic import cannot be analyzed by Vite.\nSee ${import_picocolors$8.default.blue(`https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations`)} for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.\n`));
29759
+ if (!hasViteIgnoreRE.test(source.slice(dynamicIndex + 1, end))) this.warn(`\n` + import_picocolors$8.default.cyan(importerModule.file) + `\n` + import_picocolors$8.default.reset(generateCodeFrame(source, start, end)) + import_picocolors$8.default.yellow(`\nThe above dynamic import cannot be analyzed by Vite.\nSee ${import_picocolors$8.default.blue(`https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations`)} for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.\n`));
30092
29760
  }
30093
29761
  if (!ssr) {
30094
29762
  if (!urlIsStringRE.test(rawUrl) || isExplicitImportRequired(rawUrl.slice(1, -1))) {
@@ -30142,7 +29810,7 @@ function importAnalysisPlugin(config$2) {
30142
29810
  if (ssr && importerModule.isSelfAccepting) isSelfAccepting = true;
30143
29811
  if (!isSelfAccepting && isPartiallySelfAccepting && acceptedExports.size >= exports$1.length && exports$1.every((e$1) => acceptedExports.has(e$1.n))) isSelfAccepting = true;
30144
29812
  const prunedImports = await moduleGraph.updateModuleInfo(importerModule, importedUrls, importedBindings, normalizedAcceptedUrls, isPartiallySelfAccepting ? acceptedExports : null, isSelfAccepting, staticImportedUrls);
30145
- if (hasHMR && prunedImports) handlePrunedModules(prunedImports, environment);
29813
+ if (prunedImports) handlePrunedModules(prunedImports, environment);
30146
29814
  }
30147
29815
  debug$2?.(`${timeFrom(msAtStart)} ${import_picocolors$8.default.dim(`[${importedUrls.size} imports rewritten] ${prettifyUrl(importer, root)}`)}`);
30148
29816
  if (s$2) return transformStableResult(s$2, importer, config$2);
@@ -30163,9 +29831,8 @@ function createParseErrorInfo(importer, source) {
30163
29831
  const isJsx = importer.endsWith(".jsx") || importer.endsWith(".tsx");
30164
29832
  const maybeJSX = !isVue && isJSRequest(importer);
30165
29833
  const probablyBinary = source.includes("�");
30166
- const msg = isVue ? `Install @vitejs/plugin-vue to handle .vue files.` : maybeJSX ? isJsx ? `If you use tsconfig.json, make sure to not set jsx to preserve.` : `If you are using JSX, make sure to name the file with the .jsx or .tsx extension.` : `You may need to install appropriate plugins to handle the ${path.extname(importer)} file format, or if it's an asset, add "**/*${path.extname(importer)}" to \`assetsInclude\` in your configuration.`;
30167
29834
  return {
30168
- message: "Failed to parse source for import analysis because the content contains invalid JS syntax. " + msg,
29835
+ message: "Failed to parse source for import analysis because the content contains invalid JS syntax. " + (isVue ? `Install @vitejs/plugin-vue to handle .vue files.` : maybeJSX ? isJsx ? `If you use tsconfig.json, make sure to not set jsx to preserve.` : `If you are using JSX, make sure to name the file with the .jsx or .tsx extension.` : `You may need to install appropriate plugins to handle the ${path.extname(importer)} file format, or if it's an asset, add "**/*${path.extname(importer)}" to \`assetsInclude\` in your configuration.`),
30169
29836
  showCodeFrame: !probablyBinary
30170
29837
  };
30171
29838
  }
@@ -30212,10 +29879,9 @@ function transformCjsImport(importExp, url$3, rawUrl, importIndex, importer, con
30212
29879
  let defaultExports = "";
30213
29880
  for (const spec of node.specifiers) if (spec.type === "ImportSpecifier") {
30214
29881
  const importedName = getIdentifierNameOrLiteralValue(spec.imported);
30215
- const localName = spec.local.name;
30216
29882
  importNames.push({
30217
29883
  importedName,
30218
- localName
29884
+ localName: spec.local.name
30219
29885
  });
30220
29886
  } else if (spec.type === "ImportDefaultSpecifier") importNames.push({
30221
29887
  importedName: "default",
@@ -30322,10 +29988,8 @@ function clientInjectionsPlugin(config$2) {
30322
29988
  },
30323
29989
  async transform(code, id) {
30324
29990
  const ssr = this.environment.config.consumer === "server";
30325
- if (id === normalizedClientEntry || id === normalizedEnvEntry) {
30326
- const defineReplacer = getDefineReplacer(this);
30327
- return defineReplacer(injectConfigValues(code));
30328
- } else if (!ssr && code.includes("process.env.NODE_ENV")) {
29991
+ if (id === normalizedClientEntry || id === normalizedEnvEntry) return getDefineReplacer(this)(injectConfigValues(code));
29992
+ else if (!ssr && code.includes("process.env.NODE_ENV")) {
30329
29993
  const nodeEnv = this.environment.config.define?.["process.env.NODE_ENV"] || JSON.stringify(process.env.NODE_ENV || config$2.mode);
30330
29994
  return await replaceDefine(this.environment, code, id, {
30331
29995
  "process.env.NODE_ENV": nodeEnv,
@@ -30460,8 +30124,7 @@ async function getWorkerType(raw, clean, i$1) {
30460
30124
  const endIndex = findClosingParen(clean, i$1);
30461
30125
  if (commaIndex > endIndex) return "classic";
30462
30126
  let workerOptString = raw.substring(commaIndex + 1, endIndex);
30463
- const hasViteIgnore = hasViteIgnoreRE.test(workerOptString);
30464
- if (hasViteIgnore) return "ignore";
30127
+ if (hasViteIgnoreRE.test(workerOptString)) return "ignore";
30465
30128
  const cleanWorkerOptString = clean.substring(commaIndex + 1, endIndex);
30466
30129
  const trimmedCleanWorkerOptString = cleanWorkerOptString.trim();
30467
30130
  if (!trimmedCleanWorkerOptString.length) return "classic";
@@ -30583,8 +30246,7 @@ function assetImportMetaUrlPlugin(config$2) {
30583
30246
  const hasQueryDelimiter = queryDelimiterIndex !== -1;
30584
30247
  const pureUrl = hasQueryDelimiter ? rawUrl.slice(0, queryDelimiterIndex) + "`" : rawUrl;
30585
30248
  const queryString = hasQueryDelimiter ? rawUrl.slice(queryDelimiterIndex, -1) : "";
30586
- const ast = this.parse(pureUrl);
30587
- const templateLiteral = ast.body[0].expression;
30249
+ const templateLiteral = this.parse(pureUrl).body[0].expression;
30588
30250
  if (templateLiteral.expressions.length) {
30589
30251
  const pattern = buildGlobPattern(templateLiteral);
30590
30252
  if (pattern[0] === "*") continue;
@@ -30731,8 +30393,7 @@ function dynamicImportToGlob(node, sourceString) {
30731
30393
  if (glob$1.startsWith("*")) throw new VariableDynamicImportError(`invalid import "${sourceString}". It cannot be statically analyzed. Variable dynamic imports must start with ./ and be limited to a specific directory. ${example}`);
30732
30394
  if (glob$1.startsWith("/")) throw new VariableDynamicImportError(`invalid import "${sourceString}". Variable absolute imports are not supported, imports must start with ./ in the static part of the import. ${example}`);
30733
30395
  if (!glob$1.startsWith("./") && !glob$1.startsWith("../")) throw new VariableDynamicImportError(`invalid import "${sourceString}". Variable bare imports are not supported, imports must start with ./ in the static part of the import. ${example}`);
30734
- const ownDirectoryStarExtension = /^\.\/\*\.\w+$/;
30735
- if (ownDirectoryStarExtension.test(glob$1)) throw new VariableDynamicImportError(`${`invalid import "${sourceString}". Variable imports cannot import their own directory, place imports in a separate directory or make the import filename more specific. `}${example}`);
30396
+ if (/^\.\/\*\.\w+$/.test(glob$1)) throw new VariableDynamicImportError(`${`invalid import "${sourceString}". Variable imports cannot import their own directory, place imports in a separate directory or make the import filename more specific. `}${example}`);
30736
30397
  if (path$1.extname(glob$1) === "") throw new VariableDynamicImportError(`invalid import "${sourceString}". A file extension must be included in the static part of the import. ${example}`);
30737
30398
  return glob$1;
30738
30399
  }
@@ -30938,7 +30599,7 @@ function createFilterForTransform(idFilter, codeFilter, cwd) {
30938
30599
  async function resolvePlugins(config$2, prePlugins, normalPlugins, postPlugins) {
30939
30600
  const isBuild = config$2.command === "build";
30940
30601
  const isWorker = config$2.isWorker;
30941
- const buildPlugins = isBuild ? await (await import("./dep-BvyJBvVx.js")).resolveBuildPlugins(config$2) : {
30602
+ const buildPlugins = isBuild ? await (await import("./dep-CAc8-XM0.js")).resolveBuildPlugins(config$2) : {
30942
30603
  pre: [],
30943
30604
  post: []
30944
30605
  };
@@ -30998,8 +30659,7 @@ function createPluginHookUtils(plugins$1) {
30998
30659
  return sorted;
30999
30660
  }
31000
30661
  function getSortedPluginHooks(hookName) {
31001
- const plugins$2 = getSortedPlugins(hookName);
31002
- return plugins$2.map((p) => getHookHandler(p[hookName])).filter(Boolean);
30662
+ return getSortedPlugins(hookName).map((p) => getHookHandler(p[hookName])).filter(Boolean);
31003
30663
  }
31004
30664
  return {
31005
30665
  getSortedPlugins,
@@ -31065,8 +30725,7 @@ function extractFilter(hook) {
31065
30725
  return hook && "filter" in hook && hook.filter ? hook.filter : void 0;
31066
30726
  }
31067
30727
  const viteAliasCustomResolver = async function(id, importer, options$1) {
31068
- const resolved = await this.resolve(id, importer, options$1);
31069
- return resolved || {
30728
+ return await this.resolve(id, importer, options$1) || {
31070
30729
  id,
31071
30730
  meta: { "vite:alias": { noResolved: true } }
31072
30731
  };
@@ -31145,7 +30804,7 @@ var EnvironmentPluginContainer = class {
31145
30804
  meta: module$1.meta || EMPTY_OBJECT
31146
30805
  }, { get(info, key) {
31147
30806
  if (key in info) return info[key];
31148
- if (key === "then") return void 0;
30807
+ if (key === "then") return;
31149
30808
  throw Error(`[vite] The "${key}" property of ModuleInfo is not supported.`);
31150
30809
  } });
31151
30810
  return module$1.info ?? null;
@@ -31387,8 +31046,7 @@ var BasicMinimalPluginContext = class {
31387
31046
  });
31388
31047
  }
31389
31048
  error(e$1) {
31390
- const err$2 = typeof e$1 === "string" ? new Error(e$1) : e$1;
31391
- throw err$2;
31049
+ throw typeof e$1 === "string" ? new Error(e$1) : e$1;
31392
31050
  }
31393
31051
  _normalizeRawLog(rawLog) {
31394
31052
  const logValue = typeof rawLog === "function" ? rawLog() : rawLog;
@@ -31796,9 +31454,7 @@ function createIdResolver(config$2, options$1) {
31796
31454
  return await pluginContainer.resolveId(id, importer, { scan });
31797
31455
  }
31798
31456
  return async (environment, id, importer, aliasOnly) => {
31799
- const resolveFn = aliasOnly ? resolveAlias : resolve$4;
31800
- const resolved = await resolveFn(environment, id, importer);
31801
- return resolved?.id;
31457
+ return (await (aliasOnly ? resolveAlias : resolve$4)(environment, id, importer))?.id;
31802
31458
  };
31803
31459
  }
31804
31460
 
@@ -31916,8 +31572,7 @@ function cssPlugin(config$2) {
31916
31572
  return [url$4, resolved];
31917
31573
  }
31918
31574
  if (config$2.command === "build") {
31919
- const isExternal$1 = config$2.build.rollupOptions.external ? resolveUserExternal(config$2.build.rollupOptions.external, decodedUrl, id$1, false) : false;
31920
- if (!isExternal$1) config$2.logger.warnOnce(`\n${decodedUrl} referenced in ${id$1} didn't resolve at build time, it will remain unchanged to be resolved at runtime`);
31575
+ if (!(config$2.build.rollupOptions.external ? resolveUserExternal(config$2.build.rollupOptions.external, decodedUrl, id$1, false) : false)) config$2.logger.warnOnce(`\n${decodedUrl} referenced in ${id$1} didn't resolve at build time, it will remain unchanged to be resolved at runtime`);
31921
31576
  }
31922
31577
  return [url$3, void 0];
31923
31578
  };
@@ -32007,16 +31662,15 @@ function cssPostPlugin(config$2) {
32007
31662
  if (inlined) return `export default ${JSON.stringify(css)}`;
32008
31663
  if (this.environment.config.consumer === "server") return modulesCode || "export {}";
32009
31664
  const cssContent = await getContentWithSourcemap(css);
32010
- const code$1 = [
32011
- `import { updateStyle as __vite__updateStyle, removeStyle as __vite__removeStyle } from ${JSON.stringify(path.posix.join(config$2.base, CLIENT_PUBLIC_PATH))}`,
32012
- `const __vite__id = ${JSON.stringify(id)}`,
32013
- `const __vite__css = ${JSON.stringify(cssContent)}`,
32014
- `__vite__updateStyle(__vite__id, __vite__css)`,
32015
- `${modulesCode || "import.meta.hot.accept()"}`,
32016
- `import.meta.hot.prune(() => __vite__removeStyle(__vite__id))`
32017
- ].join("\n");
32018
31665
  return {
32019
- code: code$1,
31666
+ code: [
31667
+ `import { updateStyle as __vite__updateStyle, removeStyle as __vite__removeStyle } from ${JSON.stringify(path.posix.join(config$2.base, CLIENT_PUBLIC_PATH))}`,
31668
+ `const __vite__id = ${JSON.stringify(id)}`,
31669
+ `const __vite__css = ${JSON.stringify(cssContent)}`,
31670
+ `__vite__updateStyle(__vite__id, __vite__css)`,
31671
+ `${modulesCode || "import.meta.hot.accept()"}`,
31672
+ `import.meta.hot.prune(() => __vite__removeStyle(__vite__id))`
31673
+ ].join("\n"),
32020
31674
  map: { mappings: "" }
32021
31675
  };
32022
31676
  }
@@ -32039,8 +31693,7 @@ function cssPostPlugin(config$2) {
32039
31693
  let chunkCSS;
32040
31694
  const renderedModules = new Proxy({}, { get(_target, p) {
32041
31695
  for (const name in meta.chunks) {
32042
- const modules = meta.chunks[name].modules;
32043
- const module$1 = modules[p];
31696
+ const module$1 = meta.chunks[name].modules[p];
32044
31697
  if (module$1) return module$1;
32045
31698
  }
32046
31699
  } });
@@ -32057,8 +31710,7 @@ function cssPostPlugin(config$2) {
32057
31710
  const publicAssetUrlMap = publicAssetUrlCache.get(config$2);
32058
31711
  const resolveAssetUrlsInCss = (chunkCSS$1, cssAssetName) => {
32059
31712
  const encodedPublicUrls = encodePublicUrlsInCSS(config$2);
32060
- const relative$3 = config$2.base === "./" || config$2.base === "";
32061
- const cssAssetDirname = encodedPublicUrls || relative$3 ? slash(getCssAssetDirname(cssAssetName)) : void 0;
31713
+ const cssAssetDirname = encodedPublicUrls || config$2.base === "./" || config$2.base === "" ? slash(getCssAssetDirname(cssAssetName)) : void 0;
32062
31714
  const toRelative = (filename) => {
32063
31715
  const relativePath = normalizePath(path.relative(cssAssetDirname, filename));
32064
31716
  return relativePath[0] === "." ? relativePath : "./" + relativePath;
@@ -32426,9 +32078,9 @@ async function compilePostCSS(environment, id, code, deps, lang, workerControlle
32426
32078
  const code$1 = await fs.promises.readFile(id$1, "utf-8");
32427
32079
  const lang$1 = CSS_LANGS_RE.exec(id$1)?.[1];
32428
32080
  if (isPreProcessor(lang$1)) {
32429
- const result$1 = await compileCSSPreprocessors(environment, id$1, lang$1, code$1, workerController);
32430
- result$1.deps?.forEach((dep) => deps.add(dep));
32431
- return result$1.code;
32081
+ const result = await compileCSSPreprocessors(environment, id$1, lang$1, code$1, workerController);
32082
+ result.deps?.forEach((dep) => deps.add(dep));
32083
+ return result.code;
32432
32084
  }
32433
32085
  return code$1;
32434
32086
  },
@@ -32460,27 +32112,24 @@ async function compilePostCSS(environment, id, code, deps, lang, workerControlle
32460
32112
  const postcssOptions = postcssConfig?.options ?? {};
32461
32113
  const postcssParser = lang === "sss" ? loadSss(config$2.root) : postcssOptions.parser;
32462
32114
  if (!postcssPlugins.length && !postcssParser) return;
32463
- const result = await runPostCSS(id, code, postcssPlugins, {
32464
- ...postcssOptions,
32465
- parser: postcssParser
32466
- }, deps, environment.logger, devSourcemap);
32467
32115
  return {
32468
- ...result,
32116
+ ...await runPostCSS(id, code, postcssPlugins, {
32117
+ ...postcssOptions,
32118
+ parser: postcssParser
32119
+ }, deps, environment.logger, devSourcemap),
32469
32120
  modules
32470
32121
  };
32471
32122
  }
32472
32123
  async function transformSugarSS(environment, id, code) {
32473
32124
  const { config: config$2 } = environment;
32474
32125
  const { devSourcemap } = config$2.css;
32475
- const result = await runPostCSS(id, code, [], { parser: loadSss(config$2.root) }, void 0, environment.logger, devSourcemap);
32476
- return result;
32126
+ return await runPostCSS(id, code, [], { parser: loadSss(config$2.root) }, void 0, environment.logger, devSourcemap);
32477
32127
  }
32478
32128
  async function runPostCSS(id, code, plugins$1, options$1, deps, logger, enableSourcemap) {
32479
32129
  let postcssResult;
32480
32130
  try {
32481
32131
  const source = removeDirectQuery(id);
32482
- const postcss = await importPostcss();
32483
- postcssResult = await postcss.default(plugins$1).process(code, {
32132
+ postcssResult = await (await importPostcss()).default(plugins$1).process(code, {
32484
32133
  ...options$1,
32485
32134
  to: source,
32486
32135
  from: source,
@@ -32543,8 +32192,8 @@ function createCachedImport(imp) {
32543
32192
  return cached;
32544
32193
  };
32545
32194
  }
32546
- const importPostcssImport = createCachedImport(() => import("./dep-DDbTn5rw.js").then(__toDynamicImportESM(1)));
32547
- const importPostcssModules = createCachedImport(() => import("./dep-DCVhRpiz.js").then(__toDynamicImportESM(1)));
32195
+ const importPostcssImport = createCachedImport(() => import("./dep-CwrJo3zV.js").then(__toDynamicImportESM(1)));
32196
+ const importPostcssModules = createCachedImport(() => import("./dep-D8ZQhg7-.js").then(__toDynamicImportESM(1)));
32548
32197
  const importPostcss = createCachedImport(() => import("postcss"));
32549
32198
  const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
32550
32199
  let alwaysFakeWorkerWorkerControllerCache;
@@ -32644,12 +32293,9 @@ const UrlRewritePostcssPlugin = (opts) => {
32644
32293
  if (isCssUrl && isCssImageSet) promises$2.push(rewriteCssUrls(declaration.value, replacerForDeclaration).then((url$3) => rewriteCssImageSet(url$3, replacerForDeclaration)).then((url$3) => {
32645
32294
  declaration.value = url$3;
32646
32295
  }));
32647
- else {
32648
- const rewriterToUse = isCssImageSet ? rewriteCssImageSet : rewriteCssUrls;
32649
- promises$2.push(rewriterToUse(declaration.value, replacerForDeclaration).then((url$3) => {
32650
- declaration.value = url$3;
32651
- }));
32652
- }
32296
+ else promises$2.push((isCssImageSet ? rewriteCssImageSet : rewriteCssUrls)(declaration.value, replacerForDeclaration).then((url$3) => {
32297
+ declaration.value = url$3;
32298
+ }));
32653
32299
  }
32654
32300
  });
32655
32301
  if (promises$2.length) return Promise.all(promises$2);
@@ -32679,12 +32325,11 @@ const cssNotProcessedRE = /(?:gradient|element|cross-fade|image)\(/;
32679
32325
  async function rewriteCssImageSet(css, replacer) {
32680
32326
  return await asyncReplace(css, cssImageSetRE, async (match) => {
32681
32327
  const [, rawUrl] = match;
32682
- const url$3 = await processSrcSet(rawUrl, async ({ url: url$4 }) => {
32683
- if (cssUrlRE.test(url$4)) return await rewriteCssUrls(url$4, replacer);
32684
- if (!cssNotProcessedRE.test(url$4)) return await doUrlReplace(url$4, url$4, replacer);
32685
- return url$4;
32328
+ return await processSrcSet(rawUrl, async ({ url: url$3 }) => {
32329
+ if (cssUrlRE.test(url$3)) return await rewriteCssUrls(url$3, replacer);
32330
+ if (!cssNotProcessedRE.test(url$3)) return await doUrlReplace(url$3, url$3, replacer);
32331
+ return url$3;
32686
32332
  });
32687
- return url$3;
32688
32333
  });
32689
32334
  }
32690
32335
  function skipUrlReplacer(unquotedUrl) {
@@ -32717,8 +32362,7 @@ async function doImportCSSReplace(rawUrl, matched, replacer) {
32717
32362
  if (skipUrlReplacer(unquotedUrl)) return matched;
32718
32363
  const newUrl = await replacer(unquotedUrl, rawUrl);
32719
32364
  if (newUrl === false) return matched;
32720
- const prefix = matched.includes("url(") ? "url(" : "";
32721
- return `@import ${prefix}${wrap$1}${newUrl}${wrap$1}`;
32365
+ return `@import ${matched.includes("url(") ? "url(" : ""}${wrap$1}${newUrl}${wrap$1}`;
32722
32366
  }
32723
32367
  async function minifyCSS(css, config$2, inlined) {
32724
32368
  if (config$2.build.cssMinify === "lightningcss") try {
@@ -32766,8 +32410,7 @@ async function minifyCSS(css, config$2, inlined) {
32766
32410
  } catch (e$1) {
32767
32411
  if (e$1.errors) {
32768
32412
  e$1.message = "[esbuild css minify] " + e$1.message;
32769
- const msgs = await formatMessages(e$1.errors, { kind: "error" });
32770
- e$1.frame = "\n" + msgs.join("\n");
32413
+ e$1.frame = "\n" + (await formatMessages(e$1.errors, { kind: "error" })).join("\n");
32771
32414
  e$1.loc = e$1.errors[0].location;
32772
32415
  }
32773
32416
  throw e$1;
@@ -32819,8 +32462,7 @@ function loadPreprocessorPath(lang, root) {
32819
32462
  const cached = loadedPreprocessorPath[lang];
32820
32463
  if (cached) return cached;
32821
32464
  try {
32822
- const resolved = requireResolveFromRootWithFallback(root, lang);
32823
- return loadedPreprocessorPath[lang] = resolved;
32465
+ return loadedPreprocessorPath[lang] = requireResolveFromRootWithFallback(root, lang);
32824
32466
  } catch (e$1) {
32825
32467
  if (e$1.code === "MODULE_NOT_FOUND") {
32826
32468
  const installCommand = getPackageManagerCommand("install");
@@ -32834,17 +32476,15 @@ function loadPreprocessorPath(lang, root) {
32834
32476
  }
32835
32477
  function loadSassPackage(root) {
32836
32478
  try {
32837
- const path$13 = loadPreprocessorPath("sass-embedded", root);
32838
32479
  return {
32839
32480
  name: "sass-embedded",
32840
- path: path$13
32481
+ path: loadPreprocessorPath("sass-embedded", root)
32841
32482
  };
32842
32483
  } catch (e1) {
32843
32484
  try {
32844
- const path$13 = loadPreprocessorPath(PreprocessLang.sass, root);
32845
32485
  return {
32846
32486
  name: "sass",
32847
- path: path$13
32487
+ path: loadPreprocessorPath(PreprocessLang.sass, root)
32848
32488
  };
32849
32489
  } catch {
32850
32490
  throw e1;
@@ -32869,7 +32509,7 @@ function cleanScssBugUrl(url$3) {
32869
32509
  }
32870
32510
  const makeScssWorker = (environment, resolvers, _maxWorkers) => {
32871
32511
  let compilerPromise;
32872
- const worker = {
32512
+ return {
32873
32513
  async run(sassPath, data, options$1) {
32874
32514
  const sass = (await import(pathToFileURL(sassPath).href)).default;
32875
32515
  compilerPromise ??= sass.initAsyncCompiler();
@@ -32878,8 +32518,7 @@ const makeScssWorker = (environment, resolvers, _maxWorkers) => {
32878
32518
  sassOptions.url = pathToFileURL(options$1.filename);
32879
32519
  sassOptions.sourceMap = options$1.enableSourcemap;
32880
32520
  const skipRebaseUrls = (unquotedUrl, rawUrl) => {
32881
- const isQuoted = rawUrl[0] === "\"" || rawUrl[0] === "'";
32882
- if (!isQuoted && unquotedUrl[0] === "$") return true;
32521
+ if (!(rawUrl[0] === "\"" || rawUrl[0] === "'") && unquotedUrl[0] === "$") return true;
32883
32522
  return unquotedUrl.startsWith("#{");
32884
32523
  };
32885
32524
  const internalImporter = {
@@ -32895,9 +32534,8 @@ const makeScssWorker = (environment, resolvers, _maxWorkers) => {
32895
32534
  if (ext === ".sass") syntax = "indented";
32896
32535
  else if (ext === ".css") syntax = "css";
32897
32536
  const result$1 = await rebaseUrls(environment, fileURLToPath(canonicalUrl), options$1.filename, resolvers.sass, skipRebaseUrls);
32898
- const contents = result$1.contents ?? await fsp.readFile(result$1.file, "utf-8");
32899
32537
  return {
32900
- contents,
32538
+ contents: result$1.contents ?? await fsp.readFile(result$1.file, "utf-8"),
32901
32539
  syntax,
32902
32540
  sourceMapUrl: canonicalUrl
32903
32541
  };
@@ -32913,12 +32551,10 @@ const makeScssWorker = (environment, resolvers, _maxWorkers) => {
32913
32551
  };
32914
32552
  },
32915
32553
  async stop() {
32916
- const compiler = await compilerPromise;
32917
- await compiler?.dispose();
32554
+ await (await compilerPromise)?.dispose();
32918
32555
  compilerPromise = void 0;
32919
32556
  }
32920
32557
  };
32921
- return worker;
32922
32558
  };
32923
32559
  const scssProcessor = (maxWorkers) => {
32924
32560
  let worker;
@@ -33000,17 +32636,14 @@ const makeLessWorker = (environment, resolvers, maxWorkers) => {
33000
32636
  const viteLessResolve = async (filename, dir, rootFile, mime) => {
33001
32637
  const resolved = await resolvers.less(environment, filename, path.join(dir, "*"));
33002
32638
  if (!resolved) return void 0;
33003
- if (mime === "application/javascript") {
33004
- const file = path.resolve(resolved);
33005
- return { resolved: file };
33006
- }
32639
+ if (mime === "application/javascript") return { resolved: path.resolve(resolved) };
33007
32640
  const result = await rebaseUrls(environment, resolved, rootFile, resolvers.less, skipRebaseUrls);
33008
32641
  return {
33009
32642
  resolved,
33010
32643
  contents: "contents" in result ? result.contents : void 0
33011
32644
  };
33012
32645
  };
33013
- const worker = new WorkerWithFallback(async () => {
32646
+ return new WorkerWithFallback(async () => {
33014
32647
  const [fsp$1, path$13] = await Promise.all([import("node:fs/promises"), import("node:path")]);
33015
32648
  let ViteLessManager;
33016
32649
  const createViteLessPlugin = (less, rootFile) => {
@@ -33050,7 +32683,7 @@ const makeLessWorker = (environment, resolvers, maxWorkers) => {
33050
32683
  return async (lessPath, content, options$1) => {
33051
32684
  const nodeLess = (await import(lessPath)).default;
33052
32685
  const viteResolverPlugin = createViteLessPlugin(nodeLess, options$1.filename);
33053
- const result = await nodeLess.render(content, {
32686
+ return await nodeLess.render(content, {
33054
32687
  paths: ["node_modules"],
33055
32688
  ...options$1,
33056
32689
  plugins: [viteResolverPlugin, ...options$1.plugins || []],
@@ -33059,7 +32692,6 @@ const makeLessWorker = (environment, resolvers, maxWorkers) => {
33059
32692
  sourceMapFileInline: false
33060
32693
  } } : {}
33061
32694
  });
33062
- return result;
33063
32695
  };
33064
32696
  }, {
33065
32697
  parentFunctions: { viteLessResolve },
@@ -33068,7 +32700,6 @@ const makeLessWorker = (environment, resolvers, maxWorkers) => {
33068
32700
  },
33069
32701
  max: maxWorkers
33070
32702
  });
33071
- return worker;
33072
32703
  };
33073
32704
  const lessProcessor = (maxWorkers) => {
33074
32705
  let worker;
@@ -33113,7 +32744,7 @@ const lessProcessor = (maxWorkers) => {
33113
32744
  };
33114
32745
  };
33115
32746
  const makeStylWorker = (maxWorkers) => {
33116
- const worker = new WorkerWithFallback(() => {
32747
+ return new WorkerWithFallback(() => {
33117
32748
  return async (stylusPath, content, root, options$1) => {
33118
32749
  const nodeStylus = (await import(stylusPath)).default;
33119
32750
  const ref = nodeStylus(content, {
@@ -33138,7 +32769,6 @@ const makeStylWorker = (maxWorkers) => {
33138
32769
  },
33139
32770
  max: maxWorkers
33140
32771
  });
33141
- return worker;
33142
32772
  };
33143
32773
  const stylProcessor = (maxWorkers) => {
33144
32774
  let worker;
@@ -33184,16 +32814,16 @@ function formatStylusSourceMap(mapBefore, root) {
33184
32814
  map$1.sources = map$1.sources.map(resolveFromRoot);
33185
32815
  return map$1;
33186
32816
  }
33187
- async function getSource(source, filename, additionalData, enableSourcemap, sep$4 = "") {
32817
+ async function getSource(source, filename, additionalData, enableSourcemap, sep$3 = "") {
33188
32818
  if (!additionalData) return { content: source };
33189
32819
  if (typeof additionalData === "function") {
33190
32820
  const newContent = await additionalData(source, filename);
33191
32821
  if (typeof newContent === "string") return { content: newContent };
33192
32822
  return newContent;
33193
32823
  }
33194
- if (!enableSourcemap) return { content: additionalData + sep$4 + source };
32824
+ if (!enableSourcemap) return { content: additionalData + sep$3 + source };
33195
32825
  const ms = new MagicString(source);
33196
- ms.appendLeft(0, sep$4);
32826
+ ms.appendLeft(0, sep$3);
33197
32827
  ms.appendLeft(0, additionalData);
33198
32828
  const map$1 = ms.generateMap({ hires: "boundary" });
33199
32829
  map$1.file = filename;
@@ -33266,10 +32896,7 @@ async function compileLightningCSS(environment, id, src, deps, workerController,
33266
32896
  const result = await compileCSSPreprocessors(environment, id, lang, code, workerController);
33267
32897
  result.deps?.forEach((dep) => deps.add(dep));
33268
32898
  return result.code;
33269
- } else if (lang === "sss") {
33270
- const sssResult = await transformSugarSS(environment, id, code);
33271
- return sssResult.code;
33272
- }
32899
+ } else if (lang === "sss") return (await transformSugarSS(environment, id, code)).code;
33273
32900
  return code;
33274
32901
  },
33275
32902
  async resolve(id$1, from) {
@@ -33366,7 +32993,6 @@ function getLightningCssErrorMessageForIeSyntaxes(code) {
33366
32993
  const commonIeMessage = ", which was used in the past to support old Internet Explorer versions. This is not a valid CSS syntax and will be ignored by modern browsers. \nWhile this is not supported by LightningCSS, you can set `css.lightningcss.errorRecovery: true` to strip these codes.";
33367
32994
  if (/[\s;{]\*[a-zA-Z-][\w-]+\s*:/.test(code)) return ".\nThis file contains star property hack (e.g. `*zoom`)" + commonIeMessage;
33368
32995
  if (/min-width:\s*0\\0/.test(code)) return ".\nThis file contains @media zero hack (e.g. `@media (min-width: 0\\0)`)" + commonIeMessage;
33369
- return void 0;
33370
32996
  }
33371
32997
  const map = {
33372
32998
  chrome: "chrome",
@@ -33482,8 +33108,8 @@ const convertTargets = (esbuildTarget) => {
33482
33108
  function resolveLibCssFilename(libOptions, root, packageCache) {
33483
33109
  if (typeof libOptions.cssFileName === "string") return `${libOptions.cssFileName}.css`;
33484
33110
  else if (typeof libOptions.fileName === "string") return `${libOptions.fileName}.css`;
33485
- const packageJson$1 = findNearestMainPackageData(root, packageCache)?.data;
33486
- const name = packageJson$1 ? getPkgName(packageJson$1.name) : void 0;
33111
+ const packageJson = findNearestMainPackageData(root, packageCache)?.data;
33112
+ const name = packageJson ? getPkgName(packageJson.name) : void 0;
33487
33113
  if (!name) throw new Error("Name in package.json is required if option \"build.lib.cssFileName\" is not provided.");
33488
33114
  return `${name}.css`;
33489
33115
  }
@@ -33509,8 +33135,7 @@ function toRelativePath(filename, importer) {
33509
33135
  }
33510
33136
  function indexOfMatchInSlice(str, reg, pos = 0) {
33511
33137
  reg.lastIndex = pos;
33512
- const result = reg.exec(str);
33513
- return result?.index ?? -1;
33138
+ return reg.exec(str)?.index ?? -1;
33514
33139
  }
33515
33140
  /**
33516
33141
  * Helper for preloading CSS and direct imports of async chunks in parallel to
@@ -33541,8 +33166,7 @@ function preload(baseModule, deps, importerUrl) {
33541
33166
  seen[dep] = true;
33542
33167
  const isCss = dep.endsWith(".css");
33543
33168
  const cssSelector = isCss ? "[rel=\"stylesheet\"]" : "";
33544
- const isBaseRelative = !!importerUrl;
33545
- if (isBaseRelative) for (let i$1 = links.length - 1; i$1 >= 0; i$1--) {
33169
+ if (!!importerUrl) for (let i$1 = links.length - 1; i$1 >= 0; i$1--) {
33546
33170
  const link$1 = links[i$1];
33547
33171
  if (link$1.href === dep && (!isCss || link$1.rel === "stylesheet")) return;
33548
33172
  }
@@ -33578,8 +33202,7 @@ function getPreloadCode(environment, renderBuiltUrlBoolean, isRelativeBase) {
33578
33202
  const { modulePreload } = environment.config.build;
33579
33203
  const scriptRel$1 = modulePreload && modulePreload.polyfill ? `'modulepreload'` : `/* @__PURE__ */ (${detectScriptRel.toString()})()`;
33580
33204
  const assetsURL$1 = renderBuiltUrlBoolean || isRelativeBase ? `function(dep, importerUrl) { return new URL(dep, importerUrl).href }` : `function(dep) { return ${JSON.stringify(environment.config.base)}+dep }`;
33581
- const preloadCode = `const scriptRel = ${scriptRel$1};const assetsURL = ${assetsURL$1};const seen = {};export const ${preloadMethod} = ${preload.toString()}`;
33582
- return preloadCode;
33205
+ return `const scriptRel = ${scriptRel$1};const assetsURL = ${assetsURL$1};const seen = {};export const ${preloadMethod} = ${preload.toString()}`;
33583
33206
  }
33584
33207
  /**
33585
33208
  * Build only. During serve this is performed as part of ./importAnalysis.
@@ -33599,9 +33222,8 @@ function buildImportAnalysisPlugin(config$2) {
33599
33222
  load: {
33600
33223
  filter: { id: exactRegex(preloadHelperId) },
33601
33224
  handler(_id) {
33602
- const preloadCode = getPreloadCode(this.environment, !!renderBuiltUrl, isRelativeBase);
33603
33225
  return {
33604
- code: preloadCode,
33226
+ code: getPreloadCode(this.environment, !!renderBuiltUrl, isRelativeBase),
33605
33227
  moduleSideEffects: false
33606
33228
  };
33607
33229
  }
@@ -33787,8 +33409,7 @@ function buildImportAnalysisPlugin(config$2) {
33787
33409
  });
33788
33410
  }
33789
33411
  } else {
33790
- const removedPureCssFiles = removedPureCssFilesCache.get(config$2);
33791
- const chunk$2 = removedPureCssFiles.get(filename);
33412
+ const chunk$2 = removedPureCssFilesCache.get(config$2).get(filename);
33792
33413
  if (chunk$2) {
33793
33414
  if (chunk$2.viteMetadata.importedCss.size) {
33794
33415
  chunk$2.viteMetadata.importedCss.forEach((file$1) => {
@@ -33828,8 +33449,7 @@ function buildImportAnalysisPlugin(config$2) {
33828
33449
  }
33829
33450
  }
33830
33451
  if (fileDeps.length > 0) {
33831
- const fileDepsCode = `[${fileDeps.map((fileDep) => fileDep.runtime ? fileDep.url : JSON.stringify(fileDep.url)).join(",")}]`;
33832
- const mapDepsCode = `const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=${fileDepsCode})))=>i.map(i=>d[i]);\n`;
33452
+ const mapDepsCode = `const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=${`[${fileDeps.map((fileDep) => fileDep.runtime ? fileDep.url : JSON.stringify(fileDep.url)).join(",")}]`})))=>i.map(i=>d[i]);\n`;
33833
33453
  if (code.startsWith("#!")) s$2.prependLeft(code.indexOf("\n") + 1, mapDepsCode);
33834
33454
  else s$2.prepend(mapDepsCode);
33835
33455
  }
@@ -34092,7 +33712,7 @@ function resolveBuildEnvironmentOptions(raw, logger, consumer) {
34092
33712
  if (merged.minify === "false") merged.minify = false;
34093
33713
  else if (merged.minify === true) merged.minify = "esbuild";
34094
33714
  const defaultModulePreload = { polyfill: true };
34095
- const resolved = {
33715
+ return {
34096
33716
  ...merged,
34097
33717
  cssTarget: merged.cssTarget ?? merged.target,
34098
33718
  cssMinify: merged.cssMinify ?? (consumer === "server" ? "esbuild" : !!merged.minify),
@@ -34101,7 +33721,6 @@ function resolveBuildEnvironmentOptions(raw, logger, consumer) {
34101
33721
  ...merged.modulePreload
34102
33722
  }
34103
33723
  };
34104
- return resolved;
34105
33724
  }
34106
33725
  async function resolveBuildPlugins(config$2) {
34107
33726
  return {
@@ -34110,8 +33729,7 @@ async function resolveBuildPlugins(config$2) {
34110
33729
  ...!config$2.isWorker ? [prepareOutDirPlugin()] : [],
34111
33730
  perEnvironmentPlugin("commonjs", (environment) => {
34112
33731
  const { commonjsOptions } = environment.config.build;
34113
- const usePluginCommonjs = !Array.isArray(commonjsOptions.include) || commonjsOptions.include.length !== 0;
34114
- return usePluginCommonjs ? commonjs(commonjsOptions) : false;
33732
+ return !Array.isArray(commonjsOptions.include) || commonjsOptions.include.length !== 0 ? commonjs(commonjsOptions) : false;
34115
33733
  }),
34116
33734
  dataURIPlugin(),
34117
33735
  perEnvironmentPlugin("vite:rollup-options-plugins", async (environment) => (await asyncFlatten(arraify(environment.config.build.rollupOptions.plugins))).filter(Boolean)),
@@ -34152,8 +33770,7 @@ function resolveRollupOptions(environment) {
34152
33770
  const input = libOptions ? options$1.rollupOptions.input || (typeof libOptions.entry === "string" ? resolve$4(libOptions.entry) : Array.isArray(libOptions.entry) ? libOptions.entry.map(resolve$4) : Object.fromEntries(Object.entries(libOptions.entry).map(([alias$2, file]) => [alias$2, resolve$4(file)]))) : typeof options$1.ssr === "string" ? resolve$4(options$1.ssr) : options$1.rollupOptions.input || resolve$4("index.html");
34153
33771
  if (ssr && typeof input === "string" && input.endsWith(".html")) throw new Error("rollupOptions.input should not be an html file when building for SSR. Please specify a dedicated SSR entry.");
34154
33772
  if (options$1.cssCodeSplit === false) {
34155
- const inputs = typeof input === "string" ? [input] : Array.isArray(input) ? input : Object.values(input);
34156
- if (inputs.some((input$1) => input$1.endsWith(".css"))) throw new Error(`When "build.cssCodeSplit: false" is set, "rollupOptions.input" should not include CSS files.`);
33773
+ if ((typeof input === "string" ? [input] : Array.isArray(input) ? input : Object.values(input)).some((input$1) => input$1.endsWith(".css"))) throw new Error(`When "build.cssCodeSplit: false" is set, "rollupOptions.input" should not include CSS files.`);
34157
33774
  }
34158
33775
  const outDir = resolve$4(options$1.outDir);
34159
33776
  const plugins$1 = environment.plugins.map((p) => injectEnvironmentToHooks(environment, p));
@@ -34202,8 +33819,7 @@ function resolveRollupOptions(environment) {
34202
33819
  async function buildEnvironment(environment) {
34203
33820
  const { logger, config: config$2 } = environment;
34204
33821
  const { root, build: options$1 } = config$2;
34205
- const ssr = config$2.consumer === "server";
34206
- logger.info(import_picocolors$4.default.cyan(`vite v${VERSION} ${import_picocolors$4.default.green(`building ${ssr ? `SSR bundle ` : ``}for ${environment.config.mode}...`)}`));
33822
+ logger.info(import_picocolors$4.default.cyan(`vite v${VERSION} ${import_picocolors$4.default.green(`building ${config$2.consumer === "server" ? `SSR bundle ` : ``}for ${environment.config.mode}...`)}`));
34207
33823
  let bundle;
34208
33824
  let startTime;
34209
33825
  try {
@@ -34284,8 +33900,7 @@ function extractStack(e$1) {
34284
33900
  * This function normalizes the frame to match the esbuild format which has more pleasing padding
34285
33901
  */
34286
33902
  function normalizeCodeFrame(frame) {
34287
- const trimmedPadding = frame.replace(/^\n|\n$/g, "");
34288
- return `\n${trimmedPadding}\n`;
33903
+ return `\n${frame.replace(/^\n|\n$/g, "")}\n`;
34289
33904
  }
34290
33905
  function resolveOutputJsExtension(format$3, type = "commonjs") {
34291
33906
  if (type === "module") return format$3 === "cjs" || format$3 === "umd" ? "cjs" : "js";
@@ -34293,10 +33908,10 @@ function resolveOutputJsExtension(format$3, type = "commonjs") {
34293
33908
  }
34294
33909
  function resolveLibFilename(libOptions, format$3, entryName, root, extension$1, packageCache) {
34295
33910
  if (typeof libOptions.fileName === "function") return libOptions.fileName(format$3, entryName);
34296
- const packageJson$1 = findNearestMainPackageData(root, packageCache)?.data;
34297
- const name = libOptions.fileName || (packageJson$1 && typeof libOptions.entry === "string" ? getPkgName(packageJson$1.name) : entryName);
33911
+ const packageJson = findNearestMainPackageData(root, packageCache)?.data;
33912
+ const name = libOptions.fileName || (packageJson && typeof libOptions.entry === "string" ? getPkgName(packageJson.name) : entryName);
34298
33913
  if (!name) throw new Error("Name in package.json is required if option \"build.lib.fileName\" is not provided.");
34299
- extension$1 ??= resolveOutputJsExtension(format$3, packageJson$1?.type);
33914
+ extension$1 ??= resolveOutputJsExtension(format$3, packageJson?.type);
34300
33915
  if (format$3 === "cjs" || format$3 === "es") return `${name}.${extension$1}`;
34301
33916
  return `${name}.${format$3}.${extension$1}`;
34302
33917
  }
@@ -34324,8 +33939,7 @@ function resolveBuildOutputs(outputs, libOptions, logger) {
34324
33939
  const warningIgnoreList = [`CIRCULAR_DEPENDENCY`, `THIS_IS_UNDEFINED`];
34325
33940
  const dynamicImportWarningIgnoreList = [`Unsupported expression`, `statically analyzed`];
34326
33941
  function clearLine() {
34327
- const tty$2 = process.stdout.isTTY && !process.env.CI;
34328
- if (tty$2) {
33942
+ if (process.stdout.isTTY && !process.env.CI) {
34329
33943
  process.stdout.clearLine(0);
34330
33944
  process.stdout.cursorTo(0);
34331
33945
  }
@@ -34368,10 +33982,8 @@ function onRollupLog(level, log$4, environment) {
34368
33982
  const normalizedUserOnWarn = normalizeUserOnWarn(userOnWarn, viteLog);
34369
33983
  userOnLog(level, log$4, normalizedUserOnWarn);
34370
33984
  } else userOnLog(level, log$4, viteLog);
34371
- else if (userOnWarn) {
34372
- const normalizedUserOnWarn = normalizeUserOnWarn(userOnWarn, viteLog);
34373
- normalizedUserOnWarn(level, log$4);
34374
- } else viteLog(level, log$4);
33985
+ else if (userOnWarn) normalizeUserOnWarn(userOnWarn, viteLog)(level, log$4);
33986
+ else viteLog(level, log$4);
34375
33987
  }
34376
33988
  function normalizeUserOnWarn(userOnWarn, defaultHandler) {
34377
33989
  return (logLevel, logging) => {
@@ -34490,7 +34102,7 @@ const getResolveUrl = (path$13, URL$4 = "URL") => `new ${URL$4}(${path$13}).href
34490
34102
  const getRelativeUrlFromDocument = (relativePath, umd = false) => getResolveUrl(`'${escapeId(partialEncodeURIPath(relativePath))}', ${umd ? `typeof document === 'undefined' ? location.href : ` : ""}document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`);
34491
34103
  const getFileUrlFromFullPath = (path$13) => `require('u' + 'rl').pathToFileURL(${path$13}).href`;
34492
34104
  const getFileUrlFromRelativePath = (path$13) => getFileUrlFromFullPath(`__dirname + '/${escapeId(path$13)}'`);
34493
- const relativeUrlMechanisms = {
34105
+ const customRelativeUrlMechanisms = {
34494
34106
  amd: (relativePath) => {
34495
34107
  if (relativePath[0] !== ".") relativePath = "./" + relativePath;
34496
34108
  return getResolveUrl(`require.toUrl('${escapeId(relativePath)}'), document.baseURI`);
@@ -34499,10 +34111,7 @@ const relativeUrlMechanisms = {
34499
34111
  es: (relativePath) => getResolveUrl(`'${escapeId(partialEncodeURIPath(relativePath))}', import.meta.url`),
34500
34112
  iife: (relativePath) => getRelativeUrlFromDocument(relativePath),
34501
34113
  system: (relativePath) => getResolveUrl(`'${escapeId(partialEncodeURIPath(relativePath))}', module.meta.url`),
34502
- umd: (relativePath) => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath(relativePath)} : ${getRelativeUrlFromDocument(relativePath, true)})`
34503
- };
34504
- const customRelativeUrlMechanisms = {
34505
- ...relativeUrlMechanisms,
34114
+ umd: (relativePath) => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath(relativePath)} : ${getRelativeUrlFromDocument(relativePath, true)})`,
34506
34115
  "worker-iife": (relativePath) => getResolveUrl(`'${escapeId(partialEncodeURIPath(relativePath))}', self.location.href`)
34507
34116
  };
34508
34117
  function toOutputFilePathInJS(environment, filename, type, hostId, hostType, toRelative) {
@@ -34526,8 +34135,7 @@ function toOutputFilePathInJS(environment, filename, type, hostId, hostType, toR
34526
34135
  return joinUrlSegments(decodedBase, filename);
34527
34136
  }
34528
34137
  function createToImportMetaURLBasedRelativeRuntime(format$3, isWorker) {
34529
- const formatLong = isWorker && format$3 === "iife" ? "worker-iife" : format$3;
34530
- const toRelativePath$1 = customRelativeUrlMechanisms[formatLong];
34138
+ const toRelativePath$1 = customRelativeUrlMechanisms[isWorker && format$3 === "iife" ? "worker-iife" : format$3];
34531
34139
  return (filename, importer) => ({ runtime: toRelativePath$1(path.posix.relative(path.dirname(importer), filename)) });
34532
34140
  }
34533
34141
  function toOutputFilePathWithoutRuntime(filename, type, hostId, hostType, config$2, toRelative) {
@@ -34582,8 +34190,7 @@ function resolveBuilderOptions(options$1) {
34582
34190
  async function createBuilder(inlineConfig = {}, useLegacyBuilder = false) {
34583
34191
  const patchConfig = (resolved) => {
34584
34192
  if (!(useLegacyBuilder ?? !resolved.builder)) return;
34585
- const environmentName = resolved.build.ssr ? "ssr" : "client";
34586
- resolved.build = { ...resolved.environments[environmentName].build };
34193
+ resolved.build = { ...resolved.environments[resolved.build.ssr ? "ssr" : "client"].build };
34587
34194
  };
34588
34195
  const config$2 = await resolveConfigToBuild(inlineConfig, patchConfig);
34589
34196
  useLegacyBuilder ??= !config$2.builder;
@@ -34604,8 +34211,7 @@ async function createBuilder(inlineConfig = {}, useLegacyBuilder = false) {
34604
34211
  configBuilderBuildAppCalled = true;
34605
34212
  await configBuilder.buildApp(builder);
34606
34213
  }
34607
- const handler = getHookHandler(hook);
34608
- await handler.call(pluginContext, builder);
34214
+ await getHookHandler(hook).call(pluginContext, builder);
34609
34215
  }
34610
34216
  if (!configBuilderBuildAppCalled) await configBuilder.buildApp(builder);
34611
34217
  if (Object.values(builder.environments).every((environment) => !environment.isBuilt)) for (const environment of Object.values(builder.environments)) await builder.build(environment);
@@ -34969,8 +34575,7 @@ function createDepsOptimizer(environment) {
34969
34575
  });
34970
34576
  }
34971
34577
  async function rerun() {
34972
- const deps = Object.keys(metadata.discovered);
34973
- const depsString = depsLogString(deps);
34578
+ const depsString = depsLogString(Object.keys(metadata.discovered));
34974
34579
  debug$1?.(import_picocolors$3.default.green(`new dependencies found: ${depsString}`));
34975
34580
  runOptimizer();
34976
34581
  }
@@ -35030,8 +34635,7 @@ function createDepsOptimizer(environment) {
35030
34635
  }
35031
34636
  const needsInteropMismatch = findInteropMismatches(metadata.discovered, result.metadata.optimized);
35032
34637
  const scannerMissedDeps = crawlDeps.some((dep) => !scanDeps.includes(dep));
35033
- const outdatedResult = needsInteropMismatch.length > 0 || scannerMissedDeps;
35034
- if (outdatedResult) {
34638
+ if (needsInteropMismatch.length > 0 || scannerMissedDeps) {
35035
34639
  result.cancel();
35036
34640
  for (const dep of scanDeps) if (!crawlDeps.includes(dep)) addMissingDep(dep, result.metadata.optimized[dep].src);
35037
34641
  if (scannerMissedDeps) debug$1?.(import_picocolors$3.default.yellow(`✨ new dependencies were found while crawling that weren't detected by the scanner`));
@@ -35266,8 +34870,7 @@ var EnvironmentModuleGraph = class {
35266
34870
  }
35267
34871
  }
35268
34872
  if (resolvePromises.length) await Promise.all(resolvePromises);
35269
- const nextImports = new Set(resolveResults);
35270
- mod.importedModules = nextImports;
34873
+ mod.importedModules = new Set(resolveResults);
35271
34874
  prevImports.forEach((dep) => {
35272
34875
  if (!mod.importedModules.has(dep)) {
35273
34876
  dep.importers.delete(mod);
@@ -35652,8 +35255,7 @@ var RunnableDevEnvironment = class extends DevEnvironment {
35652
35255
  }
35653
35256
  get runner() {
35654
35257
  if (this._runner) return this._runner;
35655
- const factory = this._runnerFactory || createServerModuleRunner;
35656
- this._runner = factory(this, this._runnerOptions);
35258
+ this._runner = (this._runnerFactory || createServerModuleRunner)(this, this._runnerOptions);
35657
35259
  return this._runner;
35658
35260
  }
35659
35261
  async close() {
@@ -35903,8 +35505,7 @@ async function runnerImport(moduleId, inlineConfig) {
35903
35505
  await environment.init();
35904
35506
  try {
35905
35507
  const module$1 = await environment.runner.import(moduleId);
35906
- const modules = [...environment.runner.evaluatedModules.urlToIdModuleMap.values()];
35907
- const dependencies = modules.filter((m$2) => {
35508
+ const dependencies = [...environment.runner.evaluatedModules.urlToIdModuleMap.values()].filter((m$2) => {
35908
35509
  if (!m$2.meta || "externalize" in m$2.meta) return false;
35909
35510
  return m$2.exports !== module$1;
35910
35511
  }).map((m$2) => m$2.file);
@@ -36025,8 +35626,7 @@ function resolveDevEnvironmentOptions(dev, environmentName, consumer, preTransfo
36025
35626
  };
36026
35627
  }
36027
35628
  function resolveEnvironmentOptions(options$1, alias$2, preserveSymlinks, forceOptimizeDeps, logger, environmentName, isSsrTargetWebworkerSet, preTransformRequests) {
36028
- const isClientEnvironment = environmentName === "client";
36029
- const consumer = options$1.consumer ?? (isClientEnvironment ? "client" : "server");
35629
+ const consumer = options$1.consumer ?? (environmentName === "client" ? "client" : "server");
36030
35630
  const isSsrTargetWebworkerEnvironment = isSsrTargetWebworkerSet && environmentName === "ssr";
36031
35631
  if (options$1.define?.["process.env"]) {
36032
35632
  const processEnvDefine = options$1.define["process.env"];
@@ -36070,8 +35670,7 @@ function checkBadCharactersInPath(name, path$13, logger) {
36070
35670
  if (path$13.includes("*")) badChars.push("*");
36071
35671
  if (badChars.length > 0) {
36072
35672
  const charString = badChars.map((c) => `"${c}"`).join(" and ");
36073
- const inflectedChars = badChars.length > 1 ? "characters" : "character";
36074
- logger.warn(import_picocolors.default.yellow(`${name} contains the ${charString} ${inflectedChars} (${import_picocolors.default.cyan(path$13)}), which may not work when running Vite. Consider renaming the directory / file to remove the characters.`));
35673
+ logger.warn(import_picocolors.default.yellow(`${name} contains the ${charString} ${badChars.length > 1 ? "characters" : "character"} (${import_picocolors.default.cyan(path$13)}), which may not work when running Vite. Consider renaming the directory / file to remove the characters.`));
36075
35674
  }
36076
35675
  }
36077
35676
  const clientAlias = [{
@@ -36247,8 +35846,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
36247
35846
  if (!isNodeEnvSet && userNodeEnv) if (userNodeEnv === "development") process.env.NODE_ENV = "development";
36248
35847
  else logger.warn(`NODE_ENV=${userNodeEnv} is not supported in the .env file. Only NODE_ENV=development is supported to create a development build of your project. If you need to set process.env.NODE_ENV, you can set it in the Vite config instead.`);
36249
35848
  const isProduction = process.env.NODE_ENV === "production";
36250
- const relativeBaseShortcut = config$2.base === "" || config$2.base === "./";
36251
- const resolvedBase = relativeBaseShortcut ? !isBuild || config$2.build?.ssr ? "/" : "./" : resolveBaseUrl(config$2.base, isBuild, logger);
35849
+ const resolvedBase = config$2.base === "" || config$2.base === "./" ? !isBuild || config$2.build?.ssr ? "/" : "./" : resolveBaseUrl(config$2.base, isBuild, logger);
36252
35850
  const pkgDir = findNearestPackageData(resolvedRoot, packageCache)?.dir;
36253
35851
  const cacheDir = normalizePath(config$2.cacheDir ? path.resolve(resolvedRoot, config$2.cacheDir) : pkgDir ? path.join(pkgDir, `node_modules/.vite`) : path.join(resolvedRoot, `.vite`));
36254
35852
  const assetsFilter = config$2.assetsInclude && (!Array.isArray(config$2.assetsInclude) || config$2.assetsInclude.length) ? createFilter(config$2.assetsInclude) : () => false;
@@ -36397,7 +35995,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
36397
35995
  for (const name of Object.keys(resolved.environments)) resolved.environments[name].plugins = await resolveEnvironmentPlugins(new PartialEnvironment(name, resolved));
36398
35996
  optimizeDepsDisabledBackwardCompatibility(resolved, resolved.optimizeDeps);
36399
35997
  optimizeDepsDisabledBackwardCompatibility(resolved, resolved.ssr.optimizeDeps, "ssr.");
36400
- if (resolved.environments.ssr) resolved.environments.ssr.build.emitAssets = resolved.build.ssrEmitAssets || resolved.build.emitAssets;
35998
+ if (!resolved.builder?.sharedConfigBuild && resolved.environments.ssr) resolved.environments.ssr.build.emitAssets = resolved.build.ssrEmitAssets || resolved.build.emitAssets;
36401
35999
  debug?.(`using resolved config: %O`, {
36402
36000
  ...resolved,
36403
36001
  plugins: resolved.plugins.map((p) => p.name),
@@ -36411,8 +36009,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
36411
36009
  const assetFileNamesList = outputOption.map((output) => output.assetFileNames);
36412
36010
  if (assetFileNamesList.length > 1) {
36413
36011
  const firstAssetFileNames = assetFileNamesList[0];
36414
- const hasDifferentReference = assetFileNamesList.some((assetFileNames) => assetFileNames !== firstAssetFileNames);
36415
- if (hasDifferentReference) resolved.logger.warn(import_picocolors.default.yellow(`
36012
+ if (assetFileNamesList.some((assetFileNames) => assetFileNames !== firstAssetFileNames)) resolved.logger.warn(import_picocolors.default.yellow(`
36416
36013
  assetFileNames isn't equal for every build.rollupOptions.output. A single pattern across all outputs is supported by Vite.
36417
36014
  `));
36418
36015
  }
@@ -36483,8 +36080,7 @@ async function loadConfigFromFile(configEnv, configFile, configRoot = process.cw
36483
36080
  return null;
36484
36081
  }
36485
36082
  try {
36486
- const resolver$1 = configLoader === "bundle" ? bundleAndLoadConfigFile : configLoader === "runner" ? runnerImportConfigFile : nativeImportConfigFile;
36487
- const { configExport, dependencies } = await resolver$1(resolvedPath);
36083
+ const { configExport, dependencies } = await (configLoader === "bundle" ? bundleAndLoadConfigFile : configLoader === "runner" ? runnerImportConfigFile : nativeImportConfigFile)(resolvedPath);
36488
36084
  debug?.(`config file loaded in ${getTime()}`);
36489
36085
  const config$2 = await (typeof configExport === "function" ? configExport(configEnv) : configExport);
36490
36086
  if (!isObject(config$2)) throw new Error(`config must export or return an object.`);
@@ -36501,9 +36097,8 @@ async function loadConfigFromFile(configEnv, configFile, configRoot = process.cw
36501
36097
  }
36502
36098
  }
36503
36099
  async function nativeImportConfigFile(resolvedPath) {
36504
- const module$1 = await import(pathToFileURL(resolvedPath).href + "?t=" + Date.now());
36505
36100
  return {
36506
- configExport: module$1.default,
36101
+ configExport: (await import(pathToFileURL(resolvedPath).href + "?t=" + Date.now())).default,
36507
36102
  dependencies: []
36508
36103
  };
36509
36104
  }
@@ -36517,9 +36112,8 @@ async function runnerImportConfigFile(resolvedPath) {
36517
36112
  async function bundleAndLoadConfigFile(resolvedPath) {
36518
36113
  const isESM = typeof process.versions.deno === "string" || isFilePathESM(resolvedPath);
36519
36114
  const bundled = await bundleConfigFile(resolvedPath, isESM);
36520
- const userConfig = await loadConfigFromBundledFile(resolvedPath, bundled.code, isESM);
36521
36115
  return {
36522
- configExport: userConfig,
36116
+ configExport: await loadConfigFromBundledFile(resolvedPath, bundled.code, isESM),
36523
36117
  dependencies: bundled.dependencies
36524
36118
  };
36525
36119
  }
@@ -36661,8 +36255,7 @@ async function runConfigHook(config$2, plugins$1, configEnv) {
36661
36255
  const context = new BasicMinimalPluginContext(basePluginContextMeta, tempLogger);
36662
36256
  for (const p of getSortedPluginsByHook("config", plugins$1)) {
36663
36257
  const hook = p.config;
36664
- const handler = getHookHandler(hook);
36665
- const res = await handler.call(context, conf, configEnv);
36258
+ const res = await getHookHandler(hook).call(context, conf, configEnv);
36666
36259
  if (res && res !== conf) conf = mergeConfig(conf, res);
36667
36260
  }
36668
36261
  return conf;