@powerlines/deepkit 0.6.166 → 0.7.0

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.
Files changed (137) hide show
  1. package/bin/deepkit-install.cjs +55 -90
  2. package/dist/capnp-BLx1WTBU.cjs +5175 -0
  3. package/dist/capnp-BiGNkOmV.mjs +4905 -0
  4. package/dist/capnp.cjs +47 -186
  5. package/dist/capnp.d.cts +78 -77
  6. package/dist/{capnp.d.ts → capnp.d.mts} +78 -77
  7. package/dist/capnp.mjs +3 -0
  8. package/dist/chunk-C0xms8kb.cjs +34 -0
  9. package/dist/esbuild-plugin.cjs +47 -11
  10. package/dist/esbuild-plugin.d.cts +20 -18
  11. package/dist/esbuild-plugin.d.mts +35 -0
  12. package/dist/esbuild-plugin.mjs +48 -0
  13. package/dist/index.cjs +69 -250
  14. package/dist/index.d.cts +10 -19
  15. package/dist/index.d.mts +10 -0
  16. package/dist/index.mjs +11 -0
  17. package/dist/reflect-type.cjs +24 -12
  18. package/dist/reflect-type.d.cts +7 -5
  19. package/dist/{reflect-type.d.ts → reflect-type.d.mts} +7 -5
  20. package/dist/reflect-type.mjs +24 -0
  21. package/dist/{reflection-9KUpjPqV.d.cts → reflection-BwdnCwaK.d.cts} +11 -17
  22. package/dist/{reflection-9KUpjPqV.d.ts → reflection-D9R8cdSo.d.mts} +26 -32
  23. package/dist/resolve-reflections.cjs +15 -9
  24. package/dist/resolve-reflections.d.cts +4 -2
  25. package/dist/{resolve-reflections.d.ts → resolve-reflections.d.mts} +4 -2
  26. package/dist/resolve-reflections.mjs +16 -0
  27. package/dist/rolldown-plugin.cjs +44 -11
  28. package/dist/rolldown-plugin.d.cts +5 -3
  29. package/dist/{rolldown-plugin.d.ts → rolldown-plugin.d.mts} +5 -3
  30. package/dist/rolldown-plugin.mjs +45 -0
  31. package/dist/transformer.cjs +52 -13
  32. package/dist/transformer.d.cts +6 -4
  33. package/dist/{transformer.d.ts → transformer.d.mts} +6 -4
  34. package/dist/transformer.mjs +51 -0
  35. package/dist/transpile.cjs +29 -10
  36. package/dist/transpile.d.cts +6 -4
  37. package/dist/{transpile.d.ts → transpile.d.mts} +6 -4
  38. package/dist/transpile.mjs +29 -0
  39. package/dist/types.cjs +0 -4
  40. package/dist/types.d.cts +9 -9
  41. package/dist/{types.d.ts → types.d.mts} +9 -9
  42. package/dist/types.mjs +1 -0
  43. package/dist/utilities.cjs +116 -33
  44. package/dist/utilities.d.cts +4 -2
  45. package/dist/{utilities.d.ts → utilities.d.mts} +4 -2
  46. package/dist/utilities.mjs +111 -0
  47. package/dist/vendor/core.cjs +1240 -513
  48. package/dist/vendor/core.mjs +1116 -0
  49. package/dist/vendor/string-BoXo0wS7.cjs +2983 -0
  50. package/dist/vendor/string-BuMgdahD.mjs +2467 -0
  51. package/dist/vendor/type-BMLjRtLY.cjs +202 -0
  52. package/dist/vendor/type-Dgeqs-rL.mjs +190 -0
  53. package/dist/vendor/type-compiler/compiler-BUrWMhGi.cjs +6792 -0
  54. package/dist/vendor/type-compiler/compiler-Bg8jX6qU.mjs +6739 -0
  55. package/dist/vendor/type-compiler/compiler-D1z5h1MK.d.cts +578 -0
  56. package/dist/vendor/type-compiler/compiler-Nkxc4PLJ.d.mts +578 -0
  57. package/dist/vendor/type-compiler/compiler.cjs +11 -43
  58. package/dist/vendor/type-compiler/compiler.d.cts +2 -3
  59. package/dist/vendor/type-compiler/compiler.d.mts +2 -0
  60. package/dist/vendor/type-compiler/compiler.mjs +3 -0
  61. package/dist/vendor/type-compiler/config-BEX924PC.cjs +3709 -0
  62. package/dist/vendor/type-compiler/config-B_cKkYZm.d.cts +116 -0
  63. package/dist/vendor/type-compiler/config-D9DM7Du_.d.mts +116 -0
  64. package/dist/vendor/type-compiler/config-y0HNkbCH.mjs +3640 -0
  65. package/dist/vendor/type-compiler/config.cjs +9 -34
  66. package/dist/vendor/type-compiler/config.d.cts +2 -1
  67. package/dist/vendor/type-compiler/config.d.mts +2 -0
  68. package/dist/vendor/type-compiler/config.mjs +3 -0
  69. package/dist/vendor/type-compiler/index.cjs +56 -129
  70. package/dist/vendor/type-compiler/index.d.cts +22 -3
  71. package/dist/vendor/type-compiler/index.d.mts +22 -0
  72. package/dist/vendor/type-compiler/index.mjs +50 -0
  73. package/dist/vendor/type-spec.cjs +11 -12
  74. package/dist/vendor/type-spec.mjs +3 -0
  75. package/dist/vendor/type.cjs +8407 -17892
  76. package/dist/vendor/type.d.cts +10 -196
  77. package/dist/vendor/{type.d.ts → type.d.mts} +10 -196
  78. package/dist/vendor/type.mjs +9109 -0
  79. package/package.json +43 -31
  80. package/schemas/reflection.cjs +4018 -4129
  81. package/schemas/reflection.d.cts +30 -38
  82. package/schemas/{reflection.d.ts → reflection.d.mts} +30 -38
  83. package/schemas/reflection.mjs +4036 -0
  84. package/dist/capnp.js +0 -2
  85. package/dist/chunk-23YNDVRG.js +0 -34
  86. package/dist/chunk-27RKMKSF.cjs +0 -50
  87. package/dist/chunk-2XDQUCXZ.js +0 -2392
  88. package/dist/chunk-34OFD7LS.cjs +0 -68
  89. package/dist/chunk-7FXYDYVQ.cjs +0 -5246
  90. package/dist/chunk-7QZGCBH7.cjs +0 -11
  91. package/dist/chunk-ALM6UMVU.js +0 -9
  92. package/dist/chunk-BLLXF42T.cjs +0 -41
  93. package/dist/chunk-H3Q3XL3D.js +0 -19
  94. package/dist/chunk-HPVJ6OV3.cjs +0 -31
  95. package/dist/chunk-JQUKKAFM.js +0 -48
  96. package/dist/chunk-KK7TQA7L.cjs +0 -25
  97. package/dist/chunk-NPV2346T.js +0 -25
  98. package/dist/chunk-ORA4UQMU.cjs +0 -2
  99. package/dist/chunk-OUGDFUKJ.cjs +0 -2400
  100. package/dist/chunk-OULCUN6I.js +0 -1
  101. package/dist/chunk-SHUYVCID.js +0 -4
  102. package/dist/chunk-TDYIUJGY.js +0 -5180
  103. package/dist/chunk-USNT2KNT.cjs +0 -6
  104. package/dist/chunk-WYEFKIRL.js +0 -66
  105. package/dist/esbuild-plugin.d.ts +0 -33
  106. package/dist/esbuild-plugin.js +0 -4
  107. package/dist/index.d.ts +0 -19
  108. package/dist/index.js +0 -10
  109. package/dist/reflect-type.js +0 -5
  110. package/dist/resolve-reflections.js +0 -2
  111. package/dist/rolldown-plugin.js +0 -4
  112. package/dist/transformer.js +0 -2
  113. package/dist/transpile.js +0 -3
  114. package/dist/types.js +0 -1
  115. package/dist/utilities.js +0 -2
  116. package/dist/vendor/chunk-5BKT4CS5.js +0 -28
  117. package/dist/vendor/chunk-BLN7QVCP.js +0 -3704
  118. package/dist/vendor/chunk-BR2FK5K7.js +0 -109
  119. package/dist/vendor/chunk-EPQZMVJO.cjs +0 -3859
  120. package/dist/vendor/chunk-IFK6AU6M.cjs +0 -42
  121. package/dist/vendor/chunk-SHDAXCXF.cjs +0 -115
  122. package/dist/vendor/core.js +0 -2
  123. package/dist/vendor/type-compiler/chunk-3LL3TSRJ.js +0 -3762
  124. package/dist/vendor/type-compiler/chunk-CUTGHVNY.js +0 -7100
  125. package/dist/vendor/type-compiler/chunk-IAWCLVUK.cjs +0 -3780
  126. package/dist/vendor/type-compiler/chunk-UIWPG352.cjs +0 -7114
  127. package/dist/vendor/type-compiler/compiler.d.ts +0 -3
  128. package/dist/vendor/type-compiler/compiler.js +0 -5
  129. package/dist/vendor/type-compiler/config.d.ts +0 -1
  130. package/dist/vendor/type-compiler/config.js +0 -5
  131. package/dist/vendor/type-compiler/index.d.ts +0 -3
  132. package/dist/vendor/type-compiler/index.js +0 -66
  133. package/dist/vendor/type-spec.js +0 -2
  134. package/dist/vendor/type.js +0 -18359
  135. package/schemas/reflection.js +0 -4153
  136. /package/dist/vendor/{core.d.ts → core.d.mts} +0 -0
  137. /package/dist/vendor/{type-spec.d.ts → type-spec.d.mts} +0 -0
