@rspress/core 2.0.8 → 2.0.9

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 (94) hide show
  1. package/dist/0~execa.js +8 -8
  2. package/dist/0~rslib-runtime.js +20 -0
  3. package/dist/0~tinypool.js +828 -0
  4. package/dist/{8311.js → 1688.js} +1 -7
  5. package/dist/{7397.js → 2240.js} +4 -2
  6. package/dist/{1361.js → 3294.js} +1 -1
  7. package/dist/{1965.js → 3425.js} +0 -1
  8. package/dist/740.js +2470 -0
  9. package/dist/8006.js +77 -0
  10. package/dist/8857.js +4827 -0
  11. package/dist/8857.js.LICENSE.txt +41 -0
  12. package/dist/cli/index.js +7 -3
  13. package/dist/config/loadConfigFile.js +1 -1
  14. package/dist/eject-theme/components/CodeButtonGroup/CopyCodeButton.scss +1 -1
  15. package/dist/eject-theme/components/CodeButtonGroup/index.scss +1 -1
  16. package/dist/eject-theme/components/DocContent/doc.scss +2 -0
  17. package/dist/eject-theme/components/FallbackHeading/index.tsx +1 -1
  18. package/dist/eject-theme/components/Link/useLinkNavigate.ts +4 -1
  19. package/dist/eject-theme/components/Llms/LlmsCopyButton.scss +3 -3
  20. package/dist/eject-theme/components/Search/SearchPanel.tsx +1 -1
  21. package/dist/eject-theme/components/Steps/index.scss +32 -13
  22. package/dist/node/PluginDriver.js +1 -1
  23. package/dist/node/auto-nav-sidebar/index.js +1 -1
  24. package/dist/node/auto-nav-sidebar/locales.js +1 -1
  25. package/dist/node/auto-nav-sidebar/normalize.js +9 -5
  26. package/dist/node/auto-nav-sidebar/utils.js +8 -2
  27. package/dist/node/auto-nav-sidebar/walk.js +2 -8
  28. package/dist/node/constants.js +1 -1
  29. package/dist/node/eject.js +11 -7
  30. package/dist/node/initRsbuild.js +6 -6
  31. package/dist/node/logger/hint.js +9 -6
  32. package/dist/node/mdx/options.js +13 -2
  33. package/dist/node/mdx/processor.js +1 -1
  34. package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
  35. package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -1
  36. package/dist/node/mdx/rehypePlugins/shiki.js +1 -1
  37. package/dist/node/mdx/remarkPlugins/builtin.js +1 -1
  38. package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +6 -2
  39. package/dist/node/mdx/remarkPlugins/image.d.ts +7 -2
  40. package/dist/node/mdx/remarkPlugins/image.js +51 -2
  41. package/dist/node/mdx/remarkPlugins/link.js +7 -3
  42. package/dist/node/mdx/remarkPlugins/toc.js +1 -1
  43. package/dist/node/route/RoutePage.js +1 -1
  44. package/dist/node/route/RouteService.js +1 -1
  45. package/dist/node/route/extractPageData.js +75 -26
  46. package/dist/node/route/normalizeRoutePath.js +1 -1
  47. package/dist/node/runtimeModule/i18n.js +10 -6
  48. package/dist/node/runtimeModule/pageData/createPageData.js +1 -1
  49. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
  50. package/dist/node/runtimeModule/searchHooks.js +1 -1
  51. package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
  52. package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
  53. package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
  54. package/dist/node/serve.js +1 -1
  55. package/dist/node/ssg/renderPage.js +8 -4
  56. package/dist/node/ssg/renderPageWorker.js +1 -1
  57. package/dist/node/ssg/renderPages.js +9 -5
  58. package/dist/node/ssg/rsbuildPluginSSG.js +1 -1
  59. package/dist/node/ssg/ssgEnv.js +1 -1
  60. package/dist/node/ssg-md/llms/emitLlmsTxt.js +1 -1
  61. package/dist/node/ssg-md/llms/llmsTxt.js +1 -1
  62. package/dist/node/ssg-md/remarkSplitMdx.js +1 -1
  63. package/dist/node/ssg-md/renderPage.js +8 -4
  64. package/dist/node/ssg-md/renderPages.js +7 -3
  65. package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -1
  66. package/dist/node/utils/checkLanguageParity.js +1 -1
  67. package/dist/node/utils/createHash.js +1 -1
  68. package/dist/node/utils/error.js +5 -2
  69. package/dist/node/utils/flattenMdxContent.js +1 -1
  70. package/dist/node/utils/fs.js +1 -1
  71. package/dist/node/utils/getPageKey.js +1 -1
  72. package/dist/node/utils/normalizePath.js +1 -1
  73. package/dist/node/utils/reactAlias.js +7 -3
  74. package/dist/runtime/App.js +4 -1
  75. package/dist/runtime/index.d.ts +2 -1
  76. package/dist/runtime/index.js +2 -1
  77. package/dist/runtime/initPageData.d.ts +3 -0
  78. package/dist/runtime/initPageData.js +37 -2
  79. package/dist/runtime/ssrClientEntry.js +4 -2
  80. package/dist/theme/assets/success.js +1 -1
  81. package/dist/theme/assets/wrapped.js +1 -1
  82. package/dist/theme/components/CodeButtonGroup/CopyCodeButton.css +1 -1
  83. package/dist/theme/components/CodeButtonGroup/index.css +1 -1
  84. package/dist/theme/components/DocContent/doc.css +1 -0
  85. package/dist/theme/components/FallbackHeading/index.js +1 -1
  86. package/dist/theme/components/Link/useLinkNavigate.js +3 -2
  87. package/dist/theme/components/Llms/LlmsCopyButton.css +5 -5
  88. package/dist/theme/components/Search/SearchPanel.js +1 -1
  89. package/dist/theme/components/Steps/index.css +23 -12
  90. package/dist/theme/logic/useThemeState.js +1 -1
  91. package/package.json +12 -15
  92. package/dist/4454.js +0 -8
  93. package/dist/7319.js +0 -88
  94. package/dist/8885.js +0 -4
