@vite-hub/source 0.0.2 → 0.0.4

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 (62) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +167 -1
  3. package/dist/auth-Ddw55OUG.js +1261 -0
  4. package/dist/client-CDfTmtQu.js +7903 -0
  5. package/dist/client.d.ts +32 -0
  6. package/dist/client.js +121 -0
  7. package/dist/collection-B8pXGM2d.js +141 -0
  8. package/dist/collection-CF2ON__k.d.ts +92 -0
  9. package/dist/collection-route-Dw7QLFyx.js +6 -0
  10. package/dist/content/client.d.ts +3 -0
  11. package/dist/content/client.js +2 -0
  12. package/dist/content.d.ts +44 -0
  13. package/dist/content.js +157 -0
  14. package/dist/file-BSWQg9Qv.js +503 -0
  15. package/dist/{file-slFAccIZ.d.ts → file-EQ3AjVM6.d.ts} +1 -1
  16. package/dist/file.d.ts +2 -0
  17. package/dist/file.js +2 -0
  18. package/dist/{index-CJpN2j6c.d.ts → github.d.ts} +4 -4
  19. package/dist/github.js +1033 -0
  20. package/dist/glob.d.ts +15 -0
  21. package/dist/glob.js +895 -0
  22. package/dist/index.d.ts +69 -10
  23. package/dist/index.js +70 -108
  24. package/dist/{markdown-Beo-0cqc.d.ts → markdown.d.ts} +3 -3
  25. package/dist/{sources/markdown.js → markdown.js} +1 -1
  26. package/dist/mcp.d.ts +152 -0
  27. package/dist/mcp.js +6115 -0
  28. package/dist/{path-B5QNI5sY.js → path-BzmU4Eni.js} +2 -10
  29. package/dist/path-CUhvUREm.js +1936 -0
  30. package/dist/registry-C8skfCSV.js +120 -0
  31. package/dist/server.d.ts +15 -0
  32. package/dist/server.js +71 -0
  33. package/dist/sse-CE9Q2JqM.js +407 -0
  34. package/dist/streamableHttp-BszaXLmg.js +491 -0
  35. package/dist/types-AIBmt_m6.js +6275 -0
  36. package/dist/types-Bu3WvNX9.d.ts +71 -0
  37. package/dist/vite.d.ts +41 -0
  38. package/dist/vite.js +629 -0
  39. package/package.json +68 -30
  40. package/tsconfig.vite.json +6 -0
  41. package/types/source/fallback.d.ts +1 -0
  42. package/types/source/index.d.ts +1 -0
  43. package/dist/chunk-D7D4PA-g.js +0 -13
  44. package/dist/custom-EnZvMLiy.d.ts +0 -6
  45. package/dist/github-B4lgrzXQ.js +0 -565
  46. package/dist/glob-CuxZwoC3.d.ts +0 -15
  47. package/dist/mcp-resources-C7-5Qeh4.d.ts +0 -41
  48. package/dist/mcp-resources-DSDqTfbK.js +0 -307
  49. package/dist/sources/custom.d.ts +0 -2
  50. package/dist/sources/custom.js +0 -6
  51. package/dist/sources/file.d.ts +0 -2
  52. package/dist/sources/file.js +0 -57
  53. package/dist/sources/github.d.ts +0 -2
  54. package/dist/sources/github.js +0 -2
  55. package/dist/sources/glob.d.ts +0 -2
  56. package/dist/sources/glob.js +0 -110
  57. package/dist/sources/index.d.ts +0 -13
  58. package/dist/sources/index.js +0 -18
  59. package/dist/sources/markdown.d.ts +0 -2
  60. package/dist/sources/mcp-resources.d.ts +0 -2
  61. package/dist/sources/mcp-resources.js +0 -2
  62. package/dist/types-f6Lyjq8g.d.ts +0 -73