@@ -0,0 +1,3640 @@
1
+ import { createRequire } from "node:module";
2
+ import ts from "typescript";
3
+ import { dirname, isAbsolute, join } from "node:path";
4
+ import { readFileSync } from "node:fs";
5
+
6
+ //#region \0rolldown/runtime.js
7
+ var __create = Object.create;
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
+ var __getOwnPropNames = Object.getOwnPropertyNames;
11
+ var __getProtoOf = Object.getPrototypeOf;
12
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
13
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
17
+ key = keys[i];
18
+ if (!__hasOwnProp.call(to, key) && key !== except) {
19
+ __defProp(to, key, {
20
+ get: ((k) => from[k]).bind(null, key),
21
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
22
+ });
23
+ }
24
+ }
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
29
+ value: mod,
30
+ enumerable: true
31
+ }) : target, mod));
32
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
33
+
34
+ //#endregion
35
+ //#region ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=439aa6e683a9a48c3ebbf3529be5811680c45c22d6a265d_be73b50bc43bac944747b8ca0498113a/node_modules/@deepkit/type-compiler/dist/esm/src/debug.js
36
+ function isDebug(level = 1) {
37
+ const expected = "deepkit" + (level > 1 ? "+".repeat(level - 1) : "");
38
+ return "undefined" !== typeof process && "string" === typeof process.env.DEBUG && process.env.DEBUG.includes(expected);
39
+ }
40
+ /**
41
+ * First level debugging with DEBUG=deepkit
42
+ */
43
+ function debug(...message) {
44
+ if (isDebug(1)) console.debug(...message);
45
+ }
46
+ /**
47
+ * Second level debugging with DEBUG=deepkit+
48
+ */
49
+ function debug2(...message) {
50
+ if (isDebug(2)) console.debug(...message);
51
+ }
52
+
53
+ //#endregion
54
+ //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js
55
+ var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
56
+ exports.isInteger = (num) => {
57
+ if (typeof num === "number") return Number.isInteger(num);
58
+ if (typeof num === "string" && num.trim() !== "") return Number.isInteger(Number(num));
59
+ return false;
60
+ };
61
+ /**
62
+ * Find a node of the given type
63
+ */
64
+ exports.find = (node, type) => node.nodes.find((node) => node.type === type);
65
+ /**
66
+ * Find a node of the given type
67
+ */
68
+ exports.exceedsLimit = (min, max, step = 1, limit) => {
69
+ if (limit === false) return false;
70
+ if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
71
+ return (Number(max) - Number(min)) / Number(step) >= limit;
72
+ };
73
+ /**
74
+ * Escape the given node with '\\' before node.value
75
+ */
76
+ exports.escapeNode = (block, n = 0, type) => {
77
+ const node = block.nodes[n];
78
+ if (!node) return;
79
+ if (type && node.type === type || node.type === "open" || node.type === "close") {
80
+ if (node.escaped !== true) {
81
+ node.value = "\\" + node.value;
82
+ node.escaped = true;
83
+ }
84
+ }
85
+ };
86
+ /**
87
+ * Returns true if the given brace node should be enclosed in literal braces
88
+ */
89
+ exports.encloseBrace = (node) => {
90
+ if (node.type !== "brace") return false;
91
+ if (node.commas >> 0 + node.ranges >> 0 === 0) {
92
+ node.invalid = true;
93
+ return true;
94
+ }
95
+ return false;
96
+ };
97
+ /**
98
+ * Returns true if a brace node is invalid.
99
+ */
100
+ exports.isInvalidBrace = (block) => {
101
+ if (block.type !== "brace") return false;
102
+ if (block.invalid === true || block.dollar) return true;
103
+ if (block.commas >> 0 + block.ranges >> 0 === 0) {
104
+ block.invalid = true;
105
+ return true;
106
+ }
107
+ if (block.open !== true || block.close !== true) {
108
+ block.invalid = true;
109
+ return true;
110
+ }
111
+ return false;
112
+ };
113
+ /**
114
+ * Returns true if a node is an open or close node
115
+ */
116
+ exports.isOpenOrClose = (node) => {
117
+ if (node.type === "open" || node.type === "close") return true;
118
+ return node.open === true || node.close === true;
119
+ };
120
+ /**
121
+ * Reduce an array of text nodes.
122
+ */
123
+ exports.reduce = (nodes) => nodes.reduce((acc, node) => {
124
+ if (node.type === "text") acc.push(node.value);
125
+ if (node.type === "range") node.type = "text";
126
+ return acc;
127
+ }, []);
128
+ /**
129
+ * Flatten an array
130
+ */
131
+ exports.flatten = (...args) => {
132
+ const result = [];
133
+ const flat = (arr) => {
134
+ for (let i = 0; i < arr.length; i++) {
135
+ const ele = arr[i];
136
+ if (Array.isArray(ele)) {
137
+ flat(ele);
138
+ continue;
139
+ }
140
+ if (ele !== void 0) result.push(ele);
141
+ }
142
+ return result;
143
+ };
144
+ flat(args);
145
+ return result;
146
+ };
147
+ }));
148
+
149
+ //#endregion
150
+ //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js
151
+ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
152
+ const utils = require_utils$1();
153
+ module.exports = (ast, options = {}) => {
154
+ const stringify = (node, parent = {}) => {
155
+ const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
156
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;
157
+ let output = "";
158
+ if (node.value) {
159
+ if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) return "\\" + node.value;
160
+ return node.value;
161
+ }
162
+ if (node.value) return node.value;
163
+ if (node.nodes) for (const child of node.nodes) output += stringify(child);
164
+ return output;
165
+ };
166
+ return stringify(ast);
167
+ };
168
+ }));
169
+
170
+ //#endregion
171
+ //#region ../../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.js
172
+ /*!
173
+ * is-number <https://github.com/jonschlinkert/is-number>
174
+ *
175
+ * Copyright (c) 2014-present, Jon Schlinkert.
176
+ * Released under the MIT License.
177
+ */
178
+ var require_is_number = /* @__PURE__ */ __commonJSMin(((exports, module) => {
179
+ module.exports = function(num) {
180
+ if (typeof num === "number") return num - num === 0;
181
+ if (typeof num === "string" && num.trim() !== "") return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
182
+ return false;
183
+ };
184
+ }));
185
+
186
+ //#endregion
187
+ //#region ../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js
188
+ /*!
189
+ * to-regex-range <https://github.com/micromatch/to-regex-range>
190
+ *
191
+ * Copyright (c) 2015-present, Jon Schlinkert.
192
+ * Released under the MIT License.
193
+ */
194
+ var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
195
+ const isNumber = require_is_number();
196
+ const toRegexRange = (min, max, options) => {
197
+ if (isNumber(min) === false) throw new TypeError("toRegexRange: expected the first argument to be a number");
198
+ if (max === void 0 || min === max) return String(min);
199
+ if (isNumber(max) === false) throw new TypeError("toRegexRange: expected the second argument to be a number.");
200
+ let opts = {
201
+ relaxZeros: true,
202
+ ...options
203
+ };
204
+ if (typeof opts.strictZeros === "boolean") opts.relaxZeros = opts.strictZeros === false;
205
+ let relax = String(opts.relaxZeros);
206
+ let shorthand = String(opts.shorthand);
207
+ let capture = String(opts.capture);
208
+ let wrap = String(opts.wrap);
209
+ let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
210
+ if (toRegexRange.cache.hasOwnProperty(cacheKey)) return toRegexRange.cache[cacheKey].result;
211
+ let a = Math.min(min, max);
212
+ let b = Math.max(min, max);
213
+ if (Math.abs(a - b) === 1) {
214
+ let result = min + "|" + max;
215
+ if (opts.capture) return `(${result})`;
216
+ if (opts.wrap === false) return result;
217
+ return `(?:${result})`;
218
+ }
219
+ let isPadded = hasPadding(min) || hasPadding(max);
220
+ let state = {
221
+ min,
222
+ max,
223
+ a,
224
+ b
225
+ };
226
+ let positives = [];
227
+ let negatives = [];
228
+ if (isPadded) {
229
+ state.isPadded = isPadded;
230
+ state.maxLen = String(state.max).length;
231
+ }
232
+ if (a < 0) {
233
+ negatives = splitToPatterns(b < 0 ? Math.abs(b) : 1, Math.abs(a), state, opts);
234
+ a = state.a = 0;
235
+ }
236
+ if (b >= 0) positives = splitToPatterns(a, b, state, opts);
237
+ state.negatives = negatives;
238
+ state.positives = positives;
239
+ state.result = collatePatterns(negatives, positives, opts);
240
+ if (opts.capture === true) state.result = `(${state.result})`;
241
+ else if (opts.wrap !== false && positives.length + negatives.length > 1) state.result = `(?:${state.result})`;
242
+ toRegexRange.cache[cacheKey] = state;
243
+ return state.result;
244
+ };
245
+ function collatePatterns(neg, pos, options) {
246
+ let onlyNegative = filterPatterns(neg, pos, "-", false, options) || [];
247
+ let onlyPositive = filterPatterns(pos, neg, "", false, options) || [];
248
+ let intersected = filterPatterns(neg, pos, "-?", true, options) || [];
249
+ return onlyNegative.concat(intersected).concat(onlyPositive).join("|");
250
+ }
251
+ function splitToRanges(min, max) {
252
+ let nines = 1;
253
+ let zeros = 1;
254
+ let stop = countNines(min, nines);
255
+ let stops = new Set([max]);
256
+ while (min <= stop && stop <= max) {
257
+ stops.add(stop);
258
+ nines += 1;
259
+ stop = countNines(min, nines);
260
+ }
261
+ stop = countZeros(max + 1, zeros) - 1;
262
+ while (min < stop && stop <= max) {
263
+ stops.add(stop);
264
+ zeros += 1;
265
+ stop = countZeros(max + 1, zeros) - 1;
266
+ }
267
+ stops = [...stops];
268
+ stops.sort(compare);
269
+ return stops;
270
+ }
271
+ /**
272
+ * Convert a range to a regex pattern
273
+ * @param {Number} `start`
274
+ * @param {Number} `stop`
275
+ * @return {String}
276
+ */
277
+ function rangeToPattern(start, stop, options) {
278
+ if (start === stop) return {
279
+ pattern: start,
280
+ count: [],
281
+ digits: 0
282
+ };
283
+ let zipped = zip(start, stop);
284
+ let digits = zipped.length;
285
+ let pattern = "";
286
+ let count = 0;
287
+ for (let i = 0; i < digits; i++) {
288
+ let [startDigit, stopDigit] = zipped[i];
289
+ if (startDigit === stopDigit) pattern += startDigit;
290
+ else if (startDigit !== "0" || stopDigit !== "9") pattern += toCharacterClass(startDigit, stopDigit, options);
291
+ else count++;
292
+ }
293
+ if (count) pattern += options.shorthand === true ? "\\d" : "[0-9]";
294
+ return {
295
+ pattern,
296
+ count: [count],
297
+ digits
298
+ };
299
+ }
300
+ function splitToPatterns(min, max, tok, options) {
301
+ let ranges = splitToRanges(min, max);
302
+ let tokens = [];
303
+ let start = min;
304
+ let prev;
305
+ for (let i = 0; i < ranges.length; i++) {
306
+ let max = ranges[i];
307
+ let obj = rangeToPattern(String(start), String(max), options);
308
+ let zeros = "";
309
+ if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
310
+ if (prev.count.length > 1) prev.count.pop();
311
+ prev.count.push(obj.count[0]);
312
+ prev.string = prev.pattern + toQuantifier(prev.count);
313
+ start = max + 1;
314
+ continue;
315
+ }
316
+ if (tok.isPadded) zeros = padZeros(max, tok, options);
317
+ obj.string = zeros + obj.pattern + toQuantifier(obj.count);
318
+ tokens.push(obj);
319
+ start = max + 1;
320
+ prev = obj;
321
+ }
322
+ return tokens;
323
+ }
324
+ function filterPatterns(arr, comparison, prefix, intersection, options) {
325
+ let result = [];
326
+ for (let ele of arr) {
327
+ let { string } = ele;
328
+ if (!intersection && !contains(comparison, "string", string)) result.push(prefix + string);
329
+ if (intersection && contains(comparison, "string", string)) result.push(prefix + string);
330
+ }
331
+ return result;
332
+ }
333
+ /**
334
+ * Zip strings
335
+ */
336
+ function zip(a, b) {
337
+ let arr = [];
338
+ for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
339
+ return arr;
340
+ }
341
+ function compare(a, b) {
342
+ return a > b ? 1 : b > a ? -1 : 0;
343
+ }
344
+ function contains(arr, key, val) {
345
+ return arr.some((ele) => ele[key] === val);
346
+ }
347
+ function countNines(min, len) {
348
+ return Number(String(min).slice(0, -len) + "9".repeat(len));
349
+ }
350
+ function countZeros(integer, zeros) {
351
+ return integer - integer % Math.pow(10, zeros);
352
+ }
353
+ function toQuantifier(digits) {
354
+ let [start = 0, stop = ""] = digits;
355
+ if (stop || start > 1) return `{${start + (stop ? "," + stop : "")}}`;
356
+ return "";
357
+ }
358
+ function toCharacterClass(a, b, options) {
359
+ return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
360
+ }
361
+ function hasPadding(str) {
362
+ return /^-?(0+)\d/.test(str);
363
+ }
364
+ function padZeros(value, tok, options) {
365
+ if (!tok.isPadded) return value;
366
+ let diff = Math.abs(tok.maxLen - String(value).length);
367
+ let relax = options.relaxZeros !== false;
368
+ switch (diff) {
369
+ case 0: return "";
370
+ case 1: return relax ? "0?" : "0";
371
+ case 2: return relax ? "0{0,2}" : "00";
372
+ default: return relax ? `0{0,${diff}}` : `0{${diff}}`;
373
+ }
374
+ }
375
+ /**
376
+ * Cache
377
+ */
378
+ toRegexRange.cache = {};
379
+ toRegexRange.clearCache = () => toRegexRange.cache = {};
380
+ /**
381
+ * Expose `toRegexRange`
382
+ */
383
+ module.exports = toRegexRange;
384
+ }));
385
+
386
+ //#endregion
387
+ //#region ../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js
388
+ /*!
389
+ * fill-range <https://github.com/jonschlinkert/fill-range>
390
+ *
391
+ * Copyright (c) 2014-present, Jon Schlinkert.
392
+ * Licensed under the MIT License.
393
+ */
394
+ var require_fill_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
395
+ const util$1 = __require("node:util");
396
+ const toRegexRange = require_to_regex_range();
397
+ const isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
398
+ const transform = (toNumber) => {
399
+ return (value) => toNumber === true ? Number(value) : String(value);
400
+ };
401
+ const isValidValue = (value) => {
402
+ return typeof value === "number" || typeof value === "string" && value !== "";
403
+ };
404
+ const isNumber = (num) => Number.isInteger(+num);
405
+ const zeros = (input) => {
406
+ let value = `${input}`;
407
+ let index = -1;
408
+ if (value[0] === "-") value = value.slice(1);
409
+ if (value === "0") return false;
410
+ while (value[++index] === "0");
411
+ return index > 0;
412
+ };
413
+ const stringify = (start, end, options) => {
414
+ if (typeof start === "string" || typeof end === "string") return true;
415
+ return options.stringify === true;
416
+ };
417
+ const pad = (input, maxLength, toNumber) => {
418
+ if (maxLength > 0) {
419
+ let dash = input[0] === "-" ? "-" : "";
420
+ if (dash) input = input.slice(1);
421
+ input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
422
+ }
423
+ if (toNumber === false) return String(input);
424
+ return input;
425
+ };
426
+ const toMaxLen = (input, maxLength) => {
427
+ let negative = input[0] === "-" ? "-" : "";
428
+ if (negative) {
429
+ input = input.slice(1);
430
+ maxLength--;
431
+ }
432
+ while (input.length < maxLength) input = "0" + input;
433
+ return negative ? "-" + input : input;
434
+ };
435
+ const toSequence = (parts, options, maxLen) => {
436
+ parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
437
+ parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
438
+ let prefix = options.capture ? "" : "?:";
439
+ let positives = "";
440
+ let negatives = "";
441
+ let result;
442
+ if (parts.positives.length) positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|");
443
+ if (parts.negatives.length) negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`;
444
+ if (positives && negatives) result = `${positives}|${negatives}`;
445
+ else result = positives || negatives;
446
+ if (options.wrap) return `(${prefix}${result})`;
447
+ return result;
448
+ };
449
+ const toRange = (a, b, isNumbers, options) => {
450
+ if (isNumbers) return toRegexRange(a, b, {
451
+ wrap: false,
452
+ ...options
453
+ });
454
+ let start = String.fromCharCode(a);
455
+ if (a === b) return start;
456
+ return `[${start}-${String.fromCharCode(b)}]`;
457
+ };
458
+ const toRegex = (start, end, options) => {
459
+ if (Array.isArray(start)) {
460
+ let wrap = options.wrap === true;
461
+ let prefix = options.capture ? "" : "?:";
462
+ return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
463
+ }
464
+ return toRegexRange(start, end, options);
465
+ };
466
+ const rangeError = (...args) => {
467
+ return /* @__PURE__ */ new RangeError("Invalid range arguments: " + util$1.inspect(...args));
468
+ };
469
+ const invalidRange = (start, end, options) => {
470
+ if (options.strictRanges === true) throw rangeError([start, end]);
471
+ return [];
472
+ };
473
+ const invalidStep = (step, options) => {
474
+ if (options.strictRanges === true) throw new TypeError(`Expected step "${step}" to be a number`);
475
+ return [];
476
+ };
477
+ const fillNumbers = (start, end, step = 1, options = {}) => {
478
+ let a = Number(start);
479
+ let b = Number(end);
480
+ if (!Number.isInteger(a) || !Number.isInteger(b)) {
481
+ if (options.strictRanges === true) throw rangeError([start, end]);
482
+ return [];
483
+ }
484
+ if (a === 0) a = 0;
485
+ if (b === 0) b = 0;
486
+ let descending = a > b;
487
+ let startString = String(start);
488
+ let endString = String(end);
489
+ let stepString = String(step);
490
+ step = Math.max(Math.abs(step), 1);
491
+ let padded = zeros(startString) || zeros(endString) || zeros(stepString);
492
+ let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
493
+ let toNumber = padded === false && stringify(start, end, options) === false;
494
+ let format = options.transform || transform(toNumber);
495
+ if (options.toRegex && step === 1) return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
496
+ let parts = {
497
+ negatives: [],
498
+ positives: []
499
+ };
500
+ let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
501
+ let range = [];
502
+ let index = 0;
503
+ while (descending ? a >= b : a <= b) {
504
+ if (options.toRegex === true && step > 1) push(a);
505
+ else range.push(pad(format(a, index), maxLen, toNumber));
506
+ a = descending ? a - step : a + step;
507
+ index++;
508
+ }
509
+ if (options.toRegex === true) return step > 1 ? toSequence(parts, options, maxLen) : toRegex(range, null, {
510
+ wrap: false,
511
+ ...options
512
+ });
513
+ return range;
514
+ };
515
+ const fillLetters = (start, end, step = 1, options = {}) => {
516
+ if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) return invalidRange(start, end, options);
517
+ let format = options.transform || ((val) => String.fromCharCode(val));
518
+ let a = `${start}`.charCodeAt(0);
519
+ let b = `${end}`.charCodeAt(0);
520
+ let descending = a > b;
521
+ let min = Math.min(a, b);
522
+ let max = Math.max(a, b);
523
+ if (options.toRegex && step === 1) return toRange(min, max, false, options);
524
+ let range = [];
525
+ let index = 0;
526
+ while (descending ? a >= b : a <= b) {
527
+ range.push(format(a, index));
528
+ a = descending ? a - step : a + step;
529
+ index++;
530
+ }
531
+ if (options.toRegex === true) return toRegex(range, null, {
532
+ wrap: false,
533
+ options
534
+ });
535
+ return range;
536
+ };
537
+ const fill = (start, end, step, options = {}) => {
538
+ if (end == null && isValidValue(start)) return [start];
539
+ if (!isValidValue(start) || !isValidValue(end)) return invalidRange(start, end, options);
540
+ if (typeof step === "function") return fill(start, end, 1, { transform: step });
541
+ if (isObject(step)) return fill(start, end, 0, step);
542
+ let opts = { ...options };
543
+ if (opts.capture === true) opts.wrap = true;
544
+ step = step || opts.step || 1;
545
+ if (!isNumber(step)) {
546
+ if (step != null && !isObject(step)) return invalidStep(step, opts);
547
+ return fill(start, end, 1, step);
548
+ }
549
+ if (isNumber(start) && isNumber(end)) return fillNumbers(start, end, step, opts);
550
+ return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
551
+ };
552
+ module.exports = fill;
553
+ }));
554
+
555
+ //#endregion
556
+ //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js
557
+ var require_compile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
558
+ const fill = require_fill_range();
559
+ const utils = require_utils$1();
560
+ const compile = (ast, options = {}) => {
561
+ const walk = (node, parent = {}) => {
562
+ const invalidBlock = utils.isInvalidBrace(parent);
563
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;
564
+ const invalid = invalidBlock === true || invalidNode === true;
565
+ const prefix = options.escapeInvalid === true ? "\\" : "";
566
+ let output = "";
567
+ if (node.isOpen === true) return prefix + node.value;
568
+ if (node.isClose === true) {
569
+ console.log("node.isClose", prefix, node.value);
570
+ return prefix + node.value;
571
+ }
572
+ if (node.type === "open") return invalid ? prefix + node.value : "(";
573
+ if (node.type === "close") return invalid ? prefix + node.value : ")";
574
+ if (node.type === "comma") return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
575
+ if (node.value) return node.value;
576
+ if (node.nodes && node.ranges > 0) {
577
+ const args = utils.reduce(node.nodes);
578
+ const range = fill(...args, {
579
+ ...options,
580
+ wrap: false,
581
+ toRegex: true,
582
+ strictZeros: true
583
+ });
584
+ if (range.length !== 0) return args.length > 1 && range.length > 1 ? `(${range})` : range;
585
+ }
586
+ if (node.nodes) for (const child of node.nodes) output += walk(child, node);
587
+ return output;
588
+ };
589
+ return walk(ast);
590
+ };
591
+ module.exports = compile;
592
+ }));
593
+
594
+ //#endregion
595
+ //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js
596
+ var require_expand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
597
+ const fill = require_fill_range();
598
+ const stringify = require_stringify();
599
+ const utils = require_utils$1();
600
+ const append = (queue = "", stash = "", enclose = false) => {
601
+ const result = [];
602
+ queue = [].concat(queue);
603
+ stash = [].concat(stash);
604
+ if (!stash.length) return queue;
605
+ if (!queue.length) return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
606
+ for (const item of queue) if (Array.isArray(item)) for (const value of item) result.push(append(value, stash, enclose));
607
+ else for (let ele of stash) {
608
+ if (enclose === true && typeof ele === "string") ele = `{${ele}}`;
609
+ result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
610
+ }
611
+ return utils.flatten(result);
612
+ };
613
+ const expand = (ast, options = {}) => {
614
+ const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
615
+ const walk = (node, parent = {}) => {
616
+ node.queue = [];
617
+ let p = parent;
618
+ let q = parent.queue;
619
+ while (p.type !== "brace" && p.type !== "root" && p.parent) {
620
+ p = p.parent;
621
+ q = p.queue;
622
+ }
623
+ if (node.invalid || node.dollar) {
624
+ q.push(append(q.pop(), stringify(node, options)));
625
+ return;
626
+ }
627
+ if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
628
+ q.push(append(q.pop(), ["{}"]));
629
+ return;
630
+ }
631
+ if (node.nodes && node.ranges > 0) {
632
+ const args = utils.reduce(node.nodes);
633
+ if (utils.exceedsLimit(...args, options.step, rangeLimit)) throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
634
+ let range = fill(...args, options);
635
+ if (range.length === 0) range = stringify(node, options);
636
+ q.push(append(q.pop(), range));
637
+ node.nodes = [];
638
+ return;
639
+ }
640
+ const enclose = utils.encloseBrace(node);
641
+ let queue = node.queue;
642
+ let block = node;
643
+ while (block.type !== "brace" && block.type !== "root" && block.parent) {
644
+ block = block.parent;
645
+ queue = block.queue;
646
+ }
647
+ for (let i = 0; i < node.nodes.length; i++) {
648
+ const child = node.nodes[i];
649
+ if (child.type === "comma" && node.type === "brace") {
650
+ if (i === 1) queue.push("");
651
+ queue.push("");
652
+ continue;
653
+ }
654
+ if (child.type === "close") {
655
+ q.push(append(q.pop(), queue, enclose));
656
+ continue;
657
+ }
658
+ if (child.value && child.type !== "open") {
659
+ queue.push(append(queue.pop(), child.value));
660
+ continue;
661
+ }
662
+ if (child.nodes) walk(child, node);
663
+ }
664
+ return queue;
665
+ };
666
+ return utils.flatten(walk(ast));
667
+ };
668
+ module.exports = expand;
669
+ }));
670
+
671
+ //#endregion
672
+ //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js
673
+ var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
674
+ module.exports = {
675
+ MAX_LENGTH: 1e4,
676
+ CHAR_0: "0",
677
+ CHAR_9: "9",
678
+ CHAR_UPPERCASE_A: "A",
679
+ CHAR_LOWERCASE_A: "a",
680
+ CHAR_UPPERCASE_Z: "Z",
681
+ CHAR_LOWERCASE_Z: "z",
682
+ CHAR_LEFT_PARENTHESES: "(",
683
+ CHAR_RIGHT_PARENTHESES: ")",
684
+ CHAR_ASTERISK: "*",
685
+ CHAR_AMPERSAND: "&",
686
+ CHAR_AT: "@",
687
+ CHAR_BACKSLASH: "\\",
688
+ CHAR_BACKTICK: "`",
689
+ CHAR_CARRIAGE_RETURN: "\r",
690
+ CHAR_CIRCUMFLEX_ACCENT: "^",
691
+ CHAR_COLON: ":",
692
+ CHAR_COMMA: ",",
693
+ CHAR_DOLLAR: "$",
694
+ CHAR_DOT: ".",
695
+ CHAR_DOUBLE_QUOTE: "\"",
696
+ CHAR_EQUAL: "=",
697
+ CHAR_EXCLAMATION_MARK: "!",
698
+ CHAR_FORM_FEED: "\f",
699
+ CHAR_FORWARD_SLASH: "/",
700
+ CHAR_HASH: "#",
701
+ CHAR_HYPHEN_MINUS: "-",
702
+ CHAR_LEFT_ANGLE_BRACKET: "<",
703
+ CHAR_LEFT_CURLY_BRACE: "{",
704
+ CHAR_LEFT_SQUARE_BRACKET: "[",
705
+ CHAR_LINE_FEED: "\n",
706
+ CHAR_NO_BREAK_SPACE: "\xA0",
707
+ CHAR_PERCENT: "%",
708
+ CHAR_PLUS: "+",
709
+ CHAR_QUESTION_MARK: "?",
710
+ CHAR_RIGHT_ANGLE_BRACKET: ">",
711
+ CHAR_RIGHT_CURLY_BRACE: "}",
712
+ CHAR_RIGHT_SQUARE_BRACKET: "]",
713
+ CHAR_SEMICOLON: ";",
714
+ CHAR_SINGLE_QUOTE: "'",
715
+ CHAR_SPACE: " ",
716
+ CHAR_TAB: " ",
717
+ CHAR_UNDERSCORE: "_",
718
+ CHAR_VERTICAL_LINE: "|",
719
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: ""
720
+ };
721
+ }));
722
+
723
+ //#endregion
724
+ //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js
725
+ var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
726
+ const stringify = require_stringify();
727
+ /**
728
+ * Constants
729
+ */
730
+ const { MAX_LENGTH, CHAR_BACKSLASH, CHAR_BACKTICK, CHAR_COMMA, CHAR_DOT, CHAR_LEFT_PARENTHESES, CHAR_RIGHT_PARENTHESES, CHAR_LEFT_CURLY_BRACE, CHAR_RIGHT_CURLY_BRACE, CHAR_LEFT_SQUARE_BRACKET, CHAR_RIGHT_SQUARE_BRACKET, CHAR_DOUBLE_QUOTE, CHAR_SINGLE_QUOTE, CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE } = require_constants$1();
731
+ /**
732
+ * parse
733
+ */
734
+ const parse = (input, options = {}) => {
735
+ if (typeof input !== "string") throw new TypeError("Expected a string");
736
+ const opts = options || {};
737
+ const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
738
+ if (input.length > max) throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
739
+ const ast = {
740
+ type: "root",
741
+ input,
742
+ nodes: []
743
+ };
744
+ const stack = [ast];
745
+ let block = ast;
746
+ let prev = ast;
747
+ let brackets = 0;
748
+ const length = input.length;
749
+ let index = 0;
750
+ let depth = 0;
751
+ let value;
752
+ /**
753
+ * Helpers
754
+ */
755
+ const advance = () => input[index++];
756
+ const push = (node) => {
757
+ if (node.type === "text" && prev.type === "dot") prev.type = "text";
758
+ if (prev && prev.type === "text" && node.type === "text") {
759
+ prev.value += node.value;
760
+ return;
761
+ }
762
+ block.nodes.push(node);
763
+ node.parent = block;
764
+ node.prev = prev;
765
+ prev = node;
766
+ return node;
767
+ };
768
+ push({ type: "bos" });
769
+ while (index < length) {
770
+ block = stack[stack.length - 1];
771
+ value = advance();
772
+ /**
773
+ * Invalid chars
774
+ */
775
+ if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) continue;
776
+ /**
777
+ * Escaped chars
778
+ */
779
+ if (value === CHAR_BACKSLASH) {
780
+ push({
781
+ type: "text",
782
+ value: (options.keepEscaping ? value : "") + advance()
783
+ });
784
+ continue;
785
+ }
786
+ /**
787
+ * Right square bracket (literal): ']'
788
+ */
789
+ if (value === CHAR_RIGHT_SQUARE_BRACKET) {
790
+ push({
791
+ type: "text",
792
+ value: "\\" + value
793
+ });
794
+ continue;
795
+ }
796
+ /**
797
+ * Left square bracket: '['
798
+ */
799
+ if (value === CHAR_LEFT_SQUARE_BRACKET) {
800
+ brackets++;
801
+ let next;
802
+ while (index < length && (next = advance())) {
803
+ value += next;
804
+ if (next === CHAR_LEFT_SQUARE_BRACKET) {
805
+ brackets++;
806
+ continue;
807
+ }
808
+ if (next === CHAR_BACKSLASH) {
809
+ value += advance();
810
+ continue;
811
+ }
812
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
813
+ brackets--;
814
+ if (brackets === 0) break;
815
+ }
816
+ }
817
+ push({
818
+ type: "text",
819
+ value
820
+ });
821
+ continue;
822
+ }
823
+ /**
824
+ * Parentheses
825
+ */
826
+ if (value === CHAR_LEFT_PARENTHESES) {
827
+ block = push({
828
+ type: "paren",
829
+ nodes: []
830
+ });
831
+ stack.push(block);
832
+ push({
833
+ type: "text",
834
+ value
835
+ });
836
+ continue;
837
+ }
838
+ if (value === CHAR_RIGHT_PARENTHESES) {
839
+ if (block.type !== "paren") {
840
+ push({
841
+ type: "text",
842
+ value
843
+ });
844
+ continue;
845
+ }
846
+ block = stack.pop();
847
+ push({
848
+ type: "text",
849
+ value
850
+ });
851
+ block = stack[stack.length - 1];
852
+ continue;
853
+ }
854
+ /**
855
+ * Quotes: '|"|`
856
+ */
857
+ if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
858
+ const open = value;
859
+ let next;
860
+ if (options.keepQuotes !== true) value = "";
861
+ while (index < length && (next = advance())) {
862
+ if (next === CHAR_BACKSLASH) {
863
+ value += next + advance();
864
+ continue;
865
+ }
866
+ if (next === open) {
867
+ if (options.keepQuotes === true) value += next;
868
+ break;
869
+ }
870
+ value += next;
871
+ }
872
+ push({
873
+ type: "text",
874
+ value
875
+ });
876
+ continue;
877
+ }
878
+ /**
879
+ * Left curly brace: '{'
880
+ */
881
+ if (value === CHAR_LEFT_CURLY_BRACE) {
882
+ depth++;
883
+ block = push({
884
+ type: "brace",
885
+ open: true,
886
+ close: false,
887
+ dollar: prev.value && prev.value.slice(-1) === "$" || block.dollar === true,
888
+ depth,
889
+ commas: 0,
890
+ ranges: 0,
891
+ nodes: []
892
+ });
893
+ stack.push(block);
894
+ push({
895
+ type: "open",
896
+ value
897
+ });
898
+ continue;
899
+ }
900
+ /**
901
+ * Right curly brace: '}'
902
+ */
903
+ if (value === CHAR_RIGHT_CURLY_BRACE) {
904
+ if (block.type !== "brace") {
905
+ push({
906
+ type: "text",
907
+ value
908
+ });
909
+ continue;
910
+ }
911
+ const type = "close";
912
+ block = stack.pop();
913
+ block.close = true;
914
+ push({
915
+ type,
916
+ value
917
+ });
918
+ depth--;
919
+ block = stack[stack.length - 1];
920
+ continue;
921
+ }
922
+ /**
923
+ * Comma: ','
924
+ */
925
+ if (value === CHAR_COMMA && depth > 0) {
926
+ if (block.ranges > 0) {
927
+ block.ranges = 0;
928
+ const open = block.nodes.shift();
929
+ block.nodes = [open, {
930
+ type: "text",
931
+ value: stringify(block)
932
+ }];
933
+ }
934
+ push({
935
+ type: "comma",
936
+ value
937
+ });
938
+ block.commas++;
939
+ continue;
940
+ }
941
+ /**
942
+ * Dot: '.'
943
+ */
944
+ if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
945
+ const siblings = block.nodes;
946
+ if (depth === 0 || siblings.length === 0) {
947
+ push({
948
+ type: "text",
949
+ value
950
+ });
951
+ continue;
952
+ }
953
+ if (prev.type === "dot") {
954
+ block.range = [];
955
+ prev.value += value;
956
+ prev.type = "range";
957
+ if (block.nodes.length !== 3 && block.nodes.length !== 5) {
958
+ block.invalid = true;
959
+ block.ranges = 0;
960
+ prev.type = "text";
961
+ continue;
962
+ }
963
+ block.ranges++;
964
+ block.args = [];
965
+ continue;
966
+ }
967
+ if (prev.type === "range") {
968
+ siblings.pop();
969
+ const before = siblings[siblings.length - 1];
970
+ before.value += prev.value + value;
971
+ prev = before;
972
+ block.ranges--;
973
+ continue;
974
+ }
975
+ push({
976
+ type: "dot",
977
+ value
978
+ });
979
+ continue;
980
+ }
981
+ /**
982
+ * Text
983
+ */
984
+ push({
985
+ type: "text",
986
+ value
987
+ });
988
+ }
989
+ do {
990
+ block = stack.pop();
991
+ if (block.type !== "root") {
992
+ block.nodes.forEach((node) => {
993
+ if (!node.nodes) {
994
+ if (node.type === "open") node.isOpen = true;
995
+ if (node.type === "close") node.isClose = true;
996
+ if (!node.nodes) node.type = "text";
997
+ node.invalid = true;
998
+ }
999
+ });
1000
+ const parent = stack[stack.length - 1];
1001
+ const index = parent.nodes.indexOf(block);
1002
+ parent.nodes.splice(index, 1, ...block.nodes);
1003
+ }
1004
+ } while (stack.length > 0);
1005
+ push({ type: "eos" });
1006
+ return ast;
1007
+ };
1008
+ module.exports = parse;
1009
+ }));
1010
+
1011
+ //#endregion
1012
+ //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js
1013
+ var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1014
+ const stringify = require_stringify();
1015
+ const compile = require_compile();
1016
+ const expand = require_expand();
1017
+ const parse = require_parse$1();
1018
+ /**
1019
+ * Expand the given pattern or create a regex-compatible string.
1020
+ *
1021
+ * ```js
1022
+ * const braces = require('braces');
1023
+ * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)']
1024
+ * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c']
1025
+ * ```
1026
+ * @param {String} `str`
1027
+ * @param {Object} `options`
1028
+ * @return {String}
1029
+ * @api public
1030
+ */
1031
+ const braces = (input, options = {}) => {
1032
+ let output = [];
1033
+ if (Array.isArray(input)) for (const pattern of input) {
1034
+ const result = braces.create(pattern, options);
1035
+ if (Array.isArray(result)) output.push(...result);
1036
+ else output.push(result);
1037
+ }
1038
+ else output = [].concat(braces.create(input, options));
1039
+ if (options && options.expand === true && options.nodupes === true) output = [...new Set(output)];
1040
+ return output;
1041
+ };
1042
+ /**
1043
+ * Parse the given `str` with the given `options`.
1044
+ *
1045
+ * ```js
1046
+ * // braces.parse(pattern, [, options]);
1047
+ * const ast = braces.parse('a/{b,c}/d');
1048
+ * console.log(ast);
1049
+ * ```
1050
+ * @param {String} pattern Brace pattern to parse
1051
+ * @param {Object} options
1052
+ * @return {Object} Returns an AST
1053
+ * @api public
1054
+ */
1055
+ braces.parse = (input, options = {}) => parse(input, options);
1056
+ /**
1057
+ * Creates a braces string from an AST, or an AST node.
1058
+ *
1059
+ * ```js
1060
+ * const braces = require('braces');
1061
+ * let ast = braces.parse('foo/{a,b}/bar');
1062
+ * console.log(stringify(ast.nodes[2])); //=> '{a,b}'
1063
+ * ```
1064
+ * @param {String} `input` Brace pattern or AST.
1065
+ * @param {Object} `options`
1066
+ * @return {Array} Returns an array of expanded values.
1067
+ * @api public
1068
+ */
1069
+ braces.stringify = (input, options = {}) => {
1070
+ if (typeof input === "string") return stringify(braces.parse(input, options), options);
1071
+ return stringify(input, options);
1072
+ };
1073
+ /**
1074
+ * Compiles a brace pattern into a regex-compatible, optimized string.
1075
+ * This method is called by the main [braces](#braces) function by default.
1076
+ *
1077
+ * ```js
1078
+ * const braces = require('braces');
1079
+ * console.log(braces.compile('a/{b,c}/d'));
1080
+ * //=> ['a/(b|c)/d']
1081
+ * ```
1082
+ * @param {String} `input` Brace pattern or AST.
1083
+ * @param {Object} `options`
1084
+ * @return {Array} Returns an array of expanded values.
1085
+ * @api public
1086
+ */
1087
+ braces.compile = (input, options = {}) => {
1088
+ if (typeof input === "string") input = braces.parse(input, options);
1089
+ return compile(input, options);
1090
+ };
1091
+ /**
1092
+ * Expands a brace pattern into an array. This method is called by the
1093
+ * main [braces](#braces) function when `options.expand` is true. Before
1094
+ * using this method it's recommended that you read the [performance notes](#performance))
1095
+ * and advantages of using [.compile](#compile) instead.
1096
+ *
1097
+ * ```js
1098
+ * const braces = require('braces');
1099
+ * console.log(braces.expand('a/{b,c}/d'));
1100
+ * //=> ['a/b/d', 'a/c/d'];
1101
+ * ```
1102
+ * @param {String} `pattern` Brace pattern
1103
+ * @param {Object} `options`
1104
+ * @return {Array} Returns an array of expanded values.
1105
+ * @api public
1106
+ */
1107
+ braces.expand = (input, options = {}) => {
1108
+ if (typeof input === "string") input = braces.parse(input, options);
1109
+ let result = expand(input, options);
1110
+ if (options.noempty === true) result = result.filter(Boolean);
1111
+ if (options.nodupes === true) result = [...new Set(result)];
1112
+ return result;
1113
+ };
1114
+ /**
1115
+ * Processes a brace pattern and returns either an expanded array
1116
+ * (if `options.expand` is true), a highly optimized regex-compatible string.
1117
+ * This method is called by the main [braces](#braces) function.
1118
+ *
1119
+ * ```js
1120
+ * const braces = require('braces');
1121
+ * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}'))
1122
+ * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)'
1123
+ * ```
1124
+ * @param {String} `pattern` Brace pattern
1125
+ * @param {Object} `options`
1126
+ * @return {Array} Returns an array of expanded values.
1127
+ * @api public
1128
+ */
1129
+ braces.create = (input, options = {}) => {
1130
+ if (input === "" || input.length < 3) return [input];
1131
+ return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options);
1132
+ };
1133
+ /**
1134
+ * Expose "braces"
1135
+ */
1136
+ module.exports = braces;
1137
+ }));
1138
+
1139
+ //#endregion
1140
+ //#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/constants.js
1141
+ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1142
+ const path$2 = __require("node:path");
1143
+ const WIN_SLASH = "\\\\/";
1144
+ const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
1145
+ const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
1146
+ /**
1147
+ * Posix glob regex
1148
+ */
1149
+ const DOT_LITERAL = "\\.";
1150
+ const PLUS_LITERAL = "\\+";
1151
+ const QMARK_LITERAL = "\\?";
1152
+ const SLASH_LITERAL = "\\/";
1153
+ const ONE_CHAR = "(?=.)";
1154
+ const QMARK = "[^/]";
1155
+ const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
1156
+ const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
1157
+ const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
1158
+ const POSIX_CHARS = {
1159
+ DOT_LITERAL,
1160
+ PLUS_LITERAL,
1161
+ QMARK_LITERAL,
1162
+ SLASH_LITERAL,
1163
+ ONE_CHAR,
1164
+ QMARK,
1165
+ END_ANCHOR,
1166
+ DOTS_SLASH,
1167
+ NO_DOT: `(?!${DOT_LITERAL})`,
1168
+ NO_DOTS: `(?!${START_ANCHOR}${DOTS_SLASH})`,
1169
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`,
1170
+ NO_DOTS_SLASH: `(?!${DOTS_SLASH})`,
1171
+ QMARK_NO_DOT: `[^.${SLASH_LITERAL}]`,
1172
+ STAR: `${QMARK}*?`,
1173
+ START_ANCHOR
1174
+ };
1175
+ /**
1176
+ * Windows glob regex
1177
+ */
1178
+ const WINDOWS_CHARS = {
1179
+ ...POSIX_CHARS,
1180
+ SLASH_LITERAL: `[${WIN_SLASH}]`,
1181
+ QMARK: WIN_NO_SLASH,
1182
+ STAR: `${WIN_NO_SLASH}*?`,
1183
+ DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
1184
+ NO_DOT: `(?!${DOT_LITERAL})`,
1185
+ NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
1186
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
1187
+ NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
1188
+ QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
1189
+ START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
1190
+ END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
1191
+ };
1192
+ /**
1193
+ * POSIX Bracket Regex
1194
+ */
1195
+ const POSIX_REGEX_SOURCE = {
1196
+ __proto__: null,
1197
+ alnum: "a-zA-Z0-9",
1198
+ alpha: "a-zA-Z",
1199
+ ascii: "\\x00-\\x7F",
1200
+ blank: " \\t",
1201
+ cntrl: "\\x00-\\x1F\\x7F",
1202
+ digit: "0-9",
1203
+ graph: "\\x21-\\x7E",
1204
+ lower: "a-z",
1205
+ print: "\\x20-\\x7E ",
1206
+ punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
1207
+ space: " \\t\\r\\n\\v\\f",
1208
+ upper: "A-Z",
1209
+ word: "A-Za-z0-9_",
1210
+ xdigit: "A-Fa-f0-9"
1211
+ };
1212
+ module.exports = {
1213
+ DEFAULT_MAX_EXTGLOB_RECURSION,
1214
+ MAX_LENGTH: 1024 * 64,
1215
+ POSIX_REGEX_SOURCE,
1216
+ REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
1217
+ REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
1218
+ REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
1219
+ REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
1220
+ REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
1221
+ REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
1222
+ REPLACEMENTS: {
1223
+ __proto__: null,
1224
+ "***": "*",
1225
+ "**/**": "**",
1226
+ "**/**/**": "**"
1227
+ },
1228
+ CHAR_0: 48,
1229
+ CHAR_9: 57,
1230
+ CHAR_UPPERCASE_A: 65,
1231
+ CHAR_LOWERCASE_A: 97,
1232
+ CHAR_UPPERCASE_Z: 90,
1233
+ CHAR_LOWERCASE_Z: 122,
1234
+ CHAR_LEFT_PARENTHESES: 40,
1235
+ CHAR_RIGHT_PARENTHESES: 41,
1236
+ CHAR_ASTERISK: 42,
1237
+ CHAR_AMPERSAND: 38,
1238
+ CHAR_AT: 64,
1239
+ CHAR_BACKWARD_SLASH: 92,
1240
+ CHAR_CARRIAGE_RETURN: 13,
1241
+ CHAR_CIRCUMFLEX_ACCENT: 94,
1242
+ CHAR_COLON: 58,
1243
+ CHAR_COMMA: 44,
1244
+ CHAR_DOT: 46,
1245
+ CHAR_DOUBLE_QUOTE: 34,
1246
+ CHAR_EQUAL: 61,
1247
+ CHAR_EXCLAMATION_MARK: 33,
1248
+ CHAR_FORM_FEED: 12,
1249
+ CHAR_FORWARD_SLASH: 47,
1250
+ CHAR_GRAVE_ACCENT: 96,
1251
+ CHAR_HASH: 35,
1252
+ CHAR_HYPHEN_MINUS: 45,
1253
+ CHAR_LEFT_ANGLE_BRACKET: 60,
1254
+ CHAR_LEFT_CURLY_BRACE: 123,
1255
+ CHAR_LEFT_SQUARE_BRACKET: 91,
1256
+ CHAR_LINE_FEED: 10,
1257
+ CHAR_NO_BREAK_SPACE: 160,
1258
+ CHAR_PERCENT: 37,
1259
+ CHAR_PLUS: 43,
1260
+ CHAR_QUESTION_MARK: 63,
1261
+ CHAR_RIGHT_ANGLE_BRACKET: 62,
1262
+ CHAR_RIGHT_CURLY_BRACE: 125,
1263
+ CHAR_RIGHT_SQUARE_BRACKET: 93,
1264
+ CHAR_SEMICOLON: 59,
1265
+ CHAR_SINGLE_QUOTE: 39,
1266
+ CHAR_SPACE: 32,
1267
+ CHAR_TAB: 9,
1268
+ CHAR_UNDERSCORE: 95,
1269
+ CHAR_VERTICAL_LINE: 124,
1270
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
1271
+ SEP: path$2.sep,
1272
+ extglobChars(chars) {
1273
+ return {
1274
+ "!": {
1275
+ type: "negate",
1276
+ open: "(?:(?!(?:",
1277
+ close: `))${chars.STAR})`
1278
+ },
1279
+ "?": {
1280
+ type: "qmark",
1281
+ open: "(?:",
1282
+ close: ")?"
1283
+ },
1284
+ "+": {
1285
+ type: "plus",
1286
+ open: "(?:",
1287
+ close: ")+"
1288
+ },
1289
+ "*": {
1290
+ type: "star",
1291
+ open: "(?:",
1292
+ close: ")*"
1293
+ },
1294
+ "@": {
1295
+ type: "at",
1296
+ open: "(?:",
1297
+ close: ")"
1298
+ }
1299
+ };
1300
+ },
1301
+ globChars(win32) {
1302
+ return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
1303
+ }
1304
+ };
1305
+ }));
1306
+
1307
+ //#endregion
1308
+ //#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/utils.js
1309
+ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
1310
+ const path$1 = __require("node:path");
1311
+ const win32 = process.platform === "win32";
1312
+ const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
1313
+ exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
1314
+ exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
1315
+ exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
1316
+ exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
1317
+ exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
1318
+ exports.removeBackslashes = (str) => {
1319
+ return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
1320
+ return match === "\\" ? "" : match;
1321
+ });
1322
+ };
1323
+ exports.supportsLookbehinds = () => {
1324
+ const segs = process.version.slice(1).split(".").map(Number);
1325
+ if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) return true;
1326
+ return false;
1327
+ };
1328
+ exports.isWindows = (options) => {
1329
+ if (options && typeof options.windows === "boolean") return options.windows;
1330
+ return win32 === true || path$1.sep === "\\";
1331
+ };
1332
+ exports.escapeLast = (input, char, lastIdx) => {
1333
+ const idx = input.lastIndexOf(char, lastIdx);
1334
+ if (idx === -1) return input;
1335
+ if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
1336
+ return `${input.slice(0, idx)}\\${input.slice(idx)}`;
1337
+ };
1338
+ exports.removePrefix = (input, state = {}) => {
1339
+ let output = input;
1340
+ if (output.startsWith("./")) {
1341
+ output = output.slice(2);
1342
+ state.prefix = "./";
1343
+ }
1344
+ return output;
1345
+ };
1346
+ exports.wrapOutput = (input, state = {}, options = {}) => {
1347
+ let output = `${options.contains ? "" : "^"}(?:${input})${options.contains ? "" : "$"}`;
1348
+ if (state.negated === true) output = `(?:^(?!${output}).*$)`;
1349
+ return output;
1350
+ };
1351
+ }));
1352
+
1353
+ //#endregion
1354
+ //#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/scan.js
1355
+ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1356
+ const utils = require_utils();
1357
+ const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants();
1358
+ const isPathSeparator = (code) => {
1359
+ return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
1360
+ };
1361
+ const depth = (token) => {
1362
+ if (token.isPrefix !== true) token.depth = token.isGlobstar ? Infinity : 1;
1363
+ };
1364
+ /**
1365
+ * Quickly scans a glob pattern and returns an object with a handful of
1366
+ * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
1367
+ * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
1368
+ * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
1369
+ *
1370
+ * ```js
1371
+ * const pm = require('picomatch');
1372
+ * console.log(pm.scan('foo/bar/*.js'));
1373
+ * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
1374
+ * ```
1375
+ * @param {String} `str`
1376
+ * @param {Object} `options`
1377
+ * @return {Object} Returns an object with tokens and regex source string.
1378
+ * @api public
1379
+ */
1380
+ const scan = (input, options) => {
1381
+ const opts = options || {};
1382
+ const length = input.length - 1;
1383
+ const scanToEnd = opts.parts === true || opts.scanToEnd === true;
1384
+ const slashes = [];
1385
+ const tokens = [];
1386
+ const parts = [];
1387
+ let str = input;
1388
+ let index = -1;
1389
+ let start = 0;
1390
+ let lastIndex = 0;
1391
+ let isBrace = false;
1392
+ let isBracket = false;
1393
+ let isGlob = false;
1394
+ let isExtglob = false;
1395
+ let isGlobstar = false;
1396
+ let braceEscaped = false;
1397
+ let backslashes = false;
1398
+ let negated = false;
1399
+ let negatedExtglob = false;
1400
+ let finished = false;
1401
+ let braces = 0;
1402
+ let prev;
1403
+ let code;
1404
+ let token = {
1405
+ value: "",
1406
+ depth: 0,
1407
+ isGlob: false
1408
+ };
1409
+ const eos = () => index >= length;
1410
+ const peek = () => str.charCodeAt(index + 1);
1411
+ const advance = () => {
1412
+ prev = code;
1413
+ return str.charCodeAt(++index);
1414
+ };
1415
+ while (index < length) {
1416
+ code = advance();
1417
+ let next;
1418
+ if (code === CHAR_BACKWARD_SLASH) {
1419
+ backslashes = token.backslashes = true;
1420
+ code = advance();
1421
+ if (code === CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
1422
+ continue;
1423
+ }
1424
+ if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
1425
+ braces++;
1426
+ while (eos() !== true && (code = advance())) {
1427
+ if (code === CHAR_BACKWARD_SLASH) {
1428
+ backslashes = token.backslashes = true;
1429
+ advance();
1430
+ continue;
1431
+ }
1432
+ if (code === CHAR_LEFT_CURLY_BRACE) {
1433
+ braces++;
1434
+ continue;
1435
+ }
1436
+ if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
1437
+ isBrace = token.isBrace = true;
1438
+ isGlob = token.isGlob = true;
1439
+ finished = true;
1440
+ if (scanToEnd === true) continue;
1441
+ break;
1442
+ }
1443
+ if (braceEscaped !== true && code === CHAR_COMMA) {
1444
+ isBrace = token.isBrace = true;
1445
+ isGlob = token.isGlob = true;
1446
+ finished = true;
1447
+ if (scanToEnd === true) continue;
1448
+ break;
1449
+ }
1450
+ if (code === CHAR_RIGHT_CURLY_BRACE) {
1451
+ braces--;
1452
+ if (braces === 0) {
1453
+ braceEscaped = false;
1454
+ isBrace = token.isBrace = true;
1455
+ finished = true;
1456
+ break;
1457
+ }
1458
+ }
1459
+ }
1460
+ if (scanToEnd === true) continue;
1461
+ break;
1462
+ }
1463
+ if (code === CHAR_FORWARD_SLASH) {
1464
+ slashes.push(index);
1465
+ tokens.push(token);
1466
+ token = {
1467
+ value: "",
1468
+ depth: 0,
1469
+ isGlob: false
1470
+ };
1471
+ if (finished === true) continue;
1472
+ if (prev === CHAR_DOT && index === start + 1) {
1473
+ start += 2;
1474
+ continue;
1475
+ }
1476
+ lastIndex = index + 1;
1477
+ continue;
1478
+ }
1479
+ if (opts.noext !== true) {
1480
+ if ((code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === true && peek() === CHAR_LEFT_PARENTHESES) {
1481
+ isGlob = token.isGlob = true;
1482
+ isExtglob = token.isExtglob = true;
1483
+ finished = true;
1484
+ if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
1485
+ if (scanToEnd === true) {
1486
+ while (eos() !== true && (code = advance())) {
1487
+ if (code === CHAR_BACKWARD_SLASH) {
1488
+ backslashes = token.backslashes = true;
1489
+ code = advance();
1490
+ continue;
1491
+ }
1492
+ if (code === CHAR_RIGHT_PARENTHESES) {
1493
+ isGlob = token.isGlob = true;
1494
+ finished = true;
1495
+ break;
1496
+ }
1497
+ }
1498
+ continue;
1499
+ }
1500
+ break;
1501
+ }
1502
+ }
1503
+ if (code === CHAR_ASTERISK) {
1504
+ if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
1505
+ isGlob = token.isGlob = true;
1506
+ finished = true;
1507
+ if (scanToEnd === true) continue;
1508
+ break;
1509
+ }
1510
+ if (code === CHAR_QUESTION_MARK) {
1511
+ isGlob = token.isGlob = true;
1512
+ finished = true;
1513
+ if (scanToEnd === true) continue;
1514
+ break;
1515
+ }
1516
+ if (code === CHAR_LEFT_SQUARE_BRACKET) {
1517
+ while (eos() !== true && (next = advance())) {
1518
+ if (next === CHAR_BACKWARD_SLASH) {
1519
+ backslashes = token.backslashes = true;
1520
+ advance();
1521
+ continue;
1522
+ }
1523
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
1524
+ isBracket = token.isBracket = true;
1525
+ isGlob = token.isGlob = true;
1526
+ finished = true;
1527
+ break;
1528
+ }
1529
+ }
1530
+ if (scanToEnd === true) continue;
1531
+ break;
1532
+ }
1533
+ if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
1534
+ negated = token.negated = true;
1535
+ start++;
1536
+ continue;
1537
+ }
1538
+ if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
1539
+ isGlob = token.isGlob = true;
1540
+ if (scanToEnd === true) {
1541
+ while (eos() !== true && (code = advance())) {
1542
+ if (code === CHAR_LEFT_PARENTHESES) {
1543
+ backslashes = token.backslashes = true;
1544
+ code = advance();
1545
+ continue;
1546
+ }
1547
+ if (code === CHAR_RIGHT_PARENTHESES) {
1548
+ finished = true;
1549
+ break;
1550
+ }
1551
+ }
1552
+ continue;
1553
+ }
1554
+ break;
1555
+ }
1556
+ if (isGlob === true) {
1557
+ finished = true;
1558
+ if (scanToEnd === true) continue;
1559
+ break;
1560
+ }
1561
+ }
1562
+ if (opts.noext === true) {
1563
+ isExtglob = false;
1564
+ isGlob = false;
1565
+ }
1566
+ let base = str;
1567
+ let prefix = "";
1568
+ let glob = "";
1569
+ if (start > 0) {
1570
+ prefix = str.slice(0, start);
1571
+ str = str.slice(start);
1572
+ lastIndex -= start;
1573
+ }
1574
+ if (base && isGlob === true && lastIndex > 0) {
1575
+ base = str.slice(0, lastIndex);
1576
+ glob = str.slice(lastIndex);
1577
+ } else if (isGlob === true) {
1578
+ base = "";
1579
+ glob = str;
1580
+ } else base = str;
1581
+ if (base && base !== "" && base !== "/" && base !== str) {
1582
+ if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
1583
+ }
1584
+ if (opts.unescape === true) {
1585
+ if (glob) glob = utils.removeBackslashes(glob);
1586
+ if (base && backslashes === true) base = utils.removeBackslashes(base);
1587
+ }
1588
+ const state = {
1589
+ prefix,
1590
+ input,
1591
+ start,
1592
+ base,
1593
+ glob,
1594
+ isBrace,
1595
+ isBracket,
1596
+ isGlob,
1597
+ isExtglob,
1598
+ isGlobstar,
1599
+ negated,
1600
+ negatedExtglob
1601
+ };
1602
+ if (opts.tokens === true) {
1603
+ state.maxDepth = 0;
1604
+ if (!isPathSeparator(code)) tokens.push(token);
1605
+ state.tokens = tokens;
1606
+ }
1607
+ if (opts.parts === true || opts.tokens === true) {
1608
+ let prevIndex;
1609
+ for (let idx = 0; idx < slashes.length; idx++) {
1610
+ const n = prevIndex ? prevIndex + 1 : start;
1611
+ const i = slashes[idx];
1612
+ const value = input.slice(n, i);
1613
+ if (opts.tokens) {
1614
+ if (idx === 0 && start !== 0) {
1615
+ tokens[idx].isPrefix = true;
1616
+ tokens[idx].value = prefix;
1617
+ } else tokens[idx].value = value;
1618
+ depth(tokens[idx]);
1619
+ state.maxDepth += tokens[idx].depth;
1620
+ }
1621
+ if (idx !== 0 || value !== "") parts.push(value);
1622
+ prevIndex = i;
1623
+ }
1624
+ if (prevIndex && prevIndex + 1 < input.length) {
1625
+ const value = input.slice(prevIndex + 1);
1626
+ parts.push(value);
1627
+ if (opts.tokens) {
1628
+ tokens[tokens.length - 1].value = value;
1629
+ depth(tokens[tokens.length - 1]);
1630
+ state.maxDepth += tokens[tokens.length - 1].depth;
1631
+ }
1632
+ }
1633
+ state.slashes = slashes;
1634
+ state.parts = parts;
1635
+ }
1636
+ return state;
1637
+ };
1638
+ module.exports = scan;
1639
+ }));
1640
+
1641
+ //#endregion
1642
+ //#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/parse.js
1643
+ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1644
+ const constants = require_constants();
1645
+ const utils = require_utils();
1646
+ /**
1647
+ * Constants
1648
+ */
1649
+ const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants;
1650
+ /**
1651
+ * Helpers
1652
+ */
1653
+ const expandRange = (args, options) => {
1654
+ if (typeof options.expandRange === "function") return options.expandRange(...args, options);
1655
+ args.sort();
1656
+ const value = `[${args.join("-")}]`;
1657
+ try {
1658
+ new RegExp(value);
1659
+ } catch (ex) {
1660
+ return args.map((v) => utils.escapeRegex(v)).join("..");
1661
+ }
1662
+ return value;
1663
+ };
1664
+ /**
1665
+ * Create the message for a syntax error
1666
+ */
1667
+ const syntaxError = (type, char) => {
1668
+ return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
1669
+ };
1670
+ const splitTopLevel = (input) => {
1671
+ const parts = [];
1672
+ let bracket = 0;
1673
+ let paren = 0;
1674
+ let quote = 0;
1675
+ let value = "";
1676
+ let escaped = false;
1677
+ for (const ch of input) {
1678
+ if (escaped === true) {
1679
+ value += ch;
1680
+ escaped = false;
1681
+ continue;
1682
+ }
1683
+ if (ch === "\\") {
1684
+ value += ch;
1685
+ escaped = true;
1686
+ continue;
1687
+ }
1688
+ if (ch === "\"") {
1689
+ quote = quote === 1 ? 0 : 1;
1690
+ value += ch;
1691
+ continue;
1692
+ }
1693
+ if (quote === 0) {
1694
+ if (ch === "[") bracket++;
1695
+ else if (ch === "]" && bracket > 0) bracket--;
1696
+ else if (bracket === 0) {
1697
+ if (ch === "(") paren++;
1698
+ else if (ch === ")" && paren > 0) paren--;
1699
+ else if (ch === "|" && paren === 0) {
1700
+ parts.push(value);
1701
+ value = "";
1702
+ continue;
1703
+ }
1704
+ }
1705
+ }
1706
+ value += ch;
1707
+ }
1708
+ parts.push(value);
1709
+ return parts;
1710
+ };
1711
+ const isPlainBranch = (branch) => {
1712
+ let escaped = false;
1713
+ for (const ch of branch) {
1714
+ if (escaped === true) {
1715
+ escaped = false;
1716
+ continue;
1717
+ }
1718
+ if (ch === "\\") {
1719
+ escaped = true;
1720
+ continue;
1721
+ }
1722
+ if (/[?*+@!()[\]{}]/.test(ch)) return false;
1723
+ }
1724
+ return true;
1725
+ };
1726
+ const normalizeSimpleBranch = (branch) => {
1727
+ let value = branch.trim();
1728
+ let changed = true;
1729
+ while (changed === true) {
1730
+ changed = false;
1731
+ if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
1732
+ value = value.slice(2, -1);
1733
+ changed = true;
1734
+ }
1735
+ }
1736
+ if (!isPlainBranch(value)) return;
1737
+ return value.replace(/\\(.)/g, "$1");
1738
+ };
1739
+ const hasRepeatedCharPrefixOverlap = (branches) => {
1740
+ const values = branches.map(normalizeSimpleBranch).filter(Boolean);
1741
+ for (let i = 0; i < values.length; i++) for (let j = i + 1; j < values.length; j++) {
1742
+ const a = values[i];
1743
+ const b = values[j];
1744
+ const char = a[0];
1745
+ if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) continue;
1746
+ if (a === b || a.startsWith(b) || b.startsWith(a)) return true;
1747
+ }
1748
+ return false;
1749
+ };
1750
+ const parseRepeatedExtglob = (pattern, requireEnd = true) => {
1751
+ if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") return;
1752
+ let bracket = 0;
1753
+ let paren = 0;
1754
+ let quote = 0;
1755
+ let escaped = false;
1756
+ for (let i = 1; i < pattern.length; i++) {
1757
+ const ch = pattern[i];
1758
+ if (escaped === true) {
1759
+ escaped = false;
1760
+ continue;
1761
+ }
1762
+ if (ch === "\\") {
1763
+ escaped = true;
1764
+ continue;
1765
+ }
1766
+ if (ch === "\"") {
1767
+ quote = quote === 1 ? 0 : 1;
1768
+ continue;
1769
+ }
1770
+ if (quote === 1) continue;
1771
+ if (ch === "[") {
1772
+ bracket++;
1773
+ continue;
1774
+ }
1775
+ if (ch === "]" && bracket > 0) {
1776
+ bracket--;
1777
+ continue;
1778
+ }
1779
+ if (bracket > 0) continue;
1780
+ if (ch === "(") {
1781
+ paren++;
1782
+ continue;
1783
+ }
1784
+ if (ch === ")") {
1785
+ paren--;
1786
+ if (paren === 0) {
1787
+ if (requireEnd === true && i !== pattern.length - 1) return;
1788
+ return {
1789
+ type: pattern[0],
1790
+ body: pattern.slice(2, i),
1791
+ end: i
1792
+ };
1793
+ }
1794
+ }
1795
+ }
1796
+ };
1797
+ const getStarExtglobSequenceOutput = (pattern) => {
1798
+ let index = 0;
1799
+ const chars = [];
1800
+ while (index < pattern.length) {
1801
+ const match = parseRepeatedExtglob(pattern.slice(index), false);
1802
+ if (!match || match.type !== "*") return;
1803
+ const branches = splitTopLevel(match.body).map((branch) => branch.trim());
1804
+ if (branches.length !== 1) return;
1805
+ const branch = normalizeSimpleBranch(branches[0]);
1806
+ if (!branch || branch.length !== 1) return;
1807
+ chars.push(branch);
1808
+ index += match.end + 1;
1809
+ }
1810
+ if (chars.length < 1) return;
1811
+ return `${chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`}*`;
1812
+ };
1813
+ const repeatedExtglobRecursion = (pattern) => {
1814
+ let depth = 0;
1815
+ let value = pattern.trim();
1816
+ let match = parseRepeatedExtglob(value);
1817
+ while (match) {
1818
+ depth++;
1819
+ value = match.body.trim();
1820
+ match = parseRepeatedExtglob(value);
1821
+ }
1822
+ return depth;
1823
+ };
1824
+ const analyzeRepeatedExtglob = (body, options) => {
1825
+ if (options.maxExtglobRecursion === false) return { risky: false };
1826
+ const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
1827
+ const branches = splitTopLevel(body).map((branch) => branch.trim());
1828
+ if (branches.length > 1) {
1829
+ if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) return { risky: true };
1830
+ }
1831
+ for (const branch of branches) {
1832
+ const safeOutput = getStarExtglobSequenceOutput(branch);
1833
+ if (safeOutput) return {
1834
+ risky: true,
1835
+ safeOutput
1836
+ };
1837
+ if (repeatedExtglobRecursion(branch) > max) return { risky: true };
1838
+ }
1839
+ return { risky: false };
1840
+ };
1841
+ /**
1842
+ * Parse the given input string.
1843
+ * @param {String} input
1844
+ * @param {Object} options
1845
+ * @return {Object}
1846
+ */
1847
+ const parse = (input, options) => {
1848
+ if (typeof input !== "string") throw new TypeError("Expected a string");
1849
+ input = REPLACEMENTS[input] || input;
1850
+ const opts = { ...options };
1851
+ const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
1852
+ let len = input.length;
1853
+ if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
1854
+ const bos = {
1855
+ type: "bos",
1856
+ value: "",
1857
+ output: opts.prepend || ""
1858
+ };
1859
+ const tokens = [bos];
1860
+ const capture = opts.capture ? "" : "?:";
1861
+ const win32 = utils.isWindows(options);
1862
+ const PLATFORM_CHARS = constants.globChars(win32);
1863
+ const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
1864
+ const { DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR } = PLATFORM_CHARS;
1865
+ const globstar = (opts) => {
1866
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
1867
+ };
1868
+ const nodot = opts.dot ? "" : NO_DOT;
1869
+ const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
1870
+ let star = opts.bash === true ? globstar(opts) : STAR;
1871
+ if (opts.capture) star = `(${star})`;
1872
+ if (typeof opts.noext === "boolean") opts.noextglob = opts.noext;
1873
+ const state = {
1874
+ input,
1875
+ index: -1,
1876
+ start: 0,
1877
+ dot: opts.dot === true,
1878
+ consumed: "",
1879
+ output: "",
1880
+ prefix: "",
1881
+ backtrack: false,
1882
+ negated: false,
1883
+ brackets: 0,
1884
+ braces: 0,
1885
+ parens: 0,
1886
+ quotes: 0,
1887
+ globstar: false,
1888
+ tokens
1889
+ };
1890
+ input = utils.removePrefix(input, state);
1891
+ len = input.length;
1892
+ const extglobs = [];
1893
+ const braces = [];
1894
+ const stack = [];
1895
+ let prev = bos;
1896
+ let value;
1897
+ /**
1898
+ * Tokenizing helpers
1899
+ */
1900
+ const eos = () => state.index === len - 1;
1901
+ const peek = state.peek = (n = 1) => input[state.index + n];
1902
+ const advance = state.advance = () => input[++state.index] || "";
1903
+ const remaining = () => input.slice(state.index + 1);
1904
+ const consume = (value = "", num = 0) => {
1905
+ state.consumed += value;
1906
+ state.index += num;
1907
+ };
1908
+ const append = (token) => {
1909
+ state.output += token.output != null ? token.output : token.value;
1910
+ consume(token.value);
1911
+ };
1912
+ const negate = () => {
1913
+ let count = 1;
1914
+ while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
1915
+ advance();
1916
+ state.start++;
1917
+ count++;
1918
+ }
1919
+ if (count % 2 === 0) return false;
1920
+ state.negated = true;
1921
+ state.start++;
1922
+ return true;
1923
+ };
1924
+ const increment = (type) => {
1925
+ state[type]++;
1926
+ stack.push(type);
1927
+ };
1928
+ const decrement = (type) => {
1929
+ state[type]--;
1930
+ stack.pop();
1931
+ };
1932
+ /**
1933
+ * Push tokens onto the tokens array. This helper speeds up
1934
+ * tokenizing by 1) helping us avoid backtracking as much as possible,
1935
+ * and 2) helping us avoid creating extra tokens when consecutive
1936
+ * characters are plain text. This improves performance and simplifies
1937
+ * lookbehinds.
1938
+ */
1939
+ const push = (tok) => {
1940
+ if (prev.type === "globstar") {
1941
+ const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
1942
+ const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
1943
+ if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
1944
+ state.output = state.output.slice(0, -prev.output.length);
1945
+ prev.type = "star";
1946
+ prev.value = "*";
1947
+ prev.output = star;
1948
+ state.output += prev.output;
1949
+ }
1950
+ }
1951
+ if (extglobs.length && tok.type !== "paren") extglobs[extglobs.length - 1].inner += tok.value;
1952
+ if (tok.value || tok.output) append(tok);
1953
+ if (prev && prev.type === "text" && tok.type === "text") {
1954
+ prev.value += tok.value;
1955
+ prev.output = (prev.output || "") + tok.value;
1956
+ return;
1957
+ }
1958
+ tok.prev = prev;
1959
+ tokens.push(tok);
1960
+ prev = tok;
1961
+ };
1962
+ const extglobOpen = (type, value) => {
1963
+ const token = {
1964
+ ...EXTGLOB_CHARS[value],
1965
+ conditions: 1,
1966
+ inner: ""
1967
+ };
1968
+ token.prev = prev;
1969
+ token.parens = state.parens;
1970
+ token.output = state.output;
1971
+ token.startIndex = state.index;
1972
+ token.tokensIndex = tokens.length;
1973
+ const output = (opts.capture ? "(" : "") + token.open;
1974
+ increment("parens");
1975
+ push({
1976
+ type,
1977
+ value,
1978
+ output: state.output ? "" : ONE_CHAR
1979
+ });
1980
+ push({
1981
+ type: "paren",
1982
+ extglob: true,
1983
+ value: advance(),
1984
+ output
1985
+ });
1986
+ extglobs.push(token);
1987
+ };
1988
+ const extglobClose = (token) => {
1989
+ const literal = input.slice(token.startIndex, state.index + 1);
1990
+ const analysis = analyzeRepeatedExtglob(input.slice(token.startIndex + 2, state.index), opts);
1991
+ if ((token.type === "plus" || token.type === "star") && analysis.risky) {
1992
+ const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
1993
+ const open = tokens[token.tokensIndex];
1994
+ open.type = "text";
1995
+ open.value = literal;
1996
+ open.output = safeOutput || utils.escapeRegex(literal);
1997
+ for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
1998
+ tokens[i].value = "";
1999
+ tokens[i].output = "";
2000
+ delete tokens[i].suffix;
2001
+ }
2002
+ state.output = token.output + open.output;
2003
+ state.backtrack = true;
2004
+ push({
2005
+ type: "paren",
2006
+ extglob: true,
2007
+ value,
2008
+ output: ""
2009
+ });
2010
+ decrement("parens");
2011
+ return;
2012
+ }
2013
+ let output = token.close + (opts.capture ? ")" : "");
2014
+ let rest;
2015
+ if (token.type === "negate") {
2016
+ let extglobStar = star;
2017
+ if (token.inner && token.inner.length > 1 && token.inner.includes("/")) extglobStar = globstar(opts);
2018
+ if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) output = token.close = `)$))${extglobStar}`;
2019
+ if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) output = token.close = `)${parse(rest, {
2020
+ ...options,
2021
+ fastpaths: false
2022
+ }).output})${extglobStar})`;
2023
+ if (token.prev.type === "bos") state.negatedExtglob = true;
2024
+ }
2025
+ push({
2026
+ type: "paren",
2027
+ extglob: true,
2028
+ value,
2029
+ output
2030
+ });
2031
+ decrement("parens");
2032
+ };
2033
+ /**
2034
+ * Fast paths
2035
+ */
2036
+ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
2037
+ let backslashes = false;
2038
+ let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
2039
+ if (first === "\\") {
2040
+ backslashes = true;
2041
+ return m;
2042
+ }
2043
+ if (first === "?") {
2044
+ if (esc) return esc + first + (rest ? QMARK.repeat(rest.length) : "");
2045
+ if (index === 0) return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
2046
+ return QMARK.repeat(chars.length);
2047
+ }
2048
+ if (first === ".") return DOT_LITERAL.repeat(chars.length);
2049
+ if (first === "*") {
2050
+ if (esc) return esc + first + (rest ? star : "");
2051
+ return star;
2052
+ }
2053
+ return esc ? m : `\\${m}`;
2054
+ });
2055
+ if (backslashes === true) if (opts.unescape === true) output = output.replace(/\\/g, "");
2056
+ else output = output.replace(/\\+/g, (m) => {
2057
+ return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
2058
+ });
2059
+ if (output === input && opts.contains === true) {
2060
+ state.output = input;
2061
+ return state;
2062
+ }
2063
+ state.output = utils.wrapOutput(output, state, options);
2064
+ return state;
2065
+ }
2066
+ /**
2067
+ * Tokenize input until we reach end-of-string
2068
+ */
2069
+ while (!eos()) {
2070
+ value = advance();
2071
+ if (value === "\0") continue;
2072
+ /**
2073
+ * Escaped characters
2074
+ */
2075
+ if (value === "\\") {
2076
+ const next = peek();
2077
+ if (next === "/" && opts.bash !== true) continue;
2078
+ if (next === "." || next === ";") continue;
2079
+ if (!next) {
2080
+ value += "\\";
2081
+ push({
2082
+ type: "text",
2083
+ value
2084
+ });
2085
+ continue;
2086
+ }
2087
+ const match = /^\\+/.exec(remaining());
2088
+ let slashes = 0;
2089
+ if (match && match[0].length > 2) {
2090
+ slashes = match[0].length;
2091
+ state.index += slashes;
2092
+ if (slashes % 2 !== 0) value += "\\";
2093
+ }
2094
+ if (opts.unescape === true) value = advance();
2095
+ else value += advance();
2096
+ if (state.brackets === 0) {
2097
+ push({
2098
+ type: "text",
2099
+ value
2100
+ });
2101
+ continue;
2102
+ }
2103
+ }
2104
+ /**
2105
+ * If we're inside a regex character class, continue
2106
+ * until we reach the closing bracket.
2107
+ */
2108
+ if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
2109
+ if (opts.posix !== false && value === ":") {
2110
+ const inner = prev.value.slice(1);
2111
+ if (inner.includes("[")) {
2112
+ prev.posix = true;
2113
+ if (inner.includes(":")) {
2114
+ const idx = prev.value.lastIndexOf("[");
2115
+ const pre = prev.value.slice(0, idx);
2116
+ const posix = POSIX_REGEX_SOURCE[prev.value.slice(idx + 2)];
2117
+ if (posix) {
2118
+ prev.value = pre + posix;
2119
+ state.backtrack = true;
2120
+ advance();
2121
+ if (!bos.output && tokens.indexOf(prev) === 1) bos.output = ONE_CHAR;
2122
+ continue;
2123
+ }
2124
+ }
2125
+ }
2126
+ }
2127
+ if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") value = `\\${value}`;
2128
+ if (value === "]" && (prev.value === "[" || prev.value === "[^")) value = `\\${value}`;
2129
+ if (opts.posix === true && value === "!" && prev.value === "[") value = "^";
2130
+ prev.value += value;
2131
+ append({ value });
2132
+ continue;
2133
+ }
2134
+ /**
2135
+ * If we're inside a quoted string, continue
2136
+ * until we reach the closing double quote.
2137
+ */
2138
+ if (state.quotes === 1 && value !== "\"") {
2139
+ value = utils.escapeRegex(value);
2140
+ prev.value += value;
2141
+ append({ value });
2142
+ continue;
2143
+ }
2144
+ /**
2145
+ * Double quotes
2146
+ */
2147
+ if (value === "\"") {
2148
+ state.quotes = state.quotes === 1 ? 0 : 1;
2149
+ if (opts.keepQuotes === true) push({
2150
+ type: "text",
2151
+ value
2152
+ });
2153
+ continue;
2154
+ }
2155
+ /**
2156
+ * Parentheses
2157
+ */
2158
+ if (value === "(") {
2159
+ increment("parens");
2160
+ push({
2161
+ type: "paren",
2162
+ value
2163
+ });
2164
+ continue;
2165
+ }
2166
+ if (value === ")") {
2167
+ if (state.parens === 0 && opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "("));
2168
+ const extglob = extglobs[extglobs.length - 1];
2169
+ if (extglob && state.parens === extglob.parens + 1) {
2170
+ extglobClose(extglobs.pop());
2171
+ continue;
2172
+ }
2173
+ push({
2174
+ type: "paren",
2175
+ value,
2176
+ output: state.parens ? ")" : "\\)"
2177
+ });
2178
+ decrement("parens");
2179
+ continue;
2180
+ }
2181
+ /**
2182
+ * Square brackets
2183
+ */
2184
+ if (value === "[") {
2185
+ if (opts.nobracket === true || !remaining().includes("]")) {
2186
+ if (opts.nobracket !== true && opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
2187
+ value = `\\${value}`;
2188
+ } else increment("brackets");
2189
+ push({
2190
+ type: "bracket",
2191
+ value
2192
+ });
2193
+ continue;
2194
+ }
2195
+ if (value === "]") {
2196
+ if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
2197
+ push({
2198
+ type: "text",
2199
+ value,
2200
+ output: `\\${value}`
2201
+ });
2202
+ continue;
2203
+ }
2204
+ if (state.brackets === 0) {
2205
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "["));
2206
+ push({
2207
+ type: "text",
2208
+ value,
2209
+ output: `\\${value}`
2210
+ });
2211
+ continue;
2212
+ }
2213
+ decrement("brackets");
2214
+ const prevValue = prev.value.slice(1);
2215
+ if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) value = `/${value}`;
2216
+ prev.value += value;
2217
+ append({ value });
2218
+ if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) continue;
2219
+ const escaped = utils.escapeRegex(prev.value);
2220
+ state.output = state.output.slice(0, -prev.value.length);
2221
+ if (opts.literalBrackets === true) {
2222
+ state.output += escaped;
2223
+ prev.value = escaped;
2224
+ continue;
2225
+ }
2226
+ prev.value = `(${capture}${escaped}|${prev.value})`;
2227
+ state.output += prev.value;
2228
+ continue;
2229
+ }
2230
+ /**
2231
+ * Braces
2232
+ */
2233
+ if (value === "{" && opts.nobrace !== true) {
2234
+ increment("braces");
2235
+ const open = {
2236
+ type: "brace",
2237
+ value,
2238
+ output: "(",
2239
+ outputIndex: state.output.length,
2240
+ tokensIndex: state.tokens.length
2241
+ };
2242
+ braces.push(open);
2243
+ push(open);
2244
+ continue;
2245
+ }
2246
+ if (value === "}") {
2247
+ const brace = braces[braces.length - 1];
2248
+ if (opts.nobrace === true || !brace) {
2249
+ push({
2250
+ type: "text",
2251
+ value,
2252
+ output: value
2253
+ });
2254
+ continue;
2255
+ }
2256
+ let output = ")";
2257
+ if (brace.dots === true) {
2258
+ const arr = tokens.slice();
2259
+ const range = [];
2260
+ for (let i = arr.length - 1; i >= 0; i--) {
2261
+ tokens.pop();
2262
+ if (arr[i].type === "brace") break;
2263
+ if (arr[i].type !== "dots") range.unshift(arr[i].value);
2264
+ }
2265
+ output = expandRange(range, opts);
2266
+ state.backtrack = true;
2267
+ }
2268
+ if (brace.comma !== true && brace.dots !== true) {
2269
+ const out = state.output.slice(0, brace.outputIndex);
2270
+ const toks = state.tokens.slice(brace.tokensIndex);
2271
+ brace.value = brace.output = "\\{";
2272
+ value = output = "\\}";
2273
+ state.output = out;
2274
+ for (const t of toks) state.output += t.output || t.value;
2275
+ }
2276
+ push({
2277
+ type: "brace",
2278
+ value,
2279
+ output
2280
+ });
2281
+ decrement("braces");
2282
+ braces.pop();
2283
+ continue;
2284
+ }
2285
+ /**
2286
+ * Pipes
2287
+ */
2288
+ if (value === "|") {
2289
+ if (extglobs.length > 0) extglobs[extglobs.length - 1].conditions++;
2290
+ push({
2291
+ type: "text",
2292
+ value
2293
+ });
2294
+ continue;
2295
+ }
2296
+ /**
2297
+ * Commas
2298
+ */
2299
+ if (value === ",") {
2300
+ let output = value;
2301
+ const brace = braces[braces.length - 1];
2302
+ if (brace && stack[stack.length - 1] === "braces") {
2303
+ brace.comma = true;
2304
+ output = "|";
2305
+ }
2306
+ push({
2307
+ type: "comma",
2308
+ value,
2309
+ output
2310
+ });
2311
+ continue;
2312
+ }
2313
+ /**
2314
+ * Slashes
2315
+ */
2316
+ if (value === "/") {
2317
+ if (prev.type === "dot" && state.index === state.start + 1) {
2318
+ state.start = state.index + 1;
2319
+ state.consumed = "";
2320
+ state.output = "";
2321
+ tokens.pop();
2322
+ prev = bos;
2323
+ continue;
2324
+ }
2325
+ push({
2326
+ type: "slash",
2327
+ value,
2328
+ output: SLASH_LITERAL
2329
+ });
2330
+ continue;
2331
+ }
2332
+ /**
2333
+ * Dots
2334
+ */
2335
+ if (value === ".") {
2336
+ if (state.braces > 0 && prev.type === "dot") {
2337
+ if (prev.value === ".") prev.output = DOT_LITERAL;
2338
+ const brace = braces[braces.length - 1];
2339
+ prev.type = "dots";
2340
+ prev.output += value;
2341
+ prev.value += value;
2342
+ brace.dots = true;
2343
+ continue;
2344
+ }
2345
+ if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
2346
+ push({
2347
+ type: "text",
2348
+ value,
2349
+ output: DOT_LITERAL
2350
+ });
2351
+ continue;
2352
+ }
2353
+ push({
2354
+ type: "dot",
2355
+ value,
2356
+ output: DOT_LITERAL
2357
+ });
2358
+ continue;
2359
+ }
2360
+ /**
2361
+ * Question marks
2362
+ */
2363
+ if (value === "?") {
2364
+ if (!(prev && prev.value === "(") && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
2365
+ extglobOpen("qmark", value);
2366
+ continue;
2367
+ }
2368
+ if (prev && prev.type === "paren") {
2369
+ const next = peek();
2370
+ let output = value;
2371
+ if (next === "<" && !utils.supportsLookbehinds()) throw new Error("Node.js v10 or higher is required for regex lookbehinds");
2372
+ if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) output = `\\${value}`;
2373
+ push({
2374
+ type: "text",
2375
+ value,
2376
+ output
2377
+ });
2378
+ continue;
2379
+ }
2380
+ if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
2381
+ push({
2382
+ type: "qmark",
2383
+ value,
2384
+ output: QMARK_NO_DOT
2385
+ });
2386
+ continue;
2387
+ }
2388
+ push({
2389
+ type: "qmark",
2390
+ value,
2391
+ output: QMARK
2392
+ });
2393
+ continue;
2394
+ }
2395
+ /**
2396
+ * Exclamation
2397
+ */
2398
+ if (value === "!") {
2399
+ if (opts.noextglob !== true && peek() === "(") {
2400
+ if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
2401
+ extglobOpen("negate", value);
2402
+ continue;
2403
+ }
2404
+ }
2405
+ if (opts.nonegate !== true && state.index === 0) {
2406
+ negate();
2407
+ continue;
2408
+ }
2409
+ }
2410
+ /**
2411
+ * Plus
2412
+ */
2413
+ if (value === "+") {
2414
+ if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
2415
+ extglobOpen("plus", value);
2416
+ continue;
2417
+ }
2418
+ if (prev && prev.value === "(" || opts.regex === false) {
2419
+ push({
2420
+ type: "plus",
2421
+ value,
2422
+ output: PLUS_LITERAL
2423
+ });
2424
+ continue;
2425
+ }
2426
+ if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
2427
+ push({
2428
+ type: "plus",
2429
+ value
2430
+ });
2431
+ continue;
2432
+ }
2433
+ push({
2434
+ type: "plus",
2435
+ value: PLUS_LITERAL
2436
+ });
2437
+ continue;
2438
+ }
2439
+ /**
2440
+ * Plain text
2441
+ */
2442
+ if (value === "@") {
2443
+ if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
2444
+ push({
2445
+ type: "at",
2446
+ extglob: true,
2447
+ value,
2448
+ output: ""
2449
+ });
2450
+ continue;
2451
+ }
2452
+ push({
2453
+ type: "text",
2454
+ value
2455
+ });
2456
+ continue;
2457
+ }
2458
+ /**
2459
+ * Plain text
2460
+ */
2461
+ if (value !== "*") {
2462
+ if (value === "$" || value === "^") value = `\\${value}`;
2463
+ const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
2464
+ if (match) {
2465
+ value += match[0];
2466
+ state.index += match[0].length;
2467
+ }
2468
+ push({
2469
+ type: "text",
2470
+ value
2471
+ });
2472
+ continue;
2473
+ }
2474
+ /**
2475
+ * Stars
2476
+ */
2477
+ if (prev && (prev.type === "globstar" || prev.star === true)) {
2478
+ prev.type = "star";
2479
+ prev.star = true;
2480
+ prev.value += value;
2481
+ prev.output = star;
2482
+ state.backtrack = true;
2483
+ state.globstar = true;
2484
+ consume(value);
2485
+ continue;
2486
+ }
2487
+ let rest = remaining();
2488
+ if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
2489
+ extglobOpen("star", value);
2490
+ continue;
2491
+ }
2492
+ if (prev.type === "star") {
2493
+ if (opts.noglobstar === true) {
2494
+ consume(value);
2495
+ continue;
2496
+ }
2497
+ const prior = prev.prev;
2498
+ const before = prior.prev;
2499
+ const isStart = prior.type === "slash" || prior.type === "bos";
2500
+ const afterStar = before && (before.type === "star" || before.type === "globstar");
2501
+ if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
2502
+ push({
2503
+ type: "star",
2504
+ value,
2505
+ output: ""
2506
+ });
2507
+ continue;
2508
+ }
2509
+ const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
2510
+ const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
2511
+ if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
2512
+ push({
2513
+ type: "star",
2514
+ value,
2515
+ output: ""
2516
+ });
2517
+ continue;
2518
+ }
2519
+ while (rest.slice(0, 3) === "/**") {
2520
+ const after = input[state.index + 4];
2521
+ if (after && after !== "/") break;
2522
+ rest = rest.slice(3);
2523
+ consume("/**", 3);
2524
+ }
2525
+ if (prior.type === "bos" && eos()) {
2526
+ prev.type = "globstar";
2527
+ prev.value += value;
2528
+ prev.output = globstar(opts);
2529
+ state.output = prev.output;
2530
+ state.globstar = true;
2531
+ consume(value);
2532
+ continue;
2533
+ }
2534
+ if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
2535
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
2536
+ prior.output = `(?:${prior.output}`;
2537
+ prev.type = "globstar";
2538
+ prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
2539
+ prev.value += value;
2540
+ state.globstar = true;
2541
+ state.output += prior.output + prev.output;
2542
+ consume(value);
2543
+ continue;
2544
+ }
2545
+ if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
2546
+ const end = rest[1] !== void 0 ? "|$" : "";
2547
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
2548
+ prior.output = `(?:${prior.output}`;
2549
+ prev.type = "globstar";
2550
+ prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
2551
+ prev.value += value;
2552
+ state.output += prior.output + prev.output;
2553
+ state.globstar = true;
2554
+ consume(value + advance());
2555
+ push({
2556
+ type: "slash",
2557
+ value: "/",
2558
+ output: ""
2559
+ });
2560
+ continue;
2561
+ }
2562
+ if (prior.type === "bos" && rest[0] === "/") {
2563
+ prev.type = "globstar";
2564
+ prev.value += value;
2565
+ prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
2566
+ state.output = prev.output;
2567
+ state.globstar = true;
2568
+ consume(value + advance());
2569
+ push({
2570
+ type: "slash",
2571
+ value: "/",
2572
+ output: ""
2573
+ });
2574
+ continue;
2575
+ }
2576
+ state.output = state.output.slice(0, -prev.output.length);
2577
+ prev.type = "globstar";
2578
+ prev.output = globstar(opts);
2579
+ prev.value += value;
2580
+ state.output += prev.output;
2581
+ state.globstar = true;
2582
+ consume(value);
2583
+ continue;
2584
+ }
2585
+ const token = {
2586
+ type: "star",
2587
+ value,
2588
+ output: star
2589
+ };
2590
+ if (opts.bash === true) {
2591
+ token.output = ".*?";
2592
+ if (prev.type === "bos" || prev.type === "slash") token.output = nodot + token.output;
2593
+ push(token);
2594
+ continue;
2595
+ }
2596
+ if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
2597
+ token.output = value;
2598
+ push(token);
2599
+ continue;
2600
+ }
2601
+ if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
2602
+ if (prev.type === "dot") {
2603
+ state.output += NO_DOT_SLASH;
2604
+ prev.output += NO_DOT_SLASH;
2605
+ } else if (opts.dot === true) {
2606
+ state.output += NO_DOTS_SLASH;
2607
+ prev.output += NO_DOTS_SLASH;
2608
+ } else {
2609
+ state.output += nodot;
2610
+ prev.output += nodot;
2611
+ }
2612
+ if (peek() !== "*") {
2613
+ state.output += ONE_CHAR;
2614
+ prev.output += ONE_CHAR;
2615
+ }
2616
+ }
2617
+ push(token);
2618
+ }
2619
+ while (state.brackets > 0) {
2620
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
2621
+ state.output = utils.escapeLast(state.output, "[");
2622
+ decrement("brackets");
2623
+ }
2624
+ while (state.parens > 0) {
2625
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
2626
+ state.output = utils.escapeLast(state.output, "(");
2627
+ decrement("parens");
2628
+ }
2629
+ while (state.braces > 0) {
2630
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
2631
+ state.output = utils.escapeLast(state.output, "{");
2632
+ decrement("braces");
2633
+ }
2634
+ if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) push({
2635
+ type: "maybe_slash",
2636
+ value: "",
2637
+ output: `${SLASH_LITERAL}?`
2638
+ });
2639
+ if (state.backtrack === true) {
2640
+ state.output = "";
2641
+ for (const token of state.tokens) {
2642
+ state.output += token.output != null ? token.output : token.value;
2643
+ if (token.suffix) state.output += token.suffix;
2644
+ }
2645
+ }
2646
+ return state;
2647
+ };
2648
+ /**
2649
+ * Fast paths for creating regular expressions for common glob patterns.
2650
+ * This can significantly speed up processing and has very little downside
2651
+ * impact when none of the fast paths match.
2652
+ */
2653
+ parse.fastpaths = (input, options) => {
2654
+ const opts = { ...options };
2655
+ const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
2656
+ const len = input.length;
2657
+ if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
2658
+ input = REPLACEMENTS[input] || input;
2659
+ const win32 = utils.isWindows(options);
2660
+ const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(win32);
2661
+ const nodot = opts.dot ? NO_DOTS : NO_DOT;
2662
+ const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
2663
+ const capture = opts.capture ? "" : "?:";
2664
+ const state = {
2665
+ negated: false,
2666
+ prefix: ""
2667
+ };
2668
+ let star = opts.bash === true ? ".*?" : STAR;
2669
+ if (opts.capture) star = `(${star})`;
2670
+ const globstar = (opts) => {
2671
+ if (opts.noglobstar === true) return star;
2672
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
2673
+ };
2674
+ const create = (str) => {
2675
+ switch (str) {
2676
+ case "*": return `${nodot}${ONE_CHAR}${star}`;
2677
+ case ".*": return `${DOT_LITERAL}${ONE_CHAR}${star}`;
2678
+ case "*.*": return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
2679
+ case "*/*": return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
2680
+ case "**": return nodot + globstar(opts);
2681
+ case "**/*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
2682
+ case "**/*.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
2683
+ case "**/.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
2684
+ default: {
2685
+ const match = /^(.*?)\.(\w+)$/.exec(str);
2686
+ if (!match) return;
2687
+ const source = create(match[1]);
2688
+ if (!source) return;
2689
+ return source + DOT_LITERAL + match[2];
2690
+ }
2691
+ }
2692
+ };
2693
+ let source = create(utils.removePrefix(input, state));
2694
+ if (source && opts.strictSlashes !== true) source += `${SLASH_LITERAL}?`;
2695
+ return source;
2696
+ };
2697
+ module.exports = parse;
2698
+ }));
2699
+
2700
+ //#endregion
2701
+ //#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js
2702
+ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2703
+ const path = __require("node:path");
2704
+ const scan = require_scan();
2705
+ const parse = require_parse();
2706
+ const utils = require_utils();
2707
+ const constants = require_constants();
2708
+ const isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
2709
+ /**
2710
+ * Creates a matcher function from one or more glob patterns. The
2711
+ * returned function takes a string to match as its first argument,
2712
+ * and returns true if the string is a match. The returned matcher
2713
+ * function also takes a boolean as the second argument that, when true,
2714
+ * returns an object with additional information.
2715
+ *
2716
+ * ```js
2717
+ * const picomatch = require('picomatch');
2718
+ * // picomatch(glob[, options]);
2719
+ *
2720
+ * const isMatch = picomatch('*.!(*a)');
2721
+ * console.log(isMatch('a.a')); //=> false
2722
+ * console.log(isMatch('a.b')); //=> true
2723
+ * ```
2724
+ * @name picomatch
2725
+ * @param {String|Array} `globs` One or more glob patterns.
2726
+ * @param {Object=} `options`
2727
+ * @return {Function=} Returns a matcher function.
2728
+ * @api public
2729
+ */
2730
+ const picomatch = (glob, options, returnState = false) => {
2731
+ if (Array.isArray(glob)) {
2732
+ const fns = glob.map((input) => picomatch(input, options, returnState));
2733
+ const arrayMatcher = (str) => {
2734
+ for (const isMatch of fns) {
2735
+ const state = isMatch(str);
2736
+ if (state) return state;
2737
+ }
2738
+ return false;
2739
+ };
2740
+ return arrayMatcher;
2741
+ }
2742
+ const isState = isObject(glob) && glob.tokens && glob.input;
2743
+ if (glob === "" || typeof glob !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
2744
+ const opts = options || {};
2745
+ const posix = utils.isWindows(options);
2746
+ const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
2747
+ const state = regex.state;
2748
+ delete regex.state;
2749
+ let isIgnored = () => false;
2750
+ if (opts.ignore) {
2751
+ const ignoreOpts = {
2752
+ ...options,
2753
+ ignore: null,
2754
+ onMatch: null,
2755
+ onResult: null
2756
+ };
2757
+ isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
2758
+ }
2759
+ const matcher = (input, returnObject = false) => {
2760
+ const { isMatch, match, output } = picomatch.test(input, regex, options, {
2761
+ glob,
2762
+ posix
2763
+ });
2764
+ const result = {
2765
+ glob,
2766
+ state,
2767
+ regex,
2768
+ posix,
2769
+ input,
2770
+ output,
2771
+ match,
2772
+ isMatch
2773
+ };
2774
+ if (typeof opts.onResult === "function") opts.onResult(result);
2775
+ if (isMatch === false) {
2776
+ result.isMatch = false;
2777
+ return returnObject ? result : false;
2778
+ }
2779
+ if (isIgnored(input)) {
2780
+ if (typeof opts.onIgnore === "function") opts.onIgnore(result);
2781
+ result.isMatch = false;
2782
+ return returnObject ? result : false;
2783
+ }
2784
+ if (typeof opts.onMatch === "function") opts.onMatch(result);
2785
+ return returnObject ? result : true;
2786
+ };
2787
+ if (returnState) matcher.state = state;
2788
+ return matcher;
2789
+ };
2790
+ /**
2791
+ * Test `input` with the given `regex`. This is used by the main
2792
+ * `picomatch()` function to test the input string.
2793
+ *
2794
+ * ```js
2795
+ * const picomatch = require('picomatch');
2796
+ * // picomatch.test(input, regex[, options]);
2797
+ *
2798
+ * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
2799
+ * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
2800
+ * ```
2801
+ * @param {String} `input` String to test.
2802
+ * @param {RegExp} `regex`
2803
+ * @return {Object} Returns an object with matching info.
2804
+ * @api public
2805
+ */
2806
+ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
2807
+ if (typeof input !== "string") throw new TypeError("Expected input to be a string");
2808
+ if (input === "") return {
2809
+ isMatch: false,
2810
+ output: ""
2811
+ };
2812
+ const opts = options || {};
2813
+ const format = opts.format || (posix ? utils.toPosixSlashes : null);
2814
+ let match = input === glob;
2815
+ let output = match && format ? format(input) : input;
2816
+ if (match === false) {
2817
+ output = format ? format(input) : input;
2818
+ match = output === glob;
2819
+ }
2820
+ if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix);
2821
+ else match = regex.exec(output);
2822
+ return {
2823
+ isMatch: Boolean(match),
2824
+ match,
2825
+ output
2826
+ };
2827
+ };
2828
+ /**
2829
+ * Match the basename of a filepath.
2830
+ *
2831
+ * ```js
2832
+ * const picomatch = require('picomatch');
2833
+ * // picomatch.matchBase(input, glob[, options]);
2834
+ * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
2835
+ * ```
2836
+ * @param {String} `input` String to test.
2837
+ * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
2838
+ * @return {Boolean}
2839
+ * @api public
2840
+ */
2841
+ picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
2842
+ return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(path.basename(input));
2843
+ };
2844
+ /**
2845
+ * Returns true if **any** of the given glob `patterns` match the specified `string`.
2846
+ *
2847
+ * ```js
2848
+ * const picomatch = require('picomatch');
2849
+ * // picomatch.isMatch(string, patterns[, options]);
2850
+ *
2851
+ * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
2852
+ * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
2853
+ * ```
2854
+ * @param {String|Array} str The string to test.
2855
+ * @param {String|Array} patterns One or more glob patterns to use for matching.
2856
+ * @param {Object} [options] See available [options](#options).
2857
+ * @return {Boolean} Returns true if any patterns match `str`
2858
+ * @api public
2859
+ */
2860
+ picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
2861
+ /**
2862
+ * Parse a glob pattern to create the source string for a regular
2863
+ * expression.
2864
+ *
2865
+ * ```js
2866
+ * const picomatch = require('picomatch');
2867
+ * const result = picomatch.parse(pattern[, options]);
2868
+ * ```
2869
+ * @param {String} `pattern`
2870
+ * @param {Object} `options`
2871
+ * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
2872
+ * @api public
2873
+ */
2874
+ picomatch.parse = (pattern, options) => {
2875
+ if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
2876
+ return parse(pattern, {
2877
+ ...options,
2878
+ fastpaths: false
2879
+ });
2880
+ };
2881
+ /**
2882
+ * Scan a glob pattern to separate the pattern into segments.
2883
+ *
2884
+ * ```js
2885
+ * const picomatch = require('picomatch');
2886
+ * // picomatch.scan(input[, options]);
2887
+ *
2888
+ * const result = picomatch.scan('!./foo/*.js');
2889
+ * console.log(result);
2890
+ * { prefix: '!./',
2891
+ * input: '!./foo/*.js',
2892
+ * start: 3,
2893
+ * base: 'foo',
2894
+ * glob: '*.js',
2895
+ * isBrace: false,
2896
+ * isBracket: false,
2897
+ * isGlob: true,
2898
+ * isExtglob: false,
2899
+ * isGlobstar: false,
2900
+ * negated: true }
2901
+ * ```
2902
+ * @param {String} `input` Glob pattern to scan.
2903
+ * @param {Object} `options`
2904
+ * @return {Object} Returns an object with
2905
+ * @api public
2906
+ */
2907
+ picomatch.scan = (input, options) => scan(input, options);
2908
+ /**
2909
+ * Compile a regular expression from the `state` object returned by the
2910
+ * [parse()](#parse) method.
2911
+ *
2912
+ * @param {Object} `state`
2913
+ * @param {Object} `options`
2914
+ * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
2915
+ * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
2916
+ * @return {RegExp}
2917
+ * @api public
2918
+ */
2919
+ picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
2920
+ if (returnOutput === true) return state.output;
2921
+ const opts = options || {};
2922
+ const prepend = opts.contains ? "" : "^";
2923
+ const append = opts.contains ? "" : "$";
2924
+ let source = `${prepend}(?:${state.output})${append}`;
2925
+ if (state && state.negated === true) source = `^(?!${source}).*$`;
2926
+ const regex = picomatch.toRegex(source, options);
2927
+ if (returnState === true) regex.state = state;
2928
+ return regex;
2929
+ };
2930
+ /**
2931
+ * Create a regular expression from a parsed glob pattern.
2932
+ *
2933
+ * ```js
2934
+ * const picomatch = require('picomatch');
2935
+ * const state = picomatch.parse('*.js');
2936
+ * // picomatch.compileRe(state[, options]);
2937
+ *
2938
+ * console.log(picomatch.compileRe(state));
2939
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
2940
+ * ```
2941
+ * @param {String} `state` The object returned from the `.parse` method.
2942
+ * @param {Object} `options`
2943
+ * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
2944
+ * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
2945
+ * @return {RegExp} Returns a regex created from the given pattern.
2946
+ * @api public
2947
+ */
2948
+ picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
2949
+ if (!input || typeof input !== "string") throw new TypeError("Expected a non-empty string");
2950
+ let parsed = {
2951
+ negated: false,
2952
+ fastpaths: true
2953
+ };
2954
+ if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) parsed.output = parse.fastpaths(input, options);
2955
+ if (!parsed.output) parsed = parse(input, options);
2956
+ return picomatch.compileRe(parsed, options, returnOutput, returnState);
2957
+ };
2958
+ /**
2959
+ * Create a regular expression from the given regex source string.
2960
+ *
2961
+ * ```js
2962
+ * const picomatch = require('picomatch');
2963
+ * // picomatch.toRegex(source[, options]);
2964
+ *
2965
+ * const { output } = picomatch.parse('*.js');
2966
+ * console.log(picomatch.toRegex(output));
2967
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
2968
+ * ```
2969
+ * @param {String} `source` Regular expression source string.
2970
+ * @param {Object} `options`
2971
+ * @return {RegExp}
2972
+ * @api public
2973
+ */
2974
+ picomatch.toRegex = (source, options) => {
2975
+ try {
2976
+ const opts = options || {};
2977
+ return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
2978
+ } catch (err) {
2979
+ if (options && options.debug === true) throw err;
2980
+ return /$^/;
2981
+ }
2982
+ };
2983
+ /**
2984
+ * Picomatch constants.
2985
+ * @return {Object}
2986
+ */
2987
+ picomatch.constants = constants;
2988
+ /**
2989
+ * Expose "picomatch"
2990
+ */
2991
+ module.exports = picomatch;
2992
+ }));
2993
+
2994
+ //#endregion
2995
+ //#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/index.js
2996
+ var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2997
+ module.exports = require_picomatch$1();
2998
+ }));
2999
+
3000
+ //#endregion
3001
+ //#region ../../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/index.js
3002
+ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3003
+ const util = __require("node:util");
3004
+ const braces = require_braces();
3005
+ const picomatch = require_picomatch();
3006
+ const utils = require_utils();
3007
+ const isEmptyString = (v) => v === "" || v === "./";
3008
+ const hasBraces = (v) => {
3009
+ const index = v.indexOf("{");
3010
+ return index > -1 && v.indexOf("}", index) > -1;
3011
+ };
3012
+ /**
3013
+ * Returns an array of strings that match one or more glob patterns.
3014
+ *
3015
+ * ```js
3016
+ * const mm = require('micromatch');
3017
+ * // mm(list, patterns[, options]);
3018
+ *
3019
+ * console.log(mm(['a.js', 'a.txt'], ['*.js']));
3020
+ * //=> [ 'a.js' ]
3021
+ * ```
3022
+ * @param {String|Array<string>} `list` List of strings to match.
3023
+ * @param {String|Array<string>} `patterns` One or more glob patterns to use for matching.
3024
+ * @param {Object} `options` See available [options](#options)
3025
+ * @return {Array} Returns an array of matches
3026
+ * @summary false
3027
+ * @api public
3028
+ */
3029
+ const micromatch = (list, patterns, options) => {
3030
+ patterns = [].concat(patterns);
3031
+ list = [].concat(list);
3032
+ let omit = /* @__PURE__ */ new Set();
3033
+ let keep = /* @__PURE__ */ new Set();
3034
+ let items = /* @__PURE__ */ new Set();
3035
+ let negatives = 0;
3036
+ let onResult = (state) => {
3037
+ items.add(state.output);
3038
+ if (options && options.onResult) options.onResult(state);
3039
+ };
3040
+ for (let i = 0; i < patterns.length; i++) {
3041
+ let isMatch = picomatch(String(patterns[i]), {
3042
+ ...options,
3043
+ onResult
3044
+ }, true);
3045
+ let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
3046
+ if (negated) negatives++;
3047
+ for (let item of list) {
3048
+ let matched = isMatch(item, true);
3049
+ if (!(negated ? !matched.isMatch : matched.isMatch)) continue;
3050
+ if (negated) omit.add(matched.output);
3051
+ else {
3052
+ omit.delete(matched.output);
3053
+ keep.add(matched.output);
3054
+ }
3055
+ }
3056
+ }
3057
+ let matches = (negatives === patterns.length ? [...items] : [...keep]).filter((item) => !omit.has(item));
3058
+ if (options && matches.length === 0) {
3059
+ if (options.failglob === true) throw new Error(`No matches found for "${patterns.join(", ")}"`);
3060
+ if (options.nonull === true || options.nullglob === true) return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
3061
+ }
3062
+ return matches;
3063
+ };
3064
+ /**
3065
+ * Backwards compatibility
3066
+ */
3067
+ micromatch.match = micromatch;
3068
+ /**
3069
+ * Returns a matcher function from the given glob `pattern` and `options`.
3070
+ * The returned function takes a string to match as its only argument and returns
3071
+ * true if the string is a match.
3072
+ *
3073
+ * ```js
3074
+ * const mm = require('micromatch');
3075
+ * // mm.matcher(pattern[, options]);
3076
+ *
3077
+ * const isMatch = mm.matcher('*.!(*a)');
3078
+ * console.log(isMatch('a.a')); //=> false
3079
+ * console.log(isMatch('a.b')); //=> true
3080
+ * ```
3081
+ * @param {String} `pattern` Glob pattern
3082
+ * @param {Object} `options`
3083
+ * @return {Function} Returns a matcher function.
3084
+ * @api public
3085
+ */
3086
+ micromatch.matcher = (pattern, options) => picomatch(pattern, options);
3087
+ /**
3088
+ * Returns true if **any** of the given glob `patterns` match the specified `string`.
3089
+ *
3090
+ * ```js
3091
+ * const mm = require('micromatch');
3092
+ * // mm.isMatch(string, patterns[, options]);
3093
+ *
3094
+ * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
3095
+ * console.log(mm.isMatch('a.a', 'b.*')); //=> false
3096
+ * ```
3097
+ * @param {String} `str` The string to test.
3098
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
3099
+ * @param {Object} `[options]` See available [options](#options).
3100
+ * @return {Boolean} Returns true if any patterns match `str`
3101
+ * @api public
3102
+ */
3103
+ micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
3104
+ /**
3105
+ * Backwards compatibility
3106
+ */
3107
+ micromatch.any = micromatch.isMatch;
3108
+ /**
3109
+ * Returns a list of strings that _**do not match any**_ of the given `patterns`.
3110
+ *
3111
+ * ```js
3112
+ * const mm = require('micromatch');
3113
+ * // mm.not(list, patterns[, options]);
3114
+ *
3115
+ * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
3116
+ * //=> ['b.b', 'c.c']
3117
+ * ```
3118
+ * @param {Array} `list` Array of strings to match.
3119
+ * @param {String|Array} `patterns` One or more glob pattern to use for matching.
3120
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
3121
+ * @return {Array} Returns an array of strings that **do not match** the given patterns.
3122
+ * @api public
3123
+ */
3124
+ micromatch.not = (list, patterns, options = {}) => {
3125
+ patterns = [].concat(patterns).map(String);
3126
+ let result = /* @__PURE__ */ new Set();
3127
+ let items = [];
3128
+ let onResult = (state) => {
3129
+ if (options.onResult) options.onResult(state);
3130
+ items.push(state.output);
3131
+ };
3132
+ let matches = new Set(micromatch(list, patterns, {
3133
+ ...options,
3134
+ onResult
3135
+ }));
3136
+ for (let item of items) if (!matches.has(item)) result.add(item);
3137
+ return [...result];
3138
+ };
3139
+ /**
3140
+ * Returns true if the given `string` contains the given pattern. Similar
3141
+ * to [.isMatch](#isMatch) but the pattern can match any part of the string.
3142
+ *
3143
+ * ```js
3144
+ * var mm = require('micromatch');
3145
+ * // mm.contains(string, pattern[, options]);
3146
+ *
3147
+ * console.log(mm.contains('aa/bb/cc', '*b'));
3148
+ * //=> true
3149
+ * console.log(mm.contains('aa/bb/cc', '*d'));
3150
+ * //=> false
3151
+ * ```
3152
+ * @param {String} `str` The string to match.
3153
+ * @param {String|Array} `patterns` Glob pattern to use for matching.
3154
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
3155
+ * @return {Boolean} Returns true if any of the patterns matches any part of `str`.
3156
+ * @api public
3157
+ */
3158
+ micromatch.contains = (str, pattern, options) => {
3159
+ if (typeof str !== "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
3160
+ if (Array.isArray(pattern)) return pattern.some((p) => micromatch.contains(str, p, options));
3161
+ if (typeof pattern === "string") {
3162
+ if (isEmptyString(str) || isEmptyString(pattern)) return false;
3163
+ if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) return true;
3164
+ }
3165
+ return micromatch.isMatch(str, pattern, {
3166
+ ...options,
3167
+ contains: true
3168
+ });
3169
+ };
3170
+ /**
3171
+ * Filter the keys of the given object with the given `glob` pattern
3172
+ * and `options`. Does not attempt to match nested keys. If you need this feature,
3173
+ * use [glob-object][] instead.
3174
+ *
3175
+ * ```js
3176
+ * const mm = require('micromatch');
3177
+ * // mm.matchKeys(object, patterns[, options]);
3178
+ *
3179
+ * const obj = { aa: 'a', ab: 'b', ac: 'c' };
3180
+ * console.log(mm.matchKeys(obj, '*b'));
3181
+ * //=> { ab: 'b' }
3182
+ * ```
3183
+ * @param {Object} `object` The object with keys to filter.
3184
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
3185
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
3186
+ * @return {Object} Returns an object with only keys that match the given patterns.
3187
+ * @api public
3188
+ */
3189
+ micromatch.matchKeys = (obj, patterns, options) => {
3190
+ if (!utils.isObject(obj)) throw new TypeError("Expected the first argument to be an object");
3191
+ let keys = micromatch(Object.keys(obj), patterns, options);
3192
+ let res = {};
3193
+ for (let key of keys) res[key] = obj[key];
3194
+ return res;
3195
+ };
3196
+ /**
3197
+ * Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
3198
+ *
3199
+ * ```js
3200
+ * const mm = require('micromatch');
3201
+ * // mm.some(list, patterns[, options]);
3202
+ *
3203
+ * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
3204
+ * // true
3205
+ * console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
3206
+ * // false
3207
+ * ```
3208
+ * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
3209
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
3210
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
3211
+ * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list`
3212
+ * @api public
3213
+ */
3214
+ micromatch.some = (list, patterns, options) => {
3215
+ let items = [].concat(list);
3216
+ for (let pattern of [].concat(patterns)) {
3217
+ let isMatch = picomatch(String(pattern), options);
3218
+ if (items.some((item) => isMatch(item))) return true;
3219
+ }
3220
+ return false;
3221
+ };
3222
+ /**
3223
+ * Returns true if every string in the given `list` matches
3224
+ * any of the given glob `patterns`.
3225
+ *
3226
+ * ```js
3227
+ * const mm = require('micromatch');
3228
+ * // mm.every(list, patterns[, options]);
3229
+ *
3230
+ * console.log(mm.every('foo.js', ['foo.js']));
3231
+ * // true
3232
+ * console.log(mm.every(['foo.js', 'bar.js'], ['*.js']));
3233
+ * // true
3234
+ * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
3235
+ * // false
3236
+ * console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
3237
+ * // false
3238
+ * ```
3239
+ * @param {String|Array} `list` The string or array of strings to test.
3240
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
3241
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
3242
+ * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list`
3243
+ * @api public
3244
+ */
3245
+ micromatch.every = (list, patterns, options) => {
3246
+ let items = [].concat(list);
3247
+ for (let pattern of [].concat(patterns)) {
3248
+ let isMatch = picomatch(String(pattern), options);
3249
+ if (!items.every((item) => isMatch(item))) return false;
3250
+ }
3251
+ return true;
3252
+ };
3253
+ /**
3254
+ * Returns true if **all** of the given `patterns` match
3255
+ * the specified string.
3256
+ *
3257
+ * ```js
3258
+ * const mm = require('micromatch');
3259
+ * // mm.all(string, patterns[, options]);
3260
+ *
3261
+ * console.log(mm.all('foo.js', ['foo.js']));
3262
+ * // true
3263
+ *
3264
+ * console.log(mm.all('foo.js', ['*.js', '!foo.js']));
3265
+ * // false
3266
+ *
3267
+ * console.log(mm.all('foo.js', ['*.js', 'foo.js']));
3268
+ * // true
3269
+ *
3270
+ * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
3271
+ * // true
3272
+ * ```
3273
+ * @param {String|Array} `str` The string to test.
3274
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
3275
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
3276
+ * @return {Boolean} Returns true if any patterns match `str`
3277
+ * @api public
3278
+ */
3279
+ micromatch.all = (str, patterns, options) => {
3280
+ if (typeof str !== "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
3281
+ return [].concat(patterns).every((p) => picomatch(p, options)(str));
3282
+ };
3283
+ /**
3284
+ * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match.
3285
+ *
3286
+ * ```js
3287
+ * const mm = require('micromatch');
3288
+ * // mm.capture(pattern, string[, options]);
3289
+ *
3290
+ * console.log(mm.capture('test/*.js', 'test/foo.js'));
3291
+ * //=> ['foo']
3292
+ * console.log(mm.capture('test/*.js', 'foo/bar.css'));
3293
+ * //=> null
3294
+ * ```
3295
+ * @param {String} `glob` Glob pattern to use for matching.
3296
+ * @param {String} `input` String to match
3297
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
3298
+ * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`.
3299
+ * @api public
3300
+ */
3301
+ micromatch.capture = (glob, input, options) => {
3302
+ let posix = utils.isWindows(options);
3303
+ let match = picomatch.makeRe(String(glob), {
3304
+ ...options,
3305
+ capture: true
3306
+ }).exec(posix ? utils.toPosixSlashes(input) : input);
3307
+ if (match) return match.slice(1).map((v) => v === void 0 ? "" : v);
3308
+ };
3309
+ /**
3310
+ * Create a regular expression from the given glob `pattern`.
3311
+ *
3312
+ * ```js
3313
+ * const mm = require('micromatch');
3314
+ * // mm.makeRe(pattern[, options]);
3315
+ *
3316
+ * console.log(mm.makeRe('*.js'));
3317
+ * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
3318
+ * ```
3319
+ * @param {String} `pattern` A glob pattern to convert to regex.
3320
+ * @param {Object} `options`
3321
+ * @return {RegExp} Returns a regex created from the given pattern.
3322
+ * @api public
3323
+ */
3324
+ micromatch.makeRe = (...args) => picomatch.makeRe(...args);
3325
+ /**
3326
+ * Scan a glob pattern to separate the pattern into segments. Used
3327
+ * by the [split](#split) method.
3328
+ *
3329
+ * ```js
3330
+ * const mm = require('micromatch');
3331
+ * const state = mm.scan(pattern[, options]);
3332
+ * ```
3333
+ * @param {String} `pattern`
3334
+ * @param {Object} `options`
3335
+ * @return {Object} Returns an object with
3336
+ * @api public
3337
+ */
3338
+ micromatch.scan = (...args) => picomatch.scan(...args);
3339
+ /**
3340
+ * Parse a glob pattern to create the source string for a regular
3341
+ * expression.
3342
+ *
3343
+ * ```js
3344
+ * const mm = require('micromatch');
3345
+ * const state = mm.parse(pattern[, options]);
3346
+ * ```
3347
+ * @param {String} `glob`
3348
+ * @param {Object} `options`
3349
+ * @return {Object} Returns an object with useful properties and output to be used as regex source string.
3350
+ * @api public
3351
+ */
3352
+ micromatch.parse = (patterns, options) => {
3353
+ let res = [];
3354
+ for (let pattern of [].concat(patterns || [])) for (let str of braces(String(pattern), options)) res.push(picomatch.parse(str, options));
3355
+ return res;
3356
+ };
3357
+ /**
3358
+ * Process the given brace `pattern`.
3359
+ *
3360
+ * ```js
3361
+ * const { braces } = require('micromatch');
3362
+ * console.log(braces('foo/{a,b,c}/bar'));
3363
+ * //=> [ 'foo/(a|b|c)/bar' ]
3364
+ *
3365
+ * console.log(braces('foo/{a,b,c}/bar', { expand: true }));
3366
+ * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ]
3367
+ * ```
3368
+ * @param {String} `pattern` String with brace pattern to process.
3369
+ * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options.
3370
+ * @return {Array}
3371
+ * @api public
3372
+ */
3373
+ micromatch.braces = (pattern, options) => {
3374
+ if (typeof pattern !== "string") throw new TypeError("Expected a string");
3375
+ if (options && options.nobrace === true || !hasBraces(pattern)) return [pattern];
3376
+ return braces(pattern, options);
3377
+ };
3378
+ /**
3379
+ * Expand braces
3380
+ */
3381
+ micromatch.braceExpand = (pattern, options) => {
3382
+ if (typeof pattern !== "string") throw new TypeError("Expected a string");
3383
+ return micromatch.braces(pattern, {
3384
+ ...options,
3385
+ expand: true
3386
+ });
3387
+ };
3388
+ /**
3389
+ * Expose micromatch
3390
+ */
3391
+ micromatch.hasBraces = hasBraces;
3392
+ module.exports = micromatch;
3393
+ }));
3394
+
3395
+ //#endregion
3396
+ //#region ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=439aa6e683a9a48c3ebbf3529be5811680c45c22d6a265d_be73b50bc43bac944747b8ca0498113a/node_modules/@deepkit/type-compiler/dist/esm/src/resolver.js
3397
+ var import_micromatch = /* @__PURE__ */ __toESM(require_micromatch(), 1);
3398
+ const { createSourceFile, resolveModuleName, isStringLiteral, JSDocParsingMode, ScriptTarget } = ts;
3399
+ function patternMatch(path, patterns, base) {
3400
+ const include = patterns.filter((pattern) => pattern[0] !== "!");
3401
+ const exclude = patterns.filter((pattern) => pattern[0] === "!").map((pattern) => pattern.substring(1));
3402
+ return import_micromatch.default.isMatch(path, include, { ignore: exclude });
3403
+ }
3404
+ /**
3405
+ * A utility to resolve a module path and its declaration.
3406
+ *
3407
+ * It automatically reads a SourceFile, binds and caches it.
3408
+ */
3409
+ var Resolver = class {
3410
+ constructor(compilerOptions, host, sourceFiles) {
3411
+ this.compilerOptions = compilerOptions;
3412
+ this.host = host;
3413
+ this.sourceFiles = sourceFiles;
3414
+ }
3415
+ resolve(from, importOrExportNode) {
3416
+ const moduleSpecifier = importOrExportNode.moduleSpecifier;
3417
+ if (!moduleSpecifier) return;
3418
+ if (!isStringLiteral(moduleSpecifier)) return;
3419
+ return this.resolveSourceFile(from, moduleSpecifier);
3420
+ }
3421
+ resolveImpl(modulePath, sourceFile) {
3422
+ if (this.host.resolveModuleNameLiterals !== void 0) {
3423
+ const results = this.host.resolveModuleNameLiterals([modulePath], sourceFile.fileName, void 0, this.compilerOptions, sourceFile, void 0);
3424
+ if (results[0]) return results[0].resolvedModule;
3425
+ return;
3426
+ }
3427
+ if (this.host.resolveModuleNames !== void 0) return this.host.resolveModuleNames([modulePath.text], sourceFile.fileName, void 0, void 0, this.compilerOptions)[0];
3428
+ return resolveModuleName(modulePath.text, sourceFile.fileName, this.compilerOptions, this.host).resolvedModule;
3429
+ }
3430
+ /**
3431
+ * Tries to resolve the .ts/d.ts file path for a given module path.
3432
+ * Scans relative paths. Looks into package.json "types" and "exports" (with new 4.7 support)
3433
+ *
3434
+ * @param sourceFile the SourceFile of the file that contains the import. modulePath is relative to that.
3435
+ * @param modulePath the x in 'from x'.
3436
+ */
3437
+ resolveSourceFile(sourceFile, modulePath) {
3438
+ const result = this.resolveImpl(modulePath, sourceFile);
3439
+ if (!result) return;
3440
+ if (!result.resolvedFileName.endsWith(".ts") && !result.resolvedFileName.endsWith(".tsx") && !result.resolvedFileName.endsWith(".d.ts")) return;
3441
+ const fileName = result.resolvedFileName;
3442
+ if (this.sourceFiles[fileName]) return this.sourceFiles[fileName];
3443
+ const source = this.host.readFile(result.resolvedFileName);
3444
+ if (!source) return;
3445
+ const moduleSourceFile = this.sourceFiles[fileName] = createSourceFile(fileName, source, {
3446
+ languageVersion: this.compilerOptions.target || ScriptTarget.ES2018,
3447
+ jsDocParsingMode: JSDocParsingMode ? JSDocParsingMode.ParseNone : void 0
3448
+ }, true);
3449
+ this.sourceFiles[fileName] = moduleSourceFile;
3450
+ ts.bindSourceFile(moduleSourceFile, this.compilerOptions);
3451
+ return moduleSourceFile;
3452
+ }
3453
+ };
3454
+
3455
+ //#endregion
3456
+ //#region ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=439aa6e683a9a48c3ebbf3529be5811680c45c22d6a265d_be73b50bc43bac944747b8ca0498113a/node_modules/@deepkit/type-compiler/dist/esm/src/config.js
3457
+ /**
3458
+ * Default means reflection is enabled for this file.
3459
+ * Never means the whole reflection is disabled for this file.
3460
+ * Explicit means that reflection is per default disabled for this file, but each symbol/type
3461
+ * in it is allowed to enable it using jsdoc `@reflection`.
3462
+ */
3463
+ const reflectionModes = [
3464
+ "default",
3465
+ "explicit",
3466
+ "never"
3467
+ ];
3468
+ function isObject(obj) {
3469
+ if (!obj) return false;
3470
+ return typeof obj === "object" && !Array.isArray(obj);
3471
+ }
3472
+ const defaultMergeStrategy = "merge";
3473
+ const reflectionLevel = [
3474
+ "minimal",
3475
+ "normal",
3476
+ "extended",
3477
+ "verbose"
3478
+ ];
3479
+ /**
3480
+ * Read config and parses under TypeScript specification.
3481
+ */
3482
+ function readTsConfig(parseConfigHost, path) {
3483
+ const configFile = ts.readConfigFile(path, (path) => parseConfigHost.readFile(path));
3484
+ if (configFile.error) {
3485
+ debug(`Failed to read tsconfig ${path}: ${configFile.error.messageText}`);
3486
+ return;
3487
+ }
3488
+ const parsed = ts.parseJsonConfigFileContent(configFile.config, parseConfigHost, dirname(path));
3489
+ const ignoredErrors = [18003];
3490
+ const softErrors = [18e3];
3491
+ const errors = parsed.errors.filter((v) => !ignoredErrors.includes(v.code));
3492
+ if (errors.length) debug(`Failed to parse tsconfig ${path}: ${parsed.errors.map((v) => v.messageText).join(", ")}`);
3493
+ if (errors.filter((v) => !softErrors.includes(v.code)).length) return;
3494
+ const json = readFileSync(path, "utf8");
3495
+ const tsconfig = JSON.parse(json);
3496
+ return Object.assign(configFile.config, {
3497
+ compilerOptions: parsed.options,
3498
+ reflectionLevel: tsconfig.reflectionLevel ? String(tsconfig.reflectionLevel) : void 0
3499
+ });
3500
+ }
3501
+ function reflectionModeMatcher(config, filePath) {
3502
+ if (Array.isArray(config.exclude)) {
3503
+ if (patternMatch(filePath, config.exclude)) return "never";
3504
+ }
3505
+ if (Array.isArray(config.reflection)) return patternMatch(filePath, config.reflection) ? "default" : "never";
3506
+ if (config.reflection === "default" || config.reflection === "explicit") return config.reflection;
3507
+ return "never";
3508
+ }
3509
+ function ensureStringArray(value) {
3510
+ if (Array.isArray(value)) return value.map((v) => "" + v);
3511
+ if ("string" === typeof value) return [value];
3512
+ return [];
3513
+ }
3514
+ function parseRawMode(mode) {
3515
+ if ("boolean" === typeof mode) return mode ? "default" : "never";
3516
+ if (mode === "default" || mode === "explicit") return mode;
3517
+ return ensureStringArray(mode);
3518
+ }
3519
+ function resolvePaths(baseDir, paths) {
3520
+ if (!paths || !Array.isArray(paths)) return;
3521
+ for (let i = 0; i < paths.length; i++) {
3522
+ if ("string" !== typeof paths[i]) continue;
3523
+ if (isAbsolute(paths[i])) continue;
3524
+ let path = paths[i];
3525
+ let exclude = false;
3526
+ if (path.startsWith("!")) {
3527
+ exclude = true;
3528
+ path = path.substring(1);
3529
+ }
3530
+ if (path.startsWith("./") || path.includes("/")) path = join(baseDir, path);
3531
+ path = path.replace(/\\/g, "/");
3532
+ if (exclude) path = "!" + path;
3533
+ paths[i] = path;
3534
+ }
3535
+ }
3536
+ function appendPaths(strategy = defaultMergeStrategy, parent, existing) {
3537
+ if (strategy === "replace") return [...existing || parent];
3538
+ if (!existing) return [...parent];
3539
+ return [...parent, ...existing];
3540
+ }
3541
+ function applyConfigValues(existing, parent, baseDir) {
3542
+ const parentReflection = isObject(parent.deepkitCompilerOptions) ? parent.deepkitCompilerOptions?.reflection : parent.reflection;
3543
+ const parentReflectionLevel = parent.deepkitCompilerOptions?.reflectionLevel || parent.reflectionLevel || parent.compilerOptions?.reflectionLevel;
3544
+ if (isObject(parent.deepkitCompilerOptions) && "undefined" === typeof existing.mergeStrategy) existing.mergeStrategy = parent.deepkitCompilerOptions.mergeStrategy;
3545
+ if ("undefined" !== typeof parentReflection) {
3546
+ const next = parseRawMode(parentReflection);
3547
+ if ("undefined" === typeof existing.reflection) existing.reflection = next;
3548
+ else if ("string" === typeof existing.reflection) {} else if (Array.isArray(next) && Array.isArray(existing.reflection)) existing.reflection = appendPaths(existing.mergeStrategy, next, existing.reflection);
3549
+ else if ("string" === typeof next && Array.isArray(existing.reflection)) {}
3550
+ }
3551
+ if ("undefined" !== typeof parentReflectionLevel) {
3552
+ if ("undefined" === typeof existing.reflectionLevel) existing.reflectionLevel = parentReflectionLevel;
3553
+ }
3554
+ if (isObject(parent.deepkitCompilerOptions)) {
3555
+ if (`undefined` !== typeof parent.deepkitCompilerOptions.exclude) {
3556
+ const next = ensureStringArray(parent.deepkitCompilerOptions.exclude);
3557
+ existing.exclude = appendPaths(existing.mergeStrategy, next, existing.exclude);
3558
+ }
3559
+ }
3560
+ resolvePaths(baseDir, existing.reflection);
3561
+ resolvePaths(baseDir, existing.exclude);
3562
+ if (parent.compilerOptions) {
3563
+ if (Object.keys(existing.compilerOptions).length === 0) Object.assign(existing.compilerOptions, parent.compilerOptions);
3564
+ }
3565
+ existing.extends = parent.extends;
3566
+ }
3567
+ const defaultExcluded = [
3568
+ "lib.dom*.d.ts",
3569
+ "*typedarrays.d.ts",
3570
+ "lib.webworker*.d.ts",
3571
+ "lib.decorator*.d.ts",
3572
+ "lib.es2015.proxy.d.ts",
3573
+ "lib.es2020.sharedmemory.d.ts",
3574
+ "lib.es2015.core.d.ts"
3575
+ ];
3576
+ function getConfigResolver(cache, host, compilerOptions, sourceFile, tsConfigPath = "") {
3577
+ let config = { compilerOptions: {} };
3578
+ tsConfigPath = tsConfigPath || ("string" === typeof compilerOptions.configFilePath ? compilerOptions.configFilePath : "");
3579
+ if (tsConfigPath) {
3580
+ if (cache[tsConfigPath]) return cache[tsConfigPath];
3581
+ const configFile = readTsConfig(host, tsConfigPath);
3582
+ if (configFile) applyConfigValues(config, configFile, dirname(tsConfigPath));
3583
+ } else {
3584
+ if (!tsConfigPath && sourceFile) {
3585
+ const baseDir = dirname(sourceFile.fileName);
3586
+ const configPath = ts.findConfigFile(baseDir, (path) => {
3587
+ path = isAbsolute(path) ? path : join(baseDir, path);
3588
+ return host.fileExists(path);
3589
+ });
3590
+ debug2(`No tsConfigPath|compilerOptions.configFilePath provided. Manually searching for tsconfig.json in ${baseDir} returned ${configPath}`);
3591
+ if (configPath) tsConfigPath = isAbsolute(configPath) ? configPath : join(baseDir, configPath);
3592
+ }
3593
+ if (tsConfigPath) {
3594
+ if (cache[tsConfigPath]) return cache[tsConfigPath];
3595
+ const configFile = readTsConfig(host, tsConfigPath);
3596
+ if (configFile) applyConfigValues(config, configFile, dirname(tsConfigPath));
3597
+ }
3598
+ }
3599
+ if (tsConfigPath) {
3600
+ let basePath = dirname(tsConfigPath);
3601
+ let currentConfig = config;
3602
+ const seen = /* @__PURE__ */ new Set();
3603
+ seen.add(tsConfigPath);
3604
+ while (currentConfig.extends) {
3605
+ const path = join(basePath, currentConfig.extends);
3606
+ if (seen.has(path)) break;
3607
+ seen.add(path);
3608
+ const nextConfig = ts.readConfigFile(path, (path) => host.readFile(path));
3609
+ if (!nextConfig) break;
3610
+ basePath = dirname(path);
3611
+ applyConfigValues(currentConfig, nextConfig.config, basePath);
3612
+ }
3613
+ } else throw new Error(`No tsconfig found for ${sourceFile?.fileName}, that is weird. Either provide a tsconfig or compilerOptions.configFilePath`);
3614
+ config.exclude = config.exclude ? [...defaultExcluded, ...config.exclude] : [...defaultExcluded];
3615
+ config.compilerOptions.configFilePath = tsConfigPath;
3616
+ const resolvedConfig = {
3617
+ path: tsConfigPath,
3618
+ compilerOptions: Object.assign(config.compilerOptions, compilerOptions),
3619
+ exclude: config.exclude,
3620
+ reflection: config.reflection,
3621
+ reflectionLevel: config.reflectionLevel || (config.compilerOptions?.reflectionLevel ? String(config.compilerOptions?.reflectionLevel) : void 0) || "normal",
3622
+ mergeStrategy: config.mergeStrategy || defaultMergeStrategy
3623
+ };
3624
+ if (isDebug()) debug(`Found config ${resolvedConfig.path}:\nreflection:`, resolvedConfig.reflection, `\nexclude:`, resolvedConfig.exclude, `\npaths:`, resolvedConfig.compilerOptions.paths);
3625
+ const match = (path) => {
3626
+ return {
3627
+ mode: reflectionModeMatcher(config, path),
3628
+ tsConfigPath,
3629
+ level: resolvedConfig.reflectionLevel
3630
+ };
3631
+ };
3632
+ return cache[tsConfigPath] = {
3633
+ config: resolvedConfig,
3634
+ match
3635
+ };
3636
+ }
3637
+
3638
+ //#endregion
3639
+ export { reflectionLevel as a, Resolver as c, __commonJSMin as d, __require as f, parseRawMode as i, debug as l, getConfigResolver as n, reflectionModeMatcher as o, isObject as r, reflectionModes as s, defaultExcluded as t, debug2 as u };
3640
+ //# sourceMappingURL=config-y0HNkbCH.mjs.map