@powerlines/deepkit 0.5.0 → 0.5.2

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