UNPKG

738 kBJavaScriptView Raw
1import { createRequire as __prettierCreateRequire } from "module";
2import { fileURLToPath as __prettierFileUrlToPath } from "url";
3import { dirname as __prettierDirname } from "path";
4const require = __prettierCreateRequire(import.meta.url);
5const __filename = __prettierFileUrlToPath(import.meta.url);
6const __dirname = __prettierDirname(__filename);
7
8var __create = Object.create;
9var __defProp = Object.defineProperty;
10var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11var __getOwnPropNames = Object.getOwnPropertyNames;
12var __getProtoOf = Object.getPrototypeOf;
13var __hasOwnProp = Object.prototype.hasOwnProperty;
14var __typeError = (msg) => {
15 throw TypeError(msg);
16};
17var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
18var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
19 get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
20}) : x)(function(x) {
21 if (typeof require !== "undefined") return require.apply(this, arguments);
22 throw Error('Dynamic require of "' + x + '" is not supported');
23});
24var __commonJS = (cb, mod) => function __require2() {
25 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
26};
27var __export = (target, all) => {
28 for (var name in all)
29 __defProp(target, name, { get: all[name], enumerable: true });
30};
31var __copyProps = (to, from, except, desc) => {
32 if (from && typeof from === "object" || typeof from === "function") {
33 for (let key2 of __getOwnPropNames(from))
34 if (!__hasOwnProp.call(to, key2) && key2 !== except)
35 __defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable });
36 }
37 return to;
38};
39var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
40 // If the importer is in node compatibility mode or this is not an ESM
41 // file that has been converted to a CommonJS file using a Babel-
42 // compatible transform (i.e. "__esModule" has not been set), then set
43 // "default" to the CommonJS "module.exports" for node compatibility.
44 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
45 mod
46));
47var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
48var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
49var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
50var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
51var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
52var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
53
54// node_modules/fast-glob/out/utils/array.js
55var require_array = __commonJS({
56 "node_modules/fast-glob/out/utils/array.js"(exports) {
57 "use strict";
58 Object.defineProperty(exports, "__esModule", { value: true });
59 exports.splitWhen = exports.flatten = void 0;
60 function flatten(items) {
61 return items.reduce((collection, item) => [].concat(collection, item), []);
62 }
63 exports.flatten = flatten;
64 function splitWhen(items, predicate) {
65 const result = [[]];
66 let groupIndex = 0;
67 for (const item of items) {
68 if (predicate(item)) {
69 groupIndex++;
70 result[groupIndex] = [];
71 } else {
72 result[groupIndex].push(item);
73 }
74 }
75 return result;
76 }
77 exports.splitWhen = splitWhen;
78 }
79});
80
81// node_modules/fast-glob/out/utils/errno.js
82var require_errno = __commonJS({
83 "node_modules/fast-glob/out/utils/errno.js"(exports) {
84 "use strict";
85 Object.defineProperty(exports, "__esModule", { value: true });
86 exports.isEnoentCodeError = void 0;
87 function isEnoentCodeError(error) {
88 return error.code === "ENOENT";
89 }
90 exports.isEnoentCodeError = isEnoentCodeError;
91 }
92});
93
94// node_modules/fast-glob/out/utils/fs.js
95var require_fs = __commonJS({
96 "node_modules/fast-glob/out/utils/fs.js"(exports) {
97 "use strict";
98 Object.defineProperty(exports, "__esModule", { value: true });
99 exports.createDirentFromStats = void 0;
100 var DirentFromStats = class {
101 constructor(name, stats) {
102 this.name = name;
103 this.isBlockDevice = stats.isBlockDevice.bind(stats);
104 this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
105 this.isDirectory = stats.isDirectory.bind(stats);
106 this.isFIFO = stats.isFIFO.bind(stats);
107 this.isFile = stats.isFile.bind(stats);
108 this.isSocket = stats.isSocket.bind(stats);
109 this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
110 }
111 };
112 function createDirentFromStats(name, stats) {
113 return new DirentFromStats(name, stats);
114 }
115 exports.createDirentFromStats = createDirentFromStats;
116 }
117});
118
119// node_modules/fast-glob/out/utils/path.js
120var require_path = __commonJS({
121 "node_modules/fast-glob/out/utils/path.js"(exports) {
122 "use strict";
123 Object.defineProperty(exports, "__esModule", { value: true });
124 exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0;
125 var os2 = __require("os");
126 var path13 = __require("path");
127 var IS_WINDOWS_PLATFORM = os2.platform() === "win32";
128 var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
129 var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
130 var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g;
131 var DOS_DEVICE_PATH_RE = /^\\\\([.?])/;
132 var WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g;
133 function unixify(filepath) {
134 return filepath.replace(/\\/g, "/");
135 }
136 exports.unixify = unixify;
137 function makeAbsolute(cwd, filepath) {
138 return path13.resolve(cwd, filepath);
139 }
140 exports.makeAbsolute = makeAbsolute;
141 function removeLeadingDotSegment(entry) {
142 if (entry.charAt(0) === ".") {
143 const secondCharactery = entry.charAt(1);
144 if (secondCharactery === "/" || secondCharactery === "\\") {
145 return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
146 }
147 }
148 return entry;
149 }
150 exports.removeLeadingDotSegment = removeLeadingDotSegment;
151 exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath;
152 function escapeWindowsPath(pattern) {
153 return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
154 }
155 exports.escapeWindowsPath = escapeWindowsPath;
156 function escapePosixPath(pattern) {
157 return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
158 }
159 exports.escapePosixPath = escapePosixPath;
160 exports.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern;
161 function convertWindowsPathToPattern(filepath) {
162 return escapeWindowsPath(filepath).replace(DOS_DEVICE_PATH_RE, "//$1").replace(WINDOWS_BACKSLASHES_RE, "/");
163 }
164 exports.convertWindowsPathToPattern = convertWindowsPathToPattern;
165 function convertPosixPathToPattern(filepath) {
166 return escapePosixPath(filepath);
167 }
168 exports.convertPosixPathToPattern = convertPosixPathToPattern;
169 }
170});
171
172// node_modules/is-extglob/index.js
173var require_is_extglob = __commonJS({
174 "node_modules/is-extglob/index.js"(exports, module) {
175 module.exports = function isExtglob(str2) {
176 if (typeof str2 !== "string" || str2 === "") {
177 return false;
178 }
179 var match;
180 while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str2)) {
181 if (match[2]) return true;
182 str2 = str2.slice(match.index + match[0].length);
183 }
184 return false;
185 };
186 }
187});
188
189// node_modules/is-glob/index.js
190var require_is_glob = __commonJS({
191 "node_modules/is-glob/index.js"(exports, module) {
192 var isExtglob = require_is_extglob();
193 var chars = { "{": "}", "(": ")", "[": "]" };
194 var strictCheck = function(str2) {
195 if (str2[0] === "!") {
196 return true;
197 }
198 var index = 0;
199 var pipeIndex = -2;
200 var closeSquareIndex = -2;
201 var closeCurlyIndex = -2;
202 var closeParenIndex = -2;
203 var backSlashIndex = -2;
204 while (index < str2.length) {
205 if (str2[index] === "*") {
206 return true;
207 }
208 if (str2[index + 1] === "?" && /[\].+)]/.test(str2[index])) {
209 return true;
210 }
211 if (closeSquareIndex !== -1 && str2[index] === "[" && str2[index + 1] !== "]") {
212 if (closeSquareIndex < index) {
213 closeSquareIndex = str2.indexOf("]", index);
214 }
215 if (closeSquareIndex > index) {
216 if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
217 return true;
218 }
219 backSlashIndex = str2.indexOf("\\", index);
220 if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
221 return true;
222 }
223 }
224 }
225 if (closeCurlyIndex !== -1 && str2[index] === "{" && str2[index + 1] !== "}") {
226 closeCurlyIndex = str2.indexOf("}", index);
227 if (closeCurlyIndex > index) {
228 backSlashIndex = str2.indexOf("\\", index);
229 if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
230 return true;
231 }
232 }
233 }
234 if (closeParenIndex !== -1 && str2[index] === "(" && str2[index + 1] === "?" && /[:!=]/.test(str2[index + 2]) && str2[index + 3] !== ")") {
235 closeParenIndex = str2.indexOf(")", index);
236 if (closeParenIndex > index) {
237 backSlashIndex = str2.indexOf("\\", index);
238 if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
239 return true;
240 }
241 }
242 }
243 if (pipeIndex !== -1 && str2[index] === "(" && str2[index + 1] !== "|") {
244 if (pipeIndex < index) {
245 pipeIndex = str2.indexOf("|", index);
246 }
247 if (pipeIndex !== -1 && str2[pipeIndex + 1] !== ")") {
248 closeParenIndex = str2.indexOf(")", pipeIndex);
249 if (closeParenIndex > pipeIndex) {
250 backSlashIndex = str2.indexOf("\\", pipeIndex);
251 if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
252 return true;
253 }
254 }
255 }
256 }
257 if (str2[index] === "\\") {
258 var open = str2[index + 1];
259 index += 2;
260 var close = chars[open];
261 if (close) {
262 var n = str2.indexOf(close, index);
263 if (n !== -1) {
264 index = n + 1;
265 }
266 }
267 if (str2[index] === "!") {
268 return true;
269 }
270 } else {
271 index++;
272 }
273 }
274 return false;
275 };
276 var relaxedCheck = function(str2) {
277 if (str2[0] === "!") {
278 return true;
279 }
280 var index = 0;
281 while (index < str2.length) {
282 if (/[*?{}()[\]]/.test(str2[index])) {
283 return true;
284 }
285 if (str2[index] === "\\") {
286 var open = str2[index + 1];
287 index += 2;
288 var close = chars[open];
289 if (close) {
290 var n = str2.indexOf(close, index);
291 if (n !== -1) {
292 index = n + 1;
293 }
294 }
295 if (str2[index] === "!") {
296 return true;
297 }
298 } else {
299 index++;
300 }
301 }
302 return false;
303 };
304 module.exports = function isGlob(str2, options8) {
305 if (typeof str2 !== "string" || str2 === "") {
306 return false;
307 }
308 if (isExtglob(str2)) {
309 return true;
310 }
311 var check2 = strictCheck;
312 if (options8 && options8.strict === false) {
313 check2 = relaxedCheck;
314 }
315 return check2(str2);
316 };
317 }
318});
319
320// node_modules/glob-parent/index.js
321var require_glob_parent = __commonJS({
322 "node_modules/glob-parent/index.js"(exports, module) {
323 "use strict";
324 var isGlob = require_is_glob();
325 var pathPosixDirname = __require("path").posix.dirname;
326 var isWin32 = __require("os").platform() === "win32";
327 var slash2 = "/";
328 var backslash = /\\/g;
329 var enclosure = /[\{\[].*[\}\]]$/;
330 var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
331 var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
332 module.exports = function globParent(str2, opts) {
333 var options8 = Object.assign({ flipBackslashes: true }, opts);
334 if (options8.flipBackslashes && isWin32 && str2.indexOf(slash2) < 0) {
335 str2 = str2.replace(backslash, slash2);
336 }
337 if (enclosure.test(str2)) {
338 str2 += slash2;
339 }
340 str2 += "a";
341 do {
342 str2 = pathPosixDirname(str2);
343 } while (isGlob(str2) || globby.test(str2));
344 return str2.replace(escaped, "$1");
345 };
346 }
347});
348
349// node_modules/braces/lib/utils.js
350var require_utils = __commonJS({
351 "node_modules/braces/lib/utils.js"(exports) {
352 "use strict";
353 exports.isInteger = (num) => {
354 if (typeof num === "number") {
355 return Number.isInteger(num);
356 }
357 if (typeof num === "string" && num.trim() !== "") {
358 return Number.isInteger(Number(num));
359 }
360 return false;
361 };
362 exports.find = (node, type2) => node.nodes.find((node2) => node2.type === type2);
363 exports.exceedsLimit = (min, max, step = 1, limit) => {
364 if (limit === false) return false;
365 if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
366 return (Number(max) - Number(min)) / Number(step) >= limit;
367 };
368 exports.escapeNode = (block, n = 0, type2) => {
369 const node = block.nodes[n];
370 if (!node) return;
371 if (type2 && node.type === type2 || node.type === "open" || node.type === "close") {
372 if (node.escaped !== true) {
373 node.value = "\\" + node.value;
374 node.escaped = true;
375 }
376 }
377 };
378 exports.encloseBrace = (node) => {
379 if (node.type !== "brace") return false;
380 if (node.commas >> 0 + node.ranges >> 0 === 0) {
381 node.invalid = true;
382 return true;
383 }
384 return false;
385 };
386 exports.isInvalidBrace = (block) => {
387 if (block.type !== "brace") return false;
388 if (block.invalid === true || block.dollar) return true;
389 if (block.commas >> 0 + block.ranges >> 0 === 0) {
390 block.invalid = true;
391 return true;
392 }
393 if (block.open !== true || block.close !== true) {
394 block.invalid = true;
395 return true;
396 }
397 return false;
398 };
399 exports.isOpenOrClose = (node) => {
400 if (node.type === "open" || node.type === "close") {
401 return true;
402 }
403 return node.open === true || node.close === true;
404 };
405 exports.reduce = (nodes) => nodes.reduce((acc, node) => {
406 if (node.type === "text") acc.push(node.value);
407 if (node.type === "range") node.type = "text";
408 return acc;
409 }, []);
410 exports.flatten = (...args) => {
411 const result = [];
412 const flat = (arr) => {
413 for (let i = 0; i < arr.length; i++) {
414 const ele = arr[i];
415 if (Array.isArray(ele)) {
416 flat(ele);
417 continue;
418 }
419 if (ele !== void 0) {
420 result.push(ele);
421 }
422 }
423 return result;
424 };
425 flat(args);
426 return result;
427 };
428 }
429});
430
431// node_modules/braces/lib/stringify.js
432var require_stringify = __commonJS({
433 "node_modules/braces/lib/stringify.js"(exports, module) {
434 "use strict";
435 var utils = require_utils();
436 module.exports = (ast, options8 = {}) => {
437 const stringify2 = (node, parent = {}) => {
438 const invalidBlock = options8.escapeInvalid && utils.isInvalidBrace(parent);
439 const invalidNode = node.invalid === true && options8.escapeInvalid === true;
440 let output = "";
441 if (node.value) {
442 if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
443 return "\\" + node.value;
444 }
445 return node.value;
446 }
447 if (node.value) {
448 return node.value;
449 }
450 if (node.nodes) {
451 for (const child of node.nodes) {
452 output += stringify2(child);
453 }
454 }
455 return output;
456 };
457 return stringify2(ast);
458 };
459 }
460});
461
462// node_modules/is-number/index.js
463var require_is_number = __commonJS({
464 "node_modules/is-number/index.js"(exports, module) {
465 "use strict";
466 module.exports = function(num) {
467 if (typeof num === "number") {
468 return num - num === 0;
469 }
470 if (typeof num === "string" && num.trim() !== "") {
471 return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
472 }
473 return false;
474 };
475 }
476});
477
478// node_modules/to-regex-range/index.js
479var require_to_regex_range = __commonJS({
480 "node_modules/to-regex-range/index.js"(exports, module) {
481 "use strict";
482 var isNumber = require_is_number();
483 var toRegexRange = (min, max, options8) => {
484 if (isNumber(min) === false) {
485 throw new TypeError("toRegexRange: expected the first argument to be a number");
486 }
487 if (max === void 0 || min === max) {
488 return String(min);
489 }
490 if (isNumber(max) === false) {
491 throw new TypeError("toRegexRange: expected the second argument to be a number.");
492 }
493 let opts = { relaxZeros: true, ...options8 };
494 if (typeof opts.strictZeros === "boolean") {
495 opts.relaxZeros = opts.strictZeros === false;
496 }
497 let relax = String(opts.relaxZeros);
498 let shorthand = String(opts.shorthand);
499 let capture = String(opts.capture);
500 let wrap = String(opts.wrap);
501 let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
502 if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
503 return toRegexRange.cache[cacheKey].result;
504 }
505 let a = Math.min(min, max);
506 let b = Math.max(min, max);
507 if (Math.abs(a - b) === 1) {
508 let result = min + "|" + max;
509 if (opts.capture) {
510 return `(${result})`;
511 }
512 if (opts.wrap === false) {
513 return result;
514 }
515 return `(?:${result})`;
516 }
517 let isPadded = hasPadding(min) || hasPadding(max);
518 let state = { min, max, a, b };
519 let positives = [];
520 let negatives = [];
521 if (isPadded) {
522 state.isPadded = isPadded;
523 state.maxLen = String(state.max).length;
524 }
525 if (a < 0) {
526 let newMin = b < 0 ? Math.abs(b) : 1;
527 negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
528 a = state.a = 0;
529 }
530 if (b >= 0) {
531 positives = splitToPatterns(a, b, state, opts);
532 }
533 state.negatives = negatives;
534 state.positives = positives;
535 state.result = collatePatterns(negatives, positives, opts);
536 if (opts.capture === true) {
537 state.result = `(${state.result})`;
538 } else if (opts.wrap !== false && positives.length + negatives.length > 1) {
539 state.result = `(?:${state.result})`;
540 }
541 toRegexRange.cache[cacheKey] = state;
542 return state.result;
543 };
544 function collatePatterns(neg, pos2, options8) {
545 let onlyNegative = filterPatterns(neg, pos2, "-", false, options8) || [];
546 let onlyPositive = filterPatterns(pos2, neg, "", false, options8) || [];
547 let intersected = filterPatterns(neg, pos2, "-?", true, options8) || [];
548 let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
549 return subpatterns.join("|");
550 }
551 function splitToRanges(min, max) {
552 let nines = 1;
553 let zeros = 1;
554 let stop = countNines(min, nines);
555 let stops = /* @__PURE__ */ new Set([max]);
556 while (min <= stop && stop <= max) {
557 stops.add(stop);
558 nines += 1;
559 stop = countNines(min, nines);
560 }
561 stop = countZeros(max + 1, zeros) - 1;
562 while (min < stop && stop <= max) {
563 stops.add(stop);
564 zeros += 1;
565 stop = countZeros(max + 1, zeros) - 1;
566 }
567 stops = [...stops];
568 stops.sort(compare);
569 return stops;
570 }
571 function rangeToPattern(start, stop, options8) {
572 if (start === stop) {
573 return { pattern: start, count: [], digits: 0 };
574 }
575 let zipped = zip(start, stop);
576 let digits = zipped.length;
577 let pattern = "";
578 let count = 0;
579 for (let i = 0; i < digits; i++) {
580 let [startDigit, stopDigit] = zipped[i];
581 if (startDigit === stopDigit) {
582 pattern += startDigit;
583 } else if (startDigit !== "0" || stopDigit !== "9") {
584 pattern += toCharacterClass(startDigit, stopDigit, options8);
585 } else {
586 count++;
587 }
588 }
589 if (count) {
590 pattern += options8.shorthand === true ? "\\d" : "[0-9]";
591 }
592 return { pattern, count: [count], digits };
593 }
594 function splitToPatterns(min, max, tok, options8) {
595 let ranges = splitToRanges(min, max);
596 let tokens = [];
597 let start = min;
598 let prev;
599 for (let i = 0; i < ranges.length; i++) {
600 let max2 = ranges[i];
601 let obj = rangeToPattern(String(start), String(max2), options8);
602 let zeros = "";
603 if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
604 if (prev.count.length > 1) {
605 prev.count.pop();
606 }
607 prev.count.push(obj.count[0]);
608 prev.string = prev.pattern + toQuantifier(prev.count);
609 start = max2 + 1;
610 continue;
611 }
612 if (tok.isPadded) {
613 zeros = padZeros(max2, tok, options8);
614 }
615 obj.string = zeros + obj.pattern + toQuantifier(obj.count);
616 tokens.push(obj);
617 start = max2 + 1;
618 prev = obj;
619 }
620 return tokens;
621 }
622 function filterPatterns(arr, comparison, prefix, intersection, options8) {
623 let result = [];
624 for (let ele of arr) {
625 let { string } = ele;
626 if (!intersection && !contains(comparison, "string", string)) {
627 result.push(prefix + string);
628 }
629 if (intersection && contains(comparison, "string", string)) {
630 result.push(prefix + string);
631 }
632 }
633 return result;
634 }
635 function zip(a, b) {
636 let arr = [];
637 for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
638 return arr;
639 }
640 function compare(a, b) {
641 return a > b ? 1 : b > a ? -1 : 0;
642 }
643 function contains(arr, key2, val) {
644 return arr.some((ele) => ele[key2] === val);
645 }
646 function countNines(min, len) {
647 return Number(String(min).slice(0, -len) + "9".repeat(len));
648 }
649 function countZeros(integer, zeros) {
650 return integer - integer % Math.pow(10, zeros);
651 }
652 function toQuantifier(digits) {
653 let [start = 0, stop = ""] = digits;
654 if (stop || start > 1) {
655 return `{${start + (stop ? "," + stop : "")}}`;
656 }
657 return "";
658 }
659 function toCharacterClass(a, b, options8) {
660 return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
661 }
662 function hasPadding(str2) {
663 return /^-?(0+)\d/.test(str2);
664 }
665 function padZeros(value, tok, options8) {
666 if (!tok.isPadded) {
667 return value;
668 }
669 let diff2 = Math.abs(tok.maxLen - String(value).length);
670 let relax = options8.relaxZeros !== false;
671 switch (diff2) {
672 case 0:
673 return "";
674 case 1:
675 return relax ? "0?" : "0";
676 case 2:
677 return relax ? "0{0,2}" : "00";
678 default: {
679 return relax ? `0{0,${diff2}}` : `0{${diff2}}`;
680 }
681 }
682 }
683 toRegexRange.cache = {};
684 toRegexRange.clearCache = () => toRegexRange.cache = {};
685 module.exports = toRegexRange;
686 }
687});
688
689// node_modules/fill-range/index.js
690var require_fill_range = __commonJS({
691 "node_modules/fill-range/index.js"(exports, module) {
692 "use strict";
693 var util2 = __require("util");
694 var toRegexRange = require_to_regex_range();
695 var isObject3 = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
696 var transform = (toNumber) => {
697 return (value) => toNumber === true ? Number(value) : String(value);
698 };
699 var isValidValue = (value) => {
700 return typeof value === "number" || typeof value === "string" && value !== "";
701 };
702 var isNumber = (num) => Number.isInteger(+num);
703 var zeros = (input) => {
704 let value = `${input}`;
705 let index = -1;
706 if (value[0] === "-") value = value.slice(1);
707 if (value === "0") return false;
708 while (value[++index] === "0") ;
709 return index > 0;
710 };
711 var stringify2 = (start, end, options8) => {
712 if (typeof start === "string" || typeof end === "string") {
713 return true;
714 }
715 return options8.stringify === true;
716 };
717 var pad = (input, maxLength, toNumber) => {
718 if (maxLength > 0) {
719 let dash = input[0] === "-" ? "-" : "";
720 if (dash) input = input.slice(1);
721 input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
722 }
723 if (toNumber === false) {
724 return String(input);
725 }
726 return input;
727 };
728 var toMaxLen = (input, maxLength) => {
729 let negative = input[0] === "-" ? "-" : "";
730 if (negative) {
731 input = input.slice(1);
732 maxLength--;
733 }
734 while (input.length < maxLength) input = "0" + input;
735 return negative ? "-" + input : input;
736 };
737 var toSequence = (parts, options8, maxLen) => {
738 parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
739 parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
740 let prefix = options8.capture ? "" : "?:";
741 let positives = "";
742 let negatives = "";
743 let result;
744 if (parts.positives.length) {
745 positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|");
746 }
747 if (parts.negatives.length) {
748 negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`;
749 }
750 if (positives && negatives) {
751 result = `${positives}|${negatives}`;
752 } else {
753 result = positives || negatives;
754 }
755 if (options8.wrap) {
756 return `(${prefix}${result})`;
757 }
758 return result;
759 };
760 var toRange = (a, b, isNumbers, options8) => {
761 if (isNumbers) {
762 return toRegexRange(a, b, { wrap: false, ...options8 });
763 }
764 let start = String.fromCharCode(a);
765 if (a === b) return start;
766 let stop = String.fromCharCode(b);
767 return `[${start}-${stop}]`;
768 };
769 var toRegex = (start, end, options8) => {
770 if (Array.isArray(start)) {
771 let wrap = options8.wrap === true;
772 let prefix = options8.capture ? "" : "?:";
773 return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
774 }
775 return toRegexRange(start, end, options8);
776 };
777 var rangeError = (...args) => {
778 return new RangeError("Invalid range arguments: " + util2.inspect(...args));
779 };
780 var invalidRange = (start, end, options8) => {
781 if (options8.strictRanges === true) throw rangeError([start, end]);
782 return [];
783 };
784 var invalidStep = (step, options8) => {
785 if (options8.strictRanges === true) {
786 throw new TypeError(`Expected step "${step}" to be a number`);
787 }
788 return [];
789 };
790 var fillNumbers = (start, end, step = 1, options8 = {}) => {
791 let a = Number(start);
792 let b = Number(end);
793 if (!Number.isInteger(a) || !Number.isInteger(b)) {
794 if (options8.strictRanges === true) throw rangeError([start, end]);
795 return [];
796 }
797 if (a === 0) a = 0;
798 if (b === 0) b = 0;
799 let descending = a > b;
800 let startString = String(start);
801 let endString = String(end);
802 let stepString = String(step);
803 step = Math.max(Math.abs(step), 1);
804 let padded = zeros(startString) || zeros(endString) || zeros(stepString);
805 let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
806 let toNumber = padded === false && stringify2(start, end, options8) === false;
807 let format3 = options8.transform || transform(toNumber);
808 if (options8.toRegex && step === 1) {
809 return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options8);
810 }
811 let parts = { negatives: [], positives: [] };
812 let push2 = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
813 let range = [];
814 let index = 0;
815 while (descending ? a >= b : a <= b) {
816 if (options8.toRegex === true && step > 1) {
817 push2(a);
818 } else {
819 range.push(pad(format3(a, index), maxLen, toNumber));
820 }
821 a = descending ? a - step : a + step;
822 index++;
823 }
824 if (options8.toRegex === true) {
825 return step > 1 ? toSequence(parts, options8, maxLen) : toRegex(range, null, { wrap: false, ...options8 });
826 }
827 return range;
828 };
829 var fillLetters = (start, end, step = 1, options8 = {}) => {
830 if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
831 return invalidRange(start, end, options8);
832 }
833 let format3 = options8.transform || ((val) => String.fromCharCode(val));
834 let a = `${start}`.charCodeAt(0);
835 let b = `${end}`.charCodeAt(0);
836 let descending = a > b;
837 let min = Math.min(a, b);
838 let max = Math.max(a, b);
839 if (options8.toRegex && step === 1) {
840 return toRange(min, max, false, options8);
841 }
842 let range = [];
843 let index = 0;
844 while (descending ? a >= b : a <= b) {
845 range.push(format3(a, index));
846 a = descending ? a - step : a + step;
847 index++;
848 }
849 if (options8.toRegex === true) {
850 return toRegex(range, null, { wrap: false, options: options8 });
851 }
852 return range;
853 };
854 var fill = (start, end, step, options8 = {}) => {
855 if (end == null && isValidValue(start)) {
856 return [start];
857 }
858 if (!isValidValue(start) || !isValidValue(end)) {
859 return invalidRange(start, end, options8);
860 }
861 if (typeof step === "function") {
862 return fill(start, end, 1, { transform: step });
863 }
864 if (isObject3(step)) {
865 return fill(start, end, 0, step);
866 }
867 let opts = { ...options8 };
868 if (opts.capture === true) opts.wrap = true;
869 step = step || opts.step || 1;
870 if (!isNumber(step)) {
871 if (step != null && !isObject3(step)) return invalidStep(step, opts);
872 return fill(start, end, 1, step);
873 }
874 if (isNumber(start) && isNumber(end)) {
875 return fillNumbers(start, end, step, opts);
876 }
877 return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
878 };
879 module.exports = fill;
880 }
881});
882
883// node_modules/braces/lib/compile.js
884var require_compile = __commonJS({
885 "node_modules/braces/lib/compile.js"(exports, module) {
886 "use strict";
887 var fill = require_fill_range();
888 var utils = require_utils();
889 var compile = (ast, options8 = {}) => {
890 const walk = (node, parent = {}) => {
891 const invalidBlock = utils.isInvalidBrace(parent);
892 const invalidNode = node.invalid === true && options8.escapeInvalid === true;
893 const invalid = invalidBlock === true || invalidNode === true;
894 const prefix = options8.escapeInvalid === true ? "\\" : "";
895 let output = "";
896 if (node.isOpen === true) {
897 return prefix + node.value;
898 }
899 if (node.isClose === true) {
900 console.log("node.isClose", prefix, node.value);
901 return prefix + node.value;
902 }
903 if (node.type === "open") {
904 return invalid ? prefix + node.value : "(";
905 }
906 if (node.type === "close") {
907 return invalid ? prefix + node.value : ")";
908 }
909 if (node.type === "comma") {
910 return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
911 }
912 if (node.value) {
913 return node.value;
914 }
915 if (node.nodes && node.ranges > 0) {
916 const args = utils.reduce(node.nodes);
917 const range = fill(...args, { ...options8, wrap: false, toRegex: true, strictZeros: true });
918 if (range.length !== 0) {
919 return args.length > 1 && range.length > 1 ? `(${range})` : range;
920 }
921 }
922 if (node.nodes) {
923 for (const child of node.nodes) {
924 output += walk(child, node);
925 }
926 }
927 return output;
928 };
929 return walk(ast);
930 };
931 module.exports = compile;
932 }
933});
934
935// node_modules/braces/lib/expand.js
936var require_expand = __commonJS({
937 "node_modules/braces/lib/expand.js"(exports, module) {
938 "use strict";
939 var fill = require_fill_range();
940 var stringify2 = require_stringify();
941 var utils = require_utils();
942 var append = (queue = "", stash = "", enclose = false) => {
943 const result = [];
944 queue = [].concat(queue);
945 stash = [].concat(stash);
946 if (!stash.length) return queue;
947 if (!queue.length) {
948 return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
949 }
950 for (const item of queue) {
951 if (Array.isArray(item)) {
952 for (const value of item) {
953 result.push(append(value, stash, enclose));
954 }
955 } else {
956 for (let ele of stash) {
957 if (enclose === true && typeof ele === "string") ele = `{${ele}}`;
958 result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
959 }
960 }
961 }
962 return utils.flatten(result);
963 };
964 var expand = (ast, options8 = {}) => {
965 const rangeLimit = options8.rangeLimit === void 0 ? 1e3 : options8.rangeLimit;
966 const walk = (node, parent = {}) => {
967 node.queue = [];
968 let p = parent;
969 let q = parent.queue;
970 while (p.type !== "brace" && p.type !== "root" && p.parent) {
971 p = p.parent;
972 q = p.queue;
973 }
974 if (node.invalid || node.dollar) {
975 q.push(append(q.pop(), stringify2(node, options8)));
976 return;
977 }
978 if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
979 q.push(append(q.pop(), ["{}"]));
980 return;
981 }
982 if (node.nodes && node.ranges > 0) {
983 const args = utils.reduce(node.nodes);
984 if (utils.exceedsLimit(...args, options8.step, rangeLimit)) {
985 throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
986 }
987 let range = fill(...args, options8);
988 if (range.length === 0) {
989 range = stringify2(node, options8);
990 }
991 q.push(append(q.pop(), range));
992 node.nodes = [];
993 return;
994 }
995 const enclose = utils.encloseBrace(node);
996 let queue = node.queue;
997 let block = node;
998 while (block.type !== "brace" && block.type !== "root" && block.parent) {
999 block = block.parent;
1000 queue = block.queue;
1001 }
1002 for (let i = 0; i < node.nodes.length; i++) {
1003 const child = node.nodes[i];
1004 if (child.type === "comma" && node.type === "brace") {
1005 if (i === 1) queue.push("");
1006 queue.push("");
1007 continue;
1008 }
1009 if (child.type === "close") {
1010 q.push(append(q.pop(), queue, enclose));
1011 continue;
1012 }
1013 if (child.value && child.type !== "open") {
1014 queue.push(append(queue.pop(), child.value));
1015 continue;
1016 }
1017 if (child.nodes) {
1018 walk(child, node);
1019 }
1020 }
1021 return queue;
1022 };
1023 return utils.flatten(walk(ast));
1024 };
1025 module.exports = expand;
1026 }
1027});
1028
1029// node_modules/braces/lib/constants.js
1030var require_constants = __commonJS({
1031 "node_modules/braces/lib/constants.js"(exports, module) {
1032 "use strict";
1033 module.exports = {
1034 MAX_LENGTH: 1e4,
1035 // Digits
1036 CHAR_0: "0",
1037 /* 0 */
1038 CHAR_9: "9",
1039 /* 9 */
1040 // Alphabet chars.
1041 CHAR_UPPERCASE_A: "A",
1042 /* A */
1043 CHAR_LOWERCASE_A: "a",
1044 /* a */
1045 CHAR_UPPERCASE_Z: "Z",
1046 /* Z */
1047 CHAR_LOWERCASE_Z: "z",
1048 /* z */
1049 CHAR_LEFT_PARENTHESES: "(",
1050 /* ( */
1051 CHAR_RIGHT_PARENTHESES: ")",
1052 /* ) */
1053 CHAR_ASTERISK: "*",
1054 /* * */
1055 // Non-alphabetic chars.
1056 CHAR_AMPERSAND: "&",
1057 /* & */
1058 CHAR_AT: "@",
1059 /* @ */
1060 CHAR_BACKSLASH: "\\",
1061 /* \ */
1062 CHAR_BACKTICK: "`",
1063 /* ` */
1064 CHAR_CARRIAGE_RETURN: "\r",
1065 /* \r */
1066 CHAR_CIRCUMFLEX_ACCENT: "^",
1067 /* ^ */
1068 CHAR_COLON: ":",
1069 /* : */
1070 CHAR_COMMA: ",",
1071 /* , */
1072 CHAR_DOLLAR: "$",
1073 /* . */
1074 CHAR_DOT: ".",
1075 /* . */
1076 CHAR_DOUBLE_QUOTE: '"',
1077 /* " */
1078 CHAR_EQUAL: "=",
1079 /* = */
1080 CHAR_EXCLAMATION_MARK: "!",
1081 /* ! */
1082 CHAR_FORM_FEED: "\f",
1083 /* \f */
1084 CHAR_FORWARD_SLASH: "/",
1085 /* / */
1086 CHAR_HASH: "#",
1087 /* # */
1088 CHAR_HYPHEN_MINUS: "-",
1089 /* - */
1090 CHAR_LEFT_ANGLE_BRACKET: "<",
1091 /* < */
1092 CHAR_LEFT_CURLY_BRACE: "{",
1093 /* { */
1094 CHAR_LEFT_SQUARE_BRACKET: "[",
1095 /* [ */
1096 CHAR_LINE_FEED: "\n",
1097 /* \n */
1098 CHAR_NO_BREAK_SPACE: "\xA0",
1099 /* \u00A0 */
1100 CHAR_PERCENT: "%",
1101 /* % */
1102 CHAR_PLUS: "+",
1103 /* + */
1104 CHAR_QUESTION_MARK: "?",
1105 /* ? */
1106 CHAR_RIGHT_ANGLE_BRACKET: ">",
1107 /* > */
1108 CHAR_RIGHT_CURLY_BRACE: "}",
1109 /* } */
1110 CHAR_RIGHT_SQUARE_BRACKET: "]",
1111 /* ] */
1112 CHAR_SEMICOLON: ";",
1113 /* ; */
1114 CHAR_SINGLE_QUOTE: "'",
1115 /* ' */
1116 CHAR_SPACE: " ",
1117 /* */
1118 CHAR_TAB: " ",
1119 /* \t */
1120 CHAR_UNDERSCORE: "_",
1121 /* _ */
1122 CHAR_VERTICAL_LINE: "|",
1123 /* | */
1124 CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF"
1125 /* \uFEFF */
1126 };
1127 }
1128});
1129
1130// node_modules/braces/lib/parse.js
1131var require_parse = __commonJS({
1132 "node_modules/braces/lib/parse.js"(exports, module) {
1133 "use strict";
1134 var stringify2 = require_stringify();
1135 var {
1136 MAX_LENGTH,
1137 CHAR_BACKSLASH,
1138 /* \ */
1139 CHAR_BACKTICK,
1140 /* ` */
1141 CHAR_COMMA,
1142 /* , */
1143 CHAR_DOT,
1144 /* . */
1145 CHAR_LEFT_PARENTHESES,
1146 /* ( */
1147 CHAR_RIGHT_PARENTHESES,
1148 /* ) */
1149 CHAR_LEFT_CURLY_BRACE,
1150 /* { */
1151 CHAR_RIGHT_CURLY_BRACE,
1152 /* } */
1153 CHAR_LEFT_SQUARE_BRACKET,
1154 /* [ */
1155 CHAR_RIGHT_SQUARE_BRACKET,
1156 /* ] */
1157 CHAR_DOUBLE_QUOTE,
1158 /* " */
1159 CHAR_SINGLE_QUOTE,
1160 /* ' */
1161 CHAR_NO_BREAK_SPACE,
1162 CHAR_ZERO_WIDTH_NOBREAK_SPACE
1163 } = require_constants();
1164 var parse7 = (input, options8 = {}) => {
1165 if (typeof input !== "string") {
1166 throw new TypeError("Expected a string");
1167 }
1168 const opts = options8 || {};
1169 const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
1170 if (input.length > max) {
1171 throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
1172 }
1173 const ast = { type: "root", input, nodes: [] };
1174 const stack2 = [ast];
1175 let block = ast;
1176 let prev = ast;
1177 let brackets = 0;
1178 const length = input.length;
1179 let index = 0;
1180 let depth = 0;
1181 let value;
1182 const advance = () => input[index++];
1183 const push2 = (node) => {
1184 if (node.type === "text" && prev.type === "dot") {
1185 prev.type = "text";
1186 }
1187 if (prev && prev.type === "text" && node.type === "text") {
1188 prev.value += node.value;
1189 return;
1190 }
1191 block.nodes.push(node);
1192 node.parent = block;
1193 node.prev = prev;
1194 prev = node;
1195 return node;
1196 };
1197 push2({ type: "bos" });
1198 while (index < length) {
1199 block = stack2[stack2.length - 1];
1200 value = advance();
1201 if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
1202 continue;
1203 }
1204 if (value === CHAR_BACKSLASH) {
1205 push2({ type: "text", value: (options8.keepEscaping ? value : "") + advance() });
1206 continue;
1207 }
1208 if (value === CHAR_RIGHT_SQUARE_BRACKET) {
1209 push2({ type: "text", value: "\\" + value });
1210 continue;
1211 }
1212 if (value === CHAR_LEFT_SQUARE_BRACKET) {
1213 brackets++;
1214 let next;
1215 while (index < length && (next = advance())) {
1216 value += next;
1217 if (next === CHAR_LEFT_SQUARE_BRACKET) {
1218 brackets++;
1219 continue;
1220 }
1221 if (next === CHAR_BACKSLASH) {
1222 value += advance();
1223 continue;
1224 }
1225 if (next === CHAR_RIGHT_SQUARE_BRACKET) {
1226 brackets--;
1227 if (brackets === 0) {
1228 break;
1229 }
1230 }
1231 }
1232 push2({ type: "text", value });
1233 continue;
1234 }
1235 if (value === CHAR_LEFT_PARENTHESES) {
1236 block = push2({ type: "paren", nodes: [] });
1237 stack2.push(block);
1238 push2({ type: "text", value });
1239 continue;
1240 }
1241 if (value === CHAR_RIGHT_PARENTHESES) {
1242 if (block.type !== "paren") {
1243 push2({ type: "text", value });
1244 continue;
1245 }
1246 block = stack2.pop();
1247 push2({ type: "text", value });
1248 block = stack2[stack2.length - 1];
1249 continue;
1250 }
1251 if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
1252 const open = value;
1253 let next;
1254 if (options8.keepQuotes !== true) {
1255 value = "";
1256 }
1257 while (index < length && (next = advance())) {
1258 if (next === CHAR_BACKSLASH) {
1259 value += next + advance();
1260 continue;
1261 }
1262 if (next === open) {
1263 if (options8.keepQuotes === true) value += next;
1264 break;
1265 }
1266 value += next;
1267 }
1268 push2({ type: "text", value });
1269 continue;
1270 }
1271 if (value === CHAR_LEFT_CURLY_BRACE) {
1272 depth++;
1273 const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
1274 const brace = {
1275 type: "brace",
1276 open: true,
1277 close: false,
1278 dollar,
1279 depth,
1280 commas: 0,
1281 ranges: 0,
1282 nodes: []
1283 };
1284 block = push2(brace);
1285 stack2.push(block);
1286 push2({ type: "open", value });
1287 continue;
1288 }
1289 if (value === CHAR_RIGHT_CURLY_BRACE) {
1290 if (block.type !== "brace") {
1291 push2({ type: "text", value });
1292 continue;
1293 }
1294 const type2 = "close";
1295 block = stack2.pop();
1296 block.close = true;
1297 push2({ type: type2, value });
1298 depth--;
1299 block = stack2[stack2.length - 1];
1300 continue;
1301 }
1302 if (value === CHAR_COMMA && depth > 0) {
1303 if (block.ranges > 0) {
1304 block.ranges = 0;
1305 const open = block.nodes.shift();
1306 block.nodes = [open, { type: "text", value: stringify2(block) }];
1307 }
1308 push2({ type: "comma", value });
1309 block.commas++;
1310 continue;
1311 }
1312 if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
1313 const siblings = block.nodes;
1314 if (depth === 0 || siblings.length === 0) {
1315 push2({ type: "text", value });
1316 continue;
1317 }
1318 if (prev.type === "dot") {
1319 block.range = [];
1320 prev.value += value;
1321 prev.type = "range";
1322 if (block.nodes.length !== 3 && block.nodes.length !== 5) {
1323 block.invalid = true;
1324 block.ranges = 0;
1325 prev.type = "text";
1326 continue;
1327 }
1328 block.ranges++;
1329 block.args = [];
1330 continue;
1331 }
1332 if (prev.type === "range") {
1333 siblings.pop();
1334 const before = siblings[siblings.length - 1];
1335 before.value += prev.value + value;
1336 prev = before;
1337 block.ranges--;
1338 continue;
1339 }
1340 push2({ type: "dot", value });
1341 continue;
1342 }
1343 push2({ type: "text", value });
1344 }
1345 do {
1346 block = stack2.pop();
1347 if (block.type !== "root") {
1348 block.nodes.forEach((node) => {
1349 if (!node.nodes) {
1350 if (node.type === "open") node.isOpen = true;
1351 if (node.type === "close") node.isClose = true;
1352 if (!node.nodes) node.type = "text";
1353 node.invalid = true;
1354 }
1355 });
1356 const parent = stack2[stack2.length - 1];
1357 const index2 = parent.nodes.indexOf(block);
1358 parent.nodes.splice(index2, 1, ...block.nodes);
1359 }
1360 } while (stack2.length > 0);
1361 push2({ type: "eos" });
1362 return ast;
1363 };
1364 module.exports = parse7;
1365 }
1366});
1367
1368// node_modules/braces/index.js
1369var require_braces = __commonJS({
1370 "node_modules/braces/index.js"(exports, module) {
1371 "use strict";
1372 var stringify2 = require_stringify();
1373 var compile = require_compile();
1374 var expand = require_expand();
1375 var parse7 = require_parse();
1376 var braces = (input, options8 = {}) => {
1377 let output = [];
1378 if (Array.isArray(input)) {
1379 for (const pattern of input) {
1380 const result = braces.create(pattern, options8);
1381 if (Array.isArray(result)) {
1382 output.push(...result);
1383 } else {
1384 output.push(result);
1385 }
1386 }
1387 } else {
1388 output = [].concat(braces.create(input, options8));
1389 }
1390 if (options8 && options8.expand === true && options8.nodupes === true) {
1391 output = [...new Set(output)];
1392 }
1393 return output;
1394 };
1395 braces.parse = (input, options8 = {}) => parse7(input, options8);
1396 braces.stringify = (input, options8 = {}) => {
1397 if (typeof input === "string") {
1398 return stringify2(braces.parse(input, options8), options8);
1399 }
1400 return stringify2(input, options8);
1401 };
1402 braces.compile = (input, options8 = {}) => {
1403 if (typeof input === "string") {
1404 input = braces.parse(input, options8);
1405 }
1406 return compile(input, options8);
1407 };
1408 braces.expand = (input, options8 = {}) => {
1409 if (typeof input === "string") {
1410 input = braces.parse(input, options8);
1411 }
1412 let result = expand(input, options8);
1413 if (options8.noempty === true) {
1414 result = result.filter(Boolean);
1415 }
1416 if (options8.nodupes === true) {
1417 result = [...new Set(result)];
1418 }
1419 return result;
1420 };
1421 braces.create = (input, options8 = {}) => {
1422 if (input === "" || input.length < 3) {
1423 return [input];
1424 }
1425 return options8.expand !== true ? braces.compile(input, options8) : braces.expand(input, options8);
1426 };
1427 module.exports = braces;
1428 }
1429});
1430
1431// node_modules/picomatch/lib/constants.js
1432var require_constants2 = __commonJS({
1433 "node_modules/picomatch/lib/constants.js"(exports, module) {
1434 "use strict";
1435 var path13 = __require("path");
1436 var WIN_SLASH = "\\\\/";
1437 var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
1438 var DOT_LITERAL = "\\.";
1439 var PLUS_LITERAL = "\\+";
1440 var QMARK_LITERAL = "\\?";
1441 var SLASH_LITERAL = "\\/";
1442 var ONE_CHAR = "(?=.)";
1443 var QMARK = "[^/]";
1444 var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
1445 var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
1446 var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
1447 var NO_DOT = `(?!${DOT_LITERAL})`;
1448 var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
1449 var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
1450 var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
1451 var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
1452 var STAR = `${QMARK}*?`;
1453 var POSIX_CHARS = {
1454 DOT_LITERAL,
1455 PLUS_LITERAL,
1456 QMARK_LITERAL,
1457 SLASH_LITERAL,
1458 ONE_CHAR,
1459 QMARK,
1460 END_ANCHOR,
1461 DOTS_SLASH,
1462 NO_DOT,
1463 NO_DOTS,
1464 NO_DOT_SLASH,
1465 NO_DOTS_SLASH,
1466 QMARK_NO_DOT,
1467 STAR,
1468 START_ANCHOR
1469 };
1470 var WINDOWS_CHARS = {
1471 ...POSIX_CHARS,
1472 SLASH_LITERAL: `[${WIN_SLASH}]`,
1473 QMARK: WIN_NO_SLASH,
1474 STAR: `${WIN_NO_SLASH}*?`,
1475 DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
1476 NO_DOT: `(?!${DOT_LITERAL})`,
1477 NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
1478 NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
1479 NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
1480 QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
1481 START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
1482 END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
1483 };
1484 var POSIX_REGEX_SOURCE = {
1485 alnum: "a-zA-Z0-9",
1486 alpha: "a-zA-Z",
1487 ascii: "\\x00-\\x7F",
1488 blank: " \\t",
1489 cntrl: "\\x00-\\x1F\\x7F",
1490 digit: "0-9",
1491 graph: "\\x21-\\x7E",
1492 lower: "a-z",
1493 print: "\\x20-\\x7E ",
1494 punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
1495 space: " \\t\\r\\n\\v\\f",
1496 upper: "A-Z",
1497 word: "A-Za-z0-9_",
1498 xdigit: "A-Fa-f0-9"
1499 };
1500 module.exports = {
1501 MAX_LENGTH: 1024 * 64,
1502 POSIX_REGEX_SOURCE,
1503 // regular expressions
1504 REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
1505 REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
1506 REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
1507 REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
1508 REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
1509 REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
1510 // Replace globs with equivalent patterns to reduce parsing time.
1511 REPLACEMENTS: {
1512 "***": "*",
1513 "**/**": "**",
1514 "**/**/**": "**"
1515 },
1516 // Digits
1517 CHAR_0: 48,
1518 /* 0 */
1519 CHAR_9: 57,
1520 /* 9 */
1521 // Alphabet chars.
1522 CHAR_UPPERCASE_A: 65,
1523 /* A */
1524 CHAR_LOWERCASE_A: 97,
1525 /* a */
1526 CHAR_UPPERCASE_Z: 90,
1527 /* Z */
1528 CHAR_LOWERCASE_Z: 122,
1529 /* z */
1530 CHAR_LEFT_PARENTHESES: 40,
1531 /* ( */
1532 CHAR_RIGHT_PARENTHESES: 41,
1533 /* ) */
1534 CHAR_ASTERISK: 42,
1535 /* * */
1536 // Non-alphabetic chars.
1537 CHAR_AMPERSAND: 38,
1538 /* & */
1539 CHAR_AT: 64,
1540 /* @ */
1541 CHAR_BACKWARD_SLASH: 92,
1542 /* \ */
1543 CHAR_CARRIAGE_RETURN: 13,
1544 /* \r */
1545 CHAR_CIRCUMFLEX_ACCENT: 94,
1546 /* ^ */
1547 CHAR_COLON: 58,
1548 /* : */
1549 CHAR_COMMA: 44,
1550 /* , */
1551 CHAR_DOT: 46,
1552 /* . */
1553 CHAR_DOUBLE_QUOTE: 34,
1554 /* " */
1555 CHAR_EQUAL: 61,
1556 /* = */
1557 CHAR_EXCLAMATION_MARK: 33,
1558 /* ! */
1559 CHAR_FORM_FEED: 12,
1560 /* \f */
1561 CHAR_FORWARD_SLASH: 47,
1562 /* / */
1563 CHAR_GRAVE_ACCENT: 96,
1564 /* ` */
1565 CHAR_HASH: 35,
1566 /* # */
1567 CHAR_HYPHEN_MINUS: 45,
1568 /* - */
1569 CHAR_LEFT_ANGLE_BRACKET: 60,
1570 /* < */
1571 CHAR_LEFT_CURLY_BRACE: 123,
1572 /* { */
1573 CHAR_LEFT_SQUARE_BRACKET: 91,
1574 /* [ */
1575 CHAR_LINE_FEED: 10,
1576 /* \n */
1577 CHAR_NO_BREAK_SPACE: 160,
1578 /* \u00A0 */
1579 CHAR_PERCENT: 37,
1580 /* % */
1581 CHAR_PLUS: 43,
1582 /* + */
1583 CHAR_QUESTION_MARK: 63,
1584 /* ? */
1585 CHAR_RIGHT_ANGLE_BRACKET: 62,
1586 /* > */
1587 CHAR_RIGHT_CURLY_BRACE: 125,
1588 /* } */
1589 CHAR_RIGHT_SQUARE_BRACKET: 93,
1590 /* ] */
1591 CHAR_SEMICOLON: 59,
1592 /* ; */
1593 CHAR_SINGLE_QUOTE: 39,
1594 /* ' */
1595 CHAR_SPACE: 32,
1596 /* */
1597 CHAR_TAB: 9,
1598 /* \t */
1599 CHAR_UNDERSCORE: 95,
1600 /* _ */
1601 CHAR_VERTICAL_LINE: 124,
1602 /* | */
1603 CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
1604 /* \uFEFF */
1605 SEP: path13.sep,
1606 /**
1607 * Create EXTGLOB_CHARS
1608 */
1609 extglobChars(chars) {
1610 return {
1611 "!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
1612 "?": { type: "qmark", open: "(?:", close: ")?" },
1613 "+": { type: "plus", open: "(?:", close: ")+" },
1614 "*": { type: "star", open: "(?:", close: ")*" },
1615 "@": { type: "at", open: "(?:", close: ")" }
1616 };
1617 },
1618 /**
1619 * Create GLOB_CHARS
1620 */
1621 globChars(win32) {
1622 return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
1623 }
1624 };
1625 }
1626});
1627
1628// node_modules/picomatch/lib/utils.js
1629var require_utils2 = __commonJS({
1630 "node_modules/picomatch/lib/utils.js"(exports) {
1631 "use strict";
1632 var path13 = __require("path");
1633 var win32 = process.platform === "win32";
1634 var {
1635 REGEX_BACKSLASH,
1636 REGEX_REMOVE_BACKSLASH,
1637 REGEX_SPECIAL_CHARS,
1638 REGEX_SPECIAL_CHARS_GLOBAL
1639 } = require_constants2();
1640 exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
1641 exports.hasRegexChars = (str2) => REGEX_SPECIAL_CHARS.test(str2);
1642 exports.isRegexChar = (str2) => str2.length === 1 && exports.hasRegexChars(str2);
1643 exports.escapeRegex = (str2) => str2.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
1644 exports.toPosixSlashes = (str2) => str2.replace(REGEX_BACKSLASH, "/");
1645 exports.removeBackslashes = (str2) => {
1646 return str2.replace(REGEX_REMOVE_BACKSLASH, (match) => {
1647 return match === "\\" ? "" : match;
1648 });
1649 };
1650 exports.supportsLookbehinds = () => {
1651 const segs = process.version.slice(1).split(".").map(Number);
1652 if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
1653 return true;
1654 }
1655 return false;
1656 };
1657 exports.isWindows = (options8) => {
1658 if (options8 && typeof options8.windows === "boolean") {
1659 return options8.windows;
1660 }
1661 return win32 === true || path13.sep === "\\";
1662 };
1663 exports.escapeLast = (input, char, lastIdx) => {
1664 const idx = input.lastIndexOf(char, lastIdx);
1665 if (idx === -1) return input;
1666 if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
1667 return `${input.slice(0, idx)}\\${input.slice(idx)}`;
1668 };
1669 exports.removePrefix = (input, state = {}) => {
1670 let output = input;
1671 if (output.startsWith("./")) {
1672 output = output.slice(2);
1673 state.prefix = "./";
1674 }
1675 return output;
1676 };
1677 exports.wrapOutput = (input, state = {}, options8 = {}) => {
1678 const prepend = options8.contains ? "" : "^";
1679 const append = options8.contains ? "" : "$";
1680 let output = `${prepend}(?:${input})${append}`;
1681 if (state.negated === true) {
1682 output = `(?:^(?!${output}).*$)`;
1683 }
1684 return output;
1685 };
1686 }
1687});
1688
1689// node_modules/picomatch/lib/scan.js
1690var require_scan = __commonJS({
1691 "node_modules/picomatch/lib/scan.js"(exports, module) {
1692 "use strict";
1693 var utils = require_utils2();
1694 var {
1695 CHAR_ASTERISK,
1696 /* * */
1697 CHAR_AT,
1698 /* @ */
1699 CHAR_BACKWARD_SLASH,
1700 /* \ */
1701 CHAR_COMMA,
1702 /* , */
1703 CHAR_DOT,
1704 /* . */
1705 CHAR_EXCLAMATION_MARK,
1706 /* ! */
1707 CHAR_FORWARD_SLASH,
1708 /* / */
1709 CHAR_LEFT_CURLY_BRACE,
1710 /* { */
1711 CHAR_LEFT_PARENTHESES,
1712 /* ( */
1713 CHAR_LEFT_SQUARE_BRACKET,
1714 /* [ */
1715 CHAR_PLUS,
1716 /* + */
1717 CHAR_QUESTION_MARK,
1718 /* ? */
1719 CHAR_RIGHT_CURLY_BRACE,
1720 /* } */
1721 CHAR_RIGHT_PARENTHESES,
1722 /* ) */
1723 CHAR_RIGHT_SQUARE_BRACKET
1724 /* ] */
1725 } = require_constants2();
1726 var isPathSeparator = (code) => {
1727 return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
1728 };
1729 var depth = (token2) => {
1730 if (token2.isPrefix !== true) {
1731 token2.depth = token2.isGlobstar ? Infinity : 1;
1732 }
1733 };
1734 var scan = (input, options8) => {
1735 const opts = options8 || {};
1736 const length = input.length - 1;
1737 const scanToEnd = opts.parts === true || opts.scanToEnd === true;
1738 const slashes = [];
1739 const tokens = [];
1740 const parts = [];
1741 let str2 = input;
1742 let index = -1;
1743 let start = 0;
1744 let lastIndex = 0;
1745 let isBrace = false;
1746 let isBracket = false;
1747 let isGlob = false;
1748 let isExtglob = false;
1749 let isGlobstar = false;
1750 let braceEscaped = false;
1751 let backslashes = false;
1752 let negated = false;
1753 let negatedExtglob = false;
1754 let finished = false;
1755 let braces = 0;
1756 let prev;
1757 let code;
1758 let token2 = { value: "", depth: 0, isGlob: false };
1759 const eos = () => index >= length;
1760 const peek2 = () => str2.charCodeAt(index + 1);
1761 const advance = () => {
1762 prev = code;
1763 return str2.charCodeAt(++index);
1764 };
1765 while (index < length) {
1766 code = advance();
1767 let next;
1768 if (code === CHAR_BACKWARD_SLASH) {
1769 backslashes = token2.backslashes = true;
1770 code = advance();
1771 if (code === CHAR_LEFT_CURLY_BRACE) {
1772 braceEscaped = true;
1773 }
1774 continue;
1775 }
1776 if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
1777 braces++;
1778 while (eos() !== true && (code = advance())) {
1779 if (code === CHAR_BACKWARD_SLASH) {
1780 backslashes = token2.backslashes = true;
1781 advance();
1782 continue;
1783 }
1784 if (code === CHAR_LEFT_CURLY_BRACE) {
1785 braces++;
1786 continue;
1787 }
1788 if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
1789 isBrace = token2.isBrace = true;
1790 isGlob = token2.isGlob = true;
1791 finished = true;
1792 if (scanToEnd === true) {
1793 continue;
1794 }
1795 break;
1796 }
1797 if (braceEscaped !== true && code === CHAR_COMMA) {
1798 isBrace = token2.isBrace = true;
1799 isGlob = token2.isGlob = true;
1800 finished = true;
1801 if (scanToEnd === true) {
1802 continue;
1803 }
1804 break;
1805 }
1806 if (code === CHAR_RIGHT_CURLY_BRACE) {
1807 braces--;
1808 if (braces === 0) {
1809 braceEscaped = false;
1810 isBrace = token2.isBrace = true;
1811 finished = true;
1812 break;
1813 }
1814 }
1815 }
1816 if (scanToEnd === true) {
1817 continue;
1818 }
1819 break;
1820 }
1821 if (code === CHAR_FORWARD_SLASH) {
1822 slashes.push(index);
1823 tokens.push(token2);
1824 token2 = { value: "", depth: 0, isGlob: false };
1825 if (finished === true) continue;
1826 if (prev === CHAR_DOT && index === start + 1) {
1827 start += 2;
1828 continue;
1829 }
1830 lastIndex = index + 1;
1831 continue;
1832 }
1833 if (opts.noext !== true) {
1834 const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
1835 if (isExtglobChar === true && peek2() === CHAR_LEFT_PARENTHESES) {
1836 isGlob = token2.isGlob = true;
1837 isExtglob = token2.isExtglob = true;
1838 finished = true;
1839 if (code === CHAR_EXCLAMATION_MARK && index === start) {
1840 negatedExtglob = true;
1841 }
1842 if (scanToEnd === true) {
1843 while (eos() !== true && (code = advance())) {
1844 if (code === CHAR_BACKWARD_SLASH) {
1845 backslashes = token2.backslashes = true;
1846 code = advance();
1847 continue;
1848 }
1849 if (code === CHAR_RIGHT_PARENTHESES) {
1850 isGlob = token2.isGlob = true;
1851 finished = true;
1852 break;
1853 }
1854 }
1855 continue;
1856 }
1857 break;
1858 }
1859 }
1860 if (code === CHAR_ASTERISK) {
1861 if (prev === CHAR_ASTERISK) isGlobstar = token2.isGlobstar = true;
1862 isGlob = token2.isGlob = true;
1863 finished = true;
1864 if (scanToEnd === true) {
1865 continue;
1866 }
1867 break;
1868 }
1869 if (code === CHAR_QUESTION_MARK) {
1870 isGlob = token2.isGlob = true;
1871 finished = true;
1872 if (scanToEnd === true) {
1873 continue;
1874 }
1875 break;
1876 }
1877 if (code === CHAR_LEFT_SQUARE_BRACKET) {
1878 while (eos() !== true && (next = advance())) {
1879 if (next === CHAR_BACKWARD_SLASH) {
1880 backslashes = token2.backslashes = true;
1881 advance();
1882 continue;
1883 }
1884 if (next === CHAR_RIGHT_SQUARE_BRACKET) {
1885 isBracket = token2.isBracket = true;
1886 isGlob = token2.isGlob = true;
1887 finished = true;
1888 break;
1889 }
1890 }
1891 if (scanToEnd === true) {
1892 continue;
1893 }
1894 break;
1895 }
1896 if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
1897 negated = token2.negated = true;
1898 start++;
1899 continue;
1900 }
1901 if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
1902 isGlob = token2.isGlob = true;
1903 if (scanToEnd === true) {
1904 while (eos() !== true && (code = advance())) {
1905 if (code === CHAR_LEFT_PARENTHESES) {
1906 backslashes = token2.backslashes = true;
1907 code = advance();
1908 continue;
1909 }
1910 if (code === CHAR_RIGHT_PARENTHESES) {
1911 finished = true;
1912 break;
1913 }
1914 }
1915 continue;
1916 }
1917 break;
1918 }
1919 if (isGlob === true) {
1920 finished = true;
1921 if (scanToEnd === true) {
1922 continue;
1923 }
1924 break;
1925 }
1926 }
1927 if (opts.noext === true) {
1928 isExtglob = false;
1929 isGlob = false;
1930 }
1931 let base = str2;
1932 let prefix = "";
1933 let glob = "";
1934 if (start > 0) {
1935 prefix = str2.slice(0, start);
1936 str2 = str2.slice(start);
1937 lastIndex -= start;
1938 }
1939 if (base && isGlob === true && lastIndex > 0) {
1940 base = str2.slice(0, lastIndex);
1941 glob = str2.slice(lastIndex);
1942 } else if (isGlob === true) {
1943 base = "";
1944 glob = str2;
1945 } else {
1946 base = str2;
1947 }
1948 if (base && base !== "" && base !== "/" && base !== str2) {
1949 if (isPathSeparator(base.charCodeAt(base.length - 1))) {
1950 base = base.slice(0, -1);
1951 }
1952 }
1953 if (opts.unescape === true) {
1954 if (glob) glob = utils.removeBackslashes(glob);
1955 if (base && backslashes === true) {
1956 base = utils.removeBackslashes(base);
1957 }
1958 }
1959 const state = {
1960 prefix,
1961 input,
1962 start,
1963 base,
1964 glob,
1965 isBrace,
1966 isBracket,
1967 isGlob,
1968 isExtglob,
1969 isGlobstar,
1970 negated,
1971 negatedExtglob
1972 };
1973 if (opts.tokens === true) {
1974 state.maxDepth = 0;
1975 if (!isPathSeparator(code)) {
1976 tokens.push(token2);
1977 }
1978 state.tokens = tokens;
1979 }
1980 if (opts.parts === true || opts.tokens === true) {
1981 let prevIndex;
1982 for (let idx = 0; idx < slashes.length; idx++) {
1983 const n = prevIndex ? prevIndex + 1 : start;
1984 const i = slashes[idx];
1985 const value = input.slice(n, i);
1986 if (opts.tokens) {
1987 if (idx === 0 && start !== 0) {
1988 tokens[idx].isPrefix = true;
1989 tokens[idx].value = prefix;
1990 } else {
1991 tokens[idx].value = value;
1992 }
1993 depth(tokens[idx]);
1994 state.maxDepth += tokens[idx].depth;
1995 }
1996 if (idx !== 0 || value !== "") {
1997 parts.push(value);
1998 }
1999 prevIndex = i;
2000 }
2001 if (prevIndex && prevIndex + 1 < input.length) {
2002 const value = input.slice(prevIndex + 1);
2003 parts.push(value);
2004 if (opts.tokens) {
2005 tokens[tokens.length - 1].value = value;
2006 depth(tokens[tokens.length - 1]);
2007 state.maxDepth += tokens[tokens.length - 1].depth;
2008 }
2009 }
2010 state.slashes = slashes;
2011 state.parts = parts;
2012 }
2013 return state;
2014 };
2015 module.exports = scan;
2016 }
2017});
2018
2019// node_modules/picomatch/lib/parse.js
2020var require_parse2 = __commonJS({
2021 "node_modules/picomatch/lib/parse.js"(exports, module) {
2022 "use strict";
2023 var constants = require_constants2();
2024 var utils = require_utils2();
2025 var {
2026 MAX_LENGTH,
2027 POSIX_REGEX_SOURCE,
2028 REGEX_NON_SPECIAL_CHARS,
2029 REGEX_SPECIAL_CHARS_BACKREF,
2030 REPLACEMENTS
2031 } = constants;
2032 var expandRange = (args, options8) => {
2033 if (typeof options8.expandRange === "function") {
2034 return options8.expandRange(...args, options8);
2035 }
2036 args.sort();
2037 const value = `[${args.join("-")}]`;
2038 try {
2039 new RegExp(value);
2040 } catch (ex) {
2041 return args.map((v) => utils.escapeRegex(v)).join("..");
2042 }
2043 return value;
2044 };
2045 var syntaxError2 = (type2, char) => {
2046 return `Missing ${type2}: "${char}" - use "\\\\${char}" to match literal characters`;
2047 };
2048 var parse7 = (input, options8) => {
2049 if (typeof input !== "string") {
2050 throw new TypeError("Expected a string");
2051 }
2052 input = REPLACEMENTS[input] || input;
2053 const opts = { ...options8 };
2054 const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
2055 let len = input.length;
2056 if (len > max) {
2057 throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
2058 }
2059 const bos = { type: "bos", value: "", output: opts.prepend || "" };
2060 const tokens = [bos];
2061 const capture = opts.capture ? "" : "?:";
2062 const win32 = utils.isWindows(options8);
2063 const PLATFORM_CHARS = constants.globChars(win32);
2064 const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
2065 const {
2066 DOT_LITERAL,
2067 PLUS_LITERAL,
2068 SLASH_LITERAL,
2069 ONE_CHAR,
2070 DOTS_SLASH,
2071 NO_DOT,
2072 NO_DOT_SLASH,
2073 NO_DOTS_SLASH,
2074 QMARK,
2075 QMARK_NO_DOT,
2076 STAR,
2077 START_ANCHOR
2078 } = PLATFORM_CHARS;
2079 const globstar = (opts2) => {
2080 return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
2081 };
2082 const nodot = opts.dot ? "" : NO_DOT;
2083 const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
2084 let star = opts.bash === true ? globstar(opts) : STAR;
2085 if (opts.capture) {
2086 star = `(${star})`;
2087 }
2088 if (typeof opts.noext === "boolean") {
2089 opts.noextglob = opts.noext;
2090 }
2091 const state = {
2092 input,
2093 index: -1,
2094 start: 0,
2095 dot: opts.dot === true,
2096 consumed: "",
2097 output: "",
2098 prefix: "",
2099 backtrack: false,
2100 negated: false,
2101 brackets: 0,
2102 braces: 0,
2103 parens: 0,
2104 quotes: 0,
2105 globstar: false,
2106 tokens
2107 };
2108 input = utils.removePrefix(input, state);
2109 len = input.length;
2110 const extglobs = [];
2111 const braces = [];
2112 const stack2 = [];
2113 let prev = bos;
2114 let value;
2115 const eos = () => state.index === len - 1;
2116 const peek2 = state.peek = (n = 1) => input[state.index + n];
2117 const advance = state.advance = () => input[++state.index] || "";
2118 const remaining = () => input.slice(state.index + 1);
2119 const consume = (value2 = "", num = 0) => {
2120 state.consumed += value2;
2121 state.index += num;
2122 };
2123 const append = (token2) => {
2124 state.output += token2.output != null ? token2.output : token2.value;
2125 consume(token2.value);
2126 };
2127 const negate = () => {
2128 let count = 1;
2129 while (peek2() === "!" && (peek2(2) !== "(" || peek2(3) === "?")) {
2130 advance();
2131 state.start++;
2132 count++;
2133 }
2134 if (count % 2 === 0) {
2135 return false;
2136 }
2137 state.negated = true;
2138 state.start++;
2139 return true;
2140 };
2141 const increment = (type2) => {
2142 state[type2]++;
2143 stack2.push(type2);
2144 };
2145 const decrement = (type2) => {
2146 state[type2]--;
2147 stack2.pop();
2148 };
2149 const push2 = (tok) => {
2150 if (prev.type === "globstar") {
2151 const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
2152 const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
2153 if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
2154 state.output = state.output.slice(0, -prev.output.length);
2155 prev.type = "star";
2156 prev.value = "*";
2157 prev.output = star;
2158 state.output += prev.output;
2159 }
2160 }
2161 if (extglobs.length && tok.type !== "paren") {
2162 extglobs[extglobs.length - 1].inner += tok.value;
2163 }
2164 if (tok.value || tok.output) append(tok);
2165 if (prev && prev.type === "text" && tok.type === "text") {
2166 prev.value += tok.value;
2167 prev.output = (prev.output || "") + tok.value;
2168 return;
2169 }
2170 tok.prev = prev;
2171 tokens.push(tok);
2172 prev = tok;
2173 };
2174 const extglobOpen = (type2, value2) => {
2175 const token2 = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
2176 token2.prev = prev;
2177 token2.parens = state.parens;
2178 token2.output = state.output;
2179 const output = (opts.capture ? "(" : "") + token2.open;
2180 increment("parens");
2181 push2({ type: type2, value: value2, output: state.output ? "" : ONE_CHAR });
2182 push2({ type: "paren", extglob: true, value: advance(), output });
2183 extglobs.push(token2);
2184 };
2185 const extglobClose = (token2) => {
2186 let output = token2.close + (opts.capture ? ")" : "");
2187 let rest;
2188 if (token2.type === "negate") {
2189 let extglobStar = star;
2190 if (token2.inner && token2.inner.length > 1 && token2.inner.includes("/")) {
2191 extglobStar = globstar(opts);
2192 }
2193 if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
2194 output = token2.close = `)$))${extglobStar}`;
2195 }
2196 if (token2.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
2197 const expression = parse7(rest, { ...options8, fastpaths: false }).output;
2198 output = token2.close = `)${expression})${extglobStar})`;
2199 }
2200 if (token2.prev.type === "bos") {
2201 state.negatedExtglob = true;
2202 }
2203 }
2204 push2({ type: "paren", extglob: true, value, output });
2205 decrement("parens");
2206 };
2207 if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
2208 let backslashes = false;
2209 let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
2210 if (first === "\\") {
2211 backslashes = true;
2212 return m;
2213 }
2214 if (first === "?") {
2215 if (esc) {
2216 return esc + first + (rest ? QMARK.repeat(rest.length) : "");
2217 }
2218 if (index === 0) {
2219 return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
2220 }
2221 return QMARK.repeat(chars.length);
2222 }
2223 if (first === ".") {
2224 return DOT_LITERAL.repeat(chars.length);
2225 }
2226 if (first === "*") {
2227 if (esc) {
2228 return esc + first + (rest ? star : "");
2229 }
2230 return star;
2231 }
2232 return esc ? m : `\\${m}`;
2233 });
2234 if (backslashes === true) {
2235 if (opts.unescape === true) {
2236 output = output.replace(/\\/g, "");
2237 } else {
2238 output = output.replace(/\\+/g, (m) => {
2239 return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
2240 });
2241 }
2242 }
2243 if (output === input && opts.contains === true) {
2244 state.output = input;
2245 return state;
2246 }
2247 state.output = utils.wrapOutput(output, state, options8);
2248 return state;
2249 }
2250 while (!eos()) {
2251 value = advance();
2252 if (value === "\0") {
2253 continue;
2254 }
2255 if (value === "\\") {
2256 const next = peek2();
2257 if (next === "/" && opts.bash !== true) {
2258 continue;
2259 }
2260 if (next === "." || next === ";") {
2261 continue;
2262 }
2263 if (!next) {
2264 value += "\\";
2265 push2({ type: "text", value });
2266 continue;
2267 }
2268 const match = /^\\+/.exec(remaining());
2269 let slashes = 0;
2270 if (match && match[0].length > 2) {
2271 slashes = match[0].length;
2272 state.index += slashes;
2273 if (slashes % 2 !== 0) {
2274 value += "\\";
2275 }
2276 }
2277 if (opts.unescape === true) {
2278 value = advance();
2279 } else {
2280 value += advance();
2281 }
2282 if (state.brackets === 0) {
2283 push2({ type: "text", value });
2284 continue;
2285 }
2286 }
2287 if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
2288 if (opts.posix !== false && value === ":") {
2289 const inner = prev.value.slice(1);
2290 if (inner.includes("[")) {
2291 prev.posix = true;
2292 if (inner.includes(":")) {
2293 const idx = prev.value.lastIndexOf("[");
2294 const pre = prev.value.slice(0, idx);
2295 const rest2 = prev.value.slice(idx + 2);
2296 const posix = POSIX_REGEX_SOURCE[rest2];
2297 if (posix) {
2298 prev.value = pre + posix;
2299 state.backtrack = true;
2300 advance();
2301 if (!bos.output && tokens.indexOf(prev) === 1) {
2302 bos.output = ONE_CHAR;
2303 }
2304 continue;
2305 }
2306 }
2307 }
2308 }
2309 if (value === "[" && peek2() !== ":" || value === "-" && peek2() === "]") {
2310 value = `\\${value}`;
2311 }
2312 if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
2313 value = `\\${value}`;
2314 }
2315 if (opts.posix === true && value === "!" && prev.value === "[") {
2316 value = "^";
2317 }
2318 prev.value += value;
2319 append({ value });
2320 continue;
2321 }
2322 if (state.quotes === 1 && value !== '"') {
2323 value = utils.escapeRegex(value);
2324 prev.value += value;
2325 append({ value });
2326 continue;
2327 }
2328 if (value === '"') {
2329 state.quotes = state.quotes === 1 ? 0 : 1;
2330 if (opts.keepQuotes === true) {
2331 push2({ type: "text", value });
2332 }
2333 continue;
2334 }
2335 if (value === "(") {
2336 increment("parens");
2337 push2({ type: "paren", value });
2338 continue;
2339 }
2340 if (value === ")") {
2341 if (state.parens === 0 && opts.strictBrackets === true) {
2342 throw new SyntaxError(syntaxError2("opening", "("));
2343 }
2344 const extglob = extglobs[extglobs.length - 1];
2345 if (extglob && state.parens === extglob.parens + 1) {
2346 extglobClose(extglobs.pop());
2347 continue;
2348 }
2349 push2({ type: "paren", value, output: state.parens ? ")" : "\\)" });
2350 decrement("parens");
2351 continue;
2352 }
2353 if (value === "[") {
2354 if (opts.nobracket === true || !remaining().includes("]")) {
2355 if (opts.nobracket !== true && opts.strictBrackets === true) {
2356 throw new SyntaxError(syntaxError2("closing", "]"));
2357 }
2358 value = `\\${value}`;
2359 } else {
2360 increment("brackets");
2361 }
2362 push2({ type: "bracket", value });
2363 continue;
2364 }
2365 if (value === "]") {
2366 if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
2367 push2({ type: "text", value, output: `\\${value}` });
2368 continue;
2369 }
2370 if (state.brackets === 0) {
2371 if (opts.strictBrackets === true) {
2372 throw new SyntaxError(syntaxError2("opening", "["));
2373 }
2374 push2({ type: "text", value, output: `\\${value}` });
2375 continue;
2376 }
2377 decrement("brackets");
2378 const prevValue = prev.value.slice(1);
2379 if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
2380 value = `/${value}`;
2381 }
2382 prev.value += value;
2383 append({ value });
2384 if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
2385 continue;
2386 }
2387 const escaped = utils.escapeRegex(prev.value);
2388 state.output = state.output.slice(0, -prev.value.length);
2389 if (opts.literalBrackets === true) {
2390 state.output += escaped;
2391 prev.value = escaped;
2392 continue;
2393 }
2394 prev.value = `(${capture}${escaped}|${prev.value})`;
2395 state.output += prev.value;
2396 continue;
2397 }
2398 if (value === "{" && opts.nobrace !== true) {
2399 increment("braces");
2400 const open = {
2401 type: "brace",
2402 value,
2403 output: "(",
2404 outputIndex: state.output.length,
2405 tokensIndex: state.tokens.length
2406 };
2407 braces.push(open);
2408 push2(open);
2409 continue;
2410 }
2411 if (value === "}") {
2412 const brace = braces[braces.length - 1];
2413 if (opts.nobrace === true || !brace) {
2414 push2({ type: "text", value, output: value });
2415 continue;
2416 }
2417 let output = ")";
2418 if (brace.dots === true) {
2419 const arr = tokens.slice();
2420 const range = [];
2421 for (let i = arr.length - 1; i >= 0; i--) {
2422 tokens.pop();
2423 if (arr[i].type === "brace") {
2424 break;
2425 }
2426 if (arr[i].type !== "dots") {
2427 range.unshift(arr[i].value);
2428 }
2429 }
2430 output = expandRange(range, opts);
2431 state.backtrack = true;
2432 }
2433 if (brace.comma !== true && brace.dots !== true) {
2434 const out = state.output.slice(0, brace.outputIndex);
2435 const toks = state.tokens.slice(brace.tokensIndex);
2436 brace.value = brace.output = "\\{";
2437 value = output = "\\}";
2438 state.output = out;
2439 for (const t of toks) {
2440 state.output += t.output || t.value;
2441 }
2442 }
2443 push2({ type: "brace", value, output });
2444 decrement("braces");
2445 braces.pop();
2446 continue;
2447 }
2448 if (value === "|") {
2449 if (extglobs.length > 0) {
2450 extglobs[extglobs.length - 1].conditions++;
2451 }
2452 push2({ type: "text", value });
2453 continue;
2454 }
2455 if (value === ",") {
2456 let output = value;
2457 const brace = braces[braces.length - 1];
2458 if (brace && stack2[stack2.length - 1] === "braces") {
2459 brace.comma = true;
2460 output = "|";
2461 }
2462 push2({ type: "comma", value, output });
2463 continue;
2464 }
2465 if (value === "/") {
2466 if (prev.type === "dot" && state.index === state.start + 1) {
2467 state.start = state.index + 1;
2468 state.consumed = "";
2469 state.output = "";
2470 tokens.pop();
2471 prev = bos;
2472 continue;
2473 }
2474 push2({ type: "slash", value, output: SLASH_LITERAL });
2475 continue;
2476 }
2477 if (value === ".") {
2478 if (state.braces > 0 && prev.type === "dot") {
2479 if (prev.value === ".") prev.output = DOT_LITERAL;
2480 const brace = braces[braces.length - 1];
2481 prev.type = "dots";
2482 prev.output += value;
2483 prev.value += value;
2484 brace.dots = true;
2485 continue;
2486 }
2487 if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
2488 push2({ type: "text", value, output: DOT_LITERAL });
2489 continue;
2490 }
2491 push2({ type: "dot", value, output: DOT_LITERAL });
2492 continue;
2493 }
2494 if (value === "?") {
2495 const isGroup = prev && prev.value === "(";
2496 if (!isGroup && opts.noextglob !== true && peek2() === "(" && peek2(2) !== "?") {
2497 extglobOpen("qmark", value);
2498 continue;
2499 }
2500 if (prev && prev.type === "paren") {
2501 const next = peek2();
2502 let output = value;
2503 if (next === "<" && !utils.supportsLookbehinds()) {
2504 throw new Error("Node.js v10 or higher is required for regex lookbehinds");
2505 }
2506 if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
2507 output = `\\${value}`;
2508 }
2509 push2({ type: "text", value, output });
2510 continue;
2511 }
2512 if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
2513 push2({ type: "qmark", value, output: QMARK_NO_DOT });
2514 continue;
2515 }
2516 push2({ type: "qmark", value, output: QMARK });
2517 continue;
2518 }
2519 if (value === "!") {
2520 if (opts.noextglob !== true && peek2() === "(") {
2521 if (peek2(2) !== "?" || !/[!=<:]/.test(peek2(3))) {
2522 extglobOpen("negate", value);
2523 continue;
2524 }
2525 }
2526 if (opts.nonegate !== true && state.index === 0) {
2527 negate();
2528 continue;
2529 }
2530 }
2531 if (value === "+") {
2532 if (opts.noextglob !== true && peek2() === "(" && peek2(2) !== "?") {
2533 extglobOpen("plus", value);
2534 continue;
2535 }
2536 if (prev && prev.value === "(" || opts.regex === false) {
2537 push2({ type: "plus", value, output: PLUS_LITERAL });
2538 continue;
2539 }
2540 if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
2541 push2({ type: "plus", value });
2542 continue;
2543 }
2544 push2({ type: "plus", value: PLUS_LITERAL });
2545 continue;
2546 }
2547 if (value === "@") {
2548 if (opts.noextglob !== true && peek2() === "(" && peek2(2) !== "?") {
2549 push2({ type: "at", extglob: true, value, output: "" });
2550 continue;
2551 }
2552 push2({ type: "text", value });
2553 continue;
2554 }
2555 if (value !== "*") {
2556 if (value === "$" || value === "^") {
2557 value = `\\${value}`;
2558 }
2559 const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
2560 if (match) {
2561 value += match[0];
2562 state.index += match[0].length;
2563 }
2564 push2({ type: "text", value });
2565 continue;
2566 }
2567 if (prev && (prev.type === "globstar" || prev.star === true)) {
2568 prev.type = "star";
2569 prev.star = true;
2570 prev.value += value;
2571 prev.output = star;
2572 state.backtrack = true;
2573 state.globstar = true;
2574 consume(value);
2575 continue;
2576 }
2577 let rest = remaining();
2578 if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
2579 extglobOpen("star", value);
2580 continue;
2581 }
2582 if (prev.type === "star") {
2583 if (opts.noglobstar === true) {
2584 consume(value);
2585 continue;
2586 }
2587 const prior = prev.prev;
2588 const before = prior.prev;
2589 const isStart = prior.type === "slash" || prior.type === "bos";
2590 const afterStar = before && (before.type === "star" || before.type === "globstar");
2591 if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
2592 push2({ type: "star", value, output: "" });
2593 continue;
2594 }
2595 const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
2596 const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
2597 if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
2598 push2({ type: "star", value, output: "" });
2599 continue;
2600 }
2601 while (rest.slice(0, 3) === "/**") {
2602 const after = input[state.index + 4];
2603 if (after && after !== "/") {
2604 break;
2605 }
2606 rest = rest.slice(3);
2607 consume("/**", 3);
2608 }
2609 if (prior.type === "bos" && eos()) {
2610 prev.type = "globstar";
2611 prev.value += value;
2612 prev.output = globstar(opts);
2613 state.output = prev.output;
2614 state.globstar = true;
2615 consume(value);
2616 continue;
2617 }
2618 if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
2619 state.output = state.output.slice(0, -(prior.output + prev.output).length);
2620 prior.output = `(?:${prior.output}`;
2621 prev.type = "globstar";
2622 prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
2623 prev.value += value;
2624 state.globstar = true;
2625 state.output += prior.output + prev.output;
2626 consume(value);
2627 continue;
2628 }
2629 if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
2630 const end = rest[1] !== void 0 ? "|$" : "";
2631 state.output = state.output.slice(0, -(prior.output + prev.output).length);
2632 prior.output = `(?:${prior.output}`;
2633 prev.type = "globstar";
2634 prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
2635 prev.value += value;
2636 state.output += prior.output + prev.output;
2637 state.globstar = true;
2638 consume(value + advance());
2639 push2({ type: "slash", value: "/", output: "" });
2640 continue;
2641 }
2642 if (prior.type === "bos" && rest[0] === "/") {
2643 prev.type = "globstar";
2644 prev.value += value;
2645 prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
2646 state.output = prev.output;
2647 state.globstar = true;
2648 consume(value + advance());
2649 push2({ type: "slash", value: "/", output: "" });
2650 continue;
2651 }
2652 state.output = state.output.slice(0, -prev.output.length);
2653 prev.type = "globstar";
2654 prev.output = globstar(opts);
2655 prev.value += value;
2656 state.output += prev.output;
2657 state.globstar = true;
2658 consume(value);
2659 continue;
2660 }
2661 const token2 = { type: "star", value, output: star };
2662 if (opts.bash === true) {
2663 token2.output = ".*?";
2664 if (prev.type === "bos" || prev.type === "slash") {
2665 token2.output = nodot + token2.output;
2666 }
2667 push2(token2);
2668 continue;
2669 }
2670 if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
2671 token2.output = value;
2672 push2(token2);
2673 continue;
2674 }
2675 if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
2676 if (prev.type === "dot") {
2677 state.output += NO_DOT_SLASH;
2678 prev.output += NO_DOT_SLASH;
2679 } else if (opts.dot === true) {
2680 state.output += NO_DOTS_SLASH;
2681 prev.output += NO_DOTS_SLASH;
2682 } else {
2683 state.output += nodot;
2684 prev.output += nodot;
2685 }
2686 if (peek2() !== "*") {
2687 state.output += ONE_CHAR;
2688 prev.output += ONE_CHAR;
2689 }
2690 }
2691 push2(token2);
2692 }
2693 while (state.brackets > 0) {
2694 if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", "]"));
2695 state.output = utils.escapeLast(state.output, "[");
2696 decrement("brackets");
2697 }
2698 while (state.parens > 0) {
2699 if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", ")"));
2700 state.output = utils.escapeLast(state.output, "(");
2701 decrement("parens");
2702 }
2703 while (state.braces > 0) {
2704 if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", "}"));
2705 state.output = utils.escapeLast(state.output, "{");
2706 decrement("braces");
2707 }
2708 if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
2709 push2({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
2710 }
2711 if (state.backtrack === true) {
2712 state.output = "";
2713 for (const token2 of state.tokens) {
2714 state.output += token2.output != null ? token2.output : token2.value;
2715 if (token2.suffix) {
2716 state.output += token2.suffix;
2717 }
2718 }
2719 }
2720 return state;
2721 };
2722 parse7.fastpaths = (input, options8) => {
2723 const opts = { ...options8 };
2724 const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
2725 const len = input.length;
2726 if (len > max) {
2727 throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
2728 }
2729 input = REPLACEMENTS[input] || input;
2730 const win32 = utils.isWindows(options8);
2731 const {
2732 DOT_LITERAL,
2733 SLASH_LITERAL,
2734 ONE_CHAR,
2735 DOTS_SLASH,
2736 NO_DOT,
2737 NO_DOTS,
2738 NO_DOTS_SLASH,
2739 STAR,
2740 START_ANCHOR
2741 } = constants.globChars(win32);
2742 const nodot = opts.dot ? NO_DOTS : NO_DOT;
2743 const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
2744 const capture = opts.capture ? "" : "?:";
2745 const state = { negated: false, prefix: "" };
2746 let star = opts.bash === true ? ".*?" : STAR;
2747 if (opts.capture) {
2748 star = `(${star})`;
2749 }
2750 const globstar = (opts2) => {
2751 if (opts2.noglobstar === true) return star;
2752 return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
2753 };
2754 const create = (str2) => {
2755 switch (str2) {
2756 case "*":
2757 return `${nodot}${ONE_CHAR}${star}`;
2758 case ".*":
2759 return `${DOT_LITERAL}${ONE_CHAR}${star}`;
2760 case "*.*":
2761 return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
2762 case "*/*":
2763 return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
2764 case "**":
2765 return nodot + globstar(opts);
2766 case "**/*":
2767 return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
2768 case "**/*.*":
2769 return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
2770 case "**/.*":
2771 return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
2772 default: {
2773 const match = /^(.*?)\.(\w+)$/.exec(str2);
2774 if (!match) return;
2775 const source3 = create(match[1]);
2776 if (!source3) return;
2777 return source3 + DOT_LITERAL + match[2];
2778 }
2779 }
2780 };
2781 const output = utils.removePrefix(input, state);
2782 let source2 = create(output);
2783 if (source2 && opts.strictSlashes !== true) {
2784 source2 += `${SLASH_LITERAL}?`;
2785 }
2786 return source2;
2787 };
2788 module.exports = parse7;
2789 }
2790});
2791
2792// node_modules/picomatch/lib/picomatch.js
2793var require_picomatch = __commonJS({
2794 "node_modules/picomatch/lib/picomatch.js"(exports, module) {
2795 "use strict";
2796 var path13 = __require("path");
2797 var scan = require_scan();
2798 var parse7 = require_parse2();
2799 var utils = require_utils2();
2800 var constants = require_constants2();
2801 var isObject3 = (val) => val && typeof val === "object" && !Array.isArray(val);
2802 var picomatch = (glob, options8, returnState = false) => {
2803 if (Array.isArray(glob)) {
2804 const fns = glob.map((input) => picomatch(input, options8, returnState));
2805 const arrayMatcher = (str2) => {
2806 for (const isMatch of fns) {
2807 const state2 = isMatch(str2);
2808 if (state2) return state2;
2809 }
2810 return false;
2811 };
2812 return arrayMatcher;
2813 }
2814 const isState = isObject3(glob) && glob.tokens && glob.input;
2815 if (glob === "" || typeof glob !== "string" && !isState) {
2816 throw new TypeError("Expected pattern to be a non-empty string");
2817 }
2818 const opts = options8 || {};
2819 const posix = utils.isWindows(options8);
2820 const regex = isState ? picomatch.compileRe(glob, options8) : picomatch.makeRe(glob, options8, false, true);
2821 const state = regex.state;
2822 delete regex.state;
2823 let isIgnored2 = () => false;
2824 if (opts.ignore) {
2825 const ignoreOpts = { ...options8, ignore: null, onMatch: null, onResult: null };
2826 isIgnored2 = picomatch(opts.ignore, ignoreOpts, returnState);
2827 }
2828 const matcher = (input, returnObject = false) => {
2829 const { isMatch, match, output } = picomatch.test(input, regex, options8, { glob, posix });
2830 const result = { glob, state, regex, posix, input, output, match, isMatch };
2831 if (typeof opts.onResult === "function") {
2832 opts.onResult(result);
2833 }
2834 if (isMatch === false) {
2835 result.isMatch = false;
2836 return returnObject ? result : false;
2837 }
2838 if (isIgnored2(input)) {
2839 if (typeof opts.onIgnore === "function") {
2840 opts.onIgnore(result);
2841 }
2842 result.isMatch = false;
2843 return returnObject ? result : false;
2844 }
2845 if (typeof opts.onMatch === "function") {
2846 opts.onMatch(result);
2847 }
2848 return returnObject ? result : true;
2849 };
2850 if (returnState) {
2851 matcher.state = state;
2852 }
2853 return matcher;
2854 };
2855 picomatch.test = (input, regex, options8, { glob, posix } = {}) => {
2856 if (typeof input !== "string") {
2857 throw new TypeError("Expected input to be a string");
2858 }
2859 if (input === "") {
2860 return { isMatch: false, output: "" };
2861 }
2862 const opts = options8 || {};
2863 const format3 = opts.format || (posix ? utils.toPosixSlashes : null);
2864 let match = input === glob;
2865 let output = match && format3 ? format3(input) : input;
2866 if (match === false) {
2867 output = format3 ? format3(input) : input;
2868 match = output === glob;
2869 }
2870 if (match === false || opts.capture === true) {
2871 if (opts.matchBase === true || opts.basename === true) {
2872 match = picomatch.matchBase(input, regex, options8, posix);
2873 } else {
2874 match = regex.exec(output);
2875 }
2876 }
2877 return { isMatch: Boolean(match), match, output };
2878 };
2879 picomatch.matchBase = (input, glob, options8, posix = utils.isWindows(options8)) => {
2880 const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options8);
2881 return regex.test(path13.basename(input));
2882 };
2883 picomatch.isMatch = (str2, patterns, options8) => picomatch(patterns, options8)(str2);
2884 picomatch.parse = (pattern, options8) => {
2885 if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options8));
2886 return parse7(pattern, { ...options8, fastpaths: false });
2887 };
2888 picomatch.scan = (input, options8) => scan(input, options8);
2889 picomatch.compileRe = (state, options8, returnOutput = false, returnState = false) => {
2890 if (returnOutput === true) {
2891 return state.output;
2892 }
2893 const opts = options8 || {};
2894 const prepend = opts.contains ? "" : "^";
2895 const append = opts.contains ? "" : "$";
2896 let source2 = `${prepend}(?:${state.output})${append}`;
2897 if (state && state.negated === true) {
2898 source2 = `^(?!${source2}).*$`;
2899 }
2900 const regex = picomatch.toRegex(source2, options8);
2901 if (returnState === true) {
2902 regex.state = state;
2903 }
2904 return regex;
2905 };
2906 picomatch.makeRe = (input, options8 = {}, returnOutput = false, returnState = false) => {
2907 if (!input || typeof input !== "string") {
2908 throw new TypeError("Expected a non-empty string");
2909 }
2910 let parsed = { negated: false, fastpaths: true };
2911 if (options8.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
2912 parsed.output = parse7.fastpaths(input, options8);
2913 }
2914 if (!parsed.output) {
2915 parsed = parse7(input, options8);
2916 }
2917 return picomatch.compileRe(parsed, options8, returnOutput, returnState);
2918 };
2919 picomatch.toRegex = (source2, options8) => {
2920 try {
2921 const opts = options8 || {};
2922 return new RegExp(source2, opts.flags || (opts.nocase ? "i" : ""));
2923 } catch (err) {
2924 if (options8 && options8.debug === true) throw err;
2925 return /$^/;
2926 }
2927 };
2928 picomatch.constants = constants;
2929 module.exports = picomatch;
2930 }
2931});
2932
2933// node_modules/picomatch/index.js
2934var require_picomatch2 = __commonJS({
2935 "node_modules/picomatch/index.js"(exports, module) {
2936 "use strict";
2937 module.exports = require_picomatch();
2938 }
2939});
2940
2941// node_modules/micromatch/index.js
2942var require_micromatch = __commonJS({
2943 "node_modules/micromatch/index.js"(exports, module) {
2944 "use strict";
2945 var util2 = __require("util");
2946 var braces = require_braces();
2947 var picomatch = require_picomatch2();
2948 var utils = require_utils2();
2949 var isEmptyString = (v) => v === "" || v === "./";
2950 var hasBraces = (v) => {
2951 const index = v.indexOf("{");
2952 return index > -1 && v.indexOf("}", index) > -1;
2953 };
2954 var micromatch2 = (list, patterns, options8) => {
2955 patterns = [].concat(patterns);
2956 list = [].concat(list);
2957 let omit2 = /* @__PURE__ */ new Set();
2958 let keep = /* @__PURE__ */ new Set();
2959 let items = /* @__PURE__ */ new Set();
2960 let negatives = 0;
2961 let onResult = (state) => {
2962 items.add(state.output);
2963 if (options8 && options8.onResult) {
2964 options8.onResult(state);
2965 }
2966 };
2967 for (let i = 0; i < patterns.length; i++) {
2968 let isMatch = picomatch(String(patterns[i]), { ...options8, onResult }, true);
2969 let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
2970 if (negated) negatives++;
2971 for (let item of list) {
2972 let matched = isMatch(item, true);
2973 let match = negated ? !matched.isMatch : matched.isMatch;
2974 if (!match) continue;
2975 if (negated) {
2976 omit2.add(matched.output);
2977 } else {
2978 omit2.delete(matched.output);
2979 keep.add(matched.output);
2980 }
2981 }
2982 }
2983 let result = negatives === patterns.length ? [...items] : [...keep];
2984 let matches = result.filter((item) => !omit2.has(item));
2985 if (options8 && matches.length === 0) {
2986 if (options8.failglob === true) {
2987 throw new Error(`No matches found for "${patterns.join(", ")}"`);
2988 }
2989 if (options8.nonull === true || options8.nullglob === true) {
2990 return options8.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
2991 }
2992 }
2993 return matches;
2994 };
2995 micromatch2.match = micromatch2;
2996 micromatch2.matcher = (pattern, options8) => picomatch(pattern, options8);
2997 micromatch2.isMatch = (str2, patterns, options8) => picomatch(patterns, options8)(str2);
2998 micromatch2.any = micromatch2.isMatch;
2999 micromatch2.not = (list, patterns, options8 = {}) => {
3000 patterns = [].concat(patterns).map(String);
3001 let result = /* @__PURE__ */ new Set();
3002 let items = [];
3003 let onResult = (state) => {
3004 if (options8.onResult) options8.onResult(state);
3005 items.push(state.output);
3006 };
3007 let matches = new Set(micromatch2(list, patterns, { ...options8, onResult }));
3008 for (let item of items) {
3009 if (!matches.has(item)) {
3010 result.add(item);
3011 }
3012 }
3013 return [...result];
3014 };
3015 micromatch2.contains = (str2, pattern, options8) => {
3016 if (typeof str2 !== "string") {
3017 throw new TypeError(`Expected a string: "${util2.inspect(str2)}"`);
3018 }
3019 if (Array.isArray(pattern)) {
3020 return pattern.some((p) => micromatch2.contains(str2, p, options8));
3021 }
3022 if (typeof pattern === "string") {
3023 if (isEmptyString(str2) || isEmptyString(pattern)) {
3024 return false;
3025 }
3026 if (str2.includes(pattern) || str2.startsWith("./") && str2.slice(2).includes(pattern)) {
3027 return true;
3028 }
3029 }
3030 return micromatch2.isMatch(str2, pattern, { ...options8, contains: true });
3031 };
3032 micromatch2.matchKeys = (obj, patterns, options8) => {
3033 if (!utils.isObject(obj)) {
3034 throw new TypeError("Expected the first argument to be an object");
3035 }
3036 let keys = micromatch2(Object.keys(obj), patterns, options8);
3037 let res = {};
3038 for (let key2 of keys) res[key2] = obj[key2];
3039 return res;
3040 };
3041 micromatch2.some = (list, patterns, options8) => {
3042 let items = [].concat(list);
3043 for (let pattern of [].concat(patterns)) {
3044 let isMatch = picomatch(String(pattern), options8);
3045 if (items.some((item) => isMatch(item))) {
3046 return true;
3047 }
3048 }
3049 return false;
3050 };
3051 micromatch2.every = (list, patterns, options8) => {
3052 let items = [].concat(list);
3053 for (let pattern of [].concat(patterns)) {
3054 let isMatch = picomatch(String(pattern), options8);
3055 if (!items.every((item) => isMatch(item))) {
3056 return false;
3057 }
3058 }
3059 return true;
3060 };
3061 micromatch2.all = (str2, patterns, options8) => {
3062 if (typeof str2 !== "string") {
3063 throw new TypeError(`Expected a string: "${util2.inspect(str2)}"`);
3064 }
3065 return [].concat(patterns).every((p) => picomatch(p, options8)(str2));
3066 };
3067 micromatch2.capture = (glob, input, options8) => {
3068 let posix = utils.isWindows(options8);
3069 let regex = picomatch.makeRe(String(glob), { ...options8, capture: true });
3070 let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
3071 if (match) {
3072 return match.slice(1).map((v) => v === void 0 ? "" : v);
3073 }
3074 };
3075 micromatch2.makeRe = (...args) => picomatch.makeRe(...args);
3076 micromatch2.scan = (...args) => picomatch.scan(...args);
3077 micromatch2.parse = (patterns, options8) => {
3078 let res = [];
3079 for (let pattern of [].concat(patterns || [])) {
3080 for (let str2 of braces(String(pattern), options8)) {
3081 res.push(picomatch.parse(str2, options8));
3082 }
3083 }
3084 return res;
3085 };
3086 micromatch2.braces = (pattern, options8) => {
3087 if (typeof pattern !== "string") throw new TypeError("Expected a string");
3088 if (options8 && options8.nobrace === true || !hasBraces(pattern)) {
3089 return [pattern];
3090 }
3091 return braces(pattern, options8);
3092 };
3093 micromatch2.braceExpand = (pattern, options8) => {
3094 if (typeof pattern !== "string") throw new TypeError("Expected a string");
3095 return micromatch2.braces(pattern, { ...options8, expand: true });
3096 };
3097 micromatch2.hasBraces = hasBraces;
3098 module.exports = micromatch2;
3099 }
3100});
3101
3102// node_modules/fast-glob/out/utils/pattern.js
3103var require_pattern = __commonJS({
3104 "node_modules/fast-glob/out/utils/pattern.js"(exports) {
3105 "use strict";
3106 Object.defineProperty(exports, "__esModule", { value: true });
3107 exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
3108 var path13 = __require("path");
3109 var globParent = require_glob_parent();
3110 var micromatch2 = require_micromatch();
3111 var GLOBSTAR = "**";
3112 var ESCAPE_SYMBOL = "\\";
3113 var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
3114 var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
3115 var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
3116 var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
3117 var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
3118 var DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
3119 function isStaticPattern(pattern, options8 = {}) {
3120 return !isDynamicPattern(pattern, options8);
3121 }
3122 exports.isStaticPattern = isStaticPattern;
3123 function isDynamicPattern(pattern, options8 = {}) {
3124 if (pattern === "") {
3125 return false;
3126 }
3127 if (options8.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
3128 return true;
3129 }
3130 if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
3131 return true;
3132 }
3133 if (options8.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
3134 return true;
3135 }
3136 if (options8.braceExpansion !== false && hasBraceExpansion(pattern)) {
3137 return true;
3138 }
3139 return false;
3140 }
3141 exports.isDynamicPattern = isDynamicPattern;
3142 function hasBraceExpansion(pattern) {
3143 const openingBraceIndex = pattern.indexOf("{");
3144 if (openingBraceIndex === -1) {
3145 return false;
3146 }
3147 const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1);
3148 if (closingBraceIndex === -1) {
3149 return false;
3150 }
3151 const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
3152 return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
3153 }
3154 function convertToPositivePattern(pattern) {
3155 return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
3156 }
3157 exports.convertToPositivePattern = convertToPositivePattern;
3158 function convertToNegativePattern(pattern) {
3159 return "!" + pattern;
3160 }
3161 exports.convertToNegativePattern = convertToNegativePattern;
3162 function isNegativePattern(pattern) {
3163 return pattern.startsWith("!") && pattern[1] !== "(";
3164 }
3165 exports.isNegativePattern = isNegativePattern;
3166 function isPositivePattern(pattern) {
3167 return !isNegativePattern(pattern);
3168 }
3169 exports.isPositivePattern = isPositivePattern;
3170 function getNegativePatterns(patterns) {
3171 return patterns.filter(isNegativePattern);
3172 }
3173 exports.getNegativePatterns = getNegativePatterns;
3174 function getPositivePatterns(patterns) {
3175 return patterns.filter(isPositivePattern);
3176 }
3177 exports.getPositivePatterns = getPositivePatterns;
3178 function getPatternsInsideCurrentDirectory(patterns) {
3179 return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
3180 }
3181 exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
3182 function getPatternsOutsideCurrentDirectory(patterns) {
3183 return patterns.filter(isPatternRelatedToParentDirectory);
3184 }
3185 exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
3186 function isPatternRelatedToParentDirectory(pattern) {
3187 return pattern.startsWith("..") || pattern.startsWith("./..");
3188 }
3189 exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
3190 function getBaseDirectory(pattern) {
3191 return globParent(pattern, { flipBackslashes: false });
3192 }
3193 exports.getBaseDirectory = getBaseDirectory;
3194 function hasGlobStar(pattern) {
3195 return pattern.includes(GLOBSTAR);
3196 }
3197 exports.hasGlobStar = hasGlobStar;
3198 function endsWithSlashGlobStar(pattern) {
3199 return pattern.endsWith("/" + GLOBSTAR);
3200 }
3201 exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
3202 function isAffectDepthOfReadingPattern(pattern) {
3203 const basename = path13.basename(pattern);
3204 return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
3205 }
3206 exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
3207 function expandPatternsWithBraceExpansion(patterns) {
3208 return patterns.reduce((collection, pattern) => {
3209 return collection.concat(expandBraceExpansion(pattern));
3210 }, []);
3211 }
3212 exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
3213 function expandBraceExpansion(pattern) {
3214 const patterns = micromatch2.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
3215 patterns.sort((a, b) => a.length - b.length);
3216 return patterns.filter((pattern2) => pattern2 !== "");
3217 }
3218 exports.expandBraceExpansion = expandBraceExpansion;
3219 function getPatternParts(pattern, options8) {
3220 let { parts } = micromatch2.scan(pattern, Object.assign(Object.assign({}, options8), { parts: true }));
3221 if (parts.length === 0) {
3222 parts = [pattern];
3223 }
3224 if (parts[0].startsWith("/")) {
3225 parts[0] = parts[0].slice(1);
3226 parts.unshift("");
3227 }
3228 return parts;
3229 }
3230 exports.getPatternParts = getPatternParts;
3231 function makeRe(pattern, options8) {
3232 return micromatch2.makeRe(pattern, options8);
3233 }
3234 exports.makeRe = makeRe;
3235 function convertPatternsToRe(patterns, options8) {
3236 return patterns.map((pattern) => makeRe(pattern, options8));
3237 }
3238 exports.convertPatternsToRe = convertPatternsToRe;
3239 function matchAny(entry, patternsRe) {
3240 return patternsRe.some((patternRe) => patternRe.test(entry));
3241 }
3242 exports.matchAny = matchAny;
3243 function removeDuplicateSlashes(pattern) {
3244 return pattern.replace(DOUBLE_SLASH_RE, "/");
3245 }
3246 exports.removeDuplicateSlashes = removeDuplicateSlashes;
3247 }
3248});
3249
3250// node_modules/merge2/index.js
3251var require_merge2 = __commonJS({
3252 "node_modules/merge2/index.js"(exports, module) {
3253 "use strict";
3254 var Stream = __require("stream");
3255 var PassThrough = Stream.PassThrough;
3256 var slice = Array.prototype.slice;
3257 module.exports = merge2;
3258 function merge2() {
3259 const streamsQueue = [];
3260 const args = slice.call(arguments);
3261 let merging = false;
3262 let options8 = args[args.length - 1];
3263 if (options8 && !Array.isArray(options8) && options8.pipe == null) {
3264 args.pop();
3265 } else {
3266 options8 = {};
3267 }
3268 const doEnd = options8.end !== false;
3269 const doPipeError = options8.pipeError === true;
3270 if (options8.objectMode == null) {
3271 options8.objectMode = true;
3272 }
3273 if (options8.highWaterMark == null) {
3274 options8.highWaterMark = 64 * 1024;
3275 }
3276 const mergedStream = PassThrough(options8);
3277 function addStream() {
3278 for (let i = 0, len = arguments.length; i < len; i++) {
3279 streamsQueue.push(pauseStreams(arguments[i], options8));
3280 }
3281 mergeStream();
3282 return this;
3283 }
3284 function mergeStream() {
3285 if (merging) {
3286 return;
3287 }
3288 merging = true;
3289 let streams = streamsQueue.shift();
3290 if (!streams) {
3291 process.nextTick(endStream);
3292 return;
3293 }
3294 if (!Array.isArray(streams)) {
3295 streams = [streams];
3296 }
3297 let pipesCount = streams.length + 1;
3298 function next() {
3299 if (--pipesCount > 0) {
3300 return;
3301 }
3302 merging = false;
3303 mergeStream();
3304 }
3305 function pipe(stream) {
3306 function onend() {
3307 stream.removeListener("merge2UnpipeEnd", onend);
3308 stream.removeListener("end", onend);
3309 if (doPipeError) {
3310 stream.removeListener("error", onerror);
3311 }
3312 next();
3313 }
3314 function onerror(err) {
3315 mergedStream.emit("error", err);
3316 }
3317 if (stream._readableState.endEmitted) {
3318 return next();
3319 }
3320 stream.on("merge2UnpipeEnd", onend);
3321 stream.on("end", onend);
3322 if (doPipeError) {
3323 stream.on("error", onerror);
3324 }
3325 stream.pipe(mergedStream, { end: false });
3326 stream.resume();
3327 }
3328 for (let i = 0; i < streams.length; i++) {
3329 pipe(streams[i]);
3330 }
3331 next();
3332 }
3333 function endStream() {
3334 merging = false;
3335 mergedStream.emit("queueDrain");
3336 if (doEnd) {
3337 mergedStream.end();
3338 }
3339 }
3340 mergedStream.setMaxListeners(0);
3341 mergedStream.add = addStream;
3342 mergedStream.on("unpipe", function(stream) {
3343 stream.emit("merge2UnpipeEnd");
3344 });
3345 if (args.length) {
3346 addStream.apply(null, args);
3347 }
3348 return mergedStream;
3349 }
3350 function pauseStreams(streams, options8) {
3351 if (!Array.isArray(streams)) {
3352 if (!streams._readableState && streams.pipe) {
3353 streams = streams.pipe(PassThrough(options8));
3354 }
3355 if (!streams._readableState || !streams.pause || !streams.pipe) {
3356 throw new Error("Only readable stream can be merged.");
3357 }
3358 streams.pause();
3359 } else {
3360 for (let i = 0, len = streams.length; i < len; i++) {
3361 streams[i] = pauseStreams(streams[i], options8);
3362 }
3363 }
3364 return streams;
3365 }
3366 }
3367});
3368
3369// node_modules/fast-glob/out/utils/stream.js
3370var require_stream = __commonJS({
3371 "node_modules/fast-glob/out/utils/stream.js"(exports) {
3372 "use strict";
3373 Object.defineProperty(exports, "__esModule", { value: true });
3374 exports.merge = void 0;
3375 var merge2 = require_merge2();
3376 function merge3(streams) {
3377 const mergedStream = merge2(streams);
3378 streams.forEach((stream) => {
3379 stream.once("error", (error) => mergedStream.emit("error", error));
3380 });
3381 mergedStream.once("close", () => propagateCloseEventToSources(streams));
3382 mergedStream.once("end", () => propagateCloseEventToSources(streams));
3383 return mergedStream;
3384 }
3385 exports.merge = merge3;
3386 function propagateCloseEventToSources(streams) {
3387 streams.forEach((stream) => stream.emit("close"));
3388 }
3389 }
3390});
3391
3392// node_modules/fast-glob/out/utils/string.js
3393var require_string = __commonJS({
3394 "node_modules/fast-glob/out/utils/string.js"(exports) {
3395 "use strict";
3396 Object.defineProperty(exports, "__esModule", { value: true });
3397 exports.isEmpty = exports.isString = void 0;
3398 function isString(input) {
3399 return typeof input === "string";
3400 }
3401 exports.isString = isString;
3402 function isEmpty(input) {
3403 return input === "";
3404 }
3405 exports.isEmpty = isEmpty;
3406 }
3407});
3408
3409// node_modules/fast-glob/out/utils/index.js
3410var require_utils3 = __commonJS({
3411 "node_modules/fast-glob/out/utils/index.js"(exports) {
3412 "use strict";
3413 Object.defineProperty(exports, "__esModule", { value: true });
3414 exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0;
3415 var array2 = require_array();
3416 exports.array = array2;
3417 var errno = require_errno();
3418 exports.errno = errno;
3419 var fs7 = require_fs();
3420 exports.fs = fs7;
3421 var path13 = require_path();
3422 exports.path = path13;
3423 var pattern = require_pattern();
3424 exports.pattern = pattern;
3425 var stream = require_stream();
3426 exports.stream = stream;
3427 var string = require_string();
3428 exports.string = string;
3429 }
3430});
3431
3432// node_modules/fast-glob/out/managers/tasks.js
3433var require_tasks = __commonJS({
3434 "node_modules/fast-glob/out/managers/tasks.js"(exports) {
3435 "use strict";
3436 Object.defineProperty(exports, "__esModule", { value: true });
3437 exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
3438 var utils = require_utils3();
3439 function generate(input, settings) {
3440 const patterns = processPatterns(input, settings);
3441 const ignore = processPatterns(settings.ignore, settings);
3442 const positivePatterns = getPositivePatterns(patterns);
3443 const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
3444 const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
3445 const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
3446 const staticTasks = convertPatternsToTasks(
3447 staticPatterns,
3448 negativePatterns,
3449 /* dynamic */
3450 false
3451 );
3452 const dynamicTasks = convertPatternsToTasks(
3453 dynamicPatterns,
3454 negativePatterns,
3455 /* dynamic */
3456 true
3457 );
3458 return staticTasks.concat(dynamicTasks);
3459 }
3460 exports.generate = generate;
3461 function processPatterns(input, settings) {
3462 let patterns = input;
3463 if (settings.braceExpansion) {
3464 patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
3465 }
3466 if (settings.baseNameMatch) {
3467 patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
3468 }
3469 return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
3470 }
3471 function convertPatternsToTasks(positive, negative, dynamic) {
3472 const tasks = [];
3473 const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive);
3474 const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive);
3475 const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
3476 const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
3477 tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
3478 if ("." in insideCurrentDirectoryGroup) {
3479 tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic));
3480 } else {
3481 tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
3482 }
3483 return tasks;
3484 }
3485 exports.convertPatternsToTasks = convertPatternsToTasks;
3486 function getPositivePatterns(patterns) {
3487 return utils.pattern.getPositivePatterns(patterns);
3488 }
3489 exports.getPositivePatterns = getPositivePatterns;
3490 function getNegativePatternsAsPositive(patterns, ignore) {
3491 const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore);
3492 const positive = negative.map(utils.pattern.convertToPositivePattern);
3493 return positive;
3494 }
3495 exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
3496 function groupPatternsByBaseDirectory(patterns) {
3497 const group = {};
3498 return patterns.reduce((collection, pattern) => {
3499 const base = utils.pattern.getBaseDirectory(pattern);
3500 if (base in collection) {
3501 collection[base].push(pattern);
3502 } else {
3503 collection[base] = [pattern];
3504 }
3505 return collection;
3506 }, group);
3507 }
3508 exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
3509 function convertPatternGroupsToTasks(positive, negative, dynamic) {
3510 return Object.keys(positive).map((base) => {
3511 return convertPatternGroupToTask(base, positive[base], negative, dynamic);
3512 });
3513 }
3514 exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
3515 function convertPatternGroupToTask(base, positive, negative, dynamic) {
3516 return {
3517 dynamic,
3518 positive,
3519 negative,
3520 base,
3521 patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern))
3522 };
3523 }
3524 exports.convertPatternGroupToTask = convertPatternGroupToTask;
3525 }
3526});
3527
3528// node_modules/@nodelib/fs.stat/out/providers/async.js
3529var require_async = __commonJS({
3530 "node_modules/@nodelib/fs.stat/out/providers/async.js"(exports) {
3531 "use strict";
3532 Object.defineProperty(exports, "__esModule", { value: true });
3533 exports.read = void 0;
3534 function read3(path13, settings, callback) {
3535 settings.fs.lstat(path13, (lstatError, lstat) => {
3536 if (lstatError !== null) {
3537 callFailureCallback(callback, lstatError);
3538 return;
3539 }
3540 if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
3541 callSuccessCallback(callback, lstat);
3542 return;
3543 }
3544 settings.fs.stat(path13, (statError, stat) => {
3545 if (statError !== null) {
3546 if (settings.throwErrorOnBrokenSymbolicLink) {
3547 callFailureCallback(callback, statError);
3548 return;
3549 }
3550 callSuccessCallback(callback, lstat);
3551 return;
3552 }
3553 if (settings.markSymbolicLink) {
3554 stat.isSymbolicLink = () => true;
3555 }
3556 callSuccessCallback(callback, stat);
3557 });
3558 });
3559 }
3560 exports.read = read3;
3561 function callFailureCallback(callback, error) {
3562 callback(error);
3563 }
3564 function callSuccessCallback(callback, result) {
3565 callback(null, result);
3566 }
3567 }
3568});
3569
3570// node_modules/@nodelib/fs.stat/out/providers/sync.js
3571var require_sync = __commonJS({
3572 "node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports) {
3573 "use strict";
3574 Object.defineProperty(exports, "__esModule", { value: true });
3575 exports.read = void 0;
3576 function read3(path13, settings) {
3577 const lstat = settings.fs.lstatSync(path13);
3578 if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
3579 return lstat;
3580 }
3581 try {
3582 const stat = settings.fs.statSync(path13);
3583 if (settings.markSymbolicLink) {
3584 stat.isSymbolicLink = () => true;
3585 }
3586 return stat;
3587 } catch (error) {
3588 if (!settings.throwErrorOnBrokenSymbolicLink) {
3589 return lstat;
3590 }
3591 throw error;
3592 }
3593 }
3594 exports.read = read3;
3595 }
3596});
3597
3598// node_modules/@nodelib/fs.stat/out/adapters/fs.js
3599var require_fs2 = __commonJS({
3600 "node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports) {
3601 "use strict";
3602 Object.defineProperty(exports, "__esModule", { value: true });
3603 exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
3604 var fs7 = __require("fs");
3605 exports.FILE_SYSTEM_ADAPTER = {
3606 lstat: fs7.lstat,
3607 stat: fs7.stat,
3608 lstatSync: fs7.lstatSync,
3609 statSync: fs7.statSync
3610 };
3611 function createFileSystemAdapter(fsMethods) {
3612 if (fsMethods === void 0) {
3613 return exports.FILE_SYSTEM_ADAPTER;
3614 }
3615 return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
3616 }
3617 exports.createFileSystemAdapter = createFileSystemAdapter;
3618 }
3619});
3620
3621// node_modules/@nodelib/fs.stat/out/settings.js
3622var require_settings = __commonJS({
3623 "node_modules/@nodelib/fs.stat/out/settings.js"(exports) {
3624 "use strict";
3625 Object.defineProperty(exports, "__esModule", { value: true });
3626 var fs7 = require_fs2();
3627 var Settings = class {
3628 constructor(_options = {}) {
3629 this._options = _options;
3630 this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
3631 this.fs = fs7.createFileSystemAdapter(this._options.fs);
3632 this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
3633 this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
3634 }
3635 _getValue(option, value) {
3636 return option !== null && option !== void 0 ? option : value;
3637 }
3638 };
3639 exports.default = Settings;
3640 }
3641});
3642
3643// node_modules/@nodelib/fs.stat/out/index.js
3644var require_out = __commonJS({
3645 "node_modules/@nodelib/fs.stat/out/index.js"(exports) {
3646 "use strict";
3647 Object.defineProperty(exports, "__esModule", { value: true });
3648 exports.statSync = exports.stat = exports.Settings = void 0;
3649 var async = require_async();
3650 var sync = require_sync();
3651 var settings_1 = require_settings();
3652 exports.Settings = settings_1.default;
3653 function stat(path13, optionsOrSettingsOrCallback, callback) {
3654 if (typeof optionsOrSettingsOrCallback === "function") {
3655 async.read(path13, getSettings(), optionsOrSettingsOrCallback);
3656 return;
3657 }
3658 async.read(path13, getSettings(optionsOrSettingsOrCallback), callback);
3659 }
3660 exports.stat = stat;
3661 function statSync2(path13, optionsOrSettings) {
3662 const settings = getSettings(optionsOrSettings);
3663 return sync.read(path13, settings);
3664 }
3665 exports.statSync = statSync2;
3666 function getSettings(settingsOrOptions = {}) {
3667 if (settingsOrOptions instanceof settings_1.default) {
3668 return settingsOrOptions;
3669 }
3670 return new settings_1.default(settingsOrOptions);
3671 }
3672 }
3673});
3674
3675// node_modules/queue-microtask/index.js
3676var require_queue_microtask = __commonJS({
3677 "node_modules/queue-microtask/index.js"(exports, module) {
3678 var promise;
3679 module.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {
3680 throw err;
3681 }, 0));
3682 }
3683});
3684
3685// node_modules/run-parallel/index.js
3686var require_run_parallel = __commonJS({
3687 "node_modules/run-parallel/index.js"(exports, module) {
3688 module.exports = runParallel;
3689 var queueMicrotask2 = require_queue_microtask();
3690 function runParallel(tasks, cb) {
3691 let results, pending, keys;
3692 let isSync = true;
3693 if (Array.isArray(tasks)) {
3694 results = [];
3695 pending = tasks.length;
3696 } else {
3697 keys = Object.keys(tasks);
3698 results = {};
3699 pending = keys.length;
3700 }
3701 function done(err) {
3702 function end() {
3703 if (cb) cb(err, results);
3704 cb = null;
3705 }
3706 if (isSync) queueMicrotask2(end);
3707 else end();
3708 }
3709 function each(i, err, result) {
3710 results[i] = result;
3711 if (--pending === 0 || err) {
3712 done(err);
3713 }
3714 }
3715 if (!pending) {
3716 done(null);
3717 } else if (keys) {
3718 keys.forEach(function(key2) {
3719 tasks[key2](function(err, result) {
3720 each(key2, err, result);
3721 });
3722 });
3723 } else {
3724 tasks.forEach(function(task, i) {
3725 task(function(err, result) {
3726 each(i, err, result);
3727 });
3728 });
3729 }
3730 isSync = false;
3731 }
3732 }
3733});
3734
3735// node_modules/@nodelib/fs.scandir/out/constants.js
3736var require_constants3 = __commonJS({
3737 "node_modules/@nodelib/fs.scandir/out/constants.js"(exports) {
3738 "use strict";
3739 Object.defineProperty(exports, "__esModule", { value: true });
3740 exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
3741 var NODE_PROCESS_VERSION_PARTS = process.versions.node.split(".");
3742 if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) {
3743 throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);
3744 }
3745 var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
3746 var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
3747 var SUPPORTED_MAJOR_VERSION = 10;
3748 var SUPPORTED_MINOR_VERSION = 10;
3749 var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
3750 var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
3751 exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
3752 }
3753});
3754
3755// node_modules/@nodelib/fs.scandir/out/utils/fs.js
3756var require_fs3 = __commonJS({
3757 "node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports) {
3758 "use strict";
3759 Object.defineProperty(exports, "__esModule", { value: true });
3760 exports.createDirentFromStats = void 0;
3761 var DirentFromStats = class {
3762 constructor(name, stats) {
3763 this.name = name;
3764 this.isBlockDevice = stats.isBlockDevice.bind(stats);
3765 this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
3766 this.isDirectory = stats.isDirectory.bind(stats);
3767 this.isFIFO = stats.isFIFO.bind(stats);
3768 this.isFile = stats.isFile.bind(stats);
3769 this.isSocket = stats.isSocket.bind(stats);
3770 this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
3771 }
3772 };
3773 function createDirentFromStats(name, stats) {
3774 return new DirentFromStats(name, stats);
3775 }
3776 exports.createDirentFromStats = createDirentFromStats;
3777 }
3778});
3779
3780// node_modules/@nodelib/fs.scandir/out/utils/index.js
3781var require_utils4 = __commonJS({
3782 "node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports) {
3783 "use strict";
3784 Object.defineProperty(exports, "__esModule", { value: true });
3785 exports.fs = void 0;
3786 var fs7 = require_fs3();
3787 exports.fs = fs7;
3788 }
3789});
3790
3791// node_modules/@nodelib/fs.scandir/out/providers/common.js
3792var require_common = __commonJS({
3793 "node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports) {
3794 "use strict";
3795 Object.defineProperty(exports, "__esModule", { value: true });
3796 exports.joinPathSegments = void 0;
3797 function joinPathSegments(a, b, separator) {
3798 if (a.endsWith(separator)) {
3799 return a + b;
3800 }
3801 return a + separator + b;
3802 }
3803 exports.joinPathSegments = joinPathSegments;
3804 }
3805});
3806
3807// node_modules/@nodelib/fs.scandir/out/providers/async.js
3808var require_async2 = __commonJS({
3809 "node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports) {
3810 "use strict";
3811 Object.defineProperty(exports, "__esModule", { value: true });
3812 exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
3813 var fsStat = require_out();
3814 var rpl = require_run_parallel();
3815 var constants_1 = require_constants3();
3816 var utils = require_utils4();
3817 var common2 = require_common();
3818 function read3(directory, settings, callback) {
3819 if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
3820 readdirWithFileTypes(directory, settings, callback);
3821 return;
3822 }
3823 readdir(directory, settings, callback);
3824 }
3825 exports.read = read3;
3826 function readdirWithFileTypes(directory, settings, callback) {
3827 settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
3828 if (readdirError !== null) {
3829 callFailureCallback(callback, readdirError);
3830 return;
3831 }
3832 const entries = dirents.map((dirent) => ({
3833 dirent,
3834 name: dirent.name,
3835 path: common2.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
3836 }));
3837 if (!settings.followSymbolicLinks) {
3838 callSuccessCallback(callback, entries);
3839 return;
3840 }
3841 const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
3842 rpl(tasks, (rplError, rplEntries) => {
3843 if (rplError !== null) {
3844 callFailureCallback(callback, rplError);
3845 return;
3846 }
3847 callSuccessCallback(callback, rplEntries);
3848 });
3849 });
3850 }
3851 exports.readdirWithFileTypes = readdirWithFileTypes;
3852 function makeRplTaskEntry(entry, settings) {
3853 return (done) => {
3854 if (!entry.dirent.isSymbolicLink()) {
3855 done(null, entry);
3856 return;
3857 }
3858 settings.fs.stat(entry.path, (statError, stats) => {
3859 if (statError !== null) {
3860 if (settings.throwErrorOnBrokenSymbolicLink) {
3861 done(statError);
3862 return;
3863 }
3864 done(null, entry);
3865 return;
3866 }
3867 entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
3868 done(null, entry);
3869 });
3870 };
3871 }
3872 function readdir(directory, settings, callback) {
3873 settings.fs.readdir(directory, (readdirError, names) => {
3874 if (readdirError !== null) {
3875 callFailureCallback(callback, readdirError);
3876 return;
3877 }
3878 const tasks = names.map((name) => {
3879 const path13 = common2.joinPathSegments(directory, name, settings.pathSegmentSeparator);
3880 return (done) => {
3881 fsStat.stat(path13, settings.fsStatSettings, (error, stats) => {
3882 if (error !== null) {
3883 done(error);
3884 return;
3885 }
3886 const entry = {
3887 name,
3888 path: path13,
3889 dirent: utils.fs.createDirentFromStats(name, stats)
3890 };
3891 if (settings.stats) {
3892 entry.stats = stats;
3893 }
3894 done(null, entry);
3895 });
3896 };
3897 });
3898 rpl(tasks, (rplError, entries) => {
3899 if (rplError !== null) {
3900 callFailureCallback(callback, rplError);
3901 return;
3902 }
3903 callSuccessCallback(callback, entries);
3904 });
3905 });
3906 }
3907 exports.readdir = readdir;
3908 function callFailureCallback(callback, error) {
3909 callback(error);
3910 }
3911 function callSuccessCallback(callback, result) {
3912 callback(null, result);
3913 }
3914 }
3915});
3916
3917// node_modules/@nodelib/fs.scandir/out/providers/sync.js
3918var require_sync2 = __commonJS({
3919 "node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports) {
3920 "use strict";
3921 Object.defineProperty(exports, "__esModule", { value: true });
3922 exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
3923 var fsStat = require_out();
3924 var constants_1 = require_constants3();
3925 var utils = require_utils4();
3926 var common2 = require_common();
3927 function read3(directory, settings) {
3928 if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
3929 return readdirWithFileTypes(directory, settings);
3930 }
3931 return readdir(directory, settings);
3932 }
3933 exports.read = read3;
3934 function readdirWithFileTypes(directory, settings) {
3935 const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });
3936 return dirents.map((dirent) => {
3937 const entry = {
3938 dirent,
3939 name: dirent.name,
3940 path: common2.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
3941 };
3942 if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
3943 try {
3944 const stats = settings.fs.statSync(entry.path);
3945 entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
3946 } catch (error) {
3947 if (settings.throwErrorOnBrokenSymbolicLink) {
3948 throw error;
3949 }
3950 }
3951 }
3952 return entry;
3953 });
3954 }
3955 exports.readdirWithFileTypes = readdirWithFileTypes;
3956 function readdir(directory, settings) {
3957 const names = settings.fs.readdirSync(directory);
3958 return names.map((name) => {
3959 const entryPath = common2.joinPathSegments(directory, name, settings.pathSegmentSeparator);
3960 const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
3961 const entry = {
3962 name,
3963 path: entryPath,
3964 dirent: utils.fs.createDirentFromStats(name, stats)
3965 };
3966 if (settings.stats) {
3967 entry.stats = stats;
3968 }
3969 return entry;
3970 });
3971 }
3972 exports.readdir = readdir;
3973 }
3974});
3975
3976// node_modules/@nodelib/fs.scandir/out/adapters/fs.js
3977var require_fs4 = __commonJS({
3978 "node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports) {
3979 "use strict";
3980 Object.defineProperty(exports, "__esModule", { value: true });
3981 exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
3982 var fs7 = __require("fs");
3983 exports.FILE_SYSTEM_ADAPTER = {
3984 lstat: fs7.lstat,
3985 stat: fs7.stat,
3986 lstatSync: fs7.lstatSync,
3987 statSync: fs7.statSync,
3988 readdir: fs7.readdir,
3989 readdirSync: fs7.readdirSync
3990 };
3991 function createFileSystemAdapter(fsMethods) {
3992 if (fsMethods === void 0) {
3993 return exports.FILE_SYSTEM_ADAPTER;
3994 }
3995 return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
3996 }
3997 exports.createFileSystemAdapter = createFileSystemAdapter;
3998 }
3999});
4000
4001// node_modules/@nodelib/fs.scandir/out/settings.js
4002var require_settings2 = __commonJS({
4003 "node_modules/@nodelib/fs.scandir/out/settings.js"(exports) {
4004 "use strict";
4005 Object.defineProperty(exports, "__esModule", { value: true });
4006 var path13 = __require("path");
4007 var fsStat = require_out();
4008 var fs7 = require_fs4();
4009 var Settings = class {
4010 constructor(_options = {}) {
4011 this._options = _options;
4012 this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
4013 this.fs = fs7.createFileSystemAdapter(this._options.fs);
4014 this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path13.sep);
4015 this.stats = this._getValue(this._options.stats, false);
4016 this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
4017 this.fsStatSettings = new fsStat.Settings({
4018 followSymbolicLink: this.followSymbolicLinks,
4019 fs: this.fs,
4020 throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
4021 });
4022 }
4023 _getValue(option, value) {
4024 return option !== null && option !== void 0 ? option : value;
4025 }
4026 };
4027 exports.default = Settings;
4028 }
4029});
4030
4031// node_modules/@nodelib/fs.scandir/out/index.js
4032var require_out2 = __commonJS({
4033 "node_modules/@nodelib/fs.scandir/out/index.js"(exports) {
4034 "use strict";
4035 Object.defineProperty(exports, "__esModule", { value: true });
4036 exports.Settings = exports.scandirSync = exports.scandir = void 0;
4037 var async = require_async2();
4038 var sync = require_sync2();
4039 var settings_1 = require_settings2();
4040 exports.Settings = settings_1.default;
4041 function scandir(path13, optionsOrSettingsOrCallback, callback) {
4042 if (typeof optionsOrSettingsOrCallback === "function") {
4043 async.read(path13, getSettings(), optionsOrSettingsOrCallback);
4044 return;
4045 }
4046 async.read(path13, getSettings(optionsOrSettingsOrCallback), callback);
4047 }
4048 exports.scandir = scandir;
4049 function scandirSync(path13, optionsOrSettings) {
4050 const settings = getSettings(optionsOrSettings);
4051 return sync.read(path13, settings);
4052 }
4053 exports.scandirSync = scandirSync;
4054 function getSettings(settingsOrOptions = {}) {
4055 if (settingsOrOptions instanceof settings_1.default) {
4056 return settingsOrOptions;
4057 }
4058 return new settings_1.default(settingsOrOptions);
4059 }
4060 }
4061});
4062
4063// node_modules/reusify/reusify.js
4064var require_reusify = __commonJS({
4065 "node_modules/reusify/reusify.js"(exports, module) {
4066 "use strict";
4067 function reusify(Constructor) {
4068 var head = new Constructor();
4069 var tail = head;
4070 function get() {
4071 var current = head;
4072 if (current.next) {
4073 head = current.next;
4074 } else {
4075 head = new Constructor();
4076 tail = head;
4077 }
4078 current.next = null;
4079 return current;
4080 }
4081 function release(obj) {
4082 tail.next = obj;
4083 tail = obj;
4084 }
4085 return {
4086 get,
4087 release
4088 };
4089 }
4090 module.exports = reusify;
4091 }
4092});
4093
4094// node_modules/fastq/queue.js
4095var require_queue = __commonJS({
4096 "node_modules/fastq/queue.js"(exports, module) {
4097 "use strict";
4098 var reusify = require_reusify();
4099 function fastqueue(context, worker, _concurrency) {
4100 if (typeof context === "function") {
4101 _concurrency = worker;
4102 worker = context;
4103 context = null;
4104 }
4105 if (!(_concurrency >= 1)) {
4106 throw new Error("fastqueue concurrency must be equal to or greater than 1");
4107 }
4108 var cache3 = reusify(Task);
4109 var queueHead = null;
4110 var queueTail = null;
4111 var _running = 0;
4112 var errorHandler = null;
4113 var self = {
4114 push: push2,
4115 drain: noop2,
4116 saturated: noop2,
4117 pause,
4118 paused: false,
4119 get concurrency() {
4120 return _concurrency;
4121 },
4122 set concurrency(value) {
4123 if (!(value >= 1)) {
4124 throw new Error("fastqueue concurrency must be equal to or greater than 1");
4125 }
4126 _concurrency = value;
4127 if (self.paused) return;
4128 for (; queueHead && _running < _concurrency; ) {
4129 _running++;
4130 release();
4131 }
4132 },
4133 running,
4134 resume,
4135 idle,
4136 length,
4137 getQueue,
4138 unshift,
4139 empty: noop2,
4140 kill,
4141 killAndDrain,
4142 error
4143 };
4144 return self;
4145 function running() {
4146 return _running;
4147 }
4148 function pause() {
4149 self.paused = true;
4150 }
4151 function length() {
4152 var current = queueHead;
4153 var counter = 0;
4154 while (current) {
4155 current = current.next;
4156 counter++;
4157 }
4158 return counter;
4159 }
4160 function getQueue() {
4161 var current = queueHead;
4162 var tasks = [];
4163 while (current) {
4164 tasks.push(current.value);
4165 current = current.next;
4166 }
4167 return tasks;
4168 }
4169 function resume() {
4170 if (!self.paused) return;
4171 self.paused = false;
4172 if (queueHead === null) {
4173 _running++;
4174 release();
4175 return;
4176 }
4177 for (; queueHead && _running < _concurrency; ) {
4178 _running++;
4179 release();
4180 }
4181 }
4182 function idle() {
4183 return _running === 0 && self.length() === 0;
4184 }
4185 function push2(value, done) {
4186 var current = cache3.get();
4187 current.context = context;
4188 current.release = release;
4189 current.value = value;
4190 current.callback = done || noop2;
4191 current.errorHandler = errorHandler;
4192 if (_running >= _concurrency || self.paused) {
4193 if (queueTail) {
4194 queueTail.next = current;
4195 queueTail = current;
4196 } else {
4197 queueHead = current;
4198 queueTail = current;
4199 self.saturated();
4200 }
4201 } else {
4202 _running++;
4203 worker.call(context, current.value, current.worked);
4204 }
4205 }
4206 function unshift(value, done) {
4207 var current = cache3.get();
4208 current.context = context;
4209 current.release = release;
4210 current.value = value;
4211 current.callback = done || noop2;
4212 current.errorHandler = errorHandler;
4213 if (_running >= _concurrency || self.paused) {
4214 if (queueHead) {
4215 current.next = queueHead;
4216 queueHead = current;
4217 } else {
4218 queueHead = current;
4219 queueTail = current;
4220 self.saturated();
4221 }
4222 } else {
4223 _running++;
4224 worker.call(context, current.value, current.worked);
4225 }
4226 }
4227 function release(holder) {
4228 if (holder) {
4229 cache3.release(holder);
4230 }
4231 var next = queueHead;
4232 if (next && _running <= _concurrency) {
4233 if (!self.paused) {
4234 if (queueTail === queueHead) {
4235 queueTail = null;
4236 }
4237 queueHead = next.next;
4238 next.next = null;
4239 worker.call(context, next.value, next.worked);
4240 if (queueTail === null) {
4241 self.empty();
4242 }
4243 } else {
4244 _running--;
4245 }
4246 } else if (--_running === 0) {
4247 self.drain();
4248 }
4249 }
4250 function kill() {
4251 queueHead = null;
4252 queueTail = null;
4253 self.drain = noop2;
4254 }
4255 function killAndDrain() {
4256 queueHead = null;
4257 queueTail = null;
4258 self.drain();
4259 self.drain = noop2;
4260 }
4261 function error(handler) {
4262 errorHandler = handler;
4263 }
4264 }
4265 function noop2() {
4266 }
4267 function Task() {
4268 this.value = null;
4269 this.callback = noop2;
4270 this.next = null;
4271 this.release = noop2;
4272 this.context = null;
4273 this.errorHandler = null;
4274 var self = this;
4275 this.worked = function worked(err, result) {
4276 var callback = self.callback;
4277 var errorHandler = self.errorHandler;
4278 var val = self.value;
4279 self.value = null;
4280 self.callback = noop2;
4281 if (self.errorHandler) {
4282 errorHandler(err, val);
4283 }
4284 callback.call(self.context, err, result);
4285 self.release(self);
4286 };
4287 }
4288 function queueAsPromised(context, worker, _concurrency) {
4289 if (typeof context === "function") {
4290 _concurrency = worker;
4291 worker = context;
4292 context = null;
4293 }
4294 function asyncWrapper(arg, cb) {
4295 worker.call(this, arg).then(function(res) {
4296 cb(null, res);
4297 }, cb);
4298 }
4299 var queue = fastqueue(context, asyncWrapper, _concurrency);
4300 var pushCb = queue.push;
4301 var unshiftCb = queue.unshift;
4302 queue.push = push2;
4303 queue.unshift = unshift;
4304 queue.drained = drained;
4305 return queue;
4306 function push2(value) {
4307 var p = new Promise(function(resolve3, reject) {
4308 pushCb(value, function(err, result) {
4309 if (err) {
4310 reject(err);
4311 return;
4312 }
4313 resolve3(result);
4314 });
4315 });
4316 p.catch(noop2);
4317 return p;
4318 }
4319 function unshift(value) {
4320 var p = new Promise(function(resolve3, reject) {
4321 unshiftCb(value, function(err, result) {
4322 if (err) {
4323 reject(err);
4324 return;
4325 }
4326 resolve3(result);
4327 });
4328 });
4329 p.catch(noop2);
4330 return p;
4331 }
4332 function drained() {
4333 if (queue.idle()) {
4334 return new Promise(function(resolve3) {
4335 resolve3();
4336 });
4337 }
4338 var previousDrain = queue.drain;
4339 var p = new Promise(function(resolve3) {
4340 queue.drain = function() {
4341 previousDrain();
4342 resolve3();
4343 };
4344 });
4345 return p;
4346 }
4347 }
4348 module.exports = fastqueue;
4349 module.exports.promise = queueAsPromised;
4350 }
4351});
4352
4353// node_modules/@nodelib/fs.walk/out/readers/common.js
4354var require_common2 = __commonJS({
4355 "node_modules/@nodelib/fs.walk/out/readers/common.js"(exports) {
4356 "use strict";
4357 Object.defineProperty(exports, "__esModule", { value: true });
4358 exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
4359 function isFatalError(settings, error) {
4360 if (settings.errorFilter === null) {
4361 return true;
4362 }
4363 return !settings.errorFilter(error);
4364 }
4365 exports.isFatalError = isFatalError;
4366 function isAppliedFilter(filter2, value) {
4367 return filter2 === null || filter2(value);
4368 }
4369 exports.isAppliedFilter = isAppliedFilter;
4370 function replacePathSegmentSeparator(filepath, separator) {
4371 return filepath.split(/[/\\]/).join(separator);
4372 }
4373 exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
4374 function joinPathSegments(a, b, separator) {
4375 if (a === "") {
4376 return b;
4377 }
4378 if (a.endsWith(separator)) {
4379 return a + b;
4380 }
4381 return a + separator + b;
4382 }
4383 exports.joinPathSegments = joinPathSegments;
4384 }
4385});
4386
4387// node_modules/@nodelib/fs.walk/out/readers/reader.js
4388var require_reader = __commonJS({
4389 "node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports) {
4390 "use strict";
4391 Object.defineProperty(exports, "__esModule", { value: true });
4392 var common2 = require_common2();
4393 var Reader = class {
4394 constructor(_root, _settings) {
4395 this._root = _root;
4396 this._settings = _settings;
4397 this._root = common2.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
4398 }
4399 };
4400 exports.default = Reader;
4401 }
4402});
4403
4404// node_modules/@nodelib/fs.walk/out/readers/async.js
4405var require_async3 = __commonJS({
4406 "node_modules/@nodelib/fs.walk/out/readers/async.js"(exports) {
4407 "use strict";
4408 Object.defineProperty(exports, "__esModule", { value: true });
4409 var events_1 = __require("events");
4410 var fsScandir = require_out2();
4411 var fastq = require_queue();
4412 var common2 = require_common2();
4413 var reader_1 = require_reader();
4414 var AsyncReader = class extends reader_1.default {
4415 constructor(_root, _settings) {
4416 super(_root, _settings);
4417 this._settings = _settings;
4418 this._scandir = fsScandir.scandir;
4419 this._emitter = new events_1.EventEmitter();
4420 this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
4421 this._isFatalError = false;
4422 this._isDestroyed = false;
4423 this._queue.drain = () => {
4424 if (!this._isFatalError) {
4425 this._emitter.emit("end");
4426 }
4427 };
4428 }
4429 read() {
4430 this._isFatalError = false;
4431 this._isDestroyed = false;
4432 setImmediate(() => {
4433 this._pushToQueue(this._root, this._settings.basePath);
4434 });
4435 return this._emitter;
4436 }
4437 get isDestroyed() {
4438 return this._isDestroyed;
4439 }
4440 destroy() {
4441 if (this._isDestroyed) {
4442 throw new Error("The reader is already destroyed");
4443 }
4444 this._isDestroyed = true;
4445 this._queue.killAndDrain();
4446 }
4447 onEntry(callback) {
4448 this._emitter.on("entry", callback);
4449 }
4450 onError(callback) {
4451 this._emitter.once("error", callback);
4452 }
4453 onEnd(callback) {
4454 this._emitter.once("end", callback);
4455 }
4456 _pushToQueue(directory, base) {
4457 const queueItem = { directory, base };
4458 this._queue.push(queueItem, (error) => {
4459 if (error !== null) {
4460 this._handleError(error);
4461 }
4462 });
4463 }
4464 _worker(item, done) {
4465 this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
4466 if (error !== null) {
4467 done(error, void 0);
4468 return;
4469 }
4470 for (const entry of entries) {
4471 this._handleEntry(entry, item.base);
4472 }
4473 done(null, void 0);
4474 });
4475 }
4476 _handleError(error) {
4477 if (this._isDestroyed || !common2.isFatalError(this._settings, error)) {
4478 return;
4479 }
4480 this._isFatalError = true;
4481 this._isDestroyed = true;
4482 this._emitter.emit("error", error);
4483 }
4484 _handleEntry(entry, base) {
4485 if (this._isDestroyed || this._isFatalError) {
4486 return;
4487 }
4488 const fullpath = entry.path;
4489 if (base !== void 0) {
4490 entry.path = common2.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
4491 }
4492 if (common2.isAppliedFilter(this._settings.entryFilter, entry)) {
4493 this._emitEntry(entry);
4494 }
4495 if (entry.dirent.isDirectory() && common2.isAppliedFilter(this._settings.deepFilter, entry)) {
4496 this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
4497 }
4498 }
4499 _emitEntry(entry) {
4500 this._emitter.emit("entry", entry);
4501 }
4502 };
4503 exports.default = AsyncReader;
4504 }
4505});
4506
4507// node_modules/@nodelib/fs.walk/out/providers/async.js
4508var require_async4 = __commonJS({
4509 "node_modules/@nodelib/fs.walk/out/providers/async.js"(exports) {
4510 "use strict";
4511 Object.defineProperty(exports, "__esModule", { value: true });
4512 var async_1 = require_async3();
4513 var AsyncProvider = class {
4514 constructor(_root, _settings) {
4515 this._root = _root;
4516 this._settings = _settings;
4517 this._reader = new async_1.default(this._root, this._settings);
4518 this._storage = [];
4519 }
4520 read(callback) {
4521 this._reader.onError((error) => {
4522 callFailureCallback(callback, error);
4523 });
4524 this._reader.onEntry((entry) => {
4525 this._storage.push(entry);
4526 });
4527 this._reader.onEnd(() => {
4528 callSuccessCallback(callback, this._storage);
4529 });
4530 this._reader.read();
4531 }
4532 };
4533 exports.default = AsyncProvider;
4534 function callFailureCallback(callback, error) {
4535 callback(error);
4536 }
4537 function callSuccessCallback(callback, entries) {
4538 callback(null, entries);
4539 }
4540 }
4541});
4542
4543// node_modules/@nodelib/fs.walk/out/providers/stream.js
4544var require_stream2 = __commonJS({
4545 "node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports) {
4546 "use strict";
4547 Object.defineProperty(exports, "__esModule", { value: true });
4548 var stream_1 = __require("stream");
4549 var async_1 = require_async3();
4550 var StreamProvider = class {
4551 constructor(_root, _settings) {
4552 this._root = _root;
4553 this._settings = _settings;
4554 this._reader = new async_1.default(this._root, this._settings);
4555 this._stream = new stream_1.Readable({
4556 objectMode: true,
4557 read: () => {
4558 },
4559 destroy: () => {
4560 if (!this._reader.isDestroyed) {
4561 this._reader.destroy();
4562 }
4563 }
4564 });
4565 }
4566 read() {
4567 this._reader.onError((error) => {
4568 this._stream.emit("error", error);
4569 });
4570 this._reader.onEntry((entry) => {
4571 this._stream.push(entry);
4572 });
4573 this._reader.onEnd(() => {
4574 this._stream.push(null);
4575 });
4576 this._reader.read();
4577 return this._stream;
4578 }
4579 };
4580 exports.default = StreamProvider;
4581 }
4582});
4583
4584// node_modules/@nodelib/fs.walk/out/readers/sync.js
4585var require_sync3 = __commonJS({
4586 "node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports) {
4587 "use strict";
4588 Object.defineProperty(exports, "__esModule", { value: true });
4589 var fsScandir = require_out2();
4590 var common2 = require_common2();
4591 var reader_1 = require_reader();
4592 var SyncReader = class extends reader_1.default {
4593 constructor() {
4594 super(...arguments);
4595 this._scandir = fsScandir.scandirSync;
4596 this._storage = [];
4597 this._queue = /* @__PURE__ */ new Set();
4598 }
4599 read() {
4600 this._pushToQueue(this._root, this._settings.basePath);
4601 this._handleQueue();
4602 return this._storage;
4603 }
4604 _pushToQueue(directory, base) {
4605 this._queue.add({ directory, base });
4606 }
4607 _handleQueue() {
4608 for (const item of this._queue.values()) {
4609 this._handleDirectory(item.directory, item.base);
4610 }
4611 }
4612 _handleDirectory(directory, base) {
4613 try {
4614 const entries = this._scandir(directory, this._settings.fsScandirSettings);
4615 for (const entry of entries) {
4616 this._handleEntry(entry, base);
4617 }
4618 } catch (error) {
4619 this._handleError(error);
4620 }
4621 }
4622 _handleError(error) {
4623 if (!common2.isFatalError(this._settings, error)) {
4624 return;
4625 }
4626 throw error;
4627 }
4628 _handleEntry(entry, base) {
4629 const fullpath = entry.path;
4630 if (base !== void 0) {
4631 entry.path = common2.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
4632 }
4633 if (common2.isAppliedFilter(this._settings.entryFilter, entry)) {
4634 this._pushToStorage(entry);
4635 }
4636 if (entry.dirent.isDirectory() && common2.isAppliedFilter(this._settings.deepFilter, entry)) {
4637 this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
4638 }
4639 }
4640 _pushToStorage(entry) {
4641 this._storage.push(entry);
4642 }
4643 };
4644 exports.default = SyncReader;
4645 }
4646});
4647
4648// node_modules/@nodelib/fs.walk/out/providers/sync.js
4649var require_sync4 = __commonJS({
4650 "node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports) {
4651 "use strict";
4652 Object.defineProperty(exports, "__esModule", { value: true });
4653 var sync_1 = require_sync3();
4654 var SyncProvider = class {
4655 constructor(_root, _settings) {
4656 this._root = _root;
4657 this._settings = _settings;
4658 this._reader = new sync_1.default(this._root, this._settings);
4659 }
4660 read() {
4661 return this._reader.read();
4662 }
4663 };
4664 exports.default = SyncProvider;
4665 }
4666});
4667
4668// node_modules/@nodelib/fs.walk/out/settings.js
4669var require_settings3 = __commonJS({
4670 "node_modules/@nodelib/fs.walk/out/settings.js"(exports) {
4671 "use strict";
4672 Object.defineProperty(exports, "__esModule", { value: true });
4673 var path13 = __require("path");
4674 var fsScandir = require_out2();
4675 var Settings = class {
4676 constructor(_options = {}) {
4677 this._options = _options;
4678 this.basePath = this._getValue(this._options.basePath, void 0);
4679 this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
4680 this.deepFilter = this._getValue(this._options.deepFilter, null);
4681 this.entryFilter = this._getValue(this._options.entryFilter, null);
4682 this.errorFilter = this._getValue(this._options.errorFilter, null);
4683 this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path13.sep);
4684 this.fsScandirSettings = new fsScandir.Settings({
4685 followSymbolicLinks: this._options.followSymbolicLinks,
4686 fs: this._options.fs,
4687 pathSegmentSeparator: this._options.pathSegmentSeparator,
4688 stats: this._options.stats,
4689 throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
4690 });
4691 }
4692 _getValue(option, value) {
4693 return option !== null && option !== void 0 ? option : value;
4694 }
4695 };
4696 exports.default = Settings;
4697 }
4698});
4699
4700// node_modules/@nodelib/fs.walk/out/index.js
4701var require_out3 = __commonJS({
4702 "node_modules/@nodelib/fs.walk/out/index.js"(exports) {
4703 "use strict";
4704 Object.defineProperty(exports, "__esModule", { value: true });
4705 exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0;
4706 var async_1 = require_async4();
4707 var stream_1 = require_stream2();
4708 var sync_1 = require_sync4();
4709 var settings_1 = require_settings3();
4710 exports.Settings = settings_1.default;
4711 function walk(directory, optionsOrSettingsOrCallback, callback) {
4712 if (typeof optionsOrSettingsOrCallback === "function") {
4713 new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
4714 return;
4715 }
4716 new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
4717 }
4718 exports.walk = walk;
4719 function walkSync(directory, optionsOrSettings) {
4720 const settings = getSettings(optionsOrSettings);
4721 const provider = new sync_1.default(directory, settings);
4722 return provider.read();
4723 }
4724 exports.walkSync = walkSync;
4725 function walkStream(directory, optionsOrSettings) {
4726 const settings = getSettings(optionsOrSettings);
4727 const provider = new stream_1.default(directory, settings);
4728 return provider.read();
4729 }
4730 exports.walkStream = walkStream;
4731 function getSettings(settingsOrOptions = {}) {
4732 if (settingsOrOptions instanceof settings_1.default) {
4733 return settingsOrOptions;
4734 }
4735 return new settings_1.default(settingsOrOptions);
4736 }
4737 }
4738});
4739
4740// node_modules/fast-glob/out/readers/reader.js
4741var require_reader2 = __commonJS({
4742 "node_modules/fast-glob/out/readers/reader.js"(exports) {
4743 "use strict";
4744 Object.defineProperty(exports, "__esModule", { value: true });
4745 var path13 = __require("path");
4746 var fsStat = require_out();
4747 var utils = require_utils3();
4748 var Reader = class {
4749 constructor(_settings) {
4750 this._settings = _settings;
4751 this._fsStatSettings = new fsStat.Settings({
4752 followSymbolicLink: this._settings.followSymbolicLinks,
4753 fs: this._settings.fs,
4754 throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
4755 });
4756 }
4757 _getFullEntryPath(filepath) {
4758 return path13.resolve(this._settings.cwd, filepath);
4759 }
4760 _makeEntry(stats, pattern) {
4761 const entry = {
4762 name: pattern,
4763 path: pattern,
4764 dirent: utils.fs.createDirentFromStats(pattern, stats)
4765 };
4766 if (this._settings.stats) {
4767 entry.stats = stats;
4768 }
4769 return entry;
4770 }
4771 _isFatalError(error) {
4772 return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
4773 }
4774 };
4775 exports.default = Reader;
4776 }
4777});
4778
4779// node_modules/fast-glob/out/readers/stream.js
4780var require_stream3 = __commonJS({
4781 "node_modules/fast-glob/out/readers/stream.js"(exports) {
4782 "use strict";
4783 Object.defineProperty(exports, "__esModule", { value: true });
4784 var stream_1 = __require("stream");
4785 var fsStat = require_out();
4786 var fsWalk = require_out3();
4787 var reader_1 = require_reader2();
4788 var ReaderStream = class extends reader_1.default {
4789 constructor() {
4790 super(...arguments);
4791 this._walkStream = fsWalk.walkStream;
4792 this._stat = fsStat.stat;
4793 }
4794 dynamic(root2, options8) {
4795 return this._walkStream(root2, options8);
4796 }
4797 static(patterns, options8) {
4798 const filepaths = patterns.map(this._getFullEntryPath, this);
4799 const stream = new stream_1.PassThrough({ objectMode: true });
4800 stream._write = (index, _enc, done) => {
4801 return this._getEntry(filepaths[index], patterns[index], options8).then((entry) => {
4802 if (entry !== null && options8.entryFilter(entry)) {
4803 stream.push(entry);
4804 }
4805 if (index === filepaths.length - 1) {
4806 stream.end();
4807 }
4808 done();
4809 }).catch(done);
4810 };
4811 for (let i = 0; i < filepaths.length; i++) {
4812 stream.write(i);
4813 }
4814 return stream;
4815 }
4816 _getEntry(filepath, pattern, options8) {
4817 return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error) => {
4818 if (options8.errorFilter(error)) {
4819 return null;
4820 }
4821 throw error;
4822 });
4823 }
4824 _getStat(filepath) {
4825 return new Promise((resolve3, reject) => {
4826 this._stat(filepath, this._fsStatSettings, (error, stats) => {
4827 return error === null ? resolve3(stats) : reject(error);
4828 });
4829 });
4830 }
4831 };
4832 exports.default = ReaderStream;
4833 }
4834});
4835
4836// node_modules/fast-glob/out/readers/async.js
4837var require_async5 = __commonJS({
4838 "node_modules/fast-glob/out/readers/async.js"(exports) {
4839 "use strict";
4840 Object.defineProperty(exports, "__esModule", { value: true });
4841 var fsWalk = require_out3();
4842 var reader_1 = require_reader2();
4843 var stream_1 = require_stream3();
4844 var ReaderAsync = class extends reader_1.default {
4845 constructor() {
4846 super(...arguments);
4847 this._walkAsync = fsWalk.walk;
4848 this._readerStream = new stream_1.default(this._settings);
4849 }
4850 dynamic(root2, options8) {
4851 return new Promise((resolve3, reject) => {
4852 this._walkAsync(root2, options8, (error, entries) => {
4853 if (error === null) {
4854 resolve3(entries);
4855 } else {
4856 reject(error);
4857 }
4858 });
4859 });
4860 }
4861 async static(patterns, options8) {
4862 const entries = [];
4863 const stream = this._readerStream.static(patterns, options8);
4864 return new Promise((resolve3, reject) => {
4865 stream.once("error", reject);
4866 stream.on("data", (entry) => entries.push(entry));
4867 stream.once("end", () => resolve3(entries));
4868 });
4869 }
4870 };
4871 exports.default = ReaderAsync;
4872 }
4873});
4874
4875// node_modules/fast-glob/out/providers/matchers/matcher.js
4876var require_matcher = __commonJS({
4877 "node_modules/fast-glob/out/providers/matchers/matcher.js"(exports) {
4878 "use strict";
4879 Object.defineProperty(exports, "__esModule", { value: true });
4880 var utils = require_utils3();
4881 var Matcher = class {
4882 constructor(_patterns, _settings, _micromatchOptions) {
4883 this._patterns = _patterns;
4884 this._settings = _settings;
4885 this._micromatchOptions = _micromatchOptions;
4886 this._storage = [];
4887 this._fillStorage();
4888 }
4889 _fillStorage() {
4890 for (const pattern of this._patterns) {
4891 const segments = this._getPatternSegments(pattern);
4892 const sections = this._splitSegmentsIntoSections(segments);
4893 this._storage.push({
4894 complete: sections.length <= 1,
4895 pattern,
4896 segments,
4897 sections
4898 });
4899 }
4900 }
4901 _getPatternSegments(pattern) {
4902 const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions);
4903 return parts.map((part) => {
4904 const dynamic = utils.pattern.isDynamicPattern(part, this._settings);
4905 if (!dynamic) {
4906 return {
4907 dynamic: false,
4908 pattern: part
4909 };
4910 }
4911 return {
4912 dynamic: true,
4913 pattern: part,
4914 patternRe: utils.pattern.makeRe(part, this._micromatchOptions)
4915 };
4916 });
4917 }
4918 _splitSegmentsIntoSections(segments) {
4919 return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern));
4920 }
4921 };
4922 exports.default = Matcher;
4923 }
4924});
4925
4926// node_modules/fast-glob/out/providers/matchers/partial.js
4927var require_partial = __commonJS({
4928 "node_modules/fast-glob/out/providers/matchers/partial.js"(exports) {
4929 "use strict";
4930 Object.defineProperty(exports, "__esModule", { value: true });
4931 var matcher_1 = require_matcher();
4932 var PartialMatcher = class extends matcher_1.default {
4933 match(filepath) {
4934 const parts = filepath.split("/");
4935 const levels = parts.length;
4936 const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
4937 for (const pattern of patterns) {
4938 const section = pattern.sections[0];
4939 if (!pattern.complete && levels > section.length) {
4940 return true;
4941 }
4942 const match = parts.every((part, index) => {
4943 const segment = pattern.segments[index];
4944 if (segment.dynamic && segment.patternRe.test(part)) {
4945 return true;
4946 }
4947 if (!segment.dynamic && segment.pattern === part) {
4948 return true;
4949 }
4950 return false;
4951 });
4952 if (match) {
4953 return true;
4954 }
4955 }
4956 return false;
4957 }
4958 };
4959 exports.default = PartialMatcher;
4960 }
4961});
4962
4963// node_modules/fast-glob/out/providers/filters/deep.js
4964var require_deep = __commonJS({
4965 "node_modules/fast-glob/out/providers/filters/deep.js"(exports) {
4966 "use strict";
4967 Object.defineProperty(exports, "__esModule", { value: true });
4968 var utils = require_utils3();
4969 var partial_1 = require_partial();
4970 var DeepFilter = class {
4971 constructor(_settings, _micromatchOptions) {
4972 this._settings = _settings;
4973 this._micromatchOptions = _micromatchOptions;
4974 }
4975 getFilter(basePath, positive, negative) {
4976 const matcher = this._getMatcher(positive);
4977 const negativeRe = this._getNegativePatternsRe(negative);
4978 return (entry) => this._filter(basePath, entry, matcher, negativeRe);
4979 }
4980 _getMatcher(patterns) {
4981 return new partial_1.default(patterns, this._settings, this._micromatchOptions);
4982 }
4983 _getNegativePatternsRe(patterns) {
4984 const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
4985 return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
4986 }
4987 _filter(basePath, entry, matcher, negativeRe) {
4988 if (this._isSkippedByDeep(basePath, entry.path)) {
4989 return false;
4990 }
4991 if (this._isSkippedSymbolicLink(entry)) {
4992 return false;
4993 }
4994 const filepath = utils.path.removeLeadingDotSegment(entry.path);
4995 if (this._isSkippedByPositivePatterns(filepath, matcher)) {
4996 return false;
4997 }
4998 return this._isSkippedByNegativePatterns(filepath, negativeRe);
4999 }
5000 _isSkippedByDeep(basePath, entryPath) {
5001 if (this._settings.deep === Infinity) {
5002 return false;
5003 }
5004 return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
5005 }
5006 _getEntryLevel(basePath, entryPath) {
5007 const entryPathDepth = entryPath.split("/").length;
5008 if (basePath === "") {
5009 return entryPathDepth;
5010 }
5011 const basePathDepth = basePath.split("/").length;
5012 return entryPathDepth - basePathDepth;
5013 }
5014 _isSkippedSymbolicLink(entry) {
5015 return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
5016 }
5017 _isSkippedByPositivePatterns(entryPath, matcher) {
5018 return !this._settings.baseNameMatch && !matcher.match(entryPath);
5019 }
5020 _isSkippedByNegativePatterns(entryPath, patternsRe) {
5021 return !utils.pattern.matchAny(entryPath, patternsRe);
5022 }
5023 };
5024 exports.default = DeepFilter;
5025 }
5026});
5027
5028// node_modules/fast-glob/out/providers/filters/entry.js
5029var require_entry = __commonJS({
5030 "node_modules/fast-glob/out/providers/filters/entry.js"(exports) {
5031 "use strict";
5032 Object.defineProperty(exports, "__esModule", { value: true });
5033 var utils = require_utils3();
5034 var EntryFilter = class {
5035 constructor(_settings, _micromatchOptions) {
5036 this._settings = _settings;
5037 this._micromatchOptions = _micromatchOptions;
5038 this.index = /* @__PURE__ */ new Map();
5039 }
5040 getFilter(positive, negative) {
5041 const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions);
5042 const negativeRe = utils.pattern.convertPatternsToRe(negative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true }));
5043 return (entry) => this._filter(entry, positiveRe, negativeRe);
5044 }
5045 _filter(entry, positiveRe, negativeRe) {
5046 const filepath = utils.path.removeLeadingDotSegment(entry.path);
5047 if (this._settings.unique && this._isDuplicateEntry(filepath)) {
5048 return false;
5049 }
5050 if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
5051 return false;
5052 }
5053 if (this._isSkippedByAbsoluteNegativePatterns(filepath, negativeRe)) {
5054 return false;
5055 }
5056 const isDirectory2 = entry.dirent.isDirectory();
5057 const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory2) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory2);
5058 if (this._settings.unique && isMatched) {
5059 this._createIndexRecord(filepath);
5060 }
5061 return isMatched;
5062 }
5063 _isDuplicateEntry(filepath) {
5064 return this.index.has(filepath);
5065 }
5066 _createIndexRecord(filepath) {
5067 this.index.set(filepath, void 0);
5068 }
5069 _onlyFileFilter(entry) {
5070 return this._settings.onlyFiles && !entry.dirent.isFile();
5071 }
5072 _onlyDirectoryFilter(entry) {
5073 return this._settings.onlyDirectories && !entry.dirent.isDirectory();
5074 }
5075 _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
5076 if (!this._settings.absolute) {
5077 return false;
5078 }
5079 const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath);
5080 return utils.pattern.matchAny(fullpath, patternsRe);
5081 }
5082 _isMatchToPatterns(filepath, patternsRe, isDirectory2) {
5083 const isMatched = utils.pattern.matchAny(filepath, patternsRe);
5084 if (!isMatched && isDirectory2) {
5085 return utils.pattern.matchAny(filepath + "/", patternsRe);
5086 }
5087 return isMatched;
5088 }
5089 };
5090 exports.default = EntryFilter;
5091 }
5092});
5093
5094// node_modules/fast-glob/out/providers/filters/error.js
5095var require_error = __commonJS({
5096 "node_modules/fast-glob/out/providers/filters/error.js"(exports) {
5097 "use strict";
5098 Object.defineProperty(exports, "__esModule", { value: true });
5099 var utils = require_utils3();
5100 var ErrorFilter = class {
5101 constructor(_settings) {
5102 this._settings = _settings;
5103 }
5104 getFilter() {
5105 return (error) => this._isNonFatalError(error);
5106 }
5107 _isNonFatalError(error) {
5108 return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
5109 }
5110 };
5111 exports.default = ErrorFilter;
5112 }
5113});
5114
5115// node_modules/fast-glob/out/providers/transformers/entry.js
5116var require_entry2 = __commonJS({
5117 "node_modules/fast-glob/out/providers/transformers/entry.js"(exports) {
5118 "use strict";
5119 Object.defineProperty(exports, "__esModule", { value: true });
5120 var utils = require_utils3();
5121 var EntryTransformer = class {
5122 constructor(_settings) {
5123 this._settings = _settings;
5124 }
5125 getTransformer() {
5126 return (entry) => this._transform(entry);
5127 }
5128 _transform(entry) {
5129 let filepath = entry.path;
5130 if (this._settings.absolute) {
5131 filepath = utils.path.makeAbsolute(this._settings.cwd, filepath);
5132 filepath = utils.path.unixify(filepath);
5133 }
5134 if (this._settings.markDirectories && entry.dirent.isDirectory()) {
5135 filepath += "/";
5136 }
5137 if (!this._settings.objectMode) {
5138 return filepath;
5139 }
5140 return Object.assign(Object.assign({}, entry), { path: filepath });
5141 }
5142 };
5143 exports.default = EntryTransformer;
5144 }
5145});
5146
5147// node_modules/fast-glob/out/providers/provider.js
5148var require_provider = __commonJS({
5149 "node_modules/fast-glob/out/providers/provider.js"(exports) {
5150 "use strict";
5151 Object.defineProperty(exports, "__esModule", { value: true });
5152 var path13 = __require("path");
5153 var deep_1 = require_deep();
5154 var entry_1 = require_entry();
5155 var error_1 = require_error();
5156 var entry_2 = require_entry2();
5157 var Provider = class {
5158 constructor(_settings) {
5159 this._settings = _settings;
5160 this.errorFilter = new error_1.default(this._settings);
5161 this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
5162 this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
5163 this.entryTransformer = new entry_2.default(this._settings);
5164 }
5165 _getRootDirectory(task) {
5166 return path13.resolve(this._settings.cwd, task.base);
5167 }
5168 _getReaderOptions(task) {
5169 const basePath = task.base === "." ? "" : task.base;
5170 return {
5171 basePath,
5172 pathSegmentSeparator: "/",
5173 concurrency: this._settings.concurrency,
5174 deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
5175 entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
5176 errorFilter: this.errorFilter.getFilter(),
5177 followSymbolicLinks: this._settings.followSymbolicLinks,
5178 fs: this._settings.fs,
5179 stats: this._settings.stats,
5180 throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
5181 transform: this.entryTransformer.getTransformer()
5182 };
5183 }
5184 _getMicromatchOptions() {
5185 return {
5186 dot: this._settings.dot,
5187 matchBase: this._settings.baseNameMatch,
5188 nobrace: !this._settings.braceExpansion,
5189 nocase: !this._settings.caseSensitiveMatch,
5190 noext: !this._settings.extglob,
5191 noglobstar: !this._settings.globstar,
5192 posix: true,
5193 strictSlashes: false
5194 };
5195 }
5196 };
5197 exports.default = Provider;
5198 }
5199});
5200
5201// node_modules/fast-glob/out/providers/async.js
5202var require_async6 = __commonJS({
5203 "node_modules/fast-glob/out/providers/async.js"(exports) {
5204 "use strict";
5205 Object.defineProperty(exports, "__esModule", { value: true });
5206 var async_1 = require_async5();
5207 var provider_1 = require_provider();
5208 var ProviderAsync = class extends provider_1.default {
5209 constructor() {
5210 super(...arguments);
5211 this._reader = new async_1.default(this._settings);
5212 }
5213 async read(task) {
5214 const root2 = this._getRootDirectory(task);
5215 const options8 = this._getReaderOptions(task);
5216 const entries = await this.api(root2, task, options8);
5217 return entries.map((entry) => options8.transform(entry));
5218 }
5219 api(root2, task, options8) {
5220 if (task.dynamic) {
5221 return this._reader.dynamic(root2, options8);
5222 }
5223 return this._reader.static(task.patterns, options8);
5224 }
5225 };
5226 exports.default = ProviderAsync;
5227 }
5228});
5229
5230// node_modules/fast-glob/out/providers/stream.js
5231var require_stream4 = __commonJS({
5232 "node_modules/fast-glob/out/providers/stream.js"(exports) {
5233 "use strict";
5234 Object.defineProperty(exports, "__esModule", { value: true });
5235 var stream_1 = __require("stream");
5236 var stream_2 = require_stream3();
5237 var provider_1 = require_provider();
5238 var ProviderStream = class extends provider_1.default {
5239 constructor() {
5240 super(...arguments);
5241 this._reader = new stream_2.default(this._settings);
5242 }
5243 read(task) {
5244 const root2 = this._getRootDirectory(task);
5245 const options8 = this._getReaderOptions(task);
5246 const source2 = this.api(root2, task, options8);
5247 const destination = new stream_1.Readable({ objectMode: true, read: () => {
5248 } });
5249 source2.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options8.transform(entry))).once("end", () => destination.emit("end"));
5250 destination.once("close", () => source2.destroy());
5251 return destination;
5252 }
5253 api(root2, task, options8) {
5254 if (task.dynamic) {
5255 return this._reader.dynamic(root2, options8);
5256 }
5257 return this._reader.static(task.patterns, options8);
5258 }
5259 };
5260 exports.default = ProviderStream;
5261 }
5262});
5263
5264// node_modules/fast-glob/out/readers/sync.js
5265var require_sync5 = __commonJS({
5266 "node_modules/fast-glob/out/readers/sync.js"(exports) {
5267 "use strict";
5268 Object.defineProperty(exports, "__esModule", { value: true });
5269 var fsStat = require_out();
5270 var fsWalk = require_out3();
5271 var reader_1 = require_reader2();
5272 var ReaderSync = class extends reader_1.default {
5273 constructor() {
5274 super(...arguments);
5275 this._walkSync = fsWalk.walkSync;
5276 this._statSync = fsStat.statSync;
5277 }
5278 dynamic(root2, options8) {
5279 return this._walkSync(root2, options8);
5280 }
5281 static(patterns, options8) {
5282 const entries = [];
5283 for (const pattern of patterns) {
5284 const filepath = this._getFullEntryPath(pattern);
5285 const entry = this._getEntry(filepath, pattern, options8);
5286 if (entry === null || !options8.entryFilter(entry)) {
5287 continue;
5288 }
5289 entries.push(entry);
5290 }
5291 return entries;
5292 }
5293 _getEntry(filepath, pattern, options8) {
5294 try {
5295 const stats = this._getStat(filepath);
5296 return this._makeEntry(stats, pattern);
5297 } catch (error) {
5298 if (options8.errorFilter(error)) {
5299 return null;
5300 }
5301 throw error;
5302 }
5303 }
5304 _getStat(filepath) {
5305 return this._statSync(filepath, this._fsStatSettings);
5306 }
5307 };
5308 exports.default = ReaderSync;
5309 }
5310});
5311
5312// node_modules/fast-glob/out/providers/sync.js
5313var require_sync6 = __commonJS({
5314 "node_modules/fast-glob/out/providers/sync.js"(exports) {
5315 "use strict";
5316 Object.defineProperty(exports, "__esModule", { value: true });
5317 var sync_1 = require_sync5();
5318 var provider_1 = require_provider();
5319 var ProviderSync = class extends provider_1.default {
5320 constructor() {
5321 super(...arguments);
5322 this._reader = new sync_1.default(this._settings);
5323 }
5324 read(task) {
5325 const root2 = this._getRootDirectory(task);
5326 const options8 = this._getReaderOptions(task);
5327 const entries = this.api(root2, task, options8);
5328 return entries.map(options8.transform);
5329 }
5330 api(root2, task, options8) {
5331 if (task.dynamic) {
5332 return this._reader.dynamic(root2, options8);
5333 }
5334 return this._reader.static(task.patterns, options8);
5335 }
5336 };
5337 exports.default = ProviderSync;
5338 }
5339});
5340
5341// node_modules/fast-glob/out/settings.js
5342var require_settings4 = __commonJS({
5343 "node_modules/fast-glob/out/settings.js"(exports) {
5344 "use strict";
5345 Object.defineProperty(exports, "__esModule", { value: true });
5346 exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
5347 var fs7 = __require("fs");
5348 var os2 = __require("os");
5349 var CPU_COUNT = Math.max(os2.cpus().length, 1);
5350 exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
5351 lstat: fs7.lstat,
5352 lstatSync: fs7.lstatSync,
5353 stat: fs7.stat,
5354 statSync: fs7.statSync,
5355 readdir: fs7.readdir,
5356 readdirSync: fs7.readdirSync
5357 };
5358 var Settings = class {
5359 constructor(_options = {}) {
5360 this._options = _options;
5361 this.absolute = this._getValue(this._options.absolute, false);
5362 this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
5363 this.braceExpansion = this._getValue(this._options.braceExpansion, true);
5364 this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
5365 this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
5366 this.cwd = this._getValue(this._options.cwd, process.cwd());
5367 this.deep = this._getValue(this._options.deep, Infinity);
5368 this.dot = this._getValue(this._options.dot, false);
5369 this.extglob = this._getValue(this._options.extglob, true);
5370 this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
5371 this.fs = this._getFileSystemMethods(this._options.fs);
5372 this.globstar = this._getValue(this._options.globstar, true);
5373 this.ignore = this._getValue(this._options.ignore, []);
5374 this.markDirectories = this._getValue(this._options.markDirectories, false);
5375 this.objectMode = this._getValue(this._options.objectMode, false);
5376 this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
5377 this.onlyFiles = this._getValue(this._options.onlyFiles, true);
5378 this.stats = this._getValue(this._options.stats, false);
5379 this.suppressErrors = this._getValue(this._options.suppressErrors, false);
5380 this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
5381 this.unique = this._getValue(this._options.unique, true);
5382 if (this.onlyDirectories) {
5383 this.onlyFiles = false;
5384 }
5385 if (this.stats) {
5386 this.objectMode = true;
5387 }
5388 this.ignore = [].concat(this.ignore);
5389 }
5390 _getValue(option, value) {
5391 return option === void 0 ? value : option;
5392 }
5393 _getFileSystemMethods(methods = {}) {
5394 return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
5395 }
5396 };
5397 exports.default = Settings;
5398 }
5399});
5400
5401// node_modules/fast-glob/out/index.js
5402var require_out4 = __commonJS({
5403 "node_modules/fast-glob/out/index.js"(exports, module) {
5404 "use strict";
5405 var taskManager = require_tasks();
5406 var async_1 = require_async6();
5407 var stream_1 = require_stream4();
5408 var sync_1 = require_sync6();
5409 var settings_1 = require_settings4();
5410 var utils = require_utils3();
5411 async function FastGlob(source2, options8) {
5412 assertPatternsInput(source2);
5413 const works = getWorks(source2, async_1.default, options8);
5414 const result = await Promise.all(works);
5415 return utils.array.flatten(result);
5416 }
5417 (function(FastGlob2) {
5418 FastGlob2.glob = FastGlob2;
5419 FastGlob2.globSync = sync;
5420 FastGlob2.globStream = stream;
5421 FastGlob2.async = FastGlob2;
5422 function sync(source2, options8) {
5423 assertPatternsInput(source2);
5424 const works = getWorks(source2, sync_1.default, options8);
5425 return utils.array.flatten(works);
5426 }
5427 FastGlob2.sync = sync;
5428 function stream(source2, options8) {
5429 assertPatternsInput(source2);
5430 const works = getWorks(source2, stream_1.default, options8);
5431 return utils.stream.merge(works);
5432 }
5433 FastGlob2.stream = stream;
5434 function generateTasks(source2, options8) {
5435 assertPatternsInput(source2);
5436 const patterns = [].concat(source2);
5437 const settings = new settings_1.default(options8);
5438 return taskManager.generate(patterns, settings);
5439 }
5440 FastGlob2.generateTasks = generateTasks;
5441 function isDynamicPattern(source2, options8) {
5442 assertPatternsInput(source2);
5443 const settings = new settings_1.default(options8);
5444 return utils.pattern.isDynamicPattern(source2, settings);
5445 }
5446 FastGlob2.isDynamicPattern = isDynamicPattern;
5447 function escapePath(source2) {
5448 assertPatternsInput(source2);
5449 return utils.path.escape(source2);
5450 }
5451 FastGlob2.escapePath = escapePath;
5452 function convertPathToPattern(source2) {
5453 assertPatternsInput(source2);
5454 return utils.path.convertPathToPattern(source2);
5455 }
5456 FastGlob2.convertPathToPattern = convertPathToPattern;
5457 let posix;
5458 (function(posix2) {
5459 function escapePath2(source2) {
5460 assertPatternsInput(source2);
5461 return utils.path.escapePosixPath(source2);
5462 }
5463 posix2.escapePath = escapePath2;
5464 function convertPathToPattern2(source2) {
5465 assertPatternsInput(source2);
5466 return utils.path.convertPosixPathToPattern(source2);
5467 }
5468 posix2.convertPathToPattern = convertPathToPattern2;
5469 })(posix = FastGlob2.posix || (FastGlob2.posix = {}));
5470 let win32;
5471 (function(win322) {
5472 function escapePath2(source2) {
5473 assertPatternsInput(source2);
5474 return utils.path.escapeWindowsPath(source2);
5475 }
5476 win322.escapePath = escapePath2;
5477 function convertPathToPattern2(source2) {
5478 assertPatternsInput(source2);
5479 return utils.path.convertWindowsPathToPattern(source2);
5480 }
5481 win322.convertPathToPattern = convertPathToPattern2;
5482 })(win32 = FastGlob2.win32 || (FastGlob2.win32 = {}));
5483 })(FastGlob || (FastGlob = {}));
5484 function getWorks(source2, _Provider, options8) {
5485 const patterns = [].concat(source2);
5486 const settings = new settings_1.default(options8);
5487 const tasks = taskManager.generate(patterns, settings);
5488 const provider = new _Provider(settings);
5489 return tasks.map(provider.read, provider);
5490 }
5491 function assertPatternsInput(input) {
5492 const source2 = [].concat(input);
5493 const isValidSource = source2.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
5494 if (!isValidSource) {
5495 throw new TypeError("Patterns must be a string (non empty) or an array of strings");
5496 }
5497 }
5498 module.exports = FastGlob;
5499 }
5500});
5501
5502// node_modules/semver/internal/debug.js
5503var require_debug = __commonJS({
5504 "node_modules/semver/internal/debug.js"(exports, module) {
5505 var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
5506 };
5507 module.exports = debug;
5508 }
5509});
5510
5511// node_modules/semver/internal/constants.js
5512var require_constants4 = __commonJS({
5513 "node_modules/semver/internal/constants.js"(exports, module) {
5514 var SEMVER_SPEC_VERSION = "2.0.0";
5515 var MAX_LENGTH = 256;
5516 var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
5517 9007199254740991;
5518 var MAX_SAFE_COMPONENT_LENGTH = 16;
5519 var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
5520 var RELEASE_TYPES = [
5521 "major",
5522 "premajor",
5523 "minor",
5524 "preminor",
5525 "patch",
5526 "prepatch",
5527 "prerelease"
5528 ];
5529 module.exports = {
5530 MAX_LENGTH,
5531 MAX_SAFE_COMPONENT_LENGTH,
5532 MAX_SAFE_BUILD_LENGTH,
5533 MAX_SAFE_INTEGER,
5534 RELEASE_TYPES,
5535 SEMVER_SPEC_VERSION,
5536 FLAG_INCLUDE_PRERELEASE: 1,
5537 FLAG_LOOSE: 2
5538 };
5539 }
5540});
5541
5542// node_modules/semver/internal/re.js
5543var require_re = __commonJS({
5544 "node_modules/semver/internal/re.js"(exports, module) {
5545 var {
5546 MAX_SAFE_COMPONENT_LENGTH,
5547 MAX_SAFE_BUILD_LENGTH,
5548 MAX_LENGTH
5549 } = require_constants4();
5550 var debug = require_debug();
5551 exports = module.exports = {};
5552 var re = exports.re = [];
5553 var safeRe = exports.safeRe = [];
5554 var src = exports.src = [];
5555 var t = exports.t = {};
5556 var R = 0;
5557 var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
5558 var safeRegexReplacements = [
5559 ["\\s", 1],
5560 ["\\d", MAX_LENGTH],
5561 [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
5562 ];
5563 var makeSafeRegex = (value) => {
5564 for (const [token2, max] of safeRegexReplacements) {
5565 value = value.split(`${token2}*`).join(`${token2}{0,${max}}`).split(`${token2}+`).join(`${token2}{1,${max}}`);
5566 }
5567 return value;
5568 };
5569 var createToken = (name, value, isGlobal) => {
5570 const safe = makeSafeRegex(value);
5571 const index = R++;
5572 debug(name, index, value);
5573 t[name] = index;
5574 src[index] = value;
5575 re[index] = new RegExp(value, isGlobal ? "g" : void 0);
5576 safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
5577 };
5578 createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
5579 createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
5580 createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
5581 createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
5582 createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
5583 createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
5584 createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
5585 createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
5586 createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
5587 createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
5588 createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
5589 createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
5590 createToken("FULL", `^${src[t.FULLPLAIN]}$`);
5591 createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
5592 createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
5593 createToken("GTLT", "((?:<|>)?=?)");
5594 createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
5595 createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
5596 createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
5597 createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
5598 createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
5599 createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
5600 createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
5601 createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
5602 createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
5603 createToken("COERCERTL", src[t.COERCE], true);
5604 createToken("COERCERTLFULL", src[t.COERCEFULL], true);
5605 createToken("LONETILDE", "(?:~>?)");
5606 createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
5607 exports.tildeTrimReplace = "$1~";
5608 createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
5609 createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
5610 createToken("LONECARET", "(?:\\^)");
5611 createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
5612 exports.caretTrimReplace = "$1^";
5613 createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
5614 createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
5615 createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
5616 createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
5617 createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
5618 exports.comparatorTrimReplace = "$1$2$3";
5619 createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
5620 createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
5621 createToken("STAR", "(<|>)?=?\\s*\\*");
5622 createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
5623 createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
5624 }
5625});
5626
5627// node_modules/semver/internal/parse-options.js
5628var require_parse_options = __commonJS({
5629 "node_modules/semver/internal/parse-options.js"(exports, module) {
5630 var looseOption = Object.freeze({ loose: true });
5631 var emptyOpts = Object.freeze({});
5632 var parseOptions = (options8) => {
5633 if (!options8) {
5634 return emptyOpts;
5635 }
5636 if (typeof options8 !== "object") {
5637 return looseOption;
5638 }
5639 return options8;
5640 };
5641 module.exports = parseOptions;
5642 }
5643});
5644
5645// node_modules/semver/internal/identifiers.js
5646var require_identifiers = __commonJS({
5647 "node_modules/semver/internal/identifiers.js"(exports, module) {
5648 var numeric = /^[0-9]+$/;
5649 var compareIdentifiers = (a, b) => {
5650 const anum = numeric.test(a);
5651 const bnum = numeric.test(b);
5652 if (anum && bnum) {
5653 a = +a;
5654 b = +b;
5655 }
5656 return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
5657 };
5658 var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
5659 module.exports = {
5660 compareIdentifiers,
5661 rcompareIdentifiers
5662 };
5663 }
5664});
5665
5666// node_modules/semver/classes/semver.js
5667var require_semver = __commonJS({
5668 "node_modules/semver/classes/semver.js"(exports, module) {
5669 var debug = require_debug();
5670 var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants4();
5671 var { safeRe: re, t } = require_re();
5672 var parseOptions = require_parse_options();
5673 var { compareIdentifiers } = require_identifiers();
5674 var SemVer = class _SemVer {
5675 constructor(version, options8) {
5676 options8 = parseOptions(options8);
5677 if (version instanceof _SemVer) {
5678 if (version.loose === !!options8.loose && version.includePrerelease === !!options8.includePrerelease) {
5679 return version;
5680 } else {
5681 version = version.version;
5682 }
5683 } else if (typeof version !== "string") {
5684 throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
5685 }
5686 if (version.length > MAX_LENGTH) {
5687 throw new TypeError(
5688 `version is longer than ${MAX_LENGTH} characters`
5689 );
5690 }
5691 debug("SemVer", version, options8);
5692 this.options = options8;
5693 this.loose = !!options8.loose;
5694 this.includePrerelease = !!options8.includePrerelease;
5695 const m = version.trim().match(options8.loose ? re[t.LOOSE] : re[t.FULL]);
5696 if (!m) {
5697 throw new TypeError(`Invalid Version: ${version}`);
5698 }
5699 this.raw = version;
5700 this.major = +m[1];
5701 this.minor = +m[2];
5702 this.patch = +m[3];
5703 if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
5704 throw new TypeError("Invalid major version");
5705 }
5706 if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
5707 throw new TypeError("Invalid minor version");
5708 }
5709 if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
5710 throw new TypeError("Invalid patch version");
5711 }
5712 if (!m[4]) {
5713 this.prerelease = [];
5714 } else {
5715 this.prerelease = m[4].split(".").map((id) => {
5716 if (/^[0-9]+$/.test(id)) {
5717 const num = +id;
5718 if (num >= 0 && num < MAX_SAFE_INTEGER) {
5719 return num;
5720 }
5721 }
5722 return id;
5723 });
5724 }
5725 this.build = m[5] ? m[5].split(".") : [];
5726 this.format();
5727 }
5728 format() {
5729 this.version = `${this.major}.${this.minor}.${this.patch}`;
5730 if (this.prerelease.length) {
5731 this.version += `-${this.prerelease.join(".")}`;
5732 }
5733 return this.version;
5734 }
5735 toString() {
5736 return this.version;
5737 }
5738 compare(other) {
5739 debug("SemVer.compare", this.version, this.options, other);
5740 if (!(other instanceof _SemVer)) {
5741 if (typeof other === "string" && other === this.version) {
5742 return 0;
5743 }
5744 other = new _SemVer(other, this.options);
5745 }
5746 if (other.version === this.version) {
5747 return 0;
5748 }
5749 return this.compareMain(other) || this.comparePre(other);
5750 }
5751 compareMain(other) {
5752 if (!(other instanceof _SemVer)) {
5753 other = new _SemVer(other, this.options);
5754 }
5755 return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
5756 }
5757 comparePre(other) {
5758 if (!(other instanceof _SemVer)) {
5759 other = new _SemVer(other, this.options);
5760 }
5761 if (this.prerelease.length && !other.prerelease.length) {
5762 return -1;
5763 } else if (!this.prerelease.length && other.prerelease.length) {
5764 return 1;
5765 } else if (!this.prerelease.length && !other.prerelease.length) {
5766 return 0;
5767 }
5768 let i = 0;
5769 do {
5770 const a = this.prerelease[i];
5771 const b = other.prerelease[i];
5772 debug("prerelease compare", i, a, b);
5773 if (a === void 0 && b === void 0) {
5774 return 0;
5775 } else if (b === void 0) {
5776 return 1;
5777 } else if (a === void 0) {
5778 return -1;
5779 } else if (a === b) {
5780 continue;
5781 } else {
5782 return compareIdentifiers(a, b);
5783 }
5784 } while (++i);
5785 }
5786 compareBuild(other) {
5787 if (!(other instanceof _SemVer)) {
5788 other = new _SemVer(other, this.options);
5789 }
5790 let i = 0;
5791 do {
5792 const a = this.build[i];
5793 const b = other.build[i];
5794 debug("build compare", i, a, b);
5795 if (a === void 0 && b === void 0) {
5796 return 0;
5797 } else if (b === void 0) {
5798 return 1;
5799 } else if (a === void 0) {
5800 return -1;
5801 } else if (a === b) {
5802 continue;
5803 } else {
5804 return compareIdentifiers(a, b);
5805 }
5806 } while (++i);
5807 }
5808 // preminor will bump the version up to the next minor release, and immediately
5809 // down to pre-release. premajor and prepatch work the same way.
5810 inc(release, identifier, identifierBase) {
5811 switch (release) {
5812 case "premajor":
5813 this.prerelease.length = 0;
5814 this.patch = 0;
5815 this.minor = 0;
5816 this.major++;
5817 this.inc("pre", identifier, identifierBase);
5818 break;
5819 case "preminor":
5820 this.prerelease.length = 0;
5821 this.patch = 0;
5822 this.minor++;
5823 this.inc("pre", identifier, identifierBase);
5824 break;
5825 case "prepatch":
5826 this.prerelease.length = 0;
5827 this.inc("patch", identifier, identifierBase);
5828 this.inc("pre", identifier, identifierBase);
5829 break;
5830 // If the input is a non-prerelease version, this acts the same as
5831 // prepatch.
5832 case "prerelease":
5833 if (this.prerelease.length === 0) {
5834 this.inc("patch", identifier, identifierBase);
5835 }
5836 this.inc("pre", identifier, identifierBase);
5837 break;
5838 case "major":
5839 if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
5840 this.major++;
5841 }
5842 this.minor = 0;
5843 this.patch = 0;
5844 this.prerelease = [];
5845 break;
5846 case "minor":
5847 if (this.patch !== 0 || this.prerelease.length === 0) {
5848 this.minor++;
5849 }
5850 this.patch = 0;
5851 this.prerelease = [];
5852 break;
5853 case "patch":
5854 if (this.prerelease.length === 0) {
5855 this.patch++;
5856 }
5857 this.prerelease = [];
5858 break;
5859 // This probably shouldn't be used publicly.
5860 // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
5861 case "pre": {
5862 const base = Number(identifierBase) ? 1 : 0;
5863 if (!identifier && identifierBase === false) {
5864 throw new Error("invalid increment argument: identifier is empty");
5865 }
5866 if (this.prerelease.length === 0) {
5867 this.prerelease = [base];
5868 } else {
5869 let i = this.prerelease.length;
5870 while (--i >= 0) {
5871 if (typeof this.prerelease[i] === "number") {
5872 this.prerelease[i]++;
5873 i = -2;
5874 }
5875 }
5876 if (i === -1) {
5877 if (identifier === this.prerelease.join(".") && identifierBase === false) {
5878 throw new Error("invalid increment argument: identifier already exists");
5879 }
5880 this.prerelease.push(base);
5881 }
5882 }
5883 if (identifier) {
5884 let prerelease = [identifier, base];
5885 if (identifierBase === false) {
5886 prerelease = [identifier];
5887 }
5888 if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
5889 if (isNaN(this.prerelease[1])) {
5890 this.prerelease = prerelease;
5891 }
5892 } else {
5893 this.prerelease = prerelease;
5894 }
5895 }
5896 break;
5897 }
5898 default:
5899 throw new Error(`invalid increment argument: ${release}`);
5900 }
5901 this.raw = this.format();
5902 if (this.build.length) {
5903 this.raw += `+${this.build.join(".")}`;
5904 }
5905 return this;
5906 }
5907 };
5908 module.exports = SemVer;
5909 }
5910});
5911
5912// node_modules/semver/functions/compare.js
5913var require_compare = __commonJS({
5914 "node_modules/semver/functions/compare.js"(exports, module) {
5915 var SemVer = require_semver();
5916 var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
5917 module.exports = compare;
5918 }
5919});
5920
5921// node_modules/semver/functions/gte.js
5922var require_gte = __commonJS({
5923 "node_modules/semver/functions/gte.js"(exports, module) {
5924 var compare = require_compare();
5925 var gte = (a, b, loose) => compare(a, b, loose) >= 0;
5926 module.exports = gte;
5927 }
5928});
5929
5930// node_modules/pseudomap/pseudomap.js
5931var require_pseudomap = __commonJS({
5932 "node_modules/pseudomap/pseudomap.js"(exports, module) {
5933 var hasOwnProperty3 = Object.prototype.hasOwnProperty;
5934 module.exports = PseudoMap;
5935 function PseudoMap(set3) {
5936 if (!(this instanceof PseudoMap))
5937 throw new TypeError("Constructor PseudoMap requires 'new'");
5938 this.clear();
5939 if (set3) {
5940 if (set3 instanceof PseudoMap || typeof Map === "function" && set3 instanceof Map)
5941 set3.forEach(function(value, key2) {
5942 this.set(key2, value);
5943 }, this);
5944 else if (Array.isArray(set3))
5945 set3.forEach(function(kv) {
5946 this.set(kv[0], kv[1]);
5947 }, this);
5948 else
5949 throw new TypeError("invalid argument");
5950 }
5951 }
5952 PseudoMap.prototype.forEach = function(fn, thisp) {
5953 thisp = thisp || this;
5954 Object.keys(this._data).forEach(function(k) {
5955 if (k !== "size")
5956 fn.call(thisp, this._data[k].value, this._data[k].key);
5957 }, this);
5958 };
5959 PseudoMap.prototype.has = function(k) {
5960 return !!find(this._data, k);
5961 };
5962 PseudoMap.prototype.get = function(k) {
5963 var res = find(this._data, k);
5964 return res && res.value;
5965 };
5966 PseudoMap.prototype.set = function(k, v) {
5967 set2(this._data, k, v);
5968 };
5969 PseudoMap.prototype.delete = function(k) {
5970 var res = find(this._data, k);
5971 if (res) {
5972 delete this._data[res._index];
5973 this._data.size--;
5974 }
5975 };
5976 PseudoMap.prototype.clear = function() {
5977 var data = /* @__PURE__ */ Object.create(null);
5978 data.size = 0;
5979 Object.defineProperty(this, "_data", {
5980 value: data,
5981 enumerable: false,
5982 configurable: true,
5983 writable: false
5984 });
5985 };
5986 Object.defineProperty(PseudoMap.prototype, "size", {
5987 get: function() {
5988 return this._data.size;
5989 },
5990 set: function(n) {
5991 },
5992 enumerable: true,
5993 configurable: true
5994 });
5995 PseudoMap.prototype.values = PseudoMap.prototype.keys = PseudoMap.prototype.entries = function() {
5996 throw new Error("iterators are not implemented in this version");
5997 };
5998 function same(a, b) {
5999 return a === b || a !== a && b !== b;
6000 }
6001 function Entry(k, v, i) {
6002 this.key = k;
6003 this.value = v;
6004 this._index = i;
6005 }
6006 function find(data, k) {
6007 for (var i = 0, s = "_" + k, key2 = s; hasOwnProperty3.call(data, key2); key2 = s + i++) {
6008 if (same(data[key2].key, k))
6009 return data[key2];
6010 }
6011 }
6012 function set2(data, k, v) {
6013 for (var i = 0, s = "_" + k, key2 = s; hasOwnProperty3.call(data, key2); key2 = s + i++) {
6014 if (same(data[key2].key, k)) {
6015 data[key2].value = v;
6016 return;
6017 }
6018 }
6019 data.size++;
6020 data[key2] = new Entry(k, v, key2);
6021 }
6022 }
6023});
6024
6025// node_modules/pseudomap/map.js
6026var require_map = __commonJS({
6027 "node_modules/pseudomap/map.js"(exports, module) {
6028 if (process.env.npm_package_name === "pseudomap" && process.env.npm_lifecycle_script === "test")
6029 process.env.TEST_PSEUDOMAP = "true";
6030 if (typeof Map === "function" && !process.env.TEST_PSEUDOMAP) {
6031 module.exports = Map;
6032 } else {
6033 module.exports = require_pseudomap();
6034 }
6035 }
6036});
6037
6038// node_modules/yallist/yallist.js
6039var require_yallist = __commonJS({
6040 "node_modules/yallist/yallist.js"(exports, module) {
6041 module.exports = Yallist;
6042 Yallist.Node = Node;
6043 Yallist.create = Yallist;
6044 function Yallist(list) {
6045 var self = this;
6046 if (!(self instanceof Yallist)) {
6047 self = new Yallist();
6048 }
6049 self.tail = null;
6050 self.head = null;
6051 self.length = 0;
6052 if (list && typeof list.forEach === "function") {
6053 list.forEach(function(item) {
6054 self.push(item);
6055 });
6056 } else if (arguments.length > 0) {
6057 for (var i = 0, l = arguments.length; i < l; i++) {
6058 self.push(arguments[i]);
6059 }
6060 }
6061 return self;
6062 }
6063 Yallist.prototype.removeNode = function(node) {
6064 if (node.list !== this) {
6065 throw new Error("removing node which does not belong to this list");
6066 }
6067 var next = node.next;
6068 var prev = node.prev;
6069 if (next) {
6070 next.prev = prev;
6071 }
6072 if (prev) {
6073 prev.next = next;
6074 }
6075 if (node === this.head) {
6076 this.head = next;
6077 }
6078 if (node === this.tail) {
6079 this.tail = prev;
6080 }
6081 node.list.length--;
6082 node.next = null;
6083 node.prev = null;
6084 node.list = null;
6085 };
6086 Yallist.prototype.unshiftNode = function(node) {
6087 if (node === this.head) {
6088 return;
6089 }
6090 if (node.list) {
6091 node.list.removeNode(node);
6092 }
6093 var head = this.head;
6094 node.list = this;
6095 node.next = head;
6096 if (head) {
6097 head.prev = node;
6098 }
6099 this.head = node;
6100 if (!this.tail) {
6101 this.tail = node;
6102 }
6103 this.length++;
6104 };
6105 Yallist.prototype.pushNode = function(node) {
6106 if (node === this.tail) {
6107 return;
6108 }
6109 if (node.list) {
6110 node.list.removeNode(node);
6111 }
6112 var tail = this.tail;
6113 node.list = this;
6114 node.prev = tail;
6115 if (tail) {
6116 tail.next = node;
6117 }
6118 this.tail = node;
6119 if (!this.head) {
6120 this.head = node;
6121 }
6122 this.length++;
6123 };
6124 Yallist.prototype.push = function() {
6125 for (var i = 0, l = arguments.length; i < l; i++) {
6126 push2(this, arguments[i]);
6127 }
6128 return this.length;
6129 };
6130 Yallist.prototype.unshift = function() {
6131 for (var i = 0, l = arguments.length; i < l; i++) {
6132 unshift(this, arguments[i]);
6133 }
6134 return this.length;
6135 };
6136 Yallist.prototype.pop = function() {
6137 if (!this.tail) {
6138 return void 0;
6139 }
6140 var res = this.tail.value;
6141 this.tail = this.tail.prev;
6142 if (this.tail) {
6143 this.tail.next = null;
6144 } else {
6145 this.head = null;
6146 }
6147 this.length--;
6148 return res;
6149 };
6150 Yallist.prototype.shift = function() {
6151 if (!this.head) {
6152 return void 0;
6153 }
6154 var res = this.head.value;
6155 this.head = this.head.next;
6156 if (this.head) {
6157 this.head.prev = null;
6158 } else {
6159 this.tail = null;
6160 }
6161 this.length--;
6162 return res;
6163 };
6164 Yallist.prototype.forEach = function(fn, thisp) {
6165 thisp = thisp || this;
6166 for (var walker = this.head, i = 0; walker !== null; i++) {
6167 fn.call(thisp, walker.value, i, this);
6168 walker = walker.next;
6169 }
6170 };
6171 Yallist.prototype.forEachReverse = function(fn, thisp) {
6172 thisp = thisp || this;
6173 for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
6174 fn.call(thisp, walker.value, i, this);
6175 walker = walker.prev;
6176 }
6177 };
6178 Yallist.prototype.get = function(n) {
6179 for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
6180 walker = walker.next;
6181 }
6182 if (i === n && walker !== null) {
6183 return walker.value;
6184 }
6185 };
6186 Yallist.prototype.getReverse = function(n) {
6187 for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
6188 walker = walker.prev;
6189 }
6190 if (i === n && walker !== null) {
6191 return walker.value;
6192 }
6193 };
6194 Yallist.prototype.map = function(fn, thisp) {
6195 thisp = thisp || this;
6196 var res = new Yallist();
6197 for (var walker = this.head; walker !== null; ) {
6198 res.push(fn.call(thisp, walker.value, this));
6199 walker = walker.next;
6200 }
6201 return res;
6202 };
6203 Yallist.prototype.mapReverse = function(fn, thisp) {
6204 thisp = thisp || this;
6205 var res = new Yallist();
6206 for (var walker = this.tail; walker !== null; ) {
6207 res.push(fn.call(thisp, walker.value, this));
6208 walker = walker.prev;
6209 }
6210 return res;
6211 };
6212 Yallist.prototype.reduce = function(fn, initial) {
6213 var acc;
6214 var walker = this.head;
6215 if (arguments.length > 1) {
6216 acc = initial;
6217 } else if (this.head) {
6218 walker = this.head.next;
6219 acc = this.head.value;
6220 } else {
6221 throw new TypeError("Reduce of empty list with no initial value");
6222 }
6223 for (var i = 0; walker !== null; i++) {
6224 acc = fn(acc, walker.value, i);
6225 walker = walker.next;
6226 }
6227 return acc;
6228 };
6229 Yallist.prototype.reduceReverse = function(fn, initial) {
6230 var acc;
6231 var walker = this.tail;
6232 if (arguments.length > 1) {
6233 acc = initial;
6234 } else if (this.tail) {
6235 walker = this.tail.prev;
6236 acc = this.tail.value;
6237 } else {
6238 throw new TypeError("Reduce of empty list with no initial value");
6239 }
6240 for (var i = this.length - 1; walker !== null; i--) {
6241 acc = fn(acc, walker.value, i);
6242 walker = walker.prev;
6243 }
6244 return acc;
6245 };
6246 Yallist.prototype.toArray = function() {
6247 var arr = new Array(this.length);
6248 for (var i = 0, walker = this.head; walker !== null; i++) {
6249 arr[i] = walker.value;
6250 walker = walker.next;
6251 }
6252 return arr;
6253 };
6254 Yallist.prototype.toArrayReverse = function() {
6255 var arr = new Array(this.length);
6256 for (var i = 0, walker = this.tail; walker !== null; i++) {
6257 arr[i] = walker.value;
6258 walker = walker.prev;
6259 }
6260 return arr;
6261 };
6262 Yallist.prototype.slice = function(from, to) {
6263 to = to || this.length;
6264 if (to < 0) {
6265 to += this.length;
6266 }
6267 from = from || 0;
6268 if (from < 0) {
6269 from += this.length;
6270 }
6271 var ret = new Yallist();
6272 if (to < from || to < 0) {
6273 return ret;
6274 }
6275 if (from < 0) {
6276 from = 0;
6277 }
6278 if (to > this.length) {
6279 to = this.length;
6280 }
6281 for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
6282 walker = walker.next;
6283 }
6284 for (; walker !== null && i < to; i++, walker = walker.next) {
6285 ret.push(walker.value);
6286 }
6287 return ret;
6288 };
6289 Yallist.prototype.sliceReverse = function(from, to) {
6290 to = to || this.length;
6291 if (to < 0) {
6292 to += this.length;
6293 }
6294 from = from || 0;
6295 if (from < 0) {
6296 from += this.length;
6297 }
6298 var ret = new Yallist();
6299 if (to < from || to < 0) {
6300 return ret;
6301 }
6302 if (from < 0) {
6303 from = 0;
6304 }
6305 if (to > this.length) {
6306 to = this.length;
6307 }
6308 for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
6309 walker = walker.prev;
6310 }
6311 for (; walker !== null && i > from; i--, walker = walker.prev) {
6312 ret.push(walker.value);
6313 }
6314 return ret;
6315 };
6316 Yallist.prototype.reverse = function() {
6317 var head = this.head;
6318 var tail = this.tail;
6319 for (var walker = head; walker !== null; walker = walker.prev) {
6320 var p = walker.prev;
6321 walker.prev = walker.next;
6322 walker.next = p;
6323 }
6324 this.head = tail;
6325 this.tail = head;
6326 return this;
6327 };
6328 function push2(self, item) {
6329 self.tail = new Node(item, self.tail, null, self);
6330 if (!self.head) {
6331 self.head = self.tail;
6332 }
6333 self.length++;
6334 }
6335 function unshift(self, item) {
6336 self.head = new Node(item, null, self.head, self);
6337 if (!self.tail) {
6338 self.tail = self.head;
6339 }
6340 self.length++;
6341 }
6342 function Node(value, prev, next, list) {
6343 if (!(this instanceof Node)) {
6344 return new Node(value, prev, next, list);
6345 }
6346 this.list = list;
6347 this.value = value;
6348 if (prev) {
6349 prev.next = this;
6350 this.prev = prev;
6351 } else {
6352 this.prev = null;
6353 }
6354 if (next) {
6355 next.prev = this;
6356 this.next = next;
6357 } else {
6358 this.next = null;
6359 }
6360 }
6361 }
6362});
6363
6364// node_modules/lru-cache/index.js
6365var require_lru_cache = __commonJS({
6366 "node_modules/lru-cache/index.js"(exports, module) {
6367 "use strict";
6368 module.exports = LRUCache;
6369 var Map2 = require_map();
6370 var util2 = __require("util");
6371 var Yallist = require_yallist();
6372 var hasSymbol = typeof Symbol === "function" && process.env._nodeLRUCacheForceNoSymbol !== "1";
6373 var makeSymbol;
6374 if (hasSymbol) {
6375 makeSymbol = function(key2) {
6376 return Symbol(key2);
6377 };
6378 } else {
6379 makeSymbol = function(key2) {
6380 return "_" + key2;
6381 };
6382 }
6383 var MAX = makeSymbol("max");
6384 var LENGTH = makeSymbol("length");
6385 var LENGTH_CALCULATOR = makeSymbol("lengthCalculator");
6386 var ALLOW_STALE = makeSymbol("allowStale");
6387 var MAX_AGE = makeSymbol("maxAge");
6388 var DISPOSE = makeSymbol("dispose");
6389 var NO_DISPOSE_ON_SET = makeSymbol("noDisposeOnSet");
6390 var LRU_LIST = makeSymbol("lruList");
6391 var CACHE = makeSymbol("cache");
6392 function naiveLength() {
6393 return 1;
6394 }
6395 function LRUCache(options8) {
6396 if (!(this instanceof LRUCache)) {
6397 return new LRUCache(options8);
6398 }
6399 if (typeof options8 === "number") {
6400 options8 = { max: options8 };
6401 }
6402 if (!options8) {
6403 options8 = {};
6404 }
6405 var max = this[MAX] = options8.max;
6406 if (!max || !(typeof max === "number") || max <= 0) {
6407 this[MAX] = Infinity;
6408 }
6409 var lc = options8.length || naiveLength;
6410 if (typeof lc !== "function") {
6411 lc = naiveLength;
6412 }
6413 this[LENGTH_CALCULATOR] = lc;
6414 this[ALLOW_STALE] = options8.stale || false;
6415 this[MAX_AGE] = options8.maxAge || 0;
6416 this[DISPOSE] = options8.dispose;
6417 this[NO_DISPOSE_ON_SET] = options8.noDisposeOnSet || false;
6418 this.reset();
6419 }
6420 Object.defineProperty(LRUCache.prototype, "max", {
6421 set: function(mL) {
6422 if (!mL || !(typeof mL === "number") || mL <= 0) {
6423 mL = Infinity;
6424 }
6425 this[MAX] = mL;
6426 trim2(this);
6427 },
6428 get: function() {
6429 return this[MAX];
6430 },
6431 enumerable: true
6432 });
6433 Object.defineProperty(LRUCache.prototype, "allowStale", {
6434 set: function(allowStale) {
6435 this[ALLOW_STALE] = !!allowStale;
6436 },
6437 get: function() {
6438 return this[ALLOW_STALE];
6439 },
6440 enumerable: true
6441 });
6442 Object.defineProperty(LRUCache.prototype, "maxAge", {
6443 set: function(mA) {
6444 if (!mA || !(typeof mA === "number") || mA < 0) {
6445 mA = 0;
6446 }
6447 this[MAX_AGE] = mA;
6448 trim2(this);
6449 },
6450 get: function() {
6451 return this[MAX_AGE];
6452 },
6453 enumerable: true
6454 });
6455 Object.defineProperty(LRUCache.prototype, "lengthCalculator", {
6456 set: function(lC) {
6457 if (typeof lC !== "function") {
6458 lC = naiveLength;
6459 }
6460 if (lC !== this[LENGTH_CALCULATOR]) {
6461 this[LENGTH_CALCULATOR] = lC;
6462 this[LENGTH] = 0;
6463 this[LRU_LIST].forEach(function(hit) {
6464 hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
6465 this[LENGTH] += hit.length;
6466 }, this);
6467 }
6468 trim2(this);
6469 },
6470 get: function() {
6471 return this[LENGTH_CALCULATOR];
6472 },
6473 enumerable: true
6474 });
6475 Object.defineProperty(LRUCache.prototype, "length", {
6476 get: function() {
6477 return this[LENGTH];
6478 },
6479 enumerable: true
6480 });
6481 Object.defineProperty(LRUCache.prototype, "itemCount", {
6482 get: function() {
6483 return this[LRU_LIST].length;
6484 },
6485 enumerable: true
6486 });
6487 LRUCache.prototype.rforEach = function(fn, thisp) {
6488 thisp = thisp || this;
6489 for (var walker = this[LRU_LIST].tail; walker !== null; ) {
6490 var prev = walker.prev;
6491 forEachStep(this, fn, walker, thisp);
6492 walker = prev;
6493 }
6494 };
6495 function forEachStep(self, fn, node, thisp) {
6496 var hit = node.value;
6497 if (isStale(self, hit)) {
6498 del(self, node);
6499 if (!self[ALLOW_STALE]) {
6500 hit = void 0;
6501 }
6502 }
6503 if (hit) {
6504 fn.call(thisp, hit.value, hit.key, self);
6505 }
6506 }
6507 LRUCache.prototype.forEach = function(fn, thisp) {
6508 thisp = thisp || this;
6509 for (var walker = this[LRU_LIST].head; walker !== null; ) {
6510 var next = walker.next;
6511 forEachStep(this, fn, walker, thisp);
6512 walker = next;
6513 }
6514 };
6515 LRUCache.prototype.keys = function() {
6516 return this[LRU_LIST].toArray().map(function(k) {
6517 return k.key;
6518 }, this);
6519 };
6520 LRUCache.prototype.values = function() {
6521 return this[LRU_LIST].toArray().map(function(k) {
6522 return k.value;
6523 }, this);
6524 };
6525 LRUCache.prototype.reset = function() {
6526 if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
6527 this[LRU_LIST].forEach(function(hit) {
6528 this[DISPOSE](hit.key, hit.value);
6529 }, this);
6530 }
6531 this[CACHE] = new Map2();
6532 this[LRU_LIST] = new Yallist();
6533 this[LENGTH] = 0;
6534 };
6535 LRUCache.prototype.dump = function() {
6536 return this[LRU_LIST].map(function(hit) {
6537 if (!isStale(this, hit)) {
6538 return {
6539 k: hit.key,
6540 v: hit.value,
6541 e: hit.now + (hit.maxAge || 0)
6542 };
6543 }
6544 }, this).toArray().filter(function(h) {
6545 return h;
6546 });
6547 };
6548 LRUCache.prototype.dumpLru = function() {
6549 return this[LRU_LIST];
6550 };
6551 LRUCache.prototype.inspect = function(n, opts) {
6552 var str2 = "LRUCache {";
6553 var extras = false;
6554 var as = this[ALLOW_STALE];
6555 if (as) {
6556 str2 += "\n allowStale: true";
6557 extras = true;
6558 }
6559 var max = this[MAX];
6560 if (max && max !== Infinity) {
6561 if (extras) {
6562 str2 += ",";
6563 }
6564 str2 += "\n max: " + util2.inspect(max, opts);
6565 extras = true;
6566 }
6567 var maxAge = this[MAX_AGE];
6568 if (maxAge) {
6569 if (extras) {
6570 str2 += ",";
6571 }
6572 str2 += "\n maxAge: " + util2.inspect(maxAge, opts);
6573 extras = true;
6574 }
6575 var lc = this[LENGTH_CALCULATOR];
6576 if (lc && lc !== naiveLength) {
6577 if (extras) {
6578 str2 += ",";
6579 }
6580 str2 += "\n length: " + util2.inspect(this[LENGTH], opts);
6581 extras = true;
6582 }
6583 var didFirst = false;
6584 this[LRU_LIST].forEach(function(item) {
6585 if (didFirst) {
6586 str2 += ",\n ";
6587 } else {
6588 if (extras) {
6589 str2 += ",\n";
6590 }
6591 didFirst = true;
6592 str2 += "\n ";
6593 }
6594 var key2 = util2.inspect(item.key).split("\n").join("\n ");
6595 var val = { value: item.value };
6596 if (item.maxAge !== maxAge) {
6597 val.maxAge = item.maxAge;
6598 }
6599 if (lc !== naiveLength) {
6600 val.length = item.length;
6601 }
6602 if (isStale(this, item)) {
6603 val.stale = true;
6604 }
6605 val = util2.inspect(val, opts).split("\n").join("\n ");
6606 str2 += key2 + " => " + val;
6607 });
6608 if (didFirst || extras) {
6609 str2 += "\n";
6610 }
6611 str2 += "}";
6612 return str2;
6613 };
6614 LRUCache.prototype.set = function(key2, value, maxAge) {
6615 maxAge = maxAge || this[MAX_AGE];
6616 var now = maxAge ? Date.now() : 0;
6617 var len = this[LENGTH_CALCULATOR](value, key2);
6618 if (this[CACHE].has(key2)) {
6619 if (len > this[MAX]) {
6620 del(this, this[CACHE].get(key2));
6621 return false;
6622 }
6623 var node = this[CACHE].get(key2);
6624 var item = node.value;
6625 if (this[DISPOSE]) {
6626 if (!this[NO_DISPOSE_ON_SET]) {
6627 this[DISPOSE](key2, item.value);
6628 }
6629 }
6630 item.now = now;
6631 item.maxAge = maxAge;
6632 item.value = value;
6633 this[LENGTH] += len - item.length;
6634 item.length = len;
6635 this.get(key2);
6636 trim2(this);
6637 return true;
6638 }
6639 var hit = new Entry(key2, value, len, now, maxAge);
6640 if (hit.length > this[MAX]) {
6641 if (this[DISPOSE]) {
6642 this[DISPOSE](key2, value);
6643 }
6644 return false;
6645 }
6646 this[LENGTH] += hit.length;
6647 this[LRU_LIST].unshift(hit);
6648 this[CACHE].set(key2, this[LRU_LIST].head);
6649 trim2(this);
6650 return true;
6651 };
6652 LRUCache.prototype.has = function(key2) {
6653 if (!this[CACHE].has(key2)) return false;
6654 var hit = this[CACHE].get(key2).value;
6655 if (isStale(this, hit)) {
6656 return false;
6657 }
6658 return true;
6659 };
6660 LRUCache.prototype.get = function(key2) {
6661 return get(this, key2, true);
6662 };
6663 LRUCache.prototype.peek = function(key2) {
6664 return get(this, key2, false);
6665 };
6666 LRUCache.prototype.pop = function() {
6667 var node = this[LRU_LIST].tail;
6668 if (!node) return null;
6669 del(this, node);
6670 return node.value;
6671 };
6672 LRUCache.prototype.del = function(key2) {
6673 del(this, this[CACHE].get(key2));
6674 };
6675 LRUCache.prototype.load = function(arr) {
6676 this.reset();
6677 var now = Date.now();
6678 for (var l = arr.length - 1; l >= 0; l--) {
6679 var hit = arr[l];
6680 var expiresAt = hit.e || 0;
6681 if (expiresAt === 0) {
6682 this.set(hit.k, hit.v);
6683 } else {
6684 var maxAge = expiresAt - now;
6685 if (maxAge > 0) {
6686 this.set(hit.k, hit.v, maxAge);
6687 }
6688 }
6689 }
6690 };
6691 LRUCache.prototype.prune = function() {
6692 var self = this;
6693 this[CACHE].forEach(function(value, key2) {
6694 get(self, key2, false);
6695 });
6696 };
6697 function get(self, key2, doUse) {
6698 var node = self[CACHE].get(key2);
6699 if (node) {
6700 var hit = node.value;
6701 if (isStale(self, hit)) {
6702 del(self, node);
6703 if (!self[ALLOW_STALE]) hit = void 0;
6704 } else {
6705 if (doUse) {
6706 self[LRU_LIST].unshiftNode(node);
6707 }
6708 }
6709 if (hit) hit = hit.value;
6710 }
6711 return hit;
6712 }
6713 function isStale(self, hit) {
6714 if (!hit || !hit.maxAge && !self[MAX_AGE]) {
6715 return false;
6716 }
6717 var stale = false;
6718 var diff2 = Date.now() - hit.now;
6719 if (hit.maxAge) {
6720 stale = diff2 > hit.maxAge;
6721 } else {
6722 stale = self[MAX_AGE] && diff2 > self[MAX_AGE];
6723 }
6724 return stale;
6725 }
6726 function trim2(self) {
6727 if (self[LENGTH] > self[MAX]) {
6728 for (var walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
6729 var prev = walker.prev;
6730 del(self, walker);
6731 walker = prev;
6732 }
6733 }
6734 }
6735 function del(self, node) {
6736 if (node) {
6737 var hit = node.value;
6738 if (self[DISPOSE]) {
6739 self[DISPOSE](hit.key, hit.value);
6740 }
6741 self[LENGTH] -= hit.length;
6742 self[CACHE].delete(hit.key);
6743 self[LRU_LIST].removeNode(node);
6744 }
6745 }
6746 function Entry(key2, value, length, now, maxAge) {
6747 this.key = key2;
6748 this.value = value;
6749 this.length = length;
6750 this.now = now;
6751 this.maxAge = maxAge || 0;
6752 }
6753 }
6754});
6755
6756// node_modules/sigmund/sigmund.js
6757var require_sigmund = __commonJS({
6758 "node_modules/sigmund/sigmund.js"(exports, module) {
6759 module.exports = sigmund;
6760 function sigmund(subject, maxSessions) {
6761 maxSessions = maxSessions || 10;
6762 var notes = [];
6763 var analysis = "";
6764 var RE = RegExp;
6765 function psychoAnalyze(subject2, session) {
6766 if (session > maxSessions) return;
6767 if (typeof subject2 === "function" || typeof subject2 === "undefined") {
6768 return;
6769 }
6770 if (typeof subject2 !== "object" || !subject2 || subject2 instanceof RE) {
6771 analysis += subject2;
6772 return;
6773 }
6774 if (notes.indexOf(subject2) !== -1 || session === maxSessions) return;
6775 notes.push(subject2);
6776 analysis += "{";
6777 Object.keys(subject2).forEach(function(issue, _, __) {
6778 if (issue.charAt(0) === "_") return;
6779 var to = typeof subject2[issue];
6780 if (to === "function" || to === "undefined") return;
6781 analysis += issue;
6782 psychoAnalyze(subject2[issue], session + 1);
6783 });
6784 }
6785 psychoAnalyze(subject, 0);
6786 return analysis;
6787 }
6788 }
6789});
6790
6791// node_modules/editorconfig/src/lib/fnmatch.js
6792var require_fnmatch = __commonJS({
6793 "node_modules/editorconfig/src/lib/fnmatch.js"(exports, module) {
6794 var platform = typeof process === "object" ? process.platform : "win32";
6795 if (module) module.exports = minimatch;
6796 else exports.minimatch = minimatch;
6797 minimatch.Minimatch = Minimatch;
6798 var LRU = require_lru_cache();
6799 var cache3 = minimatch.cache = new LRU({ max: 100 });
6800 var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
6801 var sigmund = require_sigmund();
6802 var path13 = __require("path");
6803 var qmark = "[^/]";
6804 var star = qmark + "*?";
6805 var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
6806 var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
6807 var reSpecials = charSet("().*{}+?[]^$\\!");
6808 function charSet(s) {
6809 return s.split("").reduce(function(set2, c2) {
6810 set2[c2] = true;
6811 return set2;
6812 }, {});
6813 }
6814 var slashSplit = /\/+/;
6815 minimatch.monkeyPatch = monkeyPatch;
6816 function monkeyPatch() {
6817 var desc = Object.getOwnPropertyDescriptor(String.prototype, "match");
6818 var orig = desc.value;
6819 desc.value = function(p) {
6820 if (p instanceof Minimatch) return p.match(this);
6821 return orig.call(this, p);
6822 };
6823 Object.defineProperty(String.prototype, desc);
6824 }
6825 minimatch.filter = filter2;
6826 function filter2(pattern, options8) {
6827 options8 = options8 || {};
6828 return function(p, i, list) {
6829 return minimatch(p, pattern, options8);
6830 };
6831 }
6832 function ext(a, b) {
6833 a = a || {};
6834 b = b || {};
6835 var t = {};
6836 Object.keys(b).forEach(function(k) {
6837 t[k] = b[k];
6838 });
6839 Object.keys(a).forEach(function(k) {
6840 t[k] = a[k];
6841 });
6842 return t;
6843 }
6844 minimatch.defaults = function(def) {
6845 if (!def || !Object.keys(def).length) return minimatch;
6846 var orig = minimatch;
6847 var m = function minimatch2(p, pattern, options8) {
6848 return orig.minimatch(p, pattern, ext(def, options8));
6849 };
6850 m.Minimatch = function Minimatch2(pattern, options8) {
6851 return new orig.Minimatch(pattern, ext(def, options8));
6852 };
6853 return m;
6854 };
6855 Minimatch.defaults = function(def) {
6856 if (!def || !Object.keys(def).length) return Minimatch;
6857 return minimatch.defaults(def).Minimatch;
6858 };
6859 function minimatch(p, pattern, options8) {
6860 if (typeof pattern !== "string") {
6861 throw new TypeError("glob pattern string required");
6862 }
6863 if (!options8) options8 = {};
6864 if (!options8.nocomment && pattern.charAt(0) === "#") {
6865 return false;
6866 }
6867 if (pattern.trim() === "") return p === "";
6868 return new Minimatch(pattern, options8).match(p);
6869 }
6870 function Minimatch(pattern, options8) {
6871 if (!(this instanceof Minimatch)) {
6872 return new Minimatch(pattern, options8, cache3);
6873 }
6874 if (typeof pattern !== "string") {
6875 throw new TypeError("glob pattern string required");
6876 }
6877 if (!options8) options8 = {};
6878 if (platform === "win32") {
6879 pattern = pattern.split("\\").join("/");
6880 }
6881 var cacheKey = pattern + "\n" + sigmund(options8);
6882 var cached = minimatch.cache.get(cacheKey);
6883 if (cached) return cached;
6884 minimatch.cache.set(cacheKey, this);
6885 this.options = options8;
6886 this.set = [];
6887 this.pattern = pattern;
6888 this.regexp = null;
6889 this.negate = false;
6890 this.comment = false;
6891 this.empty = false;
6892 this.make();
6893 }
6894 Minimatch.prototype.make = make;
6895 function make() {
6896 if (this._made) return;
6897 var pattern = this.pattern;
6898 var options8 = this.options;
6899 if (!options8.nocomment && pattern.charAt(0) === "#") {
6900 this.comment = true;
6901 return;
6902 }
6903 if (!pattern) {
6904 this.empty = true;
6905 return;
6906 }
6907 this.parseNegate();
6908 var set2 = this.globSet = this.braceExpand();
6909 if (options8.debug) console.error(this.pattern, set2);
6910 set2 = this.globParts = set2.map(function(s) {
6911 return s.split(slashSplit);
6912 });
6913 if (options8.debug) console.error(this.pattern, set2);
6914 set2 = set2.map(function(s, si, set3) {
6915 return s.map(this.parse, this);
6916 }, this);
6917 if (options8.debug) console.error(this.pattern, set2);
6918 set2 = set2.filter(function(s) {
6919 return -1 === s.indexOf(false);
6920 });
6921 if (options8.debug) console.error(this.pattern, set2);
6922 this.set = set2;
6923 }
6924 Minimatch.prototype.parseNegate = parseNegate;
6925 function parseNegate() {
6926 var pattern = this.pattern, negate = false, options8 = this.options, negateOffset = 0;
6927 if (options8.nonegate) return;
6928 for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
6929 negate = !negate;
6930 negateOffset++;
6931 }
6932 if (negateOffset) this.pattern = pattern.substr(negateOffset);
6933 this.negate = negate;
6934 }
6935 minimatch.braceExpand = function(pattern, options8) {
6936 return new Minimatch(pattern, options8).braceExpand();
6937 };
6938 Minimatch.prototype.braceExpand = braceExpand;
6939 function braceExpand(pattern, options8) {
6940 options8 = options8 || this.options;
6941 pattern = typeof pattern === "undefined" ? this.pattern : pattern;
6942 if (typeof pattern === "undefined") {
6943 throw new Error("undefined pattern");
6944 }
6945 if (options8.nobrace || !pattern.match(/\{.*\}/)) {
6946 return [pattern];
6947 }
6948 var escaping = false;
6949 if (pattern.charAt(0) !== "{") {
6950 var prefix = null;
6951 for (var i = 0, l = pattern.length; i < l; i++) {
6952 var c2 = pattern.charAt(i);
6953 if (c2 === "\\") {
6954 escaping = !escaping;
6955 } else if (c2 === "{" && !escaping) {
6956 prefix = pattern.substr(0, i);
6957 break;
6958 }
6959 }
6960 if (prefix === null) {
6961 return [pattern];
6962 }
6963 var tail = braceExpand(pattern.substr(i), options8);
6964 return tail.map(function(t) {
6965 return prefix + t;
6966 });
6967 }
6968 var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);
6969 if (numset) {
6970 var suf = braceExpand(pattern.substr(numset[0].length), options8), start = +numset[1], end = +numset[2], inc = start > end ? -1 : 1, set2 = [];
6971 for (var i = start; i != end + inc; i += inc) {
6972 for (var ii = 0, ll = suf.length; ii < ll; ii++) {
6973 set2.push(i + suf[ii]);
6974 }
6975 }
6976 return set2;
6977 }
6978 var i = 1, depth = 1, set2 = [], member = "", sawEnd = false, escaping = false;
6979 function addMember() {
6980 set2.push(member);
6981 member = "";
6982 }
6983 FOR: for (i = 1, l = pattern.length; i < l; i++) {
6984 var c2 = pattern.charAt(i);
6985 if (escaping) {
6986 escaping = false;
6987 member += "\\" + c2;
6988 } else {
6989 switch (c2) {
6990 case "\\":
6991 escaping = true;
6992 continue;
6993 case "{":
6994 depth++;
6995 member += "{";
6996 continue;
6997 case "}":
6998 depth--;
6999 if (depth === 0) {
7000 addMember();
7001 i++;
7002 break FOR;
7003 } else {
7004 member += c2;
7005 continue;
7006 }
7007 case ",":
7008 if (depth === 1) {
7009 addMember();
7010 } else {
7011 member += c2;
7012 }
7013 continue;
7014 default:
7015 member += c2;
7016 continue;
7017 }
7018 }
7019 }
7020 if (depth !== 0) {
7021 return braceExpand("\\" + pattern, options8);
7022 }
7023 var suf = braceExpand(pattern.substr(i), options8);
7024 var addBraces = set2.length === 1;
7025 set2 = set2.map(function(p) {
7026 return braceExpand(p, options8);
7027 });
7028 set2 = set2.reduce(function(l2, r) {
7029 return l2.concat(r);
7030 });
7031 if (addBraces) {
7032 set2 = set2.map(function(s) {
7033 return "{" + s + "}";
7034 });
7035 }
7036 var ret = [];
7037 for (var i = 0, l = set2.length; i < l; i++) {
7038 for (var ii = 0, ll = suf.length; ii < ll; ii++) {
7039 ret.push(set2[i] + suf[ii]);
7040 }
7041 }
7042 return ret;
7043 }
7044 Minimatch.prototype.parse = parse7;
7045 var SUBPARSE = {};
7046 function parse7(pattern, isSub) {
7047 var options8 = this.options;
7048 if (!options8.noglobstar && pattern === "**") return GLOBSTAR;
7049 if (pattern === "") return "";
7050 var re = "", hasMagic = !!options8.nocase, escaping = false, patternListStack = [], plType, stateChar, inClass = false, reClassStart = -1, classStart = -1, patternStart = pattern.charAt(0) === "." ? "" : options8.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
7051 function clearStateChar() {
7052 if (stateChar) {
7053 switch (stateChar) {
7054 case "*":
7055 re += star;
7056 hasMagic = true;
7057 break;
7058 case "?":
7059 re += qmark;
7060 hasMagic = true;
7061 break;
7062 default:
7063 re += "\\" + stateChar;
7064 break;
7065 }
7066 stateChar = false;
7067 }
7068 }
7069 for (var i = 0, len = pattern.length, c2; i < len && (c2 = pattern.charAt(i)); i++) {
7070 if (options8.debug) {
7071 console.error("%s %s %s %j", pattern, i, re, c2);
7072 }
7073 if (escaping && reSpecials[c2]) {
7074 re += "\\" + c2;
7075 escaping = false;
7076 continue;
7077 }
7078 SWITCH: switch (c2) {
7079 case "/":
7080 return false;
7081 case "\\":
7082 clearStateChar();
7083 escaping = true;
7084 continue;
7085 // the various stateChar values
7086 // for the "extglob" stuff.
7087 case "?":
7088 case "*":
7089 case "+":
7090 case "@":
7091 case "!":
7092 if (options8.debug) {
7093 console.error("%s %s %s %j <-- stateChar", pattern, i, re, c2);
7094 }
7095 if (inClass) {
7096 if (c2 === "!" && i === classStart + 1) c2 = "^";
7097 re += c2;
7098 continue;
7099 }
7100 clearStateChar();
7101 stateChar = c2;
7102 if (options8.noext) clearStateChar();
7103 continue;
7104 case "(":
7105 if (inClass) {
7106 re += "(";
7107 continue;
7108 }
7109 if (!stateChar) {
7110 re += "\\(";
7111 continue;
7112 }
7113 plType = stateChar;
7114 patternListStack.push({
7115 type: plType,
7116 start: i - 1,
7117 reStart: re.length
7118 });
7119 re += stateChar === "!" ? "(?:(?!" : "(?:";
7120 stateChar = false;
7121 continue;
7122 case ")":
7123 if (inClass || !patternListStack.length) {
7124 re += "\\)";
7125 continue;
7126 }
7127 hasMagic = true;
7128 re += ")";
7129 plType = patternListStack.pop().type;
7130 switch (plType) {
7131 case "!":
7132 re += "[^/]*?)";
7133 break;
7134 case "?":
7135 case "+":
7136 case "*":
7137 re += plType;
7138 case "@":
7139 break;
7140 }
7141 continue;
7142 case "|":
7143 if (inClass || !patternListStack.length || escaping) {
7144 re += "\\|";
7145 escaping = false;
7146 continue;
7147 }
7148 re += "|";
7149 continue;
7150 // these are mostly the same in regexp and glob
7151 case "[":
7152 clearStateChar();
7153 if (inClass) {
7154 re += "\\" + c2;
7155 continue;
7156 }
7157 inClass = true;
7158 classStart = i;
7159 reClassStart = re.length;
7160 re += c2;
7161 continue;
7162 case "]":
7163 if (i === classStart + 1 || !inClass) {
7164 re += "\\" + c2;
7165 escaping = false;
7166 continue;
7167 }
7168 hasMagic = true;
7169 inClass = false;
7170 re += c2;
7171 continue;
7172 default:
7173 clearStateChar();
7174 if (escaping) {
7175 escaping = false;
7176 } else if (reSpecials[c2] && !(c2 === "^" && inClass)) {
7177 re += "\\";
7178 }
7179 re += c2;
7180 }
7181 }
7182 if (inClass) {
7183 var cs = pattern.substr(classStart + 1), sp = this.parse(cs, SUBPARSE);
7184 re = re.substr(0, reClassStart) + "\\[" + sp[0];
7185 hasMagic = hasMagic || sp[1];
7186 }
7187 var pl;
7188 while (pl = patternListStack.pop()) {
7189 var tail = re.slice(pl.reStart + 3);
7190 tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function(_, $1, $2) {
7191 if (!$2) {
7192 $2 = "\\";
7193 }
7194 return $1 + $1 + $2 + "|";
7195 });
7196 var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
7197 hasMagic = true;
7198 re = re.slice(0, pl.reStart) + t + "\\(" + tail;
7199 }
7200 clearStateChar();
7201 if (escaping) {
7202 re += "\\\\";
7203 }
7204 var addPatternStart = false;
7205 switch (re.charAt(0)) {
7206 case ".":
7207 case "[":
7208 case "(":
7209 addPatternStart = true;
7210 }
7211 if (re !== "" && hasMagic) re = "(?=.)" + re;
7212 if (addPatternStart) re = patternStart + re;
7213 if (isSub === SUBPARSE) {
7214 return [re, hasMagic];
7215 }
7216 if (!hasMagic) {
7217 return globUnescape(pattern);
7218 }
7219 var flags = options8.nocase ? "i" : "", regExp = new RegExp("^" + re + "$", flags);
7220 regExp._glob = pattern;
7221 regExp._src = re;
7222 return regExp;
7223 }
7224 minimatch.makeRe = function(pattern, options8) {
7225 return new Minimatch(pattern, options8 || {}).makeRe();
7226 };
7227 Minimatch.prototype.makeRe = makeRe;
7228 function makeRe() {
7229 if (this.regexp || this.regexp === false) return this.regexp;
7230 var set2 = this.set;
7231 if (!set2.length) return this.regexp = false;
7232 var options8 = this.options;
7233 var twoStar = options8.noglobstar ? star : options8.dot ? twoStarDot : twoStarNoDot, flags = options8.nocase ? "i" : "";
7234 var re = set2.map(function(pattern) {
7235 return pattern.map(function(p) {
7236 return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
7237 }).join("\\/");
7238 }).join("|");
7239 re = "^(?:" + re + ")$";
7240 if (this.negate) re = "^(?!" + re + ").*$";
7241 try {
7242 return this.regexp = new RegExp(re, flags);
7243 } catch (ex) {
7244 return this.regexp = false;
7245 }
7246 }
7247 minimatch.match = function(list, pattern, options8) {
7248 var mm = new Minimatch(pattern, options8);
7249 list = list.filter(function(f) {
7250 return mm.match(f);
7251 });
7252 if (options8.nonull && !list.length) {
7253 list.push(pattern);
7254 }
7255 return list;
7256 };
7257 Minimatch.prototype.match = match;
7258 function match(f, partial) {
7259 if (this.comment) return false;
7260 if (this.empty) return f === "";
7261 if (f === "/" && partial) return true;
7262 var options8 = this.options;
7263 if (platform === "win32") {
7264 f = f.split("\\").join("/");
7265 }
7266 f = f.split(slashSplit);
7267 if (options8.debug) {
7268 console.error(this.pattern, "split", f);
7269 }
7270 var set2 = this.set;
7271 for (var i = 0, l = set2.length; i < l; i++) {
7272 var pattern = set2[i];
7273 var hit = this.matchOne(f, pattern, partial);
7274 if (hit) {
7275 if (options8.flipNegate) return true;
7276 return !this.negate;
7277 }
7278 }
7279 if (options8.flipNegate) return false;
7280 return this.negate;
7281 }
7282 Minimatch.prototype.matchOne = function(file, pattern, partial) {
7283 var options8 = this.options;
7284 if (options8.debug) {
7285 console.error(
7286 "matchOne",
7287 {
7288 "this": this,
7289 file,
7290 pattern
7291 }
7292 );
7293 }
7294 if (options8.matchBase && pattern.length === 1) {
7295 file = path13.basename(file.join("/")).split("/");
7296 }
7297 if (options8.debug) {
7298 console.error("matchOne", file.length, pattern.length);
7299 }
7300 for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
7301 if (options8.debug) {
7302 console.error("matchOne loop");
7303 }
7304 var p = pattern[pi], f = file[fi];
7305 if (options8.debug) {
7306 console.error(pattern, p, f);
7307 }
7308 if (p === false) return false;
7309 if (p === GLOBSTAR) {
7310 if (options8.debug)
7311 console.error("GLOBSTAR", [pattern, p, f]);
7312 var fr = fi, pr = pi + 1;
7313 if (pr === pl) {
7314 if (options8.debug)
7315 console.error("** at the end");
7316 for (; fi < fl; fi++) {
7317 if (file[fi] === "." || file[fi] === ".." || !options8.dot && file[fi].charAt(0) === ".") return false;
7318 }
7319 return true;
7320 }
7321 WHILE: while (fr < fl) {
7322 var swallowee = file[fr];
7323 if (options8.debug) {
7324 console.error(
7325 "\nglobstar while",
7326 file,
7327 fr,
7328 pattern,
7329 pr,
7330 swallowee
7331 );
7332 }
7333 if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
7334 if (options8.debug)
7335 console.error("globstar found match!", fr, fl, swallowee);
7336 return true;
7337 } else {
7338 if (swallowee === "." || swallowee === ".." || !options8.dot && swallowee.charAt(0) === ".") {
7339 if (options8.debug)
7340 console.error("dot detected!", file, fr, pattern, pr);
7341 break WHILE;
7342 }
7343 if (options8.debug)
7344 console.error("globstar swallow a segment, and continue");
7345 fr++;
7346 }
7347 }
7348 if (partial) {
7349 if (fr === fl) return true;
7350 }
7351 return false;
7352 }
7353 var hit;
7354 if (typeof p === "string") {
7355 if (options8.nocase) {
7356 hit = f.toLowerCase() === p.toLowerCase();
7357 } else {
7358 hit = f === p;
7359 }
7360 if (options8.debug) {
7361 console.error("string match", p, f, hit);
7362 }
7363 } else {
7364 hit = f.match(p);
7365 if (options8.debug) {
7366 console.error("pattern match", p, f, hit);
7367 }
7368 }
7369 if (!hit) return false;
7370 }
7371 if (fi === fl && pi === pl) {
7372 return true;
7373 } else if (fi === fl) {
7374 return partial;
7375 } else if (pi === pl) {
7376 var emptyFileEnd = fi === fl - 1 && file[fi] === "";
7377 return emptyFileEnd;
7378 }
7379 throw new Error("wtf?");
7380 };
7381 function globUnescape(s) {
7382 return s.replace(/\\(.)/g, "$1");
7383 }
7384 function regExpEscape(s) {
7385 return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
7386 }
7387 }
7388});
7389
7390// node_modules/editorconfig/src/lib/ini.js
7391var require_ini = __commonJS({
7392 "node_modules/editorconfig/src/lib/ini.js"(exports) {
7393 "use strict";
7394 var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
7395 return new (P || (P = Promise))(function(resolve3, reject) {
7396 function fulfilled(value) {
7397 try {
7398 step(generator.next(value));
7399 } catch (e) {
7400 reject(e);
7401 }
7402 }
7403 function rejected(value) {
7404 try {
7405 step(generator["throw"](value));
7406 } catch (e) {
7407 reject(e);
7408 }
7409 }
7410 function step(result) {
7411 result.done ? resolve3(result.value) : new P(function(resolve4) {
7412 resolve4(result.value);
7413 }).then(fulfilled, rejected);
7414 }
7415 step((generator = generator.apply(thisArg, _arguments || [])).next());
7416 });
7417 };
7418 var __generator = exports && exports.__generator || function(thisArg, body) {
7419 var _ = { label: 0, sent: function() {
7420 if (t[0] & 1) throw t[1];
7421 return t[1];
7422 }, trys: [], ops: [] }, f, y, t, g;
7423 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
7424 return this;
7425 }), g;
7426 function verb(n) {
7427 return function(v) {
7428 return step([n, v]);
7429 };
7430 }
7431 function step(op) {
7432 if (f) throw new TypeError("Generator is already executing.");
7433 while (_) try {
7434 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
7435 if (y = 0, t) op = [op[0] & 2, t.value];
7436 switch (op[0]) {
7437 case 0:
7438 case 1:
7439 t = op;
7440 break;
7441 case 4:
7442 _.label++;
7443 return { value: op[1], done: false };
7444 case 5:
7445 _.label++;
7446 y = op[1];
7447 op = [0];
7448 continue;
7449 case 7:
7450 op = _.ops.pop();
7451 _.trys.pop();
7452 continue;
7453 default:
7454 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
7455 _ = 0;
7456 continue;
7457 }
7458 if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
7459 _.label = op[1];
7460 break;
7461 }
7462 if (op[0] === 6 && _.label < t[1]) {
7463 _.label = t[1];
7464 t = op;
7465 break;
7466 }
7467 if (t && _.label < t[2]) {
7468 _.label = t[2];
7469 _.ops.push(op);
7470 break;
7471 }
7472 if (t[2]) _.ops.pop();
7473 _.trys.pop();
7474 continue;
7475 }
7476 op = body.call(thisArg, _);
7477 } catch (e) {
7478 op = [6, e];
7479 y = 0;
7480 } finally {
7481 f = t = 0;
7482 }
7483 if (op[0] & 5) throw op[1];
7484 return { value: op[0] ? op[1] : void 0, done: true };
7485 }
7486 };
7487 var __importStar = exports && exports.__importStar || function(mod) {
7488 if (mod && mod.__esModule) return mod;
7489 var result = {};
7490 if (mod != null) {
7491 for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
7492 }
7493 result["default"] = mod;
7494 return result;
7495 };
7496 Object.defineProperty(exports, "__esModule", { value: true });
7497 var fs7 = __importStar(__require("fs"));
7498 var regex = {
7499 section: /^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$/,
7500 param: /^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/,
7501 comment: /^\s*[#;].*$/
7502 };
7503 function parse7(file) {
7504 return __awaiter(this, void 0, void 0, function() {
7505 return __generator(this, function(_a) {
7506 return [2, new Promise(function(resolve3, reject) {
7507 fs7.readFile(file, "utf8", function(err, data) {
7508 if (err) {
7509 reject(err);
7510 return;
7511 }
7512 resolve3(parseString2(data));
7513 });
7514 })];
7515 });
7516 });
7517 }
7518 exports.parse = parse7;
7519 function parseSync(file) {
7520 return parseString2(fs7.readFileSync(file, "utf8"));
7521 }
7522 exports.parseSync = parseSync;
7523 function parseString2(data) {
7524 var sectionBody = {};
7525 var sectionName = null;
7526 var value = [[sectionName, sectionBody]];
7527 var lines = data.split(/\r\n|\r|\n/);
7528 lines.forEach(function(line3) {
7529 var match;
7530 if (regex.comment.test(line3)) {
7531 return;
7532 }
7533 if (regex.param.test(line3)) {
7534 match = line3.match(regex.param);
7535 sectionBody[match[1]] = match[2];
7536 } else if (regex.section.test(line3)) {
7537 match = line3.match(regex.section);
7538 sectionName = match[1];
7539 sectionBody = {};
7540 value.push([sectionName, sectionBody]);
7541 }
7542 });
7543 return value;
7544 }
7545 exports.parseString = parseString2;
7546 }
7547});
7548
7549// node_modules/editorconfig/package.json
7550var require_package = __commonJS({
7551 "node_modules/editorconfig/package.json"(exports, module) {
7552 module.exports = {
7553 name: "editorconfig",
7554 version: "0.15.3",
7555 description: "EditorConfig File Locator and Interpreter for Node.js",
7556 keywords: [
7557 "editorconfig",
7558 "core"
7559 ],
7560 main: "src/index.js",
7561 contributors: [
7562 "Hong Xu (topbug.net)",
7563 "Jed Mao (https://github.com/jedmao/)",
7564 "Trey Hunner (http://treyhunner.com)"
7565 ],
7566 directories: {
7567 bin: "./bin",
7568 lib: "./lib"
7569 },
7570 scripts: {
7571 clean: "rimraf dist",
7572 prebuild: "npm run clean",
7573 build: "tsc",
7574 pretest: "npm run lint && npm run build && npm run copy && cmake .",
7575 test: "ctest .",
7576 "pretest:ci": "npm run pretest",
7577 "test:ci": "ctest -VV --output-on-failure .",
7578 lint: "npm run eclint && npm run tslint",
7579 eclint: 'eclint check --indent_size ignore "src/**"',
7580 tslint: "tslint --project tsconfig.json --exclude package.json",
7581 copy: "cpy .npmignore LICENSE README.md CHANGELOG.md dist && cpy bin/* dist/bin && cpy src/lib/fnmatch*.* dist/src/lib",
7582 prepub: "npm run lint && npm run build && npm run copy",
7583 pub: "npm publish ./dist"
7584 },
7585 repository: {
7586 type: "git",
7587 url: "git://github.com/editorconfig/editorconfig-core-js.git"
7588 },
7589 bugs: "https://github.com/editorconfig/editorconfig-core-js/issues",
7590 author: "EditorConfig Team",
7591 license: "MIT",
7592 dependencies: {
7593 commander: "^2.19.0",
7594 "lru-cache": "^4.1.5",
7595 semver: "^5.6.0",
7596 sigmund: "^1.0.1"
7597 },
7598 devDependencies: {
7599 "@types/mocha": "^5.2.6",
7600 "@types/node": "^10.12.29",
7601 "@types/semver": "^5.5.0",
7602 "cpy-cli": "^2.0.0",
7603 eclint: "^2.8.1",
7604 mocha: "^5.2.0",
7605 rimraf: "^2.6.3",
7606 should: "^13.2.3",
7607 tslint: "^5.13.1",
7608 typescript: "^3.3.3333"
7609 }
7610 };
7611 }
7612});
7613
7614// node_modules/editorconfig/src/index.js
7615var require_src = __commonJS({
7616 "node_modules/editorconfig/src/index.js"(exports) {
7617 "use strict";
7618 var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
7619 return new (P || (P = Promise))(function(resolve3, reject) {
7620 function fulfilled(value) {
7621 try {
7622 step(generator.next(value));
7623 } catch (e) {
7624 reject(e);
7625 }
7626 }
7627 function rejected(value) {
7628 try {
7629 step(generator["throw"](value));
7630 } catch (e) {
7631 reject(e);
7632 }
7633 }
7634 function step(result) {
7635 result.done ? resolve3(result.value) : new P(function(resolve4) {
7636 resolve4(result.value);
7637 }).then(fulfilled, rejected);
7638 }
7639 step((generator = generator.apply(thisArg, _arguments || [])).next());
7640 });
7641 };
7642 var __generator = exports && exports.__generator || function(thisArg, body) {
7643 var _ = { label: 0, sent: function() {
7644 if (t[0] & 1) throw t[1];
7645 return t[1];
7646 }, trys: [], ops: [] }, f, y, t, g;
7647 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
7648 return this;
7649 }), g;
7650 function verb(n) {
7651 return function(v) {
7652 return step([n, v]);
7653 };
7654 }
7655 function step(op) {
7656 if (f) throw new TypeError("Generator is already executing.");
7657 while (_) try {
7658 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
7659 if (y = 0, t) op = [op[0] & 2, t.value];
7660 switch (op[0]) {
7661 case 0:
7662 case 1:
7663 t = op;
7664 break;
7665 case 4:
7666 _.label++;
7667 return { value: op[1], done: false };
7668 case 5:
7669 _.label++;
7670 y = op[1];
7671 op = [0];
7672 continue;
7673 case 7:
7674 op = _.ops.pop();
7675 _.trys.pop();
7676 continue;
7677 default:
7678 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
7679 _ = 0;
7680 continue;
7681 }
7682 if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
7683 _.label = op[1];
7684 break;
7685 }
7686 if (op[0] === 6 && _.label < t[1]) {
7687 _.label = t[1];
7688 t = op;
7689 break;
7690 }
7691 if (t && _.label < t[2]) {
7692 _.label = t[2];
7693 _.ops.push(op);
7694 break;
7695 }
7696 if (t[2]) _.ops.pop();
7697 _.trys.pop();
7698 continue;
7699 }
7700 op = body.call(thisArg, _);
7701 } catch (e) {
7702 op = [6, e];
7703 y = 0;
7704 } finally {
7705 f = t = 0;
7706 }
7707 if (op[0] & 5) throw op[1];
7708 return { value: op[0] ? op[1] : void 0, done: true };
7709 }
7710 };
7711 var __importStar = exports && exports.__importStar || function(mod) {
7712 if (mod && mod.__esModule) return mod;
7713 var result = {};
7714 if (mod != null) {
7715 for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
7716 }
7717 result["default"] = mod;
7718 return result;
7719 };
7720 var __importDefault = exports && exports.__importDefault || function(mod) {
7721 return mod && mod.__esModule ? mod : { "default": mod };
7722 };
7723 Object.defineProperty(exports, "__esModule", { value: true });
7724 var fs7 = __importStar(__require("fs"));
7725 var path13 = __importStar(__require("path"));
7726 var semver = {
7727 gte: require_gte()
7728 };
7729 var fnmatch_1 = __importDefault(require_fnmatch());
7730 var ini_1 = require_ini();
7731 exports.parseString = ini_1.parseString;
7732 var package_json_1 = __importDefault(require_package());
7733 var knownProps = {
7734 end_of_line: true,
7735 indent_style: true,
7736 indent_size: true,
7737 insert_final_newline: true,
7738 trim_trailing_whitespace: true,
7739 charset: true
7740 };
7741 function fnmatch(filepath, glob) {
7742 var matchOptions = { matchBase: true, dot: true, noext: true };
7743 glob = glob.replace(/\*\*/g, "{*,**/**/**}");
7744 return fnmatch_1.default(filepath, glob, matchOptions);
7745 }
7746 function getConfigFileNames(filepath, options8) {
7747 var paths = [];
7748 do {
7749 filepath = path13.dirname(filepath);
7750 paths.push(path13.join(filepath, options8.config));
7751 } while (filepath !== options8.root);
7752 return paths;
7753 }
7754 function processMatches(matches, version) {
7755 if ("indent_style" in matches && matches.indent_style === "tab" && !("indent_size" in matches) && semver.gte(version, "0.10.0")) {
7756 matches.indent_size = "tab";
7757 }
7758 if ("indent_size" in matches && !("tab_width" in matches) && matches.indent_size !== "tab") {
7759 matches.tab_width = matches.indent_size;
7760 }
7761 if ("indent_size" in matches && "tab_width" in matches && matches.indent_size === "tab") {
7762 matches.indent_size = matches.tab_width;
7763 }
7764 return matches;
7765 }
7766 function processOptions(options8, filepath) {
7767 if (options8 === void 0) {
7768 options8 = {};
7769 }
7770 return {
7771 config: options8.config || ".editorconfig",
7772 version: options8.version || package_json_1.default.version,
7773 root: path13.resolve(options8.root || path13.parse(filepath).root)
7774 };
7775 }
7776 function buildFullGlob(pathPrefix, glob) {
7777 switch (glob.indexOf("/")) {
7778 case -1:
7779 glob = "**/" + glob;
7780 break;
7781 case 0:
7782 glob = glob.substring(1);
7783 break;
7784 default:
7785 break;
7786 }
7787 return path13.join(pathPrefix, glob);
7788 }
7789 function extendProps(props, options8) {
7790 if (props === void 0) {
7791 props = {};
7792 }
7793 if (options8 === void 0) {
7794 options8 = {};
7795 }
7796 for (var key2 in options8) {
7797 if (options8.hasOwnProperty(key2)) {
7798 var value = options8[key2];
7799 var key22 = key2.toLowerCase();
7800 var value2 = value;
7801 if (knownProps[key22]) {
7802 value2 = value.toLowerCase();
7803 }
7804 try {
7805 value2 = JSON.parse(value);
7806 } catch (e) {
7807 }
7808 if (typeof value === "undefined" || value === null) {
7809 value2 = String(value);
7810 }
7811 props[key22] = value2;
7812 }
7813 }
7814 return props;
7815 }
7816 function parseFromConfigs(configs, filepath, options8) {
7817 return processMatches(configs.reverse().reduce(function(matches, file) {
7818 var pathPrefix = path13.dirname(file.name);
7819 file.contents.forEach(function(section) {
7820 var glob = section[0];
7821 var options22 = section[1];
7822 if (!glob) {
7823 return;
7824 }
7825 var fullGlob = buildFullGlob(pathPrefix, glob);
7826 if (!fnmatch(filepath, fullGlob)) {
7827 return;
7828 }
7829 matches = extendProps(matches, options22);
7830 });
7831 return matches;
7832 }, {}), options8.version);
7833 }
7834 function getConfigsForFiles(files) {
7835 var configs = [];
7836 for (var i in files) {
7837 if (files.hasOwnProperty(i)) {
7838 var file = files[i];
7839 var contents = ini_1.parseString(file.contents);
7840 configs.push({
7841 name: file.name,
7842 contents
7843 });
7844 if ((contents[0][1].root || "").toLowerCase() === "true") {
7845 break;
7846 }
7847 }
7848 }
7849 return configs;
7850 }
7851 function readConfigFiles(filepaths) {
7852 return __awaiter(this, void 0, void 0, function() {
7853 return __generator(this, function(_a) {
7854 return [2, Promise.all(filepaths.map(function(name) {
7855 return new Promise(function(resolve3) {
7856 fs7.readFile(name, "utf8", function(err, data) {
7857 resolve3({
7858 name,
7859 contents: err ? "" : data
7860 });
7861 });
7862 });
7863 }))];
7864 });
7865 });
7866 }
7867 function readConfigFilesSync(filepaths) {
7868 var files = [];
7869 var file;
7870 filepaths.forEach(function(filepath) {
7871 try {
7872 file = fs7.readFileSync(filepath, "utf8");
7873 } catch (e) {
7874 file = "";
7875 }
7876 files.push({
7877 name: filepath,
7878 contents: file
7879 });
7880 });
7881 return files;
7882 }
7883 function opts(filepath, options8) {
7884 if (options8 === void 0) {
7885 options8 = {};
7886 }
7887 var resolvedFilePath = path13.resolve(filepath);
7888 return [
7889 resolvedFilePath,
7890 processOptions(options8, resolvedFilePath)
7891 ];
7892 }
7893 function parseFromFiles(filepath, files, options8) {
7894 if (options8 === void 0) {
7895 options8 = {};
7896 }
7897 return __awaiter(this, void 0, void 0, function() {
7898 var _a, resolvedFilePath, processedOptions;
7899 return __generator(this, function(_b) {
7900 _a = opts(filepath, options8), resolvedFilePath = _a[0], processedOptions = _a[1];
7901 return [2, files.then(getConfigsForFiles).then(function(configs) {
7902 return parseFromConfigs(configs, resolvedFilePath, processedOptions);
7903 })];
7904 });
7905 });
7906 }
7907 exports.parseFromFiles = parseFromFiles;
7908 function parseFromFilesSync(filepath, files, options8) {
7909 if (options8 === void 0) {
7910 options8 = {};
7911 }
7912 var _a = opts(filepath, options8), resolvedFilePath = _a[0], processedOptions = _a[1];
7913 return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions);
7914 }
7915 exports.parseFromFilesSync = parseFromFilesSync;
7916 function parse7(_filepath, _options) {
7917 if (_options === void 0) {
7918 _options = {};
7919 }
7920 return __awaiter(this, void 0, void 0, function() {
7921 var _a, resolvedFilePath, processedOptions, filepaths;
7922 return __generator(this, function(_b) {
7923 _a = opts(_filepath, _options), resolvedFilePath = _a[0], processedOptions = _a[1];
7924 filepaths = getConfigFileNames(resolvedFilePath, processedOptions);
7925 return [2, readConfigFiles(filepaths).then(getConfigsForFiles).then(function(configs) {
7926 return parseFromConfigs(configs, resolvedFilePath, processedOptions);
7927 })];
7928 });
7929 });
7930 }
7931 exports.parse = parse7;
7932 function parseSync(_filepath, _options) {
7933 if (_options === void 0) {
7934 _options = {};
7935 }
7936 var _a = opts(_filepath, _options), resolvedFilePath = _a[0], processedOptions = _a[1];
7937 var filepaths = getConfigFileNames(resolvedFilePath, processedOptions);
7938 var files = readConfigFilesSync(filepaths);
7939 return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions);
7940 }
7941 exports.parseSync = parseSync;
7942 }
7943});
7944
7945// node_modules/ci-info/vendors.json
7946var require_vendors = __commonJS({
7947 "node_modules/ci-info/vendors.json"(exports, module) {
7948 module.exports = [
7949 {
7950 name: "Agola CI",
7951 constant: "AGOLA",
7952 env: "AGOLA_GIT_REF",
7953 pr: "AGOLA_PULL_REQUEST_ID"
7954 },
7955 {
7956 name: "Appcircle",
7957 constant: "APPCIRCLE",
7958 env: "AC_APPCIRCLE",
7959 pr: {
7960 env: "AC_GIT_PR",
7961 ne: "false"
7962 }
7963 },
7964 {
7965 name: "AppVeyor",
7966 constant: "APPVEYOR",
7967 env: "APPVEYOR",
7968 pr: "APPVEYOR_PULL_REQUEST_NUMBER"
7969 },
7970 {
7971 name: "AWS CodeBuild",
7972 constant: "CODEBUILD",
7973 env: "CODEBUILD_BUILD_ARN",
7974 pr: {
7975 env: "CODEBUILD_WEBHOOK_EVENT",
7976 any: [
7977 "PULL_REQUEST_CREATED",
7978 "PULL_REQUEST_UPDATED",
7979 "PULL_REQUEST_REOPENED"
7980 ]
7981 }
7982 },
7983 {
7984 name: "Azure Pipelines",
7985 constant: "AZURE_PIPELINES",
7986 env: "TF_BUILD",
7987 pr: {
7988 BUILD_REASON: "PullRequest"
7989 }
7990 },
7991 {
7992 name: "Bamboo",
7993 constant: "BAMBOO",
7994 env: "bamboo_planKey"
7995 },
7996 {
7997 name: "Bitbucket Pipelines",
7998 constant: "BITBUCKET",
7999 env: "BITBUCKET_COMMIT",
8000 pr: "BITBUCKET_PR_ID"
8001 },
8002 {
8003 name: "Bitrise",
8004 constant: "BITRISE",
8005 env: "BITRISE_IO",
8006 pr: "BITRISE_PULL_REQUEST"
8007 },
8008 {
8009 name: "Buddy",
8010 constant: "BUDDY",
8011 env: "BUDDY_WORKSPACE_ID",
8012 pr: "BUDDY_EXECUTION_PULL_REQUEST_ID"
8013 },
8014 {
8015 name: "Buildkite",
8016 constant: "BUILDKITE",
8017 env: "BUILDKITE",
8018 pr: {
8019 env: "BUILDKITE_PULL_REQUEST",
8020 ne: "false"
8021 }
8022 },
8023 {
8024 name: "CircleCI",
8025 constant: "CIRCLE",
8026 env: "CIRCLECI",
8027 pr: "CIRCLE_PULL_REQUEST"
8028 },
8029 {
8030 name: "Cirrus CI",
8031 constant: "CIRRUS",
8032 env: "CIRRUS_CI",
8033 pr: "CIRRUS_PR"
8034 },
8035 {
8036 name: "Codefresh",
8037 constant: "CODEFRESH",
8038 env: "CF_BUILD_ID",
8039 pr: {
8040 any: [
8041 "CF_PULL_REQUEST_NUMBER",
8042 "CF_PULL_REQUEST_ID"
8043 ]
8044 }
8045 },
8046 {
8047 name: "Codemagic",
8048 constant: "CODEMAGIC",
8049 env: "CM_BUILD_ID",
8050 pr: "CM_PULL_REQUEST"
8051 },
8052 {
8053 name: "Codeship",
8054 constant: "CODESHIP",
8055 env: {
8056 CI_NAME: "codeship"
8057 }
8058 },
8059 {
8060 name: "Drone",
8061 constant: "DRONE",
8062 env: "DRONE",
8063 pr: {
8064 DRONE_BUILD_EVENT: "pull_request"
8065 }
8066 },
8067 {
8068 name: "dsari",
8069 constant: "DSARI",
8070 env: "DSARI"
8071 },
8072 {
8073 name: "Earthly",
8074 constant: "EARTHLY",
8075 env: "EARTHLY_CI"
8076 },
8077 {
8078 name: "Expo Application Services",
8079 constant: "EAS",
8080 env: "EAS_BUILD"
8081 },
8082 {
8083 name: "Gerrit",
8084 constant: "GERRIT",
8085 env: "GERRIT_PROJECT"
8086 },
8087 {
8088 name: "Gitea Actions",
8089 constant: "GITEA_ACTIONS",
8090 env: "GITEA_ACTIONS"
8091 },
8092 {
8093 name: "GitHub Actions",
8094 constant: "GITHUB_ACTIONS",
8095 env: "GITHUB_ACTIONS",
8096 pr: {
8097 GITHUB_EVENT_NAME: "pull_request"
8098 }
8099 },
8100 {
8101 name: "GitLab CI",
8102 constant: "GITLAB",
8103 env: "GITLAB_CI",
8104 pr: "CI_MERGE_REQUEST_ID"
8105 },
8106 {
8107 name: "GoCD",
8108 constant: "GOCD",
8109 env: "GO_PIPELINE_LABEL"
8110 },
8111 {
8112 name: "Google Cloud Build",
8113 constant: "GOOGLE_CLOUD_BUILD",
8114 env: "BUILDER_OUTPUT"
8115 },
8116 {
8117 name: "Harness CI",
8118 constant: "HARNESS",
8119 env: "HARNESS_BUILD_ID"
8120 },
8121 {
8122 name: "Heroku",
8123 constant: "HEROKU",
8124 env: {
8125 env: "NODE",
8126 includes: "/app/.heroku/node/bin/node"
8127 }
8128 },
8129 {
8130 name: "Hudson",
8131 constant: "HUDSON",
8132 env: "HUDSON_URL"
8133 },
8134 {
8135 name: "Jenkins",
8136 constant: "JENKINS",
8137 env: [
8138 "JENKINS_URL",
8139 "BUILD_ID"
8140 ],
8141 pr: {
8142 any: [
8143 "ghprbPullId",
8144 "CHANGE_ID"
8145 ]
8146 }
8147 },
8148 {
8149 name: "LayerCI",
8150 constant: "LAYERCI",
8151 env: "LAYERCI",
8152 pr: "LAYERCI_PULL_REQUEST"
8153 },
8154 {
8155 name: "Magnum CI",
8156 constant: "MAGNUM",
8157 env: "MAGNUM"
8158 },
8159 {
8160 name: "Netlify CI",
8161 constant: "NETLIFY",
8162 env: "NETLIFY",
8163 pr: {
8164 env: "PULL_REQUEST",
8165 ne: "false"
8166 }
8167 },
8168 {
8169 name: "Nevercode",
8170 constant: "NEVERCODE",
8171 env: "NEVERCODE",
8172 pr: {
8173 env: "NEVERCODE_PULL_REQUEST",
8174 ne: "false"
8175 }
8176 },
8177 {
8178 name: "Prow",
8179 constant: "PROW",
8180 env: "PROW_JOB_ID"
8181 },
8182 {
8183 name: "ReleaseHub",
8184 constant: "RELEASEHUB",
8185 env: "RELEASE_BUILD_ID"
8186 },
8187 {
8188 name: "Render",
8189 constant: "RENDER",
8190 env: "RENDER",
8191 pr: {
8192 IS_PULL_REQUEST: "true"
8193 }
8194 },
8195 {
8196 name: "Sail CI",
8197 constant: "SAIL",
8198 env: "SAILCI",
8199 pr: "SAIL_PULL_REQUEST_NUMBER"
8200 },
8201 {
8202 name: "Screwdriver",
8203 constant: "SCREWDRIVER",
8204 env: "SCREWDRIVER",
8205 pr: {
8206 env: "SD_PULL_REQUEST",
8207 ne: "false"
8208 }
8209 },
8210 {
8211 name: "Semaphore",
8212 constant: "SEMAPHORE",
8213 env: "SEMAPHORE",
8214 pr: "PULL_REQUEST_NUMBER"
8215 },
8216 {
8217 name: "Sourcehut",
8218 constant: "SOURCEHUT",
8219 env: {
8220 CI_NAME: "sourcehut"
8221 }
8222 },
8223 {
8224 name: "Strider CD",
8225 constant: "STRIDER",
8226 env: "STRIDER"
8227 },
8228 {
8229 name: "TaskCluster",
8230 constant: "TASKCLUSTER",
8231 env: [
8232 "TASK_ID",
8233 "RUN_ID"
8234 ]
8235 },
8236 {
8237 name: "TeamCity",
8238 constant: "TEAMCITY",
8239 env: "TEAMCITY_VERSION"
8240 },
8241 {
8242 name: "Travis CI",
8243 constant: "TRAVIS",
8244 env: "TRAVIS",
8245 pr: {
8246 env: "TRAVIS_PULL_REQUEST",
8247 ne: "false"
8248 }
8249 },
8250 {
8251 name: "Vela",
8252 constant: "VELA",
8253 env: "VELA",
8254 pr: {
8255 VELA_PULL_REQUEST: "1"
8256 }
8257 },
8258 {
8259 name: "Vercel",
8260 constant: "VERCEL",
8261 env: {
8262 any: [
8263 "NOW_BUILDER",
8264 "VERCEL"
8265 ]
8266 },
8267 pr: "VERCEL_GIT_PULL_REQUEST_ID"
8268 },
8269 {
8270 name: "Visual Studio App Center",
8271 constant: "APPCENTER",
8272 env: "APPCENTER_BUILD_ID"
8273 },
8274 {
8275 name: "Woodpecker",
8276 constant: "WOODPECKER",
8277 env: {
8278 CI: "woodpecker"
8279 },
8280 pr: {
8281 CI_BUILD_EVENT: "pull_request"
8282 }
8283 },
8284 {
8285 name: "Xcode Cloud",
8286 constant: "XCODE_CLOUD",
8287 env: "CI_XCODE_PROJECT",
8288 pr: "CI_PULL_REQUEST_NUMBER"
8289 },
8290 {
8291 name: "Xcode Server",
8292 constant: "XCODE_SERVER",
8293 env: "XCS"
8294 }
8295 ];
8296 }
8297});
8298
8299// node_modules/ci-info/index.js
8300var require_ci_info = __commonJS({
8301 "node_modules/ci-info/index.js"(exports) {
8302 "use strict";
8303 var vendors = require_vendors();
8304 var env2 = process.env;
8305 Object.defineProperty(exports, "_vendors", {
8306 value: vendors.map(function(v) {
8307 return v.constant;
8308 })
8309 });
8310 exports.name = null;
8311 exports.isPR = null;
8312 exports.id = null;
8313 vendors.forEach(function(vendor) {
8314 const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];
8315 const isCI2 = envs.every(function(obj) {
8316 return checkEnv(obj);
8317 });
8318 exports[vendor.constant] = isCI2;
8319 if (!isCI2) {
8320 return;
8321 }
8322 exports.name = vendor.name;
8323 exports.isPR = checkPR(vendor);
8324 exports.id = vendor.constant;
8325 });
8326 exports.isCI = !!(env2.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
8327 (env2.BUILD_ID || // Jenkins, Cloudbees
8328 env2.BUILD_NUMBER || // Jenkins, TeamCity
8329 env2.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari
8330 env2.CI_APP_ID || // Appflow
8331 env2.CI_BUILD_ID || // Appflow
8332 env2.CI_BUILD_NUMBER || // Appflow
8333 env2.CI_NAME || // Codeship and others
8334 env2.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
8335 env2.RUN_ID || // TaskCluster, dsari
8336 exports.name || false));
8337 function checkEnv(obj) {
8338 if (typeof obj === "string") return !!env2[obj];
8339 if ("env" in obj) {
8340 return env2[obj.env] && env2[obj.env].includes(obj.includes);
8341 }
8342 if ("any" in obj) {
8343 return obj.any.some(function(k) {
8344 return !!env2[k];
8345 });
8346 }
8347 return Object.keys(obj).every(function(k) {
8348 return env2[k] === obj[k];
8349 });
8350 }
8351 function checkPR(vendor) {
8352 switch (typeof vendor.pr) {
8353 case "string":
8354 return !!env2[vendor.pr];
8355 case "object":
8356 if ("env" in vendor.pr) {
8357 if ("any" in vendor.pr) {
8358 return vendor.pr.any.some(function(key2) {
8359 return env2[vendor.pr.env] === key2;
8360 });
8361 } else {
8362 return vendor.pr.env in env2 && env2[vendor.pr.env] !== vendor.pr.ne;
8363 }
8364 } else if ("any" in vendor.pr) {
8365 return vendor.pr.any.some(function(key2) {
8366 return !!env2[key2];
8367 });
8368 } else {
8369 return checkEnv(vendor.pr);
8370 }
8371 default:
8372 return null;
8373 }
8374 }
8375 }
8376});
8377
8378// node_modules/picocolors/picocolors.js
8379var require_picocolors = __commonJS({
8380 "node_modules/picocolors/picocolors.js"(exports, module) {
8381 var p = process || {};
8382 var argv = p.argv || [];
8383 var env2 = p.env || {};
8384 var isColorSupported = !(!!env2.NO_COLOR || argv.includes("--no-color")) && (!!env2.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env2.TERM !== "dumb" || !!env2.CI);
8385 var formatter = (open, close, replace = open) => (input) => {
8386 let string = "" + input, index = string.indexOf(close, open.length);
8387 return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
8388 };
8389 var replaceClose = (string, close, replace, index) => {
8390 let result = "", cursor2 = 0;
8391 do {
8392 result += string.substring(cursor2, index) + replace;
8393 cursor2 = index + close.length;
8394 index = string.indexOf(close, cursor2);
8395 } while (~index);
8396 return result + string.substring(cursor2);
8397 };
8398 var createColors = (enabled = isColorSupported) => {
8399 let f = enabled ? formatter : () => String;
8400 return {
8401 isColorSupported: enabled,
8402 reset: f("\x1B[0m", "\x1B[0m"),
8403 bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
8404 dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
8405 italic: f("\x1B[3m", "\x1B[23m"),
8406 underline: f("\x1B[4m", "\x1B[24m"),
8407 inverse: f("\x1B[7m", "\x1B[27m"),
8408 hidden: f("\x1B[8m", "\x1B[28m"),
8409 strikethrough: f("\x1B[9m", "\x1B[29m"),
8410 black: f("\x1B[30m", "\x1B[39m"),
8411 red: f("\x1B[31m", "\x1B[39m"),
8412 green: f("\x1B[32m", "\x1B[39m"),
8413 yellow: f("\x1B[33m", "\x1B[39m"),
8414 blue: f("\x1B[34m", "\x1B[39m"),
8415 magenta: f("\x1B[35m", "\x1B[39m"),
8416 cyan: f("\x1B[36m", "\x1B[39m"),
8417 white: f("\x1B[37m", "\x1B[39m"),
8418 gray: f("\x1B[90m", "\x1B[39m"),
8419 bgBlack: f("\x1B[40m", "\x1B[49m"),
8420 bgRed: f("\x1B[41m", "\x1B[49m"),
8421 bgGreen: f("\x1B[42m", "\x1B[49m"),
8422 bgYellow: f("\x1B[43m", "\x1B[49m"),
8423 bgBlue: f("\x1B[44m", "\x1B[49m"),
8424 bgMagenta: f("\x1B[45m", "\x1B[49m"),
8425 bgCyan: f("\x1B[46m", "\x1B[49m"),
8426 bgWhite: f("\x1B[47m", "\x1B[49m"),
8427 blackBright: f("\x1B[90m", "\x1B[39m"),
8428 redBright: f("\x1B[91m", "\x1B[39m"),
8429 greenBright: f("\x1B[92m", "\x1B[39m"),
8430 yellowBright: f("\x1B[93m", "\x1B[39m"),
8431 blueBright: f("\x1B[94m", "\x1B[39m"),
8432 magentaBright: f("\x1B[95m", "\x1B[39m"),
8433 cyanBright: f("\x1B[96m", "\x1B[39m"),
8434 whiteBright: f("\x1B[97m", "\x1B[39m"),
8435 bgBlackBright: f("\x1B[100m", "\x1B[49m"),
8436 bgRedBright: f("\x1B[101m", "\x1B[49m"),
8437 bgGreenBright: f("\x1B[102m", "\x1B[49m"),
8438 bgYellowBright: f("\x1B[103m", "\x1B[49m"),
8439 bgBlueBright: f("\x1B[104m", "\x1B[49m"),
8440 bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
8441 bgCyanBright: f("\x1B[106m", "\x1B[49m"),
8442 bgWhiteBright: f("\x1B[107m", "\x1B[49m")
8443 };
8444 };
8445 module.exports = createColors();
8446 module.exports.createColors = createColors;
8447 }
8448});
8449
8450// node_modules/js-tokens/index.js
8451var require_js_tokens = __commonJS({
8452 "node_modules/js-tokens/index.js"(exports) {
8453 Object.defineProperty(exports, "__esModule", {
8454 value: true
8455 });
8456 exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;
8457 exports.matchToToken = function(match) {
8458 var token2 = { type: "invalid", value: match[0], closed: void 0 };
8459 if (match[1]) token2.type = "string", token2.closed = !!(match[3] || match[4]);
8460 else if (match[5]) token2.type = "comment";
8461 else if (match[6]) token2.type = "comment", token2.closed = !!match[7];
8462 else if (match[8]) token2.type = "regex";
8463 else if (match[9]) token2.type = "number";
8464 else if (match[10]) token2.type = "name";
8465 else if (match[11]) token2.type = "punctuator";
8466 else if (match[12]) token2.type = "whitespace";
8467 return token2;
8468 };
8469 }
8470});
8471
8472// node_modules/@babel/helper-validator-identifier/lib/identifier.js
8473var require_identifier = __commonJS({
8474 "node_modules/@babel/helper-validator-identifier/lib/identifier.js"(exports) {
8475 "use strict";
8476 Object.defineProperty(exports, "__esModule", {
8477 value: true
8478 });
8479 exports.isIdentifierChar = isIdentifierChar;
8480 exports.isIdentifierName = isIdentifierName;
8481 exports.isIdentifierStart = isIdentifierStart;
8482 var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
8483 var nonASCIIidentifierChars = "\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65";
8484 var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
8485 var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
8486 nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
8487 var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
8488 var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
8489 function isInAstralSet(code, set2) {
8490 let pos2 = 65536;
8491 for (let i = 0, length = set2.length; i < length; i += 2) {
8492 pos2 += set2[i];
8493 if (pos2 > code) return false;
8494 pos2 += set2[i + 1];
8495 if (pos2 >= code) return true;
8496 }
8497 return false;
8498 }
8499 function isIdentifierStart(code) {
8500 if (code < 65) return code === 36;
8501 if (code <= 90) return true;
8502 if (code < 97) return code === 95;
8503 if (code <= 122) return true;
8504 if (code <= 65535) {
8505 return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code));
8506 }
8507 return isInAstralSet(code, astralIdentifierStartCodes);
8508 }
8509 function isIdentifierChar(code) {
8510 if (code < 48) return code === 36;
8511 if (code < 58) return true;
8512 if (code < 65) return false;
8513 if (code <= 90) return true;
8514 if (code < 97) return code === 95;
8515 if (code <= 122) return true;
8516 if (code <= 65535) {
8517 return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code));
8518 }
8519 return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
8520 }
8521 function isIdentifierName(name) {
8522 let isFirst = true;
8523 for (let i = 0; i < name.length; i++) {
8524 let cp = name.charCodeAt(i);
8525 if ((cp & 64512) === 55296 && i + 1 < name.length) {
8526 const trail = name.charCodeAt(++i);
8527 if ((trail & 64512) === 56320) {
8528 cp = 65536 + ((cp & 1023) << 10) + (trail & 1023);
8529 }
8530 }
8531 if (isFirst) {
8532 isFirst = false;
8533 if (!isIdentifierStart(cp)) {
8534 return false;
8535 }
8536 } else if (!isIdentifierChar(cp)) {
8537 return false;
8538 }
8539 }
8540 return !isFirst;
8541 }
8542 }
8543});
8544
8545// node_modules/@babel/helper-validator-identifier/lib/keyword.js
8546var require_keyword = __commonJS({
8547 "node_modules/@babel/helper-validator-identifier/lib/keyword.js"(exports) {
8548 "use strict";
8549 Object.defineProperty(exports, "__esModule", {
8550 value: true
8551 });
8552 exports.isKeyword = isKeyword;
8553 exports.isReservedWord = isReservedWord;
8554 exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
8555 exports.isStrictBindReservedWord = isStrictBindReservedWord;
8556 exports.isStrictReservedWord = isStrictReservedWord;
8557 var reservedWords = {
8558 keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
8559 strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
8560 strictBind: ["eval", "arguments"]
8561 };
8562 var keywords = new Set(reservedWords.keyword);
8563 var reservedWordsStrictSet = new Set(reservedWords.strict);
8564 var reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
8565 function isReservedWord(word, inModule) {
8566 return inModule && word === "await" || word === "enum";
8567 }
8568 function isStrictReservedWord(word, inModule) {
8569 return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
8570 }
8571 function isStrictBindOnlyReservedWord(word) {
8572 return reservedWordsStrictBindSet.has(word);
8573 }
8574 function isStrictBindReservedWord(word, inModule) {
8575 return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
8576 }
8577 function isKeyword(word) {
8578 return keywords.has(word);
8579 }
8580 }
8581});
8582
8583// node_modules/@babel/helper-validator-identifier/lib/index.js
8584var require_lib = __commonJS({
8585 "node_modules/@babel/helper-validator-identifier/lib/index.js"(exports) {
8586 "use strict";
8587 Object.defineProperty(exports, "__esModule", {
8588 value: true
8589 });
8590 Object.defineProperty(exports, "isIdentifierChar", {
8591 enumerable: true,
8592 get: function() {
8593 return _identifier.isIdentifierChar;
8594 }
8595 });
8596 Object.defineProperty(exports, "isIdentifierName", {
8597 enumerable: true,
8598 get: function() {
8599 return _identifier.isIdentifierName;
8600 }
8601 });
8602 Object.defineProperty(exports, "isIdentifierStart", {
8603 enumerable: true,
8604 get: function() {
8605 return _identifier.isIdentifierStart;
8606 }
8607 });
8608 Object.defineProperty(exports, "isKeyword", {
8609 enumerable: true,
8610 get: function() {
8611 return _keyword.isKeyword;
8612 }
8613 });
8614 Object.defineProperty(exports, "isReservedWord", {
8615 enumerable: true,
8616 get: function() {
8617 return _keyword.isReservedWord;
8618 }
8619 });
8620 Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
8621 enumerable: true,
8622 get: function() {
8623 return _keyword.isStrictBindOnlyReservedWord;
8624 }
8625 });
8626 Object.defineProperty(exports, "isStrictBindReservedWord", {
8627 enumerable: true,
8628 get: function() {
8629 return _keyword.isStrictBindReservedWord;
8630 }
8631 });
8632 Object.defineProperty(exports, "isStrictReservedWord", {
8633 enumerable: true,
8634 get: function() {
8635 return _keyword.isStrictReservedWord;
8636 }
8637 });
8638 var _identifier = require_identifier();
8639 var _keyword = require_keyword();
8640 }
8641});
8642
8643// node_modules/@babel/code-frame/lib/index.js
8644var require_lib2 = __commonJS({
8645 "node_modules/@babel/code-frame/lib/index.js"(exports) {
8646 "use strict";
8647 Object.defineProperty(exports, "__esModule", { value: true });
8648 var picocolors = require_picocolors();
8649 var jsTokens = require_js_tokens();
8650 var helperValidatorIdentifier = require_lib();
8651 function isColorSupported() {
8652 return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported;
8653 }
8654 var compose = (f, g) => (v) => f(g(v));
8655 function buildDefs(colors) {
8656 return {
8657 keyword: colors.cyan,
8658 capitalized: colors.yellow,
8659 jsxIdentifier: colors.yellow,
8660 punctuator: colors.yellow,
8661 number: colors.magenta,
8662 string: colors.green,
8663 regex: colors.magenta,
8664 comment: colors.gray,
8665 invalid: compose(compose(colors.white, colors.bgRed), colors.bold),
8666 gutter: colors.gray,
8667 marker: compose(colors.red, colors.bold),
8668 message: compose(colors.red, colors.bold),
8669 reset: colors.reset
8670 };
8671 }
8672 var defsOn = buildDefs(picocolors.createColors(true));
8673 var defsOff = buildDefs(picocolors.createColors(false));
8674 function getDefs(enabled) {
8675 return enabled ? defsOn : defsOff;
8676 }
8677 var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
8678 var NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
8679 var BRACKET = /^[()[\]{}]$/;
8680 var tokenize2;
8681 {
8682 const JSX_TAG = /^[a-z][\w-]*$/i;
8683 const getTokenType = function(token2, offset, text) {
8684 if (token2.type === "name") {
8685 if (helperValidatorIdentifier.isKeyword(token2.value) || helperValidatorIdentifier.isStrictReservedWord(token2.value, true) || sometimesKeywords.has(token2.value)) {
8686 return "keyword";
8687 }
8688 if (JSX_TAG.test(token2.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === "</")) {
8689 return "jsxIdentifier";
8690 }
8691 if (token2.value[0] !== token2.value[0].toLowerCase()) {
8692 return "capitalized";
8693 }
8694 }
8695 if (token2.type === "punctuator" && BRACKET.test(token2.value)) {
8696 return "bracket";
8697 }
8698 if (token2.type === "invalid" && (token2.value === "@" || token2.value === "#")) {
8699 return "punctuator";
8700 }
8701 return token2.type;
8702 };
8703 tokenize2 = function* (text) {
8704 let match;
8705 while (match = jsTokens.default.exec(text)) {
8706 const token2 = jsTokens.matchToToken(match);
8707 yield {
8708 type: getTokenType(token2, match.index, text),
8709 value: token2.value
8710 };
8711 }
8712 };
8713 }
8714 function highlight(text) {
8715 if (text === "") return "";
8716 const defs = getDefs(true);
8717 let highlighted = "";
8718 for (const {
8719 type: type2,
8720 value
8721 } of tokenize2(text)) {
8722 if (type2 in defs) {
8723 highlighted += value.split(NEWLINE$1).map((str2) => defs[type2](str2)).join("\n");
8724 } else {
8725 highlighted += value;
8726 }
8727 }
8728 return highlighted;
8729 }
8730 var deprecationWarningShown = false;
8731 var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
8732 function getMarkerLines(loc, source2, opts) {
8733 const startLoc = Object.assign({
8734 column: 0,
8735 line: -1
8736 }, loc.start);
8737 const endLoc = Object.assign({}, startLoc, loc.end);
8738 const {
8739 linesAbove = 2,
8740 linesBelow = 3
8741 } = opts || {};
8742 const startLine = startLoc.line;
8743 const startColumn = startLoc.column;
8744 const endLine = endLoc.line;
8745 const endColumn = endLoc.column;
8746 let start = Math.max(startLine - (linesAbove + 1), 0);
8747 let end = Math.min(source2.length, endLine + linesBelow);
8748 if (startLine === -1) {
8749 start = 0;
8750 }
8751 if (endLine === -1) {
8752 end = source2.length;
8753 }
8754 const lineDiff2 = endLine - startLine;
8755 const markerLines = {};
8756 if (lineDiff2) {
8757 for (let i = 0; i <= lineDiff2; i++) {
8758 const lineNumber = i + startLine;
8759 if (!startColumn) {
8760 markerLines[lineNumber] = true;
8761 } else if (i === 0) {
8762 const sourceLength = source2[lineNumber - 1].length;
8763 markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
8764 } else if (i === lineDiff2) {
8765 markerLines[lineNumber] = [0, endColumn];
8766 } else {
8767 const sourceLength = source2[lineNumber - i].length;
8768 markerLines[lineNumber] = [0, sourceLength];
8769 }
8770 }
8771 } else {
8772 if (startColumn === endColumn) {
8773 if (startColumn) {
8774 markerLines[startLine] = [startColumn, 0];
8775 } else {
8776 markerLines[startLine] = true;
8777 }
8778 } else {
8779 markerLines[startLine] = [startColumn, endColumn - startColumn];
8780 }
8781 }
8782 return {
8783 start,
8784 end,
8785 markerLines
8786 };
8787 }
8788 function codeFrameColumns3(rawLines, loc, opts = {}) {
8789 const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;
8790 const defs = getDefs(shouldHighlight);
8791 const lines = rawLines.split(NEWLINE);
8792 const {
8793 start,
8794 end,
8795 markerLines
8796 } = getMarkerLines(loc, lines, opts);
8797 const hasColumns = loc.start && typeof loc.start.column === "number";
8798 const numberMaxWidth = String(end).length;
8799 const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;
8800 let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line3, index2) => {
8801 const number = start + 1 + index2;
8802 const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
8803 const gutter = ` ${paddedNumber} |`;
8804 const hasMarker = markerLines[number];
8805 const lastMarkerLine = !markerLines[number + 1];
8806 if (hasMarker) {
8807 let markerLine = "";
8808 if (Array.isArray(hasMarker)) {
8809 const markerSpacing = line3.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
8810 const numberOfMarkers = hasMarker[1] || 1;
8811 markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join("");
8812 if (lastMarkerLine && opts.message) {
8813 markerLine += " " + defs.message(opts.message);
8814 }
8815 }
8816 return [defs.marker(">"), defs.gutter(gutter), line3.length > 0 ? ` ${line3}` : "", markerLine].join("");
8817 } else {
8818 return ` ${defs.gutter(gutter)}${line3.length > 0 ? ` ${line3}` : ""}`;
8819 }
8820 }).join("\n");
8821 if (opts.message && !hasColumns) {
8822 frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}
8823${frame}`;
8824 }
8825 if (shouldHighlight) {
8826 return defs.reset(frame);
8827 } else {
8828 return frame;
8829 }
8830 }
8831 function index(rawLines, lineNumber, colNumber, opts = {}) {
8832 if (!deprecationWarningShown) {
8833 deprecationWarningShown = true;
8834 const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
8835 if (process.emitWarning) {
8836 process.emitWarning(message, "DeprecationWarning");
8837 } else {
8838 const deprecationError = new Error(message);
8839 deprecationError.name = "DeprecationWarning";
8840 console.warn(new Error(message));
8841 }
8842 }
8843 colNumber = Math.max(colNumber, 0);
8844 const location = {
8845 start: {
8846 column: colNumber,
8847 line: lineNumber
8848 }
8849 };
8850 return codeFrameColumns3(rawLines, location, opts);
8851 }
8852 exports.codeFrameColumns = codeFrameColumns3;
8853 exports.default = index;
8854 exports.highlight = highlight;
8855 }
8856});
8857
8858// node_modules/ignore/index.js
8859var require_ignore = __commonJS({
8860 "node_modules/ignore/index.js"(exports, module) {
8861 function makeArray(subject) {
8862 return Array.isArray(subject) ? subject : [subject];
8863 }
8864 var EMPTY = "";
8865 var SPACE = " ";
8866 var ESCAPE = "\\";
8867 var REGEX_TEST_BLANK_LINE = /^\s+$/;
8868 var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
8869 var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
8870 var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
8871 var REGEX_SPLITALL_CRLF = /\r?\n/g;
8872 var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/;
8873 var SLASH = "/";
8874 var TMP_KEY_IGNORE = "node-ignore";
8875 if (typeof Symbol !== "undefined") {
8876 TMP_KEY_IGNORE = Symbol.for("node-ignore");
8877 }
8878 var KEY_IGNORE = TMP_KEY_IGNORE;
8879 var define = (object, key2, value) => Object.defineProperty(object, key2, { value });
8880 var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
8881 var RETURN_FALSE = () => false;
8882 var sanitizeRange = (range) => range.replace(
8883 REGEX_REGEXP_RANGE,
8884 (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY
8885 );
8886 var cleanRangeBackSlash = (slashes) => {
8887 const { length } = slashes;
8888 return slashes.slice(0, length - length % 2);
8889 };
8890 var REPLACERS = [
8891 [
8892 // remove BOM
8893 // TODO:
8894 // Other similar zero-width characters?
8895 /^\uFEFF/,
8896 () => EMPTY
8897 ],
8898 // > Trailing spaces are ignored unless they are quoted with backslash ("\")
8899 [
8900 // (a\ ) -> (a )
8901 // (a ) -> (a)
8902 // (a ) -> (a)
8903 // (a \ ) -> (a )
8904 /((?:\\\\)*?)(\\?\s+)$/,
8905 (_, m1, m2) => m1 + (m2.indexOf("\\") === 0 ? SPACE : EMPTY)
8906 ],
8907 // replace (\ ) with ' '
8908 // (\ ) -> ' '
8909 // (\\ ) -> '\\ '
8910 // (\\\ ) -> '\\ '
8911 [
8912 /(\\+?)\s/g,
8913 (_, m1) => {
8914 const { length } = m1;
8915 return m1.slice(0, length - length % 2) + SPACE;
8916 }
8917 ],
8918 // Escape metacharacters
8919 // which is written down by users but means special for regular expressions.
8920 // > There are 12 characters with special meanings:
8921 // > - the backslash \,
8922 // > - the caret ^,
8923 // > - the dollar sign $,
8924 // > - the period or dot .,
8925 // > - the vertical bar or pipe symbol |,
8926 // > - the question mark ?,
8927 // > - the asterisk or star *,
8928 // > - the plus sign +,
8929 // > - the opening parenthesis (,
8930 // > - the closing parenthesis ),
8931 // > - and the opening square bracket [,
8932 // > - the opening curly brace {,
8933 // > These special characters are often called "metacharacters".
8934 [
8935 /[\\$.|*+(){^]/g,
8936 (match) => `\\${match}`
8937 ],
8938 [
8939 // > a question mark (?) matches a single character
8940 /(?!\\)\?/g,
8941 () => "[^/]"
8942 ],
8943 // leading slash
8944 [
8945 // > A leading slash matches the beginning of the pathname.
8946 // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
8947 // A leading slash matches the beginning of the pathname
8948 /^\//,
8949 () => "^"
8950 ],
8951 // replace special metacharacter slash after the leading slash
8952 [
8953 /\//g,
8954 () => "\\/"
8955 ],
8956 [
8957 // > A leading "**" followed by a slash means match in all directories.
8958 // > For example, "**/foo" matches file or directory "foo" anywhere,
8959 // > the same as pattern "foo".
8960 // > "**/foo/bar" matches file or directory "bar" anywhere that is directly
8961 // > under directory "foo".
8962 // Notice that the '*'s have been replaced as '\\*'
8963 /^\^*\\\*\\\*\\\//,
8964 // '**/foo' <-> 'foo'
8965 () => "^(?:.*\\/)?"
8966 ],
8967 // starting
8968 [
8969 // there will be no leading '/'
8970 // (which has been replaced by section "leading slash")
8971 // If starts with '**', adding a '^' to the regular expression also works
8972 /^(?=[^^])/,
8973 function startingReplacer() {
8974 return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^";
8975 }
8976 ],
8977 // two globstars
8978 [
8979 // Use lookahead assertions so that we could match more than one `'/**'`
8980 /\\\/\\\*\\\*(?=\\\/|$)/g,
8981 // Zero, one or several directories
8982 // should not use '*', or it will be replaced by the next replacer
8983 // Check if it is not the last `'/**'`
8984 (_, index, str2) => index + 6 < str2.length ? "(?:\\/[^\\/]+)*" : "\\/.+"
8985 ],
8986 // normal intermediate wildcards
8987 [
8988 // Never replace escaped '*'
8989 // ignore rule '\*' will match the path '*'
8990 // 'abc.*/' -> go
8991 // 'abc.*' -> skip this rule,
8992 // coz trailing single wildcard will be handed by [trailing wildcard]
8993 /(^|[^\\]+)(\\\*)+(?=.+)/g,
8994 // '*.js' matches '.js'
8995 // '*.js' doesn't match 'abc'
8996 (_, p1, p2) => {
8997 const unescaped = p2.replace(/\\\*/g, "[^\\/]*");
8998 return p1 + unescaped;
8999 }
9000 ],
9001 [
9002 // unescape, revert step 3 except for back slash
9003 // For example, if a user escape a '\\*',
9004 // after step 3, the result will be '\\\\\\*'
9005 /\\\\\\(?=[$.|*+(){^])/g,
9006 () => ESCAPE
9007 ],
9008 [
9009 // '\\\\' -> '\\'
9010 /\\\\/g,
9011 () => ESCAPE
9012 ],
9013 [
9014 // > The range notation, e.g. [a-zA-Z],
9015 // > can be used to match one of the characters in a range.
9016 // `\` is escaped by step 3
9017 /(\\)?\[([^\]/]*?)(\\*)($|\])/g,
9018 (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]"
9019 ],
9020 // ending
9021 [
9022 // 'js' will not match 'js.'
9023 // 'ab' will not match 'abc'
9024 /(?:[^*])$/,
9025 // WTF!
9026 // https://git-scm.com/docs/gitignore
9027 // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
9028 // which re-fixes #24, #38
9029 // > If there is a separator at the end of the pattern then the pattern
9030 // > will only match directories, otherwise the pattern can match both
9031 // > files and directories.
9032 // 'js*' will not match 'a.js'
9033 // 'js/' will not match 'a.js'
9034 // 'js' will match 'a.js' and 'a.js/'
9035 (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)`
9036 ],
9037 // trailing wildcard
9038 [
9039 /(\^|\\\/)?\\\*$/,
9040 (_, p1) => {
9041 const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
9042 return `${prefix}(?=$|\\/$)`;
9043 }
9044 ]
9045 ];
9046 var regexCache = /* @__PURE__ */ Object.create(null);
9047 var makeRegex = (pattern, ignoreCase) => {
9048 let source2 = regexCache[pattern];
9049 if (!source2) {
9050 source2 = REPLACERS.reduce(
9051 (prev, [matcher, replacer]) => prev.replace(matcher, replacer.bind(pattern)),
9052 pattern
9053 );
9054 regexCache[pattern] = source2;
9055 }
9056 return ignoreCase ? new RegExp(source2, "i") : new RegExp(source2);
9057 };
9058 var isString = (subject) => typeof subject === "string";
9059 var checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0;
9060 var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF);
9061 var IgnoreRule = class {
9062 constructor(origin, pattern, negative, regex) {
9063 this.origin = origin;
9064 this.pattern = pattern;
9065 this.negative = negative;
9066 this.regex = regex;
9067 }
9068 };
9069 var createRule = (pattern, ignoreCase) => {
9070 const origin = pattern;
9071 let negative = false;
9072 if (pattern.indexOf("!") === 0) {
9073 negative = true;
9074 pattern = pattern.substr(1);
9075 }
9076 pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
9077 const regex = makeRegex(pattern, ignoreCase);
9078 return new IgnoreRule(
9079 origin,
9080 pattern,
9081 negative,
9082 regex
9083 );
9084 };
9085 var throwError2 = (message, Ctor) => {
9086 throw new Ctor(message);
9087 };
9088 var checkPath = (path13, originalPath, doThrow) => {
9089 if (!isString(path13)) {
9090 return doThrow(
9091 `path must be a string, but got \`${originalPath}\``,
9092 TypeError
9093 );
9094 }
9095 if (!path13) {
9096 return doThrow(`path must not be empty`, TypeError);
9097 }
9098 if (checkPath.isNotRelative(path13)) {
9099 const r = "`path.relative()`d";
9100 return doThrow(
9101 `path should be a ${r} string, but got "${originalPath}"`,
9102 RangeError
9103 );
9104 }
9105 return true;
9106 };
9107 var isNotRelative = (path13) => REGEX_TEST_INVALID_PATH.test(path13);
9108 checkPath.isNotRelative = isNotRelative;
9109 checkPath.convert = (p) => p;
9110 var Ignore = class {
9111 constructor({
9112 ignorecase = true,
9113 ignoreCase = ignorecase,
9114 allowRelativePaths = false
9115 } = {}) {
9116 define(this, KEY_IGNORE, true);
9117 this._rules = [];
9118 this._ignoreCase = ignoreCase;
9119 this._allowRelativePaths = allowRelativePaths;
9120 this._initCache();
9121 }
9122 _initCache() {
9123 this._ignoreCache = /* @__PURE__ */ Object.create(null);
9124 this._testCache = /* @__PURE__ */ Object.create(null);
9125 }
9126 _addPattern(pattern) {
9127 if (pattern && pattern[KEY_IGNORE]) {
9128 this._rules = this._rules.concat(pattern._rules);
9129 this._added = true;
9130 return;
9131 }
9132 if (checkPattern(pattern)) {
9133 const rule = createRule(pattern, this._ignoreCase);
9134 this._added = true;
9135 this._rules.push(rule);
9136 }
9137 }
9138 // @param {Array<string> | string | Ignore} pattern
9139 add(pattern) {
9140 this._added = false;
9141 makeArray(
9142 isString(pattern) ? splitPattern(pattern) : pattern
9143 ).forEach(this._addPattern, this);
9144 if (this._added) {
9145 this._initCache();
9146 }
9147 return this;
9148 }
9149 // legacy
9150 addPattern(pattern) {
9151 return this.add(pattern);
9152 }
9153 // | ignored : unignored
9154 // negative | 0:0 | 0:1 | 1:0 | 1:1
9155 // -------- | ------- | ------- | ------- | --------
9156 // 0 | TEST | TEST | SKIP | X
9157 // 1 | TESTIF | SKIP | TEST | X
9158 // - SKIP: always skip
9159 // - TEST: always test
9160 // - TESTIF: only test if checkUnignored
9161 // - X: that never happen
9162 // @param {boolean} whether should check if the path is unignored,
9163 // setting `checkUnignored` to `false` could reduce additional
9164 // path matching.
9165 // @returns {TestResult} true if a file is ignored
9166 _testOne(path13, checkUnignored) {
9167 let ignored = false;
9168 let unignored = false;
9169 this._rules.forEach((rule) => {
9170 const { negative } = rule;
9171 if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
9172 return;
9173 }
9174 const matched = rule.regex.test(path13);
9175 if (matched) {
9176 ignored = !negative;
9177 unignored = negative;
9178 }
9179 });
9180 return {
9181 ignored,
9182 unignored
9183 };
9184 }
9185 // @returns {TestResult}
9186 _test(originalPath, cache3, checkUnignored, slices) {
9187 const path13 = originalPath && checkPath.convert(originalPath);
9188 checkPath(
9189 path13,
9190 originalPath,
9191 this._allowRelativePaths ? RETURN_FALSE : throwError2
9192 );
9193 return this._t(path13, cache3, checkUnignored, slices);
9194 }
9195 _t(path13, cache3, checkUnignored, slices) {
9196 if (path13 in cache3) {
9197 return cache3[path13];
9198 }
9199 if (!slices) {
9200 slices = path13.split(SLASH);
9201 }
9202 slices.pop();
9203 if (!slices.length) {
9204 return cache3[path13] = this._testOne(path13, checkUnignored);
9205 }
9206 const parent = this._t(
9207 slices.join(SLASH) + SLASH,
9208 cache3,
9209 checkUnignored,
9210 slices
9211 );
9212 return cache3[path13] = parent.ignored ? parent : this._testOne(path13, checkUnignored);
9213 }
9214 ignores(path13) {
9215 return this._test(path13, this._ignoreCache, false).ignored;
9216 }
9217 createFilter() {
9218 return (path13) => !this.ignores(path13);
9219 }
9220 filter(paths) {
9221 return makeArray(paths).filter(this.createFilter());
9222 }
9223 // @returns {TestResult}
9224 test(path13) {
9225 return this._test(path13, this._testCache, true);
9226 }
9227 };
9228 var factory = (options8) => new Ignore(options8);
9229 var isPathValid = (path13) => checkPath(path13 && checkPath.convert(path13), path13, RETURN_FALSE);
9230 factory.isPathValid = isPathValid;
9231 factory.default = factory;
9232 module.exports = factory;
9233 if (
9234 // Detect `process` so that it can run in browsers.
9235 typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")
9236 ) {
9237 const makePosix = (str2) => /^\\\\\?\\/.test(str2) || /["<>|\u0000-\u001F]+/u.test(str2) ? str2 : str2.replace(/\\/g, "/");
9238 checkPath.convert = makePosix;
9239 const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
9240 checkPath.isNotRelative = (path13) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path13) || isNotRelative(path13);
9241 }
9242 }
9243});
9244
9245// node_modules/n-readlines/readlines.js
9246var require_readlines = __commonJS({
9247 "node_modules/n-readlines/readlines.js"(exports, module) {
9248 "use strict";
9249 var fs7 = __require("fs");
9250 var LineByLine = class {
9251 constructor(file, options8) {
9252 options8 = options8 || {};
9253 if (!options8.readChunk) options8.readChunk = 1024;
9254 if (!options8.newLineCharacter) {
9255 options8.newLineCharacter = 10;
9256 } else {
9257 options8.newLineCharacter = options8.newLineCharacter.charCodeAt(0);
9258 }
9259 if (typeof file === "number") {
9260 this.fd = file;
9261 } else {
9262 this.fd = fs7.openSync(file, "r");
9263 }
9264 this.options = options8;
9265 this.newLineCharacter = options8.newLineCharacter;
9266 this.reset();
9267 }
9268 _searchInBuffer(buffer2, hexNeedle) {
9269 let found = -1;
9270 for (let i = 0; i <= buffer2.length; i++) {
9271 let b_byte = buffer2[i];
9272 if (b_byte === hexNeedle) {
9273 found = i;
9274 break;
9275 }
9276 }
9277 return found;
9278 }
9279 reset() {
9280 this.eofReached = false;
9281 this.linesCache = [];
9282 this.fdPosition = 0;
9283 }
9284 close() {
9285 fs7.closeSync(this.fd);
9286 this.fd = null;
9287 }
9288 _extractLines(buffer2) {
9289 let line3;
9290 const lines = [];
9291 let bufferPosition = 0;
9292 let lastNewLineBufferPosition = 0;
9293 while (true) {
9294 let bufferPositionValue = buffer2[bufferPosition++];
9295 if (bufferPositionValue === this.newLineCharacter) {
9296 line3 = buffer2.slice(lastNewLineBufferPosition, bufferPosition);
9297 lines.push(line3);
9298 lastNewLineBufferPosition = bufferPosition;
9299 } else if (bufferPositionValue === void 0) {
9300 break;
9301 }
9302 }
9303 let leftovers = buffer2.slice(lastNewLineBufferPosition, bufferPosition);
9304 if (leftovers.length) {
9305 lines.push(leftovers);
9306 }
9307 return lines;
9308 }
9309 _readChunk(lineLeftovers) {
9310 let totalBytesRead = 0;
9311 let bytesRead;
9312 const buffers = [];
9313 do {
9314 const readBuffer = Buffer.alloc(this.options.readChunk);
9315 bytesRead = fs7.readSync(this.fd, readBuffer, 0, this.options.readChunk, this.fdPosition);
9316 totalBytesRead = totalBytesRead + bytesRead;
9317 this.fdPosition = this.fdPosition + bytesRead;
9318 buffers.push(readBuffer);
9319 } while (bytesRead && this._searchInBuffer(buffers[buffers.length - 1], this.options.newLineCharacter) === -1);
9320 let bufferData = Buffer.concat(buffers);
9321 if (bytesRead < this.options.readChunk) {
9322 this.eofReached = true;
9323 bufferData = bufferData.slice(0, totalBytesRead);
9324 }
9325 if (totalBytesRead) {
9326 this.linesCache = this._extractLines(bufferData);
9327 if (lineLeftovers) {
9328 this.linesCache[0] = Buffer.concat([lineLeftovers, this.linesCache[0]]);
9329 }
9330 }
9331 return totalBytesRead;
9332 }
9333 next() {
9334 if (!this.fd) return false;
9335 let line3 = false;
9336 if (this.eofReached && this.linesCache.length === 0) {
9337 return line3;
9338 }
9339 let bytesRead;
9340 if (!this.linesCache.length) {
9341 bytesRead = this._readChunk();
9342 }
9343 if (this.linesCache.length) {
9344 line3 = this.linesCache.shift();
9345 const lastLineCharacter = line3[line3.length - 1];
9346 if (lastLineCharacter !== this.newLineCharacter) {
9347 bytesRead = this._readChunk(line3);
9348 if (bytesRead) {
9349 line3 = this.linesCache.shift();
9350 }
9351 }
9352 }
9353 if (this.eofReached && this.linesCache.length === 0) {
9354 this.close();
9355 }
9356 if (line3 && line3[line3.length - 1] === this.newLineCharacter) {
9357 line3 = line3.slice(0, line3.length - 1);
9358 }
9359 return line3;
9360 }
9361 };
9362 module.exports = LineByLine;
9363 }
9364});
9365
9366// src/index.js
9367var src_exports = {};
9368__export(src_exports, {
9369 __debug: () => debugApis,
9370 __internal: () => sharedWithCli,
9371 check: () => check,
9372 clearConfigCache: () => clearCache3,
9373 doc: () => doc,
9374 format: () => format2,
9375 formatWithCursor: () => formatWithCursor2,
9376 getFileInfo: () => getFileInfo2,
9377 getSupportInfo: () => getSupportInfo2,
9378 resolveConfig: () => resolveConfig,
9379 resolveConfigFile: () => resolveConfigFile,
9380 util: () => public_exports,
9381 version: () => version_evaluate_default
9382});
9383
9384// node_modules/diff/lib/index.mjs
9385function Diff() {
9386}
9387Diff.prototype = {
9388 diff: function diff(oldString, newString) {
9389 var _options$timeout;
9390 var options8 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
9391 var callback = options8.callback;
9392 if (typeof options8 === "function") {
9393 callback = options8;
9394 options8 = {};
9395 }
9396 var self = this;
9397 function done(value) {
9398 value = self.postProcess(value, options8);
9399 if (callback) {
9400 setTimeout(function() {
9401 callback(value);
9402 }, 0);
9403 return true;
9404 } else {
9405 return value;
9406 }
9407 }
9408 oldString = this.castInput(oldString, options8);
9409 newString = this.castInput(newString, options8);
9410 oldString = this.removeEmpty(this.tokenize(oldString, options8));
9411 newString = this.removeEmpty(this.tokenize(newString, options8));
9412 var newLen = newString.length, oldLen = oldString.length;
9413 var editLength = 1;
9414 var maxEditLength = newLen + oldLen;
9415 if (options8.maxEditLength != null) {
9416 maxEditLength = Math.min(maxEditLength, options8.maxEditLength);
9417 }
9418 var maxExecutionTime = (_options$timeout = options8.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity;
9419 var abortAfterTimestamp = Date.now() + maxExecutionTime;
9420 var bestPath = [{
9421 oldPos: -1,
9422 lastComponent: void 0
9423 }];
9424 var newPos = this.extractCommon(bestPath[0], newString, oldString, 0, options8);
9425 if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
9426 return done(buildValues(self, bestPath[0].lastComponent, newString, oldString, self.useLongestToken));
9427 }
9428 var minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;
9429 function execEditLength() {
9430 for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
9431 var basePath = void 0;
9432 var removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];
9433 if (removePath) {
9434 bestPath[diagonalPath - 1] = void 0;
9435 }
9436 var canAdd = false;
9437 if (addPath) {
9438 var addPathNewPos = addPath.oldPos - diagonalPath;
9439 canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
9440 }
9441 var canRemove = removePath && removePath.oldPos + 1 < oldLen;
9442 if (!canAdd && !canRemove) {
9443 bestPath[diagonalPath] = void 0;
9444 continue;
9445 }
9446 if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) {
9447 basePath = self.addToPath(addPath, true, false, 0, options8);
9448 } else {
9449 basePath = self.addToPath(removePath, false, true, 1, options8);
9450 }
9451 newPos = self.extractCommon(basePath, newString, oldString, diagonalPath, options8);
9452 if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
9453 return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));
9454 } else {
9455 bestPath[diagonalPath] = basePath;
9456 if (basePath.oldPos + 1 >= oldLen) {
9457 maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
9458 }
9459 if (newPos + 1 >= newLen) {
9460 minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
9461 }
9462 }
9463 }
9464 editLength++;
9465 }
9466 if (callback) {
9467 (function exec() {
9468 setTimeout(function() {
9469 if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
9470 return callback();
9471 }
9472 if (!execEditLength()) {
9473 exec();
9474 }
9475 }, 0);
9476 })();
9477 } else {
9478 while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
9479 var ret = execEditLength();
9480 if (ret) {
9481 return ret;
9482 }
9483 }
9484 }
9485 },
9486 addToPath: function addToPath(path13, added, removed, oldPosInc, options8) {
9487 var last = path13.lastComponent;
9488 if (last && !options8.oneChangePerToken && last.added === added && last.removed === removed) {
9489 return {
9490 oldPos: path13.oldPos + oldPosInc,
9491 lastComponent: {
9492 count: last.count + 1,
9493 added,
9494 removed,
9495 previousComponent: last.previousComponent
9496 }
9497 };
9498 } else {
9499 return {
9500 oldPos: path13.oldPos + oldPosInc,
9501 lastComponent: {
9502 count: 1,
9503 added,
9504 removed,
9505 previousComponent: last
9506 }
9507 };
9508 }
9509 },
9510 extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath, options8) {
9511 var newLen = newString.length, oldLen = oldString.length, oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;
9512 while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldString[oldPos + 1], newString[newPos + 1], options8)) {
9513 newPos++;
9514 oldPos++;
9515 commonCount++;
9516 if (options8.oneChangePerToken) {
9517 basePath.lastComponent = {
9518 count: 1,
9519 previousComponent: basePath.lastComponent,
9520 added: false,
9521 removed: false
9522 };
9523 }
9524 }
9525 if (commonCount && !options8.oneChangePerToken) {
9526 basePath.lastComponent = {
9527 count: commonCount,
9528 previousComponent: basePath.lastComponent,
9529 added: false,
9530 removed: false
9531 };
9532 }
9533 basePath.oldPos = oldPos;
9534 return newPos;
9535 },
9536 equals: function equals(left, right, options8) {
9537 if (options8.comparator) {
9538 return options8.comparator(left, right);
9539 } else {
9540 return left === right || options8.ignoreCase && left.toLowerCase() === right.toLowerCase();
9541 }
9542 },
9543 removeEmpty: function removeEmpty(array2) {
9544 var ret = [];
9545 for (var i = 0; i < array2.length; i++) {
9546 if (array2[i]) {
9547 ret.push(array2[i]);
9548 }
9549 }
9550 return ret;
9551 },
9552 castInput: function castInput(value) {
9553 return value;
9554 },
9555 tokenize: function tokenize(value) {
9556 return Array.from(value);
9557 },
9558 join: function join(chars) {
9559 return chars.join("");
9560 },
9561 postProcess: function postProcess(changeObjects) {
9562 return changeObjects;
9563 }
9564};
9565function buildValues(diff2, lastComponent, newString, oldString, useLongestToken) {
9566 var components = [];
9567 var nextComponent;
9568 while (lastComponent) {
9569 components.push(lastComponent);
9570 nextComponent = lastComponent.previousComponent;
9571 delete lastComponent.previousComponent;
9572 lastComponent = nextComponent;
9573 }
9574 components.reverse();
9575 var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0;
9576 for (; componentPos < componentLen; componentPos++) {
9577 var component = components[componentPos];
9578 if (!component.removed) {
9579 if (!component.added && useLongestToken) {
9580 var value = newString.slice(newPos, newPos + component.count);
9581 value = value.map(function(value2, i) {
9582 var oldValue = oldString[oldPos + i];
9583 return oldValue.length > value2.length ? oldValue : value2;
9584 });
9585 component.value = diff2.join(value);
9586 } else {
9587 component.value = diff2.join(newString.slice(newPos, newPos + component.count));
9588 }
9589 newPos += component.count;
9590 if (!component.added) {
9591 oldPos += component.count;
9592 }
9593 } else {
9594 component.value = diff2.join(oldString.slice(oldPos, oldPos + component.count));
9595 oldPos += component.count;
9596 }
9597 }
9598 return components;
9599}
9600var characterDiff = new Diff();
9601function longestCommonPrefix(str1, str2) {
9602 var i;
9603 for (i = 0; i < str1.length && i < str2.length; i++) {
9604 if (str1[i] != str2[i]) {
9605 return str1.slice(0, i);
9606 }
9607 }
9608 return str1.slice(0, i);
9609}
9610function longestCommonSuffix(str1, str2) {
9611 var i;
9612 if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) {
9613 return "";
9614 }
9615 for (i = 0; i < str1.length && i < str2.length; i++) {
9616 if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) {
9617 return str1.slice(-i);
9618 }
9619 }
9620 return str1.slice(-i);
9621}
9622function replacePrefix(string, oldPrefix, newPrefix) {
9623 if (string.slice(0, oldPrefix.length) != oldPrefix) {
9624 throw Error("string ".concat(JSON.stringify(string), " doesn't start with prefix ").concat(JSON.stringify(oldPrefix), "; this is a bug"));
9625 }
9626 return newPrefix + string.slice(oldPrefix.length);
9627}
9628function replaceSuffix(string, oldSuffix, newSuffix) {
9629 if (!oldSuffix) {
9630 return string + newSuffix;
9631 }
9632 if (string.slice(-oldSuffix.length) != oldSuffix) {
9633 throw Error("string ".concat(JSON.stringify(string), " doesn't end with suffix ").concat(JSON.stringify(oldSuffix), "; this is a bug"));
9634 }
9635 return string.slice(0, -oldSuffix.length) + newSuffix;
9636}
9637function removePrefix(string, oldPrefix) {
9638 return replacePrefix(string, oldPrefix, "");
9639}
9640function removeSuffix(string, oldSuffix) {
9641 return replaceSuffix(string, oldSuffix, "");
9642}
9643function maximumOverlap(string1, string2) {
9644 return string2.slice(0, overlapCount(string1, string2));
9645}
9646function overlapCount(a, b) {
9647 var startA = 0;
9648 if (a.length > b.length) {
9649 startA = a.length - b.length;
9650 }
9651 var endB = b.length;
9652 if (a.length < b.length) {
9653 endB = a.length;
9654 }
9655 var map2 = Array(endB);
9656 var k = 0;
9657 map2[0] = 0;
9658 for (var j = 1; j < endB; j++) {
9659 if (b[j] == b[k]) {
9660 map2[j] = map2[k];
9661 } else {
9662 map2[j] = k;
9663 }
9664 while (k > 0 && b[j] != b[k]) {
9665 k = map2[k];
9666 }
9667 if (b[j] == b[k]) {
9668 k++;
9669 }
9670 }
9671 k = 0;
9672 for (var i = startA; i < a.length; i++) {
9673 while (k > 0 && a[i] != b[k]) {
9674 k = map2[k];
9675 }
9676 if (a[i] == b[k]) {
9677 k++;
9678 }
9679 }
9680 return k;
9681}
9682var extendedWordChars = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";
9683var tokenizeIncludingWhitespace = new RegExp("[".concat(extendedWordChars, "]+|\\s+|[^").concat(extendedWordChars, "]"), "ug");
9684var wordDiff = new Diff();
9685wordDiff.equals = function(left, right, options8) {
9686 if (options8.ignoreCase) {
9687 left = left.toLowerCase();
9688 right = right.toLowerCase();
9689 }
9690 return left.trim() === right.trim();
9691};
9692wordDiff.tokenize = function(value) {
9693 var options8 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
9694 var parts;
9695 if (options8.intlSegmenter) {
9696 if (options8.intlSegmenter.resolvedOptions().granularity != "word") {
9697 throw new Error('The segmenter passed must have a granularity of "word"');
9698 }
9699 parts = Array.from(options8.intlSegmenter.segment(value), function(segment) {
9700 return segment.segment;
9701 });
9702 } else {
9703 parts = value.match(tokenizeIncludingWhitespace) || [];
9704 }
9705 var tokens = [];
9706 var prevPart = null;
9707 parts.forEach(function(part) {
9708 if (/\s/.test(part)) {
9709 if (prevPart == null) {
9710 tokens.push(part);
9711 } else {
9712 tokens.push(tokens.pop() + part);
9713 }
9714 } else if (/\s/.test(prevPart)) {
9715 if (tokens[tokens.length - 1] == prevPart) {
9716 tokens.push(tokens.pop() + part);
9717 } else {
9718 tokens.push(prevPart + part);
9719 }
9720 } else {
9721 tokens.push(part);
9722 }
9723 prevPart = part;
9724 });
9725 return tokens;
9726};
9727wordDiff.join = function(tokens) {
9728 return tokens.map(function(token2, i) {
9729 if (i == 0) {
9730 return token2;
9731 } else {
9732 return token2.replace(/^\s+/, "");
9733 }
9734 }).join("");
9735};
9736wordDiff.postProcess = function(changes, options8) {
9737 if (!changes || options8.oneChangePerToken) {
9738 return changes;
9739 }
9740 var lastKeep = null;
9741 var insertion = null;
9742 var deletion = null;
9743 changes.forEach(function(change) {
9744 if (change.added) {
9745 insertion = change;
9746 } else if (change.removed) {
9747 deletion = change;
9748 } else {
9749 if (insertion || deletion) {
9750 dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change);
9751 }
9752 lastKeep = change;
9753 insertion = null;
9754 deletion = null;
9755 }
9756 });
9757 if (insertion || deletion) {
9758 dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null);
9759 }
9760 return changes;
9761};
9762function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep) {
9763 if (deletion && insertion) {
9764 var oldWsPrefix = deletion.value.match(/^\s*/)[0];
9765 var oldWsSuffix = deletion.value.match(/\s*$/)[0];
9766 var newWsPrefix = insertion.value.match(/^\s*/)[0];
9767 var newWsSuffix = insertion.value.match(/\s*$/)[0];
9768 if (startKeep) {
9769 var commonWsPrefix = longestCommonPrefix(oldWsPrefix, newWsPrefix);
9770 startKeep.value = replaceSuffix(startKeep.value, newWsPrefix, commonWsPrefix);
9771 deletion.value = removePrefix(deletion.value, commonWsPrefix);
9772 insertion.value = removePrefix(insertion.value, commonWsPrefix);
9773 }
9774 if (endKeep) {
9775 var commonWsSuffix = longestCommonSuffix(oldWsSuffix, newWsSuffix);
9776 endKeep.value = replacePrefix(endKeep.value, newWsSuffix, commonWsSuffix);
9777 deletion.value = removeSuffix(deletion.value, commonWsSuffix);
9778 insertion.value = removeSuffix(insertion.value, commonWsSuffix);
9779 }
9780 } else if (insertion) {
9781 if (startKeep) {
9782 insertion.value = insertion.value.replace(/^\s*/, "");
9783 }
9784 if (endKeep) {
9785 endKeep.value = endKeep.value.replace(/^\s*/, "");
9786 }
9787 } else if (startKeep && endKeep) {
9788 var newWsFull = endKeep.value.match(/^\s*/)[0], delWsStart = deletion.value.match(/^\s*/)[0], delWsEnd = deletion.value.match(/\s*$/)[0];
9789 var newWsStart = longestCommonPrefix(newWsFull, delWsStart);
9790 deletion.value = removePrefix(deletion.value, newWsStart);
9791 var newWsEnd = longestCommonSuffix(removePrefix(newWsFull, newWsStart), delWsEnd);
9792 deletion.value = removeSuffix(deletion.value, newWsEnd);
9793 endKeep.value = replacePrefix(endKeep.value, newWsFull, newWsEnd);
9794 startKeep.value = replaceSuffix(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length));
9795 } else if (endKeep) {
9796 var endKeepWsPrefix = endKeep.value.match(/^\s*/)[0];
9797 var deletionWsSuffix = deletion.value.match(/\s*$/)[0];
9798 var overlap = maximumOverlap(deletionWsSuffix, endKeepWsPrefix);
9799 deletion.value = removeSuffix(deletion.value, overlap);
9800 } else if (startKeep) {
9801 var startKeepWsSuffix = startKeep.value.match(/\s*$/)[0];
9802 var deletionWsPrefix = deletion.value.match(/^\s*/)[0];
9803 var _overlap = maximumOverlap(startKeepWsSuffix, deletionWsPrefix);
9804 deletion.value = removePrefix(deletion.value, _overlap);
9805 }
9806}
9807var wordWithSpaceDiff = new Diff();
9808wordWithSpaceDiff.tokenize = function(value) {
9809 var regex = new RegExp("(\\r?\\n)|[".concat(extendedWordChars, "]+|[^\\S\\n\\r]+|[^").concat(extendedWordChars, "]"), "ug");
9810 return value.match(regex) || [];
9811};
9812var lineDiff = new Diff();
9813lineDiff.tokenize = function(value, options8) {
9814 if (options8.stripTrailingCr) {
9815 value = value.replace(/\r\n/g, "\n");
9816 }
9817 var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
9818 if (!linesAndNewlines[linesAndNewlines.length - 1]) {
9819 linesAndNewlines.pop();
9820 }
9821 for (var i = 0; i < linesAndNewlines.length; i++) {
9822 var line3 = linesAndNewlines[i];
9823 if (i % 2 && !options8.newlineIsToken) {
9824 retLines[retLines.length - 1] += line3;
9825 } else {
9826 retLines.push(line3);
9827 }
9828 }
9829 return retLines;
9830};
9831lineDiff.equals = function(left, right, options8) {
9832 if (options8.ignoreWhitespace) {
9833 if (!options8.newlineIsToken || !left.includes("\n")) {
9834 left = left.trim();
9835 }
9836 if (!options8.newlineIsToken || !right.includes("\n")) {
9837 right = right.trim();
9838 }
9839 } else if (options8.ignoreNewlineAtEof && !options8.newlineIsToken) {
9840 if (left.endsWith("\n")) {
9841 left = left.slice(0, -1);
9842 }
9843 if (right.endsWith("\n")) {
9844 right = right.slice(0, -1);
9845 }
9846 }
9847 return Diff.prototype.equals.call(this, left, right, options8);
9848};
9849function diffLines(oldStr, newStr, callback) {
9850 return lineDiff.diff(oldStr, newStr, callback);
9851}
9852var sentenceDiff = new Diff();
9853sentenceDiff.tokenize = function(value) {
9854 return value.split(/(\S.+?[.!?])(?=\s+|$)/);
9855};
9856var cssDiff = new Diff();
9857cssDiff.tokenize = function(value) {
9858 return value.split(/([{}:;,]|\s+)/);
9859};
9860function ownKeys(e, r) {
9861 var t = Object.keys(e);
9862 if (Object.getOwnPropertySymbols) {
9863 var o = Object.getOwnPropertySymbols(e);
9864 r && (o = o.filter(function(r2) {
9865 return Object.getOwnPropertyDescriptor(e, r2).enumerable;
9866 })), t.push.apply(t, o);
9867 }
9868 return t;
9869}
9870function _objectSpread2(e) {
9871 for (var r = 1; r < arguments.length; r++) {
9872 var t = null != arguments[r] ? arguments[r] : {};
9873 r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
9874 _defineProperty(e, r2, t[r2]);
9875 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
9876 Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
9877 });
9878 }
9879 return e;
9880}
9881function _toPrimitive(t, r) {
9882 if ("object" != typeof t || !t) return t;
9883 var e = t[Symbol.toPrimitive];
9884 if (void 0 !== e) {
9885 var i = e.call(t, r || "default");
9886 if ("object" != typeof i) return i;
9887 throw new TypeError("@@toPrimitive must return a primitive value.");
9888 }
9889 return ("string" === r ? String : Number)(t);
9890}
9891function _toPropertyKey(t) {
9892 var i = _toPrimitive(t, "string");
9893 return "symbol" == typeof i ? i : i + "";
9894}
9895function _typeof(o) {
9896 "@babel/helpers - typeof";
9897 return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
9898 return typeof o2;
9899 } : function(o2) {
9900 return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
9901 }, _typeof(o);
9902}
9903function _defineProperty(obj, key2, value) {
9904 key2 = _toPropertyKey(key2);
9905 if (key2 in obj) {
9906 Object.defineProperty(obj, key2, {
9907 value,
9908 enumerable: true,
9909 configurable: true,
9910 writable: true
9911 });
9912 } else {
9913 obj[key2] = value;
9914 }
9915 return obj;
9916}
9917function _toConsumableArray(arr) {
9918 return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
9919}
9920function _arrayWithoutHoles(arr) {
9921 if (Array.isArray(arr)) return _arrayLikeToArray(arr);
9922}
9923function _iterableToArray(iter) {
9924 if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
9925}
9926function _unsupportedIterableToArray(o, minLen) {
9927 if (!o) return;
9928 if (typeof o === "string") return _arrayLikeToArray(o, minLen);
9929 var n = Object.prototype.toString.call(o).slice(8, -1);
9930 if (n === "Object" && o.constructor) n = o.constructor.name;
9931 if (n === "Map" || n === "Set") return Array.from(o);
9932 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
9933}
9934function _arrayLikeToArray(arr, len) {
9935 if (len == null || len > arr.length) len = arr.length;
9936 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
9937 return arr2;
9938}
9939function _nonIterableSpread() {
9940 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
9941}
9942var jsonDiff = new Diff();
9943jsonDiff.useLongestToken = true;
9944jsonDiff.tokenize = lineDiff.tokenize;
9945jsonDiff.castInput = function(value, options8) {
9946 var undefinedReplacement = options8.undefinedReplacement, _options$stringifyRep = options8.stringifyReplacer, stringifyReplacer = _options$stringifyRep === void 0 ? function(k, v) {
9947 return typeof v === "undefined" ? undefinedReplacement : v;
9948 } : _options$stringifyRep;
9949 return typeof value === "string" ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, " ");
9950};
9951jsonDiff.equals = function(left, right, options8) {
9952 return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, "$1"), right.replace(/,([\r\n])/g, "$1"), options8);
9953};
9954function canonicalize(obj, stack2, replacementStack, replacer, key2) {
9955 stack2 = stack2 || [];
9956 replacementStack = replacementStack || [];
9957 if (replacer) {
9958 obj = replacer(key2, obj);
9959 }
9960 var i;
9961 for (i = 0; i < stack2.length; i += 1) {
9962 if (stack2[i] === obj) {
9963 return replacementStack[i];
9964 }
9965 }
9966 var canonicalizedObj;
9967 if ("[object Array]" === Object.prototype.toString.call(obj)) {
9968 stack2.push(obj);
9969 canonicalizedObj = new Array(obj.length);
9970 replacementStack.push(canonicalizedObj);
9971 for (i = 0; i < obj.length; i += 1) {
9972 canonicalizedObj[i] = canonicalize(obj[i], stack2, replacementStack, replacer, key2);
9973 }
9974 stack2.pop();
9975 replacementStack.pop();
9976 return canonicalizedObj;
9977 }
9978 if (obj && obj.toJSON) {
9979 obj = obj.toJSON();
9980 }
9981 if (_typeof(obj) === "object" && obj !== null) {
9982 stack2.push(obj);
9983 canonicalizedObj = {};
9984 replacementStack.push(canonicalizedObj);
9985 var sortedKeys = [], _key;
9986 for (_key in obj) {
9987 if (Object.prototype.hasOwnProperty.call(obj, _key)) {
9988 sortedKeys.push(_key);
9989 }
9990 }
9991 sortedKeys.sort();
9992 for (i = 0; i < sortedKeys.length; i += 1) {
9993 _key = sortedKeys[i];
9994 canonicalizedObj[_key] = canonicalize(obj[_key], stack2, replacementStack, replacer, _key);
9995 }
9996 stack2.pop();
9997 replacementStack.pop();
9998 } else {
9999 canonicalizedObj = obj;
10000 }
10001 return canonicalizedObj;
10002}
10003var arrayDiff = new Diff();
10004arrayDiff.tokenize = function(value) {
10005 return value.slice();
10006};
10007arrayDiff.join = arrayDiff.removeEmpty = function(value) {
10008 return value;
10009};
10010function diffArrays(oldArr, newArr, callback) {
10011 return arrayDiff.diff(oldArr, newArr, callback);
10012}
10013function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8) {
10014 if (!options8) {
10015 options8 = {};
10016 }
10017 if (typeof options8 === "function") {
10018 options8 = {
10019 callback: options8
10020 };
10021 }
10022 if (typeof options8.context === "undefined") {
10023 options8.context = 4;
10024 }
10025 if (options8.newlineIsToken) {
10026 throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");
10027 }
10028 if (!options8.callback) {
10029 return diffLinesResultToPatch(diffLines(oldStr, newStr, options8));
10030 } else {
10031 var _options = options8, _callback = _options.callback;
10032 diffLines(oldStr, newStr, _objectSpread2(_objectSpread2({}, options8), {}, {
10033 callback: function callback(diff2) {
10034 var patch = diffLinesResultToPatch(diff2);
10035 _callback(patch);
10036 }
10037 }));
10038 }
10039 function diffLinesResultToPatch(diff2) {
10040 if (!diff2) {
10041 return;
10042 }
10043 diff2.push({
10044 value: "",
10045 lines: []
10046 });
10047 function contextLines(lines) {
10048 return lines.map(function(entry) {
10049 return " " + entry;
10050 });
10051 }
10052 var hunks = [];
10053 var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1;
10054 var _loop = function _loop2() {
10055 var current = diff2[i], lines = current.lines || splitLines(current.value);
10056 current.lines = lines;
10057 if (current.added || current.removed) {
10058 var _curRange;
10059 if (!oldRangeStart) {
10060 var prev = diff2[i - 1];
10061 oldRangeStart = oldLine;
10062 newRangeStart = newLine;
10063 if (prev) {
10064 curRange = options8.context > 0 ? contextLines(prev.lines.slice(-options8.context)) : [];
10065 oldRangeStart -= curRange.length;
10066 newRangeStart -= curRange.length;
10067 }
10068 }
10069 (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function(entry) {
10070 return (current.added ? "+" : "-") + entry;
10071 })));
10072 if (current.added) {
10073 newLine += lines.length;
10074 } else {
10075 oldLine += lines.length;
10076 }
10077 } else {
10078 if (oldRangeStart) {
10079 if (lines.length <= options8.context * 2 && i < diff2.length - 2) {
10080 var _curRange2;
10081 (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines)));
10082 } else {
10083 var _curRange3;
10084 var contextSize = Math.min(lines.length, options8.context);
10085 (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize))));
10086 var _hunk = {
10087 oldStart: oldRangeStart,
10088 oldLines: oldLine - oldRangeStart + contextSize,
10089 newStart: newRangeStart,
10090 newLines: newLine - newRangeStart + contextSize,
10091 lines: curRange
10092 };
10093 hunks.push(_hunk);
10094 oldRangeStart = 0;
10095 newRangeStart = 0;
10096 curRange = [];
10097 }
10098 }
10099 oldLine += lines.length;
10100 newLine += lines.length;
10101 }
10102 };
10103 for (var i = 0; i < diff2.length; i++) {
10104 _loop();
10105 }
10106 for (var _i = 0, _hunks = hunks; _i < _hunks.length; _i++) {
10107 var hunk = _hunks[_i];
10108 for (var _i2 = 0; _i2 < hunk.lines.length; _i2++) {
10109 if (hunk.lines[_i2].endsWith("\n")) {
10110 hunk.lines[_i2] = hunk.lines[_i2].slice(0, -1);
10111 } else {
10112 hunk.lines.splice(_i2 + 1, 0, "\\ No newline at end of file");
10113 _i2++;
10114 }
10115 }
10116 }
10117 return {
10118 oldFileName,
10119 newFileName,
10120 oldHeader,
10121 newHeader,
10122 hunks
10123 };
10124 }
10125}
10126function formatPatch(diff2) {
10127 if (Array.isArray(diff2)) {
10128 return diff2.map(formatPatch).join("\n");
10129 }
10130 var ret = [];
10131 if (diff2.oldFileName == diff2.newFileName) {
10132 ret.push("Index: " + diff2.oldFileName);
10133 }
10134 ret.push("===================================================================");
10135 ret.push("--- " + diff2.oldFileName + (typeof diff2.oldHeader === "undefined" ? "" : " " + diff2.oldHeader));
10136 ret.push("+++ " + diff2.newFileName + (typeof diff2.newHeader === "undefined" ? "" : " " + diff2.newHeader));
10137 for (var i = 0; i < diff2.hunks.length; i++) {
10138 var hunk = diff2.hunks[i];
10139 if (hunk.oldLines === 0) {
10140 hunk.oldStart -= 1;
10141 }
10142 if (hunk.newLines === 0) {
10143 hunk.newStart -= 1;
10144 }
10145 ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@");
10146 ret.push.apply(ret, hunk.lines);
10147 }
10148 return ret.join("\n") + "\n";
10149}
10150function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8) {
10151 var _options2;
10152 if (typeof options8 === "function") {
10153 options8 = {
10154 callback: options8
10155 };
10156 }
10157 if (!((_options2 = options8) !== null && _options2 !== void 0 && _options2.callback)) {
10158 var patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8);
10159 if (!patchObj) {
10160 return;
10161 }
10162 return formatPatch(patchObj);
10163 } else {
10164 var _options3 = options8, _callback2 = _options3.callback;
10165 structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, _objectSpread2(_objectSpread2({}, options8), {}, {
10166 callback: function callback(patchObj2) {
10167 if (!patchObj2) {
10168 _callback2();
10169 } else {
10170 _callback2(formatPatch(patchObj2));
10171 }
10172 }
10173 }));
10174 }
10175}
10176function splitLines(text) {
10177 var hasTrailingNl = text.endsWith("\n");
10178 var result = text.split("\n").map(function(line3) {
10179 return line3 + "\n";
10180 });
10181 if (hasTrailingNl) {
10182 result.pop();
10183 } else {
10184 result.push(result.pop().slice(0, -1));
10185 }
10186 return result;
10187}
10188
10189// src/index.js
10190var import_fast_glob = __toESM(require_out4(), 1);
10191
10192// node_modules/vnopts/lib/descriptors/api.js
10193var apiDescriptor = {
10194 key: (key2) => /^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(key2) ? key2 : JSON.stringify(key2),
10195 value(value) {
10196 if (value === null || typeof value !== "object") {
10197 return JSON.stringify(value);
10198 }
10199 if (Array.isArray(value)) {
10200 return `[${value.map((subValue) => apiDescriptor.value(subValue)).join(", ")}]`;
10201 }
10202 const keys = Object.keys(value);
10203 return keys.length === 0 ? "{}" : `{ ${keys.map((key2) => `${apiDescriptor.key(key2)}: ${apiDescriptor.value(value[key2])}`).join(", ")} }`;
10204 },
10205 pair: ({ key: key2, value }) => apiDescriptor.value({ [key2]: value })
10206};
10207
10208// node_modules/chalk/source/vendor/ansi-styles/index.js
10209var ANSI_BACKGROUND_OFFSET = 10;
10210var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
10211var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
10212var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
10213var styles = {
10214 modifier: {
10215 reset: [0, 0],
10216 // 21 isn't widely supported and 22 does the same thing
10217 bold: [1, 22],
10218 dim: [2, 22],
10219 italic: [3, 23],
10220 underline: [4, 24],
10221 overline: [53, 55],
10222 inverse: [7, 27],
10223 hidden: [8, 28],
10224 strikethrough: [9, 29]
10225 },
10226 color: {
10227 black: [30, 39],
10228 red: [31, 39],
10229 green: [32, 39],
10230 yellow: [33, 39],
10231 blue: [34, 39],
10232 magenta: [35, 39],
10233 cyan: [36, 39],
10234 white: [37, 39],
10235 // Bright color
10236 blackBright: [90, 39],
10237 gray: [90, 39],
10238 // Alias of `blackBright`
10239 grey: [90, 39],
10240 // Alias of `blackBright`
10241 redBright: [91, 39],
10242 greenBright: [92, 39],
10243 yellowBright: [93, 39],
10244 blueBright: [94, 39],
10245 magentaBright: [95, 39],
10246 cyanBright: [96, 39],
10247 whiteBright: [97, 39]
10248 },
10249 bgColor: {
10250 bgBlack: [40, 49],
10251 bgRed: [41, 49],
10252 bgGreen: [42, 49],
10253 bgYellow: [43, 49],
10254 bgBlue: [44, 49],
10255 bgMagenta: [45, 49],
10256 bgCyan: [46, 49],
10257 bgWhite: [47, 49],
10258 // Bright color
10259 bgBlackBright: [100, 49],
10260 bgGray: [100, 49],
10261 // Alias of `bgBlackBright`
10262 bgGrey: [100, 49],
10263 // Alias of `bgBlackBright`
10264 bgRedBright: [101, 49],
10265 bgGreenBright: [102, 49],
10266 bgYellowBright: [103, 49],
10267 bgBlueBright: [104, 49],
10268 bgMagentaBright: [105, 49],
10269 bgCyanBright: [106, 49],
10270 bgWhiteBright: [107, 49]
10271 }
10272};
10273var modifierNames = Object.keys(styles.modifier);
10274var foregroundColorNames = Object.keys(styles.color);
10275var backgroundColorNames = Object.keys(styles.bgColor);
10276var colorNames = [...foregroundColorNames, ...backgroundColorNames];
10277function assembleStyles() {
10278 const codes2 = /* @__PURE__ */ new Map();
10279 for (const [groupName, group] of Object.entries(styles)) {
10280 for (const [styleName, style] of Object.entries(group)) {
10281 styles[styleName] = {
10282 open: `\x1B[${style[0]}m`,
10283 close: `\x1B[${style[1]}m`
10284 };
10285 group[styleName] = styles[styleName];
10286 codes2.set(style[0], style[1]);
10287 }
10288 Object.defineProperty(styles, groupName, {
10289 value: group,
10290 enumerable: false
10291 });
10292 }
10293 Object.defineProperty(styles, "codes", {
10294 value: codes2,
10295 enumerable: false
10296 });
10297 styles.color.close = "\x1B[39m";
10298 styles.bgColor.close = "\x1B[49m";
10299 styles.color.ansi = wrapAnsi16();
10300 styles.color.ansi256 = wrapAnsi256();
10301 styles.color.ansi16m = wrapAnsi16m();
10302 styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
10303 styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
10304 styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
10305 Object.defineProperties(styles, {
10306 rgbToAnsi256: {
10307 value(red, green, blue) {
10308 if (red === green && green === blue) {
10309 if (red < 8) {
10310 return 16;
10311 }
10312 if (red > 248) {
10313 return 231;
10314 }
10315 return Math.round((red - 8) / 247 * 24) + 232;
10316 }
10317 return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
10318 },
10319 enumerable: false
10320 },
10321 hexToRgb: {
10322 value(hex) {
10323 const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
10324 if (!matches) {
10325 return [0, 0, 0];
10326 }
10327 let [colorString] = matches;
10328 if (colorString.length === 3) {
10329 colorString = [...colorString].map((character) => character + character).join("");
10330 }
10331 const integer = Number.parseInt(colorString, 16);
10332 return [
10333 /* eslint-disable no-bitwise */
10334 integer >> 16 & 255,
10335 integer >> 8 & 255,
10336 integer & 255
10337 /* eslint-enable no-bitwise */
10338 ];
10339 },
10340 enumerable: false
10341 },
10342 hexToAnsi256: {
10343 value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
10344 enumerable: false
10345 },
10346 ansi256ToAnsi: {
10347 value(code) {
10348 if (code < 8) {
10349 return 30 + code;
10350 }
10351 if (code < 16) {
10352 return 90 + (code - 8);
10353 }
10354 let red;
10355 let green;
10356 let blue;
10357 if (code >= 232) {
10358 red = ((code - 232) * 10 + 8) / 255;
10359 green = red;
10360 blue = red;
10361 } else {
10362 code -= 16;
10363 const remainder = code % 36;
10364 red = Math.floor(code / 36) / 5;
10365 green = Math.floor(remainder / 6) / 5;
10366 blue = remainder % 6 / 5;
10367 }
10368 const value = Math.max(red, green, blue) * 2;
10369 if (value === 0) {
10370 return 30;
10371 }
10372 let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
10373 if (value === 2) {
10374 result += 60;
10375 }
10376 return result;
10377 },
10378 enumerable: false
10379 },
10380 rgbToAnsi: {
10381 value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
10382 enumerable: false
10383 },
10384 hexToAnsi: {
10385 value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
10386 enumerable: false
10387 }
10388 });
10389 return styles;
10390}
10391var ansiStyles = assembleStyles();
10392var ansi_styles_default = ansiStyles;
10393
10394// node_modules/chalk/source/vendor/supports-color/index.js
10395import process2 from "process";
10396import os from "os";
10397import tty from "tty";
10398function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
10399 const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
10400 const position = argv.indexOf(prefix + flag);
10401 const terminatorPosition = argv.indexOf("--");
10402 return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
10403}
10404var { env } = process2;
10405var flagForceColor;
10406if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
10407 flagForceColor = 0;
10408} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
10409 flagForceColor = 1;
10410}
10411function envForceColor() {
10412 if ("FORCE_COLOR" in env) {
10413 if (env.FORCE_COLOR === "true") {
10414 return 1;
10415 }
10416 if (env.FORCE_COLOR === "false") {
10417 return 0;
10418 }
10419 return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
10420 }
10421}
10422function translateLevel(level) {
10423 if (level === 0) {
10424 return false;
10425 }
10426 return {
10427 level,
10428 hasBasic: true,
10429 has256: level >= 2,
10430 has16m: level >= 3
10431 };
10432}
10433function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
10434 const noFlagForceColor = envForceColor();
10435 if (noFlagForceColor !== void 0) {
10436 flagForceColor = noFlagForceColor;
10437 }
10438 const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
10439 if (forceColor === 0) {
10440 return 0;
10441 }
10442 if (sniffFlags) {
10443 if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
10444 return 3;
10445 }
10446 if (hasFlag("color=256")) {
10447 return 2;
10448 }
10449 }
10450 if ("TF_BUILD" in env && "AGENT_NAME" in env) {
10451 return 1;
10452 }
10453 if (haveStream && !streamIsTTY && forceColor === void 0) {
10454 return 0;
10455 }
10456 const min = forceColor || 0;
10457 if (env.TERM === "dumb") {
10458 return min;
10459 }
10460 if (process2.platform === "win32") {
10461 const osRelease = os.release().split(".");
10462 if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
10463 return Number(osRelease[2]) >= 14931 ? 3 : 2;
10464 }
10465 return 1;
10466 }
10467 if ("CI" in env) {
10468 if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
10469 return 3;
10470 }
10471 if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign2) => sign2 in env) || env.CI_NAME === "codeship") {
10472 return 1;
10473 }
10474 return min;
10475 }
10476 if ("TEAMCITY_VERSION" in env) {
10477 return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
10478 }
10479 if (env.COLORTERM === "truecolor") {
10480 return 3;
10481 }
10482 if (env.TERM === "xterm-kitty") {
10483 return 3;
10484 }
10485 if ("TERM_PROGRAM" in env) {
10486 const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
10487 switch (env.TERM_PROGRAM) {
10488 case "iTerm.app": {
10489 return version >= 3 ? 3 : 2;
10490 }
10491 case "Apple_Terminal": {
10492 return 2;
10493 }
10494 }
10495 }
10496 if (/-256(color)?$/i.test(env.TERM)) {
10497 return 2;
10498 }
10499 if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
10500 return 1;
10501 }
10502 if ("COLORTERM" in env) {
10503 return 1;
10504 }
10505 return min;
10506}
10507function createSupportsColor(stream, options8 = {}) {
10508 const level = _supportsColor(stream, {
10509 streamIsTTY: stream && stream.isTTY,
10510 ...options8
10511 });
10512 return translateLevel(level);
10513}
10514var supportsColor = {
10515 stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
10516 stderr: createSupportsColor({ isTTY: tty.isatty(2) })
10517};
10518var supports_color_default = supportsColor;
10519
10520// node_modules/chalk/source/utilities.js
10521function stringReplaceAll(string, substring, replacer) {
10522 let index = string.indexOf(substring);
10523 if (index === -1) {
10524 return string;
10525 }
10526 const substringLength = substring.length;
10527 let endIndex = 0;
10528 let returnValue = "";
10529 do {
10530 returnValue += string.slice(endIndex, index) + substring + replacer;
10531 endIndex = index + substringLength;
10532 index = string.indexOf(substring, endIndex);
10533 } while (index !== -1);
10534 returnValue += string.slice(endIndex);
10535 return returnValue;
10536}
10537function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
10538 let endIndex = 0;
10539 let returnValue = "";
10540 do {
10541 const gotCR = string[index - 1] === "\r";
10542 returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
10543 endIndex = index + 1;
10544 index = string.indexOf("\n", endIndex);
10545 } while (index !== -1);
10546 returnValue += string.slice(endIndex);
10547 return returnValue;
10548}
10549
10550// node_modules/chalk/source/index.js
10551var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
10552var GENERATOR = Symbol("GENERATOR");
10553var STYLER = Symbol("STYLER");
10554var IS_EMPTY = Symbol("IS_EMPTY");
10555var levelMapping = [
10556 "ansi",
10557 "ansi",
10558 "ansi256",
10559 "ansi16m"
10560];
10561var styles2 = /* @__PURE__ */ Object.create(null);
10562var applyOptions = (object, options8 = {}) => {
10563 if (options8.level && !(Number.isInteger(options8.level) && options8.level >= 0 && options8.level <= 3)) {
10564 throw new Error("The `level` option should be an integer from 0 to 3");
10565 }
10566 const colorLevel = stdoutColor ? stdoutColor.level : 0;
10567 object.level = options8.level === void 0 ? colorLevel : options8.level;
10568};
10569var chalkFactory = (options8) => {
10570 const chalk2 = (...strings) => strings.join(" ");
10571 applyOptions(chalk2, options8);
10572 Object.setPrototypeOf(chalk2, createChalk.prototype);
10573 return chalk2;
10574};
10575function createChalk(options8) {
10576 return chalkFactory(options8);
10577}
10578Object.setPrototypeOf(createChalk.prototype, Function.prototype);
10579for (const [styleName, style] of Object.entries(ansi_styles_default)) {
10580 styles2[styleName] = {
10581 get() {
10582 const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
10583 Object.defineProperty(this, styleName, { value: builder });
10584 return builder;
10585 }
10586 };
10587}
10588styles2.visible = {
10589 get() {
10590 const builder = createBuilder(this, this[STYLER], true);
10591 Object.defineProperty(this, "visible", { value: builder });
10592 return builder;
10593 }
10594};
10595var getModelAnsi = (model, level, type2, ...arguments_) => {
10596 if (model === "rgb") {
10597 if (level === "ansi16m") {
10598 return ansi_styles_default[type2].ansi16m(...arguments_);
10599 }
10600 if (level === "ansi256") {
10601 return ansi_styles_default[type2].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
10602 }
10603 return ansi_styles_default[type2].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
10604 }
10605 if (model === "hex") {
10606 return getModelAnsi("rgb", level, type2, ...ansi_styles_default.hexToRgb(...arguments_));
10607 }
10608 return ansi_styles_default[type2][model](...arguments_);
10609};
10610var usedModels = ["rgb", "hex", "ansi256"];
10611for (const model of usedModels) {
10612 styles2[model] = {
10613 get() {
10614 const { level } = this;
10615 return function(...arguments_) {
10616 const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
10617 return createBuilder(this, styler, this[IS_EMPTY]);
10618 };
10619 }
10620 };
10621 const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
10622 styles2[bgModel] = {
10623 get() {
10624 const { level } = this;
10625 return function(...arguments_) {
10626 const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
10627 return createBuilder(this, styler, this[IS_EMPTY]);
10628 };
10629 }
10630 };
10631}
10632var proto = Object.defineProperties(() => {
10633}, {
10634 ...styles2,
10635 level: {
10636 enumerable: true,
10637 get() {
10638 return this[GENERATOR].level;
10639 },
10640 set(level) {
10641 this[GENERATOR].level = level;
10642 }
10643 }
10644});
10645var createStyler = (open, close, parent) => {
10646 let openAll;
10647 let closeAll;
10648 if (parent === void 0) {
10649 openAll = open;
10650 closeAll = close;
10651 } else {
10652 openAll = parent.openAll + open;
10653 closeAll = close + parent.closeAll;
10654 }
10655 return {
10656 open,
10657 close,
10658 openAll,
10659 closeAll,
10660 parent
10661 };
10662};
10663var createBuilder = (self, _styler, _isEmpty) => {
10664 const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
10665 Object.setPrototypeOf(builder, proto);
10666 builder[GENERATOR] = self;
10667 builder[STYLER] = _styler;
10668 builder[IS_EMPTY] = _isEmpty;
10669 return builder;
10670};
10671var applyStyle = (self, string) => {
10672 if (self.level <= 0 || !string) {
10673 return self[IS_EMPTY] ? "" : string;
10674 }
10675 let styler = self[STYLER];
10676 if (styler === void 0) {
10677 return string;
10678 }
10679 const { openAll, closeAll } = styler;
10680 if (string.includes("\x1B")) {
10681 while (styler !== void 0) {
10682 string = stringReplaceAll(string, styler.close, styler.open);
10683 styler = styler.parent;
10684 }
10685 }
10686 const lfIndex = string.indexOf("\n");
10687 if (lfIndex !== -1) {
10688 string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
10689 }
10690 return openAll + string + closeAll;
10691};
10692Object.defineProperties(createChalk.prototype, styles2);
10693var chalk = createChalk();
10694var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
10695var source_default = chalk;
10696
10697// node_modules/vnopts/lib/handlers/deprecated/common.js
10698var commonDeprecatedHandler = (keyOrPair, redirectTo, { descriptor }) => {
10699 const messages2 = [
10700 `${source_default.yellow(typeof keyOrPair === "string" ? descriptor.key(keyOrPair) : descriptor.pair(keyOrPair))} is deprecated`
10701 ];
10702 if (redirectTo) {
10703 messages2.push(`we now treat it as ${source_default.blue(typeof redirectTo === "string" ? descriptor.key(redirectTo) : descriptor.pair(redirectTo))}`);
10704 }
10705 return messages2.join("; ") + ".";
10706};
10707
10708// node_modules/vnopts/lib/constants.js
10709var VALUE_NOT_EXIST = Symbol.for("vnopts.VALUE_NOT_EXIST");
10710var VALUE_UNCHANGED = Symbol.for("vnopts.VALUE_UNCHANGED");
10711
10712// node_modules/vnopts/lib/handlers/invalid/common.js
10713var INDENTATION = " ".repeat(2);
10714var commonInvalidHandler = (key2, value, utils) => {
10715 const { text, list } = utils.normalizeExpectedResult(utils.schemas[key2].expected(utils));
10716 const descriptions = [];
10717 if (text) {
10718 descriptions.push(getDescription(key2, value, text, utils.descriptor));
10719 }
10720 if (list) {
10721 descriptions.push([getDescription(key2, value, list.title, utils.descriptor)].concat(list.values.map((valueDescription) => getListDescription(valueDescription, utils.loggerPrintWidth))).join("\n"));
10722 }
10723 return chooseDescription(descriptions, utils.loggerPrintWidth);
10724};
10725function getDescription(key2, value, expected, descriptor) {
10726 return [
10727 `Invalid ${source_default.red(descriptor.key(key2))} value.`,
10728 `Expected ${source_default.blue(expected)},`,
10729 `but received ${value === VALUE_NOT_EXIST ? source_default.gray("nothing") : source_default.red(descriptor.value(value))}.`
10730 ].join(" ");
10731}
10732function getListDescription({ text, list }, printWidth) {
10733 const descriptions = [];
10734 if (text) {
10735 descriptions.push(`- ${source_default.blue(text)}`);
10736 }
10737 if (list) {
10738 descriptions.push([`- ${source_default.blue(list.title)}:`].concat(list.values.map((valueDescription) => getListDescription(valueDescription, printWidth - INDENTATION.length).replace(/^|\n/g, `$&${INDENTATION}`))).join("\n"));
10739 }
10740 return chooseDescription(descriptions, printWidth);
10741}
10742function chooseDescription(descriptions, printWidth) {
10743 if (descriptions.length === 1) {
10744 return descriptions[0];
10745 }
10746 const [firstDescription, secondDescription] = descriptions;
10747 const [firstWidth, secondWidth] = descriptions.map((description) => description.split("\n", 1)[0].length);
10748 return firstWidth > printWidth && firstWidth > secondWidth ? secondDescription : firstDescription;
10749}
10750
10751// node_modules/leven/index.js
10752var array = [];
10753var characterCodeCache = [];
10754function leven(first, second) {
10755 if (first === second) {
10756 return 0;
10757 }
10758 const swap = first;
10759 if (first.length > second.length) {
10760 first = second;
10761 second = swap;
10762 }
10763 let firstLength = first.length;
10764 let secondLength = second.length;
10765 while (firstLength > 0 && first.charCodeAt(~-firstLength) === second.charCodeAt(~-secondLength)) {
10766 firstLength--;
10767 secondLength--;
10768 }
10769 let start = 0;
10770 while (start < firstLength && first.charCodeAt(start) === second.charCodeAt(start)) {
10771 start++;
10772 }
10773 firstLength -= start;
10774 secondLength -= start;
10775 if (firstLength === 0) {
10776 return secondLength;
10777 }
10778 let bCharacterCode;
10779 let result;
10780 let temporary;
10781 let temporary2;
10782 let index = 0;
10783 let index2 = 0;
10784 while (index < firstLength) {
10785 characterCodeCache[index] = first.charCodeAt(start + index);
10786 array[index] = ++index;
10787 }
10788 while (index2 < secondLength) {
10789 bCharacterCode = second.charCodeAt(start + index2);
10790 temporary = index2++;
10791 result = index2;
10792 for (index = 0; index < firstLength; index++) {
10793 temporary2 = bCharacterCode === characterCodeCache[index] ? temporary : temporary + 1;
10794 temporary = array[index];
10795 result = array[index] = temporary > result ? temporary2 > result ? result + 1 : temporary2 : temporary2 > temporary ? temporary + 1 : temporary2;
10796 }
10797 }
10798 return result;
10799}
10800
10801// node_modules/vnopts/lib/handlers/unknown/leven.js
10802var levenUnknownHandler = (key2, value, { descriptor, logger, schemas }) => {
10803 const messages2 = [
10804 `Ignored unknown option ${source_default.yellow(descriptor.pair({ key: key2, value }))}.`
10805 ];
10806 const suggestion = Object.keys(schemas).sort().find((knownKey) => leven(key2, knownKey) < 3);
10807 if (suggestion) {
10808 messages2.push(`Did you mean ${source_default.blue(descriptor.key(suggestion))}?`);
10809 }
10810 logger.warn(messages2.join(" "));
10811};
10812
10813// node_modules/vnopts/lib/schema.js
10814var HANDLER_KEYS = [
10815 "default",
10816 "expected",
10817 "validate",
10818 "deprecated",
10819 "forward",
10820 "redirect",
10821 "overlap",
10822 "preprocess",
10823 "postprocess"
10824];
10825function createSchema(SchemaConstructor, parameters) {
10826 const schema2 = new SchemaConstructor(parameters);
10827 const subSchema = Object.create(schema2);
10828 for (const handlerKey of HANDLER_KEYS) {
10829 if (handlerKey in parameters) {
10830 subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema2, Schema.prototype[handlerKey].length);
10831 }
10832 }
10833 return subSchema;
10834}
10835var Schema = class {
10836 static create(parameters) {
10837 return createSchema(this, parameters);
10838 }
10839 constructor(parameters) {
10840 this.name = parameters.name;
10841 }
10842 default(_utils) {
10843 return void 0;
10844 }
10845 // this is actually an abstract method but we need a placeholder to get `function.length`
10846 /* c8 ignore start */
10847 expected(_utils) {
10848 return "nothing";
10849 }
10850 /* c8 ignore stop */
10851 // this is actually an abstract method but we need a placeholder to get `function.length`
10852 /* c8 ignore start */
10853 validate(_value, _utils) {
10854 return false;
10855 }
10856 /* c8 ignore stop */
10857 deprecated(_value, _utils) {
10858 return false;
10859 }
10860 forward(_value, _utils) {
10861 return void 0;
10862 }
10863 redirect(_value, _utils) {
10864 return void 0;
10865 }
10866 overlap(currentValue, _newValue, _utils) {
10867 return currentValue;
10868 }
10869 preprocess(value, _utils) {
10870 return value;
10871 }
10872 postprocess(_value, _utils) {
10873 return VALUE_UNCHANGED;
10874 }
10875};
10876function normalizeHandler(handler, superSchema, handlerArgumentsLength) {
10877 return typeof handler === "function" ? (...args) => handler(...args.slice(0, handlerArgumentsLength - 1), superSchema, ...args.slice(handlerArgumentsLength - 1)) : () => handler;
10878}
10879
10880// node_modules/vnopts/lib/schemas/alias.js
10881var AliasSchema = class extends Schema {
10882 constructor(parameters) {
10883 super(parameters);
10884 this._sourceName = parameters.sourceName;
10885 }
10886 expected(utils) {
10887 return utils.schemas[this._sourceName].expected(utils);
10888 }
10889 validate(value, utils) {
10890 return utils.schemas[this._sourceName].validate(value, utils);
10891 }
10892 redirect(_value, _utils) {
10893 return this._sourceName;
10894 }
10895};
10896
10897// node_modules/vnopts/lib/schemas/any.js
10898var AnySchema = class extends Schema {
10899 expected() {
10900 return "anything";
10901 }
10902 validate() {
10903 return true;
10904 }
10905};
10906
10907// node_modules/vnopts/lib/schemas/array.js
10908var ArraySchema = class extends Schema {
10909 constructor({ valueSchema, name = valueSchema.name, ...handlers }) {
10910 super({ ...handlers, name });
10911 this._valueSchema = valueSchema;
10912 }
10913 expected(utils) {
10914 const { text, list } = utils.normalizeExpectedResult(this._valueSchema.expected(utils));
10915 return {
10916 text: text && `an array of ${text}`,
10917 list: list && {
10918 title: `an array of the following values`,
10919 values: [{ list }]
10920 }
10921 };
10922 }
10923 validate(value, utils) {
10924 if (!Array.isArray(value)) {
10925 return false;
10926 }
10927 const invalidValues = [];
10928 for (const subValue of value) {
10929 const subValidateResult = utils.normalizeValidateResult(this._valueSchema.validate(subValue, utils), subValue);
10930 if (subValidateResult !== true) {
10931 invalidValues.push(subValidateResult.value);
10932 }
10933 }
10934 return invalidValues.length === 0 ? true : { value: invalidValues };
10935 }
10936 deprecated(value, utils) {
10937 const deprecatedResult = [];
10938 for (const subValue of value) {
10939 const subDeprecatedResult = utils.normalizeDeprecatedResult(this._valueSchema.deprecated(subValue, utils), subValue);
10940 if (subDeprecatedResult !== false) {
10941 deprecatedResult.push(...subDeprecatedResult.map(({ value: deprecatedValue }) => ({
10942 value: [deprecatedValue]
10943 })));
10944 }
10945 }
10946 return deprecatedResult;
10947 }
10948 forward(value, utils) {
10949 const forwardResult = [];
10950 for (const subValue of value) {
10951 const subForwardResult = utils.normalizeForwardResult(this._valueSchema.forward(subValue, utils), subValue);
10952 forwardResult.push(...subForwardResult.map(wrapTransferResult));
10953 }
10954 return forwardResult;
10955 }
10956 redirect(value, utils) {
10957 const remain = [];
10958 const redirect = [];
10959 for (const subValue of value) {
10960 const subRedirectResult = utils.normalizeRedirectResult(this._valueSchema.redirect(subValue, utils), subValue);
10961 if ("remain" in subRedirectResult) {
10962 remain.push(subRedirectResult.remain);
10963 }
10964 redirect.push(...subRedirectResult.redirect.map(wrapTransferResult));
10965 }
10966 return remain.length === 0 ? { redirect } : { redirect, remain };
10967 }
10968 overlap(currentValue, newValue) {
10969 return currentValue.concat(newValue);
10970 }
10971};
10972function wrapTransferResult({ from, to }) {
10973 return { from: [from], to };
10974}
10975
10976// node_modules/vnopts/lib/schemas/boolean.js
10977var BooleanSchema = class extends Schema {
10978 expected() {
10979 return "true or false";
10980 }
10981 validate(value) {
10982 return typeof value === "boolean";
10983 }
10984};
10985
10986// node_modules/vnopts/lib/utils.js
10987function recordFromArray(array2, mainKey) {
10988 const record = /* @__PURE__ */ Object.create(null);
10989 for (const value of array2) {
10990 const key2 = value[mainKey];
10991 if (record[key2]) {
10992 throw new Error(`Duplicate ${mainKey} ${JSON.stringify(key2)}`);
10993 }
10994 record[key2] = value;
10995 }
10996 return record;
10997}
10998function mapFromArray(array2, mainKey) {
10999 const map2 = /* @__PURE__ */ new Map();
11000 for (const value of array2) {
11001 const key2 = value[mainKey];
11002 if (map2.has(key2)) {
11003 throw new Error(`Duplicate ${mainKey} ${JSON.stringify(key2)}`);
11004 }
11005 map2.set(key2, value);
11006 }
11007 return map2;
11008}
11009function createAutoChecklist() {
11010 const map2 = /* @__PURE__ */ Object.create(null);
11011 return (id) => {
11012 const idString = JSON.stringify(id);
11013 if (map2[idString]) {
11014 return true;
11015 }
11016 map2[idString] = true;
11017 return false;
11018 };
11019}
11020function partition(array2, predicate) {
11021 const trueArray = [];
11022 const falseArray = [];
11023 for (const value of array2) {
11024 if (predicate(value)) {
11025 trueArray.push(value);
11026 } else {
11027 falseArray.push(value);
11028 }
11029 }
11030 return [trueArray, falseArray];
11031}
11032function isInt(value) {
11033 return value === Math.floor(value);
11034}
11035function comparePrimitive(a, b) {
11036 if (a === b) {
11037 return 0;
11038 }
11039 const typeofA = typeof a;
11040 const typeofB = typeof b;
11041 const orders = [
11042 "undefined",
11043 "object",
11044 "boolean",
11045 "number",
11046 "string"
11047 ];
11048 if (typeofA !== typeofB) {
11049 return orders.indexOf(typeofA) - orders.indexOf(typeofB);
11050 }
11051 if (typeofA !== "string") {
11052 return Number(a) - Number(b);
11053 }
11054 return a.localeCompare(b);
11055}
11056function normalizeInvalidHandler(invalidHandler) {
11057 return (...args) => {
11058 const errorMessageOrError = invalidHandler(...args);
11059 return typeof errorMessageOrError === "string" ? new Error(errorMessageOrError) : errorMessageOrError;
11060 };
11061}
11062function normalizeDefaultResult(result) {
11063 return result === void 0 ? {} : result;
11064}
11065function normalizeExpectedResult(result) {
11066 if (typeof result === "string") {
11067 return { text: result };
11068 }
11069 const { text, list } = result;
11070 assert((text || list) !== void 0, "Unexpected `expected` result, there should be at least one field.");
11071 if (!list) {
11072 return { text };
11073 }
11074 return {
11075 text,
11076 list: {
11077 title: list.title,
11078 values: list.values.map(normalizeExpectedResult)
11079 }
11080 };
11081}
11082function normalizeValidateResult(result, value) {
11083 return result === true ? true : result === false ? { value } : result;
11084}
11085function normalizeDeprecatedResult(result, value, doNotNormalizeTrue = false) {
11086 return result === false ? false : result === true ? doNotNormalizeTrue ? true : [{ value }] : "value" in result ? [result] : result.length === 0 ? false : result;
11087}
11088function normalizeTransferResult(result, value) {
11089 return typeof result === "string" || "key" in result ? { from: value, to: result } : "from" in result ? { from: result.from, to: result.to } : { from: value, to: result.to };
11090}
11091function normalizeForwardResult(result, value) {
11092 return result === void 0 ? [] : Array.isArray(result) ? result.map((transferResult) => normalizeTransferResult(transferResult, value)) : [normalizeTransferResult(result, value)];
11093}
11094function normalizeRedirectResult(result, value) {
11095 const redirect = normalizeForwardResult(typeof result === "object" && "redirect" in result ? result.redirect : result, value);
11096 return redirect.length === 0 ? { remain: value, redirect } : typeof result === "object" && "remain" in result ? { remain: result.remain, redirect } : { redirect };
11097}
11098function assert(isValid, message) {
11099 if (!isValid) {
11100 throw new Error(message);
11101 }
11102}
11103
11104// node_modules/vnopts/lib/schemas/choice.js
11105var ChoiceSchema = class extends Schema {
11106 constructor(parameters) {
11107 super(parameters);
11108 this._choices = mapFromArray(parameters.choices.map((choice) => choice && typeof choice === "object" ? choice : { value: choice }), "value");
11109 }
11110 expected({ descriptor }) {
11111 const choiceDescriptions = Array.from(this._choices.keys()).map((value) => this._choices.get(value)).filter(({ hidden }) => !hidden).map((choiceInfo) => choiceInfo.value).sort(comparePrimitive).map(descriptor.value);
11112 const head = choiceDescriptions.slice(0, -2);
11113 const tail = choiceDescriptions.slice(-2);
11114 const message = head.concat(tail.join(" or ")).join(", ");
11115 return {
11116 text: message,
11117 list: {
11118 title: "one of the following values",
11119 values: choiceDescriptions
11120 }
11121 };
11122 }
11123 validate(value) {
11124 return this._choices.has(value);
11125 }
11126 deprecated(value) {
11127 const choiceInfo = this._choices.get(value);
11128 return choiceInfo && choiceInfo.deprecated ? { value } : false;
11129 }
11130 forward(value) {
11131 const choiceInfo = this._choices.get(value);
11132 return choiceInfo ? choiceInfo.forward : void 0;
11133 }
11134 redirect(value) {
11135 const choiceInfo = this._choices.get(value);
11136 return choiceInfo ? choiceInfo.redirect : void 0;
11137 }
11138};
11139
11140// node_modules/vnopts/lib/schemas/number.js
11141var NumberSchema = class extends Schema {
11142 expected() {
11143 return "a number";
11144 }
11145 validate(value, _utils) {
11146 return typeof value === "number";
11147 }
11148};
11149
11150// node_modules/vnopts/lib/schemas/integer.js
11151var IntegerSchema = class extends NumberSchema {
11152 expected() {
11153 return "an integer";
11154 }
11155 validate(value, utils) {
11156 return utils.normalizeValidateResult(super.validate(value, utils), value) === true && isInt(value);
11157 }
11158};
11159
11160// node_modules/vnopts/lib/schemas/string.js
11161var StringSchema = class extends Schema {
11162 expected() {
11163 return "a string";
11164 }
11165 validate(value) {
11166 return typeof value === "string";
11167 }
11168};
11169
11170// node_modules/vnopts/lib/defaults.js
11171var defaultDescriptor = apiDescriptor;
11172var defaultUnknownHandler = levenUnknownHandler;
11173var defaultInvalidHandler = commonInvalidHandler;
11174var defaultDeprecatedHandler = commonDeprecatedHandler;
11175
11176// node_modules/vnopts/lib/normalize.js
11177var Normalizer = class {
11178 constructor(schemas, opts) {
11179 const { logger = console, loggerPrintWidth = 80, descriptor = defaultDescriptor, unknown = defaultUnknownHandler, invalid = defaultInvalidHandler, deprecated = defaultDeprecatedHandler, missing = () => false, required = () => false, preprocess = (x) => x, postprocess = () => VALUE_UNCHANGED } = opts || {};
11180 this._utils = {
11181 descriptor,
11182 logger: (
11183 /* c8 ignore next */
11184 logger || { warn: () => {
11185 } }
11186 ),
11187 loggerPrintWidth,
11188 schemas: recordFromArray(schemas, "name"),
11189 normalizeDefaultResult,
11190 normalizeExpectedResult,
11191 normalizeDeprecatedResult,
11192 normalizeForwardResult,
11193 normalizeRedirectResult,
11194 normalizeValidateResult
11195 };
11196 this._unknownHandler = unknown;
11197 this._invalidHandler = normalizeInvalidHandler(invalid);
11198 this._deprecatedHandler = deprecated;
11199 this._identifyMissing = (k, o) => !(k in o) || missing(k, o);
11200 this._identifyRequired = required;
11201 this._preprocess = preprocess;
11202 this._postprocess = postprocess;
11203 this.cleanHistory();
11204 }
11205 cleanHistory() {
11206 this._hasDeprecationWarned = createAutoChecklist();
11207 }
11208 normalize(options8) {
11209 const newOptions = {};
11210 const preprocessed = this._preprocess(options8, this._utils);
11211 const restOptionsArray = [preprocessed];
11212 const applyNormalization = () => {
11213 while (restOptionsArray.length !== 0) {
11214 const currentOptions = restOptionsArray.shift();
11215 const transferredOptionsArray = this._applyNormalization(currentOptions, newOptions);
11216 restOptionsArray.push(...transferredOptionsArray);
11217 }
11218 };
11219 applyNormalization();
11220 for (const key2 of Object.keys(this._utils.schemas)) {
11221 const schema2 = this._utils.schemas[key2];
11222 if (!(key2 in newOptions)) {
11223 const defaultResult = normalizeDefaultResult(schema2.default(this._utils));
11224 if ("value" in defaultResult) {
11225 restOptionsArray.push({ [key2]: defaultResult.value });
11226 }
11227 }
11228 }
11229 applyNormalization();
11230 for (const key2 of Object.keys(this._utils.schemas)) {
11231 if (!(key2 in newOptions)) {
11232 continue;
11233 }
11234 const schema2 = this._utils.schemas[key2];
11235 const value = newOptions[key2];
11236 const newValue = schema2.postprocess(value, this._utils);
11237 if (newValue === VALUE_UNCHANGED) {
11238 continue;
11239 }
11240 this._applyValidation(newValue, key2, schema2);
11241 newOptions[key2] = newValue;
11242 }
11243 this._applyPostprocess(newOptions);
11244 this._applyRequiredCheck(newOptions);
11245 return newOptions;
11246 }
11247 _applyNormalization(options8, newOptions) {
11248 const transferredOptionsArray = [];
11249 const { knownKeys, unknownKeys } = this._partitionOptionKeys(options8);
11250 for (const key2 of knownKeys) {
11251 const schema2 = this._utils.schemas[key2];
11252 const value = schema2.preprocess(options8[key2], this._utils);
11253 this._applyValidation(value, key2, schema2);
11254 const appendTransferredOptions = ({ from, to }) => {
11255 transferredOptionsArray.push(typeof to === "string" ? { [to]: from } : { [to.key]: to.value });
11256 };
11257 const warnDeprecated = ({ value: currentValue, redirectTo }) => {
11258 const deprecatedResult = normalizeDeprecatedResult(
11259 schema2.deprecated(currentValue, this._utils),
11260 value,
11261 /* doNotNormalizeTrue */
11262 true
11263 );
11264 if (deprecatedResult === false) {
11265 return;
11266 }
11267 if (deprecatedResult === true) {
11268 if (!this._hasDeprecationWarned(key2)) {
11269 this._utils.logger.warn(this._deprecatedHandler(key2, redirectTo, this._utils));
11270 }
11271 } else {
11272 for (const { value: deprecatedValue } of deprecatedResult) {
11273 const pair = { key: key2, value: deprecatedValue };
11274 if (!this._hasDeprecationWarned(pair)) {
11275 const redirectToPair = typeof redirectTo === "string" ? { key: redirectTo, value: deprecatedValue } : redirectTo;
11276 this._utils.logger.warn(this._deprecatedHandler(pair, redirectToPair, this._utils));
11277 }
11278 }
11279 }
11280 };
11281 const forwardResult = normalizeForwardResult(schema2.forward(value, this._utils), value);
11282 forwardResult.forEach(appendTransferredOptions);
11283 const redirectResult = normalizeRedirectResult(schema2.redirect(value, this._utils), value);
11284 redirectResult.redirect.forEach(appendTransferredOptions);
11285 if ("remain" in redirectResult) {
11286 const remainingValue = redirectResult.remain;
11287 newOptions[key2] = key2 in newOptions ? schema2.overlap(newOptions[key2], remainingValue, this._utils) : remainingValue;
11288 warnDeprecated({ value: remainingValue });
11289 }
11290 for (const { from, to } of redirectResult.redirect) {
11291 warnDeprecated({ value: from, redirectTo: to });
11292 }
11293 }
11294 for (const key2 of unknownKeys) {
11295 const value = options8[key2];
11296 this._applyUnknownHandler(key2, value, newOptions, (knownResultKey, knownResultValue) => {
11297 transferredOptionsArray.push({ [knownResultKey]: knownResultValue });
11298 });
11299 }
11300 return transferredOptionsArray;
11301 }
11302 _applyRequiredCheck(options8) {
11303 for (const key2 of Object.keys(this._utils.schemas)) {
11304 if (this._identifyMissing(key2, options8)) {
11305 if (this._identifyRequired(key2)) {
11306 throw this._invalidHandler(key2, VALUE_NOT_EXIST, this._utils);
11307 }
11308 }
11309 }
11310 }
11311 _partitionOptionKeys(options8) {
11312 const [knownKeys, unknownKeys] = partition(Object.keys(options8).filter((key2) => !this._identifyMissing(key2, options8)), (key2) => key2 in this._utils.schemas);
11313 return { knownKeys, unknownKeys };
11314 }
11315 _applyValidation(value, key2, schema2) {
11316 const validateResult = normalizeValidateResult(schema2.validate(value, this._utils), value);
11317 if (validateResult !== true) {
11318 throw this._invalidHandler(key2, validateResult.value, this._utils);
11319 }
11320 }
11321 _applyUnknownHandler(key2, value, newOptions, knownResultHandler) {
11322 const unknownResult = this._unknownHandler(key2, value, this._utils);
11323 if (!unknownResult) {
11324 return;
11325 }
11326 for (const resultKey of Object.keys(unknownResult)) {
11327 if (this._identifyMissing(resultKey, unknownResult)) {
11328 continue;
11329 }
11330 const resultValue = unknownResult[resultKey];
11331 if (resultKey in this._utils.schemas) {
11332 knownResultHandler(resultKey, resultValue);
11333 } else {
11334 newOptions[resultKey] = resultValue;
11335 }
11336 }
11337 }
11338 _applyPostprocess(options8) {
11339 const postprocessed = this._postprocess(options8, this._utils);
11340 if (postprocessed === VALUE_UNCHANGED) {
11341 return;
11342 }
11343 if (postprocessed.delete) {
11344 for (const deleteKey of postprocessed.delete) {
11345 delete options8[deleteKey];
11346 }
11347 }
11348 if (postprocessed.override) {
11349 const { knownKeys, unknownKeys } = this._partitionOptionKeys(postprocessed.override);
11350 for (const key2 of knownKeys) {
11351 const value = postprocessed.override[key2];
11352 this._applyValidation(value, key2, this._utils.schemas[key2]);
11353 options8[key2] = value;
11354 }
11355 for (const key2 of unknownKeys) {
11356 const value = postprocessed.override[key2];
11357 this._applyUnknownHandler(key2, value, options8, (knownResultKey, knownResultValue) => {
11358 const schema2 = this._utils.schemas[knownResultKey];
11359 this._applyValidation(knownResultValue, knownResultKey, schema2);
11360 options8[knownResultKey] = knownResultValue;
11361 });
11362 }
11363 }
11364 }
11365};
11366
11367// src/common/errors.js
11368var errors_exports = {};
11369__export(errors_exports, {
11370 ArgExpansionBailout: () => ArgExpansionBailout,
11371 ConfigError: () => ConfigError,
11372 UndefinedParserError: () => UndefinedParserError
11373});
11374var ConfigError = class extends Error {
11375 name = "ConfigError";
11376};
11377var UndefinedParserError = class extends Error {
11378 name = "UndefinedParserError";
11379};
11380var ArgExpansionBailout = class extends Error {
11381 name = "ArgExpansionBailout";
11382};
11383
11384// src/config/resolve-config.js
11385var import_micromatch = __toESM(require_micromatch(), 1);
11386import path9 from "path";
11387
11388// node_modules/url-or-path/index.js
11389import { fileURLToPath, pathToFileURL } from "url";
11390var URL_STRING_PREFIX = "file:";
11391var isUrlInstance = (value) => value instanceof URL;
11392var isUrlString = (value) => typeof value === "string" && value.startsWith(URL_STRING_PREFIX);
11393var isUrl = (urlOrPath) => isUrlInstance(urlOrPath) || isUrlString(urlOrPath);
11394var toPath = (urlOrPath) => isUrl(urlOrPath) ? fileURLToPath(urlOrPath) : urlOrPath;
11395
11396// src/utils/partition.js
11397function partition2(array2, predicate) {
11398 const result = [[], []];
11399 for (const value of array2) {
11400 result[predicate(value) ? 0 : 1].push(value);
11401 }
11402 return result;
11403}
11404var partition_default = partition2;
11405
11406// src/config/editorconfig/index.js
11407var import_editorconfig = __toESM(require_src(), 1);
11408import path4 from "path";
11409
11410// src/config/find-project-root.js
11411import * as path3 from "path";
11412
11413// src/utils/is-directory.js
11414import fs from "fs/promises";
11415async function isDirectory(directory, options8) {
11416 const allowSymlinks = (options8 == null ? void 0 : options8.allowSymlinks) ?? true;
11417 let stats;
11418 try {
11419 stats = await (allowSymlinks ? fs.stat : fs.lstat)(toPath(directory));
11420 } catch {
11421 return false;
11422 }
11423 return stats.isDirectory();
11424}
11425var is_directory_default = isDirectory;
11426
11427// src/config/searcher.js
11428import path2 from "path";
11429
11430// node_modules/iterate-directory-up/index.js
11431import * as path from "path";
11432var toAbsolutePath = (value) => path.resolve(toPath(value));
11433function* iterateDirectoryUp(from, to) {
11434 from = toAbsolutePath(from);
11435 const { root: root2 } = path.parse(from);
11436 to = to ? toAbsolutePath(to) : root2;
11437 if (from !== to && !from.startsWith(to)) {
11438 return;
11439 }
11440 for (let directory = from; directory !== to; directory = path.dirname(directory)) {
11441 yield directory;
11442 }
11443 yield to;
11444}
11445var iterate_directory_up_default = iterateDirectoryUp;
11446
11447// src/config/searcher.js
11448var _names, _filter, _stopDirectory, _cache, _Searcher_instances, searchInDirectory_fn;
11449var Searcher = class {
11450 /**
11451 * @param {{
11452 * names: string[],
11453 * filter: (fileOrDirectory: {name: string, path: string}) => Promise<boolean>,
11454 * stopDirectory?: string,
11455 * }} param0
11456 */
11457 constructor({ names, filter: filter2, stopDirectory }) {
11458 __privateAdd(this, _Searcher_instances);
11459 __privateAdd(this, _names);
11460 __privateAdd(this, _filter);
11461 __privateAdd(this, _stopDirectory);
11462 __privateAdd(this, _cache, /* @__PURE__ */ new Map());
11463 __privateSet(this, _names, names);
11464 __privateSet(this, _filter, filter2);
11465 __privateSet(this, _stopDirectory, stopDirectory);
11466 }
11467 async search(startDirectory, { shouldCache }) {
11468 const cache3 = __privateGet(this, _cache);
11469 if (shouldCache && cache3.has(startDirectory)) {
11470 return cache3.get(startDirectory);
11471 }
11472 const searchedDirectories = [];
11473 let result;
11474 for (const directory of iterate_directory_up_default(
11475 startDirectory,
11476 __privateGet(this, _stopDirectory)
11477 )) {
11478 searchedDirectories.push(directory);
11479 result = await __privateMethod(this, _Searcher_instances, searchInDirectory_fn).call(this, directory, shouldCache);
11480 if (result) {
11481 break;
11482 }
11483 }
11484 for (const directory of searchedDirectories) {
11485 cache3.set(directory, result);
11486 }
11487 return result;
11488 }
11489 clearCache() {
11490 __privateGet(this, _cache).clear();
11491 }
11492};
11493_names = new WeakMap();
11494_filter = new WeakMap();
11495_stopDirectory = new WeakMap();
11496_cache = new WeakMap();
11497_Searcher_instances = new WeakSet();
11498searchInDirectory_fn = async function(directory, shouldCache) {
11499 const cache3 = __privateGet(this, _cache);
11500 if (shouldCache && cache3.has(directory)) {
11501 return cache3.get(directory);
11502 }
11503 for (const name of __privateGet(this, _names)) {
11504 const fileOrDirectory = path2.join(directory, name);
11505 if (await __privateGet(this, _filter).call(this, { name, path: fileOrDirectory })) {
11506 return fileOrDirectory;
11507 }
11508 }
11509};
11510var searcher_default = Searcher;
11511
11512// src/config/find-project-root.js
11513var MARKERS = [".git", ".hg"];
11514var searcher;
11515var searchOptions = {
11516 names: MARKERS,
11517 filter: ({ path: directory }) => is_directory_default(directory, { allowSymlinks: false })
11518};
11519async function findProjectRoot(startDirectory, options8) {
11520 searcher ?? (searcher = new searcher_default(searchOptions));
11521 const mark = await searcher.search(startDirectory, options8);
11522 return mark ? path3.dirname(mark) : void 0;
11523}
11524function clearFindProjectRootCache() {
11525 searcher == null ? void 0 : searcher.clearCache();
11526}
11527
11528// src/config/editorconfig/editorconfig-to-prettier.js
11529function removeUnset(editorConfig) {
11530 const result = {};
11531 const keys = Object.keys(editorConfig);
11532 for (let i = 0; i < keys.length; i++) {
11533 const key2 = keys[i];
11534 if (editorConfig[key2] === "unset") {
11535 continue;
11536 }
11537 result[key2] = editorConfig[key2];
11538 }
11539 return result;
11540}
11541function editorConfigToPrettier(editorConfig) {
11542 if (!editorConfig) {
11543 return null;
11544 }
11545 editorConfig = removeUnset(editorConfig);
11546 if (Object.keys(editorConfig).length === 0) {
11547 return null;
11548 }
11549 const result = {};
11550 if (editorConfig.indent_style) {
11551 result.useTabs = editorConfig.indent_style === "tab";
11552 }
11553 if (editorConfig.indent_size === "tab") {
11554 result.useTabs = true;
11555 }
11556 if (result.useTabs && editorConfig.tab_width) {
11557 result.tabWidth = editorConfig.tab_width;
11558 } else if (editorConfig.indent_style === "space" && editorConfig.indent_size && editorConfig.indent_size !== "tab") {
11559 result.tabWidth = editorConfig.indent_size;
11560 } else if (editorConfig.tab_width !== void 0) {
11561 result.tabWidth = editorConfig.tab_width;
11562 }
11563 if (editorConfig.max_line_length) {
11564 if (editorConfig.max_line_length === "off") {
11565 result.printWidth = Number.POSITIVE_INFINITY;
11566 } else {
11567 result.printWidth = editorConfig.max_line_length;
11568 }
11569 }
11570 if (editorConfig.quote_type === "single") {
11571 result.singleQuote = true;
11572 } else if (editorConfig.quote_type === "double") {
11573 result.singleQuote = false;
11574 }
11575 if (["cr", "crlf", "lf"].includes(editorConfig.end_of_line)) {
11576 result.endOfLine = editorConfig.end_of_line;
11577 }
11578 return result;
11579}
11580var editorconfig_to_prettier_default = editorConfigToPrettier;
11581
11582// src/config/editorconfig/index.js
11583var editorconfigCache = /* @__PURE__ */ new Map();
11584function clearEditorconfigCache() {
11585 clearFindProjectRootCache();
11586 editorconfigCache.clear();
11587}
11588async function loadEditorconfigInternal(file, { shouldCache }) {
11589 const directory = path4.dirname(file);
11590 const root2 = await findProjectRoot(directory, { shouldCache });
11591 const editorConfig = await import_editorconfig.default.parse(file, { root: root2 });
11592 const config = editorconfig_to_prettier_default(editorConfig);
11593 return config;
11594}
11595function loadEditorconfig(file, { shouldCache }) {
11596 file = path4.resolve(file);
11597 if (!shouldCache || !editorconfigCache.has(file)) {
11598 editorconfigCache.set(
11599 file,
11600 loadEditorconfigInternal(file, { shouldCache })
11601 );
11602 }
11603 return editorconfigCache.get(file);
11604}
11605
11606// src/config/prettier-config/index.js
11607import path8 from "path";
11608
11609// src/common/mockable.js
11610var import_ci_info = __toESM(require_ci_info(), 1);
11611import fs2 from "fs/promises";
11612
11613// node_modules/get-stdin/index.js
11614var { stdin } = process;
11615async function getStdin() {
11616 let result = "";
11617 if (stdin.isTTY) {
11618 return result;
11619 }
11620 stdin.setEncoding("utf8");
11621 for await (const chunk of stdin) {
11622 result += chunk;
11623 }
11624 return result;
11625}
11626getStdin.buffer = async () => {
11627 const result = [];
11628 let length = 0;
11629 if (stdin.isTTY) {
11630 return Buffer.concat([]);
11631 }
11632 for await (const chunk of stdin) {
11633 result.push(chunk);
11634 length += chunk.length;
11635 }
11636 return Buffer.concat(result, length);
11637};
11638
11639// src/common/mockable.js
11640function writeFormattedFile(file, data) {
11641 return fs2.writeFile(file, data);
11642}
11643var mockable = {
11644 getPrettierConfigSearchStopDirectory: () => void 0,
11645 getStdin,
11646 isCI: () => import_ci_info.isCI,
11647 writeFormattedFile
11648};
11649var mockable_default = mockable;
11650
11651// src/utils/is-file.js
11652import fs3 from "fs/promises";
11653async function isFile(file, options8) {
11654 const allowSymlinks = (options8 == null ? void 0 : options8.allowSymlinks) ?? true;
11655 let stats;
11656 try {
11657 stats = await (allowSymlinks ? fs3.stat : fs3.lstat)(toPath(file));
11658 } catch {
11659 return false;
11660 }
11661 return stats.isFile();
11662}
11663var is_file_default = isFile;
11664
11665// src/config/prettier-config/loaders.js
11666import { pathToFileURL as pathToFileURL2 } from "url";
11667
11668// node_modules/js-yaml/dist/js-yaml.mjs
11669function isNothing(subject) {
11670 return typeof subject === "undefined" || subject === null;
11671}
11672function isObject(subject) {
11673 return typeof subject === "object" && subject !== null;
11674}
11675function toArray(sequence) {
11676 if (Array.isArray(sequence)) return sequence;
11677 else if (isNothing(sequence)) return [];
11678 return [sequence];
11679}
11680function extend(target, source2) {
11681 var index, length, key2, sourceKeys;
11682 if (source2) {
11683 sourceKeys = Object.keys(source2);
11684 for (index = 0, length = sourceKeys.length; index < length; index += 1) {
11685 key2 = sourceKeys[index];
11686 target[key2] = source2[key2];
11687 }
11688 }
11689 return target;
11690}
11691function repeat(string, count) {
11692 var result = "", cycle;
11693 for (cycle = 0; cycle < count; cycle += 1) {
11694 result += string;
11695 }
11696 return result;
11697}
11698function isNegativeZero(number) {
11699 return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
11700}
11701var isNothing_1 = isNothing;
11702var isObject_1 = isObject;
11703var toArray_1 = toArray;
11704var repeat_1 = repeat;
11705var isNegativeZero_1 = isNegativeZero;
11706var extend_1 = extend;
11707var common = {
11708 isNothing: isNothing_1,
11709 isObject: isObject_1,
11710 toArray: toArray_1,
11711 repeat: repeat_1,
11712 isNegativeZero: isNegativeZero_1,
11713 extend: extend_1
11714};
11715function formatError(exception2, compact) {
11716 var where = "", message = exception2.reason || "(unknown reason)";
11717 if (!exception2.mark) return message;
11718 if (exception2.mark.name) {
11719 where += 'in "' + exception2.mark.name + '" ';
11720 }
11721 where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
11722 if (!compact && exception2.mark.snippet) {
11723 where += "\n\n" + exception2.mark.snippet;
11724 }
11725 return message + " " + where;
11726}
11727function YAMLException$1(reason, mark) {
11728 Error.call(this);
11729 this.name = "YAMLException";
11730 this.reason = reason;
11731 this.mark = mark;
11732 this.message = formatError(this, false);
11733 if (Error.captureStackTrace) {
11734 Error.captureStackTrace(this, this.constructor);
11735 } else {
11736 this.stack = new Error().stack || "";
11737 }
11738}
11739YAMLException$1.prototype = Object.create(Error.prototype);
11740YAMLException$1.prototype.constructor = YAMLException$1;
11741YAMLException$1.prototype.toString = function toString(compact) {
11742 return this.name + ": " + formatError(this, compact);
11743};
11744var exception = YAMLException$1;
11745function getLine(buffer2, lineStart, lineEnd, position, maxLineLength) {
11746 var head = "";
11747 var tail = "";
11748 var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
11749 if (position - lineStart > maxHalfLength) {
11750 head = " ... ";
11751 lineStart = position - maxHalfLength + head.length;
11752 }
11753 if (lineEnd - position > maxHalfLength) {
11754 tail = " ...";
11755 lineEnd = position + maxHalfLength - tail.length;
11756 }
11757 return {
11758 str: head + buffer2.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail,
11759 pos: position - lineStart + head.length
11760 // relative position
11761 };
11762}
11763function padStart(string, max) {
11764 return common.repeat(" ", max - string.length) + string;
11765}
11766function makeSnippet(mark, options8) {
11767 options8 = Object.create(options8 || null);
11768 if (!mark.buffer) return null;
11769 if (!options8.maxLength) options8.maxLength = 79;
11770 if (typeof options8.indent !== "number") options8.indent = 1;
11771 if (typeof options8.linesBefore !== "number") options8.linesBefore = 3;
11772 if (typeof options8.linesAfter !== "number") options8.linesAfter = 2;
11773 var re = /\r?\n|\r|\0/g;
11774 var lineStarts = [0];
11775 var lineEnds = [];
11776 var match;
11777 var foundLineNo = -1;
11778 while (match = re.exec(mark.buffer)) {
11779 lineEnds.push(match.index);
11780 lineStarts.push(match.index + match[0].length);
11781 if (mark.position <= match.index && foundLineNo < 0) {
11782 foundLineNo = lineStarts.length - 2;
11783 }
11784 }
11785 if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
11786 var result = "", i, line3;
11787 var lineNoLength = Math.min(mark.line + options8.linesAfter, lineEnds.length).toString().length;
11788 var maxLineLength = options8.maxLength - (options8.indent + lineNoLength + 3);
11789 for (i = 1; i <= options8.linesBefore; i++) {
11790 if (foundLineNo - i < 0) break;
11791 line3 = getLine(
11792 mark.buffer,
11793 lineStarts[foundLineNo - i],
11794 lineEnds[foundLineNo - i],
11795 mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
11796 maxLineLength
11797 );
11798 result = common.repeat(" ", options8.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line3.str + "\n" + result;
11799 }
11800 line3 = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
11801 result += common.repeat(" ", options8.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line3.str + "\n";
11802 result += common.repeat("-", options8.indent + lineNoLength + 3 + line3.pos) + "^\n";
11803 for (i = 1; i <= options8.linesAfter; i++) {
11804 if (foundLineNo + i >= lineEnds.length) break;
11805 line3 = getLine(
11806 mark.buffer,
11807 lineStarts[foundLineNo + i],
11808 lineEnds[foundLineNo + i],
11809 mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
11810 maxLineLength
11811 );
11812 result += common.repeat(" ", options8.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line3.str + "\n";
11813 }
11814 return result.replace(/\n$/, "");
11815}
11816var snippet = makeSnippet;
11817var TYPE_CONSTRUCTOR_OPTIONS = [
11818 "kind",
11819 "multi",
11820 "resolve",
11821 "construct",
11822 "instanceOf",
11823 "predicate",
11824 "represent",
11825 "representName",
11826 "defaultStyle",
11827 "styleAliases"
11828];
11829var YAML_NODE_KINDS = [
11830 "scalar",
11831 "sequence",
11832 "mapping"
11833];
11834function compileStyleAliases(map2) {
11835 var result = {};
11836 if (map2 !== null) {
11837 Object.keys(map2).forEach(function(style) {
11838 map2[style].forEach(function(alias) {
11839 result[String(alias)] = style;
11840 });
11841 });
11842 }
11843 return result;
11844}
11845function Type$1(tag, options8) {
11846 options8 = options8 || {};
11847 Object.keys(options8).forEach(function(name) {
11848 if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
11849 throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
11850 }
11851 });
11852 this.options = options8;
11853 this.tag = tag;
11854 this.kind = options8["kind"] || null;
11855 this.resolve = options8["resolve"] || function() {
11856 return true;
11857 };
11858 this.construct = options8["construct"] || function(data) {
11859 return data;
11860 };
11861 this.instanceOf = options8["instanceOf"] || null;
11862 this.predicate = options8["predicate"] || null;
11863 this.represent = options8["represent"] || null;
11864 this.representName = options8["representName"] || null;
11865 this.defaultStyle = options8["defaultStyle"] || null;
11866 this.multi = options8["multi"] || false;
11867 this.styleAliases = compileStyleAliases(options8["styleAliases"] || null);
11868 if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
11869 throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
11870 }
11871}
11872var type = Type$1;
11873function compileList(schema2, name) {
11874 var result = [];
11875 schema2[name].forEach(function(currentType) {
11876 var newIndex = result.length;
11877 result.forEach(function(previousType, previousIndex) {
11878 if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
11879 newIndex = previousIndex;
11880 }
11881 });
11882 result[newIndex] = currentType;
11883 });
11884 return result;
11885}
11886function compileMap() {
11887 var result = {
11888 scalar: {},
11889 sequence: {},
11890 mapping: {},
11891 fallback: {},
11892 multi: {
11893 scalar: [],
11894 sequence: [],
11895 mapping: [],
11896 fallback: []
11897 }
11898 }, index, length;
11899 function collectType(type2) {
11900 if (type2.multi) {
11901 result.multi[type2.kind].push(type2);
11902 result.multi["fallback"].push(type2);
11903 } else {
11904 result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2;
11905 }
11906 }
11907 for (index = 0, length = arguments.length; index < length; index += 1) {
11908 arguments[index].forEach(collectType);
11909 }
11910 return result;
11911}
11912function Schema$1(definition) {
11913 return this.extend(definition);
11914}
11915Schema$1.prototype.extend = function extend2(definition) {
11916 var implicit = [];
11917 var explicit = [];
11918 if (definition instanceof type) {
11919 explicit.push(definition);
11920 } else if (Array.isArray(definition)) {
11921 explicit = explicit.concat(definition);
11922 } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
11923 if (definition.implicit) implicit = implicit.concat(definition.implicit);
11924 if (definition.explicit) explicit = explicit.concat(definition.explicit);
11925 } else {
11926 throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
11927 }
11928 implicit.forEach(function(type$1) {
11929 if (!(type$1 instanceof type)) {
11930 throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
11931 }
11932 if (type$1.loadKind && type$1.loadKind !== "scalar") {
11933 throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
11934 }
11935 if (type$1.multi) {
11936 throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
11937 }
11938 });
11939 explicit.forEach(function(type$1) {
11940 if (!(type$1 instanceof type)) {
11941 throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
11942 }
11943 });
11944 var result = Object.create(Schema$1.prototype);
11945 result.implicit = (this.implicit || []).concat(implicit);
11946 result.explicit = (this.explicit || []).concat(explicit);
11947 result.compiledImplicit = compileList(result, "implicit");
11948 result.compiledExplicit = compileList(result, "explicit");
11949 result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
11950 return result;
11951};
11952var schema = Schema$1;
11953var str = new type("tag:yaml.org,2002:str", {
11954 kind: "scalar",
11955 construct: function(data) {
11956 return data !== null ? data : "";
11957 }
11958});
11959var seq = new type("tag:yaml.org,2002:seq", {
11960 kind: "sequence",
11961 construct: function(data) {
11962 return data !== null ? data : [];
11963 }
11964});
11965var map = new type("tag:yaml.org,2002:map", {
11966 kind: "mapping",
11967 construct: function(data) {
11968 return data !== null ? data : {};
11969 }
11970});
11971var failsafe = new schema({
11972 explicit: [
11973 str,
11974 seq,
11975 map
11976 ]
11977});
11978function resolveYamlNull(data) {
11979 if (data === null) return true;
11980 var max = data.length;
11981 return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
11982}
11983function constructYamlNull() {
11984 return null;
11985}
11986function isNull(object) {
11987 return object === null;
11988}
11989var _null = new type("tag:yaml.org,2002:null", {
11990 kind: "scalar",
11991 resolve: resolveYamlNull,
11992 construct: constructYamlNull,
11993 predicate: isNull,
11994 represent: {
11995 canonical: function() {
11996 return "~";
11997 },
11998 lowercase: function() {
11999 return "null";
12000 },
12001 uppercase: function() {
12002 return "NULL";
12003 },
12004 camelcase: function() {
12005 return "Null";
12006 },
12007 empty: function() {
12008 return "";
12009 }
12010 },
12011 defaultStyle: "lowercase"
12012});
12013function resolveYamlBoolean(data) {
12014 if (data === null) return false;
12015 var max = data.length;
12016 return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
12017}
12018function constructYamlBoolean(data) {
12019 return data === "true" || data === "True" || data === "TRUE";
12020}
12021function isBoolean(object) {
12022 return Object.prototype.toString.call(object) === "[object Boolean]";
12023}
12024var bool = new type("tag:yaml.org,2002:bool", {
12025 kind: "scalar",
12026 resolve: resolveYamlBoolean,
12027 construct: constructYamlBoolean,
12028 predicate: isBoolean,
12029 represent: {
12030 lowercase: function(object) {
12031 return object ? "true" : "false";
12032 },
12033 uppercase: function(object) {
12034 return object ? "TRUE" : "FALSE";
12035 },
12036 camelcase: function(object) {
12037 return object ? "True" : "False";
12038 }
12039 },
12040 defaultStyle: "lowercase"
12041});
12042function isHexCode(c2) {
12043 return 48 <= c2 && c2 <= 57 || 65 <= c2 && c2 <= 70 || 97 <= c2 && c2 <= 102;
12044}
12045function isOctCode(c2) {
12046 return 48 <= c2 && c2 <= 55;
12047}
12048function isDecCode(c2) {
12049 return 48 <= c2 && c2 <= 57;
12050}
12051function resolveYamlInteger(data) {
12052 if (data === null) return false;
12053 var max = data.length, index = 0, hasDigits = false, ch;
12054 if (!max) return false;
12055 ch = data[index];
12056 if (ch === "-" || ch === "+") {
12057 ch = data[++index];
12058 }
12059 if (ch === "0") {
12060 if (index + 1 === max) return true;
12061 ch = data[++index];
12062 if (ch === "b") {
12063 index++;
12064 for (; index < max; index++) {
12065 ch = data[index];
12066 if (ch === "_") continue;
12067 if (ch !== "0" && ch !== "1") return false;
12068 hasDigits = true;
12069 }
12070 return hasDigits && ch !== "_";
12071 }
12072 if (ch === "x") {
12073 index++;
12074 for (; index < max; index++) {
12075 ch = data[index];
12076 if (ch === "_") continue;
12077 if (!isHexCode(data.charCodeAt(index))) return false;
12078 hasDigits = true;
12079 }
12080 return hasDigits && ch !== "_";
12081 }
12082 if (ch === "o") {
12083 index++;
12084 for (; index < max; index++) {
12085 ch = data[index];
12086 if (ch === "_") continue;
12087 if (!isOctCode(data.charCodeAt(index))) return false;
12088 hasDigits = true;
12089 }
12090 return hasDigits && ch !== "_";
12091 }
12092 }
12093 if (ch === "_") return false;
12094 for (; index < max; index++) {
12095 ch = data[index];
12096 if (ch === "_") continue;
12097 if (!isDecCode(data.charCodeAt(index))) {
12098 return false;
12099 }
12100 hasDigits = true;
12101 }
12102 if (!hasDigits || ch === "_") return false;
12103 return true;
12104}
12105function constructYamlInteger(data) {
12106 var value = data, sign2 = 1, ch;
12107 if (value.indexOf("_") !== -1) {
12108 value = value.replace(/_/g, "");
12109 }
12110 ch = value[0];
12111 if (ch === "-" || ch === "+") {
12112 if (ch === "-") sign2 = -1;
12113 value = value.slice(1);
12114 ch = value[0];
12115 }
12116 if (value === "0") return 0;
12117 if (ch === "0") {
12118 if (value[1] === "b") return sign2 * parseInt(value.slice(2), 2);
12119 if (value[1] === "x") return sign2 * parseInt(value.slice(2), 16);
12120 if (value[1] === "o") return sign2 * parseInt(value.slice(2), 8);
12121 }
12122 return sign2 * parseInt(value, 10);
12123}
12124function isInteger(object) {
12125 return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
12126}
12127var int = new type("tag:yaml.org,2002:int", {
12128 kind: "scalar",
12129 resolve: resolveYamlInteger,
12130 construct: constructYamlInteger,
12131 predicate: isInteger,
12132 represent: {
12133 binary: function(obj) {
12134 return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
12135 },
12136 octal: function(obj) {
12137 return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
12138 },
12139 decimal: function(obj) {
12140 return obj.toString(10);
12141 },
12142 /* eslint-disable max-len */
12143 hexadecimal: function(obj) {
12144 return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
12145 }
12146 },
12147 defaultStyle: "decimal",
12148 styleAliases: {
12149 binary: [2, "bin"],
12150 octal: [8, "oct"],
12151 decimal: [10, "dec"],
12152 hexadecimal: [16, "hex"]
12153 }
12154});
12155var YAML_FLOAT_PATTERN = new RegExp(
12156 // 2.5e4, 2.5 and integers
12157 "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
12158);
12159function resolveYamlFloat(data) {
12160 if (data === null) return false;
12161 if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_`
12162 // Probably should update regexp & check speed
12163 data[data.length - 1] === "_") {
12164 return false;
12165 }
12166 return true;
12167}
12168function constructYamlFloat(data) {
12169 var value, sign2;
12170 value = data.replace(/_/g, "").toLowerCase();
12171 sign2 = value[0] === "-" ? -1 : 1;
12172 if ("+-".indexOf(value[0]) >= 0) {
12173 value = value.slice(1);
12174 }
12175 if (value === ".inf") {
12176 return sign2 === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
12177 } else if (value === ".nan") {
12178 return NaN;
12179 }
12180 return sign2 * parseFloat(value, 10);
12181}
12182var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
12183function representYamlFloat(object, style) {
12184 var res;
12185 if (isNaN(object)) {
12186 switch (style) {
12187 case "lowercase":
12188 return ".nan";
12189 case "uppercase":
12190 return ".NAN";
12191 case "camelcase":
12192 return ".NaN";
12193 }
12194 } else if (Number.POSITIVE_INFINITY === object) {
12195 switch (style) {
12196 case "lowercase":
12197 return ".inf";
12198 case "uppercase":
12199 return ".INF";
12200 case "camelcase":
12201 return ".Inf";
12202 }
12203 } else if (Number.NEGATIVE_INFINITY === object) {
12204 switch (style) {
12205 case "lowercase":
12206 return "-.inf";
12207 case "uppercase":
12208 return "-.INF";
12209 case "camelcase":
12210 return "-.Inf";
12211 }
12212 } else if (common.isNegativeZero(object)) {
12213 return "-0.0";
12214 }
12215 res = object.toString(10);
12216 return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
12217}
12218function isFloat(object) {
12219 return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
12220}
12221var float = new type("tag:yaml.org,2002:float", {
12222 kind: "scalar",
12223 resolve: resolveYamlFloat,
12224 construct: constructYamlFloat,
12225 predicate: isFloat,
12226 represent: representYamlFloat,
12227 defaultStyle: "lowercase"
12228});
12229var json = failsafe.extend({
12230 implicit: [
12231 _null,
12232 bool,
12233 int,
12234 float
12235 ]
12236});
12237var core = json;
12238var YAML_DATE_REGEXP = new RegExp(
12239 "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
12240);
12241var YAML_TIMESTAMP_REGEXP = new RegExp(
12242 "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
12243);
12244function resolveYamlTimestamp(data) {
12245 if (data === null) return false;
12246 if (YAML_DATE_REGEXP.exec(data) !== null) return true;
12247 if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
12248 return false;
12249}
12250function constructYamlTimestamp(data) {
12251 var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
12252 match = YAML_DATE_REGEXP.exec(data);
12253 if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
12254 if (match === null) throw new Error("Date resolve error");
12255 year = +match[1];
12256 month = +match[2] - 1;
12257 day = +match[3];
12258 if (!match[4]) {
12259 return new Date(Date.UTC(year, month, day));
12260 }
12261 hour = +match[4];
12262 minute = +match[5];
12263 second = +match[6];
12264 if (match[7]) {
12265 fraction = match[7].slice(0, 3);
12266 while (fraction.length < 3) {
12267 fraction += "0";
12268 }
12269 fraction = +fraction;
12270 }
12271 if (match[9]) {
12272 tz_hour = +match[10];
12273 tz_minute = +(match[11] || 0);
12274 delta = (tz_hour * 60 + tz_minute) * 6e4;
12275 if (match[9] === "-") delta = -delta;
12276 }
12277 date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
12278 if (delta) date.setTime(date.getTime() - delta);
12279 return date;
12280}
12281function representYamlTimestamp(object) {
12282 return object.toISOString();
12283}
12284var timestamp = new type("tag:yaml.org,2002:timestamp", {
12285 kind: "scalar",
12286 resolve: resolveYamlTimestamp,
12287 construct: constructYamlTimestamp,
12288 instanceOf: Date,
12289 represent: representYamlTimestamp
12290});
12291function resolveYamlMerge(data) {
12292 return data === "<<" || data === null;
12293}
12294var merge = new type("tag:yaml.org,2002:merge", {
12295 kind: "scalar",
12296 resolve: resolveYamlMerge
12297});
12298var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
12299function resolveYamlBinary(data) {
12300 if (data === null) return false;
12301 var code, idx, bitlen = 0, max = data.length, map2 = BASE64_MAP;
12302 for (idx = 0; idx < max; idx++) {
12303 code = map2.indexOf(data.charAt(idx));
12304 if (code > 64) continue;
12305 if (code < 0) return false;
12306 bitlen += 6;
12307 }
12308 return bitlen % 8 === 0;
12309}
12310function constructYamlBinary(data) {
12311 var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map2 = BASE64_MAP, bits = 0, result = [];
12312 for (idx = 0; idx < max; idx++) {
12313 if (idx % 4 === 0 && idx) {
12314 result.push(bits >> 16 & 255);
12315 result.push(bits >> 8 & 255);
12316 result.push(bits & 255);
12317 }
12318 bits = bits << 6 | map2.indexOf(input.charAt(idx));
12319 }
12320 tailbits = max % 4 * 6;
12321 if (tailbits === 0) {
12322 result.push(bits >> 16 & 255);
12323 result.push(bits >> 8 & 255);
12324 result.push(bits & 255);
12325 } else if (tailbits === 18) {
12326 result.push(bits >> 10 & 255);
12327 result.push(bits >> 2 & 255);
12328 } else if (tailbits === 12) {
12329 result.push(bits >> 4 & 255);
12330 }
12331 return new Uint8Array(result);
12332}
12333function representYamlBinary(object) {
12334 var result = "", bits = 0, idx, tail, max = object.length, map2 = BASE64_MAP;
12335 for (idx = 0; idx < max; idx++) {
12336 if (idx % 3 === 0 && idx) {
12337 result += map2[bits >> 18 & 63];
12338 result += map2[bits >> 12 & 63];
12339 result += map2[bits >> 6 & 63];
12340 result += map2[bits & 63];
12341 }
12342 bits = (bits << 8) + object[idx];
12343 }
12344 tail = max % 3;
12345 if (tail === 0) {
12346 result += map2[bits >> 18 & 63];
12347 result += map2[bits >> 12 & 63];
12348 result += map2[bits >> 6 & 63];
12349 result += map2[bits & 63];
12350 } else if (tail === 2) {
12351 result += map2[bits >> 10 & 63];
12352 result += map2[bits >> 4 & 63];
12353 result += map2[bits << 2 & 63];
12354 result += map2[64];
12355 } else if (tail === 1) {
12356 result += map2[bits >> 2 & 63];
12357 result += map2[bits << 4 & 63];
12358 result += map2[64];
12359 result += map2[64];
12360 }
12361 return result;
12362}
12363function isBinary(obj) {
12364 return Object.prototype.toString.call(obj) === "[object Uint8Array]";
12365}
12366var binary = new type("tag:yaml.org,2002:binary", {
12367 kind: "scalar",
12368 resolve: resolveYamlBinary,
12369 construct: constructYamlBinary,
12370 predicate: isBinary,
12371 represent: representYamlBinary
12372});
12373var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
12374var _toString$2 = Object.prototype.toString;
12375function resolveYamlOmap(data) {
12376 if (data === null) return true;
12377 var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
12378 for (index = 0, length = object.length; index < length; index += 1) {
12379 pair = object[index];
12380 pairHasKey = false;
12381 if (_toString$2.call(pair) !== "[object Object]") return false;
12382 for (pairKey in pair) {
12383 if (_hasOwnProperty$3.call(pair, pairKey)) {
12384 if (!pairHasKey) pairHasKey = true;
12385 else return false;
12386 }
12387 }
12388 if (!pairHasKey) return false;
12389 if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
12390 else return false;
12391 }
12392 return true;
12393}
12394function constructYamlOmap(data) {
12395 return data !== null ? data : [];
12396}
12397var omap = new type("tag:yaml.org,2002:omap", {
12398 kind: "sequence",
12399 resolve: resolveYamlOmap,
12400 construct: constructYamlOmap
12401});
12402var _toString$1 = Object.prototype.toString;
12403function resolveYamlPairs(data) {
12404 if (data === null) return true;
12405 var index, length, pair, keys, result, object = data;
12406 result = new Array(object.length);
12407 for (index = 0, length = object.length; index < length; index += 1) {
12408 pair = object[index];
12409 if (_toString$1.call(pair) !== "[object Object]") return false;
12410 keys = Object.keys(pair);
12411 if (keys.length !== 1) return false;
12412 result[index] = [keys[0], pair[keys[0]]];
12413 }
12414 return true;
12415}
12416function constructYamlPairs(data) {
12417 if (data === null) return [];
12418 var index, length, pair, keys, result, object = data;
12419 result = new Array(object.length);
12420 for (index = 0, length = object.length; index < length; index += 1) {
12421 pair = object[index];
12422 keys = Object.keys(pair);
12423 result[index] = [keys[0], pair[keys[0]]];
12424 }
12425 return result;
12426}
12427var pairs = new type("tag:yaml.org,2002:pairs", {
12428 kind: "sequence",
12429 resolve: resolveYamlPairs,
12430 construct: constructYamlPairs
12431});
12432var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
12433function resolveYamlSet(data) {
12434 if (data === null) return true;
12435 var key2, object = data;
12436 for (key2 in object) {
12437 if (_hasOwnProperty$2.call(object, key2)) {
12438 if (object[key2] !== null) return false;
12439 }
12440 }
12441 return true;
12442}
12443function constructYamlSet(data) {
12444 return data !== null ? data : {};
12445}
12446var set = new type("tag:yaml.org,2002:set", {
12447 kind: "mapping",
12448 resolve: resolveYamlSet,
12449 construct: constructYamlSet
12450});
12451var _default = core.extend({
12452 implicit: [
12453 timestamp,
12454 merge
12455 ],
12456 explicit: [
12457 binary,
12458 omap,
12459 pairs,
12460 set
12461 ]
12462});
12463var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
12464var CONTEXT_FLOW_IN = 1;
12465var CONTEXT_FLOW_OUT = 2;
12466var CONTEXT_BLOCK_IN = 3;
12467var CONTEXT_BLOCK_OUT = 4;
12468var CHOMPING_CLIP = 1;
12469var CHOMPING_STRIP = 2;
12470var CHOMPING_KEEP = 3;
12471var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
12472var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
12473var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
12474var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
12475var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
12476function _class(obj) {
12477 return Object.prototype.toString.call(obj);
12478}
12479function is_EOL(c2) {
12480 return c2 === 10 || c2 === 13;
12481}
12482function is_WHITE_SPACE(c2) {
12483 return c2 === 9 || c2 === 32;
12484}
12485function is_WS_OR_EOL(c2) {
12486 return c2 === 9 || c2 === 32 || c2 === 10 || c2 === 13;
12487}
12488function is_FLOW_INDICATOR(c2) {
12489 return c2 === 44 || c2 === 91 || c2 === 93 || c2 === 123 || c2 === 125;
12490}
12491function fromHexCode(c2) {
12492 var lc;
12493 if (48 <= c2 && c2 <= 57) {
12494 return c2 - 48;
12495 }
12496 lc = c2 | 32;
12497 if (97 <= lc && lc <= 102) {
12498 return lc - 97 + 10;
12499 }
12500 return -1;
12501}
12502function escapedHexLen(c2) {
12503 if (c2 === 120) {
12504 return 2;
12505 }
12506 if (c2 === 117) {
12507 return 4;
12508 }
12509 if (c2 === 85) {
12510 return 8;
12511 }
12512 return 0;
12513}
12514function fromDecimalCode(c2) {
12515 if (48 <= c2 && c2 <= 57) {
12516 return c2 - 48;
12517 }
12518 return -1;
12519}
12520function simpleEscapeSequence(c2) {
12521 return c2 === 48 ? "\0" : c2 === 97 ? "\x07" : c2 === 98 ? "\b" : c2 === 116 ? " " : c2 === 9 ? " " : c2 === 110 ? "\n" : c2 === 118 ? "\v" : c2 === 102 ? "\f" : c2 === 114 ? "\r" : c2 === 101 ? "\x1B" : c2 === 32 ? " " : c2 === 34 ? '"' : c2 === 47 ? "/" : c2 === 92 ? "\\" : c2 === 78 ? "\x85" : c2 === 95 ? "\xA0" : c2 === 76 ? "\u2028" : c2 === 80 ? "\u2029" : "";
12522}
12523function charFromCodepoint(c2) {
12524 if (c2 <= 65535) {
12525 return String.fromCharCode(c2);
12526 }
12527 return String.fromCharCode(
12528 (c2 - 65536 >> 10) + 55296,
12529 (c2 - 65536 & 1023) + 56320
12530 );
12531}
12532var simpleEscapeCheck = new Array(256);
12533var simpleEscapeMap = new Array(256);
12534for (i = 0; i < 256; i++) {
12535 simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
12536 simpleEscapeMap[i] = simpleEscapeSequence(i);
12537}
12538var i;
12539function State$1(input, options8) {
12540 this.input = input;
12541 this.filename = options8["filename"] || null;
12542 this.schema = options8["schema"] || _default;
12543 this.onWarning = options8["onWarning"] || null;
12544 this.legacy = options8["legacy"] || false;
12545 this.json = options8["json"] || false;
12546 this.listener = options8["listener"] || null;
12547 this.implicitTypes = this.schema.compiledImplicit;
12548 this.typeMap = this.schema.compiledTypeMap;
12549 this.length = input.length;
12550 this.position = 0;
12551 this.line = 0;
12552 this.lineStart = 0;
12553 this.lineIndent = 0;
12554 this.firstTabInLine = -1;
12555 this.documents = [];
12556}
12557function generateError(state, message) {
12558 var mark = {
12559 name: state.filename,
12560 buffer: state.input.slice(0, -1),
12561 // omit trailing \0
12562 position: state.position,
12563 line: state.line,
12564 column: state.position - state.lineStart
12565 };
12566 mark.snippet = snippet(mark);
12567 return new exception(message, mark);
12568}
12569function throwError(state, message) {
12570 throw generateError(state, message);
12571}
12572function throwWarning(state, message) {
12573 if (state.onWarning) {
12574 state.onWarning.call(null, generateError(state, message));
12575 }
12576}
12577var directiveHandlers = {
12578 YAML: function handleYamlDirective(state, name, args) {
12579 var match, major, minor;
12580 if (state.version !== null) {
12581 throwError(state, "duplication of %YAML directive");
12582 }
12583 if (args.length !== 1) {
12584 throwError(state, "YAML directive accepts exactly one argument");
12585 }
12586 match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
12587 if (match === null) {
12588 throwError(state, "ill-formed argument of the YAML directive");
12589 }
12590 major = parseInt(match[1], 10);
12591 minor = parseInt(match[2], 10);
12592 if (major !== 1) {
12593 throwError(state, "unacceptable YAML version of the document");
12594 }
12595 state.version = args[0];
12596 state.checkLineBreaks = minor < 2;
12597 if (minor !== 1 && minor !== 2) {
12598 throwWarning(state, "unsupported YAML version of the document");
12599 }
12600 },
12601 TAG: function handleTagDirective(state, name, args) {
12602 var handle, prefix;
12603 if (args.length !== 2) {
12604 throwError(state, "TAG directive accepts exactly two arguments");
12605 }
12606 handle = args[0];
12607 prefix = args[1];
12608 if (!PATTERN_TAG_HANDLE.test(handle)) {
12609 throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
12610 }
12611 if (_hasOwnProperty$1.call(state.tagMap, handle)) {
12612 throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
12613 }
12614 if (!PATTERN_TAG_URI.test(prefix)) {
12615 throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
12616 }
12617 try {
12618 prefix = decodeURIComponent(prefix);
12619 } catch (err) {
12620 throwError(state, "tag prefix is malformed: " + prefix);
12621 }
12622 state.tagMap[handle] = prefix;
12623 }
12624};
12625function captureSegment(state, start, end, checkJson) {
12626 var _position, _length, _character, _result;
12627 if (start < end) {
12628 _result = state.input.slice(start, end);
12629 if (checkJson) {
12630 for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
12631 _character = _result.charCodeAt(_position);
12632 if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
12633 throwError(state, "expected valid JSON character");
12634 }
12635 }
12636 } else if (PATTERN_NON_PRINTABLE.test(_result)) {
12637 throwError(state, "the stream contains non-printable characters");
12638 }
12639 state.result += _result;
12640 }
12641}
12642function mergeMappings(state, destination, source2, overridableKeys) {
12643 var sourceKeys, key2, index, quantity;
12644 if (!common.isObject(source2)) {
12645 throwError(state, "cannot merge mappings; the provided source object is unacceptable");
12646 }
12647 sourceKeys = Object.keys(source2);
12648 for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
12649 key2 = sourceKeys[index];
12650 if (!_hasOwnProperty$1.call(destination, key2)) {
12651 destination[key2] = source2[key2];
12652 overridableKeys[key2] = true;
12653 }
12654 }
12655}
12656function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
12657 var index, quantity;
12658 if (Array.isArray(keyNode)) {
12659 keyNode = Array.prototype.slice.call(keyNode);
12660 for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
12661 if (Array.isArray(keyNode[index])) {
12662 throwError(state, "nested arrays are not supported inside keys");
12663 }
12664 if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
12665 keyNode[index] = "[object Object]";
12666 }
12667 }
12668 }
12669 if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
12670 keyNode = "[object Object]";
12671 }
12672 keyNode = String(keyNode);
12673 if (_result === null) {
12674 _result = {};
12675 }
12676 if (keyTag === "tag:yaml.org,2002:merge") {
12677 if (Array.isArray(valueNode)) {
12678 for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
12679 mergeMappings(state, _result, valueNode[index], overridableKeys);
12680 }
12681 } else {
12682 mergeMappings(state, _result, valueNode, overridableKeys);
12683 }
12684 } else {
12685 if (!state.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) {
12686 state.line = startLine || state.line;
12687 state.lineStart = startLineStart || state.lineStart;
12688 state.position = startPos || state.position;
12689 throwError(state, "duplicated mapping key");
12690 }
12691 if (keyNode === "__proto__") {
12692 Object.defineProperty(_result, keyNode, {
12693 configurable: true,
12694 enumerable: true,
12695 writable: true,
12696 value: valueNode
12697 });
12698 } else {
12699 _result[keyNode] = valueNode;
12700 }
12701 delete overridableKeys[keyNode];
12702 }
12703 return _result;
12704}
12705function readLineBreak(state) {
12706 var ch;
12707 ch = state.input.charCodeAt(state.position);
12708 if (ch === 10) {
12709 state.position++;
12710 } else if (ch === 13) {
12711 state.position++;
12712 if (state.input.charCodeAt(state.position) === 10) {
12713 state.position++;
12714 }
12715 } else {
12716 throwError(state, "a line break is expected");
12717 }
12718 state.line += 1;
12719 state.lineStart = state.position;
12720 state.firstTabInLine = -1;
12721}
12722function skipSeparationSpace(state, allowComments, checkIndent) {
12723 var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
12724 while (ch !== 0) {
12725 while (is_WHITE_SPACE(ch)) {
12726 if (ch === 9 && state.firstTabInLine === -1) {
12727 state.firstTabInLine = state.position;
12728 }
12729 ch = state.input.charCodeAt(++state.position);
12730 }
12731 if (allowComments && ch === 35) {
12732 do {
12733 ch = state.input.charCodeAt(++state.position);
12734 } while (ch !== 10 && ch !== 13 && ch !== 0);
12735 }
12736 if (is_EOL(ch)) {
12737 readLineBreak(state);
12738 ch = state.input.charCodeAt(state.position);
12739 lineBreaks++;
12740 state.lineIndent = 0;
12741 while (ch === 32) {
12742 state.lineIndent++;
12743 ch = state.input.charCodeAt(++state.position);
12744 }
12745 } else {
12746 break;
12747 }
12748 }
12749 if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
12750 throwWarning(state, "deficient indentation");
12751 }
12752 return lineBreaks;
12753}
12754function testDocumentSeparator(state) {
12755 var _position = state.position, ch;
12756 ch = state.input.charCodeAt(_position);
12757 if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
12758 _position += 3;
12759 ch = state.input.charCodeAt(_position);
12760 if (ch === 0 || is_WS_OR_EOL(ch)) {
12761 return true;
12762 }
12763 }
12764 return false;
12765}
12766function writeFoldedLines(state, count) {
12767 if (count === 1) {
12768 state.result += " ";
12769 } else if (count > 1) {
12770 state.result += common.repeat("\n", count - 1);
12771 }
12772}
12773function readPlainScalar(state, nodeIndent, withinFlowCollection) {
12774 var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
12775 ch = state.input.charCodeAt(state.position);
12776 if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
12777 return false;
12778 }
12779 if (ch === 63 || ch === 45) {
12780 following = state.input.charCodeAt(state.position + 1);
12781 if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
12782 return false;
12783 }
12784 }
12785 state.kind = "scalar";
12786 state.result = "";
12787 captureStart = captureEnd = state.position;
12788 hasPendingContent = false;
12789 while (ch !== 0) {
12790 if (ch === 58) {
12791 following = state.input.charCodeAt(state.position + 1);
12792 if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
12793 break;
12794 }
12795 } else if (ch === 35) {
12796 preceding = state.input.charCodeAt(state.position - 1);
12797 if (is_WS_OR_EOL(preceding)) {
12798 break;
12799 }
12800 } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
12801 break;
12802 } else if (is_EOL(ch)) {
12803 _line = state.line;
12804 _lineStart = state.lineStart;
12805 _lineIndent = state.lineIndent;
12806 skipSeparationSpace(state, false, -1);
12807 if (state.lineIndent >= nodeIndent) {
12808 hasPendingContent = true;
12809 ch = state.input.charCodeAt(state.position);
12810 continue;
12811 } else {
12812 state.position = captureEnd;
12813 state.line = _line;
12814 state.lineStart = _lineStart;
12815 state.lineIndent = _lineIndent;
12816 break;
12817 }
12818 }
12819 if (hasPendingContent) {
12820 captureSegment(state, captureStart, captureEnd, false);
12821 writeFoldedLines(state, state.line - _line);
12822 captureStart = captureEnd = state.position;
12823 hasPendingContent = false;
12824 }
12825 if (!is_WHITE_SPACE(ch)) {
12826 captureEnd = state.position + 1;
12827 }
12828 ch = state.input.charCodeAt(++state.position);
12829 }
12830 captureSegment(state, captureStart, captureEnd, false);
12831 if (state.result) {
12832 return true;
12833 }
12834 state.kind = _kind;
12835 state.result = _result;
12836 return false;
12837}
12838function readSingleQuotedScalar(state, nodeIndent) {
12839 var ch, captureStart, captureEnd;
12840 ch = state.input.charCodeAt(state.position);
12841 if (ch !== 39) {
12842 return false;
12843 }
12844 state.kind = "scalar";
12845 state.result = "";
12846 state.position++;
12847 captureStart = captureEnd = state.position;
12848 while ((ch = state.input.charCodeAt(state.position)) !== 0) {
12849 if (ch === 39) {
12850 captureSegment(state, captureStart, state.position, true);
12851 ch = state.input.charCodeAt(++state.position);
12852 if (ch === 39) {
12853 captureStart = state.position;
12854 state.position++;
12855 captureEnd = state.position;
12856 } else {
12857 return true;
12858 }
12859 } else if (is_EOL(ch)) {
12860 captureSegment(state, captureStart, captureEnd, true);
12861 writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
12862 captureStart = captureEnd = state.position;
12863 } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
12864 throwError(state, "unexpected end of the document within a single quoted scalar");
12865 } else {
12866 state.position++;
12867 captureEnd = state.position;
12868 }
12869 }
12870 throwError(state, "unexpected end of the stream within a single quoted scalar");
12871}
12872function readDoubleQuotedScalar(state, nodeIndent) {
12873 var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
12874 ch = state.input.charCodeAt(state.position);
12875 if (ch !== 34) {
12876 return false;
12877 }
12878 state.kind = "scalar";
12879 state.result = "";
12880 state.position++;
12881 captureStart = captureEnd = state.position;
12882 while ((ch = state.input.charCodeAt(state.position)) !== 0) {
12883 if (ch === 34) {
12884 captureSegment(state, captureStart, state.position, true);
12885 state.position++;
12886 return true;
12887 } else if (ch === 92) {
12888 captureSegment(state, captureStart, state.position, true);
12889 ch = state.input.charCodeAt(++state.position);
12890 if (is_EOL(ch)) {
12891 skipSeparationSpace(state, false, nodeIndent);
12892 } else if (ch < 256 && simpleEscapeCheck[ch]) {
12893 state.result += simpleEscapeMap[ch];
12894 state.position++;
12895 } else if ((tmp = escapedHexLen(ch)) > 0) {
12896 hexLength = tmp;
12897 hexResult = 0;
12898 for (; hexLength > 0; hexLength--) {
12899 ch = state.input.charCodeAt(++state.position);
12900 if ((tmp = fromHexCode(ch)) >= 0) {
12901 hexResult = (hexResult << 4) + tmp;
12902 } else {
12903 throwError(state, "expected hexadecimal character");
12904 }
12905 }
12906 state.result += charFromCodepoint(hexResult);
12907 state.position++;
12908 } else {
12909 throwError(state, "unknown escape sequence");
12910 }
12911 captureStart = captureEnd = state.position;
12912 } else if (is_EOL(ch)) {
12913 captureSegment(state, captureStart, captureEnd, true);
12914 writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
12915 captureStart = captureEnd = state.position;
12916 } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
12917 throwError(state, "unexpected end of the document within a double quoted scalar");
12918 } else {
12919 state.position++;
12920 captureEnd = state.position;
12921 }
12922 }
12923 throwError(state, "unexpected end of the stream within a double quoted scalar");
12924}
12925function readFlowCollection(state, nodeIndent) {
12926 var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch;
12927 ch = state.input.charCodeAt(state.position);
12928 if (ch === 91) {
12929 terminator = 93;
12930 isMapping = false;
12931 _result = [];
12932 } else if (ch === 123) {
12933 terminator = 125;
12934 isMapping = true;
12935 _result = {};
12936 } else {
12937 return false;
12938 }
12939 if (state.anchor !== null) {
12940 state.anchorMap[state.anchor] = _result;
12941 }
12942 ch = state.input.charCodeAt(++state.position);
12943 while (ch !== 0) {
12944 skipSeparationSpace(state, true, nodeIndent);
12945 ch = state.input.charCodeAt(state.position);
12946 if (ch === terminator) {
12947 state.position++;
12948 state.tag = _tag;
12949 state.anchor = _anchor;
12950 state.kind = isMapping ? "mapping" : "sequence";
12951 state.result = _result;
12952 return true;
12953 } else if (!readNext) {
12954 throwError(state, "missed comma between flow collection entries");
12955 } else if (ch === 44) {
12956 throwError(state, "expected the node content, but found ','");
12957 }
12958 keyTag = keyNode = valueNode = null;
12959 isPair = isExplicitPair = false;
12960 if (ch === 63) {
12961 following = state.input.charCodeAt(state.position + 1);
12962 if (is_WS_OR_EOL(following)) {
12963 isPair = isExplicitPair = true;
12964 state.position++;
12965 skipSeparationSpace(state, true, nodeIndent);
12966 }
12967 }
12968 _line = state.line;
12969 _lineStart = state.lineStart;
12970 _pos = state.position;
12971 composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
12972 keyTag = state.tag;
12973 keyNode = state.result;
12974 skipSeparationSpace(state, true, nodeIndent);
12975 ch = state.input.charCodeAt(state.position);
12976 if ((isExplicitPair || state.line === _line) && ch === 58) {
12977 isPair = true;
12978 ch = state.input.charCodeAt(++state.position);
12979 skipSeparationSpace(state, true, nodeIndent);
12980 composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
12981 valueNode = state.result;
12982 }
12983 if (isMapping) {
12984 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
12985 } else if (isPair) {
12986 _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
12987 } else {
12988 _result.push(keyNode);
12989 }
12990 skipSeparationSpace(state, true, nodeIndent);
12991 ch = state.input.charCodeAt(state.position);
12992 if (ch === 44) {
12993 readNext = true;
12994 ch = state.input.charCodeAt(++state.position);
12995 } else {
12996 readNext = false;
12997 }
12998 }
12999 throwError(state, "unexpected end of the stream within a flow collection");
13000}
13001function readBlockScalar(state, nodeIndent) {
13002 var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
13003 ch = state.input.charCodeAt(state.position);
13004 if (ch === 124) {
13005 folding = false;
13006 } else if (ch === 62) {
13007 folding = true;
13008 } else {
13009 return false;
13010 }
13011 state.kind = "scalar";
13012 state.result = "";
13013 while (ch !== 0) {
13014 ch = state.input.charCodeAt(++state.position);
13015 if (ch === 43 || ch === 45) {
13016 if (CHOMPING_CLIP === chomping) {
13017 chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
13018 } else {
13019 throwError(state, "repeat of a chomping mode identifier");
13020 }
13021 } else if ((tmp = fromDecimalCode(ch)) >= 0) {
13022 if (tmp === 0) {
13023 throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
13024 } else if (!detectedIndent) {
13025 textIndent = nodeIndent + tmp - 1;
13026 detectedIndent = true;
13027 } else {
13028 throwError(state, "repeat of an indentation width identifier");
13029 }
13030 } else {
13031 break;
13032 }
13033 }
13034 if (is_WHITE_SPACE(ch)) {
13035 do {
13036 ch = state.input.charCodeAt(++state.position);
13037 } while (is_WHITE_SPACE(ch));
13038 if (ch === 35) {
13039 do {
13040 ch = state.input.charCodeAt(++state.position);
13041 } while (!is_EOL(ch) && ch !== 0);
13042 }
13043 }
13044 while (ch !== 0) {
13045 readLineBreak(state);
13046 state.lineIndent = 0;
13047 ch = state.input.charCodeAt(state.position);
13048 while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
13049 state.lineIndent++;
13050 ch = state.input.charCodeAt(++state.position);
13051 }
13052 if (!detectedIndent && state.lineIndent > textIndent) {
13053 textIndent = state.lineIndent;
13054 }
13055 if (is_EOL(ch)) {
13056 emptyLines++;
13057 continue;
13058 }
13059 if (state.lineIndent < textIndent) {
13060 if (chomping === CHOMPING_KEEP) {
13061 state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
13062 } else if (chomping === CHOMPING_CLIP) {
13063 if (didReadContent) {
13064 state.result += "\n";
13065 }
13066 }
13067 break;
13068 }
13069 if (folding) {
13070 if (is_WHITE_SPACE(ch)) {
13071 atMoreIndented = true;
13072 state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
13073 } else if (atMoreIndented) {
13074 atMoreIndented = false;
13075 state.result += common.repeat("\n", emptyLines + 1);
13076 } else if (emptyLines === 0) {
13077 if (didReadContent) {
13078 state.result += " ";
13079 }
13080 } else {
13081 state.result += common.repeat("\n", emptyLines);
13082 }
13083 } else {
13084 state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
13085 }
13086 didReadContent = true;
13087 detectedIndent = true;
13088 emptyLines = 0;
13089 captureStart = state.position;
13090 while (!is_EOL(ch) && ch !== 0) {
13091 ch = state.input.charCodeAt(++state.position);
13092 }
13093 captureSegment(state, captureStart, state.position, false);
13094 }
13095 return true;
13096}
13097function readBlockSequence(state, nodeIndent) {
13098 var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
13099 if (state.firstTabInLine !== -1) return false;
13100 if (state.anchor !== null) {
13101 state.anchorMap[state.anchor] = _result;
13102 }
13103 ch = state.input.charCodeAt(state.position);
13104 while (ch !== 0) {
13105 if (state.firstTabInLine !== -1) {
13106 state.position = state.firstTabInLine;
13107 throwError(state, "tab characters must not be used in indentation");
13108 }
13109 if (ch !== 45) {
13110 break;
13111 }
13112 following = state.input.charCodeAt(state.position + 1);
13113 if (!is_WS_OR_EOL(following)) {
13114 break;
13115 }
13116 detected = true;
13117 state.position++;
13118 if (skipSeparationSpace(state, true, -1)) {
13119 if (state.lineIndent <= nodeIndent) {
13120 _result.push(null);
13121 ch = state.input.charCodeAt(state.position);
13122 continue;
13123 }
13124 }
13125 _line = state.line;
13126 composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
13127 _result.push(state.result);
13128 skipSeparationSpace(state, true, -1);
13129 ch = state.input.charCodeAt(state.position);
13130 if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
13131 throwError(state, "bad indentation of a sequence entry");
13132 } else if (state.lineIndent < nodeIndent) {
13133 break;
13134 }
13135 }
13136 if (detected) {
13137 state.tag = _tag;
13138 state.anchor = _anchor;
13139 state.kind = "sequence";
13140 state.result = _result;
13141 return true;
13142 }
13143 return false;
13144}
13145function readBlockMapping(state, nodeIndent, flowIndent) {
13146 var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
13147 if (state.firstTabInLine !== -1) return false;
13148 if (state.anchor !== null) {
13149 state.anchorMap[state.anchor] = _result;
13150 }
13151 ch = state.input.charCodeAt(state.position);
13152 while (ch !== 0) {
13153 if (!atExplicitKey && state.firstTabInLine !== -1) {
13154 state.position = state.firstTabInLine;
13155 throwError(state, "tab characters must not be used in indentation");
13156 }
13157 following = state.input.charCodeAt(state.position + 1);
13158 _line = state.line;
13159 if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
13160 if (ch === 63) {
13161 if (atExplicitKey) {
13162 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
13163 keyTag = keyNode = valueNode = null;
13164 }
13165 detected = true;
13166 atExplicitKey = true;
13167 allowCompact = true;
13168 } else if (atExplicitKey) {
13169 atExplicitKey = false;
13170 allowCompact = true;
13171 } else {
13172 throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
13173 }
13174 state.position += 1;
13175 ch = following;
13176 } else {
13177 _keyLine = state.line;
13178 _keyLineStart = state.lineStart;
13179 _keyPos = state.position;
13180 if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
13181 break;
13182 }
13183 if (state.line === _line) {
13184 ch = state.input.charCodeAt(state.position);
13185 while (is_WHITE_SPACE(ch)) {
13186 ch = state.input.charCodeAt(++state.position);
13187 }
13188 if (ch === 58) {
13189 ch = state.input.charCodeAt(++state.position);
13190 if (!is_WS_OR_EOL(ch)) {
13191 throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
13192 }
13193 if (atExplicitKey) {
13194 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
13195 keyTag = keyNode = valueNode = null;
13196 }
13197 detected = true;
13198 atExplicitKey = false;
13199 allowCompact = false;
13200 keyTag = state.tag;
13201 keyNode = state.result;
13202 } else if (detected) {
13203 throwError(state, "can not read an implicit mapping pair; a colon is missed");
13204 } else {
13205 state.tag = _tag;
13206 state.anchor = _anchor;
13207 return true;
13208 }
13209 } else if (detected) {
13210 throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
13211 } else {
13212 state.tag = _tag;
13213 state.anchor = _anchor;
13214 return true;
13215 }
13216 }
13217 if (state.line === _line || state.lineIndent > nodeIndent) {
13218 if (atExplicitKey) {
13219 _keyLine = state.line;
13220 _keyLineStart = state.lineStart;
13221 _keyPos = state.position;
13222 }
13223 if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
13224 if (atExplicitKey) {
13225 keyNode = state.result;
13226 } else {
13227 valueNode = state.result;
13228 }
13229 }
13230 if (!atExplicitKey) {
13231 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
13232 keyTag = keyNode = valueNode = null;
13233 }
13234 skipSeparationSpace(state, true, -1);
13235 ch = state.input.charCodeAt(state.position);
13236 }
13237 if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
13238 throwError(state, "bad indentation of a mapping entry");
13239 } else if (state.lineIndent < nodeIndent) {
13240 break;
13241 }
13242 }
13243 if (atExplicitKey) {
13244 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
13245 }
13246 if (detected) {
13247 state.tag = _tag;
13248 state.anchor = _anchor;
13249 state.kind = "mapping";
13250 state.result = _result;
13251 }
13252 return detected;
13253}
13254function readTagProperty(state) {
13255 var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
13256 ch = state.input.charCodeAt(state.position);
13257 if (ch !== 33) return false;
13258 if (state.tag !== null) {
13259 throwError(state, "duplication of a tag property");
13260 }
13261 ch = state.input.charCodeAt(++state.position);
13262 if (ch === 60) {
13263 isVerbatim = true;
13264 ch = state.input.charCodeAt(++state.position);
13265 } else if (ch === 33) {
13266 isNamed = true;
13267 tagHandle = "!!";
13268 ch = state.input.charCodeAt(++state.position);
13269 } else {
13270 tagHandle = "!";
13271 }
13272 _position = state.position;
13273 if (isVerbatim) {
13274 do {
13275 ch = state.input.charCodeAt(++state.position);
13276 } while (ch !== 0 && ch !== 62);
13277 if (state.position < state.length) {
13278 tagName = state.input.slice(_position, state.position);
13279 ch = state.input.charCodeAt(++state.position);
13280 } else {
13281 throwError(state, "unexpected end of the stream within a verbatim tag");
13282 }
13283 } else {
13284 while (ch !== 0 && !is_WS_OR_EOL(ch)) {
13285 if (ch === 33) {
13286 if (!isNamed) {
13287 tagHandle = state.input.slice(_position - 1, state.position + 1);
13288 if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
13289 throwError(state, "named tag handle cannot contain such characters");
13290 }
13291 isNamed = true;
13292 _position = state.position + 1;
13293 } else {
13294 throwError(state, "tag suffix cannot contain exclamation marks");
13295 }
13296 }
13297 ch = state.input.charCodeAt(++state.position);
13298 }
13299 tagName = state.input.slice(_position, state.position);
13300 if (PATTERN_FLOW_INDICATORS.test(tagName)) {
13301 throwError(state, "tag suffix cannot contain flow indicator characters");
13302 }
13303 }
13304 if (tagName && !PATTERN_TAG_URI.test(tagName)) {
13305 throwError(state, "tag name cannot contain such characters: " + tagName);
13306 }
13307 try {
13308 tagName = decodeURIComponent(tagName);
13309 } catch (err) {
13310 throwError(state, "tag name is malformed: " + tagName);
13311 }
13312 if (isVerbatim) {
13313 state.tag = tagName;
13314 } else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) {
13315 state.tag = state.tagMap[tagHandle] + tagName;
13316 } else if (tagHandle === "!") {
13317 state.tag = "!" + tagName;
13318 } else if (tagHandle === "!!") {
13319 state.tag = "tag:yaml.org,2002:" + tagName;
13320 } else {
13321 throwError(state, 'undeclared tag handle "' + tagHandle + '"');
13322 }
13323 return true;
13324}
13325function readAnchorProperty(state) {
13326 var _position, ch;
13327 ch = state.input.charCodeAt(state.position);
13328 if (ch !== 38) return false;
13329 if (state.anchor !== null) {
13330 throwError(state, "duplication of an anchor property");
13331 }
13332 ch = state.input.charCodeAt(++state.position);
13333 _position = state.position;
13334 while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
13335 ch = state.input.charCodeAt(++state.position);
13336 }
13337 if (state.position === _position) {
13338 throwError(state, "name of an anchor node must contain at least one character");
13339 }
13340 state.anchor = state.input.slice(_position, state.position);
13341 return true;
13342}
13343function readAlias(state) {
13344 var _position, alias, ch;
13345 ch = state.input.charCodeAt(state.position);
13346 if (ch !== 42) return false;
13347 ch = state.input.charCodeAt(++state.position);
13348 _position = state.position;
13349 while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
13350 ch = state.input.charCodeAt(++state.position);
13351 }
13352 if (state.position === _position) {
13353 throwError(state, "name of an alias node must contain at least one character");
13354 }
13355 alias = state.input.slice(_position, state.position);
13356 if (!_hasOwnProperty$1.call(state.anchorMap, alias)) {
13357 throwError(state, 'unidentified alias "' + alias + '"');
13358 }
13359 state.result = state.anchorMap[alias];
13360 skipSeparationSpace(state, true, -1);
13361 return true;
13362}
13363function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
13364 var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type2, flowIndent, blockIndent;
13365 if (state.listener !== null) {
13366 state.listener("open", state);
13367 }
13368 state.tag = null;
13369 state.anchor = null;
13370 state.kind = null;
13371 state.result = null;
13372 allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
13373 if (allowToSeek) {
13374 if (skipSeparationSpace(state, true, -1)) {
13375 atNewLine = true;
13376 if (state.lineIndent > parentIndent) {
13377 indentStatus = 1;
13378 } else if (state.lineIndent === parentIndent) {
13379 indentStatus = 0;
13380 } else if (state.lineIndent < parentIndent) {
13381 indentStatus = -1;
13382 }
13383 }
13384 }
13385 if (indentStatus === 1) {
13386 while (readTagProperty(state) || readAnchorProperty(state)) {
13387 if (skipSeparationSpace(state, true, -1)) {
13388 atNewLine = true;
13389 allowBlockCollections = allowBlockStyles;
13390 if (state.lineIndent > parentIndent) {
13391 indentStatus = 1;
13392 } else if (state.lineIndent === parentIndent) {
13393 indentStatus = 0;
13394 } else if (state.lineIndent < parentIndent) {
13395 indentStatus = -1;
13396 }
13397 } else {
13398 allowBlockCollections = false;
13399 }
13400 }
13401 }
13402 if (allowBlockCollections) {
13403 allowBlockCollections = atNewLine || allowCompact;
13404 }
13405 if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
13406 if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
13407 flowIndent = parentIndent;
13408 } else {
13409 flowIndent = parentIndent + 1;
13410 }
13411 blockIndent = state.position - state.lineStart;
13412 if (indentStatus === 1) {
13413 if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
13414 hasContent = true;
13415 } else {
13416 if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
13417 hasContent = true;
13418 } else if (readAlias(state)) {
13419 hasContent = true;
13420 if (state.tag !== null || state.anchor !== null) {
13421 throwError(state, "alias node should not have any properties");
13422 }
13423 } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
13424 hasContent = true;
13425 if (state.tag === null) {
13426 state.tag = "?";
13427 }
13428 }
13429 if (state.anchor !== null) {
13430 state.anchorMap[state.anchor] = state.result;
13431 }
13432 }
13433 } else if (indentStatus === 0) {
13434 hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
13435 }
13436 }
13437 if (state.tag === null) {
13438 if (state.anchor !== null) {
13439 state.anchorMap[state.anchor] = state.result;
13440 }
13441 } else if (state.tag === "?") {
13442 if (state.result !== null && state.kind !== "scalar") {
13443 throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
13444 }
13445 for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
13446 type2 = state.implicitTypes[typeIndex];
13447 if (type2.resolve(state.result)) {
13448 state.result = type2.construct(state.result);
13449 state.tag = type2.tag;
13450 if (state.anchor !== null) {
13451 state.anchorMap[state.anchor] = state.result;
13452 }
13453 break;
13454 }
13455 }
13456 } else if (state.tag !== "!") {
13457 if (_hasOwnProperty$1.call(state.typeMap[state.kind || "fallback"], state.tag)) {
13458 type2 = state.typeMap[state.kind || "fallback"][state.tag];
13459 } else {
13460 type2 = null;
13461 typeList = state.typeMap.multi[state.kind || "fallback"];
13462 for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
13463 if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
13464 type2 = typeList[typeIndex];
13465 break;
13466 }
13467 }
13468 }
13469 if (!type2) {
13470 throwError(state, "unknown tag !<" + state.tag + ">");
13471 }
13472 if (state.result !== null && type2.kind !== state.kind) {
13473 throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type2.kind + '", not "' + state.kind + '"');
13474 }
13475 if (!type2.resolve(state.result, state.tag)) {
13476 throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
13477 } else {
13478 state.result = type2.construct(state.result, state.tag);
13479 if (state.anchor !== null) {
13480 state.anchorMap[state.anchor] = state.result;
13481 }
13482 }
13483 }
13484 if (state.listener !== null) {
13485 state.listener("close", state);
13486 }
13487 return state.tag !== null || state.anchor !== null || hasContent;
13488}
13489function readDocument(state) {
13490 var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
13491 state.version = null;
13492 state.checkLineBreaks = state.legacy;
13493 state.tagMap = /* @__PURE__ */ Object.create(null);
13494 state.anchorMap = /* @__PURE__ */ Object.create(null);
13495 while ((ch = state.input.charCodeAt(state.position)) !== 0) {
13496 skipSeparationSpace(state, true, -1);
13497 ch = state.input.charCodeAt(state.position);
13498 if (state.lineIndent > 0 || ch !== 37) {
13499 break;
13500 }
13501 hasDirectives = true;
13502 ch = state.input.charCodeAt(++state.position);
13503 _position = state.position;
13504 while (ch !== 0 && !is_WS_OR_EOL(ch)) {
13505 ch = state.input.charCodeAt(++state.position);
13506 }
13507 directiveName = state.input.slice(_position, state.position);
13508 directiveArgs = [];
13509 if (directiveName.length < 1) {
13510 throwError(state, "directive name must not be less than one character in length");
13511 }
13512 while (ch !== 0) {
13513 while (is_WHITE_SPACE(ch)) {
13514 ch = state.input.charCodeAt(++state.position);
13515 }
13516 if (ch === 35) {
13517 do {
13518 ch = state.input.charCodeAt(++state.position);
13519 } while (ch !== 0 && !is_EOL(ch));
13520 break;
13521 }
13522 if (is_EOL(ch)) break;
13523 _position = state.position;
13524 while (ch !== 0 && !is_WS_OR_EOL(ch)) {
13525 ch = state.input.charCodeAt(++state.position);
13526 }
13527 directiveArgs.push(state.input.slice(_position, state.position));
13528 }
13529 if (ch !== 0) readLineBreak(state);
13530 if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
13531 directiveHandlers[directiveName](state, directiveName, directiveArgs);
13532 } else {
13533 throwWarning(state, 'unknown document directive "' + directiveName + '"');
13534 }
13535 }
13536 skipSeparationSpace(state, true, -1);
13537 if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
13538 state.position += 3;
13539 skipSeparationSpace(state, true, -1);
13540 } else if (hasDirectives) {
13541 throwError(state, "directives end mark is expected");
13542 }
13543 composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
13544 skipSeparationSpace(state, true, -1);
13545 if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
13546 throwWarning(state, "non-ASCII line breaks are interpreted as content");
13547 }
13548 state.documents.push(state.result);
13549 if (state.position === state.lineStart && testDocumentSeparator(state)) {
13550 if (state.input.charCodeAt(state.position) === 46) {
13551 state.position += 3;
13552 skipSeparationSpace(state, true, -1);
13553 }
13554 return;
13555 }
13556 if (state.position < state.length - 1) {
13557 throwError(state, "end of the stream or a document separator is expected");
13558 } else {
13559 return;
13560 }
13561}
13562function loadDocuments(input, options8) {
13563 input = String(input);
13564 options8 = options8 || {};
13565 if (input.length !== 0) {
13566 if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
13567 input += "\n";
13568 }
13569 if (input.charCodeAt(0) === 65279) {
13570 input = input.slice(1);
13571 }
13572 }
13573 var state = new State$1(input, options8);
13574 var nullpos = input.indexOf("\0");
13575 if (nullpos !== -1) {
13576 state.position = nullpos;
13577 throwError(state, "null byte is not allowed in input");
13578 }
13579 state.input += "\0";
13580 while (state.input.charCodeAt(state.position) === 32) {
13581 state.lineIndent += 1;
13582 state.position += 1;
13583 }
13584 while (state.position < state.length - 1) {
13585 readDocument(state);
13586 }
13587 return state.documents;
13588}
13589function loadAll$1(input, iterator, options8) {
13590 if (iterator !== null && typeof iterator === "object" && typeof options8 === "undefined") {
13591 options8 = iterator;
13592 iterator = null;
13593 }
13594 var documents = loadDocuments(input, options8);
13595 if (typeof iterator !== "function") {
13596 return documents;
13597 }
13598 for (var index = 0, length = documents.length; index < length; index += 1) {
13599 iterator(documents[index]);
13600 }
13601}
13602function load$1(input, options8) {
13603 var documents = loadDocuments(input, options8);
13604 if (documents.length === 0) {
13605 return void 0;
13606 } else if (documents.length === 1) {
13607 return documents[0];
13608 }
13609 throw new exception("expected a single document in the stream, but found more");
13610}
13611var loadAll_1 = loadAll$1;
13612var load_1 = load$1;
13613var loader = {
13614 loadAll: loadAll_1,
13615 load: load_1
13616};
13617var ESCAPE_SEQUENCES = {};
13618ESCAPE_SEQUENCES[0] = "\\0";
13619ESCAPE_SEQUENCES[7] = "\\a";
13620ESCAPE_SEQUENCES[8] = "\\b";
13621ESCAPE_SEQUENCES[9] = "\\t";
13622ESCAPE_SEQUENCES[10] = "\\n";
13623ESCAPE_SEQUENCES[11] = "\\v";
13624ESCAPE_SEQUENCES[12] = "\\f";
13625ESCAPE_SEQUENCES[13] = "\\r";
13626ESCAPE_SEQUENCES[27] = "\\e";
13627ESCAPE_SEQUENCES[34] = '\\"';
13628ESCAPE_SEQUENCES[92] = "\\\\";
13629ESCAPE_SEQUENCES[133] = "\\N";
13630ESCAPE_SEQUENCES[160] = "\\_";
13631ESCAPE_SEQUENCES[8232] = "\\L";
13632ESCAPE_SEQUENCES[8233] = "\\P";
13633function renamed(from, to) {
13634 return function() {
13635 throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
13636 };
13637}
13638var load = loader.load;
13639var loadAll = loader.loadAll;
13640var safeLoad = renamed("safeLoad", "load");
13641var safeLoadAll = renamed("safeLoadAll", "loadAll");
13642var safeDump = renamed("safeDump", "dump");
13643
13644// node_modules/json5/dist/index.mjs
13645var Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
13646var ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
13647var ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
13648var unicode = {
13649 Space_Separator,
13650 ID_Start,
13651 ID_Continue
13652};
13653var util = {
13654 isSpaceSeparator(c2) {
13655 return typeof c2 === "string" && unicode.Space_Separator.test(c2);
13656 },
13657 isIdStartChar(c2) {
13658 return typeof c2 === "string" && (c2 >= "a" && c2 <= "z" || c2 >= "A" && c2 <= "Z" || c2 === "$" || c2 === "_" || unicode.ID_Start.test(c2));
13659 },
13660 isIdContinueChar(c2) {
13661 return typeof c2 === "string" && (c2 >= "a" && c2 <= "z" || c2 >= "A" && c2 <= "Z" || c2 >= "0" && c2 <= "9" || c2 === "$" || c2 === "_" || c2 === "\u200C" || c2 === "\u200D" || unicode.ID_Continue.test(c2));
13662 },
13663 isDigit(c2) {
13664 return typeof c2 === "string" && /[0-9]/.test(c2);
13665 },
13666 isHexDigit(c2) {
13667 return typeof c2 === "string" && /[0-9A-Fa-f]/.test(c2);
13668 }
13669};
13670var source;
13671var parseState;
13672var stack;
13673var pos;
13674var line;
13675var column;
13676var token;
13677var key;
13678var root;
13679var parse2 = function parse3(text, reviver) {
13680 source = String(text);
13681 parseState = "start";
13682 stack = [];
13683 pos = 0;
13684 line = 1;
13685 column = 0;
13686 token = void 0;
13687 key = void 0;
13688 root = void 0;
13689 do {
13690 token = lex();
13691 parseStates[parseState]();
13692 } while (token.type !== "eof");
13693 if (typeof reviver === "function") {
13694 return internalize({ "": root }, "", reviver);
13695 }
13696 return root;
13697};
13698function internalize(holder, name, reviver) {
13699 const value = holder[name];
13700 if (value != null && typeof value === "object") {
13701 if (Array.isArray(value)) {
13702 for (let i = 0; i < value.length; i++) {
13703 const key2 = String(i);
13704 const replacement = internalize(value, key2, reviver);
13705 if (replacement === void 0) {
13706 delete value[key2];
13707 } else {
13708 Object.defineProperty(value, key2, {
13709 value: replacement,
13710 writable: true,
13711 enumerable: true,
13712 configurable: true
13713 });
13714 }
13715 }
13716 } else {
13717 for (const key2 in value) {
13718 const replacement = internalize(value, key2, reviver);
13719 if (replacement === void 0) {
13720 delete value[key2];
13721 } else {
13722 Object.defineProperty(value, key2, {
13723 value: replacement,
13724 writable: true,
13725 enumerable: true,
13726 configurable: true
13727 });
13728 }
13729 }
13730 }
13731 }
13732 return reviver.call(holder, name, value);
13733}
13734var lexState;
13735var buffer;
13736var doubleQuote;
13737var sign;
13738var c;
13739function lex() {
13740 lexState = "default";
13741 buffer = "";
13742 doubleQuote = false;
13743 sign = 1;
13744 for (; ; ) {
13745 c = peek();
13746 const token2 = lexStates[lexState]();
13747 if (token2) {
13748 return token2;
13749 }
13750 }
13751}
13752function peek() {
13753 if (source[pos]) {
13754 return String.fromCodePoint(source.codePointAt(pos));
13755 }
13756}
13757function read() {
13758 const c2 = peek();
13759 if (c2 === "\n") {
13760 line++;
13761 column = 0;
13762 } else if (c2) {
13763 column += c2.length;
13764 } else {
13765 column++;
13766 }
13767 if (c2) {
13768 pos += c2.length;
13769 }
13770 return c2;
13771}
13772var lexStates = {
13773 default() {
13774 switch (c) {
13775 case " ":
13776 case "\v":
13777 case "\f":
13778 case " ":
13779 case "\xA0":
13780 case "\uFEFF":
13781 case "\n":
13782 case "\r":
13783 case "\u2028":
13784 case "\u2029":
13785 read();
13786 return;
13787 case "/":
13788 read();
13789 lexState = "comment";
13790 return;
13791 case void 0:
13792 read();
13793 return newToken("eof");
13794 }
13795 if (util.isSpaceSeparator(c)) {
13796 read();
13797 return;
13798 }
13799 return lexStates[parseState]();
13800 },
13801 comment() {
13802 switch (c) {
13803 case "*":
13804 read();
13805 lexState = "multiLineComment";
13806 return;
13807 case "/":
13808 read();
13809 lexState = "singleLineComment";
13810 return;
13811 }
13812 throw invalidChar(read());
13813 },
13814 multiLineComment() {
13815 switch (c) {
13816 case "*":
13817 read();
13818 lexState = "multiLineCommentAsterisk";
13819 return;
13820 case void 0:
13821 throw invalidChar(read());
13822 }
13823 read();
13824 },
13825 multiLineCommentAsterisk() {
13826 switch (c) {
13827 case "*":
13828 read();
13829 return;
13830 case "/":
13831 read();
13832 lexState = "default";
13833 return;
13834 case void 0:
13835 throw invalidChar(read());
13836 }
13837 read();
13838 lexState = "multiLineComment";
13839 },
13840 singleLineComment() {
13841 switch (c) {
13842 case "\n":
13843 case "\r":
13844 case "\u2028":
13845 case "\u2029":
13846 read();
13847 lexState = "default";
13848 return;
13849 case void 0:
13850 read();
13851 return newToken("eof");
13852 }
13853 read();
13854 },
13855 value() {
13856 switch (c) {
13857 case "{":
13858 case "[":
13859 return newToken("punctuator", read());
13860 case "n":
13861 read();
13862 literal("ull");
13863 return newToken("null", null);
13864 case "t":
13865 read();
13866 literal("rue");
13867 return newToken("boolean", true);
13868 case "f":
13869 read();
13870 literal("alse");
13871 return newToken("boolean", false);
13872 case "-":
13873 case "+":
13874 if (read() === "-") {
13875 sign = -1;
13876 }
13877 lexState = "sign";
13878 return;
13879 case ".":
13880 buffer = read();
13881 lexState = "decimalPointLeading";
13882 return;
13883 case "0":
13884 buffer = read();
13885 lexState = "zero";
13886 return;
13887 case "1":
13888 case "2":
13889 case "3":
13890 case "4":
13891 case "5":
13892 case "6":
13893 case "7":
13894 case "8":
13895 case "9":
13896 buffer = read();
13897 lexState = "decimalInteger";
13898 return;
13899 case "I":
13900 read();
13901 literal("nfinity");
13902 return newToken("numeric", Infinity);
13903 case "N":
13904 read();
13905 literal("aN");
13906 return newToken("numeric", NaN);
13907 case '"':
13908 case "'":
13909 doubleQuote = read() === '"';
13910 buffer = "";
13911 lexState = "string";
13912 return;
13913 }
13914 throw invalidChar(read());
13915 },
13916 identifierNameStartEscape() {
13917 if (c !== "u") {
13918 throw invalidChar(read());
13919 }
13920 read();
13921 const u = unicodeEscape();
13922 switch (u) {
13923 case "$":
13924 case "_":
13925 break;
13926 default:
13927 if (!util.isIdStartChar(u)) {
13928 throw invalidIdentifier();
13929 }
13930 break;
13931 }
13932 buffer += u;
13933 lexState = "identifierName";
13934 },
13935 identifierName() {
13936 switch (c) {
13937 case "$":
13938 case "_":
13939 case "\u200C":
13940 case "\u200D":
13941 buffer += read();
13942 return;
13943 case "\\":
13944 read();
13945 lexState = "identifierNameEscape";
13946 return;
13947 }
13948 if (util.isIdContinueChar(c)) {
13949 buffer += read();
13950 return;
13951 }
13952 return newToken("identifier", buffer);
13953 },
13954 identifierNameEscape() {
13955 if (c !== "u") {
13956 throw invalidChar(read());
13957 }
13958 read();
13959 const u = unicodeEscape();
13960 switch (u) {
13961 case "$":
13962 case "_":
13963 case "\u200C":
13964 case "\u200D":
13965 break;
13966 default:
13967 if (!util.isIdContinueChar(u)) {
13968 throw invalidIdentifier();
13969 }
13970 break;
13971 }
13972 buffer += u;
13973 lexState = "identifierName";
13974 },
13975 sign() {
13976 switch (c) {
13977 case ".":
13978 buffer = read();
13979 lexState = "decimalPointLeading";
13980 return;
13981 case "0":
13982 buffer = read();
13983 lexState = "zero";
13984 return;
13985 case "1":
13986 case "2":
13987 case "3":
13988 case "4":
13989 case "5":
13990 case "6":
13991 case "7":
13992 case "8":
13993 case "9":
13994 buffer = read();
13995 lexState = "decimalInteger";
13996 return;
13997 case "I":
13998 read();
13999 literal("nfinity");
14000 return newToken("numeric", sign * Infinity);
14001 case "N":
14002 read();
14003 literal("aN");
14004 return newToken("numeric", NaN);
14005 }
14006 throw invalidChar(read());
14007 },
14008 zero() {
14009 switch (c) {
14010 case ".":
14011 buffer += read();
14012 lexState = "decimalPoint";
14013 return;
14014 case "e":
14015 case "E":
14016 buffer += read();
14017 lexState = "decimalExponent";
14018 return;
14019 case "x":
14020 case "X":
14021 buffer += read();
14022 lexState = "hexadecimal";
14023 return;
14024 }
14025 return newToken("numeric", sign * 0);
14026 },
14027 decimalInteger() {
14028 switch (c) {
14029 case ".":
14030 buffer += read();
14031 lexState = "decimalPoint";
14032 return;
14033 case "e":
14034 case "E":
14035 buffer += read();
14036 lexState = "decimalExponent";
14037 return;
14038 }
14039 if (util.isDigit(c)) {
14040 buffer += read();
14041 return;
14042 }
14043 return newToken("numeric", sign * Number(buffer));
14044 },
14045 decimalPointLeading() {
14046 if (util.isDigit(c)) {
14047 buffer += read();
14048 lexState = "decimalFraction";
14049 return;
14050 }
14051 throw invalidChar(read());
14052 },
14053 decimalPoint() {
14054 switch (c) {
14055 case "e":
14056 case "E":
14057 buffer += read();
14058 lexState = "decimalExponent";
14059 return;
14060 }
14061 if (util.isDigit(c)) {
14062 buffer += read();
14063 lexState = "decimalFraction";
14064 return;
14065 }
14066 return newToken("numeric", sign * Number(buffer));
14067 },
14068 decimalFraction() {
14069 switch (c) {
14070 case "e":
14071 case "E":
14072 buffer += read();
14073 lexState = "decimalExponent";
14074 return;
14075 }
14076 if (util.isDigit(c)) {
14077 buffer += read();
14078 return;
14079 }
14080 return newToken("numeric", sign * Number(buffer));
14081 },
14082 decimalExponent() {
14083 switch (c) {
14084 case "+":
14085 case "-":
14086 buffer += read();
14087 lexState = "decimalExponentSign";
14088 return;
14089 }
14090 if (util.isDigit(c)) {
14091 buffer += read();
14092 lexState = "decimalExponentInteger";
14093 return;
14094 }
14095 throw invalidChar(read());
14096 },
14097 decimalExponentSign() {
14098 if (util.isDigit(c)) {
14099 buffer += read();
14100 lexState = "decimalExponentInteger";
14101 return;
14102 }
14103 throw invalidChar(read());
14104 },
14105 decimalExponentInteger() {
14106 if (util.isDigit(c)) {
14107 buffer += read();
14108 return;
14109 }
14110 return newToken("numeric", sign * Number(buffer));
14111 },
14112 hexadecimal() {
14113 if (util.isHexDigit(c)) {
14114 buffer += read();
14115 lexState = "hexadecimalInteger";
14116 return;
14117 }
14118 throw invalidChar(read());
14119 },
14120 hexadecimalInteger() {
14121 if (util.isHexDigit(c)) {
14122 buffer += read();
14123 return;
14124 }
14125 return newToken("numeric", sign * Number(buffer));
14126 },
14127 string() {
14128 switch (c) {
14129 case "\\":
14130 read();
14131 buffer += escape();
14132 return;
14133 case '"':
14134 if (doubleQuote) {
14135 read();
14136 return newToken("string", buffer);
14137 }
14138 buffer += read();
14139 return;
14140 case "'":
14141 if (!doubleQuote) {
14142 read();
14143 return newToken("string", buffer);
14144 }
14145 buffer += read();
14146 return;
14147 case "\n":
14148 case "\r":
14149 throw invalidChar(read());
14150 case "\u2028":
14151 case "\u2029":
14152 separatorChar(c);
14153 break;
14154 case void 0:
14155 throw invalidChar(read());
14156 }
14157 buffer += read();
14158 },
14159 start() {
14160 switch (c) {
14161 case "{":
14162 case "[":
14163 return newToken("punctuator", read());
14164 }
14165 lexState = "value";
14166 },
14167 beforePropertyName() {
14168 switch (c) {
14169 case "$":
14170 case "_":
14171 buffer = read();
14172 lexState = "identifierName";
14173 return;
14174 case "\\":
14175 read();
14176 lexState = "identifierNameStartEscape";
14177 return;
14178 case "}":
14179 return newToken("punctuator", read());
14180 case '"':
14181 case "'":
14182 doubleQuote = read() === '"';
14183 lexState = "string";
14184 return;
14185 }
14186 if (util.isIdStartChar(c)) {
14187 buffer += read();
14188 lexState = "identifierName";
14189 return;
14190 }
14191 throw invalidChar(read());
14192 },
14193 afterPropertyName() {
14194 if (c === ":") {
14195 return newToken("punctuator", read());
14196 }
14197 throw invalidChar(read());
14198 },
14199 beforePropertyValue() {
14200 lexState = "value";
14201 },
14202 afterPropertyValue() {
14203 switch (c) {
14204 case ",":
14205 case "}":
14206 return newToken("punctuator", read());
14207 }
14208 throw invalidChar(read());
14209 },
14210 beforeArrayValue() {
14211 if (c === "]") {
14212 return newToken("punctuator", read());
14213 }
14214 lexState = "value";
14215 },
14216 afterArrayValue() {
14217 switch (c) {
14218 case ",":
14219 case "]":
14220 return newToken("punctuator", read());
14221 }
14222 throw invalidChar(read());
14223 },
14224 end() {
14225 throw invalidChar(read());
14226 }
14227};
14228function newToken(type2, value) {
14229 return {
14230 type: type2,
14231 value,
14232 line,
14233 column
14234 };
14235}
14236function literal(s) {
14237 for (const c2 of s) {
14238 const p = peek();
14239 if (p !== c2) {
14240 throw invalidChar(read());
14241 }
14242 read();
14243 }
14244}
14245function escape() {
14246 const c2 = peek();
14247 switch (c2) {
14248 case "b":
14249 read();
14250 return "\b";
14251 case "f":
14252 read();
14253 return "\f";
14254 case "n":
14255 read();
14256 return "\n";
14257 case "r":
14258 read();
14259 return "\r";
14260 case "t":
14261 read();
14262 return " ";
14263 case "v":
14264 read();
14265 return "\v";
14266 case "0":
14267 read();
14268 if (util.isDigit(peek())) {
14269 throw invalidChar(read());
14270 }
14271 return "\0";
14272 case "x":
14273 read();
14274 return hexEscape();
14275 case "u":
14276 read();
14277 return unicodeEscape();
14278 case "\n":
14279 case "\u2028":
14280 case "\u2029":
14281 read();
14282 return "";
14283 case "\r":
14284 read();
14285 if (peek() === "\n") {
14286 read();
14287 }
14288 return "";
14289 case "1":
14290 case "2":
14291 case "3":
14292 case "4":
14293 case "5":
14294 case "6":
14295 case "7":
14296 case "8":
14297 case "9":
14298 throw invalidChar(read());
14299 case void 0:
14300 throw invalidChar(read());
14301 }
14302 return read();
14303}
14304function hexEscape() {
14305 let buffer2 = "";
14306 let c2 = peek();
14307 if (!util.isHexDigit(c2)) {
14308 throw invalidChar(read());
14309 }
14310 buffer2 += read();
14311 c2 = peek();
14312 if (!util.isHexDigit(c2)) {
14313 throw invalidChar(read());
14314 }
14315 buffer2 += read();
14316 return String.fromCodePoint(parseInt(buffer2, 16));
14317}
14318function unicodeEscape() {
14319 let buffer2 = "";
14320 let count = 4;
14321 while (count-- > 0) {
14322 const c2 = peek();
14323 if (!util.isHexDigit(c2)) {
14324 throw invalidChar(read());
14325 }
14326 buffer2 += read();
14327 }
14328 return String.fromCodePoint(parseInt(buffer2, 16));
14329}
14330var parseStates = {
14331 start() {
14332 if (token.type === "eof") {
14333 throw invalidEOF();
14334 }
14335 push();
14336 },
14337 beforePropertyName() {
14338 switch (token.type) {
14339 case "identifier":
14340 case "string":
14341 key = token.value;
14342 parseState = "afterPropertyName";
14343 return;
14344 case "punctuator":
14345 pop();
14346 return;
14347 case "eof":
14348 throw invalidEOF();
14349 }
14350 },
14351 afterPropertyName() {
14352 if (token.type === "eof") {
14353 throw invalidEOF();
14354 }
14355 parseState = "beforePropertyValue";
14356 },
14357 beforePropertyValue() {
14358 if (token.type === "eof") {
14359 throw invalidEOF();
14360 }
14361 push();
14362 },
14363 beforeArrayValue() {
14364 if (token.type === "eof") {
14365 throw invalidEOF();
14366 }
14367 if (token.type === "punctuator" && token.value === "]") {
14368 pop();
14369 return;
14370 }
14371 push();
14372 },
14373 afterPropertyValue() {
14374 if (token.type === "eof") {
14375 throw invalidEOF();
14376 }
14377 switch (token.value) {
14378 case ",":
14379 parseState = "beforePropertyName";
14380 return;
14381 case "}":
14382 pop();
14383 }
14384 },
14385 afterArrayValue() {
14386 if (token.type === "eof") {
14387 throw invalidEOF();
14388 }
14389 switch (token.value) {
14390 case ",":
14391 parseState = "beforeArrayValue";
14392 return;
14393 case "]":
14394 pop();
14395 }
14396 },
14397 end() {
14398 }
14399};
14400function push() {
14401 let value;
14402 switch (token.type) {
14403 case "punctuator":
14404 switch (token.value) {
14405 case "{":
14406 value = {};
14407 break;
14408 case "[":
14409 value = [];
14410 break;
14411 }
14412 break;
14413 case "null":
14414 case "boolean":
14415 case "numeric":
14416 case "string":
14417 value = token.value;
14418 break;
14419 }
14420 if (root === void 0) {
14421 root = value;
14422 } else {
14423 const parent = stack[stack.length - 1];
14424 if (Array.isArray(parent)) {
14425 parent.push(value);
14426 } else {
14427 Object.defineProperty(parent, key, {
14428 value,
14429 writable: true,
14430 enumerable: true,
14431 configurable: true
14432 });
14433 }
14434 }
14435 if (value !== null && typeof value === "object") {
14436 stack.push(value);
14437 if (Array.isArray(value)) {
14438 parseState = "beforeArrayValue";
14439 } else {
14440 parseState = "beforePropertyName";
14441 }
14442 } else {
14443 const current = stack[stack.length - 1];
14444 if (current == null) {
14445 parseState = "end";
14446 } else if (Array.isArray(current)) {
14447 parseState = "afterArrayValue";
14448 } else {
14449 parseState = "afterPropertyValue";
14450 }
14451 }
14452}
14453function pop() {
14454 stack.pop();
14455 const current = stack[stack.length - 1];
14456 if (current == null) {
14457 parseState = "end";
14458 } else if (Array.isArray(current)) {
14459 parseState = "afterArrayValue";
14460 } else {
14461 parseState = "afterPropertyValue";
14462 }
14463}
14464function invalidChar(c2) {
14465 if (c2 === void 0) {
14466 return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
14467 }
14468 return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`);
14469}
14470function invalidEOF() {
14471 return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
14472}
14473function invalidIdentifier() {
14474 column -= 5;
14475 return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`);
14476}
14477function separatorChar(c2) {
14478 console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
14479}
14480function formatChar(c2) {
14481 const replacements = {
14482 "'": "\\'",
14483 '"': '\\"',
14484 "\\": "\\\\",
14485 "\b": "\\b",
14486 "\f": "\\f",
14487 "\n": "\\n",
14488 "\r": "\\r",
14489 " ": "\\t",
14490 "\v": "\\v",
14491 "\0": "\\0",
14492 "\u2028": "\\u2028",
14493 "\u2029": "\\u2029"
14494 };
14495 if (replacements[c2]) {
14496 return replacements[c2];
14497 }
14498 if (c2 < " ") {
14499 const hexString = c2.charCodeAt(0).toString(16);
14500 return "\\x" + ("00" + hexString).substring(hexString.length);
14501 }
14502 return c2;
14503}
14504function syntaxError(message) {
14505 const err = new SyntaxError(message);
14506 err.lineNumber = line;
14507 err.columnNumber = column;
14508 return err;
14509}
14510var dist_default = { parse: parse2 };
14511
14512// node_modules/parse-json/index.js
14513var import_code_frame = __toESM(require_lib2(), 1);
14514
14515// node_modules/index-to-position/index.js
14516var safeLastIndexOf = (string, searchString, index) => index < 0 ? -1 : string.lastIndexOf(searchString, index);
14517function getPosition(text, textIndex) {
14518 const lineBreakBefore = safeLastIndexOf(text, "\n", textIndex - 1);
14519 const column2 = textIndex - lineBreakBefore - 1;
14520 let line3 = 0;
14521 for (let index = lineBreakBefore; index >= 0; index = safeLastIndexOf(text, "\n", index - 1)) {
14522 line3++;
14523 }
14524 return { line: line3, column: column2 };
14525}
14526function indexToLineColumn(text, textIndex, { oneBased = false } = {}) {
14527 if (textIndex < 0 || textIndex >= text.length && text.length > 0) {
14528 throw new RangeError("Index out of bounds");
14529 }
14530 const position = getPosition(text, textIndex);
14531 return oneBased ? { line: position.line + 1, column: position.column + 1 } : position;
14532}
14533
14534// node_modules/parse-json/index.js
14535var getCodePoint = (character) => `\\u{${character.codePointAt(0).toString(16)}}`;
14536var _message;
14537var _JSONError = class _JSONError extends Error {
14538 constructor(message) {
14539 var _a;
14540 super();
14541 __publicField(this, "name", "JSONError");
14542 __publicField(this, "fileName");
14543 __publicField(this, "codeFrame");
14544 __publicField(this, "rawCodeFrame");
14545 __privateAdd(this, _message);
14546 __privateSet(this, _message, message);
14547 (_a = Error.captureStackTrace) == null ? void 0 : _a.call(Error, this, _JSONError);
14548 }
14549 get message() {
14550 const { fileName, codeFrame } = this;
14551 return `${__privateGet(this, _message)}${fileName ? ` in ${fileName}` : ""}${codeFrame ? `
14552
14553${codeFrame}
14554` : ""}`;
14555 }
14556 set message(message) {
14557 __privateSet(this, _message, message);
14558 }
14559};
14560_message = new WeakMap();
14561var JSONError = _JSONError;
14562var generateCodeFrame = (string, location, highlightCode = true) => (0, import_code_frame.codeFrameColumns)(string, { start: location }, { highlightCode });
14563var getErrorLocation = (string, message) => {
14564 const match = message.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);
14565 if (!match) {
14566 return;
14567 }
14568 let { index, line: line3, column: column2 } = match.groups;
14569 if (line3 && column2) {
14570 return { line: Number(line3), column: Number(column2) };
14571 }
14572 index = Number(index);
14573 if (index === string.length) {
14574 const { line: line4, column: column3 } = indexToLineColumn(string, string.length - 1, { oneBased: true });
14575 return { line: line4, column: column3 + 1 };
14576 }
14577 return indexToLineColumn(string, index, { oneBased: true });
14578};
14579var addCodePointToUnexpectedToken = (message) => message.replace(
14580 // TODO[engine:node@>=20]: The token always quoted after Node.js 20
14581 /(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,
14582 (_, _quote, token2) => `"${token2}"(${getCodePoint(token2)})`
14583);
14584function parseJson(string, reviver, fileName) {
14585 if (typeof reviver === "string") {
14586 fileName = reviver;
14587 reviver = void 0;
14588 }
14589 let message;
14590 try {
14591 return JSON.parse(string, reviver);
14592 } catch (error) {
14593 message = error.message;
14594 }
14595 let location;
14596 if (string) {
14597 location = getErrorLocation(string, message);
14598 message = addCodePointToUnexpectedToken(message);
14599 } else {
14600 message += " while parsing empty string";
14601 }
14602 const jsonError = new JSONError(message);
14603 jsonError.fileName = fileName;
14604 if (location) {
14605 jsonError.codeFrame = generateCodeFrame(string, location);
14606 jsonError.rawCodeFrame = generateCodeFrame(
14607 string,
14608 location,
14609 /* highlightCode */
14610 false
14611 );
14612 }
14613 throw jsonError;
14614}
14615
14616// node_modules/smol-toml/dist/error.js
14617function getLineColFromPtr(string, ptr) {
14618 let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g);
14619 return [lines.length, lines.pop().length + 1];
14620}
14621function makeCodeBlock(string, line3, column2) {
14622 let lines = string.split(/\r\n|\n|\r/g);
14623 let codeblock = "";
14624 let numberLen = (Math.log10(line3 + 1) | 0) + 1;
14625 for (let i = line3 - 1; i <= line3 + 1; i++) {
14626 let l = lines[i - 1];
14627 if (!l)
14628 continue;
14629 codeblock += i.toString().padEnd(numberLen, " ");
14630 codeblock += ": ";
14631 codeblock += l;
14632 codeblock += "\n";
14633 if (i === line3) {
14634 codeblock += " ".repeat(numberLen + column2 + 2);
14635 codeblock += "^\n";
14636 }
14637 }
14638 return codeblock;
14639}
14640var TomlError = class extends Error {
14641 line;
14642 column;
14643 codeblock;
14644 constructor(message, options8) {
14645 const [line3, column2] = getLineColFromPtr(options8.toml, options8.ptr);
14646 const codeblock = makeCodeBlock(options8.toml, line3, column2);
14647 super(`Invalid TOML document: ${message}
14648
14649${codeblock}`, options8);
14650 this.line = line3;
14651 this.column = column2;
14652 this.codeblock = codeblock;
14653 }
14654};
14655
14656// node_modules/smol-toml/dist/util.js
14657function indexOfNewline(str2, start = 0, end = str2.length) {
14658 let idx = str2.indexOf("\n", start);
14659 if (str2[idx - 1] === "\r")
14660 idx--;
14661 return idx <= end ? idx : -1;
14662}
14663function skipComment(str2, ptr) {
14664 for (let i = ptr; i < str2.length; i++) {
14665 let c2 = str2[i];
14666 if (c2 === "\n")
14667 return i;
14668 if (c2 === "\r" && str2[i + 1] === "\n")
14669 return i + 1;
14670 if (c2 < " " && c2 !== " " || c2 === "\x7F") {
14671 throw new TomlError("control characters are not allowed in comments", {
14672 toml: str2,
14673 ptr
14674 });
14675 }
14676 }
14677 return str2.length;
14678}
14679function skipVoid(str2, ptr, banNewLines, banComments) {
14680 let c2;
14681 while ((c2 = str2[ptr]) === " " || c2 === " " || !banNewLines && (c2 === "\n" || c2 === "\r" && str2[ptr + 1] === "\n"))
14682 ptr++;
14683 return banComments || c2 !== "#" ? ptr : skipVoid(str2, skipComment(str2, ptr), banNewLines);
14684}
14685function skipUntil(str2, ptr, sep, end, banNewLines = false) {
14686 if (!end) {
14687 ptr = indexOfNewline(str2, ptr);
14688 return ptr < 0 ? str2.length : ptr;
14689 }
14690 for (let i = ptr; i < str2.length; i++) {
14691 let c2 = str2[i];
14692 if (c2 === "#") {
14693 i = indexOfNewline(str2, i);
14694 } else if (c2 === sep) {
14695 return i + 1;
14696 } else if (c2 === end) {
14697 return i;
14698 } else if (banNewLines && (c2 === "\n" || c2 === "\r" && str2[i + 1] === "\n")) {
14699 return i;
14700 }
14701 }
14702 throw new TomlError("cannot find end of structure", {
14703 toml: str2,
14704 ptr
14705 });
14706}
14707function getStringEnd(str2, seek) {
14708 let first = str2[seek];
14709 let target = first === str2[seek + 1] && str2[seek + 1] === str2[seek + 2] ? str2.slice(seek, seek + 3) : first;
14710 seek += target.length - 1;
14711 do
14712 seek = str2.indexOf(target, ++seek);
14713 while (seek > -1 && first !== "'" && str2[seek - 1] === "\\" && str2[seek - 2] !== "\\");
14714 if (seek > -1) {
14715 seek += target.length;
14716 if (target.length > 1) {
14717 if (str2[seek] === first)
14718 seek++;
14719 if (str2[seek] === first)
14720 seek++;
14721 }
14722 }
14723 return seek;
14724}
14725
14726// node_modules/smol-toml/dist/date.js
14727var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i;
14728var _hasDate, _hasTime, _offset;
14729var _TomlDate = class _TomlDate extends Date {
14730 constructor(date) {
14731 let hasDate = true;
14732 let hasTime = true;
14733 let offset = "Z";
14734 if (typeof date === "string") {
14735 let match = date.match(DATE_TIME_RE);
14736 if (match) {
14737 if (!match[1]) {
14738 hasDate = false;
14739 date = `0000-01-01T${date}`;
14740 }
14741 hasTime = !!match[2];
14742 if (match[2] && +match[2] > 23) {
14743 date = "";
14744 } else {
14745 offset = match[3] || null;
14746 date = date.toUpperCase();
14747 if (!offset && hasTime)
14748 date += "Z";
14749 }
14750 } else {
14751 date = "";
14752 }
14753 }
14754 super(date);
14755 __privateAdd(this, _hasDate, false);
14756 __privateAdd(this, _hasTime, false);
14757 __privateAdd(this, _offset, null);
14758 if (!isNaN(this.getTime())) {
14759 __privateSet(this, _hasDate, hasDate);
14760 __privateSet(this, _hasTime, hasTime);
14761 __privateSet(this, _offset, offset);
14762 }
14763 }
14764 isDateTime() {
14765 return __privateGet(this, _hasDate) && __privateGet(this, _hasTime);
14766 }
14767 isLocal() {
14768 return !__privateGet(this, _hasDate) || !__privateGet(this, _hasTime) || !__privateGet(this, _offset);
14769 }
14770 isDate() {
14771 return __privateGet(this, _hasDate) && !__privateGet(this, _hasTime);
14772 }
14773 isTime() {
14774 return __privateGet(this, _hasTime) && !__privateGet(this, _hasDate);
14775 }
14776 isValid() {
14777 return __privateGet(this, _hasDate) || __privateGet(this, _hasTime);
14778 }
14779 toISOString() {
14780 let iso = super.toISOString();
14781 if (this.isDate())
14782 return iso.slice(0, 10);
14783 if (this.isTime())
14784 return iso.slice(11, 23);
14785 if (__privateGet(this, _offset) === null)
14786 return iso.slice(0, -1);
14787 if (__privateGet(this, _offset) === "Z")
14788 return iso;
14789 let offset = +__privateGet(this, _offset).slice(1, 3) * 60 + +__privateGet(this, _offset).slice(4, 6);
14790 offset = __privateGet(this, _offset)[0] === "-" ? offset : -offset;
14791 let offsetDate = new Date(this.getTime() - offset * 6e4);
14792 return offsetDate.toISOString().slice(0, -1) + __privateGet(this, _offset);
14793 }
14794 static wrapAsOffsetDateTime(jsDate, offset = "Z") {
14795 let date = new _TomlDate(jsDate);
14796 __privateSet(date, _offset, offset);
14797 return date;
14798 }
14799 static wrapAsLocalDateTime(jsDate) {
14800 let date = new _TomlDate(jsDate);
14801 __privateSet(date, _offset, null);
14802 return date;
14803 }
14804 static wrapAsLocalDate(jsDate) {
14805 let date = new _TomlDate(jsDate);
14806 __privateSet(date, _hasTime, false);
14807 __privateSet(date, _offset, null);
14808 return date;
14809 }
14810 static wrapAsLocalTime(jsDate) {
14811 let date = new _TomlDate(jsDate);
14812 __privateSet(date, _hasDate, false);
14813 __privateSet(date, _offset, null);
14814 return date;
14815 }
14816};
14817_hasDate = new WeakMap();
14818_hasTime = new WeakMap();
14819_offset = new WeakMap();
14820var TomlDate = _TomlDate;
14821
14822// node_modules/smol-toml/dist/primitive.js
14823var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
14824var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
14825var LEADING_ZERO = /^[+-]?0[0-9_]/;
14826var ESCAPE_REGEX = /^[0-9a-f]{4,8}$/i;
14827var ESC_MAP = {
14828 b: "\b",
14829 t: " ",
14830 n: "\n",
14831 f: "\f",
14832 r: "\r",
14833 '"': '"',
14834 "\\": "\\"
14835};
14836function parseString(str2, ptr = 0, endPtr = str2.length) {
14837 let isLiteral = str2[ptr] === "'";
14838 let isMultiline = str2[ptr++] === str2[ptr] && str2[ptr] === str2[ptr + 1];
14839 if (isMultiline) {
14840 endPtr -= 2;
14841 if (str2[ptr += 2] === "\r")
14842 ptr++;
14843 if (str2[ptr] === "\n")
14844 ptr++;
14845 }
14846 let tmp = 0;
14847 let isEscape;
14848 let parsed = "";
14849 let sliceStart = ptr;
14850 while (ptr < endPtr - 1) {
14851 let c2 = str2[ptr++];
14852 if (c2 === "\n" || c2 === "\r" && str2[ptr] === "\n") {
14853 if (!isMultiline) {
14854 throw new TomlError("newlines are not allowed in strings", {
14855 toml: str2,
14856 ptr: ptr - 1
14857 });
14858 }
14859 } else if (c2 < " " && c2 !== " " || c2 === "\x7F") {
14860 throw new TomlError("control characters are not allowed in strings", {
14861 toml: str2,
14862 ptr: ptr - 1
14863 });
14864 }
14865 if (isEscape) {
14866 isEscape = false;
14867 if (c2 === "u" || c2 === "U") {
14868 let code = str2.slice(ptr, ptr += c2 === "u" ? 4 : 8);
14869 if (!ESCAPE_REGEX.test(code)) {
14870 throw new TomlError("invalid unicode escape", {
14871 toml: str2,
14872 ptr: tmp
14873 });
14874 }
14875 try {
14876 parsed += String.fromCodePoint(parseInt(code, 16));
14877 } catch {
14878 throw new TomlError("invalid unicode escape", {
14879 toml: str2,
14880 ptr: tmp
14881 });
14882 }
14883 } else if (isMultiline && (c2 === "\n" || c2 === " " || c2 === " " || c2 === "\r")) {
14884 ptr = skipVoid(str2, ptr - 1, true);
14885 if (str2[ptr] !== "\n" && str2[ptr] !== "\r") {
14886 throw new TomlError("invalid escape: only line-ending whitespace may be escaped", {
14887 toml: str2,
14888 ptr: tmp
14889 });
14890 }
14891 ptr = skipVoid(str2, ptr);
14892 } else if (c2 in ESC_MAP) {
14893 parsed += ESC_MAP[c2];
14894 } else {
14895 throw new TomlError("unrecognized escape sequence", {
14896 toml: str2,
14897 ptr: tmp
14898 });
14899 }
14900 sliceStart = ptr;
14901 } else if (!isLiteral && c2 === "\\") {
14902 tmp = ptr - 1;
14903 isEscape = true;
14904 parsed += str2.slice(sliceStart, tmp);
14905 }
14906 }
14907 return parsed + str2.slice(sliceStart, endPtr - 1);
14908}
14909function parseValue(value, toml, ptr) {
14910 if (value === "true")
14911 return true;
14912 if (value === "false")
14913 return false;
14914 if (value === "-inf")
14915 return -Infinity;
14916 if (value === "inf" || value === "+inf")
14917 return Infinity;
14918 if (value === "nan" || value === "+nan" || value === "-nan")
14919 return NaN;
14920 if (value === "-0")
14921 return 0;
14922 let isInt2;
14923 if ((isInt2 = INT_REGEX.test(value)) || FLOAT_REGEX.test(value)) {
14924 if (LEADING_ZERO.test(value)) {
14925 throw new TomlError("leading zeroes are not allowed", {
14926 toml,
14927 ptr
14928 });
14929 }
14930 let numeric = +value.replace(/_/g, "");
14931 if (isNaN(numeric)) {
14932 throw new TomlError("invalid number", {
14933 toml,
14934 ptr
14935 });
14936 }
14937 if (isInt2 && !Number.isSafeInteger(numeric)) {
14938 throw new TomlError("integer value cannot be represented losslessly", {
14939 toml,
14940 ptr
14941 });
14942 }
14943 return numeric;
14944 }
14945 let date = new TomlDate(value);
14946 if (!date.isValid()) {
14947 throw new TomlError("invalid value", {
14948 toml,
14949 ptr
14950 });
14951 }
14952 return date;
14953}
14954
14955// node_modules/smol-toml/dist/extract.js
14956function sliceAndTrimEndOf(str2, startPtr, endPtr, allowNewLines) {
14957 let value = str2.slice(startPtr, endPtr);
14958 let commentIdx = value.indexOf("#");
14959 if (commentIdx > -1) {
14960 skipComment(str2, commentIdx);
14961 value = value.slice(0, commentIdx);
14962 }
14963 let trimmed = value.trimEnd();
14964 if (!allowNewLines) {
14965 let newlineIdx = value.indexOf("\n", trimmed.length);
14966 if (newlineIdx > -1) {
14967 throw new TomlError("newlines are not allowed in inline tables", {
14968 toml: str2,
14969 ptr: startPtr + newlineIdx
14970 });
14971 }
14972 }
14973 return [trimmed, commentIdx];
14974}
14975function extractValue(str2, ptr, end, depth) {
14976 if (depth === 0) {
14977 throw new TomlError("document contains excessively nested structures. aborting.", {
14978 toml: str2,
14979 ptr
14980 });
14981 }
14982 let c2 = str2[ptr];
14983 if (c2 === "[" || c2 === "{") {
14984 let [value, endPtr2] = c2 === "[" ? parseArray(str2, ptr, depth) : parseInlineTable(str2, ptr, depth);
14985 let newPtr = skipUntil(str2, endPtr2, ",", end);
14986 if (end === "}") {
14987 let nextNewLine = indexOfNewline(str2, endPtr2, newPtr);
14988 if (nextNewLine > -1) {
14989 throw new TomlError("newlines are not allowed in inline tables", {
14990 toml: str2,
14991 ptr: nextNewLine
14992 });
14993 }
14994 }
14995 return [value, newPtr];
14996 }
14997 let endPtr;
14998 if (c2 === '"' || c2 === "'") {
14999 endPtr = getStringEnd(str2, ptr);
15000 let parsed = parseString(str2, ptr, endPtr);
15001 if (end) {
15002 endPtr = skipVoid(str2, endPtr, end !== "]");
15003 if (str2[endPtr] && str2[endPtr] !== "," && str2[endPtr] !== end && str2[endPtr] !== "\n" && str2[endPtr] !== "\r") {
15004 throw new TomlError("unexpected character encountered", {
15005 toml: str2,
15006 ptr: endPtr
15007 });
15008 }
15009 endPtr += +(str2[endPtr] === ",");
15010 }
15011 return [parsed, endPtr];
15012 }
15013 endPtr = skipUntil(str2, ptr, ",", end);
15014 let slice = sliceAndTrimEndOf(str2, ptr, endPtr - +(str2[endPtr - 1] === ","), end === "]");
15015 if (!slice[0]) {
15016 throw new TomlError("incomplete key-value declaration: no value specified", {
15017 toml: str2,
15018 ptr
15019 });
15020 }
15021 if (end && slice[1] > -1) {
15022 endPtr = skipVoid(str2, ptr + slice[1]);
15023 endPtr += +(str2[endPtr] === ",");
15024 }
15025 return [
15026 parseValue(slice[0], str2, ptr),
15027 endPtr
15028 ];
15029}
15030
15031// node_modules/smol-toml/dist/struct.js
15032var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
15033function parseKey(str2, ptr, end = "=") {
15034 let dot = ptr - 1;
15035 let parsed = [];
15036 let endPtr = str2.indexOf(end, ptr);
15037 if (endPtr < 0) {
15038 throw new TomlError("incomplete key-value: cannot find end of key", {
15039 toml: str2,
15040 ptr
15041 });
15042 }
15043 do {
15044 let c2 = str2[ptr = ++dot];
15045 if (c2 !== " " && c2 !== " ") {
15046 if (c2 === '"' || c2 === "'") {
15047 if (c2 === str2[ptr + 1] && c2 === str2[ptr + 2]) {
15048 throw new TomlError("multiline strings are not allowed in keys", {
15049 toml: str2,
15050 ptr
15051 });
15052 }
15053 let eos = getStringEnd(str2, ptr);
15054 if (eos < 0) {
15055 throw new TomlError("unfinished string encountered", {
15056 toml: str2,
15057 ptr
15058 });
15059 }
15060 dot = str2.indexOf(".", eos);
15061 let strEnd = str2.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);
15062 let newLine = indexOfNewline(strEnd);
15063 if (newLine > -1) {
15064 throw new TomlError("newlines are not allowed in keys", {
15065 toml: str2,
15066 ptr: ptr + dot + newLine
15067 });
15068 }
15069 if (strEnd.trimStart()) {
15070 throw new TomlError("found extra tokens after the string part", {
15071 toml: str2,
15072 ptr: eos
15073 });
15074 }
15075 if (endPtr < eos) {
15076 endPtr = str2.indexOf(end, eos);
15077 if (endPtr < 0) {
15078 throw new TomlError("incomplete key-value: cannot find end of key", {
15079 toml: str2,
15080 ptr
15081 });
15082 }
15083 }
15084 parsed.push(parseString(str2, ptr, eos));
15085 } else {
15086 dot = str2.indexOf(".", ptr);
15087 let part = str2.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot);
15088 if (!KEY_PART_RE.test(part)) {
15089 throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", {
15090 toml: str2,
15091 ptr
15092 });
15093 }
15094 parsed.push(part.trimEnd());
15095 }
15096 }
15097 } while (dot + 1 && dot < endPtr);
15098 return [parsed, skipVoid(str2, endPtr + 1, true, true)];
15099}
15100function parseInlineTable(str2, ptr, depth) {
15101 let res = {};
15102 let seen = /* @__PURE__ */ new Set();
15103 let c2;
15104 let comma = 0;
15105 ptr++;
15106 while ((c2 = str2[ptr++]) !== "}" && c2) {
15107 if (c2 === "\n") {
15108 throw new TomlError("newlines are not allowed in inline tables", {
15109 toml: str2,
15110 ptr: ptr - 1
15111 });
15112 } else if (c2 === "#") {
15113 throw new TomlError("inline tables cannot contain comments", {
15114 toml: str2,
15115 ptr: ptr - 1
15116 });
15117 } else if (c2 === ",") {
15118 throw new TomlError("expected key-value, found comma", {
15119 toml: str2,
15120 ptr: ptr - 1
15121 });
15122 } else if (c2 !== " " && c2 !== " ") {
15123 let k;
15124 let t = res;
15125 let hasOwn = false;
15126 let [key2, keyEndPtr] = parseKey(str2, ptr - 1);
15127 for (let i = 0; i < key2.length; i++) {
15128 if (i)
15129 t = hasOwn ? t[k] : t[k] = {};
15130 k = key2[i];
15131 if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) {
15132 throw new TomlError("trying to redefine an already defined value", {
15133 toml: str2,
15134 ptr
15135 });
15136 }
15137 if (!hasOwn && k === "__proto__") {
15138 Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
15139 }
15140 }
15141 if (hasOwn) {
15142 throw new TomlError("trying to redefine an already defined value", {
15143 toml: str2,
15144 ptr
15145 });
15146 }
15147 let [value, valueEndPtr] = extractValue(str2, keyEndPtr, "}", depth - 1);
15148 seen.add(value);
15149 t[k] = value;
15150 ptr = valueEndPtr;
15151 comma = str2[ptr - 1] === "," ? ptr - 1 : 0;
15152 }
15153 }
15154 if (comma) {
15155 throw new TomlError("trailing commas are not allowed in inline tables", {
15156 toml: str2,
15157 ptr: comma
15158 });
15159 }
15160 if (!c2) {
15161 throw new TomlError("unfinished table encountered", {
15162 toml: str2,
15163 ptr
15164 });
15165 }
15166 return [res, ptr];
15167}
15168function parseArray(str2, ptr, depth) {
15169 let res = [];
15170 let c2;
15171 ptr++;
15172 while ((c2 = str2[ptr++]) !== "]" && c2) {
15173 if (c2 === ",") {
15174 throw new TomlError("expected value, found comma", {
15175 toml: str2,
15176 ptr: ptr - 1
15177 });
15178 } else if (c2 === "#")
15179 ptr = skipComment(str2, ptr);
15180 else if (c2 !== " " && c2 !== " " && c2 !== "\n" && c2 !== "\r") {
15181 let e = extractValue(str2, ptr - 1, "]", depth - 1);
15182 res.push(e[0]);
15183 ptr = e[1];
15184 }
15185 }
15186 if (!c2) {
15187 throw new TomlError("unfinished array encountered", {
15188 toml: str2,
15189 ptr
15190 });
15191 }
15192 return [res, ptr];
15193}
15194
15195// node_modules/smol-toml/dist/parse.js
15196function peekTable(key2, table, meta, type2) {
15197 var _a, _b;
15198 let t = table;
15199 let m = meta;
15200 let k;
15201 let hasOwn = false;
15202 let state;
15203 for (let i = 0; i < key2.length; i++) {
15204 if (i) {
15205 t = hasOwn ? t[k] : t[k] = {};
15206 m = (state = m[k]).c;
15207 if (type2 === 0 && (state.t === 1 || state.t === 2)) {
15208 return null;
15209 }
15210 if (state.t === 2) {
15211 let l = t.length - 1;
15212 t = t[l];
15213 m = m[l].c;
15214 }
15215 }
15216 k = key2[i];
15217 if ((hasOwn = Object.hasOwn(t, k)) && ((_a = m[k]) == null ? void 0 : _a.t) === 0 && ((_b = m[k]) == null ? void 0 : _b.d)) {
15218 return null;
15219 }
15220 if (!hasOwn) {
15221 if (k === "__proto__") {
15222 Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
15223 Object.defineProperty(m, k, { enumerable: true, configurable: true, writable: true });
15224 }
15225 m[k] = {
15226 t: i < key2.length - 1 && type2 === 2 ? 3 : type2,
15227 d: false,
15228 i: 0,
15229 c: {}
15230 };
15231 }
15232 }
15233 state = m[k];
15234 if (state.t !== type2 && !(type2 === 1 && state.t === 3)) {
15235 return null;
15236 }
15237 if (type2 === 2) {
15238 if (!state.d) {
15239 state.d = true;
15240 t[k] = [];
15241 }
15242 t[k].push(t = {});
15243 state.c[state.i++] = state = { t: 1, d: false, i: 0, c: {} };
15244 }
15245 if (state.d) {
15246 return null;
15247 }
15248 state.d = true;
15249 if (type2 === 1) {
15250 t = hasOwn ? t[k] : t[k] = {};
15251 } else if (type2 === 0 && hasOwn) {
15252 return null;
15253 }
15254 return [k, t, state.c];
15255}
15256function parse4(toml, opts) {
15257 let maxDepth = (opts == null ? void 0 : opts.maxDepth) ?? 1e3;
15258 let res = {};
15259 let meta = {};
15260 let tbl = res;
15261 let m = meta;
15262 for (let ptr = skipVoid(toml, 0); ptr < toml.length; ) {
15263 if (toml[ptr] === "[") {
15264 let isTableArray = toml[++ptr] === "[";
15265 let k = parseKey(toml, ptr += +isTableArray, "]");
15266 if (isTableArray) {
15267 if (toml[k[1] - 1] !== "]") {
15268 throw new TomlError("expected end of table declaration", {
15269 toml,
15270 ptr: k[1] - 1
15271 });
15272 }
15273 k[1]++;
15274 }
15275 let p = peekTable(
15276 k[0],
15277 res,
15278 meta,
15279 isTableArray ? 2 : 1
15280 /* Type.EXPLICIT */
15281 );
15282 if (!p) {
15283 throw new TomlError("trying to redefine an already defined table or value", {
15284 toml,
15285 ptr
15286 });
15287 }
15288 m = p[2];
15289 tbl = p[1];
15290 ptr = k[1];
15291 } else {
15292 let k = parseKey(toml, ptr);
15293 let p = peekTable(
15294 k[0],
15295 tbl,
15296 m,
15297 0
15298 /* Type.DOTTED */
15299 );
15300 if (!p) {
15301 throw new TomlError("trying to redefine an already defined table or value", {
15302 toml,
15303 ptr
15304 });
15305 }
15306 let v = extractValue(toml, k[1], void 0, maxDepth);
15307 p[1][p[0]] = v[0];
15308 ptr = v[1];
15309 }
15310 ptr = skipVoid(toml, ptr, true);
15311 if (toml[ptr] && toml[ptr] !== "\n" && toml[ptr] !== "\r") {
15312 throw new TomlError("each key-value declaration must be followed by an end-of-line", {
15313 toml,
15314 ptr
15315 });
15316 }
15317 ptr = skipVoid(toml, ptr);
15318 }
15319 return res;
15320}
15321
15322// src/utils/read-file.js
15323import fs4 from "fs/promises";
15324async function readFile(file) {
15325 if (isUrlString(file)) {
15326 file = new URL(file);
15327 }
15328 try {
15329 return await fs4.readFile(file, "utf8");
15330 } catch (error) {
15331 if (error.code === "ENOENT") {
15332 return;
15333 }
15334 throw new Error(`Unable to read '${file}': ${error.message}`);
15335 }
15336}
15337var read_file_default = readFile;
15338
15339// src/config/prettier-config/loaders.js
15340async function readJson(file) {
15341 const content = await read_file_default(file);
15342 try {
15343 return parseJson(content);
15344 } catch (error) {
15345 error.message = `JSON Error in ${file}:
15346${error.message}`;
15347 throw error;
15348 }
15349}
15350async function loadJs(file) {
15351 const module = await import(pathToFileURL2(file).href);
15352 return module.default;
15353}
15354async function loadConfigFromPackageJson(file) {
15355 const { prettier } = await readJson(file);
15356 return prettier;
15357}
15358async function loadConfigFromPackageYaml(file) {
15359 const { prettier } = await loadYaml(file);
15360 return prettier;
15361}
15362async function loadYaml(file) {
15363 const content = await read_file_default(file);
15364 try {
15365 return load(content);
15366 } catch (error) {
15367 error.message = `YAML Error in ${file}:
15368${error.message}`;
15369 throw error;
15370 }
15371}
15372var loaders = {
15373 async ".toml"(file) {
15374 const content = await read_file_default(file);
15375 try {
15376 return parse4(content);
15377 } catch (error) {
15378 error.message = `TOML Error in ${file}:
15379${error.message}`;
15380 throw error;
15381 }
15382 },
15383 async ".json5"(file) {
15384 const content = await read_file_default(file);
15385 try {
15386 return dist_default.parse(content);
15387 } catch (error) {
15388 error.message = `JSON5 Error in ${file}:
15389${error.message}`;
15390 throw error;
15391 }
15392 },
15393 ".json": readJson,
15394 ".js": loadJs,
15395 ".mjs": loadJs,
15396 ".cjs": loadJs,
15397 ".yaml": loadYaml,
15398 ".yml": loadYaml,
15399 // No extension
15400 "": loadYaml
15401};
15402var loaders_default = loaders;
15403
15404// src/config/prettier-config/config-searcher.js
15405var CONFIG_FILE_NAMES = [
15406 "package.json",
15407 "package.yaml",
15408 ".prettierrc",
15409 ".prettierrc.json",
15410 ".prettierrc.yaml",
15411 ".prettierrc.yml",
15412 ".prettierrc.json5",
15413 ".prettierrc.js",
15414 ".prettierrc.mjs",
15415 ".prettierrc.cjs",
15416 "prettier.config.js",
15417 "prettier.config.mjs",
15418 "prettier.config.cjs",
15419 ".prettierrc.toml"
15420];
15421async function filter({ name, path: file }) {
15422 if (!await is_file_default(file)) {
15423 return false;
15424 }
15425 if (name === "package.json") {
15426 try {
15427 return Boolean(await loadConfigFromPackageJson(file));
15428 } catch {
15429 return false;
15430 }
15431 }
15432 if (name === "package.yaml") {
15433 try {
15434 return Boolean(await loadConfigFromPackageYaml(file));
15435 } catch {
15436 return false;
15437 }
15438 }
15439 return true;
15440}
15441function getSearcher(stopDirectory) {
15442 return new searcher_default({ names: CONFIG_FILE_NAMES, filter, stopDirectory });
15443}
15444var config_searcher_default = getSearcher;
15445
15446// src/config/prettier-config/load-config.js
15447import path7 from "path";
15448
15449// src/utils/import-from-file.js
15450import { pathToFileURL as pathToFileURL4 } from "url";
15451
15452// node_modules/import-meta-resolve/lib/resolve.js
15453import assert3 from "assert";
15454import { statSync, realpathSync } from "fs";
15455import process3 from "process";
15456import { URL as URL2, fileURLToPath as fileURLToPath4, pathToFileURL as pathToFileURL3 } from "url";
15457import path6 from "path";
15458import { builtinModules } from "module";
15459
15460// node_modules/import-meta-resolve/lib/get-format.js
15461import { fileURLToPath as fileURLToPath3 } from "url";
15462
15463// node_modules/import-meta-resolve/lib/package-json-reader.js
15464import fs5 from "fs";
15465import path5 from "path";
15466import { fileURLToPath as fileURLToPath2 } from "url";
15467
15468// node_modules/import-meta-resolve/lib/errors.js
15469import v8 from "v8";
15470import assert2 from "assert";
15471import { format, inspect } from "util";
15472var own = {}.hasOwnProperty;
15473var classRegExp = /^([A-Z][a-z\d]*)+$/;
15474var kTypes = /* @__PURE__ */ new Set([
15475 "string",
15476 "function",
15477 "number",
15478 "object",
15479 // Accept 'Function' and 'Object' as alternative to the lower cased version.
15480 "Function",
15481 "Object",
15482 "boolean",
15483 "bigint",
15484 "symbol"
15485]);
15486var codes = {};
15487function formatList(array2, type2 = "and") {
15488 return array2.length < 3 ? array2.join(` ${type2} `) : `${array2.slice(0, -1).join(", ")}, ${type2} ${array2[array2.length - 1]}`;
15489}
15490var messages = /* @__PURE__ */ new Map();
15491var nodeInternalPrefix = "__node_internal_";
15492var userStackTraceLimit;
15493codes.ERR_INVALID_ARG_TYPE = createError(
15494 "ERR_INVALID_ARG_TYPE",
15495 /**
15496 * @param {string} name
15497 * @param {Array<string> | string} expected
15498 * @param {unknown} actual
15499 */
15500 (name, expected, actual) => {
15501 assert2(typeof name === "string", "'name' must be a string");
15502 if (!Array.isArray(expected)) {
15503 expected = [expected];
15504 }
15505 let message = "The ";
15506 if (name.endsWith(" argument")) {
15507 message += `${name} `;
15508 } else {
15509 const type2 = name.includes(".") ? "property" : "argument";
15510 message += `"${name}" ${type2} `;
15511 }
15512 message += "must be ";
15513 const types = [];
15514 const instances = [];
15515 const other = [];
15516 for (const value of expected) {
15517 assert2(
15518 typeof value === "string",
15519 "All expected entries have to be of type string"
15520 );
15521 if (kTypes.has(value)) {
15522 types.push(value.toLowerCase());
15523 } else if (classRegExp.exec(value) === null) {
15524 assert2(
15525 value !== "object",
15526 'The value "object" should be written as "Object"'
15527 );
15528 other.push(value);
15529 } else {
15530 instances.push(value);
15531 }
15532 }
15533 if (instances.length > 0) {
15534 const pos2 = types.indexOf("object");
15535 if (pos2 !== -1) {
15536 types.slice(pos2, 1);
15537 instances.push("Object");
15538 }
15539 }
15540 if (types.length > 0) {
15541 message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(
15542 types,
15543 "or"
15544 )}`;
15545 if (instances.length > 0 || other.length > 0) message += " or ";
15546 }
15547 if (instances.length > 0) {
15548 message += `an instance of ${formatList(instances, "or")}`;
15549 if (other.length > 0) message += " or ";
15550 }
15551 if (other.length > 0) {
15552 if (other.length > 1) {
15553 message += `one of ${formatList(other, "or")}`;
15554 } else {
15555 if (other[0].toLowerCase() !== other[0]) message += "an ";
15556 message += `${other[0]}`;
15557 }
15558 }
15559 message += `. Received ${determineSpecificType(actual)}`;
15560 return message;
15561 },
15562 TypeError
15563);
15564codes.ERR_INVALID_MODULE_SPECIFIER = createError(
15565 "ERR_INVALID_MODULE_SPECIFIER",
15566 /**
15567 * @param {string} request
15568 * @param {string} reason
15569 * @param {string} [base]
15570 */
15571 (request, reason, base = void 0) => {
15572 return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
15573 },
15574 TypeError
15575);
15576codes.ERR_INVALID_PACKAGE_CONFIG = createError(
15577 "ERR_INVALID_PACKAGE_CONFIG",
15578 /**
15579 * @param {string} path
15580 * @param {string} [base]
15581 * @param {string} [message]
15582 */
15583 (path13, base, message) => {
15584 return `Invalid package config ${path13}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
15585 },
15586 Error
15587);
15588codes.ERR_INVALID_PACKAGE_TARGET = createError(
15589 "ERR_INVALID_PACKAGE_TARGET",
15590 /**
15591 * @param {string} packagePath
15592 * @param {string} key
15593 * @param {unknown} target
15594 * @param {boolean} [isImport=false]
15595 * @param {string} [base]
15596 */
15597 (packagePath, key2, target, isImport = false, base = void 0) => {
15598 const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
15599 if (key2 === ".") {
15600 assert2(isImport === false);
15601 return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
15602 }
15603 return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
15604 target
15605 )} defined for '${key2}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
15606 },
15607 Error
15608);
15609codes.ERR_MODULE_NOT_FOUND = createError(
15610 "ERR_MODULE_NOT_FOUND",
15611 /**
15612 * @param {string} path
15613 * @param {string} base
15614 * @param {boolean} [exactUrl]
15615 */
15616 (path13, base, exactUrl = false) => {
15617 return `Cannot find ${exactUrl ? "module" : "package"} '${path13}' imported from ${base}`;
15618 },
15619 Error
15620);
15621codes.ERR_NETWORK_IMPORT_DISALLOWED = createError(
15622 "ERR_NETWORK_IMPORT_DISALLOWED",
15623 "import of '%s' by %s is not supported: %s",
15624 Error
15625);
15626codes.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError(
15627 "ERR_PACKAGE_IMPORT_NOT_DEFINED",
15628 /**
15629 * @param {string} specifier
15630 * @param {string} packagePath
15631 * @param {string} base
15632 */
15633 (specifier, packagePath, base) => {
15634 return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ""} imported from ${base}`;
15635 },
15636 TypeError
15637);
15638codes.ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
15639 "ERR_PACKAGE_PATH_NOT_EXPORTED",
15640 /**
15641 * @param {string} packagePath
15642 * @param {string} subpath
15643 * @param {string} [base]
15644 */
15645 (packagePath, subpath, base = void 0) => {
15646 if (subpath === ".")
15647 return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
15648 return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
15649 },
15650 Error
15651);
15652codes.ERR_UNSUPPORTED_DIR_IMPORT = createError(
15653 "ERR_UNSUPPORTED_DIR_IMPORT",
15654 "Directory import '%s' is not supported resolving ES modules imported from %s",
15655 Error
15656);
15657codes.ERR_UNSUPPORTED_RESOLVE_REQUEST = createError(
15658 "ERR_UNSUPPORTED_RESOLVE_REQUEST",
15659 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',
15660 TypeError
15661);
15662codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
15663 "ERR_UNKNOWN_FILE_EXTENSION",
15664 /**
15665 * @param {string} extension
15666 * @param {string} path
15667 */
15668 (extension, path13) => {
15669 return `Unknown file extension "${extension}" for ${path13}`;
15670 },
15671 TypeError
15672);
15673codes.ERR_INVALID_ARG_VALUE = createError(
15674 "ERR_INVALID_ARG_VALUE",
15675 /**
15676 * @param {string} name
15677 * @param {unknown} value
15678 * @param {string} [reason='is invalid']
15679 */
15680 (name, value, reason = "is invalid") => {
15681 let inspected = inspect(value);
15682 if (inspected.length > 128) {
15683 inspected = `${inspected.slice(0, 128)}...`;
15684 }
15685 const type2 = name.includes(".") ? "property" : "argument";
15686 return `The ${type2} '${name}' ${reason}. Received ${inspected}`;
15687 },
15688 TypeError
15689 // Note: extra classes have been shaken out.
15690 // , RangeError
15691);
15692function createError(sym, value, constructor) {
15693 messages.set(sym, value);
15694 return makeNodeErrorWithCode(constructor, sym);
15695}
15696function makeNodeErrorWithCode(Base, key2) {
15697 return NodeError;
15698 function NodeError(...parameters) {
15699 const limit = Error.stackTraceLimit;
15700 if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;
15701 const error = new Base();
15702 if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;
15703 const message = getMessage(key2, parameters, error);
15704 Object.defineProperties(error, {
15705 // Note: no need to implement `kIsNodeError` symbol, would be hard,
15706 // probably.
15707 message: {
15708 value: message,
15709 enumerable: false,
15710 writable: true,
15711 configurable: true
15712 },
15713 toString: {
15714 /** @this {Error} */
15715 value() {
15716 return `${this.name} [${key2}]: ${this.message}`;
15717 },
15718 enumerable: false,
15719 writable: true,
15720 configurable: true
15721 }
15722 });
15723 captureLargerStackTrace(error);
15724 error.code = key2;
15725 return error;
15726 }
15727}
15728function isErrorStackTraceLimitWritable() {
15729 try {
15730 if (v8.startupSnapshot.isBuildingSnapshot()) {
15731 return false;
15732 }
15733 } catch {
15734 }
15735 const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
15736 if (desc === void 0) {
15737 return Object.isExtensible(Error);
15738 }
15739 return own.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
15740}
15741function hideStackFrames(wrappedFunction) {
15742 const hidden = nodeInternalPrefix + wrappedFunction.name;
15743 Object.defineProperty(wrappedFunction, "name", { value: hidden });
15744 return wrappedFunction;
15745}
15746var captureLargerStackTrace = hideStackFrames(
15747 /**
15748 * @param {Error} error
15749 * @returns {Error}
15750 */
15751 // @ts-expect-error: fine
15752 function(error) {
15753 const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
15754 if (stackTraceLimitIsWritable) {
15755 userStackTraceLimit = Error.stackTraceLimit;
15756 Error.stackTraceLimit = Number.POSITIVE_INFINITY;
15757 }
15758 Error.captureStackTrace(error);
15759 if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit;
15760 return error;
15761 }
15762);
15763function getMessage(key2, parameters, self) {
15764 const message = messages.get(key2);
15765 assert2(message !== void 0, "expected `message` to be found");
15766 if (typeof message === "function") {
15767 assert2(
15768 message.length <= parameters.length,
15769 // Default options do not count.
15770 `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`
15771 );
15772 return Reflect.apply(message, self, parameters);
15773 }
15774 const regex = /%[dfijoOs]/g;
15775 let expectedLength = 0;
15776 while (regex.exec(message) !== null) expectedLength++;
15777 assert2(
15778 expectedLength === parameters.length,
15779 `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`
15780 );
15781 if (parameters.length === 0) return message;
15782 parameters.unshift(message);
15783 return Reflect.apply(format, null, parameters);
15784}
15785function determineSpecificType(value) {
15786 if (value === null || value === void 0) {
15787 return String(value);
15788 }
15789 if (typeof value === "function" && value.name) {
15790 return `function ${value.name}`;
15791 }
15792 if (typeof value === "object") {
15793 if (value.constructor && value.constructor.name) {
15794 return `an instance of ${value.constructor.name}`;
15795 }
15796 return `${inspect(value, { depth: -1 })}`;
15797 }
15798 let inspected = inspect(value, { colors: false });
15799 if (inspected.length > 28) {
15800 inspected = `${inspected.slice(0, 25)}...`;
15801 }
15802 return `type ${typeof value} (${inspected})`;
15803}
15804
15805// node_modules/import-meta-resolve/lib/package-json-reader.js
15806var hasOwnProperty = {}.hasOwnProperty;
15807var { ERR_INVALID_PACKAGE_CONFIG } = codes;
15808var cache = /* @__PURE__ */ new Map();
15809function read2(jsonPath, { base, specifier }) {
15810 const existing = cache.get(jsonPath);
15811 if (existing) {
15812 return existing;
15813 }
15814 let string;
15815 try {
15816 string = fs5.readFileSync(path5.toNamespacedPath(jsonPath), "utf8");
15817 } catch (error) {
15818 const exception2 = (
15819 /** @type {ErrnoException} */
15820 error
15821 );
15822 if (exception2.code !== "ENOENT") {
15823 throw exception2;
15824 }
15825 }
15826 const result = {
15827 exists: false,
15828 pjsonPath: jsonPath,
15829 main: void 0,
15830 name: void 0,
15831 type: "none",
15832 // Ignore unknown types for forwards compatibility
15833 exports: void 0,
15834 imports: void 0
15835 };
15836 if (string !== void 0) {
15837 let parsed;
15838 try {
15839 parsed = JSON.parse(string);
15840 } catch (error_) {
15841 const cause = (
15842 /** @type {ErrnoException} */
15843 error_
15844 );
15845 const error = new ERR_INVALID_PACKAGE_CONFIG(
15846 jsonPath,
15847 (base ? `"${specifier}" from ` : "") + fileURLToPath2(base || specifier),
15848 cause.message
15849 );
15850 error.cause = cause;
15851 throw error;
15852 }
15853 result.exists = true;
15854 if (hasOwnProperty.call(parsed, "name") && typeof parsed.name === "string") {
15855 result.name = parsed.name;
15856 }
15857 if (hasOwnProperty.call(parsed, "main") && typeof parsed.main === "string") {
15858 result.main = parsed.main;
15859 }
15860 if (hasOwnProperty.call(parsed, "exports")) {
15861 result.exports = parsed.exports;
15862 }
15863 if (hasOwnProperty.call(parsed, "imports")) {
15864 result.imports = parsed.imports;
15865 }
15866 if (hasOwnProperty.call(parsed, "type") && (parsed.type === "commonjs" || parsed.type === "module")) {
15867 result.type = parsed.type;
15868 }
15869 }
15870 cache.set(jsonPath, result);
15871 return result;
15872}
15873function getPackageScopeConfig(resolved) {
15874 let packageJSONUrl = new URL("package.json", resolved);
15875 while (true) {
15876 const packageJSONPath2 = packageJSONUrl.pathname;
15877 if (packageJSONPath2.endsWith("node_modules/package.json")) {
15878 break;
15879 }
15880 const packageConfig = read2(fileURLToPath2(packageJSONUrl), {
15881 specifier: resolved
15882 });
15883 if (packageConfig.exists) {
15884 return packageConfig;
15885 }
15886 const lastPackageJSONUrl = packageJSONUrl;
15887 packageJSONUrl = new URL("../package.json", packageJSONUrl);
15888 if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) {
15889 break;
15890 }
15891 }
15892 const packageJSONPath = fileURLToPath2(packageJSONUrl);
15893 return {
15894 pjsonPath: packageJSONPath,
15895 exists: false,
15896 type: "none"
15897 };
15898}
15899function getPackageType(url2) {
15900 return getPackageScopeConfig(url2).type;
15901}
15902
15903// node_modules/import-meta-resolve/lib/get-format.js
15904var { ERR_UNKNOWN_FILE_EXTENSION } = codes;
15905var hasOwnProperty2 = {}.hasOwnProperty;
15906var extensionFormatMap = {
15907 // @ts-expect-error: hush.
15908 __proto__: null,
15909 ".cjs": "commonjs",
15910 ".js": "module",
15911 ".json": "json",
15912 ".mjs": "module"
15913};
15914function mimeToFormat(mime) {
15915 if (mime && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime))
15916 return "module";
15917 if (mime === "application/json") return "json";
15918 return null;
15919}
15920var protocolHandlers = {
15921 // @ts-expect-error: hush.
15922 __proto__: null,
15923 "data:": getDataProtocolModuleFormat,
15924 "file:": getFileProtocolModuleFormat,
15925 "http:": getHttpProtocolModuleFormat,
15926 "https:": getHttpProtocolModuleFormat,
15927 "node:"() {
15928 return "builtin";
15929 }
15930};
15931function getDataProtocolModuleFormat(parsed) {
15932 const { 1: mime } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(
15933 parsed.pathname
15934 ) || [null, null, null];
15935 return mimeToFormat(mime);
15936}
15937function extname(url2) {
15938 const pathname = url2.pathname;
15939 let index = pathname.length;
15940 while (index--) {
15941 const code = pathname.codePointAt(index);
15942 if (code === 47) {
15943 return "";
15944 }
15945 if (code === 46) {
15946 return pathname.codePointAt(index - 1) === 47 ? "" : pathname.slice(index);
15947 }
15948 }
15949 return "";
15950}
15951function getFileProtocolModuleFormat(url2, _context, ignoreErrors) {
15952 const value = extname(url2);
15953 if (value === ".js") {
15954 const packageType = getPackageType(url2);
15955 if (packageType !== "none") {
15956 return packageType;
15957 }
15958 return "commonjs";
15959 }
15960 if (value === "") {
15961 const packageType = getPackageType(url2);
15962 if (packageType === "none" || packageType === "commonjs") {
15963 return "commonjs";
15964 }
15965 return "module";
15966 }
15967 const format3 = extensionFormatMap[value];
15968 if (format3) return format3;
15969 if (ignoreErrors) {
15970 return void 0;
15971 }
15972 const filepath = fileURLToPath3(url2);
15973 throw new ERR_UNKNOWN_FILE_EXTENSION(value, filepath);
15974}
15975function getHttpProtocolModuleFormat() {
15976}
15977function defaultGetFormatWithoutErrors(url2, context) {
15978 const protocol = url2.protocol;
15979 if (!hasOwnProperty2.call(protocolHandlers, protocol)) {
15980 return null;
15981 }
15982 return protocolHandlers[protocol](url2, context, true) || null;
15983}
15984
15985// node_modules/import-meta-resolve/lib/utils.js
15986var { ERR_INVALID_ARG_VALUE } = codes;
15987var DEFAULT_CONDITIONS = Object.freeze(["node", "import"]);
15988var DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS);
15989function getDefaultConditions() {
15990 return DEFAULT_CONDITIONS;
15991}
15992function getDefaultConditionsSet() {
15993 return DEFAULT_CONDITIONS_SET;
15994}
15995function getConditionsSet(conditions) {
15996 if (conditions !== void 0 && conditions !== getDefaultConditions()) {
15997 if (!Array.isArray(conditions)) {
15998 throw new ERR_INVALID_ARG_VALUE(
15999 "conditions",
16000 conditions,
16001 "expected an array"
16002 );
16003 }
16004 return new Set(conditions);
16005 }
16006 return getDefaultConditionsSet();
16007}
16008
16009// node_modules/import-meta-resolve/lib/resolve.js
16010var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
16011var {
16012 ERR_NETWORK_IMPORT_DISALLOWED,
16013 ERR_INVALID_MODULE_SPECIFIER,
16014 ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG2,
16015 ERR_INVALID_PACKAGE_TARGET,
16016 ERR_MODULE_NOT_FOUND,
16017 ERR_PACKAGE_IMPORT_NOT_DEFINED,
16018 ERR_PACKAGE_PATH_NOT_EXPORTED,
16019 ERR_UNSUPPORTED_DIR_IMPORT,
16020 ERR_UNSUPPORTED_RESOLVE_REQUEST
16021} = codes;
16022var own2 = {}.hasOwnProperty;
16023var invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i;
16024var deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i;
16025var invalidPackageNameRegEx = /^\.|%|\\/;
16026var patternRegEx = /\*/g;
16027var encodedSeparatorRegEx = /%2f|%5c/i;
16028var emittedPackageWarnings = /* @__PURE__ */ new Set();
16029var doubleSlashRegEx = /[/\\]{2}/;
16030function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) {
16031 if (process3.noDeprecation) {
16032 return;
16033 }
16034 const pjsonPath = fileURLToPath4(packageJsonUrl);
16035 const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null;
16036 process3.emitWarning(
16037 `Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match ? "" : `matched to "${match}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath4(base)}` : ""}.`,
16038 "DeprecationWarning",
16039 "DEP0166"
16040 );
16041}
16042function emitLegacyIndexDeprecation(url2, packageJsonUrl, base, main) {
16043 if (process3.noDeprecation) {
16044 return;
16045 }
16046 const format3 = defaultGetFormatWithoutErrors(url2, { parentURL: base.href });
16047 if (format3 !== "module") return;
16048 const urlPath = fileURLToPath4(url2.href);
16049 const packagePath = fileURLToPath4(new URL2(".", packageJsonUrl));
16050 const basePath = fileURLToPath4(base);
16051 if (!main) {
16052 process3.emitWarning(
16053 `No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(
16054 packagePath.length
16055 )}", imported from ${basePath}.
16056Default "index" lookups for the main are deprecated for ES modules.`,
16057 "DeprecationWarning",
16058 "DEP0151"
16059 );
16060 } else if (path6.resolve(packagePath, main) !== urlPath) {
16061 process3.emitWarning(
16062 `Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(
16063 packagePath.length
16064 )}", imported from ${basePath}.
16065 Automatic extension resolution of the "main" field is deprecated for ES modules.`,
16066 "DeprecationWarning",
16067 "DEP0151"
16068 );
16069 }
16070}
16071function tryStatSync(path13) {
16072 try {
16073 return statSync(path13);
16074 } catch {
16075 }
16076}
16077function fileExists(url2) {
16078 const stats = statSync(url2, { throwIfNoEntry: false });
16079 const isFile2 = stats ? stats.isFile() : void 0;
16080 return isFile2 === null || isFile2 === void 0 ? false : isFile2;
16081}
16082function legacyMainResolve(packageJsonUrl, packageConfig, base) {
16083 let guess;
16084 if (packageConfig.main !== void 0) {
16085 guess = new URL2(packageConfig.main, packageJsonUrl);
16086 if (fileExists(guess)) return guess;
16087 const tries2 = [
16088 `./${packageConfig.main}.js`,
16089 `./${packageConfig.main}.json`,
16090 `./${packageConfig.main}.node`,
16091 `./${packageConfig.main}/index.js`,
16092 `./${packageConfig.main}/index.json`,
16093 `./${packageConfig.main}/index.node`
16094 ];
16095 let i2 = -1;
16096 while (++i2 < tries2.length) {
16097 guess = new URL2(tries2[i2], packageJsonUrl);
16098 if (fileExists(guess)) break;
16099 guess = void 0;
16100 }
16101 if (guess) {
16102 emitLegacyIndexDeprecation(
16103 guess,
16104 packageJsonUrl,
16105 base,
16106 packageConfig.main
16107 );
16108 return guess;
16109 }
16110 }
16111 const tries = ["./index.js", "./index.json", "./index.node"];
16112 let i = -1;
16113 while (++i < tries.length) {
16114 guess = new URL2(tries[i], packageJsonUrl);
16115 if (fileExists(guess)) break;
16116 guess = void 0;
16117 }
16118 if (guess) {
16119 emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main);
16120 return guess;
16121 }
16122 throw new ERR_MODULE_NOT_FOUND(
16123 fileURLToPath4(new URL2(".", packageJsonUrl)),
16124 fileURLToPath4(base)
16125 );
16126}
16127function finalizeResolution(resolved, base, preserveSymlinks) {
16128 if (encodedSeparatorRegEx.exec(resolved.pathname) !== null) {
16129 throw new ERR_INVALID_MODULE_SPECIFIER(
16130 resolved.pathname,
16131 'must not include encoded "/" or "\\" characters',
16132 fileURLToPath4(base)
16133 );
16134 }
16135 let filePath;
16136 try {
16137 filePath = fileURLToPath4(resolved);
16138 } catch (error) {
16139 const cause = (
16140 /** @type {ErrnoException} */
16141 error
16142 );
16143 Object.defineProperty(cause, "input", { value: String(resolved) });
16144 Object.defineProperty(cause, "module", { value: String(base) });
16145 throw cause;
16146 }
16147 const stats = tryStatSync(
16148 filePath.endsWith("/") ? filePath.slice(-1) : filePath
16149 );
16150 if (stats && stats.isDirectory()) {
16151 const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, fileURLToPath4(base));
16152 error.url = String(resolved);
16153 throw error;
16154 }
16155 if (!stats || !stats.isFile()) {
16156 const error = new ERR_MODULE_NOT_FOUND(
16157 filePath || resolved.pathname,
16158 base && fileURLToPath4(base),
16159 true
16160 );
16161 error.url = String(resolved);
16162 throw error;
16163 }
16164 if (!preserveSymlinks) {
16165 const real = realpathSync(filePath);
16166 const { search, hash } = resolved;
16167 resolved = pathToFileURL3(real + (filePath.endsWith(path6.sep) ? "/" : ""));
16168 resolved.search = search;
16169 resolved.hash = hash;
16170 }
16171 return resolved;
16172}
16173function importNotDefined(specifier, packageJsonUrl, base) {
16174 return new ERR_PACKAGE_IMPORT_NOT_DEFINED(
16175 specifier,
16176 packageJsonUrl && fileURLToPath4(new URL2(".", packageJsonUrl)),
16177 fileURLToPath4(base)
16178 );
16179}
16180function exportsNotFound(subpath, packageJsonUrl, base) {
16181 return new ERR_PACKAGE_PATH_NOT_EXPORTED(
16182 fileURLToPath4(new URL2(".", packageJsonUrl)),
16183 subpath,
16184 base && fileURLToPath4(base)
16185 );
16186}
16187function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) {
16188 const reason = `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${fileURLToPath4(packageJsonUrl)}`;
16189 throw new ERR_INVALID_MODULE_SPECIFIER(
16190 request,
16191 reason,
16192 base && fileURLToPath4(base)
16193 );
16194}
16195function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) {
16196 target = typeof target === "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`;
16197 return new ERR_INVALID_PACKAGE_TARGET(
16198 fileURLToPath4(new URL2(".", packageJsonUrl)),
16199 subpath,
16200 target,
16201 internal,
16202 base && fileURLToPath4(base)
16203 );
16204}
16205function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base, pattern, internal, isPathMap, conditions) {
16206 if (subpath !== "" && !pattern && target[target.length - 1] !== "/")
16207 throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
16208 if (!target.startsWith("./")) {
16209 if (internal && !target.startsWith("../") && !target.startsWith("/")) {
16210 let isURL2 = false;
16211 try {
16212 new URL2(target);
16213 isURL2 = true;
16214 } catch {
16215 }
16216 if (!isURL2) {
16217 const exportTarget = pattern ? RegExpPrototypeSymbolReplace.call(
16218 patternRegEx,
16219 target,
16220 () => subpath
16221 ) : target + subpath;
16222 return packageResolve(exportTarget, packageJsonUrl, conditions);
16223 }
16224 }
16225 throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
16226 }
16227 if (invalidSegmentRegEx.exec(target.slice(2)) !== null) {
16228 if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) {
16229 if (!isPathMap) {
16230 const request = pattern ? match.replace("*", () => subpath) : match + subpath;
16231 const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call(
16232 patternRegEx,
16233 target,
16234 () => subpath
16235 ) : target;
16236 emitInvalidSegmentDeprecation(
16237 resolvedTarget,
16238 request,
16239 match,
16240 packageJsonUrl,
16241 internal,
16242 base,
16243 true
16244 );
16245 }
16246 } else {
16247 throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
16248 }
16249 }
16250 const resolved = new URL2(target, packageJsonUrl);
16251 const resolvedPath = resolved.pathname;
16252 const packagePath = new URL2(".", packageJsonUrl).pathname;
16253 if (!resolvedPath.startsWith(packagePath))
16254 throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
16255 if (subpath === "") return resolved;
16256 if (invalidSegmentRegEx.exec(subpath) !== null) {
16257 const request = pattern ? match.replace("*", () => subpath) : match + subpath;
16258 if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) {
16259 if (!isPathMap) {
16260 const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call(
16261 patternRegEx,
16262 target,
16263 () => subpath
16264 ) : target;
16265 emitInvalidSegmentDeprecation(
16266 resolvedTarget,
16267 request,
16268 match,
16269 packageJsonUrl,
16270 internal,
16271 base,
16272 false
16273 );
16274 }
16275 } else {
16276 throwInvalidSubpath(request, match, packageJsonUrl, internal, base);
16277 }
16278 }
16279 if (pattern) {
16280 return new URL2(
16281 RegExpPrototypeSymbolReplace.call(
16282 patternRegEx,
16283 resolved.href,
16284 () => subpath
16285 )
16286 );
16287 }
16288 return new URL2(subpath, resolved);
16289}
16290function isArrayIndex(key2) {
16291 const keyNumber = Number(key2);
16292 if (`${keyNumber}` !== key2) return false;
16293 return keyNumber >= 0 && keyNumber < 4294967295;
16294}
16295function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions) {
16296 if (typeof target === "string") {
16297 return resolvePackageTargetString(
16298 target,
16299 subpath,
16300 packageSubpath,
16301 packageJsonUrl,
16302 base,
16303 pattern,
16304 internal,
16305 isPathMap,
16306 conditions
16307 );
16308 }
16309 if (Array.isArray(target)) {
16310 const targetList = target;
16311 if (targetList.length === 0) return null;
16312 let lastException;
16313 let i = -1;
16314 while (++i < targetList.length) {
16315 const targetItem = targetList[i];
16316 let resolveResult;
16317 try {
16318 resolveResult = resolvePackageTarget(
16319 packageJsonUrl,
16320 targetItem,
16321 subpath,
16322 packageSubpath,
16323 base,
16324 pattern,
16325 internal,
16326 isPathMap,
16327 conditions
16328 );
16329 } catch (error) {
16330 const exception2 = (
16331 /** @type {ErrnoException} */
16332 error
16333 );
16334 lastException = exception2;
16335 if (exception2.code === "ERR_INVALID_PACKAGE_TARGET") continue;
16336 throw error;
16337 }
16338 if (resolveResult === void 0) continue;
16339 if (resolveResult === null) {
16340 lastException = null;
16341 continue;
16342 }
16343 return resolveResult;
16344 }
16345 if (lastException === void 0 || lastException === null) {
16346 return null;
16347 }
16348 throw lastException;
16349 }
16350 if (typeof target === "object" && target !== null) {
16351 const keys = Object.getOwnPropertyNames(target);
16352 let i = -1;
16353 while (++i < keys.length) {
16354 const key2 = keys[i];
16355 if (isArrayIndex(key2)) {
16356 throw new ERR_INVALID_PACKAGE_CONFIG2(
16357 fileURLToPath4(packageJsonUrl),
16358 base,
16359 '"exports" cannot contain numeric property keys.'
16360 );
16361 }
16362 }
16363 i = -1;
16364 while (++i < keys.length) {
16365 const key2 = keys[i];
16366 if (key2 === "default" || conditions && conditions.has(key2)) {
16367 const conditionalTarget = (
16368 /** @type {unknown} */
16369 target[key2]
16370 );
16371 const resolveResult = resolvePackageTarget(
16372 packageJsonUrl,
16373 conditionalTarget,
16374 subpath,
16375 packageSubpath,
16376 base,
16377 pattern,
16378 internal,
16379 isPathMap,
16380 conditions
16381 );
16382 if (resolveResult === void 0) continue;
16383 return resolveResult;
16384 }
16385 }
16386 return null;
16387 }
16388 if (target === null) {
16389 return null;
16390 }
16391 throw invalidPackageTarget(
16392 packageSubpath,
16393 target,
16394 packageJsonUrl,
16395 internal,
16396 base
16397 );
16398}
16399function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
16400 if (typeof exports === "string" || Array.isArray(exports)) return true;
16401 if (typeof exports !== "object" || exports === null) return false;
16402 const keys = Object.getOwnPropertyNames(exports);
16403 let isConditionalSugar = false;
16404 let i = 0;
16405 let keyIndex = -1;
16406 while (++keyIndex < keys.length) {
16407 const key2 = keys[keyIndex];
16408 const currentIsConditionalSugar = key2 === "" || key2[0] !== ".";
16409 if (i++ === 0) {
16410 isConditionalSugar = currentIsConditionalSugar;
16411 } else if (isConditionalSugar !== currentIsConditionalSugar) {
16412 throw new ERR_INVALID_PACKAGE_CONFIG2(
16413 fileURLToPath4(packageJsonUrl),
16414 base,
16415 `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`
16416 );
16417 }
16418 }
16419 return isConditionalSugar;
16420}
16421function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
16422 if (process3.noDeprecation) {
16423 return;
16424 }
16425 const pjsonPath = fileURLToPath4(pjsonUrl);
16426 if (emittedPackageWarnings.has(pjsonPath + "|" + match)) return;
16427 emittedPackageWarnings.add(pjsonPath + "|" + match);
16428 process3.emitWarning(
16429 `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath4(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`,
16430 "DeprecationWarning",
16431 "DEP0155"
16432 );
16433}
16434function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) {
16435 let exports = packageConfig.exports;
16436 if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) {
16437 exports = { ".": exports };
16438 }
16439 if (own2.call(exports, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) {
16440 const target = exports[packageSubpath];
16441 const resolveResult = resolvePackageTarget(
16442 packageJsonUrl,
16443 target,
16444 "",
16445 packageSubpath,
16446 base,
16447 false,
16448 false,
16449 false,
16450 conditions
16451 );
16452 if (resolveResult === null || resolveResult === void 0) {
16453 throw exportsNotFound(packageSubpath, packageJsonUrl, base);
16454 }
16455 return resolveResult;
16456 }
16457 let bestMatch = "";
16458 let bestMatchSubpath = "";
16459 const keys = Object.getOwnPropertyNames(exports);
16460 let i = -1;
16461 while (++i < keys.length) {
16462 const key2 = keys[i];
16463 const patternIndex = key2.indexOf("*");
16464 if (patternIndex !== -1 && packageSubpath.startsWith(key2.slice(0, patternIndex))) {
16465 if (packageSubpath.endsWith("/")) {
16466 emitTrailingSlashPatternDeprecation(
16467 packageSubpath,
16468 packageJsonUrl,
16469 base
16470 );
16471 }
16472 const patternTrailer = key2.slice(patternIndex + 1);
16473 if (packageSubpath.length >= key2.length && packageSubpath.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key2) === 1 && key2.lastIndexOf("*") === patternIndex) {
16474 bestMatch = key2;
16475 bestMatchSubpath = packageSubpath.slice(
16476 patternIndex,
16477 packageSubpath.length - patternTrailer.length
16478 );
16479 }
16480 }
16481 }
16482 if (bestMatch) {
16483 const target = (
16484 /** @type {unknown} */
16485 exports[bestMatch]
16486 );
16487 const resolveResult = resolvePackageTarget(
16488 packageJsonUrl,
16489 target,
16490 bestMatchSubpath,
16491 bestMatch,
16492 base,
16493 true,
16494 false,
16495 packageSubpath.endsWith("/"),
16496 conditions
16497 );
16498 if (resolveResult === null || resolveResult === void 0) {
16499 throw exportsNotFound(packageSubpath, packageJsonUrl, base);
16500 }
16501 return resolveResult;
16502 }
16503 throw exportsNotFound(packageSubpath, packageJsonUrl, base);
16504}
16505function patternKeyCompare(a, b) {
16506 const aPatternIndex = a.indexOf("*");
16507 const bPatternIndex = b.indexOf("*");
16508 const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
16509 const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
16510 if (baseLengthA > baseLengthB) return -1;
16511 if (baseLengthB > baseLengthA) return 1;
16512 if (aPatternIndex === -1) return 1;
16513 if (bPatternIndex === -1) return -1;
16514 if (a.length > b.length) return -1;
16515 if (b.length > a.length) return 1;
16516 return 0;
16517}
16518function packageImportsResolve(name, base, conditions) {
16519 if (name === "#" || name.startsWith("#/") || name.endsWith("/")) {
16520 const reason = "is not a valid internal imports specifier name";
16521 throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath4(base));
16522 }
16523 let packageJsonUrl;
16524 const packageConfig = getPackageScopeConfig(base);
16525 if (packageConfig.exists) {
16526 packageJsonUrl = pathToFileURL3(packageConfig.pjsonPath);
16527 const imports = packageConfig.imports;
16528 if (imports) {
16529 if (own2.call(imports, name) && !name.includes("*")) {
16530 const resolveResult = resolvePackageTarget(
16531 packageJsonUrl,
16532 imports[name],
16533 "",
16534 name,
16535 base,
16536 false,
16537 true,
16538 false,
16539 conditions
16540 );
16541 if (resolveResult !== null && resolveResult !== void 0) {
16542 return resolveResult;
16543 }
16544 } else {
16545 let bestMatch = "";
16546 let bestMatchSubpath = "";
16547 const keys = Object.getOwnPropertyNames(imports);
16548 let i = -1;
16549 while (++i < keys.length) {
16550 const key2 = keys[i];
16551 const patternIndex = key2.indexOf("*");
16552 if (patternIndex !== -1 && name.startsWith(key2.slice(0, -1))) {
16553 const patternTrailer = key2.slice(patternIndex + 1);
16554 if (name.length >= key2.length && name.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key2) === 1 && key2.lastIndexOf("*") === patternIndex) {
16555 bestMatch = key2;
16556 bestMatchSubpath = name.slice(
16557 patternIndex,
16558 name.length - patternTrailer.length
16559 );
16560 }
16561 }
16562 }
16563 if (bestMatch) {
16564 const target = imports[bestMatch];
16565 const resolveResult = resolvePackageTarget(
16566 packageJsonUrl,
16567 target,
16568 bestMatchSubpath,
16569 bestMatch,
16570 base,
16571 true,
16572 true,
16573 false,
16574 conditions
16575 );
16576 if (resolveResult !== null && resolveResult !== void 0) {
16577 return resolveResult;
16578 }
16579 }
16580 }
16581 }
16582 }
16583 throw importNotDefined(name, packageJsonUrl, base);
16584}
16585function parsePackageName(specifier, base) {
16586 let separatorIndex = specifier.indexOf("/");
16587 let validPackageName = true;
16588 let isScoped = false;
16589 if (specifier[0] === "@") {
16590 isScoped = true;
16591 if (separatorIndex === -1 || specifier.length === 0) {
16592 validPackageName = false;
16593 } else {
16594 separatorIndex = specifier.indexOf("/", separatorIndex + 1);
16595 }
16596 }
16597 const packageName = separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex);
16598 if (invalidPackageNameRegEx.exec(packageName) !== null) {
16599 validPackageName = false;
16600 }
16601 if (!validPackageName) {
16602 throw new ERR_INVALID_MODULE_SPECIFIER(
16603 specifier,
16604 "is not a valid package name",
16605 fileURLToPath4(base)
16606 );
16607 }
16608 const packageSubpath = "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex));
16609 return { packageName, packageSubpath, isScoped };
16610}
16611function packageResolve(specifier, base, conditions) {
16612 if (builtinModules.includes(specifier)) {
16613 return new URL2("node:" + specifier);
16614 }
16615 const { packageName, packageSubpath, isScoped } = parsePackageName(
16616 specifier,
16617 base
16618 );
16619 const packageConfig = getPackageScopeConfig(base);
16620 if (packageConfig.exists) {
16621 const packageJsonUrl2 = pathToFileURL3(packageConfig.pjsonPath);
16622 if (packageConfig.name === packageName && packageConfig.exports !== void 0 && packageConfig.exports !== null) {
16623 return packageExportsResolve(
16624 packageJsonUrl2,
16625 packageSubpath,
16626 packageConfig,
16627 base,
16628 conditions
16629 );
16630 }
16631 }
16632 let packageJsonUrl = new URL2(
16633 "./node_modules/" + packageName + "/package.json",
16634 base
16635 );
16636 let packageJsonPath = fileURLToPath4(packageJsonUrl);
16637 let lastPath;
16638 do {
16639 const stat = tryStatSync(packageJsonPath.slice(0, -13));
16640 if (!stat || !stat.isDirectory()) {
16641 lastPath = packageJsonPath;
16642 packageJsonUrl = new URL2(
16643 (isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json",
16644 packageJsonUrl
16645 );
16646 packageJsonPath = fileURLToPath4(packageJsonUrl);
16647 continue;
16648 }
16649 const packageConfig2 = read2(packageJsonPath, { base, specifier });
16650 if (packageConfig2.exports !== void 0 && packageConfig2.exports !== null) {
16651 return packageExportsResolve(
16652 packageJsonUrl,
16653 packageSubpath,
16654 packageConfig2,
16655 base,
16656 conditions
16657 );
16658 }
16659 if (packageSubpath === ".") {
16660 return legacyMainResolve(packageJsonUrl, packageConfig2, base);
16661 }
16662 return new URL2(packageSubpath, packageJsonUrl);
16663 } while (packageJsonPath.length !== lastPath.length);
16664 throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath4(base), false);
16665}
16666function isRelativeSpecifier(specifier) {
16667 if (specifier[0] === ".") {
16668 if (specifier.length === 1 || specifier[1] === "/") return true;
16669 if (specifier[1] === "." && (specifier.length === 2 || specifier[2] === "/")) {
16670 return true;
16671 }
16672 }
16673 return false;
16674}
16675function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {
16676 if (specifier === "") return false;
16677 if (specifier[0] === "/") return true;
16678 return isRelativeSpecifier(specifier);
16679}
16680function moduleResolve(specifier, base, conditions, preserveSymlinks) {
16681 const protocol = base.protocol;
16682 const isData = protocol === "data:";
16683 const isRemote = isData || protocol === "http:" || protocol === "https:";
16684 let resolved;
16685 if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
16686 try {
16687 resolved = new URL2(specifier, base);
16688 } catch (error_) {
16689 const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
16690 error.cause = error_;
16691 throw error;
16692 }
16693 } else if (protocol === "file:" && specifier[0] === "#") {
16694 resolved = packageImportsResolve(specifier, base, conditions);
16695 } else {
16696 try {
16697 resolved = new URL2(specifier);
16698 } catch (error_) {
16699 if (isRemote && !builtinModules.includes(specifier)) {
16700 const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
16701 error.cause = error_;
16702 throw error;
16703 }
16704 resolved = packageResolve(specifier, base, conditions);
16705 }
16706 }
16707 assert3(resolved !== void 0, "expected to be defined");
16708 if (resolved.protocol !== "file:") {
16709 return resolved;
16710 }
16711 return finalizeResolution(resolved, base, preserveSymlinks);
16712}
16713function checkIfDisallowedImport(specifier, parsed, parsedParentURL) {
16714 if (parsedParentURL) {
16715 const parentProtocol = parsedParentURL.protocol;
16716 if (parentProtocol === "http:" || parentProtocol === "https:") {
16717 if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
16718 const parsedProtocol = parsed == null ? void 0 : parsed.protocol;
16719 if (parsedProtocol && parsedProtocol !== "https:" && parsedProtocol !== "http:") {
16720 throw new ERR_NETWORK_IMPORT_DISALLOWED(
16721 specifier,
16722 parsedParentURL,
16723 "remote imports cannot import from a local location."
16724 );
16725 }
16726 return { url: (parsed == null ? void 0 : parsed.href) || "" };
16727 }
16728 if (builtinModules.includes(specifier)) {
16729 throw new ERR_NETWORK_IMPORT_DISALLOWED(
16730 specifier,
16731 parsedParentURL,
16732 "remote imports cannot import from a local location."
16733 );
16734 }
16735 throw new ERR_NETWORK_IMPORT_DISALLOWED(
16736 specifier,
16737 parsedParentURL,
16738 "only relative and absolute specifiers are supported."
16739 );
16740 }
16741 }
16742}
16743function isURL(self) {
16744 return Boolean(
16745 self && typeof self === "object" && "href" in self && typeof self.href === "string" && "protocol" in self && typeof self.protocol === "string" && self.href && self.protocol
16746 );
16747}
16748function throwIfInvalidParentURL(parentURL) {
16749 if (parentURL === void 0) {
16750 return;
16751 }
16752 if (typeof parentURL !== "string" && !isURL(parentURL)) {
16753 throw new codes.ERR_INVALID_ARG_TYPE(
16754 "parentURL",
16755 ["string", "URL"],
16756 parentURL
16757 );
16758 }
16759}
16760function defaultResolve(specifier, context = {}) {
16761 const { parentURL } = context;
16762 assert3(parentURL !== void 0, "expected `parentURL` to be defined");
16763 throwIfInvalidParentURL(parentURL);
16764 let parsedParentURL;
16765 if (parentURL) {
16766 try {
16767 parsedParentURL = new URL2(parentURL);
16768 } catch {
16769 }
16770 }
16771 let parsed;
16772 let protocol;
16773 try {
16774 parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) ? new URL2(specifier, parsedParentURL) : new URL2(specifier);
16775 protocol = parsed.protocol;
16776 if (protocol === "data:") {
16777 return { url: parsed.href, format: null };
16778 }
16779 } catch {
16780 }
16781 const maybeReturn = checkIfDisallowedImport(
16782 specifier,
16783 parsed,
16784 parsedParentURL
16785 );
16786 if (maybeReturn) return maybeReturn;
16787 if (protocol === void 0 && parsed) {
16788 protocol = parsed.protocol;
16789 }
16790 if (protocol === "node:") {
16791 return { url: specifier };
16792 }
16793 if (parsed && parsed.protocol === "node:") return { url: specifier };
16794 const conditions = getConditionsSet(context.conditions);
16795 const url2 = moduleResolve(specifier, new URL2(parentURL), conditions, false);
16796 return {
16797 // Do NOT cast `url` to a string: that will work even when there are real
16798 // problems, silencing them
16799 url: url2.href,
16800 format: defaultGetFormatWithoutErrors(url2, { parentURL })
16801 };
16802}
16803
16804// node_modules/import-meta-resolve/index.js
16805function resolve2(specifier, parent) {
16806 if (!parent) {
16807 throw new Error(
16808 "Please pass `parent`: `import-meta-resolve` cannot ponyfill that"
16809 );
16810 }
16811 try {
16812 return defaultResolve(specifier, { parentURL: parent }).url;
16813 } catch (error) {
16814 const exception2 = (
16815 /** @type {ErrnoException} */
16816 error
16817 );
16818 if ((exception2.code === "ERR_UNSUPPORTED_DIR_IMPORT" || exception2.code === "ERR_MODULE_NOT_FOUND") && typeof exception2.url === "string") {
16819 return exception2.url;
16820 }
16821 throw error;
16822 }
16823}
16824
16825// src/utils/import-from-file.js
16826function importFromFile(specifier, parent) {
16827 const url2 = resolve2(specifier, pathToFileURL4(parent).href);
16828 return import(url2);
16829}
16830var import_from_file_default = importFromFile;
16831
16832// src/utils/require-from-file.js
16833import { createRequire } from "module";
16834function requireFromFile(id, parent) {
16835 const require2 = createRequire(parent);
16836 return require2(id);
16837}
16838var require_from_file_default = requireFromFile;
16839
16840// src/config/prettier-config/load-external-config.js
16841var requireErrorCodesShouldBeIgnored = /* @__PURE__ */ new Set([
16842 "MODULE_NOT_FOUND",
16843 "ERR_REQUIRE_ESM",
16844 "ERR_PACKAGE_PATH_NOT_EXPORTED",
16845 "ERR_REQUIRE_ASYNC_MODULE"
16846]);
16847async function loadExternalConfig(externalConfig, configFile) {
16848 try {
16849 const required = require_from_file_default(externalConfig, configFile);
16850 if (process.features.require_module && required.__esModule) {
16851 return required.default;
16852 }
16853 return required;
16854 } catch (error) {
16855 if (!requireErrorCodesShouldBeIgnored.has(error == null ? void 0 : error.code)) {
16856 throw error;
16857 }
16858 }
16859 const module = await import_from_file_default(externalConfig, configFile);
16860 return module.default;
16861}
16862var load_external_config_default = loadExternalConfig;
16863
16864// src/config/prettier-config/load-config.js
16865async function loadConfig(configFile) {
16866 const { base: fileName, ext: extension } = path7.parse(configFile);
16867 const load2 = fileName === "package.json" ? loadConfigFromPackageJson : fileName === "package.yaml" ? loadConfigFromPackageYaml : loaders_default[extension];
16868 if (!load2) {
16869 throw new Error(
16870 `No loader specified for extension "${extension || "noExt"}"`
16871 );
16872 }
16873 let config = await load2(configFile);
16874 if (!config) {
16875 return;
16876 }
16877 if (typeof config === "string") {
16878 config = await load_external_config_default(config, configFile);
16879 }
16880 if (typeof config !== "object") {
16881 throw new TypeError(
16882 `Config is only allowed to be an object, but received ${typeof config} in "${configFile}"`
16883 );
16884 }
16885 delete config.$schema;
16886 return config;
16887}
16888var load_config_default = loadConfig;
16889
16890// src/config/prettier-config/index.js
16891var loadCache = /* @__PURE__ */ new Map();
16892var searchCache = /* @__PURE__ */ new Map();
16893function clearPrettierConfigCache() {
16894 loadCache.clear();
16895 searchCache.clear();
16896}
16897function loadPrettierConfig(configFile, { shouldCache }) {
16898 configFile = path8.resolve(configFile);
16899 if (!shouldCache || !loadCache.has(configFile)) {
16900 loadCache.set(configFile, load_config_default(configFile));
16901 }
16902 return loadCache.get(configFile);
16903}
16904function getSearchFunction(stopDirectory) {
16905 stopDirectory = stopDirectory ? path8.resolve(stopDirectory) : void 0;
16906 if (!searchCache.has(stopDirectory)) {
16907 const searcher2 = config_searcher_default(stopDirectory);
16908 const searchFunction = searcher2.search.bind(searcher2);
16909 searchCache.set(stopDirectory, searchFunction);
16910 }
16911 return searchCache.get(stopDirectory);
16912}
16913function searchPrettierConfig(startDirectory, options8 = {}) {
16914 startDirectory = startDirectory ? path8.resolve(startDirectory) : process.cwd();
16915 const stopDirectory = mockable_default.getPrettierConfigSearchStopDirectory();
16916 const search = getSearchFunction(stopDirectory);
16917 return search(startDirectory, { shouldCache: options8.shouldCache });
16918}
16919
16920// src/config/resolve-config.js
16921function clearCache() {
16922 clearPrettierConfigCache();
16923 clearEditorconfigCache();
16924}
16925function loadEditorconfig2(file, options8) {
16926 if (!file || !options8.editorconfig) {
16927 return;
16928 }
16929 const shouldCache = options8.useCache;
16930 return loadEditorconfig(file, { shouldCache });
16931}
16932async function loadPrettierConfig2(file, options8) {
16933 const shouldCache = options8.useCache;
16934 let configFile = options8.config;
16935 if (!configFile) {
16936 const directory = file ? path9.dirname(path9.resolve(file)) : void 0;
16937 configFile = await searchPrettierConfig(directory, { shouldCache });
16938 }
16939 if (!configFile) {
16940 return;
16941 }
16942 const config = await loadPrettierConfig(configFile, { shouldCache });
16943 return { config, configFile };
16944}
16945async function resolveConfig(fileUrlOrPath, options8) {
16946 options8 = { useCache: true, ...options8 };
16947 const filePath = toPath(fileUrlOrPath);
16948 const [result, editorConfigured] = await Promise.all([
16949 loadPrettierConfig2(filePath, options8),
16950 loadEditorconfig2(filePath, options8)
16951 ]);
16952 if (!result && !editorConfigured) {
16953 return null;
16954 }
16955 const merged = {
16956 ...editorConfigured,
16957 ...mergeOverrides(result, filePath)
16958 };
16959 if (Array.isArray(merged.plugins)) {
16960 merged.plugins = merged.plugins.map(
16961 (value) => typeof value === "string" && value.startsWith(".") ? path9.resolve(path9.dirname(result.configFile), value) : value
16962 );
16963 }
16964 return merged;
16965}
16966async function resolveConfigFile(fileUrlOrPath) {
16967 const directory = fileUrlOrPath ? path9.dirname(path9.resolve(toPath(fileUrlOrPath))) : void 0;
16968 const result = await searchPrettierConfig(directory, { shouldCache: false });
16969 return result ?? null;
16970}
16971function mergeOverrides(configResult, filePath) {
16972 const { config, configFile } = configResult || {};
16973 const { overrides, ...options8 } = config || {};
16974 if (filePath && overrides) {
16975 const relativeFilePath = path9.relative(path9.dirname(configFile), filePath);
16976 for (const override of overrides) {
16977 if (pathMatchesGlobs(
16978 relativeFilePath,
16979 override.files,
16980 override.excludeFiles
16981 )) {
16982 Object.assign(options8, override.options);
16983 }
16984 }
16985 }
16986 return options8;
16987}
16988function pathMatchesGlobs(filePath, patterns, excludedPatterns) {
16989 const patternList = Array.isArray(patterns) ? patterns : [patterns];
16990 const [withSlashes, withoutSlashes] = partition_default(
16991 patternList,
16992 (pattern) => pattern.includes("/")
16993 );
16994 return import_micromatch.default.isMatch(filePath, withoutSlashes, {
16995 ignore: excludedPatterns,
16996 basename: true,
16997 dot: true
16998 }) || import_micromatch.default.isMatch(filePath, withSlashes, {
16999 ignore: excludedPatterns,
17000 basename: false,
17001 dot: true
17002 });
17003}
17004
17005// scripts/build/shims/string-replace-all.js
17006var stringReplaceAll2 = (isOptionalObject, original, pattern, replacement) => {
17007 if (isOptionalObject && (original === void 0 || original === null)) {
17008 return;
17009 }
17010 if (original.replaceAll) {
17011 return original.replaceAll(pattern, replacement);
17012 }
17013 if (pattern.global) {
17014 return original.replace(pattern, replacement);
17015 }
17016 return original.split(pattern).join(replacement);
17017};
17018var string_replace_all_default = stringReplaceAll2;
17019
17020// src/utils/ignore.js
17021var import_ignore = __toESM(require_ignore(), 1);
17022import path10 from "path";
17023import url from "url";
17024var createIgnore = import_ignore.default.default;
17025var slash = path10.sep === "\\" ? (filePath) => string_replace_all_default(
17026 /* isOptionalObject */
17027 false,
17028 filePath,
17029 "\\",
17030 "/"
17031) : (filePath) => filePath;
17032function getRelativePath(file, ignoreFile) {
17033 const ignoreFilePath = toPath(ignoreFile);
17034 const filePath = isUrl(file) ? url.fileURLToPath(file) : path10.resolve(file);
17035 return path10.relative(
17036 // If there's an ignore-path set, the filename must be relative to the
17037 // ignore path, not the current working directory.
17038 ignoreFilePath ? path10.dirname(ignoreFilePath) : process.cwd(),
17039 filePath
17040 );
17041}
17042async function createSingleIsIgnoredFunction(ignoreFile, withNodeModules) {
17043 let content = "";
17044 if (ignoreFile) {
17045 content += await read_file_default(ignoreFile) ?? "";
17046 }
17047 if (!withNodeModules) {
17048 content += "\nnode_modules";
17049 }
17050 if (!content) {
17051 return;
17052 }
17053 const ignore = createIgnore({ allowRelativePaths: true }).add(content);
17054 return (file) => ignore.ignores(slash(getRelativePath(file, ignoreFile)));
17055}
17056async function createIsIgnoredFunction(ignoreFiles, withNodeModules) {
17057 if (ignoreFiles.length === 0 && !withNodeModules) {
17058 ignoreFiles = [void 0];
17059 }
17060 const isIgnoredFunctions = (await Promise.all(
17061 ignoreFiles.map(
17062 (ignoreFile) => createSingleIsIgnoredFunction(ignoreFile, withNodeModules)
17063 )
17064 )).filter(Boolean);
17065 return (file) => isIgnoredFunctions.some((isIgnored2) => isIgnored2(file));
17066}
17067async function isIgnored(file, options8) {
17068 const { ignorePath: ignoreFiles, withNodeModules } = options8;
17069 const isIgnored2 = await createIsIgnoredFunction(ignoreFiles, withNodeModules);
17070 return isIgnored2(file);
17071}
17072
17073// src/utils/get-interpreter.js
17074var import_n_readlines = __toESM(require_readlines(), 1);
17075import fs6 from "fs";
17076function getInterpreter(file) {
17077 let fd;
17078 try {
17079 fd = fs6.openSync(file, "r");
17080 } catch {
17081 return;
17082 }
17083 try {
17084 const liner = new import_n_readlines.default(fd);
17085 const firstLine = liner.next().toString("utf8");
17086 const m1 = firstLine.match(/^#!\/(?:usr\/)?bin\/env\s+(\S+)/u);
17087 if (m1) {
17088 return m1[1];
17089 }
17090 const m2 = firstLine.match(/^#!\/(?:usr\/(?:local\/)?)?bin\/(\S+)/u);
17091 if (m2) {
17092 return m2[1];
17093 }
17094 } finally {
17095 try {
17096 fs6.closeSync(fd);
17097 } catch {
17098 }
17099 }
17100}
17101var get_interpreter_default = getInterpreter;
17102
17103// src/utils/infer-parser.js
17104var getFileBasename = (file) => String(file).split(/[/\\]/u).pop();
17105function getLanguageByFileName(languages2, file) {
17106 if (!file) {
17107 return;
17108 }
17109 const basename = getFileBasename(file).toLowerCase();
17110 return languages2.find(
17111 ({ filenames }) => filenames == null ? void 0 : filenames.some((name) => name.toLowerCase() === basename)
17112 ) ?? languages2.find(
17113 ({ extensions }) => extensions == null ? void 0 : extensions.some((extension) => basename.endsWith(extension))
17114 );
17115}
17116function getLanguageByLanguageName(languages2, languageName) {
17117 if (!languageName) {
17118 return;
17119 }
17120 return languages2.find(({ name }) => name.toLowerCase() === languageName) ?? languages2.find(({ aliases }) => aliases == null ? void 0 : aliases.includes(languageName)) ?? languages2.find(({ extensions }) => extensions == null ? void 0 : extensions.includes(`.${languageName}`));
17121}
17122function getLanguageByInterpreter(languages2, file) {
17123 if (!file || getFileBasename(file).includes(".")) {
17124 return;
17125 }
17126 const interpreter = get_interpreter_default(file);
17127 if (!interpreter) {
17128 return;
17129 }
17130 return languages2.find(
17131 ({ interpreters }) => interpreters == null ? void 0 : interpreters.includes(interpreter)
17132 );
17133}
17134function inferParser(options8, fileInfo) {
17135 const languages2 = options8.plugins.flatMap(
17136 (plugin) => (
17137 // @ts-expect-error -- Safe
17138 plugin.languages ?? []
17139 )
17140 );
17141 const language = getLanguageByLanguageName(languages2, fileInfo.language) ?? getLanguageByFileName(languages2, fileInfo.physicalFile) ?? getLanguageByFileName(languages2, fileInfo.file) ?? getLanguageByInterpreter(languages2, fileInfo.physicalFile);
17142 return language == null ? void 0 : language.parsers[0];
17143}
17144var infer_parser_default = inferParser;
17145
17146// src/common/get-file-info.js
17147async function getFileInfo(file, options8) {
17148 if (typeof file !== "string" && !(file instanceof URL)) {
17149 throw new TypeError(
17150 `expect \`file\` to be a string or URL, got \`${typeof file}\``
17151 );
17152 }
17153 let { ignorePath, withNodeModules } = options8;
17154 if (!Array.isArray(ignorePath)) {
17155 ignorePath = [ignorePath];
17156 }
17157 const ignored = await isIgnored(file, { ignorePath, withNodeModules });
17158 let inferredParser;
17159 if (!ignored) {
17160 inferredParser = await getParser(file, options8);
17161 }
17162 return {
17163 ignored,
17164 inferredParser: inferredParser ?? null
17165 };
17166}
17167async function getParser(file, options8) {
17168 let config;
17169 if (options8.resolveConfig !== false) {
17170 config = await resolveConfig(file);
17171 }
17172 return (config == null ? void 0 : config.parser) ?? infer_parser_default(options8, { physicalFile: file });
17173}
17174var get_file_info_default = getFileInfo;
17175
17176// src/common/end-of-line.js
17177function guessEndOfLine(text) {
17178 const index = text.indexOf("\r");
17179 if (index !== -1) {
17180 return text.charAt(index + 1) === "\n" ? "crlf" : "cr";
17181 }
17182 return "lf";
17183}
17184function convertEndOfLineToChars(value) {
17185 switch (value) {
17186 case "cr":
17187 return "\r";
17188 case "crlf":
17189 return "\r\n";
17190 default:
17191 return "\n";
17192 }
17193}
17194function countEndOfLineChars(text, eol) {
17195 let regex;
17196 switch (eol) {
17197 case "\n":
17198 regex = /\n/gu;
17199 break;
17200 case "\r":
17201 regex = /\r/gu;
17202 break;
17203 case "\r\n":
17204 regex = /\r\n/gu;
17205 break;
17206 default:
17207 throw new Error(`Unexpected "eol" ${JSON.stringify(eol)}.`);
17208 }
17209 const endOfLines = text.match(regex);
17210 return endOfLines ? endOfLines.length : 0;
17211}
17212function normalizeEndOfLine(text) {
17213 return string_replace_all_default(
17214 /* isOptionalObject */
17215 false,
17216 text,
17217 /\r\n?/gu,
17218 "\n"
17219 );
17220}
17221
17222// src/document/constants.js
17223var DOC_TYPE_STRING = "string";
17224var DOC_TYPE_ARRAY = "array";
17225var DOC_TYPE_CURSOR = "cursor";
17226var DOC_TYPE_INDENT = "indent";
17227var DOC_TYPE_ALIGN = "align";
17228var DOC_TYPE_TRIM = "trim";
17229var DOC_TYPE_GROUP = "group";
17230var DOC_TYPE_FILL = "fill";
17231var DOC_TYPE_IF_BREAK = "if-break";
17232var DOC_TYPE_INDENT_IF_BREAK = "indent-if-break";
17233var DOC_TYPE_LINE_SUFFIX = "line-suffix";
17234var DOC_TYPE_LINE_SUFFIX_BOUNDARY = "line-suffix-boundary";
17235var DOC_TYPE_LINE = "line";
17236var DOC_TYPE_LABEL = "label";
17237var DOC_TYPE_BREAK_PARENT = "break-parent";
17238var VALID_OBJECT_DOC_TYPES = /* @__PURE__ */ new Set([
17239 DOC_TYPE_CURSOR,
17240 DOC_TYPE_INDENT,
17241 DOC_TYPE_ALIGN,
17242 DOC_TYPE_TRIM,
17243 DOC_TYPE_GROUP,
17244 DOC_TYPE_FILL,
17245 DOC_TYPE_IF_BREAK,
17246 DOC_TYPE_INDENT_IF_BREAK,
17247 DOC_TYPE_LINE_SUFFIX,
17248 DOC_TYPE_LINE_SUFFIX_BOUNDARY,
17249 DOC_TYPE_LINE,
17250 DOC_TYPE_LABEL,
17251 DOC_TYPE_BREAK_PARENT
17252]);
17253
17254// src/document/utils/get-doc-type.js
17255function getDocType(doc2) {
17256 if (typeof doc2 === "string") {
17257 return DOC_TYPE_STRING;
17258 }
17259 if (Array.isArray(doc2)) {
17260 return DOC_TYPE_ARRAY;
17261 }
17262 if (!doc2) {
17263 return;
17264 }
17265 const { type: type2 } = doc2;
17266 if (VALID_OBJECT_DOC_TYPES.has(type2)) {
17267 return type2;
17268 }
17269}
17270var get_doc_type_default = getDocType;
17271
17272// src/document/invalid-doc-error.js
17273var disjunctionListFormat = (list) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(list);
17274function getDocErrorMessage(doc2) {
17275 const type2 = doc2 === null ? "null" : typeof doc2;
17276 if (type2 !== "string" && type2 !== "object") {
17277 return `Unexpected doc '${type2}',
17278Expected it to be 'string' or 'object'.`;
17279 }
17280 if (get_doc_type_default(doc2)) {
17281 throw new Error("doc is valid.");
17282 }
17283 const objectType = Object.prototype.toString.call(doc2);
17284 if (objectType !== "[object Object]") {
17285 return `Unexpected doc '${objectType}'.`;
17286 }
17287 const EXPECTED_TYPE_VALUES = disjunctionListFormat(
17288 [...VALID_OBJECT_DOC_TYPES].map((type3) => `'${type3}'`)
17289 );
17290 return `Unexpected doc.type '${doc2.type}'.
17291Expected it to be ${EXPECTED_TYPE_VALUES}.`;
17292}
17293var InvalidDocError = class extends Error {
17294 name = "InvalidDocError";
17295 constructor(doc2) {
17296 super(getDocErrorMessage(doc2));
17297 this.doc = doc2;
17298 }
17299};
17300var invalid_doc_error_default = InvalidDocError;
17301
17302// src/document/utils/traverse-doc.js
17303var traverseDocOnExitStackMarker = {};
17304function traverseDoc(doc2, onEnter, onExit, shouldTraverseConditionalGroups) {
17305 const docsStack = [doc2];
17306 while (docsStack.length > 0) {
17307 const doc3 = docsStack.pop();
17308 if (doc3 === traverseDocOnExitStackMarker) {
17309 onExit(docsStack.pop());
17310 continue;
17311 }
17312 if (onExit) {
17313 docsStack.push(doc3, traverseDocOnExitStackMarker);
17314 }
17315 const docType = get_doc_type_default(doc3);
17316 if (!docType) {
17317 throw new invalid_doc_error_default(doc3);
17318 }
17319 if ((onEnter == null ? void 0 : onEnter(doc3)) === false) {
17320 continue;
17321 }
17322 switch (docType) {
17323 case DOC_TYPE_ARRAY:
17324 case DOC_TYPE_FILL: {
17325 const parts = docType === DOC_TYPE_ARRAY ? doc3 : doc3.parts;
17326 for (let ic = parts.length, i = ic - 1; i >= 0; --i) {
17327 docsStack.push(parts[i]);
17328 }
17329 break;
17330 }
17331 case DOC_TYPE_IF_BREAK:
17332 docsStack.push(doc3.flatContents, doc3.breakContents);
17333 break;
17334 case DOC_TYPE_GROUP:
17335 if (shouldTraverseConditionalGroups && doc3.expandedStates) {
17336 for (let ic = doc3.expandedStates.length, i = ic - 1; i >= 0; --i) {
17337 docsStack.push(doc3.expandedStates[i]);
17338 }
17339 } else {
17340 docsStack.push(doc3.contents);
17341 }
17342 break;
17343 case DOC_TYPE_ALIGN:
17344 case DOC_TYPE_INDENT:
17345 case DOC_TYPE_INDENT_IF_BREAK:
17346 case DOC_TYPE_LABEL:
17347 case DOC_TYPE_LINE_SUFFIX:
17348 docsStack.push(doc3.contents);
17349 break;
17350 case DOC_TYPE_STRING:
17351 case DOC_TYPE_CURSOR:
17352 case DOC_TYPE_TRIM:
17353 case DOC_TYPE_LINE_SUFFIX_BOUNDARY:
17354 case DOC_TYPE_LINE:
17355 case DOC_TYPE_BREAK_PARENT:
17356 break;
17357 default:
17358 throw new invalid_doc_error_default(doc3);
17359 }
17360 }
17361}
17362var traverse_doc_default = traverseDoc;
17363
17364// src/document/utils/assert-doc.js
17365var noop = () => {
17366};
17367var assertDoc = true ? noop : function(doc2) {
17368 traverse_doc_default(doc2, (doc3) => {
17369 if (checked.has(doc3)) {
17370 return false;
17371 }
17372 if (typeof doc3 !== "string") {
17373 checked.add(doc3);
17374 }
17375 });
17376};
17377
17378// src/document/builders.js
17379function indent(contents) {
17380 assertDoc(contents);
17381 return { type: DOC_TYPE_INDENT, contents };
17382}
17383function align(widthOrString, contents) {
17384 assertDoc(contents);
17385 return { type: DOC_TYPE_ALIGN, contents, n: widthOrString };
17386}
17387function lineSuffix(contents) {
17388 assertDoc(contents);
17389 return { type: DOC_TYPE_LINE_SUFFIX, contents };
17390}
17391var breakParent = { type: DOC_TYPE_BREAK_PARENT };
17392var hardlineWithoutBreakParent = { type: DOC_TYPE_LINE, hard: true };
17393var line2 = { type: DOC_TYPE_LINE };
17394var hardline = [hardlineWithoutBreakParent, breakParent];
17395var cursor = { type: DOC_TYPE_CURSOR };
17396function addAlignmentToDoc(doc2, size, tabWidth) {
17397 assertDoc(doc2);
17398 let aligned = doc2;
17399 if (size > 0) {
17400 for (let i = 0; i < Math.floor(size / tabWidth); ++i) {
17401 aligned = indent(aligned);
17402 }
17403 aligned = align(size % tabWidth, aligned);
17404 aligned = align(Number.NEGATIVE_INFINITY, aligned);
17405 }
17406 return aligned;
17407}
17408
17409// src/document/debug.js
17410function flattenDoc(doc2) {
17411 var _a;
17412 if (!doc2) {
17413 return "";
17414 }
17415 if (Array.isArray(doc2)) {
17416 const res = [];
17417 for (const part of doc2) {
17418 if (Array.isArray(part)) {
17419 res.push(...flattenDoc(part));
17420 } else {
17421 const flattened = flattenDoc(part);
17422 if (flattened !== "") {
17423 res.push(flattened);
17424 }
17425 }
17426 }
17427 return res;
17428 }
17429 if (doc2.type === DOC_TYPE_IF_BREAK) {
17430 return {
17431 ...doc2,
17432 breakContents: flattenDoc(doc2.breakContents),
17433 flatContents: flattenDoc(doc2.flatContents)
17434 };
17435 }
17436 if (doc2.type === DOC_TYPE_GROUP) {
17437 return {
17438 ...doc2,
17439 contents: flattenDoc(doc2.contents),
17440 expandedStates: (_a = doc2.expandedStates) == null ? void 0 : _a.map(flattenDoc)
17441 };
17442 }
17443 if (doc2.type === DOC_TYPE_FILL) {
17444 return { type: "fill", parts: doc2.parts.map(flattenDoc) };
17445 }
17446 if (doc2.contents) {
17447 return { ...doc2, contents: flattenDoc(doc2.contents) };
17448 }
17449 return doc2;
17450}
17451function printDocToDebug(doc2) {
17452 const printedSymbols = /* @__PURE__ */ Object.create(null);
17453 const usedKeysForSymbols = /* @__PURE__ */ new Set();
17454 return printDoc(flattenDoc(doc2));
17455 function printDoc(doc3, index, parentParts) {
17456 var _a, _b;
17457 if (typeof doc3 === "string") {
17458 return JSON.stringify(doc3);
17459 }
17460 if (Array.isArray(doc3)) {
17461 const printed = doc3.map(printDoc).filter(Boolean);
17462 return printed.length === 1 ? printed[0] : `[${printed.join(", ")}]`;
17463 }
17464 if (doc3.type === DOC_TYPE_LINE) {
17465 const withBreakParent = ((_a = parentParts == null ? void 0 : parentParts[index + 1]) == null ? void 0 : _a.type) === DOC_TYPE_BREAK_PARENT;
17466 if (doc3.literal) {
17467 return withBreakParent ? "literalline" : "literallineWithoutBreakParent";
17468 }
17469 if (doc3.hard) {
17470 return withBreakParent ? "hardline" : "hardlineWithoutBreakParent";
17471 }
17472 if (doc3.soft) {
17473 return "softline";
17474 }
17475 return "line";
17476 }
17477 if (doc3.type === DOC_TYPE_BREAK_PARENT) {
17478 const afterHardline = ((_b = parentParts == null ? void 0 : parentParts[index - 1]) == null ? void 0 : _b.type) === DOC_TYPE_LINE && parentParts[index - 1].hard;
17479 return afterHardline ? void 0 : "breakParent";
17480 }
17481 if (doc3.type === DOC_TYPE_TRIM) {
17482 return "trim";
17483 }
17484 if (doc3.type === DOC_TYPE_INDENT) {
17485 return "indent(" + printDoc(doc3.contents) + ")";
17486 }
17487 if (doc3.type === DOC_TYPE_ALIGN) {
17488 return doc3.n === Number.NEGATIVE_INFINITY ? "dedentToRoot(" + printDoc(doc3.contents) + ")" : doc3.n < 0 ? "dedent(" + printDoc(doc3.contents) + ")" : doc3.n.type === "root" ? "markAsRoot(" + printDoc(doc3.contents) + ")" : "align(" + JSON.stringify(doc3.n) + ", " + printDoc(doc3.contents) + ")";
17489 }
17490 if (doc3.type === DOC_TYPE_IF_BREAK) {
17491 return "ifBreak(" + printDoc(doc3.breakContents) + (doc3.flatContents ? ", " + printDoc(doc3.flatContents) : "") + (doc3.groupId ? (!doc3.flatContents ? ', ""' : "") + `, { groupId: ${printGroupId(doc3.groupId)} }` : "") + ")";
17492 }
17493 if (doc3.type === DOC_TYPE_INDENT_IF_BREAK) {
17494 const optionsParts = [];
17495 if (doc3.negate) {
17496 optionsParts.push("negate: true");
17497 }
17498 if (doc3.groupId) {
17499 optionsParts.push(`groupId: ${printGroupId(doc3.groupId)}`);
17500 }
17501 const options8 = optionsParts.length > 0 ? `, { ${optionsParts.join(", ")} }` : "";
17502 return `indentIfBreak(${printDoc(doc3.contents)}${options8})`;
17503 }
17504 if (doc3.type === DOC_TYPE_GROUP) {
17505 const optionsParts = [];
17506 if (doc3.break && doc3.break !== "propagated") {
17507 optionsParts.push("shouldBreak: true");
17508 }
17509 if (doc3.id) {
17510 optionsParts.push(`id: ${printGroupId(doc3.id)}`);
17511 }
17512 const options8 = optionsParts.length > 0 ? `, { ${optionsParts.join(", ")} }` : "";
17513 if (doc3.expandedStates) {
17514 return `conditionalGroup([${doc3.expandedStates.map((part) => printDoc(part)).join(",")}]${options8})`;
17515 }
17516 return `group(${printDoc(doc3.contents)}${options8})`;
17517 }
17518 if (doc3.type === DOC_TYPE_FILL) {
17519 return `fill([${doc3.parts.map((part) => printDoc(part)).join(", ")}])`;
17520 }
17521 if (doc3.type === DOC_TYPE_LINE_SUFFIX) {
17522 return "lineSuffix(" + printDoc(doc3.contents) + ")";
17523 }
17524 if (doc3.type === DOC_TYPE_LINE_SUFFIX_BOUNDARY) {
17525 return "lineSuffixBoundary";
17526 }
17527 if (doc3.type === DOC_TYPE_LABEL) {
17528 return `label(${JSON.stringify(doc3.label)}, ${printDoc(doc3.contents)})`;
17529 }
17530 throw new Error("Unknown doc type " + doc3.type);
17531 }
17532 function printGroupId(id) {
17533 if (typeof id !== "symbol") {
17534 return JSON.stringify(String(id));
17535 }
17536 if (id in printedSymbols) {
17537 return printedSymbols[id];
17538 }
17539 const prefix = id.description || "symbol";
17540 for (let counter = 0; ; counter++) {
17541 const key2 = prefix + (counter > 0 ? ` #${counter}` : "");
17542 if (!usedKeysForSymbols.has(key2)) {
17543 usedKeysForSymbols.add(key2);
17544 return printedSymbols[id] = `Symbol.for(${JSON.stringify(key2)})`;
17545 }
17546 }
17547 }
17548}
17549
17550// scripts/build/shims/at.js
17551var at = (isOptionalObject, object, index) => {
17552 if (isOptionalObject && (object === void 0 || object === null)) {
17553 return;
17554 }
17555 if (Array.isArray(object) || typeof object === "string") {
17556 return object[index < 0 ? object.length + index : index];
17557 }
17558 return object.at(index);
17559};
17560var at_default = at;
17561
17562// node_modules/emoji-regex/index.mjs
17563var emoji_regex_default = () => {
17564 return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
17565};
17566
17567// node_modules/get-east-asian-width/lookup.js
17568function isFullWidth(x) {
17569 return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
17570}
17571function isWide(x) {
17572 return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
17573}
17574
17575// node_modules/get-east-asian-width/index.js
17576var _isNarrowWidth = (codePoint) => !(isFullWidth(codePoint) || isWide(codePoint));
17577
17578// src/utils/get-string-width.js
17579var notAsciiRegex = /[^\x20-\x7F]/u;
17580function getStringWidth(text) {
17581 if (!text) {
17582 return 0;
17583 }
17584 if (!notAsciiRegex.test(text)) {
17585 return text.length;
17586 }
17587 text = text.replace(emoji_regex_default(), " ");
17588 let width = 0;
17589 for (const character of text) {
17590 const codePoint = character.codePointAt(0);
17591 if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
17592 continue;
17593 }
17594 if (codePoint >= 768 && codePoint <= 879) {
17595 continue;
17596 }
17597 width += _isNarrowWidth(codePoint) ? 1 : 2;
17598 }
17599 return width;
17600}
17601var get_string_width_default = getStringWidth;
17602
17603// src/document/utils.js
17604function mapDoc(doc2, cb) {
17605 if (typeof doc2 === "string") {
17606 return cb(doc2);
17607 }
17608 const mapped = /* @__PURE__ */ new Map();
17609 return rec(doc2);
17610 function rec(doc3) {
17611 if (mapped.has(doc3)) {
17612 return mapped.get(doc3);
17613 }
17614 const result = process4(doc3);
17615 mapped.set(doc3, result);
17616 return result;
17617 }
17618 function process4(doc3) {
17619 switch (get_doc_type_default(doc3)) {
17620 case DOC_TYPE_ARRAY:
17621 return cb(doc3.map(rec));
17622 case DOC_TYPE_FILL:
17623 return cb({ ...doc3, parts: doc3.parts.map(rec) });
17624 case DOC_TYPE_IF_BREAK:
17625 return cb({
17626 ...doc3,
17627 breakContents: rec(doc3.breakContents),
17628 flatContents: rec(doc3.flatContents)
17629 });
17630 case DOC_TYPE_GROUP: {
17631 let { expandedStates, contents } = doc3;
17632 if (expandedStates) {
17633 expandedStates = expandedStates.map(rec);
17634 contents = expandedStates[0];
17635 } else {
17636 contents = rec(contents);
17637 }
17638 return cb({ ...doc3, contents, expandedStates });
17639 }
17640 case DOC_TYPE_ALIGN:
17641 case DOC_TYPE_INDENT:
17642 case DOC_TYPE_INDENT_IF_BREAK:
17643 case DOC_TYPE_LABEL:
17644 case DOC_TYPE_LINE_SUFFIX:
17645 return cb({ ...doc3, contents: rec(doc3.contents) });
17646 case DOC_TYPE_STRING:
17647 case DOC_TYPE_CURSOR:
17648 case DOC_TYPE_TRIM:
17649 case DOC_TYPE_LINE_SUFFIX_BOUNDARY:
17650 case DOC_TYPE_LINE:
17651 case DOC_TYPE_BREAK_PARENT:
17652 return cb(doc3);
17653 default:
17654 throw new invalid_doc_error_default(doc3);
17655 }
17656 }
17657}
17658function breakParentGroup(groupStack) {
17659 if (groupStack.length > 0) {
17660 const parentGroup = at_default(
17661 /* isOptionalObject */
17662 false,
17663 groupStack,
17664 -1
17665 );
17666 if (!parentGroup.expandedStates && !parentGroup.break) {
17667 parentGroup.break = "propagated";
17668 }
17669 }
17670 return null;
17671}
17672function propagateBreaks(doc2) {
17673 const alreadyVisitedSet = /* @__PURE__ */ new Set();
17674 const groupStack = [];
17675 function propagateBreaksOnEnterFn(doc3) {
17676 if (doc3.type === DOC_TYPE_BREAK_PARENT) {
17677 breakParentGroup(groupStack);
17678 }
17679 if (doc3.type === DOC_TYPE_GROUP) {
17680 groupStack.push(doc3);
17681 if (alreadyVisitedSet.has(doc3)) {
17682 return false;
17683 }
17684 alreadyVisitedSet.add(doc3);
17685 }
17686 }
17687 function propagateBreaksOnExitFn(doc3) {
17688 if (doc3.type === DOC_TYPE_GROUP) {
17689 const group = groupStack.pop();
17690 if (group.break) {
17691 breakParentGroup(groupStack);
17692 }
17693 }
17694 }
17695 traverse_doc_default(
17696 doc2,
17697 propagateBreaksOnEnterFn,
17698 propagateBreaksOnExitFn,
17699 /* shouldTraverseConditionalGroups */
17700 true
17701 );
17702}
17703function stripTrailingHardlineFromParts(parts) {
17704 parts = [...parts];
17705 while (parts.length >= 2 && at_default(
17706 /* isOptionalObject */
17707 false,
17708 parts,
17709 -2
17710 ).type === DOC_TYPE_LINE && at_default(
17711 /* isOptionalObject */
17712 false,
17713 parts,
17714 -1
17715 ).type === DOC_TYPE_BREAK_PARENT) {
17716 parts.length -= 2;
17717 }
17718 if (parts.length > 0) {
17719 const lastPart = stripTrailingHardlineFromDoc(at_default(
17720 /* isOptionalObject */
17721 false,
17722 parts,
17723 -1
17724 ));
17725 parts[parts.length - 1] = lastPart;
17726 }
17727 return parts;
17728}
17729function stripTrailingHardlineFromDoc(doc2) {
17730 switch (get_doc_type_default(doc2)) {
17731 case DOC_TYPE_INDENT:
17732 case DOC_TYPE_INDENT_IF_BREAK:
17733 case DOC_TYPE_GROUP:
17734 case DOC_TYPE_LINE_SUFFIX:
17735 case DOC_TYPE_LABEL: {
17736 const contents = stripTrailingHardlineFromDoc(doc2.contents);
17737 return { ...doc2, contents };
17738 }
17739 case DOC_TYPE_IF_BREAK:
17740 return {
17741 ...doc2,
17742 breakContents: stripTrailingHardlineFromDoc(doc2.breakContents),
17743 flatContents: stripTrailingHardlineFromDoc(doc2.flatContents)
17744 };
17745 case DOC_TYPE_FILL:
17746 return { ...doc2, parts: stripTrailingHardlineFromParts(doc2.parts) };
17747 case DOC_TYPE_ARRAY:
17748 return stripTrailingHardlineFromParts(doc2);
17749 case DOC_TYPE_STRING:
17750 return doc2.replace(/[\n\r]*$/u, "");
17751 case DOC_TYPE_ALIGN:
17752 case DOC_TYPE_CURSOR:
17753 case DOC_TYPE_TRIM:
17754 case DOC_TYPE_LINE_SUFFIX_BOUNDARY:
17755 case DOC_TYPE_LINE:
17756 case DOC_TYPE_BREAK_PARENT:
17757 break;
17758 default:
17759 throw new invalid_doc_error_default(doc2);
17760 }
17761 return doc2;
17762}
17763function stripTrailingHardline(doc2) {
17764 return stripTrailingHardlineFromDoc(cleanDoc(doc2));
17765}
17766function cleanDocFn(doc2) {
17767 switch (get_doc_type_default(doc2)) {
17768 case DOC_TYPE_FILL:
17769 if (doc2.parts.every((part) => part === "")) {
17770 return "";
17771 }
17772 break;
17773 case DOC_TYPE_GROUP:
17774 if (!doc2.contents && !doc2.id && !doc2.break && !doc2.expandedStates) {
17775 return "";
17776 }
17777 if (doc2.contents.type === DOC_TYPE_GROUP && doc2.contents.id === doc2.id && doc2.contents.break === doc2.break && doc2.contents.expandedStates === doc2.expandedStates) {
17778 return doc2.contents;
17779 }
17780 break;
17781 case DOC_TYPE_ALIGN:
17782 case DOC_TYPE_INDENT:
17783 case DOC_TYPE_INDENT_IF_BREAK:
17784 case DOC_TYPE_LINE_SUFFIX:
17785 if (!doc2.contents) {
17786 return "";
17787 }
17788 break;
17789 case DOC_TYPE_IF_BREAK:
17790 if (!doc2.flatContents && !doc2.breakContents) {
17791 return "";
17792 }
17793 break;
17794 case DOC_TYPE_ARRAY: {
17795 const parts = [];
17796 for (const part of doc2) {
17797 if (!part) {
17798 continue;
17799 }
17800 const [currentPart, ...restParts] = Array.isArray(part) ? part : [part];
17801 if (typeof currentPart === "string" && typeof at_default(
17802 /* isOptionalObject */
17803 false,
17804 parts,
17805 -1
17806 ) === "string") {
17807 parts[parts.length - 1] += currentPart;
17808 } else {
17809 parts.push(currentPart);
17810 }
17811 parts.push(...restParts);
17812 }
17813 if (parts.length === 0) {
17814 return "";
17815 }
17816 if (parts.length === 1) {
17817 return parts[0];
17818 }
17819 return parts;
17820 }
17821 case DOC_TYPE_STRING:
17822 case DOC_TYPE_CURSOR:
17823 case DOC_TYPE_TRIM:
17824 case DOC_TYPE_LINE_SUFFIX_BOUNDARY:
17825 case DOC_TYPE_LINE:
17826 case DOC_TYPE_LABEL:
17827 case DOC_TYPE_BREAK_PARENT:
17828 break;
17829 default:
17830 throw new invalid_doc_error_default(doc2);
17831 }
17832 return doc2;
17833}
17834function cleanDoc(doc2) {
17835 return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
17836}
17837function inheritLabel(doc2, fn) {
17838 return doc2.type === DOC_TYPE_LABEL ? { ...doc2, contents: fn(doc2.contents) } : fn(doc2);
17839}
17840
17841// src/document/printer.js
17842var MODE_BREAK = Symbol("MODE_BREAK");
17843var MODE_FLAT = Symbol("MODE_FLAT");
17844var CURSOR_PLACEHOLDER = Symbol("cursor");
17845var DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
17846function rootIndent() {
17847 return { value: "", length: 0, queue: [] };
17848}
17849function makeIndent(ind, options8) {
17850 return generateInd(ind, { type: "indent" }, options8);
17851}
17852function makeAlign(indent2, widthOrDoc, options8) {
17853 if (widthOrDoc === Number.NEGATIVE_INFINITY) {
17854 return indent2.root || rootIndent();
17855 }
17856 if (widthOrDoc < 0) {
17857 return generateInd(indent2, { type: "dedent" }, options8);
17858 }
17859 if (!widthOrDoc) {
17860 return indent2;
17861 }
17862 if (widthOrDoc.type === "root") {
17863 return { ...indent2, root: indent2 };
17864 }
17865 const alignType = typeof widthOrDoc === "string" ? "stringAlign" : "numberAlign";
17866 return generateInd(indent2, { type: alignType, n: widthOrDoc }, options8);
17867}
17868function generateInd(ind, newPart, options8) {
17869 const queue = newPart.type === "dedent" ? ind.queue.slice(0, -1) : [...ind.queue, newPart];
17870 let value = "";
17871 let length = 0;
17872 let lastTabs = 0;
17873 let lastSpaces = 0;
17874 for (const part of queue) {
17875 switch (part.type) {
17876 case "indent":
17877 flush();
17878 if (options8.useTabs) {
17879 addTabs(1);
17880 } else {
17881 addSpaces(options8.tabWidth);
17882 }
17883 break;
17884 case "stringAlign":
17885 flush();
17886 value += part.n;
17887 length += part.n.length;
17888 break;
17889 case "numberAlign":
17890 lastTabs += 1;
17891 lastSpaces += part.n;
17892 break;
17893 default:
17894 throw new Error(`Unexpected type '${part.type}'`);
17895 }
17896 }
17897 flushSpaces();
17898 return { ...ind, value, length, queue };
17899 function addTabs(count) {
17900 value += " ".repeat(count);
17901 length += options8.tabWidth * count;
17902 }
17903 function addSpaces(count) {
17904 value += " ".repeat(count);
17905 length += count;
17906 }
17907 function flush() {
17908 if (options8.useTabs) {
17909 flushTabs();
17910 } else {
17911 flushSpaces();
17912 }
17913 }
17914 function flushTabs() {
17915 if (lastTabs > 0) {
17916 addTabs(lastTabs);
17917 }
17918 resetLast();
17919 }
17920 function flushSpaces() {
17921 if (lastSpaces > 0) {
17922 addSpaces(lastSpaces);
17923 }
17924 resetLast();
17925 }
17926 function resetLast() {
17927 lastTabs = 0;
17928 lastSpaces = 0;
17929 }
17930}
17931function trim(out) {
17932 let trimCount = 0;
17933 let cursorCount = 0;
17934 let outIndex = out.length;
17935 outer: while (outIndex--) {
17936 const last = out[outIndex];
17937 if (last === CURSOR_PLACEHOLDER) {
17938 cursorCount++;
17939 continue;
17940 }
17941 if (false) {
17942 throw new Error(`Unexpected value in trim: '${typeof last}'`);
17943 }
17944 for (let charIndex = last.length - 1; charIndex >= 0; charIndex--) {
17945 const char = last[charIndex];
17946 if (char === " " || char === " ") {
17947 trimCount++;
17948 } else {
17949 out[outIndex] = last.slice(0, charIndex + 1);
17950 break outer;
17951 }
17952 }
17953 }
17954 if (trimCount > 0 || cursorCount > 0) {
17955 out.length = outIndex + 1;
17956 while (cursorCount-- > 0) {
17957 out.push(CURSOR_PLACEHOLDER);
17958 }
17959 }
17960 return trimCount;
17961}
17962function fits(next, restCommands, width, hasLineSuffix, groupModeMap, mustBeFlat) {
17963 if (width === Number.POSITIVE_INFINITY) {
17964 return true;
17965 }
17966 let restIdx = restCommands.length;
17967 const cmds = [next];
17968 const out = [];
17969 while (width >= 0) {
17970 if (cmds.length === 0) {
17971 if (restIdx === 0) {
17972 return true;
17973 }
17974 cmds.push(restCommands[--restIdx]);
17975 continue;
17976 }
17977 const { mode, doc: doc2 } = cmds.pop();
17978 const docType = get_doc_type_default(doc2);
17979 switch (docType) {
17980 case DOC_TYPE_STRING:
17981 out.push(doc2);
17982 width -= get_string_width_default(doc2);
17983 break;
17984 case DOC_TYPE_ARRAY:
17985 case DOC_TYPE_FILL: {
17986 const parts = docType === DOC_TYPE_ARRAY ? doc2 : doc2.parts;
17987 for (let i = parts.length - 1; i >= 0; i--) {
17988 cmds.push({ mode, doc: parts[i] });
17989 }
17990 break;
17991 }
17992 case DOC_TYPE_INDENT:
17993 case DOC_TYPE_ALIGN:
17994 case DOC_TYPE_INDENT_IF_BREAK:
17995 case DOC_TYPE_LABEL:
17996 cmds.push({ mode, doc: doc2.contents });
17997 break;
17998 case DOC_TYPE_TRIM:
17999 width += trim(out);
18000 break;
18001 case DOC_TYPE_GROUP: {
18002 if (mustBeFlat && doc2.break) {
18003 return false;
18004 }
18005 const groupMode = doc2.break ? MODE_BREAK : mode;
18006 const contents = doc2.expandedStates && groupMode === MODE_BREAK ? at_default(
18007 /* isOptionalObject */
18008 false,
18009 doc2.expandedStates,
18010 -1
18011 ) : doc2.contents;
18012 cmds.push({ mode: groupMode, doc: contents });
18013 break;
18014 }
18015 case DOC_TYPE_IF_BREAK: {
18016 const groupMode = doc2.groupId ? groupModeMap[doc2.groupId] || MODE_FLAT : mode;
18017 const contents = groupMode === MODE_BREAK ? doc2.breakContents : doc2.flatContents;
18018 if (contents) {
18019 cmds.push({ mode, doc: contents });
18020 }
18021 break;
18022 }
18023 case DOC_TYPE_LINE:
18024 if (mode === MODE_BREAK || doc2.hard) {
18025 return true;
18026 }
18027 if (!doc2.soft) {
18028 out.push(" ");
18029 width--;
18030 }
18031 break;
18032 case DOC_TYPE_LINE_SUFFIX:
18033 hasLineSuffix = true;
18034 break;
18035 case DOC_TYPE_LINE_SUFFIX_BOUNDARY:
18036 if (hasLineSuffix) {
18037 return false;
18038 }
18039 break;
18040 }
18041 }
18042 return false;
18043}
18044function printDocToString(doc2, options8) {
18045 const groupModeMap = {};
18046 const width = options8.printWidth;
18047 const newLine = convertEndOfLineToChars(options8.endOfLine);
18048 let pos2 = 0;
18049 const cmds = [{ ind: rootIndent(), mode: MODE_BREAK, doc: doc2 }];
18050 const out = [];
18051 let shouldRemeasure = false;
18052 const lineSuffix2 = [];
18053 let printedCursorCount = 0;
18054 propagateBreaks(doc2);
18055 while (cmds.length > 0) {
18056 const { ind, mode, doc: doc3 } = cmds.pop();
18057 switch (get_doc_type_default(doc3)) {
18058 case DOC_TYPE_STRING: {
18059 const formatted = newLine !== "\n" ? string_replace_all_default(
18060 /* isOptionalObject */
18061 false,
18062 doc3,
18063 "\n",
18064 newLine
18065 ) : doc3;
18066 out.push(formatted);
18067 if (cmds.length > 0) {
18068 pos2 += get_string_width_default(formatted);
18069 }
18070 break;
18071 }
18072 case DOC_TYPE_ARRAY:
18073 for (let i = doc3.length - 1; i >= 0; i--) {
18074 cmds.push({ ind, mode, doc: doc3[i] });
18075 }
18076 break;
18077 case DOC_TYPE_CURSOR:
18078 if (printedCursorCount >= 2) {
18079 throw new Error("There are too many 'cursor' in doc.");
18080 }
18081 out.push(CURSOR_PLACEHOLDER);
18082 printedCursorCount++;
18083 break;
18084 case DOC_TYPE_INDENT:
18085 cmds.push({ ind: makeIndent(ind, options8), mode, doc: doc3.contents });
18086 break;
18087 case DOC_TYPE_ALIGN:
18088 cmds.push({
18089 ind: makeAlign(ind, doc3.n, options8),
18090 mode,
18091 doc: doc3.contents
18092 });
18093 break;
18094 case DOC_TYPE_TRIM:
18095 pos2 -= trim(out);
18096 break;
18097 case DOC_TYPE_GROUP:
18098 switch (mode) {
18099 case MODE_FLAT:
18100 if (!shouldRemeasure) {
18101 cmds.push({
18102 ind,
18103 mode: doc3.break ? MODE_BREAK : MODE_FLAT,
18104 doc: doc3.contents
18105 });
18106 break;
18107 }
18108 // fallthrough
18109 case MODE_BREAK: {
18110 shouldRemeasure = false;
18111 const next = { ind, mode: MODE_FLAT, doc: doc3.contents };
18112 const rem = width - pos2;
18113 const hasLineSuffix = lineSuffix2.length > 0;
18114 if (!doc3.break && fits(next, cmds, rem, hasLineSuffix, groupModeMap)) {
18115 cmds.push(next);
18116 } else {
18117 if (doc3.expandedStates) {
18118 const mostExpanded = at_default(
18119 /* isOptionalObject */
18120 false,
18121 doc3.expandedStates,
18122 -1
18123 );
18124 if (doc3.break) {
18125 cmds.push({ ind, mode: MODE_BREAK, doc: mostExpanded });
18126 break;
18127 } else {
18128 for (let i = 1; i < doc3.expandedStates.length + 1; i++) {
18129 if (i >= doc3.expandedStates.length) {
18130 cmds.push({ ind, mode: MODE_BREAK, doc: mostExpanded });
18131 break;
18132 } else {
18133 const state = doc3.expandedStates[i];
18134 const cmd = { ind, mode: MODE_FLAT, doc: state };
18135 if (fits(cmd, cmds, rem, hasLineSuffix, groupModeMap)) {
18136 cmds.push(cmd);
18137 break;
18138 }
18139 }
18140 }
18141 }
18142 } else {
18143 cmds.push({ ind, mode: MODE_BREAK, doc: doc3.contents });
18144 }
18145 }
18146 break;
18147 }
18148 }
18149 if (doc3.id) {
18150 groupModeMap[doc3.id] = at_default(
18151 /* isOptionalObject */
18152 false,
18153 cmds,
18154 -1
18155 ).mode;
18156 }
18157 break;
18158 // Fills each line with as much code as possible before moving to a new
18159 // line with the same indentation.
18160 //
18161 // Expects doc.parts to be an array of alternating content and
18162 // whitespace. The whitespace contains the linebreaks.
18163 //
18164 // For example:
18165 // ["I", line, "love", line, "monkeys"]
18166 // or
18167 // [{ type: group, ... }, softline, { type: group, ... }]
18168 //
18169 // It uses this parts structure to handle three main layout cases:
18170 // * The first two content items fit on the same line without
18171 // breaking
18172 // -> output the first content item and the whitespace "flat".
18173 // * Only the first content item fits on the line without breaking
18174 // -> output the first content item "flat" and the whitespace with
18175 // "break".
18176 // * Neither content item fits on the line without breaking
18177 // -> output the first content item and the whitespace with "break".
18178 case DOC_TYPE_FILL: {
18179 const rem = width - pos2;
18180 const offset = doc3[DOC_FILL_PRINTED_LENGTH] ?? 0;
18181 const { parts } = doc3;
18182 const length = parts.length - offset;
18183 if (length === 0) {
18184 break;
18185 }
18186 const content = parts[offset + 0];
18187 const whitespace = parts[offset + 1];
18188 const contentFlatCmd = { ind, mode: MODE_FLAT, doc: content };
18189 const contentBreakCmd = { ind, mode: MODE_BREAK, doc: content };
18190 const contentFits = fits(
18191 contentFlatCmd,
18192 [],
18193 rem,
18194 lineSuffix2.length > 0,
18195 groupModeMap,
18196 true
18197 );
18198 if (length === 1) {
18199 if (contentFits) {
18200 cmds.push(contentFlatCmd);
18201 } else {
18202 cmds.push(contentBreakCmd);
18203 }
18204 break;
18205 }
18206 const whitespaceFlatCmd = { ind, mode: MODE_FLAT, doc: whitespace };
18207 const whitespaceBreakCmd = { ind, mode: MODE_BREAK, doc: whitespace };
18208 if (length === 2) {
18209 if (contentFits) {
18210 cmds.push(whitespaceFlatCmd, contentFlatCmd);
18211 } else {
18212 cmds.push(whitespaceBreakCmd, contentBreakCmd);
18213 }
18214 break;
18215 }
18216 const secondContent = parts[offset + 2];
18217 const remainingCmd = {
18218 ind,
18219 mode,
18220 doc: { ...doc3, [DOC_FILL_PRINTED_LENGTH]: offset + 2 }
18221 };
18222 const firstAndSecondContentFlatCmd = {
18223 ind,
18224 mode: MODE_FLAT,
18225 doc: [content, whitespace, secondContent]
18226 };
18227 const firstAndSecondContentFits = fits(
18228 firstAndSecondContentFlatCmd,
18229 [],
18230 rem,
18231 lineSuffix2.length > 0,
18232 groupModeMap,
18233 true
18234 );
18235 if (firstAndSecondContentFits) {
18236 cmds.push(remainingCmd, whitespaceFlatCmd, contentFlatCmd);
18237 } else if (contentFits) {
18238 cmds.push(remainingCmd, whitespaceBreakCmd, contentFlatCmd);
18239 } else {
18240 cmds.push(remainingCmd, whitespaceBreakCmd, contentBreakCmd);
18241 }
18242 break;
18243 }
18244 case DOC_TYPE_IF_BREAK:
18245 case DOC_TYPE_INDENT_IF_BREAK: {
18246 const groupMode = doc3.groupId ? groupModeMap[doc3.groupId] : mode;
18247 if (groupMode === MODE_BREAK) {
18248 const breakContents = doc3.type === DOC_TYPE_IF_BREAK ? doc3.breakContents : doc3.negate ? doc3.contents : indent(doc3.contents);
18249 if (breakContents) {
18250 cmds.push({ ind, mode, doc: breakContents });
18251 }
18252 }
18253 if (groupMode === MODE_FLAT) {
18254 const flatContents = doc3.type === DOC_TYPE_IF_BREAK ? doc3.flatContents : doc3.negate ? indent(doc3.contents) : doc3.contents;
18255 if (flatContents) {
18256 cmds.push({ ind, mode, doc: flatContents });
18257 }
18258 }
18259 break;
18260 }
18261 case DOC_TYPE_LINE_SUFFIX:
18262 lineSuffix2.push({ ind, mode, doc: doc3.contents });
18263 break;
18264 case DOC_TYPE_LINE_SUFFIX_BOUNDARY:
18265 if (lineSuffix2.length > 0) {
18266 cmds.push({ ind, mode, doc: hardlineWithoutBreakParent });
18267 }
18268 break;
18269 case DOC_TYPE_LINE:
18270 switch (mode) {
18271 case MODE_FLAT:
18272 if (!doc3.hard) {
18273 if (!doc3.soft) {
18274 out.push(" ");
18275 pos2 += 1;
18276 }
18277 break;
18278 } else {
18279 shouldRemeasure = true;
18280 }
18281 // fallthrough
18282 case MODE_BREAK:
18283 if (lineSuffix2.length > 0) {
18284 cmds.push({ ind, mode, doc: doc3 }, ...lineSuffix2.reverse());
18285 lineSuffix2.length = 0;
18286 break;
18287 }
18288 if (doc3.literal) {
18289 if (ind.root) {
18290 out.push(newLine, ind.root.value);
18291 pos2 = ind.root.length;
18292 } else {
18293 out.push(newLine);
18294 pos2 = 0;
18295 }
18296 } else {
18297 pos2 -= trim(out);
18298 out.push(newLine + ind.value);
18299 pos2 = ind.length;
18300 }
18301 break;
18302 }
18303 break;
18304 case DOC_TYPE_LABEL:
18305 cmds.push({ ind, mode, doc: doc3.contents });
18306 break;
18307 case DOC_TYPE_BREAK_PARENT:
18308 break;
18309 default:
18310 throw new invalid_doc_error_default(doc3);
18311 }
18312 if (cmds.length === 0 && lineSuffix2.length > 0) {
18313 cmds.push(...lineSuffix2.reverse());
18314 lineSuffix2.length = 0;
18315 }
18316 }
18317 const cursorPlaceholderIndex = out.indexOf(CURSOR_PLACEHOLDER);
18318 if (cursorPlaceholderIndex !== -1) {
18319 const otherCursorPlaceholderIndex = out.indexOf(
18320 CURSOR_PLACEHOLDER,
18321 cursorPlaceholderIndex + 1
18322 );
18323 if (otherCursorPlaceholderIndex === -1) {
18324 return {
18325 formatted: out.filter((char) => char !== CURSOR_PLACEHOLDER).join("")
18326 };
18327 }
18328 const beforeCursor = out.slice(0, cursorPlaceholderIndex).join("");
18329 const aroundCursor = out.slice(cursorPlaceholderIndex + 1, otherCursorPlaceholderIndex).join("");
18330 const afterCursor = out.slice(otherCursorPlaceholderIndex + 1).join("");
18331 return {
18332 formatted: beforeCursor + aroundCursor + afterCursor,
18333 cursorNodeStart: beforeCursor.length,
18334 cursorNodeText: aroundCursor
18335 };
18336 }
18337 return { formatted: out.join("") };
18338}
18339
18340// src/utils/get-alignment-size.js
18341function getAlignmentSize(text, tabWidth, startIndex = 0) {
18342 let size = 0;
18343 for (let i = startIndex; i < text.length; ++i) {
18344 if (text[i] === " ") {
18345 size = size + tabWidth - size % tabWidth;
18346 } else {
18347 size++;
18348 }
18349 }
18350 return size;
18351}
18352var get_alignment_size_default = getAlignmentSize;
18353
18354// src/common/ast-path.js
18355var _AstPath_instances, getNodeStackIndex_fn, getAncestors_fn;
18356var AstPath = class {
18357 constructor(value) {
18358 __privateAdd(this, _AstPath_instances);
18359 this.stack = [value];
18360 }
18361 /** @type {string | null} */
18362 get key() {
18363 const { stack: stack2, siblings } = this;
18364 return at_default(
18365 /* isOptionalObject */
18366 false,
18367 stack2,
18368 siblings === null ? -2 : -4
18369 ) ?? null;
18370 }
18371 /** @type {number | null} */
18372 get index() {
18373 return this.siblings === null ? null : at_default(
18374 /* isOptionalObject */
18375 false,
18376 this.stack,
18377 -2
18378 );
18379 }
18380 /** @type {object} */
18381 get node() {
18382 return at_default(
18383 /* isOptionalObject */
18384 false,
18385 this.stack,
18386 -1
18387 );
18388 }
18389 /** @type {object | null} */
18390 get parent() {
18391 return this.getNode(1);
18392 }
18393 /** @type {object | null} */
18394 get grandparent() {
18395 return this.getNode(2);
18396 }
18397 /** @type {boolean} */
18398 get isInArray() {
18399 return this.siblings !== null;
18400 }
18401 /** @type {object[] | null} */
18402 get siblings() {
18403 const { stack: stack2 } = this;
18404 const maybeArray = at_default(
18405 /* isOptionalObject */
18406 false,
18407 stack2,
18408 -3
18409 );
18410 return Array.isArray(maybeArray) ? maybeArray : null;
18411 }
18412 /** @type {object | null} */
18413 get next() {
18414 const { siblings } = this;
18415 return siblings === null ? null : siblings[this.index + 1];
18416 }
18417 /** @type {object | null} */
18418 get previous() {
18419 const { siblings } = this;
18420 return siblings === null ? null : siblings[this.index - 1];
18421 }
18422 /** @type {boolean} */
18423 get isFirst() {
18424 return this.index === 0;
18425 }
18426 /** @type {boolean} */
18427 get isLast() {
18428 const { siblings, index } = this;
18429 return siblings !== null && index === siblings.length - 1;
18430 }
18431 /** @type {boolean} */
18432 get isRoot() {
18433 return this.stack.length === 1;
18434 }
18435 /** @type {object} */
18436 get root() {
18437 return this.stack[0];
18438 }
18439 /** @type {object[]} */
18440 get ancestors() {
18441 return [...__privateMethod(this, _AstPath_instances, getAncestors_fn).call(this)];
18442 }
18443 // The name of the current property is always the penultimate element of
18444 // this.stack, and always a string/number/symbol.
18445 getName() {
18446 const { stack: stack2 } = this;
18447 const { length } = stack2;
18448 if (length > 1) {
18449 return at_default(
18450 /* isOptionalObject */
18451 false,
18452 stack2,
18453 -2
18454 );
18455 }
18456 return null;
18457 }
18458 // The value of the current property is always the final element of
18459 // this.stack.
18460 getValue() {
18461 return at_default(
18462 /* isOptionalObject */
18463 false,
18464 this.stack,
18465 -1
18466 );
18467 }
18468 getNode(count = 0) {
18469 const stackIndex = __privateMethod(this, _AstPath_instances, getNodeStackIndex_fn).call(this, count);
18470 return stackIndex === -1 ? null : this.stack[stackIndex];
18471 }
18472 getParentNode(count = 0) {
18473 return this.getNode(count + 1);
18474 }
18475 // Temporarily push properties named by string arguments given after the
18476 // callback function onto this.stack, then call the callback with a
18477 // reference to this (modified) AstPath object. Note that the stack will
18478 // be restored to its original state after the callback is finished, so it
18479 // is probably a mistake to retain a reference to the path.
18480 call(callback, ...names) {
18481 const { stack: stack2 } = this;
18482 const { length } = stack2;
18483 let value = at_default(
18484 /* isOptionalObject */
18485 false,
18486 stack2,
18487 -1
18488 );
18489 for (const name of names) {
18490 value = value[name];
18491 stack2.push(name, value);
18492 }
18493 try {
18494 return callback(this);
18495 } finally {
18496 stack2.length = length;
18497 }
18498 }
18499 /**
18500 * @template {(path: AstPath) => any} T
18501 * @param {T} callback
18502 * @param {number} [count=0]
18503 * @returns {ReturnType<T>}
18504 */
18505 callParent(callback, count = 0) {
18506 const stackIndex = __privateMethod(this, _AstPath_instances, getNodeStackIndex_fn).call(this, count + 1);
18507 const parentValues = this.stack.splice(stackIndex + 1);
18508 try {
18509 return callback(this);
18510 } finally {
18511 this.stack.push(...parentValues);
18512 }
18513 }
18514 // Similar to AstPath.prototype.call, except that the value obtained by
18515 // accessing this.getValue()[name1][name2]... should be array. The
18516 // callback will be called with a reference to this path object for each
18517 // element of the array.
18518 each(callback, ...names) {
18519 const { stack: stack2 } = this;
18520 const { length } = stack2;
18521 let value = at_default(
18522 /* isOptionalObject */
18523 false,
18524 stack2,
18525 -1
18526 );
18527 for (const name of names) {
18528 value = value[name];
18529 stack2.push(name, value);
18530 }
18531 try {
18532 for (let i = 0; i < value.length; ++i) {
18533 stack2.push(i, value[i]);
18534 callback(this, i, value);
18535 stack2.length -= 2;
18536 }
18537 } finally {
18538 stack2.length = length;
18539 }
18540 }
18541 // Similar to AstPath.prototype.each, except that the results of the
18542 // callback function invocations are stored in an array and returned at
18543 // the end of the iteration.
18544 map(callback, ...names) {
18545 const result = [];
18546 this.each(
18547 (path13, index, value) => {
18548 result[index] = callback(path13, index, value);
18549 },
18550 ...names
18551 );
18552 return result;
18553 }
18554 /**
18555 * @param {...(
18556 * | ((node: any, name: string | null, number: number | null) => boolean)
18557 * | undefined
18558 * )} predicates
18559 */
18560 match(...predicates) {
18561 let stackPointer = this.stack.length - 1;
18562 let name = null;
18563 let node = this.stack[stackPointer--];
18564 for (const predicate of predicates) {
18565 if (node === void 0) {
18566 return false;
18567 }
18568 let number = null;
18569 if (typeof name === "number") {
18570 number = name;
18571 name = this.stack[stackPointer--];
18572 node = this.stack[stackPointer--];
18573 }
18574 if (predicate && !predicate(node, name, number)) {
18575 return false;
18576 }
18577 name = this.stack[stackPointer--];
18578 node = this.stack[stackPointer--];
18579 }
18580 return true;
18581 }
18582 /**
18583 * Traverses the ancestors of the current node heading toward the tree root
18584 * until it finds a node that matches the provided predicate function. Will
18585 * return the first matching ancestor. If no such node exists, returns undefined.
18586 * @param {(node: any) => boolean} predicate
18587 * @internal Unstable API. Don't use in plugins for now.
18588 */
18589 findAncestor(predicate) {
18590 for (const node of __privateMethod(this, _AstPath_instances, getAncestors_fn).call(this)) {
18591 if (predicate(node)) {
18592 return node;
18593 }
18594 }
18595 }
18596 /**
18597 * Traverses the ancestors of the current node heading toward the tree root
18598 * until it finds a node that matches the provided predicate function.
18599 * returns true if matched node found.
18600 * @param {(node: any) => boolean} predicate
18601 * @returns {boolean}
18602 * @internal Unstable API. Don't use in plugins for now.
18603 */
18604 hasAncestor(predicate) {
18605 for (const node of __privateMethod(this, _AstPath_instances, getAncestors_fn).call(this)) {
18606 if (predicate(node)) {
18607 return true;
18608 }
18609 }
18610 return false;
18611 }
18612};
18613_AstPath_instances = new WeakSet();
18614getNodeStackIndex_fn = function(count) {
18615 const { stack: stack2 } = this;
18616 for (let i = stack2.length - 1; i >= 0; i -= 2) {
18617 if (!Array.isArray(stack2[i]) && --count < 0) {
18618 return i;
18619 }
18620 }
18621 return -1;
18622};
18623getAncestors_fn = function* () {
18624 const { stack: stack2 } = this;
18625 for (let index = stack2.length - 3; index >= 0; index -= 2) {
18626 const value = stack2[index];
18627 if (!Array.isArray(value)) {
18628 yield value;
18629 }
18630 }
18631};
18632var ast_path_default = AstPath;
18633
18634// src/main/comments/attach.js
18635import assert4 from "assert";
18636
18637// src/utils/is-object.js
18638function isObject2(object) {
18639 return object !== null && typeof object === "object";
18640}
18641var is_object_default = isObject2;
18642
18643// src/utils/ast-utils.js
18644function* getChildren(node, options8) {
18645 const { getVisitorKeys, filter: filter2 = () => true } = options8;
18646 const isMatchedNode = (node2) => is_object_default(node2) && filter2(node2);
18647 for (const key2 of getVisitorKeys(node)) {
18648 const value = node[key2];
18649 if (Array.isArray(value)) {
18650 for (const child of value) {
18651 if (isMatchedNode(child)) {
18652 yield child;
18653 }
18654 }
18655 } else if (isMatchedNode(value)) {
18656 yield value;
18657 }
18658 }
18659}
18660function* getDescendants(node, options8) {
18661 const queue = [node];
18662 for (let index = 0; index < queue.length; index++) {
18663 const node2 = queue[index];
18664 for (const child of getChildren(node2, options8)) {
18665 yield child;
18666 queue.push(child);
18667 }
18668 }
18669}
18670function isLeaf(node, options8) {
18671 return getChildren(node, options8).next().done;
18672}
18673
18674// src/utils/skip.js
18675function skip(characters) {
18676 return (text, startIndex, options8) => {
18677 const backwards = Boolean(options8 == null ? void 0 : options8.backwards);
18678 if (startIndex === false) {
18679 return false;
18680 }
18681 const { length } = text;
18682 let cursor2 = startIndex;
18683 while (cursor2 >= 0 && cursor2 < length) {
18684 const character = text.charAt(cursor2);
18685 if (characters instanceof RegExp) {
18686 if (!characters.test(character)) {
18687 return cursor2;
18688 }
18689 } else if (!characters.includes(character)) {
18690 return cursor2;
18691 }
18692 backwards ? cursor2-- : cursor2++;
18693 }
18694 if (cursor2 === -1 || cursor2 === length) {
18695 return cursor2;
18696 }
18697 return false;
18698 };
18699}
18700var skipWhitespace = skip(/\s/u);
18701var skipSpaces = skip(" ");
18702var skipToLineEnd = skip(",; ");
18703var skipEverythingButNewLine = skip(/[^\n\r]/u);
18704
18705// src/utils/skip-newline.js
18706function skipNewline(text, startIndex, options8) {
18707 const backwards = Boolean(options8 == null ? void 0 : options8.backwards);
18708 if (startIndex === false) {
18709 return false;
18710 }
18711 const character = text.charAt(startIndex);
18712 if (backwards) {
18713 if (text.charAt(startIndex - 1) === "\r" && character === "\n") {
18714 return startIndex - 2;
18715 }
18716 if (character === "\n" || character === "\r" || character === "\u2028" || character === "\u2029") {
18717 return startIndex - 1;
18718 }
18719 } else {
18720 if (character === "\r" && text.charAt(startIndex + 1) === "\n") {
18721 return startIndex + 2;
18722 }
18723 if (character === "\n" || character === "\r" || character === "\u2028" || character === "\u2029") {
18724 return startIndex + 1;
18725 }
18726 }
18727 return startIndex;
18728}
18729var skip_newline_default = skipNewline;
18730
18731// src/utils/has-newline.js
18732function hasNewline(text, startIndex, options8 = {}) {
18733 const idx = skipSpaces(
18734 text,
18735 options8.backwards ? startIndex - 1 : startIndex,
18736 options8
18737 );
18738 const idx2 = skip_newline_default(text, idx, options8);
18739 return idx !== idx2;
18740}
18741var has_newline_default = hasNewline;
18742
18743// src/utils/is-non-empty-array.js
18744function isNonEmptyArray(object) {
18745 return Array.isArray(object) && object.length > 0;
18746}
18747var is_non_empty_array_default = isNonEmptyArray;
18748
18749// src/main/create-get-visitor-keys-function.js
18750var nonTraversableKeys = /* @__PURE__ */ new Set([
18751 "tokens",
18752 "comments",
18753 "parent",
18754 "enclosingNode",
18755 "precedingNode",
18756 "followingNode"
18757]);
18758var defaultGetVisitorKeys = (node) => Object.keys(node).filter((key2) => !nonTraversableKeys.has(key2));
18759function createGetVisitorKeysFunction(printerGetVisitorKeys) {
18760 return printerGetVisitorKeys ? (node) => printerGetVisitorKeys(node, nonTraversableKeys) : defaultGetVisitorKeys;
18761}
18762var create_get_visitor_keys_function_default = createGetVisitorKeysFunction;
18763
18764// src/main/comments/utils.js
18765function describeNodeForDebugging(node) {
18766 const nodeType = node.type || node.kind || "(unknown type)";
18767 let nodeName = String(
18768 node.name || node.id && (typeof node.id === "object" ? node.id.name : node.id) || node.key && (typeof node.key === "object" ? node.key.name : node.key) || node.value && (typeof node.value === "object" ? "" : String(node.value)) || node.operator || ""
18769 );
18770 if (nodeName.length > 20) {
18771 nodeName = nodeName.slice(0, 19) + "\u2026";
18772 }
18773 return nodeType + (nodeName ? " " + nodeName : "");
18774}
18775function addCommentHelper(node, comment) {
18776 const comments = node.comments ?? (node.comments = []);
18777 comments.push(comment);
18778 comment.printed = false;
18779 comment.nodeDescription = describeNodeForDebugging(node);
18780}
18781function addLeadingComment(node, comment) {
18782 comment.leading = true;
18783 comment.trailing = false;
18784 addCommentHelper(node, comment);
18785}
18786function addDanglingComment(node, comment, marker) {
18787 comment.leading = false;
18788 comment.trailing = false;
18789 if (marker) {
18790 comment.marker = marker;
18791 }
18792 addCommentHelper(node, comment);
18793}
18794function addTrailingComment(node, comment) {
18795 comment.leading = false;
18796 comment.trailing = true;
18797 addCommentHelper(node, comment);
18798}
18799
18800// src/main/comments/attach.js
18801var childNodesCache = /* @__PURE__ */ new WeakMap();
18802function getSortedChildNodes(node, options8) {
18803 if (childNodesCache.has(node)) {
18804 return childNodesCache.get(node);
18805 }
18806 const {
18807 printer: {
18808 getCommentChildNodes,
18809 canAttachComment,
18810 getVisitorKeys: printerGetVisitorKeys
18811 },
18812 locStart,
18813 locEnd
18814 } = options8;
18815 if (!canAttachComment) {
18816 return [];
18817 }
18818 const childNodes = ((getCommentChildNodes == null ? void 0 : getCommentChildNodes(node, options8)) ?? [
18819 ...getChildren(node, {
18820 getVisitorKeys: create_get_visitor_keys_function_default(printerGetVisitorKeys)
18821 })
18822 ]).flatMap(
18823 (node2) => canAttachComment(node2) ? [node2] : getSortedChildNodes(node2, options8)
18824 );
18825 childNodes.sort(
18826 (nodeA, nodeB) => locStart(nodeA) - locStart(nodeB) || locEnd(nodeA) - locEnd(nodeB)
18827 );
18828 childNodesCache.set(node, childNodes);
18829 return childNodes;
18830}
18831function decorateComment(node, comment, options8, enclosingNode) {
18832 const { locStart, locEnd } = options8;
18833 const commentStart = locStart(comment);
18834 const commentEnd = locEnd(comment);
18835 const childNodes = getSortedChildNodes(node, options8);
18836 let precedingNode;
18837 let followingNode;
18838 let left = 0;
18839 let right = childNodes.length;
18840 while (left < right) {
18841 const middle = left + right >> 1;
18842 const child = childNodes[middle];
18843 const start = locStart(child);
18844 const end = locEnd(child);
18845 if (start <= commentStart && commentEnd <= end) {
18846 return decorateComment(child, comment, options8, child);
18847 }
18848 if (end <= commentStart) {
18849 precedingNode = child;
18850 left = middle + 1;
18851 continue;
18852 }
18853 if (commentEnd <= start) {
18854 followingNode = child;
18855 right = middle;
18856 continue;
18857 }
18858 throw new Error("Comment location overlaps with node location");
18859 }
18860 if ((enclosingNode == null ? void 0 : enclosingNode.type) === "TemplateLiteral") {
18861 const { quasis } = enclosingNode;
18862 const commentIndex = findExpressionIndexForComment(
18863 quasis,
18864 comment,
18865 options8
18866 );
18867 if (precedingNode && findExpressionIndexForComment(quasis, precedingNode, options8) !== commentIndex) {
18868 precedingNode = null;
18869 }
18870 if (followingNode && findExpressionIndexForComment(quasis, followingNode, options8) !== commentIndex) {
18871 followingNode = null;
18872 }
18873 }
18874 return { enclosingNode, precedingNode, followingNode };
18875}
18876var returnFalse = () => false;
18877function attachComments(ast, options8) {
18878 const { comments } = ast;
18879 delete ast.comments;
18880 if (!is_non_empty_array_default(comments) || !options8.printer.canAttachComment) {
18881 return;
18882 }
18883 const tiesToBreak = [];
18884 const {
18885 locStart,
18886 locEnd,
18887 printer: {
18888 experimentalFeatures: {
18889 // TODO: Make this as default behavior
18890 avoidAstMutation = false
18891 } = {},
18892 handleComments = {}
18893 },
18894 originalText: text
18895 } = options8;
18896 const {
18897 ownLine: handleOwnLineComment = returnFalse,
18898 endOfLine: handleEndOfLineComment = returnFalse,
18899 remaining: handleRemainingComment = returnFalse
18900 } = handleComments;
18901 const decoratedComments = comments.map((comment, index) => ({
18902 ...decorateComment(ast, comment, options8),
18903 comment,
18904 text,
18905 options: options8,
18906 ast,
18907 isLastComment: comments.length - 1 === index
18908 }));
18909 for (const [index, context] of decoratedComments.entries()) {
18910 const {
18911 comment,
18912 precedingNode,
18913 enclosingNode,
18914 followingNode,
18915 text: text2,
18916 options: options9,
18917 ast: ast2,
18918 isLastComment
18919 } = context;
18920 if (options9.parser === "json" || options9.parser === "json5" || options9.parser === "jsonc" || options9.parser === "__js_expression" || options9.parser === "__ts_expression" || options9.parser === "__vue_expression" || options9.parser === "__vue_ts_expression") {
18921 if (locStart(comment) - locStart(ast2) <= 0) {
18922 addLeadingComment(ast2, comment);
18923 continue;
18924 }
18925 if (locEnd(comment) - locEnd(ast2) >= 0) {
18926 addTrailingComment(ast2, comment);
18927 continue;
18928 }
18929 }
18930 let args;
18931 if (avoidAstMutation) {
18932 args = [context];
18933 } else {
18934 comment.enclosingNode = enclosingNode;
18935 comment.precedingNode = precedingNode;
18936 comment.followingNode = followingNode;
18937 args = [comment, text2, options9, ast2, isLastComment];
18938 }
18939 if (isOwnLineComment(text2, options9, decoratedComments, index)) {
18940 comment.placement = "ownLine";
18941 if (handleOwnLineComment(...args)) {
18942 } else if (followingNode) {
18943 addLeadingComment(followingNode, comment);
18944 } else if (precedingNode) {
18945 addTrailingComment(precedingNode, comment);
18946 } else if (enclosingNode) {
18947 addDanglingComment(enclosingNode, comment);
18948 } else {
18949 addDanglingComment(ast2, comment);
18950 }
18951 } else if (isEndOfLineComment(text2, options9, decoratedComments, index)) {
18952 comment.placement = "endOfLine";
18953 if (handleEndOfLineComment(...args)) {
18954 } else if (precedingNode) {
18955 addTrailingComment(precedingNode, comment);
18956 } else if (followingNode) {
18957 addLeadingComment(followingNode, comment);
18958 } else if (enclosingNode) {
18959 addDanglingComment(enclosingNode, comment);
18960 } else {
18961 addDanglingComment(ast2, comment);
18962 }
18963 } else {
18964 comment.placement = "remaining";
18965 if (handleRemainingComment(...args)) {
18966 } else if (precedingNode && followingNode) {
18967 const tieCount = tiesToBreak.length;
18968 if (tieCount > 0) {
18969 const lastTie = tiesToBreak[tieCount - 1];
18970 if (lastTie.followingNode !== followingNode) {
18971 breakTies(tiesToBreak, options9);
18972 }
18973 }
18974 tiesToBreak.push(context);
18975 } else if (precedingNode) {
18976 addTrailingComment(precedingNode, comment);
18977 } else if (followingNode) {
18978 addLeadingComment(followingNode, comment);
18979 } else if (enclosingNode) {
18980 addDanglingComment(enclosingNode, comment);
18981 } else {
18982 addDanglingComment(ast2, comment);
18983 }
18984 }
18985 }
18986 breakTies(tiesToBreak, options8);
18987 if (!avoidAstMutation) {
18988 for (const comment of comments) {
18989 delete comment.precedingNode;
18990 delete comment.enclosingNode;
18991 delete comment.followingNode;
18992 }
18993 }
18994}
18995var isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]/u.test(text);
18996function isOwnLineComment(text, options8, decoratedComments, commentIndex) {
18997 const { comment, precedingNode } = decoratedComments[commentIndex];
18998 const { locStart, locEnd } = options8;
18999 let start = locStart(comment);
19000 if (precedingNode) {
19001 for (let index = commentIndex - 1; index >= 0; index--) {
19002 const { comment: comment2, precedingNode: currentCommentPrecedingNode } = decoratedComments[index];
19003 if (currentCommentPrecedingNode !== precedingNode || !isAllEmptyAndNoLineBreak(text.slice(locEnd(comment2), start))) {
19004 break;
19005 }
19006 start = locStart(comment2);
19007 }
19008 }
19009 return has_newline_default(text, start, { backwards: true });
19010}
19011function isEndOfLineComment(text, options8, decoratedComments, commentIndex) {
19012 const { comment, followingNode } = decoratedComments[commentIndex];
19013 const { locStart, locEnd } = options8;
19014 let end = locEnd(comment);
19015 if (followingNode) {
19016 for (let index = commentIndex + 1; index < decoratedComments.length; index++) {
19017 const { comment: comment2, followingNode: currentCommentFollowingNode } = decoratedComments[index];
19018 if (currentCommentFollowingNode !== followingNode || !isAllEmptyAndNoLineBreak(text.slice(end, locStart(comment2)))) {
19019 break;
19020 }
19021 end = locEnd(comment2);
19022 }
19023 }
19024 return has_newline_default(text, end);
19025}
19026function breakTies(tiesToBreak, options8) {
19027 var _a, _b;
19028 const tieCount = tiesToBreak.length;
19029 if (tieCount === 0) {
19030 return;
19031 }
19032 const { precedingNode, followingNode } = tiesToBreak[0];
19033 let gapEndPos = options8.locStart(followingNode);
19034 let indexOfFirstLeadingComment;
19035 for (indexOfFirstLeadingComment = tieCount; indexOfFirstLeadingComment > 0; --indexOfFirstLeadingComment) {
19036 const {
19037 comment,
19038 precedingNode: currentCommentPrecedingNode,
19039 followingNode: currentCommentFollowingNode
19040 } = tiesToBreak[indexOfFirstLeadingComment - 1];
19041 assert4.strictEqual(currentCommentPrecedingNode, precedingNode);
19042 assert4.strictEqual(currentCommentFollowingNode, followingNode);
19043 const gap = options8.originalText.slice(options8.locEnd(comment), gapEndPos);
19044 if (((_b = (_a = options8.printer).isGap) == null ? void 0 : _b.call(_a, gap, options8)) ?? /^[\s(]*$/u.test(gap)) {
19045 gapEndPos = options8.locStart(comment);
19046 } else {
19047 break;
19048 }
19049 }
19050 for (const [i, { comment }] of tiesToBreak.entries()) {
19051 if (i < indexOfFirstLeadingComment) {
19052 addTrailingComment(precedingNode, comment);
19053 } else {
19054 addLeadingComment(followingNode, comment);
19055 }
19056 }
19057 for (const node of [precedingNode, followingNode]) {
19058 if (node.comments && node.comments.length > 1) {
19059 node.comments.sort((a, b) => options8.locStart(a) - options8.locStart(b));
19060 }
19061 }
19062 tiesToBreak.length = 0;
19063}
19064function findExpressionIndexForComment(quasis, comment, options8) {
19065 const startPos = options8.locStart(comment) - 1;
19066 for (let i = 1; i < quasis.length; ++i) {
19067 if (startPos < options8.locStart(quasis[i])) {
19068 return i - 1;
19069 }
19070 }
19071 return 0;
19072}
19073
19074// src/utils/is-previous-line-empty.js
19075function isPreviousLineEmpty(text, startIndex) {
19076 let idx = startIndex - 1;
19077 idx = skipSpaces(text, idx, { backwards: true });
19078 idx = skip_newline_default(text, idx, { backwards: true });
19079 idx = skipSpaces(text, idx, { backwards: true });
19080 const idx2 = skip_newline_default(text, idx, { backwards: true });
19081 return idx !== idx2;
19082}
19083var is_previous_line_empty_default = isPreviousLineEmpty;
19084
19085// src/main/comments/print.js
19086function printComment(path13, options8) {
19087 const comment = path13.node;
19088 comment.printed = true;
19089 return options8.printer.printComment(path13, options8);
19090}
19091function printLeadingComment(path13, options8) {
19092 var _a;
19093 const comment = path13.node;
19094 const parts = [printComment(path13, options8)];
19095 const { printer, originalText, locStart, locEnd } = options8;
19096 const isBlock = (_a = printer.isBlockComment) == null ? void 0 : _a.call(printer, comment);
19097 if (isBlock) {
19098 const lineBreak = has_newline_default(originalText, locEnd(comment)) ? has_newline_default(originalText, locStart(comment), {
19099 backwards: true
19100 }) ? hardline : line2 : " ";
19101 parts.push(lineBreak);
19102 } else {
19103 parts.push(hardline);
19104 }
19105 const index = skip_newline_default(
19106 originalText,
19107 skipSpaces(originalText, locEnd(comment))
19108 );
19109 if (index !== false && has_newline_default(originalText, index)) {
19110 parts.push(hardline);
19111 }
19112 return parts;
19113}
19114function printTrailingComment(path13, options8, previousComment) {
19115 var _a;
19116 const comment = path13.node;
19117 const printed = printComment(path13, options8);
19118 const { printer, originalText, locStart } = options8;
19119 const isBlock = (_a = printer.isBlockComment) == null ? void 0 : _a.call(printer, comment);
19120 if ((previousComment == null ? void 0 : previousComment.hasLineSuffix) && !(previousComment == null ? void 0 : previousComment.isBlock) || has_newline_default(originalText, locStart(comment), { backwards: true })) {
19121 const isLineBeforeEmpty = is_previous_line_empty_default(
19122 originalText,
19123 locStart(comment)
19124 );
19125 return {
19126 doc: lineSuffix([hardline, isLineBeforeEmpty ? hardline : "", printed]),
19127 isBlock,
19128 hasLineSuffix: true
19129 };
19130 }
19131 if (!isBlock || (previousComment == null ? void 0 : previousComment.hasLineSuffix)) {
19132 return {
19133 doc: [lineSuffix([" ", printed]), breakParent],
19134 isBlock,
19135 hasLineSuffix: true
19136 };
19137 }
19138 return { doc: [" ", printed], isBlock, hasLineSuffix: false };
19139}
19140function printCommentsSeparately(path13, options8) {
19141 const value = path13.node;
19142 if (!value) {
19143 return {};
19144 }
19145 const ignored = options8[Symbol.for("printedComments")];
19146 const comments = (value.comments || []).filter(
19147 (comment) => !ignored.has(comment)
19148 );
19149 if (comments.length === 0) {
19150 return { leading: "", trailing: "" };
19151 }
19152 const leadingParts = [];
19153 const trailingParts = [];
19154 let printedTrailingComment;
19155 path13.each(() => {
19156 const comment = path13.node;
19157 if (ignored == null ? void 0 : ignored.has(comment)) {
19158 return;
19159 }
19160 const { leading, trailing } = comment;
19161 if (leading) {
19162 leadingParts.push(printLeadingComment(path13, options8));
19163 } else if (trailing) {
19164 printedTrailingComment = printTrailingComment(
19165 path13,
19166 options8,
19167 printedTrailingComment
19168 );
19169 trailingParts.push(printedTrailingComment.doc);
19170 }
19171 }, "comments");
19172 return { leading: leadingParts, trailing: trailingParts };
19173}
19174function printComments(path13, doc2, options8) {
19175 const { leading, trailing } = printCommentsSeparately(path13, options8);
19176 if (!leading && !trailing) {
19177 return doc2;
19178 }
19179 return inheritLabel(doc2, (doc3) => [leading, doc3, trailing]);
19180}
19181function ensureAllCommentsPrinted(options8) {
19182 const {
19183 [Symbol.for("comments")]: comments,
19184 [Symbol.for("printedComments")]: printedComments
19185 } = options8;
19186 for (const comment of comments) {
19187 if (!comment.printed && !printedComments.has(comment)) {
19188 throw new Error(
19189 'Comment "' + comment.value.trim() + '" was not printed. Please report this error!'
19190 );
19191 }
19192 delete comment.printed;
19193 }
19194}
19195
19196// src/main/create-print-pre-check-function.js
19197function createPrintPreCheckFunction(options8) {
19198 if (true) {
19199 return () => {
19200 };
19201 }
19202 const getVisitorKeys = create_get_visitor_keys_function_default(
19203 options8.printer.getVisitorKeys
19204 );
19205 return function(path13) {
19206 if (path13.isRoot) {
19207 return;
19208 }
19209 const { key: key2, parent } = path13;
19210 const visitorKeys = getVisitorKeys(parent);
19211 if (visitorKeys.includes(key2)) {
19212 return;
19213 }
19214 throw Object.assign(new Error("Calling `print()` on non-node object."), {
19215 parentNode: parent,
19216 allowedProperties: visitorKeys,
19217 printingProperty: key2,
19218 printingValue: path13.node,
19219 pathStack: path13.stack.length > 5 ? ["...", ...path13.stack.slice(-5)] : [...path13.stack]
19220 });
19221 };
19222}
19223var create_print_pre_check_function_default = createPrintPreCheckFunction;
19224
19225// src/main/core-options.evaluate.js
19226var core_options_evaluate_default = {
19227 "cursorOffset": {
19228 "category": "Special",
19229 "type": "int",
19230 "default": -1,
19231 "range": {
19232 "start": -1,
19233 "end": Infinity,
19234 "step": 1
19235 },
19236 "description": "Print (to stderr) where a cursor at the given position would move to after formatting.",
19237 "cliCategory": "Editor"
19238 },
19239 "endOfLine": {
19240 "category": "Global",
19241 "type": "choice",
19242 "default": "lf",
19243 "description": "Which end of line characters to apply.",
19244 "choices": [
19245 {
19246 "value": "lf",
19247 "description": "Line Feed only (\\n), common on Linux and macOS as well as inside git repos"
19248 },
19249 {
19250 "value": "crlf",
19251 "description": "Carriage Return + Line Feed characters (\\r\\n), common on Windows"
19252 },
19253 {
19254 "value": "cr",
19255 "description": "Carriage Return character only (\\r), used very rarely"
19256 },
19257 {
19258 "value": "auto",
19259 "description": "Maintain existing\n(mixed values within one file are normalised by looking at what's used after the first line)"
19260 }
19261 ]
19262 },
19263 "filepath": {
19264 "category": "Special",
19265 "type": "path",
19266 "description": "Specify the input filepath. This will be used to do parser inference.",
19267 "cliName": "stdin-filepath",
19268 "cliCategory": "Other",
19269 "cliDescription": "Path to the file to pretend that stdin comes from."
19270 },
19271 "insertPragma": {
19272 "category": "Special",
19273 "type": "boolean",
19274 "default": false,
19275 "description": "Insert @format pragma into file's first docblock comment.",
19276 "cliCategory": "Other"
19277 },
19278 "parser": {
19279 "category": "Global",
19280 "type": "choice",
19281 "default": void 0,
19282 "description": "Which parser to use.",
19283 "exception": (value) => typeof value === "string" || typeof value === "function",
19284 "choices": [
19285 {
19286 "value": "flow",
19287 "description": "Flow"
19288 },
19289 {
19290 "value": "babel",
19291 "description": "JavaScript"
19292 },
19293 {
19294 "value": "babel-flow",
19295 "description": "Flow"
19296 },
19297 {
19298 "value": "babel-ts",
19299 "description": "TypeScript"
19300 },
19301 {
19302 "value": "typescript",
19303 "description": "TypeScript"
19304 },
19305 {
19306 "value": "acorn",
19307 "description": "JavaScript"
19308 },
19309 {
19310 "value": "espree",
19311 "description": "JavaScript"
19312 },
19313 {
19314 "value": "meriyah",
19315 "description": "JavaScript"
19316 },
19317 {
19318 "value": "css",
19319 "description": "CSS"
19320 },
19321 {
19322 "value": "less",
19323 "description": "Less"
19324 },
19325 {
19326 "value": "scss",
19327 "description": "SCSS"
19328 },
19329 {
19330 "value": "json",
19331 "description": "JSON"
19332 },
19333 {
19334 "value": "json5",
19335 "description": "JSON5"
19336 },
19337 {
19338 "value": "jsonc",
19339 "description": "JSON with Comments"
19340 },
19341 {
19342 "value": "json-stringify",
19343 "description": "JSON.stringify"
19344 },
19345 {
19346 "value": "graphql",
19347 "description": "GraphQL"
19348 },
19349 {
19350 "value": "markdown",
19351 "description": "Markdown"
19352 },
19353 {
19354 "value": "mdx",
19355 "description": "MDX"
19356 },
19357 {
19358 "value": "vue",
19359 "description": "Vue"
19360 },
19361 {
19362 "value": "yaml",
19363 "description": "YAML"
19364 },
19365 {
19366 "value": "glimmer",
19367 "description": "Ember / Handlebars"
19368 },
19369 {
19370 "value": "html",
19371 "description": "HTML"
19372 },
19373 {
19374 "value": "angular",
19375 "description": "Angular"
19376 },
19377 {
19378 "value": "lwc",
19379 "description": "Lightning Web Components"
19380 }
19381 ]
19382 },
19383 "plugins": {
19384 "type": "path",
19385 "array": true,
19386 "default": [
19387 {
19388 "value": []
19389 }
19390 ],
19391 "category": "Global",
19392 "description": "Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",
19393 "exception": (value) => typeof value === "string" || typeof value === "object",
19394 "cliName": "plugin",
19395 "cliCategory": "Config"
19396 },
19397 "printWidth": {
19398 "category": "Global",
19399 "type": "int",
19400 "default": 80,
19401 "description": "The line length where Prettier will try wrap.",
19402 "range": {
19403 "start": 0,
19404 "end": Infinity,
19405 "step": 1
19406 }
19407 },
19408 "rangeEnd": {
19409 "category": "Special",
19410 "type": "int",
19411 "default": Infinity,
19412 "range": {
19413 "start": 0,
19414 "end": Infinity,
19415 "step": 1
19416 },
19417 "description": "Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",
19418 "cliCategory": "Editor"
19419 },
19420 "rangeStart": {
19421 "category": "Special",
19422 "type": "int",
19423 "default": 0,
19424 "range": {
19425 "start": 0,
19426 "end": Infinity,
19427 "step": 1
19428 },
19429 "description": "Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",
19430 "cliCategory": "Editor"
19431 },
19432 "requirePragma": {
19433 "category": "Special",
19434 "type": "boolean",
19435 "default": false,
19436 "description": "Require either '@prettier' or '@format' to be present in the file's first docblock comment\nin order for it to be formatted.",
19437 "cliCategory": "Other"
19438 },
19439 "tabWidth": {
19440 "type": "int",
19441 "category": "Global",
19442 "default": 2,
19443 "description": "Number of spaces per indentation level.",
19444 "range": {
19445 "start": 0,
19446 "end": Infinity,
19447 "step": 1
19448 }
19449 },
19450 "useTabs": {
19451 "category": "Global",
19452 "type": "boolean",
19453 "default": false,
19454 "description": "Indent with tabs instead of spaces."
19455 },
19456 "embeddedLanguageFormatting": {
19457 "category": "Global",
19458 "type": "choice",
19459 "default": "auto",
19460 "description": "Control how Prettier formats quoted code embedded in the file.",
19461 "choices": [
19462 {
19463 "value": "auto",
19464 "description": "Format embedded code if Prettier can automatically identify it."
19465 },
19466 {
19467 "value": "off",
19468 "description": "Never automatically format embedded code."
19469 }
19470 ]
19471 }
19472};
19473
19474// src/main/support.js
19475function getSupportInfo({ plugins = [], showDeprecated = false } = {}) {
19476 const languages2 = plugins.flatMap((plugin) => plugin.languages ?? []);
19477 const options8 = [];
19478 for (const option of normalizeOptionSettings(
19479 Object.assign({}, ...plugins.map(({ options: options9 }) => options9), core_options_evaluate_default)
19480 )) {
19481 if (!showDeprecated && option.deprecated) {
19482 continue;
19483 }
19484 if (Array.isArray(option.choices)) {
19485 if (!showDeprecated) {
19486 option.choices = option.choices.filter((choice) => !choice.deprecated);
19487 }
19488 if (option.name === "parser") {
19489 option.choices = [
19490 ...option.choices,
19491 ...collectParsersFromLanguages(option.choices, languages2, plugins)
19492 ];
19493 }
19494 }
19495 option.pluginDefaults = Object.fromEntries(
19496 plugins.filter((plugin) => {
19497 var _a;
19498 return ((_a = plugin.defaultOptions) == null ? void 0 : _a[option.name]) !== void 0;
19499 }).map((plugin) => [plugin.name, plugin.defaultOptions[option.name]])
19500 );
19501 options8.push(option);
19502 }
19503 return { languages: languages2, options: options8 };
19504}
19505function* collectParsersFromLanguages(parserChoices, languages2, plugins) {
19506 const existingParsers = new Set(parserChoices.map((choice) => choice.value));
19507 for (const language of languages2) {
19508 if (language.parsers) {
19509 for (const parserName of language.parsers) {
19510 if (!existingParsers.has(parserName)) {
19511 existingParsers.add(parserName);
19512 const plugin = plugins.find(
19513 (plugin2) => plugin2.parsers && Object.prototype.hasOwnProperty.call(plugin2.parsers, parserName)
19514 );
19515 let description = language.name;
19516 if (plugin == null ? void 0 : plugin.name) {
19517 description += ` (plugin: ${plugin.name})`;
19518 }
19519 yield { value: parserName, description };
19520 }
19521 }
19522 }
19523 }
19524}
19525function normalizeOptionSettings(settings) {
19526 const options8 = [];
19527 for (const [name, originalOption] of Object.entries(settings)) {
19528 const option = { name, ...originalOption };
19529 if (Array.isArray(option.default)) {
19530 option.default = at_default(
19531 /* isOptionalObject */
19532 false,
19533 option.default,
19534 -1
19535 ).value;
19536 }
19537 options8.push(option);
19538 }
19539 return options8;
19540}
19541
19542// src/main/normalize-options.js
19543var hasDeprecationWarned;
19544function normalizeOptions(options8, optionInfos, {
19545 logger = false,
19546 isCLI = false,
19547 passThrough = false,
19548 FlagSchema,
19549 descriptor
19550} = {}) {
19551 if (isCLI) {
19552 if (!FlagSchema) {
19553 throw new Error("'FlagSchema' option is required.");
19554 }
19555 if (!descriptor) {
19556 throw new Error("'descriptor' option is required.");
19557 }
19558 } else {
19559 descriptor = apiDescriptor;
19560 }
19561 const unknown = !passThrough ? (key2, value, options9) => {
19562 const { _, ...schemas2 } = options9.schemas;
19563 return levenUnknownHandler(key2, value, {
19564 ...options9,
19565 schemas: schemas2
19566 });
19567 } : Array.isArray(passThrough) ? (key2, value) => !passThrough.includes(key2) ? void 0 : { [key2]: value } : (key2, value) => ({ [key2]: value });
19568 const schemas = optionInfosToSchemas(optionInfos, { isCLI, FlagSchema });
19569 const normalizer = new Normalizer(schemas, {
19570 logger,
19571 unknown,
19572 descriptor
19573 });
19574 const shouldSuppressDuplicateDeprecationWarnings = logger !== false;
19575 if (shouldSuppressDuplicateDeprecationWarnings && hasDeprecationWarned) {
19576 normalizer._hasDeprecationWarned = hasDeprecationWarned;
19577 }
19578 const normalized = normalizer.normalize(options8);
19579 if (shouldSuppressDuplicateDeprecationWarnings) {
19580 hasDeprecationWarned = normalizer._hasDeprecationWarned;
19581 }
19582 return normalized;
19583}
19584function optionInfosToSchemas(optionInfos, { isCLI, FlagSchema }) {
19585 const schemas = [];
19586 if (isCLI) {
19587 schemas.push(AnySchema.create({ name: "_" }));
19588 }
19589 for (const optionInfo of optionInfos) {
19590 schemas.push(
19591 optionInfoToSchema(optionInfo, {
19592 isCLI,
19593 optionInfos,
19594 FlagSchema
19595 })
19596 );
19597 if (optionInfo.alias && isCLI) {
19598 schemas.push(
19599 AliasSchema.create({
19600 // @ts-expect-error
19601 name: optionInfo.alias,
19602 sourceName: optionInfo.name
19603 })
19604 );
19605 }
19606 }
19607 return schemas;
19608}
19609function optionInfoToSchema(optionInfo, { isCLI, optionInfos, FlagSchema }) {
19610 const { name } = optionInfo;
19611 const parameters = { name };
19612 let SchemaConstructor;
19613 const handlers = {};
19614 switch (optionInfo.type) {
19615 case "int":
19616 SchemaConstructor = IntegerSchema;
19617 if (isCLI) {
19618 parameters.preprocess = Number;
19619 }
19620 break;
19621 case "string":
19622 SchemaConstructor = StringSchema;
19623 break;
19624 case "choice":
19625 SchemaConstructor = ChoiceSchema;
19626 parameters.choices = optionInfo.choices.map(
19627 (choiceInfo) => (choiceInfo == null ? void 0 : choiceInfo.redirect) ? {
19628 ...choiceInfo,
19629 redirect: {
19630 to: { key: optionInfo.name, value: choiceInfo.redirect }
19631 }
19632 } : choiceInfo
19633 );
19634 break;
19635 case "boolean":
19636 SchemaConstructor = BooleanSchema;
19637 break;
19638 case "flag":
19639 SchemaConstructor = FlagSchema;
19640 parameters.flags = optionInfos.flatMap(
19641 (optionInfo2) => [
19642 optionInfo2.alias,
19643 optionInfo2.description && optionInfo2.name,
19644 optionInfo2.oppositeDescription && `no-${optionInfo2.name}`
19645 ].filter(Boolean)
19646 );
19647 break;
19648 case "path":
19649 SchemaConstructor = StringSchema;
19650 break;
19651 default:
19652 throw new Error(`Unexpected type ${optionInfo.type}`);
19653 }
19654 if (optionInfo.exception) {
19655 parameters.validate = (value, schema2, utils) => optionInfo.exception(value) || schema2.validate(value, utils);
19656 } else {
19657 parameters.validate = (value, schema2, utils) => value === void 0 || schema2.validate(value, utils);
19658 }
19659 if (optionInfo.redirect) {
19660 handlers.redirect = (value) => !value ? void 0 : {
19661 to: typeof optionInfo.redirect === "string" ? optionInfo.redirect : {
19662 key: optionInfo.redirect.option,
19663 value: optionInfo.redirect.value
19664 }
19665 };
19666 }
19667 if (optionInfo.deprecated) {
19668 handlers.deprecated = true;
19669 }
19670 if (isCLI && !optionInfo.array) {
19671 const originalPreprocess = parameters.preprocess || ((x) => x);
19672 parameters.preprocess = (value, schema2, utils) => schema2.preprocess(
19673 originalPreprocess(Array.isArray(value) ? at_default(
19674 /* isOptionalObject */
19675 false,
19676 value,
19677 -1
19678 ) : value),
19679 utils
19680 );
19681 }
19682 return optionInfo.array ? ArraySchema.create({
19683 ...isCLI ? { preprocess: (v) => Array.isArray(v) ? v : [v] } : {},
19684 ...handlers,
19685 // @ts-expect-error
19686 valueSchema: SchemaConstructor.create(parameters)
19687 }) : SchemaConstructor.create({ ...parameters, ...handlers });
19688}
19689var normalize_options_default = normalizeOptions;
19690
19691// scripts/build/shims/array-find-last.js
19692var arrayFindLast = (isOptionalObject, array2, callback) => {
19693 if (isOptionalObject && (array2 === void 0 || array2 === null)) {
19694 return;
19695 }
19696 if (array2.findLast) {
19697 return array2.findLast(callback);
19698 }
19699 for (let index = array2.length - 1; index >= 0; index--) {
19700 const element = array2[index];
19701 if (callback(element, index, array2)) {
19702 return element;
19703 }
19704 }
19705};
19706var array_find_last_default = arrayFindLast;
19707
19708// src/main/parser-and-printer.js
19709function getParserPluginByParserName(plugins, parserName) {
19710 if (!parserName) {
19711 throw new Error("parserName is required.");
19712 }
19713 const plugin = array_find_last_default(
19714 /* isOptionalObject */
19715 false,
19716 plugins,
19717 (plugin2) => plugin2.parsers && Object.prototype.hasOwnProperty.call(plugin2.parsers, parserName)
19718 );
19719 if (plugin) {
19720 return plugin;
19721 }
19722 let message = `Couldn't resolve parser "${parserName}".`;
19723 if (false) {
19724 message += " Plugins must be explicitly added to the standalone bundle.";
19725 }
19726 throw new ConfigError(message);
19727}
19728function getPrinterPluginByAstFormat(plugins, astFormat) {
19729 if (!astFormat) {
19730 throw new Error("astFormat is required.");
19731 }
19732 const plugin = array_find_last_default(
19733 /* isOptionalObject */
19734 false,
19735 plugins,
19736 (plugin2) => plugin2.printers && Object.prototype.hasOwnProperty.call(plugin2.printers, astFormat)
19737 );
19738 if (plugin) {
19739 return plugin;
19740 }
19741 let message = `Couldn't find plugin for AST format "${astFormat}".`;
19742 if (false) {
19743 message += " Plugins must be explicitly added to the standalone bundle.";
19744 }
19745 throw new ConfigError(message);
19746}
19747function resolveParser({ plugins, parser }) {
19748 const plugin = getParserPluginByParserName(plugins, parser);
19749 return initParser(plugin, parser);
19750}
19751function initParser(plugin, parserName) {
19752 const parserOrParserInitFunction = plugin.parsers[parserName];
19753 return typeof parserOrParserInitFunction === "function" ? parserOrParserInitFunction() : parserOrParserInitFunction;
19754}
19755function initPrinter(plugin, astFormat) {
19756 const printerOrPrinterInitFunction = plugin.printers[astFormat];
19757 return typeof printerOrPrinterInitFunction === "function" ? printerOrPrinterInitFunction() : printerOrPrinterInitFunction;
19758}
19759
19760// src/main/normalize-format-options.js
19761var formatOptionsHiddenDefaults = {
19762 astFormat: "estree",
19763 printer: {},
19764 originalText: void 0,
19765 locStart: null,
19766 locEnd: null
19767};
19768async function normalizeFormatOptions(options8, opts = {}) {
19769 var _a;
19770 const rawOptions = { ...options8 };
19771 if (!rawOptions.parser) {
19772 if (!rawOptions.filepath) {
19773 throw new UndefinedParserError(
19774 "No parser and no file path given, couldn't infer a parser."
19775 );
19776 } else {
19777 rawOptions.parser = infer_parser_default(rawOptions, {
19778 physicalFile: rawOptions.filepath
19779 });
19780 if (!rawOptions.parser) {
19781 throw new UndefinedParserError(
19782 `No parser could be inferred for file "${rawOptions.filepath}".`
19783 );
19784 }
19785 }
19786 }
19787 const supportOptions = getSupportInfo({
19788 plugins: options8.plugins,
19789 showDeprecated: true
19790 }).options;
19791 const defaults = {
19792 ...formatOptionsHiddenDefaults,
19793 ...Object.fromEntries(
19794 supportOptions.filter((optionInfo) => optionInfo.default !== void 0).map((option) => [option.name, option.default])
19795 )
19796 };
19797 const parserPlugin = getParserPluginByParserName(
19798 rawOptions.plugins,
19799 rawOptions.parser
19800 );
19801 const parser = await initParser(parserPlugin, rawOptions.parser);
19802 rawOptions.astFormat = parser.astFormat;
19803 rawOptions.locEnd = parser.locEnd;
19804 rawOptions.locStart = parser.locStart;
19805 const printerPlugin = ((_a = parserPlugin.printers) == null ? void 0 : _a[parser.astFormat]) ? parserPlugin : getPrinterPluginByAstFormat(rawOptions.plugins, parser.astFormat);
19806 const printer = await initPrinter(printerPlugin, parser.astFormat);
19807 rawOptions.printer = printer;
19808 const pluginDefaults = printerPlugin.defaultOptions ? Object.fromEntries(
19809 Object.entries(printerPlugin.defaultOptions).filter(
19810 ([, value]) => value !== void 0
19811 )
19812 ) : {};
19813 const mixedDefaults = { ...defaults, ...pluginDefaults };
19814 for (const [k, value] of Object.entries(mixedDefaults)) {
19815 if (rawOptions[k] === null || rawOptions[k] === void 0) {
19816 rawOptions[k] = value;
19817 }
19818 }
19819 if (rawOptions.parser === "json") {
19820 rawOptions.trailingComma = "none";
19821 }
19822 return normalize_options_default(rawOptions, supportOptions, {
19823 passThrough: Object.keys(formatOptionsHiddenDefaults),
19824 ...opts
19825 });
19826}
19827var normalize_format_options_default = normalizeFormatOptions;
19828
19829// src/main/parse.js
19830var import_code_frame2 = __toESM(require_lib2(), 1);
19831async function parse5(originalText, options8) {
19832 const parser = await resolveParser(options8);
19833 const text = parser.preprocess ? parser.preprocess(originalText, options8) : originalText;
19834 options8.originalText = text;
19835 let ast;
19836 try {
19837 ast = await parser.parse(
19838 text,
19839 options8,
19840 // TODO: remove the third argument in v4
19841 // The duplicated argument is passed as intended, see #10156
19842 options8
19843 );
19844 } catch (error) {
19845 handleParseError(error, originalText);
19846 }
19847 return { text, ast };
19848}
19849function handleParseError(error, text) {
19850 const { loc } = error;
19851 if (loc) {
19852 const codeFrame = (0, import_code_frame2.codeFrameColumns)(text, loc, { highlightCode: true });
19853 error.message += "\n" + codeFrame;
19854 error.codeFrame = codeFrame;
19855 throw error;
19856 }
19857 throw error;
19858}
19859var parse_default = parse5;
19860
19861// src/main/multiparser.js
19862async function printEmbeddedLanguages(path13, genericPrint, options8, printAstToDoc2, embeds) {
19863 const {
19864 embeddedLanguageFormatting,
19865 printer: {
19866 embed,
19867 hasPrettierIgnore = () => false,
19868 getVisitorKeys: printerGetVisitorKeys
19869 }
19870 } = options8;
19871 if (!embed || embeddedLanguageFormatting !== "auto") {
19872 return;
19873 }
19874 if (embed.length > 2) {
19875 throw new Error(
19876 "printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/en/plugins.html#optional-embed"
19877 );
19878 }
19879 const getVisitorKeys = create_get_visitor_keys_function_default(
19880 embed.getVisitorKeys ?? printerGetVisitorKeys
19881 );
19882 const embedCallResults = [];
19883 recurse();
19884 const originalPathStack = path13.stack;
19885 for (const { print, node, pathStack } of embedCallResults) {
19886 try {
19887 path13.stack = pathStack;
19888 const doc2 = await print(textToDocForEmbed, genericPrint, path13, options8);
19889 if (doc2) {
19890 embeds.set(node, doc2);
19891 }
19892 } catch (error) {
19893 if (process.env.PRETTIER_DEBUG) {
19894 throw error;
19895 }
19896 }
19897 }
19898 path13.stack = originalPathStack;
19899 function textToDocForEmbed(text, partialNextOptions) {
19900 return textToDoc(text, partialNextOptions, options8, printAstToDoc2);
19901 }
19902 function recurse() {
19903 const { node } = path13;
19904 if (node === null || typeof node !== "object" || hasPrettierIgnore(path13)) {
19905 return;
19906 }
19907 for (const key2 of getVisitorKeys(node)) {
19908 if (Array.isArray(node[key2])) {
19909 path13.each(recurse, key2);
19910 } else {
19911 path13.call(recurse, key2);
19912 }
19913 }
19914 const result = embed(path13, options8);
19915 if (!result) {
19916 return;
19917 }
19918 if (typeof result === "function") {
19919 embedCallResults.push({
19920 print: result,
19921 node,
19922 pathStack: [...path13.stack]
19923 });
19924 return;
19925 }
19926 if (false) {
19927 throw new Error(
19928 "`embed` should return an async function instead of Promise."
19929 );
19930 }
19931 embeds.set(node, result);
19932 }
19933}
19934async function textToDoc(text, partialNextOptions, parentOptions, printAstToDoc2) {
19935 const options8 = await normalize_format_options_default(
19936 {
19937 ...parentOptions,
19938 ...partialNextOptions,
19939 parentParser: parentOptions.parser,
19940 originalText: text
19941 },
19942 { passThrough: true }
19943 );
19944 const { ast } = await parse_default(text, options8);
19945 const doc2 = await printAstToDoc2(ast, options8);
19946 return stripTrailingHardline(doc2);
19947}
19948
19949// src/main/print-ignored.js
19950function printIgnored(path13, options8) {
19951 const {
19952 originalText,
19953 [Symbol.for("comments")]: comments,
19954 locStart,
19955 locEnd,
19956 [Symbol.for("printedComments")]: printedComments
19957 } = options8;
19958 const { node } = path13;
19959 const start = locStart(node);
19960 const end = locEnd(node);
19961 for (const comment of comments) {
19962 if (locStart(comment) >= start && locEnd(comment) <= end) {
19963 printedComments.add(comment);
19964 }
19965 }
19966 return originalText.slice(start, end);
19967}
19968var print_ignored_default = printIgnored;
19969
19970// src/main/ast-to-doc.js
19971async function printAstToDoc(ast, options8) {
19972 ({ ast } = await prepareToPrint(ast, options8));
19973 const cache3 = /* @__PURE__ */ new Map();
19974 const path13 = new ast_path_default(ast);
19975 const ensurePrintingNode = create_print_pre_check_function_default(options8);
19976 const embeds = /* @__PURE__ */ new Map();
19977 await printEmbeddedLanguages(path13, mainPrint, options8, printAstToDoc, embeds);
19978 const doc2 = await callPluginPrintFunction(
19979 path13,
19980 options8,
19981 mainPrint,
19982 void 0,
19983 embeds
19984 );
19985 ensureAllCommentsPrinted(options8);
19986 if (options8.nodeAfterCursor && !options8.nodeBeforeCursor) {
19987 return [cursor, doc2];
19988 }
19989 if (options8.nodeBeforeCursor && !options8.nodeAfterCursor) {
19990 return [doc2, cursor];
19991 }
19992 return doc2;
19993 function mainPrint(selector, args) {
19994 if (selector === void 0 || selector === path13) {
19995 return mainPrintInternal(args);
19996 }
19997 if (Array.isArray(selector)) {
19998 return path13.call(() => mainPrintInternal(args), ...selector);
19999 }
20000 return path13.call(() => mainPrintInternal(args), selector);
20001 }
20002 function mainPrintInternal(args) {
20003 ensurePrintingNode(path13);
20004 const value = path13.node;
20005 if (value === void 0 || value === null) {
20006 return "";
20007 }
20008 const shouldCache = value && typeof value === "object" && args === void 0;
20009 if (shouldCache && cache3.has(value)) {
20010 return cache3.get(value);
20011 }
20012 const doc3 = callPluginPrintFunction(path13, options8, mainPrint, args, embeds);
20013 if (shouldCache) {
20014 cache3.set(value, doc3);
20015 }
20016 return doc3;
20017 }
20018}
20019function callPluginPrintFunction(path13, options8, printPath, args, embeds) {
20020 var _a;
20021 const { node } = path13;
20022 const { printer } = options8;
20023 let doc2;
20024 if ((_a = printer.hasPrettierIgnore) == null ? void 0 : _a.call(printer, path13)) {
20025 doc2 = print_ignored_default(path13, options8);
20026 } else if (embeds.has(node)) {
20027 doc2 = embeds.get(node);
20028 } else {
20029 doc2 = printer.print(path13, options8, printPath, args);
20030 }
20031 switch (node) {
20032 case options8.cursorNode:
20033 doc2 = inheritLabel(doc2, (doc3) => [cursor, doc3, cursor]);
20034 break;
20035 case options8.nodeBeforeCursor:
20036 doc2 = inheritLabel(doc2, (doc3) => [doc3, cursor]);
20037 break;
20038 case options8.nodeAfterCursor:
20039 doc2 = inheritLabel(doc2, (doc3) => [cursor, doc3]);
20040 break;
20041 }
20042 if (printer.printComment && (!printer.willPrintOwnComments || !printer.willPrintOwnComments(path13, options8))) {
20043 doc2 = printComments(path13, doc2, options8);
20044 }
20045 return doc2;
20046}
20047async function prepareToPrint(ast, options8) {
20048 const comments = ast.comments ?? [];
20049 options8[Symbol.for("comments")] = comments;
20050 options8[Symbol.for("tokens")] = ast.tokens ?? [];
20051 options8[Symbol.for("printedComments")] = /* @__PURE__ */ new Set();
20052 attachComments(ast, options8);
20053 const {
20054 printer: { preprocess }
20055 } = options8;
20056 ast = preprocess ? await preprocess(ast, options8) : ast;
20057 return { ast, comments };
20058}
20059
20060// src/main/get-cursor-node.js
20061function getCursorLocation(ast, options8) {
20062 const { cursorOffset, locStart, locEnd } = options8;
20063 const getVisitorKeys = create_get_visitor_keys_function_default(
20064 options8.printer.getVisitorKeys
20065 );
20066 const nodeContainsCursor = (node) => locStart(node) <= cursorOffset && locEnd(node) >= cursorOffset;
20067 let cursorNode = ast;
20068 const nodesContainingCursor = [ast];
20069 for (const node of getDescendants(ast, {
20070 getVisitorKeys,
20071 filter: nodeContainsCursor
20072 })) {
20073 nodesContainingCursor.push(node);
20074 cursorNode = node;
20075 }
20076 if (isLeaf(cursorNode, { getVisitorKeys })) {
20077 return { cursorNode };
20078 }
20079 let nodeBeforeCursor;
20080 let nodeAfterCursor;
20081 let nodeBeforeCursorEndIndex = -1;
20082 let nodeAfterCursorStartIndex = Number.POSITIVE_INFINITY;
20083 while (nodesContainingCursor.length > 0 && (nodeBeforeCursor === void 0 || nodeAfterCursor === void 0)) {
20084 cursorNode = nodesContainingCursor.pop();
20085 const foundBeforeNode = nodeBeforeCursor !== void 0;
20086 const foundAfterNode = nodeAfterCursor !== void 0;
20087 for (const node of getChildren(cursorNode, { getVisitorKeys })) {
20088 if (!foundBeforeNode) {
20089 const nodeEnd = locEnd(node);
20090 if (nodeEnd <= cursorOffset && nodeEnd > nodeBeforeCursorEndIndex) {
20091 nodeBeforeCursor = node;
20092 nodeBeforeCursorEndIndex = nodeEnd;
20093 }
20094 }
20095 if (!foundAfterNode) {
20096 const nodeStart = locStart(node);
20097 if (nodeStart >= cursorOffset && nodeStart < nodeAfterCursorStartIndex) {
20098 nodeAfterCursor = node;
20099 nodeAfterCursorStartIndex = nodeStart;
20100 }
20101 }
20102 }
20103 }
20104 return {
20105 nodeBeforeCursor,
20106 nodeAfterCursor
20107 };
20108}
20109var get_cursor_node_default = getCursorLocation;
20110
20111// src/main/massage-ast.js
20112function massageAst(ast, options8) {
20113 const {
20114 printer: {
20115 massageAstNode: cleanFunction,
20116 getVisitorKeys: printerGetVisitorKeys
20117 }
20118 } = options8;
20119 if (!cleanFunction) {
20120 return ast;
20121 }
20122 const getVisitorKeys = create_get_visitor_keys_function_default(printerGetVisitorKeys);
20123 const ignoredProperties = cleanFunction.ignoredProperties ?? /* @__PURE__ */ new Set();
20124 return recurse(ast);
20125 function recurse(original, parent) {
20126 if (!(original !== null && typeof original === "object")) {
20127 return original;
20128 }
20129 if (Array.isArray(original)) {
20130 return original.map((child) => recurse(child, parent)).filter(Boolean);
20131 }
20132 const cloned = {};
20133 const childrenKeys = new Set(getVisitorKeys(original));
20134 for (const key2 in original) {
20135 if (!Object.prototype.hasOwnProperty.call(original, key2) || ignoredProperties.has(key2)) {
20136 continue;
20137 }
20138 if (childrenKeys.has(key2)) {
20139 cloned[key2] = recurse(original[key2], original);
20140 } else {
20141 cloned[key2] = original[key2];
20142 }
20143 }
20144 const result = cleanFunction(original, cloned, parent);
20145 if (result === null) {
20146 return;
20147 }
20148 return result ?? cloned;
20149 }
20150}
20151var massage_ast_default = massageAst;
20152
20153// scripts/build/shims/array-find-last-index.js
20154var arrayFindLastIndex = (isOptionalObject, array2, callback) => {
20155 if (isOptionalObject && (array2 === void 0 || array2 === null)) {
20156 return;
20157 }
20158 if (array2.findLastIndex) {
20159 return array2.findLastIndex(callback);
20160 }
20161 for (let index = array2.length - 1; index >= 0; index--) {
20162 const element = array2[index];
20163 if (callback(element, index, array2)) {
20164 return index;
20165 }
20166 }
20167 return -1;
20168};
20169var array_find_last_index_default = arrayFindLastIndex;
20170
20171// src/main/range-util.js
20172import assert5 from "assert";
20173var isJsonParser = ({ parser }) => parser === "json" || parser === "json5" || parser === "jsonc" || parser === "json-stringify";
20174function findCommonAncestor(startNodeAndParents, endNodeAndParents) {
20175 const startNodeAndAncestors = [
20176 startNodeAndParents.node,
20177 ...startNodeAndParents.parentNodes
20178 ];
20179 const endNodeAndAncestors = /* @__PURE__ */ new Set([
20180 endNodeAndParents.node,
20181 ...endNodeAndParents.parentNodes
20182 ]);
20183 return startNodeAndAncestors.find(
20184 (node) => jsonSourceElements.has(node.type) && endNodeAndAncestors.has(node)
20185 );
20186}
20187function dropRootParents(parents) {
20188 const index = array_find_last_index_default(
20189 /* isOptionalObject */
20190 false,
20191 parents,
20192 (node) => node.type !== "Program" && node.type !== "File"
20193 );
20194 if (index === -1) {
20195 return parents;
20196 }
20197 return parents.slice(0, index + 1);
20198}
20199function findSiblingAncestors(startNodeAndParents, endNodeAndParents, { locStart, locEnd }) {
20200 let resultStartNode = startNodeAndParents.node;
20201 let resultEndNode = endNodeAndParents.node;
20202 if (resultStartNode === resultEndNode) {
20203 return {
20204 startNode: resultStartNode,
20205 endNode: resultEndNode
20206 };
20207 }
20208 const startNodeStart = locStart(startNodeAndParents.node);
20209 for (const endParent of dropRootParents(endNodeAndParents.parentNodes)) {
20210 if (locStart(endParent) >= startNodeStart) {
20211 resultEndNode = endParent;
20212 } else {
20213 break;
20214 }
20215 }
20216 const endNodeEnd = locEnd(endNodeAndParents.node);
20217 for (const startParent of dropRootParents(startNodeAndParents.parentNodes)) {
20218 if (locEnd(startParent) <= endNodeEnd) {
20219 resultStartNode = startParent;
20220 } else {
20221 break;
20222 }
20223 if (resultStartNode === resultEndNode) {
20224 break;
20225 }
20226 }
20227 return {
20228 startNode: resultStartNode,
20229 endNode: resultEndNode
20230 };
20231}
20232function findNodeAtOffset(node, offset, options8, predicate, parentNodes = [], type2) {
20233 const { locStart, locEnd } = options8;
20234 const start = locStart(node);
20235 const end = locEnd(node);
20236 if (offset > end || offset < start || type2 === "rangeEnd" && offset === start || type2 === "rangeStart" && offset === end) {
20237 return;
20238 }
20239 for (const childNode of getSortedChildNodes(node, options8)) {
20240 const childResult = findNodeAtOffset(
20241 childNode,
20242 offset,
20243 options8,
20244 predicate,
20245 [node, ...parentNodes],
20246 type2
20247 );
20248 if (childResult) {
20249 return childResult;
20250 }
20251 }
20252 if (!predicate || predicate(node, parentNodes[0])) {
20253 return {
20254 node,
20255 parentNodes
20256 };
20257 }
20258}
20259function isJsSourceElement(type2, parentType) {
20260 return parentType !== "DeclareExportDeclaration" && type2 !== "TypeParameterDeclaration" && (type2 === "Directive" || type2 === "TypeAlias" || type2 === "TSExportAssignment" || type2.startsWith("Declare") || type2.startsWith("TSDeclare") || type2.endsWith("Statement") || type2.endsWith("Declaration"));
20261}
20262var jsonSourceElements = /* @__PURE__ */ new Set([
20263 "JsonRoot",
20264 "ObjectExpression",
20265 "ArrayExpression",
20266 "StringLiteral",
20267 "NumericLiteral",
20268 "BooleanLiteral",
20269 "NullLiteral",
20270 "UnaryExpression",
20271 "TemplateLiteral"
20272]);
20273var graphqlSourceElements = /* @__PURE__ */ new Set([
20274 "OperationDefinition",
20275 "FragmentDefinition",
20276 "VariableDefinition",
20277 "TypeExtensionDefinition",
20278 "ObjectTypeDefinition",
20279 "FieldDefinition",
20280 "DirectiveDefinition",
20281 "EnumTypeDefinition",
20282 "EnumValueDefinition",
20283 "InputValueDefinition",
20284 "InputObjectTypeDefinition",
20285 "SchemaDefinition",
20286 "OperationTypeDefinition",
20287 "InterfaceTypeDefinition",
20288 "UnionTypeDefinition",
20289 "ScalarTypeDefinition"
20290]);
20291function isSourceElement(opts, node, parentNode) {
20292 if (!node) {
20293 return false;
20294 }
20295 switch (opts.parser) {
20296 case "flow":
20297 case "babel":
20298 case "babel-flow":
20299 case "babel-ts":
20300 case "typescript":
20301 case "acorn":
20302 case "espree":
20303 case "meriyah":
20304 case "__babel_estree":
20305 return isJsSourceElement(node.type, parentNode == null ? void 0 : parentNode.type);
20306 case "json":
20307 case "json5":
20308 case "jsonc":
20309 case "json-stringify":
20310 return jsonSourceElements.has(node.type);
20311 case "graphql":
20312 return graphqlSourceElements.has(node.kind);
20313 case "vue":
20314 return node.tag !== "root";
20315 }
20316 return false;
20317}
20318function calculateRange(text, opts, ast) {
20319 let { rangeStart: start, rangeEnd: end, locStart, locEnd } = opts;
20320 assert5.ok(end > start);
20321 const firstNonWhitespaceCharacterIndex = text.slice(start, end).search(/\S/u);
20322 const isAllWhitespace = firstNonWhitespaceCharacterIndex === -1;
20323 if (!isAllWhitespace) {
20324 start += firstNonWhitespaceCharacterIndex;
20325 for (; end > start; --end) {
20326 if (/\S/u.test(text[end - 1])) {
20327 break;
20328 }
20329 }
20330 }
20331 const startNodeAndParents = findNodeAtOffset(
20332 ast,
20333 start,
20334 opts,
20335 (node, parentNode) => isSourceElement(opts, node, parentNode),
20336 [],
20337 "rangeStart"
20338 );
20339 const endNodeAndParents = (
20340 // No need find Node at `end`, it will be the same as `startNodeAndParents`
20341 isAllWhitespace ? startNodeAndParents : findNodeAtOffset(
20342 ast,
20343 end,
20344 opts,
20345 (node) => isSourceElement(opts, node),
20346 [],
20347 "rangeEnd"
20348 )
20349 );
20350 if (!startNodeAndParents || !endNodeAndParents) {
20351 return {
20352 rangeStart: 0,
20353 rangeEnd: 0
20354 };
20355 }
20356 let startNode;
20357 let endNode;
20358 if (isJsonParser(opts)) {
20359 const commonAncestor = findCommonAncestor(
20360 startNodeAndParents,
20361 endNodeAndParents
20362 );
20363 startNode = commonAncestor;
20364 endNode = commonAncestor;
20365 } else {
20366 ({ startNode, endNode } = findSiblingAncestors(
20367 startNodeAndParents,
20368 endNodeAndParents,
20369 opts
20370 ));
20371 }
20372 return {
20373 rangeStart: Math.min(locStart(startNode), locStart(endNode)),
20374 rangeEnd: Math.max(locEnd(startNode), locEnd(endNode))
20375 };
20376}
20377
20378// src/main/core.js
20379var BOM = "\uFEFF";
20380var CURSOR = Symbol("cursor");
20381async function coreFormat(originalText, opts, addAlignmentSize = 0) {
20382 if (!originalText || originalText.trim().length === 0) {
20383 return { formatted: "", cursorOffset: -1, comments: [] };
20384 }
20385 const { ast, text } = await parse_default(originalText, opts);
20386 if (opts.cursorOffset >= 0) {
20387 opts = {
20388 ...opts,
20389 ...get_cursor_node_default(ast, opts)
20390 };
20391 }
20392 let doc2 = await printAstToDoc(ast, opts, addAlignmentSize);
20393 if (addAlignmentSize > 0) {
20394 doc2 = addAlignmentToDoc([hardline, doc2], addAlignmentSize, opts.tabWidth);
20395 }
20396 const result = printDocToString(doc2, opts);
20397 if (addAlignmentSize > 0) {
20398 const trimmed = result.formatted.trim();
20399 if (result.cursorNodeStart !== void 0) {
20400 result.cursorNodeStart -= result.formatted.indexOf(trimmed);
20401 if (result.cursorNodeStart < 0) {
20402 result.cursorNodeStart = 0;
20403 result.cursorNodeText = result.cursorNodeText.trimStart();
20404 }
20405 if (result.cursorNodeStart + result.cursorNodeText.length > trimmed.length) {
20406 result.cursorNodeText = result.cursorNodeText.trimEnd();
20407 }
20408 }
20409 result.formatted = trimmed + convertEndOfLineToChars(opts.endOfLine);
20410 }
20411 const comments = opts[Symbol.for("comments")];
20412 if (opts.cursorOffset >= 0) {
20413 let oldCursorRegionStart;
20414 let oldCursorRegionText;
20415 let newCursorRegionStart;
20416 let newCursorRegionText;
20417 if ((opts.cursorNode || opts.nodeBeforeCursor || opts.nodeAfterCursor) && result.cursorNodeText) {
20418 newCursorRegionStart = result.cursorNodeStart;
20419 newCursorRegionText = result.cursorNodeText;
20420 if (opts.cursorNode) {
20421 oldCursorRegionStart = opts.locStart(opts.cursorNode);
20422 oldCursorRegionText = text.slice(
20423 oldCursorRegionStart,
20424 opts.locEnd(opts.cursorNode)
20425 );
20426 } else {
20427 if (!opts.nodeBeforeCursor && !opts.nodeAfterCursor) {
20428 throw new Error(
20429 "Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor"
20430 );
20431 }
20432 oldCursorRegionStart = opts.nodeBeforeCursor ? opts.locEnd(opts.nodeBeforeCursor) : 0;
20433 const oldCursorRegionEnd = opts.nodeAfterCursor ? opts.locStart(opts.nodeAfterCursor) : text.length;
20434 oldCursorRegionText = text.slice(
20435 oldCursorRegionStart,
20436 oldCursorRegionEnd
20437 );
20438 }
20439 } else {
20440 oldCursorRegionStart = 0;
20441 oldCursorRegionText = text;
20442 newCursorRegionStart = 0;
20443 newCursorRegionText = result.formatted;
20444 }
20445 const cursorOffsetRelativeToOldCursorRegionStart = opts.cursorOffset - oldCursorRegionStart;
20446 if (oldCursorRegionText === newCursorRegionText) {
20447 return {
20448 formatted: result.formatted,
20449 cursorOffset: newCursorRegionStart + cursorOffsetRelativeToOldCursorRegionStart,
20450 comments
20451 };
20452 }
20453 const oldCursorNodeCharArray = oldCursorRegionText.split("");
20454 oldCursorNodeCharArray.splice(
20455 cursorOffsetRelativeToOldCursorRegionStart,
20456 0,
20457 CURSOR
20458 );
20459 const newCursorNodeCharArray = newCursorRegionText.split("");
20460 const cursorNodeDiff = diffArrays(
20461 oldCursorNodeCharArray,
20462 newCursorNodeCharArray
20463 );
20464 let cursorOffset = newCursorRegionStart;
20465 for (const entry of cursorNodeDiff) {
20466 if (entry.removed) {
20467 if (entry.value.includes(CURSOR)) {
20468 break;
20469 }
20470 } else {
20471 cursorOffset += entry.count;
20472 }
20473 }
20474 return { formatted: result.formatted, cursorOffset, comments };
20475 }
20476 return { formatted: result.formatted, cursorOffset: -1, comments };
20477}
20478async function formatRange(originalText, opts) {
20479 const { ast, text } = await parse_default(originalText, opts);
20480 const { rangeStart, rangeEnd } = calculateRange(text, opts, ast);
20481 const rangeString = text.slice(rangeStart, rangeEnd);
20482 const rangeStart2 = Math.min(
20483 rangeStart,
20484 text.lastIndexOf("\n", rangeStart) + 1
20485 );
20486 const indentString = text.slice(rangeStart2, rangeStart).match(/^\s*/u)[0];
20487 const alignmentSize = get_alignment_size_default(indentString, opts.tabWidth);
20488 const rangeResult = await coreFormat(
20489 rangeString,
20490 {
20491 ...opts,
20492 rangeStart: 0,
20493 rangeEnd: Number.POSITIVE_INFINITY,
20494 // Track the cursor offset only if it's within our range
20495 cursorOffset: opts.cursorOffset > rangeStart && opts.cursorOffset <= rangeEnd ? opts.cursorOffset - rangeStart : -1,
20496 // Always use `lf` to format, we'll replace it later
20497 endOfLine: "lf"
20498 },
20499 alignmentSize
20500 );
20501 const rangeTrimmed = rangeResult.formatted.trimEnd();
20502 let { cursorOffset } = opts;
20503 if (cursorOffset > rangeEnd) {
20504 cursorOffset += rangeTrimmed.length - rangeString.length;
20505 } else if (rangeResult.cursorOffset >= 0) {
20506 cursorOffset = rangeResult.cursorOffset + rangeStart;
20507 }
20508 let formatted = text.slice(0, rangeStart) + rangeTrimmed + text.slice(rangeEnd);
20509 if (opts.endOfLine !== "lf") {
20510 const eol = convertEndOfLineToChars(opts.endOfLine);
20511 if (cursorOffset >= 0 && eol === "\r\n") {
20512 cursorOffset += countEndOfLineChars(
20513 formatted.slice(0, cursorOffset),
20514 "\n"
20515 );
20516 }
20517 formatted = string_replace_all_default(
20518 /* isOptionalObject */
20519 false,
20520 formatted,
20521 "\n",
20522 eol
20523 );
20524 }
20525 return { formatted, cursorOffset, comments: rangeResult.comments };
20526}
20527function ensureIndexInText(text, index, defaultValue) {
20528 if (typeof index !== "number" || Number.isNaN(index) || index < 0 || index > text.length) {
20529 return defaultValue;
20530 }
20531 return index;
20532}
20533function normalizeIndexes(text, options8) {
20534 let { cursorOffset, rangeStart, rangeEnd } = options8;
20535 cursorOffset = ensureIndexInText(text, cursorOffset, -1);
20536 rangeStart = ensureIndexInText(text, rangeStart, 0);
20537 rangeEnd = ensureIndexInText(text, rangeEnd, text.length);
20538 return { ...options8, cursorOffset, rangeStart, rangeEnd };
20539}
20540function normalizeInputAndOptions(text, options8) {
20541 let { cursorOffset, rangeStart, rangeEnd, endOfLine } = normalizeIndexes(
20542 text,
20543 options8
20544 );
20545 const hasBOM = text.charAt(0) === BOM;
20546 if (hasBOM) {
20547 text = text.slice(1);
20548 cursorOffset--;
20549 rangeStart--;
20550 rangeEnd--;
20551 }
20552 if (endOfLine === "auto") {
20553 endOfLine = guessEndOfLine(text);
20554 }
20555 if (text.includes("\r")) {
20556 const countCrlfBefore = (index) => countEndOfLineChars(text.slice(0, Math.max(index, 0)), "\r\n");
20557 cursorOffset -= countCrlfBefore(cursorOffset);
20558 rangeStart -= countCrlfBefore(rangeStart);
20559 rangeEnd -= countCrlfBefore(rangeEnd);
20560 text = normalizeEndOfLine(text);
20561 }
20562 return {
20563 hasBOM,
20564 text,
20565 options: normalizeIndexes(text, {
20566 ...options8,
20567 cursorOffset,
20568 rangeStart,
20569 rangeEnd,
20570 endOfLine
20571 })
20572 };
20573}
20574async function hasPragma(text, options8) {
20575 const selectedParser = await resolveParser(options8);
20576 return !selectedParser.hasPragma || selectedParser.hasPragma(text);
20577}
20578async function formatWithCursor(originalText, originalOptions) {
20579 let { hasBOM, text, options: options8 } = normalizeInputAndOptions(
20580 originalText,
20581 await normalize_format_options_default(originalOptions)
20582 );
20583 if (options8.rangeStart >= options8.rangeEnd && text !== "" || options8.requirePragma && !await hasPragma(text, options8)) {
20584 return {
20585 formatted: originalText,
20586 cursorOffset: originalOptions.cursorOffset,
20587 comments: []
20588 };
20589 }
20590 let result;
20591 if (options8.rangeStart > 0 || options8.rangeEnd < text.length) {
20592 result = await formatRange(text, options8);
20593 } else {
20594 if (!options8.requirePragma && options8.insertPragma && options8.printer.insertPragma && !await hasPragma(text, options8)) {
20595 text = options8.printer.insertPragma(text);
20596 }
20597 result = await coreFormat(text, options8);
20598 }
20599 if (hasBOM) {
20600 result.formatted = BOM + result.formatted;
20601 if (result.cursorOffset >= 0) {
20602 result.cursorOffset++;
20603 }
20604 }
20605 return result;
20606}
20607async function parse6(originalText, originalOptions, devOptions) {
20608 const { text, options: options8 } = normalizeInputAndOptions(
20609 originalText,
20610 await normalize_format_options_default(originalOptions)
20611 );
20612 const parsed = await parse_default(text, options8);
20613 if (devOptions) {
20614 if (devOptions.preprocessForPrint) {
20615 parsed.ast = await prepareToPrint(parsed.ast, options8);
20616 }
20617 if (devOptions.massage) {
20618 parsed.ast = massage_ast_default(parsed.ast, options8);
20619 }
20620 }
20621 return parsed;
20622}
20623async function formatAst(ast, options8) {
20624 options8 = await normalize_format_options_default(options8);
20625 const doc2 = await printAstToDoc(ast, options8);
20626 return printDocToString(doc2, options8);
20627}
20628async function formatDoc(doc2, options8) {
20629 const text = printDocToDebug(doc2);
20630 const { formatted } = await formatWithCursor(text, {
20631 ...options8,
20632 parser: "__js_expression"
20633 });
20634 return formatted;
20635}
20636async function printToDoc(originalText, options8) {
20637 options8 = await normalize_format_options_default(options8);
20638 const { ast } = await parse_default(originalText, options8);
20639 return printAstToDoc(ast, options8);
20640}
20641async function printDocToString2(doc2, options8) {
20642 return printDocToString(
20643 doc2,
20644 await normalize_format_options_default(options8)
20645 );
20646}
20647
20648// src/main/option-categories.js
20649var option_categories_exports = {};
20650__export(option_categories_exports, {
20651 CATEGORY_CONFIG: () => CATEGORY_CONFIG,
20652 CATEGORY_EDITOR: () => CATEGORY_EDITOR,
20653 CATEGORY_FORMAT: () => CATEGORY_FORMAT,
20654 CATEGORY_GLOBAL: () => CATEGORY_GLOBAL,
20655 CATEGORY_OTHER: () => CATEGORY_OTHER,
20656 CATEGORY_OUTPUT: () => CATEGORY_OUTPUT,
20657 CATEGORY_SPECIAL: () => CATEGORY_SPECIAL
20658});
20659var CATEGORY_CONFIG = "Config";
20660var CATEGORY_EDITOR = "Editor";
20661var CATEGORY_FORMAT = "Format";
20662var CATEGORY_OTHER = "Other";
20663var CATEGORY_OUTPUT = "Output";
20664var CATEGORY_GLOBAL = "Global";
20665var CATEGORY_SPECIAL = "Special";
20666
20667// src/plugins/builtin-plugins-proxy.js
20668var builtin_plugins_proxy_exports = {};
20669__export(builtin_plugins_proxy_exports, {
20670 languages: () => languages,
20671 options: () => options7,
20672 parsers: () => parsers,
20673 printers: () => printers
20674});
20675
20676// src/language-css/languages.evaluate.js
20677var languages_evaluate_default = [
20678 {
20679 "linguistLanguageId": 50,
20680 "name": "CSS",
20681 "type": "markup",
20682 "tmScope": "source.css",
20683 "aceMode": "css",
20684 "codemirrorMode": "css",
20685 "codemirrorMimeType": "text/css",
20686 "color": "#563d7c",
20687 "extensions": [
20688 ".css",
20689 ".wxss"
20690 ],
20691 "parsers": [
20692 "css"
20693 ],
20694 "vscodeLanguageIds": [
20695 "css"
20696 ]
20697 },
20698 {
20699 "linguistLanguageId": 262764437,
20700 "name": "PostCSS",
20701 "type": "markup",
20702 "color": "#dc3a0c",
20703 "tmScope": "source.postcss",
20704 "group": "CSS",
20705 "extensions": [
20706 ".pcss",
20707 ".postcss"
20708 ],
20709 "aceMode": "text",
20710 "parsers": [
20711 "css"
20712 ],
20713 "vscodeLanguageIds": [
20714 "postcss"
20715 ]
20716 },
20717 {
20718 "linguistLanguageId": 198,
20719 "name": "Less",
20720 "type": "markup",
20721 "color": "#1d365d",
20722 "aliases": [
20723 "less-css"
20724 ],
20725 "extensions": [
20726 ".less"
20727 ],
20728 "tmScope": "source.css.less",
20729 "aceMode": "less",
20730 "codemirrorMode": "css",
20731 "codemirrorMimeType": "text/css",
20732 "parsers": [
20733 "less"
20734 ],
20735 "vscodeLanguageIds": [
20736 "less"
20737 ]
20738 },
20739 {
20740 "linguistLanguageId": 329,
20741 "name": "SCSS",
20742 "type": "markup",
20743 "color": "#c6538c",
20744 "tmScope": "source.css.scss",
20745 "aceMode": "scss",
20746 "codemirrorMode": "css",
20747 "codemirrorMimeType": "text/x-scss",
20748 "extensions": [
20749 ".scss"
20750 ],
20751 "parsers": [
20752 "scss"
20753 ],
20754 "vscodeLanguageIds": [
20755 "scss"
20756 ]
20757 }
20758];
20759
20760// src/common/common-options.evaluate.js
20761var common_options_evaluate_default = {
20762 "bracketSpacing": {
20763 "category": "Common",
20764 "type": "boolean",
20765 "default": true,
20766 "description": "Print spaces between brackets.",
20767 "oppositeDescription": "Do not print spaces between brackets."
20768 },
20769 "singleQuote": {
20770 "category": "Common",
20771 "type": "boolean",
20772 "default": false,
20773 "description": "Use single quotes instead of double quotes."
20774 },
20775 "proseWrap": {
20776 "category": "Common",
20777 "type": "choice",
20778 "default": "preserve",
20779 "description": "How to wrap prose.",
20780 "choices": [
20781 {
20782 "value": "always",
20783 "description": "Wrap prose if it exceeds the print width."
20784 },
20785 {
20786 "value": "never",
20787 "description": "Do not wrap prose."
20788 },
20789 {
20790 "value": "preserve",
20791 "description": "Wrap prose as-is."
20792 }
20793 ]
20794 },
20795 "bracketSameLine": {
20796 "category": "Common",
20797 "type": "boolean",
20798 "default": false,
20799 "description": "Put > of opening tags on the last line instead of on a new line."
20800 },
20801 "singleAttributePerLine": {
20802 "category": "Common",
20803 "type": "boolean",
20804 "default": false,
20805 "description": "Enforce single attribute per line in HTML, Vue and JSX."
20806 }
20807};
20808
20809// src/language-css/options.js
20810var options = {
20811 singleQuote: common_options_evaluate_default.singleQuote
20812};
20813var options_default = options;
20814
20815// src/language-graphql/languages.evaluate.js
20816var languages_evaluate_default2 = [
20817 {
20818 "linguistLanguageId": 139,
20819 "name": "GraphQL",
20820 "type": "data",
20821 "color": "#e10098",
20822 "extensions": [
20823 ".graphql",
20824 ".gql",
20825 ".graphqls"
20826 ],
20827 "tmScope": "source.graphql",
20828 "aceMode": "text",
20829 "parsers": [
20830 "graphql"
20831 ],
20832 "vscodeLanguageIds": [
20833 "graphql"
20834 ]
20835 }
20836];
20837
20838// src/language-graphql/options.js
20839var options2 = {
20840 bracketSpacing: common_options_evaluate_default.bracketSpacing
20841};
20842var options_default2 = options2;
20843
20844// src/language-handlebars/languages.evaluate.js
20845var languages_evaluate_default3 = [
20846 {
20847 "linguistLanguageId": 155,
20848 "name": "Handlebars",
20849 "type": "markup",
20850 "color": "#f7931e",
20851 "aliases": [
20852 "hbs",
20853 "htmlbars"
20854 ],
20855 "extensions": [
20856 ".handlebars",
20857 ".hbs"
20858 ],
20859 "tmScope": "text.html.handlebars",
20860 "aceMode": "handlebars",
20861 "parsers": [
20862 "glimmer"
20863 ],
20864 "vscodeLanguageIds": [
20865 "handlebars"
20866 ]
20867 }
20868];
20869
20870// src/language-html/languages.evaluate.js
20871var languages_evaluate_default4 = [
20872 {
20873 "linguistLanguageId": 146,
20874 "name": "Angular",
20875 "type": "markup",
20876 "tmScope": "text.html.basic",
20877 "aceMode": "html",
20878 "codemirrorMode": "htmlmixed",
20879 "codemirrorMimeType": "text/html",
20880 "color": "#e34c26",
20881 "aliases": [
20882 "xhtml"
20883 ],
20884 "extensions": [
20885 ".component.html"
20886 ],
20887 "parsers": [
20888 "angular"
20889 ],
20890 "vscodeLanguageIds": [
20891 "html"
20892 ],
20893 "filenames": []
20894 },
20895 {
20896 "linguistLanguageId": 146,
20897 "name": "HTML",
20898 "type": "markup",
20899 "tmScope": "text.html.basic",
20900 "aceMode": "html",
20901 "codemirrorMode": "htmlmixed",
20902 "codemirrorMimeType": "text/html",
20903 "color": "#e34c26",
20904 "aliases": [
20905 "xhtml"
20906 ],
20907 "extensions": [
20908 ".html",
20909 ".hta",
20910 ".htm",
20911 ".html.hl",
20912 ".inc",
20913 ".xht",
20914 ".xhtml",
20915 ".mjml"
20916 ],
20917 "parsers": [
20918 "html"
20919 ],
20920 "vscodeLanguageIds": [
20921 "html"
20922 ]
20923 },
20924 {
20925 "linguistLanguageId": 146,
20926 "name": "Lightning Web Components",
20927 "type": "markup",
20928 "tmScope": "text.html.basic",
20929 "aceMode": "html",
20930 "codemirrorMode": "htmlmixed",
20931 "codemirrorMimeType": "text/html",
20932 "color": "#e34c26",
20933 "aliases": [
20934 "xhtml"
20935 ],
20936 "extensions": [],
20937 "parsers": [
20938 "lwc"
20939 ],
20940 "vscodeLanguageIds": [
20941 "html"
20942 ],
20943 "filenames": []
20944 },
20945 {
20946 "linguistLanguageId": 391,
20947 "name": "Vue",
20948 "type": "markup",
20949 "color": "#41b883",
20950 "extensions": [
20951 ".vue"
20952 ],
20953 "tmScope": "text.html.vue",
20954 "aceMode": "html",
20955 "parsers": [
20956 "vue"
20957 ],
20958 "vscodeLanguageIds": [
20959 "vue"
20960 ]
20961 }
20962];
20963
20964// src/language-html/options.js
20965var CATEGORY_HTML = "HTML";
20966var options3 = {
20967 bracketSameLine: common_options_evaluate_default.bracketSameLine,
20968 htmlWhitespaceSensitivity: {
20969 category: CATEGORY_HTML,
20970 type: "choice",
20971 default: "css",
20972 description: "How to handle whitespaces in HTML.",
20973 choices: [
20974 {
20975 value: "css",
20976 description: "Respect the default value of CSS display property."
20977 },
20978 {
20979 value: "strict",
20980 description: "Whitespaces are considered sensitive."
20981 },
20982 {
20983 value: "ignore",
20984 description: "Whitespaces are considered insensitive."
20985 }
20986 ]
20987 },
20988 singleAttributePerLine: common_options_evaluate_default.singleAttributePerLine,
20989 vueIndentScriptAndStyle: {
20990 category: CATEGORY_HTML,
20991 type: "boolean",
20992 default: false,
20993 description: "Indent script and style tags in Vue files."
20994 }
20995};
20996var options_default3 = options3;
20997
20998// src/language-js/languages.evaluate.js
20999var languages_evaluate_default5 = [
21000 {
21001 "linguistLanguageId": 183,
21002 "name": "JavaScript",
21003 "type": "programming",
21004 "tmScope": "source.js",
21005 "aceMode": "javascript",
21006 "codemirrorMode": "javascript",
21007 "codemirrorMimeType": "text/javascript",
21008 "color": "#f1e05a",
21009 "aliases": [
21010 "js",
21011 "node"
21012 ],
21013 "extensions": [
21014 ".js",
21015 "._js",
21016 ".bones",
21017 ".cjs",
21018 ".es",
21019 ".es6",
21020 ".frag",
21021 ".gs",
21022 ".jake",
21023 ".javascript",
21024 ".jsb",
21025 ".jscad",
21026 ".jsfl",
21027 ".jslib",
21028 ".jsm",
21029 ".jspre",
21030 ".jss",
21031 ".mjs",
21032 ".njs",
21033 ".pac",
21034 ".sjs",
21035 ".ssjs",
21036 ".xsjs",
21037 ".xsjslib",
21038 ".wxs"
21039 ],
21040 "filenames": [
21041 "Jakefile"
21042 ],
21043 "interpreters": [
21044 "chakra",
21045 "d8",
21046 "gjs",
21047 "js",
21048 "node",
21049 "nodejs",
21050 "qjs",
21051 "rhino",
21052 "v8",
21053 "v8-shell",
21054 "zx"
21055 ],
21056 "parsers": [
21057 "babel",
21058 "acorn",
21059 "espree",
21060 "meriyah",
21061 "babel-flow",
21062 "babel-ts",
21063 "flow",
21064 "typescript"
21065 ],
21066 "vscodeLanguageIds": [
21067 "javascript",
21068 "mongo"
21069 ]
21070 },
21071 {
21072 "linguistLanguageId": 183,
21073 "name": "Flow",
21074 "type": "programming",
21075 "tmScope": "source.js",
21076 "aceMode": "javascript",
21077 "codemirrorMode": "javascript",
21078 "codemirrorMimeType": "text/javascript",
21079 "color": "#f1e05a",
21080 "aliases": [],
21081 "extensions": [
21082 ".js.flow"
21083 ],
21084 "filenames": [],
21085 "interpreters": [
21086 "chakra",
21087 "d8",
21088 "gjs",
21089 "js",
21090 "node",
21091 "nodejs",
21092 "qjs",
21093 "rhino",
21094 "v8",
21095 "v8-shell"
21096 ],
21097 "parsers": [
21098 "flow",
21099 "babel-flow"
21100 ],
21101 "vscodeLanguageIds": [
21102 "javascript"
21103 ]
21104 },
21105 {
21106 "linguistLanguageId": 183,
21107 "name": "JSX",
21108 "type": "programming",
21109 "tmScope": "source.js.jsx",
21110 "aceMode": "javascript",
21111 "codemirrorMode": "jsx",
21112 "codemirrorMimeType": "text/jsx",
21113 "color": void 0,
21114 "aliases": void 0,
21115 "extensions": [
21116 ".jsx"
21117 ],
21118 "filenames": void 0,
21119 "interpreters": void 0,
21120 "parsers": [
21121 "babel",
21122 "babel-flow",
21123 "babel-ts",
21124 "flow",
21125 "typescript",
21126 "espree",
21127 "meriyah"
21128 ],
21129 "vscodeLanguageIds": [
21130 "javascriptreact"
21131 ],
21132 "group": "JavaScript"
21133 },
21134 {
21135 "linguistLanguageId": 378,
21136 "name": "TypeScript",
21137 "type": "programming",
21138 "color": "#3178c6",
21139 "aliases": [
21140 "ts"
21141 ],
21142 "interpreters": [
21143 "deno",
21144 "ts-node"
21145 ],
21146 "extensions": [
21147 ".ts",
21148 ".cts",
21149 ".mts"
21150 ],
21151 "tmScope": "source.ts",
21152 "aceMode": "typescript",
21153 "codemirrorMode": "javascript",
21154 "codemirrorMimeType": "application/typescript",
21155 "parsers": [
21156 "typescript",
21157 "babel-ts"
21158 ],
21159 "vscodeLanguageIds": [
21160 "typescript"
21161 ]
21162 },
21163 {
21164 "linguistLanguageId": 94901924,
21165 "name": "TSX",
21166 "type": "programming",
21167 "color": "#3178c6",
21168 "group": "TypeScript",
21169 "extensions": [
21170 ".tsx"
21171 ],
21172 "tmScope": "source.tsx",
21173 "aceMode": "javascript",
21174 "codemirrorMode": "jsx",
21175 "codemirrorMimeType": "text/jsx",
21176 "parsers": [
21177 "typescript",
21178 "babel-ts"
21179 ],
21180 "vscodeLanguageIds": [
21181 "typescriptreact"
21182 ]
21183 }
21184];
21185
21186// src/language-js/options.js
21187var CATEGORY_JAVASCRIPT = "JavaScript";
21188var options4 = {
21189 arrowParens: {
21190 category: CATEGORY_JAVASCRIPT,
21191 type: "choice",
21192 default: "always",
21193 description: "Include parentheses around a sole arrow function parameter.",
21194 choices: [
21195 {
21196 value: "always",
21197 description: "Always include parens. Example: `(x) => x`"
21198 },
21199 {
21200 value: "avoid",
21201 description: "Omit parens when possible. Example: `x => x`"
21202 }
21203 ]
21204 },
21205 bracketSameLine: common_options_evaluate_default.bracketSameLine,
21206 bracketSpacing: common_options_evaluate_default.bracketSpacing,
21207 jsxBracketSameLine: {
21208 category: CATEGORY_JAVASCRIPT,
21209 type: "boolean",
21210 description: "Put > on the last line instead of at a new line.",
21211 deprecated: "2.4.0"
21212 },
21213 semi: {
21214 category: CATEGORY_JAVASCRIPT,
21215 type: "boolean",
21216 default: true,
21217 description: "Print semicolons.",
21218 oppositeDescription: "Do not print semicolons, except at the beginning of lines which may need them."
21219 },
21220 experimentalTernaries: {
21221 category: CATEGORY_JAVASCRIPT,
21222 type: "boolean",
21223 default: false,
21224 description: "Use curious ternaries, with the question mark after the condition.",
21225 oppositeDescription: "Default behavior of ternaries; keep question marks on the same line as the consequent."
21226 },
21227 singleQuote: common_options_evaluate_default.singleQuote,
21228 jsxSingleQuote: {
21229 category: CATEGORY_JAVASCRIPT,
21230 type: "boolean",
21231 default: false,
21232 description: "Use single quotes in JSX."
21233 },
21234 quoteProps: {
21235 category: CATEGORY_JAVASCRIPT,
21236 type: "choice",
21237 default: "as-needed",
21238 description: "Change when properties in objects are quoted.",
21239 choices: [
21240 {
21241 value: "as-needed",
21242 description: "Only add quotes around object properties where required."
21243 },
21244 {
21245 value: "consistent",
21246 description: "If at least one property in an object requires quotes, quote all properties."
21247 },
21248 {
21249 value: "preserve",
21250 description: "Respect the input use of quotes in object properties."
21251 }
21252 ]
21253 },
21254 trailingComma: {
21255 category: CATEGORY_JAVASCRIPT,
21256 type: "choice",
21257 default: "all",
21258 description: "Print trailing commas wherever possible when multi-line.",
21259 choices: [
21260 {
21261 value: "all",
21262 description: "Trailing commas wherever possible (including function arguments)."
21263 },
21264 {
21265 value: "es5",
21266 description: "Trailing commas where valid in ES5 (objects, arrays, etc.)"
21267 },
21268 { value: "none", description: "No trailing commas." }
21269 ]
21270 },
21271 singleAttributePerLine: common_options_evaluate_default.singleAttributePerLine
21272};
21273var options_default4 = options4;
21274
21275// src/language-json/languages.evaluate.js
21276var languages_evaluate_default6 = [
21277 {
21278 "linguistLanguageId": 174,
21279 "name": "JSON.stringify",
21280 "type": "data",
21281 "color": "#292929",
21282 "tmScope": "source.json",
21283 "aceMode": "json",
21284 "codemirrorMode": "javascript",
21285 "codemirrorMimeType": "application/json",
21286 "aliases": [
21287 "geojson",
21288 "jsonl",
21289 "topojson"
21290 ],
21291 "extensions": [
21292 ".importmap"
21293 ],
21294 "filenames": [
21295 "package.json",
21296 "package-lock.json",
21297 "composer.json"
21298 ],
21299 "parsers": [
21300 "json-stringify"
21301 ],
21302 "vscodeLanguageIds": [
21303 "json"
21304 ]
21305 },
21306 {
21307 "linguistLanguageId": 174,
21308 "name": "JSON",
21309 "type": "data",
21310 "color": "#292929",
21311 "tmScope": "source.json",
21312 "aceMode": "json",
21313 "codemirrorMode": "javascript",
21314 "codemirrorMimeType": "application/json",
21315 "aliases": [
21316 "geojson",
21317 "jsonl",
21318 "topojson"
21319 ],
21320 "extensions": [
21321 ".json",
21322 ".4DForm",
21323 ".4DProject",
21324 ".avsc",
21325 ".geojson",
21326 ".gltf",
21327 ".har",
21328 ".ice",
21329 ".JSON-tmLanguage",
21330 ".mcmeta",
21331 ".tfstate",
21332 ".tfstate.backup",
21333 ".topojson",
21334 ".webapp",
21335 ".webmanifest",
21336 ".yy",
21337 ".yyp"
21338 ],
21339 "filenames": [
21340 ".all-contributorsrc",
21341 ".arcconfig",
21342 ".auto-changelog",
21343 ".c8rc",
21344 ".htmlhintrc",
21345 ".imgbotconfig",
21346 ".nycrc",
21347 ".tern-config",
21348 ".tern-project",
21349 ".watchmanconfig",
21350 "Pipfile.lock",
21351 "composer.lock",
21352 "flake.lock",
21353 "mcmod.info",
21354 ".babelrc",
21355 ".jscsrc",
21356 ".jshintrc",
21357 ".jslintrc",
21358 ".swcrc"
21359 ],
21360 "parsers": [
21361 "json"
21362 ],
21363 "vscodeLanguageIds": [
21364 "json"
21365 ]
21366 },
21367 {
21368 "linguistLanguageId": 423,
21369 "name": "JSON with Comments",
21370 "type": "data",
21371 "color": "#292929",
21372 "group": "JSON",
21373 "tmScope": "source.js",
21374 "aceMode": "javascript",
21375 "codemirrorMode": "javascript",
21376 "codemirrorMimeType": "text/javascript",
21377 "aliases": [
21378 "jsonc"
21379 ],
21380 "extensions": [
21381 ".jsonc",
21382 ".code-snippets",
21383 ".code-workspace",
21384 ".sublime-build",
21385 ".sublime-commands",
21386 ".sublime-completions",
21387 ".sublime-keymap",
21388 ".sublime-macro",
21389 ".sublime-menu",
21390 ".sublime-mousemap",
21391 ".sublime-project",
21392 ".sublime-settings",
21393 ".sublime-theme",
21394 ".sublime-workspace",
21395 ".sublime_metrics",
21396 ".sublime_session"
21397 ],
21398 "filenames": [],
21399 "parsers": [
21400 "jsonc"
21401 ],
21402 "vscodeLanguageIds": [
21403 "jsonc"
21404 ]
21405 },
21406 {
21407 "linguistLanguageId": 175,
21408 "name": "JSON5",
21409 "type": "data",
21410 "color": "#267CB9",
21411 "extensions": [
21412 ".json5"
21413 ],
21414 "tmScope": "source.js",
21415 "aceMode": "javascript",
21416 "codemirrorMode": "javascript",
21417 "codemirrorMimeType": "application/json",
21418 "parsers": [
21419 "json5"
21420 ],
21421 "vscodeLanguageIds": [
21422 "json5"
21423 ]
21424 }
21425];
21426
21427// src/language-markdown/languages.evaluate.js
21428var languages_evaluate_default7 = [
21429 {
21430 "linguistLanguageId": 222,
21431 "name": "Markdown",
21432 "type": "prose",
21433 "color": "#083fa1",
21434 "aliases": [
21435 "md",
21436 "pandoc"
21437 ],
21438 "aceMode": "markdown",
21439 "codemirrorMode": "gfm",
21440 "codemirrorMimeType": "text/x-gfm",
21441 "wrap": true,
21442 "extensions": [
21443 ".md",
21444 ".livemd",
21445 ".markdown",
21446 ".mdown",
21447 ".mdwn",
21448 ".mkd",
21449 ".mkdn",
21450 ".mkdown",
21451 ".ronn",
21452 ".scd",
21453 ".workbook"
21454 ],
21455 "filenames": [
21456 "contents.lr",
21457 "README"
21458 ],
21459 "tmScope": "text.md",
21460 "parsers": [
21461 "markdown"
21462 ],
21463 "vscodeLanguageIds": [
21464 "markdown"
21465 ]
21466 },
21467 {
21468 "linguistLanguageId": 222,
21469 "name": "MDX",
21470 "type": "prose",
21471 "color": "#083fa1",
21472 "aliases": [
21473 "md",
21474 "pandoc"
21475 ],
21476 "aceMode": "markdown",
21477 "codemirrorMode": "gfm",
21478 "codemirrorMimeType": "text/x-gfm",
21479 "wrap": true,
21480 "extensions": [
21481 ".mdx"
21482 ],
21483 "filenames": [],
21484 "tmScope": "text.md",
21485 "parsers": [
21486 "mdx"
21487 ],
21488 "vscodeLanguageIds": [
21489 "mdx"
21490 ]
21491 }
21492];
21493
21494// src/language-markdown/options.js
21495var options5 = {
21496 proseWrap: common_options_evaluate_default.proseWrap,
21497 singleQuote: common_options_evaluate_default.singleQuote
21498};
21499var options_default5 = options5;
21500
21501// src/language-yaml/languages.evaluate.js
21502var languages_evaluate_default8 = [
21503 {
21504 "linguistLanguageId": 407,
21505 "name": "YAML",
21506 "type": "data",
21507 "color": "#cb171e",
21508 "tmScope": "source.yaml",
21509 "aliases": [
21510 "yml"
21511 ],
21512 "extensions": [
21513 ".yml",
21514 ".mir",
21515 ".reek",
21516 ".rviz",
21517 ".sublime-syntax",
21518 ".syntax",
21519 ".yaml",
21520 ".yaml-tmlanguage",
21521 ".yaml.sed",
21522 ".yml.mysql"
21523 ],
21524 "filenames": [
21525 ".clang-format",
21526 ".clang-tidy",
21527 ".gemrc",
21528 "CITATION.cff",
21529 "glide.lock",
21530 ".prettierrc",
21531 ".stylelintrc",
21532 ".lintstagedrc"
21533 ],
21534 "aceMode": "yaml",
21535 "codemirrorMode": "yaml",
21536 "codemirrorMimeType": "text/x-yaml",
21537 "parsers": [
21538 "yaml"
21539 ],
21540 "vscodeLanguageIds": [
21541 "yaml",
21542 "ansible",
21543 "home-assistant"
21544 ]
21545 }
21546];
21547
21548// src/language-yaml/options.js
21549var options6 = {
21550 bracketSpacing: common_options_evaluate_default.bracketSpacing,
21551 singleQuote: common_options_evaluate_default.singleQuote,
21552 proseWrap: common_options_evaluate_default.proseWrap
21553};
21554var options_default6 = options6;
21555
21556// src/plugins/builtin-plugins-proxy.js
21557function createParsersAndPrinters(modules) {
21558 const parsers2 = /* @__PURE__ */ Object.create(null);
21559 const printers2 = /* @__PURE__ */ Object.create(null);
21560 for (const {
21561 importPlugin: importPlugin2,
21562 parsers: parserNames = [],
21563 printers: printerNames = []
21564 } of modules) {
21565 const loadPlugin2 = async () => {
21566 const plugin = await importPlugin2();
21567 Object.assign(parsers2, plugin.parsers);
21568 Object.assign(printers2, plugin.printers);
21569 return plugin;
21570 };
21571 for (const parserName of parserNames) {
21572 parsers2[parserName] = async () => (await loadPlugin2()).parsers[parserName];
21573 }
21574 for (const printerName of printerNames) {
21575 printers2[printerName] = async () => (await loadPlugin2()).printers[printerName];
21576 }
21577 }
21578 return { parsers: parsers2, printers: printers2 };
21579}
21580var options7 = {
21581 ...options_default,
21582 ...options_default2,
21583 ...options_default3,
21584 ...options_default4,
21585 ...options_default5,
21586 ...options_default6
21587};
21588var languages = [
21589 ...languages_evaluate_default,
21590 ...languages_evaluate_default2,
21591 ...languages_evaluate_default3,
21592 ...languages_evaluate_default4,
21593 ...languages_evaluate_default5,
21594 ...languages_evaluate_default6,
21595 ...languages_evaluate_default7,
21596 ...languages_evaluate_default8
21597];
21598var { parsers, printers } = createParsersAndPrinters([
21599 {
21600 importPlugin: () => import("./plugins/acorn.mjs"),
21601 parsers: ["acorn", "espree"]
21602 },
21603 {
21604 importPlugin: () => import("./plugins/angular.mjs"),
21605 parsers: [
21606 "__ng_action",
21607 "__ng_binding",
21608 "__ng_interpolation",
21609 "__ng_directive"
21610 ]
21611 },
21612 {
21613 importPlugin: () => import("./plugins/babel.mjs"),
21614 parsers: [
21615 "babel",
21616 "babel-flow",
21617 "babel-ts",
21618 "__js_expression",
21619 "__ts_expression",
21620 "__vue_expression",
21621 "__vue_ts_expression",
21622 "__vue_event_binding",
21623 "__vue_ts_event_binding",
21624 "__babel_estree",
21625 "json",
21626 "json5",
21627 "jsonc",
21628 "json-stringify"
21629 ]
21630 },
21631 {
21632 importPlugin: () => import("./plugins/estree.mjs"),
21633 printers: ["estree", "estree-json"]
21634 },
21635 {
21636 importPlugin: () => import("./plugins/flow.mjs"),
21637 parsers: ["flow"]
21638 },
21639 {
21640 importPlugin: () => import("./plugins/glimmer.mjs"),
21641 parsers: ["glimmer"],
21642 printers: ["glimmer"]
21643 },
21644 {
21645 importPlugin: () => import("./plugins/graphql.mjs"),
21646 parsers: ["graphql"],
21647 printers: ["graphql"]
21648 },
21649 {
21650 importPlugin: () => import("./plugins/html.mjs"),
21651 parsers: ["html", "angular", "vue", "lwc"],
21652 printers: ["html"]
21653 },
21654 {
21655 importPlugin: () => import("./plugins/markdown.mjs"),
21656 parsers: ["markdown", "mdx", "remark"],
21657 printers: ["mdast"]
21658 },
21659 {
21660 importPlugin: () => import("./plugins/meriyah.mjs"),
21661 parsers: ["meriyah"]
21662 },
21663 {
21664 importPlugin: () => import("./plugins/postcss.mjs"),
21665 parsers: ["css", "less", "scss"],
21666 printers: ["postcss"]
21667 },
21668 {
21669 importPlugin: () => import("./plugins/typescript.mjs"),
21670 parsers: ["typescript"]
21671 },
21672 {
21673 importPlugin: () => import("./plugins/yaml.mjs"),
21674 parsers: ["yaml"],
21675 printers: ["yaml"]
21676 }
21677]);
21678
21679// src/main/plugins/load-builtin-plugins.js
21680function loadBuiltinPlugins() {
21681 return [builtin_plugins_proxy_exports];
21682}
21683var load_builtin_plugins_default = loadBuiltinPlugins;
21684
21685// src/main/plugins/load-plugin.js
21686import path12 from "path";
21687import { pathToFileURL as pathToFileURL5 } from "url";
21688
21689// src/utils/import-from-directory.js
21690import path11 from "path";
21691function importFromDirectory(specifier, directory) {
21692 return import_from_file_default(specifier, path11.join(directory, "noop.js"));
21693}
21694var import_from_directory_default = importFromDirectory;
21695
21696// src/main/plugins/load-plugin.js
21697async function importPlugin(name, cwd) {
21698 if (path12.isAbsolute(name)) {
21699 return import(pathToFileURL5(name).href);
21700 }
21701 try {
21702 return await import(pathToFileURL5(path12.resolve(name)).href);
21703 } catch {
21704 return import_from_directory_default(name, cwd);
21705 }
21706}
21707async function loadPluginWithoutCache(plugin, cwd) {
21708 const module = await importPlugin(plugin, cwd);
21709 return { name: plugin, ...module.default ?? module };
21710}
21711var cache2 = /* @__PURE__ */ new Map();
21712function loadPlugin(plugin) {
21713 if (typeof plugin !== "string") {
21714 return plugin;
21715 }
21716 const cwd = process.cwd();
21717 const cacheKey = JSON.stringify({ name: plugin, cwd });
21718 if (!cache2.has(cacheKey)) {
21719 cache2.set(cacheKey, loadPluginWithoutCache(plugin, cwd));
21720 }
21721 return cache2.get(cacheKey);
21722}
21723function clearCache2() {
21724 cache2.clear();
21725}
21726
21727// src/main/plugins/load-plugins.js
21728function loadPlugins(plugins = []) {
21729 return Promise.all(plugins.map((plugin) => loadPlugin(plugin)));
21730}
21731var load_plugins_default = loadPlugins;
21732
21733// src/utils/object-omit.js
21734function omit(object, keys) {
21735 keys = new Set(keys);
21736 return Object.fromEntries(
21737 Object.entries(object).filter(([key2]) => !keys.has(key2))
21738 );
21739}
21740var object_omit_default = omit;
21741
21742// src/index.js
21743import * as doc from "./doc.mjs";
21744
21745// src/main/version.evaluate.cjs
21746var version_evaluate_default = "3.4.1";
21747
21748// src/utils/public.js
21749var public_exports = {};
21750__export(public_exports, {
21751 addDanglingComment: () => addDanglingComment,
21752 addLeadingComment: () => addLeadingComment,
21753 addTrailingComment: () => addTrailingComment,
21754 getAlignmentSize: () => get_alignment_size_default,
21755 getIndentSize: () => get_indent_size_default,
21756 getMaxContinuousCount: () => get_max_continuous_count_default,
21757 getNextNonSpaceNonCommentCharacter: () => get_next_non_space_non_comment_character_default,
21758 getNextNonSpaceNonCommentCharacterIndex: () => getNextNonSpaceNonCommentCharacterIndex2,
21759 getPreferredQuote: () => get_preferred_quote_default,
21760 getStringWidth: () => get_string_width_default,
21761 hasNewline: () => has_newline_default,
21762 hasNewlineInRange: () => has_newline_in_range_default,
21763 hasSpaces: () => has_spaces_default,
21764 isNextLineEmpty: () => isNextLineEmpty2,
21765 isNextLineEmptyAfterIndex: () => is_next_line_empty_default,
21766 isPreviousLineEmpty: () => isPreviousLineEmpty2,
21767 makeString: () => make_string_default,
21768 skip: () => skip,
21769 skipEverythingButNewLine: () => skipEverythingButNewLine,
21770 skipInlineComment: () => skip_inline_comment_default,
21771 skipNewline: () => skip_newline_default,
21772 skipSpaces: () => skipSpaces,
21773 skipToLineEnd: () => skipToLineEnd,
21774 skipTrailingComment: () => skip_trailing_comment_default,
21775 skipWhitespace: () => skipWhitespace
21776});
21777
21778// src/utils/skip-inline-comment.js
21779function skipInlineComment(text, startIndex) {
21780 if (startIndex === false) {
21781 return false;
21782 }
21783 if (text.charAt(startIndex) === "/" && text.charAt(startIndex + 1) === "*") {
21784 for (let i = startIndex + 2; i < text.length; ++i) {
21785 if (text.charAt(i) === "*" && text.charAt(i + 1) === "/") {
21786 return i + 2;
21787 }
21788 }
21789 }
21790 return startIndex;
21791}
21792var skip_inline_comment_default = skipInlineComment;
21793
21794// src/utils/skip-trailing-comment.js
21795function skipTrailingComment(text, startIndex) {
21796 if (startIndex === false) {
21797 return false;
21798 }
21799 if (text.charAt(startIndex) === "/" && text.charAt(startIndex + 1) === "/") {
21800 return skipEverythingButNewLine(text, startIndex);
21801 }
21802 return startIndex;
21803}
21804var skip_trailing_comment_default = skipTrailingComment;
21805
21806// src/utils/get-next-non-space-non-comment-character-index.js
21807function getNextNonSpaceNonCommentCharacterIndex(text, startIndex) {
21808 let oldIdx = null;
21809 let nextIdx = startIndex;
21810 while (nextIdx !== oldIdx) {
21811 oldIdx = nextIdx;
21812 nextIdx = skipSpaces(text, nextIdx);
21813 nextIdx = skip_inline_comment_default(text, nextIdx);
21814 nextIdx = skip_trailing_comment_default(text, nextIdx);
21815 nextIdx = skip_newline_default(text, nextIdx);
21816 }
21817 return nextIdx;
21818}
21819var get_next_non_space_non_comment_character_index_default = getNextNonSpaceNonCommentCharacterIndex;
21820
21821// src/utils/is-next-line-empty.js
21822function isNextLineEmpty(text, startIndex) {
21823 let oldIdx = null;
21824 let idx = startIndex;
21825 while (idx !== oldIdx) {
21826 oldIdx = idx;
21827 idx = skipToLineEnd(text, idx);
21828 idx = skip_inline_comment_default(text, idx);
21829 idx = skipSpaces(text, idx);
21830 }
21831 idx = skip_trailing_comment_default(text, idx);
21832 idx = skip_newline_default(text, idx);
21833 return idx !== false && has_newline_default(text, idx);
21834}
21835var is_next_line_empty_default = isNextLineEmpty;
21836
21837// src/utils/get-indent-size.js
21838function getIndentSize(value, tabWidth) {
21839 const lastNewlineIndex = value.lastIndexOf("\n");
21840 if (lastNewlineIndex === -1) {
21841 return 0;
21842 }
21843 return get_alignment_size_default(
21844 // All the leading whitespaces
21845 value.slice(lastNewlineIndex + 1).match(/^[\t ]*/u)[0],
21846 tabWidth
21847 );
21848}
21849var get_indent_size_default = getIndentSize;
21850
21851// node_modules/escape-string-regexp/index.js
21852function escapeStringRegexp(string) {
21853 if (typeof string !== "string") {
21854 throw new TypeError("Expected a string");
21855 }
21856 return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
21857}
21858
21859// src/utils/get-max-continuous-count.js
21860function getMaxContinuousCount(text, searchString) {
21861 const results = text.match(
21862 new RegExp(`(${escapeStringRegexp(searchString)})+`, "gu")
21863 );
21864 if (results === null) {
21865 return 0;
21866 }
21867 return results.reduce(
21868 (maxCount, result) => Math.max(maxCount, result.length / searchString.length),
21869 0
21870 );
21871}
21872var get_max_continuous_count_default = getMaxContinuousCount;
21873
21874// src/utils/get-next-non-space-non-comment-character.js
21875function getNextNonSpaceNonCommentCharacter(text, startIndex) {
21876 const index = get_next_non_space_non_comment_character_index_default(text, startIndex);
21877 return index === false ? "" : text.charAt(index);
21878}
21879var get_next_non_space_non_comment_character_default = getNextNonSpaceNonCommentCharacter;
21880
21881// src/utils/get-preferred-quote.js
21882var SINGLE_QUOTE = "'";
21883var DOUBLE_QUOTE = '"';
21884function getPreferredQuote(text, preferredQuoteOrPreferSingleQuote) {
21885 const preferred = preferredQuoteOrPreferSingleQuote === true || preferredQuoteOrPreferSingleQuote === SINGLE_QUOTE ? SINGLE_QUOTE : DOUBLE_QUOTE;
21886 const alternate = preferred === SINGLE_QUOTE ? DOUBLE_QUOTE : SINGLE_QUOTE;
21887 let preferredQuoteCount = 0;
21888 let alternateQuoteCount = 0;
21889 for (const character of text) {
21890 if (character === preferred) {
21891 preferredQuoteCount++;
21892 } else if (character === alternate) {
21893 alternateQuoteCount++;
21894 }
21895 }
21896 return preferredQuoteCount > alternateQuoteCount ? alternate : preferred;
21897}
21898var get_preferred_quote_default = getPreferredQuote;
21899
21900// src/utils/has-newline-in-range.js
21901function hasNewlineInRange(text, startIndex, endIndex) {
21902 for (let i = startIndex; i < endIndex; ++i) {
21903 if (text.charAt(i) === "\n") {
21904 return true;
21905 }
21906 }
21907 return false;
21908}
21909var has_newline_in_range_default = hasNewlineInRange;
21910
21911// src/utils/has-spaces.js
21912function hasSpaces(text, startIndex, options8 = {}) {
21913 const idx = skipSpaces(
21914 text,
21915 options8.backwards ? startIndex - 1 : startIndex,
21916 options8
21917 );
21918 return idx !== startIndex;
21919}
21920var has_spaces_default = hasSpaces;
21921
21922// src/utils/make-string.js
21923function makeString(rawText, enclosingQuote, unescapeUnnecessaryEscapes) {
21924 const otherQuote = enclosingQuote === '"' ? "'" : '"';
21925 const regex = /\\(.)|(["'])/gsu;
21926 const raw = string_replace_all_default(
21927 /* isOptionalObject */
21928 false,
21929 rawText,
21930 regex,
21931 (match, escaped, quote) => {
21932 if (escaped === otherQuote) {
21933 return escaped;
21934 }
21935 if (quote === enclosingQuote) {
21936 return "\\" + quote;
21937 }
21938 if (quote) {
21939 return quote;
21940 }
21941 return unescapeUnnecessaryEscapes && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(escaped) ? escaped : "\\" + escaped;
21942 }
21943 );
21944 return enclosingQuote + raw + enclosingQuote;
21945}
21946var make_string_default = makeString;
21947
21948// src/utils/public.js
21949function legacyGetNextNonSpaceNonCommentCharacterIndex(text, node, locEnd) {
21950 return get_next_non_space_non_comment_character_index_default(
21951 text,
21952 locEnd(node)
21953 );
21954}
21955function getNextNonSpaceNonCommentCharacterIndex2(text, startIndex) {
21956 return arguments.length === 2 || typeof startIndex === "number" ? get_next_non_space_non_comment_character_index_default(text, startIndex) : (
21957 // @ts-expect-error -- expected
21958 // eslint-disable-next-line prefer-rest-params
21959 legacyGetNextNonSpaceNonCommentCharacterIndex(...arguments)
21960 );
21961}
21962function legacyIsPreviousLineEmpty(text, node, locStart) {
21963 return is_previous_line_empty_default(text, locStart(node));
21964}
21965function isPreviousLineEmpty2(text, startIndex) {
21966 return arguments.length === 2 || typeof startIndex === "number" ? is_previous_line_empty_default(text, startIndex) : (
21967 // @ts-expect-error -- expected
21968 // eslint-disable-next-line prefer-rest-params
21969 legacyIsPreviousLineEmpty(...arguments)
21970 );
21971}
21972function legacyIsNextLineEmpty(text, node, locEnd) {
21973 return is_next_line_empty_default(text, locEnd(node));
21974}
21975function isNextLineEmpty2(text, startIndex) {
21976 return arguments.length === 2 || typeof startIndex === "number" ? is_next_line_empty_default(text, startIndex) : (
21977 // @ts-expect-error -- expected
21978 // eslint-disable-next-line prefer-rest-params
21979 legacyIsNextLineEmpty(...arguments)
21980 );
21981}
21982
21983// src/index.js
21984function withPlugins(fn, optionsArgumentIndex = 1) {
21985 return async (...args) => {
21986 const options8 = args[optionsArgumentIndex] ?? {};
21987 const { plugins = [] } = options8;
21988 args[optionsArgumentIndex] = {
21989 ...options8,
21990 plugins: (await Promise.all([
21991 load_builtin_plugins_default(),
21992 // TODO: standalone version allow `plugins` to be `prettierPlugins` which is an object, should allow that too
21993 load_plugins_default(plugins)
21994 ])).flat()
21995 };
21996 return fn(...args);
21997 };
21998}
21999var formatWithCursor2 = withPlugins(formatWithCursor);
22000async function format2(text, options8) {
22001 const { formatted } = await formatWithCursor2(text, {
22002 ...options8,
22003 cursorOffset: -1
22004 });
22005 return formatted;
22006}
22007async function check(text, options8) {
22008 return await format2(text, options8) === text;
22009}
22010async function clearCache3() {
22011 clearCache();
22012 clearCache2();
22013}
22014var getFileInfo2 = withPlugins(get_file_info_default);
22015var getSupportInfo2 = withPlugins(getSupportInfo, 0);
22016var sharedWithCli = {
22017 errors: errors_exports,
22018 optionCategories: option_categories_exports,
22019 createIsIgnoredFunction,
22020 formatOptionsHiddenDefaults,
22021 normalizeOptions: normalize_options_default,
22022 getSupportInfoWithoutPlugins: getSupportInfo,
22023 normalizeOptionSettings,
22024 vnopts: {
22025 ChoiceSchema,
22026 apiDescriptor
22027 },
22028 fastGlob: import_fast_glob.default,
22029 createTwoFilesPatch,
22030 utils: {
22031 omit: object_omit_default
22032 },
22033 mockable: mockable_default
22034};
22035var debugApis = {
22036 parse: withPlugins(parse6),
22037 formatAST: withPlugins(formatAst),
22038 formatDoc: withPlugins(formatDoc),
22039 printToDoc: withPlugins(printToDoc),
22040 printDocToString: withPlugins(printDocToString2),
22041 mockable: mockable_default
22042};
22043
22044// with-default-export:src/index.js
22045var src_default = src_exports;
22046export {
22047 debugApis as __debug,
22048 sharedWithCli as __internal,
22049 check,
22050 clearCache3 as clearConfigCache,
22051 src_default as default,
22052 doc,
22053 format2 as format,
22054 formatWithCursor2 as formatWithCursor,
22055 getFileInfo2 as getFileInfo,
22056 getSupportInfo2 as getSupportInfo,
22057 resolveConfig,
22058 resolveConfigFile,
22059 public_exports as util,
22060 version_evaluate_default as version
22061};