package/dist/8857.js ADDED
@@ -0,0 +1,4827 @@
1
+ /*! LICENSE: 8857.js.LICENSE.txt */
2
+ import { __webpack_require__ } from "./0~rslib-runtime.js";
3
+ import "./740.js";
4
+ import { createRequire as __rspack_createRequire } from "node:module";
5
+ const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
6
+ __webpack_require__.add({
7
+ "../../node_modules/.pnpm/anymatch@3.1.3/node_modules/anymatch/index.js" (module, exports, __webpack_require__) {
8
+ Object.defineProperty(exports, "__esModule", {
9
+ value: true
10
+ });
11
+ const picomatch = __webpack_require__("../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/index.js");
12
+ const normalizePath = __webpack_require__("../../node_modules/.pnpm/normalize-path@3.0.0/node_modules/normalize-path/index.js");
13
+ const BANG = '!';
14
+ const DEFAULT_OPTIONS = {
15
+ returnIndex: false
16
+ };
17
+ const arrify = (item)=>Array.isArray(item) ? item : [
18
+ item
19
+ ];
20
+ const createPattern = (matcher, options)=>{
21
+ if ('function' == typeof matcher) return matcher;
22
+ if ('string' == typeof matcher) {
23
+ const glob = picomatch(matcher, options);
24
+ return (string)=>matcher === string || glob(string);
25
+ }
26
+ if (matcher instanceof RegExp) return (string)=>matcher.test(string);
27
+ return (string)=>false;
28
+ };
29
+ const matchPatterns = (patterns, negPatterns, args, returnIndex)=>{
30
+ const isList = Array.isArray(args);
31
+ const _path = isList ? args[0] : args;
32
+ if (!isList && 'string' != typeof _path) throw new TypeError('anymatch: second argument must be a string: got ' + Object.prototype.toString.call(_path));
33
+ const path = normalizePath(_path, false);
34
+ for(let index = 0; index < negPatterns.length; index++){
35
+ const nglob = negPatterns[index];
36
+ if (nglob(path)) return returnIndex ? -1 : false;
37
+ }
38
+ const applied = isList && [
39
+ path
40
+ ].concat(args.slice(1));
41
+ for(let index = 0; index < patterns.length; index++){
42
+ const pattern = patterns[index];
43
+ if (isList ? pattern(...applied) : pattern(path)) return returnIndex ? index : true;
44
+ }
45
+ return returnIndex ? -1 : false;
46
+ };
47
+ const anymatch = (matchers, testString, options = DEFAULT_OPTIONS)=>{
48
+ if (null == matchers) throw new TypeError('anymatch: specify first argument');
49
+ const opts = 'boolean' == typeof options ? {
50
+ returnIndex: options
51
+ } : options;
52
+ const returnIndex = opts.returnIndex || false;
53
+ const mtchers = arrify(matchers);
54
+ const negatedGlobs = mtchers.filter((item)=>'string' == typeof item && item.charAt(0) === BANG).map((item)=>item.slice(1)).map((item)=>picomatch(item, opts));
55
+ const patterns = mtchers.filter((item)=>'string' != typeof item || 'string' == typeof item && item.charAt(0) !== BANG).map((matcher)=>createPattern(matcher, opts));
56
+ if (null == testString) return (testString, ri = false)=>{
57
+ const returnIndex = 'boolean' == typeof ri ? ri : false;
58
+ return matchPatterns(patterns, negatedGlobs, testString, returnIndex);
59
+ };
60
+ return matchPatterns(patterns, negatedGlobs, testString, returnIndex);
61
+ };
62
+ anymatch.default = anymatch;
63
+ module.exports = anymatch;
64
+ },
65
+ "../../node_modules/.pnpm/binary-extensions@2.3.0/node_modules/binary-extensions/index.js" (module, __unused_rspack_exports, __webpack_require__) {
66
+ module.exports = __webpack_require__("../../node_modules/.pnpm/binary-extensions@2.3.0/node_modules/binary-extensions/binary-extensions.json");
67
+ },
68
+ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js" (module, __unused_rspack_exports, __webpack_require__) {
69
+ const stringify = __webpack_require__("../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js");
70
+ const compile = __webpack_require__("../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js");
71
+ const expand = __webpack_require__("../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js");
72
+ const parse = __webpack_require__("../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js");
73
+ const braces = (input, options = {})=>{
74
+ let output = [];
75
+ if (Array.isArray(input)) for (const pattern of input){
76
+ const result = braces.create(pattern, options);
77
+ if (Array.isArray(result)) output.push(...result);
78
+ else output.push(result);
79
+ }
80
+ else output = [].concat(braces.create(input, options));
81
+ if (options && true === options.expand && true === options.nodupes) output = [
82
+ ...new Set(output)
83
+ ];
84
+ return output;
85
+ };
86
+ braces.parse = (input, options = {})=>parse(input, options);
87
+ braces.stringify = (input, options = {})=>{
88
+ if ('string' == typeof input) return stringify(braces.parse(input, options), options);
89
+ return stringify(input, options);
90
+ };
91
+ braces.compile = (input, options = {})=>{
92
+ if ('string' == typeof input) input = braces.parse(input, options);
93
+ return compile(input, options);
94
+ };
95
+ braces.expand = (input, options = {})=>{
96
+ if ('string' == typeof input) input = braces.parse(input, options);
97
+ let result = expand(input, options);
98
+ if (true === options.noempty) result = result.filter(Boolean);
99
+ if (true === options.nodupes) result = [
100
+ ...new Set(result)
101
+ ];
102
+ return result;
103
+ };
104
+ braces.create = (input, options = {})=>{
105
+ if ('' === input || input.length < 3) return [
106
+ input
107
+ ];
108
+ return true !== options.expand ? braces.compile(input, options) : braces.expand(input, options);
109
+ };
110
+ module.exports = braces;
111
+ },
112
+ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js" (module, __unused_rspack_exports, __webpack_require__) {
113
+ const fill = __webpack_require__("../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js");
114
+ const utils = __webpack_require__("../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js");
115
+ const compile = (ast, options = {})=>{
116
+ const walk = (node, parent = {})=>{
117
+ const invalidBlock = utils.isInvalidBrace(parent);
118
+ const invalidNode = true === node.invalid && true === options.escapeInvalid;
119
+ const invalid = true === invalidBlock || true === invalidNode;
120
+ const prefix = true === options.escapeInvalid ? '\\' : '';
121
+ let output = '';
122
+ if (true === node.isOpen) return prefix + node.value;
123
+ if (true === node.isClose) {
124
+ console.log('node.isClose', prefix, node.value);
125
+ return prefix + node.value;
126
+ }
127
+ if ('open' === node.type) return invalid ? prefix + node.value : '(';
128
+ if ('close' === node.type) return invalid ? prefix + node.value : ')';
129
+ if ('comma' === node.type) return 'comma' === node.prev.type ? '' : invalid ? node.value : '|';
130
+ if (node.value) return node.value;
131
+ if (node.nodes && node.ranges > 0) {
132
+ const args = utils.reduce(node.nodes);
133
+ const range = fill(...args, {
134
+ ...options,
135
+ wrap: false,
136
+ toRegex: true,
137
+ strictZeros: true
138
+ });
139
+ if (0 !== range.length) return args.length > 1 && range.length > 1 ? `(${range})` : range;
140
+ }
141
+ if (node.nodes) for (const child of node.nodes)output += walk(child, node);
142
+ return output;
143
+ };
144
+ return walk(ast);
145
+ };
146
+ module.exports = compile;
147
+ },
148
+ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js" (module) {
149
+ module.exports = {
150
+ MAX_LENGTH: 10000,
151
+ CHAR_0: '0',
152
+ CHAR_9: '9',
153
+ CHAR_UPPERCASE_A: 'A',
154
+ CHAR_LOWERCASE_A: 'a',
155
+ CHAR_UPPERCASE_Z: 'Z',
156
+ CHAR_LOWERCASE_Z: 'z',
157
+ CHAR_LEFT_PARENTHESES: '(',
158
+ CHAR_RIGHT_PARENTHESES: ')',
159
+ CHAR_ASTERISK: '*',
160
+ CHAR_AMPERSAND: '&',
161
+ CHAR_AT: '@',
162
+ CHAR_BACKSLASH: '\\',
163
+ CHAR_BACKTICK: '`',
164
+ CHAR_CARRIAGE_RETURN: '\r',
165
+ CHAR_CIRCUMFLEX_ACCENT: '^',
166
+ CHAR_COLON: ':',
167
+ CHAR_COMMA: ',',
168
+ CHAR_DOLLAR: '$',
169
+ CHAR_DOT: '.',
170
+ CHAR_DOUBLE_QUOTE: '"',
171
+ CHAR_EQUAL: '=',
172
+ CHAR_EXCLAMATION_MARK: '!',
173
+ CHAR_FORM_FEED: '\f',
174
+ CHAR_FORWARD_SLASH: '/',
175
+ CHAR_HASH: '#',
176
+ CHAR_HYPHEN_MINUS: '-',
177
+ CHAR_LEFT_ANGLE_BRACKET: '<',
178
+ CHAR_LEFT_CURLY_BRACE: '{',
179
+ CHAR_LEFT_SQUARE_BRACKET: '[',
180
+ CHAR_LINE_FEED: '\n',
181
+ CHAR_NO_BREAK_SPACE: '\u00A0',
182
+ CHAR_PERCENT: '%',
183
+ CHAR_PLUS: '+',
184
+ CHAR_QUESTION_MARK: '?',
185
+ CHAR_RIGHT_ANGLE_BRACKET: '>',
186
+ CHAR_RIGHT_CURLY_BRACE: '}',
187
+ CHAR_RIGHT_SQUARE_BRACKET: ']',
188
+ CHAR_SEMICOLON: ';',
189
+ CHAR_SINGLE_QUOTE: '\'',
190
+ CHAR_SPACE: ' ',
191
+ CHAR_TAB: '\t',
192
+ CHAR_UNDERSCORE: '_',
193
+ CHAR_VERTICAL_LINE: '|',
194
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF'
195
+ };
196
+ },
197
+ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js" (module, __unused_rspack_exports, __webpack_require__) {
198
+ const fill = __webpack_require__("../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js");
199
+ const stringify = __webpack_require__("../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js");
200
+ const utils = __webpack_require__("../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js");
201
+ const append = (queue = '', stash = '', enclose = false)=>{
202
+ const result = [];
203
+ queue = [].concat(queue);
204
+ stash = [].concat(stash);
205
+ if (!stash.length) return queue;
206
+ if (!queue.length) return enclose ? utils.flatten(stash).map((ele)=>`{${ele}}`) : stash;
207
+ for (const item of queue)if (Array.isArray(item)) for (const value of item)result.push(append(value, stash, enclose));
208
+ else for (let ele of stash){
209
+ if (true === enclose && 'string' == typeof ele) ele = `{${ele}}`;
210
+ result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
211
+ }
212
+ return utils.flatten(result);
213
+ };
214
+ const expand = (ast, options = {})=>{
215
+ const rangeLimit = void 0 === options.rangeLimit ? 1000 : options.rangeLimit;
216
+ const walk = (node, parent = {})=>{
217
+ node.queue = [];
218
+ let p = parent;
219
+ let q = parent.queue;
220
+ while('brace' !== p.type && 'root' !== p.type && p.parent){
221
+ p = p.parent;
222
+ q = p.queue;
223
+ }
224
+ if (node.invalid || node.dollar) return void q.push(append(q.pop(), stringify(node, options)));
225
+ if ('brace' === node.type && true !== node.invalid && 2 === node.nodes.length) return void q.push(append(q.pop(), [
226
+ '{}'
227
+ ]));
228
+ if (node.nodes && node.ranges > 0) {
229
+ const args = utils.reduce(node.nodes);
230
+ if (utils.exceedsLimit(...args, options.step, rangeLimit)) throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
231
+ let range = fill(...args, options);
232
+ if (0 === range.length) range = stringify(node, options);
233
+ q.push(append(q.pop(), range));
234
+ node.nodes = [];
235
+ return;
236
+ }
237
+ const enclose = utils.encloseBrace(node);
238
+ let queue = node.queue;
239
+ let block = node;
240
+ while('brace' !== block.type && 'root' !== block.type && block.parent){
241
+ block = block.parent;
242
+ queue = block.queue;
243
+ }
244
+ for(let i = 0; i < node.nodes.length; i++){
245
+ const child = node.nodes[i];
246
+ if ('comma' === child.type && 'brace' === node.type) {
247
+ if (1 === i) queue.push('');
248
+ queue.push('');
249
+ continue;
250
+ }
251
+ if ('close' === child.type) {
252
+ q.push(append(q.pop(), queue, enclose));
253
+ continue;
254
+ }
255
+ if (child.value && 'open' !== child.type) {
256
+ queue.push(append(queue.pop(), child.value));
257
+ continue;
258
+ }
259
+ if (child.nodes) walk(child, node);
260
+ }
261
+ return queue;
262
+ };
263
+ return utils.flatten(walk(ast));
264
+ };
265
+ module.exports = expand;
266
+ },
267
+ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js" (module, __unused_rspack_exports, __webpack_require__) {
268
+ const stringify = __webpack_require__("../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js");
269
+ const { MAX_LENGTH, CHAR_BACKSLASH, CHAR_BACKTICK, CHAR_COMMA, CHAR_DOT, CHAR_LEFT_PARENTHESES, CHAR_RIGHT_PARENTHESES, CHAR_LEFT_CURLY_BRACE, CHAR_RIGHT_CURLY_BRACE, CHAR_LEFT_SQUARE_BRACKET, CHAR_RIGHT_SQUARE_BRACKET, CHAR_DOUBLE_QUOTE, CHAR_SINGLE_QUOTE, CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE } = __webpack_require__("../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js");
270
+ const parse = (input, options = {})=>{
271
+ if ('string' != typeof input) throw new TypeError('Expected a string');
272
+ const opts = options || {};
273
+ const max = 'number' == typeof opts.maxLength ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
274
+ if (input.length > max) throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
275
+ const ast = {
276
+ type: 'root',
277
+ input,
278
+ nodes: []
279
+ };
280
+ const stack = [
281
+ ast
282
+ ];
283
+ let block = ast;
284
+ let prev = ast;
285
+ let brackets = 0;
286
+ const length = input.length;
287
+ let index = 0;
288
+ let depth = 0;
289
+ let value;
290
+ const advance = ()=>input[index++];
291
+ const push = (node)=>{
292
+ if ('text' === node.type && 'dot' === prev.type) prev.type = 'text';
293
+ if (prev && 'text' === prev.type && 'text' === node.type) {
294
+ prev.value += node.value;
295
+ return;
296
+ }
297
+ block.nodes.push(node);
298
+ node.parent = block;
299
+ node.prev = prev;
300
+ prev = node;
301
+ return node;
302
+ };
303
+ push({
304
+ type: 'bos'
305
+ });
306
+ while(index < length){
307
+ block = stack[stack.length - 1];
308
+ value = advance();
309
+ if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) continue;
310
+ if (value === CHAR_BACKSLASH) {
311
+ push({
312
+ type: 'text',
313
+ value: (options.keepEscaping ? value : '') + advance()
314
+ });
315
+ continue;
316
+ }
317
+ if (value === CHAR_RIGHT_SQUARE_BRACKET) {
318
+ push({
319
+ type: 'text',
320
+ value: '\\' + value
321
+ });
322
+ continue;
323
+ }
324
+ if (value === CHAR_LEFT_SQUARE_BRACKET) {
325
+ brackets++;
326
+ let next;
327
+ while(index < length && (next = advance())){
328
+ value += next;
329
+ if (next === CHAR_LEFT_SQUARE_BRACKET) {
330
+ brackets++;
331
+ continue;
332
+ }
333
+ if (next === CHAR_BACKSLASH) {
334
+ value += advance();
335
+ continue;
336
+ }
337
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
338
+ brackets--;
339
+ if (0 === brackets) break;
340
+ }
341
+ }
342
+ push({
343
+ type: 'text',
344
+ value
345
+ });
346
+ continue;
347
+ }
348
+ if (value === CHAR_LEFT_PARENTHESES) {
349
+ block = push({
350
+ type: 'paren',
351
+ nodes: []
352
+ });
353
+ stack.push(block);
354
+ push({
355
+ type: 'text',
356
+ value
357
+ });
358
+ continue;
359
+ }
360
+ if (value === CHAR_RIGHT_PARENTHESES) {
361
+ if ('paren' !== block.type) {
362
+ push({
363
+ type: 'text',
364
+ value
365
+ });
366
+ continue;
367
+ }
368
+ block = stack.pop();
369
+ push({
370
+ type: 'text',
371
+ value
372
+ });
373
+ block = stack[stack.length - 1];
374
+ continue;
375
+ }
376
+ if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
377
+ const open = value;
378
+ let next;
379
+ if (true !== options.keepQuotes) value = '';
380
+ while(index < length && (next = advance())){
381
+ if (next === CHAR_BACKSLASH) {
382
+ value += next + advance();
383
+ continue;
384
+ }
385
+ if (next === open) {
386
+ if (true === options.keepQuotes) value += next;
387
+ break;
388
+ }
389
+ value += next;
390
+ }
391
+ push({
392
+ type: 'text',
393
+ value
394
+ });
395
+ continue;
396
+ }
397
+ if (value === CHAR_LEFT_CURLY_BRACE) {
398
+ depth++;
399
+ const dollar = prev.value && '$' === prev.value.slice(-1) || true === block.dollar;
400
+ const brace = {
401
+ type: 'brace',
402
+ open: true,
403
+ close: false,
404
+ dollar,
405
+ depth,
406
+ commas: 0,
407
+ ranges: 0,
408
+ nodes: []
409
+ };
410
+ block = push(brace);
411
+ stack.push(block);
412
+ push({
413
+ type: 'open',
414
+ value
415
+ });
416
+ continue;
417
+ }
418
+ if (value === CHAR_RIGHT_CURLY_BRACE) {
419
+ if ('brace' !== block.type) {
420
+ push({
421
+ type: 'text',
422
+ value
423
+ });
424
+ continue;
425
+ }
426
+ const type = 'close';
427
+ block = stack.pop();
428
+ block.close = true;
429
+ push({
430
+ type,
431
+ value
432
+ });
433
+ depth--;
434
+ block = stack[stack.length - 1];
435
+ continue;
436
+ }
437
+ if (value === CHAR_COMMA && depth > 0) {
438
+ if (block.ranges > 0) {
439
+ block.ranges = 0;
440
+ const open = block.nodes.shift();
441
+ block.nodes = [
442
+ open,
443
+ {
444
+ type: 'text',
445
+ value: stringify(block)
446
+ }
447
+ ];
448
+ }
449
+ push({
450
+ type: 'comma',
451
+ value
452
+ });
453
+ block.commas++;
454
+ continue;
455
+ }
456
+ if (value === CHAR_DOT && depth > 0 && 0 === block.commas) {
457
+ const siblings = block.nodes;
458
+ if (0 === depth || 0 === siblings.length) {
459
+ push({
460
+ type: 'text',
461
+ value
462
+ });
463
+ continue;
464
+ }
465
+ if ('dot' === prev.type) {
466
+ block.range = [];
467
+ prev.value += value;
468
+ prev.type = 'range';
469
+ if (3 !== block.nodes.length && 5 !== block.nodes.length) {
470
+ block.invalid = true;
471
+ block.ranges = 0;
472
+ prev.type = 'text';
473
+ continue;
474
+ }
475
+ block.ranges++;
476
+ block.args = [];
477
+ continue;
478
+ }
479
+ if ('range' === prev.type) {
480
+ siblings.pop();
481
+ const before = siblings[siblings.length - 1];
482
+ before.value += prev.value + value;
483
+ prev = before;
484
+ block.ranges--;
485
+ continue;
486
+ }
487
+ push({
488
+ type: 'dot',
489
+ value
490
+ });
491
+ continue;
492
+ }
493
+ push({
494
+ type: 'text',
495
+ value
496
+ });
497
+ }
498
+ do {
499
+ block = stack.pop();
500
+ if ('root' !== block.type) {
501
+ block.nodes.forEach((node)=>{
502
+ if (!node.nodes) {
503
+ if ('open' === node.type) node.isOpen = true;
504
+ if ('close' === node.type) node.isClose = true;
505
+ if (!node.nodes) node.type = 'text';
506
+ node.invalid = true;
507
+ }
508
+ });
509
+ const parent = stack[stack.length - 1];
510
+ const index = parent.nodes.indexOf(block);
511
+ parent.nodes.splice(index, 1, ...block.nodes);
512
+ }
513
+ }while (stack.length > 0);
514
+ push({
515
+ type: 'eos'
516
+ });
517
+ return ast;
518
+ };
519
+ module.exports = parse;
520
+ },
521
+ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js" (module, __unused_rspack_exports, __webpack_require__) {
522
+ const utils = __webpack_require__("../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js");
523
+ module.exports = (ast, options = {})=>{
524
+ const stringify = (node, parent = {})=>{
525
+ const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
526
+ const invalidNode = true === node.invalid && true === options.escapeInvalid;
527
+ let output = '';
528
+ if (node.value) {
529
+ if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) return '\\' + node.value;
530
+ return node.value;
531
+ }
532
+ if (node.value) return node.value;
533
+ if (node.nodes) for (const child of node.nodes)output += stringify(child);
534
+ return output;
535
+ };
536
+ return stringify(ast);
537
+ };
538
+ },
539
+ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js" (__unused_rspack_module, exports) {
540
+ exports.isInteger = (num)=>{
541
+ if ('number' == typeof num) return Number.isInteger(num);
542
+ if ('string' == typeof num && '' !== num.trim()) return Number.isInteger(Number(num));
543
+ return false;
544
+ };
545
+ exports.find = (node, type)=>node.nodes.find((node)=>node.type === type);
546
+ exports.exceedsLimit = (min, max, step = 1, limit)=>{
547
+ if (false === limit) return false;
548
+ if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
549
+ return (Number(max) - Number(min)) / Number(step) >= limit;
550
+ };
551
+ exports.escapeNode = (block, n = 0, type)=>{
552
+ const node = block.nodes[n];
553
+ if (!node) return;
554
+ if (type && node.type === type || 'open' === node.type || 'close' === node.type) {
555
+ if (true !== node.escaped) {
556
+ node.value = '\\' + node.value;
557
+ node.escaped = true;
558
+ }
559
+ }
560
+ };
561
+ exports.encloseBrace = (node)=>{
562
+ if ('brace' !== node.type) return false;
563
+ if (node.commas >> 0 + node.ranges === 0) {
564
+ node.invalid = true;
565
+ return true;
566
+ }
567
+ return false;
568
+ };
569
+ exports.isInvalidBrace = (block)=>{
570
+ if ('brace' !== block.type) return false;
571
+ if (true === block.invalid || block.dollar) return true;
572
+ if (block.commas >> 0 + block.ranges === 0) {
573
+ block.invalid = true;
574
+ return true;
575
+ }
576
+ if (true !== block.open || true !== block.close) {
577
+ block.invalid = true;
578
+ return true;
579
+ }
580
+ return false;
581
+ };
582
+ exports.isOpenOrClose = (node)=>{
583
+ if ('open' === node.type || 'close' === node.type) return true;
584
+ return true === node.open || true === node.close;
585
+ };
586
+ exports.reduce = (nodes)=>nodes.reduce((acc, node)=>{
587
+ if ('text' === node.type) acc.push(node.value);
588
+ if ('range' === node.type) node.type = 'text';
589
+ return acc;
590
+ }, []);
591
+ exports.flatten = (...args)=>{
592
+ const result = [];
593
+ const flat = (arr)=>{
594
+ for(let i = 0; i < arr.length; i++){
595
+ const ele = arr[i];
596
+ if (Array.isArray(ele)) {
597
+ flat(ele);
598
+ continue;
599
+ }
600
+ if (void 0 !== ele) result.push(ele);
601
+ }
602
+ return result;
603
+ };
604
+ flat(args);
605
+ return result;
606
+ };
607
+ },
608
+ "../../node_modules/.pnpm/chokidar@3.6.0/node_modules/chokidar/index.js" (__unused_rspack_module, exports, __webpack_require__) {
609
+ const { EventEmitter } = __webpack_require__("events");
610
+ const fs = __webpack_require__("fs?8b28");
611
+ const sysPath = __webpack_require__("path?aeb1");
612
+ const { promisify } = __webpack_require__("util");
613
+ const readdirp = __webpack_require__("../../node_modules/.pnpm/readdirp@3.6.0/node_modules/readdirp/index.js");
614
+ const anymatch = __webpack_require__("../../node_modules/.pnpm/anymatch@3.1.3/node_modules/anymatch/index.js")["default"];
615
+ const globParent = __webpack_require__("../../node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.js");
616
+ const isGlob = __webpack_require__("../../node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.js");
617
+ const braces = __webpack_require__("../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js");
618
+ const normalizePath = __webpack_require__("../../node_modules/.pnpm/normalize-path@3.0.0/node_modules/normalize-path/index.js");
619
+ const NodeFsHandler = __webpack_require__("../../node_modules/.pnpm/chokidar@3.6.0/node_modules/chokidar/lib/nodefs-handler.js");
620
+ const FsEventsHandler = __webpack_require__("../../node_modules/.pnpm/chokidar@3.6.0/node_modules/chokidar/lib/fsevents-handler.js");
621
+ const { EV_ALL, EV_READY, EV_ADD, EV_CHANGE, EV_UNLINK, EV_ADD_DIR, EV_UNLINK_DIR, EV_RAW, EV_ERROR, STR_CLOSE, STR_END, BACK_SLASH_RE, DOUBLE_SLASH_RE, SLASH_OR_BACK_SLASH_RE, DOT_RE, REPLACER_RE, SLASH, SLASH_SLASH, BRACE_START, BANG, ONE_DOT, TWO_DOTS, GLOBSTAR, SLASH_GLOBSTAR, ANYMATCH_OPTS, STRING_TYPE, FUNCTION_TYPE, EMPTY_STR, EMPTY_FN, isWindows, isMacos, isIBMi } = __webpack_require__("../../node_modules/.pnpm/chokidar@3.6.0/node_modules/chokidar/lib/constants.js");
622
+ const stat = promisify(fs.stat);
623
+ const readdir = promisify(fs.readdir);
624
+ const arrify = (value = [])=>Array.isArray(value) ? value : [
625
+ value
626
+ ];
627
+ const flatten = (list, result = [])=>{
628
+ list.forEach((item)=>{
629
+ if (Array.isArray(item)) flatten(item, result);
630
+ else result.push(item);
631
+ });
632
+ return result;
633
+ };
634
+ const unifyPaths = (paths_)=>{
635
+ const paths = flatten(arrify(paths_));
636
+ if (!paths.every((p)=>typeof p === STRING_TYPE)) throw new TypeError(`Non-string provided as watch path: ${paths}`);
637
+ return paths.map(normalizePathToUnix);
638
+ };
639
+ const toUnix = (string)=>{
640
+ let str = string.replace(BACK_SLASH_RE, SLASH);
641
+ let prepend = false;
642
+ if (str.startsWith(SLASH_SLASH)) prepend = true;
643
+ while(str.match(DOUBLE_SLASH_RE))str = str.replace(DOUBLE_SLASH_RE, SLASH);
644
+ if (prepend) str = SLASH + str;
645
+ return str;
646
+ };
647
+ const normalizePathToUnix = (path)=>toUnix(sysPath.normalize(toUnix(path)));
648
+ const normalizeIgnored = (cwd = EMPTY_STR)=>(path)=>{
649
+ if (typeof path !== STRING_TYPE) return path;
650
+ return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path));
651
+ };
652
+ const getAbsolutePath = (path, cwd)=>{
653
+ if (sysPath.isAbsolute(path)) return path;
654
+ if (path.startsWith(BANG)) return BANG + sysPath.join(cwd, path.slice(1));
655
+ return sysPath.join(cwd, path);
656
+ };
657
+ const undef = (opts, key)=>void 0 === opts[key];
658
+ class DirEntry {
659
+ constructor(dir, removeWatcher){
660
+ this.path = dir;
661
+ this._removeWatcher = removeWatcher;
662
+ this.items = new Set();
663
+ }
664
+ add(item) {
665
+ const { items } = this;
666
+ if (!items) return;
667
+ if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item);
668
+ }
669
+ async remove(item) {
670
+ const { items } = this;
671
+ if (!items) return;
672
+ items.delete(item);
673
+ if (items.size > 0) return;
674
+ const dir = this.path;
675
+ try {
676
+ await readdir(dir);
677
+ } catch (err) {
678
+ if (this._removeWatcher) this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir));
679
+ }
680
+ }
681
+ has(item) {
682
+ const { items } = this;
683
+ if (!items) return;
684
+ return items.has(item);
685
+ }
686
+ getChildren() {
687
+ const { items } = this;
688
+ if (!items) return;
689
+ return [
690
+ ...items.values()
691
+ ];
692
+ }
693
+ dispose() {
694
+ this.items.clear();
695
+ delete this.path;
696
+ delete this._removeWatcher;
697
+ delete this.items;
698
+ Object.freeze(this);
699
+ }
700
+ }
701
+ const STAT_METHOD_F = 'stat';
702
+ const STAT_METHOD_L = 'lstat';
703
+ class WatchHelper {
704
+ constructor(path, watchPath, follow, fsw){
705
+ this.fsw = fsw;
706
+ this.path = path = path.replace(REPLACER_RE, EMPTY_STR);
707
+ this.watchPath = watchPath;
708
+ this.fullWatchPath = sysPath.resolve(watchPath);
709
+ this.hasGlob = watchPath !== path;
710
+ if (path === EMPTY_STR) this.hasGlob = false;
711
+ this.globSymlink = this.hasGlob && follow ? void 0 : false;
712
+ this.globFilter = this.hasGlob ? anymatch(path, void 0, ANYMATCH_OPTS) : false;
713
+ this.dirParts = this.getDirParts(path);
714
+ this.dirParts.forEach((parts)=>{
715
+ if (parts.length > 1) parts.pop();
716
+ });
717
+ this.followSymlinks = follow;
718
+ this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
719
+ }
720
+ checkGlobSymlink(entry) {
721
+ if (void 0 === this.globSymlink) this.globSymlink = entry.fullParentDir === this.fullWatchPath ? false : {
722
+ realPath: entry.fullParentDir,
723
+ linkPath: this.fullWatchPath
724
+ };
725
+ if (this.globSymlink) return entry.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath);
726
+ return entry.fullPath;
727
+ }
728
+ entryPath(entry) {
729
+ return sysPath.join(this.watchPath, sysPath.relative(this.watchPath, this.checkGlobSymlink(entry)));
730
+ }
731
+ filterPath(entry) {
732
+ const { stats } = entry;
733
+ if (stats && stats.isSymbolicLink()) return this.filterDir(entry);
734
+ const resolvedPath = this.entryPath(entry);
735
+ const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ? this.globFilter(resolvedPath) : true;
736
+ return matchesGlob && this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
737
+ }
738
+ getDirParts(path) {
739
+ if (!this.hasGlob) return [];
740
+ const parts = [];
741
+ const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [
742
+ path
743
+ ];
744
+ expandedPath.forEach((path)=>{
745
+ parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE));
746
+ });
747
+ return parts;
748
+ }
749
+ filterDir(entry) {
750
+ if (this.hasGlob) {
751
+ const entryParts = this.getDirParts(this.checkGlobSymlink(entry));
752
+ let globstar = false;
753
+ this.unmatchedGlob = !this.dirParts.some((parts)=>parts.every((part, i)=>{
754
+ if (part === GLOBSTAR) globstar = true;
755
+ return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS);
756
+ }));
757
+ }
758
+ return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
759
+ }
760
+ }
761
+ class FSWatcher extends EventEmitter {
762
+ constructor(_opts){
763
+ super();
764
+ const opts = {};
765
+ if (_opts) Object.assign(opts, _opts);
766
+ this._watched = new Map();
767
+ this._closers = new Map();
768
+ this._ignoredPaths = new Set();
769
+ this._throttled = new Map();
770
+ this._symlinkPaths = new Map();
771
+ this._streams = new Set();
772
+ this.closed = false;
773
+ if (undef(opts, 'persistent')) opts.persistent = true;
774
+ if (undef(opts, 'ignoreInitial')) opts.ignoreInitial = false;
775
+ if (undef(opts, 'ignorePermissionErrors')) opts.ignorePermissionErrors = false;
776
+ if (undef(opts, 'interval')) opts.interval = 100;
777
+ if (undef(opts, 'binaryInterval')) opts.binaryInterval = 300;
778
+ if (undef(opts, 'disableGlobbing')) opts.disableGlobbing = false;
779
+ opts.enableBinaryInterval = opts.binaryInterval !== opts.interval;
780
+ if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling;
781
+ const canUseFsEvents = FsEventsHandler.canUse();
782
+ if (!canUseFsEvents) opts.useFsEvents = false;
783
+ if (undef(opts, 'usePolling') && !opts.useFsEvents) opts.usePolling = isMacos;
784
+ if (isIBMi) opts.usePolling = true;
785
+ const envPoll = process.env.CHOKIDAR_USEPOLLING;
786
+ if (void 0 !== envPoll) {
787
+ const envLower = envPoll.toLowerCase();
788
+ if ('false' === envLower || '0' === envLower) opts.usePolling = false;
789
+ else if ('true' === envLower || '1' === envLower) opts.usePolling = true;
790
+ else opts.usePolling = !!envLower;
791
+ }
792
+ const envInterval = process.env.CHOKIDAR_INTERVAL;
793
+ if (envInterval) opts.interval = Number.parseInt(envInterval, 10);
794
+ if (undef(opts, 'atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents;
795
+ if (opts.atomic) this._pendingUnlinks = new Map();
796
+ if (undef(opts, 'followSymlinks')) opts.followSymlinks = true;
797
+ if (undef(opts, 'awaitWriteFinish')) opts.awaitWriteFinish = false;
798
+ if (true === opts.awaitWriteFinish) opts.awaitWriteFinish = {};
799
+ const awf = opts.awaitWriteFinish;
800
+ if (awf) {
801
+ if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000;
802
+ if (!awf.pollInterval) awf.pollInterval = 100;
803
+ this._pendingWrites = new Map();
804
+ }
805
+ if (opts.ignored) opts.ignored = arrify(opts.ignored);
806
+ let readyCalls = 0;
807
+ this._emitReady = ()=>{
808
+ readyCalls++;
809
+ if (readyCalls >= this._readyCount) {
810
+ this._emitReady = EMPTY_FN;
811
+ this._readyEmitted = true;
812
+ process.nextTick(()=>this.emit(EV_READY));
813
+ }
814
+ };
815
+ this._emitRaw = (...args)=>this.emit(EV_RAW, ...args);
816
+ this._readyEmitted = false;
817
+ this.options = opts;
818
+ if (opts.useFsEvents) this._fsEventsHandler = new FsEventsHandler(this);
819
+ else this._nodeFsHandler = new NodeFsHandler(this);
820
+ Object.freeze(opts);
821
+ }
822
+ add(paths_, _origAdd, _internal) {
823
+ const { cwd, disableGlobbing } = this.options;
824
+ this.closed = false;
825
+ let paths = unifyPaths(paths_);
826
+ if (cwd) paths = paths.map((path)=>{
827
+ const absPath = getAbsolutePath(path, cwd);
828
+ if (disableGlobbing || !isGlob(path)) return absPath;
829
+ return normalizePath(absPath);
830
+ });
831
+ paths = paths.filter((path)=>{
832
+ if (path.startsWith(BANG)) {
833
+ this._ignoredPaths.add(path.slice(1));
834
+ return false;
835
+ }
836
+ this._ignoredPaths.delete(path);
837
+ this._ignoredPaths.delete(path + SLASH_GLOBSTAR);
838
+ this._userIgnored = void 0;
839
+ return true;
840
+ });
841
+ if (this.options.useFsEvents && this._fsEventsHandler) {
842
+ if (!this._readyCount) this._readyCount = paths.length;
843
+ if (this.options.persistent) this._readyCount += paths.length;
844
+ paths.forEach((path)=>this._fsEventsHandler._addToFsEvents(path));
845
+ } else {
846
+ if (!this._readyCount) this._readyCount = 0;
847
+ this._readyCount += paths.length;
848
+ Promise.all(paths.map(async (path)=>{
849
+ const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, 0, 0, _origAdd);
850
+ if (res) this._emitReady();
851
+ return res;
852
+ })).then((results)=>{
853
+ if (this.closed) return;
854
+ results.filter((item)=>item).forEach((item)=>{
855
+ this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item));
856
+ });
857
+ });
858
+ }
859
+ return this;
860
+ }
861
+ unwatch(paths_) {
862
+ if (this.closed) return this;
863
+ const paths = unifyPaths(paths_);
864
+ const { cwd } = this.options;
865
+ paths.forEach((path)=>{
866
+ if (!sysPath.isAbsolute(path) && !this._closers.has(path)) {
867
+ if (cwd) path = sysPath.join(cwd, path);
868
+ path = sysPath.resolve(path);
869
+ }
870
+ this._closePath(path);
871
+ this._ignoredPaths.add(path);
872
+ if (this._watched.has(path)) this._ignoredPaths.add(path + SLASH_GLOBSTAR);
873
+ this._userIgnored = void 0;
874
+ });
875
+ return this;
876
+ }
877
+ close() {
878
+ if (this.closed) return this._closePromise;
879
+ this.closed = true;
880
+ this.removeAllListeners();
881
+ const closers = [];
882
+ this._closers.forEach((closerList)=>closerList.forEach((closer)=>{
883
+ const promise = closer();
884
+ if (promise instanceof Promise) closers.push(promise);
885
+ }));
886
+ this._streams.forEach((stream)=>stream.destroy());
887
+ this._userIgnored = void 0;
888
+ this._readyCount = 0;
889
+ this._readyEmitted = false;
890
+ this._watched.forEach((dirent)=>dirent.dispose());
891
+ [
892
+ 'closers',
893
+ 'watched',
894
+ 'streams',
895
+ 'symlinkPaths',
896
+ 'throttled'
897
+ ].forEach((key)=>{
898
+ this[`_${key}`].clear();
899
+ });
900
+ this._closePromise = closers.length ? Promise.all(closers).then(()=>void 0) : Promise.resolve();
901
+ return this._closePromise;
902
+ }
903
+ getWatched() {
904
+ const watchList = {};
905
+ this._watched.forEach((entry, dir)=>{
906
+ const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir;
907
+ watchList[key || ONE_DOT] = entry.getChildren().sort();
908
+ });
909
+ return watchList;
910
+ }
911
+ emitWithAll(event, args) {
912
+ this.emit(...args);
913
+ if (event !== EV_ERROR) this.emit(EV_ALL, ...args);
914
+ }
915
+ async _emit(event, path, val1, val2, val3) {
916
+ if (this.closed) return;
917
+ const opts = this.options;
918
+ if (isWindows) path = sysPath.normalize(path);
919
+ if (opts.cwd) path = sysPath.relative(opts.cwd, path);
920
+ const args = [
921
+ event,
922
+ path
923
+ ];
924
+ if (void 0 !== val3) args.push(val1, val2, val3);
925
+ else if (void 0 !== val2) args.push(val1, val2);
926
+ else if (void 0 !== val1) args.push(val1);
927
+ const awf = opts.awaitWriteFinish;
928
+ let pw;
929
+ if (awf && (pw = this._pendingWrites.get(path))) {
930
+ pw.lastChange = new Date();
931
+ return this;
932
+ }
933
+ if (opts.atomic) {
934
+ if (event === EV_UNLINK) {
935
+ this._pendingUnlinks.set(path, args);
936
+ setTimeout(()=>{
937
+ this._pendingUnlinks.forEach((entry, path)=>{
938
+ this.emit(...entry);
939
+ this.emit(EV_ALL, ...entry);
940
+ this._pendingUnlinks.delete(path);
941
+ });
942
+ }, 'number' == typeof opts.atomic ? opts.atomic : 100);
943
+ return this;
944
+ }
945
+ if (event === EV_ADD && this._pendingUnlinks.has(path)) {
946
+ event = args[0] = EV_CHANGE;
947
+ this._pendingUnlinks.delete(path);
948
+ }
949
+ }
950
+ if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) {
951
+ const awfEmit = (err, stats)=>{
952
+ if (err) {
953
+ event = args[0] = EV_ERROR;
954
+ args[1] = err;
955
+ this.emitWithAll(event, args);
956
+ } else if (stats) {
957
+ if (args.length > 2) args[2] = stats;
958
+ else args.push(stats);
959
+ this.emitWithAll(event, args);
960
+ }
961
+ };
962
+ this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit);
963
+ return this;
964
+ }
965
+ if (event === EV_CHANGE) {
966
+ const isThrottled = !this._throttle(EV_CHANGE, path, 50);
967
+ if (isThrottled) return this;
968
+ }
969
+ if (opts.alwaysStat && void 0 === val1 && (event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE)) {
970
+ const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path;
971
+ let stats;
972
+ try {
973
+ stats = await stat(fullPath);
974
+ } catch (err) {}
975
+ if (!stats || this.closed) return;
976
+ args.push(stats);
977
+ }
978
+ this.emitWithAll(event, args);
979
+ return this;
980
+ }
981
+ _handleError(error) {
982
+ const code = error && error.code;
983
+ if (error && 'ENOENT' !== code && 'ENOTDIR' !== code && (!this.options.ignorePermissionErrors || 'EPERM' !== code && 'EACCES' !== code)) this.emit(EV_ERROR, error);
984
+ return error || this.closed;
985
+ }
986
+ _throttle(actionType, path, timeout) {
987
+ if (!this._throttled.has(actionType)) this._throttled.set(actionType, new Map());
988
+ const action = this._throttled.get(actionType);
989
+ const actionPath = action.get(path);
990
+ if (actionPath) {
991
+ actionPath.count++;
992
+ return false;
993
+ }
994
+ let timeoutObject;
995
+ const clear = ()=>{
996
+ const item = action.get(path);
997
+ const count = item ? item.count : 0;
998
+ action.delete(path);
999
+ clearTimeout(timeoutObject);
1000
+ if (item) clearTimeout(item.timeoutObject);
1001
+ return count;
1002
+ };
1003
+ timeoutObject = setTimeout(clear, timeout);
1004
+ const thr = {
1005
+ timeoutObject,
1006
+ clear,
1007
+ count: 0
1008
+ };
1009
+ action.set(path, thr);
1010
+ return thr;
1011
+ }
1012
+ _incrReadyCount() {
1013
+ return this._readyCount++;
1014
+ }
1015
+ _awaitWriteFinish(path, threshold, event, awfEmit) {
1016
+ let timeoutHandler;
1017
+ let fullPath = path;
1018
+ if (this.options.cwd && !sysPath.isAbsolute(path)) fullPath = sysPath.join(this.options.cwd, path);
1019
+ const now = new Date();
1020
+ const awaitWriteFinish = (prevStat)=>{
1021
+ fs.stat(fullPath, (err, curStat)=>{
1022
+ if (err || !this._pendingWrites.has(path)) {
1023
+ if (err && 'ENOENT' !== err.code) awfEmit(err);
1024
+ return;
1025
+ }
1026
+ const now = Number(new Date());
1027
+ if (prevStat && curStat.size !== prevStat.size) this._pendingWrites.get(path).lastChange = now;
1028
+ const pw = this._pendingWrites.get(path);
1029
+ const df = now - pw.lastChange;
1030
+ if (df >= threshold) {
1031
+ this._pendingWrites.delete(path);
1032
+ awfEmit(void 0, curStat);
1033
+ } else timeoutHandler = setTimeout(awaitWriteFinish, this.options.awaitWriteFinish.pollInterval, curStat);
1034
+ });
1035
+ };
1036
+ if (!this._pendingWrites.has(path)) {
1037
+ this._pendingWrites.set(path, {
1038
+ lastChange: now,
1039
+ cancelWait: ()=>{
1040
+ this._pendingWrites.delete(path);
1041
+ clearTimeout(timeoutHandler);
1042
+ return event;
1043
+ }
1044
+ });
1045
+ timeoutHandler = setTimeout(awaitWriteFinish, this.options.awaitWriteFinish.pollInterval);
1046
+ }
1047
+ }
1048
+ _getGlobIgnored() {
1049
+ return [
1050
+ ...this._ignoredPaths.values()
1051
+ ];
1052
+ }
1053
+ _isIgnored(path, stats) {
1054
+ if (this.options.atomic && DOT_RE.test(path)) return true;
1055
+ if (!this._userIgnored) {
1056
+ const { cwd } = this.options;
1057
+ const ign = this.options.ignored;
1058
+ const ignored = ign && ign.map(normalizeIgnored(cwd));
1059
+ const paths = arrify(ignored).filter((path)=>typeof path === STRING_TYPE && !isGlob(path)).map((path)=>path + SLASH_GLOBSTAR);
1060
+ const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths);
1061
+ this._userIgnored = anymatch(list, void 0, ANYMATCH_OPTS);
1062
+ }
1063
+ return this._userIgnored([
1064
+ path,
1065
+ stats
1066
+ ]);
1067
+ }
1068
+ _isntIgnored(path, stat) {
1069
+ return !this._isIgnored(path, stat);
1070
+ }
1071
+ _getWatchHelpers(path, depth) {
1072
+ const watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path);
1073
+ const follow = this.options.followSymlinks;
1074
+ return new WatchHelper(path, watchPath, follow, this);
1075
+ }
1076
+ _getWatchedDir(directory) {
1077
+ if (!this._boundRemove) this._boundRemove = this._remove.bind(this);
1078
+ const dir = sysPath.resolve(directory);
1079
+ if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove));
1080
+ return this._watched.get(dir);
1081
+ }
1082
+ _hasReadPermissions(stats) {
1083
+ if (this.options.ignorePermissionErrors) return true;
1084
+ const md = stats && Number.parseInt(stats.mode, 10);
1085
+ const st = 511 & md;
1086
+ const it = Number.parseInt(st.toString(8)[0], 10);
1087
+ return Boolean(4 & it);
1088
+ }
1089
+ _remove(directory, item, isDirectory) {
1090
+ const path = sysPath.join(directory, item);
1091
+ const fullPath = sysPath.resolve(path);
1092
+ isDirectory = null != isDirectory ? isDirectory : this._watched.has(path) || this._watched.has(fullPath);
1093
+ if (!this._throttle('remove', path, 100)) return;
1094
+ if (!isDirectory && !this.options.useFsEvents && 1 === this._watched.size) this.add(directory, item, true);
1095
+ const wp = this._getWatchedDir(path);
1096
+ const nestedDirectoryChildren = wp.getChildren();
1097
+ nestedDirectoryChildren.forEach((nested)=>this._remove(path, nested));
1098
+ const parent = this._getWatchedDir(directory);
1099
+ const wasTracked = parent.has(item);
1100
+ parent.remove(item);
1101
+ if (this._symlinkPaths.has(fullPath)) this._symlinkPaths.delete(fullPath);
1102
+ let relPath = path;
1103
+ if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path);
1104
+ if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
1105
+ const event = this._pendingWrites.get(relPath).cancelWait();
1106
+ if (event === EV_ADD) return;
1107
+ }
1108
+ this._watched.delete(path);
1109
+ this._watched.delete(fullPath);
1110
+ const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK;
1111
+ if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path);
1112
+ if (!this.options.useFsEvents) this._closePath(path);
1113
+ }
1114
+ _closePath(path) {
1115
+ this._closeFile(path);
1116
+ const dir = sysPath.dirname(path);
1117
+ this._getWatchedDir(dir).remove(sysPath.basename(path));
1118
+ }
1119
+ _closeFile(path) {
1120
+ const closers = this._closers.get(path);
1121
+ if (!closers) return;
1122
+ closers.forEach((closer)=>closer());
1123
+ this._closers.delete(path);
1124
+ }
1125
+ _addPathCloser(path, closer) {
1126
+ if (!closer) return;
1127
+ let list = this._closers.get(path);
1128
+ if (!list) {
1129
+ list = [];
1130
+ this._closers.set(path, list);
1131
+ }
1132
+ list.push(closer);
1133
+ }
1134
+ _readdirp(root, opts) {
1135
+ if (this.closed) return;
1136
+ const options = {
1137
+ type: EV_ALL,
1138
+ alwaysStat: true,
1139
+ lstat: true,
1140
+ ...opts
1141
+ };
1142
+ let stream = readdirp(root, options);
1143
+ this._streams.add(stream);
1144
+ stream.once(STR_CLOSE, ()=>{
1145
+ stream = void 0;
1146
+ });
1147
+ stream.once(STR_END, ()=>{
1148
+ if (stream) {
1149
+ this._streams.delete(stream);
1150
+ stream = void 0;
1151
+ }
1152
+ });
1153
+ return stream;
1154
+ }
1155
+ }
1156
+ exports.FSWatcher = FSWatcher;
1157
+ const watch = (paths, options)=>{
1158
+ const watcher = new FSWatcher(options);
1159
+ watcher.add(paths);
1160
+ return watcher;
1161
+ };
1162
+ exports.watch = watch;
1163
+ },
1164
+ "../../node_modules/.pnpm/chokidar@3.6.0/node_modules/chokidar/lib/constants.js" (__unused_rspack_module, exports, __webpack_require__) {
1165
+ const { sep } = __webpack_require__("path?aeb1");
1166
+ const { platform } = process;
1167
+ const os = __webpack_require__("os");
1168
+ exports.EV_ALL = 'all';
1169
+ exports.EV_READY = 'ready';
1170
+ exports.EV_ADD = 'add';
1171
+ exports.EV_CHANGE = 'change';
1172
+ exports.EV_ADD_DIR = 'addDir';
1173
+ exports.EV_UNLINK = 'unlink';
1174
+ exports.EV_UNLINK_DIR = 'unlinkDir';
1175
+ exports.EV_RAW = 'raw';
1176
+ exports.EV_ERROR = 'error';
1177
+ exports.STR_DATA = 'data';
1178
+ exports.STR_END = 'end';
1179
+ exports.STR_CLOSE = 'close';
1180
+ exports.FSEVENT_CREATED = 'created';
1181
+ exports.FSEVENT_MODIFIED = 'modified';
1182
+ exports.FSEVENT_DELETED = 'deleted';
1183
+ exports.FSEVENT_MOVED = 'moved';
1184
+ 'cloned';
1185
+ exports.FSEVENT_UNKNOWN = 'unknown';
1186
+ exports.FSEVENT_FLAG_MUST_SCAN_SUBDIRS = 1;
1187
+ exports.FSEVENT_TYPE_FILE = 'file';
1188
+ exports.FSEVENT_TYPE_DIRECTORY = 'directory';
1189
+ exports.FSEVENT_TYPE_SYMLINK = 'symlink';
1190
+ exports.KEY_LISTENERS = 'listeners';
1191
+ exports.KEY_ERR = 'errHandlers';
1192
+ exports.KEY_RAW = 'rawEmitters';
1193
+ exports.HANDLER_KEYS = [
1194
+ exports.KEY_LISTENERS,
1195
+ exports.KEY_ERR,
1196
+ exports.KEY_RAW
1197
+ ];
1198
+ exports.DOT_SLASH = `.${sep}`;
1199
+ exports.BACK_SLASH_RE = /\\/g;
1200
+ exports.DOUBLE_SLASH_RE = /\/\//;
1201
+ exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/;
1202
+ exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
1203
+ exports.REPLACER_RE = /^\.[/\\]/;
1204
+ exports.SLASH = '/';
1205
+ exports.SLASH_SLASH = '//';
1206
+ exports.BRACE_START = '{';
1207
+ exports.BANG = '!';
1208
+ exports.ONE_DOT = '.';
1209
+ exports.TWO_DOTS = '..';
1210
+ exports.STAR = '*';
1211
+ exports.GLOBSTAR = '**';
1212
+ exports.ROOT_GLOBSTAR = '/**/*';
1213
+ exports.SLASH_GLOBSTAR = '/**';
1214
+ exports.DIR_SUFFIX = 'Dir';
1215
+ exports.ANYMATCH_OPTS = {
1216
+ dot: true
1217
+ };
1218
+ exports.STRING_TYPE = 'string';
1219
+ exports.FUNCTION_TYPE = 'function';
1220
+ exports.EMPTY_STR = '';
1221
+ exports.EMPTY_FN = ()=>{};
1222
+ exports.IDENTITY_FN = (val)=>val;
1223
+ exports.isWindows = 'win32' === platform;
1224
+ exports.isMacos = 'darwin' === platform;
1225
+ exports.isLinux = 'linux' === platform;
1226
+ exports.isIBMi = 'OS400' === os.type();
1227
+ },
1228
+ "../../node_modules/.pnpm/chokidar@3.6.0/node_modules/chokidar/lib/fsevents-handler.js" (module, __unused_rspack_exports, __webpack_require__) {
1229
+ const fs = __webpack_require__("fs?8b28");
1230
+ const sysPath = __webpack_require__("path?aeb1");
1231
+ const { promisify } = __webpack_require__("util");
1232
+ let fsevents;
1233
+ try {
1234
+ fsevents = __webpack_require__(Object(function() {
1235
+ var e = new Error("Cannot find module 'fsevents'");
1236
+ e.code = 'MODULE_NOT_FOUND';
1237
+ throw e;
1238
+ }()));
1239
+ } catch (error) {
1240
+ if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error);
1241
+ }
1242
+ if (fsevents) {
1243
+ const mtch = process.version.match(/v(\d+)\.(\d+)/);
1244
+ if (mtch && mtch[1] && mtch[2]) {
1245
+ const maj = Number.parseInt(mtch[1], 10);
1246
+ const min = Number.parseInt(mtch[2], 10);
1247
+ if (8 === maj && min < 16) fsevents = void 0;
1248
+ }
1249
+ }
1250
+ const { EV_ADD, EV_CHANGE, EV_ADD_DIR, EV_UNLINK, EV_ERROR, STR_DATA, STR_END, FSEVENT_CREATED, FSEVENT_MODIFIED, FSEVENT_DELETED, FSEVENT_MOVED, FSEVENT_UNKNOWN, FSEVENT_FLAG_MUST_SCAN_SUBDIRS, FSEVENT_TYPE_FILE, FSEVENT_TYPE_DIRECTORY, FSEVENT_TYPE_SYMLINK, ROOT_GLOBSTAR, DIR_SUFFIX, DOT_SLASH, FUNCTION_TYPE, EMPTY_FN, IDENTITY_FN } = __webpack_require__("../../node_modules/.pnpm/chokidar@3.6.0/node_modules/chokidar/lib/constants.js");
1251
+ const Depth = (value)=>isNaN(value) ? {} : {
1252
+ depth: value
1253
+ };
1254
+ const stat = promisify(fs.stat);
1255
+ const lstat = promisify(fs.lstat);
1256
+ const realpath = promisify(fs.realpath);
1257
+ const statMethods = {
1258
+ stat,
1259
+ lstat
1260
+ };
1261
+ const FSEventsWatchers = new Map();
1262
+ const consolidateThreshhold = 10;
1263
+ const wrongEventFlags = new Set([
1264
+ 69888,
1265
+ 70400,
1266
+ 71424,
1267
+ 72704,
1268
+ 73472,
1269
+ 131328,
1270
+ 131840,
1271
+ 262912
1272
+ ]);
1273
+ const createFSEventsInstance = (path, callback)=>{
1274
+ const stop = fsevents.watch(path, callback);
1275
+ return {
1276
+ stop
1277
+ };
1278
+ };
1279
+ function setFSEventsListener(path, realPath, listener, rawEmitter) {
1280
+ let watchPath = sysPath.extname(realPath) ? sysPath.dirname(realPath) : realPath;
1281
+ const parentPath = sysPath.dirname(watchPath);
1282
+ let cont = FSEventsWatchers.get(watchPath);
1283
+ if (couldConsolidate(parentPath)) watchPath = parentPath;
1284
+ const resolvedPath = sysPath.resolve(path);
1285
+ const hasSymlink = resolvedPath !== realPath;
1286
+ const filteredListener = (fullPath, flags, info)=>{
1287
+ if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath);
1288
+ if (fullPath === resolvedPath || !fullPath.indexOf(resolvedPath + sysPath.sep)) listener(fullPath, flags, info);
1289
+ };
1290
+ let watchedParent = false;
1291
+ for (const watchedPath of FSEventsWatchers.keys())if (0 === realPath.indexOf(sysPath.resolve(watchedPath) + sysPath.sep)) {
1292
+ watchPath = watchedPath;
1293
+ cont = FSEventsWatchers.get(watchPath);
1294
+ watchedParent = true;
1295
+ break;
1296
+ }
1297
+ if (cont || watchedParent) cont.listeners.add(filteredListener);
1298
+ else {
1299
+ cont = {
1300
+ listeners: new Set([
1301
+ filteredListener
1302
+ ]),
1303
+ rawEmitter,
1304
+ watcher: createFSEventsInstance(watchPath, (fullPath, flags)=>{
1305
+ if (!cont.listeners.size) return;
1306
+ if (flags & FSEVENT_FLAG_MUST_SCAN_SUBDIRS) return;
1307
+ const info = fsevents.getInfo(fullPath, flags);
1308
+ cont.listeners.forEach((list)=>{
1309
+ list(fullPath, flags, info);
1310
+ });
1311
+ cont.rawEmitter(info.event, fullPath, info);
1312
+ })
1313
+ };
1314
+ FSEventsWatchers.set(watchPath, cont);
1315
+ }
1316
+ return ()=>{
1317
+ const lst = cont.listeners;
1318
+ lst.delete(filteredListener);
1319
+ if (!lst.size) {
1320
+ FSEventsWatchers.delete(watchPath);
1321
+ if (cont.watcher) return cont.watcher.stop().then(()=>{
1322
+ cont.rawEmitter = cont.watcher = void 0;
1323
+ Object.freeze(cont);
1324
+ });
1325
+ }
1326
+ };
1327
+ }
1328
+ const couldConsolidate = (path)=>{
1329
+ let count = 0;
1330
+ for (const watchPath of FSEventsWatchers.keys())if (0 === watchPath.indexOf(path)) {
1331
+ count++;
1332
+ if (count >= consolidateThreshhold) return true;
1333
+ }
1334
+ return false;
1335
+ };
1336
+ const canUse = ()=>fsevents && FSEventsWatchers.size < 128;
1337
+ const calcDepth = (path, root)=>{
1338
+ let i = 0;
1339
+ while(!path.indexOf(root) && (path = sysPath.dirname(path)) !== root)i++;
1340
+ return i;
1341
+ };
1342
+ const sameTypes = (info, stats)=>info.type === FSEVENT_TYPE_DIRECTORY && stats.isDirectory() || info.type === FSEVENT_TYPE_SYMLINK && stats.isSymbolicLink() || info.type === FSEVENT_TYPE_FILE && stats.isFile();
1343
+ class FsEventsHandler {
1344
+ constructor(fsw){
1345
+ this.fsw = fsw;
1346
+ }
1347
+ checkIgnored(path, stats) {
1348
+ const ipaths = this.fsw._ignoredPaths;
1349
+ if (this.fsw._isIgnored(path, stats)) {
1350
+ ipaths.add(path);
1351
+ if (stats && stats.isDirectory()) ipaths.add(path + ROOT_GLOBSTAR);
1352
+ return true;
1353
+ }
1354
+ ipaths.delete(path);
1355
+ ipaths.delete(path + ROOT_GLOBSTAR);
1356
+ }
1357
+ addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts) {
1358
+ const event = watchedDir.has(item) ? EV_CHANGE : EV_ADD;
1359
+ this.handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts);
1360
+ }
1361
+ async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts) {
1362
+ try {
1363
+ const stats = await stat(path);
1364
+ if (this.fsw.closed) return;
1365
+ if (sameTypes(info, stats)) this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
1366
+ else this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
1367
+ } catch (error) {
1368
+ if ('EACCES' === error.code) this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
1369
+ else this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
1370
+ }
1371
+ }
1372
+ handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts) {
1373
+ if (this.fsw.closed || this.checkIgnored(path)) return;
1374
+ if (event === EV_UNLINK) {
1375
+ const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY;
1376
+ if (isDirectory || watchedDir.has(item)) this.fsw._remove(parent, item, isDirectory);
1377
+ } else {
1378
+ if (event === EV_ADD) {
1379
+ if (info.type === FSEVENT_TYPE_DIRECTORY) this.fsw._getWatchedDir(path);
1380
+ if (info.type === FSEVENT_TYPE_SYMLINK && opts.followSymlinks) {
1381
+ const curDepth = void 0 === opts.depth ? void 0 : calcDepth(fullPath, realPath) + 1;
1382
+ return this._addToFsEvents(path, false, true, curDepth);
1383
+ }
1384
+ this.fsw._getWatchedDir(parent).add(item);
1385
+ }
1386
+ const eventName = info.type === FSEVENT_TYPE_DIRECTORY ? event + DIR_SUFFIX : event;
1387
+ this.fsw._emit(eventName, path);
1388
+ if (eventName === EV_ADD_DIR) this._addToFsEvents(path, false, true);
1389
+ }
1390
+ }
1391
+ _watchWithFsEvents(watchPath, realPath, transform, globFilter) {
1392
+ if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return;
1393
+ const opts = this.fsw.options;
1394
+ const watchCallback = async (fullPath, flags, info)=>{
1395
+ if (this.fsw.closed) return;
1396
+ if (void 0 !== opts.depth && calcDepth(fullPath, realPath) > opts.depth) return;
1397
+ const path = transform(sysPath.join(watchPath, sysPath.relative(watchPath, fullPath)));
1398
+ if (globFilter && !globFilter(path)) return;
1399
+ const parent = sysPath.dirname(path);
1400
+ const item = sysPath.basename(path);
1401
+ const watchedDir = this.fsw._getWatchedDir(info.type === FSEVENT_TYPE_DIRECTORY ? path : parent);
1402
+ if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) if (typeof opts.ignored === FUNCTION_TYPE) {
1403
+ let stats;
1404
+ try {
1405
+ stats = await stat(path);
1406
+ } catch (error) {}
1407
+ if (this.fsw.closed) return;
1408
+ if (this.checkIgnored(path, stats)) return;
1409
+ if (sameTypes(info, stats)) this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
1410
+ else this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
1411
+ } else this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts);
1412
+ else switch(info.event){
1413
+ case FSEVENT_CREATED:
1414
+ case FSEVENT_MODIFIED:
1415
+ return this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
1416
+ case FSEVENT_DELETED:
1417
+ case FSEVENT_MOVED:
1418
+ return this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts);
1419
+ }
1420
+ };
1421
+ const closer = setFSEventsListener(watchPath, realPath, watchCallback, this.fsw._emitRaw);
1422
+ this.fsw._emitReady();
1423
+ return closer;
1424
+ }
1425
+ async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) {
1426
+ if (this.fsw.closed || this.fsw._symlinkPaths.has(fullPath)) return;
1427
+ this.fsw._symlinkPaths.set(fullPath, true);
1428
+ this.fsw._incrReadyCount();
1429
+ try {
1430
+ const linkTarget = await realpath(linkPath);
1431
+ if (this.fsw.closed) return;
1432
+ if (this.fsw._isIgnored(linkTarget)) return this.fsw._emitReady();
1433
+ this.fsw._incrReadyCount();
1434
+ this._addToFsEvents(linkTarget || linkPath, (path)=>{
1435
+ let aliasedPath = linkPath;
1436
+ if (linkTarget && linkTarget !== DOT_SLASH) aliasedPath = path.replace(linkTarget, linkPath);
1437
+ else if (path !== DOT_SLASH) aliasedPath = sysPath.join(linkPath, path);
1438
+ return transform(aliasedPath);
1439
+ }, false, curDepth);
1440
+ } catch (error) {
1441
+ if (this.fsw._handleError(error)) return this.fsw._emitReady();
1442
+ }
1443
+ }
1444
+ emitAdd(newPath, stats, processPath, opts, forceAdd) {
1445
+ const pp = processPath(newPath);
1446
+ const isDir = stats.isDirectory();
1447
+ const dirObj = this.fsw._getWatchedDir(sysPath.dirname(pp));
1448
+ const base = sysPath.basename(pp);
1449
+ if (isDir) this.fsw._getWatchedDir(pp);
1450
+ if (dirObj.has(base)) return;
1451
+ dirObj.add(base);
1452
+ if (!opts.ignoreInitial || true === forceAdd) this.fsw._emit(isDir ? EV_ADD_DIR : EV_ADD, pp, stats);
1453
+ }
1454
+ initWatch(realPath, path, wh, processPath) {
1455
+ if (this.fsw.closed) return;
1456
+ const closer = this._watchWithFsEvents(wh.watchPath, sysPath.resolve(realPath || wh.watchPath), processPath, wh.globFilter);
1457
+ this.fsw._addPathCloser(path, closer);
1458
+ }
1459
+ async _addToFsEvents(path, transform, forceAdd, priorDepth) {
1460
+ if (this.fsw.closed) return;
1461
+ const opts = this.fsw.options;
1462
+ const processPath = typeof transform === FUNCTION_TYPE ? transform : IDENTITY_FN;
1463
+ const wh = this.fsw._getWatchHelpers(path);
1464
+ try {
1465
+ const stats = await statMethods[wh.statMethod](wh.watchPath);
1466
+ if (this.fsw.closed) return;
1467
+ if (this.fsw._isIgnored(wh.watchPath, stats)) throw null;
1468
+ if (stats.isDirectory()) {
1469
+ if (!wh.globFilter) this.emitAdd(processPath(path), stats, processPath, opts, forceAdd);
1470
+ if (priorDepth && priorDepth > opts.depth) return;
1471
+ this.fsw._readdirp(wh.watchPath, {
1472
+ fileFilter: (entry)=>wh.filterPath(entry),
1473
+ directoryFilter: (entry)=>wh.filterDir(entry),
1474
+ ...Depth(opts.depth - (priorDepth || 0))
1475
+ }).on(STR_DATA, (entry)=>{
1476
+ if (this.fsw.closed) return;
1477
+ if (entry.stats.isDirectory() && !wh.filterPath(entry)) return;
1478
+ const joinedPath = sysPath.join(wh.watchPath, entry.path);
1479
+ const { fullPath } = entry;
1480
+ if (wh.followSymlinks && entry.stats.isSymbolicLink()) {
1481
+ const curDepth = void 0 === opts.depth ? void 0 : calcDepth(joinedPath, sysPath.resolve(wh.watchPath)) + 1;
1482
+ this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth);
1483
+ } else this.emitAdd(joinedPath, entry.stats, processPath, opts, forceAdd);
1484
+ }).on(EV_ERROR, EMPTY_FN).on(STR_END, ()=>{
1485
+ this.fsw._emitReady();
1486
+ });
1487
+ } else {
1488
+ this.emitAdd(wh.watchPath, stats, processPath, opts, forceAdd);
1489
+ this.fsw._emitReady();
1490
+ }
1491
+ } catch (error) {
1492
+ if (!error || this.fsw._handleError(error)) {
1493
+ this.fsw._emitReady();
1494
+ this.fsw._emitReady();
1495
+ }
1496
+ }
1497
+ if (opts.persistent && true !== forceAdd) if (typeof transform === FUNCTION_TYPE) this.initWatch(void 0, path, wh, processPath);
1498
+ else {
1499
+ let realPath;
1500
+ try {
1501
+ realPath = await realpath(wh.watchPath);
1502
+ } catch (e) {}
1503
+ this.initWatch(realPath, path, wh, processPath);
1504
+ }
1505
+ }
1506
+ }
1507
+ module.exports = FsEventsHandler;
1508
+ module.exports.canUse = canUse;
1509
+ },
1510
+ "../../node_modules/.pnpm/chokidar@3.6.0/node_modules/chokidar/lib/nodefs-handler.js" (module, __unused_rspack_exports, __webpack_require__) {
1511
+ const fs = __webpack_require__("fs?8b28");
1512
+ const sysPath = __webpack_require__("path?aeb1");
1513
+ const { promisify } = __webpack_require__("util");
1514
+ const isBinaryPath = __webpack_require__("../../node_modules/.pnpm/is-binary-path@2.1.0/node_modules/is-binary-path/index.js");
1515
+ const { isWindows, isLinux, EMPTY_FN, EMPTY_STR, KEY_LISTENERS, KEY_ERR, KEY_RAW, HANDLER_KEYS, EV_CHANGE, EV_ADD, EV_ADD_DIR, EV_ERROR, STR_DATA, STR_END, BRACE_START, STAR } = __webpack_require__("../../node_modules/.pnpm/chokidar@3.6.0/node_modules/chokidar/lib/constants.js");
1516
+ const THROTTLE_MODE_WATCH = 'watch';
1517
+ const open = promisify(fs.open);
1518
+ const stat = promisify(fs.stat);
1519
+ const lstat = promisify(fs.lstat);
1520
+ const close = promisify(fs.close);
1521
+ const fsrealpath = promisify(fs.realpath);
1522
+ const statMethods = {
1523
+ lstat,
1524
+ stat
1525
+ };
1526
+ const foreach = (val, fn)=>{
1527
+ if (val instanceof Set) val.forEach(fn);
1528
+ else fn(val);
1529
+ };
1530
+ const addAndConvert = (main, prop, item)=>{
1531
+ let container = main[prop];
1532
+ if (!(container instanceof Set)) main[prop] = container = new Set([
1533
+ container
1534
+ ]);
1535
+ container.add(item);
1536
+ };
1537
+ const clearItem = (cont)=>(key)=>{
1538
+ const set = cont[key];
1539
+ if (set instanceof Set) set.clear();
1540
+ else delete cont[key];
1541
+ };
1542
+ const delFromSet = (main, prop, item)=>{
1543
+ const container = main[prop];
1544
+ if (container instanceof Set) container.delete(item);
1545
+ else if (container === item) delete main[prop];
1546
+ };
1547
+ const isEmptySet = (val)=>val instanceof Set ? 0 === val.size : !val;
1548
+ const FsWatchInstances = new Map();
1549
+ function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
1550
+ const handleEvent = (rawEvent, evPath)=>{
1551
+ listener(path);
1552
+ emitRaw(rawEvent, evPath, {
1553
+ watchedPath: path
1554
+ });
1555
+ if (evPath && path !== evPath) fsWatchBroadcast(sysPath.resolve(path, evPath), KEY_LISTENERS, sysPath.join(path, evPath));
1556
+ };
1557
+ try {
1558
+ return fs.watch(path, options, handleEvent);
1559
+ } catch (error) {
1560
+ errHandler(error);
1561
+ }
1562
+ }
1563
+ const fsWatchBroadcast = (fullPath, type, val1, val2, val3)=>{
1564
+ const cont = FsWatchInstances.get(fullPath);
1565
+ if (!cont) return;
1566
+ foreach(cont[type], (listener)=>{
1567
+ listener(val1, val2, val3);
1568
+ });
1569
+ };
1570
+ const setFsWatchListener = (path, fullPath, options, handlers)=>{
1571
+ const { listener, errHandler, rawEmitter } = handlers;
1572
+ let cont = FsWatchInstances.get(fullPath);
1573
+ let watcher;
1574
+ if (!options.persistent) {
1575
+ watcher = createFsWatchInstance(path, options, listener, errHandler, rawEmitter);
1576
+ return watcher.close.bind(watcher);
1577
+ }
1578
+ if (cont) {
1579
+ addAndConvert(cont, KEY_LISTENERS, listener);
1580
+ addAndConvert(cont, KEY_ERR, errHandler);
1581
+ addAndConvert(cont, KEY_RAW, rawEmitter);
1582
+ } else {
1583
+ watcher = createFsWatchInstance(path, options, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, fsWatchBroadcast.bind(null, fullPath, KEY_RAW));
1584
+ if (!watcher) return;
1585
+ watcher.on(EV_ERROR, async (error)=>{
1586
+ const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
1587
+ cont.watcherUnusable = true;
1588
+ if (isWindows && 'EPERM' === error.code) try {
1589
+ const fd = await open(path, 'r');
1590
+ await close(fd);
1591
+ broadcastErr(error);
1592
+ } catch (err) {}
1593
+ else broadcastErr(error);
1594
+ });
1595
+ cont = {
1596
+ listeners: listener,
1597
+ errHandlers: errHandler,
1598
+ rawEmitters: rawEmitter,
1599
+ watcher
1600
+ };
1601
+ FsWatchInstances.set(fullPath, cont);
1602
+ }
1603
+ return ()=>{
1604
+ delFromSet(cont, KEY_LISTENERS, listener);
1605
+ delFromSet(cont, KEY_ERR, errHandler);
1606
+ delFromSet(cont, KEY_RAW, rawEmitter);
1607
+ if (isEmptySet(cont.listeners)) {
1608
+ cont.watcher.close();
1609
+ FsWatchInstances.delete(fullPath);
1610
+ HANDLER_KEYS.forEach(clearItem(cont));
1611
+ cont.watcher = void 0;
1612
+ Object.freeze(cont);
1613
+ }
1614
+ };
1615
+ };
1616
+ const FsWatchFileInstances = new Map();
1617
+ const setFsWatchFileListener = (path, fullPath, options, handlers)=>{
1618
+ const { listener, rawEmitter } = handlers;
1619
+ let cont = FsWatchFileInstances.get(fullPath);
1620
+ new Set();
1621
+ new Set();
1622
+ const copts = cont && cont.options;
1623
+ if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
1624
+ cont.listeners;
1625
+ cont.rawEmitters;
1626
+ fs.unwatchFile(fullPath);
1627
+ cont = void 0;
1628
+ }
1629
+ if (cont) {
1630
+ addAndConvert(cont, KEY_LISTENERS, listener);
1631
+ addAndConvert(cont, KEY_RAW, rawEmitter);
1632
+ } else {
1633
+ cont = {
1634
+ listeners: listener,
1635
+ rawEmitters: rawEmitter,
1636
+ options,
1637
+ watcher: fs.watchFile(fullPath, options, (curr, prev)=>{
1638
+ foreach(cont.rawEmitters, (rawEmitter)=>{
1639
+ rawEmitter(EV_CHANGE, fullPath, {
1640
+ curr,
1641
+ prev
1642
+ });
1643
+ });
1644
+ const currmtime = curr.mtimeMs;
1645
+ if (curr.size !== prev.size || currmtime > prev.mtimeMs || 0 === currmtime) foreach(cont.listeners, (listener)=>listener(path, curr));
1646
+ })
1647
+ };
1648
+ FsWatchFileInstances.set(fullPath, cont);
1649
+ }
1650
+ return ()=>{
1651
+ delFromSet(cont, KEY_LISTENERS, listener);
1652
+ delFromSet(cont, KEY_RAW, rawEmitter);
1653
+ if (isEmptySet(cont.listeners)) {
1654
+ FsWatchFileInstances.delete(fullPath);
1655
+ fs.unwatchFile(fullPath);
1656
+ cont.options = cont.watcher = void 0;
1657
+ Object.freeze(cont);
1658
+ }
1659
+ };
1660
+ };
1661
+ class NodeFsHandler {
1662
+ constructor(fsW){
1663
+ this.fsw = fsW;
1664
+ this._boundHandleError = (error)=>fsW._handleError(error);
1665
+ }
1666
+ _watchWithNodeFs(path, listener) {
1667
+ const opts = this.fsw.options;
1668
+ const directory = sysPath.dirname(path);
1669
+ const basename = sysPath.basename(path);
1670
+ const parent = this.fsw._getWatchedDir(directory);
1671
+ parent.add(basename);
1672
+ const absolutePath = sysPath.resolve(path);
1673
+ const options = {
1674
+ persistent: opts.persistent
1675
+ };
1676
+ if (!listener) listener = EMPTY_FN;
1677
+ let closer;
1678
+ if (opts.usePolling) {
1679
+ options.interval = opts.enableBinaryInterval && isBinaryPath(basename) ? opts.binaryInterval : opts.interval;
1680
+ closer = setFsWatchFileListener(path, absolutePath, options, {
1681
+ listener,
1682
+ rawEmitter: this.fsw._emitRaw
1683
+ });
1684
+ } else closer = setFsWatchListener(path, absolutePath, options, {
1685
+ listener,
1686
+ errHandler: this._boundHandleError,
1687
+ rawEmitter: this.fsw._emitRaw
1688
+ });
1689
+ return closer;
1690
+ }
1691
+ _handleFile(file, stats, initialAdd) {
1692
+ if (this.fsw.closed) return;
1693
+ const dirname = sysPath.dirname(file);
1694
+ const basename = sysPath.basename(file);
1695
+ const parent = this.fsw._getWatchedDir(dirname);
1696
+ let prevStats = stats;
1697
+ if (parent.has(basename)) return;
1698
+ const listener = async (path, newStats)=>{
1699
+ if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return;
1700
+ if (newStats && 0 !== newStats.mtimeMs) {
1701
+ if (parent.has(basename)) {
1702
+ const at = newStats.atimeMs;
1703
+ const mt = newStats.mtimeMs;
1704
+ if (!at || at <= mt || mt !== prevStats.mtimeMs) this.fsw._emit(EV_CHANGE, file, newStats);
1705
+ prevStats = newStats;
1706
+ }
1707
+ } else try {
1708
+ const newStats = await stat(file);
1709
+ if (this.fsw.closed) return;
1710
+ const at = newStats.atimeMs;
1711
+ const mt = newStats.mtimeMs;
1712
+ if (!at || at <= mt || mt !== prevStats.mtimeMs) this.fsw._emit(EV_CHANGE, file, newStats);
1713
+ if (isLinux && prevStats.ino !== newStats.ino) {
1714
+ this.fsw._closeFile(path);
1715
+ prevStats = newStats;
1716
+ this.fsw._addPathCloser(path, this._watchWithNodeFs(file, listener));
1717
+ } else prevStats = newStats;
1718
+ } catch (error) {
1719
+ this.fsw._remove(dirname, basename);
1720
+ }
1721
+ };
1722
+ const closer = this._watchWithNodeFs(file, listener);
1723
+ if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) {
1724
+ if (!this.fsw._throttle(EV_ADD, file, 0)) return;
1725
+ this.fsw._emit(EV_ADD, file, stats);
1726
+ }
1727
+ return closer;
1728
+ }
1729
+ async _handleSymlink(entry, directory, path, item) {
1730
+ if (this.fsw.closed) return;
1731
+ const full = entry.fullPath;
1732
+ const dir = this.fsw._getWatchedDir(directory);
1733
+ if (!this.fsw.options.followSymlinks) {
1734
+ this.fsw._incrReadyCount();
1735
+ let linkPath;
1736
+ try {
1737
+ linkPath = await fsrealpath(path);
1738
+ } catch (e) {
1739
+ this.fsw._emitReady();
1740
+ return true;
1741
+ }
1742
+ if (this.fsw.closed) return;
1743
+ if (dir.has(item)) {
1744
+ if (this.fsw._symlinkPaths.get(full) !== linkPath) {
1745
+ this.fsw._symlinkPaths.set(full, linkPath);
1746
+ this.fsw._emit(EV_CHANGE, path, entry.stats);
1747
+ }
1748
+ } else {
1749
+ dir.add(item);
1750
+ this.fsw._symlinkPaths.set(full, linkPath);
1751
+ this.fsw._emit(EV_ADD, path, entry.stats);
1752
+ }
1753
+ this.fsw._emitReady();
1754
+ return true;
1755
+ }
1756
+ if (this.fsw._symlinkPaths.has(full)) return true;
1757
+ this.fsw._symlinkPaths.set(full, true);
1758
+ }
1759
+ _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
1760
+ directory = sysPath.join(directory, EMPTY_STR);
1761
+ if (!wh.hasGlob) {
1762
+ throttler = this.fsw._throttle('readdir', directory, 1000);
1763
+ if (!throttler) return;
1764
+ }
1765
+ const previous = this.fsw._getWatchedDir(wh.path);
1766
+ const current = new Set();
1767
+ let stream = this.fsw._readdirp(directory, {
1768
+ fileFilter: (entry)=>wh.filterPath(entry),
1769
+ directoryFilter: (entry)=>wh.filterDir(entry),
1770
+ depth: 0
1771
+ }).on(STR_DATA, async (entry)=>{
1772
+ if (this.fsw.closed) {
1773
+ stream = void 0;
1774
+ return;
1775
+ }
1776
+ const item = entry.path;
1777
+ let path = sysPath.join(directory, item);
1778
+ current.add(item);
1779
+ if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) return;
1780
+ if (this.fsw.closed) {
1781
+ stream = void 0;
1782
+ return;
1783
+ }
1784
+ if (item === target || !target && !previous.has(item)) {
1785
+ this.fsw._incrReadyCount();
1786
+ path = sysPath.join(dir, sysPath.relative(dir, path));
1787
+ this._addToNodeFs(path, initialAdd, wh, depth + 1);
1788
+ }
1789
+ }).on(EV_ERROR, this._boundHandleError);
1790
+ return new Promise((resolve)=>stream.once(STR_END, ()=>{
1791
+ if (this.fsw.closed) {
1792
+ stream = void 0;
1793
+ return;
1794
+ }
1795
+ const wasThrottled = throttler ? throttler.clear() : false;
1796
+ resolve();
1797
+ previous.getChildren().filter((item)=>item !== directory && !current.has(item) && (!wh.hasGlob || wh.filterPath({
1798
+ fullPath: sysPath.resolve(directory, item)
1799
+ }))).forEach((item)=>{
1800
+ this.fsw._remove(directory, item);
1801
+ });
1802
+ stream = void 0;
1803
+ if (wasThrottled) this._handleRead(directory, false, wh, target, dir, depth, throttler);
1804
+ }));
1805
+ }
1806
+ async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {
1807
+ const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir));
1808
+ const tracked = parentDir.has(sysPath.basename(dir));
1809
+ if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
1810
+ if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR, dir, stats);
1811
+ }
1812
+ parentDir.add(sysPath.basename(dir));
1813
+ this.fsw._getWatchedDir(dir);
1814
+ let throttler;
1815
+ let closer;
1816
+ const oDepth = this.fsw.options.depth;
1817
+ if ((null == oDepth || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) {
1818
+ if (!target) {
1819
+ await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler);
1820
+ if (this.fsw.closed) return;
1821
+ }
1822
+ closer = this._watchWithNodeFs(dir, (dirPath, stats)=>{
1823
+ if (stats && 0 === stats.mtimeMs) return;
1824
+ this._handleRead(dirPath, false, wh, target, dir, depth, throttler);
1825
+ });
1826
+ }
1827
+ return closer;
1828
+ }
1829
+ async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
1830
+ const ready = this.fsw._emitReady;
1831
+ if (this.fsw._isIgnored(path) || this.fsw.closed) {
1832
+ ready();
1833
+ return false;
1834
+ }
1835
+ const wh = this.fsw._getWatchHelpers(path, depth);
1836
+ if (!wh.hasGlob && priorWh) {
1837
+ wh.hasGlob = priorWh.hasGlob;
1838
+ wh.globFilter = priorWh.globFilter;
1839
+ wh.filterPath = (entry)=>priorWh.filterPath(entry);
1840
+ wh.filterDir = (entry)=>priorWh.filterDir(entry);
1841
+ }
1842
+ try {
1843
+ const stats = await statMethods[wh.statMethod](wh.watchPath);
1844
+ if (this.fsw.closed) return;
1845
+ if (this.fsw._isIgnored(wh.watchPath, stats)) {
1846
+ ready();
1847
+ return false;
1848
+ }
1849
+ const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START);
1850
+ let closer;
1851
+ if (stats.isDirectory()) {
1852
+ const absPath = sysPath.resolve(path);
1853
+ const targetPath = follow ? await fsrealpath(path) : path;
1854
+ if (this.fsw.closed) return;
1855
+ closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
1856
+ if (this.fsw.closed) return;
1857
+ if (absPath !== targetPath && void 0 !== targetPath) this.fsw._symlinkPaths.set(absPath, targetPath);
1858
+ } else if (stats.isSymbolicLink()) {
1859
+ const targetPath = follow ? await fsrealpath(path) : path;
1860
+ if (this.fsw.closed) return;
1861
+ const parent = sysPath.dirname(wh.watchPath);
1862
+ this.fsw._getWatchedDir(parent).add(wh.watchPath);
1863
+ this.fsw._emit(EV_ADD, wh.watchPath, stats);
1864
+ closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath);
1865
+ if (this.fsw.closed) return;
1866
+ if (void 0 !== targetPath) this.fsw._symlinkPaths.set(sysPath.resolve(path), targetPath);
1867
+ } else closer = this._handleFile(wh.watchPath, stats, initialAdd);
1868
+ ready();
1869
+ this.fsw._addPathCloser(path, closer);
1870
+ return false;
1871
+ } catch (error) {
1872
+ if (this.fsw._handleError(error)) {
1873
+ ready();
1874
+ return path;
1875
+ }
1876
+ }
1877
+ }
1878
+ }
1879
+ module.exports = NodeFsHandler;
1880
+ },
1881
+ "../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js" (module, __unused_rspack_exports, __webpack_require__) {
1882
+ /*!
1883
+ * fill-range <https://github.com/jonschlinkert/fill-range>
1884
+ *
1885
+ * Copyright (c) 2014-present, Jon Schlinkert.
1886
+ * Licensed under the MIT License.
1887
+ */ const util = __webpack_require__("util");
1888
+ const toRegexRange = __webpack_require__("../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js");
1889
+ const isObject = (val)=>null !== val && 'object' == typeof val && !Array.isArray(val);
1890
+ const transform = (toNumber)=>(value)=>true === toNumber ? Number(value) : String(value);
1891
+ const isValidValue = (value)=>'number' == typeof value || 'string' == typeof value && '' !== value;
1892
+ const isNumber = (num)=>Number.isInteger(+num);
1893
+ const zeros = (input)=>{
1894
+ let value = `${input}`;
1895
+ let index = -1;
1896
+ if ('-' === value[0]) value = value.slice(1);
1897
+ if ('0' === value) return false;
1898
+ while('0' === value[++index]);
1899
+ return index > 0;
1900
+ };
1901
+ const stringify = (start, end, options)=>{
1902
+ if ('string' == typeof start || 'string' == typeof end) return true;
1903
+ return true === options.stringify;
1904
+ };
1905
+ const pad = (input, maxLength, toNumber)=>{
1906
+ if (maxLength > 0) {
1907
+ let dash = '-' === input[0] ? '-' : '';
1908
+ if (dash) input = input.slice(1);
1909
+ input = dash + input.padStart(dash ? maxLength - 1 : maxLength, '0');
1910
+ }
1911
+ if (false === toNumber) return String(input);
1912
+ return input;
1913
+ };
1914
+ const toMaxLen = (input, maxLength)=>{
1915
+ let negative = '-' === input[0] ? '-' : '';
1916
+ if (negative) {
1917
+ input = input.slice(1);
1918
+ maxLength--;
1919
+ }
1920
+ while(input.length < maxLength)input = '0' + input;
1921
+ return negative ? '-' + input : input;
1922
+ };
1923
+ const toSequence = (parts, options, maxLen)=>{
1924
+ parts.negatives.sort((a, b)=>a < b ? -1 : a > b ? 1 : 0);
1925
+ parts.positives.sort((a, b)=>a < b ? -1 : a > b ? 1 : 0);
1926
+ let prefix = options.capture ? '' : '?:';
1927
+ let positives = '';
1928
+ let negatives = '';
1929
+ let result;
1930
+ if (parts.positives.length) positives = parts.positives.map((v)=>toMaxLen(String(v), maxLen)).join('|');
1931
+ if (parts.negatives.length) negatives = `-(${prefix}${parts.negatives.map((v)=>toMaxLen(String(v), maxLen)).join('|')})`;
1932
+ result = positives && negatives ? `${positives}|${negatives}` : positives || negatives;
1933
+ if (options.wrap) return `(${prefix}${result})`;
1934
+ return result;
1935
+ };
1936
+ const toRange = (a, b, isNumbers, options)=>{
1937
+ if (isNumbers) return toRegexRange(a, b, {
1938
+ wrap: false,
1939
+ ...options
1940
+ });
1941
+ let start = String.fromCharCode(a);
1942
+ if (a === b) return start;
1943
+ let stop = String.fromCharCode(b);
1944
+ return `[${start}-${stop}]`;
1945
+ };
1946
+ const toRegex = (start, end, options)=>{
1947
+ if (Array.isArray(start)) {
1948
+ let wrap = true === options.wrap;
1949
+ let prefix = options.capture ? '' : '?:';
1950
+ return wrap ? `(${prefix}${start.join('|')})` : start.join('|');
1951
+ }
1952
+ return toRegexRange(start, end, options);
1953
+ };
1954
+ const rangeError = (...args)=>new RangeError('Invalid range arguments: ' + util.inspect(...args));
1955
+ const invalidRange = (start, end, options)=>{
1956
+ if (true === options.strictRanges) throw rangeError([
1957
+ start,
1958
+ end
1959
+ ]);
1960
+ return [];
1961
+ };
1962
+ const invalidStep = (step, options)=>{
1963
+ if (true === options.strictRanges) throw new TypeError(`Expected step "${step}" to be a number`);
1964
+ return [];
1965
+ };
1966
+ const fillNumbers = (start, end, step = 1, options = {})=>{
1967
+ let a = Number(start);
1968
+ let b = Number(end);
1969
+ if (!Number.isInteger(a) || !Number.isInteger(b)) {
1970
+ if (true === options.strictRanges) throw rangeError([
1971
+ start,
1972
+ end
1973
+ ]);
1974
+ return [];
1975
+ }
1976
+ if (0 === a) a = 0;
1977
+ if (0 === b) b = 0;
1978
+ let descending = a > b;
1979
+ let startString = String(start);
1980
+ let endString = String(end);
1981
+ let stepString = String(step);
1982
+ step = Math.max(Math.abs(step), 1);
1983
+ let padded = zeros(startString) || zeros(endString) || zeros(stepString);
1984
+ let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
1985
+ let toNumber = false === padded && false === stringify(start, end, options);
1986
+ let format = options.transform || transform(toNumber);
1987
+ if (options.toRegex && 1 === step) return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
1988
+ let parts = {
1989
+ negatives: [],
1990
+ positives: []
1991
+ };
1992
+ let push = (num)=>parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num));
1993
+ let range = [];
1994
+ let index = 0;
1995
+ while(descending ? a >= b : a <= b){
1996
+ if (true === options.toRegex && step > 1) push(a);
1997
+ else range.push(pad(format(a, index), maxLen, toNumber));
1998
+ a = descending ? a - step : a + step;
1999
+ index++;
2000
+ }
2001
+ if (true === options.toRegex) return step > 1 ? toSequence(parts, options, maxLen) : toRegex(range, null, {
2002
+ wrap: false,
2003
+ ...options
2004
+ });
2005
+ return range;
2006
+ };
2007
+ const fillLetters = (start, end, step = 1, options = {})=>{
2008
+ if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) return invalidRange(start, end, options);
2009
+ let format = options.transform || ((val)=>String.fromCharCode(val));
2010
+ let a = `${start}`.charCodeAt(0);
2011
+ let b = `${end}`.charCodeAt(0);
2012
+ let descending = a > b;
2013
+ let min = Math.min(a, b);
2014
+ let max = Math.max(a, b);
2015
+ if (options.toRegex && 1 === step) return toRange(min, max, false, options);
2016
+ let range = [];
2017
+ let index = 0;
2018
+ while(descending ? a >= b : a <= b){
2019
+ range.push(format(a, index));
2020
+ a = descending ? a - step : a + step;
2021
+ index++;
2022
+ }
2023
+ if (true === options.toRegex) return toRegex(range, null, {
2024
+ wrap: false,
2025
+ options
2026
+ });
2027
+ return range;
2028
+ };
2029
+ const fill = (start, end, step, options = {})=>{
2030
+ if (null == end && isValidValue(start)) return [
2031
+ start
2032
+ ];
2033
+ if (!isValidValue(start) || !isValidValue(end)) return invalidRange(start, end, options);
2034
+ if ('function' == typeof step) return fill(start, end, 1, {
2035
+ transform: step
2036
+ });
2037
+ if (isObject(step)) return fill(start, end, 0, step);
2038
+ let opts = {
2039
+ ...options
2040
+ };
2041
+ if (true === opts.capture) opts.wrap = true;
2042
+ step = step || opts.step || 1;
2043
+ if (!isNumber(step)) {
2044
+ if (null != step && !isObject(step)) return invalidStep(step, opts);
2045
+ return fill(start, end, 1, step);
2046
+ }
2047
+ if (isNumber(start) && isNumber(end)) return fillNumbers(start, end, step, opts);
2048
+ return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
2049
+ };
2050
+ module.exports = fill;
2051
+ },
2052
+ "../../node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.js" (module, __unused_rspack_exports, __webpack_require__) {
2053
+ var isGlob = __webpack_require__("../../node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.js");
2054
+ var pathPosixDirname = __webpack_require__("path?aeb1").posix.dirname;
2055
+ var isWin32 = 'win32' === __webpack_require__("os").platform();
2056
+ var slash = '/';
2057
+ var backslash = /\\/g;
2058
+ var enclosure = /[\{\[].*[\}\]]$/;
2059
+ var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
2060
+ var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
2061
+ module.exports = function(str, opts) {
2062
+ var options = Object.assign({
2063
+ flipBackslashes: true
2064
+ }, opts);
2065
+ if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) str = str.replace(backslash, slash);
2066
+ if (enclosure.test(str)) str += slash;
2067
+ str += 'a';
2068
+ do str = pathPosixDirname(str);
2069
+ while (isGlob(str) || globby.test(str));
2070
+ return str.replace(escaped, '$1');
2071
+ };
2072
+ },
2073
+ "../../node_modules/.pnpm/is-binary-path@2.1.0/node_modules/is-binary-path/index.js" (module, __unused_rspack_exports, __webpack_require__) {
2074
+ const path = __webpack_require__("path?aeb1");
2075
+ const binaryExtensions = __webpack_require__("../../node_modules/.pnpm/binary-extensions@2.3.0/node_modules/binary-extensions/index.js");
2076
+ const extensions = new Set(binaryExtensions);
2077
+ module.exports = (filePath)=>extensions.has(path.extname(filePath).slice(1).toLowerCase());
2078
+ },
2079
+ "../../node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.js" (module) {
2080
+ /*!
2081
+ * is-extglob <https://github.com/jonschlinkert/is-extglob>
2082
+ *
2083
+ * Copyright (c) 2014-2016, Jon Schlinkert.
2084
+ * Licensed under the MIT License.
2085
+ */ module.exports = function(str) {
2086
+ if ('string' != typeof str || '' === str) return false;
2087
+ var match;
2088
+ while(match = /(\\).|([@?!+*]\(.*\))/g.exec(str)){
2089
+ if (match[2]) return true;
2090
+ str = str.slice(match.index + match[0].length);
2091
+ }
2092
+ return false;
2093
+ };
2094
+ },
2095
+ "../../node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.js" (module, __unused_rspack_exports, __webpack_require__) {
2096
+ /*!
2097
+ * is-glob <https://github.com/jonschlinkert/is-glob>
2098
+ *
2099
+ * Copyright (c) 2014-2017, Jon Schlinkert.
2100
+ * Released under the MIT License.
2101
+ */ var isExtglob = __webpack_require__("../../node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.js");
2102
+ var chars = {
2103
+ '{': '}',
2104
+ '(': ')',
2105
+ '[': ']'
2106
+ };
2107
+ var strictCheck = function(str) {
2108
+ if ('!' === str[0]) return true;
2109
+ var index = 0;
2110
+ var pipeIndex = -2;
2111
+ var closeSquareIndex = -2;
2112
+ var closeCurlyIndex = -2;
2113
+ var closeParenIndex = -2;
2114
+ var backSlashIndex = -2;
2115
+ while(index < str.length){
2116
+ if ('*' === str[index]) return true;
2117
+ if ('?' === str[index + 1] && /[\].+)]/.test(str[index])) return true;
2118
+ if (-1 !== closeSquareIndex && '[' === str[index] && ']' !== str[index + 1]) {
2119
+ if (closeSquareIndex < index) closeSquareIndex = str.indexOf(']', index);
2120
+ if (closeSquareIndex > index) {
2121
+ if (-1 === backSlashIndex || backSlashIndex > closeSquareIndex) return true;
2122
+ backSlashIndex = str.indexOf('\\', index);
2123
+ if (-1 === backSlashIndex || backSlashIndex > closeSquareIndex) return true;
2124
+ }
2125
+ }
2126
+ if (-1 !== closeCurlyIndex && '{' === str[index] && '}' !== str[index + 1]) {
2127
+ closeCurlyIndex = str.indexOf('}', index);
2128
+ if (closeCurlyIndex > index) {
2129
+ backSlashIndex = str.indexOf('\\', index);
2130
+ if (-1 === backSlashIndex || backSlashIndex > closeCurlyIndex) return true;
2131
+ }
2132
+ }
2133
+ if (-1 !== closeParenIndex && '(' === str[index] && '?' === str[index + 1] && /[:!=]/.test(str[index + 2]) && ')' !== str[index + 3]) {
2134
+ closeParenIndex = str.indexOf(')', index);
2135
+ if (closeParenIndex > index) {
2136
+ backSlashIndex = str.indexOf('\\', index);
2137
+ if (-1 === backSlashIndex || backSlashIndex > closeParenIndex) return true;
2138
+ }
2139
+ }
2140
+ if (-1 !== pipeIndex && '(' === str[index] && '|' !== str[index + 1]) {
2141
+ if (pipeIndex < index) pipeIndex = str.indexOf('|', index);
2142
+ if (-1 !== pipeIndex && ')' !== str[pipeIndex + 1]) {
2143
+ closeParenIndex = str.indexOf(')', pipeIndex);
2144
+ if (closeParenIndex > pipeIndex) {
2145
+ backSlashIndex = str.indexOf('\\', pipeIndex);
2146
+ if (-1 === backSlashIndex || backSlashIndex > closeParenIndex) return true;
2147
+ }
2148
+ }
2149
+ }
2150
+ if ('\\' === str[index]) {
2151
+ var open = str[index + 1];
2152
+ index += 2;
2153
+ var close = chars[open];
2154
+ if (close) {
2155
+ var n = str.indexOf(close, index);
2156
+ if (-1 !== n) index = n + 1;
2157
+ }
2158
+ if ('!' === str[index]) return true;
2159
+ } else index++;
2160
+ }
2161
+ return false;
2162
+ };
2163
+ var relaxedCheck = function(str) {
2164
+ if ('!' === str[0]) return true;
2165
+ var index = 0;
2166
+ while(index < str.length){
2167
+ if (/[*?{}()[\]]/.test(str[index])) return true;
2168
+ if ('\\' === str[index]) {
2169
+ var open = str[index + 1];
2170
+ index += 2;
2171
+ var close = chars[open];
2172
+ if (close) {
2173
+ var n = str.indexOf(close, index);
2174
+ if (-1 !== n) index = n + 1;
2175
+ }
2176
+ if ('!' === str[index]) return true;
2177
+ } else index++;
2178
+ }
2179
+ return false;
2180
+ };
2181
+ module.exports = function(str, options) {
2182
+ if ('string' != typeof str || '' === str) return false;
2183
+ if (isExtglob(str)) return true;
2184
+ var check = strictCheck;
2185
+ if (options && false === options.strict) check = relaxedCheck;
2186
+ return check(str);
2187
+ };
2188
+ },
2189
+ "../../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.js" (module) {
2190
+ /*!
2191
+ * is-number <https://github.com/jonschlinkert/is-number>
2192
+ *
2193
+ * Copyright (c) 2014-present, Jon Schlinkert.
2194
+ * Released under the MIT License.
2195
+ */ module.exports = function(num) {
2196
+ if ('number' == typeof num) return num - num === 0;
2197
+ if ('string' == typeof num && '' !== num.trim()) return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
2198
+ return false;
2199
+ };
2200
+ },
2201
+ "../../node_modules/.pnpm/normalize-path@3.0.0/node_modules/normalize-path/index.js" (module) {
2202
+ /*!
2203
+ * normalize-path <https://github.com/jonschlinkert/normalize-path>
2204
+ *
2205
+ * Copyright (c) 2014-2018, Jon Schlinkert.
2206
+ * Released under the MIT License.
2207
+ */ module.exports = function(path, stripTrailing) {
2208
+ if ('string' != typeof path) throw new TypeError('expected path to be a string');
2209
+ if ('\\' === path || '/' === path) return '/';
2210
+ var len = path.length;
2211
+ if (len <= 1) return path;
2212
+ var prefix = '';
2213
+ if (len > 4 && '\\' === path[3]) {
2214
+ var ch = path[2];
2215
+ if (('?' === ch || '.' === ch) && '\\\\' === path.slice(0, 2)) {
2216
+ path = path.slice(2);
2217
+ prefix = '//';
2218
+ }
2219
+ }
2220
+ var segs = path.split(/[/\\]+/);
2221
+ if (false !== stripTrailing && '' === segs[segs.length - 1]) segs.pop();
2222
+ return prefix + segs.join('/');
2223
+ };
2224
+ },
2225
+ "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/index.js" (module, __unused_rspack_exports, __webpack_require__) {
2226
+ module.exports = __webpack_require__("../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js");
2227
+ },
2228
+ "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/constants.js" (module, __unused_rspack_exports, __webpack_require__) {
2229
+ const path = __webpack_require__("path?aeb1");
2230
+ const WIN_SLASH = '\\\\/';
2231
+ const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
2232
+ const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
2233
+ const DOT_LITERAL = '\\.';
2234
+ const PLUS_LITERAL = '\\+';
2235
+ const QMARK_LITERAL = '\\?';
2236
+ const SLASH_LITERAL = '\\/';
2237
+ const ONE_CHAR = '(?=.)';
2238
+ const QMARK = '[^/]';
2239
+ const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
2240
+ const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
2241
+ const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
2242
+ const NO_DOT = `(?!${DOT_LITERAL})`;
2243
+ const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
2244
+ const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
2245
+ const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
2246
+ const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
2247
+ const STAR = `${QMARK}*?`;
2248
+ const POSIX_CHARS = {
2249
+ DOT_LITERAL,
2250
+ PLUS_LITERAL,
2251
+ QMARK_LITERAL,
2252
+ SLASH_LITERAL,
2253
+ ONE_CHAR,
2254
+ QMARK,
2255
+ END_ANCHOR,
2256
+ DOTS_SLASH,
2257
+ NO_DOT,
2258
+ NO_DOTS,
2259
+ NO_DOT_SLASH,
2260
+ NO_DOTS_SLASH,
2261
+ QMARK_NO_DOT,
2262
+ STAR,
2263
+ START_ANCHOR
2264
+ };
2265
+ const WINDOWS_CHARS = {
2266
+ ...POSIX_CHARS,
2267
+ SLASH_LITERAL: `[${WIN_SLASH}]`,
2268
+ QMARK: WIN_NO_SLASH,
2269
+ STAR: `${WIN_NO_SLASH}*?`,
2270
+ DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
2271
+ NO_DOT: `(?!${DOT_LITERAL})`,
2272
+ NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
2273
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
2274
+ NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
2275
+ QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
2276
+ START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
2277
+ END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
2278
+ };
2279
+ const POSIX_REGEX_SOURCE = {
2280
+ __proto__: null,
2281
+ alnum: 'a-zA-Z0-9',
2282
+ alpha: 'a-zA-Z',
2283
+ ascii: '\\x00-\\x7F',
2284
+ blank: ' \\t',
2285
+ cntrl: '\\x00-\\x1F\\x7F',
2286
+ digit: '0-9',
2287
+ graph: '\\x21-\\x7E',
2288
+ lower: 'a-z',
2289
+ print: '\\x20-\\x7E ',
2290
+ punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
2291
+ space: ' \\t\\r\\n\\v\\f',
2292
+ upper: 'A-Z',
2293
+ word: 'A-Za-z0-9_',
2294
+ xdigit: 'A-Fa-f0-9'
2295
+ };
2296
+ module.exports = {
2297
+ DEFAULT_MAX_EXTGLOB_RECURSION,
2298
+ MAX_LENGTH: 65536,
2299
+ POSIX_REGEX_SOURCE,
2300
+ REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
2301
+ REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
2302
+ REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
2303
+ REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
2304
+ REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
2305
+ REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
2306
+ REPLACEMENTS: {
2307
+ __proto__: null,
2308
+ '***': '*',
2309
+ '**/**': '**',
2310
+ '**/**/**': '**'
2311
+ },
2312
+ CHAR_0: 48,
2313
+ CHAR_9: 57,
2314
+ CHAR_UPPERCASE_A: 65,
2315
+ CHAR_LOWERCASE_A: 97,
2316
+ CHAR_UPPERCASE_Z: 90,
2317
+ CHAR_LOWERCASE_Z: 122,
2318
+ CHAR_LEFT_PARENTHESES: 40,
2319
+ CHAR_RIGHT_PARENTHESES: 41,
2320
+ CHAR_ASTERISK: 42,
2321
+ CHAR_AMPERSAND: 38,
2322
+ CHAR_AT: 64,
2323
+ CHAR_BACKWARD_SLASH: 92,
2324
+ CHAR_CARRIAGE_RETURN: 13,
2325
+ CHAR_CIRCUMFLEX_ACCENT: 94,
2326
+ CHAR_COLON: 58,
2327
+ CHAR_COMMA: 44,
2328
+ CHAR_DOT: 46,
2329
+ CHAR_DOUBLE_QUOTE: 34,
2330
+ CHAR_EQUAL: 61,
2331
+ CHAR_EXCLAMATION_MARK: 33,
2332
+ CHAR_FORM_FEED: 12,
2333
+ CHAR_FORWARD_SLASH: 47,
2334
+ CHAR_GRAVE_ACCENT: 96,
2335
+ CHAR_HASH: 35,
2336
+ CHAR_HYPHEN_MINUS: 45,
2337
+ CHAR_LEFT_ANGLE_BRACKET: 60,
2338
+ CHAR_LEFT_CURLY_BRACE: 123,
2339
+ CHAR_LEFT_SQUARE_BRACKET: 91,
2340
+ CHAR_LINE_FEED: 10,
2341
+ CHAR_NO_BREAK_SPACE: 160,
2342
+ CHAR_PERCENT: 37,
2343
+ CHAR_PLUS: 43,
2344
+ CHAR_QUESTION_MARK: 63,
2345
+ CHAR_RIGHT_ANGLE_BRACKET: 62,
2346
+ CHAR_RIGHT_CURLY_BRACE: 125,
2347
+ CHAR_RIGHT_SQUARE_BRACKET: 93,
2348
+ CHAR_SEMICOLON: 59,
2349
+ CHAR_SINGLE_QUOTE: 39,
2350
+ CHAR_SPACE: 32,
2351
+ CHAR_TAB: 9,
2352
+ CHAR_UNDERSCORE: 95,
2353
+ CHAR_VERTICAL_LINE: 124,
2354
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
2355
+ SEP: path.sep,
2356
+ extglobChars (chars) {
2357
+ return {
2358
+ '!': {
2359
+ type: 'negate',
2360
+ open: '(?:(?!(?:',
2361
+ close: `))${chars.STAR})`
2362
+ },
2363
+ '?': {
2364
+ type: 'qmark',
2365
+ open: '(?:',
2366
+ close: ')?'
2367
+ },
2368
+ '+': {
2369
+ type: 'plus',
2370
+ open: '(?:',
2371
+ close: ')+'
2372
+ },
2373
+ '*': {
2374
+ type: 'star',
2375
+ open: '(?:',
2376
+ close: ')*'
2377
+ },
2378
+ '@': {
2379
+ type: 'at',
2380
+ open: '(?:',
2381
+ close: ')'
2382
+ }
2383
+ };
2384
+ },
2385
+ globChars (win32) {
2386
+ return true === win32 ? WINDOWS_CHARS : POSIX_CHARS;
2387
+ }
2388
+ };
2389
+ },
2390
+ "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/parse.js" (module, __unused_rspack_exports, __webpack_require__) {
2391
+ const constants = __webpack_require__("../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/constants.js");
2392
+ const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/utils.js");
2393
+ const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants;
2394
+ const expandRange = (args, options)=>{
2395
+ if ('function' == typeof options.expandRange) return options.expandRange(...args, options);
2396
+ args.sort();
2397
+ const value = `[${args.join('-')}]`;
2398
+ try {
2399
+ new RegExp(value);
2400
+ } catch (ex) {
2401
+ return args.map((v)=>utils.escapeRegex(v)).join('..');
2402
+ }
2403
+ return value;
2404
+ };
2405
+ const syntaxError = (type, char)=>`Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
2406
+ const splitTopLevel = (input)=>{
2407
+ const parts = [];
2408
+ let bracket = 0;
2409
+ let paren = 0;
2410
+ let quote = 0;
2411
+ let value = '';
2412
+ let escaped = false;
2413
+ for (const ch of input){
2414
+ if (true === escaped) {
2415
+ value += ch;
2416
+ escaped = false;
2417
+ continue;
2418
+ }
2419
+ if ('\\' === ch) {
2420
+ value += ch;
2421
+ escaped = true;
2422
+ continue;
2423
+ }
2424
+ if ('"' === ch) {
2425
+ quote = 1 === quote ? 0 : 1;
2426
+ value += ch;
2427
+ continue;
2428
+ }
2429
+ if (0 === quote) {
2430
+ if ('[' === ch) bracket++;
2431
+ else if (']' === ch && bracket > 0) bracket--;
2432
+ else if (0 === bracket) {
2433
+ if ('(' === ch) paren++;
2434
+ else if (')' === ch && paren > 0) paren--;
2435
+ else if ('|' === ch && 0 === paren) {
2436
+ parts.push(value);
2437
+ value = '';
2438
+ continue;
2439
+ }
2440
+ }
2441
+ }
2442
+ value += ch;
2443
+ }
2444
+ parts.push(value);
2445
+ return parts;
2446
+ };
2447
+ const isPlainBranch = (branch)=>{
2448
+ let escaped = false;
2449
+ for (const ch of branch){
2450
+ if (true === escaped) {
2451
+ escaped = false;
2452
+ continue;
2453
+ }
2454
+ if ('\\' === ch) {
2455
+ escaped = true;
2456
+ continue;
2457
+ }
2458
+ if (/[?*+@!()[\]{}]/.test(ch)) return false;
2459
+ }
2460
+ return true;
2461
+ };
2462
+ const normalizeSimpleBranch = (branch)=>{
2463
+ let value = branch.trim();
2464
+ let changed = true;
2465
+ while(true === changed){
2466
+ changed = false;
2467
+ if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
2468
+ value = value.slice(2, -1);
2469
+ changed = true;
2470
+ }
2471
+ }
2472
+ if (!isPlainBranch(value)) return;
2473
+ return value.replace(/\\(.)/g, '$1');
2474
+ };
2475
+ const hasRepeatedCharPrefixOverlap = (branches)=>{
2476
+ const values = branches.map(normalizeSimpleBranch).filter(Boolean);
2477
+ for(let i = 0; i < values.length; i++)for(let j = i + 1; j < values.length; j++){
2478
+ const a = values[i];
2479
+ const b = values[j];
2480
+ const char = a[0];
2481
+ if (char && a === char.repeat(a.length) && b === char.repeat(b.length)) {
2482
+ if (a === b || a.startsWith(b) || b.startsWith(a)) return true;
2483
+ }
2484
+ }
2485
+ return false;
2486
+ };
2487
+ const parseRepeatedExtglob = (pattern, requireEnd = true)=>{
2488
+ if ('+' !== pattern[0] && '*' !== pattern[0] || '(' !== pattern[1]) return;
2489
+ let bracket = 0;
2490
+ let paren = 0;
2491
+ let quote = 0;
2492
+ let escaped = false;
2493
+ for(let i = 1; i < pattern.length; i++){
2494
+ const ch = pattern[i];
2495
+ if (true === escaped) {
2496
+ escaped = false;
2497
+ continue;
2498
+ }
2499
+ if ('\\' === ch) {
2500
+ escaped = true;
2501
+ continue;
2502
+ }
2503
+ if ('"' === ch) {
2504
+ quote = 1 === quote ? 0 : 1;
2505
+ continue;
2506
+ }
2507
+ if (1 !== quote) {
2508
+ if ('[' === ch) {
2509
+ bracket++;
2510
+ continue;
2511
+ }
2512
+ if (']' === ch && bracket > 0) {
2513
+ bracket--;
2514
+ continue;
2515
+ }
2516
+ if (!(bracket > 0)) {
2517
+ if ('(' === ch) {
2518
+ paren++;
2519
+ continue;
2520
+ }
2521
+ if (')' === ch) {
2522
+ paren--;
2523
+ if (0 === paren) {
2524
+ if (true === requireEnd && i !== pattern.length - 1) return;
2525
+ return {
2526
+ type: pattern[0],
2527
+ body: pattern.slice(2, i),
2528
+ end: i
2529
+ };
2530
+ }
2531
+ }
2532
+ }
2533
+ }
2534
+ }
2535
+ };
2536
+ const getStarExtglobSequenceOutput = (pattern)=>{
2537
+ let index = 0;
2538
+ const chars = [];
2539
+ while(index < pattern.length){
2540
+ const match = parseRepeatedExtglob(pattern.slice(index), false);
2541
+ if (!match || '*' !== match.type) return;
2542
+ const branches = splitTopLevel(match.body).map((branch)=>branch.trim());
2543
+ if (1 !== branches.length) return;
2544
+ const branch = normalizeSimpleBranch(branches[0]);
2545
+ if (!branch || 1 !== branch.length) return;
2546
+ chars.push(branch);
2547
+ index += match.end + 1;
2548
+ }
2549
+ if (chars.length < 1) return;
2550
+ const source = 1 === chars.length ? utils.escapeRegex(chars[0]) : `[${chars.map((ch)=>utils.escapeRegex(ch)).join('')}]`;
2551
+ return `${source}*`;
2552
+ };
2553
+ const repeatedExtglobRecursion = (pattern)=>{
2554
+ let depth = 0;
2555
+ let value = pattern.trim();
2556
+ let match = parseRepeatedExtglob(value);
2557
+ while(match){
2558
+ depth++;
2559
+ value = match.body.trim();
2560
+ match = parseRepeatedExtglob(value);
2561
+ }
2562
+ return depth;
2563
+ };
2564
+ const analyzeRepeatedExtglob = (body, options)=>{
2565
+ if (false === options.maxExtglobRecursion) return {
2566
+ risky: false
2567
+ };
2568
+ const max = 'number' == typeof options.maxExtglobRecursion ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
2569
+ const branches = splitTopLevel(body).map((branch)=>branch.trim());
2570
+ if (branches.length > 1) {
2571
+ if (branches.some((branch)=>'' === branch) || branches.some((branch)=>/^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) return {
2572
+ risky: true
2573
+ };
2574
+ }
2575
+ for (const branch of branches){
2576
+ const safeOutput = getStarExtglobSequenceOutput(branch);
2577
+ if (safeOutput) return {
2578
+ risky: true,
2579
+ safeOutput
2580
+ };
2581
+ if (repeatedExtglobRecursion(branch) > max) return {
2582
+ risky: true
2583
+ };
2584
+ }
2585
+ return {
2586
+ risky: false
2587
+ };
2588
+ };
2589
+ const parse = (input, options)=>{
2590
+ if ('string' != typeof input) throw new TypeError('Expected a string');
2591
+ input = REPLACEMENTS[input] || input;
2592
+ const opts = {
2593
+ ...options
2594
+ };
2595
+ const max = 'number' == typeof opts.maxLength ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
2596
+ let len = input.length;
2597
+ if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
2598
+ const bos = {
2599
+ type: 'bos',
2600
+ value: '',
2601
+ output: opts.prepend || ''
2602
+ };
2603
+ const tokens = [
2604
+ bos
2605
+ ];
2606
+ const capture = opts.capture ? '' : '?:';
2607
+ const win32 = utils.isWindows(options);
2608
+ const PLATFORM_CHARS = constants.globChars(win32);
2609
+ const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
2610
+ 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;
2611
+ const globstar = (opts)=>`(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
2612
+ const nodot = opts.dot ? '' : NO_DOT;
2613
+ const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
2614
+ let star = true === opts.bash ? globstar(opts) : STAR;
2615
+ if (opts.capture) star = `(${star})`;
2616
+ if ('boolean' == typeof opts.noext) opts.noextglob = opts.noext;
2617
+ const state = {
2618
+ input,
2619
+ index: -1,
2620
+ start: 0,
2621
+ dot: true === opts.dot,
2622
+ consumed: '',
2623
+ output: '',
2624
+ prefix: '',
2625
+ backtrack: false,
2626
+ negated: false,
2627
+ brackets: 0,
2628
+ braces: 0,
2629
+ parens: 0,
2630
+ quotes: 0,
2631
+ globstar: false,
2632
+ tokens
2633
+ };
2634
+ input = utils.removePrefix(input, state);
2635
+ len = input.length;
2636
+ const extglobs = [];
2637
+ const braces = [];
2638
+ const stack = [];
2639
+ let prev = bos;
2640
+ let value;
2641
+ const eos = ()=>state.index === len - 1;
2642
+ const peek = state.peek = (n = 1)=>input[state.index + n];
2643
+ const advance = state.advance = ()=>input[++state.index] || '';
2644
+ const remaining = ()=>input.slice(state.index + 1);
2645
+ const consume = (value = '', num = 0)=>{
2646
+ state.consumed += value;
2647
+ state.index += num;
2648
+ };
2649
+ const append = (token)=>{
2650
+ state.output += null != token.output ? token.output : token.value;
2651
+ consume(token.value);
2652
+ };
2653
+ const negate = ()=>{
2654
+ let count = 1;
2655
+ while('!' === peek() && ('(' !== peek(2) || '?' === peek(3))){
2656
+ advance();
2657
+ state.start++;
2658
+ count++;
2659
+ }
2660
+ if (count % 2 === 0) return false;
2661
+ state.negated = true;
2662
+ state.start++;
2663
+ return true;
2664
+ };
2665
+ const increment = (type)=>{
2666
+ state[type]++;
2667
+ stack.push(type);
2668
+ };
2669
+ const decrement = (type)=>{
2670
+ state[type]--;
2671
+ stack.pop();
2672
+ };
2673
+ const push = (tok)=>{
2674
+ if ('globstar' === prev.type) {
2675
+ const isBrace = state.braces > 0 && ('comma' === tok.type || 'brace' === tok.type);
2676
+ const isExtglob = true === tok.extglob || extglobs.length && ('pipe' === tok.type || 'paren' === tok.type);
2677
+ if ('slash' !== tok.type && 'paren' !== tok.type && !isBrace && !isExtglob) {
2678
+ state.output = state.output.slice(0, -prev.output.length);
2679
+ prev.type = 'star';
2680
+ prev.value = '*';
2681
+ prev.output = star;
2682
+ state.output += prev.output;
2683
+ }
2684
+ }
2685
+ if (extglobs.length && 'paren' !== tok.type) extglobs[extglobs.length - 1].inner += tok.value;
2686
+ if (tok.value || tok.output) append(tok);
2687
+ if (prev && 'text' === prev.type && 'text' === tok.type) {
2688
+ prev.value += tok.value;
2689
+ prev.output = (prev.output || '') + tok.value;
2690
+ return;
2691
+ }
2692
+ tok.prev = prev;
2693
+ tokens.push(tok);
2694
+ prev = tok;
2695
+ };
2696
+ const extglobOpen = (type, value)=>{
2697
+ const token = {
2698
+ ...EXTGLOB_CHARS[value],
2699
+ conditions: 1,
2700
+ inner: ''
2701
+ };
2702
+ token.prev = prev;
2703
+ token.parens = state.parens;
2704
+ token.output = state.output;
2705
+ token.startIndex = state.index;
2706
+ token.tokensIndex = tokens.length;
2707
+ const output = (opts.capture ? '(' : '') + token.open;
2708
+ increment('parens');
2709
+ push({
2710
+ type,
2711
+ value,
2712
+ output: state.output ? '' : ONE_CHAR
2713
+ });
2714
+ push({
2715
+ type: 'paren',
2716
+ extglob: true,
2717
+ value: advance(),
2718
+ output
2719
+ });
2720
+ extglobs.push(token);
2721
+ };
2722
+ const extglobClose = (token)=>{
2723
+ const literal = input.slice(token.startIndex, state.index + 1);
2724
+ const body = input.slice(token.startIndex + 2, state.index);
2725
+ const analysis = analyzeRepeatedExtglob(body, opts);
2726
+ if (('plus' === token.type || 'star' === token.type) && analysis.risky) {
2727
+ const safeOutput = analysis.safeOutput ? (token.output ? '' : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
2728
+ const open = tokens[token.tokensIndex];
2729
+ open.type = 'text';
2730
+ open.value = literal;
2731
+ open.output = safeOutput || utils.escapeRegex(literal);
2732
+ for(let i = token.tokensIndex + 1; i < tokens.length; i++){
2733
+ tokens[i].value = '';
2734
+ tokens[i].output = '';
2735
+ delete tokens[i].suffix;
2736
+ }
2737
+ state.output = token.output + open.output;
2738
+ state.backtrack = true;
2739
+ push({
2740
+ type: 'paren',
2741
+ extglob: true,
2742
+ value,
2743
+ output: ''
2744
+ });
2745
+ decrement('parens');
2746
+ return;
2747
+ }
2748
+ let output = token.close + (opts.capture ? ')' : '');
2749
+ let rest;
2750
+ if ('negate' === token.type) {
2751
+ let extglobStar = star;
2752
+ if (token.inner && token.inner.length > 1 && token.inner.includes('/')) extglobStar = globstar(opts);
2753
+ if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) output = token.close = `)$))${extglobStar}`;
2754
+ if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
2755
+ const expression = parse(rest, {
2756
+ ...options,
2757
+ fastpaths: false
2758
+ }).output;
2759
+ output = token.close = `)${expression})${extglobStar})`;
2760
+ }
2761
+ if ('bos' === token.prev.type) state.negatedExtglob = true;
2762
+ }
2763
+ push({
2764
+ type: 'paren',
2765
+ extglob: true,
2766
+ value,
2767
+ output
2768
+ });
2769
+ decrement('parens');
2770
+ };
2771
+ if (false !== opts.fastpaths && !/(^[*!]|[/()[\]{}"])/.test(input)) {
2772
+ let backslashes = false;
2773
+ let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index)=>{
2774
+ if ('\\' === first) {
2775
+ backslashes = true;
2776
+ return m;
2777
+ }
2778
+ if ('?' === first) {
2779
+ if (esc) return esc + first + (rest ? QMARK.repeat(rest.length) : '');
2780
+ if (0 === index) return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
2781
+ return QMARK.repeat(chars.length);
2782
+ }
2783
+ if ('.' === first) return DOT_LITERAL.repeat(chars.length);
2784
+ if ('*' === first) {
2785
+ if (esc) return esc + first + (rest ? star : '');
2786
+ return star;
2787
+ }
2788
+ return esc ? m : `\\${m}`;
2789
+ });
2790
+ if (true === backslashes) output = true === opts.unescape ? output.replace(/\\/g, '') : output.replace(/\\+/g, (m)=>m.length % 2 === 0 ? '\\\\' : m ? '\\' : '');
2791
+ if (output === input && true === opts.contains) {
2792
+ state.output = input;
2793
+ return state;
2794
+ }
2795
+ state.output = utils.wrapOutput(output, state, options);
2796
+ return state;
2797
+ }
2798
+ while(!eos()){
2799
+ value = advance();
2800
+ if ('\u0000' === value) continue;
2801
+ if ('\\' === value) {
2802
+ const next = peek();
2803
+ if ('/' === next && true !== opts.bash) continue;
2804
+ if ('.' === next || ';' === next) continue;
2805
+ if (!next) {
2806
+ value += '\\';
2807
+ push({
2808
+ type: 'text',
2809
+ value
2810
+ });
2811
+ continue;
2812
+ }
2813
+ const match = /^\\+/.exec(remaining());
2814
+ let slashes = 0;
2815
+ if (match && match[0].length > 2) {
2816
+ slashes = match[0].length;
2817
+ state.index += slashes;
2818
+ if (slashes % 2 !== 0) value += '\\';
2819
+ }
2820
+ if (true === opts.unescape) value = advance();
2821
+ else value += advance();
2822
+ if (0 === state.brackets) {
2823
+ push({
2824
+ type: 'text',
2825
+ value
2826
+ });
2827
+ continue;
2828
+ }
2829
+ }
2830
+ if (state.brackets > 0 && (']' !== value || '[' === prev.value || '[^' === prev.value)) {
2831
+ if (false !== opts.posix && ':' === value) {
2832
+ const inner = prev.value.slice(1);
2833
+ if (inner.includes('[')) {
2834
+ prev.posix = true;
2835
+ if (inner.includes(':')) {
2836
+ const idx = prev.value.lastIndexOf('[');
2837
+ const pre = prev.value.slice(0, idx);
2838
+ const rest = prev.value.slice(idx + 2);
2839
+ const posix = POSIX_REGEX_SOURCE[rest];
2840
+ if (posix) {
2841
+ prev.value = pre + posix;
2842
+ state.backtrack = true;
2843
+ advance();
2844
+ if (!bos.output && 1 === tokens.indexOf(prev)) bos.output = ONE_CHAR;
2845
+ continue;
2846
+ }
2847
+ }
2848
+ }
2849
+ }
2850
+ if ('[' === value && ':' !== peek() || '-' === value && ']' === peek()) value = `\\${value}`;
2851
+ if (']' === value && ('[' === prev.value || '[^' === prev.value)) value = `\\${value}`;
2852
+ if (true === opts.posix && '!' === value && '[' === prev.value) value = '^';
2853
+ prev.value += value;
2854
+ append({
2855
+ value
2856
+ });
2857
+ continue;
2858
+ }
2859
+ if (1 === state.quotes && '"' !== value) {
2860
+ value = utils.escapeRegex(value);
2861
+ prev.value += value;
2862
+ append({
2863
+ value
2864
+ });
2865
+ continue;
2866
+ }
2867
+ if ('"' === value) {
2868
+ state.quotes = 1 === state.quotes ? 0 : 1;
2869
+ if (true === opts.keepQuotes) push({
2870
+ type: 'text',
2871
+ value
2872
+ });
2873
+ continue;
2874
+ }
2875
+ if ('(' === value) {
2876
+ increment('parens');
2877
+ push({
2878
+ type: 'paren',
2879
+ value
2880
+ });
2881
+ continue;
2882
+ }
2883
+ if (')' === value) {
2884
+ if (0 === state.parens && true === opts.strictBrackets) throw new SyntaxError(syntaxError('opening', '('));
2885
+ const extglob = extglobs[extglobs.length - 1];
2886
+ if (extglob && state.parens === extglob.parens + 1) {
2887
+ extglobClose(extglobs.pop());
2888
+ continue;
2889
+ }
2890
+ push({
2891
+ type: 'paren',
2892
+ value,
2893
+ output: state.parens ? ')' : '\\)'
2894
+ });
2895
+ decrement('parens');
2896
+ continue;
2897
+ }
2898
+ if ('[' === value) {
2899
+ if (true !== opts.nobracket && remaining().includes(']')) increment('brackets');
2900
+ else {
2901
+ if (true !== opts.nobracket && true === opts.strictBrackets) throw new SyntaxError(syntaxError('closing', ']'));
2902
+ value = `\\${value}`;
2903
+ }
2904
+ push({
2905
+ type: 'bracket',
2906
+ value
2907
+ });
2908
+ continue;
2909
+ }
2910
+ if (']' === value) {
2911
+ if (true === opts.nobracket || prev && 'bracket' === prev.type && 1 === prev.value.length) {
2912
+ push({
2913
+ type: 'text',
2914
+ value,
2915
+ output: `\\${value}`
2916
+ });
2917
+ continue;
2918
+ }
2919
+ if (0 === state.brackets) {
2920
+ if (true === opts.strictBrackets) throw new SyntaxError(syntaxError('opening', '['));
2921
+ push({
2922
+ type: 'text',
2923
+ value,
2924
+ output: `\\${value}`
2925
+ });
2926
+ continue;
2927
+ }
2928
+ decrement('brackets');
2929
+ const prevValue = prev.value.slice(1);
2930
+ if (true !== prev.posix && '^' === prevValue[0] && !prevValue.includes('/')) value = `/${value}`;
2931
+ prev.value += value;
2932
+ append({
2933
+ value
2934
+ });
2935
+ if (false === opts.literalBrackets || utils.hasRegexChars(prevValue)) continue;
2936
+ const escaped = utils.escapeRegex(prev.value);
2937
+ state.output = state.output.slice(0, -prev.value.length);
2938
+ if (true === opts.literalBrackets) {
2939
+ state.output += escaped;
2940
+ prev.value = escaped;
2941
+ continue;
2942
+ }
2943
+ prev.value = `(${capture}${escaped}|${prev.value})`;
2944
+ state.output += prev.value;
2945
+ continue;
2946
+ }
2947
+ if ('{' === value && true !== opts.nobrace) {
2948
+ increment('braces');
2949
+ const open = {
2950
+ type: 'brace',
2951
+ value,
2952
+ output: '(',
2953
+ outputIndex: state.output.length,
2954
+ tokensIndex: state.tokens.length
2955
+ };
2956
+ braces.push(open);
2957
+ push(open);
2958
+ continue;
2959
+ }
2960
+ if ('}' === value) {
2961
+ const brace = braces[braces.length - 1];
2962
+ if (true === opts.nobrace || !brace) {
2963
+ push({
2964
+ type: 'text',
2965
+ value,
2966
+ output: value
2967
+ });
2968
+ continue;
2969
+ }
2970
+ let output = ')';
2971
+ if (true === brace.dots) {
2972
+ const arr = tokens.slice();
2973
+ const range = [];
2974
+ for(let i = arr.length - 1; i >= 0; i--){
2975
+ tokens.pop();
2976
+ if ('brace' === arr[i].type) break;
2977
+ if ('dots' !== arr[i].type) range.unshift(arr[i].value);
2978
+ }
2979
+ output = expandRange(range, opts);
2980
+ state.backtrack = true;
2981
+ }
2982
+ if (true !== brace.comma && true !== brace.dots) {
2983
+ const out = state.output.slice(0, brace.outputIndex);
2984
+ const toks = state.tokens.slice(brace.tokensIndex);
2985
+ brace.value = brace.output = '\\{';
2986
+ value = output = '\\}';
2987
+ state.output = out;
2988
+ for (const t of toks)state.output += t.output || t.value;
2989
+ }
2990
+ push({
2991
+ type: 'brace',
2992
+ value,
2993
+ output
2994
+ });
2995
+ decrement('braces');
2996
+ braces.pop();
2997
+ continue;
2998
+ }
2999
+ if ('|' === value) {
3000
+ if (extglobs.length > 0) extglobs[extglobs.length - 1].conditions++;
3001
+ push({
3002
+ type: 'text',
3003
+ value
3004
+ });
3005
+ continue;
3006
+ }
3007
+ if (',' === value) {
3008
+ let output = value;
3009
+ const brace = braces[braces.length - 1];
3010
+ if (brace && 'braces' === stack[stack.length - 1]) {
3011
+ brace.comma = true;
3012
+ output = '|';
3013
+ }
3014
+ push({
3015
+ type: 'comma',
3016
+ value,
3017
+ output
3018
+ });
3019
+ continue;
3020
+ }
3021
+ if ('/' === value) {
3022
+ if ('dot' === prev.type && state.index === state.start + 1) {
3023
+ state.start = state.index + 1;
3024
+ state.consumed = '';
3025
+ state.output = '';
3026
+ tokens.pop();
3027
+ prev = bos;
3028
+ continue;
3029
+ }
3030
+ push({
3031
+ type: 'slash',
3032
+ value,
3033
+ output: SLASH_LITERAL
3034
+ });
3035
+ continue;
3036
+ }
3037
+ if ('.' === value) {
3038
+ if (state.braces > 0 && 'dot' === prev.type) {
3039
+ if ('.' === prev.value) prev.output = DOT_LITERAL;
3040
+ const brace = braces[braces.length - 1];
3041
+ prev.type = 'dots';
3042
+ prev.output += value;
3043
+ prev.value += value;
3044
+ brace.dots = true;
3045
+ continue;
3046
+ }
3047
+ if (state.braces + state.parens === 0 && 'bos' !== prev.type && 'slash' !== prev.type) {
3048
+ push({
3049
+ type: 'text',
3050
+ value,
3051
+ output: DOT_LITERAL
3052
+ });
3053
+ continue;
3054
+ }
3055
+ push({
3056
+ type: 'dot',
3057
+ value,
3058
+ output: DOT_LITERAL
3059
+ });
3060
+ continue;
3061
+ }
3062
+ if ('?' === value) {
3063
+ const isGroup = prev && '(' === prev.value;
3064
+ if (!isGroup && true !== opts.noextglob && '(' === peek() && '?' !== peek(2)) {
3065
+ extglobOpen('qmark', value);
3066
+ continue;
3067
+ }
3068
+ if (prev && 'paren' === prev.type) {
3069
+ const next = peek();
3070
+ let output = value;
3071
+ if ('<' === next && !utils.supportsLookbehinds()) throw new Error('Node.js v10 or higher is required for regex lookbehinds');
3072
+ if ('(' === prev.value && !/[!=<:]/.test(next) || '<' === next && !/<([!=]|\w+>)/.test(remaining())) output = `\\${value}`;
3073
+ push({
3074
+ type: 'text',
3075
+ value,
3076
+ output
3077
+ });
3078
+ continue;
3079
+ }
3080
+ if (true !== opts.dot && ('slash' === prev.type || 'bos' === prev.type)) {
3081
+ push({
3082
+ type: 'qmark',
3083
+ value,
3084
+ output: QMARK_NO_DOT
3085
+ });
3086
+ continue;
3087
+ }
3088
+ push({
3089
+ type: 'qmark',
3090
+ value,
3091
+ output: QMARK
3092
+ });
3093
+ continue;
3094
+ }
3095
+ if ('!' === value) {
3096
+ if (true !== opts.noextglob && '(' === peek()) {
3097
+ if ('?' !== peek(2) || !/[!=<:]/.test(peek(3))) {
3098
+ extglobOpen('negate', value);
3099
+ continue;
3100
+ }
3101
+ }
3102
+ if (true !== opts.nonegate && 0 === state.index) {
3103
+ negate();
3104
+ continue;
3105
+ }
3106
+ }
3107
+ if ('+' === value) {
3108
+ if (true !== opts.noextglob && '(' === peek() && '?' !== peek(2)) {
3109
+ extglobOpen('plus', value);
3110
+ continue;
3111
+ }
3112
+ if (prev && '(' === prev.value || false === opts.regex) {
3113
+ push({
3114
+ type: 'plus',
3115
+ value,
3116
+ output: PLUS_LITERAL
3117
+ });
3118
+ continue;
3119
+ }
3120
+ if (prev && ('bracket' === prev.type || 'paren' === prev.type || 'brace' === prev.type) || state.parens > 0) {
3121
+ push({
3122
+ type: 'plus',
3123
+ value
3124
+ });
3125
+ continue;
3126
+ }
3127
+ push({
3128
+ type: 'plus',
3129
+ value: PLUS_LITERAL
3130
+ });
3131
+ continue;
3132
+ }
3133
+ if ('@' === value) {
3134
+ if (true !== opts.noextglob && '(' === peek() && '?' !== peek(2)) {
3135
+ push({
3136
+ type: 'at',
3137
+ extglob: true,
3138
+ value,
3139
+ output: ''
3140
+ });
3141
+ continue;
3142
+ }
3143
+ push({
3144
+ type: 'text',
3145
+ value
3146
+ });
3147
+ continue;
3148
+ }
3149
+ if ('*' !== value) {
3150
+ if ('$' === value || '^' === value) value = `\\${value}`;
3151
+ const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
3152
+ if (match) {
3153
+ value += match[0];
3154
+ state.index += match[0].length;
3155
+ }
3156
+ push({
3157
+ type: 'text',
3158
+ value
3159
+ });
3160
+ continue;
3161
+ }
3162
+ if (prev && ('globstar' === prev.type || true === prev.star)) {
3163
+ prev.type = 'star';
3164
+ prev.star = true;
3165
+ prev.value += value;
3166
+ prev.output = star;
3167
+ state.backtrack = true;
3168
+ state.globstar = true;
3169
+ consume(value);
3170
+ continue;
3171
+ }
3172
+ let rest = remaining();
3173
+ if (true !== opts.noextglob && /^\([^?]/.test(rest)) {
3174
+ extglobOpen('star', value);
3175
+ continue;
3176
+ }
3177
+ if ('star' === prev.type) {
3178
+ if (true === opts.noglobstar) {
3179
+ consume(value);
3180
+ continue;
3181
+ }
3182
+ const prior = prev.prev;
3183
+ const before = prior.prev;
3184
+ const isStart = 'slash' === prior.type || 'bos' === prior.type;
3185
+ const afterStar = before && ('star' === before.type || 'globstar' === before.type);
3186
+ if (true === opts.bash && (!isStart || rest[0] && '/' !== rest[0])) {
3187
+ push({
3188
+ type: 'star',
3189
+ value,
3190
+ output: ''
3191
+ });
3192
+ continue;
3193
+ }
3194
+ const isBrace = state.braces > 0 && ('comma' === prior.type || 'brace' === prior.type);
3195
+ const isExtglob = extglobs.length && ('pipe' === prior.type || 'paren' === prior.type);
3196
+ if (!isStart && 'paren' !== prior.type && !isBrace && !isExtglob) {
3197
+ push({
3198
+ type: 'star',
3199
+ value,
3200
+ output: ''
3201
+ });
3202
+ continue;
3203
+ }
3204
+ while('/**' === rest.slice(0, 3)){
3205
+ const after = input[state.index + 4];
3206
+ if (after && '/' !== after) break;
3207
+ rest = rest.slice(3);
3208
+ consume('/**', 3);
3209
+ }
3210
+ if ('bos' === prior.type && eos()) {
3211
+ prev.type = 'globstar';
3212
+ prev.value += value;
3213
+ prev.output = globstar(opts);
3214
+ state.output = prev.output;
3215
+ state.globstar = true;
3216
+ consume(value);
3217
+ continue;
3218
+ }
3219
+ if ('slash' === prior.type && 'bos' !== prior.prev.type && !afterStar && eos()) {
3220
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
3221
+ prior.output = `(?:${prior.output}`;
3222
+ prev.type = 'globstar';
3223
+ prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
3224
+ prev.value += value;
3225
+ state.globstar = true;
3226
+ state.output += prior.output + prev.output;
3227
+ consume(value);
3228
+ continue;
3229
+ }
3230
+ if ('slash' === prior.type && 'bos' !== prior.prev.type && '/' === rest[0]) {
3231
+ const end = void 0 !== rest[1] ? '|$' : '';
3232
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
3233
+ prior.output = `(?:${prior.output}`;
3234
+ prev.type = 'globstar';
3235
+ prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
3236
+ prev.value += value;
3237
+ state.output += prior.output + prev.output;
3238
+ state.globstar = true;
3239
+ consume(value + advance());
3240
+ push({
3241
+ type: 'slash',
3242
+ value: '/',
3243
+ output: ''
3244
+ });
3245
+ continue;
3246
+ }
3247
+ if ('bos' === prior.type && '/' === rest[0]) {
3248
+ prev.type = 'globstar';
3249
+ prev.value += value;
3250
+ prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
3251
+ state.output = prev.output;
3252
+ state.globstar = true;
3253
+ consume(value + advance());
3254
+ push({
3255
+ type: 'slash',
3256
+ value: '/',
3257
+ output: ''
3258
+ });
3259
+ continue;
3260
+ }
3261
+ state.output = state.output.slice(0, -prev.output.length);
3262
+ prev.type = 'globstar';
3263
+ prev.output = globstar(opts);
3264
+ prev.value += value;
3265
+ state.output += prev.output;
3266
+ state.globstar = true;
3267
+ consume(value);
3268
+ continue;
3269
+ }
3270
+ const token = {
3271
+ type: 'star',
3272
+ value,
3273
+ output: star
3274
+ };
3275
+ if (true === opts.bash) {
3276
+ token.output = '.*?';
3277
+ if ('bos' === prev.type || 'slash' === prev.type) token.output = nodot + token.output;
3278
+ push(token);
3279
+ continue;
3280
+ }
3281
+ if (prev && ('bracket' === prev.type || 'paren' === prev.type) && true === opts.regex) {
3282
+ token.output = value;
3283
+ push(token);
3284
+ continue;
3285
+ }
3286
+ if (state.index === state.start || 'slash' === prev.type || 'dot' === prev.type) {
3287
+ if ('dot' === prev.type) {
3288
+ state.output += NO_DOT_SLASH;
3289
+ prev.output += NO_DOT_SLASH;
3290
+ } else if (true === opts.dot) {
3291
+ state.output += NO_DOTS_SLASH;
3292
+ prev.output += NO_DOTS_SLASH;
3293
+ } else {
3294
+ state.output += nodot;
3295
+ prev.output += nodot;
3296
+ }
3297
+ if ('*' !== peek()) {
3298
+ state.output += ONE_CHAR;
3299
+ prev.output += ONE_CHAR;
3300
+ }
3301
+ }
3302
+ push(token);
3303
+ }
3304
+ while(state.brackets > 0){
3305
+ if (true === opts.strictBrackets) throw new SyntaxError(syntaxError('closing', ']'));
3306
+ state.output = utils.escapeLast(state.output, '[');
3307
+ decrement('brackets');
3308
+ }
3309
+ while(state.parens > 0){
3310
+ if (true === opts.strictBrackets) throw new SyntaxError(syntaxError('closing', ')'));
3311
+ state.output = utils.escapeLast(state.output, '(');
3312
+ decrement('parens');
3313
+ }
3314
+ while(state.braces > 0){
3315
+ if (true === opts.strictBrackets) throw new SyntaxError(syntaxError('closing', '}'));
3316
+ state.output = utils.escapeLast(state.output, '{');
3317
+ decrement('braces');
3318
+ }
3319
+ if (true !== opts.strictSlashes && ('star' === prev.type || 'bracket' === prev.type)) push({
3320
+ type: 'maybe_slash',
3321
+ value: '',
3322
+ output: `${SLASH_LITERAL}?`
3323
+ });
3324
+ if (true === state.backtrack) {
3325
+ state.output = '';
3326
+ for (const token of state.tokens){
3327
+ state.output += null != token.output ? token.output : token.value;
3328
+ if (token.suffix) state.output += token.suffix;
3329
+ }
3330
+ }
3331
+ return state;
3332
+ };
3333
+ parse.fastpaths = (input, options)=>{
3334
+ const opts = {
3335
+ ...options
3336
+ };
3337
+ const max = 'number' == typeof opts.maxLength ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
3338
+ const len = input.length;
3339
+ if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
3340
+ input = REPLACEMENTS[input] || input;
3341
+ const win32 = utils.isWindows(options);
3342
+ const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(win32);
3343
+ const nodot = opts.dot ? NO_DOTS : NO_DOT;
3344
+ const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
3345
+ const capture = opts.capture ? '' : '?:';
3346
+ const state = {
3347
+ negated: false,
3348
+ prefix: ''
3349
+ };
3350
+ let star = true === opts.bash ? '.*?' : STAR;
3351
+ if (opts.capture) star = `(${star})`;
3352
+ const globstar = (opts)=>{
3353
+ if (true === opts.noglobstar) return star;
3354
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
3355
+ };
3356
+ const create = (str)=>{
3357
+ switch(str){
3358
+ case '*':
3359
+ return `${nodot}${ONE_CHAR}${star}`;
3360
+ case '.*':
3361
+ return `${DOT_LITERAL}${ONE_CHAR}${star}`;
3362
+ case '*.*':
3363
+ return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
3364
+ case '*/*':
3365
+ return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
3366
+ case '**':
3367
+ return nodot + globstar(opts);
3368
+ case '**/*':
3369
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
3370
+ case '**/*.*':
3371
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
3372
+ case '**/.*':
3373
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
3374
+ default:
3375
+ {
3376
+ const match = /^(.*?)\.(\w+)$/.exec(str);
3377
+ if (!match) return;
3378
+ const source = create(match[1]);
3379
+ if (!source) return;
3380
+ return source + DOT_LITERAL + match[2];
3381
+ }
3382
+ }
3383
+ };
3384
+ const output = utils.removePrefix(input, state);
3385
+ let source = create(output);
3386
+ if (source && true !== opts.strictSlashes) source += `${SLASH_LITERAL}?`;
3387
+ return source;
3388
+ };
3389
+ module.exports = parse;
3390
+ },
3391
+ "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js" (module, __unused_rspack_exports, __webpack_require__) {
3392
+ const path = __webpack_require__("path?aeb1");
3393
+ const scan = __webpack_require__("../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/scan.js");
3394
+ const parse = __webpack_require__("../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/parse.js");
3395
+ const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/utils.js");
3396
+ const constants = __webpack_require__("../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/constants.js");
3397
+ const isObject = (val)=>val && 'object' == typeof val && !Array.isArray(val);
3398
+ const picomatch = (glob, options, returnState = false)=>{
3399
+ if (Array.isArray(glob)) {
3400
+ const fns = glob.map((input)=>picomatch(input, options, returnState));
3401
+ const arrayMatcher = (str)=>{
3402
+ for (const isMatch of fns){
3403
+ const state = isMatch(str);
3404
+ if (state) return state;
3405
+ }
3406
+ return false;
3407
+ };
3408
+ return arrayMatcher;
3409
+ }
3410
+ const isState = isObject(glob) && glob.tokens && glob.input;
3411
+ if ('' === glob || 'string' != typeof glob && !isState) throw new TypeError('Expected pattern to be a non-empty string');
3412
+ const opts = options || {};
3413
+ const posix = utils.isWindows(options);
3414
+ const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
3415
+ const state = regex.state;
3416
+ delete regex.state;
3417
+ let isIgnored = ()=>false;
3418
+ if (opts.ignore) {
3419
+ const ignoreOpts = {
3420
+ ...options,
3421
+ ignore: null,
3422
+ onMatch: null,
3423
+ onResult: null
3424
+ };
3425
+ isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
3426
+ }
3427
+ const matcher = (input, returnObject = false)=>{
3428
+ const { isMatch, match, output } = picomatch.test(input, regex, options, {
3429
+ glob,
3430
+ posix
3431
+ });
3432
+ const result = {
3433
+ glob,
3434
+ state,
3435
+ regex,
3436
+ posix,
3437
+ input,
3438
+ output,
3439
+ match,
3440
+ isMatch
3441
+ };
3442
+ if ('function' == typeof opts.onResult) opts.onResult(result);
3443
+ if (false === isMatch) {
3444
+ result.isMatch = false;
3445
+ return returnObject ? result : false;
3446
+ }
3447
+ if (isIgnored(input)) {
3448
+ if ('function' == typeof opts.onIgnore) opts.onIgnore(result);
3449
+ result.isMatch = false;
3450
+ return returnObject ? result : false;
3451
+ }
3452
+ if ('function' == typeof opts.onMatch) opts.onMatch(result);
3453
+ return returnObject ? result : true;
3454
+ };
3455
+ if (returnState) matcher.state = state;
3456
+ return matcher;
3457
+ };
3458
+ picomatch.test = (input, regex, options, { glob, posix } = {})=>{
3459
+ if ('string' != typeof input) throw new TypeError('Expected input to be a string');
3460
+ if ('' === input) return {
3461
+ isMatch: false,
3462
+ output: ''
3463
+ };
3464
+ const opts = options || {};
3465
+ const format = opts.format || (posix ? utils.toPosixSlashes : null);
3466
+ let match = input === glob;
3467
+ let output = match && format ? format(input) : input;
3468
+ if (false === match) {
3469
+ output = format ? format(input) : input;
3470
+ match = output === glob;
3471
+ }
3472
+ if (false === match || true === opts.capture) match = true === opts.matchBase || true === opts.basename ? picomatch.matchBase(input, regex, options, posix) : regex.exec(output);
3473
+ return {
3474
+ isMatch: Boolean(match),
3475
+ match,
3476
+ output
3477
+ };
3478
+ };
3479
+ picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options))=>{
3480
+ const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
3481
+ return regex.test(path.basename(input));
3482
+ };
3483
+ picomatch.isMatch = (str, patterns, options)=>picomatch(patterns, options)(str);
3484
+ picomatch.parse = (pattern, options)=>{
3485
+ if (Array.isArray(pattern)) return pattern.map((p)=>picomatch.parse(p, options));
3486
+ return parse(pattern, {
3487
+ ...options,
3488
+ fastpaths: false
3489
+ });
3490
+ };
3491
+ picomatch.scan = (input, options)=>scan(input, options);
3492
+ picomatch.compileRe = (state, options, returnOutput = false, returnState = false)=>{
3493
+ if (true === returnOutput) return state.output;
3494
+ const opts = options || {};
3495
+ const prepend = opts.contains ? '' : '^';
3496
+ const append = opts.contains ? '' : '$';
3497
+ let source = `${prepend}(?:${state.output})${append}`;
3498
+ if (state && true === state.negated) source = `^(?!${source}).*$`;
3499
+ const regex = picomatch.toRegex(source, options);
3500
+ if (true === returnState) regex.state = state;
3501
+ return regex;
3502
+ };
3503
+ picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false)=>{
3504
+ if (!input || 'string' != typeof input) throw new TypeError('Expected a non-empty string');
3505
+ let parsed = {
3506
+ negated: false,
3507
+ fastpaths: true
3508
+ };
3509
+ if (false !== options.fastpaths && ('.' === input[0] || '*' === input[0])) parsed.output = parse.fastpaths(input, options);
3510
+ if (!parsed.output) parsed = parse(input, options);
3511
+ return picomatch.compileRe(parsed, options, returnOutput, returnState);
3512
+ };
3513
+ picomatch.toRegex = (source, options)=>{
3514
+ try {
3515
+ const opts = options || {};
3516
+ return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
3517
+ } catch (err) {
3518
+ if (options && true === options.debug) throw err;
3519
+ return /$^/;
3520
+ }
3521
+ };
3522
+ picomatch.constants = constants;
3523
+ module.exports = picomatch;
3524
+ },
3525
+ "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/scan.js" (module, __unused_rspack_exports, __webpack_require__) {
3526
+ const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/utils.js");
3527
+ 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 } = __webpack_require__("../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/constants.js");
3528
+ const isPathSeparator = (code)=>code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
3529
+ const depth = (token)=>{
3530
+ if (true !== token.isPrefix) token.depth = token.isGlobstar ? 1 / 0 : 1;
3531
+ };
3532
+ const scan = (input, options)=>{
3533
+ const opts = options || {};
3534
+ const length = input.length - 1;
3535
+ const scanToEnd = true === opts.parts || true === opts.scanToEnd;
3536
+ const slashes = [];
3537
+ const tokens = [];
3538
+ const parts = [];
3539
+ let str = input;
3540
+ let index = -1;
3541
+ let start = 0;
3542
+ let lastIndex = 0;
3543
+ let isBrace = false;
3544
+ let isBracket = false;
3545
+ let isGlob = false;
3546
+ let isExtglob = false;
3547
+ let isGlobstar = false;
3548
+ let braceEscaped = false;
3549
+ let backslashes = false;
3550
+ let negated = false;
3551
+ let negatedExtglob = false;
3552
+ let finished = false;
3553
+ let braces = 0;
3554
+ let prev;
3555
+ let code;
3556
+ let token = {
3557
+ value: '',
3558
+ depth: 0,
3559
+ isGlob: false
3560
+ };
3561
+ const eos = ()=>index >= length;
3562
+ const peek = ()=>str.charCodeAt(index + 1);
3563
+ const advance = ()=>{
3564
+ prev = code;
3565
+ return str.charCodeAt(++index);
3566
+ };
3567
+ while(index < length){
3568
+ code = advance();
3569
+ let next;
3570
+ if (code === CHAR_BACKWARD_SLASH) {
3571
+ backslashes = token.backslashes = true;
3572
+ code = advance();
3573
+ if (code === CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
3574
+ continue;
3575
+ }
3576
+ if (true === braceEscaped || code === CHAR_LEFT_CURLY_BRACE) {
3577
+ braces++;
3578
+ while(true !== eos() && (code = advance())){
3579
+ if (code === CHAR_BACKWARD_SLASH) {
3580
+ backslashes = token.backslashes = true;
3581
+ advance();
3582
+ continue;
3583
+ }
3584
+ if (code === CHAR_LEFT_CURLY_BRACE) {
3585
+ braces++;
3586
+ continue;
3587
+ }
3588
+ if (true !== braceEscaped && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
3589
+ isBrace = token.isBrace = true;
3590
+ isGlob = token.isGlob = true;
3591
+ finished = true;
3592
+ if (true === scanToEnd) continue;
3593
+ break;
3594
+ }
3595
+ if (true !== braceEscaped && code === CHAR_COMMA) {
3596
+ isBrace = token.isBrace = true;
3597
+ isGlob = token.isGlob = true;
3598
+ finished = true;
3599
+ if (true === scanToEnd) continue;
3600
+ break;
3601
+ }
3602
+ if (code === CHAR_RIGHT_CURLY_BRACE) {
3603
+ braces--;
3604
+ if (0 === braces) {
3605
+ braceEscaped = false;
3606
+ isBrace = token.isBrace = true;
3607
+ finished = true;
3608
+ break;
3609
+ }
3610
+ }
3611
+ }
3612
+ if (true === scanToEnd) continue;
3613
+ break;
3614
+ }
3615
+ if (code === CHAR_FORWARD_SLASH) {
3616
+ slashes.push(index);
3617
+ tokens.push(token);
3618
+ token = {
3619
+ value: '',
3620
+ depth: 0,
3621
+ isGlob: false
3622
+ };
3623
+ if (true === finished) continue;
3624
+ if (prev === CHAR_DOT && index === start + 1) {
3625
+ start += 2;
3626
+ continue;
3627
+ }
3628
+ lastIndex = index + 1;
3629
+ continue;
3630
+ }
3631
+ if (true !== opts.noext) {
3632
+ const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
3633
+ if (true === isExtglobChar && peek() === CHAR_LEFT_PARENTHESES) {
3634
+ isGlob = token.isGlob = true;
3635
+ isExtglob = token.isExtglob = true;
3636
+ finished = true;
3637
+ if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
3638
+ if (true === scanToEnd) {
3639
+ while(true !== eos() && (code = advance())){
3640
+ if (code === CHAR_BACKWARD_SLASH) {
3641
+ backslashes = token.backslashes = true;
3642
+ code = advance();
3643
+ continue;
3644
+ }
3645
+ if (code === CHAR_RIGHT_PARENTHESES) {
3646
+ isGlob = token.isGlob = true;
3647
+ finished = true;
3648
+ break;
3649
+ }
3650
+ }
3651
+ continue;
3652
+ }
3653
+ break;
3654
+ }
3655
+ }
3656
+ if (code === CHAR_ASTERISK) {
3657
+ if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
3658
+ isGlob = token.isGlob = true;
3659
+ finished = true;
3660
+ if (true === scanToEnd) continue;
3661
+ break;
3662
+ }
3663
+ if (code === CHAR_QUESTION_MARK) {
3664
+ isGlob = token.isGlob = true;
3665
+ finished = true;
3666
+ if (true === scanToEnd) continue;
3667
+ break;
3668
+ }
3669
+ if (code === CHAR_LEFT_SQUARE_BRACKET) {
3670
+ while(true !== eos() && (next = advance())){
3671
+ if (next === CHAR_BACKWARD_SLASH) {
3672
+ backslashes = token.backslashes = true;
3673
+ advance();
3674
+ continue;
3675
+ }
3676
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
3677
+ isBracket = token.isBracket = true;
3678
+ isGlob = token.isGlob = true;
3679
+ finished = true;
3680
+ break;
3681
+ }
3682
+ }
3683
+ if (true === scanToEnd) continue;
3684
+ break;
3685
+ }
3686
+ if (true !== opts.nonegate && code === CHAR_EXCLAMATION_MARK && index === start) {
3687
+ negated = token.negated = true;
3688
+ start++;
3689
+ continue;
3690
+ }
3691
+ if (true !== opts.noparen && code === CHAR_LEFT_PARENTHESES) {
3692
+ isGlob = token.isGlob = true;
3693
+ if (true === scanToEnd) {
3694
+ while(true !== eos() && (code = advance())){
3695
+ if (code === CHAR_LEFT_PARENTHESES) {
3696
+ backslashes = token.backslashes = true;
3697
+ code = advance();
3698
+ continue;
3699
+ }
3700
+ if (code === CHAR_RIGHT_PARENTHESES) {
3701
+ finished = true;
3702
+ break;
3703
+ }
3704
+ }
3705
+ continue;
3706
+ }
3707
+ break;
3708
+ }
3709
+ if (true === isGlob) {
3710
+ finished = true;
3711
+ if (true === scanToEnd) continue;
3712
+ break;
3713
+ }
3714
+ }
3715
+ if (true === opts.noext) {
3716
+ isExtglob = false;
3717
+ isGlob = false;
3718
+ }
3719
+ let base = str;
3720
+ let prefix = '';
3721
+ let glob = '';
3722
+ if (start > 0) {
3723
+ prefix = str.slice(0, start);
3724
+ str = str.slice(start);
3725
+ lastIndex -= start;
3726
+ }
3727
+ if (base && true === isGlob && lastIndex > 0) {
3728
+ base = str.slice(0, lastIndex);
3729
+ glob = str.slice(lastIndex);
3730
+ } else if (true === isGlob) {
3731
+ base = '';
3732
+ glob = str;
3733
+ } else base = str;
3734
+ if (base && '' !== base && '/' !== base && base !== str) {
3735
+ if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
3736
+ }
3737
+ if (true === opts.unescape) {
3738
+ if (glob) glob = utils.removeBackslashes(glob);
3739
+ if (base && true === backslashes) base = utils.removeBackslashes(base);
3740
+ }
3741
+ const state = {
3742
+ prefix,
3743
+ input,
3744
+ start,
3745
+ base,
3746
+ glob,
3747
+ isBrace,
3748
+ isBracket,
3749
+ isGlob,
3750
+ isExtglob,
3751
+ isGlobstar,
3752
+ negated,
3753
+ negatedExtglob
3754
+ };
3755
+ if (true === opts.tokens) {
3756
+ state.maxDepth = 0;
3757
+ if (!isPathSeparator(code)) tokens.push(token);
3758
+ state.tokens = tokens;
3759
+ }
3760
+ if (true === opts.parts || true === opts.tokens) {
3761
+ let prevIndex;
3762
+ for(let idx = 0; idx < slashes.length; idx++){
3763
+ const n = prevIndex ? prevIndex + 1 : start;
3764
+ const i = slashes[idx];
3765
+ const value = input.slice(n, i);
3766
+ if (opts.tokens) {
3767
+ if (0 === idx && 0 !== start) {
3768
+ tokens[idx].isPrefix = true;
3769
+ tokens[idx].value = prefix;
3770
+ } else tokens[idx].value = value;
3771
+ depth(tokens[idx]);
3772
+ state.maxDepth += tokens[idx].depth;
3773
+ }
3774
+ if (0 !== idx || '' !== value) parts.push(value);
3775
+ prevIndex = i;
3776
+ }
3777
+ if (prevIndex && prevIndex + 1 < input.length) {
3778
+ const value = input.slice(prevIndex + 1);
3779
+ parts.push(value);
3780
+ if (opts.tokens) {
3781
+ tokens[tokens.length - 1].value = value;
3782
+ depth(tokens[tokens.length - 1]);
3783
+ state.maxDepth += tokens[tokens.length - 1].depth;
3784
+ }
3785
+ }
3786
+ state.slashes = slashes;
3787
+ state.parts = parts;
3788
+ }
3789
+ return state;
3790
+ };
3791
+ module.exports = scan;
3792
+ },
3793
+ "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/utils.js" (__unused_rspack_module, exports, __webpack_require__) {
3794
+ const path = __webpack_require__("path?aeb1");
3795
+ const win32 = 'win32' === process.platform;
3796
+ const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = __webpack_require__("../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/constants.js");
3797
+ exports.isObject = (val)=>null !== val && 'object' == typeof val && !Array.isArray(val);
3798
+ exports.hasRegexChars = (str)=>REGEX_SPECIAL_CHARS.test(str);
3799
+ exports.isRegexChar = (str)=>1 === str.length && exports.hasRegexChars(str);
3800
+ exports.escapeRegex = (str)=>str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
3801
+ exports.toPosixSlashes = (str)=>str.replace(REGEX_BACKSLASH, '/');
3802
+ exports.removeBackslashes = (str)=>str.replace(REGEX_REMOVE_BACKSLASH, (match)=>'\\' === match ? '' : match);
3803
+ exports.supportsLookbehinds = ()=>{
3804
+ const segs = process.version.slice(1).split('.').map(Number);
3805
+ if (3 === segs.length && segs[0] >= 9 || 8 === segs[0] && segs[1] >= 10) return true;
3806
+ return false;
3807
+ };
3808
+ exports.isWindows = (options)=>{
3809
+ if (options && 'boolean' == typeof options.windows) return options.windows;
3810
+ return true === win32 || '\\' === path.sep;
3811
+ };
3812
+ exports.escapeLast = (input, char, lastIdx)=>{
3813
+ const idx = input.lastIndexOf(char, lastIdx);
3814
+ if (-1 === idx) return input;
3815
+ if ('\\' === input[idx - 1]) return exports.escapeLast(input, char, idx - 1);
3816
+ return `${input.slice(0, idx)}\\${input.slice(idx)}`;
3817
+ };
3818
+ exports.removePrefix = (input, state = {})=>{
3819
+ let output = input;
3820
+ if (output.startsWith('./')) {
3821
+ output = output.slice(2);
3822
+ state.prefix = './';
3823
+ }
3824
+ return output;
3825
+ };
3826
+ exports.wrapOutput = (input, state = {}, options = {})=>{
3827
+ const prepend = options.contains ? '' : '^';
3828
+ const append = options.contains ? '' : '$';
3829
+ let output = `${prepend}(?:${input})${append}`;
3830
+ if (true === state.negated) output = `(?:^(?!${output}).*$)`;
3831
+ return output;
3832
+ };
3833
+ },
3834
+ "../../node_modules/.pnpm/readdirp@3.6.0/node_modules/readdirp/index.js" (module, __unused_rspack_exports, __webpack_require__) {
3835
+ const fs = __webpack_require__("fs?8b28");
3836
+ const { Readable } = __webpack_require__("stream");
3837
+ const sysPath = __webpack_require__("path?aeb1");
3838
+ const { promisify } = __webpack_require__("util");
3839
+ const picomatch = __webpack_require__("../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/index.js");
3840
+ const readdir = promisify(fs.readdir);
3841
+ const stat = promisify(fs.stat);
3842
+ const lstat = promisify(fs.lstat);
3843
+ const realpath = promisify(fs.realpath);
3844
+ const BANG = '!';
3845
+ const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR';
3846
+ const NORMAL_FLOW_ERRORS = new Set([
3847
+ 'ENOENT',
3848
+ 'EPERM',
3849
+ 'EACCES',
3850
+ 'ELOOP',
3851
+ RECURSIVE_ERROR_CODE
3852
+ ]);
3853
+ const FILE_TYPE = 'files';
3854
+ const DIR_TYPE = 'directories';
3855
+ const FILE_DIR_TYPE = 'files_directories';
3856
+ const EVERYTHING_TYPE = 'all';
3857
+ const ALL_TYPES = [
3858
+ FILE_TYPE,
3859
+ DIR_TYPE,
3860
+ FILE_DIR_TYPE,
3861
+ EVERYTHING_TYPE
3862
+ ];
3863
+ const isNormalFlowError = (error)=>NORMAL_FLOW_ERRORS.has(error.code);
3864
+ const [maj, min] = process.versions.node.split('.').slice(0, 2).map((n)=>Number.parseInt(n, 10));
3865
+ const wantBigintFsStats = 'win32' === process.platform && (maj > 10 || 10 === maj && min >= 5);
3866
+ const normalizeFilter = (filter)=>{
3867
+ if (void 0 === filter) return;
3868
+ if ('function' == typeof filter) return filter;
3869
+ if ('string' == typeof filter) {
3870
+ const glob = picomatch(filter.trim());
3871
+ return (entry)=>glob(entry.basename);
3872
+ }
3873
+ if (Array.isArray(filter)) {
3874
+ const positive = [];
3875
+ const negative = [];
3876
+ for (const item of filter){
3877
+ const trimmed = item.trim();
3878
+ if (trimmed.charAt(0) === BANG) negative.push(picomatch(trimmed.slice(1)));
3879
+ else positive.push(picomatch(trimmed));
3880
+ }
3881
+ if (negative.length > 0) {
3882
+ if (positive.length > 0) return (entry)=>positive.some((f)=>f(entry.basename)) && !negative.some((f)=>f(entry.basename));
3883
+ return (entry)=>!negative.some((f)=>f(entry.basename));
3884
+ }
3885
+ return (entry)=>positive.some((f)=>f(entry.basename));
3886
+ }
3887
+ };
3888
+ class ReaddirpStream extends Readable {
3889
+ static get defaultOptions() {
3890
+ return {
3891
+ root: '.',
3892
+ fileFilter: (path)=>true,
3893
+ directoryFilter: (path)=>true,
3894
+ type: FILE_TYPE,
3895
+ lstat: false,
3896
+ depth: 2147483648,
3897
+ alwaysStat: false
3898
+ };
3899
+ }
3900
+ constructor(options = {}){
3901
+ super({
3902
+ objectMode: true,
3903
+ autoDestroy: true,
3904
+ highWaterMark: options.highWaterMark || 4096
3905
+ });
3906
+ const opts = {
3907
+ ...ReaddirpStream.defaultOptions,
3908
+ ...options
3909
+ };
3910
+ const { root, type } = opts;
3911
+ this._fileFilter = normalizeFilter(opts.fileFilter);
3912
+ this._directoryFilter = normalizeFilter(opts.directoryFilter);
3913
+ const statMethod = opts.lstat ? lstat : stat;
3914
+ if (wantBigintFsStats) this._stat = (path)=>statMethod(path, {
3915
+ bigint: true
3916
+ });
3917
+ else this._stat = statMethod;
3918
+ this._maxDepth = opts.depth;
3919
+ this._wantsDir = [
3920
+ DIR_TYPE,
3921
+ FILE_DIR_TYPE,
3922
+ EVERYTHING_TYPE
3923
+ ].includes(type);
3924
+ this._wantsFile = [
3925
+ FILE_TYPE,
3926
+ FILE_DIR_TYPE,
3927
+ EVERYTHING_TYPE
3928
+ ].includes(type);
3929
+ this._wantsEverything = type === EVERYTHING_TYPE;
3930
+ this._root = sysPath.resolve(root);
3931
+ this._isDirent = 'Dirent' in fs && !opts.alwaysStat;
3932
+ this._statsProp = this._isDirent ? 'dirent' : 'stats';
3933
+ this._rdOptions = {
3934
+ encoding: 'utf8',
3935
+ withFileTypes: this._isDirent
3936
+ };
3937
+ this.parents = [
3938
+ this._exploreDir(root, 1)
3939
+ ];
3940
+ this.reading = false;
3941
+ this.parent = void 0;
3942
+ }
3943
+ async _read(batch) {
3944
+ if (this.reading) return;
3945
+ this.reading = true;
3946
+ try {
3947
+ while(!this.destroyed && batch > 0){
3948
+ const { path, depth, files = [] } = this.parent || {};
3949
+ if (files.length > 0) {
3950
+ const slice = files.splice(0, batch).map((dirent)=>this._formatEntry(dirent, path));
3951
+ for (const entry of (await Promise.all(slice))){
3952
+ if (this.destroyed) return;
3953
+ const entryType = await this._getEntryType(entry);
3954
+ if ('directory' === entryType && this._directoryFilter(entry)) {
3955
+ if (depth <= this._maxDepth) this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
3956
+ if (this._wantsDir) {
3957
+ this.push(entry);
3958
+ batch--;
3959
+ }
3960
+ } else if (('file' === entryType || this._includeAsFile(entry)) && this._fileFilter(entry)) {
3961
+ if (this._wantsFile) {
3962
+ this.push(entry);
3963
+ batch--;
3964
+ }
3965
+ }
3966
+ }
3967
+ } else {
3968
+ const parent = this.parents.pop();
3969
+ if (!parent) {
3970
+ this.push(null);
3971
+ break;
3972
+ }
3973
+ this.parent = await parent;
3974
+ if (this.destroyed) return;
3975
+ }
3976
+ }
3977
+ } catch (error) {
3978
+ this.destroy(error);
3979
+ } finally{
3980
+ this.reading = false;
3981
+ }
3982
+ }
3983
+ async _exploreDir(path, depth) {
3984
+ let files;
3985
+ try {
3986
+ files = await readdir(path, this._rdOptions);
3987
+ } catch (error) {
3988
+ this._onError(error);
3989
+ }
3990
+ return {
3991
+ files,
3992
+ depth,
3993
+ path
3994
+ };
3995
+ }
3996
+ async _formatEntry(dirent, path) {
3997
+ let entry;
3998
+ try {
3999
+ const basename = this._isDirent ? dirent.name : dirent;
4000
+ const fullPath = sysPath.resolve(sysPath.join(path, basename));
4001
+ entry = {
4002
+ path: sysPath.relative(this._root, fullPath),
4003
+ fullPath,
4004
+ basename
4005
+ };
4006
+ entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
4007
+ } catch (err) {
4008
+ this._onError(err);
4009
+ }
4010
+ return entry;
4011
+ }
4012
+ _onError(err) {
4013
+ if (isNormalFlowError(err) && !this.destroyed) this.emit('warn', err);
4014
+ else this.destroy(err);
4015
+ }
4016
+ async _getEntryType(entry) {
4017
+ const stats = entry && entry[this._statsProp];
4018
+ if (!stats) return;
4019
+ if (stats.isFile()) return 'file';
4020
+ if (stats.isDirectory()) return 'directory';
4021
+ if (stats && stats.isSymbolicLink()) {
4022
+ const full = entry.fullPath;
4023
+ try {
4024
+ const entryRealPath = await realpath(full);
4025
+ const entryRealPathStats = await lstat(entryRealPath);
4026
+ if (entryRealPathStats.isFile()) return 'file';
4027
+ if (entryRealPathStats.isDirectory()) {
4028
+ const len = entryRealPath.length;
4029
+ if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) {
4030
+ const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
4031
+ recursiveError.code = RECURSIVE_ERROR_CODE;
4032
+ return this._onError(recursiveError);
4033
+ }
4034
+ return 'directory';
4035
+ }
4036
+ } catch (error) {
4037
+ this._onError(error);
4038
+ }
4039
+ }
4040
+ }
4041
+ _includeAsFile(entry) {
4042
+ const stats = entry && entry[this._statsProp];
4043
+ return stats && this._wantsEverything && !stats.isDirectory();
4044
+ }
4045
+ }
4046
+ const readdirp = (root, options = {})=>{
4047
+ let type = options.entryType || options.type;
4048
+ if ('both' === type) type = FILE_DIR_TYPE;
4049
+ if (type) options.type = type;
4050
+ if (root) {
4051
+ if ('string' != typeof root) throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)');
4052
+ else if (type && !ALL_TYPES.includes(type)) throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`);
4053
+ } else throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)');
4054
+ options.root = root;
4055
+ return new ReaddirpStream(options);
4056
+ };
4057
+ const readdirpPromise = (root, options = {})=>new Promise((resolve, reject)=>{
4058
+ const files = [];
4059
+ readdirp(root, options).on('data', (entry)=>files.push(entry)).on('end', ()=>resolve(files)).on('error', (error)=>reject(error));
4060
+ });
4061
+ readdirp.promise = readdirpPromise;
4062
+ readdirp.ReaddirpStream = ReaddirpStream;
4063
+ readdirp.default = readdirp;
4064
+ module.exports = readdirp;
4065
+ },
4066
+ "../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js" (module, __unused_rspack_exports, __webpack_require__) {
4067
+ /*!
4068
+ * to-regex-range <https://github.com/micromatch/to-regex-range>
4069
+ *
4070
+ * Copyright (c) 2015-present, Jon Schlinkert.
4071
+ * Released under the MIT License.
4072
+ */ const isNumber = __webpack_require__("../../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.js");
4073
+ const toRegexRange = (min, max, options)=>{
4074
+ if (false === isNumber(min)) throw new TypeError('toRegexRange: expected the first argument to be a number');
4075
+ if (void 0 === max || min === max) return String(min);
4076
+ if (false === isNumber(max)) throw new TypeError('toRegexRange: expected the second argument to be a number.');
4077
+ let opts = {
4078
+ relaxZeros: true,
4079
+ ...options
4080
+ };
4081
+ if ('boolean' == typeof opts.strictZeros) opts.relaxZeros = false === opts.strictZeros;
4082
+ let relax = String(opts.relaxZeros);
4083
+ let shorthand = String(opts.shorthand);
4084
+ let capture = String(opts.capture);
4085
+ let wrap = String(opts.wrap);
4086
+ let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap;
4087
+ if (toRegexRange.cache.hasOwnProperty(cacheKey)) return toRegexRange.cache[cacheKey].result;
4088
+ let a = Math.min(min, max);
4089
+ let b = Math.max(min, max);
4090
+ if (1 === Math.abs(a - b)) {
4091
+ let result = min + '|' + max;
4092
+ if (opts.capture) return `(${result})`;
4093
+ if (false === opts.wrap) return result;
4094
+ return `(?:${result})`;
4095
+ }
4096
+ let isPadded = hasPadding(min) || hasPadding(max);
4097
+ let state = {
4098
+ min,
4099
+ max,
4100
+ a,
4101
+ b
4102
+ };
4103
+ let positives = [];
4104
+ let negatives = [];
4105
+ if (isPadded) {
4106
+ state.isPadded = isPadded;
4107
+ state.maxLen = String(state.max).length;
4108
+ }
4109
+ if (a < 0) {
4110
+ let newMin = b < 0 ? Math.abs(b) : 1;
4111
+ negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
4112
+ a = state.a = 0;
4113
+ }
4114
+ if (b >= 0) positives = splitToPatterns(a, b, state, opts);
4115
+ state.negatives = negatives;
4116
+ state.positives = positives;
4117
+ state.result = collatePatterns(negatives, positives, opts);
4118
+ if (true === opts.capture) state.result = `(${state.result})`;
4119
+ else if (false !== opts.wrap && positives.length + negatives.length > 1) state.result = `(?:${state.result})`;
4120
+ toRegexRange.cache[cacheKey] = state;
4121
+ return state.result;
4122
+ };
4123
+ function collatePatterns(neg, pos, options) {
4124
+ let onlyNegative = filterPatterns(neg, pos, '-', false, options) || [];
4125
+ let onlyPositive = filterPatterns(pos, neg, '', false, options) || [];
4126
+ let intersected = filterPatterns(neg, pos, '-?', true, options) || [];
4127
+ let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
4128
+ return subpatterns.join('|');
4129
+ }
4130
+ function splitToRanges(min, max) {
4131
+ let nines = 1;
4132
+ let zeros = 1;
4133
+ let stop = countNines(min, nines);
4134
+ let stops = new Set([
4135
+ max
4136
+ ]);
4137
+ while(min <= stop && stop <= max){
4138
+ stops.add(stop);
4139
+ nines += 1;
4140
+ stop = countNines(min, nines);
4141
+ }
4142
+ stop = countZeros(max + 1, zeros) - 1;
4143
+ while(min < stop && stop <= max){
4144
+ stops.add(stop);
4145
+ zeros += 1;
4146
+ stop = countZeros(max + 1, zeros) - 1;
4147
+ }
4148
+ stops = [
4149
+ ...stops
4150
+ ];
4151
+ stops.sort(compare);
4152
+ return stops;
4153
+ }
4154
+ function rangeToPattern(start, stop, options) {
4155
+ if (start === stop) return {
4156
+ pattern: start,
4157
+ count: [],
4158
+ digits: 0
4159
+ };
4160
+ let zipped = zip(start, stop);
4161
+ let digits = zipped.length;
4162
+ let pattern = '';
4163
+ let count = 0;
4164
+ for(let i = 0; i < digits; i++){
4165
+ let [startDigit, stopDigit] = zipped[i];
4166
+ if (startDigit === stopDigit) pattern += startDigit;
4167
+ else if ('0' !== startDigit || '9' !== stopDigit) pattern += toCharacterClass(startDigit, stopDigit, options);
4168
+ else count++;
4169
+ }
4170
+ if (count) pattern += true === options.shorthand ? '\\d' : '[0-9]';
4171
+ return {
4172
+ pattern,
4173
+ count: [
4174
+ count
4175
+ ],
4176
+ digits
4177
+ };
4178
+ }
4179
+ function splitToPatterns(min, max, tok, options) {
4180
+ let ranges = splitToRanges(min, max);
4181
+ let tokens = [];
4182
+ let start = min;
4183
+ let prev;
4184
+ for(let i = 0; i < ranges.length; i++){
4185
+ let max = ranges[i];
4186
+ let obj = rangeToPattern(String(start), String(max), options);
4187
+ let zeros = '';
4188
+ if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
4189
+ if (prev.count.length > 1) prev.count.pop();
4190
+ prev.count.push(obj.count[0]);
4191
+ prev.string = prev.pattern + toQuantifier(prev.count);
4192
+ start = max + 1;
4193
+ continue;
4194
+ }
4195
+ if (tok.isPadded) zeros = padZeros(max, tok, options);
4196
+ obj.string = zeros + obj.pattern + toQuantifier(obj.count);
4197
+ tokens.push(obj);
4198
+ start = max + 1;
4199
+ prev = obj;
4200
+ }
4201
+ return tokens;
4202
+ }
4203
+ function filterPatterns(arr, comparison, prefix, intersection, options) {
4204
+ let result = [];
4205
+ for (let ele of arr){
4206
+ let { string } = ele;
4207
+ if (!intersection && !contains(comparison, 'string', string)) result.push(prefix + string);
4208
+ if (intersection && contains(comparison, 'string', string)) result.push(prefix + string);
4209
+ }
4210
+ return result;
4211
+ }
4212
+ function zip(a, b) {
4213
+ let arr = [];
4214
+ for(let i = 0; i < a.length; i++)arr.push([
4215
+ a[i],
4216
+ b[i]
4217
+ ]);
4218
+ return arr;
4219
+ }
4220
+ function compare(a, b) {
4221
+ return a > b ? 1 : b > a ? -1 : 0;
4222
+ }
4223
+ function contains(arr, key, val) {
4224
+ return arr.some((ele)=>ele[key] === val);
4225
+ }
4226
+ function countNines(min, len) {
4227
+ return Number(String(min).slice(0, -len) + '9'.repeat(len));
4228
+ }
4229
+ function countZeros(integer, zeros) {
4230
+ return integer - integer % Math.pow(10, zeros);
4231
+ }
4232
+ function toQuantifier(digits) {
4233
+ let [start = 0, stop = ''] = digits;
4234
+ if (stop || start > 1) return `{${start + (stop ? ',' + stop : '')}}`;
4235
+ return '';
4236
+ }
4237
+ function toCharacterClass(a, b, options) {
4238
+ return `[${a}${b - a === 1 ? '' : '-'}${b}]`;
4239
+ }
4240
+ function hasPadding(str) {
4241
+ return /^-?(0+)\d/.test(str);
4242
+ }
4243
+ function padZeros(value, tok, options) {
4244
+ if (!tok.isPadded) return value;
4245
+ let diff = Math.abs(tok.maxLen - String(value).length);
4246
+ let relax = false !== options.relaxZeros;
4247
+ switch(diff){
4248
+ case 0:
4249
+ return '';
4250
+ case 1:
4251
+ return relax ? '0?' : '0';
4252
+ case 2:
4253
+ return relax ? '0{0,2}' : '00';
4254
+ default:
4255
+ return relax ? `0{0,${diff}}` : `0{${diff}}`;
4256
+ }
4257
+ }
4258
+ toRegexRange.cache = {};
4259
+ toRegexRange.clearCache = ()=>toRegexRange.cache = {};
4260
+ module.exports = toRegexRange;
4261
+ },
4262
+ events (module) {
4263
+ module.exports = __rspack_createRequire_require("events");
4264
+ },
4265
+ os (module) {
4266
+ module.exports = __rspack_createRequire_require("os");
4267
+ },
4268
+ util (module) {
4269
+ module.exports = __rspack_createRequire_require("util");
4270
+ },
4271
+ "../../node_modules/.pnpm/binary-extensions@2.3.0/node_modules/binary-extensions/binary-extensions.json" (module) {
4272
+ module.exports = JSON.parse('["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]');
4273
+ }
4274
+ });
4275
+ function toArr(any) {
4276
+ return null == any ? [] : Array.isArray(any) ? any : [
4277
+ any
4278
+ ];
4279
+ }
4280
+ function toVal(out, key, val, opts) {
4281
+ var x, old = out[key], nxt = ~opts.string.indexOf(key) ? null == val || true === val ? "" : String(val) : "boolean" == typeof val ? val : ~opts.boolean.indexOf(key) ? "false" === val ? false : "true" === val || (out._.push((x = +val, 0 * x === 0) ? x : val), !!val) : (x = +val, 0 * x === 0) ? x : val;
4282
+ out[key] = null == old ? nxt : Array.isArray(old) ? old.concat(nxt) : [
4283
+ old,
4284
+ nxt
4285
+ ];
4286
+ }
4287
+ function lib_default(args, opts) {
4288
+ args = args || [];
4289
+ opts = opts || {};
4290
+ var k, arr, arg, name, val, out = {
4291
+ _: []
4292
+ };
4293
+ var i = 0, j = 0, idx = 0, len = args.length;
4294
+ const alibi = void 0 !== opts.alias;
4295
+ const strict = void 0 !== opts.unknown;
4296
+ const defaults = void 0 !== opts.default;
4297
+ opts.alias = opts.alias || {};
4298
+ opts.string = toArr(opts.string);
4299
+ opts.boolean = toArr(opts.boolean);
4300
+ if (alibi) for(k in opts.alias){
4301
+ arr = opts.alias[k] = toArr(opts.alias[k]);
4302
+ for(i = 0; i < arr.length; i++)(opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);
4303
+ }
4304
+ for(i = opts.boolean.length; i-- > 0;){
4305
+ arr = opts.alias[opts.boolean[i]] || [];
4306
+ for(j = arr.length; j-- > 0;)opts.boolean.push(arr[j]);
4307
+ }
4308
+ for(i = opts.string.length; i-- > 0;){
4309
+ arr = opts.alias[opts.string[i]] || [];
4310
+ for(j = arr.length; j-- > 0;)opts.string.push(arr[j]);
4311
+ }
4312
+ if (defaults) for(k in opts.default){
4313
+ name = typeof opts.default[k];
4314
+ arr = opts.alias[k] = opts.alias[k] || [];
4315
+ if (void 0 !== opts[name]) {
4316
+ opts[name].push(k);
4317
+ for(i = 0; i < arr.length; i++)opts[name].push(arr[i]);
4318
+ }
4319
+ }
4320
+ const keys = strict ? Object.keys(opts.alias) : [];
4321
+ for(i = 0; i < len; i++){
4322
+ arg = args[i];
4323
+ if ("--" === arg) {
4324
+ out._ = out._.concat(args.slice(++i));
4325
+ break;
4326
+ }
4327
+ for(j = 0; j < arg.length && 45 === arg.charCodeAt(j); j++);
4328
+ if (0 === j) out._.push(arg);
4329
+ else if ("no-" === arg.substring(j, j + 3)) {
4330
+ name = arg.substring(j + 3);
4331
+ if (strict && !~keys.indexOf(name)) return opts.unknown(arg);
4332
+ out[name] = false;
4333
+ } else {
4334
+ for(idx = j + 1; idx < arg.length && 61 !== arg.charCodeAt(idx); idx++);
4335
+ name = arg.substring(j, idx);
4336
+ val = arg.substring(++idx) || i + 1 === len || 45 === ("" + args[i + 1]).charCodeAt(0) || args[++i];
4337
+ arr = 2 === j ? [
4338
+ name
4339
+ ] : name;
4340
+ for(idx = 0; idx < arr.length; idx++){
4341
+ name = arr[idx];
4342
+ if (strict && !~keys.indexOf(name)) return opts.unknown("-".repeat(j) + name);
4343
+ toVal(out, name, idx + 1 < arr.length || val, opts);
4344
+ }
4345
+ }
4346
+ }
4347
+ if (defaults) {
4348
+ for(k in opts.default)if (void 0 === out[k]) out[k] = opts.default[k];
4349
+ }
4350
+ if (alibi) for(k in out){
4351
+ arr = opts.alias[k] || [];
4352
+ while(arr.length > 0)out[arr.shift()] = out[k];
4353
+ }
4354
+ return out;
4355
+ }
4356
+ function removeBrackets(v) {
4357
+ return v.replace(/[<[].+/, "").trim();
4358
+ }
4359
+ function findAllBrackets(v) {
4360
+ const ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g;
4361
+ const SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g;
4362
+ const res = [];
4363
+ const parse = (match)=>{
4364
+ let variadic = false;
4365
+ let value = match[1];
4366
+ if (value.startsWith("...")) {
4367
+ value = value.slice(3);
4368
+ variadic = true;
4369
+ }
4370
+ return {
4371
+ required: match[0].startsWith("<"),
4372
+ value,
4373
+ variadic
4374
+ };
4375
+ };
4376
+ let angledMatch;
4377
+ while(angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v))res.push(parse(angledMatch));
4378
+ let squareMatch;
4379
+ while(squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v))res.push(parse(squareMatch));
4380
+ return res;
4381
+ }
4382
+ function getMriOptions(options) {
4383
+ const result = {
4384
+ alias: {},
4385
+ boolean: []
4386
+ };
4387
+ for (const [index, option] of options.entries()){
4388
+ if (option.names.length > 1) result.alias[option.names[0]] = option.names.slice(1);
4389
+ if (option.isBoolean) if (option.negated) {
4390
+ if (!options.some((o, i)=>i !== index && o.names.some((name)=>option.names.includes(name)) && "boolean" == typeof o.required)) result.boolean.push(option.names[0]);
4391
+ } else result.boolean.push(option.names[0]);
4392
+ }
4393
+ return result;
4394
+ }
4395
+ function findLongest(arr) {
4396
+ return arr.sort((a, b)=>a.length > b.length ? -1 : 1)[0];
4397
+ }
4398
+ function padRight(str, length) {
4399
+ return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`;
4400
+ }
4401
+ function camelcase(input) {
4402
+ return input.replaceAll(/([a-z])-([a-z])/g, (_, p1, p2)=>p1 + p2.toUpperCase());
4403
+ }
4404
+ function setDotProp(obj, keys, val) {
4405
+ let current = obj;
4406
+ for(let i = 0; i < keys.length; i++){
4407
+ const key = keys[i];
4408
+ if (i === keys.length - 1) {
4409
+ current[key] = val;
4410
+ return;
4411
+ }
4412
+ if (null == current[key]) {
4413
+ const nextKeyIsArrayIndex = +keys[i + 1] > -1;
4414
+ current[key] = nextKeyIsArrayIndex ? [] : {};
4415
+ }
4416
+ current = current[key];
4417
+ }
4418
+ }
4419
+ function setByType(obj, transforms) {
4420
+ for (const key of Object.keys(transforms)){
4421
+ const transform = transforms[key];
4422
+ if (transform.shouldTransform) {
4423
+ obj[key] = [
4424
+ obj[key]
4425
+ ].flat();
4426
+ if ("function" == typeof transform.transformFunction) obj[key] = obj[key].map(transform.transformFunction);
4427
+ }
4428
+ }
4429
+ }
4430
+ function getFileName(input) {
4431
+ const m = /([^\\/]+)$/.exec(input);
4432
+ return m ? m[1] : "";
4433
+ }
4434
+ function camelcaseOptionName(name) {
4435
+ return name.split(".").map((v, i)=>0 === i ? camelcase(v) : v).join(".");
4436
+ }
4437
+ var CACError = class extends Error {
4438
+ constructor(message){
4439
+ super(message);
4440
+ this.name = "CACError";
4441
+ if ("function" != typeof Error.captureStackTrace) this.stack = new Error(message).stack;
4442
+ }
4443
+ };
4444
+ var Option = class {
4445
+ rawName;
4446
+ description;
4447
+ name;
4448
+ names;
4449
+ isBoolean;
4450
+ required;
4451
+ config;
4452
+ negated;
4453
+ constructor(rawName, description, config){
4454
+ this.rawName = rawName;
4455
+ this.description = description;
4456
+ this.config = Object.assign({}, config);
4457
+ rawName = rawName.replaceAll(".*", "");
4458
+ this.negated = false;
4459
+ this.names = removeBrackets(rawName).split(",").map((v)=>{
4460
+ let name = v.trim().replace(/^-{1,2}/, "");
4461
+ if (name.startsWith("no-")) {
4462
+ this.negated = true;
4463
+ name = name.replace(/^no-/, "");
4464
+ }
4465
+ return camelcaseOptionName(name);
4466
+ }).sort((a, b)=>a.length > b.length ? 1 : -1);
4467
+ this.name = this.names.at(-1);
4468
+ if (this.negated && null == this.config.default) this.config.default = true;
4469
+ if (rawName.includes("<")) this.required = true;
4470
+ else if (rawName.includes("[")) this.required = false;
4471
+ else this.isBoolean = true;
4472
+ }
4473
+ };
4474
+ let runtimeProcessArgs;
4475
+ let runtimeInfo;
4476
+ if ("u" > typeof process) {
4477
+ let runtimeName;
4478
+ runtimeName = "u" > typeof Deno && "string" == typeof Deno.version?.deno ? "deno" : "u" > typeof Bun && "string" == typeof Bun.version ? "bun" : "node";
4479
+ runtimeInfo = `${process.platform}-${process.arch} ${runtimeName}-${process.version}`;
4480
+ runtimeProcessArgs = process.argv;
4481
+ } else runtimeInfo = "u" < typeof navigator ? "unknown" : `${navigator.platform} ${navigator.userAgent}`;
4482
+ var Command = class {
4483
+ rawName;
4484
+ description;
4485
+ config;
4486
+ cli;
4487
+ options;
4488
+ aliasNames;
4489
+ name;
4490
+ args;
4491
+ commandAction;
4492
+ usageText;
4493
+ versionNumber;
4494
+ examples;
4495
+ helpCallback;
4496
+ globalCommand;
4497
+ constructor(rawName, description, config = {}, cli){
4498
+ this.rawName = rawName;
4499
+ this.description = description;
4500
+ this.config = config;
4501
+ this.cli = cli;
4502
+ this.options = [];
4503
+ this.aliasNames = [];
4504
+ this.name = removeBrackets(rawName);
4505
+ this.args = findAllBrackets(rawName);
4506
+ this.examples = [];
4507
+ }
4508
+ usage(text) {
4509
+ this.usageText = text;
4510
+ return this;
4511
+ }
4512
+ allowUnknownOptions() {
4513
+ this.config.allowUnknownOptions = true;
4514
+ return this;
4515
+ }
4516
+ ignoreOptionDefaultValue() {
4517
+ this.config.ignoreOptionDefaultValue = true;
4518
+ return this;
4519
+ }
4520
+ version(version, customFlags = "-v, --version") {
4521
+ this.versionNumber = version;
4522
+ this.option(customFlags, "Display version number");
4523
+ return this;
4524
+ }
4525
+ example(example) {
4526
+ this.examples.push(example);
4527
+ return this;
4528
+ }
4529
+ option(rawName, description, config) {
4530
+ const option = new Option(rawName, description, config);
4531
+ this.options.push(option);
4532
+ return this;
4533
+ }
4534
+ alias(name) {
4535
+ this.aliasNames.push(name);
4536
+ return this;
4537
+ }
4538
+ action(callback) {
4539
+ this.commandAction = callback;
4540
+ return this;
4541
+ }
4542
+ isMatched(name) {
4543
+ return this.name === name || this.aliasNames.includes(name);
4544
+ }
4545
+ get isDefaultCommand() {
4546
+ return "" === this.name || this.aliasNames.includes("!");
4547
+ }
4548
+ get isGlobalCommand() {
4549
+ return this instanceof GlobalCommand;
4550
+ }
4551
+ hasOption(name) {
4552
+ name = name.split(".")[0];
4553
+ return this.options.find((option)=>option.names.includes(name));
4554
+ }
4555
+ outputHelp() {
4556
+ const { name, commands } = this.cli;
4557
+ const { versionNumber, options: globalOptions, helpCallback } = this.cli.globalCommand;
4558
+ let sections = [
4559
+ {
4560
+ body: `${name}${versionNumber ? `/${versionNumber}` : ""}`
4561
+ }
4562
+ ];
4563
+ sections.push({
4564
+ title: "Usage",
4565
+ body: ` $ ${name} ${this.usageText || this.rawName}`
4566
+ });
4567
+ if ((this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0) {
4568
+ const longestCommandName = findLongest(commands.map((command)=>command.rawName));
4569
+ sections.push({
4570
+ title: "Commands",
4571
+ body: commands.map((command)=>` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`).join("\n")
4572
+ }, {
4573
+ title: "For more info, run any command with the `--help` flag",
4574
+ body: commands.map((command)=>` $ ${name}${"" === command.name ? "" : ` ${command.name}`} --help`).join("\n")
4575
+ });
4576
+ }
4577
+ let options = this.isGlobalCommand ? globalOptions : [
4578
+ ...this.options,
4579
+ ...globalOptions || []
4580
+ ];
4581
+ if (!this.isGlobalCommand && !this.isDefaultCommand) options = options.filter((option)=>"version" !== option.name);
4582
+ if (options.length > 0) {
4583
+ const longestOptionName = findLongest(options.map((option)=>option.rawName));
4584
+ sections.push({
4585
+ title: "Options",
4586
+ body: options.map((option)=>` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${void 0 === option.config.default ? "" : `(default: ${option.config.default})`}`).join("\n")
4587
+ });
4588
+ }
4589
+ if (this.examples.length > 0) sections.push({
4590
+ title: "Examples",
4591
+ body: this.examples.map((example)=>{
4592
+ if ("function" == typeof example) return example(name);
4593
+ return example;
4594
+ }).join("\n")
4595
+ });
4596
+ if (helpCallback) sections = helpCallback(sections) || sections;
4597
+ console.info(sections.map((section)=>section.title ? `${section.title}:\n${section.body}` : section.body).join("\n\n"));
4598
+ }
4599
+ outputVersion() {
4600
+ const { name } = this.cli;
4601
+ const { versionNumber } = this.cli.globalCommand;
4602
+ if (versionNumber) console.info(`${name}/${versionNumber} ${runtimeInfo}`);
4603
+ }
4604
+ checkRequiredArgs() {
4605
+ const minimalArgsCount = this.args.filter((arg)=>arg.required).length;
4606
+ if (this.cli.args.length < minimalArgsCount) throw new CACError(`missing required args for command \`${this.rawName}\``);
4607
+ }
4608
+ checkUnknownOptions() {
4609
+ const { options, globalCommand } = this.cli;
4610
+ if (!this.config.allowUnknownOptions) {
4611
+ for (const name of Object.keys(options))if ("--" !== name && !this.hasOption(name) && !globalCommand.hasOption(name)) throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``);
4612
+ }
4613
+ }
4614
+ checkOptionValue() {
4615
+ const { options: parsedOptions, globalCommand } = this.cli;
4616
+ const options = [
4617
+ ...globalCommand.options,
4618
+ ...this.options
4619
+ ];
4620
+ for (const option of options){
4621
+ const value = parsedOptions[option.name.split(".")[0]];
4622
+ if (option.required) {
4623
+ const hasNegated = options.some((o)=>o.negated && o.names.includes(option.name));
4624
+ if (true === value || false === value && !hasNegated) throw new CACError(`option \`${option.rawName}\` value is missing`);
4625
+ }
4626
+ }
4627
+ }
4628
+ checkUnusedArgs() {
4629
+ const maximumArgsCount = this.args.some((arg)=>arg.variadic) ? 1 / 0 : this.args.length;
4630
+ if (maximumArgsCount < this.cli.args.length) throw new CACError(`Unused args: ${this.cli.args.slice(maximumArgsCount).map((arg)=>`\`${arg}\``).join(", ")}`);
4631
+ }
4632
+ };
4633
+ var GlobalCommand = class extends Command {
4634
+ constructor(cli){
4635
+ super("@@global@@", "", {}, cli);
4636
+ }
4637
+ };
4638
+ var CAC = class extends EventTarget {
4639
+ name;
4640
+ commands;
4641
+ globalCommand;
4642
+ matchedCommand;
4643
+ matchedCommandName;
4644
+ rawArgs;
4645
+ args;
4646
+ options;
4647
+ showHelpOnExit;
4648
+ showVersionOnExit;
4649
+ constructor(name = ""){
4650
+ super();
4651
+ this.name = name;
4652
+ this.commands = [];
4653
+ this.rawArgs = [];
4654
+ this.args = [];
4655
+ this.options = {};
4656
+ this.globalCommand = new GlobalCommand(this);
4657
+ this.globalCommand.usage("<command> [options]");
4658
+ }
4659
+ usage(text) {
4660
+ this.globalCommand.usage(text);
4661
+ return this;
4662
+ }
4663
+ command(rawName, description, config) {
4664
+ const command = new Command(rawName, description || "", config, this);
4665
+ command.globalCommand = this.globalCommand;
4666
+ this.commands.push(command);
4667
+ return command;
4668
+ }
4669
+ option(rawName, description, config) {
4670
+ this.globalCommand.option(rawName, description, config);
4671
+ return this;
4672
+ }
4673
+ help(callback) {
4674
+ this.globalCommand.option("-h, --help", "Display this message");
4675
+ this.globalCommand.helpCallback = callback;
4676
+ this.showHelpOnExit = true;
4677
+ return this;
4678
+ }
4679
+ version(version, customFlags = "-v, --version") {
4680
+ this.globalCommand.version(version, customFlags);
4681
+ this.showVersionOnExit = true;
4682
+ return this;
4683
+ }
4684
+ example(example) {
4685
+ this.globalCommand.example(example);
4686
+ return this;
4687
+ }
4688
+ outputHelp() {
4689
+ if (this.matchedCommand) this.matchedCommand.outputHelp();
4690
+ else this.globalCommand.outputHelp();
4691
+ }
4692
+ outputVersion() {
4693
+ this.globalCommand.outputVersion();
4694
+ }
4695
+ setParsedInfo({ args, options }, matchedCommand, matchedCommandName) {
4696
+ this.args = args;
4697
+ this.options = options;
4698
+ if (matchedCommand) this.matchedCommand = matchedCommand;
4699
+ if (matchedCommandName) this.matchedCommandName = matchedCommandName;
4700
+ return this;
4701
+ }
4702
+ unsetMatchedCommand() {
4703
+ this.matchedCommand = void 0;
4704
+ this.matchedCommandName = void 0;
4705
+ }
4706
+ parse(argv, { run = true } = {}) {
4707
+ if (!argv) {
4708
+ if (!runtimeProcessArgs) throw new Error("No argv provided and runtime process argv is not available.");
4709
+ argv = runtimeProcessArgs;
4710
+ }
4711
+ this.rawArgs = argv;
4712
+ if (!this.name) this.name = argv[1] ? getFileName(argv[1]) : "cli";
4713
+ let shouldParse = true;
4714
+ for (const command of this.commands){
4715
+ const parsed = this.mri(argv.slice(2), command);
4716
+ const commandName = parsed.args[0];
4717
+ if (command.isMatched(commandName)) {
4718
+ shouldParse = false;
4719
+ const parsedInfo = {
4720
+ ...parsed,
4721
+ args: parsed.args.slice(1)
4722
+ };
4723
+ this.setParsedInfo(parsedInfo, command, commandName);
4724
+ this.dispatchEvent(new CustomEvent(`command:${commandName}`, {
4725
+ detail: command
4726
+ }));
4727
+ }
4728
+ }
4729
+ if (shouldParse) {
4730
+ for (const command of this.commands)if (command.isDefaultCommand) {
4731
+ shouldParse = false;
4732
+ const parsed = this.mri(argv.slice(2), command);
4733
+ this.setParsedInfo(parsed, command);
4734
+ this.dispatchEvent(new CustomEvent("command:!", {
4735
+ detail: command
4736
+ }));
4737
+ }
4738
+ }
4739
+ if (shouldParse) {
4740
+ const parsed = this.mri(argv.slice(2));
4741
+ this.setParsedInfo(parsed);
4742
+ }
4743
+ if (this.options.help && this.showHelpOnExit) {
4744
+ this.outputHelp();
4745
+ run = false;
4746
+ this.unsetMatchedCommand();
4747
+ }
4748
+ if (this.options.version && this.showVersionOnExit && null == this.matchedCommandName) {
4749
+ this.outputVersion();
4750
+ run = false;
4751
+ this.unsetMatchedCommand();
4752
+ }
4753
+ const parsedArgv = {
4754
+ args: this.args,
4755
+ options: this.options
4756
+ };
4757
+ if (run) this.runMatchedCommand();
4758
+ if (!this.matchedCommand && this.args[0]) this.dispatchEvent(new CustomEvent("command:*", {
4759
+ detail: this.args[0]
4760
+ }));
4761
+ return parsedArgv;
4762
+ }
4763
+ mri(argv, command) {
4764
+ const cliOptions = [
4765
+ ...this.globalCommand.options,
4766
+ ...command ? command.options : []
4767
+ ];
4768
+ const mriOptions = getMriOptions(cliOptions);
4769
+ let argsAfterDoubleDashes = [];
4770
+ const doubleDashesIndex = argv.indexOf("--");
4771
+ if (-1 !== doubleDashesIndex) {
4772
+ argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1);
4773
+ argv = argv.slice(0, doubleDashesIndex);
4774
+ }
4775
+ let parsed = lib_default(argv, mriOptions);
4776
+ parsed = Object.keys(parsed).reduce((res, name)=>({
4777
+ ...res,
4778
+ [camelcaseOptionName(name)]: parsed[name]
4779
+ }), {
4780
+ _: []
4781
+ });
4782
+ const args = parsed._;
4783
+ const options = {
4784
+ "--": argsAfterDoubleDashes
4785
+ };
4786
+ const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue;
4787
+ const transforms = Object.create(null);
4788
+ for (const cliOption of cliOptions){
4789
+ if (!ignoreDefault && void 0 !== cliOption.config.default) for (const name of cliOption.names)options[name] = cliOption.config.default;
4790
+ if (Array.isArray(cliOption.config.type) && void 0 === transforms[cliOption.name]) {
4791
+ transforms[cliOption.name] = Object.create(null);
4792
+ transforms[cliOption.name].shouldTransform = true;
4793
+ transforms[cliOption.name].transformFunction = cliOption.config.type[0];
4794
+ }
4795
+ }
4796
+ for (const key of Object.keys(parsed))if ("_" !== key) {
4797
+ setDotProp(options, key.split("."), parsed[key]);
4798
+ setByType(options, transforms);
4799
+ }
4800
+ return {
4801
+ args,
4802
+ options
4803
+ };
4804
+ }
4805
+ runMatchedCommand() {
4806
+ const { args, options, matchedCommand: command } = this;
4807
+ if (!command || !command.commandAction) return;
4808
+ command.checkUnknownOptions();
4809
+ command.checkOptionValue();
4810
+ command.checkRequiredArgs();
4811
+ command.checkUnusedArgs();
4812
+ const actionArgs = [];
4813
+ command.args.forEach((arg, index)=>{
4814
+ if (arg.variadic) actionArgs.push(args.slice(index));
4815
+ else actionArgs.push(args[index]);
4816
+ });
4817
+ actionArgs.push(options);
4818
+ return command.commandAction.apply(this, actionArgs);
4819
+ }
4820
+ };
4821
+ const cac = (name = "")=>new CAC(name);
4822
+ export { default as node_path, join } from "node:path";
4823
+ export { logger } from "@rspress/shared/logger";
4824
+ export { default as node_fs } from "node:fs";
4825
+ export { DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "@rspress/shared/constants";
4826
+ export { default as promises } from "node:fs/promises";
4827
+ export { cac };