@@ -0,0 +1,1936 @@
1
+ import { r as normalizeSourcePath } from "./path-BzmU4Eni.js";
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
+ key = keys[i];
13
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
21
+ value: mod,
22
+ enumerable: true
23
+ }) : target, mod));
24
+ //#endregion
25
+ //#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/constants.js
26
+ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27
+ const WIN_SLASH = "\\\\/";
28
+ const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
29
+ const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
30
+ /**
31
+ * Posix glob regex
32
+ */
33
+ const DOT_LITERAL = "\\.";
34
+ const PLUS_LITERAL = "\\+";
35
+ const QMARK_LITERAL = "\\?";
36
+ const SLASH_LITERAL = "\\/";
37
+ const ONE_CHAR = "(?=.)";
38
+ const QMARK = "[^/]";
39
+ const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
40
+ const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
41
+ const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
42
+ const POSIX_CHARS = {
43
+ DOT_LITERAL,
44
+ PLUS_LITERAL,
45
+ QMARK_LITERAL,
46
+ SLASH_LITERAL,
47
+ ONE_CHAR,
48
+ QMARK,
49
+ END_ANCHOR,
50
+ DOTS_SLASH,
51
+ NO_DOT: `(?!${DOT_LITERAL})`,
52
+ NO_DOTS: `(?!${START_ANCHOR}${DOTS_SLASH})`,
53
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`,
54
+ NO_DOTS_SLASH: `(?!${DOTS_SLASH})`,
55
+ QMARK_NO_DOT: `[^.${SLASH_LITERAL}]`,
56
+ STAR: `${QMARK}*?`,
57
+ START_ANCHOR,
58
+ SEP: "/"
59
+ };
60
+ /**
61
+ * Windows glob regex
62
+ */
63
+ const WINDOWS_CHARS = {
64
+ ...POSIX_CHARS,
65
+ SLASH_LITERAL: `[${WIN_SLASH}]`,
66
+ QMARK: WIN_NO_SLASH,
67
+ STAR: `${WIN_NO_SLASH}*?`,
68
+ DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
69
+ NO_DOT: `(?!${DOT_LITERAL})`,
70
+ NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
71
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
72
+ NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
73
+ QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
74
+ START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
75
+ END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
76
+ SEP: "\\"
77
+ };
78
+ module.exports = {
79
+ DEFAULT_MAX_EXTGLOB_RECURSION,
80
+ MAX_LENGTH: 1024 * 64,
81
+ POSIX_REGEX_SOURCE: {
82
+ __proto__: null,
83
+ alnum: "a-zA-Z0-9",
84
+ alpha: "a-zA-Z",
85
+ ascii: "\\x00-\\x7F",
86
+ blank: " \\t",
87
+ cntrl: "\\x00-\\x1F\\x7F",
88
+ digit: "0-9",
89
+ graph: "\\x21-\\x7E",
90
+ lower: "a-z",
91
+ print: "\\x20-\\x7E ",
92
+ punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
93
+ space: " \\t\\r\\n\\v\\f",
94
+ upper: "A-Z",
95
+ word: "A-Za-z0-9_",
96
+ xdigit: "A-Fa-f0-9"
97
+ },
98
+ REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
99
+ REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
100
+ REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
101
+ REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
102
+ REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
103
+ REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
104
+ REPLACEMENTS: {
105
+ __proto__: null,
106
+ "***": "*",
107
+ "**/**": "**",
108
+ "**/**/**": "**"
109
+ },
110
+ CHAR_0: 48,
111
+ CHAR_9: 57,
112
+ CHAR_UPPERCASE_A: 65,
113
+ CHAR_LOWERCASE_A: 97,
114
+ CHAR_UPPERCASE_Z: 90,
115
+ CHAR_LOWERCASE_Z: 122,
116
+ CHAR_LEFT_PARENTHESES: 40,
117
+ CHAR_RIGHT_PARENTHESES: 41,
118
+ CHAR_ASTERISK: 42,
119
+ CHAR_AMPERSAND: 38,
120
+ CHAR_AT: 64,
121
+ CHAR_BACKWARD_SLASH: 92,
122
+ CHAR_CARRIAGE_RETURN: 13,
123
+ CHAR_CIRCUMFLEX_ACCENT: 94,
124
+ CHAR_COLON: 58,
125
+ CHAR_COMMA: 44,
126
+ CHAR_DOT: 46,
127
+ CHAR_DOUBLE_QUOTE: 34,
128
+ CHAR_EQUAL: 61,
129
+ CHAR_EXCLAMATION_MARK: 33,
130
+ CHAR_FORM_FEED: 12,
131
+ CHAR_FORWARD_SLASH: 47,
132
+ CHAR_GRAVE_ACCENT: 96,
133
+ CHAR_HASH: 35,
134
+ CHAR_HYPHEN_MINUS: 45,
135
+ CHAR_LEFT_ANGLE_BRACKET: 60,
136
+ CHAR_LEFT_CURLY_BRACE: 123,
137
+ CHAR_LEFT_SQUARE_BRACKET: 91,
138
+ CHAR_LINE_FEED: 10,
139
+ CHAR_NO_BREAK_SPACE: 160,
140
+ CHAR_PERCENT: 37,
141
+ CHAR_PLUS: 43,
142
+ CHAR_QUESTION_MARK: 63,
143
+ CHAR_RIGHT_ANGLE_BRACKET: 62,
144
+ CHAR_RIGHT_CURLY_BRACE: 125,
145
+ CHAR_RIGHT_SQUARE_BRACKET: 93,
146
+ CHAR_SEMICOLON: 59,
147
+ CHAR_SINGLE_QUOTE: 39,
148
+ CHAR_SPACE: 32,
149
+ CHAR_TAB: 9,
150
+ CHAR_UNDERSCORE: 95,
151
+ CHAR_VERTICAL_LINE: 124,
152
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
153
+ /**
154
+ * Create EXTGLOB_CHARS
155
+ */
156
+ extglobChars(chars) {
157
+ return {
158
+ "!": {
159
+ type: "negate",
160
+ open: "(?:(?!(?:",
161
+ close: `))${chars.STAR})`
162
+ },
163
+ "?": {
164
+ type: "qmark",
165
+ open: "(?:",
166
+ close: ")?"
167
+ },
168
+ "+": {
169
+ type: "plus",
170
+ open: "(?:",
171
+ close: ")+"
172
+ },
173
+ "*": {
174
+ type: "star",
175
+ open: "(?:",
176
+ close: ")*"
177
+ },
178
+ "@": {
179
+ type: "at",
180
+ open: "(?:",
181
+ close: ")"
182
+ }
183
+ };
184
+ },
185
+ /**
186
+ * Create GLOB_CHARS
187
+ */
188
+ globChars(win32) {
189
+ return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
190
+ }
191
+ };
192
+ }));
193
+ //#endregion
194
+ //#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/utils.js
195
+ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
196
+ const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
197
+ exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
198
+ exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
199
+ exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
200
+ exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
201
+ exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
202
+ exports.isWindows = () => {
203
+ if (typeof navigator !== "undefined" && navigator.platform) {
204
+ const platform = navigator.platform.toLowerCase();
205
+ return platform === "win32" || platform === "windows";
206
+ }
207
+ if (typeof process !== "undefined" && process.platform) return process.platform === "win32";
208
+ return false;
209
+ };
210
+ exports.removeBackslashes = (str) => {
211
+ return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
212
+ return match === "\\" ? "" : match;
213
+ });
214
+ };
215
+ exports.escapeLast = (input, char, lastIdx) => {
216
+ const idx = input.lastIndexOf(char, lastIdx);
217
+ if (idx === -1) return input;
218
+ if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
219
+ return `${input.slice(0, idx)}\\${input.slice(idx)}`;
220
+ };
221
+ exports.removePrefix = (input, state = {}) => {
222
+ let output = input;
223
+ if (output.startsWith("./")) {
224
+ output = output.slice(2);
225
+ state.prefix = "./";
226
+ }
227
+ return output;
228
+ };
229
+ exports.wrapOutput = (input, state = {}, options = {}) => {
230
+ let output = `${options.contains ? "" : "^"}(?:${input})${options.contains ? "" : "$"}`;
231
+ if (state.negated === true) output = `(?:^(?!${output}).*$)`;
232
+ return output;
233
+ };
234
+ exports.basename = (path, { windows } = {}) => {
235
+ const segs = path.split(windows ? /[\\/]/ : "/");
236
+ const last = segs[segs.length - 1];
237
+ if (last === "") return segs[segs.length - 2];
238
+ return last;
239
+ };
240
+ }));
241
+ //#endregion
242
+ //#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/scan.js
243
+ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
244
+ const utils = require_utils();
245
+ const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants();
246
+ const isPathSeparator = (code) => {
247
+ return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
248
+ };
249
+ const depth = (token) => {
250
+ if (token.isPrefix !== true) token.depth = token.isGlobstar ? Infinity : 1;
251
+ };
252
+ /**
253
+ * Quickly scans a glob pattern and returns an object with a handful of
254
+ * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
255
+ * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
256
+ * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
257
+ *
258
+ * ```js
259
+ * const pm = require('picomatch');
260
+ * console.log(pm.scan('foo/bar/*.js'));
261
+ * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
262
+ * ```
263
+ * @param {String} `str`
264
+ * @param {Object} `options`
265
+ * @return {Object} Returns an object with tokens and regex source string.
266
+ * @api public
267
+ */
268
+ const scan = (input, options) => {
269
+ const opts = options || {};
270
+ const length = input.length - 1;
271
+ const scanToEnd = opts.parts === true || opts.scanToEnd === true;
272
+ const slashes = [];
273
+ const tokens = [];
274
+ const parts = [];
275
+ let str = input;
276
+ let index = -1;
277
+ let start = 0;
278
+ let lastIndex = 0;
279
+ let isBrace = false;
280
+ let isBracket = false;
281
+ let isGlob = false;
282
+ let isExtglob = false;
283
+ let isGlobstar = false;
284
+ let braceEscaped = false;
285
+ let backslashes = false;
286
+ let negated = false;
287
+ let negatedExtglob = false;
288
+ let finished = false;
289
+ let braces = 0;
290
+ let prev;
291
+ let code;
292
+ let token = {
293
+ value: "",
294
+ depth: 0,
295
+ isGlob: false
296
+ };
297
+ const eos = () => index >= length;
298
+ const peek = () => str.charCodeAt(index + 1);
299
+ const advance = () => {
300
+ prev = code;
301
+ return str.charCodeAt(++index);
302
+ };
303
+ while (index < length) {
304
+ code = advance();
305
+ let next;
306
+ if (code === CHAR_BACKWARD_SLASH) {
307
+ backslashes = token.backslashes = true;
308
+ code = advance();
309
+ if (code === CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
310
+ continue;
311
+ }
312
+ if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
313
+ braces++;
314
+ while (eos() !== true && (code = advance())) {
315
+ if (code === CHAR_BACKWARD_SLASH) {
316
+ backslashes = token.backslashes = true;
317
+ advance();
318
+ continue;
319
+ }
320
+ if (code === CHAR_LEFT_CURLY_BRACE) {
321
+ braces++;
322
+ continue;
323
+ }
324
+ if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
325
+ isBrace = token.isBrace = true;
326
+ isGlob = token.isGlob = true;
327
+ finished = true;
328
+ if (scanToEnd === true) continue;
329
+ break;
330
+ }
331
+ if (braceEscaped !== true && code === CHAR_COMMA) {
332
+ isBrace = token.isBrace = true;
333
+ isGlob = token.isGlob = true;
334
+ finished = true;
335
+ if (scanToEnd === true) continue;
336
+ break;
337
+ }
338
+ if (code === CHAR_RIGHT_CURLY_BRACE) {
339
+ braces--;
340
+ if (braces === 0) {
341
+ braceEscaped = false;
342
+ isBrace = token.isBrace = true;
343
+ finished = true;
344
+ break;
345
+ }
346
+ }
347
+ }
348
+ if (scanToEnd === true) continue;
349
+ break;
350
+ }
351
+ if (code === CHAR_FORWARD_SLASH) {
352
+ slashes.push(index);
353
+ tokens.push(token);
354
+ token = {
355
+ value: "",
356
+ depth: 0,
357
+ isGlob: false
358
+ };
359
+ if (finished === true) continue;
360
+ if (prev === CHAR_DOT && index === start + 1) {
361
+ start += 2;
362
+ continue;
363
+ }
364
+ lastIndex = index + 1;
365
+ continue;
366
+ }
367
+ if (opts.noext !== true) {
368
+ if ((code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === true && peek() === CHAR_LEFT_PARENTHESES) {
369
+ isGlob = token.isGlob = true;
370
+ isExtglob = token.isExtglob = true;
371
+ finished = true;
372
+ if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
373
+ if (scanToEnd === true) {
374
+ while (eos() !== true && (code = advance())) {
375
+ if (code === CHAR_BACKWARD_SLASH) {
376
+ backslashes = token.backslashes = true;
377
+ code = advance();
378
+ continue;
379
+ }
380
+ if (code === CHAR_RIGHT_PARENTHESES) {
381
+ isGlob = token.isGlob = true;
382
+ finished = true;
383
+ break;
384
+ }
385
+ }
386
+ continue;
387
+ }
388
+ break;
389
+ }
390
+ }
391
+ if (code === CHAR_ASTERISK) {
392
+ if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
393
+ isGlob = token.isGlob = true;
394
+ finished = true;
395
+ if (scanToEnd === true) continue;
396
+ break;
397
+ }
398
+ if (code === CHAR_QUESTION_MARK) {
399
+ isGlob = token.isGlob = true;
400
+ finished = true;
401
+ if (scanToEnd === true) continue;
402
+ break;
403
+ }
404
+ if (code === CHAR_LEFT_SQUARE_BRACKET) {
405
+ while (eos() !== true && (next = advance())) {
406
+ if (next === CHAR_BACKWARD_SLASH) {
407
+ backslashes = token.backslashes = true;
408
+ advance();
409
+ continue;
410
+ }
411
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
412
+ isBracket = token.isBracket = true;
413
+ isGlob = token.isGlob = true;
414
+ finished = true;
415
+ break;
416
+ }
417
+ }
418
+ if (scanToEnd === true) continue;
419
+ break;
420
+ }
421
+ if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
422
+ negated = token.negated = true;
423
+ start++;
424
+ continue;
425
+ }
426
+ if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
427
+ isGlob = token.isGlob = true;
428
+ if (scanToEnd === true) {
429
+ while (eos() !== true && (code = advance())) {
430
+ if (code === CHAR_LEFT_PARENTHESES) {
431
+ backslashes = token.backslashes = true;
432
+ code = advance();
433
+ continue;
434
+ }
435
+ if (code === CHAR_RIGHT_PARENTHESES) {
436
+ finished = true;
437
+ break;
438
+ }
439
+ }
440
+ continue;
441
+ }
442
+ break;
443
+ }
444
+ if (isGlob === true) {
445
+ finished = true;
446
+ if (scanToEnd === true) continue;
447
+ break;
448
+ }
449
+ }
450
+ if (opts.noext === true) {
451
+ isExtglob = false;
452
+ isGlob = false;
453
+ }
454
+ let base = str;
455
+ let prefix = "";
456
+ let glob = "";
457
+ if (start > 0) {
458
+ prefix = str.slice(0, start);
459
+ str = str.slice(start);
460
+ lastIndex -= start;
461
+ }
462
+ if (base && isGlob === true && lastIndex > 0) {
463
+ base = str.slice(0, lastIndex);
464
+ glob = str.slice(lastIndex);
465
+ } else if (isGlob === true) {
466
+ base = "";
467
+ glob = str;
468
+ } else base = str;
469
+ if (base && base !== "" && base !== "/" && base !== str) {
470
+ if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
471
+ }
472
+ if (opts.unescape === true) {
473
+ if (glob) glob = utils.removeBackslashes(glob);
474
+ if (base && backslashes === true) base = utils.removeBackslashes(base);
475
+ }
476
+ const state = {
477
+ prefix,
478
+ input,
479
+ start,
480
+ base,
481
+ glob,
482
+ isBrace,
483
+ isBracket,
484
+ isGlob,
485
+ isExtglob,
486
+ isGlobstar,
487
+ negated,
488
+ negatedExtglob
489
+ };
490
+ if (opts.tokens === true) {
491
+ state.maxDepth = 0;
492
+ if (!isPathSeparator(code)) tokens.push(token);
493
+ state.tokens = tokens;
494
+ }
495
+ if (opts.parts === true || opts.tokens === true) {
496
+ let prevIndex;
497
+ for (let idx = 0; idx < slashes.length; idx++) {
498
+ const n = prevIndex ? prevIndex + 1 : start;
499
+ const i = slashes[idx];
500
+ const value = input.slice(n, i);
501
+ if (opts.tokens) {
502
+ if (idx === 0 && start !== 0) {
503
+ tokens[idx].isPrefix = true;
504
+ tokens[idx].value = prefix;
505
+ } else tokens[idx].value = value;
506
+ depth(tokens[idx]);
507
+ state.maxDepth += tokens[idx].depth;
508
+ }
509
+ if (idx !== 0 || value !== "") parts.push(value);
510
+ prevIndex = i;
511
+ }
512
+ if (prevIndex && prevIndex + 1 < input.length) {
513
+ const value = input.slice(prevIndex + 1);
514
+ parts.push(value);
515
+ if (opts.tokens) {
516
+ tokens[tokens.length - 1].value = value;
517
+ depth(tokens[tokens.length - 1]);
518
+ state.maxDepth += tokens[tokens.length - 1].depth;
519
+ }
520
+ }
521
+ state.slashes = slashes;
522
+ state.parts = parts;
523
+ }
524
+ return state;
525
+ };
526
+ module.exports = scan;
527
+ }));
528
+ //#endregion
529
+ //#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/parse.js
530
+ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
531
+ const constants = require_constants();
532
+ const utils = require_utils();
533
+ /**
534
+ * Constants
535
+ */
536
+ const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants;
537
+ /**
538
+ * Helpers
539
+ */
540
+ const expandRange = (args, options) => {
541
+ if (typeof options.expandRange === "function") return options.expandRange(...args, options);
542
+ args.sort();
543
+ const value = `[${args.join("-")}]`;
544
+ try {
545
+ new RegExp(value);
546
+ } catch (ex) {
547
+ return args.map((v) => utils.escapeRegex(v)).join("..");
548
+ }
549
+ return value;
550
+ };
551
+ /**
552
+ * Create the message for a syntax error
553
+ */
554
+ const syntaxError = (type, char) => {
555
+ return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
556
+ };
557
+ const splitTopLevel = (input) => {
558
+ const parts = [];
559
+ let bracket = 0;
560
+ let paren = 0;
561
+ let quote = 0;
562
+ let value = "";
563
+ let escaped = false;
564
+ for (const ch of input) {
565
+ if (escaped === true) {
566
+ value += ch;
567
+ escaped = false;
568
+ continue;
569
+ }
570
+ if (ch === "\\") {
571
+ value += ch;
572
+ escaped = true;
573
+ continue;
574
+ }
575
+ if (ch === "\"") {
576
+ quote = quote === 1 ? 0 : 1;
577
+ value += ch;
578
+ continue;
579
+ }
580
+ if (quote === 0) {
581
+ if (ch === "[") bracket++;
582
+ else if (ch === "]" && bracket > 0) bracket--;
583
+ else if (bracket === 0) {
584
+ if (ch === "(") paren++;
585
+ else if (ch === ")" && paren > 0) paren--;
586
+ else if (ch === "|" && paren === 0) {
587
+ parts.push(value);
588
+ value = "";
589
+ continue;
590
+ }
591
+ }
592
+ }
593
+ value += ch;
594
+ }
595
+ parts.push(value);
596
+ return parts;
597
+ };
598
+ const isPlainBranch = (branch) => {
599
+ let escaped = false;
600
+ for (const ch of branch) {
601
+ if (escaped === true) {
602
+ escaped = false;
603
+ continue;
604
+ }
605
+ if (ch === "\\") {
606
+ escaped = true;
607
+ continue;
608
+ }
609
+ if (/[?*+@!()[\]{}]/.test(ch)) return false;
610
+ }
611
+ return true;
612
+ };
613
+ const normalizeSimpleBranch = (branch) => {
614
+ let value = branch.trim();
615
+ let changed = true;
616
+ while (changed === true) {
617
+ changed = false;
618
+ if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
619
+ value = value.slice(2, -1);
620
+ changed = true;
621
+ }
622
+ }
623
+ if (!isPlainBranch(value)) return;
624
+ return value.replace(/\\(.)/g, "$1");
625
+ };
626
+ const hasRepeatedCharPrefixOverlap = (branches) => {
627
+ const values = branches.map(normalizeSimpleBranch).filter(Boolean);
628
+ for (let i = 0; i < values.length; i++) for (let j = i + 1; j < values.length; j++) {
629
+ const a = values[i];
630
+ const b = values[j];
631
+ const char = a[0];
632
+ if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) continue;
633
+ if (a === b || a.startsWith(b) || b.startsWith(a)) return true;
634
+ }
635
+ return false;
636
+ };
637
+ const parseRepeatedExtglob = (pattern, requireEnd = true) => {
638
+ if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") return;
639
+ let bracket = 0;
640
+ let paren = 0;
641
+ let quote = 0;
642
+ let escaped = false;
643
+ for (let i = 1; i < pattern.length; i++) {
644
+ const ch = pattern[i];
645
+ if (escaped === true) {
646
+ escaped = false;
647
+ continue;
648
+ }
649
+ if (ch === "\\") {
650
+ escaped = true;
651
+ continue;
652
+ }
653
+ if (ch === "\"") {
654
+ quote = quote === 1 ? 0 : 1;
655
+ continue;
656
+ }
657
+ if (quote === 1) continue;
658
+ if (ch === "[") {
659
+ bracket++;
660
+ continue;
661
+ }
662
+ if (ch === "]" && bracket > 0) {
663
+ bracket--;
664
+ continue;
665
+ }
666
+ if (bracket > 0) continue;
667
+ if (ch === "(") {
668
+ paren++;
669
+ continue;
670
+ }
671
+ if (ch === ")") {
672
+ paren--;
673
+ if (paren === 0) {
674
+ if (requireEnd === true && i !== pattern.length - 1) return;
675
+ return {
676
+ type: pattern[0],
677
+ body: pattern.slice(2, i),
678
+ end: i
679
+ };
680
+ }
681
+ }
682
+ }
683
+ };
684
+ const buildCharClassStar = (chars) => {
685
+ return `${chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`}*`;
686
+ };
687
+ const getStarExtglobSequenceChars = (pattern) => {
688
+ let index = 0;
689
+ const chars = [];
690
+ while (index < pattern.length) {
691
+ const match = parseRepeatedExtglob(pattern.slice(index), false);
692
+ if (!match || match.type !== "*") return;
693
+ const branches = splitTopLevel(match.body).map((branch) => branch.trim());
694
+ if (branches.length !== 1) return;
695
+ const branch = normalizeSimpleBranch(branches[0]);
696
+ if (!branch || branch.length !== 1) return;
697
+ chars.push(branch);
698
+ index += match.end + 1;
699
+ }
700
+ if (chars.length < 1) return;
701
+ return chars;
702
+ };
703
+ const repeatedExtglobRecursion = (pattern) => {
704
+ let depth = 0;
705
+ let value = pattern.trim();
706
+ let match = parseRepeatedExtglob(value);
707
+ while (match) {
708
+ depth++;
709
+ value = match.body.trim();
710
+ match = parseRepeatedExtglob(value);
711
+ }
712
+ return depth;
713
+ };
714
+ const analyzeRepeatedExtglob = (body, options) => {
715
+ if (options.maxExtglobRecursion === false) return { risky: false };
716
+ const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
717
+ const branches = splitTopLevel(body).map((branch) => branch.trim());
718
+ if (branches.length > 1) {
719
+ if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) return { risky: true };
720
+ }
721
+ const safeChars = [];
722
+ let sawStarSequence = false;
723
+ let combinable = true;
724
+ for (const branch of branches) {
725
+ const chars = getStarExtglobSequenceChars(branch);
726
+ if (chars) {
727
+ sawStarSequence = true;
728
+ safeChars.push(...chars);
729
+ continue;
730
+ }
731
+ const literal = normalizeSimpleBranch(branch);
732
+ if (literal && literal.length === 1) {
733
+ safeChars.push(literal);
734
+ continue;
735
+ }
736
+ combinable = false;
737
+ if (repeatedExtglobRecursion(branch) > max) return { risky: true };
738
+ }
739
+ if (sawStarSequence) return combinable ? {
740
+ risky: true,
741
+ safeOutput: buildCharClassStar([...new Set(safeChars)])
742
+ } : { risky: true };
743
+ return { risky: false };
744
+ };
745
+ /**
746
+ * Parse the given input string.
747
+ * @param {String} input
748
+ * @param {Object} options
749
+ * @return {Object}
750
+ */
751
+ const parse = (input, options) => {
752
+ if (typeof input !== "string") throw new TypeError("Expected a string");
753
+ input = REPLACEMENTS[input] || input;
754
+ const opts = { ...options };
755
+ const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
756
+ let len = input.length;
757
+ if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
758
+ const bos = {
759
+ type: "bos",
760
+ value: "",
761
+ output: opts.prepend || ""
762
+ };
763
+ const tokens = [bos];
764
+ const capture = opts.capture ? "" : "?:";
765
+ const PLATFORM_CHARS = constants.globChars(opts.windows);
766
+ const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
767
+ 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;
768
+ const globstar = (opts) => {
769
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
770
+ };
771
+ const nodot = opts.dot ? "" : NO_DOT;
772
+ const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
773
+ let star = opts.bash === true ? globstar(opts) : STAR;
774
+ if (opts.capture) star = `(${star})`;
775
+ if (typeof opts.noext === "boolean") opts.noextglob = opts.noext;
776
+ const state = {
777
+ input,
778
+ index: -1,
779
+ start: 0,
780
+ dot: opts.dot === true,
781
+ consumed: "",
782
+ output: "",
783
+ prefix: "",
784
+ backtrack: false,
785
+ negated: false,
786
+ brackets: 0,
787
+ braces: 0,
788
+ parens: 0,
789
+ quotes: 0,
790
+ globstar: false,
791
+ tokens
792
+ };
793
+ input = utils.removePrefix(input, state);
794
+ len = input.length;
795
+ const extglobs = [];
796
+ const braces = [];
797
+ const stack = [];
798
+ let prev = bos;
799
+ let value;
800
+ /**
801
+ * Tokenizing helpers
802
+ */
803
+ const eos = () => state.index === len - 1;
804
+ const peek = state.peek = (n = 1) => input[state.index + n];
805
+ const advance = state.advance = () => input[++state.index] || "";
806
+ const remaining = () => input.slice(state.index + 1);
807
+ const consume = (value = "", num = 0) => {
808
+ state.consumed += value;
809
+ state.index += num;
810
+ };
811
+ const append = (token) => {
812
+ state.output += token.output != null ? token.output : token.value;
813
+ consume(token.value);
814
+ };
815
+ const negate = () => {
816
+ let count = 1;
817
+ while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
818
+ advance();
819
+ state.start++;
820
+ count++;
821
+ }
822
+ if (count % 2 === 0) return false;
823
+ state.negated = true;
824
+ state.start++;
825
+ return true;
826
+ };
827
+ const increment = (type) => {
828
+ state[type]++;
829
+ stack.push(type);
830
+ };
831
+ const decrement = (type) => {
832
+ state[type]--;
833
+ stack.pop();
834
+ };
835
+ /**
836
+ * Push tokens onto the tokens array. This helper speeds up
837
+ * tokenizing by 1) helping us avoid backtracking as much as possible,
838
+ * and 2) helping us avoid creating extra tokens when consecutive
839
+ * characters are plain text. This improves performance and simplifies
840
+ * lookbehinds.
841
+ */
842
+ const push = (tok) => {
843
+ if (prev.type === "globstar") {
844
+ const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
845
+ const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
846
+ if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
847
+ state.output = state.output.slice(0, -prev.output.length);
848
+ prev.type = "star";
849
+ prev.value = "*";
850
+ prev.output = star;
851
+ state.output += prev.output;
852
+ }
853
+ }
854
+ if (extglobs.length && tok.type !== "paren") extglobs[extglobs.length - 1].inner += tok.value;
855
+ if (tok.value || tok.output) append(tok);
856
+ if (prev && prev.type === "text" && tok.type === "text") {
857
+ prev.output = (prev.output || prev.value) + tok.value;
858
+ prev.value += tok.value;
859
+ return;
860
+ }
861
+ tok.prev = prev;
862
+ tokens.push(tok);
863
+ prev = tok;
864
+ };
865
+ const extglobOpen = (type, value) => {
866
+ const token = {
867
+ ...EXTGLOB_CHARS[value],
868
+ conditions: 1,
869
+ inner: ""
870
+ };
871
+ token.prev = prev;
872
+ token.parens = state.parens;
873
+ token.output = state.output;
874
+ token.startIndex = state.index;
875
+ token.tokensIndex = tokens.length;
876
+ const output = (opts.capture ? "(" : "") + token.open;
877
+ increment("parens");
878
+ push({
879
+ type,
880
+ value,
881
+ output: state.output ? "" : ONE_CHAR
882
+ });
883
+ push({
884
+ type: "paren",
885
+ extglob: true,
886
+ value: advance(),
887
+ output
888
+ });
889
+ extglobs.push(token);
890
+ };
891
+ const extglobClose = (token) => {
892
+ const literal = input.slice(token.startIndex, state.index + 1);
893
+ const analysis = analyzeRepeatedExtglob(input.slice(token.startIndex + 2, state.index), opts);
894
+ if ((token.type === "plus" || token.type === "star") && analysis.risky) {
895
+ const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
896
+ const open = tokens[token.tokensIndex];
897
+ open.type = "text";
898
+ open.value = literal;
899
+ open.output = safeOutput || utils.escapeRegex(literal);
900
+ for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
901
+ tokens[i].value = "";
902
+ tokens[i].output = "";
903
+ delete tokens[i].suffix;
904
+ }
905
+ state.output = token.output + open.output;
906
+ state.backtrack = true;
907
+ push({
908
+ type: "paren",
909
+ extglob: true,
910
+ value,
911
+ output: ""
912
+ });
913
+ decrement("parens");
914
+ return;
915
+ }
916
+ let output = token.close + (opts.capture ? ")" : "");
917
+ let rest;
918
+ if (token.type === "negate") {
919
+ let extglobStar = star;
920
+ if (token.inner && token.inner.length > 1 && token.inner.includes("/")) extglobStar = globstar(opts);
921
+ if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) output = token.close = `)$))${extglobStar}`;
922
+ if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) output = token.close = `)${parse(rest, {
923
+ ...options,
924
+ fastpaths: false
925
+ }).output})${extglobStar})`;
926
+ if (token.prev.type === "bos") state.negatedExtglob = true;
927
+ }
928
+ push({
929
+ type: "paren",
930
+ extglob: true,
931
+ value,
932
+ output
933
+ });
934
+ decrement("parens");
935
+ };
936
+ /**
937
+ * Fast paths
938
+ */
939
+ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
940
+ let backslashes = false;
941
+ let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
942
+ if (first === "\\") {
943
+ backslashes = true;
944
+ return m;
945
+ }
946
+ if (first === "?") {
947
+ if (esc) return esc + first + (rest ? QMARK.repeat(rest.length) : "");
948
+ if (index === 0) return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
949
+ return QMARK.repeat(chars.length);
950
+ }
951
+ if (first === ".") return DOT_LITERAL.repeat(chars.length);
952
+ if (first === "*") {
953
+ if (esc) return esc + first + (rest ? star : "");
954
+ return star;
955
+ }
956
+ return esc ? m : `\\${m}`;
957
+ });
958
+ if (backslashes === true) if (opts.unescape === true) output = output.replace(/\\/g, "");
959
+ else output = output.replace(/\\+/g, (m) => {
960
+ return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
961
+ });
962
+ if (output === input && opts.contains === true) {
963
+ state.output = input;
964
+ return state;
965
+ }
966
+ state.output = utils.wrapOutput(output, state, options);
967
+ return state;
968
+ }
969
+ /**
970
+ * Tokenize input until we reach end-of-string
971
+ */
972
+ while (!eos()) {
973
+ value = advance();
974
+ if (value === "\0") continue;
975
+ /**
976
+ * Escaped characters
977
+ */
978
+ if (value === "\\") {
979
+ const next = peek();
980
+ if (next === "/" && opts.bash !== true) continue;
981
+ if (next === "." || next === ";") continue;
982
+ if (!next) {
983
+ value += "\\";
984
+ push({
985
+ type: "text",
986
+ value
987
+ });
988
+ continue;
989
+ }
990
+ const match = /^\\+/.exec(remaining());
991
+ let slashes = 0;
992
+ if (match && match[0].length > 2) {
993
+ slashes = match[0].length;
994
+ state.index += slashes;
995
+ if (slashes % 2 !== 0) value += "\\";
996
+ }
997
+ if (opts.unescape === true) value = advance();
998
+ else value += advance();
999
+ if (state.brackets === 0) {
1000
+ push({
1001
+ type: "text",
1002
+ value
1003
+ });
1004
+ continue;
1005
+ }
1006
+ }
1007
+ /**
1008
+ * If we're inside a regex character class, continue
1009
+ * until we reach the closing bracket.
1010
+ */
1011
+ if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
1012
+ if (opts.posix !== false && value === ":") {
1013
+ const inner = prev.value.slice(1);
1014
+ if (inner.includes("[")) {
1015
+ prev.posix = true;
1016
+ if (inner.includes(":")) {
1017
+ const idx = prev.value.lastIndexOf("[");
1018
+ const pre = prev.value.slice(0, idx);
1019
+ const posix = POSIX_REGEX_SOURCE[prev.value.slice(idx + 2)];
1020
+ if (posix) {
1021
+ prev.value = pre + posix;
1022
+ state.backtrack = true;
1023
+ advance();
1024
+ if (!bos.output && tokens.indexOf(prev) === 1) bos.output = ONE_CHAR;
1025
+ continue;
1026
+ }
1027
+ }
1028
+ }
1029
+ }
1030
+ if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") value = `\\${value}`;
1031
+ if (value === "]" && (prev.value === "[" || prev.value === "[^")) value = `\\${value}`;
1032
+ if (opts.posix === true && value === "!" && prev.value === "[") value = "^";
1033
+ prev.value += value;
1034
+ append({ value });
1035
+ continue;
1036
+ }
1037
+ /**
1038
+ * If we're inside a quoted string, continue
1039
+ * until we reach the closing double quote.
1040
+ */
1041
+ if (state.quotes === 1 && value !== "\"") {
1042
+ value = utils.escapeRegex(value);
1043
+ prev.value += value;
1044
+ append({ value });
1045
+ continue;
1046
+ }
1047
+ /**
1048
+ * Double quotes
1049
+ */
1050
+ if (value === "\"") {
1051
+ state.quotes = state.quotes === 1 ? 0 : 1;
1052
+ if (opts.keepQuotes === true) push({
1053
+ type: "text",
1054
+ value
1055
+ });
1056
+ continue;
1057
+ }
1058
+ /**
1059
+ * Parentheses
1060
+ */
1061
+ if (value === "(") {
1062
+ increment("parens");
1063
+ push({
1064
+ type: "paren",
1065
+ value
1066
+ });
1067
+ continue;
1068
+ }
1069
+ if (value === ")") {
1070
+ if (state.parens === 0 && opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "("));
1071
+ const extglob = extglobs[extglobs.length - 1];
1072
+ if (extglob && state.parens === extglob.parens + 1) {
1073
+ extglobClose(extglobs.pop());
1074
+ continue;
1075
+ }
1076
+ push({
1077
+ type: "paren",
1078
+ value,
1079
+ output: state.parens ? ")" : "\\)"
1080
+ });
1081
+ decrement("parens");
1082
+ continue;
1083
+ }
1084
+ /**
1085
+ * Square brackets
1086
+ */
1087
+ if (value === "[") {
1088
+ if (opts.nobracket === true || !remaining().includes("]")) {
1089
+ if (opts.nobracket !== true && opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
1090
+ value = `\\${value}`;
1091
+ } else increment("brackets");
1092
+ push({
1093
+ type: "bracket",
1094
+ value
1095
+ });
1096
+ continue;
1097
+ }
1098
+ if (value === "]") {
1099
+ if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
1100
+ push({
1101
+ type: "text",
1102
+ value,
1103
+ output: `\\${value}`
1104
+ });
1105
+ continue;
1106
+ }
1107
+ if (state.brackets === 0) {
1108
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "["));
1109
+ push({
1110
+ type: "text",
1111
+ value,
1112
+ output: `\\${value}`
1113
+ });
1114
+ continue;
1115
+ }
1116
+ decrement("brackets");
1117
+ const prevValue = prev.value.slice(1);
1118
+ if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) value = `/${value}`;
1119
+ prev.value += value;
1120
+ append({ value });
1121
+ if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) continue;
1122
+ const escaped = utils.escapeRegex(prev.value);
1123
+ state.output = state.output.slice(0, -prev.value.length);
1124
+ if (opts.literalBrackets === true) {
1125
+ state.output += escaped;
1126
+ prev.value = escaped;
1127
+ continue;
1128
+ }
1129
+ prev.value = `(${capture}${escaped}|${prev.value})`;
1130
+ state.output += prev.value;
1131
+ continue;
1132
+ }
1133
+ /**
1134
+ * Braces
1135
+ */
1136
+ if (value === "{" && opts.nobrace !== true) {
1137
+ increment("braces");
1138
+ const open = {
1139
+ type: "brace",
1140
+ value,
1141
+ output: "(",
1142
+ outputIndex: state.output.length,
1143
+ tokensIndex: state.tokens.length
1144
+ };
1145
+ braces.push(open);
1146
+ push(open);
1147
+ continue;
1148
+ }
1149
+ if (value === "}") {
1150
+ const brace = braces[braces.length - 1];
1151
+ if (opts.nobrace === true || !brace) {
1152
+ push({
1153
+ type: "text",
1154
+ value,
1155
+ output: value
1156
+ });
1157
+ continue;
1158
+ }
1159
+ let output = ")";
1160
+ if (brace.dots === true) {
1161
+ const arr = tokens.slice();
1162
+ const range = [];
1163
+ for (let i = arr.length - 1; i >= 0; i--) {
1164
+ tokens.pop();
1165
+ if (arr[i].type === "brace") break;
1166
+ if (arr[i].type !== "dots") range.unshift(arr[i].value);
1167
+ }
1168
+ output = expandRange(range, opts);
1169
+ state.backtrack = true;
1170
+ }
1171
+ if (brace.comma !== true && brace.dots !== true) {
1172
+ const out = state.output.slice(0, brace.outputIndex);
1173
+ const toks = state.tokens.slice(brace.tokensIndex);
1174
+ brace.value = brace.output = "\\{";
1175
+ value = output = "\\}";
1176
+ state.output = out;
1177
+ for (const t of toks) state.output += t.output || t.value;
1178
+ }
1179
+ push({
1180
+ type: "brace",
1181
+ value,
1182
+ output
1183
+ });
1184
+ decrement("braces");
1185
+ braces.pop();
1186
+ continue;
1187
+ }
1188
+ /**
1189
+ * Pipes
1190
+ */
1191
+ if (value === "|") {
1192
+ if (extglobs.length > 0) extglobs[extglobs.length - 1].conditions++;
1193
+ push({
1194
+ type: "text",
1195
+ value
1196
+ });
1197
+ continue;
1198
+ }
1199
+ /**
1200
+ * Commas
1201
+ */
1202
+ if (value === ",") {
1203
+ let output = value;
1204
+ const brace = braces[braces.length - 1];
1205
+ if (brace && stack[stack.length - 1] === "braces") {
1206
+ brace.comma = true;
1207
+ output = "|";
1208
+ }
1209
+ push({
1210
+ type: "comma",
1211
+ value,
1212
+ output
1213
+ });
1214
+ continue;
1215
+ }
1216
+ /**
1217
+ * Slashes
1218
+ */
1219
+ if (value === "/") {
1220
+ if (prev.type === "dot" && state.index === state.start + 1) {
1221
+ state.start = state.index + 1;
1222
+ state.consumed = "";
1223
+ state.output = "";
1224
+ tokens.pop();
1225
+ prev = bos;
1226
+ continue;
1227
+ }
1228
+ push({
1229
+ type: "slash",
1230
+ value,
1231
+ output: SLASH_LITERAL
1232
+ });
1233
+ continue;
1234
+ }
1235
+ /**
1236
+ * Dots
1237
+ */
1238
+ if (value === ".") {
1239
+ if (state.braces > 0 && prev.type === "dot") {
1240
+ if (prev.value === ".") prev.output = DOT_LITERAL;
1241
+ const brace = braces[braces.length - 1];
1242
+ prev.type = "dots";
1243
+ prev.output += value;
1244
+ prev.value += value;
1245
+ brace.dots = true;
1246
+ continue;
1247
+ }
1248
+ if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
1249
+ push({
1250
+ type: "text",
1251
+ value,
1252
+ output: DOT_LITERAL
1253
+ });
1254
+ continue;
1255
+ }
1256
+ push({
1257
+ type: "dot",
1258
+ value,
1259
+ output: DOT_LITERAL
1260
+ });
1261
+ continue;
1262
+ }
1263
+ /**
1264
+ * Question marks
1265
+ */
1266
+ if (value === "?") {
1267
+ if (!(prev && prev.value === "(") && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
1268
+ extglobOpen("qmark", value);
1269
+ continue;
1270
+ }
1271
+ if (prev && prev.type === "paren") {
1272
+ const next = peek();
1273
+ let output = value;
1274
+ if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) output = `\\${value}`;
1275
+ push({
1276
+ type: "text",
1277
+ value,
1278
+ output
1279
+ });
1280
+ continue;
1281
+ }
1282
+ if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
1283
+ push({
1284
+ type: "qmark",
1285
+ value,
1286
+ output: QMARK_NO_DOT
1287
+ });
1288
+ continue;
1289
+ }
1290
+ push({
1291
+ type: "qmark",
1292
+ value,
1293
+ output: QMARK
1294
+ });
1295
+ continue;
1296
+ }
1297
+ /**
1298
+ * Exclamation
1299
+ */
1300
+ if (value === "!") {
1301
+ if (opts.noextglob !== true && peek() === "(") {
1302
+ if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
1303
+ extglobOpen("negate", value);
1304
+ continue;
1305
+ }
1306
+ }
1307
+ if (opts.nonegate !== true && state.index === 0) {
1308
+ negate();
1309
+ continue;
1310
+ }
1311
+ }
1312
+ /**
1313
+ * Plus
1314
+ */
1315
+ if (value === "+") {
1316
+ if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
1317
+ extglobOpen("plus", value);
1318
+ continue;
1319
+ }
1320
+ if (prev && prev.value === "(" || opts.regex === false) {
1321
+ push({
1322
+ type: "plus",
1323
+ value,
1324
+ output: PLUS_LITERAL
1325
+ });
1326
+ continue;
1327
+ }
1328
+ if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
1329
+ push({
1330
+ type: "plus",
1331
+ value
1332
+ });
1333
+ continue;
1334
+ }
1335
+ push({
1336
+ type: "plus",
1337
+ value: PLUS_LITERAL
1338
+ });
1339
+ continue;
1340
+ }
1341
+ /**
1342
+ * Plain text
1343
+ */
1344
+ if (value === "@") {
1345
+ if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
1346
+ push({
1347
+ type: "at",
1348
+ extglob: true,
1349
+ value,
1350
+ output: ""
1351
+ });
1352
+ continue;
1353
+ }
1354
+ push({
1355
+ type: "text",
1356
+ value
1357
+ });
1358
+ continue;
1359
+ }
1360
+ /**
1361
+ * Plain text
1362
+ */
1363
+ if (value !== "*") {
1364
+ if (value === "$" || value === "^") value = `\\${value}`;
1365
+ const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
1366
+ if (match) {
1367
+ value += match[0];
1368
+ state.index += match[0].length;
1369
+ }
1370
+ push({
1371
+ type: "text",
1372
+ value
1373
+ });
1374
+ continue;
1375
+ }
1376
+ /**
1377
+ * Stars
1378
+ */
1379
+ if (prev && (prev.type === "globstar" || prev.star === true)) {
1380
+ prev.type = "star";
1381
+ prev.star = true;
1382
+ prev.value += value;
1383
+ prev.output = star;
1384
+ state.backtrack = true;
1385
+ state.globstar = true;
1386
+ consume(value);
1387
+ continue;
1388
+ }
1389
+ let rest = remaining();
1390
+ if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
1391
+ extglobOpen("star", value);
1392
+ continue;
1393
+ }
1394
+ if (prev.type === "star") {
1395
+ if (opts.noglobstar === true) {
1396
+ consume(value);
1397
+ continue;
1398
+ }
1399
+ const prior = prev.prev;
1400
+ const before = prior.prev;
1401
+ const isStart = prior.type === "slash" || prior.type === "bos";
1402
+ const afterStar = before && (before.type === "star" || before.type === "globstar");
1403
+ if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
1404
+ push({
1405
+ type: "star",
1406
+ value,
1407
+ output: ""
1408
+ });
1409
+ continue;
1410
+ }
1411
+ const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
1412
+ const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
1413
+ if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
1414
+ push({
1415
+ type: "star",
1416
+ value,
1417
+ output: ""
1418
+ });
1419
+ continue;
1420
+ }
1421
+ while (rest.slice(0, 3) === "/**") {
1422
+ const after = input[state.index + 4];
1423
+ if (after && after !== "/") break;
1424
+ rest = rest.slice(3);
1425
+ consume("/**", 3);
1426
+ }
1427
+ if (prior.type === "bos" && eos()) {
1428
+ prev.type = "globstar";
1429
+ prev.value += value;
1430
+ prev.output = globstar(opts);
1431
+ state.output = prev.output;
1432
+ state.globstar = true;
1433
+ consume(value);
1434
+ continue;
1435
+ }
1436
+ if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
1437
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
1438
+ prior.output = `(?:${prior.output}`;
1439
+ prev.type = "globstar";
1440
+ prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
1441
+ prev.value += value;
1442
+ state.globstar = true;
1443
+ state.output += prior.output + prev.output;
1444
+ consume(value);
1445
+ continue;
1446
+ }
1447
+ if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
1448
+ const end = rest[1] !== void 0 ? "|$" : "";
1449
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
1450
+ prior.output = `(?:${prior.output}`;
1451
+ prev.type = "globstar";
1452
+ prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
1453
+ prev.value += value;
1454
+ state.output += prior.output + prev.output;
1455
+ state.globstar = true;
1456
+ consume(value + advance());
1457
+ push({
1458
+ type: "slash",
1459
+ value: "/",
1460
+ output: ""
1461
+ });
1462
+ continue;
1463
+ }
1464
+ if (prior.type === "bos" && rest[0] === "/") {
1465
+ prev.type = "globstar";
1466
+ prev.value += value;
1467
+ prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
1468
+ state.output = prev.output;
1469
+ state.globstar = true;
1470
+ consume(value + advance());
1471
+ push({
1472
+ type: "slash",
1473
+ value: "/",
1474
+ output: ""
1475
+ });
1476
+ continue;
1477
+ }
1478
+ state.output = state.output.slice(0, -prev.output.length);
1479
+ prev.type = "globstar";
1480
+ prev.output = globstar(opts);
1481
+ prev.value += value;
1482
+ state.output += prev.output;
1483
+ state.globstar = true;
1484
+ consume(value);
1485
+ continue;
1486
+ }
1487
+ const token = {
1488
+ type: "star",
1489
+ value,
1490
+ output: star
1491
+ };
1492
+ if (opts.bash === true) {
1493
+ token.output = ".*?";
1494
+ if (prev.type === "bos" || prev.type === "slash") token.output = nodot + token.output;
1495
+ push(token);
1496
+ continue;
1497
+ }
1498
+ if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
1499
+ token.output = value;
1500
+ push(token);
1501
+ continue;
1502
+ }
1503
+ if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
1504
+ if (prev.type === "dot") {
1505
+ state.output += NO_DOT_SLASH;
1506
+ prev.output += NO_DOT_SLASH;
1507
+ } else if (opts.dot === true) {
1508
+ state.output += NO_DOTS_SLASH;
1509
+ prev.output += NO_DOTS_SLASH;
1510
+ } else {
1511
+ state.output += nodot;
1512
+ prev.output += nodot;
1513
+ }
1514
+ if (peek() !== "*") {
1515
+ state.output += ONE_CHAR;
1516
+ prev.output += ONE_CHAR;
1517
+ }
1518
+ }
1519
+ push(token);
1520
+ }
1521
+ while (state.brackets > 0) {
1522
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
1523
+ state.output = utils.escapeLast(state.output, "[");
1524
+ decrement("brackets");
1525
+ }
1526
+ while (state.parens > 0) {
1527
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
1528
+ state.output = utils.escapeLast(state.output, "(");
1529
+ decrement("parens");
1530
+ }
1531
+ while (state.braces > 0) {
1532
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
1533
+ state.output = utils.escapeLast(state.output, "{");
1534
+ decrement("braces");
1535
+ }
1536
+ if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) push({
1537
+ type: "maybe_slash",
1538
+ value: "",
1539
+ output: `${SLASH_LITERAL}?`
1540
+ });
1541
+ if (state.backtrack === true) {
1542
+ state.output = "";
1543
+ for (const token of state.tokens) {
1544
+ state.output += token.output != null ? token.output : token.value;
1545
+ if (token.suffix) state.output += token.suffix;
1546
+ }
1547
+ }
1548
+ return state;
1549
+ };
1550
+ /**
1551
+ * Fast paths for creating regular expressions for common glob patterns.
1552
+ * This can significantly speed up processing and has very little downside
1553
+ * impact when none of the fast paths match.
1554
+ */
1555
+ parse.fastpaths = (input, options) => {
1556
+ const opts = { ...options };
1557
+ const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
1558
+ const len = input.length;
1559
+ if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
1560
+ input = REPLACEMENTS[input] || input;
1561
+ const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(opts.windows);
1562
+ const nodot = opts.dot ? NO_DOTS : NO_DOT;
1563
+ const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
1564
+ const capture = opts.capture ? "" : "?:";
1565
+ const state = {
1566
+ negated: false,
1567
+ prefix: ""
1568
+ };
1569
+ let star = opts.bash === true ? ".*?" : STAR;
1570
+ if (opts.capture) star = `(${star})`;
1571
+ const globstar = (opts) => {
1572
+ if (opts.noglobstar === true) return star;
1573
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
1574
+ };
1575
+ const create = (str) => {
1576
+ switch (str) {
1577
+ case "*": return `${nodot}${ONE_CHAR}${star}`;
1578
+ case ".*": return `${DOT_LITERAL}${ONE_CHAR}${star}`;
1579
+ case "*.*": return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
1580
+ case "*/*": return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
1581
+ case "**": return nodot + globstar(opts);
1582
+ case "**/*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
1583
+ case "**/*.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
1584
+ case "**/.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
1585
+ default: {
1586
+ const match = /^(.*?)\.(\w+)$/.exec(str);
1587
+ if (!match) return;
1588
+ const source = create(match[1]);
1589
+ if (!source) return;
1590
+ return source + DOT_LITERAL + match[2];
1591
+ }
1592
+ }
1593
+ };
1594
+ let source = create(utils.removePrefix(input, state));
1595
+ if (source && opts.strictSlashes !== true) source += `${SLASH_LITERAL}?`;
1596
+ return source;
1597
+ };
1598
+ module.exports = parse;
1599
+ }));
1600
+ //#endregion
1601
+ //#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/picomatch.js
1602
+ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1603
+ const scan = require_scan();
1604
+ const parse = require_parse();
1605
+ const utils = require_utils();
1606
+ const constants = require_constants();
1607
+ const isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
1608
+ /**
1609
+ * Creates a matcher function from one or more glob patterns. The
1610
+ * returned function takes a string to match as its first argument,
1611
+ * and returns true if the string is a match. The returned matcher
1612
+ * function also takes a boolean as the second argument that, when true,
1613
+ * returns an object with additional information.
1614
+ *
1615
+ * ```js
1616
+ * const picomatch = require('picomatch');
1617
+ * // picomatch(glob[, options]);
1618
+ *
1619
+ * const isMatch = picomatch('*.!(*a)');
1620
+ * console.log(isMatch('a.a')); //=> false
1621
+ * console.log(isMatch('a.b')); //=> true
1622
+ *
1623
+ * // For environments without `node.js`, `picomatch/posix` provides you a dependency-free matcher, without automatic OS detection.
1624
+ * const picomatch = require('picomatch/posix');
1625
+ * // the same API, defaulting to posix paths
1626
+ * const isMatch = picomatch('a/*');
1627
+ * console.log(isMatch('a\\b')); //=> false
1628
+ * console.log(isMatch('a/b')); //=> true
1629
+ *
1630
+ * // you can still configure the matcher function to accept windows paths
1631
+ * const isMatch = picomatch('a/*', { options: windows });
1632
+ * console.log(isMatch('a\\b')); //=> true
1633
+ * console.log(isMatch('a/b')); //=> true
1634
+ * ```
1635
+ * @name picomatch
1636
+ * @param {String|Array} `globs` One or more glob patterns.
1637
+ * @param {Object=} `options`
1638
+ * @return {Function=} Returns a matcher function.
1639
+ * @api public
1640
+ */
1641
+ const picomatch = (glob, options, returnState = false) => {
1642
+ if (Array.isArray(glob)) {
1643
+ const fns = glob.map((input) => picomatch(input, options, returnState));
1644
+ const arrayMatcher = (str) => {
1645
+ for (const isMatch of fns) {
1646
+ const state = isMatch(str);
1647
+ if (state) return state;
1648
+ }
1649
+ return false;
1650
+ };
1651
+ return arrayMatcher;
1652
+ }
1653
+ const isState = isObject(glob) && glob.tokens && glob.input;
1654
+ if (glob === "" || typeof glob !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
1655
+ const opts = options || {};
1656
+ const posix = opts.windows;
1657
+ const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
1658
+ const state = regex.state;
1659
+ delete regex.state;
1660
+ let isIgnored = () => false;
1661
+ if (opts.ignore) {
1662
+ const ignoreOpts = {
1663
+ ...options,
1664
+ ignore: null,
1665
+ onMatch: null,
1666
+ onResult: null
1667
+ };
1668
+ isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
1669
+ }
1670
+ const matcher = (input, returnObject = false) => {
1671
+ const { isMatch, match, output } = picomatch.test(input, regex, options, {
1672
+ glob,
1673
+ posix
1674
+ });
1675
+ const result = {
1676
+ glob,
1677
+ state,
1678
+ regex,
1679
+ posix,
1680
+ input,
1681
+ output,
1682
+ match,
1683
+ isMatch
1684
+ };
1685
+ if (typeof opts.onResult === "function") opts.onResult(result);
1686
+ if (isMatch === false) {
1687
+ result.isMatch = false;
1688
+ return returnObject ? result : false;
1689
+ }
1690
+ if (isIgnored(input)) {
1691
+ if (typeof opts.onIgnore === "function") opts.onIgnore(result);
1692
+ result.isMatch = false;
1693
+ return returnObject ? result : false;
1694
+ }
1695
+ if (typeof opts.onMatch === "function") opts.onMatch(result);
1696
+ return returnObject ? result : true;
1697
+ };
1698
+ if (returnState) matcher.state = state;
1699
+ return matcher;
1700
+ };
1701
+ /**
1702
+ * Test `input` with the given `regex`. This is used by the main
1703
+ * `picomatch()` function to test the input string.
1704
+ *
1705
+ * ```js
1706
+ * const picomatch = require('picomatch');
1707
+ * // picomatch.test(input, regex[, options]);
1708
+ *
1709
+ * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
1710
+ * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
1711
+ * ```
1712
+ * @param {String} `input` String to test.
1713
+ * @param {RegExp} `regex`
1714
+ * @return {Object} Returns an object with matching info.
1715
+ * @api public
1716
+ */
1717
+ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
1718
+ if (typeof input !== "string") throw new TypeError("Expected input to be a string");
1719
+ if (input === "") return {
1720
+ isMatch: false,
1721
+ output: ""
1722
+ };
1723
+ const opts = options || {};
1724
+ const format = opts.format || (posix ? utils.toPosixSlashes : null);
1725
+ let match = input === glob;
1726
+ let output = match && format ? format(input) : input;
1727
+ if (match === false) {
1728
+ output = format ? format(input) : input;
1729
+ match = output === glob;
1730
+ }
1731
+ if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix);
1732
+ else match = regex.exec(output);
1733
+ return {
1734
+ isMatch: Boolean(match),
1735
+ match,
1736
+ output
1737
+ };
1738
+ };
1739
+ /**
1740
+ * Match the basename of a filepath.
1741
+ *
1742
+ * ```js
1743
+ * const picomatch = require('picomatch');
1744
+ * // picomatch.matchBase(input, glob[, options]);
1745
+ * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
1746
+ * ```
1747
+ * @param {String} `input` String to test.
1748
+ * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
1749
+ * @return {Boolean}
1750
+ * @api public
1751
+ */
1752
+ picomatch.matchBase = (input, glob, options, posix = options && options.windows) => {
1753
+ return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input, { windows: posix }));
1754
+ };
1755
+ /**
1756
+ * Returns true if **any** of the given glob `patterns` match the specified `string`.
1757
+ *
1758
+ * ```js
1759
+ * const picomatch = require('picomatch');
1760
+ * // picomatch.isMatch(string, patterns[, options]);
1761
+ *
1762
+ * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
1763
+ * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
1764
+ * ```
1765
+ * @param {String|Array} str The string to test.
1766
+ * @param {String|Array} patterns One or more glob patterns to use for matching.
1767
+ * @param {Object} [options] See available [options](#options).
1768
+ * @return {Boolean} Returns true if any patterns match `str`
1769
+ * @api public
1770
+ */
1771
+ picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
1772
+ /**
1773
+ * Parse a glob pattern to create the source string for a regular
1774
+ * expression.
1775
+ *
1776
+ * ```js
1777
+ * const picomatch = require('picomatch');
1778
+ * const result = picomatch.parse(pattern[, options]);
1779
+ * ```
1780
+ * @param {String} `pattern`
1781
+ * @param {Object} `options`
1782
+ * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
1783
+ * @api public
1784
+ */
1785
+ picomatch.parse = (pattern, options) => {
1786
+ if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
1787
+ return parse(pattern, {
1788
+ ...options,
1789
+ fastpaths: false
1790
+ });
1791
+ };
1792
+ /**
1793
+ * Scan a glob pattern to separate the pattern into segments.
1794
+ *
1795
+ * ```js
1796
+ * const picomatch = require('picomatch');
1797
+ * // picomatch.scan(input[, options]);
1798
+ *
1799
+ * const result = picomatch.scan('!./foo/*.js');
1800
+ * console.log(result);
1801
+ * { prefix: '!./',
1802
+ * input: '!./foo/*.js',
1803
+ * start: 3,
1804
+ * base: 'foo',
1805
+ * glob: '*.js',
1806
+ * isBrace: false,
1807
+ * isBracket: false,
1808
+ * isGlob: true,
1809
+ * isExtglob: false,
1810
+ * isGlobstar: false,
1811
+ * negated: true }
1812
+ * ```
1813
+ * @param {String} `input` Glob pattern to scan.
1814
+ * @param {Object} `options`
1815
+ * @return {Object} Returns an object with
1816
+ * @api public
1817
+ */
1818
+ picomatch.scan = (input, options) => scan(input, options);
1819
+ /**
1820
+ * Compile a regular expression from the `state` object returned by the
1821
+ * [parse()](#parse) method.
1822
+ *
1823
+ * ```js
1824
+ * const picomatch = require('picomatch');
1825
+ * const state = picomatch.parse('*.js');
1826
+ * // picomatch.compileRe(state[, options]);
1827
+ *
1828
+ * console.log(picomatch.compileRe(state));
1829
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
1830
+ * ```
1831
+ * @param {Object} `state`
1832
+ * @param {Object} `options`
1833
+ * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
1834
+ * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
1835
+ * @return {RegExp}
1836
+ * @api public
1837
+ */
1838
+ picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
1839
+ if (returnOutput === true) return state.output;
1840
+ const opts = options || {};
1841
+ const prepend = opts.contains ? "" : "^";
1842
+ const append = opts.contains ? "" : "$";
1843
+ let source = `${prepend}(?:${state.output})${append}`;
1844
+ if (state && state.negated === true) source = `^(?!${source}).*$`;
1845
+ const regex = picomatch.toRegex(source, options);
1846
+ if (returnState === true) regex.state = state;
1847
+ return regex;
1848
+ };
1849
+ /**
1850
+ * Create a regular expression from a parsed glob pattern.
1851
+ *
1852
+ * ```js
1853
+ * const picomatch = require('picomatch');
1854
+ * // picomatch.makeRe(state[, options]);
1855
+ *
1856
+ * const result = picomatch.makeRe('*.js');
1857
+ * console.log(result);
1858
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
1859
+ * ```
1860
+ * @param {String} `state` The object returned from the `.parse` method.
1861
+ * @param {Object} `options`
1862
+ * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
1863
+ * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
1864
+ * @return {RegExp} Returns a regex created from the given pattern.
1865
+ * @api public
1866
+ */
1867
+ picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
1868
+ if (!input || typeof input !== "string") throw new TypeError("Expected a non-empty string");
1869
+ let parsed = {
1870
+ negated: false,
1871
+ fastpaths: true
1872
+ };
1873
+ if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) parsed.output = parse.fastpaths(input, options);
1874
+ if (!parsed.output) parsed = parse(input, options);
1875
+ return picomatch.compileRe(parsed, options, returnOutput, returnState);
1876
+ };
1877
+ /**
1878
+ * Create a regular expression from the given regex source string.
1879
+ *
1880
+ * ```js
1881
+ * const picomatch = require('picomatch');
1882
+ * // picomatch.toRegex(source[, options]);
1883
+ *
1884
+ * const { output } = picomatch.parse('*.js');
1885
+ * console.log(picomatch.toRegex(output));
1886
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
1887
+ * ```
1888
+ * @param {String} `source` Regular expression source string.
1889
+ * @param {Object} `options`
1890
+ * @return {RegExp}
1891
+ * @api public
1892
+ */
1893
+ picomatch.toRegex = (source, options) => {
1894
+ try {
1895
+ const opts = options || {};
1896
+ return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
1897
+ } catch (err) {
1898
+ if (options && options.debug === true) throw err;
1899
+ return /$^/;
1900
+ }
1901
+ };
1902
+ /**
1903
+ * Picomatch constants.
1904
+ * @return {Object}
1905
+ */
1906
+ picomatch.constants = constants;
1907
+ /**
1908
+ * Expose "picomatch"
1909
+ */
1910
+ module.exports = picomatch;
1911
+ }));
1912
+ //#endregion
1913
+ //#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/index.js
1914
+ var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1915
+ const pico = require_picomatch$1();
1916
+ const utils = require_utils();
1917
+ function picomatch(glob, options, returnState = false) {
1918
+ if (options && (options.windows === null || options.windows === void 0)) options = {
1919
+ ...options,
1920
+ windows: utils.isWindows()
1921
+ };
1922
+ return pico(glob, options, returnState);
1923
+ }
1924
+ Object.assign(picomatch, pico);
1925
+ module.exports = picomatch;
1926
+ }));
1927
+ //#endregion
1928
+ //#region src/sources/path.ts
1929
+ var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
1930
+ function matchesAny(path, patterns) {
1931
+ if (!patterns) return true;
1932
+ const list = Array.isArray(patterns) ? patterns : [String(patterns)];
1933
+ return import_picomatch.default.isMatch(normalizeSourcePath(path), list.map((pattern) => normalizeSourcePath(pattern)), { dot: true });
1934
+ }
1935
+ //#endregion
1936
+ export { __toESM as i, require_picomatch as n, __commonJSMin as r, matchesAny as t };