@varlock/bumpy 1.0.0 → 1.2.0

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